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 #ifndef _BOPTools_AlgoTools_HeaderFile
19 #define _BOPTools_AlgoTools_HeaderFile
21 #include <Standard.hxx>
22 #include <Standard_DefineAlloc.hxx>
23 #include <Standard_Handle.hxx>
25 #include <Standard_Boolean.hxx>
26 #include <Standard_Integer.hxx>
27 #include <Standard_Real.hxx>
28 #include <BOPTools_ListOfCoupleOfShape.hxx>
29 #include <BOPTools_ListOfConnexityBlock.hxx>
30 #include <NCollection_BaseAllocator.hxx>
31 #include <TopAbs_State.hxx>
32 #include <TopAbs_ShapeEnum.hxx>
33 #include <TopTools_IndexedDataMapOfShapeListOfShape.hxx>
34 #include <TopTools_IndexedMapOfShape.hxx>
35 #include <TopTools_MapOfShape.hxx>
36 #include <TopTools_ListOfListOfShape.hxx>
37 #include <TopTools_ListOfShape.hxx>
38 #include <Precision.hxx>
45 class IntTools_Context;
51 //! Provides tools used in Boolean Operations algorithm:
52 //! - Vertices intersection;
53 //! - Vertex construction;
54 //! - Edge construction;
55 //! - Classification algorithms;
56 //! - Making connexity blocks;
57 //! - Shape validation.
58 class BOPTools_AlgoTools
64 public: //! @name Constants
66 //! Additional tolerance (delta tolerance) is used in Boolean Operations
67 //! to ensure that the tolerance of new/old entities obtained
68 //! by intersection of two shapes is slightly bigger than the actual
69 //! distances to these shapes. It helps to avoid numerical instability
70 //! which may occur when comparing distances and tolerances.
71 static Standard_Real DTolerance() { return 1.e-12; }
73 public: //! @name Intersection of the vertices
75 //! Intersects the vertex <theV1> with the point <theP> with tolerance <theTolP>.
76 //! Returns the error status:
77 //! - 0 - no error, meaning that the vertex intersects the point;
78 //! - 1 - the distance between vertex and point is grater than the sum of tolerances.
79 Standard_EXPORT static Standard_Integer ComputeVV(const TopoDS_Vertex& theV,
81 const Standard_Real theTolP);
83 //! Intersects the given vertices with given fuzzy value.
84 //! Returns the error status:
85 //! - 0 - no error, meaning that the vertices interferes with given tolerance;
86 //! - 1 - the distance between vertices is grater than the sum of their tolerances.
87 Standard_EXPORT static Standard_Integer ComputeVV(const TopoDS_Vertex& theV1,
88 const TopoDS_Vertex& theV2,
89 const Standard_Real theFuzz = Precision::Confusion());
91 public: //! @name Vertices construction
93 //! Makes the vertex in the middle of given vertices with
94 //! the tolerance covering all tolerance spheres of vertices.
95 Standard_EXPORT static void MakeVertex(const TopTools_ListOfShape& theLV,
98 //! Make a vertex using 3D-point <aP1> and 3D-tolerance value <aTol>
99 Standard_EXPORT static void MakeNewVertex(const gp_Pnt& aP1,
100 const Standard_Real aTol,
101 TopoDS_Vertex& aNewVertex);
103 //! Make a vertex using couple of vertices <aV1, aV2>
104 Standard_EXPORT static void MakeNewVertex(const TopoDS_Vertex& aV1,
105 const TopoDS_Vertex& aV2,
106 TopoDS_Vertex& aNewVertex);
108 //! Make a vertex in place of intersection between two edges
109 //! <aE1, aE2> with parameters <aP1, aP2>
110 Standard_EXPORT static void MakeNewVertex(const TopoDS_Edge& aE1,
111 const Standard_Real aP1,
112 const TopoDS_Edge& aE2,
113 const Standard_Real aP2,
114 TopoDS_Vertex& aNewVertex);
116 //! Make a vertex in place of intersection between the edge <aE1>
117 //! with parameter <aP1> and the face <aF2>
118 Standard_EXPORT static void MakeNewVertex(const TopoDS_Edge& aE1,
119 const Standard_Real aP1,
120 const TopoDS_Face& aF2,
121 TopoDS_Vertex& aNewVertex);
124 public: //! @name Updating the vertex
126 //! Update the tolerance value for vertex <aV>
127 //! taking into account the fact that <aV> lays on
129 Standard_EXPORT static void UpdateVertex(const IntTools_Curve& aIC,
130 const Standard_Real aT,
131 const TopoDS_Vertex& aV);
133 //! Update the tolerance value for vertex <aV>
134 //! taking into account the fact that <aV> lays on
136 Standard_EXPORT static void UpdateVertex(const TopoDS_Edge& aE,
137 const Standard_Real aT,
138 const TopoDS_Vertex& aV);
140 //! Update the tolerance value for vertex <aVN>
141 //! taking into account the fact that <aVN> should
142 //! cover tolerance zone of <aVF>
143 Standard_EXPORT static void UpdateVertex(const TopoDS_Vertex& aVF,
144 const TopoDS_Vertex& aVN);
147 public: //! @name Edge construction
149 //! Makes the edge based on the given curve with given bounding vertices.
150 Standard_EXPORT static void MakeEdge(const IntTools_Curve& theCurve,
151 const TopoDS_Vertex& theV1,
152 const Standard_Real theT1,
153 const TopoDS_Vertex& theV2,
154 const Standard_Real theT2,
155 const Standard_Real theTolR3D,
158 //! Makes a copy of <theEdge> with vertices.
159 Standard_EXPORT static TopoDS_Edge CopyEdge(const TopoDS_Edge& theEdge);
161 //! Make the edge from base edge <aE1> and two vertices <aV1,aV2>
162 //! at parameters <aP1,aP2>
163 Standard_EXPORT static void MakeSplitEdge(const TopoDS_Edge& aE1,
164 const TopoDS_Vertex& aV1,
165 const Standard_Real aP1,
166 const TopoDS_Vertex& aV2,
167 const Standard_Real aP2,
168 TopoDS_Edge& aNewEdge);
170 //! Make the edge from 3D-Curve <aIC> and two vertices <aV1,aV2>
171 //! at parameters <aP1,aP2>
172 Standard_EXPORT static void MakeSectEdge(const IntTools_Curve& aIC,
173 const TopoDS_Vertex& aV1,
174 const Standard_Real aP1,
175 const TopoDS_Vertex& aV2,
176 const Standard_Real aP2,
177 TopoDS_Edge& aNewEdge);
180 public: //! @name Point/Edge/Face classification relatively solid
182 //! Computes the 3-D state of the point thePoint
183 //! toward solid theSolid.
184 //! theTol - value of precision of computation
185 //! theContext- cahed geometrical tools
186 //! Returns 3-D state.
187 Standard_EXPORT static TopAbs_State ComputeState(const gp_Pnt& thePoint,
188 const TopoDS_Solid& theSolid,
189 const Standard_Real theTol,
190 const Handle(IntTools_Context)& theContext);
192 //! Computes the 3-D state of the vertex theVertex
193 //! toward solid theSolid.
194 //! theTol - value of precision of computation
195 //! theContext- cahed geometrical tools
196 //! Returns 3-D state.
197 Standard_EXPORT static TopAbs_State ComputeState(const TopoDS_Vertex& theVertex,
198 const TopoDS_Solid& theSolid,
199 const Standard_Real theTol,
200 const Handle(IntTools_Context)& theContext);
202 //! Computes the 3-D state of the edge theEdge
203 //! toward solid theSolid.
204 //! theTol - value of precision of computation
205 //! theContext- cahed geometrical tools
206 //! Returns 3-D state.
207 Standard_EXPORT static TopAbs_State ComputeState(const TopoDS_Edge& theEdge,
208 const TopoDS_Solid& theSolid,
209 const Standard_Real theTol,
210 const Handle(IntTools_Context)& theContext);
212 //! Computes the 3-D state of the face theFace
213 //! toward solid theSolid.
214 //! theTol - value of precision of computation
215 //! theBounds - set of edges of <theSolid> to avoid
216 //! theContext- cahed geometrical tools
217 //! Returns 3-D state.
218 Standard_EXPORT static TopAbs_State ComputeState(const TopoDS_Face& theFace,
219 const TopoDS_Solid& theSolid,
220 const Standard_Real theTol,
221 const TopTools_IndexedMapOfShape& theBounds,
222 const Handle(IntTools_Context)& theContext);
224 //! Computes the 3-D state of the shape theShape
225 //! toward solid theSolid.
226 //! theTol - value of precision of computation
227 //! theContext- cahed geometrical tools
228 //! Returns 3-D state.
229 Standard_EXPORT static TopAbs_State ComputeStateByOnePoint(const TopoDS_Shape& theShape,
230 const TopoDS_Solid& theSolid,
231 const Standard_Real theTol,
232 const Handle(IntTools_Context)& theContext);
235 public: //! @name Face classification relatively solid
237 //! For the face theFace and its edge theEdge
238 //! finds the face suitable to produce shell.
239 //! theLCEF - set of faces to search. All faces
240 //! from theLCEF must share edge theEdge
241 Standard_EXPORT static Standard_Boolean GetFaceOff(const TopoDS_Edge& theEdge,
242 const TopoDS_Face& theFace,
243 BOPTools_ListOfCoupleOfShape& theLCEF,
244 TopoDS_Face& theFaceOff,
245 const Handle(IntTools_Context)& theContext);
247 //! Returns True if the face theFace is inside of the
248 //! couple of faces theFace1, theFace2.
249 //! The faces theFace, theFace1, theFace2 must
250 //! share the edge theEdge
252 //! * 0 state is not IN
254 //! * 2 state can not be found by the method of angles
255 Standard_EXPORT static Standard_Integer IsInternalFace(const TopoDS_Face& theFace,
256 const TopoDS_Edge& theEdge,
257 const TopoDS_Face& theFace1,
258 const TopoDS_Face& theFace2,
259 const Handle(IntTools_Context)& theContext);
261 //! Returns True if the face theFace is inside of the
262 //! appropriate couple of faces (from the set theLF) .
263 //! The faces of the set theLF and theFace must
264 //! share the edge theEdge
265 //! * 0 state is not IN
267 //! * 2 state can not be found by the method of angles
268 Standard_EXPORT static Standard_Integer IsInternalFace(const TopoDS_Face& theFace,
269 const TopoDS_Edge& theEdge,
270 TopTools_ListOfShape& theLF,
271 const Handle(IntTools_Context)& theContext);
273 //! Returns True if the face theFace is inside the
275 //! theMEF - Map Edge/Faces for theSolid
276 //! theTol - value of precision of computation
277 //! theContext- cahed geometrical tools
278 Standard_EXPORT static Standard_Boolean IsInternalFace(const TopoDS_Face& theFace,
279 const TopoDS_Solid& theSolid,
280 TopTools_IndexedDataMapOfShapeListOfShape& theMEF,
281 const Standard_Real theTol,
282 const Handle(IntTools_Context)& theContext);
285 public: //! @name PCurve construction
287 //! Makes 2d curve of the edge <theE> on the faces <theF1> and <theF2>.<br>
288 //! <theContext> - storage for caching the geometrical tools
289 Standard_EXPORT static void MakePCurve (const TopoDS_Edge& theE,
290 const TopoDS_Face& theF1,
291 const TopoDS_Face& theF2,
292 const IntTools_Curve& theCurve,
293 const Standard_Boolean thePC1,
294 const Standard_Boolean thePC2,
295 const Handle(IntTools_Context)& theContext = Handle(IntTools_Context)());
298 public: //! @name Wire classification relatively face
300 //! Checks if the wire is a hole for the face.
301 Standard_EXPORT static Standard_Boolean IsHole(const TopoDS_Shape& theW,
302 const TopoDS_Shape& theF);
305 public: //! @name Choosing correct orientation for the split shape
307 //! Checks if the direction of the split shape is opposite to
308 //! the direction of the original shape.
309 //! The method is an overload for (Edge,Edge) and (Face,Face) corresponding
310 //! methods and checks only these types of shapes.
311 //! For faces the method checks if normal directions are opposite.
312 //! For edges the method checks if tangent vectors are opposite.
314 //! In case the directions do not coincide, it returns TRUE, meaning
315 //! that split shape has to be reversed to match the direction of the
318 //! If requested (<theError> is not null), the method returns the status of the operation:
320 //! - Error from (Edge,Edge) or (Face,Face) corresponding method
321 //! - 100 - bad types.
322 //! In case of any error the method always returns FALSE.
324 //! @param theSplit [in] Split shape
325 //! @param theShape [in] Original shape
326 //! @param theContext [in] cached geometrical tools
327 //! @param theError [out] Error Status of the operation
328 Standard_EXPORT static Standard_Boolean IsSplitToReverse(const TopoDS_Shape& theSplit,
329 const TopoDS_Shape& theShape,
330 const Handle(IntTools_Context)& theContext,
331 Standard_Integer *theError = NULL);
333 //! Add-on for the *IsSplitToReverse()* to check for its errors
334 //! and in case of any add the *BOPAlgo_AlertUnableToOrientTheShape*
335 //! warning to the report.
336 Standard_EXPORT static Standard_Boolean IsSplitToReverseWithWarn(const TopoDS_Shape& theSplit,
337 const TopoDS_Shape& theShape,
338 const Handle(IntTools_Context)& theContext,
339 const Handle(Message_Report)& theReport = NULL);
341 //! Checks if the normal direction of the split face is opposite to
342 //! the normal direction of the original face.
343 //! The normal directions for both faces are taken in the same point -
344 //! point inside the split face is projected onto the original face.
345 //! Returns TRUE if the normals do not coincide, meaning the necessity
346 //! to revert the orientation of the split face to match the direction
347 //! of the original face.
349 //! If requested (<theError> is not null), the method returns the status of the operation:
351 //! - 1 - unable to find the point inside split face;
352 //! - 2 - unable to compute the normal for the split face;
353 //! - 3 - unable to project the point inside the split face on the original face;
354 //! - 4 - unable to compute the normal for the original face.
355 //! In case of any error the method always returns FALSE.
357 //! @param theSplit [in] Split face
358 //! @param theShape [in] Original face
359 //! @param theContext [in] cached geometrical tools
360 //! @param theError [out] Error Status of the operation
361 Standard_EXPORT static Standard_Boolean IsSplitToReverse(const TopoDS_Face& theSplit,
362 const TopoDS_Face& theShape,
363 const Handle(IntTools_Context)& theContext,
364 Standard_Integer *theError = NULL);
366 //! Checks if the tangent vector of the split edge is opposite to
367 //! the tangent vector of the original edge.
368 //! The tangent vectors for both edges are computed in the same point -
369 //! point inside the split edge is projected onto the original edge.
370 //! Returns TRUE if the tangent vectors do not coincide, meaning the necessity
371 //! to revert the orientation of the split edge to match the direction
372 //! of the original edge.
374 //! If requested (<theError> is not null), the method returns the status of the operation:
376 //! - 1 - degenerated edges are given;
377 //! - 2 - unable to compute the tangent vector for the split edge;
378 //! - 3 - unable to project the point inside the split edge on the original edge;
379 //! - 4 - unable to compute the tangent vector for the original edge;
380 //! In case of any error the method always returns FALSE.
382 //! @param theSplit [in] Split edge
383 //! @param theShape [in] Original edge
384 //! @param theContext [in] cached geometrical tools
385 //! @param theError [out] Error Status of the operation
386 Standard_EXPORT static Standard_Boolean IsSplitToReverse(const TopoDS_Edge& theSplit,
387 const TopoDS_Edge& theShape,
388 const Handle(IntTools_Context)& theContext,
389 Standard_Integer *theError = NULL);
391 //! Checks if the normals direction of the given faces computed near
392 //! the shared edge coincide.
393 //! Returns the status of operation:
394 //! * 0 - in case of error (shared edge not found or directions are not collinear)
395 //! * 1 - normal directions coincide;
396 //! * -1 - normal directions are opposite.
397 Standard_EXPORT static Standard_Integer Sense(const TopoDS_Face& theF1,
398 const TopoDS_Face& theF2,
399 const Handle(IntTools_Context)& theContext);
401 public: //! @name Making connexity blocks
403 //! For the list of faces theLS build block
404 //! theLSCB in terms of connexity by edges
405 //! theMapAvoid - set of edges to avoid for
407 Standard_EXPORT static void MakeConnexityBlock(TopTools_ListOfShape& theLS,
408 TopTools_IndexedMapOfShape& theMapAvoid,
409 TopTools_ListOfShape& theLSCB,
410 const Handle(NCollection_BaseAllocator)& theAllocator);
412 //! For the compound <theS> builds the blocks (compounds) of
413 //! elements of type <theElementType> connected through the shapes
414 //! of the type <theConnectionType>.
415 //! The blocks are stored into the list <theLCB>.
416 Standard_EXPORT static void MakeConnexityBlocks(const TopoDS_Shape& theS,
417 const TopAbs_ShapeEnum theConnectionType,
418 const TopAbs_ShapeEnum theElementType,
419 TopTools_ListOfShape& theLCB);
421 //! For the compound <theS> builds the blocks (compounds) of
422 //! elements of type <theElementType> connected through the shapes
423 //! of the type <theConnectionType>.
424 //! The blocks are stored into the list of lists <theLCB>.
425 //! Returns also the connection map <theConnectionMap>, filled during operation.
426 Standard_EXPORT static void MakeConnexityBlocks(const TopoDS_Shape& theS,
427 const TopAbs_ShapeEnum theConnectionType,
428 const TopAbs_ShapeEnum theElementType,
429 TopTools_ListOfListOfShape& theLCB,
430 TopTools_IndexedDataMapOfShapeListOfShape& theConnectionMap);
432 //! Makes connexity blocks of elements of the given type with the given type of the
433 //! connecting elements. The blocks are checked on regularity (multi-connectivity)
434 //! and stored to the list of blocks <theLCB>.
435 Standard_EXPORT static void MakeConnexityBlocks(const TopTools_ListOfShape& theLS,
436 const TopAbs_ShapeEnum theConnectionType,
437 const TopAbs_ShapeEnum theElementType,
438 BOPTools_ListOfConnexityBlock& theLCB);
440 public: //! @name Orienting elements in container
442 //! Correctly orients edges on the wire
443 Standard_EXPORT static void OrientEdgesOnWire(TopoDS_Shape& theWire);
445 //! Correctly orients faces on the shell
446 Standard_EXPORT static void OrientFacesOnShell(TopoDS_Shape& theShell);
449 public: //! @name Methods for shape validation (correction)
451 //! Provides valid values of tolerances for the shape <theS>
452 //! <theTolMax> is max value of the tolerance that can be
453 //! accepted for correction. If real value of the tolerance
454 //! will be greater than <aTolMax>, the correction does not
456 Standard_EXPORT static void CorrectTolerances(const TopoDS_Shape& theS,
457 const TopTools_IndexedMapOfShape& theMapToAvoid,
458 const Standard_Real theTolMax = 0.0001,
459 const Standard_Boolean theRunParallel = Standard_False);
461 //! Provides valid values of tolerances for the shape <theS>
462 //! in terms of BRepCheck_InvalidCurveOnSurface.
463 Standard_EXPORT static void CorrectCurveOnSurface(const TopoDS_Shape& theS,
464 const TopTools_IndexedMapOfShape& theMapToAvoid,
465 const Standard_Real theTolMax = 0.0001,
466 const Standard_Boolean theRunParallel = Standard_False);
468 //! Provides valid values of tolerances for the shape <theS>
469 //! in terms of BRepCheck_InvalidPointOnCurve.
470 Standard_EXPORT static void CorrectPointOnCurve(const TopoDS_Shape& theS,
471 const TopTools_IndexedMapOfShape& theMapToAvoid,
472 const Standard_Real theTolMax = 0.0001,
473 const Standard_Boolean theRunParallel = Standard_False);
475 //! Corrects tolerance values of the sub-shapes of the shape <theS> if needed.
476 Standard_EXPORT static void CorrectShapeTolerances(const TopoDS_Shape& theS,
477 const TopTools_IndexedMapOfShape& theMapToAvoid,
478 const Standard_Boolean theRunParallel = Standard_False);
481 public: //! Checking if the faces are coinciding
483 //! Checks if the given faces are same-domain, i.e. coincide.
484 Standard_EXPORT static Standard_Boolean AreFacesSameDomain(const TopoDS_Face& theF1,
485 const TopoDS_Face& theF2,
486 const Handle(IntTools_Context)& theContext,
487 const Standard_Real theFuzz = Precision::Confusion());
489 public: //! @name Looking for the edge in the face
491 //! Returns True if the face theFace contains
492 //! the edge theEdge but with opposite orientation.
493 //! If the method returns True theEdgeOff is the
495 Standard_EXPORT static Standard_Boolean GetEdgeOff(const TopoDS_Edge& theEdge,
496 const TopoDS_Face& theFace,
497 TopoDS_Edge& theEdgeOff);
499 //! For the face theFace gets the edge theEdgeOnF
500 //! that is the same as theEdge
501 //! Returns True if such edge exists
502 //! Returns False if there is no such edge
503 Standard_EXPORT static Standard_Boolean GetEdgeOnFace(const TopoDS_Edge& theEdge,
504 const TopoDS_Face& theFace,
505 TopoDS_Edge& theEdgeOnF);
508 public: //! @name Correction of the edges range
510 //! Correct shrunk range <aSR> taking into account 3D-curve
511 //! resolution and corresponding tolerance values of <aE1>, <aE2>
512 Standard_EXPORT static void CorrectRange(const TopoDS_Edge& aE1,
513 const TopoDS_Edge& aE2,
514 const IntTools_Range& aSR,
515 IntTools_Range& aNewSR);
518 //! Correct shrunk range <aSR> taking into account 3D-curve
519 //! resolution and corresponding tolerance values of <aE>, <aF>
520 Standard_EXPORT static void CorrectRange(const TopoDS_Edge& aE,
521 const TopoDS_Face& aF,
522 const IntTools_Range& aSR,
523 IntTools_Range& aNewSR);
525 public: //! @name Checking edge on micro status
527 //! Checks if it is possible to compute shrunk range for the edge <aE>
528 //! Flag <theCheckSplittable> defines whether to take into account
529 //! the possibility to split the edge or not.
530 Standard_EXPORT static Standard_Boolean IsMicroEdge(const TopoDS_Edge& theEdge,
531 const Handle(IntTools_Context)& theContext,
532 const Standard_Boolean theCheckSplittable = Standard_True);
534 public: //! @name Solid classification
536 //! Returns true if the solid <theSolid> is inverted
537 Standard_EXPORT static Standard_Boolean IsInvertedSolid(const TopoDS_Solid& theSolid);
539 public: //! @name Edge/Face Deviation computation
541 //! Computes the necessary value of the tolerance for the edge
542 Standard_EXPORT static Standard_Boolean ComputeTolerance(const TopoDS_Face& theFace,
543 const TopoDS_Edge& theEdge,
544 Standard_Real& theMaxDist,
545 Standard_Real& theMaxPar);
547 public: //! @name Other methods
549 //! Makes empty container of requested type
550 Standard_EXPORT static void MakeContainer(const TopAbs_ShapeEnum theType,
551 TopoDS_Shape& theShape);
553 //! Compute a 3D-point on the edge <aEdge> at parameter <aPrm>
554 Standard_EXPORT static void PointOnEdge(const TopoDS_Edge& aEdge,
555 const Standard_Real aPrm,
558 //! Returns TRUE if PaveBlock <aPB> lays on the face <aF>, i.e
559 //! the <PB> is IN or ON in 2D of <aF>
560 Standard_EXPORT static Standard_Boolean IsBlockInOnFace(const IntTools_Range& aShR,
561 const TopoDS_Face& aF,
562 const TopoDS_Edge& aE,
563 const Handle(IntTools_Context)& aContext);
565 //! Returns the min and max dimensions of the shape <theS>.
566 Standard_EXPORT static void Dimensions (const TopoDS_Shape& theS,
567 Standard_Integer& theDMin,
568 Standard_Integer& theDMax);
570 //! Returns dimension of the shape <theS>.
571 //! If the shape contains elements of different dimension, -1 is returned.
572 Standard_EXPORT static Standard_Integer Dimension(const TopoDS_Shape& theS);
574 //! Collects in the output list recursively all non-compound sub-shapes of the first level
575 //! of the given shape theS. The optional map theMap is used to avoid the duplicates in the
576 //! output list, so it will also contain all non-compound sub-shapes.
577 Standard_EXPORT static void TreatCompound (const TopoDS_Shape& theS,
578 TopTools_ListOfShape& theList,
579 TopTools_MapOfShape* theMap = NULL);
581 //! Returns true if the shell <theShell> is open
582 Standard_EXPORT static Standard_Boolean IsOpenShell(const TopoDS_Shell& theShell);
586 #endif // _BOPTools_AlgoTools_HeaderFile