From: abn Date: Fri, 12 Sep 2014 13:34:42 +0000 (+0200) Subject: Merge branch 'abn/port_pv42' into abn/rearch X-Git-Tag: V7_5_0b1~27^2~14 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=1d6fe1344be14cbab6bff5cfca040709ac56d51b;p=modules%2Fparavis.git Merge branch 'abn/port_pv42' into abn/rearch Conflicts: src/PVGUI/CMakeLists.txt src/PVGUI/PVGUI_Module.cxx src/PVGUI/PVGUI_Module.h --- 1d6fe1344be14cbab6bff5cfca040709ac56d51b diff --cc src/PVGUI/CMakeLists.txt index 2f54c2fd,cc6fcf1d..6614e038 --- a/src/PVGUI/CMakeLists.txt +++ b/src/PVGUI/CMakeLists.txt @@@ -30,12 -30,9 +30,13 @@@ INCLUDE_DIRECTORIES(${OMNIORB_INCLUDE_D ${Boost_INCLUDE_DIRS} ${QT_INCLUDES} ${CMAKE_CURRENT_SOURCE_DIR} + ${CMAKE_CURRENT_SOURCE_DIR}/view + ${CMAKE_CURRENT_BINARY_DIR} ) +# Process viewer: +ADD_SUBDIRECTORY(view) + # additional preprocessor / compiler flags ADD_DEFINITIONS(${CAS_DEFINITIONS}) ADD_DEFINITIONS(${KERNEL_DEFINITIONS}) @@@ -79,14 -81,12 +86,14 @@@ SET(_other_HEADER PV_I.h PARAVIS_Gen_i.hh PV_Events.h - PV_Tools.h ) +IF(NOT SALOME_PARAVIS_MINIMAL_CORBA) + LIST(APPEND _other_HEADERS PV_Tools.h) +ENDIF() + # header files / to install - SET(PVGUI_HEADERS ${_moc_HEADERS} ${_other_HEADERS}) + SET(PVGUI_HEADERS ${_moc_HEADERS} ${_other_HEADERS} ${_ui_FORMS_HEADERS}) # --- resources --- @@@ -138,14 -138,15 +145,8 @@@ SET(_other_SOURCE PVGUI_Module.cxx PVGUI_Module_actions.cxx PVGUI_Module_widgets.cxx - # PVGUI_ViewManager.cxx - # PVGUI_ViewModel.cxx - # PVGUI_ViewWindow.cxx - # PVGUI_OutputWindowAdapter.cxx - PVGUI_ViewManager.cxx - PVGUI_ViewModel.cxx - PVGUI_ViewWindow.cxx - PVGUI_OutputWindowAdapter.cxx PVGUI_Tools.cxx PVGUI_ParaViewSettingsPane.cxx -- #PVGUI_MatplotlibMathTextUtilities.cxx - #PV_Tools.cxx - PARAVIS_Gen_i.cc - PV_Tools.cxx ) IF(NOT SALOME_PARAVIS_MINIMAL_CORBA) diff --cc src/PVGUI/PVGUI_Module.cxx index 8b570956,ecb3715e..d417e1a5 --- a/src/PVGUI/PVGUI_Module.cxx +++ b/src/PVGUI/PVGUI_Module.cxx @@@ -19,7 -19,7 +19,6 @@@ // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com // // File : PVGUI_Module.cxx --// Author : Julia DOROVSKIKH #include // E.A. must be included before Python.h to fix compilation on windows #ifdef HAVE_FINITE @@@ -28,11 -28,16 +27,12 @@@ #include // Python first #include "PVGUI_Module.h" -#include "SALOMEconfig.h" -#ifdef WITH_VISU -#include CORBA_CLIENT_HEADER(VISU_Gen) +#ifdef PARAVIS_WITH_FULL_CORBA +# include "PARAVIS_Gen_i.hh" #endif -#include CORBA_SERVER_HEADER(SALOMEDS) - - //#include "PV_Tools.h" -#include "PARAVIS_Gen_i.hh" - -#include "PV_Tools.h" ++#include CORBA_SERVER_HEADER(SALOME_ModuleCatalog) ++#include CORBA_SERVER_HEADER(SALOMEDS) #include "PVGUI_ViewModel.h" #include "PVGUI_ViewManager.h" @@@ -117,25 -119,54 +117,54 @@@ #include #include #include -#include #include #include - #include + //#include #include #include #include + #include + #include + #include + + #include + + #include +#include +#include +#include -#include CORBA_SERVER_HEADER(SALOME_ModuleCatalog) - -#include #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include #include + #include + #include + #include + #include + + #include + #include +#include - #include - - #include CORBA_SERVER_HEADER(SALOME_ModuleCatalog) + // Trace related + #include + #include + #include + #include //---------------------------------------------------------------------------- pqPVApplicationCore* PVGUI_Module::MyCoreApp = 0; @@@ -374,73 -367,123 +384,76 @@@ void PVGUI_Module::initialize( CAM_Appl pvInit(); // Create GUI elements (menus, toolbars, dock widgets) - //if ( !Implementation ){ - SalomeApp_Application* anApp = getApp(); - SUIT_Desktop* aDesktop = anApp->desktop(); + SalomeApp_Application* anApp = getApp(); + SUIT_Desktop* aDesktop = anApp->desktop(); - // connect(aDesktop, SIGNAL() + // Remember current state of desktop toolbars + QList foreignToolbars = aDesktop->findChildren(); - // Remember current state of desktop toolbars - QList foreignToolbars = aDesktop->findChildren(); + setupDockWidgets(); - // Simulate ParaView client main window - //Implementation = new pqImplementation( aDesktop ); + pvCreateActions(); + pvCreateToolBars(); + pvCreateMenus(); - setupDockWidgets(); - - pvCreateActions(); - pvCreateToolBars(); - pvCreateMenus(); - - QList activeDocks = aDesktop->findChildren(); - QList activeMenus = aDesktop->findChildren(); - - // new pqParaViewBehaviors(anApp->desktop(), this); - // Has to be replaced in order to exclude using of pqQtMessageHandlerBehaviour - // Start pqParaViewBehaviors - // Register ParaView interfaces. - //pqPluginManager* pgm = pqApplicationCore::instance()->getPluginManager(); - pqInterfaceTracker* pgm = pqApplicationCore::instance()->interfaceTracker(); - - // Register standard types of property widgets. - pgm->addInterface(new pqStandardPropertyWidgetInterface(pgm)); - // Register standard types of view-frame actions. - pgm->addInterface(new pqStandardViewFrameActionsImplementation(pgm)); - - // Load plugins distributed with application. - pqApplicationCore::instance()->loadDistributedPlugins(); - - // Define application behaviors. - //new pqQtMessageHandlerBehavior(this); - new pqDataTimeStepBehavior(this); - new pqSpreadSheetVisibilityBehavior(this); - new pqPipelineContextMenuBehavior(this); - new pqObjectPickingBehavior(this); - new pqDefaultViewBehavior(this); - new pqUndoRedoBehavior(this); - new pqAlwaysConnectedBehavior(this); - new pqCrashRecoveryBehavior(this); - new pqAutoLoadPluginXMLBehavior(this); - new pqPluginDockWidgetsBehavior(aDesktop); - new pqVerifyRequiredPluginBehavior(this); - new pqPluginActionGroupBehavior(aDesktop); - new pqFixPathsInStateFilesBehavior(this); - new pqCommandLineOptionsBehavior(this); - new pqPersistentMainWindowStateBehavior(aDesktop); - new pqCollaborationBehavior(this); - new pqViewStreamingBehavior(this); - new pqPluginSettingsBehavior(this); - - pqApplyBehavior* applyBehavior = new pqApplyBehavior(this); - foreach (pqPropertiesPanel* ppanel, aDesktop->findChildren()) - { - applyBehavior->registerPanel(ppanel); - } + QList activeDocks = aDesktop->findChildren(); + QList activeMenus = aDesktop->findChildren(); + PVGUI_Behaviors * behav = new PVGUI_Behaviors(this); + behav->instanciateAllBehaviors(aDesktop); - // Setup quick-launch shortcuts. - QShortcut *ctrlSpace = new QShortcut(Qt::CTRL + Qt::Key_Space, aDesktop); - QObject::connect(ctrlSpace, SIGNAL(activated()), - pqApplicationCore::instance(), SLOT(quickLaunch())); + // Setup quick-launch shortcuts. + QShortcut *ctrlSpace = new QShortcut(Qt::CTRL + Qt::Key_Space, aDesktop); + QObject::connect(ctrlSpace, SIGNAL(activated()), + pqApplicationCore::instance(), SLOT(quickLaunch())); - // Find Plugin Dock Widgets - QList currentDocks = aDesktop->findChildren(); - QList::iterator i; - for (i = currentDocks.begin(); i != currentDocks.end(); ++i) { - if(!activeDocks.contains(*i)) { - myDockWidgets[*i] = false; // hidden by default - (*i)->hide(); - } + // Find Plugin Dock Widgets + QList currentDocks = aDesktop->findChildren(); + QList::iterator i; + for (i = currentDocks.begin(); i != currentDocks.end(); ++i) { + if(!activeDocks.contains(*i)) { + myDockWidgets[*i] = false; // hidden by default + (*i)->hide(); } + } - // Find Plugin Menus - QList currentMenus = aDesktop->findChildren(); - QList::iterator im; - for (im = currentMenus.begin(); im != currentMenus.end(); ++im) { - if(!activeMenus.contains(*im)) { - myMenus.append(*im); - } - } + // Find Plugin Menus + // [ABN] TODO: fix this - triggers a SEGFAULT at deactivation() time. + // QList currentMenus = aDesktop->findChildren(); + // QList::iterator im; + // for (im = currentMenus.begin(); im != currentMenus.end(); ++im) { + // if(!activeMenus.contains(*im)) { + // QString s = (*im)->title(); + // std::cout << " MENU "<< s.toStdString() << std::endl; + // myMenus.append(*im); + // } + // } - SUIT_ResourceMgr* resMgr = SUIT_Session::session()->resourceMgr(); - QString aPath = resMgr->stringValue("resources", "PARAVIS", QString()); - if (!aPath.isNull()) { - MyCoreApp->loadConfiguration(aPath + QDir::separator() + "ParaViewFilters.xml"); - MyCoreApp->loadConfiguration(aPath + QDir::separator() + "ParaViewReaders.xml"); - MyCoreApp->loadConfiguration(aPath + QDir::separator() + "ParaViewSources.xml"); - MyCoreApp->loadConfiguration(aPath + QDir::separator() + "ParaViewWriters.xml"); - } - - // Force creation of engine - PARAVIS::GetParavisGen(this); - updateObjBrowser(); + SUIT_ResourceMgr* resMgr = SUIT_Session::session()->resourceMgr(); + QString aPath = resMgr->stringValue("resources", "PARAVIS", QString()); + if (!aPath.isNull()) { + MyCoreApp->loadConfiguration(aPath + QDir::separator() + "ParaViewFilters.xml"); + MyCoreApp->loadConfiguration(aPath + QDir::separator() + "ParaViewReaders.xml"); + MyCoreApp->loadConfiguration(aPath + QDir::separator() + "ParaViewSources.xml"); + MyCoreApp->loadConfiguration(aPath + QDir::separator() + "ParaViewWriters.xml"); + } + + // Force creation of the PARAVIS engine + GetEngine(); + updateObjBrowser(); - // Find created toolbars - QCoreApplication::processEvents(); + // Find created toolbars + QCoreApplication::processEvents(); - QList allToolbars = aDesktop->findChildren(); - foreach(QToolBar* aBar, allToolbars) { - if (!foreignToolbars.contains(aBar)) { - myToolbars[aBar] = true; - myToolbarBreaks[aBar] = false; - aBar->setVisible(false); - aBar->toggleViewAction()->setVisible(false); - } + QList allToolbars = aDesktop->findChildren(); + foreach(QToolBar* aBar, allToolbars) { + if (!foreignToolbars.contains(aBar)) { + myToolbars[aBar] = true; + myToolbarBreaks[aBar] = false; + aBar->setVisible(false); + aBar->toggleViewAction()->setVisible(false); } - //} + } updateMacros(); @@@ -620,67 -609,26 +633,15 @@@ void PVGUI_Module::onVariableChanged(pq } } - void PVGUI_Module::execPythonCommand(const QString& cmd, bool inSalomeConsole) - { - if ( inSalomeConsole ) { - if ( PyInterp_Dispatcher::Get()->IsBusy() ) return; - SalomeApp_Application* app = - dynamic_cast< SalomeApp_Application* >(SUIT_Session::session()->activeApplication()); - PyConsole_Console* pyConsole = app->pythonConsole(); - if (pyConsole) - pyConsole->exec(cmd); - } - else - { - SalomeApp_Application* app = - dynamic_cast< SalomeApp_Application* >(SUIT_Session::session()->activeApplication()); - PyConsole_Interp* pyInterp = app->pythonConsole()->getInterp(); - PyLockWrapper aGil; - pyInterp->run(cmd.toStdString().c_str()); - // pqPythonManager* manager = qobject_cast - // ( pqApplicationCore::instance()->manager( "PYTHON_MANAGER" ) ); - // if ( manager ) - // { - // pqPythonDialog* pyDiag = manager->pythonShellDialog(); - // if ( pyDiag ) - // { - // pqPythonShell* shell = pyDiag->shell(); - // if ( shell ) { - // shell->executeScript(cmd); - // } - // } - // } - } - } - /*! - \brief Launches a tracing of current server + \brief Initialisation timer event - fired only once, after the GUI loop is ready. + See creation in initialize(). */ -void PVGUI_Module::timerEvent(QTimerEvent* te ) +void PVGUI_Module::onInitTimer() { -//#ifndef WNT -// if ( PyInterp_Dispatcher::Get()->IsBusy() ) -// { -// // Reschedule for later -// MESSAGE("interpreter busy -> rescheduling trace start."); -// startTimer(500); -// } -// else -// { - MESSAGE("about to start trace...."); - startTrace(); - MESSAGE("trace STARTED...."); -// } - killTimer( te->timerId() ); -//#endif +#ifndef PARAVIS_WITH_FULL_CORBA + connectToExternalPVServer(); +#endif - - #ifndef WNT - // if ( PyInterp_Dispatcher::Get()->IsBusy() ) - // { - // // Reschedule for later - // MESSAGE("interpreter busy -> rescheduling trace start."); - // startTimer(500); - // } - // else - // { - MESSAGE("timerEvent(): About to start trace...."); - execPythonCommand("from paraview import smtrace;smtrace.start_trace()", false); - MESSAGE("timerEvent(): Trace STARTED...."); - // } - #endif - - MESSAGE("initialize(): Initializing PARAVIS's Python context ..."); - execPythonCommand("import paraview.servermanager as sm; sm.fromGUI=True", false); - MESSAGE("initialize(): Initialized."); } /*! diff --cc src/PVGUI/PVGUI_Module.h index e9becbde,9208709a..62d58427 --- a/src/PVGUI/PVGUI_Module.h +++ b/src/PVGUI/PVGUI_Module.h @@@ -225,13 -223,6 +227,10 @@@ private //! restore visibility of the common dockable windows (OB, PyConsole, ... etc.) void restoreCommonWindowsState(); - //! run Python command (either in SALOME's Python interpreter, or in ParaView's Python's interpreter) - void execPythonCommand(const QString& cmd, bool inSalomeConsole=false); - + //! Connect to the external PVServer, using the PARAVIS engine to launch it if it is not + //! already up. + bool connectToExternalPVServer(); + private slots: void showHelpForProxy( const QString&, const QString& ); diff --cc src/PVGUI/PVGUI_ParaViewSettingsPane.cxx index 6b524e3e,fb095ece..ac9e5431 --- a/src/PVGUI/PVGUI_ParaViewSettingsPane.cxx +++ b/src/PVGUI/PVGUI_ParaViewSettingsPane.cxx @@@ -23,170 -23,88 +23,79 @@@ // #include "PVGUI_ParaViewSettingsPane.h" - #include "ui_pqOptionsDialog.h" + #include "ui_pqCustomSettingsWidget.h" - #include - #include - #include - #include "pqApplicationCore.h" - #include "pqApplicationOptions.h" - #include "pqGlobalRenderViewOptions.h" - #include "pqPluginManager.h" - #include "pqViewOptionsInterface.h" - #include "pqInterfaceTracker.h" - - #include - #include - #include - #include - #include - - - class OptionsDialogModelItem - { - public: - OptionsDialogModelItem(); - OptionsDialogModelItem(const QString &name); - ~OptionsDialogModelItem(); - - OptionsDialogModelItem *Parent; - QString Name; - QList Children; - }; - - - class OptionsDialogModel : public QAbstractItemModel - { - public: - OptionsDialogModel(QObject *parent=0); - virtual ~OptionsDialogModel(); + #include - virtual int rowCount(const QModelIndex &parent=QModelIndex()) const; - virtual int columnCount(const QModelIndex &parent=QModelIndex()) const; - virtual QModelIndex index(int row, int column, - const QModelIndex &parent=QModelIndex()) const; - virtual QModelIndex parent(const QModelIndex &child) const; - - virtual QVariant data(const QModelIndex &index, - int role=Qt::DisplayRole) const; - - QModelIndex getIndex(const QString &path) const; - QString getPath(const QModelIndex &index) const; - void addPath(const QString &path); - bool removeIndex(const QModelIndex &index); - - private: - QModelIndex getIndex(OptionsDialogModelItem *item) const; + #include - private: - OptionsDialogModelItem *Root; - }; + #include "pqActiveObjects.h" + #include "pqApplicationCore.h" + #include "pqProxyWidget.h" + #include "pqSearchBox.h" + #include "pqServer.h" + #include "pqSettings.h" + #include "pqUndoStack.h" + #include "vtkNew.h" + #include "vtkPVXMLElement.h" + #include "vtkSmartPointer.h" + #include "vtkSMProperty.h" + #include "vtkSMPropertyHelper.h" + #include "vtkSMPropertyIterator.h" + #include "vtkSMProxy.h" + #include "vtkSMProxyIterator.h" + #include "vtkSMSessionProxyManager.h" + #include "vtkSMSettings.h" + + #include + #include + #include + #include + #include + #include + #include + #include - class OptionsDialogForm : public Ui::pqOptionsFrame -// This class is revisited to hack on the SALOME's Preferences "Default" button -// to ParaView's "Default" behavior. + class PVGUI_ParaViewSettingsPane::pqInternals { public: - OptionsDialogForm(); - ~OptionsDialogForm(); - pqInternals() - { - // Get the containing preference tab to identify when it has focus - - } - ~pqInternals(); - + Ui::CustomSettingsWidget Ui; - QMap Pages; - OptionsDialogModel *Model; - int ApplyUseCount; - //bool ApplyNeeded; + // Map from tab indices to stack widget indices. This is needed because there + // are more widgets in the stacked widgets than just what we add. + QMap TabToStackedWidgets; }; + bool PVGUI_ParaViewSettingsPane::ShowRestartRequired = false; //---------------------------------------------------------------------------- - OptionsDialogModelItem::OptionsDialogModelItem() - : Name(), Children() - { - this->Parent = 0; - } - - OptionsDialogModelItem::OptionsDialogModelItem(const QString &name) - : Name(name), Children() - { - this->Parent = 0; - } - - OptionsDialogModelItem::~OptionsDialogModelItem() - { - QList::Iterator iter = this->Children.begin(); - for( ; iter != this->Children.end(); ++iter) - { - delete *iter; - } - } - - - //---------------------------------------------------------------------------- - OptionsDialogModel::OptionsDialogModel(QObject *parentObject) - : QAbstractItemModel(parentObject) - { - this->Root = new OptionsDialogModelItem(); - } - - OptionsDialogModel::~OptionsDialogModel() - { - delete this->Root; - } - - int OptionsDialogModel::rowCount(const QModelIndex &parentIndex) const - { - OptionsDialogModelItem *item = this->Root; - if(parentIndex.isValid()) - { - item = reinterpret_cast( - parentIndex.internalPointer()); - } - - return item->Children.size(); - } - - int OptionsDialogModel::columnCount(const QModelIndex &) const - { - return 1; - } - - QModelIndex OptionsDialogModel::index(int row, int column, - const QModelIndex &parentIndex) const - { - OptionsDialogModelItem *item = this->Root; - if(parentIndex.isValid()) - { - item = reinterpret_cast( - parentIndex.internalPointer()); - } - - if(column == 0 && row >= 0 && row < item->Children.size()) - { - return this->createIndex(row, column, item->Children[row]); - } - - return QModelIndex(); - } - - QModelIndex OptionsDialogModel::parent(const QModelIndex &child) const - { - if(child.isValid()) - { - OptionsDialogModelItem *item = - reinterpret_cast(child.internalPointer()); - return this->getIndex(item->Parent); - } - - return QModelIndex(); - } - - QVariant OptionsDialogModel::data(const QModelIndex &idx, int role) const - { - if(idx.isValid()) + PVGUI_ParaViewSettingsPane::PVGUI_ParaViewSettingsPane(QWidget *widgetParent) + : QtxUserDefinedContent(widgetParent), + Internals (new PVGUI_ParaViewSettingsPane::pqInternals()) + { + Ui::CustomSettingsWidget &ui = this->Internals->Ui; + ui.setupUi(this); + ui.tabBar->setDocumentMode(false); + ui.tabBar->setDrawBase(false); + ui.tabBar->setExpanding(false); + ui.tabBar->setUsesScrollButtons(true); + + // Hide restart message + ui.restartRequiredLabel->setVisible(PVGUI_ParaViewSettingsPane::ShowRestartRequired); + + QList proxies_to_show; + + pqServer* server = pqActiveObjects::instance().activeServer(); + vtkNew iter; + iter->SetSession(server->session()); + iter->SetModeToOneGroup(); + for (iter->Begin("settings"); !iter->IsAtEnd(); iter->Next()) { - OptionsDialogModelItem *item = - reinterpret_cast(idx.internalPointer()); - if(role == Qt::DisplayRole || role == Qt::ToolTipRole) + vtkSMProxy* proxy = iter->GetProxy(); + if (proxy) { - return QVariant(item->Name); + proxies_to_show.push_back(proxy); } } diff --cc src/PVGUI/view/PVGUI_Behaviors.cxx index 9b3061e4,00000000..f03a5118 mode 100644,000000..100644 --- a/src/PVGUI/view/PVGUI_Behaviors.cxx +++ b/src/PVGUI/view/PVGUI_Behaviors.cxx @@@ -1,115 -1,0 +1,120 @@@ +// 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, 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 +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +// Lesser General Public License for more details. +// +// You should have received a copy of the GNU Lesser General Public +// License along with this library; if not, write to the Free Software +// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +// +// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com +// +// Author: Adrien Bruneton (CEA) + +#include "PVGUI_Behaviors.h" + +#include +#include + +#include +#include +#include - #include +#include ++#include ++#include + +#include +#include +#include +#include +#include +#include - #include +#include +#include +#include +#include +#include - #include +#include +#include - #include +#include +#include ++#include ++#include ++#include ++#include + +bool PVGUI_Behaviors::hasMinimalInstanciated = false; + +PVGUI_Behaviors::PVGUI_Behaviors(SalomeApp_Module * parent) + : QObject(static_cast(parent)) +{ +} + +/**! Instanciate minimal ParaView behaviors needed when using an instance of PVViewer. + * This method should be updated at each new version of ParaView with what is found in + * Qt/ApplicationComponents/pqParaViewBehaviors.cxx + */ +void PVGUI_Behaviors::instanciateMinimalBehaviors(SUIT_Desktop * desk) +{ + hasMinimalInstanciated = true; + + // Register ParaView interfaces. + pqInterfaceTracker* pgm = pqApplicationCore::instance()->interfaceTracker(); + - // * adds support for standard paraview views. - pgm->addInterface(new pqStandardViewModules(pgm)); ++ // Register standard types of property widgets. + pgm->addInterface(new pqStandardPropertyWidgetInterface(pgm)); ++ // Register standard types of view-frame actions. ++ pgm->addInterface(new pqStandardViewFrameActionsImplementation(pgm)); + + // Load plugins distributed with application. + pqApplicationCore::instance()->loadDistributedPlugins(); + - new pqViewFrameActionsBehavior(this); // button above the view port controlling selection and camera undos + new pqDefaultViewBehavior(this); // shows a 3D view as soon as a server connection is made + new pqAlwaysConnectedBehavior(this); // client always connected to a server - new pqPVNewSourceBehavior(this); // new source is made active, ... + new pqAutoLoadPluginXMLBehavior(this); // auto load plugins ++ new pqVerifyRequiredPluginBehavior(this); ++ new pqPluginSettingsBehavior(this); ++ new pqFixPathsInStateFilesBehavior(this); ++ new pqCrashRecoveryBehavior(this); ++ new pqCommandLineOptionsBehavior(this); +} + +/**! Instanciate usual ParaView behaviors. + * This method should be updated at each new version of ParaView with what is found in + * Qt/ApplicationComponents/pqParaViewBehaviors.cxx + */ +void PVGUI_Behaviors::instanciateAllBehaviors(SUIT_Desktop * desk) +{ + // "new pqParaViewBehaviors(anApp->desktop(), this);" + // -> (which loads all standard ParaView behaviors at once) has to be replaced in order to + // exclude using of pqQtMessageHandlerBehaviour + + // Define application behaviors. + if (!hasMinimalInstanciated) + instanciateMinimalBehaviors(desk); + //new pqQtMessageHandlerBehavior(this); // THIS ONE TO EXCLUDE !! see comment above + new pqDataTimeStepBehavior(this); + new pqSpreadSheetVisibilityBehavior(this); + new pqPipelineContextMenuBehavior(this); - new pqObjectPickingBehavior(this); // NEW in 4.1 - new pqDeleteBehavior(this); + new pqUndoRedoBehavior(this); - new pqCrashRecoveryBehavior(this); + new pqPluginDockWidgetsBehavior(desk); - //new pqVerifyRequiredPluginBehavior(this); + new pqPluginActionGroupBehavior(desk); - //new pqFixPathsInStateFilesBehavior(this); - new pqCommandLineOptionsBehavior(this); + new pqPersistentMainWindowStateBehavior(desk); + new pqObjectPickingBehavior(desk); + new pqCollaborationBehavior(this); - //new pqMultiServerBehavior(this); + new pqViewStreamingBehavior(this); + ++ pqApplyBehavior* applyBehavior = new pqApplyBehavior(this); ++ foreach (pqPropertiesPanel* ppanel, desk->findChildren()) ++ { ++ applyBehavior->registerPanel(ppanel); ++ } ++ +}