Salome HOME
Fix ELNO field treatment
authorChristophe Bourcier <christophe.bourcier@cea.fr>
Tue, 20 Oct 2020 14:32:23 +0000 (16:32 +0200)
committerChristophe Bourcier <christophe.bourcier@cea.fr>
Tue, 20 Oct 2020 14:32:23 +0000 (16:32 +0200)
src/MEDCalc/cmp/MEDPresentation.cxx
src/MEDCalc/test/tui/CMakeLists.txt
src/MEDCalc/test/tui/elno_field.py [new file with mode: 0644]
src/MEDCalc/test/tui/medfiles/portico_elno.med [new file with mode: 0644]
src/MEDCalc/test/tui/tests.set

index 2018c7aa24baf4a0747f501903427790cd4824e8..0a82cffd40443631a8bb42c32ecf0ad2164b3211 100644 (file)
@@ -333,7 +333,7 @@ MEDPresentation::createSource()
     {
       std::ostringstream oss, oss2;
       oss2 << "__srcObj" << GeneratePythonId();
-      oss << oss2.str() << " = pvs.ELNOMesh(Input=" << _srcObjVar << ");";
+      oss << oss2.str() << " = pvs.ELNOfieldToSurface(Input=" << _srcObjVar << ");";
       pushAndExecPyLine(oss.str()); oss.str("");
       // Now the source becomes the result of the CellDatatoPointData:
       _srcObjVar = oss2.str();
index bcc02a6f69b4c57696a1cf1e2f947c20b39f3b21..fbcb7c1050f2b1b9aa8e79ef7cd072a84af08678 100644 (file)
@@ -23,6 +23,7 @@ SET(_test_files
     medfiles/smooth_surface_and_field.med
     medfiles/agitateur.med
     medfiles/deplacements.med
+    medfiles/portico_elno.med
 )
 
 SET(TEST_INSTALL_DIRECTORY ${SALOME_FIELDS_INSTALL_TEST}/MEDCalc/tui)
diff --git a/src/MEDCalc/test/tui/elno_field.py b/src/MEDCalc/test/tui/elno_field.py
new file mode 100644 (file)
index 0000000..69b6b7d
--- /dev/null
@@ -0,0 +1,36 @@
+# Copyright (C) 2016-2020  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 os
+from time import sleep
+
+import medcalc
+medcalc.medconsole.setConsoleGlobals(globals())
+import MEDCALC
+from medcalc.medconsole import accessField
+
+from medcalc_testutils import GetMEDFileDirTUI
+
+datafile = os.path.join(GetMEDFileDirTUI(), "portico_elno.med")
+source_id = medcalc.LoadDataSource(datafile)
+
+presentation_id = medcalc.MakeScalarMap(accessField(0), MEDCALC.VIEW_MODE_REPLACE, colorMap=MEDCALC.COLOR_MAP_BLUE_TO_RED_RAINBOW)
+sleep(1)
+medcalc.RemovePresentation(presentation_id)
+sleep(1)
diff --git a/src/MEDCalc/test/tui/medfiles/portico_elno.med b/src/MEDCalc/test/tui/medfiles/portico_elno.med
new file mode 100644 (file)
index 0000000..22d7725
Binary files /dev/null and b/src/MEDCalc/test/tui/medfiles/portico_elno.med differ
index 03267553f6157c9203919644b2e1b307615f720b..430ac9a6480333aac029f985f36ca5a580e7a51f 100644 (file)
@@ -21,6 +21,8 @@ SET(TEST_NAMES
   access_API
   load_file
   import_pvsimple
+## These tests need a display to open a render window (paraview calls from python)
+## Uncomment these lines to add the tests to the test suite and run them manually
 #  scalar_map
 #  contour
 #  slices
@@ -28,4 +30,5 @@ SET(TEST_NAMES
 #  point_sprite
 #  vector_field
 #  deflection_shape
+#  elno_field
 )