Salome HOME
64aa244e44d66ae4d6333a9292087621d23c3310
[modules/geom.git] / src / NMTAlgo / NMTAlgo_Splitter.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 #ifndef _NMTAlgo_Splitter_HeaderFile
23 #define _NMTAlgo_Splitter_HeaderFile
24
25 #ifndef _TopAbs_ShapeEnum_HeaderFile
26 #include <TopAbs_ShapeEnum.hxx>
27 #endif
28 #ifndef _BRep_Builder_HeaderFile
29 #include <BRep_Builder.hxx>
30 #endif
31 #ifndef _TopTools_ListOfShape_HeaderFile
32 #include <TopTools_ListOfShape.hxx>
33 #endif
34 #ifndef _TopTools_MapOfShape_HeaderFile
35 #include <TopTools_MapOfShape.hxx>
36 #endif
37 #ifndef _TopTools_DataMapOfShapeShape_HeaderFile
38 #include <TopTools_DataMapOfShapeShape.hxx>
39 #endif
40 #ifndef _BRepAlgo_Image_HeaderFile
41 #include <BRepAlgo_Image.hxx>
42 #endif
43 #ifndef _TopTools_MapOfOrientedShape_HeaderFile
44 #include <TopTools_MapOfOrientedShape.hxx>
45 #endif
46 #ifndef _TopTools_DataMapOfShapeListOfShape_HeaderFile
47 #include <TopTools_DataMapOfShapeListOfShape.hxx>
48 #endif
49 #ifndef _NMTAlgo_Builder_HeaderFile
50 #include <NMTAlgo_Builder.hxx>
51 #endif
52 #ifndef _Standard_Boolean_HeaderFile
53 #include <Standard_Boolean.hxx>
54 #endif
55 class TopoDS_Shape;
56 class NMTTools_DSFiller;
57 class TopTools_ListOfShape;
58
59
60 #ifndef _Standard_HeaderFile
61 #include <Standard.hxx>
62 #endif
63 #ifndef _Standard_Macro_HeaderFile
64 #include <Standard_Macro.hxx>
65 #endif
66
67 class NMTAlgo_Splitter  : public NMTAlgo_Builder {
68
69 public:
70
71     void* operator new(size_t,void* anAddress) 
72       {
73         return anAddress;
74       }
75     void* operator new(size_t size) 
76       { 
77         return Standard::Allocate(size); 
78       }
79     void  operator delete(void *anAddress) 
80       { 
81         if (anAddress) Standard::Free((Standard_Address&)anAddress); 
82       }
83  // Methods PUBLIC
84  // 
85 Standard_EXPORT NMTAlgo_Splitter();
86 Standard_EXPORT virtual ~NMTAlgo_Splitter();
87 Standard_EXPORT virtual  void AddShape(const TopoDS_Shape& S) ;
88 Standard_EXPORT virtual  void AddTool(const TopoDS_Shape& S) ;
89 Standard_EXPORT virtual  void Compute() ;
90 Standard_EXPORT virtual  void Build(const TopAbs_ShapeEnum aLimit = TopAbs_SHAPE) ;
91 Standard_EXPORT virtual  void ComputeWithFiller(const NMTTools_DSFiller& aDSF) ;
92 Standard_EXPORT   void KeepShapesInside(const TopoDS_Shape& S) ;
93 Standard_EXPORT   void RemoveShapesInside(const TopoDS_Shape& S) ;
94 Standard_EXPORT  const TopTools_ListOfShape& Modified(const TopoDS_Shape& S) ;
95 Standard_EXPORT  const TopTools_ListOfShape& Generated(const TopoDS_Shape& S) ;
96 Standard_EXPORT   Standard_Boolean IsDeleted(const TopoDS_Shape& S) ;
97 Standard_EXPORT virtual  void Clear() ;
98 Standard_EXPORT  const TopTools_ListOfShape& SourceShapes() const;
99
100
101
102
103
104 protected:
105
106  // Methods PROTECTED
107  // 
108 Standard_EXPORT   void FillResult() ;
109 Standard_EXPORT   void FillImageShape() ;
110 Standard_EXPORT   void SplittedFaces() ;
111 Standard_EXPORT   void SplittedWires() ;
112 Standard_EXPORT   void SplitsAndSections() ;
113 Standard_EXPORT   void ShellsAndSolids() ;
114 Standard_EXPORT   void MakeShells(const TopoDS_Shape& aS,TopTools_ListOfShape& aLNS) ;
115 Standard_EXPORT   void MakeSolids(const TopoDS_Shape& Solid,TopTools_ListOfShape& Shells) ;
116 Standard_EXPORT   TopoDS_Shape FindFacesInside(const TopoDS_Shape& S,const Standard_Boolean CheckClosed = Standard_False,const Standard_Boolean All = Standard_False) ;
117 Standard_EXPORT static  Standard_Boolean IsInside(const TopoDS_Shape& S1,const TopoDS_Shape& S2) ;
118 Standard_EXPORT   TopoDS_Shape GetOriginalShape(const TopoDS_Shape& aShape) const;
119 Standard_EXPORT   void FindImage(const TopoDS_Shape& aS,TopTools_ListOfShape& aLIms) ;
120
121
122  // Fields PROTECTED
123  //
124 TopAbs_ShapeEnum myDoneStep;
125 BRep_Builder myBuilder;
126 TopTools_ListOfShape myListShapes;
127 TopTools_MapOfShape myMapFaces;
128 TopTools_MapOfShape myMapTools;
129 TopTools_MapOfShape myEqualEdges;
130 TopTools_MapOfShape myNewSection;
131 TopTools_MapOfShape myClosedShapes;
132 TopTools_MapOfShape myWrappingSolid;
133 TopTools_DataMapOfShapeShape myFaceShapeMap;
134 TopTools_DataMapOfShapeShape myInternalFaces;
135 TopTools_DataMapOfShapeShape myIntNotClFaces;
136 BRepAlgo_Image myImageShape;
137 TopTools_MapOfOrientedShape myAddedFacesMap;
138 TopTools_ListOfShape mySourceShapes;
139 TopAbs_ShapeEnum myLimit;
140 TopTools_MapOfShape myToolShapes;
141 TopTools_MapOfShape myObjShapes;
142 TopTools_DataMapOfShapeShape myMapSIFC;
143 TopTools_ListOfShape myGenerated;
144 TopTools_DataMapOfShapeListOfShape myModifiedFaces;
145
146
147 private: 
148
149  // Methods PRIVATE
150  // 
151
152
153  // Fields PRIVATE
154  //
155
156
157 };
158
159
160
161
162
163 // other Inline functions and methods (like "C++: function call" methods)
164 //
165
166
167 #endif