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_Inter3d.hxx
25 //  Module : GEOM
26 
27 #ifndef _Partition_Inter3d_HeaderFile
28 #define _Partition_Inter3d_HeaderFile
29 
30 #ifndef _Standard_Version_HeaderFile
31 #include <Standard_Version.hxx>
32 #endif
33 
34 #if OCC_VERSION_HEX < 0x070000
35    #ifndef _Handle_BRepAlgo_AsDes_HeaderFile
36       #include <Handle_BRepAlgo_AsDes.hxx>
37    #endif
38 #else
39    #include <BRepAlgo_AsDes.hxx>
40    #include <TopTools_DataMapOfShapeShape.hxx>
41 #endif
42 #ifndef _TopTools_DataMapOfShapeListOfShape_HeaderFile
43 #include <TopTools_DataMapOfShapeListOfShape.hxx>
44 #endif
45 #ifndef _TopTools_MapOfShape_HeaderFile
46 #include <TopTools_MapOfShape.hxx>
47 #endif
48 #ifndef _TopTools_DataMapOfShapeShape_HeaderFile
49 #include <TopTools_DataMapOfShapeShape.hxx>
50 #endif
51 #ifndef _Standard_Boolean_HeaderFile
52 #include <Standard_Boolean.hxx>
53 #endif
54 
55 #if OCC_VERSION_HEX < 0x070000
56    class TopTools_ListOfShape;
57    class TopTools_DataMapOfShapeShape;
58    class TopTools_MapOfShape;
59 #endif
60 
61 class BRepAlgo_AsDes;
62 class TopoDS_Face;
63 class TopoDS_Shape;
64 class TopoDS_Vertex;
65 class TopoDS_Edge;
66 
67 
68 #ifndef _Standard_HeaderFile
69 #include <Standard.hxx>
70 #endif
71 #ifndef _Standard_Macro_HeaderFile
72 #include <Standard_Macro.hxx>
73 #endif
74 
75 class Partition_Inter3d  {
76 
77 public:
78 
operator new(size_t,void * anAddress)79    void* operator new(size_t,void* anAddress)
80    {
81       return anAddress;
82    }
operator new(size_t size)83    void* operator new(size_t size)
84    {
85       return Standard::Allocate(size);
86    }
operator delete(void * anAddress)87    void  operator delete(void *anAddress)
88    {
89       if (anAddress) Standard::Free((Standard_Address&)anAddress);
90    }
91    // Methods PUBLIC
92    //
93    Partition_Inter3d();
94    Partition_Inter3d(const Handle(BRepAlgo_AsDes)& AsDes);
95    void CompletPart3d(const TopTools_ListOfShape& SetOfFaces1,const TopTools_DataMapOfShapeShape& FaceShapeMap) ;
96    void FacesPartition(const TopoDS_Face& F1,const TopoDS_Face& F2) ;
97    Standard_Boolean IsDone(const TopoDS_Face& F1,const TopoDS_Face& F2) const;
98    TopTools_MapOfShape& TouchedFaces() ;
99    Handle(BRepAlgo_AsDes) AsDes() const;
100    TopTools_MapOfShape& NewEdges() ;
101    Standard_Boolean HasSameDomainF(const TopoDS_Shape& F) const;
102    Standard_Boolean IsSameDomainF(const TopoDS_Shape& F1,const TopoDS_Shape& F2) const;
103    const TopTools_ListOfShape& SameDomain(const TopoDS_Face& F) const;
104    TopoDS_Vertex ReplaceSameDomainV(const TopoDS_Vertex& V,const TopoDS_Edge& E) const;
105    Handle(BRepAlgo_AsDes) SectionEdgesAD() const;
106    Standard_Boolean IsSectionEdge(const TopoDS_Edge& E) const;
107    Standard_Boolean HasSectionEdge(const TopoDS_Face& F) const;
108    Standard_Boolean IsSplitOn(const TopoDS_Edge& NewE,const TopoDS_Edge& OldE,const TopoDS_Face& F) const;
109    const TopTools_ListOfShape& SectionEdgeFaces(const TopoDS_Edge& SecE) const;
110 
111 
112 
113 
114 
115 protected:
116 
117    // Methods PROTECTED
118    //
119 
120 
121    // Fields PROTECTED
122    //
123 
124 
125 private:
126 
127    // Methods PRIVATE
128    //
129    void Inter3D(const TopoDS_Face& F1,const TopoDS_Face& F2,TopTools_ListOfShape& LInt) ;
130    void StorePart3d(const TopoDS_Face& F1,const TopoDS_Face& F2,const TopTools_ListOfShape& LInt1) ;
131    void SetDone(const TopoDS_Face& F1,const TopoDS_Face& F2) ;
132    void Affiche(const TopTools_ListOfShape& SetOfFaces) const;
133 
134 
135    // Fields PRIVATE
136    //
137    Handle(BRepAlgo_AsDes) myAsDes;
138    TopTools_DataMapOfShapeListOfShape myDone;
139    TopTools_MapOfShape myTouched;
140    TopTools_MapOfShape myNewEdges;
141    Handle(BRepAlgo_AsDes) mySectionEdgesAD;
142    TopTools_DataMapOfShapeListOfShape mySameDomainFM;
143    TopTools_DataMapOfShapeShape mySameDomainVM;
144 
145 
146 };
147 
148 
149 
150 
151 
152 // other Inline functions and methods (like "C++: function call" methods)
153 //
154 
155 
156 #endif
157