Salome HOME
Dump Image data to python script (Feature #13).
[modules/hydro.git] / src / HYDROGUI / HYDROGUI_VisualStateOp.cxx
index 37f9c27f81c0183dcf2a3bc05140cf30df9e0b69..90a798286e873c0dc126226fd1588e4ec939a109 100644 (file)
@@ -59,7 +59,8 @@ void HYDROGUI_VisualStateOp::startOperation()
 {
   HYDROGUI_Operation::startOperation();
 
-  startDocOperation();
+  if( !myIsLoad )
+    startDocOperation();
 
   bool aResult = false;
   if( myIsLoad )
@@ -69,13 +70,15 @@ void HYDROGUI_VisualStateOp::startOperation()
 
   if( aResult )
   {
-    commitDocOperation();
+    if( !myIsLoad )
+      commitDocOperation();
     commit();
   }
   else
   {
-    abortDocOperation();
-    abort(); // do not commit the document command
+    if( !myIsLoad )
+      abortDocOperation();
+    abort();
   }
 }
 
@@ -140,7 +143,7 @@ bool HYDROGUI_VisualStateOp::saveVisualState()
             // Format: "Name|Visibility[|CoordX|CoordY]"
             QString aParameters = anObject->GetName();
 
-            int aVisibility = (int)anObject->IsVisible( aViewId );
+            int aVisibility = (int)( module()->isObjectVisible( aViewId, anObject ) );
             aParameters.append( QString( "|%1" ).arg( aVisibility ) );
 
             setVisualProperty( aPropertyMap, aViewerEntry, aParameters, true );
@@ -255,7 +258,7 @@ bool HYDROGUI_VisualStateOp::loadVisualState()
               {
                 bool anIsVisible = aParameters[ aParamIndex ].toInt( &anIsOk[ ++aParamIndex ] );
                 if( anIsOk[ 0 ] )
-                  anObject->SetVisible( aViewId, anIsVisible );
+                  module()->setObjectVisible( aViewId, anObject, anIsVisible );
               }
             }
           }