Salome HOME
Update copyright
[modules/geom.git] / src / GEOMAlgo / GEOMAlgo_Gluer.hxx
1 // Copyright (C) 2007-2011  CEA/DEN, EDF R&D, OPEN CASCADE
2 //
3 // Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
4 // CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
5 //
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.
10 //
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.
15 //
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
19 //
20 // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
21 //
22
23 #ifndef _GEOMAlgo_Gluer_HeaderFile
24 #define _GEOMAlgo_Gluer_HeaderFile
25
26 #ifndef _Standard_HeaderFile
27 #include <Standard.hxx>
28 #endif
29 #ifndef _Standard_Macro_HeaderFile
30 #include <Standard_Macro.hxx>
31 #endif
32
33 #ifndef _Standard_Boolean_HeaderFile
34 #include <Standard_Boolean.hxx>
35 #endif
36 #ifndef _Standard_Real_HeaderFile
37 #include <Standard_Real.hxx>
38 #endif
39 #ifndef _TopTools_DataMapOfShapeListOfShape_HeaderFile
40 #include <TopTools_DataMapOfShapeListOfShape.hxx>
41 #endif
42 #ifndef _TopTools_DataMapOfShapeShape_HeaderFile
43 #include <TopTools_DataMapOfShapeShape.hxx>
44 #endif
45 #ifndef _Standard_Integer_HeaderFile
46 #include <Standard_Integer.hxx>
47 #endif
48 #ifndef _TopTools_ListOfShape_HeaderFile
49 #include <TopTools_ListOfShape.hxx>
50 #endif
51 #ifndef _GEOMAlgo_ShapeAlgo_HeaderFile
52 #include <GEOMAlgo_ShapeAlgo.hxx>
53 #endif
54 #ifndef _TopAbs_ShapeEnum_HeaderFile
55 #include <TopAbs_ShapeEnum.hxx>
56 #endif
57 class TopTools_ListOfShape;
58 class TopoDS_Shape;
59 class TopoDS_Edge;
60 class GEOMAlgo_PassKeyShape;
61 class TopoDS_Face;
62 class TopoDS_Vertex;
63 class TopTools_DataMapOfShapeListOfShape;
64 class TopTools_DataMapOfShapeShape;
65 class TopTools_MapOfShape;
66 class TopoDS_Compound;
67
68
69
70 class GEOMAlgo_Gluer  : public GEOMAlgo_ShapeAlgo {
71 public:
72
73   void* operator new(size_t,void* anAddress) 
74   {
75     return anAddress;
76   }
77   void* operator new(size_t size) 
78   {
79     return Standard::Allocate(size); 
80   }
81   void  operator delete(void *anAddress) 
82   {
83     if (anAddress) Standard::Free((Standard_Address&)anAddress); 
84   }
85
86   
87   Standard_EXPORT   GEOMAlgo_Gluer();
88 Standard_EXPORT virtual ~GEOMAlgo_Gluer();
89   
90   Standard_EXPORT     void SetCheckGeometry(const Standard_Boolean aFlag) ;
91   
92   Standard_EXPORT     Standard_Boolean CheckGeometry() const;
93   
94   Standard_EXPORT   virtual  void Perform() ;
95   
96   Standard_EXPORT     Standard_Integer AloneShapes() const;
97   
98   Standard_EXPORT    const TopTools_ListOfShape& Modified(const TopoDS_Shape& S) ;
99   
100   Standard_EXPORT    const TopTools_ListOfShape& Generated(const TopoDS_Shape& S) ;
101   
102   Standard_EXPORT     Standard_Boolean IsDeleted(const TopoDS_Shape& S) ;
103   
104   Standard_EXPORT    const TopTools_DataMapOfShapeListOfShape& Images() const;
105   
106   Standard_EXPORT    const TopTools_DataMapOfShapeShape& Origins() const;
107   
108   Standard_EXPORT     void MakeSubShapes(const TopoDS_Shape& aS,TopTools_MapOfShape& aM,TopoDS_Compound& aC) ;
109   
110   Standard_EXPORT     void SetKeepNonSolids(const Standard_Boolean bFlag) ;
111   
112   Standard_EXPORT     Standard_Boolean KeepNonSolids() const;
113
114
115
116
117
118 protected:
119
120   
121   Standard_EXPORT   virtual  void CheckData() ;
122   
123   Standard_EXPORT   virtual  void CheckResult() ;
124   
125   Standard_EXPORT     void MakeVertices() ;
126   
127   Standard_EXPORT     void MakeEdges() ;
128   
129   Standard_EXPORT     void MakeFaces() ;
130   
131   Standard_EXPORT     void MakeShapes(const TopAbs_ShapeEnum aType) ;
132   
133   Standard_EXPORT     void MakeShells() ;
134   
135   Standard_EXPORT     void MakeSolids() ;
136   
137   Standard_EXPORT     void InnerTolerance() ;
138   
139   Standard_EXPORT     void EdgePassKey(const TopoDS_Edge& aE,GEOMAlgo_PassKeyShape& aPK) ;
140   
141   Standard_EXPORT     void FacePassKey(const TopoDS_Face& aF,GEOMAlgo_PassKeyShape& aPK) ;
142   
143   Standard_EXPORT     void MakeVertex(const TopTools_ListOfShape& aLV,TopoDS_Vertex& aNewV) ;
144   
145   Standard_EXPORT     void MakeEdge(const TopoDS_Edge& aEdge,TopoDS_Edge& aNewEdge) ;
146   
147   Standard_EXPORT     void MakeFace(const TopoDS_Face& aFace,TopoDS_Face& aNewEdge) ;
148   
149   Standard_EXPORT     Standard_Boolean IsToReverse(const TopoDS_Face& aFR,const TopoDS_Face& aF) ;
150   
151   Standard_EXPORT     Standard_Boolean HasNewSubShape(const TopoDS_Shape& aS) const;
152
153
154 Standard_Boolean myCheckGeometry;
155 Standard_Real myTol;
156 TopTools_DataMapOfShapeListOfShape myImages;
157 TopTools_DataMapOfShapeShape myOrigins;
158 Standard_Integer myNbAlone;
159 TopTools_ListOfShape myGenerated;
160 Standard_Boolean myKeepNonSolids;
161
162
163 private:
164
165
166
167
168
169 };
170
171
172
173
174
175 // other Inline functions and methods (like "C++: function call" methods)
176
177
178 #endif