File indexing completed on 2026-11-18 10:38:47
0001
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013
0014
0015
0016 #ifndef _BRepMesh_Triangulator_HeaderFile
0017 #define _BRepMesh_Triangulator_HeaderFile
0018
0019 #include <gp_Pln.hxx>
0020 #include <Poly_Triangulation.hxx>
0021 #include <IMeshData_Types.hxx>
0022 #include <NCollection_DynamicArray.hxx>
0023 #include <NCollection_List.hxx>
0024 #include <NCollection_Shared.hxx>
0025 #include <Standard_Integer.hxx>
0026 #include <NCollection_Sequence.hxx>
0027 #include <NCollection_DataMap.hxx>
0028 #include <BRepMesh_DataStructureOfDelaun.hxx>
0029
0030 class Message_Messenger;
0031
0032
0033 class BRepMesh_Triangulator
0034 {
0035 public:
0036 DEFINE_STANDARD_ALLOC
0037
0038
0039 Standard_EXPORT static occ::handle<Poly_Triangulation> ToPolyTriangulation(
0040 const NCollection_Array1<gp_Pnt>& theNodes,
0041 const NCollection_List<Poly_Triangle>& thePolyTriangles);
0042
0043 public:
0044
0045 Standard_EXPORT BRepMesh_Triangulator(const NCollection_DynamicArray<gp_XYZ>& theXYZs,
0046 const NCollection_List<NCollection_Sequence<int>>& theWires,
0047 const gp_Dir& theNorm);
0048
0049
0050 Standard_EXPORT bool Perform(NCollection_List<Poly_Triangle>& thePolyTriangles);
0051
0052
0053
0054 void SetMessenger(const occ::handle<Message_Messenger>& theMess) { myMess = theMess; }
0055
0056 BRepMesh_Triangulator& operator=(const BRepMesh_Triangulator& theOther);
0057
0058 private:
0059
0060 void addTriange34(const NCollection_Sequence<int>& theW,
0061 NCollection_List<Poly_Triangle>& thePolyTriangles);
0062
0063
0064 bool checkCondition(const int (&theNodes)[4], const NCollection_Sequence<int>& theWire);
0065
0066
0067 bool prepareMeshStructure();
0068
0069
0070 bool triangulate(NCollection_List<Poly_Triangle>& thePolyTriangles);
0071
0072 private:
0073 const NCollection_DynamicArray<gp_XYZ>& myXYZs;
0074 const NCollection_List<NCollection_Sequence<int>>& myWires;
0075 gp_Pln myPlane;
0076 occ::handle<Message_Messenger> myMess;
0077
0078 occ::handle<BRepMesh_DataStructureOfDelaun> myMeshStructure;
0079 NCollection_DataMap<int, int> myTmpMap;
0080 Handle(IMeshData::VectorOfInteger) myIndices;
0081 };
0082
0083 #endif