]> SALOME platform Git repositories - modules/smesh.git/blobdiff - src/SMESHGUI/SMESHGUI.cxx
Salome HOME
Fix of the problem with vtkRenderer::GetActors() method
[modules/smesh.git] / src / SMESHGUI / SMESHGUI.cxx
index 4561074f79d0106d7ad7c8079ddb9e843614e76a..5b24c6762cb2c34e5368e7a4799e36eb2df077ec 100644 (file)
@@ -96,6 +96,8 @@
 #include <SVTK_ViewModel.h>
 #include <SVTK_ViewManager.h>
 
+#include <VTKViewer_Algorithm.h>
+
 #include <SUIT_MessageBox.h>
 #include <SUIT_ResourceMgr.h>
 #include <SUIT_FileDlg.h>
@@ -2077,6 +2079,7 @@ bool SMESHGUI::OnGUIEvent( int theCommandID )
 
   case 1100:                                   // EDIT HYPOTHESIS
     {
+      cout<<"EDIT HYPOTHESIS"<<endl;
       if(checkLock(aStudy)) break;
 
       LightApp_SelectionMgr *aSel = SMESHGUI::selectionMgr();
@@ -4037,7 +4040,8 @@ void SMESHGUI::storeVisualParameters (int savePoint)
       {
        if (SVTK_ViewWindow* vtkView = dynamic_cast<SVTK_ViewWindow*>(views[i]))
         {
-         vtkActorCollection* allActors = vtkView->getRenderer()->GetActors();
+         VTK::ActorCollectionCopy aCopy(vtkView->getRenderer()->GetActors());
+         vtkActorCollection* allActors = aCopy.GetActors();
          allActors->InitTraversal();
          while (vtkActor* actor = allActors->GetNextActor())
           {
@@ -4253,7 +4257,8 @@ void SMESHGUI::restoreVisualParameters (int savePoint)
               // access later when restoring other parameters
               SVTK_ViewWindow* vtkView = (SVTK_ViewWindow*) vman->getActiveView();
               vtkRenderer* Renderer = vtkView->getRenderer();
-              vtkActorCollection* theActors = Renderer->GetActors();
+             VTK::ActorCollectionCopy aCopy(Renderer->GetActors());
+              vtkActorCollection* theActors = aCopy.GetActors();
               theActors->InitTraversal();
               bool isFound = false;
               vtkActor *ac = theActors->GetNextActor();