]> SALOME platform Git repositories - modules/gui.git/commitdiff
Salome HOME
INT PAL 52638: "Hide All" operation doesn't work in the SALOME OCC and VTK viewers...
authorakl <alexander.kovalev@opencascade.com>
Thu, 2 Apr 2015 09:25:26 +0000 (13:25 +0400)
committerakl <alexander.kovalev@opencascade.com>
Thu, 2 Apr 2015 09:25:26 +0000 (13:25 +0400)
src/LightApp/LightApp_ShowHideOp.cxx

index b001bb4a22687f0244a82d1abe67193417a5e2e3..2b8ae4ad5539d0829a10d7e790687e581ec068eb 100644 (file)
@@ -78,22 +78,6 @@ void LightApp_ShowHideOp::startOperation()
     return;
   }
 
-  QString mod_name;
-  if( sel->count()>0 )
-  {
-    QString aStr =  sel->parameter( 0, "displayer" ).toString();
-    mod_name = app->moduleTitle( aStr );
-  }
-  else if( app->activeModule() )
-    mod_name = app->moduleTitle( app->activeModule()->name() );
-
-  LightApp_Displayer* d = LightApp_Displayer::FindDisplayer( mod_name, true );
-  if( !d )
-  {
-    abort();
-    return;
-  }
-
   if( myActionType==DISPLAY_ONLY || myActionType==ERASE_ALL )
   {
     //ERASE ALL
@@ -108,12 +92,30 @@ void LightApp_ShowHideOp::startOperation()
     }
     if( myActionType==ERASE_ALL )
     {
-      d->UpdateViewer();
+      // Temporary displayer just to update viewer!
+      LightApp_Displayer ld;
+      ld.UpdateViewer();
       commit();
       return;
     }
   }
 
+  QString mod_name;
+  if( sel->count()>0 )
+  {
+    QString aStr =  sel->parameter( 0, "displayer" ).toString();
+    mod_name = app->moduleTitle( aStr );
+  }
+  else if( app->activeModule() )
+    mod_name = app->moduleTitle( app->activeModule()->name() );
+
+  LightApp_Displayer* d = LightApp_Displayer::FindDisplayer( mod_name, true );
+  if( !d )
+  {
+    abort();
+    return;
+  }
+
   QStringList entries;
 
 #ifndef DISABLE_SALOMEOBJECT