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);
291 --- Provides valid values of tolerances for the shape <theS>
292 --- <theTolMax> is max value of the tolerance that can be
293 --- accepted for correction. If real value of the tolerance
294 --- will be greater than <aTolMax>, the correction does not
297 CorrectCurveOnSurface (myclass;
298 theS: Shape from TopoDS;
299 theTolMax: Real from Standard =0.0001);
301 --- Provides valid values of tolerances for the shape <theS>
302 --- in terms of BRepCheck_InvalidCurveOnSurface.
304 CorrectPointOnCurve (myclass;
305 theS: Shape from TopoDS;
306 theTolMax: Real from Standard =0.0001);
308 --- Provides valid values of tolerances for the shape <theS>
309 --- in terms of BRepCheck_InvalidPointOnCurve.
313 --copy from BOPTools_AlgoTools.cdl
314 MakeNewVertex (myclass;
316 aTol: Real from Standard;
317 aNewVertex:out Vertex from TopoDS);
319 --- Make a vertex using 3D-point <aP1> and 3D-tolerance value <aTol>
321 MakeNewVertex (myclass;
322 aV1,aV2: Vertex from TopoDS;
323 aNewVertex:out Vertex from TopoDS);
325 --- Make a vertex using couple of vertices <aV1, aV2>
327 MakeNewVertex (myclass;
328 aE1: Edge from TopoDS;
329 aP1: Real from Standard;
330 aE2: Edge from TopoDS;
331 aP2: Real from Standard;
332 aNewVertex:out Vertex from TopoDS);
334 --- Make a vertex in place of intersection between two edges
335 --- <aE1, aE2> with parameters <aP1, aP2>
337 MakeNewVertex (myclass;
338 aE1: Edge from TopoDS;
339 aP1: Real from Standard;
340 aF2: Face from TopoDS;
341 aNewVertex:out Vertex from TopoDS);
343 --- Make a vertex in place of intersection between the edge <aE1>
344 --- with parameter <aP1> and the face <aF2>
346 PointOnEdge (myclass;
347 aEdge: Edge from TopoDS;
348 aPrm: Real from Standard;
351 --- Compute a 3D-point on the edge <aEdge> at parameter <aPrm>
353 MakeSplitEdge (myclass;
354 aE1: Edge from TopoDS;
355 aV1: Vertex from TopoDS;
356 aP1: Real from Standard;
357 aV2: Vertex from TopoDS;
358 aP2: Real from Standard;
359 aNewEdge:out Edge from TopoDS);
361 --- Make the edge from base edge <aE1> and two vertices <aV1,aV2>
362 --- at parameters <aP1,aP2>
364 MakeSectEdge (myclass;
365 aIC: Curve from IntTools;
366 aV1: Vertex from TopoDS;
367 aP1: Real from Standard;
368 aV2: Vertex from TopoDS;
369 aP2: Real from Standard;
370 aNewEdge:out Edge from TopoDS);
372 --- Make the edge from 3D-Curve <aIC> and two vertices <aV1,aV2>
373 --- at parameters <aP1,aP2>
375 UpdateVertex (myclass;
376 aIC: Curve from IntTools;
377 aT : Real from Standard;
378 aV : Vertex from TopoDS);
380 --- Update the tolerance value for vertex <aV>
381 --- taking into account the fact that <aV> lays on
384 UpdateVertex (myclass;
385 aE : Edge from TopoDS;
386 aT : Real from Standard;
387 aV : Vertex from TopoDS);
389 --- Update the tolerance value for vertex <aV>
390 --- taking into account the fact that <aV> lays on
393 UpdateVertex (myclass;
394 aVF : Vertex from TopoDS;
395 aVN : Vertex from TopoDS);
397 --- Update the tolerance value for vertex <aVN>
398 --- taking into account the fact that <aVN> should
399 --- cover tolerance zone of <aVF>
402 CorrectRange (myclass;
403 aE1: Edge from TopoDS;
404 aE2: Edge from TopoDS;
405 aSR: Range from IntTools;
406 aNewSR:out Range from IntTools);
408 --- Correct shrunk range <aSR> taking into account 3D-curve
409 --- resolution and corresp. tolerances' values of <aE1>, <aE2>
411 CorrectRange (myclass;
412 aE: Edge from TopoDS;
413 aF: Face from TopoDS;
414 aSR: Range from IntTools;
415 aNewSR:out Range from IntTools);
417 --- Correct shrunk range <aSR> taking into account 3D-curve
418 --- resolution and corresp. tolerances' values of <aE>, <aF>
421 IsBlockInOnFace(myclass;
422 aShR : Range from IntTools;
423 aF : Face from TopoDS;
424 aE : Edge from TopoDS;
425 aContext:out Context from BOPInt)
426 returns Boolean from Standard;
428 --- Returns TRUE if PaveBlock <aPB> lays on the face <aF>, i.e
429 --- the <PB> is IN or ON in 2D of <aF>
432 theEdge : Edge from TopoDS;
433 theContext : Context from BOPInt)
434 returns Boolean from Standard;
436 --- Checks if it is possible to compute shrunk range for the edge <aE>.
439 CorrectShapeTolerances (myclass;
440 theS: Shape from TopoDS);
442 --- Corrects tolerance values of the sub-shapes of the shape <theS> if needed.
446 theS:Shape from TopoDS)
447 returns Integer from Standard;
449 --- Retutns dimension of the shape <theS>.
452 theShell:Shell from TopoDS)
453 returns Boolean from Standard;
454 ---Purpose: Returns true if the shell <theShell> is open
456 IsInvertedSolid(myclass;
457 theSolid:Solid from TopoDS)
458 returns Boolean from Standard;
459 ---Purpose: Returns true if the solid <theSolid> is inverted