File indexing completed on 2026-09-25 09:20:34
0001
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013
0014
0015
0016 #ifndef MeshTest_CheckTopology_HeaderFile
0017 #define MeshTest_CheckTopology_HeaderFile
0018
0019 #include <TopoDS_Shape.hxx>
0020 #include <NCollection_IndexedDataMap.hxx>
0021 #include <Standard_Integer.hxx>
0022 #include <NCollection_Sequence.hxx>
0023 #include <NCollection_HSequence.hxx>
0024 #include <Draw_Interpretor.hxx>
0025
0026
0027
0028
0029
0030
0031
0032
0033
0034
0035
0036
0037
0038
0039
0040
0041 class MeshTest_CheckTopology
0042 {
0043 public:
0044
0045 MeshTest_CheckTopology(const TopoDS_Shape& theShape)
0046 : myShape(theShape)
0047 {
0048 }
0049
0050
0051 Standard_EXPORT void Perform(Draw_Interpretor& di);
0052
0053
0054 int NbFacesWithFL() const { return myMapFaceLinks.Extent(); }
0055
0056
0057
0058 int GetFaceNumWithFL(const int theIndex) const { return myMapFaceLinks.FindKey(theIndex); }
0059
0060
0061 int NbFreeLinks(const int theIndex) const { return myMapFaceLinks(theIndex)->Length() / 2; }
0062
0063
0064
0065 Standard_EXPORT void GetFreeLink(const int theFaceIndex,
0066 const int theLinkIndex,
0067 int& theNode1,
0068 int& theNode2) const;
0069
0070
0071 int NbCrossFaceErrors() const { return myErrorsVal.Length(); }
0072
0073
0074 Standard_EXPORT void GetCrossFaceError(const int theIndex,
0075 int& theFace1,
0076 int& theNode1,
0077 int& theFace2,
0078 int& theNode2,
0079 double& theValue) const;
0080
0081
0082 int NbAsyncEdges() const { return myAsyncEdges.Length(); }
0083
0084
0085 int GetAsyncEdgeNum(const int theIndex) const { return myAsyncEdges(theIndex); }
0086
0087
0088 int NbFreeNodes() const { return myFreeNodeFaces.Length(); }
0089
0090
0091
0092 void GetFreeNodeNum(const int theIndex, int& theFaceNum, int& theNodeNum) const
0093 {
0094 theFaceNum = myFreeNodeFaces(theIndex);
0095 theNodeNum = myFreeNodeNums(theIndex);
0096 }
0097
0098
0099 int NbSmallTriangles() const { return mySmallTrianglesFaces.Length(); }
0100
0101
0102
0103
0104 void GetSmallTriangle(const int theIndex, int& theFaceNum, int& theNodeNum) const
0105 {
0106 theFaceNum = mySmallTrianglesFaces(theIndex);
0107 theNodeNum = mySmallTrianglesTriangles(theIndex);
0108 }
0109
0110 private:
0111 TopoDS_Shape myShape;
0112 NCollection_IndexedDataMap<int, occ::handle<NCollection_HSequence<int>>> myMapFaceLinks;
0113
0114 NCollection_Sequence<int> myErrors;
0115 NCollection_Sequence<double> myErrorsVal;
0116
0117 NCollection_Sequence<int> myAsyncEdges;
0118 NCollection_Sequence<int> myFreeNodeFaces;
0119 NCollection_Sequence<int> myFreeNodeNums;
0120 NCollection_Sequence<int> mySmallTrianglesFaces;
0121 NCollection_Sequence<int> mySmallTrianglesTriangles;
0122 };
0123
0124 #endif