#include <BRepLib_WireError.hxx>
#include <TopoDS_Edge.hxx>
#include <TopoDS_Vertex.hxx>
+#include <TopTools_DataMapOfShapeShape.hxx>
#include <TopTools_IndexedMapOfShape.hxx>
#include <BRepLib_MakeShape.hxx>
#include <TopTools_ListOfShape.hxx>
-#include <NCollection_Map.hxx>
#include <Bnd_Box.hxx>
#include <NCollection_UBTree.hxx>
};
void CollectCoincidentVertices(const TopTools_ListOfShape& theL,
- NCollection_List<NCollection_List<TopoDS_Vertex>>& theGrVL);
+ NCollection_List<NCollection_List<TopoDS_Vertex>>& theGrVL);
void CreateNewVertices(const NCollection_List<NCollection_List<TopoDS_Vertex>>& theGrVL,
- NCollection_DataMap<TopoDS_Vertex, TopoDS_Vertex>& theO2NV);
+ TopTools_DataMapOfShapeShape& theO2NV);
void CreateNewListOfEdges(const TopTools_ListOfShape& theL,
- const NCollection_DataMap<TopoDS_Vertex, TopoDS_Vertex>& theO2NV,
- TopTools_ListOfShape& theNewEList);
+ const TopTools_DataMapOfShapeShape& theO2NV,
+ TopTools_ListOfShape& theNewEList);
void Add(const TopoDS_Edge& E, Standard_Boolean IsCheckGeometryProximity);
CollectCoincidentVertices(L, aGrVL);
- NCollection_DataMap<TopoDS_Vertex, TopoDS_Vertex> anO2NV;
+ TopTools_DataMapOfShapeShape anO2NV;
CreateNewVertices(aGrVL, anO2NV);
NCollection_List<NCollection_List<TopoDS_Vertex>>& theGrVL)
{
TopTools_IndexedMapOfShape anAllV;
- TopTools_ListIteratorOfListOfShape anItL;
TopTools_IndexedDataMapOfShapeListOfShape aMV2EL;
- TopExp::MapShapesAndAncestors(myShape, TopAbs_VERTEX, TopAbs_EDGE, aMV2EL);
- TopExp_Explorer exp;
- for (anItL.Initialize(theL); anItL.More(); anItL.Next())
- TopExp::MapShapesAndAncestors(anItL.Value(), TopAbs_VERTEX, TopAbs_EDGE, aMV2EL);
+ TopExp::MapShapes(myShape, TopAbs_VERTEX, anAllV);
- for (int i = 1; i <= aMV2EL.Extent(); i++)
- if (aMV2EL(i).Extent() == 1)
- anAllV.Add(aMV2EL.FindKey(i));
+ TopTools_ListIteratorOfListOfShape anItL(theL);
+ for (; anItL.More(); anItL.Next())
+ TopExp::MapShapes(anItL.Value(), TopAbs_VERTEX, anAllV);
//aV2CV : vertex <-> its coincident vertices
NCollection_DataMap<TopoDS_Vertex, NCollection_Map<TopoDS_Vertex>> aV2CV;
//function : CreateNewVertices
//purpose :
//=======================================================================
-void BRepLib_MakeWire::CreateNewVertices(const NCollection_List<NCollection_List<TopoDS_Vertex>>& theGrVL,
- NCollection_DataMap<TopoDS_Vertex, TopoDS_Vertex>& theO2NV)
+void BRepLib_MakeWire::CreateNewVertices(const NCollection_List<NCollection_List<TopoDS_Vertex>>& theGrVL,
+ TopTools_DataMapOfShapeShape& theO2NV)
{
//map [old vertex => new vertex]
//note that already existing shape (i.e. the original ones)
//purpose :
//=======================================================================
void BRepLib_MakeWire::CreateNewListOfEdges(const TopTools_ListOfShape& theL,
- const NCollection_DataMap<TopoDS_Vertex, TopoDS_Vertex>& theO2NV,
+ const TopTools_DataMapOfShapeShape& theO2NV,
TopTools_ListOfShape& theNewEList)
{
///create the new list (theNewEList) from the input list L
--- /dev/null
+puts "REQUIRED All: Wire not done with an error"
+
+puts "========"
+puts "0030522: Modeling Algorithms - BRepBuilderAPI_MakeWire produces different wires depending on the order of parameters"
+puts "========"
+puts ""
+
+restore [locate_data_file bug30522_w_line12.brep] w1
+restore [locate_data_file bug30522_w_line21.brep] w2
+
+if {![regexp "Wire not done with an error" [wire r12 w1 w2]]} {
+ if {[lindex [nbshapes r12] 10] != 8} {
+ puts "Error: The wires have been unified incorrectly"
+ }
+}
+
+wire r21 w2 w1
+
+wire r12u -unsorted w1 w2
+
+wire r21u -unsorted w2 w1
+
+foreach r {r21 r12u r21u} {
+ checkshape $r
+ checknbshapes $r -edge 8 -vertex 8
+}
+
+smallview +Y+Z
+donly r21; fit
+checkview -screenshot -2d -path ${imagedir}/${test_image}.png