X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;f=src%2FOBJECT%2FSMESH_PreviewActorsCollection.cxx;h=4269c50ad00b78156d4438d494cf6a1d2b8cb7bf;hb=05a257d4f4e64a05ba8bb953efd5a2f1846e3fe1;hp=aee863d1f3f9d9eca7f4dcb70d227fad4893ea24;hpb=bbca2cb797c37bb7695d3f35490bcd328fbddd4e;p=modules%2Fsmesh.git diff --git a/src/OBJECT/SMESH_PreviewActorsCollection.cxx b/src/OBJECT/SMESH_PreviewActorsCollection.cxx index aee863d1f..4269c50ad 100644 --- a/src/OBJECT/SMESH_PreviewActorsCollection.cxx +++ b/src/OBJECT/SMESH_PreviewActorsCollection.cxx @@ -1,4 +1,4 @@ -// Copyright (C) 2007-2015 CEA/DEN, EDF R&D, OPEN CASCADE +// Copyright (C) 2007-2016 CEA/DEN, EDF R&D, OPEN CASCADE // // This library is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public @@ -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& indices) { if ( myIndices != indices )