- SMESH_PreviewActorsCollection* previewActor = mySubSelectWdg->GetActorCollection();
- if ( !previewActor ) return;
- const QList<int>& egdeIDs = previewActor->GetIndices();
- for ( QList<int>::const_iterator ieIt = egdeIDs.begin(); ieIt != egdeIDs.end(); ++ieIt )
- {
- TopoDS_Shape E = previewActor->GetShapeByIndex( *ieIt );
- if ( !E.IsNull() && E.ShapeType() == TopAbs_EDGE )
- aBuilder.Add( aCompound, E );
- }
+ TopTools_MapOfShape edgesMap;
+ TopExp_Explorer edge( mainShape, TopAbs_EDGE );
+ for ( ; edge.More(); edge.Next() )
+ if ( edgesMap.Add( edge.Current() ))
+ aBuilder.Add( aCompound, edge.Current() );