File indexing completed on 2026-10-04 09:13:55
0001
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013
0014
0015
0016
0017 #ifndef _BRepLib_MakeWire_HeaderFile
0018 #define _BRepLib_MakeWire_HeaderFile
0019
0020 #include <Standard.hxx>
0021 #include <Standard_DefineAlloc.hxx>
0022
0023 #include <BRepLib_WireError.hxx>
0024 #include <TopoDS_Edge.hxx>
0025 #include <TopoDS_Vertex.hxx>
0026 #include <TopoDS_Shape.hxx>
0027 #include <TopTools_ShapeMapHasher.hxx>
0028 #include <NCollection_DataMap.hxx>
0029 #include <NCollection_IndexedMap.hxx>
0030 #include <BRepLib_MakeShape.hxx>
0031 #include <NCollection_List.hxx>
0032 #include <Bnd_Box.hxx>
0033 #include <NCollection_UBTree.hxx>
0034
0035 class TopoDS_Wire;
0036
0037
0038
0039
0040
0041
0042
0043
0044
0045
0046
0047
0048
0049
0050
0051
0052
0053
0054
0055
0056
0057
0058
0059
0060
0061
0062
0063
0064
0065
0066
0067
0068
0069
0070
0071
0072
0073
0074
0075
0076
0077
0078
0079
0080 class BRepLib_MakeWire : public BRepLib_MakeShape
0081 {
0082 public:
0083 DEFINE_STANDARD_ALLOC
0084
0085
0086 Standard_EXPORT BRepLib_MakeWire();
0087
0088
0089 Standard_EXPORT BRepLib_MakeWire(const TopoDS_Edge& E);
0090
0091
0092 Standard_EXPORT BRepLib_MakeWire(const TopoDS_Edge& E1, const TopoDS_Edge& E2);
0093
0094
0095 Standard_EXPORT BRepLib_MakeWire(const TopoDS_Edge& E1,
0096 const TopoDS_Edge& E2,
0097 const TopoDS_Edge& E3);
0098
0099
0100 Standard_EXPORT BRepLib_MakeWire(const TopoDS_Edge& E1,
0101 const TopoDS_Edge& E2,
0102 const TopoDS_Edge& E3,
0103 const TopoDS_Edge& E4);
0104
0105
0106 Standard_EXPORT BRepLib_MakeWire(const TopoDS_Wire& W);
0107
0108
0109 Standard_EXPORT BRepLib_MakeWire(const TopoDS_Wire& W, const TopoDS_Edge& E);
0110
0111
0112 Standard_EXPORT void Add(const TopoDS_Edge& E);
0113
0114
0115 Standard_EXPORT void Add(const TopoDS_Wire& W);
0116
0117
0118
0119
0120 Standard_EXPORT void Add(const NCollection_List<TopoDS_Shape>& L);
0121
0122 Standard_EXPORT BRepLib_WireError Error() const;
0123
0124
0125 Standard_EXPORT const TopoDS_Wire& Wire();
0126 Standard_EXPORT operator TopoDS_Wire();
0127
0128
0129 Standard_EXPORT const TopoDS_Edge& Edge() const;
0130
0131
0132 Standard_EXPORT const TopoDS_Vertex& Vertex() const;
0133
0134 private:
0135 class BRepLib_BndBoxVertexSelector : public NCollection_UBTree<int, Bnd_Box>::Selector
0136 {
0137 public:
0138 BRepLib_BndBoxVertexSelector(
0139 const NCollection_IndexedMap<TopoDS_Shape, TopTools_ShapeMapHasher>& theMapOfShape)
0140 : myMapOfShape(theMapOfShape),
0141 myTolP(0.0),
0142 myVInd(0)
0143 {
0144 }
0145
0146 bool Reject(const Bnd_Box& theBox) const override { return theBox.IsOut(myVBox); }
0147
0148 bool Accept(const int& theObj) override;
0149
0150 void SetCurrentVertex(const gp_Pnt& theP, double theTol, int theVInd);
0151
0152 const NCollection_List<int>& GetResultInds() const { return myResultInd; }
0153
0154 void ClearResInds() { myResultInd.Clear(); }
0155
0156 private:
0157 BRepLib_BndBoxVertexSelector(const BRepLib_BndBoxVertexSelector&) = delete;
0158 BRepLib_BndBoxVertexSelector& operator=(const BRepLib_BndBoxVertexSelector&) = delete;
0159
0160 const NCollection_IndexedMap<TopoDS_Shape, TopTools_ShapeMapHasher>& myMapOfShape;
0161 gp_Pnt myP;
0162 double myTolP;
0163 int myVInd;
0164 Bnd_Box myVBox;
0165 NCollection_List<int> myResultInd;
0166 };
0167
0168 void CollectCoincidentVertices(const NCollection_List<TopoDS_Shape>& theL,
0169 NCollection_List<NCollection_List<TopoDS_Vertex>>& theGrVL);
0170
0171 void CreateNewVertices(
0172 const NCollection_List<NCollection_List<TopoDS_Vertex>>& theGrVL,
0173 NCollection_DataMap<TopoDS_Shape, TopoDS_Shape, TopTools_ShapeMapHasher>& theO2NV);
0174
0175 void CreateNewListOfEdges(
0176 const NCollection_List<TopoDS_Shape>& theL,
0177 const NCollection_DataMap<TopoDS_Shape, TopoDS_Shape, TopTools_ShapeMapHasher>& theO2NV,
0178 NCollection_List<TopoDS_Shape>& theNewEList);
0179
0180 void Add(const TopoDS_Edge& E, bool IsCheckGeometryProximity);
0181
0182 private:
0183 BRepLib_WireError myError;
0184 TopoDS_Edge myEdge;
0185 TopoDS_Vertex myVertex;
0186 NCollection_IndexedMap<TopoDS_Shape, TopTools_ShapeMapHasher> myVertices;
0187 TopoDS_Vertex FirstVertex;
0188 TopoDS_Vertex VF;
0189 TopoDS_Vertex VL;
0190 };
0191
0192 #endif