From e0f9a7efdc51f558c8edbc0f1b4c63f2928e9076 Mon Sep 17 00:00:00 2001 From: rnv Date: Fri, 15 Nov 2013 10:17:50 +0000 Subject: [PATCH] Fix remarks related to the "0021757: EDF 1829 : Activate bring to front action on simple selection of an object" issue. --- src/GEOMGUI/GEOMGUI_OCCSelector.cxx | 17 +++++++++++++---- src/GEOMGUI/GEOM_Displayer.cxx | 10 +++++----- src/GEOMGUI/GEOM_Displayer.h | 2 +- src/GEOMGUI/GeometryGUI.cxx | 2 +- 4 files changed, 20 insertions(+), 11 deletions(-) diff --git a/src/GEOMGUI/GEOMGUI_OCCSelector.cxx b/src/GEOMGUI/GEOMGUI_OCCSelector.cxx index 9b3923096..25ef6cbc9 100644 --- a/src/GEOMGUI/GEOMGUI_OCCSelector.cxx +++ b/src/GEOMGUI/GEOMGUI_OCCSelector.cxx @@ -30,6 +30,7 @@ #include #include +#include #include #include @@ -197,6 +198,9 @@ void GEOMGUI_OCCSelector::setSelection( const SUIT_DataOwnerPtrList& aList ) if ( !vw ) return; + SUIT_ResourceMgr* aResourceMgr = SUIT_Session::session()->resourceMgr(); + bool anAutoBringToFront = aResourceMgr->booleanValue( "Geometry", "auto_bring_to_front", false ); + Handle(AIS_InteractiveContext) ic = vw->getAISContext(); // "entry - list_of_int" map for LOCAL selection @@ -335,11 +339,16 @@ void GEOMGUI_OCCSelector::setSelection( const SUIT_DataOwnerPtrList& aList ) else ic->AddOrRemoveSelected( Handle(AIS_InteractiveObject)::DownCast(owner->Selectable()), false ); } + ic->SetAutomaticHilight(isAutoHilight); //Bug 17269: restore mode - if (n < 3000) - ic->HilightSelected(/*updateviewer*/Standard_True); - else - vw->update(); + + //rnv: In case Automatic Bring To Front viewer will be updated later + if(!anAutoBringToFront) { + if (n < 3000) + ic->HilightSelected(Standard_True); + else + vw->update(); + } // fill extra selected mySelectedExternals.clear(); diff --git a/src/GEOMGUI/GEOM_Displayer.cxx b/src/GEOMGUI/GEOM_Displayer.cxx index a3e7de10c..074654890 100644 --- a/src/GEOMGUI/GEOM_Displayer.cxx +++ b/src/GEOMGUI/GEOM_Displayer.cxx @@ -1590,13 +1590,13 @@ void GEOM_Displayer::AfterDisplay( SALOME_View* v, const SALOME_OCCPrs* p ) } } } - UpdateColorScale(); + UpdateColorScale(false,false); } void GEOM_Displayer::AfterErase( SALOME_View* v, const SALOME_OCCPrs* p ) { LightApp_Displayer::AfterErase( v, p ); - UpdateColorScale(); + UpdateColorScale(false,false); } //================================================================= @@ -2415,7 +2415,7 @@ Standard_Boolean GEOM_Displayer::FindColor( const Standard_Real aValue, } } -void GEOM_Displayer::UpdateColorScale( const bool theIsRedisplayFieldSteps ) +void GEOM_Displayer::UpdateColorScale( const bool theIsRedisplayFieldSteps, const bool updateViewer ) { SalomeApp_Study* aStudy = dynamic_cast( myApp->activeStudy() ); if( !aStudy ) @@ -2552,6 +2552,6 @@ void GEOM_Displayer::UpdateColorScale( const bool theIsRedisplayFieldSteps ) } } } - - UpdateViewer(); + if(updateViewer) + UpdateViewer(); } diff --git a/src/GEOMGUI/GEOM_Displayer.h b/src/GEOMGUI/GEOM_Displayer.h index e5ee15cec..6d3f03216 100644 --- a/src/GEOMGUI/GEOM_Displayer.h +++ b/src/GEOMGUI/GEOM_Displayer.h @@ -193,7 +193,7 @@ public: SALOME_View* = 0); /* Update visibility and parameters of the currently selected field step's color scale */ - void UpdateColorScale( const bool theIsRedisplayFieldSteps = false ); + void UpdateColorScale( const bool theIsRedisplayFieldSteps = false, const bool updateViewer = true ); protected: /* internal methods */ diff --git a/src/GEOMGUI/GeometryGUI.cxx b/src/GEOMGUI/GeometryGUI.cxx index 0a480ed0a..6ba66d776 100644 --- a/src/GEOMGUI/GeometryGUI.cxx +++ b/src/GEOMGUI/GeometryGUI.cxx @@ -2546,7 +2546,7 @@ void GeometryGUI::preferencesChanged( const QString& section, const QString& par { GEOM_Displayer aDisplayer( aStudy ); bool anIsRedisplayFieldSteps = param == QString("scalar_bar_nb_intervals"); - aDisplayer.UpdateColorScale( anIsRedisplayFieldSteps ); + aDisplayer.UpdateColorScale( anIsRedisplayFieldSteps, true ); } } }