1 -- Created on: 1993-01-11
2 -- Created by: Christophe MARION
3 -- Copyright (c) 1993-1999 Matra Datavision
4 -- Copyright (c) 1999-2014 OPEN CASCADE SAS
6 -- This file is part of Open CASCADE Technology software library.
8 -- This library is free software; you can redistribute it and/or modify it under
9 -- the terms of the GNU Lesser General Public License version 2.1 as published
10 -- by the Free Software Foundation, with special exception defined in the file
11 -- OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
12 -- distribution for complete text of the license and disclaimer of any warranty.
14 -- Alternatively, this file may be used under the terms of Open CASCADE
15 -- commercial license or contractual agreement.
17 class Data from HLRBRep inherits TShared from MMgt
20 Address from Standard,
21 Integer from Standard,
22 Boolean from Standard,
23 ShortReal from Standard,
25 Array1OfInteger from TColStd,
29 CurveType from GeomAbs,
30 SurfaceType from GeomAbs,
32 Orientation from TopAbs,
33 IndexedMapOfShape from TopTools,
34 IntersectionPoint from IntRes2d,
35 Interference from HLRAlgo,
36 InterferenceList from HLRAlgo,
37 Projector from HLRAlgo,
38 EdgeData from HLRBRep,
39 FaceData from HLRBRep,
40 Array1OfEData from HLRBRep,
41 Array1OfFData from HLRBRep,
42 FaceIterator from HLRBRep,
43 EdgeFaceTool from HLRBRep,
44 Intersector from HLRBRep,
49 TopolTool from BRepTopAdaptor,
50 MapOfShapeTool from BRepTopAdaptor
54 UndefinedDerivative from StdFail
58 -- Method to load or edit the Data Structure
61 Create(NV, NE, NF : Integer from Standard)
62 ---Purpose: Create an empty data structure of <NV> vertices,
63 -- <NE> edges and <NF> faces.
64 returns Data from HLRBRep;
66 Write(me : mutable; DS : Data from HLRBRep;
67 dv,de,df : Integer from Standard)
68 ---Purpose: Write <DS> in me with a translation of
72 EDataArray(me : mutable) returns Array1OfEData from HLRBRep
77 FDataArray(me : mutable) returns Array1OfFData from HLRBRep
82 Tolerance(me : mutable; tol : ShortReal from Standard)
84 ---Purpose: Set the tolerance for the rejections during the
88 Tolerance(me) returns ShortReal from Standard
90 ---Purpose: returns the tolerance for the rejections during
94 Update(me : mutable; P : Projector from HLRAlgo)
95 ---Purpose: end of building of the Data and updating
96 -- all the informations linked to the projection.
99 Projector(me : mutable) returns Projector from HLRAlgo
105 -- Methods to query the Data
108 NbVertices(me) returns Integer from Standard
112 NbEdges(me) returns Integer from Standard
116 NbFaces(me) returns Integer from Standard
120 EdgeMap(me : mutable) returns IndexedMapOfShape from TopTools
125 FaceMap(me : mutable) returns IndexedMapOfShape from TopTools
131 -- Exploration of non rejected visible edges
134 InitBoundSort(me : mutable;
135 MinMaxTot : Address from Standard;
136 e1,e2 : Integer from Standard)
137 ---Purpose: to compare with only non rejected edges.
140 InitEdge(me : mutable; FI : Integer from Standard;
141 MST: in out MapOfShapeTool from BRepTopAdaptor)
142 ---Purpose: Begin an iteration only on visible Edges
143 -- crossing the face number <FI>.
146 MoreEdge(me : mutable) returns Boolean from Standard
149 NextEdge(me : mutable; skip : Boolean from Standard = Standard_True)
152 Edge(me) returns Integer from Standard
153 ---Purpose: Returns the current Edge
156 HidingTheFace(me) returns Boolean from Standard
158 ---Purpose: Returns true if the current edge to be hidden
159 -- belongs to the hiding face.
162 SimpleHidingFace(me) returns Boolean from Standard
164 ---Purpose: Returns true if the current hiding face is not an
165 -- auto-intersected one.
169 -- Intersection of current edge with face
172 InitInterference(me : mutable)
173 ---Purpose: Intersect the current Edge with the boundary of
174 -- the hiding face. The interferences are given by
175 -- the More, Next, and Value methods.
178 MoreInterference(me) returns Boolean from Standard
182 NextInterference(me : mutable)
185 RejectedInterference(me : mutable) returns Boolean from Standard
186 ---Purpose: Returns True if the interference is rejected.
189 AboveInterference(me : mutable) returns Boolean from Standard
190 ---Purpose: Returns True if the rejected interference is above
194 Interference(me : mutable) returns Interference from HLRAlgo
199 LocalLEGeometry2D(me : mutable; Param : Real from Standard;
200 Tg : out Dir2d from gp;
201 Nm : out Dir2d from gp;
202 Cu : out Real from Standard)
203 ---Purpose: Returns the local description of the projection of
204 -- the current LEdge at parameter <Param>.
206 UndefinedDerivative from StdFail
209 LocalFEGeometry2D(me : mutable; FE : Integer from Standard;
210 Param : Real from Standard;
211 Tg : out Dir2d from gp;
212 Nm : out Dir2d from gp;
213 Cu : out Real from Standard)
214 ---Purpose: Returns the local description of the projection of
215 -- the current FEdge at parameter <Param>.
217 UndefinedDerivative from StdFail
220 EdgeState(me : mutable; p1,p2 : Real from Standard;
221 stbef, staf : out State from TopAbs)
222 ---Purpose: Returns the local 3D state of the intersection
223 -- between the current edge and the current face at the
224 -- <p1> and <p2> parameters.
227 EdgeOfTheHidingFace(me; E : Integer from Standard;
228 ED : EdgeData from HLRBRep)
229 returns Boolean from Standard
230 ---Purpose: Returns the true if the Edge <ED> belongs to the
235 HidingStartLevel(me : mutable; E : Integer from Standard;
236 ED : EdgeData from HLRBRep;
237 IL : InterferenceList from HLRAlgo)
238 returns Integer from Standard
239 ---Purpose: Returns the number of levels of hiding face above
240 -- the first point of the edge <ED>. The
241 -- InterferenceList is given to compute far away of
242 -- the Interferences and then come back.
245 Compare(me : mutable; E : Integer from Standard;
246 ED : EdgeData from HLRBRep)
247 returns State from TopAbs
248 ---Purpose: Returns the state of the Edge <ED> after
252 SimplClassify(me : mutable; E : Integer from Standard;
253 ED : EdgeData from HLRBRep;
254 Nbp : Integer from Standard;
255 p1, p2 : Real from Standard)
256 returns State from TopAbs;
257 ---Purpose: Simple classification of part of edge [p1, p2]
258 -- returns OUT if at least 1 of Nbp points of edge is out
259 -- othewise returns IN
260 -- It is used to check "suspision" hided part of edge.
262 -- The following methods are private
264 OrientOutLine(me : mutable; I : Integer from Standard;
265 FD : out FaceData from HLRBRep)
266 returns Boolean from Standard
267 ---Purpose: Orient the OutLines ( left must be inside in
268 -- projection ). Returns True if the face of a closed
269 -- shell has been inverted;
272 OrientOthEdge(me : mutable; I : Integer from Standard;
273 FD : out FaceData from HLRBRep)
274 ---Purpose: Orient the Edges which are not Internal OutLine,
275 -- not Double and not IsoLine.
278 Classify(me : mutable; E : Integer from Standard;
279 ED : EdgeData from HLRBRep;
280 LevelFlag : Boolean from Standard;
281 Level : out Integer from Standard;
282 param : Real from Standard)
283 returns State from TopAbs;
284 ---Purpose: Classification of an edge.
286 RejectedPoint(me : mutable; PInter : IntersectionPoint from IntRes2d;
287 BoundOri : Orientation from TopAbs;
288 NumSeg : Integer from Standard) --- -1 if Point else NumSegment
289 returns Boolean from Standard
290 ---Purpose: Returns True if the intersection is rejected.
293 SameVertex(me : mutable; head1,head2 : Boolean from Standard)
294 returns Boolean from Standard
295 ---Purpose: returns True if there is a common vertex between
296 -- myLE and myFE dependig on <head1> and <head2>.
299 Destroy(me: mutable);
305 -- basic data : Vertices, Edges, Faces
306 myNbVertices : Integer from Standard;
307 myNbEdges : Integer from Standard;
308 myNbFaces : Integer from Standard;
309 myEMap : IndexedMapOfShape from TopTools;
310 myFMap : IndexedMapOfShape from TopTools;
311 myEData : Array1OfEData from HLRBRep;
312 myFData : Array1OfFData from HLRBRep;
313 myEdgeIndices : Array1OfInteger from TColStd;
314 myToler : ShortReal from Standard;
315 myProj : Projector from HLRAlgo;
316 myLLProps : CLProps from HLRBRep;
317 myFLProps : CLProps from HLRBRep;
318 mySLProps : SLProps from HLRBRep;
319 myBigSize : Real from Standard;
322 myFaceItr1 : FaceIterator from HLRBRep;
323 myFaceItr2 : FaceIterator from HLRBRep;
325 -- Current hiding face
326 iFace : Integer from Standard;
327 iFaceData : Address from Standard;
328 iFaceGeom : Address from Standard;
329 iFaceMinMax : Address from Standard;
330 iFaceType : SurfaceType from GeomAbs;
331 iFaceBack : Boolean from Standard;
332 iFaceSimp : Boolean from Standard;
333 iFaceSmpl : Boolean from Standard;
334 iFaceTest : Boolean from Standard;
336 -- Exploration of edges to be hidden
337 myHideCount : Integer from Standard;
338 myDeca : Real from Standard[16];
339 mySurD : Real from Standard[16];
340 myCurSortEd : Integer from Standard;
341 myNbrSortEd : Integer from Standard;
343 -- Current hidden edge, to be intersected
344 myLE : Integer from Standard;
345 myLEOutLine : Boolean from Standard;
346 myLEInternal : Boolean from Standard;
347 myLEDouble : Boolean from Standard;
348 myLEIsoLine : Boolean from Standard;
349 myLEData : Address from Standard;
350 myLEGeom : Address from Standard;
351 myLEMinMax : Address from Standard;
352 myLEType : CurveType from GeomAbs;
353 myLETol : ShortReal from Standard;
355 -- Exploration of hiding face for intersection
356 myFE : Integer from Standard;
357 myFEOri : Orientation from TopAbs;
358 myFEOutLine : Boolean from Standard;
359 myFEInternal : Boolean from Standard;
360 myFEDouble : Boolean from Standard;
361 myFEData : Address from Standard;
362 myFEGeom : Address from Standard;
363 myFEType : CurveType from GeomAbs;
364 myFETol : ShortReal from Standard;
367 myIntersector : Intersector from HLRBRep;
368 myClassifier : TopolTool from BRepTopAdaptor;
369 mySameVertex : Boolean from Standard;
370 myIntersected : Boolean from Standard;
371 myNbPoints : Integer from Standard;
372 myNbSegments : Integer from Standard;
373 iInterf : Integer from Standard;
374 myIntf : Interference from HLRAlgo;
375 myAboveIntf : Boolean from Standard;
377 myReject : Address from Standard;