From 29adb78ec8adfb633edb66c4abdb8c203709bf57 Mon Sep 17 00:00:00 2001 From: asl Date: Fri, 10 Nov 2017 13:48:04 +0300 Subject: [PATCH] refs #1396: bathymetry text without transaction --- src/HYDROGUI/HYDROGUI_BathymetryOp.cxx | 4 +++- src/HYDROGUI/HYDROGUI_BathymetryOp.h | 3 ++- src/HYDROGUI/HYDROGUI_Operations.cxx | 6 +++++- src/HYDROGUI/HYDROGUI_ShapeBathymetry.cxx | 1 + 4 files changed, 11 insertions(+), 3 deletions(-) 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(); } -- 2.39.2