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