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