-/*!
- \brief Static method, performs initialization of ParaView session.
- \param fullSetup whether to instanciate all behaviors or just the minimal ones.
- \return \c true if ParaView has been initialized successfully, otherwise false
-*/
-bool PVViewer_ViewManager::ParaviewInitApp(SUIT_Desktop * aDesktop, LogWindow * logWindow)
-{
- if ( ! MyCoreApp) {
- // Obtain command-line arguments
- int argc = 0;
- char** argv = 0;
- QString aOptions = getenv("PARAVIEW_OPTIONS");
- QStringList aOptList = aOptions.split(":", QString::SkipEmptyParts);
- argv = new char*[aOptList.size() + 1];
- QStringList args = QApplication::arguments();
- argv[0] = (args.size() > 0)? strdup(args[0].toLatin1().constData()) : strdup("paravis");
- argc++;
-
- foreach (QString aStr, aOptList) {
- argv[argc] = strdup( aStr.toLatin1().constData() );
- argc++;
- }
- MyCoreApp = new pqPVApplicationCore (argc, argv);
- if (MyCoreApp->getOptions()->GetHelpSelected() ||
- MyCoreApp->getOptions()->GetUnknownArgument() ||
- MyCoreApp->getOptions()->GetErrorMessage() ||
- MyCoreApp->getOptions()->GetTellVersion()) {
- return false;
- }
-
- // Direct VTK log messages to our SALOME window - TODO: review this
- PVViewer_LogWindowAdapter * w = PVViewer_LogWindowAdapter::New();
- w->setLogWindow(logWindow);
- vtkOutputWindow::SetInstance(w);
-
- new pqTabbedMultiViewWidget(); // registers a "MULTIVIEW_WIDGET" on creation
-
- for (int i = 0; i < argc; i++)
- free(argv[i]);
- delete[] argv;
- }
- // Initialize GUI elements if needed:
- PVViewer_GUIElements::GetInstance(aDesktop);
- return true;
-}
-
-void PVViewer_ViewManager::ParaviewInitBehaviors(bool fullSetup, SUIT_Desktop* aDesktop)
-{
- if (!ParaviewBehaviors)
- ParaviewBehaviors = new PVViewer_Behaviors(aDesktop);
-
- if(fullSetup)
- ParaviewBehaviors->instanciateAllBehaviors(aDesktop);
- else
- ParaviewBehaviors->instanciateMinimalBehaviors(aDesktop);
-}
-
-void PVViewer_ViewManager::ParaviewLoadConfigurations(bool force)
-{
- if (!ConfigLoaded || force)
- {
- SUIT_ResourceMgr* resMgr = SUIT_Session::session()->resourceMgr();
- QString aPath = resMgr->stringValue("resources", "PVViewer", QString());
- if (!aPath.isNull()) {
- MyCoreApp->loadConfiguration(aPath + QDir::separator() + "ParaViewFilters.xml");
- MyCoreApp->loadConfiguration(aPath + QDir::separator() + "ParaViewSources.xml");
- }
- ConfigLoaded = true;
- }
-}
-
-void PVViewer_ViewManager::ParaviewCleanup()