File indexing completed on 2025-01-18 10:03:10
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 <TColgp_Array1OfPnt.hxx>
0021 #include <TColStd_DataMapOfIntegerInteger.hxx>
0022 #include <TopoDS_Edge.hxx>
0023 #include <TopoDS_Face.hxx>
0024
0025
0026 typedef NCollection_Vector<TopoDS_Shape> BRepExtrema_ShapeList;
0027
0028
0029 class BRepExtrema_TriangleSet : public BVH_PrimitiveSet3d
0030 {
0031 public:
0032
0033
0034 Standard_EXPORT BRepExtrema_TriangleSet();
0035
0036
0037 Standard_EXPORT BRepExtrema_TriangleSet (const BRepExtrema_ShapeList& theFaces);
0038
0039
0040 Standard_EXPORT ~BRepExtrema_TriangleSet();
0041
0042 public:
0043
0044
0045 Standard_EXPORT Standard_Integer Size() const Standard_OVERRIDE;
0046
0047
0048 Standard_EXPORT BVH_Box<Standard_Real, 3> Box (const Standard_Integer theIndex) const Standard_OVERRIDE;
0049
0050
0051 using BVH_PrimitiveSet3d::Box;
0052
0053
0054 Standard_EXPORT Standard_Real Center (const Standard_Integer theIndex, const Standard_Integer theAxis) const Standard_OVERRIDE;
0055
0056
0057 Standard_EXPORT void Swap (const Standard_Integer theIndex1, const Standard_Integer theIndex2) Standard_OVERRIDE;
0058
0059 public:
0060
0061
0062 Standard_EXPORT void Clear();
0063
0064
0065 Standard_EXPORT Standard_Boolean Init (const BRepExtrema_ShapeList& theShapes);
0066
0067
0068 Standard_EXPORT const BVH_Array3d& GetVertices() const { return myVertexArray; }
0069
0070
0071 Standard_EXPORT void GetVertices (const Standard_Integer theIndex,
0072 BVH_Vec3d& theVertex1,
0073 BVH_Vec3d& theVertex2,
0074 BVH_Vec3d& theVertex3) const;
0075
0076
0077 Standard_EXPORT void GetVtxIndices (const Standard_Integer theIndex,
0078 NCollection_Array1<Standard_Integer>& theVtxIndices) const;
0079
0080
0081 Standard_EXPORT Standard_Integer GetFaceID (const Standard_Integer theIndex) const;
0082
0083
0084 Standard_EXPORT Standard_Integer GetShapeIDOfVtx (const Standard_Integer theIndex) const;
0085
0086
0087
0088 Standard_EXPORT Standard_Integer GetVtxIdxInShape (const Standard_Integer theIndex) const;
0089
0090
0091
0092 Standard_EXPORT Standard_Integer GetTrgIdxInShape (const Standard_Integer theIndex) const;
0093
0094 private:
0095
0096
0097 Standard_Boolean initFace (const TopoDS_Face& theFace, const Standard_Integer theIndex);
0098
0099
0100 Standard_Boolean initEdge (const TopoDS_Edge& theEdge, const Standard_Integer theIndex);
0101
0102
0103 void initNodes (const TColgp_Array1OfPnt& theNodes,
0104 const gp_Trsf& theTrsf,
0105 const Standard_Integer theIndex);
0106
0107 protected:
0108
0109
0110 BVH_Array4i myTriangles;
0111
0112
0113 BVH_Array3d myVertexArray;
0114
0115
0116
0117 NCollection_Vector<Standard_Integer> myShapeIdxOfVtxVec;
0118
0119
0120 NCollection_Vector<Standard_Integer> myNumVtxInShapeVec;
0121
0122
0123 NCollection_Vector<Standard_Integer> myNumTrgInShapeVec;
0124
0125
0126 TColStd_DataMapOfIntegerInteger myTrgIdxMap;
0127
0128 public:
0129
0130 DEFINE_STANDARD_RTTIEXT(BRepExtrema_TriangleSet, BVH_PrimitiveSet3d)
0131
0132 };
0133
0134 DEFINE_STANDARD_HANDLE(BRepExtrema_TriangleSet, BVH_PrimitiveSet3d)
0135
0136 #endif