summaryrefslogtreecommitdiff
path: root/inc/TopOpeBRepBuild_HBuilder.hxx
blob: d6e385b0a6bb9f121690ea8f23c67d803489afec (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
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
// 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_HBuilder_HeaderFile
#define _TopOpeBRepBuild_HBuilder_HeaderFile

#ifndef _Standard_HeaderFile
#include <Standard.hxx>
#endif
#ifndef _Standard_DefineHandle_HeaderFile
#include <Standard_DefineHandle.hxx>
#endif
#ifndef _Handle_TopOpeBRepBuild_HBuilder_HeaderFile
#include <Handle_TopOpeBRepBuild_HBuilder.hxx>
#endif

#ifndef _TopOpeBRepBuild_Builder1_HeaderFile
#include <TopOpeBRepBuild_Builder1.hxx>
#endif
#ifndef _TopTools_DataMapOfShapeInteger_HeaderFile
#include <TopTools_DataMapOfShapeInteger.hxx>
#endif
#ifndef _TColStd_DataMapOfIntegerListOfInteger_HeaderFile
#include <TColStd_DataMapOfIntegerListOfInteger.hxx>
#endif
#ifndef _Standard_Boolean_HeaderFile
#include <Standard_Boolean.hxx>
#endif
#ifndef _TopoDS_Shape_HeaderFile
#include <TopoDS_Shape.hxx>
#endif
#ifndef _TColStd_ListOfInteger_HeaderFile
#include <TColStd_ListOfInteger.hxx>
#endif
#ifndef _MMgt_TShared_HeaderFile
#include <MMgt_TShared.hxx>
#endif
#ifndef _Handle_TopOpeBRepDS_HDataStructure_HeaderFile
#include <Handle_TopOpeBRepDS_HDataStructure.hxx>
#endif
#ifndef _TopAbs_State_HeaderFile
#include <TopAbs_State.hxx>
#endif
#ifndef _Standard_Integer_HeaderFile
#include <Standard_Integer.hxx>
#endif
class Standard_NoSuchObject;
class TopOpeBRepDS_BuildTool;
class TopOpeBRepDS_HDataStructure;
class TopoDS_Shape;
class TopTools_ListOfShape;
class TColStd_ListOfInteger;
class TopOpeBRepBuild_Builder;


//! The HBuilder  algorithm    constructs   topological <br>
//!          objects  from   an    existing  topology  and  new <br>
//!          geometries attached to the topology. It is used to <br>
//!          construct the result of a topological operation; <br>
//!          the existing  topologies are the parts involved in <br>
//!          the  topological  operation and the new geometries <br>
//!          are the intersection lines and points. <br>
class TopOpeBRepBuild_HBuilder : public MMgt_TShared {

public:

  
  Standard_EXPORT   TopOpeBRepBuild_HBuilder(const TopOpeBRepDS_BuildTool& BT);
  
  Standard_EXPORT    const TopOpeBRepDS_BuildTool& BuildTool() const;
  
//! Stores the data structure <HDS>, <br>
//! Create shapes from the new geometries described in <HDS>. <br>
  Standard_EXPORT     void Perform(const Handle(TopOpeBRepDS_HDataStructure)& HDS) ;
  
//! Same as previous + evaluates if an operation performed on shapes S1,S2 <br>
//! is a particular case. <br>
  Standard_EXPORT     void Perform(const Handle(TopOpeBRepDS_HDataStructure)& HDS,const TopoDS_Shape& S1,const TopoDS_Shape& S2) ;
  //! Removes all split and merge already performed. <br>
//! 	        Does NOT clear the handled DS. <br>
  Standard_EXPORT     void Clear() ;
  //! returns the DS handled by this builder <br>
  Standard_EXPORT     Handle_TopOpeBRepDS_HDataStructure DataStructure() const;
  
  Standard_EXPORT     TopOpeBRepDS_BuildTool& ChangeBuildTool() ;
  //! Merges the two shapes <S1> and <S2> keeping the <br>
//!          parts of states <TB1>,<TB2> in <S1>,<S2>. <br>
  Standard_EXPORT     void MergeShapes(const TopoDS_Shape& S1,const TopAbs_State TB1,const TopoDS_Shape& S2,const TopAbs_State TB2) ;
  //! Merges  the two solids <S1>   and <S2> keeping the <br>
//!          parts in each solid of states <TB1> and <TB2>. <br>
  Standard_EXPORT     void MergeSolids(const TopoDS_Shape& S1,const TopAbs_State TB1,const TopoDS_Shape& S2,const TopAbs_State TB2) ;
  //! Merges the solid <S>  keeping the <br>
//!          parts of state <TB>. <br>
  Standard_EXPORT     void MergeSolid(const TopoDS_Shape& S,const TopAbs_State TB) ;
  
//! Returns True if the shape <S> has been split. <br>
  Standard_EXPORT     Standard_Boolean IsSplit(const TopoDS_Shape& S,const TopAbs_State ToBuild) const;
  
//! Returns the split parts <ToBuild> of shape <S>. <br>
  Standard_EXPORT    const TopTools_ListOfShape& Splits(const TopoDS_Shape& S,const TopAbs_State ToBuild) const;
  
//! Returns True if the shape <S> has been merged. <br>
  Standard_EXPORT     Standard_Boolean IsMerged(const TopoDS_Shape& S,const TopAbs_State ToBuild) const;
  
//! Returns the merged parts <ToBuild> of shape <S>. <br>
  Standard_EXPORT    const TopTools_ListOfShape& Merged(const TopoDS_Shape& S,const TopAbs_State ToBuild) const;
  
//! Returns the vertex created on point <I>. <br>
  Standard_EXPORT    const TopoDS_Shape& NewVertex(const Standard_Integer I) const;
  
//! Returns the edges created on curve <I>. <br>
  Standard_EXPORT    const TopTools_ListOfShape& NewEdges(const Standard_Integer I) const;
  
//! Returns the edges created on curve <I>. <br>
  Standard_EXPORT     TopTools_ListOfShape& ChangeNewEdges(const Standard_Integer I) ;
  
//! Returns the faces created on surface <I>. <br>
  Standard_EXPORT    const TopTools_ListOfShape& NewFaces(const Standard_Integer I) const;
  
  Standard_EXPORT    const TopTools_ListOfShape& Section() ;
  
  Standard_EXPORT     void InitExtendedSectionDS(const Standard_Integer k = 3) ;
  
  Standard_EXPORT     void InitSection(const Standard_Integer k = 3) ;
  
  Standard_EXPORT     Standard_Boolean MoreSection() const;
  
  Standard_EXPORT     void NextSection() ;
  
  Standard_EXPORT    const TopoDS_Shape& CurrentSection() const;
  
  Standard_EXPORT     Standard_Integer GetDSEdgeFromSectEdge(const TopoDS_Shape& E,const Standard_Integer rank) ;
  
  Standard_EXPORT     TColStd_ListOfInteger& GetDSFaceFromDSEdge(const Standard_Integer indexEdg,const Standard_Integer rank) ;
  
  Standard_EXPORT     Standard_Integer GetDSCurveFromSectEdge(const TopoDS_Shape& SectEdge) ;
  
  Standard_EXPORT     Standard_Integer GetDSFaceFromDSCurve(const Standard_Integer indexCur,const Standard_Integer rank) ;
  
  Standard_EXPORT     Standard_Integer GetDSPointFromNewVertex(const TopoDS_Shape& NewVert) ;
  //! search for the couple of face F1,F2 <br>
//! (from arguments of supra Perform(S1,S2,HDS)) method which <br>
//! intersection gives section edge E built on an intersection curve. <br>
//! returns True if F1,F2 have been valued. <br>
//! returns False if E is not a section edge built <br>
//! on intersection curve IC. <br>
  Standard_EXPORT     Standard_Boolean EdgeCurveAncestors(const TopoDS_Shape& E,TopoDS_Shape& F1,TopoDS_Shape& F2,Standard_Integer& IC) ;
  //! search for the couple of face F1,F2 <br>
//! (from arguments of supra Perform(S1,S2,HDS)) method which <br>
//! intersection gives section edge E built on at least one edge . <br>
//! returns True if F1,F2 have been valued. <br>
//! returns False if E is not a section edge built <br>
//! on at least one edge of S1 and/or S2. <br>
//! LE1,LE2 are edges of S1,S2 which common part is edge E. <br>
//! LE1 or LE2 may be empty() but not both. <br>
  Standard_EXPORT     Standard_Boolean EdgeSectionAncestors(const TopoDS_Shape& E,TopTools_ListOfShape& LF1,TopTools_ListOfShape& LF2,TopTools_ListOfShape& LE1,TopTools_ListOfShape& LE2) ;
  //! Returns 0 is standard operation, != 0 if particular case <br>
  Standard_EXPORT     Standard_Integer IsKPart() ;
  
  Standard_EXPORT     void MergeKPart(const TopAbs_State TB1,const TopAbs_State TB2) ;
  
  Standard_EXPORT     TopOpeBRepBuild_Builder& ChangeBuilder() ;




  DEFINE_STANDARD_RTTI(TopOpeBRepBuild_HBuilder)

protected:


TopOpeBRepBuild_Builder1 myBuilder;


private: 

  
  Standard_EXPORT     void MakeEdgeAncestorMap() ;
  
  Standard_EXPORT     void MakeCurveAncestorMap() ;

TopTools_DataMapOfShapeInteger mySectEdgeDSEdges1;
TopTools_DataMapOfShapeInteger mySectEdgeDSEdges2;
TColStd_DataMapOfIntegerListOfInteger myDSEdgesDSFaces1;
TColStd_DataMapOfIntegerListOfInteger myDSEdgesDSFaces2;
Standard_Boolean myMakeEdgeAncestorIsDone;
TopTools_DataMapOfShapeInteger mySectEdgeDSCurve;
Standard_Boolean myMakeCurveAncestorIsDone;
TopTools_DataMapOfShapeInteger myNewVertexDSPoint;
Standard_Boolean myMakePointAncestorIsDone;
TopoDS_Shape myEmptyShape;
TColStd_ListOfInteger myEmptyIntegerList;


};





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


#endif