From: vsr Date: Tue, 18 Aug 2015 11:17:04 +0000 (+0300) Subject: Improve locale selection actvation in case if sub-shape of any type can be selected... X-Git-Tag: V7_7_0a1~13 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=389efae83b99d654509671e60af3eecf11b8278e;p=modules%2Fgui.git Improve locale selection actvation in case if sub-shape of any type can be selected: for this TopAbs_SHAPE type can be just passed. --- diff --git a/src/SOCC/SOCC_ViewModel.cxx b/src/SOCC/SOCC_ViewModel.cxx index 946f574ca..bebe7068c 100755 --- a/src/SOCC/SOCC_ViewModel.cxx +++ b/src/SOCC/SOCC_ViewModel.cxx @@ -61,6 +61,8 @@ #include #include +#include + // in order NOT TO link with SalomeApp, here the code returns SALOMEDS_Study. // SalomeApp_Study::studyDS() does it as well, but -- here it is retrieved from // SALOMEDS::StudyManager - no linkage with SalomeApp. @@ -572,6 +574,11 @@ void SOCC_Viewer::LocalSelection( const SALOME_OCCPrs* thePrs, const std::listGetObjects( anObjs ); + std::list sel_modes; + for ( int i = TopAbs_COMPOUND; i < TopAbs_SHAPE; i++ ) + if ( std::find(modes.begin(), modes.end(), (int)TopAbs_SHAPE) != modes.end() || std::find(modes.begin(), modes.end(), i) != modes.end()) + sel_modes.push_back(i); + // Activate selection of objects from prs AIS_ListIteratorOfListOfInteractive aIter( anObjs ); for ( ; aIter.More(); aIter.Next() ) { @@ -582,13 +589,13 @@ void SOCC_Viewer::LocalSelection( const SALOME_OCCPrs* thePrs, const std::listIsKind( STANDARD_TYPE( AIS_Shape ) ) ) { ic->Load( anAIS, -1, false ); - for( it = modes.begin(); it != modes.end(); ++it ) + for( it = sel_modes.begin(); it != sel_modes.end(); ++it ) ic->Activate( anAIS, AIS_Shape::SelectionMode( (TopAbs_ShapeEnum)*it ) ); } else if ( anAIS->DynamicType() != STANDARD_TYPE(AIS_Trihedron) ) { ic->Load( anAIS, -1, false ); - for( it = modes.begin(); it != modes.end(); ++it ) + for( it = sel_modes.begin(); it != sel_modes.end(); ++it ) ic->Activate( anAIS, *it ); } }