4e57c75e |
1 | -- Created by: Peter KURNEV |
973c2be1 |
2 | -- Copyright (c) 2010-2014 OPEN CASCADE SAS |
4e57c75e |
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 |
6 | -- |
973c2be1 |
7 | -- This file is part of Open CASCADE Technology software library. |
4e57c75e |
8 | -- |
d5f74e42 |
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 |
973c2be1 |
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. |
4e57c75e |
14 | -- |
973c2be1 |
15 | -- Alternatively, this file may be used under the terms of Open CASCADE |
16 | -- commercial license or contractual agreement. |
4e57c75e |
17 | |
18 | class AlgoTools from BOPTools |
19 | ---Purpose: |
20 | |
21 | uses |
22 | Pnt from gp, |
23 | Pnt2d from gp, |
24 | Dir from gp, |
25 | Plane from Geom, |
26 | State from TopAbs, |
27 | ShapeEnum from TopAbs, |
28 | Curve from IntTools, |
29 | Shape from TopoDS, |
30 | Vertex from TopoDS, |
31 | Edge from TopoDS, |
32 | Face from TopoDS, |
30ecd5f8 |
33 | Wire from TopoDS, |
34 | Shell from TopoDS, |
4e57c75e |
35 | Solid from TopoDS, |
36 | -- |
37 | BaseAllocator from BOPCol, |
38 | ListOfShape from BOPCol, |
39 | IndexedMapOfShape from BOPCol, |
40 | IndexedDataMapOfShapeListOfShape from BOPCol, |
1e143abb |
41 | Context from IntTools, |
4e57c75e |
42 | ListOfCoupleOfShape from BOPTools, |
43 | Range from IntTools |
44 | |
45 | --raises |
46 | |
47 | is |
48 | ComputeVV(myclass; |
c26b5a34 |
49 | aV1:Vertex from TopoDS; |
50 | aP2:Pnt from gp; |
51 | aTolP2:Real from Standard) |
52 | returns Integer from Standard; |
4e57c75e |
53 | |
54 | ComputeVV(myclass; |
c26b5a34 |
55 | aV1:Vertex from TopoDS; |
56 | aV2:Vertex from TopoDS) |
57 | returns Integer from Standard; |
4e57c75e |
58 | |
59 | MakeVertex (myclass; |
c26b5a34 |
60 | aLV: out ListOfShape from BOPCol; |
61 | aV : out Vertex from TopoDS); |
4e57c75e |
62 | |
63 | MakeEdge(myclass; |
c26b5a34 |
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); |
4e57c75e |
71 | |
72 | MakePCurve(myclass; |
c26b5a34 |
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); |
4e57c75e |
79 | |
80 | MakeContainer(myclass; |
c26b5a34 |
81 | theType:ShapeEnum from TopAbs; |
82 | theShape:out Shape from TopoDS); |
4e57c75e |
83 | |
84 | |
85 | IsHole(myclass; |
c26b5a34 |
86 | aW: Shape from TopoDS; |
87 | aF: Shape from TopoDS) |
88 | returns Boolean from Standard; |
4e57c75e |
89 | |
90 | IsSplitToReverse(myclass; |
c26b5a34 |
91 | theSplit : Shape from TopoDS; |
92 | theShape : Shape from TopoDS; |
1e143abb |
93 | theContext:out Context from IntTools) |
4e57c75e |
94 | ---Purpose: Returns True if the shape theSplit has opposite |
95 | -- direction than theShape |
96 | -- theContext - cashed geometrical tools |
97 | returns Boolean from Standard; |
98 | |
99 | IsSplitToReverse(myclass; |
c26b5a34 |
100 | theSplit : Face from TopoDS; |
101 | theShape : Face from TopoDS; |
1e143abb |
102 | theContext:out Context from IntTools) |
4e57c75e |
103 | ---Purpose: Returns True if normal direction of the face |
104 | -- theShape is not the same as for the face |
105 | -- theSplit |
106 | -- theContext - cashed geometrical tools |
107 | returns Boolean from Standard; |
108 | |
109 | IsSplitToReverse (myclass; |
c26b5a34 |
110 | aE1: Edge from TopoDS; |
111 | aE2: Edge from TopoDS; |
1e143abb |
112 | aContext:out Context from IntTools) |
c26b5a34 |
113 | returns Boolean from Standard; |
4e57c75e |
114 | |
115 | |
116 | AreFacesSameDomain(myclass; |
c26b5a34 |
117 | theF1: Face from TopoDS; |
118 | theF2: Face from TopoDS; |
1e143abb |
119 | theContext:out Context from IntTools) |
c26b5a34 |
120 | returns Boolean from Standard; |
4e57c75e |
121 | |
122 | CheckSameGeom (myclass; |
c26b5a34 |
123 | theF1: Face from TopoDS; |
124 | theF2: Face from TopoDS; |
1e143abb |
125 | theContext:out Context from IntTools) |
c26b5a34 |
126 | returns Boolean from Standard; |
4e57c75e |
127 | |
128 | Sense (myclass; |
c26b5a34 |
129 | theF1: Face from TopoDS; |
130 | theF2: Face from TopoDS) |
131 | returns Integer from Standard; |
4e57c75e |
132 | |
133 | GetEdgeOff (myclass; |
c26b5a34 |
134 | theEdge :Edge from TopoDS; |
135 | theFace :Face from TopoDS; |
136 | theEdgeOff :out Edge from TopoDS) |
4e57c75e |
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 |
140 | -- edge founded |
141 | returns Boolean from Standard; |
142 | |
143 | GetFaceOff(myclass; |
c26b5a34 |
144 | theEdge :Edge from TopoDS; |
145 | theFace :Face from TopoDS; |
146 | theLCEF :out ListOfCoupleOfShape from BOPTools; |
147 | theFaceOff :out Face from TopoDS; |
1e143abb |
148 | theContext :out Context from IntTools) |
c26b5a34 |
149 | returns Boolean from Standard; |
744511c8 |
150 | |
4e57c75e |
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 |
155 | |
156 | IsInternalFace(myclass; |
c26b5a34 |
157 | theFace :Face from TopoDS; |
158 | theEdge :Edge from TopoDS; |
159 | theFace1 :Face from TopoDS; |
160 | theFace2 :Face from TopoDS; |
1e143abb |
161 | theContext:out Context from IntTools) |
4e57c75e |
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 |
744511c8 |
166 | returns Integer from Standard; |
4e57c75e |
167 | |
168 | IsInternalFace(myclass; |
c26b5a34 |
169 | theFace :Face from TopoDS; |
170 | theEdge :Edge from TopoDS; |
171 | theLF :out ListOfShape from BOPCol; |
1e143abb |
172 | theContext:out Context from IntTools) |
4e57c75e |
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 |
744511c8 |
177 | returns Integer from Standard; |
4e57c75e |
178 | |
179 | IsInternalFace(myclass; |
c26b5a34 |
180 | theFace :Face from TopoDS; |
181 | theSolid :Solid from TopoDS; |
182 | theMEF :out IndexedDataMapOfShapeListOfShape from BOPCol; |
183 | theTol :Real from Standard; |
1e143abb |
184 | theContext:out Context from IntTools) |
4e57c75e |
185 | ---Purpose: Returns True if the face theFace is inside the |
186 | -- solid theSolid. |
187 | -- theMEF - Map Edge/Faces for theSolid |
188 | -- theTol - value of precision of computation |
189 | -- theContext- cahed geometrical tools |
744511c8 |
190 | returns Integer from Standard; |
4e57c75e |
191 | |
192 | |
193 | GetEdgeOnFace (myclass; |
c26b5a34 |
194 | theEdge :Edge from TopoDS; |
195 | theFace :Face from TopoDS; |
196 | theEdgeOnF :out Edge from TopoDS) |
4e57c75e |
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; |
202 | |
203 | ComputeState(myclass; |
c26b5a34 |
204 | thePoint :Pnt from gp; |
205 | theSolid :Solid from TopoDS; |
206 | theTol :Real from Standard; |
1e143abb |
207 | theContext:out Context from IntTools) |
4e57c75e |
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; |
214 | |
215 | ComputeState(myclass; |
c26b5a34 |
216 | theVertex:Vertex from TopoDS; |
217 | theSolid :Solid from TopoDS; |
218 | theTol :Real from Standard; |
1e143abb |
219 | theContext:out Context from IntTools) |
4e57c75e |
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; |
226 | |
227 | ComputeState(myclass; |
c26b5a34 |
228 | theEdge :Edge from TopoDS; |
229 | theSolid :Solid from TopoDS; |
230 | theTol :Real from Standard; |
1e143abb |
231 | theContext:out Context from IntTools) |
4e57c75e |
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; |
238 | |
239 | ComputeState(myclass; |
c26b5a34 |
240 | theFace :Face from TopoDS; |
241 | theSolid :Solid from TopoDS; |
242 | theTol :Real from Standard; |
243 | theBounds:out IndexedMapOfShape from BOPCol; |
1e143abb |
244 | theContext:out Context from IntTools) |
4e57c75e |
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; |
252 | |
253 | ComputeStateByOnePoint(myclass; |
c26b5a34 |
254 | theShape :Shape from TopoDS; |
255 | theSolid :Solid from TopoDS; |
256 | theTol :Real from Standard; |
1e143abb |
257 | theContext:out Context from IntTools) |
4e57c75e |
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; |
264 | |
265 | MakeConnexityBlock(myclass; |
c26b5a34 |
266 | theLS :out ListOfShape from BOPCol; |
267 | theMapAvoid:out IndexedMapOfShape from BOPCol; |
268 | theLSCB :out ListOfShape from BOPCol; |
269 | theAllocator:BaseAllocator from BOPCol); |
4e57c75e |
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 |
273 | -- the treatment |
274 | |
275 | MakeConnexityBlocks(myclass; |
c26b5a34 |
276 | theS :Shape from TopoDS; |
277 | theType1 :ShapeEnum from TopAbs; |
278 | theType2 :ShapeEnum from TopAbs; |
279 | theLCB :out ListOfShape from BOPCol); |
4e57c75e |
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 |
283 | |
284 | OrientFacesOnShell (myclass; |
c26b5a34 |
285 | theS :out Shape from TopoDS); |
4e57c75e |
286 | |
287 | CorrectTolerances (myclass; |
c26b5a34 |
288 | theS: Shape from TopoDS; |
289 | theTolMax: Real from Standard =0.0001; |
290 | theRunParallel: Boolean from Standard=Standard_False); |
291 | |
4e57c75e |
292 | ---Purpose: |
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 |
297 | --- perform. |
298 | --- |
299 | CorrectCurveOnSurface (myclass; |
c26b5a34 |
300 | theS: Shape from TopoDS; |
301 | theTolMax: Real from Standard =0.0001; |
302 | theRunParallel: Boolean from Standard=Standard_False); |
4e57c75e |
303 | ---Purpose: |
304 | --- Provides valid values of tolerances for the shape <theS> |
305 | --- in terms of BRepCheck_InvalidCurveOnSurface. |
306 | --- |
307 | CorrectPointOnCurve (myclass; |
c26b5a34 |
308 | theS: Shape from TopoDS; |
309 | theTolMax: Real from Standard =0.0001; |
310 | theRunParallel: Boolean from Standard=Standard_False); |
4e57c75e |
311 | ---Purpose: |
312 | --- Provides valid values of tolerances for the shape <theS> |
313 | --- in terms of BRepCheck_InvalidPointOnCurve. |
314 | --- |
315 | --fields |
df017cc9 |
316 | |
4e57c75e |
317 | --copy from BOPTools_AlgoTools.cdl |
318 | MakeNewVertex (myclass; |
c26b5a34 |
319 | aP1 : Pnt from gp; |
320 | aTol: Real from Standard; |
321 | aNewVertex:out Vertex from TopoDS); |
4e57c75e |
322 | ---Purpose: |
323 | --- Make a vertex using 3D-point <aP1> and 3D-tolerance value <aTol> |
324 | --- |
325 | MakeNewVertex (myclass; |
326 | aV1,aV2: Vertex from TopoDS; |
327 | aNewVertex:out Vertex from TopoDS); |
328 | ---Purpose: |
329 | --- Make a vertex using couple of vertices <aV1, aV2> |
330 | --- |
331 | MakeNewVertex (myclass; |
c26b5a34 |
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); |
4e57c75e |
337 | ---Purpose: |
338 | --- Make a vertex in place of intersection between two edges |
339 | --- <aE1, aE2> with parameters <aP1, aP2> |
340 | --- |
341 | MakeNewVertex (myclass; |
c26b5a34 |
342 | aE1: Edge from TopoDS; |
343 | aP1: Real from Standard; |
344 | aF2: Face from TopoDS; |
345 | aNewVertex:out Vertex from TopoDS); |
4e57c75e |
346 | ---Purpose: |
347 | --- Make a vertex in place of intersection between the edge <aE1> |
348 | --- with parameter <aP1> and the face <aF2> |
349 | --- |
350 | PointOnEdge (myclass; |
c26b5a34 |
351 | aEdge: Edge from TopoDS; |
352 | aPrm: Real from Standard; |
353 | aP:out Pnt from gp); |
4e57c75e |
354 | ---Purpose: |
355 | --- Compute a 3D-point on the edge <aEdge> at parameter <aPrm> |
356 | --- |
357 | MakeSplitEdge (myclass; |
c26b5a34 |
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); |
4e57c75e |
364 | ---Purpose: |
365 | --- Make the edge from base edge <aE1> and two vertices <aV1,aV2> |
366 | --- at parameters <aP1,aP2> |
367 | --- |
368 | MakeSectEdge (myclass; |
c26b5a34 |
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); |
4e57c75e |
375 | ---Purpose: |
376 | --- Make the edge from 3D-Curve <aIC> and two vertices <aV1,aV2> |
377 | --- at parameters <aP1,aP2> |
378 | --- |
379 | UpdateVertex (myclass; |
c26b5a34 |
380 | aIC: Curve from IntTools; |
381 | aT : Real from Standard; |
382 | aV : Vertex from TopoDS); |
4e57c75e |
383 | ---Purpose: |
384 | --- Update the tolerance value for vertex <aV> |
385 | --- taking into account the fact that <aV> lays on |
386 | --- the curve <aIC> |
387 | --- |
388 | UpdateVertex (myclass; |
c26b5a34 |
389 | aE : Edge from TopoDS; |
390 | aT : Real from Standard; |
391 | aV : Vertex from TopoDS); |
4e57c75e |
392 | ---Purpose: |
393 | --- Update the tolerance value for vertex <aV> |
394 | --- taking into account the fact that <aV> lays on |
395 | --- the edge <aE> |
396 | --- |
397 | UpdateVertex (myclass; |
c26b5a34 |
398 | aVF : Vertex from TopoDS; |
399 | aVN : Vertex from TopoDS); |
4e57c75e |
400 | ---Purpose: |
401 | --- Update the tolerance value for vertex <aVN> |
402 | --- taking into account the fact that <aVN> should |
403 | --- cover tolerance zone of <aVF> |
404 | --- |
405 | |
406 | CorrectRange (myclass; |
c26b5a34 |
407 | aE1: Edge from TopoDS; |
408 | aE2: Edge from TopoDS; |
409 | aSR: Range from IntTools; |
410 | aNewSR:out Range from IntTools); |
4e57c75e |
411 | ---Purpose: |
412 | --- Correct shrunk range <aSR> taking into account 3D-curve |
413 | --- resolution and corresp. tolerances' values of <aE1>, <aE2> |
414 | --- |
415 | CorrectRange (myclass; |
c26b5a34 |
416 | aE: Edge from TopoDS; |
417 | aF: Face from TopoDS; |
418 | aSR: Range from IntTools; |
419 | aNewSR:out Range from IntTools); |
4e57c75e |
420 | ---Purpose: |
421 | --- Correct shrunk range <aSR> taking into account 3D-curve |
422 | --- resolution and corresp. tolerances' values of <aE>, <aF> |
423 | --- |
424 | |
425 | IsBlockInOnFace(myclass; |
c26b5a34 |
426 | aShR : Range from IntTools; |
427 | aF : Face from TopoDS; |
428 | aE : Edge from TopoDS; |
1e143abb |
429 | aContext:out Context from IntTools) |
c26b5a34 |
430 | returns Boolean from Standard; |
4e57c75e |
431 | ---Purpose: |
432 | --- Returns TRUE if PaveBlock <aPB> lays on the face <aF>, i.e |
433 | --- the <PB> is IN or ON in 2D of <aF> |
434 | |
4e57c75e |
435 | IsMicroEdge(myclass; |
c26b5a34 |
436 | theEdge : Edge from TopoDS; |
1e143abb |
437 | theContext : Context from IntTools) |
c26b5a34 |
438 | returns Boolean from Standard; |
4e57c75e |
439 | ---Purpose: |
440 | --- Checks if it is possible to compute shrunk range for the edge <aE>. |
441 | --- |
442 | |
443 | CorrectShapeTolerances (myclass; |
c26b5a34 |
444 | theS: Shape from TopoDS; |
445 | theRunParallel: Boolean from Standard=Standard_False); |
4e57c75e |
446 | ---Purpose: |
447 | --- Corrects tolerance values of the sub-shapes of the shape <theS> if needed. |
448 | --- |
449 | |
450 | Dimension(myclass; |
c26b5a34 |
451 | theS:Shape from TopoDS) |
452 | returns Integer from Standard; |
4e57c75e |
453 | ---Purpose: |
454 | --- Retutns dimension of the shape <theS>. |
30ecd5f8 |
455 | |
456 | IsOpenShell(myclass; |
c26b5a34 |
457 | theShell:Shell from TopoDS) |
458 | returns Boolean from Standard; |
459 | ---Purpose: Returns true if the shell <theShell> is open |
30ecd5f8 |
460 | |
461 | IsInvertedSolid(myclass; |
c26b5a34 |
462 | theSolid:Solid from TopoDS) |
463 | returns Boolean from Standard; |
464 | ---Purpose: Returns true if the solid <theSolid> is inverted |
465 | |
4e57c75e |
466 | end AlgoTools; |