converting edges to wires

Hi,

I got edge information of a TopoDS Shape,but I'm unable to group them into wires.ie I get all edges but cannot differenciate which wire it belongs to?
this is the code I used:

Standard_Boolean isd = true;
TopTools_MapOfShape moe;
TopExp_Explorer ex(R,TopAbs_EDGE);
BRepBuilderAPI_MakeWire Wire;
while (ex.More())
{
moe.Add(ex.Current());
TopoDS_Shape res1 = ex.Current();
Handle(AIS_Shape) ais1=new AIS_Shape(res1);
myAISContext->SetColor(ais1,Quantity_NOC_YELLOW,Standard_False);
// myAISContext->Display(ais1,Standard_False);
cout ex.Next();

arkoala's picture

Try with:

TopoDS_Wire theWire;
BRepBuilderAPI_MakeWire mkWire;
while(ex.More())
{
mkWire.Add(ex.Current());
}
if (mkWire.IsDone())
{
theWire = mkWire;
Handle(AIS_Shape) ais1=new AIS_Shape(theWire);
myAISContext->SetColor(ais1,Quantity_NOC_YELLOW,Standard_False);
myAISContext->Display(ais1,Standard_False);
}

I don't know what is TopTools_MapOfShape, but it seems to be a mistame with moe and Wire.
I usually make wires in the previous way.
Ready to display the wire, and not each edge.

Divya's picture

Thanks Arkoala!

but i cant display it this way.I tried it earlier.Can you help me with some other method!