X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;f=src%2FOBJECT%2FSMESH_PreviewActorsCollection.cxx;h=677b72030902f6bbd32cf70d99c498766ea6af41;hb=dbbd8a2dbee2a8ad0a41f0d01d280c25ab6a7e9f;hp=aee863d1f3f9d9eca7f4dcb70d227fad4893ea24;hpb=bbca2cb797c37bb7695d3f35490bcd328fbddd4e;p=modules%2Fsmesh.git diff --git a/src/OBJECT/SMESH_PreviewActorsCollection.cxx b/src/OBJECT/SMESH_PreviewActorsCollection.cxx index aee863d1f..677b72030 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-2020 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 @@ -84,9 +84,9 @@ bool SMESH_PreviewActorsCollection::Init( const TopoDS_Shape& theShape, return false; // Handle( SALOME_InteractiveObject ) anIO = new SALOME_InteractiveObject(); - // anIO->setEntry( theEntry.toLatin1().constData() ); - - // get indexes of seleted elements + // anIO->setEntry( theEntry.toUtf8().constData() ); + + // get indexes of selected elements TopExp::MapShapes( theMainShape, myMapOfShapes ); TopExp_Explorer exp( theShape, theType ); QSet indices; @@ -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 ) @@ -237,7 +248,7 @@ void SMESH_PreviewActorsCollection::showCurrentChunk() QString entry = QString( "%1_%2" ).arg( myEntry ).arg( index ); // Create interactive object Handle( SALOME_InteractiveObject ) anIO = new SALOME_InteractiveObject(); - anIO->setEntry( entry.toLatin1().constData() ); + anIO->setEntry( entry.toUtf8().constData() ); // Init Actor anActor->SetVectorMode( myType==TopAbs_EDGE ); anActor->setIO( anIO );