1 -- Created by: Peter KURNEV
2 -- Copyright (c) 2010-2014 OPEN CASCADE SAS
3 -- Copyright (c) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
4 -- Copyright (c) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN, CEDRAT,
5 -- EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
7 -- This file is part of Open CASCADE Technology software library.
9 -- This library is free software; you can redistribute it and/or modify it under
10 -- the terms of the GNU Lesser General Public License version 2.1 as published
11 -- by the Free Software Foundation, with special exception defined in the file
12 -- OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
13 -- distribution for complete text of the license and disclaimer of any warranty.
15 -- Alternatively, this file may be used under the terms of Open CASCADE
16 -- commercial license or contractual agreement.
18 class AlgoTools from BOPTools
27 ShapeEnum from TopAbs,
37 BaseAllocator from BOPCol,
38 ListOfShape from BOPCol,
39 IndexedMapOfShape from BOPCol,
40 IndexedDataMapOfShapeListOfShape from BOPCol,
42 ListOfCoupleOfShape from BOPTools,
49 aV1:Vertex from TopoDS;
51 aTolP2:Real from Standard)
52 returns Integer from Standard;
55 aV1:Vertex from TopoDS;
56 aV2:Vertex from TopoDS)
57 returns Integer from Standard;
60 aLV: out ListOfShape from BOPCol;
61 aV : out Vertex from TopoDS);
64 theCurve:Curve from IntTools;
65 theV1: Vertex from TopoDS;
66 theT1: Real from Standard;
67 theV2: Vertex from TopoDS;
68 theT2: Real from Standard;
69 theTolR3D: Real from Standard;
70 theE :out Edge from TopoDS);
73 theE : Edge from TopoDS;
74 theF1: Face from TopoDS;
75 theF2: Face from TopoDS;
76 theCurve:Curve from IntTools;
77 thePC1:Boolean from Standard;
78 thePC2:Boolean from Standard);
80 MakeContainer(myclass;
81 theType:ShapeEnum from TopAbs;
82 theShape:out Shape from TopoDS);
86 aW: Shape from TopoDS;
87 aF: Shape from TopoDS)
88 returns Boolean from Standard;
90 IsSplitToReverse(myclass;
91 theSplit : Shape from TopoDS;
92 theShape : Shape from TopoDS;
93 theContext:out Context from BOPInt)
94 ---Purpose: Returns True if the shape theSplit has opposite
95 -- direction than theShape
96 -- theContext - cashed geometrical tools
97 returns Boolean from Standard;
99 IsSplitToReverse(myclass;
100 theSplit : Face from TopoDS;
101 theShape : Face from TopoDS;
102 theContext:out Context from BOPInt)
103 ---Purpose: Returns True if normal direction of the face
104 -- theShape is not the same as for the face
106 -- theContext - cashed geometrical tools
107 returns Boolean from Standard;
109 IsSplitToReverse (myclass;
110 aE1: Edge from TopoDS;
111 aE2: Edge from TopoDS;
112 aContext:out Context from BOPInt)
113 returns Boolean from Standard;
116 AreFacesSameDomain(myclass;
117 theF1: Face from TopoDS;
118 theF2: Face from TopoDS;
119 theContext:out Context from BOPInt)
120 returns Boolean from Standard;
122 CheckSameGeom (myclass;
123 theF1: Face from TopoDS;
124 theF2: Face from TopoDS;
125 theContext:out Context from BOPInt)
126 returns Boolean from Standard;
129 theF1: Face from TopoDS;
130 theF2: Face from TopoDS)
131 returns Integer from Standard;
134 theEdge :Edge from TopoDS;
135 theFace :Face from TopoDS;
136 theEdgeOff :out Edge from TopoDS)
137 ---Purpose: Returns True if the face theFace contains
138 -- the edge theEdge but with opposite orientation.
139 -- If the method returns True theEdgeOff is the
141 returns Boolean from Standard;
144 theEdge :Edge from TopoDS;
145 theFace :Face from TopoDS;
146 theLCEF :out ListOfCoupleOfShape from BOPTools;
147 theFaceOff :out Face from TopoDS;
148 theContext :out Context from BOPInt)
149 returns Boolean from Standard;
151 ---Purpose: For the face theFace and its edge theEdge
152 -- finds the face suitable to produce shell.
153 -- theLCEF - set of faces to search. All faces
154 -- from theLCEF must share edge theEdge
156 IsInternalFace(myclass;
157 theFace :Face from TopoDS;
158 theEdge :Edge from TopoDS;
159 theFace1 :Face from TopoDS;
160 theFace2 :Face from TopoDS;
161 theContext:out Context from BOPInt)
162 ---Purpose: Returns True if the face theFace is inside of the
163 -- couple of faces theFace1, theFace2.
164 -- The faces theFace, theFace1, theFace2 must
165 -- share the edge theEdge
166 returns Integer from Standard;
168 IsInternalFace(myclass;
169 theFace :Face from TopoDS;
170 theEdge :Edge from TopoDS;
171 theLF :out ListOfShape from BOPCol;
172 theContext:out Context from BOPInt)
173 ---Purpose: Returns True if the face theFace is inside of the
174 -- appropriate couple of faces (from the set theLF) .
175 -- The faces of the set theLF and theFace must
176 -- share the edge theEdge
177 returns Integer from Standard;
179 IsInternalFace(myclass;
180 theFace :Face from TopoDS;
181 theSolid :Solid from TopoDS;
182 theMEF :out IndexedDataMapOfShapeListOfShape from BOPCol;
183 theTol :Real from Standard;
184 theContext:out Context from BOPInt)
185 ---Purpose: Returns True if the face theFace is inside the
187 -- theMEF - Map Edge/Faces for theSolid
188 -- theTol - value of precision of computation
189 -- theContext- cahed geometrical tools
190 returns Integer from Standard;
193 GetEdgeOnFace (myclass;
194 theEdge :Edge from TopoDS;
195 theFace :Face from TopoDS;
196 theEdgeOnF :out Edge from TopoDS)
197 ---Purpose: For the face theFace gets the edge theEdgeOnF
198 -- that is the same as theEdge
199 -- Returns True if such edge exists
200 -- Returns False if there is no such edge
201 returns Boolean from Standard;
203 ComputeState(myclass;
204 thePoint :Pnt from gp;
205 theSolid :Solid from TopoDS;
206 theTol :Real from Standard;
207 theContext:out Context from BOPInt)
208 ---Purpose: Computes the 3-D state of the point thePoint
209 -- toward solid theSolid.
210 -- theTol - value of precision of computation
211 -- theContext- cahed geometrical tools
212 -- Returns 3-D state.
213 returns State from TopAbs;
215 ComputeState(myclass;
216 theVertex:Vertex from TopoDS;
217 theSolid :Solid from TopoDS;
218 theTol :Real from Standard;
219 theContext:out Context from BOPInt)
220 ---Purpose: Computes the 3-D state of the vertex theVertex
221 -- toward solid theSolid.
222 -- theTol - value of precision of computation
223 -- theContext- cahed geometrical tools
224 -- Returns 3-D state.
225 returns State from TopAbs;
227 ComputeState(myclass;
228 theEdge :Edge from TopoDS;
229 theSolid :Solid from TopoDS;
230 theTol :Real from Standard;
231 theContext:out Context from BOPInt)
232 ---Purpose: Computes the 3-D state of the edge theEdge
233 -- toward solid theSolid.
234 -- theTol - value of precision of computation
235 -- theContext- cahed geometrical tools
236 -- Returns 3-D state.
237 returns State from TopAbs;
239 ComputeState(myclass;
240 theFace :Face from TopoDS;
241 theSolid :Solid from TopoDS;
242 theTol :Real from Standard;
243 theBounds:out IndexedMapOfShape from BOPCol;
244 theContext:out Context from BOPInt)
245 ---Purpose: Computes the 3-D state of the face theFace
246 -- toward solid theSolid.
247 -- theTol - value of precision of computation
248 -- theBounds - set of edges of theFace to avoid
249 -- theContext- cahed geometrical tools
250 -- Returns 3-D state.
251 returns State from TopAbs;
253 ComputeStateByOnePoint(myclass;
254 theShape :Shape from TopoDS;
255 theSolid :Solid from TopoDS;
256 theTol :Real from Standard;
257 theContext:out Context from BOPInt)
258 ---Purpose: Computes the 3-D state of the shape theShape
259 -- toward solid theSolid.
260 -- theTol - value of precision of computation
261 -- theContext- cahed geometrical tools
262 -- Returns 3-D state.
263 returns State from TopAbs;
265 MakeConnexityBlock(myclass;
266 theLS :out ListOfShape from BOPCol;
267 theMapAvoid:out IndexedMapOfShape from BOPCol;
268 theLSCB :out ListOfShape from BOPCol;
269 theAllocator:BaseAllocator from BOPCol);
270 ---Purpose: For the list of faces theLS build block
271 -- theLSCB in terms of connexity by edges
272 -- theMapAvoid - set of edges to avoid for
275 MakeConnexityBlocks(myclass;
276 theS :Shape from TopoDS;
277 theType1 :ShapeEnum from TopAbs;
278 theType2 :ShapeEnum from TopAbs;
279 theLCB :out ListOfShape from BOPCol);
280 ---Purpose: For the compound theS build the blocks
281 -- theLCB (as list of compounds)
282 -- in terms of connexity by the shapes of theType
284 OrientFacesOnShell (myclass;
285 theS :out Shape from TopoDS);
287 CorrectTolerances (myclass;
288 theS: Shape from TopoDS;
289 theTolMax: Real from Standard =0.0001;
290 theRunParallel: Boolean from Standard=Standard_False);
293 --- Provides valid values of tolerances for the shape <theS>
294 --- <theTolMax> is max value of the tolerance that can be
295 --- accepted for correction. If real value of the tolerance
296 --- will be greater than <aTolMax>, the correction does not
299 CorrectCurveOnSurface (myclass;
300 theS: Shape from TopoDS;
301 theTolMax: Real from Standard =0.0001;
302 theRunParallel: Boolean from Standard=Standard_False);
304 --- Provides valid values of tolerances for the shape <theS>
305 --- in terms of BRepCheck_InvalidCurveOnSurface.
307 CorrectPointOnCurve (myclass;
308 theS: Shape from TopoDS;
309 theTolMax: Real from Standard =0.0001;
310 theRunParallel: Boolean from Standard=Standard_False);
312 --- Provides valid values of tolerances for the shape <theS>
313 --- in terms of BRepCheck_InvalidPointOnCurve.
317 --copy from BOPTools_AlgoTools.cdl
318 MakeNewVertex (myclass;
320 aTol: Real from Standard;
321 aNewVertex:out Vertex from TopoDS);
323 --- Make a vertex using 3D-point <aP1> and 3D-tolerance value <aTol>
325 MakeNewVertex (myclass;
326 aV1,aV2: Vertex from TopoDS;
327 aNewVertex:out Vertex from TopoDS);
329 --- Make a vertex using couple of vertices <aV1, aV2>
331 MakeNewVertex (myclass;
332 aE1: Edge from TopoDS;
333 aP1: Real from Standard;
334 aE2: Edge from TopoDS;
335 aP2: Real from Standard;
336 aNewVertex:out Vertex from TopoDS);
338 --- Make a vertex in place of intersection between two edges
339 --- <aE1, aE2> with parameters <aP1, aP2>
341 MakeNewVertex (myclass;
342 aE1: Edge from TopoDS;
343 aP1: Real from Standard;
344 aF2: Face from TopoDS;
345 aNewVertex:out Vertex from TopoDS);
347 --- Make a vertex in place of intersection between the edge <aE1>
348 --- with parameter <aP1> and the face <aF2>
350 PointOnEdge (myclass;
351 aEdge: Edge from TopoDS;
352 aPrm: Real from Standard;
355 --- Compute a 3D-point on the edge <aEdge> at parameter <aPrm>
357 MakeSplitEdge (myclass;
358 aE1: Edge from TopoDS;
359 aV1: Vertex from TopoDS;
360 aP1: Real from Standard;
361 aV2: Vertex from TopoDS;
362 aP2: Real from Standard;
363 aNewEdge:out Edge from TopoDS);
365 --- Make the edge from base edge <aE1> and two vertices <aV1,aV2>
366 --- at parameters <aP1,aP2>
368 MakeSectEdge (myclass;
369 aIC: Curve from IntTools;
370 aV1: Vertex from TopoDS;
371 aP1: Real from Standard;
372 aV2: Vertex from TopoDS;
373 aP2: Real from Standard;
374 aNewEdge:out Edge from TopoDS);
376 --- Make the edge from 3D-Curve <aIC> and two vertices <aV1,aV2>
377 --- at parameters <aP1,aP2>
379 UpdateVertex (myclass;
380 aIC: Curve from IntTools;
381 aT : Real from Standard;
382 aV : Vertex from TopoDS);
384 --- Update the tolerance value for vertex <aV>
385 --- taking into account the fact that <aV> lays on
388 UpdateVertex (myclass;
389 aE : Edge from TopoDS;
390 aT : Real from Standard;
391 aV : Vertex from TopoDS);
393 --- Update the tolerance value for vertex <aV>
394 --- taking into account the fact that <aV> lays on
397 UpdateVertex (myclass;
398 aVF : Vertex from TopoDS;
399 aVN : Vertex from TopoDS);
401 --- Update the tolerance value for vertex <aVN>
402 --- taking into account the fact that <aVN> should
403 --- cover tolerance zone of <aVF>
406 CorrectRange (myclass;
407 aE1: Edge from TopoDS;
408 aE2: Edge from TopoDS;
409 aSR: Range from IntTools;
410 aNewSR:out Range from IntTools);
412 --- Correct shrunk range <aSR> taking into account 3D-curve
413 --- resolution and corresp. tolerances' values of <aE1>, <aE2>
415 CorrectRange (myclass;
416 aE: Edge from TopoDS;
417 aF: Face from TopoDS;
418 aSR: Range from IntTools;
419 aNewSR:out Range from IntTools);
421 --- Correct shrunk range <aSR> taking into account 3D-curve
422 --- resolution and corresp. tolerances' values of <aE>, <aF>
425 IsBlockInOnFace(myclass;
426 aShR : Range from IntTools;
427 aF : Face from TopoDS;
428 aE : Edge from TopoDS;
429 aContext:out Context from BOPInt)
430 returns Boolean from Standard;
432 --- Returns TRUE if PaveBlock <aPB> lays on the face <aF>, i.e
433 --- the <PB> is IN or ON in 2D of <aF>
436 theEdge : Edge from TopoDS;
437 theContext : Context from BOPInt)
438 returns Boolean from Standard;
440 --- Checks if it is possible to compute shrunk range for the edge <aE>.
443 CorrectShapeTolerances (myclass;
444 theS: Shape from TopoDS;
445 theRunParallel: Boolean from Standard=Standard_False);
447 --- Corrects tolerance values of the sub-shapes of the shape <theS> if needed.
451 theS:Shape from TopoDS)
452 returns Integer from Standard;
454 --- Retutns dimension of the shape <theS>.
457 theShell:Shell from TopoDS)
458 returns Boolean from Standard;
459 ---Purpose: Returns true if the shell <theShell> is open
461 IsInvertedSolid(myclass;
462 theSolid:Solid from TopoDS)
463 returns Boolean from Standard;
464 ---Purpose: Returns true if the solid <theSolid> is inverted