]> SALOME platform Git repositories - modules/gui.git/commitdiff
Salome HOME
Implementation of the "22589: EDF 8048 - ergonomics of SMESH" issue.
authorrnv <rnv@opencascade.com>
Fri, 23 May 2014 09:00:40 +0000 (13:00 +0400)
committerrnv <rnv@opencascade.com>
Fri, 23 May 2014 09:00:40 +0000 (13:00 +0400)
src/OCCViewer/OCCViewer_ViewWindow.cxx
src/OCCViewer/OCCViewer_ViewWindow.h
src/SALOME_PY/SalomePy.cxx
src/SVTK/SVTK_Renderer.cxx
src/SVTK/SVTK_Renderer.h
src/SVTK/SVTK_ViewWindow.cxx
src/SVTK/SVTK_ViewWindow.h

index 96e15b4885f29f741e8e8dc6206dddddfaff324d..ed1d3c1dbec0275b88cd84086b872940b26797b8 100755 (executable)
@@ -1283,8 +1283,10 @@ void OCCViewer_ViewWindow::createActions()
   if (myModel->trihedronActivated()) {
     aAction = new QtxAction(tr("MNU_SHOW_TRIHEDRE"), aResMgr->loadPixmap( "OCCViewer", tr( "ICON_OCCVIEWER_VIEW_TRIHEDRON" ) ),
                              tr( "MNU_SHOW_TRIHEDRE" ), 0, this);
+    aAction->setCheckable( true );
+    aAction->setChecked( true );
     aAction->setStatusTip(tr("DSC_SHOW_TRIHEDRE"));
-    connect(aAction, SIGNAL(triggered()), this, SLOT(onTrihedronShow()));
+    connect(aAction, SIGNAL(toggled(bool)), this, SLOT(onTrihedronShow(bool)));
     toolMgr()->registerAction( aAction, TrihedronShowId );
   }
 
@@ -1790,9 +1792,9 @@ void OCCViewer_ViewWindow::setRestoreFlag()
 /*!
   \brief Called when action "show/hide trihedron" is activated.
 */
-void OCCViewer_ViewWindow::onTrihedronShow()
+void OCCViewer_ViewWindow::onTrihedronShow(bool show)
 {
-  myModel->toggleTrihedron();
+  myModel->setTrihedronShown(show);
 }
 
 /*!
index 135d81c0d430086cbb9e5dbcf80dfb32b7bc7d69..421e43f049b4956cabd1b472ae3f4af953a8c670 100755 (executable)
@@ -260,7 +260,7 @@ public slots:
   virtual void onAmbientToogle();
   virtual void onMemorizeView();
   virtual void onRestoreView();
-  virtual void onTrihedronShow();
+  virtual void onTrihedronShow(bool);
   virtual void setRestoreFlag();
   virtual void onSwitchInteractionStyle( bool on );
   virtual void onSwitchZoomingStyle( bool on );
index 85286c91b0211948ad6d5b1f16b1d166b785e720..167941da847083c4323b88c0a075884198db44b8 100755 (executable)
@@ -372,7 +372,7 @@ extern "C" SALOMEPY_EXPORT PyObject* libSalomePy_showTrihedron( PyObject* self,
     {
       if( SVTK_ViewWindow* aVTKViewWindow = GetVTKViewWindow( __Find ) ) {
         if ( aVTKViewWindow->isTrihedronDisplayed() != myShow )
-          aVTKViewWindow->onViewTrihedron();
+          aVTKViewWindow->onViewTrihedron(myShow);
       }
     }
   };
index 8bbed38032062ccaa891a9cbfff9e052b1426b98..d5ccedbefe59f7690d755967d4b7c4002986c054 100644 (file)
@@ -558,6 +558,18 @@ SVTK_Renderer
     myTrihedron->VisibilityOn();
 }
 
+/*!
+  Set trihedron visibility
+*/
+void 
+SVTK_Renderer
+::SetTrihedronVisibility( const bool show ) {
+  if(show)
+    myTrihedron->VisibilityOn();
+  else
+    myTrihedron->VisibilityOff();  
+}
+
 /*!
   Adjust size of the trihedron to the bounding box of the scene
 */
index 91421aa4ae0bf6a43c06ede1b4c3bcc8eb94f848..19e7f51e870d486e2037f190c24f94434fb52a29 100644 (file)
@@ -153,6 +153,11 @@ class SVTK_EXPORT SVTK_Renderer : public vtkObject
   void 
   OnViewTrihedron(); 
 
+  //! Set Toggle trihedron visibility
+
+  void
+  SetTrihedronVisibility( const bool );
+
   //! Adjust size of the trihedron to the bounding box of the scene
   void 
   OnAdjustTrihedron();
index 63ed448bc7b949b273bbf909ad527eee334d02c6..d56dde955cb163a7d2ecb1ae12e500e2f75d6d9c 100755 (executable)
@@ -799,9 +799,9 @@ bool SVTK_ViewWindow::isCubeAxesDisplayed()
 /*!
   Redirect the request to #SVTK_Renderer::OnViewTrihedron
 */
-void SVTK_ViewWindow::onViewTrihedron()
+void SVTK_ViewWindow::onViewTrihedron(bool show)
 {
-  GetRenderer()->OnViewTrihedron();
+  GetRenderer()->SetTrihedronVisibility(show);
   Repaint();
 }
 
@@ -2050,8 +2050,11 @@ void SVTK_ViewWindow::createActions(SUIT_ResourceMgr* theResourceMgr)
   anAction = new QtxAction(tr("MNU_SHOW_TRIHEDRON"), 
                            theResourceMgr->loadPixmap( "VTKViewer", tr( "ICON_VTKVIEWER_VIEW_TRIHEDRON" ) ),
                            tr( "MNU_SHOW_TRIHEDRON" ), 0, this);
+  anAction->setCheckable( true );
+  anAction->setChecked( true );
+  
   anAction->setStatusTip(tr("DSC_SHOW_TRIHEDRON"));
-  connect(anAction, SIGNAL(activated()), this, SLOT(onViewTrihedron()));
+  connect(anAction, SIGNAL(toggled(bool)), this, SLOT(onViewTrihedron(bool)));
   mgr->registerAction( anAction, ViewTrihedronId );
 
   // onNonIsometric: Manage non-isometric params
index 3ee736b38b5969a3e1af8eb9ff37075a6a4dfede..ef6eb8a55bb196ec57e382afe6af95cb6fe9bb11 100755 (executable)
@@ -365,7 +365,7 @@ public slots:
   virtual void onFitAll();
 
   //! Redirect the request to #SVTK_Renderer::OnViewTrihedron
-  virtual void onViewTrihedron(); 
+  virtual void onViewTrihedron(bool); 
 
   //! Redirect the request to #SVTK_Renderer::OnViewCubeAxes
   virtual void onViewCubeAxes();