From 1db2d030906722076cc5ca1ee03a0ef65e4e7e60 Mon Sep 17 00:00:00 2001 From: Christophe Bourcier Date: Tue, 20 Oct 2020 16:32:23 +0200 Subject: [PATCH] Fix ELNO field treatment --- src/MEDCalc/cmp/MEDPresentation.cxx | 2 +- src/MEDCalc/test/tui/CMakeLists.txt | 1 + src/MEDCalc/test/tui/elno_field.py | 36 ++++++++++++++++++ .../test/tui/medfiles/portico_elno.med | Bin 0 -> 12586 bytes src/MEDCalc/test/tui/tests.set | 3 ++ 5 files changed, 41 insertions(+), 1 deletion(-) create mode 100644 src/MEDCalc/test/tui/elno_field.py create mode 100644 src/MEDCalc/test/tui/medfiles/portico_elno.med diff --git a/src/MEDCalc/cmp/MEDPresentation.cxx b/src/MEDCalc/cmp/MEDPresentation.cxx index 2018c7aa2..0a82cffd4 100644 --- a/src/MEDCalc/cmp/MEDPresentation.cxx +++ b/src/MEDCalc/cmp/MEDPresentation.cxx @@ -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(); diff --git a/src/MEDCalc/test/tui/CMakeLists.txt b/src/MEDCalc/test/tui/CMakeLists.txt index bcc02a6f6..fbcb7c105 100644 --- a/src/MEDCalc/test/tui/CMakeLists.txt +++ b/src/MEDCalc/test/tui/CMakeLists.txt @@ -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 index 000000000..69b6b7d1f --- /dev/null +++ b/src/MEDCalc/test/tui/elno_field.py @@ -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 index 0000000000000000000000000000000000000000..22d772523735999cf00d18de42ff3f8499e71d39 GIT binary patch literal 12586 zcmeGi3yf6N^}ZQ)c3lSfl%H6(Gk~&y!Y;c65#uns^JZsY=DlG)b^+;B0;^D{1lX3< z7D2022`cdu71UKpG_Dv-Osdv8G>X_tT8WCH*`P*RS3pcO3QF9bb3Zfh&3kY5b#|t4 zQ*QF!dG~+rIp>~p?s@n2P#`#@dR(=ms)~rz%hS|)R#L|+et7Tr-_%eb?(n>Q{_2I= zXQN{TwhYU}#tgs)=-qtjKYHL{7ZQ2X#SDiB!r;A|3V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k~I%6A@Qj=~{Qnw=P0uNbd{F38O8+!(p~TAZ(2Dpg4bjwya+xQKYRd=4F>{ Qbtw;5b}pTxKoJ!950X-T>;M1& literal 0 HcmV?d00001 diff --git a/src/MEDCalc/test/tui/tests.set b/src/MEDCalc/test/tui/tests.set index 03267553f..430ac9a64 100644 --- a/src/MEDCalc/test/tui/tests.set +++ b/src/MEDCalc/test/tui/tests.set @@ -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 ) -- 2.39.2