// PARAVIS : ParaView wrapper SALOME module
//
-// Copyright (C) 2010-2012 CEA/DEN, EDF R&D
+// Copyright (C) 2010-2014 CEA/DEN, EDF R&D
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+// version 2.1 of the License, or (at your option) any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
#include <QtxActionToolMgr.h>
#include <LightApp_Application.h>
+#include <SalomeApp_Application.h>
#include <SUIT_Desktop.h>
#include <QApplication>
#include <pqApplicationCore.h>
#include <pqComparativeVisPanel.h>
-#include <pqObjectInspectorWidget.h>
#include <pqPipelineBrowserWidget.h>
-//#include <pqProxyTabWidget.h>
-#include <pqObjectInspectorWidget.h>
#include <pqProxyInformationWidget.h>
-#include <pqDisplayProxyEditorWidget.h>
#include <pqSettings.h>
#include <pqDataInformationWidget.h>
#include <pqPVAnimationWidget.h>
-#include <pqSelectionInspectorWidget.h>
+#include <pqFindDataSelectionDisplayFrame.h>
+#include <pqMultiBlockInspectorPanel.h>
#include <pqProgressWidget.h>
#include <pqProgressManager.h>
+#include <pqObjectInspectorWidget.h>
+#include <pqDisplayProxyEditorWidget.h>
#include <pqAlwaysConnectedBehavior.h>
#include <pqApplicationCore.h>
#include <pqParaViewMenuBuilders.h>
#include <pqCollaborationPanel.h>
#include <pqMemoryInspectorPanel.h>
+#include <pqColorMapEditor.h>
class ResizeHelper : public pqPVAnimationWidget
{
pipelineBrowserDock->setWidget(browser);
myDockWidgets[pipelineBrowserDock] = true;
-
-
-
//Object inspector
QDockWidget* objectInspectorDock = new QDockWidget( tr( "TTL_OBJECT_INSPECTOR" ), desk );
objectInspectorDock->setObjectName("objectInspectorDock");
desk->tabifyDockWidget(objectInspectorDock, informationDock);
objectInspectorDock->raise();
+
// Statistic View
QDockWidget* statisticsViewDock = new QDockWidget( tr( "TTL_STATISTICS_VIEW" ), desk );
statisticsViewDock->setObjectName("statisticsViewDock");
desk->tabifyDockWidget(animationViewDock, statisticsViewDock);
- // Selection view
- QDockWidget* selectionInspectorDock = new QDockWidget( tr( "TTL_SELECTION_INSPECTOR" ), desk );
- selectionInspectorDock->setObjectName("selectionInspectorDock");
- selectionInspectorDock->setAllowedAreas( Qt::AllDockWidgetAreas );
- desk->addDockWidget( Qt::LeftDockWidgetArea, selectionInspectorDock );
- pqSelectionInspectorPanel* aSelInspector = new pqSelectionInspectorWidget(selectionInspectorDock);
- selectionInspectorDock->setWidget(aSelInspector);
- myDockWidgets[selectionInspectorDock] = false; // hidden by default
+ // Selection inspector
+ QDockWidget* selectionDisplayDock = new QDockWidget( tr( "TTL_SELECTION_INSPECTOR" ), desk );
+ selectionDisplayDock->setObjectName("selectionInspectorDock");
+ selectionDisplayDock->setAllowedAreas( Qt::AllDockWidgetAreas );
+ desk->addDockWidget( Qt::LeftDockWidgetArea, selectionDisplayDock );
+ pqFindDataSelectionDisplayFrame* aSelInspector = new pqFindDataSelectionDisplayFrame(selectionDisplayDock);
+ selectionDisplayDock->setWidget(aSelInspector);
+ myDockWidgets[selectionDisplayDock] = false; // hidden by default
+
+ // Multi-block inspector
+ QDockWidget* multiBlockInspectorPanelDock = new QDockWidget( tr( "TTL_MUTLI_BLOCK_INSPECTOR" ), desk );
+ multiBlockInspectorPanelDock->setObjectName("multiBlockInspectorPanelDock");
+ desk->addDockWidget( Qt::LeftDockWidgetArea, multiBlockInspectorPanelDock );
+ pqMultiBlockInspectorPanel* mbi_panel = new pqMultiBlockInspectorPanel( multiBlockInspectorPanelDock );
+ multiBlockInspectorPanelDock->setWidget(mbi_panel);
+ myDockWidgets[multiBlockInspectorPanelDock] = false; // hidden by default
// Comparative View
QDockWidget* comparativePanelDock = new QDockWidget( tr( "TTL_COMPARATIVE_VIEW_INSPECTOR" ), desk );
collaborationPanelDock->setWidget(collaborationPanel);
desk->addDockWidget(Qt::RightDockWidgetArea, collaborationPanelDock);
myDockWidgets[collaborationPanelDock] = false; // hidden by default
+
+ // Color map editor
+ QDockWidget* colorMapEditorDock = new QDockWidget( tr( "TTL_COLOR_MAP_EDITOR" ), desk );
+ colorMapEditorDock->setObjectName("colorMapEditorDock");
+ desk->addDockWidget( Qt::LeftDockWidgetArea, colorMapEditorDock );
+ pqColorMapEditor* cmed_panel = new pqColorMapEditor( colorMapEditorDock );
+ colorMapEditorDock->setWidget(cmed_panel);
+ myDockWidgets[colorMapEditorDock] = false; // hidden by default
+
// Memory inspector dock
QDockWidget* memoryInspectorDock = new QDockWidget(tr( "TTL_MEMORY_INSPECTOR" ), desk);
memoryInspectorDock->setObjectName("memoryInspectorDock");
+#ifndef WIN32
pqMemoryInspectorPanel* dockWidgetContents = new pqMemoryInspectorPanel();
dockWidgetContents->setObjectName("dockWidgetContents");
memoryInspectorDock->setWidget(dockWidgetContents);
+#endif
desk->addDockWidget(Qt::RightDockWidgetArea, memoryInspectorDock);
myDockWidgets[memoryInspectorDock] = false; // hidden by default
statisticsViewDock->hide();
comparativePanelDock->hide();
animationViewDock->hide();
- selectionInspectorDock->hide();
+ multiBlockInspectorPanelDock->hide();
+ selectionDisplayDock->hide();
collaborationPanelDock->hide();
memoryInspectorDock->hide();
-
- // Setup quick-launch shortcuts.
- QShortcut *ctrlSpace = new QShortcut(Qt::CTRL + Qt::Key_Space, desk);
- QObject::connect(ctrlSpace, SIGNAL(activated()), pqApplicationCore::instance(), SLOT(quickLaunch()));
- QShortcut *altSpace = new QShortcut(Qt::ALT + Qt::Key_Space, desk);
- QObject::connect(altSpace, SIGNAL(activated()), pqApplicationCore::instance(), SLOT(quickLaunch()));
-
+ colorMapEditorDock->hide();
}
/*!
tb->toggleViewAction()->setVisible( true );
}
}
+
+
+
+/*!
+ \brief Store visibility of the common dockable windows (OB, PyConsole, ... etc.)
+*/
+void PVGUI_Module::storeCommonWindowsState() {
+ //rnv: Make behaviour of the dockable windows and toolbars coherent with others
+ // modules: if 'Save position of the windows' or 'Save position of the toolbars'
+ // in the General SALOME preferences are cheked, then properties of the windows and/or toolbars
+ // are stored/restored using standard Qt saveState(...) and restoreState(...) methods.
+ // Otherwise to the windows and toolbars applied default settins stored int the SalomeApp.xml
+ // configuration file.
+ //
+ // But in contrast to others modules ParaVis module default settings hide some dockable
+ // windows, so to restore it at the moment of the ParaVis de-activation we call
+ // restoreCommonWindowsState() method, and at the moment of the ParaVis activation we call
+ // this method.
+
+ SalomeApp_Application* anApp = getApp();
+ if(!anApp)
+ return;
+
+ int begin = SalomeApp_Application::WT_ObjectBrowser;
+ int end = SalomeApp_Application::WT_NoteBook;
+ for( int i = begin; i <= end; i++ ) {
+ QWidget* wg = anApp->getWindow(i);
+ if(wg) {
+ QDockWidget* dock = 0;
+ QWidget* w = wg->parentWidget();
+ while ( w && !dock ) {
+ dock = ::qobject_cast<QDockWidget*>( w );
+ w = w->parentWidget();
+ }
+ if(dock){
+ if(!myCommonMap.contains(i)){
+ myCommonMap.insert(i,dock->isVisible());
+ } else {
+ myCommonMap[i] = dock->isVisible();
+ }
+ }
+ }
+ }
+}
+
+/*!
+ \brief Restore visibility of the common dockable windows (OB, PyConsole, ... etc.)
+*/
+void PVGUI_Module::restoreCommonWindowsState() {
+ SalomeApp_Application* anApp = getApp();
+ if(!anApp)
+ return;
+ DockWindowMap::const_iterator it = myCommonMap.begin();
+ for( ;it != myCommonMap.end(); it++ ) {
+ QWidget* wg = anApp->getWindow(it.key());
+ if(wg) {
+ QDockWidget* dock = 0;
+ QWidget* w = wg->parentWidget();
+ while ( w && !dock ) {
+ dock = ::qobject_cast<QDockWidget*>( w );
+ w = w->parentWidget();
+ }
+ if(dock) {
+ dock->setVisible(it.value());
+ }
+ }
+ }
+}