From: Anthony Geay Date: Fri, 7 Apr 2023 13:39:10 +0000 (+0200) Subject: Add fit all button X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=89d61ff3f5d41b94297fa796f21fc98f29886073;p=modules%2Fgui.git Add fit all button --- diff --git a/src/PV3DViewer/PV3DViewer_ViewWindow.cxx b/src/PV3DViewer/PV3DViewer_ViewWindow.cxx index 9a21c91c2..b0f14d44e 100644 --- a/src/PV3DViewer/PV3DViewer_ViewWindow.cxx +++ b/src/PV3DViewer/PV3DViewer_ViewWindow.cxx @@ -39,12 +39,6 @@ #include "MBDebug.h" //--------------------------------------------------------- - -/*! - \class PV3DViewer_ViewWindow - \brief PVGUI view window. -*/ - /*! \brief Constructor. \param theDesktop parent desktop window @@ -57,17 +51,6 @@ PV3DViewer_ViewWindow::PV3DViewer_ViewWindow( SUIT_Desktop* theDesktop, PV3DView myDesktop = theDesktop; myModel = theModel; setViewManager(myModel->getViewManager()); - /*myPVMgr = qobject_cast(pqApplicationCore::instance()->manager("MULTIVIEW_WIDGET")); - if (myPVMgr) { - SUIT_Application* app = SUIT_Session::session()->activeApplication(); - if ( app ) - app->addPostRoutine(&PV3DViewer_ViewWindow::removePVMgr); - myPVMgr->setParent( this ); - // This is mandatory, see setParent() method in Qt 4 documentation - myPVMgr->show(); - setCentralWidget( myPVMgr ); - } else - qDebug("No multiViewManager defined");*/ } /*! @@ -98,7 +81,7 @@ void PV3DViewer_ViewWindow::removePVMgr() /*! \brief Returns the ParaView multi-view manager previously set with setPVManager() */ -pqTabbedMultiViewWidget* PV3DViewer_ViewWindow::getMultiViewManager() const +pqTabbedMultiViewWidget *PV3DViewer_ViewWindow::getMultiViewManager() const { DBG_FUN(); return myPVMgr; diff --git a/src/SPV3D/SPV3D_ViewWindow.cxx b/src/SPV3D/SPV3D_ViewWindow.cxx index 855874ed1..d3e226c4d 100644 --- a/src/SPV3D/SPV3D_ViewWindow.cxx +++ b/src/SPV3D/SPV3D_ViewWindow.cxx @@ -50,9 +50,14 @@ #include "QtxMultiAction.h" #include "QtxActionGroup.h" +#include +#include + #include "SALOME_ListIO.hxx" #include "SPV3D_Prs.h" +#include + //--------------------------------------------------------- #define USE_DEBUG #define MBCLASSNAME "SPV3D_ViewWindow" @@ -78,6 +83,13 @@ void SPV3D_ViewWindow::init() QWidget *wid = myModel->getView()->widget(); wid->setParent( this ); setCentralWidget( myModel->getView()->widget() ); + // + myToolBar = toolMgr()->createToolBar( tr("LBL_TOOLBAR_LABEL"), // title (language-dependant) + QString( "PV3DViewerViewOperations" ), // name (language-independant) + false ); + QAction* resetCenterAction = + toolMgr()->toolBar(myToolBar)->addAction(QIcon(":/pqWidgets/Icons/pqResetCamera.svg"), tr( "MNU_FITALL" ) ); + new pqCameraReaction(resetCenterAction, pqCameraReaction::RESET_CAMERA); } SPV3D_Prs *SPV3D_ViewWindow::findOrCreatePrs( const char* entry ) diff --git a/src/SPV3D/SPV3D_ViewWindow.h b/src/SPV3D/SPV3D_ViewWindow.h index 546eeeebe..5a39d5bff 100644 --- a/src/SPV3D/SPV3D_ViewWindow.h +++ b/src/SPV3D/SPV3D_ViewWindow.h @@ -139,6 +139,7 @@ protected slots: void onMouseMoving(QMouseEvent* event); protected: + int myToolBar = -1; SPV3D_ViewModel* myModel; std::list< std::pair > > myPrs; };