void setProperty(const std::string& propName, const std::string& propValue);
const std::string getProperty(const std::string& propName) const;
+ void activateView() const;
+
protected:
typedef std::pair<int, PyObject *> PyObjectId;
void pushAndExecPyLine(const std::string & lin);
MEDPresentation::TypeID getID() const { return _fieldHandlerId; }
+ long getPyViewID() const { return _renderViewPyId; }
static int GeneratePythonId();
#include "PVViewer_GUIElements.h"
#endif
+#include "MEDFactoryClient.hxx"
+#include "MEDPresentationManager_i.hxx"
+
#include <sstream>
#include <pqAnimationManager.h>
//! The only instance of the reference to engine
-MED_ORB::MED_Gen_var MEDModule::myEngine;
+MED_ORB::MED_Gen_var MEDModule::_MED_engine;
+//! The only instance of the MEDPresentationManager
+MEDCALC::MEDPresentationManager_ptr MEDModule::_presManager;
MEDModule::MEDModule() :
SalomeApp_Module("MED"), _studyEditor(0),
MEDModule::engine()
{
init(); // initialize engine, if necessary
- return myEngine;
+ return _MED_engine;
}
void
MEDModule::init()
{
// initialize MED module engine (load, if necessary)
- if ( CORBA::is_nil( myEngine ) ) {
+ if ( CORBA::is_nil( _MED_engine ) ) {
Engines::EngineComponent_var comp =
SalomeApp_Application::lcc()->FindOrLoad_Component( "FactoryServer", "MED" );
- myEngine = MED_ORB::MED_Gen::_narrow( comp );
+ _MED_engine = MED_ORB::MED_Gen::_narrow( comp );
}
+
+ // Retrieve MEDFactory to get MEDPresentationManager (sometimes
+ if ( ! _presManager ) {
+ _presManager = MEDFactoryClient::getFactory()->getPresentationManager();
+ }
}
void
MEDModule::engineIOR() const
{
init(); // initialize engine, if necessary
- CORBA::String_var anIOR = getApp()->orb()->object_to_string( myEngine.in() );
+ CORBA::String_var anIOR = getApp()->orb()->object_to_string( _MED_engine.in() );
return QString( anIOR.in() );
}
bool
MEDModule::activateModule( SUIT_Study* theStudy )
{
- if ( CORBA::is_nil( myEngine ) )
+ if ( CORBA::is_nil( _MED_engine ) )
return false;
// call parent implementation
if (!itemClickGeneric(index, name, fieldId, presId))
return;
- STDLOG("Presentation selection (should activate view): NOT IMPLEMENTED YET");
- STDLOG(" Presention infos:");
+ STDLOG("Presentation selection (activate view)");
std::ostringstream oss;
oss << fieldId << " / " << presId;
STDLOG(" - Field id / pres id: " + oss.str());
STDLOG(" - Presentation name: " + name);
- // TODO: activate corresponding view
-
+ _presManager->activateView(presId);
}
void
class SalomeApp_Application;
class PVViewer_GUIElements;
+class MEDPresentationManager_i;
/*!
* This class defines the gui of the MED module.
XmedDataModel* _xmedDataModel;
PresentationController* _presentationController;
ProcessingController* _processingController;
- static MED_ORB::MED_Gen_var myEngine;
PVViewer_GUIElements* _pvGuiElements;
+
+ static MED_ORB::MED_Gen_var _MED_engine;
+
+ // GUI needs to talk directly to the pres manager to activate a view, get some params, etc ...:
+ static MEDCALC::MEDPresentationManager_ptr _presManager;
};
#endif