MEDDataManager.idl
MEDCalculator.idl
MEDEventListener.idl
+ MEDPresentationManager.idl
MEDOPFactory.idl
)
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
-
#ifndef __MEDOPFactory_IDL_
#define __MEDOPFactory_IDL_
#include "SALOME_Exception.idl"
#include "MEDDataManager.idl"
#include "MEDCalculator.idl"
+#include "MEDPresentationManager.idl"
/*!
* This module contains the interface required for starting with MED
MEDOP::MEDDataManager getDataManager();
MEDOP::MEDCalculator getCalculator();
+ MEDOP::MEDPresentationManager getPresentationManager();
};
};
#endif
-
--- /dev/null
+// Copyright (C) 2005-2015 CEA/DEN, EDF R&D, OPEN CASCADE
+//
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+//
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// Lesser General Public License for more details.
+//
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+//
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//
+
+#ifndef __MED_PRESENTATION_MANAGER_IDL_
+#define __MED_PRESENTATION_MANAGER_IDL_
+
+#include "SALOME_GenericObj.idl"
+#include "MEDDataManager.idl"
+
+module MEDOP
+{
+
+ interface MEDPresentationManager : SALOME::GenericObj
+ {
+
+ void MakeScalarMap(in long fieldHandlerId, in string viewMode);
+
+ };
+
+};
+
+#endif
SET(MEDOPFactoryEngine_SOURCES
MEDDataManager_i.cxx
MEDCalculator_i.cxx
+ MEDPresentationManager_i.cxx
MEDOPFactory_i.cxx
)
+
SET(COMMON_LIBS
medloader
SalomeIDLMED
#include "MEDDataManager_i.hxx"
#include "MEDCalculator_i.hxx"
+#include "MEDPresentationManager_i.hxx"
using namespace std;
return medCalculatorPtr;
}
+MEDOP::MEDPresentationManager_ptr MEDOPFactory_i::getPresentationManager() {
+ MEDPresentationManager_i * manager = MEDPresentationManager_i::getInstance();
+ MEDOP::MEDPresentationManager_ptr managerPtr = manager->_this();
+ return managerPtr;
+}
+
extern "C"
{
PortableServer::ObjectId * MEDOPFactoryEngine_factory(
#include CORBA_SERVER_HEADER(MEDOPFactory)
#include CORBA_SERVER_HEADER(MEDDataManager)
#include CORBA_SERVER_HEADER(MEDCalculator)
+#include CORBA_SERVER_HEADER(MEDPresentationManager)
#include "SALOME_Component_i.hxx"
#include "MEDOP.hxx"
class MEDOP_EXPORT MEDOPFactory_i: public POA_MEDOP::MEDOPFactory,
public Engines_Component_i
{
-
+
public:
MEDOPFactory_i(CORBA::ORB_ptr orb,
PortableServer::POA_ptr poa,
MEDOP::MEDDataManager_ptr getDataManager();
/*! Returns the singleton instance of the calculator */
MEDOP::MEDCalculator_ptr getCalculator();
-
+ /*! Returns the singleton instance of the prsentation manager */
+ MEDOP::MEDPresentationManager_ptr getPresentationManager();
+
};
extern "C"
--- /dev/null
+// Copyright (C) 2011-2015 CEA/DEN, EDF R&D
+//
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+//
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// Lesser General Public License for more details.
+//
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+//
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//
+
+#include "MEDPresentationManager_i.hxx"
+#include "SALOME_KernelServices.hxx"
+#include "Basics_Utils.hxx"
+
+MEDPresentationManager_i* MEDPresentationManager_i::_instance = NULL;
+
+MEDPresentationManager_i*
+MEDPresentationManager_i::getInstance() {
+ if ( _instance == NULL )
+ _instance = new MEDPresentationManager_i();
+ return _instance;
+}
+
+MEDPresentationManager_i::MEDPresentationManager_i()
+{
+}
+
+MEDPresentationManager_i::~MEDPresentationManager_i()
+{
+}
+
+#include <iostream>
+
+void
+MEDPresentationManager_i::MakeScalarMap(CORBA::Long fieldHandlerId, const char* viewMode)
+{
+ //throw KERNEL::createSalomeException("Not implemented yet");
+ std::cout << "MEDPresentationManager_i::MakeScalarMap: Not implemented yet\n";
+}
--- /dev/null
+// Copyright (C) 2007-2015 CEA/DEN, EDF R&D
+//
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+//
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// Lesser General Public License for more details.
+//
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+//
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//
+
+#ifndef _MED_PRESENTATION_MANAGER_I_HXX_
+#define _MED_PRESENTATION_MANAGER_I_HXX_
+
+#include <SALOMEconfig.h>
+#include CORBA_SERVER_HEADER(MEDDataManager)
+#include CORBA_SERVER_HEADER(MEDPresentationManager)
+#include "SALOME_GenericObj_i.hh"
+
+#include "MEDDataManager_i.hxx"
+#include "MEDOP.hxx"
+
+class MEDOP_EXPORT MEDPresentationManager_i: public POA_MEDOP::MEDPresentationManager,
+ public SALOME::GenericObj_i
+{
+ public:
+
+ static MEDPresentationManager_i* getInstance();
+
+ void MakeScalarMap(CORBA::Long fieldHandlerId, const char*);
+
+ private:
+
+ MEDPresentationManager_i();
+ virtual ~MEDPresentationManager_i();
+
+ private :
+
+ // The MEDPresentationManager is a singleton, whose instance can be obtained
+ // using the getInstance static method.
+ static MEDPresentationManager_i * _instance;
+
+};
+
+#endif // _MED_PRESENTATION_MANAGER_I_HXX_
actionId = _salomeModule->createStandardAction(label,this,SLOT(OnExpandField()),icon);
_salomeModule->addActionInPopupMenu(actionId);
- // Create a control view
- label = tr("LAB_VISUALIZE");
+ // Create a view submenu with usual visualization functions
+ label = tr("LAB_VISUALIZE_SCALARMAP");
icon = tr("ICO_DATASOURCE_VIEW");
- actionId = _salomeModule->createStandardAction(label,this,SLOT(OnVisualize()),icon);
- _salomeModule->addActionInPopupMenu(actionId);
+ actionId = _salomeModule->createStandardAction(label,this,SLOT(OnVisualizeScalarMap()),icon);
+ _salomeModule->addActionInPopupMenu(actionId, tr("LAB_VISUALIZE"));
// Use in workspace
label = tr("LAB_USE_IN_WORKSPACE");
_salomeModule->updateObjBrowser(true);
}
-void DatasourceController::OnVisualize() {
- STDLOG("OnVisualize: To Be Implemented");
-
+void DatasourceController::visualize(DatasourceEvent::EventType eventType) {
// We need a _studyEditor updated on the active study
_studyEditor->updateActiveStudy();
}
DatasourceEvent * event = new DatasourceEvent();
- event->eventtype = DatasourceEvent::EVENT_VIEW_OBJECT;
+ event->eventtype = eventType;
XmedDataObject * dataObject = new XmedDataObject();
dataObject->setFieldHandler(*fieldHandler);
event->objectdata = dataObject;
emit datasourceSignal(event);
}
+}
+void DatasourceController::OnVisualizeScalarMap() {
+ this->visualize(DatasourceEvent::EVENT_VIEW_OBJECT_SCALAR_MAP);
}
void DatasourceController::OnUseInWorkspace() {
EVENT_IMPORT_OBJECT, // Simply import the object in the workspace
EVENT_USE_OBJECT, // Import in the workspace AND define a proxy
// variable in the tui console to use it
- EVENT_VIEW_OBJECT // View with a salome viewer (SMESH/VISU/PARAVIS)
+ EVENT_VIEW_OBJECT_SCALAR_MAP
};
int eventtype;
XmedDataObject * objectdata;
void OnAddDatasource();
void OnAddImagesource();
void OnExpandField();
- void OnVisualize();
+ void OnVisualizeScalarMap();
void OnUseInWorkspace();
void OnChangeUnderlyingMesh();
void OnInterpolateField();
+private:
+ void visualize(DatasourceEvent::EventType);
private:
StandardApp_Module * _salomeModule;
<source>LAB_EXPAND_FIELD</source>
<translation>Expand field timeseries</translation>
</message>
+ <message>
+ <source>LAB_VISUALIZE_SCALARMAP</source>
+ <translation>Scalar map</translation>
+ </message>
<message>
<location filename="MEDOP/gui/DatasourceController.cxx" line="69"/>
<source>LAB_VISUALIZE</source>
<source>LAB_EXPAND_FIELD</source>
<translation>Étendre les series temporelles du champ</translation>
</message>
+ <message>
+ <source>LAB_VISUALIZE_SCALARMAP</source>
+ <translation>Carte scalaire</translation>
+ </message>
<message>
<location filename="MEDOP/gui/DatasourceController.cxx" line="69"/>
<source>LAB_VISUALIZE</source>
askForOptions,
QCHARSTAR(event->objectalias));
}
- else if ( event->eventtype == DatasourceEvent::EVENT_VIEW_OBJECT ) {
+ else if ( event->eventtype == DatasourceEvent::EVENT_VIEW_OBJECT_SCALAR_MAP ) {
QStringList commands;
- commands+=QString("view(get(%1))").arg(dataObject->getFieldHandler()->id);
+ commands += QString("from medpresentation import MakeScalarMap");
+ QString viewMode = "view mode"; // :TODO: change this (get value from dedicated dialog)
+ MEDOP::FieldHandler* fieldHandler = dataObject->getFieldHandler();
+ commands += QString("MakeScalarMap(get(%1), '%2')").arg(fieldHandler->id).arg(viewMode);
_consoleDriver->exec(commands);
}
else {
#
ADD_SUBDIRECTORY(xmedpy)
+ADD_SUBDIRECTORY(medpresentation)
--- /dev/null
+# Copyright (C) 2012-2015 CEA/DEN, EDF R&D
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License, or (at your option) any later version.
+#
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+#
+# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+#
+
+SET(PYFILES_TO_INSTALL
+ __init__.py
+ medpresentation.py
+ )
+
+SALOME_INSTALL_SCRIPTS("${PYFILES_TO_INSTALL}" ${SALOME_INSTALL_PYTHON}/medpresentation)
--- /dev/null
+# Copyright (C) 2011-2015 CEA/DEN, EDF R&D
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License, or (at your option) any later version.
+#
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+#
+# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+#
+
+from medpresentation import LoadDataSource
+from medpresentation import MakeScalarMap
--- /dev/null
+# Copyright (C) 2011-2015 CEA/DEN, EDF R&D
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License, or (at your option) any later version.
+#
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+#
+# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+#
+
+import xmed
+import MEDOP
+import SALOME
+
+__manager = xmed.factory.getPresentationManager()
+
+def LoadDataSource(filename):
+ dataHandler = xmed.dataManager.addDatasource(filename)
+ print data
+ #return data
+#
+
+def MakeScalarMap(proxy, viewMode):
+ # 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)
+
+
+#