Salome HOME
NPAL19769: Null rotation do a translation (sometime).
[modules/geom.git] / src / NMTAlgo / NMTAlgo_Splitter.hxx
1 // Copyright (C) 2005  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
2 // CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
3 // 
4 // This library is free software; you can redistribute it and/or
5 // modify it under the terms of the GNU Lesser General Public
6 // License as published by the Free Software Foundation; either 
7 // version 2.1 of the License.
8 // 
9 // This library is distributed in the hope that it will be useful 
10 // but WITHOUT ANY WARRANTY; without even the implied warranty of 
11 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU 
12 // Lesser General Public License for more details.
13 //
14 // You should have received a copy of the GNU Lesser General Public  
15 // License along with this library; if not, write to the Free Software 
16 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
17 //
18 // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
19
20 #ifndef _NMTAlgo_Splitter_HeaderFile
21 #define _NMTAlgo_Splitter_HeaderFile
22
23 #ifndef _TopAbs_ShapeEnum_HeaderFile
24 #include <TopAbs_ShapeEnum.hxx>
25 #endif
26 #ifndef _BRep_Builder_HeaderFile
27 #include <BRep_Builder.hxx>
28 #endif
29 #ifndef _TopTools_ListOfShape_HeaderFile
30 #include <TopTools_ListOfShape.hxx>
31 #endif
32 #ifndef _TopTools_MapOfShape_HeaderFile
33 #include <TopTools_MapOfShape.hxx>
34 #endif
35 #ifndef _TopTools_DataMapOfShapeShape_HeaderFile
36 #include <TopTools_DataMapOfShapeShape.hxx>
37 #endif
38 #ifndef _BRepAlgo_Image_HeaderFile
39 #include <BRepAlgo_Image.hxx>
40 #endif
41 #ifndef _TopTools_MapOfOrientedShape_HeaderFile
42 #include <TopTools_MapOfOrientedShape.hxx>
43 #endif
44 #ifndef _TopTools_DataMapOfShapeListOfShape_HeaderFile
45 #include <TopTools_DataMapOfShapeListOfShape.hxx>
46 #endif
47 #ifndef _NMTAlgo_Builder_HeaderFile
48 #include <NMTAlgo_Builder.hxx>
49 #endif
50 #ifndef _Standard_Boolean_HeaderFile
51 #include <Standard_Boolean.hxx>
52 #endif
53 class TopoDS_Shape;
54 class NMTTools_DSFiller;
55 class TopTools_ListOfShape;
56
57
58 #ifndef _Standard_HeaderFile
59 #include <Standard.hxx>
60 #endif
61 #ifndef _Standard_Macro_HeaderFile
62 #include <Standard_Macro.hxx>
63 #endif
64
65 class NMTAlgo_Splitter  : public NMTAlgo_Builder {
66
67 public:
68
69     void* operator new(size_t,void* anAddress) 
70       {
71         return anAddress;
72       }
73     void* operator new(size_t size) 
74       { 
75         return Standard::Allocate(size); 
76       }
77     void  operator delete(void *anAddress) 
78       { 
79         if (anAddress) Standard::Free((Standard_Address&)anAddress); 
80       }
81  // Methods PUBLIC
82  // 
83 Standard_EXPORT NMTAlgo_Splitter();
84 Standard_EXPORT virtual ~NMTAlgo_Splitter();
85 Standard_EXPORT virtual  void AddShape(const TopoDS_Shape& S) ;
86 Standard_EXPORT virtual  void AddTool(const TopoDS_Shape& S) ;
87 Standard_EXPORT virtual  void Compute() ;
88 Standard_EXPORT virtual  void Build(const TopAbs_ShapeEnum aLimit = TopAbs_SHAPE) ;
89 Standard_EXPORT virtual  void ComputeWithFiller(const NMTTools_DSFiller& aDSF) ;
90 Standard_EXPORT   void KeepShapesInside(const TopoDS_Shape& S) ;
91 Standard_EXPORT   void RemoveShapesInside(const TopoDS_Shape& S) ;
92 Standard_EXPORT  const TopTools_ListOfShape& Modified(const TopoDS_Shape& S) ;
93 Standard_EXPORT  const TopTools_ListOfShape& Generated(const TopoDS_Shape& S) ;
94 Standard_EXPORT   Standard_Boolean IsDeleted(const TopoDS_Shape& S) ;
95 Standard_EXPORT virtual  void Clear() ;
96 Standard_EXPORT  const TopTools_ListOfShape& SourceShapes() const;
97
98
99
100
101
102 protected:
103
104  // Methods PROTECTED
105  // 
106 Standard_EXPORT   void FillResult() ;
107 Standard_EXPORT   void FillImageShape() ;
108 Standard_EXPORT   void SplittedFaces() ;
109 Standard_EXPORT   void SplittedWires() ;
110 Standard_EXPORT   void SplitsAndSections() ;
111 Standard_EXPORT   void ShellsAndSolids() ;
112 Standard_EXPORT   void MakeShells(const TopoDS_Shape& aS,TopTools_ListOfShape& aLNS) ;
113 Standard_EXPORT   void MakeSolids(const TopoDS_Shape& Solid,TopTools_ListOfShape& Shells) ;
114 Standard_EXPORT   TopoDS_Shape FindFacesInside(const TopoDS_Shape& S,const Standard_Boolean CheckClosed = Standard_False,const Standard_Boolean All = Standard_False) ;
115 Standard_EXPORT static  Standard_Boolean IsInside(const TopoDS_Shape& S1,const TopoDS_Shape& S2) ;
116 Standard_EXPORT   TopoDS_Shape GetOriginalShape(const TopoDS_Shape& aShape) const;
117 Standard_EXPORT   void FindImage(const TopoDS_Shape& aS,TopTools_ListOfShape& aLIms) ;
118
119
120  // Fields PROTECTED
121  //
122 TopAbs_ShapeEnum myDoneStep;
123 BRep_Builder myBuilder;
124 TopTools_ListOfShape myListShapes;
125 TopTools_MapOfShape myMapFaces;
126 TopTools_MapOfShape myMapTools;
127 TopTools_MapOfShape myEqualEdges;
128 TopTools_MapOfShape myNewSection;
129 TopTools_MapOfShape myClosedShapes;
130 TopTools_MapOfShape myWrappingSolid;
131 TopTools_DataMapOfShapeShape myFaceShapeMap;
132 TopTools_DataMapOfShapeShape myInternalFaces;
133 TopTools_DataMapOfShapeShape myIntNotClFaces;
134 BRepAlgo_Image myImageShape;
135 TopTools_MapOfOrientedShape myAddedFacesMap;
136 TopTools_ListOfShape mySourceShapes;
137 TopAbs_ShapeEnum myLimit;
138 TopTools_MapOfShape myToolShapes;
139 TopTools_MapOfShape myObjShapes;
140 TopTools_DataMapOfShapeShape myMapSIFC;
141 TopTools_ListOfShape myGenerated;
142 TopTools_DataMapOfShapeListOfShape myModifiedFaces;
143
144
145 private: 
146
147  // Methods PRIVATE
148  // 
149
150
151  // Fields PRIVATE
152  //
153
154
155 };
156
157
158
159
160
161 // other Inline functions and methods (like "C++: function call" methods)
162 //
163
164
165 #endif