use MapShapeAncestor

Hi,

I've a map of edge and i want to find faces liable by each edge.. i'm wondering if i may use MapShapeAncestor and how to use it..
Thank you..

Rob Bachrach's picture

Create the map with:

TopTools_IndexedDataMapOfShapeListOfShape myEdgeFaceMap;
TopExp::MapShapesAndAncestors(myShape, TopAbs_EDGE, TopAbs_FACE, myEdgeFaceMap);

Reference it with:
const TopTools_ListOfShape &myFaces = mapEdgeFace.FindFromKey(myEdge);
TopTools_ListIteratorOfListOfShape itFace;
for (itFace.Initialize(myFaces); itFace.More(); itFace.Next()) {
// process the face
}