File indexing completed on 2026-05-22 08:29:09
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_Vector.hxx>
0023 #include <NCollection_List.hxx>
0024 #include <NCollection_Shared.hxx>
0025 #include <TColStd_SequenceOfInteger.hxx>
0026 #include <TColStd_DataMapOfIntegerInteger.hxx>
0027 #include <BRepMesh_DataStructureOfDelaun.hxx>
0028
0029 class Message_Messenger;
0030
0031
0032 class BRepMesh_Triangulator
0033 {
0034 public:
0035 DEFINE_STANDARD_ALLOC
0036
0037
0038 Standard_EXPORT static Handle(Poly_Triangulation) ToPolyTriangulation(
0039 const TColgp_Array1OfPnt& theNodes,
0040 const NCollection_List<Poly_Triangle>& thePolyTriangles);
0041
0042 public:
0043
0044 Standard_EXPORT BRepMesh_Triangulator(const NCollection_Vector<gp_XYZ>& theXYZs,
0045 const NCollection_List<TColStd_SequenceOfInteger>& theWires,
0046 const gp_Dir& theNorm);
0047
0048
0049 Standard_EXPORT Standard_Boolean Perform(NCollection_List<Poly_Triangle>& thePolyTriangles);
0050
0051
0052
0053 void SetMessenger(const Handle(Message_Messenger)& theMess) { myMess = theMess; }
0054
0055 BRepMesh_Triangulator& operator=(const BRepMesh_Triangulator& theOther);
0056
0057 private:
0058
0059 void addTriange34(const TColStd_SequenceOfInteger& theW,
0060 NCollection_List<Poly_Triangle>& thePolyTriangles);
0061
0062
0063 Standard_Boolean checkCondition(const int (&theNodes)[4],
0064 const TColStd_SequenceOfInteger& theWire);
0065
0066
0067 Standard_Boolean prepareMeshStructure();
0068
0069
0070 Standard_Boolean triangulate(NCollection_List<Poly_Triangle>& thePolyTriangles);
0071
0072 private:
0073 const NCollection_Vector<gp_XYZ>& myXYZs;
0074 const NCollection_List<TColStd_SequenceOfInteger>& myWires;
0075 gp_Pln myPlane;
0076 Handle(Message_Messenger) myMess;
0077
0078 Handle(BRepMesh_DataStructureOfDelaun) myMeshStructure;
0079 TColStd_DataMapOfIntegerInteger myTmpMap;
0080 Handle(IMeshData::VectorOfInteger) myIndices;
0081 };
0082
0083 #endif