b311480e |
1 | -- Created on: 1994-10-10 |
2 | -- Created by: Jean Yves LEBEY |
3 | -- Copyright (c) 1994-1999 Matra Datavision |
4 | -- Copyright (c) 1999-2012 OPEN CASCADE SAS |
5 | -- |
6 | -- The content of this file is subject to the Open CASCADE Technology Public |
7 | -- License Version 6.5 (the "License"). You may not use the content of this file |
8 | -- except in compliance with the License. Please obtain a copy of the License |
9 | -- at http://www.opencascade.org and read it completely before using this file. |
10 | -- |
11 | -- The Initial Developer of the Original Code is Open CASCADE S.A.S., having its |
12 | -- main offices at: 1, place des Freres Montgolfier, 78280 Guyancourt, France. |
13 | -- |
14 | -- The Original Code and all software distributed under the License is |
15 | -- distributed on an "AS IS" basis, without warranty of any kind, and the |
16 | -- Initial Developer hereby disclaims all such warranties, including without |
17 | -- limitation, any warranties of merchantability, fitness for a particular |
18 | -- purpose or non-infringement. Please see the License for the specific terms |
19 | -- and conditions governing the rights and limitations under the License. |
20 | |
7fd59977 |
21 | |
22 | class FacesFiller from TopOpeBRep |
23 | |
24 | ---Purpose: Fills a DataStructure from TopOpeBRepDS with the result |
25 | -- of Face/Face instersection described by FacesIntersector from TopOpeBRep. |
26 | -- if the faces have same Domain, record it in the DS. |
27 | -- else record lines and points and attach list of interferences |
28 | -- to the faces, the lines and the edges. |
29 | |
30 | uses |
31 | |
32 | Orientation from TopAbs, |
33 | ShapeEnum from TopAbs, |
34 | State from TopAbs, |
35 | Shape from TopoDS, |
36 | Face from TopoDS, |
37 | Edge from TopoDS, |
38 | ListOfShape from TopTools, |
39 | DataMapOfShapeListOfShape from TopTools, |
40 | Pnt from gp, |
41 | Vec from gp, |
42 | Curve from Geom, |
43 | Curve from Geom2d, |
44 | |
45 | ShapeTool from TopOpeBRepTool, |
46 | PShapeClassifier from TopOpeBRepTool, |
47 | FacesIntersector from TopOpeBRep, |
48 | PFacesIntersector from TopOpeBRep, |
49 | PointGeomTool from TopOpeBRep, |
50 | PointClassifier from TopOpeBRep, |
51 | LineInter from TopOpeBRep, |
52 | PLineInter from TopOpeBRep, |
53 | VPointInter from TopOpeBRep, |
54 | VPointInterIterator from TopOpeBRep, |
55 | VPointInterClassifier from TopOpeBRep, |
56 | FFTransitionTool from TopOpeBRep, |
57 | FFDumper from TopOpeBRep, |
58 | |
59 | Interference from TopOpeBRepDS, |
60 | ListOfInterference from TopOpeBRepDS, |
61 | ListIteratorOfListOfInterference from TopOpeBRepDS, |
62 | InterferenceTool from TopOpeBRepDS, |
63 | PointIterator from TopOpeBRepDS, |
64 | Transition from TopOpeBRepDS, |
65 | Kind from TopOpeBRepDS, |
66 | HDataStructure from TopOpeBRepDS, |
67 | DataStructure from TopOpeBRepDS, |
68 | PDataStructure from TopOpeBRepDS, |
69 | Curve from TopOpeBRepDS, |
70 | Point from TopOpeBRepDS |
71 | |
72 | is |
73 | |
74 | Create returns FacesFiller from TopOpeBRep; |
75 | |
76 | Insert(me : in out; F1,F2 : Shape from TopoDS; |
77 | FACINT : in out FacesIntersector from TopOpeBRep; |
78 | HDS : HDataStructure from TopOpeBRepDS) is static; |
79 | ---Purpose: Stores in <DS> the intersections of <S1> and <S2>. |
80 | |
81 | ProcessSectionEdges(me : in out); |
82 | |
83 | ChangePointClassifier(me : in out) |
84 | returns PointClassifier from TopOpeBRep; |
85 | ---C++: return & |
86 | |
87 | PShapeClassifier(me) returns PShapeClassifier from TopOpeBRepTool; |
88 | ---Purpose: return field myPShapeClassifier. |
89 | |
90 | SetPShapeClassifier(me : in out; PSC : PShapeClassifier from TopOpeBRepTool); |
91 | ---Purpose: set field myPShapeClassifier. |
92 | |
93 | -- ------- |
94 | -- private |
95 | -- ------- |
96 | |
97 | LoadLine(me : in out; L : in out LineInter from TopOpeBRep) is static; |
98 | -- Complete informations given on intersection line. |
99 | -- Set current intersection line to process myLine to <L>. |
100 | |
101 | CheckLine(me; L : in out LineInter from TopOpeBRep) |
102 | returns Boolean is static; |
103 | |
104 | VP_Position(me : in out; FACINT : in out FacesIntersector from TopOpeBRep) |
105 | ---Purpose: compute position of VPoints of lines |
106 | is static; |
107 | |
108 | VP_Position(me : in out; L : in out LineInter from TopOpeBRep) |
109 | ---Purpose: compute position of VPoints of line L |
110 | is static; |
111 | |
112 | VP_PositionOnL(me : in out; L : in out LineInter from TopOpeBRep) |
113 | ---Purpose: compute position of VPoints of non-restriction line L. |
114 | is static; |
115 | |
116 | VP_PositionOnR(me : in out; L : in out LineInter from TopOpeBRep) |
117 | ---Purpose: compute position of VPoints of restriction line L. |
118 | is static; |
119 | |
120 | VP_Position(me : in out; VP : in out VPointInter from TopOpeBRep; |
121 | VPC : in out VPointInterClassifier from TopOpeBRep) |
122 | is static; |
123 | ---Purpose: compute position of VP with current faces, |
124 | -- according to VP.ShapeIndex() . |
125 | |
126 | -- -------------------------------- |
127 | -- current line (myLine) processing |
128 | -- -------------------------------- |
129 | |
130 | ProcessLine(me : in out) is static; |
131 | ---Purpose: Process current intersection line (set by LoadLine) |
132 | |
133 | ResetDSC(me : in out) is static; |
134 | |
135 | ProcessRLine(me : in out) is static; |
136 | ---Purpose: Process current restriction line, adding restriction edge |
137 | -- and computing face/edge interference. |
138 | |
139 | FillLineVPonR(me : in out) is static; |
140 | ---Purpose: VP processing for restriction line and line sharing |
141 | -- same domain with section edges : |
142 | -- - if restriction : |
143 | -- Adds restriction edges as section edges and compute |
144 | -- face/edge interference. |
145 | -- - if same domain : |
146 | -- If line share same domain with section edges, compute |
147 | -- parts of line IN/IN the two faces, and compute curve/point |
148 | -- interference for VP boundaries. |
149 | |
150 | |
151 | FillLine(me : in out) is static; |
152 | |
153 | AddShapesLine(me : in out) is static; |
154 | ---Purpose: compute 3d curve, pcurves and face/curve interferences |
155 | -- for current NDSC. Add them to the DS. |
156 | |
157 | GetESL(me : in out; LES : out ListOfShape from TopTools) is static; |
158 | ---Purpose: Get map <mapES > of restriction edges having parts IN one |
159 | -- of the 2 faces. |
160 | |
161 | KeepRLine(me; |
162 | Lrest : LineInter from TopOpeBRep; |
163 | checkkeep : Boolean) |
164 | returns Boolean is static private; |
165 | |
166 | ProcessVPR(me : in out; |
167 | FF : in out FacesFiller from TopOpeBRep; |
168 | VP : VPointInter from TopOpeBRep); |
169 | ---Purpose: calling the followings ProcessVPIonR and ProcessVPonR. |
170 | |
171 | ProcessVPIonR(me : in out; VPI : in out VPointInterIterator from TopOpeBRep; |
172 | trans1 : Transition from TopOpeBRepDS; F1 : Shape from TopoDS; |
173 | ShapeIndex : Integer) |
174 | is static; |
175 | ---Purpose: processing ProcessVPonR for VPI. |
176 | |
177 | ProcessVPonR(me : in out; VP : VPointInter from TopOpeBRep; |
178 | trans1 : Transition from TopOpeBRepDS; F1 : Shape from TopoDS; |
179 | ShapeIndex : Integer) |
180 | is static; |
181 | ---Purpose: adds <VP>'s geometric point (if not stored) and |
182 | -- computes (curve or edge)/(point or vertex) interference. |
183 | |
184 | ProcessVPonclosingR(me : in out; VP : VPointInter from TopOpeBRep; |
185 | F1 : Shape from TopoDS; ShapeIndex : Integer; |
186 | transEdge : Transition from TopOpeBRepDS; |
187 | PVKind : Kind from TopOpeBRepDS; PVIndex : Integer; |
188 | EPIfound : Boolean; IEPI : Interference from TopOpeBRepDS) |
189 | is static; |
190 | ---Purpose: VP processing on closing arc. |
191 | |
192 | ProcessVPondgE(me : in out; VP : VPointInter from TopOpeBRep; |
193 | ShapeIndex : Integer; |
194 | PVKind : out Kind from TopOpeBRepDS; PVIndex : out Integer; |
195 | EPIfound : out Boolean; IEPI : out Interference from TopOpeBRepDS; |
196 | CPIfound : out Boolean; ICPI : out Interference from TopOpeBRepDS) |
197 | returns Boolean is static; |
198 | ---Purpose: VP processing on degenerated arc. |
199 | |
200 | ProcessVPInotonR(me : in out; VPI : in out VPointInterIterator from TopOpeBRep) |
201 | is static; |
202 | ---Purpose: processing ProcessVPnotonR for VPI. |
203 | |
204 | ProcessVPnotonR(me : in out; VP : VPointInter from TopOpeBRep) |
205 | is static; |
206 | ---Purpose: adds <VP>'s geometrical point to the DS (if not stored) |
207 | -- and computes curve point interference. |
208 | |
209 | GetGeometry(me : in out; |
210 | IT : in out ListIteratorOfListOfInterference from TopOpeBRepDS; |
211 | VP : VPointInter from TopOpeBRep; |
212 | G : in out Integer; K : in out Kind from TopOpeBRepDS) |
213 | returns Boolean is static; |
214 | ---Purpose: |
215 | -- Get the geometry of a DS point <DSP>. |
216 | -- Search for it with ScanInterfList (previous method). |
217 | -- if found, set <G> to the geometry of the interference found. |
218 | -- else, add the point <DSP> in the <DS> and set <G> to the |
219 | -- value of the new geometry such created. |
220 | -- returns the value of ScanInterfList(). |
221 | |
222 | MakeGeometry(me : in out; VP : VPointInter from TopOpeBRep; |
223 | ShapeIndex : Integer; K : in out Kind from TopOpeBRepDS) |
224 | returns Integer is static; |
225 | |
226 | StoreCurveInterference(me : in out; I : Interference from TopOpeBRepDS) |
227 | is static; |
228 | ---Purpose: |
229 | -- Add interference <I> to list myDSCIL. |
230 | -- on a given line, at first call, add a new DS curve. |
231 | |
232 | GetFFGeometry(me; DSP : Point from TopOpeBRepDS; K : out Kind; G : in out Integer) |
233 | returns Boolean is static; |
234 | ---Purpose: search for G = geometry of Point which is identical to <DSP> |
235 | -- among the DS Points created in the CURRENT face/face |
236 | -- intersection ( current Insert() call). |
237 | |
238 | GetFFGeometry(me; VP : VPointInter from TopOpeBRep; K : out Kind; G : in out Integer) |
239 | returns Boolean is static; |
240 | ---Purpose: search for G = geometry of Point which is identical to <VP> |
241 | -- among the DS Points created in the CURRENT face/face |
242 | -- intersection ( current Insert() call). |
243 | |
244 | GetEdgeTrans(me : in out; |
245 | VP : VPointInter from TopOpeBRep; |
246 | PVKind : Kind from TopOpeBRepDS; |
247 | PVIndex : Integer; |
248 | Sind : Integer; |
249 | F : Face from TopoDS) |
250 | returns Transition from TopOpeBRepDS is static private; |
251 | |
252 | StateVPonFace(me; |
253 | VP : VPointInter from TopOpeBRep) |
254 | returns State from TopAbs is static private; |
255 | ---Purpose: If <VP>'s index != 3, calls a classifier to determine |
256 | -- <VP>'s state on the face. |
257 | |
258 | PequalVPonR(me; |
259 | P3D : Pnt from gp; |
260 | VPshapeindex : Integer; |
261 | VP : in out VPointInter from TopOpeBRep; |
262 | Lrest : in out LineInter from TopOpeBRep) |
263 | returns Boolean is static private; |
264 | ---Purpose: <VP> is of geometry <P>. |
265 | -- Looks after a VPoint on RESTRICTION <Lrest> with |
266 | -- geometric value <P>. If true, updates states ON for <VP>. |
267 | |
268 | StBipVPonF(me; |
269 | IVPf, IVPl : VPointInter from TopOpeBRep; |
270 | Lrest : LineInter from TopOpeBRep; |
271 | isonedge1 : Boolean) |
272 | returns State from TopAbs is static private; |
273 | ---Purpose: Classifies (VPf, VPl) middle point on restriction edge |
274 | |
275 | ChangeFacesIntersector(me:in out) returns FacesIntersector is static; |
276 | ---C++: return & |
277 | |
278 | HDataStructure(me:in out) returns HDataStructure is static; |
279 | |
280 | ChangeDataStructure(me:in out) returns DataStructure is static; |
281 | ---C++: return & |
282 | |
283 | Face(me;I:Integer) returns Face from TopoDS is static; |
284 | ---C++: return const & |
285 | |
286 | FaceFaceTransition(me;L:LineInter;I:Integer) |
287 | returns Transition from TopOpeBRepDS; |
288 | ---C++: return const & |
289 | -- transition from face I(1,2) through line L with face (2,1) |
290 | |
291 | FaceFaceTransition(me;I:Integer) |
292 | returns Transition from TopOpeBRepDS; |
293 | ---C++: return const & |
294 | -- transition from face I(1,2) through current line with face (2,1) |
295 | |
296 | PFacesIntersectorDummy(me) returns PFacesIntersector from TopOpeBRep; |
297 | PDataStructureDummy(me) returns PDataStructure from TopOpeBRepDS; |
298 | PLineInterDummy(me) returns PLineInter from TopOpeBRep; |
299 | |
300 | SetTraceIndex(me:in out; exF1,exF2 : Integer) is static; |
301 | GetTraceIndex(me; exF1,exF2 : out Integer) is static; |
302 | -- <exf1,exf2> TopExp_Explorer exploration index of faces F1,F2 |
303 | -- in ancestors shapes. (trace) |
304 | |
305 | ------------------------- |
306 | -- Class methods : |
307 | ------------------------- |
308 | |
309 | Lminmax(myclass; L : LineInter from TopOpeBRep; |
310 | pmin, pmax : out Real); |
311 | ---Purpose: Computes <pmin> and <pmax> the upper and lower bounds of <L> |
312 | -- enclosing all vpoints. |
313 | |
314 | LSameDomainERL(myclass; L : LineInter from TopOpeBRep; |
315 | ERL : ListOfShape from TopTools) returns Boolean; |
316 | ---Purpose: Returns <True> if <L> shares a same geometric domain with |
317 | -- at least one of the section edges of <ERL>. |
318 | |
319 | |
320 | IsVPtransLok(myclass; L : LineInter from TopOpeBRep; |
321 | iVP, SI12 : Integer; |
322 | T : out Transition from TopOpeBRepDS) |
323 | returns Boolean; |
324 | ---Purpose: Computes the transition <T> of the VPoint <iVP> on the edge |
325 | -- of <SI12>. Returns <False> if the status is unknown. |
326 | |
327 | TransvpOK(myclass; L : LineInter from TopOpeBRep; |
328 | iVP, SI : Integer; |
329 | isINOUT : Boolean) returns Boolean; |
330 | ---Purpose: Computes transition on line for VP<iVP> on edge |
331 | -- restriction of <SI>. If <isINOUT> : returns <true> if |
332 | -- transition computed is IN/OUT else : returns <true> if |
333 | -- transition computed is OUT/IN. |
334 | |
335 | VPParamOnER(myclass; vp : VPointInter from TopOpeBRep; |
336 | Lrest : LineInter from TopOpeBRep) returns Real; |
337 | ---Purpose: Returns parameter u of vp on the restriction edge. |
338 | |
339 | EqualpPonR(myclass; Lrest : LineInter from TopOpeBRep; |
340 | VP1, VP2 : VPointInter from TopOpeBRep) returns Boolean; |
341 | |
342 | EqualpP(myclass; L : LineInter from TopOpeBRep; |
343 | iVP1, iVP2 : Integer) returns Boolean; |
344 | |
345 | fields |
346 | |
347 | -- input |
348 | myF1 : Face from TopoDS; |
349 | myF2 : Face from TopoDS; |
350 | myF1ori : Orientation from TopAbs; |
351 | myF2ori : Orientation from TopAbs; |
352 | myFacesIntersector : PFacesIntersector from TopOpeBRep; |
353 | |
354 | myHDS : HDataStructure from TopOpeBRepDS; |
355 | myDS : PDataStructure from TopOpeBRepDS; |
356 | |
357 | -- current face/face intersection |
358 | myFFfirstDSP : Integer; |
359 | -- First DS point created by current face/face intersection |
360 | |
361 | -- current line |
362 | myLine : PLineInter from TopOpeBRep; |
363 | myLineOK : Boolean; |
364 | myLineINL : Boolean; -- Is Null Length |
365 | myLineTonF1 : Transition from TopOpeBRepDS; |
366 | myLineTonF2 : Transition from TopOpeBRepDS; |
367 | myLineIsonEdge : Boolean; |
368 | myERL : ListOfShape from TopTools; |
369 | -- Stores the restriction edges found by the current faces intersector. |
370 | |
371 | myDataforDegenEd : DataMapOfShapeListOfShape from TopTools; |
372 | -- If the line describes a VP on degenerated edge, stores |
373 | -- the vertex, the degenerated edge, the couture edge on same |
374 | -- shape. |
375 | |
376 | myLastVPison0 : Boolean;-- only for walking. |
377 | mykeptVPnbr : Boolean; -- number of current line's VP kept |
378 | |
379 | -- curve on current line |
380 | myDSCIndex : Integer; |
381 | myDSCIL : ListOfInterference from TopOpeBRepDS; |
382 | |
383 | -- tools |
384 | myPointClassifier : PointClassifier from TopOpeBRep; |
385 | myPShapeClassifier : PShapeClassifier from TopOpeBRepTool; |
386 | |
387 | -- trace |
388 | myexF1,myexF2 : Integer; |
389 | myHFFD : FFDumper from TopOpeBRep; |
390 | |
391 | end FacesFiller from TopOpeBRep; |