7fd59977 |
1 | -- File: BRepLib_FuseEdges.cdl |
2 | -- Created: Mon Sep 10 10:36:48 2007 |
3 | -- Author: Igor FEOKTISTOV |
4 | -- <ifv@philipox.nnov.matra-dtv.fr> |
5 | ---Copyright: Matra Datavision 2007 |
6 | |
7 | |
8 | class FuseEdges from BRepLib |
9 | |
10 | ---Purpose: This class can detect vertices in a face that can |
11 | -- be considered useless and then perform the fuse of |
12 | -- the edges and remove the useless vertices. By |
13 | -- useles vertices, we mean : |
14 | -- * vertices that have exactly two connex edges |
15 | -- * the edges connex to the vertex must have |
16 | -- exactly the same 2 connex faces . |
17 | -- * The edges connex to the vertex must have the |
18 | -- same geometric support. |
19 | |
20 | uses |
21 | Shape from TopoDS, |
22 | Vertex from TopoDS, |
23 | Edge from TopoDS, |
24 | ShapeEnum from TopAbs, |
25 | MapOfShape from TopTools, |
26 | ListOfShape from TopTools, |
27 | DataMapOfIntegerListOfShape from TopTools, |
28 | DataMapOfIntegerShape from TopTools, |
29 | DataMapOfShapeShape from TopTools, |
30 | IndexedDataMapOfShapeListOfShape from TopTools, |
31 | IndexedMapOfShape from TopTools |
32 | |
33 | raises |
34 | ConstructionError from Standard, |
35 | NullObject from Standard |
36 | |
37 | is |
38 | Create (theShape : Shape from TopoDS; |
39 | PerformNow : Boolean from Standard = Standard_False) |
40 | returns FuseEdges from BRepLib |
41 | raises NullObject from Standard; |
42 | ---Purpose: Initialise members and build construction of map |
43 | -- of ancestors. |
44 | |
45 | AvoidEdges (me : in out; theMapEdg : IndexedMapOfShape from TopTools); |
46 | ---Purpose: set edges to avoid being fused |
47 | |
48 | -- Modified by IFV 19.04.07 |
49 | SetConcatBSpl(me : in out; theConcatBSpl : Boolean from Standard = Standard_True); |
50 | ---Purpose: set mode to enable concatenation G1 BSpline edges in one |
51 | -- End Modified by IFV 19.04.07 |
52 | |
53 | Edges (me : in out ; theMapLstEdg : in out DataMapOfIntegerListOfShape from TopTools); |
54 | ---Purpose: returns all the list of edges to be fused |
55 | -- each list of the map represent a set of connex edges |
56 | -- that can be fused. |
57 | |
58 | ResultEdges (me : in out ; theMapEdg : in out DataMapOfIntegerShape from TopTools); |
59 | ---Purpose: returns all the fused edges. each integer entry in |
60 | -- the map corresponds to the integer in the |
61 | -- DataMapOfIntegerListOfShape we get in method |
62 | -- Edges. That is to say, to the list of edges in |
63 | -- theMapLstEdg(i) corresponds the resulting edge theMapEdge(i) |
64 | -- |
65 | |
66 | |
67 | Faces (me: in out; theMapFac : in out DataMapOfShapeShape from TopTools); |
68 | ---Purpose: returns the map of modified faces. |
69 | |
70 | Shape (me : in out) |
71 | returns Shape from TopoDS |
72 | raises NullObject from Standard; |
73 | ---Purpose: returns myShape modified with the list of internal |
74 | -- edges removed from it. |
75 | ---C++: return & |
76 | |
77 | NbVertices (me : in out) |
78 | returns Integer from Standard |
79 | raises NullObject from Standard; |
80 | ---Purpose: returns the number of vertices candidate to be removed |
81 | ---C++: return const |
82 | |
83 | Perform (me : in out); |
84 | ---Purpose: Using map of list of connex edges, fuse each list to |
85 | -- one edge and then update myShape |
86 | |
87 | |
88 | BuildAncestors (me; S: Shape from TopoDS; TS: ShapeEnum from TopAbs; |
89 | TA: ShapeEnum from TopAbs; M: in out IndexedDataMapOfShapeListOfShape from TopTools) |
90 | ---Purpose: build a map of shapes and ancestors, like |
91 | -- TopExp.MapShapesAndAncestors, but we remove duplicate |
92 | -- shapes in list of shapes. |
93 | is private; |
94 | |
95 | BuildListEdges (me : in out) |
96 | ---Purpose: Build the all the lists of edges that are to be fused |
97 | is private; |
98 | |
99 | BuildListResultEdges (me : in out) |
100 | ---Purpose: Build result fused edges according to the list |
101 | -- builtin BuildLisEdges |
102 | is private; |
103 | |
104 | BuildListConnexEdge (me : in out; theEdge : Shape from TopoDS; theMapUniq : in out MapOfShape from TopTools; |
105 | theLstEdg : in out ListOfShape from TopTools) |
106 | is private; |
107 | |
108 | NextConnexEdge (me; theVertex : Vertex from TopoDS; theEdge : Shape from TopoDS; |
109 | theEdgeConnex : in out Shape from TopoDS) |
110 | returns Boolean from Standard |
111 | is private; |
112 | |
113 | SameSupport (me; E1 : Edge from TopoDS; E2 :Edge from TopoDS) |
114 | returns Boolean from Standard |
115 | is private; |
116 | |
117 | UpdatePCurve (me; theOldEdge : Edge from TopoDS; |
118 | theNewEdge : in out Edge from TopoDS; |
119 | theLstEdg : ListOfShape from TopTools) |
120 | returns Boolean from Standard |
121 | is private; |
122 | |
123 | |
124 | fields |
125 | myShape : Shape from TopoDS; |
126 | myShapeDone : Boolean from Standard; |
127 | myEdgesDone : Boolean from Standard; |
128 | myResultEdgesDone : Boolean from Standard; |
129 | myMapVerLstEdg : IndexedDataMapOfShapeListOfShape from TopTools; |
130 | myMapEdgLstFac : IndexedDataMapOfShapeListOfShape from TopTools; |
131 | myMapLstEdg : DataMapOfIntegerListOfShape from TopTools; |
132 | myMapEdg : DataMapOfIntegerShape from TopTools; |
133 | myMapFaces : DataMapOfShapeShape from TopTools; |
134 | myNbConnexEdge : Integer from Standard; |
135 | myAvoidEdg : IndexedMapOfShape from TopTools; |
136 | -- Modified by IFV 19.04.07 |
137 | myConcatBSpl : Boolean from Standard; -- to enable concatenation of G1 BSpline |
138 | -- edges |
139 | |
140 | end FuseEdges; |