1 -- Created by: Peter KURNEV
2 -- Copyright (c) 2010-2012 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 -- The content of this file is subject to the Open CASCADE Technology Public
8 -- License Version 6.5 (the "License"). You may not use the content of this file
9 -- except in compliance with the License. Please obtain a copy of the License
10 -- at http://www.opencascade.org and read it completely before using this file.
12 -- The Initial Developer of the Original Code is Open CASCADE S.A.S., having its
13 -- main offices at: 1, place des Freres Montgolfier, 78280 Guyancourt, France.
15 -- The Original Code and all software distributed under the License is
16 -- distributed on an "AS IS" basis, without warranty of any kind, and the
17 -- Initial Developer hereby disclaims all such warranties, including without
18 -- limitation, any warranties of merchantability, fitness for a particular
19 -- purpose or non-infringement. Please see the License for the specific terms
20 -- and conditions governing the rights and limitations under the License.
22 class AlgoTools from BOPTools
31 ShapeEnum from TopAbs,
40 BaseAllocator from BOPCol,
41 ListOfShape from BOPCol,
42 IndexedMapOfShape from BOPCol,
43 IndexedDataMapOfShapeListOfShape from BOPCol,
45 ListOfCoupleOfShape from BOPTools,
52 aV1:Vertex from TopoDS;
54 aTolP2:Real from Standard)
55 returns Integer from Standard;
58 aV1:Vertex from TopoDS;
59 aV2:Vertex from TopoDS)
60 returns Integer from Standard;
63 aLV: out ListOfShape from BOPCol;
64 aV : out Vertex from TopoDS);
67 theCurve:Curve from IntTools;
68 theV1: Vertex from TopoDS;
69 theT1: Real from Standard;
70 theV2: Vertex from TopoDS;
71 theT2: Real from Standard;
72 theTolR3D: Real from Standard;
73 theE :out Edge from TopoDS);
76 theE : Edge from TopoDS;
77 theF1: Face from TopoDS;
78 theF2: Face from TopoDS;
79 theCurve:Curve from IntTools;
80 thePC1:Boolean from Standard;
81 thePC2:Boolean from Standard);
83 MakeContainer(myclass;
84 theType:ShapeEnum from TopAbs;
85 theShape:out Shape from TopoDS);
89 aW: Shape from TopoDS;
90 aF: Shape from TopoDS)
91 returns Boolean from Standard;
93 IsSplitToReverse(myclass;
94 theSplit : Shape from TopoDS;
95 theShape : Shape from TopoDS;
96 theContext:out Context from BOPInt)
97 ---Purpose: Returns True if the shape theSplit has opposite
98 -- direction than theShape
99 -- theContext - cashed geometrical tools
100 returns Boolean from Standard;
102 IsSplitToReverse(myclass;
103 theSplit : Face from TopoDS;
104 theShape : Face from TopoDS;
105 theContext:out Context from BOPInt)
106 ---Purpose: Returns True if normal direction of the face
107 -- theShape is not the same as for the face
109 -- theContext - cashed geometrical tools
110 returns Boolean from Standard;
112 IsSplitToReverse (myclass;
113 aE1: Edge from TopoDS;
114 aE2: Edge from TopoDS;
115 aContext:out Context from BOPInt)
116 returns Boolean from Standard;
119 AreFacesSameDomain(myclass;
120 theF1: Face from TopoDS;
121 theF2: Face from TopoDS;
122 theContext:out Context from BOPInt)
123 returns Boolean from Standard;
125 CheckSameGeom (myclass;
126 theF1: Face from TopoDS;
127 theF2: Face from TopoDS;
128 theContext:out Context from BOPInt)
129 returns Boolean from Standard;
132 theF1: Face from TopoDS;
133 theF2: Face from TopoDS)
134 returns Integer from Standard;
137 theEdge :Edge from TopoDS;
138 theFace :Face from TopoDS;
139 theEdgeOff :out Edge from TopoDS)
140 ---Purpose: Returns True if the face theFace contains
141 -- the edge theEdge but with opposite orientation.
142 -- If the method returns True theEdgeOff is the
144 returns Boolean from Standard;
147 theEdge :Edge from TopoDS;
148 theFace :Face from TopoDS;
149 theLCEF :out ListOfCoupleOfShape from BOPTools;
150 theFaceOff :out Face from TopoDS;
151 theContext :out Context from BOPInt);
152 ---Purpose: For the face theFace and its edge theEdge
153 -- finds the face suitable to produce shell.
154 -- theLCEF - set of faces to search. All faces
155 -- from theLCEF must share edge theEdge
157 IsInternalFace(myclass;
158 theFace :Face from TopoDS;
159 theEdge :Edge from TopoDS;
160 theFace1 :Face from TopoDS;
161 theFace2 :Face from TopoDS;
162 theContext:out Context from BOPInt)
163 ---Purpose: Returns True if the face theFace is inside of the
164 -- couple of faces theFace1, theFace2.
165 -- The faces theFace, theFace1, theFace2 must
166 -- share the edge theEdge
167 returns Boolean from Standard;
169 IsInternalFace(myclass;
170 theFace :Face from TopoDS;
171 theEdge :Edge from TopoDS;
172 theLF :out ListOfShape from BOPCol;
173 theContext:out Context from BOPInt)
174 ---Purpose: Returns True if the face theFace is inside of the
175 -- appropriate couple of faces (from the set theLF) .
176 -- The faces of the set theLF and theFace must
177 -- share the edge theEdge
178 returns Boolean from Standard;
180 IsInternalFace(myclass;
181 theFace :Face from TopoDS;
182 theSolid :Solid from TopoDS;
183 theMEF :out IndexedDataMapOfShapeListOfShape from BOPCol;
184 theTol :Real from Standard;
185 theContext:out Context from BOPInt)
186 ---Purpose: Returns True if the face theFace is inside the
188 -- theMEF - Map Edge/Faces for theSolid
189 -- theTol - value of precision of computation
190 -- theContext- cahed geometrical tools
191 returns Boolean from Standard;
194 GetEdgeOnFace (myclass;
195 theEdge :Edge from TopoDS;
196 theFace :Face from TopoDS;
197 theEdgeOnF :out Edge from TopoDS)
198 ---Purpose: For the face theFace gets the edge theEdgeOnF
199 -- that is the same as theEdge
200 -- Returns True if such edge exists
201 -- Returns False if there is no such edge
202 returns Boolean from Standard;
204 ComputeState(myclass;
205 thePoint :Pnt from gp;
206 theSolid :Solid from TopoDS;
207 theTol :Real from Standard;
208 theContext:out Context from BOPInt)
209 ---Purpose: Computes the 3-D state of the point thePoint
210 -- toward solid theSolid.
211 -- theTol - value of precision of computation
212 -- theContext- cahed geometrical tools
213 -- Returns 3-D state.
214 returns State from TopAbs;
216 ComputeState(myclass;
217 theVertex:Vertex from TopoDS;
218 theSolid :Solid from TopoDS;
219 theTol :Real from Standard;
220 theContext:out Context from BOPInt)
221 ---Purpose: Computes the 3-D state of the vertex theVertex
222 -- toward solid theSolid.
223 -- theTol - value of precision of computation
224 -- theContext- cahed geometrical tools
225 -- Returns 3-D state.
226 returns State from TopAbs;
228 ComputeState(myclass;
229 theEdge :Edge from TopoDS;
230 theSolid :Solid from TopoDS;
231 theTol :Real from Standard;
232 theContext:out Context from BOPInt)
233 ---Purpose: Computes the 3-D state of the edge theEdge
234 -- toward solid theSolid.
235 -- theTol - value of precision of computation
236 -- theContext- cahed geometrical tools
237 -- Returns 3-D state.
238 returns State from TopAbs;
240 ComputeState(myclass;
241 theFace :Face from TopoDS;
242 theSolid :Solid from TopoDS;
243 theTol :Real from Standard;
244 theBounds:out IndexedMapOfShape from BOPCol;
245 theContext:out Context from BOPInt)
246 ---Purpose: Computes the 3-D state of the face theFace
247 -- toward solid theSolid.
248 -- theTol - value of precision of computation
249 -- theBounds - set of edges of theFace to avoid
250 -- theContext- cahed geometrical tools
251 -- Returns 3-D state.
252 returns State from TopAbs;
254 ComputeStateByOnePoint(myclass;
255 theShape :Shape from TopoDS;
256 theSolid :Solid from TopoDS;
257 theTol :Real from Standard;
258 theContext:out Context from BOPInt)
259 ---Purpose: Computes the 3-D state of the shape theShape
260 -- toward solid theSolid.
261 -- theTol - value of precision of computation
262 -- theContext- cahed geometrical tools
263 -- Returns 3-D state.
264 returns State from TopAbs;
266 MakeConnexityBlock(myclass;
267 theLS :out ListOfShape from BOPCol;
268 theMapAvoid:out IndexedMapOfShape from BOPCol;
269 theLSCB :out ListOfShape from BOPCol;
270 theAllocator:BaseAllocator from BOPCol);
271 ---Purpose: For the list of faces theLS build block
272 -- theLSCB in terms of connexity by edges
273 -- theMapAvoid - set of edges to avoid for
276 MakeConnexityBlocks(myclass;
277 theS :Shape from TopoDS;
278 theType1 :ShapeEnum from TopAbs;
279 theType2 :ShapeEnum from TopAbs;
280 theLCB :out ListOfShape from BOPCol);
281 ---Purpose: For the compound theS build the blocks
282 -- theLCB (as list of compounds)
283 -- in terms of connexity by the shapes of theType
285 OrientFacesOnShell (myclass;
286 theS :out Shape from TopoDS);
288 CorrectTolerances (myclass;
289 theS: Shape from TopoDS;
290 theTolMax: Real from Standard =0.0001);
292 --- Provides valid values of tolerances for the shape <theS>
293 --- <theTolMax> is max value of the tolerance that can be
294 --- accepted for correction. If real value of the tolerance
295 --- will be greater than <aTolMax>, the correction does not
298 CorrectCurveOnSurface (myclass;
299 theS: Shape from TopoDS;
300 theTolMax: Real from Standard =0.0001);
302 --- Provides valid values of tolerances for the shape <theS>
303 --- in terms of BRepCheck_InvalidCurveOnSurface.
305 CorrectPointOnCurve (myclass;
306 theS: Shape from TopoDS;
307 theTolMax: Real from Standard =0.0001);
309 --- Provides valid values of tolerances for the shape <theS>
310 --- in terms of BRepCheck_InvalidPointOnCurve.
314 CorrectPoint (myclass;
316 thePL:Plane from Geom;
317 theNewPnt:out Pnt from gp);
319 --copy from BOPTools_AlgoTools.cdl
320 MakeNewVertex (myclass;
322 aTol: Real from Standard;
323 aNewVertex:out Vertex from TopoDS);
325 --- Make a vertex using 3D-point <aP1> and 3D-tolerance value <aTol>
327 MakeNewVertex (myclass;
328 aV1,aV2: Vertex from TopoDS;
329 aNewVertex:out Vertex from TopoDS);
331 --- Make a vertex using couple of vertices <aV1, aV2>
333 MakeNewVertex (myclass;
334 aE1: Edge from TopoDS;
335 aP1: Real from Standard;
336 aE2: Edge from TopoDS;
337 aP2: Real from Standard;
338 aNewVertex:out Vertex from TopoDS);
340 --- Make a vertex in place of intersection between two edges
341 --- <aE1, aE2> with parameters <aP1, aP2>
343 MakeNewVertex (myclass;
344 aE1: Edge from TopoDS;
345 aP1: Real from Standard;
346 aF2: Face from TopoDS;
347 aNewVertex:out Vertex from TopoDS);
349 --- Make a vertex in place of intersection between the edge <aE1>
350 --- with parameter <aP1> and the face <aF2>
352 PointOnEdge (myclass;
353 aEdge: Edge from TopoDS;
354 aPrm: Real from Standard;
357 --- Compute a 3D-point on the edge <aEdge> at parameter <aPrm>
359 MakeSplitEdge (myclass;
360 aE1: Edge from TopoDS;
361 aV1: Vertex from TopoDS;
362 aP1: Real from Standard;
363 aV2: Vertex from TopoDS;
364 aP2: Real from Standard;
365 aNewEdge:out Edge from TopoDS);
367 --- Make the edge from base edge <aE1> and two vertices <aV1,aV2>
368 --- at parameters <aP1,aP2>
370 MakeSectEdge (myclass;
371 aIC: Curve from IntTools;
372 aV1: Vertex from TopoDS;
373 aP1: Real from Standard;
374 aV2: Vertex from TopoDS;
375 aP2: Real from Standard;
376 aNewEdge:out Edge from TopoDS);
378 --- Make the edge from 3D-Curve <aIC> and two vertices <aV1,aV2>
379 --- at parameters <aP1,aP2>
381 UpdateVertex (myclass;
382 aIC: Curve from IntTools;
383 aT : Real from Standard;
384 aV : Vertex from TopoDS);
386 --- Update the tolerance value for vertex <aV>
387 --- taking into account the fact that <aV> lays on
390 UpdateVertex (myclass;
391 aE : Edge from TopoDS;
392 aT : Real from Standard;
393 aV : Vertex from TopoDS);
395 --- Update the tolerance value for vertex <aV>
396 --- taking into account the fact that <aV> lays on
399 UpdateVertex (myclass;
400 aVF : Vertex from TopoDS;
401 aVN : Vertex from TopoDS);
403 --- Update the tolerance value for vertex <aVN>
404 --- taking into account the fact that <aVN> should
405 --- cover tolerance zone of <aVF>
408 CorrectRange (myclass;
409 aE1: Edge from TopoDS;
410 aE2: Edge from TopoDS;
411 aSR: Range from IntTools;
412 aNewSR:out Range from IntTools);
414 --- Correct shrunk range <aSR> taking into account 3D-curve
415 --- resolution and corresp. tolerances' values of <aE1>, <aE2>
417 CorrectRange (myclass;
418 aE: Edge from TopoDS;
419 aF: Face from TopoDS;
420 aSR: Range from IntTools;
421 aNewSR:out Range from IntTools);
423 --- Correct shrunk range <aSR> taking into account 3D-curve
424 --- resolution and corresp. tolerances' values of <aE>, <aF>
427 IsBlockInOnFace(myclass;
428 aShR : Range from IntTools;
429 aF : Face from TopoDS;
430 aE : Edge from TopoDS;
431 aContext:out Context from BOPInt)
432 returns Boolean from Standard;
434 --- Returns TRUE if PaveBlock <aPB> lays on the face <aF>, i.e
435 --- the <PB> is IN or ON in 2D of <aF>
438 GetProjectPoint(myclass;
439 aF : Face from TopoDS;
441 aF1 : Face from TopoDS;
442 aPF1 : out Pnt from gp;
443 aDNF1 : out Dir from gp;
444 theContext : out Context from BOPInt)
445 returns Boolean from Standard;
447 --- Computes projection of the point <aP> on the face <theFace>.
448 --- Returns TRUE if projection is done.
451 theEdge : Edge from TopoDS;
452 theContext : Context from BOPInt)
453 returns Boolean from Standard;
455 --- Checks if it is possible to compute shrunk range for the edge <aE>.
458 CorrectShapeTolerances (myclass;
459 theS: Shape from TopoDS);
461 --- Corrects tolerance values of the sub-shapes of the shape <theS> if needed.
465 theS:Shape from TopoDS)
466 returns Integer from Standard;
468 --- Retutns dimension of the shape <theS>.