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