Fix remarks related to the "0021757: EDF 1829 : Activate bring to front action on simple selection of an object" issue.

This commit is contained in:
rnv 2013-11-15 10:17:50 +00:00
parent 2a044ae940
commit e0f9a7efdc
4 changed files with 20 additions and 11 deletions

View File

@ -30,6 +30,7 @@
#include <OCCViewer_ViewModel.h> #include <OCCViewer_ViewModel.h>
#include <SUIT_Session.h> #include <SUIT_Session.h>
#include <SUIT_ResourceMgr.h>
#include <SalomeApp_Study.h> #include <SalomeApp_Study.h>
#include <SALOME_InteractiveObject.hxx> #include <SALOME_InteractiveObject.hxx>
@ -197,6 +198,9 @@ void GEOMGUI_OCCSelector::setSelection( const SUIT_DataOwnerPtrList& aList )
if ( !vw ) if ( !vw )
return; return;
SUIT_ResourceMgr* aResourceMgr = SUIT_Session::session()->resourceMgr();
bool anAutoBringToFront = aResourceMgr->booleanValue( "Geometry", "auto_bring_to_front", false );
Handle(AIS_InteractiveContext) ic = vw->getAISContext(); Handle(AIS_InteractiveContext) ic = vw->getAISContext();
// "entry - list_of_int" map for LOCAL selection // "entry - list_of_int" map for LOCAL selection
@ -335,11 +339,16 @@ void GEOMGUI_OCCSelector::setSelection( const SUIT_DataOwnerPtrList& aList )
else else
ic->AddOrRemoveSelected( Handle(AIS_InteractiveObject)::DownCast(owner->Selectable()), false ); ic->AddOrRemoveSelected( Handle(AIS_InteractiveObject)::DownCast(owner->Selectable()), false );
} }
ic->SetAutomaticHilight(isAutoHilight); //Bug 17269: restore mode ic->SetAutomaticHilight(isAutoHilight); //Bug 17269: restore mode
if (n < 3000)
ic->HilightSelected(/*updateviewer*/Standard_True); //rnv: In case Automatic Bring To Front viewer will be updated later
else if(!anAutoBringToFront) {
vw->update(); if (n < 3000)
ic->HilightSelected(Standard_True);
else
vw->update();
}
// fill extra selected // fill extra selected
mySelectedExternals.clear(); mySelectedExternals.clear();

View File

@ -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 ) void GEOM_Displayer::AfterErase( SALOME_View* v, const SALOME_OCCPrs* p )
{ {
LightApp_Displayer::AfterErase( v, 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<SalomeApp_Study*>( myApp->activeStudy() ); SalomeApp_Study* aStudy = dynamic_cast<SalomeApp_Study*>( myApp->activeStudy() );
if( !aStudy ) if( !aStudy )
@ -2552,6 +2552,6 @@ void GEOM_Displayer::UpdateColorScale( const bool theIsRedisplayFieldSteps )
} }
} }
} }
if(updateViewer)
UpdateViewer(); UpdateViewer();
} }

View File

@ -193,7 +193,7 @@ public:
SALOME_View* = 0); SALOME_View* = 0);
/* Update visibility and parameters of the currently selected field step's color scale */ /* 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: protected:
/* internal methods */ /* internal methods */

View File

@ -2546,7 +2546,7 @@ void GeometryGUI::preferencesChanged( const QString& section, const QString& par
{ {
GEOM_Displayer aDisplayer( aStudy ); GEOM_Displayer aDisplayer( aStudy );
bool anIsRedisplayFieldSteps = param == QString("scalar_bar_nb_intervals"); bool anIsRedisplayFieldSteps = param == QString("scalar_bar_nb_intervals");
aDisplayer.UpdateColorScale( anIsRedisplayFieldSteps ); aDisplayer.UpdateColorScale( anIsRedisplayFieldSteps, true );
} }
} }
} }