File indexing completed on 2025-01-18 10:03:13
0001
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013
0014
0015
0016 #ifndef _BRepMesh_BaseMeshAlgo_HeaderFile
0017 #define _BRepMesh_BaseMeshAlgo_HeaderFile
0018
0019 #include <IMeshTools_MeshAlgo.hxx>
0020 #include <NCollection_Shared.hxx>
0021 #include <IMeshTools_Parameters.hxx>
0022 #include <BRepMesh_DegreeOfFreedom.hxx>
0023 #include <Poly_Triangulation.hxx>
0024
0025 class BRepMesh_DataStructureOfDelaun;
0026
0027
0028
0029 class BRepMesh_BaseMeshAlgo : public IMeshTools_MeshAlgo
0030 {
0031 public:
0032
0033 typedef NCollection_Shared<NCollection_Vector<gp_Pnt> > VectorOfPnt;
0034
0035
0036 Standard_EXPORT BRepMesh_BaseMeshAlgo();
0037
0038
0039 Standard_EXPORT virtual ~BRepMesh_BaseMeshAlgo();
0040
0041
0042 Standard_EXPORT virtual void Perform(
0043 const IMeshData::IFaceHandle& theDFace,
0044 const IMeshTools_Parameters& theParameters,
0045 const Message_ProgressRange& theRange = Message_ProgressRange()) Standard_OVERRIDE;
0046
0047 DEFINE_STANDARD_RTTIEXT(BRepMesh_BaseMeshAlgo, IMeshTools_MeshAlgo)
0048
0049 protected:
0050
0051
0052 const IMeshData::IFaceHandle& getDFace() const
0053 {
0054 return myDFace;
0055 }
0056
0057
0058 const IMeshTools_Parameters& getParameters() const
0059 {
0060 return myParameters;
0061 }
0062
0063
0064 const Handle(NCollection_IncAllocator)& getAllocator() const
0065 {
0066 return myAllocator;
0067 }
0068
0069
0070 const Handle(BRepMesh_DataStructureOfDelaun)& getStructure() const
0071 {
0072 return myStructure;
0073 }
0074
0075
0076 const Handle(VectorOfPnt)& getNodesMap() const
0077 {
0078 return myNodesMap;
0079 }
0080
0081 protected:
0082
0083
0084
0085 Standard_EXPORT virtual Standard_Integer registerNode(
0086 const gp_Pnt& thePoint,
0087 const gp_Pnt2d& thePoint2d,
0088 const BRepMesh_DegreeOfFreedom theMovability,
0089 const Standard_Boolean isForceAdd);
0090
0091
0092
0093 Standard_EXPORT virtual Standard_Integer addNodeToStructure(
0094 const gp_Pnt2d& thePoint,
0095 const Standard_Integer theLocation3d,
0096 const BRepMesh_DegreeOfFreedom theMovability,
0097 const Standard_Boolean isForceAdd);
0098
0099
0100 Standard_EXPORT virtual gp_Pnt2d getNodePoint2d(const BRepMesh_Vertex& theVertex) const;
0101
0102
0103 Standard_EXPORT virtual Standard_Boolean initDataStructure();
0104
0105
0106 Standard_EXPORT virtual void generateMesh(const Message_ProgressRange& theRange) = 0;
0107
0108 private:
0109
0110
0111
0112 TopAbs_Orientation fixSeamEdgeOrientation(
0113 const IMeshData::IEdgeHandle& theDEdge,
0114 const IMeshData::IPCurveHandle& thePCurve) const;
0115
0116
0117
0118 Standard_Integer addLinkToMesh(
0119 const Standard_Integer theFirstNodeId,
0120 const Standard_Integer theLastNodeId,
0121 const TopAbs_Orientation theOrientation);
0122
0123
0124 void commitSurfaceTriangulation();
0125
0126
0127 Handle(Poly_Triangulation) collectTriangles();
0128
0129
0130 void collectNodes(const Handle(Poly_Triangulation)& theTriangulation);
0131
0132 private:
0133 typedef NCollection_Shared<NCollection_DataMap<Standard_Integer, Standard_Integer> > DMapOfIntegerInteger;
0134
0135 IMeshData::IFaceHandle myDFace;
0136 IMeshTools_Parameters myParameters;
0137 Handle(NCollection_IncAllocator) myAllocator;
0138 Handle(BRepMesh_DataStructureOfDelaun) myStructure;
0139 Handle(VectorOfPnt) myNodesMap;
0140 Handle(DMapOfIntegerInteger) myUsedNodes;
0141 };
0142
0143 #endif