27 #ifndef VTKViewer_Algorithm_H 
   28 #define VTKViewer_Algorithm_H 
   32 #include <vtkActorCollection.h> 
   61     vtkActorCollection* GetActors() 
const;
 
   67     template<
typename TActor, 
typename TFunction>
 
   68       TFunction 
ForEach(vtkActorCollection *theCollection, TFunction theFun)
 
   71           theCollection->InitTraversal();
 
   72           while(vtkActor *anAct = theCollection->GetNextActor())
 
   73             if(TActor *anActor = dynamic_cast<TActor*>(anAct))
 
   83     template<
typename TActor, 
typename TPredicate, 
typename TFunction>
 
   84       TFunction 
ForEachIf(vtkActorCollection *theCollection, 
 
   85                           TPredicate thePredicate,
 
   89           theCollection->InitTraversal();
 
   90           while(vtkActor *anAct = theCollection->GetNextActor())
 
   91             if(TActor *anActor = dynamic_cast<TActor*>(anAct))
 
   92               if(thePredicate(anActor))
 
  102     template<
typename TActor, 
typename TPredicate>
 
  103       TActor* 
Find(vtkActorCollection *theCollection, TPredicate thePredicate)
 
  106           theCollection->InitTraversal();
 
  107           while(vtkActor *anAct = theCollection->GetNextActor())
 
  108             if(TActor *anActor = dynamic_cast<TActor*>(anAct))
 
  109               if(thePredicate(anActor))