summaryrefslogtreecommitdiff
path: root/inc/BRepLib_FuseEdges.hxx
blob: 18ad097c9f90e86ce136ab5b14d29070103b8e1f (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
// 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 _BRepLib_FuseEdges_HeaderFile
#define _BRepLib_FuseEdges_HeaderFile

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

#ifndef _TopoDS_Shape_HeaderFile
#include <TopoDS_Shape.hxx>
#endif
#ifndef _Standard_Boolean_HeaderFile
#include <Standard_Boolean.hxx>
#endif
#ifndef _TopTools_IndexedDataMapOfShapeListOfShape_HeaderFile
#include <TopTools_IndexedDataMapOfShapeListOfShape.hxx>
#endif
#ifndef _TopTools_DataMapOfIntegerListOfShape_HeaderFile
#include <TopTools_DataMapOfIntegerListOfShape.hxx>
#endif
#ifndef _TopTools_DataMapOfIntegerShape_HeaderFile
#include <TopTools_DataMapOfIntegerShape.hxx>
#endif
#ifndef _TopTools_DataMapOfShapeShape_HeaderFile
#include <TopTools_DataMapOfShapeShape.hxx>
#endif
#ifndef _Standard_Integer_HeaderFile
#include <Standard_Integer.hxx>
#endif
#ifndef _TopTools_IndexedMapOfShape_HeaderFile
#include <TopTools_IndexedMapOfShape.hxx>
#endif
#ifndef _TopAbs_ShapeEnum_HeaderFile
#include <TopAbs_ShapeEnum.hxx>
#endif
class Standard_ConstructionError;
class Standard_NullObject;
class TopoDS_Shape;
class TopTools_IndexedMapOfShape;
class TopTools_DataMapOfIntegerListOfShape;
class TopTools_DataMapOfIntegerShape;
class TopTools_DataMapOfShapeShape;
class TopTools_IndexedDataMapOfShapeListOfShape;
class TopTools_MapOfShape;
class TopTools_ListOfShape;
class TopoDS_Vertex;
class TopoDS_Edge;


//! This class can detect  vertices in a face that can <br>
//!          be considered useless and then perform the fuse of <br>
//!          the  edges and remove  the  useless vertices.  By <br>
//!          useles vertices,  we mean : <br>
//!            * vertices that  have  exactly two connex edges <br>
//!            * the edges connex to the vertex must have <br>
//!              exactly the same 2 connex faces . <br>
//!            * The edges connex to the vertex must have the <br>
//!               same geometric support. <br>
class BRepLib_FuseEdges  {
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); 
  }

  //! Initialise members  and build  construction of map <br>
//!          of ancestors. <br>
  Standard_EXPORT   BRepLib_FuseEdges(const TopoDS_Shape& theShape,const Standard_Boolean PerformNow = Standard_False);
  //! set edges to avoid being fused <br>
  Standard_EXPORT     void AvoidEdges(const TopTools_IndexedMapOfShape& theMapEdg) ;
  //! set mode to enable concatenation G1 BSpline edges in one <br>
//!  End  Modified  by  IFV  19.04.07 <br>
  Standard_EXPORT     void SetConcatBSpl(const Standard_Boolean theConcatBSpl = Standard_True) ;
  //! returns  all the list of edges to be fused <br>
//!          each list of the map represent a set of connex edges <br>
//!          that can be fused. <br>
  Standard_EXPORT     void Edges(TopTools_DataMapOfIntegerListOfShape& theMapLstEdg) ;
  //! returns all the fused edges. each integer entry in <br>
//!           the   map  corresponds  to  the  integer   in the <br>
//!           DataMapOfIntegerListOfShape  we    get in  method <br>
//!          Edges.   That is to say, to  the list  of edges in <br>
//!          theMapLstEdg(i) corresponds the resulting edge theMapEdge(i) <br>
//! <br>
  Standard_EXPORT     void ResultEdges(TopTools_DataMapOfIntegerShape& theMapEdg) ;
  //! returns the map of modified faces. <br>
  Standard_EXPORT     void Faces(TopTools_DataMapOfShapeShape& theMapFac) ;
  //! returns myShape modified with the list of internal <br>
//!          edges removed from it. <br>
  Standard_EXPORT     TopoDS_Shape& Shape() ;
  //! returns the number of vertices candidate to be removed <br>
  Standard_EXPORT    const Standard_Integer NbVertices() ;
  //! Using  map of list of connex  edges, fuse each list to <br>
//!           one edge and then update myShape <br>
  Standard_EXPORT     void Perform() ;





protected:





private:

  //! build a map of shapes and ancestors, like <br>
//!          TopExp.MapShapesAndAncestors, but we remove duplicate <br>
//!          shapes in list of shapes. <br>
  Standard_EXPORT     void BuildAncestors(const TopoDS_Shape& S,const TopAbs_ShapeEnum TS,const TopAbs_ShapeEnum TA,TopTools_IndexedDataMapOfShapeListOfShape& M) const;
  //! Build the all the lists of edges that are to be fused <br>
  Standard_EXPORT     void BuildListEdges() ;
  //! Build result   fused edges according  to  the list <br>
//!          builtin BuildLisEdges <br>
  Standard_EXPORT     void BuildListResultEdges() ;
  
  Standard_EXPORT     void BuildListConnexEdge(const TopoDS_Shape& theEdge,TopTools_MapOfShape& theMapUniq,TopTools_ListOfShape& theLstEdg) ;
  
  Standard_EXPORT     Standard_Boolean NextConnexEdge(const TopoDS_Vertex& theVertex,const TopoDS_Shape& theEdge,TopoDS_Shape& theEdgeConnex) const;
  
  Standard_EXPORT     Standard_Boolean SameSupport(const TopoDS_Edge& E1,const TopoDS_Edge& E2) const;
  
  Standard_EXPORT     Standard_Boolean UpdatePCurve(const TopoDS_Edge& theOldEdge,TopoDS_Edge& theNewEdge,const TopTools_ListOfShape& theLstEdg) const;


TopoDS_Shape myShape;
Standard_Boolean myShapeDone;
Standard_Boolean myEdgesDone;
Standard_Boolean myResultEdgesDone;
TopTools_IndexedDataMapOfShapeListOfShape myMapVerLstEdg;
TopTools_IndexedDataMapOfShapeListOfShape myMapEdgLstFac;
TopTools_DataMapOfIntegerListOfShape myMapLstEdg;
TopTools_DataMapOfIntegerShape myMapEdg;
TopTools_DataMapOfShapeShape myMapFaces;
Standard_Integer myNbConnexEdge;
TopTools_IndexedMapOfShape myAvoidEdg;
Standard_Boolean myConcatBSpl;


};





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


#endif