#include "PVViewer_EngineWrapper.h"
#include <Utils_SALOME_Exception.hxx>
+//#include <SalomeApp_Application.h>
+#include <SUIT_Session.h>
+
PVViewer_EngineWrapper * PVViewer_EngineWrapper::instance = NULL;
+PVViewer_EngineWrapper * PVViewer_EngineWrapper::GetInstance()
+{
+ if (!instance)
+ instance = new PVViewer_EngineWrapper();
+ return instance;
+}
+
+//static SalomeApp_Application* getApplication()
+//{
+// if ( SUIT_Session::session() )
+// return dynamic_cast<SalomeApp_Application*>( SUIT_Session::session()->activeApplication() );
+// return 0;
+//}
+//
+//PVViewer_EngineWrapper::PVViewer_EngineWrapper()
+//// : paravisEngine(NULL)
+//{
+// _component = getApplication()->lcc()->FindOrLoad_Component( "FactoryServer", "PARAVIS" );
+//}
+//
+//bool PVViewer_EngineWrapper::GetGUIConnected()
+//{
+// CORBA::Request_var req = _component->_request("GetGUIConnected");
+// req->set_return_type(CORBA::_tc_boolean);
+// req->invoke();
+// CORBA::Exception *exc =req->env()->exception();
+// if( exc )
+// throw SALOME_Exception("Unable to invoke PARAVIS engine!");
+// CORBA::Any & ret = req->return_value();
+// CORBA::Boolean bo;
+//
+// if (ret >>= bo)
+// return bool(bo);
+// else
+// throw SALOME_Exception("Unable to convert engine result!");
+//}
+//
+//void PVViewer_EngineWrapper::SetGUIConnected(bool isConnected)
+//{
+// CORBA::Request_var req = _component->_request("SetGUIConnected");
+// CORBA::Boolean arg = isConnected;
+// req->add_in_arg() <<= arg;
+// req->set_return_type(CORBA::_tc_void);
+// req->invoke();
+// CORBA::Exception *exc =req->env()->exception();
+// if( exc )
+// throw SALOME_Exception("Unable to invoke PARAVIS engine!");
+//}
+//
+//std::string PVViewer_EngineWrapper::FindOrStartPVServer(int port)
+//{
+// CORBA::Request_var req = _component->_request("FindOrStartPVServer");
+// CORBA::Long arg = port;
+// req->add_in_arg() <<= arg;
+// req->set_return_type(CORBA::_tc_string);
+// req->invoke();
+// CORBA::Exception *exc =req->env()->exception();
+// if( exc )
+// throw SALOME_Exception("Unable to invoke PARAVIS engine!");
+//
+// const char* ret;
+// if(req->return_value() >>= ret)
+// return std::string(ret);
+// else
+// throw SALOME_Exception("Unable to convert engine result!");
+//}
+
PVViewer_EngineWrapper::PVViewer_EngineWrapper() :
paravisEngine(NULL)
{
}
-PVViewer_EngineWrapper * PVViewer_EngineWrapper::GetInstance()
-{
- if (!instance)
- instance = new PVViewer_EngineWrapper();
- return instance;
-}
bool PVViewer_EngineWrapper::GetGUIConnected()
{