File indexing completed on 2025-01-18 10:03:13
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 <TopTools_DataMapOfShapeShape.hxx>
0027 #include <TopTools_IndexedMapOfShape.hxx>
0028 #include <BRepLib_MakeShape.hxx>
0029 #include <TopTools_ListOfShape.hxx>
0030 #include <Bnd_Box.hxx>
0031 #include <NCollection_UBTree.hxx>
0032
0033 class TopoDS_Wire;
0034
0035
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 class BRepLib_MakeWire : public BRepLib_MakeShape
0079 {
0080 public:
0081
0082 DEFINE_STANDARD_ALLOC
0083
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, const TopoDS_Edge& E2, const TopoDS_Edge& E3);
0096
0097
0098 Standard_EXPORT BRepLib_MakeWire(const TopoDS_Edge& E1, const TopoDS_Edge& E2, const TopoDS_Edge& E3, const TopoDS_Edge& E4);
0099
0100
0101 Standard_EXPORT BRepLib_MakeWire(const TopoDS_Wire& W);
0102
0103
0104 Standard_EXPORT BRepLib_MakeWire(const TopoDS_Wire& W, const TopoDS_Edge& E);
0105
0106
0107 Standard_EXPORT void Add (const TopoDS_Edge& E);
0108
0109
0110 Standard_EXPORT void Add (const TopoDS_Wire& W);
0111
0112
0113
0114
0115 Standard_EXPORT void Add (const TopTools_ListOfShape& L);
0116
0117 Standard_EXPORT BRepLib_WireError Error() const;
0118
0119
0120 Standard_EXPORT const TopoDS_Wire& Wire();
0121 Standard_EXPORT operator TopoDS_Wire();
0122
0123
0124 Standard_EXPORT const TopoDS_Edge& Edge() const;
0125
0126
0127 Standard_EXPORT const TopoDS_Vertex& Vertex() const;
0128
0129 private:
0130 class BRepLib_BndBoxVertexSelector : public NCollection_UBTree <Standard_Integer,Bnd_Box>::Selector
0131 {
0132 public:
0133 BRepLib_BndBoxVertexSelector(const TopTools_IndexedMapOfShape& theMapOfShape)
0134 : BRepLib_BndBoxVertexSelector::Selector(),
0135 myMapOfShape (theMapOfShape),
0136 myTolP(0.0),
0137 myVInd(0)
0138 {
0139 }
0140
0141 Standard_Boolean Reject (const Bnd_Box& theBox) const
0142 {
0143 return theBox.IsOut(myVBox);
0144 }
0145
0146 Standard_Boolean Accept (const Standard_Integer& theObj);
0147
0148 void SetCurrentVertex (const gp_Pnt& theP, Standard_Real theTol,
0149 Standard_Integer theVInd);
0150
0151 const NCollection_List<Standard_Integer>& GetResultInds () const
0152 {
0153 return myResultInd;
0154 }
0155
0156 void ClearResInds()
0157 {
0158 myResultInd.Clear();
0159 }
0160
0161 private:
0162
0163 BRepLib_BndBoxVertexSelector(const BRepLib_BndBoxVertexSelector& );
0164 BRepLib_BndBoxVertexSelector& operator=(const BRepLib_BndBoxVertexSelector& );
0165
0166 const TopTools_IndexedMapOfShape& myMapOfShape;
0167 gp_Pnt myP;
0168 Standard_Real myTolP;
0169 Standard_Integer myVInd;
0170 Bnd_Box myVBox;
0171 NCollection_List<Standard_Integer> myResultInd;
0172 };
0173
0174 void CollectCoincidentVertices(const TopTools_ListOfShape& theL,
0175 NCollection_List<NCollection_List<TopoDS_Vertex>>& theGrVL);
0176
0177 void CreateNewVertices(const NCollection_List<NCollection_List<TopoDS_Vertex>>& theGrVL,
0178 TopTools_DataMapOfShapeShape& theO2NV);
0179
0180 void CreateNewListOfEdges(const TopTools_ListOfShape& theL,
0181 const TopTools_DataMapOfShapeShape& theO2NV,
0182 TopTools_ListOfShape& theNewEList);
0183
0184 void Add(const TopoDS_Edge& E, Standard_Boolean IsCheckGeometryProximity);
0185
0186
0187
0188 protected:
0189
0190
0191
0192 private:
0193
0194 BRepLib_WireError myError;
0195 TopoDS_Edge myEdge;
0196 TopoDS_Vertex myVertex;
0197 TopTools_IndexedMapOfShape myVertices;
0198 TopoDS_Vertex FirstVertex;
0199 TopoDS_Vertex VF;
0200 TopoDS_Vertex VL;
0201
0202 };
0203
0204
0205
0206
0207
0208
0209
0210 #endif