Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-01-18 10:03:14

0001 // Created on: 2016-04-19
0002 // Copyright (c) 2016 OPEN CASCADE SAS
0003 // Created by: Oleg AGASHIN
0004 //
0005 // This file is part of Open CASCADE Technology software library.
0006 //
0007 // This library is free software; you can redistribute it and/or modify it under
0008 // the terms of the GNU Lesser General Public License version 2.1 as published
0009 // by the Free Software Foundation, with special exception defined in the file
0010 // OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
0011 // distribution for complete text of the license and disclaimer of any warranty.
0012 //
0013 // Alternatively, this file may be used under the terms of Open CASCADE
0014 // commercial license or contractual agreement.
0015 
0016 #ifndef _BRepMesh_ShapeTool_HeaderFile
0017 #define _BRepMesh_ShapeTool_HeaderFile
0018 
0019 #include <Standard_Transient.hxx>
0020 #include <IMeshData_Types.hxx>
0021 #include <Poly_Triangulation.hxx>
0022 #include <Poly_PolygonOnTriangulation.hxx>
0023 
0024 class Geom_Curve;
0025 class Geom2d_Curve;
0026 class Poly_Polygon3D;
0027 class TopoDS_Face;
0028 class TopoDS_Edge;
0029 class Bnd_Box;
0030 
0031 //! Auxiliary class providing functionality to compute,
0032 //! retrieve and store data to TopoDS and model shape.
0033 class BRepMesh_ShapeTool : public Standard_Transient
0034 {
0035 public:
0036 
0037   //! Returns maximum tolerance of the given face.
0038   //! Considers tolerances of edges and vertices contained in the given face.
0039   Standard_EXPORT static Standard_Real MaxFaceTolerance(
0040     const TopoDS_Face& theFace);
0041 
0042   //! Gets the maximum dimension of the given bounding box.
0043   //! If the given bounding box is void leaves the resulting value unchanged.
0044   //! @param theBox bounding box to be processed.
0045   //! @param theMaxDimension maximum dimension of the given box.
0046   Standard_EXPORT static void BoxMaxDimension(const Bnd_Box& theBox,
0047                                               Standard_Real& theMaxDimension);
0048 
0049   //! Checks same parameter, same range and degenerativity attributes
0050   //! using geometrical data of the given edge and updates edge model
0051   //! by computed parameters in case of worst case - it can drop flags
0052   //! same parameter and same range to False but never to True if it is 
0053   //! already set to False. In contrary, it can also drop degenerated 
0054   //! flag to True, but never to False if it is already set to True.
0055   Standard_EXPORT static void CheckAndUpdateFlags (
0056     const IMeshData::IEdgeHandle&   theEdge,
0057     const IMeshData::IPCurveHandle& thePCurve);
0058 
0059   //! Stores the given triangulation into the given face.
0060   //! @param theFace face to be updated by triangulation.
0061   //! @param theTriangulation triangulation to be stored into the face.
0062   Standard_EXPORT static void AddInFace(
0063     const TopoDS_Face&          theFace,
0064     Handle(Poly_Triangulation)& theTriangulation);
0065 
0066   //! Nullifies triangulation stored in the face.
0067   //! @param theFace face to be updated by null triangulation.
0068   Standard_EXPORT static void NullifyFace (const TopoDS_Face& theFace);
0069 
0070   //! Nullifies polygon on triangulation stored in the edge.
0071   //! @param theEdge edge to be updated by null polygon.
0072   //! @param theTriangulation triangulation the given edge is associated to.
0073   //! @param theLocation face location.
0074   Standard_EXPORT static void NullifyEdge (
0075     const TopoDS_Edge&                 theEdge,
0076     const Handle (Poly_Triangulation)& theTriangulation,
0077     const TopLoc_Location&             theLocation);
0078 
0079   //! Nullifies 3d polygon stored in the edge.
0080   //! @param theEdge edge to be updated by null polygon.
0081   //! @param theLocation face location.
0082   Standard_EXPORT static void NullifyEdge (
0083     const TopoDS_Edge&     theEdge,
0084     const TopLoc_Location& theLocation);
0085 
0086   //! Updates the given edge by the given tessellated representation.
0087   //! @param theEdge edge to be updated.
0088   //! @param thePolygon tessellated representation of the edge to be stored.
0089   //! @param theTriangulation triangulation the given edge is associated to.
0090   //! @param theLocation face location.
0091   Standard_EXPORT static void UpdateEdge (
0092     const TopoDS_Edge&                          theEdge,
0093     const Handle (Poly_PolygonOnTriangulation)& thePolygon,
0094     const Handle (Poly_Triangulation)&          theTriangulation,
0095     const TopLoc_Location&                      theLocation);
0096 
0097   //! Updates the given edge by the given tessellated representation.
0098   //! @param theEdge edge to be updated.
0099   //! @param thePolygon tessellated representation of the edge to be stored.
0100   Standard_EXPORT static void UpdateEdge(
0101     const TopoDS_Edge&            theEdge,
0102     const Handle(Poly_Polygon3D)& thePolygon);
0103 
0104   //! Updates the given seam edge by the given tessellated representations.
0105   //! @param theEdge edge to be updated.
0106   //! @param thePolygon1 tessellated representation corresponding to
0107   //! forward direction of the seam edge.
0108   //! @param thePolygon2 tessellated representation corresponding to
0109   //! reversed direction of the seam edge.
0110   //! @param theTriangulation triangulation the given edge is associated to.
0111   //! @param theLocation face location.
0112   Standard_EXPORT static void UpdateEdge (
0113     const TopoDS_Edge&                          theEdge,
0114     const Handle (Poly_PolygonOnTriangulation)& thePolygon1,
0115     const Handle (Poly_PolygonOnTriangulation)& thePolygon2,
0116     const Handle (Poly_Triangulation)&          theTriangulation,
0117     const TopLoc_Location&                      theLocation);
0118 
0119   //! Applies location to the given point and return result.
0120   //! @param thePnt point to be transformed.
0121   //! @param theLoc location to be applied.
0122   Standard_EXPORT static gp_Pnt UseLocation (
0123     const gp_Pnt&          thePnt,
0124     const TopLoc_Location& theLoc);
0125 
0126   //! Gets the strict UV locations of the extremities of the edge using pcurve.
0127   Standard_EXPORT static Standard_Boolean UVPoints (
0128     const TopoDS_Edge&      theEdge,
0129     const TopoDS_Face&      theFace,
0130     gp_Pnt2d&               theFirstPoint2d,
0131     gp_Pnt2d&               theLastPoint2d,
0132     const Standard_Boolean  isConsiderOrientation = Standard_False);
0133 
0134   //! Gets the parametric range of the given edge on the given face.
0135   Standard_EXPORT static Standard_Boolean Range (
0136     const TopoDS_Edge&      theEdge,
0137     const TopoDS_Face&      theFace,
0138     Handle (Geom2d_Curve)&  thePCurve,
0139     Standard_Real&          theFirstParam,
0140     Standard_Real&          theLastParam,
0141     const Standard_Boolean  isConsiderOrientation = Standard_False);
0142 
0143   //! Gets the 3d range of the given edge.
0144   Standard_EXPORT static Standard_Boolean Range (
0145     const TopoDS_Edge&      theEdge,
0146     Handle (Geom_Curve)&    theCurve,
0147     Standard_Real&          theFirstParam,
0148     Standard_Real&          theLastParam,
0149     const Standard_Boolean  isConsiderOrientation = Standard_False);
0150 
0151   DEFINE_STANDARD_RTTIEXT(BRepMesh_ShapeTool, Standard_Transient)
0152 };
0153 
0154 #endif