Salome HOME
Merge remote-tracking branch 'origin/BR_1321_ECW' into BR_DEMO
[modules/hydro.git] / src / HYDROGUI / HYDROGUI_BathymetrySelectionOp.cxx
index 76d4dcc0b1bfe1d7a50c72c7dfdb9263b92cf798..8c843cd2f3f45a71a3ec060f35687768ab7ec2a6 100644 (file)
 #include <HYDROGUI_Module.h>
 #include <HYDROGUI_BathymetryPrs.h>
 #include <HYDROGUI_BathymetryOp.h>
+#include <HYDROGUI_ShapeBathymetry.h>
+#include <HYDROGUI_Operations.h>
 #include <OCCViewer_ViewManager.h>
 #include <LightApp_Application.h>
+#include <QAction>
 
 HYDROGUI_BathymetrySelectionOp::HYDROGUI_BathymetrySelectionOp( HYDROGUI_Module* theModule )
 : HYDROGUI_Operation( theModule ), myIsActive( false )
@@ -41,6 +44,9 @@ void HYDROGUI_BathymetrySelectionOp::startOperation()
 void HYDROGUI_BathymetrySelectionOp::abortOperation()
 {
   activateSelection( false );
+
+  module()->action( BathymetrySelectionId )->setChecked( false );
+  module()->action( BathymetryTextId )->setChecked( false );
 }
 
 bool HYDROGUI_BathymetrySelectionOp::isValid( SUIT_Operation* theOtherOp ) const
@@ -49,13 +55,17 @@ bool HYDROGUI_BathymetrySelectionOp::isValid( SUIT_Operation* theOtherOp ) const
   return ( aBathOp != 0 );
 }
 
-Handle(AIS_InteractiveContext) getContext( HYDROGUI_Module* theModule )
+OCCViewer_Viewer* getViewer( HYDROGUI_Module* theModule )
 {
   LightApp_Application* app = theModule->getApp();
   OCCViewer_ViewManager* mgr = dynamic_cast<OCCViewer_ViewManager*>
     ( app->getViewManager( OCCViewer_Viewer::Type(), true ) );
-  Handle(AIS_InteractiveContext) ctx = mgr->getOCCViewer()->getAISContext();
-  return ctx;
+  return mgr->getOCCViewer();
+}
+
+Handle(AIS_InteractiveContext) getContext( HYDROGUI_Module* theModule )
+{
+  return getViewer( theModule )->getAISContext();
 }
 
 QList<Handle(HYDROGUI_BathymetryPrs)> getShownBathymetries( HYDROGUI_Module* theModule )
@@ -99,6 +109,7 @@ void HYDROGUI_BathymetrySelectionOp::activateSelection( bool isActive )
     {
       bath->ClearSelected();
       bath->SetAutoHilight( Standard_True );
+      bath->GetShape()->TextLabels( false );
       ctx->Deactivate( bath );
     }
     ctx->CloseLocalContext( -1, Standard_True );