From ad1ec76b02b5793c5d62b258c5ffaefba46da271 Mon Sep 17 00:00:00 2001 From: dmv Date: Fri, 10 Apr 2009 12:25:37 +0000 Subject: [PATCH] rollback the previous integration --- src/VTKViewer/VTKViewer_Algorithm.h | 27 +++++++++------------------ 1 file changed, 9 insertions(+), 18 deletions(-) diff --git a/src/VTKViewer/VTKViewer_Algorithm.h b/src/VTKViewer/VTKViewer_Algorithm.h index 7a31b7f57..fefcb3a8a 100644 --- a/src/VTKViewer/VTKViewer_Algorithm.h +++ b/src/VTKViewer/VTKViewer_Algorithm.h @@ -29,7 +29,6 @@ #define VTKViewer_Algorithm_H #include -#include 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(anIterator->GetObject())) + theCollection->InitTraversal(); + while(vtkActor *anAct = theCollection->GetNextActor()) + if(TActor *anActor = dynamic_cast(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(anIterator->GetObject())) { + theCollection->InitTraversal(); + while(vtkActor *anAct = theCollection->GetNextActor()) + if(TActor *anActor = dynamic_cast(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(anIterator->GetObject())) { + theCollection->InitTraversal(); + while(vtkActor *anAct = theCollection->GetNextActor()) + if(TActor *anActor = dynamic_cast(anAct)) if(thePredicate(anActor)) return anActor; - } - anIterator->GoToNextItem(); - } } return NULL; } -- 2.39.2