]> SALOME platform Git repositories - modules/visu.git/commitdiff
Salome HOME
Fix of the problem with vtkRenderer::GetActors() method
authorouv <ouv@opencascade.com>
Wed, 22 Jul 2009 10:33:59 +0000 (10:33 +0000)
committerouv <ouv@opencascade.com>
Wed, 22 Jul 2009 10:33:59 +0000 (10:33 +0000)
src/VVTK/VVTK_PickingDlg.cxx
src/VVTK/VVTK_Renderer.cxx
src/VVTK/VVTK_SegmentationCursorDlg.cxx
src/VVTK/VVTK_ViewModel.cxx

index d9188157bea6b1ae8ef0a58cb22b98d7a04c9061..4f7a33cb5e62e5456852d99a1712f03d0c2dc319 100644 (file)
@@ -102,7 +102,8 @@ namespace
       if ( mySelector->HasIndex( myIO ) )
        mySelector->GetIndex(myIO, myMapIndex);
        
-      myActor = SVTK::Find<VISU_GaussPtsAct>(myInteractor->getRenderer()->GetActors(),
+      VTK::ActorCollectionCopy aCopy(myInteractor->getRenderer()->GetActors());
+      myActor = SVTK::Find<VISU_GaussPtsAct>(aCopy.GetActors(),
                                             SVTK::TIsSameIObject<VISU_GaussPtsAct>( myIO ));
       if ( !myActor )
        return aResult;
index b650717267053edadcb6e02ac56ce98e049e62e7..a9528508004ee61032a32de2c56b08bd8493866c 100644 (file)
@@ -33,6 +33,8 @@
 #include "VISU_PlanesWidget.hxx"
 #include "VISU_SphereWidget.hxx"
 
+#include <VTKViewer_Algorithm.h>
+
 #include <vtkObjectFactory.h>
 #include <vtkProperty.h>
 #include <vtkPointPicker.h>
@@ -108,7 +110,8 @@ VISU_FPSActor
     float aLastRenderTimeInSeconds = aRenderer->GetLastRenderTimeInSeconds();
     if(aLastRenderTimeInSeconds > aTol){
       size_t aNumberOfCells = 0;
-      if(vtkActorCollection *anActorCollection = aRenderer->GetActors()){
+      VTK::ActorCollectionCopy aCopy(aRenderer->GetActors());
+      if(vtkActorCollection *anActorCollection = aCopy.GetActors()){
        anActorCollection->InitTraversal();
        while(vtkActor *anActor = anActorCollection->GetNextActor()){
          if(anActor->GetVisibility()){
index 02172f1eaa46f6423c5d5deceb46877e46af1e5f..a752d1b74f9320699c2b0341f03c200bda303ee2 100644 (file)
@@ -43,6 +43,7 @@
 #include <SUIT_Session.h>
 
 #include <SVTK_RenderWindowInteractor.h>
+#include <VTKViewer_Algorithm.h>
 
 #include <vtkActorCollection.h>
 #include <vtkCallbackCommand.h>
@@ -831,7 +832,8 @@ bool VVTK_SegmentationCursorDlg::CheckNumberOfFaces()
   int aNumberOfPoints = 0;
 
   vtkActor* anActor;
-  vtkActorCollection* anActColl = aRenderer->GetActors();
+  VTK::ActorCollectionCopy aCopy(aRenderer->GetActors());
+  vtkActorCollection* anActColl = aCopy.GetActors();
   for( anActColl->InitTraversal(); ( anActor = anActColl->GetNextActor() ) != NULL; )
   {
     if( VISU_GaussPtsAct1* aGaussActor = VISU_GaussPtsAct1::SafeDownCast( anActor ) )
index 3a625a1995c63179466d0e14b7ca990c6b6435ca..c82865707320d3c0c314d65c7e0ffc3e2fe276d8 100644 (file)
@@ -113,7 +113,8 @@ bool VVTK_Viewer::isVisible( const Handle(SALOME_InteractiveObject)& theIO )
     if(SVTK_ViewWindow* aViewWindow = dynamic_cast<SVTK_ViewWindow*>(aViews.at(i))){
       bool aResult;
       VVTK::TIsOneActorVisibleAction anAction(aResult);
-      SVTK::ForEachIf<SALOME_Actor>(aViewWindow->getRenderer()->GetActors(),
+      VTK::ActorCollectionCopy aCopy(aViewWindow->getRenderer()->GetActors());
+      SVTK::ForEachIf<SALOME_Actor>(aCopy.GetActors(),
                                    SVTK::TIsSameIObject<SALOME_Actor>(theIO),
                                    anAction);
       return anAction.myResult;