Salome HOME
Fix of the problem with vtkRenderer::GetActors() method
[modules/smesh.git] / src / SMESHGUI / SMESHGUI_GroupDlg.cxx
index 01e0f81950bd932f33150d60a6ab3b5de70b7e45..80e98c0cfe2474c18f935542bdd590c637c2f03e 100644 (file)
@@ -61,6 +61,8 @@
 
 #include <SVTK_ViewWindow.h>
 
+#include <VTKViewer_Algorithm.h>
+
 // SALOME KERNEL includes
 #include <SALOMEDSClient_Study.hxx>
 
@@ -2206,7 +2208,8 @@ bool SMESHGUI_GroupDlg::SetAppropriateActor()
 
       // iterate on all actors in current view window, search for
       // any visible actor, that belongs to group or submesh of current mesh
-      vtkActorCollection *aCollection = aViewWindow->getRenderer()->GetActors();
+      VTK::ActorCollectionCopy aCopy(aViewWindow->getRenderer()->GetActors());
+      vtkActorCollection *aCollection = aCopy.GetActors();
       int nbItems = aCollection->GetNumberOfItems();
       for (int i=0; i<nbItems && !isActor; i++)
       {