X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;f=src%2FHYDROGUI%2FHYDROGUI_VisualStateOp.cxx;h=58c97b42c62b6d4570ed077aca5d5ebcd21ed151;hb=a1431f03eac1d1aed4203d0568d987c41ce939b3;hp=37f9c27f81c0183dcf2a3bc05140cf30df9e0b69;hpb=35a75ba275261aff7c8c48c0d16842dafd455007;p=modules%2Fhydro.git diff --git a/src/HYDROGUI/HYDROGUI_VisualStateOp.cxx b/src/HYDROGUI/HYDROGUI_VisualStateOp.cxx index 37f9c27f..58c97b42 100644 --- a/src/HYDROGUI/HYDROGUI_VisualStateOp.cxx +++ b/src/HYDROGUI/HYDROGUI_VisualStateOp.cxx @@ -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(); } } @@ -92,7 +95,7 @@ bool HYDROGUI_VisualStateOp::saveVisualState() if( aVisualState.IsNull() ) return false; - QString aName = HYDROGUI_Tool::GenerateObjectName( module(), "VisualState" ); + QString aName = HYDROGUI_Tool::GenerateObjectName( module(), tr( "DEFAULT_VISUAL_STATE_NAME" ) ); aVisualState->SetName( aName ); } @@ -134,13 +137,13 @@ bool HYDROGUI_VisualStateOp::saveVisualState() for( int anObjIndex = 1, aLength = aSeq.Length(); anObjIndex <= aLength; anObjIndex++ ) { - Handle(HYDROData_Object) anObject = aSeq.Value( anObjIndex ); + Handle(HYDROData_Entity) anObject = aSeq.Value( anObjIndex ); if( !anObject.IsNull() ) { // 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 ); @@ -240,7 +243,7 @@ bool HYDROGUI_VisualStateOp::loadVisualState() for( int anObjIndex = 1, aLength = aSeq.Length(); anObjIndex <= aLength; anObjIndex++ ) { - Handle(HYDROData_Object) anObject = aSeq.Value( anObjIndex ); + Handle(HYDROData_Entity) anObject = aSeq.Value( anObjIndex ); if( !anObject.IsNull() ) { QString aName = anObject->GetName(); @@ -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 ); } } }