File indexing completed on 2026-10-04 09:13:48
0001
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013
0014
0015
0016 #ifndef _BRepExtrema_TriangleSet_HeaderFile
0017 #define _BRepExtrema_TriangleSet_HeaderFile
0018
0019 #include <BVH_PrimitiveSet3d.hxx>
0020 #include <gp_Pnt.hxx>
0021 #include <NCollection_Array1.hxx>
0022 #include <Standard_Integer.hxx>
0023 #include <NCollection_DataMap.hxx>
0024 #include <TopoDS_Edge.hxx>
0025 #include <TopoDS_Face.hxx>
0026
0027
0028
0029
0030 class BRepExtrema_TriangleSet : public BVH_PrimitiveSet3d
0031 {
0032 public:
0033
0034 Standard_EXPORT BRepExtrema_TriangleSet();
0035
0036
0037 Standard_EXPORT BRepExtrema_TriangleSet(const NCollection_DynamicArray<TopoDS_Shape>& theFaces);
0038
0039
0040 Standard_EXPORT ~BRepExtrema_TriangleSet() override;
0041
0042 public:
0043
0044 Standard_EXPORT int Size() const override;
0045
0046
0047 Standard_EXPORT BVH_Box<double, 3> Box(const int theIndex) const override;
0048
0049
0050 using BVH_PrimitiveSet3d::Box;
0051
0052
0053 Standard_EXPORT double Center(const int theIndex, const int theAxis) const override;
0054
0055
0056 Standard_EXPORT void Swap(const int theIndex1, const int theIndex2) override;
0057
0058 public:
0059
0060 Standard_EXPORT void Clear();
0061
0062
0063 Standard_EXPORT bool Init(const NCollection_DynamicArray<TopoDS_Shape>& theShapes);
0064
0065
0066 Standard_EXPORT const BVH_Array3d& GetVertices() const { return myVertexArray; }
0067
0068
0069 Standard_EXPORT void GetVertices(const int theIndex,
0070 BVH_Vec3d& theVertex1,
0071 BVH_Vec3d& theVertex2,
0072 BVH_Vec3d& theVertex3) const;
0073
0074
0075 Standard_EXPORT void GetVtxIndices(const int theIndex,
0076 NCollection_Array1<int>& theVtxIndices) const;
0077
0078
0079 Standard_EXPORT int GetFaceID(const int theIndex) const;
0080
0081
0082 Standard_EXPORT int GetShapeIDOfVtx(const int theIndex) const;
0083
0084
0085
0086 Standard_EXPORT int GetVtxIdxInShape(const int theIndex) const;
0087
0088
0089
0090 Standard_EXPORT int GetTrgIdxInShape(const int theIndex) const;
0091
0092 private:
0093
0094 bool initFace(const TopoDS_Face& theFace, const int theIndex);
0095
0096
0097 bool initEdge(const TopoDS_Edge& theEdge, const int theIndex);
0098
0099
0100 void initNodes(const NCollection_Array1<gp_Pnt>& theNodes,
0101 const gp_Trsf& theTrsf,
0102 const int theIndex);
0103
0104 protected:
0105
0106 BVH_Array4i myTriangles;
0107
0108
0109 BVH_Array3d myVertexArray;
0110
0111
0112
0113 NCollection_DynamicArray<int> myShapeIdxOfVtxVec;
0114
0115
0116 NCollection_DynamicArray<int> myNumVtxInShapeVec;
0117
0118
0119 NCollection_DynamicArray<int> myNumTrgInShapeVec;
0120
0121
0122 NCollection_DataMap<int, int> myTrgIdxMap;
0123
0124 public:
0125 DEFINE_STANDARD_RTTIEXT(BRepExtrema_TriangleSet, BVH_PrimitiveSet3d)
0126 };
0127
0128 #endif