From 389efae83b99d654509671e60af3eecf11b8278e Mon Sep 17 00:00:00 2001 From: vsr Date: Tue, 18 Aug 2015 14:17:04 +0300 Subject: [PATCH] Improve locale selection actvation in case if sub-shape of any type can be selected: for this TopAbs_SHAPE type can be just passed. --- src/SOCC/SOCC_ViewModel.cxx | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) 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 ); } } -- 2.39.2