int SMESH_MesherHelper::NbAncestors(const TopoDS_Shape& shape, const SMESH_Mesh& mesh, TopAbs_ShapeEnum ancestorType/*=TopAbs_SHAPE*/) { TopTools_MapOfShape ancestors; TopTools_ListIteratorOfListOfShape ansIt( mesh.GetAncestors(shape) ); for ( ; ansIt.More(); ansIt.Next() ) { if ( ancestorType == TopAbs_SHAPE || ansIt.Value().ShapeType() == ancestorType ) ancestors.Add( ansIt.Value() ); } return ancestors.Extent(); }