1 // GEOM GEOMDS : implementation of Geometry component data structure and Geometry documents management
3 // Copyright (C) 2003 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
4 // CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
6 // This library is free software; you can redistribute it and/or
7 // modify it under the terms of the GNU Lesser General Public
8 // License as published by the Free Software Foundation; either
9 // version 2.1 of the License.
11 // This library is distributed in the hope that it will be useful,
12 // but WITHOUT ANY WARRANTY; without even the implied warranty of
13 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 // Lesser General Public License for more details.
16 // You should have received a copy of the GNU Lesser General Public
17 // License along with this library; if not, write to the Free Software
18 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
20 // See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org
24 // File : GeomDS_Commands.hxx
25 // Author : Yves FRICAUD/Lucien PIGNOLONI
29 #ifndef _GEOMDS_Commands_HeaderFile
30 #define _GEOMDS_Commands_HeaderFile
32 #ifndef _TDF_Label_HeaderFile
33 #include <TDF_Label.hxx>
37 class TCollection_ExtendedString;
40 #ifndef _Standard_HeaderFile
41 #include <Standard.hxx>
43 #ifndef _Standard_Macro_HeaderFile
44 #include <Standard_Macro.hxx>
49 //============================================================================
50 // class : GEOMDS_Commands
52 //============================================================================
53 class GEOMDS_Commands {
57 inline void* operator new(size_t,void* anAddress)
61 inline void* operator new(size_t size)
63 return Standard::Allocate(size);
65 inline void operator delete(void *anAddress)
67 if (anAddress) Standard::Free((Standard_Address&)anAddress);
69 // inline void operator delete(void *anAddress, size_t size)
71 // if (anAddress) Standard::Free((Standard_Address&)anAddress,size);
76 // used for specific entities
77 enum GEOMDS_ConstructiveType { VECTOR, LINE, PLANE } ;
79 // Methods to add or create items in the data structure
80 Standard_EXPORT GEOMDS_Commands(const TDF_Label& Main);
81 Standard_EXPORT TDF_Label AddShape(const TopoDS_Shape& S,
82 const TCollection_ExtendedString& Name) ;
84 Standard_EXPORT TDF_Label Generated(const TopoDS_Shape& S,
85 const TCollection_ExtendedString& Name) ;
86 Standard_EXPORT TDF_Label Generated(const TopoDS_Shape& S1,
87 const TopoDS_Shape& S2,
88 const TCollection_ExtendedString& Name) ;
90 /* Shapes construction */
91 Standard_EXPORT TDF_Label AddIndependentShape(const TopoDS_Shape& S,
92 const TCollection_AsciiString& nameIOR) ;
93 Standard_EXPORT TDF_Label AddDependentShape(const TopoDS_Shape& S,
94 const TCollection_AsciiString& nameIOR,
95 const TDF_Label& mainLab) ;
96 Standard_EXPORT TDF_Label AddConstructiveElement(const TopoDS_Shape& S,
97 const TCollection_ExtendedString& nameIOR,
98 const GEOMDS_ConstructiveType& aType);
100 Standard_EXPORT Standard_Boolean AddIORNameAttribute(const TDF_Label& aLabel,
101 const TCollection_ExtendedString& nameIOR) ;
105 Standard_EXPORT Standard_Boolean IsConstructiveElement(const TDF_Label& aLabel) ;
107 Standard_EXPORT Standard_Boolean IsConstructiveElement(const TDF_Label& aLabel,
108 TopoDS_Shape& returnTopo,
109 GEOMDS_ConstructiveType& returnType) ;
111 Standard_EXPORT Standard_Boolean GetShape(const TDF_Label& aLabel,
112 TopoDS_Shape& returnTopo) ;
114 Standard_EXPORT Standard_Boolean IsDependentShape(const TDF_Label& aLabel) ;
116 Standard_EXPORT Standard_Boolean GetMainShapeLabel(const TDF_Label& aLabel,
117 TDF_Label& returnMainLabel) ;
119 Standard_EXPORT Standard_Boolean ClearAllIOR(const TDF_Label& aLabel) ;
121 Standard_EXPORT Standard_Boolean HasIOR(const TDF_Label& aLabel) ;
123 Standard_EXPORT Standard_Boolean ReturnNameIOR(const TDF_Label& aLabel,
124 TCollection_ExtendedString& returnNameIOR) ;
146 // other inline functions and methods (like "C++: function call" methods)