Salome HOME
23076: [CEA 1499] Get in python all sub-shapes in error after Compute
[modules/smesh.git] / src / OBJECT / SMESH_PreviewActorsCollection.cxx
index aee863d1f3f9d9eca7f4dcb70d227fad4893ea24..06c67439c32213fcd0f24ef3b5c4e75f93ab5d22 100644 (file)
@@ -128,6 +128,17 @@ TopoDS_Shape SMESH_PreviewActorsCollection::GetShapeByIndex( int index )
   return IsValidIndex( index ) ? myMapOfShapes.FindKey( index ) : TopoDS_Shape();
 }
 
+int SMESH_PreviewActorsCollection::NbShapesOfType( TopAbs_ShapeEnum type )
+{
+  if ( type == TopAbs_SHAPE ) return myMapOfShapes.Extent();
+
+  int nb = 0;
+  for ( int i = 1; i <= myMapOfShapes.Extent(); ++i )
+    nb += ( myMapOfShapes(i).ShapeType() == type );
+
+  return nb;
+}
+
 void SMESH_PreviewActorsCollection::SetIndices( const QList<int>& indices)
 {
   if ( myIndices != indices )