7fd59977 |
1 | -- File: TopOpeBRepBuild_ShapeSet.cdl |
2 | -- Created: Wed Jun 16 11:52:45 1993 |
3 | -- Author: Jean Yves LEBEY |
4 | -- <jyl@zerox> |
5 | ---Copyright: Matra Datavision 1993 |
6 | |
7 | class ShapeSet from TopOpeBRepBuild |
8 | |
9 | ---Purpose: |
10 | -- Auxiliary class providing an exploration of a set |
11 | -- of shapes to build faces or solids. |
12 | -- To build faces : shapes are wires, elements are edges. |
13 | -- To build solids : shapes are shells, elements are faces. |
14 | -- The ShapeSet stores a list of shapes, a list of elements |
15 | -- to start reconstructions, and a map to search neighbours. |
16 | -- The map stores the connection between elements through |
17 | -- subshapes of type <SubShapeType> given in constructor. |
18 | -- <SubShapeType> is : |
19 | -- - TopAbs_VERTEX to connect edges |
20 | -- - TopAbs_EDGE to connect faces |
21 | -- |
22 | -- Signature needed by the BlockBuilder : |
23 | -- InitStartElements(me : in out) |
24 | -- MoreStartElements(me) returns Boolean; |
25 | -- NextStartElement(me : in out); |
26 | -- StartElement(me) returns Shape; ---C++: return const & |
27 | -- InitNeighbours(me : in out; S : Shape); |
28 | -- MoreNeighbours(me) returns Boolean; |
29 | -- NextNeighbour(me : in out); |
30 | -- Neighbour(me) returns Shape; ---C++: return const & |
31 | |
32 | uses |
33 | |
34 | ShapeEnum from TopAbs, |
35 | Orientation from TopAbs, |
36 | Shape from TopoDS, |
37 | ListOfShape from TopTools, |
38 | ListIteratorOfListOfShape from TopTools, |
39 | IndexedDataMapOfShapeListOfShape from TopTools, |
40 | IndexedMapOfOrientedShape from TopTools, |
41 | ShapeExplorer from TopOpeBRepTool, |
42 | AsciiString from TCollection |
43 | |
44 | is |
45 | |
46 | -- Filling methods |
47 | |
48 | Create (SubShapeType:ShapeEnum from TopAbs; |
49 | checkshape:Boolean = Standard_True) returns ShapeSet; |
50 | ---Purpose: Creates a ShapeSet in order to build shapes connected |
51 | -- by <SubShapeType> shapes. |
52 | -- <checkshape>:check (or not) the shapes, startelements, elements added. |
53 | |
54 | Delete(me:out) is virtual; |
55 | ---C++: alias "Standard_EXPORT virtual ~TopOpeBRepBuild_ShapeSet(){Delete() ; }" |
56 | |
57 | AddShape(me:in out;S:Shape) is virtual; |
58 | ---Purpose: Adds <S> to the list of shapes. (wires or shells). |
59 | |
60 | AddStartElement(me:in out;S:Shape) is virtual; |
61 | ---Purpose: (S is a face or edge) |
62 | -- Add S to the list of starting shapes used for reconstructions. |
63 | -- apply AddElement(S). |
64 | |
65 | AddElement(me:in out;S:Shape) is virtual; |
66 | ---Purpose: for each subshape SE of S of type mySubShapeType |
67 | -- - Add subshapes of S to the map of subshapes (mySubShapeMap) |
68 | -- - Add S to the list of shape incident to subshapes of S. |
69 | |
70 | ProcessAddShape(me:in out;S:Shape) is static protected; |
71 | ProcessAddStartElement(me:in out;S:Shape) is static protected; |
72 | ProcessAddElement(me:in out;S:Shape) is static protected; |
73 | |
74 | StartElements(me) returns ListOfShape from TopTools; |
75 | ---Purpose: return a reference on myStartShapes |
76 | ---C++: return const & |
77 | |
78 | -- Iteration on the shapes of AddShape() |
79 | InitShapes(me:in out); |
80 | MoreShapes(me) returns Boolean; |
81 | NextShape(me:in out); |
82 | Shape(me) returns Shape; |
83 | ---C++: return const & |
84 | |
85 | -- Iteration on the start elements of AddStartElement() |
86 | InitStartElements(me:in out); |
87 | MoreStartElements(me) returns Boolean; |
88 | NextStartElement(me:in out); |
89 | StartElement(me) returns Shape; |
90 | ---C++: return const & |
91 | |
92 | -- Iteration on the neighbours of a shape of type myShapeType |
93 | -- through its subshapes of type mySubShapeType. |
94 | |
95 | InitNeighbours(me:in out;S:Shape) is virtual; |
96 | MoreNeighbours(me:in out) returns Boolean; |
97 | NextNeighbour(me:in out); |
98 | Neighbour(me) returns Shape; |
99 | ---C++: return const & |
100 | |
101 | ChangeStartShapes(me:in out) returns ListOfShape from TopTools; |
102 | ---C++: return & |
103 | |
104 | IsStartElement(me;S:Shape) returns Boolean; |
105 | IsElement(me;S:Shape) returns Boolean; |
106 | IsShape(me;S:Shape) returns Boolean; |
107 | |
108 | NStartElement(me;S:Shape) returns Integer; |
109 | NElement(me;S:Shape) returns Integer; |
110 | NShape(me;S:Shape) returns Integer; |
111 | |
112 | FindNeighbours(me:in out) is virtual; |
113 | ---Purpose: Build the list of neighbour shapes of myCurrentShape |
114 | -- (neighbour shapes and myCurrentShapes are of type t) |
115 | -- Initialize myIncidentShapesIter on neighbour shapes. |
116 | MakeNeighboursList(me:in out;E,V:Shape) returns ListOfShape from TopTools is virtual; |
117 | ---C++: return const & |
118 | MaxNumberSubShape(me:in out;Shape:Shape) returns Integer; |
119 | |
120 | -- check |
121 | CheckShape(me:in out;checkshape:Boolean); -- field myCheckShape |
122 | CheckShape(me) returns Boolean; -- field myCheckShape |
123 | CheckShape(me:in out;S:Shape;checkgeom:Boolean = Standard_False) returns Boolean; |
124 | |
125 | -- debug |
126 | DumpName(me;OS:in out OStream;str:AsciiString); |
127 | DumpCheck(me;OS:in out OStream;str:AsciiString;S:Shape;chk:Boolean); |
128 | DumpSS(me:in out) is virtual; |
129 | DumpBB(me:in out) is virtual; |
130 | |
131 | DEBName(me:in out;N:AsciiString); |
132 | DEBName(me) returns AsciiString; |
133 | ---C++: return const & |
134 | DEBNumber(me:in out;I:Integer); |
135 | DEBNumber(me) returns Integer; |
136 | |
137 | SName(me;S:Shape;sb:AsciiString="";sa:AsciiString="") |
138 | returns AsciiString is virtual; |
139 | SNameori(me;S:Shape;sb:AsciiString="";sa:AsciiString="") |
140 | returns AsciiString is virtual; |
141 | SName(me;S:ListOfShape from TopTools;sb:AsciiString="";sa:AsciiString="") |
142 | returns AsciiString is virtual; |
143 | SNameori(me;S:ListOfShape from TopTools;sb:AsciiString="";sa:AsciiString="") |
144 | returns AsciiString is virtual; |
145 | |
146 | fields |
147 | |
148 | myShapeType : ShapeEnum from TopAbs is protected; |
149 | -- shape type : edge |
150 | -- shape type : face |
151 | |
152 | mySubShapeType : ShapeEnum from TopAbs is protected; |
153 | -- subshape type : vertex |
154 | -- subshape type : edge |
155 | |
156 | mySubShapeExplorer : ShapeExplorer from TopOpeBRepTool is protected; |
157 | -- explorer of edge vertices |
158 | -- explorer of face edges |
159 | |
160 | myStartShapes : ListOfShape from TopTools is protected; |
161 | -- list of starting edges |
162 | -- list of starting faces |
163 | |
164 | myStartShapesIter : ListIteratorOfListOfShape from TopTools is protected; |
165 | -- myStartShapes iterator |
166 | |
167 | mySubShapeMap : IndexedDataMapOfShapeListOfShape from TopTools is protected; |
168 | -- map of vertices |
169 | -- mySubShapeMap(vertex) = list of incident edges to a vertex |
170 | -- mySubShapeMap(edge) = list of incident faces to a edge |
171 | |
172 | myIncidentShapesIter : ListIteratorOfListOfShape from TopTools is protected; |
173 | -- iter on list L of edges incident to a vertex, L = mySubShapeMap(vertex) |
174 | -- iter on list L of faces incident to a edge, L = mySubShapeMap(edge) |
175 | |
176 | myShapes : ListOfShape from TopTools is protected; |
177 | -- list of wires which are not to be reconstructed |
178 | -- list of shells which are not to be reconstructed |
179 | |
180 | myShapesIter : ListIteratorOfListOfShape from TopTools is protected; |
181 | -- myShapes iterator |
182 | |
183 | myCurrentShape : Shape from TopoDS is protected; |
184 | -- current edge which neighbours are searched, using FindNeighbours() |
185 | -- current face which neighbours are searched, using FindNeighbours() |
186 | |
187 | myCurrentShapeNeighbours : ListOfShape from TopTools is protected; |
188 | -- list of edges neighbour of the edge myCurrentShape |
189 | -- list of faces neighbour of the face myCurrentShape |
190 | |
191 | -- debug |
192 | myDEBNumber : Integer from Standard is protected; |
193 | myDEBName : AsciiString is protected; |
194 | |
195 | -- index of subshape is given by mySubShape |
196 | myOMSS : IndexedMapOfOrientedShape from TopTools is protected; -- AddStartElement |
197 | myOMES : IndexedMapOfOrientedShape from TopTools is protected; -- AddElement (+AddStartElement) |
198 | myOMSH : IndexedMapOfOrientedShape from TopTools is protected; -- AddShape |
199 | |
200 | myCheckShape : Boolean from Standard is protected; |
201 | |
202 | end ShapeSet from TopOpeBRepBuild; |