}
// map of vertices to know if the wire is open
- TopTools_MapOfShape vmap;
+ //TopTools_MapOfShape vmap;
+ TopTools_IndexedMapOfShape vmap;
// map of infinite edges
TopTools_MapOfShape anInfEmap;
// add or remove in the vertex map
V1.Orientation(TopAbs_FORWARD);
if (!vmap.Add(V1))
- vmap.Remove(V1);
+ //vmap.Remove(V1);
+ vmap.RemoveKey(V1);
}
if (!V2.IsNull())
{
V2.Orientation(TopAbs_REVERSED);
if (!vmap.Add(V2))
- vmap.Remove(V2);
+ //vmap.Remove(V2);
+ vmap.RemoveKey(V2);
}
if (V1.IsNull() || V2.IsNull())
}
// if vmap is not empty the wire is open, let us find the first vertex
+ V1.Nullify();
+ V2.Nullify();
if (!vmap.IsEmpty()) {
- TopTools_MapIteratorOfMapOfShape itt(vmap);
- while (itt.Key().Orientation() != TopAbs_FORWARD) {
- itt.Next();
- if (!itt.More()) break;
+ //TopTools_MapIteratorOfMapOfShape itt(vmap);
+ //while (itt.Key().Orientation() != TopAbs_FORWARD) {
+ // itt.Next();
+ // if (!itt.More()) break;
+ //}
+ //if (itt.More()) V1 = TopoDS::Vertex(itt.Key());
+ Standard_Integer ind = 0;
+ for (ind = 1; ind <= vmap.Extent(); ++ind)
+ {
+ if (vmap(ind).Orientation() == TopAbs_FORWARD)
+ {
+ V1 = TopoDS::Vertex(vmap(ind));
+ break;
+ }
}
- if (itt.More()) V1 = TopoDS::Vertex(itt.Key());
}
else {
// The wire is infinite Try to find the first vertex. It may be NULL.