File indexing completed on 2026-09-24 09:15:14
0001
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013
0014
0015
0016 #ifndef _BRepExtrema_SelfIntersection_HeaderFile
0017 #define _BRepExtrema_SelfIntersection_HeaderFile
0018
0019 #include <BRepExtrema_OverlapTool.hxx>
0020
0021 #include <TopoDS.hxx>
0022
0023
0024
0025
0026
0027
0028
0029
0030
0031
0032
0033
0034 class BRepExtrema_SelfIntersection : public BRepExtrema_ElementFilter
0035 {
0036 friend class BRepExtrema_OverlapTool;
0037
0038 public:
0039
0040 Standard_EXPORT BRepExtrema_SelfIntersection(const double theTolerance = 0.0);
0041
0042
0043 Standard_EXPORT BRepExtrema_SelfIntersection(const TopoDS_Shape& theShape,
0044 const double theTolerance = 0.0);
0045
0046 public:
0047
0048 double Tolerance() const { return myTolerance; }
0049
0050
0051 void SetTolerance(const double theTolerance) { myTolerance = theTolerance; }
0052
0053
0054 Standard_EXPORT bool LoadShape(const TopoDS_Shape& theShape);
0055
0056
0057 Standard_EXPORT void Perform();
0058
0059
0060 bool IsDone() const { return myOverlapTool.IsDone(); }
0061
0062
0063 const NCollection_DataMap<int, TColStd_PackedMapOfInteger>& OverlapElements() const
0064 {
0065 return myOverlapTool.OverlapSubShapes1();
0066 }
0067
0068
0069 const TopoDS_Face& GetSubShape(const int theID) const
0070 {
0071 return TopoDS::Face(myFaceList.Value(theID));
0072 }
0073
0074
0075 const occ::handle<BRepExtrema_TriangleSet>& ElementSet() const { return myElementSet; }
0076
0077 #ifdef OVERLAP_TOOL_OUTPUT_TRIANGLES
0078
0079 const TColStd_PackedMapOfInteger& OverlapTriangles() const
0080 {
0081 return myOverlapTool.OverlapTriangles1();
0082 }
0083 #endif
0084
0085 protected:
0086
0087 Standard_EXPORT BRepExtrema_ElementFilter::FilterResult PreCheckElements(
0088 const int theIndex1,
0089 const int theIndex2) override;
0090
0091
0092 Standard_EXPORT BRepExtrema_ElementFilter::FilterResult isRegularSharedVertex(
0093 const BVH_Vec3d& theSharedVert,
0094 const BVH_Vec3d& theTrng1Vtxs1,
0095 const BVH_Vec3d& theTrng1Vtxs2,
0096 const BVH_Vec3d& theTrng2Vtxs1,
0097 const BVH_Vec3d& theTrng2Vtxs2);
0098
0099
0100 Standard_EXPORT BRepExtrema_ElementFilter::FilterResult isRegularSharedEdge(
0101 const BVH_Vec3d& theTrng1Vtxs0,
0102 const BVH_Vec3d& theTrng1Vtxs1,
0103 const BVH_Vec3d& theTrng1Vtxs2,
0104 const BVH_Vec3d& theTrng2Vtxs2);
0105
0106 private:
0107
0108 double myTolerance;
0109
0110
0111 bool myIsInit;
0112
0113
0114 NCollection_DynamicArray<TopoDS_Shape> myFaceList;
0115
0116
0117 occ::handle<BRepExtrema_TriangleSet> myElementSet;
0118
0119
0120 BRepExtrema_OverlapTool myOverlapTool;
0121 };
0122
0123 #endif