// Copyright (C) 2007-2011 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 #include #ifndef _Standard_HeaderFile #include #endif #ifndef _Standard_Macro_HeaderFile #include #endif #ifndef _Standard_Boolean_HeaderFile #include #endif #if OCC_VERSION_LARGE > 0x06050200 #ifndef _Handle_IntTools_Context_HeaderFile #include #endif #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 gp_Pnt2d; class TopoDS_Vertex; class TopTools_IndexedDataMapOfShapeListOfShape; class NMTTools_ListOfCoupleOfShape; //! 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); } //! 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, #if OCC_VERSION_LARGE > 0x06050200 const Handle(IntTools_Context)& theContext); #else IntTools_Context& theContext); #endif //! 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, #if OCC_VERSION_LARGE > 0x06050200 const Handle(IntTools_Context)& theContext); #else IntTools_Context& theContext); #endif //! 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, #if OCC_VERSION_LARGE > 0x06050200 const Handle(IntTools_Context)& theContext); #else IntTools_Context& theContext); #endif //! 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, #if OCC_VERSION_LARGE > 0x06050200 const Handle(IntTools_Context)& theContext); #else IntTools_Context& theContext); #endif //! 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, #if OCC_VERSION_LARGE > 0x06050200 const Handle(IntTools_Context)& theContext); #else IntTools_Context& theContext); #endif //! 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, #if OCC_VERSION_LARGE > 0x06050200 const Handle(IntTools_Context)& theContext); #else IntTools_Context& theContext); #endif //! 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, #if OCC_VERSION_LARGE > 0x06050200 const Handle(IntTools_Context)& theContext); #else IntTools_Context& theContext); #endif //! 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, #if OCC_VERSION_LARGE > 0x06050200 const Handle(IntTools_Context)& theContext); #else IntTools_Context& theContext); #endif //! 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, #if OCC_VERSION_LARGE > 0x06050200 const Handle(IntTools_Context)& theContext); #else IntTools_Context& theContext); #endif //! 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, #if OCC_VERSION_LARGE > 0x06050200 const Handle(IntTools_Context)& theContext); #else IntTools_Context& theContext); #endif //! 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, #if OCC_VERSION_LARGE > 0x06050200 const Handle(IntTools_Context)& theContext); #else IntTools_Context& theContext); #endif //! 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); //! Computes a point inside the face .
//! - 2D representation of
//! on the surface of
//! Returns 0 in case of success.
Standard_EXPORT static Standard_Integer PntInFace (const TopoDS_Face& theF, gp_Pnt& theP, gp_Pnt2d& theP2D); protected: private: }; // other Inline functions and methods (like "C++: function call" methods) #endif