From: akl Date: Fri, 6 Mar 2009 13:46:59 +0000 (+0000) Subject: Fix of 'c' problem described in 0019932 issue (see comment 0004258). X-Git-Tag: V5_1_1rc2~4 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=de2577ecb2296937e07e735bb9f2d51809730bb4;p=modules%2Fgui.git 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. --- 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; } /*!