Salome HOME
refs #1396: bathymetry text without transaction
authorasl <asl@opencascade.com>
Fri, 10 Nov 2017 10:48:04 +0000 (13:48 +0300)
committerasl <asl@opencascade.com>
Fri, 10 Nov 2017 12:12:17 +0000 (15:12 +0300)
src/HYDROGUI/HYDROGUI_BathymetryOp.cxx
src/HYDROGUI/HYDROGUI_BathymetryOp.h
src/HYDROGUI/HYDROGUI_Operations.cxx
src/HYDROGUI/HYDROGUI_ShapeBathymetry.cxx

index 68178b587a5980ee6b1d7677060ba34a231bd781..2af45bc2a8995b51e43347b6615a66b3cd85bc4d 100644 (file)
@@ -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;
     }
 
index 2aad488b4ffed43aa6b263774f4e9e381db2a5c8..e76ac11900311fed309fff4cc1c0a9cbf057b508 100644 (file)
@@ -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:
index 8a709139624a18b9b569e5961a139d5ba669b9a4..194e38a18ce1461563025d25363c020dbff01d12 100644 (file)
@@ -877,5 +877,9 @@ void HYDROGUI_Module::onBathymetryText()
   if( isChecked )
     startOperation( BathymetryTextId );
   else
-    operation( BathymetryTextId )->abort();
+  {
+    HYDROGUI_BathymetryOp* op = dynamic_cast<HYDROGUI_BathymetryOp*>( operation( BathymetryTextId ) );
+    if( op )
+      op->activate( false );
+  }
 }
index f211ae56480fbbd0e4e27861ffc0750604c24af5..dfc3a62cf055cb508153a1561e1ac9aa06ea9b22 100644 (file)
@@ -298,4 +298,5 @@ void HYDROGUI_ShapeBathymetry::TextLabels( bool isOn )
   getContext()->ClearSelected();
   prs->SetTextLabels( selection );
   prs->Redisplay();
+  getContext()->UpdateCurrentViewer();
 }