From: apo Date: Fri, 19 Aug 2005 11:50:16 +0000 (+0000) Subject: To introduce highlight action X-Git-Tag: T_3_0_2a1~30 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=9131b211e3e42fdad87f4789bc12ddbeafa774bc;p=modules%2Fgui.git To introduce highlight action --- diff --git a/src/SVTK/SVTK_Functor.h b/src/SVTK/SVTK_Functor.h index 68d054c1e..74cddb3c3 100644 --- a/src/SVTK/SVTK_Functor.h +++ b/src/SVTK/SVTK_Functor.h @@ -11,38 +11,57 @@ namespace VTK { - template struct TIsSameEntry + template + struct TIsSameEntry { std::string myEntry; TIsSameEntry(const char* theEntry): myEntry(theEntry) {} bool operator()(TActor* theActor) { - if ( theActor->hasIO() ) + if ( theActor->hasIO() ) { - Handle(SALOME_InteractiveObject) anIO = theActor->getIO(); - if ( anIO->hasEntry() ) - return myEntry == anIO->getEntry(); - } - return false; + Handle(SALOME_InteractiveObject) anIO = theActor->getIO(); + if ( anIO->hasEntry() ) + return myEntry == anIO->getEntry(); + } + return false; } }; - template struct TIsSameIObject + + //---------------------------------------------------------------- + template + struct TIsSameIObject { Handle(SALOME_InteractiveObject) myIObject; TIsSameIObject(const Handle(SALOME_InteractiveObject)& theIObject): - myIObject(theIObject) + myIObject(theIObject) {} bool operator()(TActor* theActor) { - if(theActor->hasIO()) + if(theActor->hasIO()) { - Handle(SALOME_InteractiveObject) anIO = theActor->getIO(); - return myIObject->isSame(anIO); - } - return false; + Handle(SALOME_InteractiveObject) anIO = theActor->getIO(); + return myIObject->isSame(anIO); + } + return false; + } + }; + + + //---------------------------------------------------------------- + template + struct THighlight + { + bool myIsHighlight; + THighlight(bool theIsHighlight): myIsHighlight( theIsHighlight ) {} + void operator()(TActor* theActor) + { + if(theActor->GetVisibility() && theActor->GetMapper()) + theActor->highlight( myIsHighlight ); } }; + }