summaryrefslogtreecommitdiff
path: root/inc/TopOpeBRepBuild_Builder1.hxx
blob: 1f214114286f933591db5598c9cb288e79be1988 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
// This file is generated by WOK (CPPExt).
// Please do not edit this file; modify original file instead.
// The copyright and license terms as defined for the original file apply to 
// this header file considered to be the "object code" form of the original source.

#ifndef _TopOpeBRepBuild_Builder1_HeaderFile
#define _TopOpeBRepBuild_Builder1_HeaderFile

#ifndef _Standard_HeaderFile
#include <Standard.hxx>
#endif
#ifndef _Standard_Macro_HeaderFile
#include <Standard_Macro.hxx>
#endif

#ifndef _TopTools_IndexedMapOfShape_HeaderFile
#include <TopTools_IndexedMapOfShape.hxx>
#endif
#ifndef _TopoDS_Shape_HeaderFile
#include <TopoDS_Shape.hxx>
#endif
#ifndef _TopTools_IndexedDataMapOfShapeListOfShape_HeaderFile
#include <TopTools_IndexedDataMapOfShapeListOfShape.hxx>
#endif
#ifndef _TopTools_DataMapOfOrientedShapeInteger_HeaderFile
#include <TopTools_DataMapOfOrientedShapeInteger.hxx>
#endif
#ifndef _TopTools_IndexedMapOfOrientedShape_HeaderFile
#include <TopTools_IndexedMapOfOrientedShape.hxx>
#endif
#ifndef _TopTools_IndexedDataMapOfShapeShape_HeaderFile
#include <TopTools_IndexedDataMapOfShapeShape.hxx>
#endif
#ifndef _TopTools_DataMapOfShapeListOfShape_HeaderFile
#include <TopTools_DataMapOfShapeListOfShape.hxx>
#endif
#ifndef _TopOpeBRepBuild_Builder_HeaderFile
#include <TopOpeBRepBuild_Builder.hxx>
#endif
#ifndef _Handle_TopOpeBRepDS_HDataStructure_HeaderFile
#include <Handle_TopOpeBRepDS_HDataStructure.hxx>
#endif
#ifndef _TopAbs_State_HeaderFile
#include <TopAbs_State.hxx>
#endif
#ifndef _Standard_Boolean_HeaderFile
#include <Standard_Boolean.hxx>
#endif
#ifndef _Standard_Integer_HeaderFile
#include <Standard_Integer.hxx>
#endif
class TopOpeBRepBuild_HBuilder;
class TopOpeBRepDS_BuildTool;
class TopOpeBRepDS_HDataStructure;
class TopoDS_Shape;
class TopTools_ListOfShape;
class TopOpeBRepBuild_GTopo;
class TopOpeBRepBuild_ShellFaceSet;
class TopOpeBRepBuild_WireEdgeSet;
class TopTools_IndexedMapOfShape;
class TopOpeBRepDS_DataMapOfShapeState;
class TopOpeBRepBuild_PaveSet;
class TopoDS_Edge;
class TopoDS_Face;
class TopTools_SequenceOfShape;


//! extension  of  the  class  TopOpeBRepBuild_Builder  dedicated <br>
//!         to  avoid  bugs  in  "Rebuilding Result" algorithm  for  the  case  of  SOLID/SOLID  Boolean  Operations <br>
class TopOpeBRepBuild_Builder1  : public TopOpeBRepBuild_Builder {
public:

  void* operator new(size_t,void* anAddress) 
  {
    return anAddress;
  }
  void* operator new(size_t size) 
  {
    return Standard::Allocate(size); 
  }
  void  operator delete(void *anAddress) 
  {
    if (anAddress) Standard::Free((Standard_Address&)anAddress); 
  }

  
  Standard_EXPORT   TopOpeBRepBuild_Builder1(const TopOpeBRepDS_BuildTool& BT);
  
  Standard_EXPORT   virtual  void Destroy() ;
Standard_EXPORT virtual ~TopOpeBRepBuild_Builder1()  {  Destroy() ; }
  //! Removes all splits and merges already performed. <br>
//! Does NOT clear the handled DS  (except  ShapeWithStatesMaps). <br>
  Standard_EXPORT   virtual  void Clear() ;
  
  Standard_EXPORT   virtual  void Perform(const Handle(TopOpeBRepDS_HDataStructure)& HDS) ;
  
  Standard_EXPORT   virtual  void Perform(const Handle(TopOpeBRepDS_HDataStructure)& HDS,const TopoDS_Shape& S1,const TopoDS_Shape& S2) ;
  
  Standard_EXPORT   virtual  void MergeKPart() ;
  
  Standard_EXPORT   virtual  void MergeKPart(const TopAbs_State TB1,const TopAbs_State TB2) ;
  
  Standard_EXPORT   virtual  void GFillSolidSFS(const TopoDS_Shape& SO1,const TopTools_ListOfShape& LSO2,const TopOpeBRepBuild_GTopo& G,TopOpeBRepBuild_ShellFaceSet& SFS) ;
  
  Standard_EXPORT   virtual  void GFillShellSFS(const TopoDS_Shape& SH1,const TopTools_ListOfShape& LSO2,const TopOpeBRepBuild_GTopo& G,TopOpeBRepBuild_ShellFaceSet& SFS) ;
  
  Standard_EXPORT   virtual  void GWESMakeFaces(const TopoDS_Shape& FF,TopOpeBRepBuild_WireEdgeSet& WES,TopTools_ListOfShape& LOF) ;
  
  Standard_EXPORT     void GFillSplitsPVS(const TopoDS_Shape& anEdge,const TopOpeBRepBuild_GTopo& G1,TopOpeBRepBuild_PaveSet& PVS) ;
  
  Standard_EXPORT     void GFillFaceNotSameDomSFS(const TopoDS_Shape& F1,const TopTools_ListOfShape& LSO2,const TopOpeBRepBuild_GTopo& G,TopOpeBRepBuild_ShellFaceSet& SFS) ;
  
  Standard_EXPORT     void GFillFaceNotSameDomWES(const TopoDS_Shape& F1,const TopTools_ListOfShape& LSO2,const TopOpeBRepBuild_GTopo& G,TopOpeBRepBuild_WireEdgeSet& WES) ;
  
  Standard_EXPORT     void GFillWireNotSameDomWES(const TopoDS_Shape& W1,const TopTools_ListOfShape& LSO2,const TopOpeBRepBuild_GTopo& G,TopOpeBRepBuild_WireEdgeSet& WES) ;
  
  Standard_EXPORT     void GFillEdgeNotSameDomWES(const TopoDS_Shape& E1,const TopTools_ListOfShape& LSO2,const TopOpeBRepBuild_GTopo& G,TopOpeBRepBuild_WireEdgeSet& WES) ;
  
  Standard_EXPORT     void GFillFaceSameDomSFS(const TopoDS_Shape& F1,const TopTools_ListOfShape& LSO2,const TopOpeBRepBuild_GTopo& G,TopOpeBRepBuild_ShellFaceSet& SFS) ;
  
  Standard_EXPORT     void GFillFaceSameDomWES(const TopoDS_Shape& F1,const TopTools_ListOfShape& LSO2,const TopOpeBRepBuild_GTopo& G,TopOpeBRepBuild_WireEdgeSet& WES) ;
  
  Standard_EXPORT     void GFillWireSameDomWES(const TopoDS_Shape& W1,const TopTools_ListOfShape& LSO2,const TopOpeBRepBuild_GTopo& G,TopOpeBRepBuild_WireEdgeSet& WES) ;
  
  Standard_EXPORT     void GFillEdgeSameDomWES(const TopoDS_Shape& E1,const TopTools_ListOfShape& LSO2,const TopOpeBRepBuild_GTopo& G,TopOpeBRepBuild_WireEdgeSet& WES) ;
  
  Standard_EXPORT     void PerformONParts(const TopoDS_Shape& F,const TopTools_IndexedMapOfShape& SDfaces,const TopOpeBRepBuild_GTopo& G,TopOpeBRepBuild_WireEdgeSet& WES) ;
  
  Standard_EXPORT     void PerformPieceIn2D(const TopoDS_Edge& aPieceToPerform,const TopoDS_Edge& aOriginalEdge,const TopoDS_Face& edgeFace,const TopoDS_Face& toFace,const TopOpeBRepBuild_GTopo& G,Standard_Boolean& keep) ;
  
  Standard_EXPORT     Standard_Integer PerformPieceOn2D(const TopoDS_Shape& aPieceObj,const TopoDS_Shape& aFaceObj,const TopoDS_Shape& aEdgeObj,TopTools_ListOfShape& aListOfPieces,TopTools_ListOfShape& aListOfFaces,TopTools_ListOfShape& aListOfPiecesOut2d) ;
  
  Standard_EXPORT     Standard_Integer TwoPiecesON(const TopTools_SequenceOfShape& aSeq,TopTools_ListOfShape& aListOfPieces,TopTools_ListOfShape& aListOfFaces,TopTools_ListOfShape& aListOfPiecesOut2d) ;
  
  Standard_EXPORT     Standard_Integer CorrectResult2d(TopoDS_Shape& aResult) ;


friend class TopOpeBRepBuild_HBuilder;



protected:

  
  Standard_EXPORT     void PerformShapeWithStates() ;
  
  Standard_EXPORT     void PerformShapeWithStates(const TopoDS_Shape& anObj,const TopoDS_Shape& aTool) ;
  
  Standard_EXPORT     void StatusEdgesToSplit(const TopoDS_Shape& anObj,const TopTools_IndexedMapOfShape& anEdgesToSplitMap,const TopTools_IndexedMapOfShape& anEdgesToRestMap) ;
  
  Standard_EXPORT     void SplitEdge(const TopoDS_Shape& anEdge,TopTools_ListOfShape& aLNew,TopOpeBRepDS_DataMapOfShapeState& aDataMapOfShapeState) ;
  
  Standard_EXPORT     void PerformFacesWithStates(const TopoDS_Shape& anObj,const TopTools_IndexedMapOfShape& aFaces,TopOpeBRepDS_DataMapOfShapeState& aSplF) ;
  
  Standard_EXPORT     Standard_Integer IsSame2d(const TopTools_SequenceOfShape& aSeq,TopTools_ListOfShape& aListOfPiecesOut2d) ;
  
  Standard_EXPORT     void OrientateEdgeOnFace(TopoDS_Edge& EdgeToPerform,const TopoDS_Face& baseFace,const TopoDS_Face& edgeFace,const TopOpeBRepBuild_GTopo& G1,Standard_Boolean& stateOfFaceOri) const;


TopTools_DataMapOfShapeListOfShape myFSplits;
TopTools_DataMapOfShapeListOfShape myESplits;


private:



TopTools_IndexedMapOfShape mySameDomMap;
TopoDS_Shape mySDFaceToFill;
TopoDS_Shape myBaseFaceToFill;
TopTools_IndexedDataMapOfShapeListOfShape myMapOfEdgeFaces;
TopTools_DataMapOfOrientedShapeInteger myMapOfEdgeWithFaceState;
TopTools_IndexedMapOfShape myProcessedPartsOut2d;
TopTools_IndexedMapOfShape myProcessedPartsON2d;
TopTools_IndexedMapOfShape mySplitsONtoKeep;
TopTools_IndexedMapOfOrientedShape mySourceShapes;
TopTools_IndexedDataMapOfShapeShape myMapOfCorrect2dEdges;


};





// other Inline functions and methods (like "C++: function call" methods)


#endif