Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2026-07-30 09:13:02

0001 // Created by: Peter KURNEV
0002 // Copyright (c) 2010-2014 OPEN CASCADE SAS
0003 // Copyright (c) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
0004 // Copyright (c) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN, CEDRAT,
0005 //                         EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
0006 //
0007 // This file is part of Open CASCADE Technology software library.
0008 //
0009 // This library is free software; you can redistribute it and/or modify it under
0010 // the terms of the GNU Lesser General Public License version 2.1 as published
0011 // by the Free Software Foundation, with special exception defined in the file
0012 // OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
0013 // distribution for complete text of the license and disclaimer of any warranty.
0014 //
0015 // Alternatively, this file may be used under the terms of Open CASCADE
0016 // commercial license or contractual agreement.
0017 
0018 #ifndef _BOPTools_AlgoTools_HeaderFile
0019 #define _BOPTools_AlgoTools_HeaderFile
0020 
0021 #include <Standard.hxx>
0022 #include <Standard_DefineAlloc.hxx>
0023 #include <Standard_Handle.hxx>
0024 
0025 #include <Standard_Boolean.hxx>
0026 #include <Standard_Integer.hxx>
0027 #include <Standard_Real.hxx>
0028 #include <BOPTools_ListOfCoupleOfShape.hxx>
0029 #include <BOPTools_ListOfConnexityBlock.hxx>
0030 #include <NCollection_BaseAllocator.hxx>
0031 #include <TopAbs_State.hxx>
0032 #include <TopAbs_ShapeEnum.hxx>
0033 #include <TopTools_IndexedDataMapOfShapeListOfShape.hxx>
0034 #include <TopTools_IndexedMapOfShape.hxx>
0035 #include <TopTools_MapOfShape.hxx>
0036 #include <TopTools_ListOfListOfShape.hxx>
0037 #include <TopTools_ListOfShape.hxx>
0038 #include <Precision.hxx>
0039 class TopoDS_Vertex;
0040 class gp_Pnt;
0041 class IntTools_Curve;
0042 class TopoDS_Edge;
0043 class TopoDS_Face;
0044 class TopoDS_Shape;
0045 class IntTools_Context;
0046 class TopoDS_Solid;
0047 class IntTools_Range;
0048 class TopoDS_Shell;
0049 class Message_Report;
0050 
0051 //! Provides tools used in Boolean Operations algorithm:
0052 //! - Vertices intersection;
0053 //! - Vertex construction;
0054 //! - Edge construction;
0055 //! - Classification algorithms;
0056 //! - Making connexity blocks;
0057 //! - Shape validation.
0058 class BOPTools_AlgoTools
0059 {
0060 public:
0061   DEFINE_STANDARD_ALLOC
0062 
0063 public: //! @name Constants
0064   //! Additional tolerance (delta tolerance) is used in Boolean Operations
0065   //! to ensure that the tolerance of new/old entities obtained
0066   //! by intersection of two shapes is slightly bigger than the actual
0067   //! distances to these shapes. It helps to avoid numerical instability
0068   //! which may occur when comparing distances and tolerances.
0069   static Standard_Real DTolerance() { return 1.e-12; }
0070 
0071 public: //! @name Intersection of the vertices
0072   //! Intersects the vertex <theV1> with the point <theP> with tolerance <theTolP>.
0073   //! Returns the error status:
0074   //! - 0 - no error, meaning that the vertex intersects the point;
0075   //! - 1 - the distance between vertex and point is grater than the sum of tolerances.
0076   Standard_EXPORT static Standard_Integer ComputeVV(const TopoDS_Vertex& theV,
0077                                                     const gp_Pnt&        theP,
0078                                                     const Standard_Real  theTolP);
0079 
0080   //! Intersects the given vertices with given fuzzy value.
0081   //! Returns the error status:
0082   //! - 0 - no error, meaning that the vertices interferes with given tolerance;
0083   //! - 1 - the distance between vertices is grater than the sum of their tolerances.
0084   Standard_EXPORT static Standard_Integer ComputeVV(
0085     const TopoDS_Vertex& theV1,
0086     const TopoDS_Vertex& theV2,
0087     const Standard_Real  theFuzz = Precision::Confusion());
0088 
0089 public: //! @name Vertices construction
0090   //! Makes the vertex in the middle of given vertices with
0091   //! the tolerance covering all tolerance spheres of vertices.
0092   Standard_EXPORT static void MakeVertex(const TopTools_ListOfShape& theLV, TopoDS_Vertex& theV);
0093 
0094   //! Make a vertex using 3D-point <aP1> and 3D-tolerance value <aTol>
0095   Standard_EXPORT static void MakeNewVertex(const gp_Pnt&       aP1,
0096                                             const Standard_Real aTol,
0097                                             TopoDS_Vertex&      aNewVertex);
0098 
0099   //! Make a vertex using couple of vertices  <aV1, aV2>
0100   Standard_EXPORT static void MakeNewVertex(const TopoDS_Vertex& aV1,
0101                                             const TopoDS_Vertex& aV2,
0102                                             TopoDS_Vertex&       aNewVertex);
0103 
0104   //! Make a vertex in place of intersection between two edges
0105   //! <aE1, aE2> with parameters <aP1, aP2>
0106   Standard_EXPORT static void MakeNewVertex(const TopoDS_Edge&  aE1,
0107                                             const Standard_Real aP1,
0108                                             const TopoDS_Edge&  aE2,
0109                                             const Standard_Real aP2,
0110                                             TopoDS_Vertex&      aNewVertex);
0111 
0112   //! Make a vertex in place of intersection between the edge <aE1>
0113   //! with parameter <aP1> and the face <aF2>
0114   Standard_EXPORT static void MakeNewVertex(const TopoDS_Edge&  aE1,
0115                                             const Standard_Real aP1,
0116                                             const TopoDS_Face&  aF2,
0117                                             TopoDS_Vertex&      aNewVertex);
0118 
0119 public: //! @name Updating the vertex
0120   //! Update the tolerance value for vertex  <aV>
0121   //! taking into account the fact that <aV> lays on
0122   //! the curve <aIC>
0123   Standard_EXPORT static void UpdateVertex(const IntTools_Curve& aIC,
0124                                            const Standard_Real   aT,
0125                                            const TopoDS_Vertex&  aV);
0126 
0127   //! Update the tolerance value for vertex  <aV>
0128   //! taking into account the fact that <aV> lays on
0129   //! the edge <aE>
0130   Standard_EXPORT static void UpdateVertex(const TopoDS_Edge&   aE,
0131                                            const Standard_Real  aT,
0132                                            const TopoDS_Vertex& aV);
0133 
0134   //! Update the tolerance value for vertex  <aVN>
0135   //! taking into account the fact that <aVN> should
0136   //! cover tolerance zone of <aVF>
0137   Standard_EXPORT static void UpdateVertex(const TopoDS_Vertex& aVF, const TopoDS_Vertex& aVN);
0138 
0139 public: //! @name Edge construction
0140   //! Makes the edge based on the given curve with given bounding vertices.
0141   Standard_EXPORT static void MakeEdge(const IntTools_Curve& theCurve,
0142                                        const TopoDS_Vertex&  theV1,
0143                                        const Standard_Real   theT1,
0144                                        const TopoDS_Vertex&  theV2,
0145                                        const Standard_Real   theT2,
0146                                        const Standard_Real   theTolR3D,
0147                                        TopoDS_Edge&          theE);
0148 
0149   //! Makes a copy of <theEdge> with vertices.
0150   Standard_EXPORT static TopoDS_Edge CopyEdge(const TopoDS_Edge& theEdge);
0151 
0152   //! Make the edge from base edge <aE1> and two vertices <aV1,aV2>
0153   //! at parameters <aP1,aP2>
0154   Standard_EXPORT static void MakeSplitEdge(const TopoDS_Edge&   aE1,
0155                                             const TopoDS_Vertex& aV1,
0156                                             const Standard_Real  aP1,
0157                                             const TopoDS_Vertex& aV2,
0158                                             const Standard_Real  aP2,
0159                                             TopoDS_Edge&         aNewEdge);
0160 
0161   //! Make the edge from 3D-Curve <aIC>  and two vertices <aV1,aV2>
0162   //! at parameters <aP1,aP2>
0163   Standard_EXPORT static void MakeSectEdge(const IntTools_Curve& aIC,
0164                                            const TopoDS_Vertex&  aV1,
0165                                            const Standard_Real   aP1,
0166                                            const TopoDS_Vertex&  aV2,
0167                                            const Standard_Real   aP2,
0168                                            TopoDS_Edge&          aNewEdge);
0169 
0170 public: //! @name Point/Edge/Face classification relatively solid
0171   //! Computes the 3-D state of the point thePoint
0172   //! toward solid theSolid.
0173   //! theTol - value of precision of computation
0174   //! theContext- cached geometrical tools
0175   //! Returns 3-D state.
0176   Standard_EXPORT static TopAbs_State ComputeState(const gp_Pnt&                   thePoint,
0177                                                    const TopoDS_Solid&             theSolid,
0178                                                    const Standard_Real             theTol,
0179                                                    const Handle(IntTools_Context)& theContext);
0180 
0181   //! Computes the 3-D state of the vertex theVertex
0182   //! toward solid theSolid.
0183   //! theTol - value of precision of computation
0184   //! theContext- cached geometrical tools
0185   //! Returns 3-D state.
0186   Standard_EXPORT static TopAbs_State ComputeState(const TopoDS_Vertex&            theVertex,
0187                                                    const TopoDS_Solid&             theSolid,
0188                                                    const Standard_Real             theTol,
0189                                                    const Handle(IntTools_Context)& theContext);
0190 
0191   //! Computes the 3-D state of the edge theEdge
0192   //! toward solid theSolid.
0193   //! theTol - value of precision of computation
0194   //! theContext- cached geometrical tools
0195   //! Returns 3-D state.
0196   Standard_EXPORT static TopAbs_State ComputeState(const TopoDS_Edge&              theEdge,
0197                                                    const TopoDS_Solid&             theSolid,
0198                                                    const Standard_Real             theTol,
0199                                                    const Handle(IntTools_Context)& theContext);
0200 
0201   //! Computes the 3-D state of the face theFace
0202   //! toward solid theSolid.
0203   //! theTol - value of precision of computation
0204   //! theBounds - set of edges of <theSolid> to avoid
0205   //! theContext- cached geometrical tools
0206   //! Returns 3-D state.
0207   Standard_EXPORT static TopAbs_State ComputeState(const TopoDS_Face&                theFace,
0208                                                    const TopoDS_Solid&               theSolid,
0209                                                    const Standard_Real               theTol,
0210                                                    const TopTools_IndexedMapOfShape& theBounds,
0211                                                    const Handle(IntTools_Context)&   theContext);
0212 
0213   //! Computes the 3-D state of the shape theShape
0214   //! toward solid theSolid.
0215   //! theTol - value of precision of computation
0216   //! theContext- cached geometrical tools
0217   //! Returns 3-D state.
0218   Standard_EXPORT static TopAbs_State ComputeStateByOnePoint(
0219     const TopoDS_Shape&             theShape,
0220     const TopoDS_Solid&             theSolid,
0221     const Standard_Real             theTol,
0222     const Handle(IntTools_Context)& theContext);
0223 
0224 public: //! @name Face classification relatively solid
0225   //! For the face theFace and its edge theEdge
0226   //! finds the face suitable to produce shell.
0227   //! theLCEF - set of faces to search. All faces
0228   //! from theLCEF must share edge theEdge
0229   Standard_EXPORT static Standard_Boolean GetFaceOff(const TopoDS_Edge&              theEdge,
0230                                                      const TopoDS_Face&              theFace,
0231                                                      BOPTools_ListOfCoupleOfShape&   theLCEF,
0232                                                      TopoDS_Face&                    theFaceOff,
0233                                                      const Handle(IntTools_Context)& theContext);
0234 
0235   //! Returns True if the face theFace is inside of the
0236   //! couple of faces theFace1, theFace2.
0237   //! The faces theFace, theFace1, theFace2  must
0238   //! share the edge theEdge
0239   //! Return values:
0240   //!  * 0 state is not IN
0241   //!  * 1 state is IN
0242   //!  * 2 state can not be found by the method of angles
0243   Standard_EXPORT static Standard_Integer IsInternalFace(
0244     const TopoDS_Face&              theFace,
0245     const TopoDS_Edge&              theEdge,
0246     const TopoDS_Face&              theFace1,
0247     const TopoDS_Face&              theFace2,
0248     const Handle(IntTools_Context)& theContext);
0249 
0250   //! Returns True if the face theFace is inside of the
0251   //! appropriate couple of faces (from the set theLF)    .
0252   //! The faces of the set theLF and theFace  must
0253   //! share the edge theEdge
0254   //!  * 0 state is not IN
0255   //!  * 1 state is IN
0256   //!  * 2 state can not be found by the method of angles
0257   Standard_EXPORT static Standard_Integer IsInternalFace(
0258     const TopoDS_Face&              theFace,
0259     const TopoDS_Edge&              theEdge,
0260     TopTools_ListOfShape&           theLF,
0261     const Handle(IntTools_Context)& theContext);
0262 
0263   //! Returns True if the face theFace is inside the
0264   //! solid theSolid.
0265   //! theMEF - Map Edge/Faces for theSolid
0266   //! theTol - value of precision of computation
0267   //! theContext- cached geometrical tools
0268   Standard_EXPORT static Standard_Boolean IsInternalFace(
0269     const TopoDS_Face&                         theFace,
0270     const TopoDS_Solid&                        theSolid,
0271     TopTools_IndexedDataMapOfShapeListOfShape& theMEF,
0272     const Standard_Real                        theTol,
0273     const Handle(IntTools_Context)&            theContext);
0274 
0275 public: //! @name PCurve construction
0276   //! Makes 2d curve of the edge <theE> on the faces <theF1> and <theF2>.<br>
0277   //! <theContext> - storage for caching the geometrical tools
0278   Standard_EXPORT static void MakePCurve(
0279     const TopoDS_Edge&              theE,
0280     const TopoDS_Face&              theF1,
0281     const TopoDS_Face&              theF2,
0282     const IntTools_Curve&           theCurve,
0283     const Standard_Boolean          thePC1,
0284     const Standard_Boolean          thePC2,
0285     const Handle(IntTools_Context)& theContext = Handle(IntTools_Context)());
0286 
0287 public: //! @name Wire classification relatively face
0288   //! Checks if the wire is a hole for the face.
0289   Standard_EXPORT static Standard_Boolean IsHole(const TopoDS_Shape& theW,
0290                                                  const TopoDS_Shape& theF);
0291 
0292 public: //! @name Choosing correct orientation for the split shape
0293   //! Checks if the direction of the split shape is opposite to
0294   //! the direction of the original shape.
0295   //! The method is an overload for (Edge,Edge) and (Face,Face) corresponding
0296   //! methods and checks only these types of shapes.
0297   //! For faces the method checks if normal directions are opposite.
0298   //! For edges the method checks if tangent vectors are opposite.
0299   //!
0300   //! In case the directions do not coincide, it returns TRUE, meaning
0301   //! that split shape has to be reversed to match the direction of the
0302   //! original shape.
0303   //!
0304   //! If requested (<theError> is not null), the method returns the status of the operation:
0305   //! - 0 - no error;
0306   //! - Error from (Edge,Edge) or (Face,Face) corresponding method
0307   //! - 100 - bad types.
0308   //! In case of any error the method always returns FALSE.
0309   //!
0310   //! @param[in] theSplit  Split shape
0311   //! @param[in] theShape  Original shape
0312   //! @param[in] theContext  cached geometrical tools
0313   //! @param[out] theError  Error Status of the operation
0314   Standard_EXPORT static Standard_Boolean IsSplitToReverse(
0315     const TopoDS_Shape&             theSplit,
0316     const TopoDS_Shape&             theShape,
0317     const Handle(IntTools_Context)& theContext,
0318     Standard_Integer*               theError = NULL);
0319 
0320   //! Add-on for the *IsSplitToReverse()* to check for its errors
0321   //! and in case of any add the *BOPAlgo_AlertUnableToOrientTheShape*
0322   //! warning to the report.
0323   Standard_EXPORT static Standard_Boolean IsSplitToReverseWithWarn(
0324     const TopoDS_Shape&             theSplit,
0325     const TopoDS_Shape&             theShape,
0326     const Handle(IntTools_Context)& theContext,
0327     const Handle(Message_Report)&   theReport = NULL);
0328 
0329   //! Checks if the normal direction of the split face is opposite to
0330   //! the normal direction of the original face.
0331   //! The normal directions for both faces are taken in the same point -
0332   //! point inside the split face is projected onto the original face.
0333   //! Returns TRUE if the normals do not coincide, meaning the necessity
0334   //! to revert the orientation of the split face to match the direction
0335   //! of the original face.
0336   //!
0337   //! If requested (<theError> is not null), the method returns the status of the operation:
0338   //! - 0 - no error;
0339   //! - 1 - unable to find the point inside split face;
0340   //! - 2 - unable to compute the normal for the split face;
0341   //! - 3 - unable to project the point inside the split face on the original face;
0342   //! - 4 - unable to compute the normal for the original face.
0343   //! In case of any error the method always returns FALSE.
0344   //!
0345   //! @param[in] theSplit  Split face
0346   //! @param[in] theShape  Original face
0347   //! @param[in] theContext  cached geometrical tools
0348   //! @param[out] theError  Error Status of the operation
0349   Standard_EXPORT static Standard_Boolean IsSplitToReverse(
0350     const TopoDS_Face&              theSplit,
0351     const TopoDS_Face&              theShape,
0352     const Handle(IntTools_Context)& theContext,
0353     Standard_Integer*               theError = NULL);
0354 
0355   //! Checks if the tangent vector of the split edge is opposite to
0356   //! the tangent vector of the original edge.
0357   //! The tangent vectors for both edges are computed in the same point -
0358   //! point inside the split edge is projected onto the original edge.
0359   //! Returns TRUE if the tangent vectors do not coincide, meaning the necessity
0360   //! to revert the orientation of the split edge to match the direction
0361   //! of the original edge.
0362   //!
0363   //! If requested (<theError> is not null), the method returns the status of the operation:
0364   //! - 0 - no error;
0365   //! - 1 - degenerated edges are given;
0366   //! - 2 - unable to compute the tangent vector for the split edge;
0367   //! - 3 - unable to project the point inside the split edge on the original edge;
0368   //! - 4 - unable to compute the tangent vector for the original edge;
0369   //! In case of any error the method always returns FALSE.
0370   //!
0371   //! @param[in] theSplit  Split edge
0372   //! @param[in] theShape  Original edge
0373   //! @param[in] theContext  cached geometrical tools
0374   //! @param[out] theError  Error Status of the operation
0375   Standard_EXPORT static Standard_Boolean IsSplitToReverse(
0376     const TopoDS_Edge&              theSplit,
0377     const TopoDS_Edge&              theShape,
0378     const Handle(IntTools_Context)& theContext,
0379     Standard_Integer*               theError = NULL);
0380 
0381   //! Checks if the normals direction of the given faces computed near
0382   //! the shared edge coincide.
0383   //! Returns the status of operation:
0384   //! * 0 - in case of error (shared edge not found or directions are not collinear)
0385   //! * 1 - normal directions coincide;
0386   //! * -1 - normal directions are opposite.
0387   Standard_EXPORT static Standard_Integer Sense(const TopoDS_Face&              theF1,
0388                                                 const TopoDS_Face&              theF2,
0389                                                 const Handle(IntTools_Context)& theContext);
0390 
0391 public: //! @name Making connexity blocks
0392   //! For the list of faces theLS build block
0393   //! theLSCB in terms of connexity by edges
0394   //! theMapAvoid - set of edges to avoid for
0395   //! the treatment
0396   Standard_EXPORT static void MakeConnexityBlock(
0397     TopTools_ListOfShape&                    theLS,
0398     TopTools_IndexedMapOfShape&              theMapAvoid,
0399     TopTools_ListOfShape&                    theLSCB,
0400     const Handle(NCollection_BaseAllocator)& theAllocator);
0401 
0402   //! For the compound <theS> builds the blocks (compounds) of
0403   //! elements of type <theElementType> connected through the shapes
0404   //! of the type <theConnectionType>.
0405   //! The blocks are stored into the list <theLCB>.
0406   Standard_EXPORT static void MakeConnexityBlocks(const TopoDS_Shape&    theS,
0407                                                   const TopAbs_ShapeEnum theConnectionType,
0408                                                   const TopAbs_ShapeEnum theElementType,
0409                                                   TopTools_ListOfShape&  theLCB);
0410 
0411   //! For the compound <theS> builds the blocks (compounds) of
0412   //! elements of type <theElementType> connected through the shapes
0413   //! of the type <theConnectionType>.
0414   //! The blocks are stored into the list of lists <theLCB>.
0415   //! Returns also the connection map <theConnectionMap>, filled during operation.
0416   Standard_EXPORT static void MakeConnexityBlocks(
0417     const TopoDS_Shape&                        theS,
0418     const TopAbs_ShapeEnum                     theConnectionType,
0419     const TopAbs_ShapeEnum                     theElementType,
0420     TopTools_ListOfListOfShape&                theLCB,
0421     TopTools_IndexedDataMapOfShapeListOfShape& theConnectionMap);
0422 
0423   //! Makes connexity blocks of elements of the given type with the given type of the
0424   //! connecting elements. The blocks are checked on regularity (multi-connectivity)
0425   //! and stored to the list of blocks <theLCB>.
0426   Standard_EXPORT static void MakeConnexityBlocks(const TopTools_ListOfShape&    theLS,
0427                                                   const TopAbs_ShapeEnum         theConnectionType,
0428                                                   const TopAbs_ShapeEnum         theElementType,
0429                                                   BOPTools_ListOfConnexityBlock& theLCB);
0430 
0431 public: //! @name Orienting elements in container
0432   //! Correctly orients edges on the wire
0433   Standard_EXPORT static void OrientEdgesOnWire(TopoDS_Shape& theWire);
0434 
0435   //! Correctly orients faces on the shell
0436   Standard_EXPORT static void OrientFacesOnShell(TopoDS_Shape& theShell);
0437 
0438 public: //! @name Methods for shape validation (correction)
0439   //! Provides valid values of tolerances for the shape <theS>
0440   //! <theTolMax> is max value of the tolerance that can be
0441   //! accepted for correction.  If real value of the tolerance
0442   //! will be greater than  <aTolMax>, the correction does not
0443   //! perform.
0444   Standard_EXPORT static void CorrectTolerances(
0445     const TopoDS_Shape&               theS,
0446     const TopTools_IndexedMapOfShape& theMapToAvoid,
0447     const Standard_Real               theTolMax      = 0.0001,
0448     const Standard_Boolean            theRunParallel = Standard_False);
0449 
0450   //! Provides valid values of tolerances for the shape <theS>
0451   //! in  terms of BRepCheck_InvalidCurveOnSurface.
0452   Standard_EXPORT static void CorrectCurveOnSurface(
0453     const TopoDS_Shape&               theS,
0454     const TopTools_IndexedMapOfShape& theMapToAvoid,
0455     const Standard_Real               theTolMax      = 0.0001,
0456     const Standard_Boolean            theRunParallel = Standard_False);
0457 
0458   //! Provides valid values of tolerances for the shape <theS>
0459   //! in  terms of BRepCheck_InvalidPointOnCurve.
0460   Standard_EXPORT static void CorrectPointOnCurve(
0461     const TopoDS_Shape&               theS,
0462     const TopTools_IndexedMapOfShape& theMapToAvoid,
0463     const Standard_Real               theTolMax      = 0.0001,
0464     const Standard_Boolean            theRunParallel = Standard_False);
0465 
0466   //! Corrects tolerance values of the sub-shapes of the shape <theS> if needed.
0467   Standard_EXPORT static void CorrectShapeTolerances(
0468     const TopoDS_Shape&               theS,
0469     const TopTools_IndexedMapOfShape& theMapToAvoid,
0470     const Standard_Boolean            theRunParallel = Standard_False);
0471 
0472 public: //! Checking if the faces are coinciding
0473   //! Checks if the given faces are same-domain, i.e. coincide.
0474   Standard_EXPORT static Standard_Boolean AreFacesSameDomain(
0475     const TopoDS_Face&              theF1,
0476     const TopoDS_Face&              theF2,
0477     const Handle(IntTools_Context)& theContext,
0478     const Standard_Real             theFuzz = Precision::Confusion());
0479 
0480 public: //! @name Looking for the edge in the face
0481   //! Returns True if the face theFace contains
0482   //! the edge theEdge but with opposite orientation.
0483   //! If the method  returns True theEdgeOff is the
0484   //! edge founded
0485   Standard_EXPORT static Standard_Boolean GetEdgeOff(const TopoDS_Edge& theEdge,
0486                                                      const TopoDS_Face& theFace,
0487                                                      TopoDS_Edge&       theEdgeOff);
0488 
0489   //! For the face theFace gets the edge theEdgeOnF
0490   //! that is the same as theEdge
0491   //! Returns True if such edge exists
0492   //! Returns False if there is no such edge
0493   Standard_EXPORT static Standard_Boolean GetEdgeOnFace(const TopoDS_Edge& theEdge,
0494                                                         const TopoDS_Face& theFace,
0495                                                         TopoDS_Edge&       theEdgeOnF);
0496 
0497 public: //! @name Correction of the edges range
0498   //! Correct shrunk range <aSR> taking into account 3D-curve
0499   //! resolution and corresponding tolerance values of <aE1>, <aE2>
0500   Standard_EXPORT static void CorrectRange(const TopoDS_Edge&    aE1,
0501                                            const TopoDS_Edge&    aE2,
0502                                            const IntTools_Range& aSR,
0503                                            IntTools_Range&       aNewSR);
0504 
0505   //! Correct shrunk range <aSR> taking into account 3D-curve
0506   //! resolution and corresponding tolerance values of <aE>, <aF>
0507   Standard_EXPORT static void CorrectRange(const TopoDS_Edge&    aE,
0508                                            const TopoDS_Face&    aF,
0509                                            const IntTools_Range& aSR,
0510                                            IntTools_Range&       aNewSR);
0511 
0512 public: //! @name Checking edge on micro status
0513   //! Checks if it is possible to compute shrunk range for the edge <aE>
0514   //! Flag <theCheckSplittable> defines whether to take into account
0515   //! the possibility to split the edge or not.
0516   Standard_EXPORT static Standard_Boolean IsMicroEdge(
0517     const TopoDS_Edge&              theEdge,
0518     const Handle(IntTools_Context)& theContext,
0519     const Standard_Boolean          theCheckSplittable = Standard_True);
0520 
0521 public: //! @name Solid classification
0522   //! Returns true if the solid <theSolid> is inverted
0523   Standard_EXPORT static Standard_Boolean IsInvertedSolid(const TopoDS_Solid& theSolid);
0524 
0525 public: //! @name Edge/Face Deviation computation
0526   //! Computes the necessary value of the tolerance for the edge
0527   Standard_EXPORT static Standard_Boolean ComputeTolerance(const TopoDS_Face& theFace,
0528                                                            const TopoDS_Edge& theEdge,
0529                                                            Standard_Real&     theMaxDist,
0530                                                            Standard_Real&     theMaxPar);
0531 
0532 public: //! @name Other methods
0533   //! Makes empty container of requested type
0534   Standard_EXPORT static void MakeContainer(const TopAbs_ShapeEnum theType, TopoDS_Shape& theShape);
0535 
0536   //! Compute a 3D-point on the edge <aEdge> at parameter <aPrm>
0537   Standard_EXPORT static void PointOnEdge(const TopoDS_Edge&  aEdge,
0538                                           const Standard_Real aPrm,
0539                                           gp_Pnt&             aP);
0540 
0541   //! Returns TRUE if PaveBlock <aPB> lays on the face <aF>, i.e
0542   //! the <PB> is IN or ON in 2D of <aF>
0543   Standard_EXPORT static Standard_Boolean IsBlockInOnFace(const IntTools_Range&           aShR,
0544                                                           const TopoDS_Face&              aF,
0545                                                           const TopoDS_Edge&              aE,
0546                                                           const Handle(IntTools_Context)& aContext);
0547 
0548   //! Returns the min and max dimensions of the shape <theS>.
0549   Standard_EXPORT static void Dimensions(const TopoDS_Shape& theS,
0550                                          Standard_Integer&   theDMin,
0551                                          Standard_Integer&   theDMax);
0552 
0553   //! Returns dimension of the shape <theS>.
0554   //! If the shape contains elements of different dimension, -1 is returned.
0555   Standard_EXPORT static Standard_Integer Dimension(const TopoDS_Shape& theS);
0556 
0557   //! Collects in the output list recursively all non-compound sub-shapes of the first level
0558   //! of the given shape theS. The optional map theMap is used to avoid the duplicates in the
0559   //! output list, so it will also contain all non-compound sub-shapes.
0560   Standard_EXPORT static void TreatCompound(const TopoDS_Shape&   theS,
0561                                             TopTools_ListOfShape& theList,
0562                                             TopTools_MapOfShape*  theMap = NULL);
0563 
0564   //! Returns true if the  shell <theShell> is open
0565   Standard_EXPORT static Standard_Boolean IsOpenShell(const TopoDS_Shell& theShell);
0566 };
0567 
0568 #endif // _BOPTools_AlgoTools_HeaderFile