1 // Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
3 // Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
4 // CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
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.
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.
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
20 // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
22 // GEOM PARTITION : partition algorithm
23 // File : Partition_Spliter.hxx
26 #ifndef _Partition_Spliter_HeaderFile
27 #define _Partition_Spliter_HeaderFile
29 #ifndef _TopAbs_ShapeEnum_HeaderFile
30 #include <TopAbs_ShapeEnum.hxx>
32 #ifndef _TopoDS_Compound_HeaderFile
33 #include <TopoDS_Compound.hxx>
35 #ifndef _BRep_Builder_HeaderFile
36 #include <BRep_Builder.hxx>
38 #ifndef _TopTools_ListOfShape_HeaderFile
39 #include <TopTools_ListOfShape.hxx>
41 #ifndef _TopTools_MapOfShape_HeaderFile
42 #include <TopTools_MapOfShape.hxx>
44 #ifndef _TopTools_DataMapOfShapeShape_HeaderFile
45 #include <TopTools_DataMapOfShapeShape.hxx>
47 #ifndef _Handle_BRepAlgo_AsDes_HeaderFile
48 #include <Handle_BRepAlgo_AsDes.hxx>
50 #ifndef _BRepAlgo_Image_HeaderFile
51 #include <BRepAlgo_Image.hxx>
53 #ifndef _Partition_Inter3d_HeaderFile
54 #include "Partition_Inter3d.hxx"
56 #ifndef _TopTools_MapOfOrientedShape_HeaderFile
57 #include <TopTools_MapOfOrientedShape.hxx>
59 #ifndef _Standard_Boolean_HeaderFile
60 #include <Standard_Boolean.hxx>
64 class TopTools_ListOfShape;
68 #ifndef _Standard_HeaderFile
69 #include <Standard.hxx>
71 #ifndef _Standard_Macro_HeaderFile
72 #include <Standard_Macro.hxx>
75 class Partition_Spliter {
79 void* operator new(size_t,void* anAddress)
83 void* operator new(size_t size)
85 return Standard::Allocate(size);
87 void operator delete(void *anAddress)
89 if (anAddress) Standard::Free((Standard_Address&)anAddress);
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() ;
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() ;
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;
162 // other Inline functions and methods (like "C++: function call" methods)