File indexing completed on 2026-09-13 09:15:56
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 typedef NCollection_Shared<NCollection_DynamicArray<gp_Pnt>> VectorOfPnt;
0033
0034
0035 Standard_EXPORT BRepMesh_BaseMeshAlgo();
0036
0037
0038 Standard_EXPORT ~BRepMesh_BaseMeshAlgo() override;
0039
0040
0041 Standard_EXPORT void Perform(
0042 const IMeshData::IFaceHandle& theDFace,
0043 const IMeshTools_Parameters& theParameters,
0044 const Message_ProgressRange& theRange = Message_ProgressRange()) override;
0045
0046 DEFINE_STANDARD_RTTIEXT(BRepMesh_BaseMeshAlgo, IMeshTools_MeshAlgo)
0047
0048 protected:
0049
0050 const IMeshData::IFaceHandle& getDFace() const { return myDFace; }
0051
0052
0053 const IMeshTools_Parameters& getParameters() const { return myParameters; }
0054
0055
0056 const occ::handle<NCollection_IncAllocator>& getAllocator() const { return myAllocator; }
0057
0058
0059 const occ::handle<BRepMesh_DataStructureOfDelaun>& getStructure() const { return myStructure; }
0060
0061
0062 const occ::handle<VectorOfPnt>& getNodesMap() const { return myNodesMap; }
0063
0064 protected:
0065
0066
0067 Standard_EXPORT virtual int registerNode(const gp_Pnt& thePoint,
0068 const gp_Pnt2d& thePoint2d,
0069 const BRepMesh_DegreeOfFreedom theMovability,
0070 const bool isForceAdd);
0071
0072
0073
0074 Standard_EXPORT virtual int addNodeToStructure(const gp_Pnt2d& thePoint,
0075 const int theLocation3d,
0076 const BRepMesh_DegreeOfFreedom theMovability,
0077 const bool isForceAdd);
0078
0079
0080 Standard_EXPORT virtual gp_Pnt2d getNodePoint2d(const BRepMesh_Vertex& theVertex) const;
0081
0082
0083 Standard_EXPORT virtual bool initDataStructure();
0084
0085
0086 Standard_EXPORT virtual void generateMesh(const Message_ProgressRange& theRange) = 0;
0087
0088 private:
0089
0090
0091 TopAbs_Orientation fixSeamEdgeOrientation(const IMeshData::IEdgeHandle& theDEdge,
0092 const IMeshData::IPCurveHandle& thePCurve) const;
0093
0094
0095
0096 int addLinkToMesh(const int theFirstNodeId,
0097 const int theLastNodeId,
0098 const TopAbs_Orientation theOrientation);
0099
0100
0101 void commitSurfaceTriangulation();
0102
0103
0104 occ::handle<Poly_Triangulation> collectTriangles();
0105
0106
0107 void collectNodes(const occ::handle<Poly_Triangulation>& theTriangulation);
0108
0109 private:
0110 typedef NCollection_Shared<NCollection_DataMap<int, int>> DMapOfIntegerInteger;
0111
0112 IMeshData::IFaceHandle myDFace;
0113 IMeshTools_Parameters myParameters;
0114 occ::handle<NCollection_IncAllocator> myAllocator;
0115 occ::handle<BRepMesh_DataStructureOfDelaun> myStructure;
0116 occ::handle<VectorOfPnt> myNodesMap;
0117 occ::handle<DMapOfIntegerInteger> myUsedNodes;
0118 };
0119
0120 #endif