]> SALOME platform Git repositories - modules/gui.git/commitdiff
Salome HOME
To introduce highlight action
authorapo <apo@opencascade.com>
Fri, 19 Aug 2005 11:50:16 +0000 (11:50 +0000)
committerapo <apo@opencascade.com>
Fri, 19 Aug 2005 11:50:16 +0000 (11:50 +0000)
src/SVTK/SVTK_Functor.h

index 68d054c1effea082c91e4d59b8b9853537a0076c..74cddb3c31941f1338cdaef21d56abed97fc03ad 100644 (file)
 
 namespace VTK
 {
-  template<class TActor> struct TIsSameEntry
+  template<class TActor> 
+  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<class TActor> struct TIsSameIObject
+
+  //----------------------------------------------------------------
+  template<class TActor> 
+  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<class TActor> 
+  struct THighlight
+  {
+    bool myIsHighlight;
+    THighlight(bool theIsHighlight): myIsHighlight( theIsHighlight ) {}
+    void operator()(TActor* theActor) 
+    {
+      if(theActor->GetVisibility() && theActor->GetMapper())
+       theActor->highlight( myIsHighlight );
     }
   };
+
 }