#include "SALOMEDSClient_SObject.hxx"
#include "SALOMEDS_SObject.hxx"
-#include <TopTools_MapOfShape.hxx>
#include <TopExp_Explorer.hxx>
+#include <TopTools_IndexedMapOfShape.hxx>
+#include <TopExp.hxx>
/*!
* Class : SMESH_NumberFilter
if (mySubShapeType == TopAbs_SHAPE);
return true;
- TopExp_Explorer anExp2 (aShape, mySubShapeType);
- TopTools_MapOfShape aMap;
- for (; anExp2.More(); anExp2.Next())
- aMap.Add(anExp2.Current());
+ TopTools_IndexedMapOfShape aMap;
+ TopExp::MapShapes(aShape, mySubShapeType, aMap);
- return myNumber == aMap.Extent();
+ if ( myNumber )
+ return myNumber == aMap.Extent(); // given number
+
+ return aMap.Extent(); // at least one?
}
//=======================================================================