]> SALOME platform Git repositories - modules/paravis.git/commitdiff
Salome HOME
ParaView dock widgets
authorsan <san@opencascade.com>
Wed, 26 Nov 2008 14:15:16 +0000 (14:15 +0000)
committersan <san@opencascade.com>
Wed, 26 Nov 2008 14:15:16 +0000 (14:15 +0000)
src/PVGUI/PVGUI_Module.cxx

index 4826000ea935bc0d3fc5c4c408f859ed657cf233..dfd21120096977946b5748c6f0aa331f3f2ceb3b 100644 (file)
@@ -37,6 +37,7 @@
 #include <QtxActionMenuMgr.h>
 
 #include <QApplication>
 #include <QtxActionMenuMgr.h>
 
 #include <QApplication>
+#include <QDockWidget>
 #include <QInputDialog>
 #include <QStringList>
 #include <QMenu>
 #include <QInputDialog>
 #include <QStringList>
 #include <QMenu>
 #include <pqOptions.h>
 #include <pqApplicationCore.h>
 #include <pqActiveServer.h>
 #include <pqOptions.h>
 #include <pqApplicationCore.h>
 #include <pqActiveServer.h>
+#include <pqComparativeVisPanel.h>
 #include <pqMainWindowCore.h>
 #include <pqObjectBuilder.h>
 #include <pqMainWindowCore.h>
 #include <pqObjectBuilder.h>
+#include <pqPipelineBrowser.h>
+#include <pqPipelineMenu.h>
 #include <pqServer.h>
 #include <pqServerManagerModel.h>
 #include <pqServerResource.h>
 #include <pqServer.h>
 #include <pqServerManagerModel.h>
 #include <pqServerResource.h>
@@ -374,6 +378,9 @@ void PVGUI_Module::showView( bool toShow )
 
     pvCreateActions();
     setupDockWidgets();
 
     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.
 
 /*!
   \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()
 {
 */
 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();
 }
 
 /*!
 }
 
 /*!