PVViewer_ViewWindow.h
PVViewer_Behaviors.h
PVViewer_GUIElements.h
+ PVViewer_InitSingleton.h
)
# header files / no moc processing
PVViewer_Behaviors.cxx
PVViewer_GUIElements.cxx
PVViewer_Core.cxx
+ PVViewer_InitSingleton.cxx
)
# sources / to compile
char** argv = 0;
QString aOptions = getenv("PARAVIEW_OPTIONS");
QStringList aOptList = aOptions.split(":", QString::SkipEmptyParts);
- argv = new char*[aOptList.size() + 1];
+ argv = new char*[aOptList.size() + 2];
QStringList args = QApplication::arguments();
argv[0] = (args.size() > 0)? strdup(args[0].toLatin1().constData()) : strdup("paravis");
argc++;
argv[argc] = strdup( aStr.toLatin1().constData() );
argc++;
}
+ argv[argc++] = strdup("--multi-servers");
MyCoreApp = new pqPVApplicationCore (argc, argv);
if (MyCoreApp->getOptions()->GetHelpSelected() ||
MyCoreApp->getOptions()->GetUnknownArgument() ||
--- /dev/null
+// Copyright (C) 2017 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 : Anthony GEAY (EDF R&D)
+
+#include "PVViewer_InitSingleton.h"
+#include "PVViewer_Core.h"
+#include "PVViewer_ViewManager.h"
+
+bool PVViewer_InitSingleton::IS_INIT=false;
+
+void PVViewer_InitSingleton::Init(QMainWindow *aDesktop, LogWindow *logWindow)
+{
+ if(IS_INIT)
+ return ;
+ PVViewer_Core::ParaviewInitApp(aDesktop,logWindow);
+ // Finish ParaView set up: behaviors, connection and configurations.
+ const QString configPath(PVViewer_ViewManager::GetPVConfigPath());
+ PVViewer_Core::ParaviewInitBehaviors(true,aDesktop);
+ PVViewer_ViewManager::ConnectToExternalPVServer(aDesktop);
+ PVViewer_Core::ParaviewLoadConfigurations(configPath);
+ IS_INIT=true;
+}
--- /dev/null
+// Copyright (C) 2017 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 : Anthony GEAY (EDF R&D)
+
+#ifndef __PVVIEWER_INITSINGLETON_H__
+#define __PVVIEWER_INITSINGLETON_H__
+
+#include "PVViewer.h"
+
+class QMainWindow;
+class LogWindow;
+
+/**
+ * This class deals with initialization of SALOME_Session to make it a PV based application.
+ * The initialization must be done only once.
+ * It allows multi initializator ParaView visu modules other than PARAVIS.
+ */
+class PVVIEWER_EXPORT PVViewer_InitSingleton
+{
+public:
+ static void Init(QMainWindow *aDesktop, LogWindow *logWindow);
+private:
+ static bool IS_INIT;
+};
+
+#endif /* SRC_PVVIEWER_PVVIEWER_CORE_H_ */
#include "PVViewer_ViewModel.h"
#include "PVViewer_GUIElements.h"
#include "PVViewer_Core.h"
+#include "PVViewer_InitSingleton.h"
#include "PVServer_ServiceWrapper.h"
#include <utilities.h>
setTitle( tr( "PARAVIEW_VIEW_TITLE" ) );
// Initialize minimal paraview stuff (if not already done)
- PVViewer_Core::ParaviewInitApp(desk, logWindow);
+ PVViewer_InitSingleton::Init(desk, logWindow);
connect( desk, SIGNAL( windowActivated( SUIT_ViewWindow* ) ),
this, SLOT( onWindowActivated( SUIT_ViewWindow* ) ) );
// This is mandatory, see setParent() method in Qt 4 documentation
myPVMgr->show();
setCentralWidget( myPVMgr );
-
- // Finish ParaView set up: behaviors, connection and configurations.
- const QString configPath(PVViewer_ViewManager::GetPVConfigPath());
- PVViewer_Core::ParaviewInitBehaviors(true, theDesktop);
- PVViewer_ViewManager::ConnectToExternalPVServer(theDesktop);
- PVViewer_Core::ParaviewLoadConfigurations(configPath);
-
// Hide toolbars
PVViewer_GUIElements * pvge = PVViewer_GUIElements::GetInstance(myDesktop);
pvge->setToolBarVisible(false);