From: dmv Date: Fri, 10 Apr 2009 12:25:37 +0000 (+0000) Subject: rollback the previous integration X-Git-Tag: V5_1_2rc1~33 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=ad1ec76b02b5793c5d62b258c5ffaefba46da271;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; }