From: san Date: Wed, 26 Nov 2008 14:15:16 +0000 (+0000) Subject: ParaView dock widgets X-Git-Tag: PARAVIS_TEST~11 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=b866b1aac2666fe424a44e0745e12e9d12e780d7;p=modules%2Fparavis.git ParaView dock widgets --- diff --git a/src/PVGUI/PVGUI_Module.cxx b/src/PVGUI/PVGUI_Module.cxx index 4826000e..dfd21120 100644 --- a/src/PVGUI/PVGUI_Module.cxx +++ b/src/PVGUI/PVGUI_Module.cxx @@ -37,6 +37,7 @@ #include #include +#include #include #include #include @@ -46,8 +47,11 @@ #include #include #include +#include #include #include +#include +#include #include #include #include @@ -374,6 +378,9 @@ void PVGUI_Module::showView( bool toShow ) pvCreateActions(); setupDockWidgets(); + + // Now that we're ready, initialize everything ... + Implementation->Core.initializeStates(); } } @@ -423,9 +430,109 @@ void PVGUI_Module::pvCreateActions() /*! \brief Create dock widgets for ParaView widgets such as object inspector, pipeline browser, etc. + ParaView pqMainWIndowCore class is fully responsible for these dock widgets' contents. */ void PVGUI_Module::setupDockWidgets() { + SUIT_Desktop* desk = application()->desktop(); + + // See ParaView src/Applications/Client/MainWindow.cxx + QDockWidget* pipelineBrowserDock = new QDockWidget( tr( "Pipeline Browser" ), desk ); + pipelineBrowserDock->setAllowedAreas( Qt::LeftDockWidgetArea|Qt::NoDockWidgetArea|Qt::RightDockWidgetArea ); + desk->addDockWidget( Qt::LeftDockWidgetArea, pipelineBrowserDock ); + Implementation->Core.setupPipelineBrowser( pipelineBrowserDock ); + pqPipelineBrowser *browser = Implementation->Core.pipelineBrowser(); + Implementation->Core.pipelineMenu().setModels(browser->getModel(), browser->getSelectionModel()); + // TODO... + /*connect(this->Implementation->UI.actionChangeInput, SIGNAL(triggered()), + browser, SLOT(changeInput())); + connect(this->Implementation->UI.actionDelete, SIGNAL(triggered()), + browser, SLOT(deleteSelected())); + pqPipelineBrowserContextMenu *browserMenu = + new pqPipelineBrowserContextMenu(browser); + browserMenu->setMenuAction(this->Implementation->UI.actionFileOpen); + browserMenu->setMenuAction(this->Implementation->UI.actionChangeInput); + browserMenu->setMenuAction(this->Implementation->UI.actionDelete); + browserMenu->setMenuAction(this->Implementation->UI.actionToolsCreateCustomFilter);*/ + + QDockWidget* objectInspectorDock = new QDockWidget( tr( "Object Inspector" ), desk ); + objectInspectorDock->setAllowedAreas( Qt::LeftDockWidgetArea|Qt::NoDockWidgetArea|Qt::RightDockWidgetArea ); + desk->addDockWidget( Qt::LeftDockWidgetArea, objectInspectorDock ); + pqProxyTabWidget* const proxyTab = Implementation->Core.setupProxyTabWidget( objectInspectorDock ); + // TODO... + /* QObject::connect( + proxyTab->getObjectInspector(), + SIGNAL(helpRequested(QString)), + this, + SLOT(showHelpForProxy(QString))); + + QObject::connect( + proxyTab->getObjectInspector(), + SIGNAL(preaccept()), + this, + SLOT(onPreAccept())); + + QObject::connect( + proxyTab->getObjectInspector(), + SIGNAL(postaccept()), + this, + SLOT(onPostAccept()));*/ + + QDockWidget* statisticsViewDock = new QDockWidget( tr( "Statistics View" ), desk ); + statisticsViewDock->setAllowedAreas( Qt::BottomDockWidgetArea|Qt::LeftDockWidgetArea|Qt::NoDockWidgetArea|Qt::RightDockWidgetArea ); + desk->addDockWidget( Qt::BottomDockWidgetArea, statisticsViewDock ); + Implementation->Core.setupStatisticsView( statisticsViewDock ); + + QDockWidget* animationPanelDock = new QDockWidget( tr( "Animation Inspector" ), desk ); + desk->addDockWidget( Qt::LeftDockWidgetArea, animationPanelDock ); + pqAnimationPanel* animation_panel = Implementation->Core.setupAnimationPanel( animationPanelDock ); + // TODO... + /* animation_panel->setCurrentTimeToolbar( + this->Implementation->UI.currentTimeToolbar);*/ + + QDockWidget* lookmarkBrowserDock = new QDockWidget( tr( "Lookmark Browser" ), desk ); + QSizePolicy sp( QSizePolicy::Preferred, QSizePolicy::Preferred ); + sp.setHorizontalStretch( 0 ); + sp.setVerticalStretch( 0 ); + lookmarkBrowserDock->setSizePolicy( sp ); + lookmarkBrowserDock->setFloating( false ); + desk->addDockWidget( Qt::RightDockWidgetArea, lookmarkBrowserDock ); + Implementation->Core.setupLookmarkBrowser( lookmarkBrowserDock ); + + QDockWidget* lookmarkInspectorDock = new QDockWidget( tr( "Lookmark Inspector" ), desk ); + lookmarkInspectorDock->setAllowedAreas( Qt::RightDockWidgetArea ); + desk->addDockWidget( Qt::RightDockWidgetArea, lookmarkInspectorDock ); + Implementation->Core.setupLookmarkInspector( lookmarkInspectorDock ); + + QDockWidget* comparativePanelDock = new QDockWidget( tr( "Comparative View Inspector" ), desk ); + desk->addDockWidget( Qt::LeftDockWidgetArea, comparativePanelDock ); + pqComparativeVisPanel* cv_panel = new pqComparativeVisPanel( comparativePanelDock ); + comparativePanelDock->setWidget(cv_panel); + + QDockWidget* animationViewDock = new QDockWidget( tr( "Animation View" ), desk ); + desk->addDockWidget( Qt::BottomDockWidgetArea, animationViewDock ); + Implementation->Core.setupAnimationView( animationViewDock ); + + QDockWidget* selectionInspectorDock = new QDockWidget( tr( "Selection Inspector" ), desk ); + selectionInspectorDock->setAllowedAreas( Qt::AllDockWidgetAreas ); + desk->addDockWidget( Qt::LeftDockWidgetArea, selectionInspectorDock ); + Implementation->Core.setupSelectionInspector( selectionInspectorDock ); + + // Setup the statusbar ... + Implementation->Core.setupProgressBar( desk->statusBar() ); + + // Set up the dock window corners to give the vertical docks more room. + desk->setCorner(Qt::BottomLeftCorner, Qt::LeftDockWidgetArea); + desk->setCorner(Qt::BottomRightCorner, Qt::RightDockWidgetArea); + + // Setup the default dock configuration ... + lookmarkBrowserDock->hide(); + lookmarkInspectorDock->hide(); + statisticsViewDock->hide(); + animationPanelDock->hide(); + comparativePanelDock->hide(); + animationViewDock->hide(); + selectionInspectorDock->hide(); } /*!