From: Cédric Aguerre Date: Thu, 23 Jul 2015 09:18:39 +0000 (+0200) Subject: medcalc and commands history X-Git-Tag: V8_0_0a1~5^2~38 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=31fbd900a7aac66178658382470dc233dc8b12ff;p=modules%2Fmed.git medcalc and commands history --- diff --git a/src/MEDOP/gui/DatasourceController.cxx b/src/MEDOP/gui/DatasourceController.cxx index 4b5b8cbf0..e4d2c57cc 100644 --- a/src/MEDOP/gui/DatasourceController.cxx +++ b/src/MEDOP/gui/DatasourceController.cxx @@ -477,7 +477,7 @@ void DatasourceController::OnChangeUnderlyingMeshInputValidated() { event->eventtype = DatasourceEvent::EVENT_IMPORT_OBJECT; XmedDataObject * dataObject = new XmedDataObject(); dataObject->setFieldHandler(*duplicate); - event->objectdata = dataObject; + event->objectdata = dataObject; emit datasourceSignal(event); // Note that this signal is processed by the WorkspaceController diff --git a/src/MEDOP/gui/WorkspaceController.cxx b/src/MEDOP/gui/WorkspaceController.cxx index 2f19a740a..36e620667 100644 --- a/src/MEDOP/gui/WorkspaceController.cxx +++ b/src/MEDOP/gui/WorkspaceController.cxx @@ -487,7 +487,7 @@ void WorkspaceController::processDatasourceEvent(const DatasourceEvent * event) } else if ( event->eventtype == DatasourceEvent::EVENT_VIEW_OBJECT_SCALAR_MAP ) { QStringList commands; - commands += QString("from medpresentation import MakeScalarMap"); + commands += QString("from medcalc import MakeScalarMap"); commands += QString("import MEDOP"); #define stringify( name ) # name @@ -500,13 +500,13 @@ void WorkspaceController::processDatasourceEvent(const DatasourceEvent * event) } else if ( event->eventtype == DatasourceEvent::EVENT_ADD_DATASOURCE ) { QStringList commands; - commands += QString("from medpresentation import LoadDataSource"); + commands += QString("from medcalc import LoadDataSource"); commands += QString("LoadDataSource('%1')").arg(event->objectalias); _consoleDriver->exec(commands); } else if ( event->eventtype == DatasourceEvent::EVENT_ADD_IMAGE_AS_DATASOURCE ) { QStringList commands; - commands += QString("from medpresentation import LoadImageAsDataSource"); + commands += QString("from medcalc import LoadImageAsDataSource"); commands += QString("LoadImageAsDataSource('%1')").arg(event->objectalias); _consoleDriver->exec(commands); } diff --git a/src/MEDOP/gui/XmedConsoleDriver.cxx b/src/MEDOP/gui/XmedConsoleDriver.cxx index 500879c1e..c98767915 100644 --- a/src/MEDOP/gui/XmedConsoleDriver.cxx +++ b/src/MEDOP/gui/XmedConsoleDriver.cxx @@ -67,9 +67,10 @@ void XmedConsoleDriver::setup() { /*! * This function sends the specified list of commands to the console. */ -void XmedConsoleDriver::exec(QStringList commands) { +void XmedConsoleDriver::exec(const QStringList& commands) { QStringListIterator it(commands); while (it.hasNext()) { _pyConsole->exec(it.next()); } + this->_history.append(commands); } diff --git a/src/MEDOP/gui/XmedConsoleDriver.hxx b/src/MEDOP/gui/XmedConsoleDriver.hxx index 11a18c953..365a8e224 100644 --- a/src/MEDOP/gui/XmedConsoleDriver.hxx +++ b/src/MEDOP/gui/XmedConsoleDriver.hxx @@ -16,7 +16,7 @@ // // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com // -// Author : Guillaume Boulant (EDF) +// Author : Guillaume Boulant (EDF) #ifndef XMEDCONSOLEDRIVER_HXX #define XMEDCONSOLEDRIVER_HXX @@ -28,17 +28,22 @@ #include "MEDOPGUI.hxx" +typedef QList CommandsHistory; + class MEDOPGUI_EXPORT XmedConsoleDriver { public: XmedConsoleDriver(SalomeApp_Application * application); void setup(); - void exec(QStringList commands); + void exec(const QStringList& commands); + + inline const CommandsHistory& getHistory() { return _history; } private: PyConsole_Console * _pyConsole; bool _importXmedDone; + CommandsHistory _history; }; #endif //XMEDCONSOLEDRIVER_HXX diff --git a/src/MEDOP/tui/CMakeLists.txt b/src/MEDOP/tui/CMakeLists.txt index 9e4b18ab7..734da38ad 100644 --- a/src/MEDOP/tui/CMakeLists.txt +++ b/src/MEDOP/tui/CMakeLists.txt @@ -18,4 +18,4 @@ # ADD_SUBDIRECTORY(xmedpy) -ADD_SUBDIRECTORY(medpresentation) +ADD_SUBDIRECTORY(presentation) diff --git a/src/MEDOP/tui/medpresentation/CMakeLists.txt b/src/MEDOP/tui/medpresentation/CMakeLists.txt deleted file mode 100644 index 04121212d..000000000 --- a/src/MEDOP/tui/medpresentation/CMakeLists.txt +++ /dev/null @@ -1,26 +0,0 @@ -# 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 - xmedimages.py - ) - -SALOME_INSTALL_SCRIPTS("${PYFILES_TO_INSTALL}" ${SALOME_INSTALL_PYTHON}/medpresentation) diff --git a/src/MEDOP/tui/medpresentation/__init__.py b/src/MEDOP/tui/medpresentation/__init__.py deleted file mode 100644 index 6f4106b15..000000000 --- a/src/MEDOP/tui/medpresentation/__init__.py +++ /dev/null @@ -1,23 +0,0 @@ -# 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 LoadImageAsDataSource - -from medpresentation import MakeScalarMap diff --git a/src/MEDOP/tui/medpresentation/medpresentation.py b/src/MEDOP/tui/medpresentation/medpresentation.py deleted file mode 100644 index 086b4d7a0..000000000 --- a/src/MEDOP/tui/medpresentation/medpresentation.py +++ /dev/null @@ -1,56 +0,0 @@ -# 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): - xmed.dataManager.loadDatasource(filename) - from xmed.fieldproxy import notifyGui_addsource - notifyGui_addsource(filename) -# - -def LoadImageAsDataSource(filename): - # get temp file name to generate med file from image - import tempfile - temp = tempfile.NamedTemporaryFile(suffix='.cfg') - medfilename = temp.name - temp.close() - - from xmedimages import FieldBuilder - builder = FieldBuilder() - builder.image2med(filename, medfilename) - LoadDataSource(medfilename) -# - -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)" - - print "viewMode:", viewMode, " [", type(viewMode), "]" - - params = MEDOP.ScalarMapParameters(proxy.id, viewMode) - __manager.MakeScalarMap(params) - -# diff --git a/src/MEDOP/tui/medpresentation/xmedimages.py b/src/MEDOP/tui/medpresentation/xmedimages.py deleted file mode 100644 index a08d6adc3..000000000 --- a/src/MEDOP/tui/medpresentation/xmedimages.py +++ /dev/null @@ -1,148 +0,0 @@ -# -*- coding: iso-8859-1 -*- -# 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 -# - -# Author : Guillaume Boulant (EDF) - -import MEDCoupling as MC -import MEDLoader as ML - -from PIL import Image -from PIL import ImageOps -import numpy - -class FieldBuilder: - - def image2med(self, imageFilepath, medFilepath=None): - - # Load the image file in a numpy array using PIL. - img=Image.open(imageFilepath) - imgbw=ImageOps.grayscale(img) - # WARN: We keep only the grayscale. Maybe, it could be usefull - # to get the RGB scales each on one component of the field. - - # Creating a cartesian mesh with a grid of the size of the image - # The sizes defined the number of pixel in a direction, then the - # number of cells to create in the mesh in that direction. - width,height=imgbw.size - mesh=self.createMesh("grid_%sx%s"%(width,height),width,height) - field=self.createField("imagefield",mesh,imgbw) - - # The MEDLoader can be used to save all the stuff in a med file. You - # just have to specify the field and the MEDLoader will save the - # underlying mesh. - createFromScratch=True - ML.MEDLoader.WriteField(medFilepath,field,createFromScratch) - - def createMesh(self, meshname, sizeX, sizeY): - """ - Creating a cartesian mesh with a grid of the size of the image. - sizeX and sizeY should be respectively the width and heigth of the - image. - """ - # >>> - # WARNING: remember the problem of tics and spaces. The data values - # are considered as values defined on cells. With size values in a - # direction, we have to create size+1 mesh nodes in that direction. - # <<< - - # The mesh is created using MEDCoupling - cmesh=MC.MEDCouplingCMesh.New(); - cmesh.setName(meshname) - - # We use an arbitrary step between cells (the value does not matter) - stepX = 0.1 - nbNodesX = sizeX+1 - arrX = [float(i * stepX) for i in range(nbNodesX)] - coordsX=MC.DataArrayDouble.New() - coordsX.setValues(arrX,nbNodesX,1) - - # For the Y dimension, we have to reverse the coordinates (the - # first pixel is at y=height and not at y=0). - stepY = 0.1 - nbNodesY = sizeY+1 - lengthY = sizeY*stepY - arrY=[float(lengthY - i * stepY) for i in range(nbNodesY)] - coordsY=MC.DataArrayDouble.New() - coordsY.setValues(arrY,nbNodesY,1) - - cmesh.setCoords(coordsX,coordsY) - print "Imagem mesh dimension: %d"%cmesh.getSpaceDimension() - - # WARN: In the current state of development of MEDLoader, only - # unstructured meshes are supported for writting function in med - # files. We just have to convert the cartesian mesh in an unstructured - # mesh before creating the field. - umesh=cmesh.buildUnstructured(); - umesh.setName(cmesh.getName()) - - return umesh - - def createField(self, fieldname, mesh, image): - """ - Creating a scalar field on the mesh using image data - """ - # Create the field using MEDCoupling - field = MC.MEDCouplingFieldDouble.New(MC.ON_CELLS,MC.ONE_TIME); - field.setName(fieldname); - field.setMesh(mesh); - # OPTIONAL: We set an arbitrary time step for test purpose - field.setIteration(0); - field.setOrder(0) - - imagedata=list(image.getdata()) - width,height=image.size - nbCells = width*height - dataArray=MC.DataArrayDouble.New(); - nbComponents=1 # For a scalar field - - dataArray.setValues(imagedata,nbCells,nbComponents) - field.setArray(dataArray); - - return field - -# -# =================================================================== -# use case functions -# =================================================================== -# - -def getTestImagePath(): - import os - MED_ROOT_DIR=os.environ["MED_ROOT_DIR"] - RESDIR=os.path.join(MED_ROOT_DIR, "share", "salome", "resources", "med", "medop_testfiles") - imgFileName="irm_test1.png" - imgFilePath=os.path.join(RESDIR,imgFileName) - return imgFilePath - -def TEST_pil(): - imgFilePath = getTestImagePath() - img=Image.open(imageFilepath) - imgbw=ImageOps.grayscale(img) - - -def TEST_image2med(): - imgFilePath = getTestImagePath() - builder = FieldBuilder() - builder.image2med(imgFilePath,"image.med") - -# =================================================================== -if __name__ == "__main__": - TEST_pil() - #TEST_image2med() diff --git a/src/MEDOP/tui/presentation/CMakeLists.txt b/src/MEDOP/tui/presentation/CMakeLists.txt new file mode 100644 index 000000000..6aba267cf --- /dev/null +++ b/src/MEDOP/tui/presentation/CMakeLists.txt @@ -0,0 +1,26 @@ +# 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 + medimages.py + ) + +SALOME_INSTALL_SCRIPTS("${PYFILES_TO_INSTALL}" ${SALOME_INSTALL_PYTHON}/medcalc) diff --git a/src/MEDOP/tui/presentation/__init__.py b/src/MEDOP/tui/presentation/__init__.py new file mode 100644 index 000000000..6f4106b15 --- /dev/null +++ b/src/MEDOP/tui/presentation/__init__.py @@ -0,0 +1,23 @@ +# 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 LoadImageAsDataSource + +from medpresentation import MakeScalarMap diff --git a/src/MEDOP/tui/presentation/medimages.py b/src/MEDOP/tui/presentation/medimages.py new file mode 100644 index 000000000..a08d6adc3 --- /dev/null +++ b/src/MEDOP/tui/presentation/medimages.py @@ -0,0 +1,148 @@ +# -*- coding: iso-8859-1 -*- +# 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 +# + +# Author : Guillaume Boulant (EDF) + +import MEDCoupling as MC +import MEDLoader as ML + +from PIL import Image +from PIL import ImageOps +import numpy + +class FieldBuilder: + + def image2med(self, imageFilepath, medFilepath=None): + + # Load the image file in a numpy array using PIL. + img=Image.open(imageFilepath) + imgbw=ImageOps.grayscale(img) + # WARN: We keep only the grayscale. Maybe, it could be usefull + # to get the RGB scales each on one component of the field. + + # Creating a cartesian mesh with a grid of the size of the image + # The sizes defined the number of pixel in a direction, then the + # number of cells to create in the mesh in that direction. + width,height=imgbw.size + mesh=self.createMesh("grid_%sx%s"%(width,height),width,height) + field=self.createField("imagefield",mesh,imgbw) + + # The MEDLoader can be used to save all the stuff in a med file. You + # just have to specify the field and the MEDLoader will save the + # underlying mesh. + createFromScratch=True + ML.MEDLoader.WriteField(medFilepath,field,createFromScratch) + + def createMesh(self, meshname, sizeX, sizeY): + """ + Creating a cartesian mesh with a grid of the size of the image. + sizeX and sizeY should be respectively the width and heigth of the + image. + """ + # >>> + # WARNING: remember the problem of tics and spaces. The data values + # are considered as values defined on cells. With size values in a + # direction, we have to create size+1 mesh nodes in that direction. + # <<< + + # The mesh is created using MEDCoupling + cmesh=MC.MEDCouplingCMesh.New(); + cmesh.setName(meshname) + + # We use an arbitrary step between cells (the value does not matter) + stepX = 0.1 + nbNodesX = sizeX+1 + arrX = [float(i * stepX) for i in range(nbNodesX)] + coordsX=MC.DataArrayDouble.New() + coordsX.setValues(arrX,nbNodesX,1) + + # For the Y dimension, we have to reverse the coordinates (the + # first pixel is at y=height and not at y=0). + stepY = 0.1 + nbNodesY = sizeY+1 + lengthY = sizeY*stepY + arrY=[float(lengthY - i * stepY) for i in range(nbNodesY)] + coordsY=MC.DataArrayDouble.New() + coordsY.setValues(arrY,nbNodesY,1) + + cmesh.setCoords(coordsX,coordsY) + print "Imagem mesh dimension: %d"%cmesh.getSpaceDimension() + + # WARN: In the current state of development of MEDLoader, only + # unstructured meshes are supported for writting function in med + # files. We just have to convert the cartesian mesh in an unstructured + # mesh before creating the field. + umesh=cmesh.buildUnstructured(); + umesh.setName(cmesh.getName()) + + return umesh + + def createField(self, fieldname, mesh, image): + """ + Creating a scalar field on the mesh using image data + """ + # Create the field using MEDCoupling + field = MC.MEDCouplingFieldDouble.New(MC.ON_CELLS,MC.ONE_TIME); + field.setName(fieldname); + field.setMesh(mesh); + # OPTIONAL: We set an arbitrary time step for test purpose + field.setIteration(0); + field.setOrder(0) + + imagedata=list(image.getdata()) + width,height=image.size + nbCells = width*height + dataArray=MC.DataArrayDouble.New(); + nbComponents=1 # For a scalar field + + dataArray.setValues(imagedata,nbCells,nbComponents) + field.setArray(dataArray); + + return field + +# +# =================================================================== +# use case functions +# =================================================================== +# + +def getTestImagePath(): + import os + MED_ROOT_DIR=os.environ["MED_ROOT_DIR"] + RESDIR=os.path.join(MED_ROOT_DIR, "share", "salome", "resources", "med", "medop_testfiles") + imgFileName="irm_test1.png" + imgFilePath=os.path.join(RESDIR,imgFileName) + return imgFilePath + +def TEST_pil(): + imgFilePath = getTestImagePath() + img=Image.open(imageFilepath) + imgbw=ImageOps.grayscale(img) + + +def TEST_image2med(): + imgFilePath = getTestImagePath() + builder = FieldBuilder() + builder.image2med(imgFilePath,"image.med") + +# =================================================================== +if __name__ == "__main__": + TEST_pil() + #TEST_image2med() diff --git a/src/MEDOP/tui/presentation/medpresentation.py b/src/MEDOP/tui/presentation/medpresentation.py new file mode 100644 index 000000000..6be27d541 --- /dev/null +++ b/src/MEDOP/tui/presentation/medpresentation.py @@ -0,0 +1,56 @@ +# 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): + xmed.dataManager.loadDatasource(filename) + from xmed.fieldproxy import notifyGui_addsource + notifyGui_addsource(filename) +# + +def LoadImageAsDataSource(filename): + # get temp file name to generate med file from image + import tempfile + temp = tempfile.NamedTemporaryFile(suffix='.cfg') + medfilename = temp.name + temp.close() + + from medimages import FieldBuilder + builder = FieldBuilder() + builder.image2med(filename, medfilename) + LoadDataSource(medfilename) +# + +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)" + + print "viewMode:", viewMode, " [", type(viewMode), "]" + + params = MEDOP.ScalarMapParameters(proxy.id, viewMode) + __manager.MakeScalarMap(params) + +#