From: dmv Date: Fri, 10 Apr 2009 12:26:05 +0000 (+0000) Subject: rollback the previous integration X-Git-Tag: V4_1_5rc1~5 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=0b6618349a22aa93a50ae6de32db17cea53f41ac;p=modules%2Fgui.git rollback the previous integration --- 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; }