#include <QDockWidget>
#include <QHelpEngine>
+// Paraview includes
+#include <vtkPVConfig.h> // for symbol PARAVIEW_VERSION
+#include <vtkProcessModule.h>
+#include <vtkPVSession.h>
+#include <vtkPVProgressHandler.h>
+#include <vtkOutputWindow.h>
+#include <vtkEventQtSlotConnect.h>
+#include <vtkNew.h>
+#include <vtkSMProxy.h>
+#include <vtkSmartPointer.h>
+#include <vtkSMSession.h>
+#include <vtkSMTrace.h>
+#include <vtkSMSessionProxyManager.h>
+#include <vtkSMParaViewPipelineController.h>
+
#include <pqApplicationCore.h>
- #include <pqPVApplicationCore.h>
+ //#include <pqPVApplicationCore.h>
#include <pqActiveView.h>
#include <pqObjectBuilder.h>
#include <pqOptions.h>
#include <pqServerConnectReaction.h>
#include <pqServerDisconnectReaction.h>
-#include <pqServerManagerObserver.h>
-#include <vtkClientServerInterpreterInitializer.h>
-#include <vtkPVConfig.h>
-
-#include <PARAVIS_version.h>
-
-#include CORBA_SERVER_HEADER(SALOME_ModuleCatalog)
-
//----------------------------------------------------------------------------
- pqPVApplicationCore* PVGUI_Module::MyCoreApp = 0;
-
PVGUI_Module* ParavisModule = 0;
- PARAVIS_ORB::PARAVIS_Gen_var PVGUI_Module::myEngine;
-
/*!
\mainpage
}
}
}
-
- connect(&pqActiveObjects::instance(),
- SIGNAL(representationChanged(pqRepresentation*)),
- this, SLOT(onRepresentationChanged(pqRepresentation*)));
}
- bool PVGUI_Module::connectToExternalPVServer()
- {
- pqServer* server = pqActiveObjects::instance().activeServer();
- if (server && server->isRemote())
- {
- // Already connected to an external server, do nothing
- MESSAGE("connectToExternalPVServer(): Already connected to an external PVServer, won't reconnect.");
- return false;
- }
-
- std::stringstream msg;
-
- // Try to connect to the external PVServer - gives priority to an externally specified URL:
- QString serverUrlEnv = getenv("PARAVIS_PVSERVER_URL");
- std::string serverUrl;
- if (!serverUrlEnv.isEmpty())
- serverUrl = serverUrlEnv.toStdString();
- else
- {
- // Get the URL from the engine (possibly starting the pvserver)
- CORBA::String_var url = GetEngine()->FindOrStartPVServer(0); // take the first free port
- serverUrl = (char *)url;
- }
-
- msg << "connectToExternalPVServer(): Trying to connect to the external PVServer '" << serverUrl << "' ...";
- MESSAGE(msg.str());
-
- if (!pqServerConnectReaction::connectToServer(pqServerResource(serverUrl.c_str())))
- {
- std::stringstream msg2;
- msg2 << "Error while connecting to the requested pvserver '" << serverUrl;
- msg2 << "'. Might use default built-in connection instead!" << std::endl;
- qWarning(msg2.str().c_str()); // will go to the ParaView console (see ParavisMessageOutput below)
- SUIT_MessageBox::warning( getApp()->desktop(),
- QString("Error connecting to PVServer"), QString(msg2.str().c_str()));
- return false;
- }
- else
- MESSAGE("connectToExternalPVServer(): Connected!");
- return true;
- }
-
void PVGUI_Module::onStartProgress()
{
QApplication::setOverrideCursor(Qt::WaitCursor);
}
}
-///*!
-// \brief Returns IOR of current engine
-//*/
-//QString PVGUI_Module::engineIOR() const
-//{
-// CORBA::String_var anIOR = GetEngine()->GetIOR();
-// return QString(anIOR.in());
-//}
-
+/*!
+ \brief Returns IOR of current engine
+*/
+QString PVGUI_Module::engineIOR() const
+{
+ CORBA::String_var anIOR = GetEngine()->GetIOR();
+ return QString(anIOR.in());
+}
-
/*!
\brief Open file of format supported by ParaView
*/
virtual void initialize( CAM_Application* );
virtual void windows( QMap<int, int>& ) const;
- // pqTabbedMultiViewWidget* getMultiViewManager() const;
-
-// virtual QString engineIOR() const;
+ virtual QString engineIOR() const;
void openFile(const char* theName);
void executeScript(const char *script);
//! restore visibility of the common dockable windows (OB, PyConsole, ... etc.)
void restoreCommonWindowsState();
- //! Connect to the external PVServer, using the PARAVIS engine to launch it if it is not
- //! already up.
- bool connectToExternalPVServer();
- //! run Python command (either in SALOME's Python interpreter, or in ParaView's Python's interpreter)
- void execPythonCommand(const QString& cmd, bool inSalomeConsole=false);
--
private slots:
void showHelpForProxy( const QString&, const QString& );