// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE // // Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN, // CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS // // This library is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public // License as published by the Free Software Foundation; either // version 2.1 of the License. // // This library is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU // Lesser General Public License for more details. // // You should have received a copy of the GNU Lesser General Public // License along with this library; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com // #ifndef _GEOMAlgo_Tools3D_HeaderFile #define _GEOMAlgo_Tools3D_HeaderFile #ifndef _Standard_Boolean_HeaderFile #include #endif #ifndef _Standard_Integer_HeaderFile #include #endif #ifndef _TopAbs_ShapeEnum_HeaderFile #include #endif #ifndef _TopAbs_State_HeaderFile #include #endif #ifndef _Standard_Real_HeaderFile #include #endif class TopoDS_Shape; class IntTools_Context; class TopoDS_Face; class TopoDS_Edge; class TopTools_ListOfShape; class TopTools_IndexedMapOfShape; class TopoDS_Solid; class gp_Pnt; class TopoDS_Vertex; class TopTools_IndexedDataMapOfShapeListOfShape; class NMTTools_ListOfCoupleOfShape; #ifndef _Standard_HeaderFile #include #endif #ifndef _Standard_Macro_HeaderFile #include #endif //! Auxiliary tools for Algorithms
class GEOMAlgo_Tools3D { public: void* operator new(size_t,void* anAddress) { return anAddress; } void* operator new(size_t size) { return Standard::Allocate(size); } void operator delete(void *anAddress) { if (anAddress) Standard::Free((Standard_Address&)anAddress); } // Methods PUBLIC // //! Returns True if the shape theSplit has opposite
//! direction than theShape
//! theContext - cashed geometrical tools
Standard_EXPORT static Standard_Boolean IsSplitToReverse(const TopoDS_Shape& theSplit,const TopoDS_Shape& theShape,IntTools_Context& theContext) ; //! Returns True if normal direction of the face
//! theShape is not the same as for the face
//! theSplit
//! theContext - cashed geometrical tools
Standard_EXPORT static Standard_Boolean IsSplitToReverse(const TopoDS_Face& theSplit,const TopoDS_Face& theShape,IntTools_Context& theContext) ; //! Returns True if tangent direction of the edge
//! theEdge is not the same as for the edge
//! theSplit
//! theContext - cashed geometrical tools
Standard_EXPORT static Standard_Boolean IsSplitToReverse(const TopoDS_Edge& theEdge,const TopoDS_Edge& theSplit,IntTools_Context& theContext) ; //! For the couple of faces theF1, theF2
//! computes sense value
//! Returns 0 if the faces are not sensible
//! Returns 1 if the faces have same sense
//! Returns 2 if the faces have opposite sense
Standard_EXPORT static Standard_Integer Sense(const TopoDS_Face& theF1,const TopoDS_Face& theF2) ; //! Makes new face theF2 from surface and wires
//! of the face theF1
Standard_EXPORT static void CopyFace(const TopoDS_Face& theF1,TopoDS_Face& theF2) ; //! Makes empty shape theShape of the type theType
Standard_EXPORT static void MakeContainer(const TopAbs_ShapeEnum theType,TopoDS_Shape& theShape) ; //! For the list of faces theLS build block
//! theLSCB in terms of connexity by edges
//! theMapAvoid - set of edges to avoid for
//! the treatment
Standard_EXPORT static void MakeConnexityBlock(const TopTools_ListOfShape& theLS,const TopTools_IndexedMapOfShape& theMapAvoid,TopTools_ListOfShape& theLSCB) ; //! Computes the 3-D state of the shape theShape
//! toward solid theSolid.
//! theTol - value of precision of computation
//! theContext- cahed geometrical tools
//! Returns 3-D state.
Standard_EXPORT static TopAbs_State ComputeStateByOnePoint(const TopoDS_Shape& theShape,const TopoDS_Solid& theSolid,const Standard_Real theTol,IntTools_Context& theContext) ; //! Computes the 3-D state of the point thePoint
//! toward solid theSolid.
//! theTol - value of precision of computation
//! theContext- cahed geometrical tools
//! Returns 3-D state.
Standard_EXPORT static TopAbs_State ComputeState(const gp_Pnt& thePoint,const TopoDS_Solid& theSolid,const Standard_Real theTol,IntTools_Context& theContext) ; //! Computes the 3-D state of the vertex theVertex
//! toward solid theSolid.
//! theTol - value of precision of computation
//! theContext- cahed geometrical tools
//! Returns 3-D state.
Standard_EXPORT static TopAbs_State ComputeState(const TopoDS_Vertex& theVertex,const TopoDS_Solid& theSolid,const Standard_Real theTol,IntTools_Context& theContext) ; //! Computes the 3-D state of the edge theEdge
//! toward solid theSolid.
//! theTol - value of precision of computation
//! theContext- cahed geometrical tools
//! Returns 3-D state.
Standard_EXPORT static TopAbs_State ComputeState(const TopoDS_Edge& theEdge,const TopoDS_Solid& theSolid,const Standard_Real theTol,IntTools_Context& theContext) ; //! Computes the 3-D state of the face theFace
//! toward solid theSolid.
//! theTol - value of precision of computation
//! theBounds - set of edges of theFace to avoid
//! theContext- cahed geometrical tools
//! Returns 3-D state.
Standard_EXPORT static TopAbs_State ComputeState(const TopoDS_Face& theFace,const TopoDS_Solid& theSolid,const Standard_Real theTol,const TopTools_IndexedMapOfShape& theBounds,IntTools_Context& theContext) ; //! Returns True if the face theFace is inside of the
//! couple of faces theFace1, theFace2.
//! The faces theFace, theFace1, theFace2 must
//! share the edge theEdge
Standard_EXPORT static Standard_Boolean IsInternalFace(const TopoDS_Face& theFace,const TopoDS_Edge& theEdge,const TopoDS_Face& theFace1,const TopoDS_Face& theFace2) ; //! Returns True if the face theFace is inside of the
//! appropriate couple of faces (from the set theLF) .
//! The faces of the set theLF and theFace must
//! share the edge theEdge
Standard_EXPORT static Standard_Boolean IsInternalFace(const TopoDS_Face& theFace,const TopoDS_Edge& theEdge,const TopTools_ListOfShape& theLF) ; //! Returns True if the face theFace is inside the
//! solid theSolid.
//! theMEF - Map Edge/Faces for theSolid
//! theTol - value of precision of computation
//! theContext- cahed geometrical tools
Standard_EXPORT static Standard_Boolean IsInternalFace(const TopoDS_Face& theFace,const TopoDS_Solid& theSolid,const TopTools_IndexedDataMapOfShapeListOfShape& theMEF,const Standard_Real theTol,IntTools_Context& theContext) ; //! For the face theFace and its edge theEdge
//! finds the face suitable to produce shell.
//! theLCEF - set of faces to search. All faces
//! from theLCEF must share edge theEdge
Standard_EXPORT static void GetFaceOff(const TopoDS_Edge& theEdge,const TopoDS_Face& theFace,const NMTTools_ListOfCoupleOfShape& theLCEF,TopoDS_Face& theFaceOff) ; //! For the face theFace gets the edge theEdgeOnF
//! that is the same as theEdge
//! Returns True if such edge exists
//! Returns False if there is no such edge
Standard_EXPORT static Standard_Boolean GetEdgeOnFace(const TopoDS_Edge& theEdge,const TopoDS_Face& theFace,TopoDS_Edge& theEdgeOnF) ; //! Returns True if the face theFace contains
//! the edge theEdge but with opposite orientation.
//! If the method returns True theEdgeOff is the
//! edge founded
Standard_EXPORT static Standard_Boolean GetEdgeOff(const TopoDS_Edge& theEdge,const TopoDS_Face& theFace,TopoDS_Edge& theEdgeOff) ; protected: // Methods PROTECTED // // Fields PROTECTED // private: // Methods PRIVATE // // Fields PRIVATE // }; // other Inline functions and methods (like "C++: function call" methods) // #endif