Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2026-09-10 09:18:43

0001 // Created on: 1998-07-22
0002 // Created by: Christian CAILLET
0003 // Copyright (c) 1998-1999 Matra Datavision
0004 // Copyright (c) 1999-2014 OPEN CASCADE SAS
0005 //
0006 // This file is part of Open CASCADE Technology software library.
0007 //
0008 // This library is free software; you can redistribute it and/or modify it under
0009 // the terms of the GNU Lesser General Public License version 2.1 as published
0010 // by the Free Software Foundation, with special exception defined in the file
0011 // OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
0012 // distribution for complete text of the license and disclaimer of any warranty.
0013 //
0014 // Alternatively, this file may be used under the terms of Open CASCADE
0015 // commercial license or contractual agreement.
0016 
0017 #ifndef _XSControl_Vars_HeaderFile
0018 #define _XSControl_Vars_HeaderFile
0019 
0020 #include <Standard.hxx>
0021 #include <Standard_Type.hxx>
0022 
0023 #include <Standard_Transient.hxx>
0024 #include <NCollection_DataMap.hxx>
0025 #include <TCollection_AsciiString.hxx>
0026 class Geom_Geometry;
0027 class Geom2d_Curve;
0028 class Geom_Curve;
0029 class Geom_Surface;
0030 class gp_Pnt;
0031 class gp_Pnt2d;
0032 class TopoDS_Shape;
0033 
0034 class XSControl_Vars;
0035 DEFINE_STANDARD_HANDLE(XSControl_Vars, Standard_Transient)
0036 
0037 //! Defines a receptacle for externally defined variables, each
0038 //! one has a name
0039 //!
0040 //! I.E. a WorkSession for XSTEP is generally used inside a
0041 //! context, which brings variables, especially shapes and
0042 //! geometries. For instance DRAW or an application engine
0043 //!
0044 //! This class provides a common form for this. It also provides
0045 //! a default implementation (locally recorded variables in a
0046 //! dictionary), but which is aimed to be redefined
0047 class XSControl_Vars : public Standard_Transient
0048 {
0049 
0050 public:
0051   Standard_EXPORT XSControl_Vars();
0052 
0053   Standard_EXPORT virtual void Set(const Standard_CString            name,
0054                                    const Handle(Standard_Transient)& val);
0055 
0056   Standard_EXPORT virtual Handle(Standard_Transient) Get(Standard_CString& name) const;
0057 
0058   Standard_EXPORT virtual Handle(Geom_Geometry) GetGeom(Standard_CString& name) const;
0059 
0060   Standard_EXPORT virtual Handle(Geom2d_Curve) GetCurve2d(Standard_CString& name) const;
0061 
0062   Standard_EXPORT virtual Handle(Geom_Curve) GetCurve(Standard_CString& name) const;
0063 
0064   Standard_EXPORT virtual Handle(Geom_Surface) GetSurface(Standard_CString& name) const;
0065 
0066   Standard_EXPORT virtual void SetPoint(const Standard_CString name, const gp_Pnt& val);
0067 
0068   Standard_EXPORT virtual void SetPoint2d(const Standard_CString name, const gp_Pnt2d& val);
0069 
0070   Standard_EXPORT virtual Standard_Boolean GetPoint(Standard_CString& name, gp_Pnt& pnt) const;
0071 
0072   Standard_EXPORT virtual Standard_Boolean GetPoint2d(Standard_CString& name, gp_Pnt2d& pnt) const;
0073 
0074   Standard_EXPORT virtual void SetShape(const Standard_CString name, const TopoDS_Shape& val);
0075 
0076   Standard_EXPORT virtual TopoDS_Shape GetShape(Standard_CString& name) const;
0077 
0078   DEFINE_STANDARD_RTTIEXT(XSControl_Vars, Standard_Transient)
0079 
0080 protected:
0081 private:
0082   NCollection_DataMap<TCollection_AsciiString, Handle(Standard_Transient)> thevars;
0083 };
0084 
0085 #endif // _XSControl_Vars_HeaderFile