module MEDOP
{
+ enum MEDPresentationViewMode {
+ VIEW_MODE_OVERLAP,
+ VIEW_MODE_REPLACE,
+ VIEW_MODE_NEW_LAYOUT,
+ VIEW_MODE_SPLIT_VIEW
+ };
+
+ struct ScalarMapParameters {
+ long fieldHandlerId;
+ MEDPresentationViewMode viewMode;
+ };
+
interface MEDPresentationManager : SALOME::GenericObj
{
- void MakeScalarMap(in long fieldHandlerId, in string viewMode);
+ void MakeScalarMap(in ScalarMapParameters params);
};
//
#include "MEDPresentationManager_i.hxx"
-#include "SALOME_KernelServices.hxx"
-#include "Basics_Utils.hxx"
MEDPresentationManager_i* MEDPresentationManager_i::_instance = NULL;
#include <iostream>
void
-MEDPresentationManager_i::MakeScalarMap(CORBA::Long fieldHandlerId, const char* viewMode)
+MEDPresentationManager_i::MakeScalarMap(const MEDOP::ScalarMapParameters& params)
{
- //throw KERNEL::createSalomeException("Not implemented yet");
+ std::cout << "View mode: " << params.viewMode << std::endl;
std::cout << "MEDPresentationManager_i::MakeScalarMap: Not implemented yet\n";
}
static MEDPresentationManager_i* getInstance();
- void MakeScalarMap(CORBA::Long fieldHandlerId, const char*);
+ void MakeScalarMap(const MEDOP::ScalarMapParameters&);
private:
else if ( event->eventtype == DatasourceEvent::EVENT_VIEW_OBJECT_SCALAR_MAP ) {
QStringList commands;
commands += QString("from medpresentation import MakeScalarMap");
- QString viewMode = "view mode"; // :TODO: change this (get value from dedicated dialog)
+ commands += QString("import MEDOP");
+
+#define stringify( name ) # name
+ QString viewMode = stringify(MEDOP::VIEW_MODE_NEW_LAYOUT); // :TODO: change this (get value from dedicated dialog)
+ viewMode.replace("::", ".");
+
MEDOP::FieldHandler* fieldHandler = dataObject->getFieldHandler();
- commands += QString("MakeScalarMap(get(%1), '%2')").arg(fieldHandler->id).arg(viewMode);
+ commands += QString("MakeScalarMap(get(%1), %2)").arg(fieldHandler->id).arg(viewMode);
_consoleDriver->exec(commands);
}
else {
notifyGui_addsource(filename)
#
-def MakeScalarMap(proxy, viewMode):
+def MakeScalarMap(proxy, viewMode=MEDOP.VIEW_MODE_REPLACE):
# Create the presentation instance in CORBA engine
# The engine in turn creates the ParaView pipeline elements
print "In MakeScalarMap (Python)"
- __manager.MakeScalarMap(proxy.id, viewMode)
+ print "viewMode:", viewMode, " [", type(viewMode), "]"
+
+ params = MEDOP.ScalarMapParameters(proxy.id, viewMode);
+ __manager.MakeScalarMap(params)
#