From: asl Date: Fri, 10 Nov 2017 10:48:04 +0000 (+0300) Subject: refs #1396: bathymetry text without transaction X-Git-Tag: v2.1~31^2~1 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=29adb78ec8adfb633edb66c4abdb8c203709bf57;p=modules%2Fhydro.git refs #1396: bathymetry text without transaction --- diff --git a/src/HYDROGUI/HYDROGUI_BathymetryOp.cxx b/src/HYDROGUI/HYDROGUI_BathymetryOp.cxx index 68178b58..2af45bc2 100644 --- a/src/HYDROGUI/HYDROGUI_BathymetryOp.cxx +++ b/src/HYDROGUI/HYDROGUI_BathymetryOp.cxx @@ -106,7 +106,8 @@ void HYDROGUI_BathymetryOp::startOperation() void HYDROGUI_BathymetryOp::commitOperation() { - activate( false ); + if( myMode!=BathymetryTextId ) + activate( false ); } void HYDROGUI_BathymetryOp::abortOperation() @@ -140,6 +141,7 @@ void HYDROGUI_BathymetryOp::activate( bool isActivate ) { foreach( Handle(HYDROGUI_BathymetryPrs) bath, baths ) bath->GetShape()->TextLabels( isActivate ); + commit(); break; } diff --git a/src/HYDROGUI/HYDROGUI_BathymetryOp.h b/src/HYDROGUI/HYDROGUI_BathymetryOp.h index 2aad488b..e76ac119 100644 --- a/src/HYDROGUI/HYDROGUI_BathymetryOp.h +++ b/src/HYDROGUI/HYDROGUI_BathymetryOp.h @@ -34,12 +34,13 @@ public: HYDROGUI_BathymetryOp( HYDROGUI_Module* theModule, int theMode ); virtual ~HYDROGUI_BathymetryOp(); + void activate( bool ); + protected: virtual void startOperation(); virtual void commitOperation(); virtual void abortOperation(); - void activate( bool ); OCCViewer_ViewWindow* activeViewWindow() const; private: diff --git a/src/HYDROGUI/HYDROGUI_Operations.cxx b/src/HYDROGUI/HYDROGUI_Operations.cxx index 8a709139..194e38a1 100644 --- a/src/HYDROGUI/HYDROGUI_Operations.cxx +++ b/src/HYDROGUI/HYDROGUI_Operations.cxx @@ -877,5 +877,9 @@ void HYDROGUI_Module::onBathymetryText() if( isChecked ) startOperation( BathymetryTextId ); else - operation( BathymetryTextId )->abort(); + { + HYDROGUI_BathymetryOp* op = dynamic_cast( operation( BathymetryTextId ) ); + if( op ) + op->activate( false ); + } } diff --git a/src/HYDROGUI/HYDROGUI_ShapeBathymetry.cxx b/src/HYDROGUI/HYDROGUI_ShapeBathymetry.cxx index f211ae56..dfc3a62c 100644 --- a/src/HYDROGUI/HYDROGUI_ShapeBathymetry.cxx +++ b/src/HYDROGUI/HYDROGUI_ShapeBathymetry.cxx @@ -298,4 +298,5 @@ void HYDROGUI_ShapeBathymetry::TextLabels( bool isOn ) getContext()->ClearSelected(); prs->SetTextLabels( selection ); prs->Redisplay(); + getContext()->UpdateCurrentViewer(); }