]> SALOME platform Git repositories - modules/gui.git/commitdiff
Salome HOME
rollback the previous integration
authordmv <dmv@opencascade.com>
Fri, 10 Apr 2009 12:26:05 +0000 (12:26 +0000)
committerdmv <dmv@opencascade.com>
Fri, 10 Apr 2009 12:26:05 +0000 (12:26 +0000)
src/VTKViewer/VTKViewer_Algorithm.h

index 7a31b7f577b96516750a25331a4f1d5efc48956c..fefcb3a8a3cdf7293ee3467453277b2412647e0e 100644 (file)
@@ -29,7 +29,6 @@
 #define VTKViewer_Algorithm_H
 
 #include <vtkActorCollection.h>
-#include <vtkCollectionIterator.h>
 
 class vtkActor;
 
@@ -42,12 +41,10 @@ namespace VTK
       TFunction ForEach(vtkActorCollection *theCollection, TFunction theFun)
       {
        if(theCollection){
-         vtkCollectionIterator* anIterator = theCollection->NewIterator();
-         while (anIterator->IsDoneWithTraversal()) {
-           if(TActor *anActor = dynamic_cast<TActor*>(anIterator->GetObject()))
+         theCollection->InitTraversal();
+         while(vtkActor *anAct = theCollection->GetNextActor())
+           if(TActor *anActor = dynamic_cast<TActor*>(anAct))
              theFun(anActor);
-           anIterator->GoToNextItem();
-         }
        }
        return theFun;
       }
@@ -62,14 +59,11 @@ namespace VTK
                          TFunction theFun)
       {
        if(theCollection){
-         vtkCollectionIterator* anIterator = theCollection->NewIterator();
-         while (anIterator->IsDoneWithTraversal()) {
-           if(TActor *anActor = dynamic_cast<TActor*>(anIterator->GetObject())) {
+         theCollection->InitTraversal();
+         while(vtkActor *anAct = theCollection->GetNextActor())
+           if(TActor *anActor = dynamic_cast<TActor*>(anAct))
              if(thePredicate(anActor))
                theFun(anActor);
-           }
-           anIterator->GoToNextItem();
-         }
        }
        return theFun;
       }
@@ -82,14 +76,11 @@ namespace VTK
       TActor* Find(vtkActorCollection *theCollection, TPredicate thePredicate)
       {
        if(theCollection){
-         vtkCollectionIterator* anIterator = theCollection->NewIterator();
-         while (anIterator->IsDoneWithTraversal()) {
-           if(TActor* anActor = dynamic_cast<TActor*>(anIterator->GetObject())) {
+         theCollection->InitTraversal();
+         while(vtkActor *anAct = theCollection->GetNextActor())
+           if(TActor *anActor = dynamic_cast<TActor*>(anAct))
              if(thePredicate(anActor))
                return anActor;
-           }
-           anIterator->GoToNextItem();
-         }
        }
        return NULL;
       }