From 0fe6549c3632e7a2f1fda14799c7d1fe787f3306 Mon Sep 17 00:00:00 2001 From: rnv Date: Tue, 10 May 2011 08:07:35 +0000 Subject: [PATCH] Additional fir for the issue "21254: EDF 1861 VISU: Eye symbol and VISU presentations". --- src/VISU_I/VISU_Tools.cxx | 2 +- src/VISU_I/VISU_Tools.h | 3 ++- src/VISU_I/VISU_ViewManager_i.cc | 15 ++++++++++++--- 3 files changed, 15 insertions(+), 5 deletions(-) diff --git a/src/VISU_I/VISU_Tools.cxx b/src/VISU_I/VISU_Tools.cxx index 06dfe710..dca6f107 100644 --- a/src/VISU_I/VISU_Tools.cxx +++ b/src/VISU_I/VISU_Tools.cxx @@ -334,7 +334,7 @@ namespace VISU } //------------------------------------------------------------ - void SetVisibilityState(VISU_ActorBase *theActor, Qtx::VisibilityState state) { + void SetVisibilityState(SALOME_Actor *theActor, Qtx::VisibilityState state) { if(!theActor || !theActor->hasIO() || !theActor->getIO()->hasEntry()) return; SetVisibilityState(theActor->getIO()->getEntry(), state); diff --git a/src/VISU_I/VISU_Tools.h b/src/VISU_I/VISU_Tools.h index b0740bd9..cb2f5d44 100644 --- a/src/VISU_I/VISU_Tools.h +++ b/src/VISU_I/VISU_Tools.h @@ -36,6 +36,7 @@ class Plot2d_ViewFrame; class SalomeApp_Study; class SalomeApp_Application; class VISU_ActorBase; +class SALOME_Actor; namespace VISU { @@ -73,7 +74,7 @@ namespace VISU _PTR(SObject) theTableSO ); VISU_I_EXPORT void SetVisibilityState(std::string entry, Qtx::VisibilityState state); - VISU_I_EXPORT void SetVisibilityState(VISU_ActorBase *theActor, Qtx::VisibilityState state); + VISU_I_EXPORT void SetVisibilityState(SALOME_Actor *theActor, Qtx::VisibilityState state); VISU_I_EXPORT void CurveVisibilityChanged(VISU::Curve_i* theCurve, int theDisplaying, diff --git a/src/VISU_I/VISU_ViewManager_i.cc b/src/VISU_I/VISU_ViewManager_i.cc index 932dea77..f898f877 100644 --- a/src/VISU_I/VISU_ViewManager_i.cc +++ b/src/VISU_I/VISU_ViewManager_i.cc @@ -297,8 +297,8 @@ namespace VISU { vtkActorCollection* anActColl = aCopy.GetActors(); vtkActor *anActor; VISU_Actor *anVISUActor = NULL, *aResActor = NULL; - for(anActColl->InitTraversal(); (anActor = anActColl->GetNextActor()) != NULL;){ - if(anActor->IsA("VISU_Actor")){ + for(anActColl->InitTraversal(); (anActor = anActColl->GetNextActor()) != NULL;) { + if( anActor->IsA("VISU_Actor") ) { anVISUActor = VISU_Actor::SafeDownCast(anActor); if (thePrs == anVISUActor->GetPrs3d()) { aResActor = anVISUActor; @@ -317,11 +317,20 @@ namespace VISU { } else if ( theDisplaing == eDisplayAll ) { anVISUActor->VisibilityOn(); - VISU::SetVisibilityState(anVISUActor, Qtx::HiddenState); + VISU::SetVisibilityState(anVISUActor, Qtx::ShownState); } } + } else if ( anActor->IsA("SALOME_Actor") && (theDisplaing == eEraseAll || theDisplaing == eDisplayOnly) ) { + // rnv : fix for the 21254: EDF 1861 VISU: Eye symbol and VISU presentations. + // Take into account presentations created in other modules. + SALOME_Actor* aSActor = SALOME_Actor::SafeDownCast(anActor); + if( aSActor ) { + aSActor->VisibilityOff(); + VISU::SetVisibilityState(aSActor, Qtx::HiddenState); + } } } + if (aResActor) { RepaintView(theViewWindow); return aResActor; -- 2.39.2