File indexing completed on 2026-09-22 08:57:18
0001
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013
0014
0015
0016 #ifndef _BRepMesh_FaceChecker_HeaderFile
0017 #define _BRepMesh_FaceChecker_HeaderFile
0018
0019 #include <IMeshTools_Parameters.hxx>
0020 #include <Standard_Transient.hxx>
0021 #include <IMeshData_Face.hxx>
0022 #include <Standard_Type.hxx>
0023 #include <NCollection_Shared.hxx>
0024
0025
0026
0027
0028
0029 class BRepMesh_FaceChecker : public Standard_Transient
0030 {
0031 public:
0032
0033 struct Segment
0034 {
0035 IMeshData::IEdgePtr EdgePtr;
0036 gp_Pnt2d* Point1;
0037 gp_Pnt2d* Point2;
0038
0039 Segment()
0040 : EdgePtr(nullptr),
0041 Point1(nullptr),
0042 Point2(nullptr)
0043 {
0044 }
0045
0046 Segment(const IMeshData::IEdgePtr& theEdgePtr, gp_Pnt2d* thePoint1, gp_Pnt2d* thePoint2)
0047 : EdgePtr(theEdgePtr),
0048 Point1(thePoint1),
0049 Point2(thePoint2)
0050 {
0051 }
0052 };
0053
0054 typedef NCollection_Shared<NCollection_DynamicArray<Segment>> Segments;
0055 typedef NCollection_Shared<NCollection_Array1<occ::handle<Segments>>> ArrayOfSegments;
0056 typedef NCollection_Shared<NCollection_Array1<Handle(IMeshData::BndBox2dTree)>> ArrayOfBndBoxTree;
0057 typedef NCollection_Shared<NCollection_Array1<Handle(IMeshData::MapOfIEdgePtr)>>
0058 ArrayOfMapOfIEdgePtr;
0059
0060
0061 Standard_EXPORT BRepMesh_FaceChecker(const IMeshData::IFaceHandle& theFace,
0062 const IMeshTools_Parameters& theParameters);
0063
0064
0065 Standard_EXPORT ~BRepMesh_FaceChecker() override;
0066
0067
0068
0069 Standard_EXPORT bool Perform();
0070
0071
0072 const Handle(IMeshData::MapOfIEdgePtr)& GetIntersectingEdges() const
0073 {
0074 return myIntersectingEdges;
0075 }
0076
0077
0078 void operator()(const int theWireIndex) const { perform(theWireIndex); }
0079
0080 DEFINE_STANDARD_RTTIEXT(BRepMesh_FaceChecker, Standard_Transient)
0081
0082 private:
0083
0084 bool isParallel() const { return (myParameters.InParallel && myDFace->WiresNb() > 1); }
0085
0086
0087 void collectSegments();
0088
0089
0090 void collectResult();
0091
0092
0093 void perform(const int theWireIndex) const;
0094
0095 private:
0096 BRepMesh_FaceChecker(const BRepMesh_FaceChecker& theOther) = delete;
0097
0098 void operator=(const BRepMesh_FaceChecker& theOther) = delete;
0099
0100 private:
0101 IMeshData::IFaceHandle myDFace;
0102 const IMeshTools_Parameters& myParameters;
0103
0104 occ::handle<ArrayOfSegments> myWiresSegments;
0105 occ::handle<ArrayOfBndBoxTree> myWiresBndBoxTree;
0106 occ::handle<ArrayOfMapOfIEdgePtr> myWiresIntersectingEdges;
0107 Handle(IMeshData::MapOfIEdgePtr) myIntersectingEdges;
0108 };
0109
0110 #endif