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 );
}
/*!
\brief Called when action "show/hide trihedron" is activated.
*/
-void OCCViewer_ViewWindow::onTrihedronShow()
+void OCCViewer_ViewWindow::onTrihedronShow(bool show)
{
- myModel->toggleTrihedron();
+ myModel->setTrihedronShown(show);
}
/*!
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 );
{
if( SVTK_ViewWindow* aVTKViewWindow = GetVTKViewWindow( __Find ) ) {
if ( aVTKViewWindow->isTrihedronDisplayed() != myShow )
- aVTKViewWindow->onViewTrihedron();
+ aVTKViewWindow->onViewTrihedron(myShow);
}
}
};
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
*/
void
OnViewTrihedron();
+ //! Set Toggle trihedron visibility
+
+ void
+ SetTrihedronVisibility( const bool );
+
//! Adjust size of the trihedron to the bounding box of the scene
void
OnAdjustTrihedron();
/*!
Redirect the request to #SVTK_Renderer::OnViewTrihedron
*/
-void SVTK_ViewWindow::onViewTrihedron()
+void SVTK_ViewWindow::onViewTrihedron(bool show)
{
- GetRenderer()->OnViewTrihedron();
+ GetRenderer()->SetTrihedronVisibility(show);
Repaint();
}
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
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();