Salome HOME
0020660: EDF 1238 GEOM: Missing equivalent of 2nd contructor of LCS in TUI
[modules/geom.git] / src / PARTITION / Partition_Spliter.hxx
1 //  Copyright (C) 2007-2008  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 //  GEOM PARTITION : partition algorithm
23 //  File   : Partition_Spliter.hxx
24 //  Module : GEOM
25 //
26 #ifndef _Partition_Spliter_HeaderFile
27 #define _Partition_Spliter_HeaderFile
28
29 #ifndef _TopAbs_ShapeEnum_HeaderFile
30 #include <TopAbs_ShapeEnum.hxx>
31 #endif
32 #ifndef _TopoDS_Compound_HeaderFile
33 #include <TopoDS_Compound.hxx>
34 #endif
35 #ifndef _BRep_Builder_HeaderFile
36 #include <BRep_Builder.hxx>
37 #endif
38 #ifndef _TopTools_ListOfShape_HeaderFile
39 #include <TopTools_ListOfShape.hxx>
40 #endif
41 #ifndef _TopTools_MapOfShape_HeaderFile
42 #include <TopTools_MapOfShape.hxx>
43 #endif
44 #ifndef _TopTools_DataMapOfShapeShape_HeaderFile
45 #include <TopTools_DataMapOfShapeShape.hxx>
46 #endif
47 #ifndef _Handle_BRepAlgo_AsDes_HeaderFile
48 #include <Handle_BRepAlgo_AsDes.hxx>
49 #endif
50 #ifndef _BRepAlgo_Image_HeaderFile
51 #include <BRepAlgo_Image.hxx>
52 #endif
53 #ifndef _Partition_Inter3d_HeaderFile
54 #include "Partition_Inter3d.hxx"
55 #endif
56 #ifndef _TopTools_MapOfOrientedShape_HeaderFile
57 #include <TopTools_MapOfOrientedShape.hxx>
58 #endif
59 #ifndef _Standard_Boolean_HeaderFile
60 #include <Standard_Boolean.hxx>
61 #endif
62 class BRepAlgo_AsDes;
63 class TopoDS_Shape;
64 class TopTools_ListOfShape;
65 class TopoDS_Edge;
66
67
68 #ifndef _Standard_HeaderFile
69 #include <Standard.hxx>
70 #endif
71 #ifndef _Standard_Macro_HeaderFile
72 #include <Standard_Macro.hxx>
73 #endif
74
75 class Partition_Spliter  {
76
77 public:
78
79     void* operator new(size_t,void* anAddress) 
80       {
81         return anAddress;
82       }
83     void* operator new(size_t size) 
84       { 
85         return Standard::Allocate(size); 
86       }
87     void  operator delete(void *anAddress) 
88       { 
89         if (anAddress) Standard::Free((Standard_Address&)anAddress); 
90       }
91  // Methods PUBLIC
92  // 
93 Standard_EXPORT Partition_Spliter();
94 Standard_EXPORT   void AddShape(const TopoDS_Shape& S) ;
95 Standard_EXPORT   void AddTool(const TopoDS_Shape& S) ;
96 Standard_EXPORT   void Compute(const TopAbs_ShapeEnum Limit = TopAbs_SHAPE) ;
97 Standard_EXPORT   void KeepShapesInside(const TopoDS_Shape& S) ;
98 Standard_EXPORT   void RemoveShapesInside(const TopoDS_Shape& S) ;
99 Standard_EXPORT   TopoDS_Shape Shape() const;
100 Standard_EXPORT   void Clear() ;
101
102
103
104
105
106 protected:
107
108  // Methods PROTECTED
109  // 
110
111
112  // Fields PROTECTED
113  //
114
115
116 private: 
117
118  // Methods PRIVATE
119  // 
120 Standard_EXPORT   void MakeSolids(const TopoDS_Shape& Solid,TopTools_ListOfShape& Shells) ;
121 Standard_EXPORT   void MakeShells(const TopoDS_Shape& S,TopTools_ListOfShape& NS) ;
122 Standard_EXPORT   TopoDS_Shape MakeFaces(const TopoDS_Shape& S) ;
123 Standard_EXPORT   void MakeEdges(const TopoDS_Edge& E,const TopTools_ListOfShape& VOnE,TopTools_ListOfShape& NE) const;
124 Standard_EXPORT   TopoDS_Shape FindFacesInside(const TopoDS_Shape& S,const Standard_Boolean CheckClosed = Standard_False,const Standard_Boolean All = Standard_False) ;
125 Standard_EXPORT   Standard_Boolean CheckTool(const TopoDS_Shape& S) ;
126 Standard_EXPORT   void MergeEqualEdges(const TopTools_ListOfShape& LE) ;
127 Standard_EXPORT static  Standard_Boolean IsInside(const TopoDS_Shape& S1,const TopoDS_Shape& S2) ;
128 Standard_EXPORT   TopoDS_Shape GetOriginalShape(const TopoDS_Shape& aShape) const;
129 Standard_EXPORT   void FindToolsToReconstruct() ;
130
131
132  // Fields PRIVATE
133  //
134 TopAbs_ShapeEnum myDoneStep;
135 TopoDS_Compound myShape;
136 BRep_Builder myBuilder;
137 TopTools_ListOfShape myListShapes;
138 TopTools_MapOfShape myMapFaces;
139 TopTools_MapOfShape myMapTools;
140 TopTools_MapOfShape myEqualEdges;
141 TopTools_MapOfShape myNewSection;
142 TopTools_MapOfShape myClosedShapes;
143 TopTools_MapOfShape mySharedFaces;
144 TopTools_MapOfShape myWrappingSolid;
145 TopTools_DataMapOfShapeShape myFaceShapeMap;
146 TopTools_DataMapOfShapeShape myInternalFaces;
147 TopTools_DataMapOfShapeShape myIntNotClFaces;
148 Handle_BRepAlgo_AsDes myAsDes;
149 BRepAlgo_Image myImagesFaces;
150 BRepAlgo_Image myImagesEdges;
151 BRepAlgo_Image myImageShape;
152 Partition_Inter3d myInter3d;
153 TopTools_MapOfOrientedShape myAddedFacesMap;
154
155
156 };
157
158
159
160
161
162 // other Inline functions and methods (like "C++: function call" methods)
163 //
164
165
166 #endif