]> SALOME platform Git repositories - modules/geom.git/blob - src/GEOMDS/GEOMDS_Commands.hxx
Salome HOME
NRI : First integration.
[modules/geom.git] / src / GEOMDS / GEOMDS_Commands.hxx
1 //  File      : GeomDS_Commands.hxx
2 //  Created   :
3 //  Author    : Yves FRICAUD/Lucien PIGNOLONI
4 //  Project   : SALOME
5 //  Module    : GEOM
6 //  Copyright : OPEN CASCADE
7 //  $Header$
8
9
10 #ifndef _GEOMDS_Commands_HeaderFile
11 #define _GEOMDS_Commands_HeaderFile
12
13 #ifndef _TDF_Label_HeaderFile
14 #include <TDF_Label.hxx>
15 #endif
16 class TDF_Label;
17 class TopoDS_Shape;
18 class TCollection_ExtendedString;
19
20
21 #ifndef _Standard_HeaderFile
22 #include <Standard.hxx>
23 #endif
24 #ifndef _Standard_Macro_HeaderFile
25 #include <Standard_Macro.hxx>
26 #endif
27
28
29
30 //============================================================================
31 // class    : GEOMDS_Commands
32 // purpose  :
33 //============================================================================
34 class GEOMDS_Commands  {
35   
36 public:
37   
38   inline void* operator new(size_t,void* anAddress) 
39       {
40         return anAddress;
41       }
42   inline void* operator new(size_t size) 
43   { 
44     return Standard::Allocate(size); 
45   }
46   inline void  operator delete(void *anAddress) 
47   { 
48         if (anAddress) Standard::Free((Standard_Address&)anAddress); 
49   }
50   //    inline void  operator delete(void *anAddress, size_t size) 
51   //      { 
52   //        if (anAddress) Standard::Free((Standard_Address&)anAddress,size); 
53   //      }
54   // Methods PUBLIC
55   // 
56
57   // used for specific entities
58   enum GEOMDS_ConstructiveType { VECTOR, LINE, PLANE } ;
59   
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) ;
64
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) ;
70
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);
80
81   Standard_EXPORT Standard_Boolean AddIORNameAttribute(const TDF_Label& aLabel,
82                                                        const TCollection_ExtendedString& nameIOR) ;
83
84   /* Shapes query */
85
86   Standard_EXPORT Standard_Boolean IsConstructiveElement(const TDF_Label& aLabel) ;
87
88   Standard_EXPORT Standard_Boolean IsConstructiveElement(const TDF_Label& aLabel,
89                                                          TopoDS_Shape& returnTopo,
90                                                          GEOMDS_ConstructiveType& returnType) ;
91
92   Standard_EXPORT Standard_Boolean GetShape(const TDF_Label& aLabel,
93                                             TopoDS_Shape& returnTopo) ;
94
95   Standard_EXPORT Standard_Boolean IsDependentShape(const TDF_Label& aLabel) ;
96
97   Standard_EXPORT Standard_Boolean GetMainShapeLabel(const TDF_Label& aLabel,
98                                                      TDF_Label& returnMainLabel) ;
99
100   Standard_EXPORT Standard_Boolean ClearAllIOR(const TDF_Label& aLabel) ;
101
102   Standard_EXPORT Standard_Boolean HasIOR(const TDF_Label& aLabel) ;
103
104   Standard_EXPORT Standard_Boolean ReturnNameIOR(const TDF_Label& aLabel,
105                                                  TCollection_ExtendedString& returnNameIOR) ;
106   
107 protected:
108   
109   // Methods PROTECTED
110   // 
111
112   // Fields PROTECTED
113   //
114   
115 private: 
116   
117   // Methods PRIVATE
118   // 
119   
120   // Fields PRIVATE
121   //
122   
123   TDF_Label myLab;
124   
125 };
126
127 // other inline functions and methods (like "C++: function call" methods)
128 //
129
130
131 #endif