1 // File : GeomDS_Commands.hxx
3 // Author : Yves FRICAUD/Lucien PIGNOLONI
6 // Copyright : OPEN CASCADE
10 #ifndef _GEOMDS_Commands_HeaderFile
11 #define _GEOMDS_Commands_HeaderFile
13 #ifndef _TDF_Label_HeaderFile
14 #include <TDF_Label.hxx>
18 class TCollection_ExtendedString;
21 #ifndef _Standard_HeaderFile
22 #include <Standard.hxx>
24 #ifndef _Standard_Macro_HeaderFile
25 #include <Standard_Macro.hxx>
30 //============================================================================
31 // class : GEOMDS_Commands
33 //============================================================================
34 class GEOMDS_Commands {
38 inline void* operator new(size_t,void* anAddress)
42 inline void* operator new(size_t size)
44 return Standard::Allocate(size);
46 inline void operator delete(void *anAddress)
48 if (anAddress) Standard::Free((Standard_Address&)anAddress);
50 // inline void operator delete(void *anAddress, size_t size)
52 // if (anAddress) Standard::Free((Standard_Address&)anAddress,size);
57 // used for specific entities
58 enum GEOMDS_ConstructiveType { VECTOR, LINE, PLANE } ;
60 // Methods to add or create items in the data structure
61 Standard_EXPORT GEOMDS_Commands(const TDF_Label& Main);
62 Standard_EXPORT TDF_Label AddShape(const TopoDS_Shape& S,
63 const TCollection_ExtendedString& Name) ;
65 Standard_EXPORT TDF_Label Generated(const TopoDS_Shape& S,
66 const TCollection_ExtendedString& Name) ;
67 Standard_EXPORT TDF_Label Generated(const TopoDS_Shape& S1,
68 const TopoDS_Shape& S2,
69 const TCollection_ExtendedString& Name) ;
71 /* Shapes construction */
72 Standard_EXPORT TDF_Label AddIndependentShape(const TopoDS_Shape& S,
73 const TCollection_AsciiString& nameIOR) ;
74 Standard_EXPORT TDF_Label AddDependentShape(const TopoDS_Shape& S,
75 const TCollection_AsciiString& nameIOR,
76 const TDF_Label& mainLab) ;
77 Standard_EXPORT TDF_Label AddConstructiveElement(const TopoDS_Shape& S,
78 const TCollection_ExtendedString& nameIOR,
79 const GEOMDS_ConstructiveType& aType);
81 Standard_EXPORT Standard_Boolean AddIORNameAttribute(const TDF_Label& aLabel,
82 const TCollection_ExtendedString& nameIOR) ;
86 Standard_EXPORT Standard_Boolean IsConstructiveElement(const TDF_Label& aLabel) ;
88 Standard_EXPORT Standard_Boolean IsConstructiveElement(const TDF_Label& aLabel,
89 TopoDS_Shape& returnTopo,
90 GEOMDS_ConstructiveType& returnType) ;
92 Standard_EXPORT Standard_Boolean GetShape(const TDF_Label& aLabel,
93 TopoDS_Shape& returnTopo) ;
95 Standard_EXPORT Standard_Boolean IsDependentShape(const TDF_Label& aLabel) ;
97 Standard_EXPORT Standard_Boolean GetMainShapeLabel(const TDF_Label& aLabel,
98 TDF_Label& returnMainLabel) ;
100 Standard_EXPORT Standard_Boolean ClearAllIOR(const TDF_Label& aLabel) ;
102 Standard_EXPORT Standard_Boolean HasIOR(const TDF_Label& aLabel) ;
104 Standard_EXPORT Standard_Boolean ReturnNameIOR(const TDF_Label& aLabel,
105 TCollection_ExtendedString& returnNameIOR) ;
127 // other inline functions and methods (like "C++: function call" methods)