From de2577ecb2296937e07e735bb9f2d51809730bb4 Mon Sep 17 00:00:00 2001 From: akl Date: Fri, 6 Mar 2009 13:46:59 +0000 Subject: [PATCH] Fix of 'c' problem described in 0019932 issue (see comment 0004258). Now 'isVisible' method checks all actors with the given IObject and returns 'true' if at least one of these actors is visible. --- src/SVTK/SVTK_View.cxx | 28 ++++++++++++++++++++++++---- 1 file changed, 24 insertions(+), 4 deletions(-) diff --git a/src/SVTK/SVTK_View.cxx b/src/SVTK/SVTK_View.cxx index 8174f0c4f..d55865565 100644 --- a/src/SVTK/SVTK_View.cxx +++ b/src/SVTK/SVTK_View.cxx @@ -279,6 +279,25 @@ SVTK_View return anActor != NULL; } +namespace SVTK +{ + struct TIsActorVisibleAction + { + bool& myResult; + TIsActorVisibleAction(bool& theResult): + myResult(theResult) + { + myResult = false; + } + void + operator()(SALOME_Actor* theActor) + { + if( !myResult ) + myResult = theActor->GetVisibility(); + } + }; +} + /*! \return true if object is displayed in viewer \param theIO - object to be checked @@ -288,10 +307,11 @@ SVTK_View ::isVisible(const Handle(SALOME_InteractiveObject)& theIObject) { using namespace SVTK; - SALOME_Actor* anActor = - Find(getRenderer()->GetActors(), - TIsSameIObject(theIObject)); - return anActor != NULL && anActor->GetVisibility(); + bool aResult; + ForEachIf(getRenderer()->GetActors(), + TIsSameIObject(theIObject), + TIsActorVisibleAction(aResult)); + return aResult; } /*! -- 2.39.2