From 2e5a1f374e70be225365f86fd1927a22f249492b Mon Sep 17 00:00:00 2001 From: rnv Date: Wed, 10 Feb 2016 15:19:01 +0300 Subject: [PATCH] Update tests to ParaView 5.0 (merge from master) --- src/PV_SWIG/presentations.py | 42 +++++----- test/VisuPrs/CMakeLists.txt | 6 +- test/VisuPrs/CutLines/CMakeLists.txt | 7 +- test/VisuPrs/CutLines/F7.py | 35 --------- test/VisuPrs/CutPlanes/CMakeLists.txt | 2 +- test/VisuPrs/CutPlanes/F7.py | 35 --------- test/VisuPrs/DeformedShape/CMakeLists.txt | 2 +- test/VisuPrs/DeformedShape/F7.py | 35 --------- test/VisuPrs/GaussPoints/C5.py | 59 -------------- test/VisuPrs/GaussPoints/CMakeLists.txt | 2 +- test/VisuPrs/ImportMedField/B3.py | 29 ------- test/VisuPrs/ImportMedField/CMakeLists.txt | 2 +- test/VisuPrs/IsoSurfaces/CMakeLists.txt | 2 +- test/VisuPrs/IsoSurfaces/F7.py | 35 --------- test/VisuPrs/MeshPresentation/CMakeLists.txt | 2 +- test/VisuPrs/MeshPresentation/F7.py | 35 --------- test/VisuPrs/Plot3D/CMakeLists.txt | 2 +- test/VisuPrs/Plot3D/F7.py | 35 --------- test/VisuPrs/SWIG_scripts/A5.py | 3 +- test/VisuPrs/SWIG_scripts/A9.py | 2 +- test/VisuPrs/SWIG_scripts/B6.py | 5 +- test/VisuPrs/SWIG_scripts/B7.py | 5 +- test/VisuPrs/SWIG_scripts/C6.py | 3 +- test/VisuPrs/SWIG_scripts/C7.py | 7 +- test/VisuPrs/ScalarMap/CMakeLists.txt | 2 +- test/VisuPrs/ScalarMap/F7.py | 35 --------- test/VisuPrs/ScalarMap/G2.py | 28 +++++-- .../ScalarMap_On_DeformedShape/CMakeLists.txt | 2 +- test/VisuPrs/ScalarMap_On_DeformedShape/F7.py | 35 --------- test/VisuPrs/StreamLines/B3.py | 2 +- test/VisuPrs/StreamLines/B4.py | 8 +- test/VisuPrs/StreamLines/CMakeLists.txt | 2 +- test/VisuPrs/StreamLines/F7.py | 36 --------- test/VisuPrs/StreamLines/F9.py | 2 +- test/VisuPrs/StreamLines/G0.py | 2 +- test/VisuPrs/Util/paravistest.py | 20 +++++ test/VisuPrs/Vectors/CMakeLists.txt | 2 +- test/VisuPrs/Vectors/F7.py | 35 --------- test/VisuPrs/bugs/C4.py | 67 ---------------- test/VisuPrs/bugs/C7.py | 64 --------------- test/VisuPrs/bugs/CMakeLists.txt | 6 +- test/VisuPrs/bugs/D0.py | 78 ------------------- test/VisuPrs/bugs/D1.py | 46 ++++++++--- test/VisuPrs/bugs/D5.py | 7 +- test/VisuPrs/dump_study/A0.py | 18 ++++- test/VisuPrs/dump_study/A1.py | 18 ++++- test/VisuPrs/dump_study/A2.py | 17 +++- test/VisuPrs/dump_study/A3.py | 23 ++++-- test/VisuPrs/dump_study/A4.py | 18 ++++- test/VisuPrs/dump_study/A5.py | 17 +++- test/VisuPrs/dump_study/A6.py | 17 +++- test/VisuPrs/dump_study/A7.py | 12 ++- test/VisuPrs/dump_study/A8.py | 31 +++++--- test/VisuPrs/dump_study/A9.py | 14 +++- test/VisuPrs/dump_study/B0.py | 11 ++- test/VisuPrs/dump_study/B3.py | 9 ++- test/VisuPrs/dump_study/B4.py | 10 ++- test/VisuPrs/dump_study/CMakeLists.txt | 2 +- test/VisuPrs/imps/A1.py | 7 +- 59 files changed, 332 insertions(+), 763 deletions(-) delete mode 100644 test/VisuPrs/CutLines/F7.py delete mode 100755 test/VisuPrs/CutPlanes/F7.py delete mode 100755 test/VisuPrs/DeformedShape/F7.py delete mode 100644 test/VisuPrs/GaussPoints/C5.py delete mode 100644 test/VisuPrs/ImportMedField/B3.py delete mode 100644 test/VisuPrs/IsoSurfaces/F7.py delete mode 100644 test/VisuPrs/MeshPresentation/F7.py delete mode 100644 test/VisuPrs/Plot3D/F7.py delete mode 100644 test/VisuPrs/ScalarMap/F7.py delete mode 100755 test/VisuPrs/ScalarMap_On_DeformedShape/F7.py delete mode 100644 test/VisuPrs/StreamLines/F7.py delete mode 100644 test/VisuPrs/Vectors/F7.py delete mode 100644 test/VisuPrs/bugs/C4.py delete mode 100644 test/VisuPrs/bugs/C7.py delete mode 100644 test/VisuPrs/bugs/D0.py diff --git a/src/PV_SWIG/presentations.py b/src/PV_SWIG/presentations.py index 8680f5d1..b795657c 100644 --- a/src/PV_SWIG/presentations.py +++ b/src/PV_SWIG/presentations.py @@ -972,7 +972,6 @@ def get_group_mesh_name(full_group_name): group_name = full_group_name.split('/')[1] return group_name - def get_group_entity(full_group_name): """Return entity type of the group by its full name.""" aList = full_group_name.split('/') @@ -1123,7 +1122,7 @@ def ScalarMapOnField(proxy, entity, field_name, timestamp_nb, lookup_table.RGBPoints = [data_range[0], 0, 0, 1, data_range[1], 1, 0, 0] # Set properties - scalarmap.ColorArrayName = (EntityType.get_pvtype(entity), field_name) + pvs.ColorBy(scalarmap, (EntityType.get_pvtype(entity), field_name)) scalarmap.LookupTable = lookup_table # Add scalar bar @@ -1214,7 +1213,7 @@ def CutPlanesOnField(proxy, entity, field_name, timestamp_nb, lookup_table.RGBPoints = [data_range[0], 0, 0, 1, data_range[1], 1, 0, 0] # Set properties - cut_planes.ColorArrayName = (EntityType.get_pvtype(entity), field_name) + pvs.ColorBy(cut_planes, (EntityType.get_pvtype(entity), field_name)) cut_planes.LookupTable = lookup_table # Add scalar bar @@ -1361,7 +1360,7 @@ def CutLinesOnField(proxy, entity, field_name, timestamp_nb, lookup_table.RGBPoints = [data_range[0], 0, 0, 1, data_range[1], 1, 0, 0] # Set properties - cut_lines.ColorArrayName = (EntityType.get_pvtype(entity), field_name) + pvs.ColorBy(cut_lines, (EntityType.get_pvtype(entity), field_name)) cut_lines.LookupTable = lookup_table # Set wireframe represenatation mode @@ -1440,7 +1439,7 @@ def CutSegmentOnField(proxy, entity, field_name, timestamp_nb, lookup_table.RGBPoints = [data_range[0], 0, 0, 1, data_range[1], 1, 0, 0] # Set properties - cut_segment.ColorArrayName = (EntityType.get_pvtype(entity), field_name) + pvs.ColorBy(cut_segment, (EntityType.get_pvtype(entity), field_name)) cut_segment.LookupTable = lookup_table # Set wireframe represenatation mode @@ -1563,9 +1562,9 @@ def VectorsOnField(proxy, entity, field_name, timestamp_nb, # Set properties if (is_colored): - vectors.ColorArrayName = (EntityType.get_pvtype(entity), 'GlyphVector') + pvs.ColorBy(vectors, (EntityType.get_pvtype(entity), 'GlyphVector')) else: - vectors.ColorArrayName = (None, '') + pvs.ColorBy(vectors, (EntityType.get_pvtype(entity), None)) vectors.LookupTable = lookup_table vectors.LineWidth = 1.0 @@ -1667,9 +1666,9 @@ def DeformedShapeOnField(proxy, entity, field_name, # Set properties if is_colored: - defshape.ColorArrayName = (EntityType.get_pvtype(entity), field_name) + pvs.ColorBy(defshape, (EntityType.get_pvtype(entity), field_name)) else: - defshape.ColorArrayName = (None, '') + pvs.ColorBy(defshape, (EntityType.get_pvtype(entity), None)) defshape.LookupTable = lookup_table # Set wireframe represenatation mode @@ -1790,7 +1789,7 @@ def DeformedShapeAndScalarMapOnField(proxy, entity, field_name, lookup_table.RGBPoints = [data_range[0], 0, 0, 1, data_range[1], 1, 0, 0] # Set properties - defshapemap.ColorArrayName = (EntityType.get_pvtype(scalar_field_entity), scalar_field) + pvs.ColorBy(defshapemap, (EntityType.get_pvtype(scalar_field_entity), scalar_field)) defshapemap.LookupTable = lookup_table # Add scalar bar @@ -1965,7 +1964,7 @@ def Plot3DOnField(proxy, entity, field_name, timestamp_nb, lookup_table.RGBPoints = [data_range[0], 0, 0, 1, data_range[1], 1, 0, 0] # Set properties - plot3d.ColorArrayName = (EntityType.get_pvtype(entity), field_name) + pvs.ColorBy(plot3d, (EntityType.get_pvtype(entity), field_name)) plot3d.LookupTable = lookup_table # Add scalar bar @@ -2046,7 +2045,7 @@ def IsoSurfacesOnField(proxy, entity, field_name, timestamp_nb, if (scalar_range is None): scalar_range = get_data_range(proxy, entity, field_name, cut_off=True) - + # Get contour values for the range surfaces = get_contours(scalar_range, nb_surfaces) @@ -2073,9 +2072,9 @@ def IsoSurfacesOnField(proxy, entity, field_name, timestamp_nb, # Set display properties if (is_colored): - isosurfaces.ColorArrayName = (EntityType.get_pvtype(entity), field_name) + pvs.ColorBy(isosurfaces, (EntityType.get_pvtype(entity), field_name)) else: - isosurfaces.ColorArrayName = (None, '') + pvs.ColorBy(isosurfaces, (EntityType.get_pvtype(entity), None)) if color: isosurfaces.DiffuseColor = color isosurfaces.LookupTable = lookup_table @@ -2202,9 +2201,9 @@ def GaussPointsOnField(proxy, entity, field_name, # Set display properties if is_colored: - gausspnt.ColorArrayName = (EntityType.get_pvtype(entity), field_name) + pvs.ColorBy(gausspnt, (EntityType.get_pvtype(entity), field_name)) else: - gausspnt.ColorArrayName = (None, '') + pvs.ColorBy(gausspnt, (EntityType.get_pvtype(entity), None)) if color: gausspnt.DiffuseColor = color @@ -2340,9 +2339,9 @@ def GaussPointsOnField1(proxy, entity, field_name, # Set display properties if is_colored: - gausspnt.ColorArrayName = (EntityType.get_pvtype(entity), field_name) + pvs.ColorBy(gausspnt, (EntityType.get_pvtype(entity), field_name)) else: - gausspnt.ColorArrayName = (None, '') + pvs.ColorBy(gausspnt, (EntityType.get_pvtype(entity), None)) if color: gausspnt.DiffuseColor = color @@ -2475,6 +2474,7 @@ def StreamLinesOnField(proxy, entity, field_name, timestamp_nb, stream.Vectors = ['POINTS', vector_array] stream.IntegrationDirection = direction stream.IntegratorType = 'Runge-Kutta 2' + stream.SeedType = 'High Resolution Line Source' stream.UpdatePipeline() # Get Stream Lines representation object @@ -2499,9 +2499,9 @@ def StreamLinesOnField(proxy, entity, field_name, timestamp_nb, # Set properties if is_colored: - streamlines.ColorArrayName = (EntityType.get_pvtype(entity), field_name) + pvs.ColorBy(streamlines, (EntityType.get_pvtype(entity), field_name)) else: - streamlines.ColorArrayName = (None, '') + pvs.ColorBy(streamlines, (EntityType.get_pvtype(entity), None)) if color: streamlines.DiffuseColor = color @@ -2583,7 +2583,7 @@ def MeshOnGroup(proxy, extrGroups, group_name): if nb_points or nb_cells: # prs = pvs.GetRepresentation(proxy) prs = pvs.Show() - prs.ColorArrayName = '' + prs.ColorArrayName = (None, '') display_only(prs) return prs diff --git a/test/VisuPrs/CMakeLists.txt b/test/VisuPrs/CMakeLists.txt index 2e2a8852..2924c599 100644 --- a/test/VisuPrs/CMakeLists.txt +++ b/test/VisuPrs/CMakeLists.txt @@ -51,12 +51,14 @@ SET(TEST_DIRECTORIES GaussPoints StreamLines SWIG_scripts - Tables +# Tables table reader is not used anymore and CSVReader +# doesn't suport txt and xls formats, so switch off Tables tests ImportMedField united bugs imps - dump_study +# dump_study Save trace functionality of ParaView is now working +# as expected: switch off dump_study tests until it will be corrected. ) FOREACH(test_dir ${TEST_DIRECTORIES}) diff --git a/test/VisuPrs/CutLines/CMakeLists.txt b/test/VisuPrs/CutLines/CMakeLists.txt index 4b2b7230..4c1af770 100644 --- a/test/VisuPrs/CutLines/CMakeLists.txt +++ b/test/VisuPrs/CutLines/CMakeLists.txt @@ -20,7 +20,7 @@ SET(BASE_TESTS A0 B0 E0 F1 G0) SET(ALL_TESTS A0 A1 A2 A3 A4 A5 A6 A7 A8 A9 B0 B1 B2 E0 E1 E2 E3 E4 E5 E6 E7 E8 E9 - F1 F2 F3 F4 F5 F6 F7 F8 F9 G0 G1 G2) + F1 F2 F3 F4 F5 F6 F8 F9 G0 G1 G2) # For make test IF(SALOME_PARAVIS_ALL_TEST) @@ -37,6 +37,11 @@ FOREACH(tfile ${TEST_NAMES}) SET_TESTS_PROPERTIES(${TEST_NAME} PROPERTIES ENVIRONMENT "${tests_env}") ENDFOREACH() +IF(SALOME_PARAVIS_ALL_TEST) + # Increase timeout for specific tests + SET_TESTS_PROPERTIES(CUTLINES_F4 PROPERTIES TIMEOUT 5000) +ENDIF() + # Application tests SET(APPLICATION_TESTS ${ALL_TESTS}) SET(TEST_INSTALL_DIRECTORY ${SALOME_INSTALL_SCRIPT_SCRIPTS}/test/VisuPrs/CutLines) diff --git a/test/VisuPrs/CutLines/F7.py b/test/VisuPrs/CutLines/F7.py deleted file mode 100644 index 95bdfb5f..00000000 --- a/test/VisuPrs/CutLines/F7.py +++ /dev/null @@ -1,35 +0,0 @@ -# Copyright (C) 2010-2016 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 -# - -# This case corresponds to: /visu/CutLines/F7 case -# Create Cut Lines for all data of the given MED file - -import sys -from paravistest import datadir, pictureext, get_picture_dir -from presentations import CreatePrsForFile, PrsTypeEnum - -# Directory for saving snapshots -picturedir = get_picture_dir("CutLines/F7") - -file = datadir + "occ4050.med" -print " --------------------------------- " -print "file ", file -print " --------------------------------- " -print "CreatePrsForFile..." -CreatePrsForFile(file, [PrsTypeEnum.CUTLINES], picturedir, pictureext) diff --git a/test/VisuPrs/CutPlanes/CMakeLists.txt b/test/VisuPrs/CutPlanes/CMakeLists.txt index 5ef54666..3e7ab3d8 100644 --- a/test/VisuPrs/CutPlanes/CMakeLists.txt +++ b/test/VisuPrs/CutPlanes/CMakeLists.txt @@ -20,7 +20,7 @@ SET(BASE_TESTS A0 B0 E0 F1 G0) SET(ALL_TESTS A0 A1 A2 A3 A4 A5 A6 A7 A8 A9 B0 B1 B2 B3 E0 E1 E2 E3 E4 E5 E6 E7 E8 E9 - F1 F2 F3 F4 F5 F6 F7 F8 F9 G0 G1 G2) + F1 F2 F3 F4 F5 F6 F8 F9 G0 G1 G2) # For make test IF(SALOME_PARAVIS_ALL_TEST) diff --git a/test/VisuPrs/CutPlanes/F7.py b/test/VisuPrs/CutPlanes/F7.py deleted file mode 100755 index e51b293b..00000000 --- a/test/VisuPrs/CutPlanes/F7.py +++ /dev/null @@ -1,35 +0,0 @@ -# Copyright (C) 2010-2016 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 -# - -# This case corresponds to: /visu/CutPlanes/F7 case -# Create Cut Planes for all data of the given MED file - -import sys -from paravistest import datadir, pictureext, get_picture_dir -from presentations import CreatePrsForFile, PrsTypeEnum - -# Directory for saving snapshots -picturedir = get_picture_dir("CutPlanes/F7") - -file = datadir + "occ4050.med" -print " --------------------------------- " -print "file ", file -print " --------------------------------- " -print "CreatePrsForFile..." -CreatePrsForFile(file, [PrsTypeEnum.CUTPLANES], picturedir, pictureext) diff --git a/test/VisuPrs/DeformedShape/CMakeLists.txt b/test/VisuPrs/DeformedShape/CMakeLists.txt index 415250fe..7058456e 100644 --- a/test/VisuPrs/DeformedShape/CMakeLists.txt +++ b/test/VisuPrs/DeformedShape/CMakeLists.txt @@ -19,7 +19,7 @@ SET(BASE_TESTS A0 B0 E0 F1) SET(ALL_TESTS A0 A1 A2 A3 A4 A5 A6 A7 A8 A9 B0 B1 B2 B3 B4 - E0 E1 E2 E3 E4 E5 E6 E7 E8 E9 F1 F2 F3 F4 F5 F6 F7 F8 F9) + E0 E1 E2 E3 E4 E5 E6 E7 E8 E9 F1 F2 F3 F4 F5 F6 F8 F9) # For make test IF(SALOME_PARAVIS_ALL_TEST) diff --git a/test/VisuPrs/DeformedShape/F7.py b/test/VisuPrs/DeformedShape/F7.py deleted file mode 100755 index f267319f..00000000 --- a/test/VisuPrs/DeformedShape/F7.py +++ /dev/null @@ -1,35 +0,0 @@ -# Copyright (C) 2010-2016 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 -# - -# This case corresponds to: /visu/DeformedShape/F7 case -# Create Deformed Shape for all data of the given MED file - -import sys -from paravistest import datadir, pictureext, get_picture_dir -from presentations import CreatePrsForFile, PrsTypeEnum - -# Directory for saving snapshots -picturedir = get_picture_dir("DeformedShape/F7") - -file = datadir + "occ4050.med" -print " --------------------------------- " -print "file ", file -print " --------------------------------- " -print "CreatePrsForFile..." -CreatePrsForFile(file, [PrsTypeEnum.DEFORMEDSHAPE], picturedir, pictureext) diff --git a/test/VisuPrs/GaussPoints/C5.py b/test/VisuPrs/GaussPoints/C5.py deleted file mode 100644 index 98682623..00000000 --- a/test/VisuPrs/GaussPoints/C5.py +++ /dev/null @@ -1,59 +0,0 @@ -# Copyright (C) 2010-2016 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 -# - -# This case corresponds to: /visu/GaussPoints/C5 case -# Create Gauss Points on the field of the MED file - -import os -import sys - -from paravistest import datadir, pictureext, get_picture_dir -from presentations import GaussPointsOnField, EntityType, get_time, process_prs_for_test -import pvsimple - -# Directory for saving snapshots -picturedir = get_picture_dir("GaussPoints/C5") -if not picturedir.endswith(os.sep): - picturedir += os.sep - -# MED file -file_name = datadir + "occ4050.med" -field_name = "champ_reel" -timestamp_nb = -1 # last timestamp - -pvsimple.OpenDataFile(file_name) -med_reader = pvsimple.GetActiveSource() -if med_reader is None: - raise RuntimeError("File wasn't imported!!!") - -# Create Gauss Points presentation -print "BREAKPOINT_1" - -prs = GaussPointsOnField(med_reader, EntityType.CELL, field_name, timestamp_nb) -if prs is None: - raise RuntimeError, "Created presentation is None!!!" - -print "BREAKPOINT_2" - -# Display presentation and get snapshot -view = pvsimple.GetRenderView() -time = get_time(med_reader, timestamp_nb) - -pic_name = picturedir + field_name + "_" + str(time) + "_GAUSSPOINTS." + pictureext -process_prs_for_test(prs, view, pic_name) diff --git a/test/VisuPrs/GaussPoints/CMakeLists.txt b/test/VisuPrs/GaussPoints/CMakeLists.txt index 74acce32..71f42a89 100644 --- a/test/VisuPrs/GaussPoints/CMakeLists.txt +++ b/test/VisuPrs/GaussPoints/CMakeLists.txt @@ -19,7 +19,7 @@ SET(BASE_TESTS A2 B0 C0) SET(ALL_TESTS A0 A1 A3 A4 A5 A6 A7 A9 B0 B1 B2 B3 B4 B5 B6 B7 B8 B9 - C0 C1 C2 C3 C4 C5 C6 C7 C8 C9) + C0 C1 C2 C3 C4 C6 C7 C8 C9) # For make test IF(SALOME_PARAVIS_ALL_TEST) diff --git a/test/VisuPrs/ImportMedField/B3.py b/test/VisuPrs/ImportMedField/B3.py deleted file mode 100644 index 93a0b12b..00000000 --- a/test/VisuPrs/ImportMedField/B3.py +++ /dev/null @@ -1,29 +0,0 @@ -# Copyright (C) 2010-2016 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 -# - -# This case corresponds to: /visu/ImportMedField/B3 case -# Import MED file; create presentations for the given fields. - -from paravistest import datadir, Import_Med_Field - -med_file = datadir + "zzzz121b.med" -field_names = ["RESUZERODEPL____________________", "RESUZEROERRE_ELGA_NORE__________", "RESUZEROSIEF_ELGA_DEPL__________", "RESUZEROSIGM_ELNO_DEPL__________"] -prs_list = [ [0,1,5,6,7], [0,1,5,6,7], [0,1,5,6,7], [0,1,5,6,7,9] ] - -Import_Med_Field(med_file, field_names, 1, prs_list) diff --git a/test/VisuPrs/ImportMedField/CMakeLists.txt b/test/VisuPrs/ImportMedField/CMakeLists.txt index 22e679b9..fdf638b1 100644 --- a/test/VisuPrs/ImportMedField/CMakeLists.txt +++ b/test/VisuPrs/ImportMedField/CMakeLists.txt @@ -18,7 +18,7 @@ # SET(BASE_TESTS A0 B0 C0) -SET(ALL_TESTS A0 A1 A2 A3 A4 A5 A6 A7 A8 A9 B0 B1 B2 B3 B4 B5 B6 B7 B8 B9 C0 C1 C2) +SET(ALL_TESTS A0 A1 A2 A3 A4 A5 A6 A7 A8 A9 B0 B1 B2 B4 B5 B6 B7 B8 B9 C0 C1 C2) # For make test IF(SALOME_PARAVIS_ALL_TEST) diff --git a/test/VisuPrs/IsoSurfaces/CMakeLists.txt b/test/VisuPrs/IsoSurfaces/CMakeLists.txt index 5a8241ba..60f392e7 100755 --- a/test/VisuPrs/IsoSurfaces/CMakeLists.txt +++ b/test/VisuPrs/IsoSurfaces/CMakeLists.txt @@ -19,7 +19,7 @@ SET(BASE_TESTS A0 B0 E1 F1) SET(ALL_TESTS A0 A1 A2 A3 A4 A5 A6 A7 A8 A9 B0 B1 B2 - E0 E1 E2 E3 E4 E5 E6 E7 E8 E9 F1 F2 F3 F4 F5 F6 F7 F8 F9 G0 G1 G2) + E0 E1 E2 E3 E4 E5 E6 E7 E8 E9 F1 F2 F3 F4 F5 F6 F8 F9 G0 G1 G2) # For make test IF(SALOME_PARAVIS_ALL_TEST) diff --git a/test/VisuPrs/IsoSurfaces/F7.py b/test/VisuPrs/IsoSurfaces/F7.py deleted file mode 100644 index c691bbd3..00000000 --- a/test/VisuPrs/IsoSurfaces/F7.py +++ /dev/null @@ -1,35 +0,0 @@ -# Copyright (C) 2010-2016 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 -# - -# This case corresponds to: /visu/IsoSurfaces/F7 case -# Create Iso Surface for all data of the given MED file - -import sys -from paravistest import datadir, pictureext, get_picture_dir -from presentations import CreatePrsForFile, PrsTypeEnum - -# Directory for saving snapshots -picturedir = get_picture_dir("IsoSurfaces/F7") - -file = datadir + "occ4050.med" -print " --------------------------------- " -print "file ", file -print " --------------------------------- " -print "CreatePrsForFile..." -CreatePrsForFile(file, [PrsTypeEnum.ISOSURFACES], picturedir, pictureext) diff --git a/test/VisuPrs/MeshPresentation/CMakeLists.txt b/test/VisuPrs/MeshPresentation/CMakeLists.txt index 39ea03f4..16ecedb7 100644 --- a/test/VisuPrs/MeshPresentation/CMakeLists.txt +++ b/test/VisuPrs/MeshPresentation/CMakeLists.txt @@ -19,7 +19,7 @@ SET(BASE_TESTS A0 B0 E2 F2 G3 H1 I0 J0 K1 L0) SET(ALL_TESTS A0 A1 A2 A3 A4 A5 A6 A7 A8 A9 B0 B1 B2 E0 E1 E2 E3 E4 E5 E6 E7 E8 E9 - F1 F2 F3 F4 F5 F6 F7 F8 F9 G0 G1 G3 G4 G5 G6 G7 G8 G9 + F1 F2 F3 F4 F5 F6 F8 F9 G0 G1 G3 G4 G5 G6 G7 G8 G9 H0 H1 H2 H3 H4 H5 H6 H7 H8 H9 I0 I1 I2 I3 I4 I5 I6 I7 I8 I9 J0 J1 J2 J3 J4 J5 J6 J7 J8 J9 K0 K1 K2 K3 K4 K5 K6 K7 K8 K9 L0 L1) diff --git a/test/VisuPrs/MeshPresentation/F7.py b/test/VisuPrs/MeshPresentation/F7.py deleted file mode 100644 index 4ef2e441..00000000 --- a/test/VisuPrs/MeshPresentation/F7.py +++ /dev/null @@ -1,35 +0,0 @@ -# Copyright (C) 2010-2016 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 -# - -# This case corresponds to: /visu/MeshPresentation/F7 case -# Create Mesh Presentation for all data of the given MED file - -import sys -from paravistest import datadir, pictureext, get_picture_dir -from presentations import CreatePrsForFile, PrsTypeEnum - -# Directory for saving snapshots -picturedir = get_picture_dir("MeshPresentation/F7") - -file = datadir + "occ4050.med" -print " --------------------------------- " -print "file ", file -print " --------------------------------- " -print "CreatePrsForFile..." -CreatePrsForFile(file, [PrsTypeEnum.MESH], picturedir, pictureext) diff --git a/test/VisuPrs/Plot3D/CMakeLists.txt b/test/VisuPrs/Plot3D/CMakeLists.txt index 2bd6cdfc..bcb5c8f6 100755 --- a/test/VisuPrs/Plot3D/CMakeLists.txt +++ b/test/VisuPrs/Plot3D/CMakeLists.txt @@ -19,7 +19,7 @@ SET(BASE_TESTS A1 B0 E0 F1 G0) SET(ALL_TESTS A0 A1 A2 A3 A4 A5 A6 A7 A8 A9 B0 B1 B2 E0 E1 E2 E3 E4 E5 E6 E7 E8 E9 - F1 F2 F3 F4 F5 F6 F7 F8 F9 G0 G1 G2) + F1 F2 F3 F4 F5 F6 F8 F9 G0 G1 G2) # For make test IF(SALOME_PARAVIS_ALL_TEST) diff --git a/test/VisuPrs/Plot3D/F7.py b/test/VisuPrs/Plot3D/F7.py deleted file mode 100644 index d48f7345..00000000 --- a/test/VisuPrs/Plot3D/F7.py +++ /dev/null @@ -1,35 +0,0 @@ -# Copyright (C) 2010-2016 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 -# - -# This case corresponds to: /visu/Plot3D/F7 case -# Create Plot3D for all data of the given MED file - -import sys -from paravistest import datadir, pictureext, get_picture_dir -from presentations import CreatePrsForFile, PrsTypeEnum - -# Directory for saving snapshots -picturedir = get_picture_dir("Plot3D/F7") - -file = datadir + "occ4050.med" -print " --------------------------------- " -print "file ", file -print " --------------------------------- " -print "CreatePrsForFile..." -CreatePrsForFile(file, [PrsTypeEnum.PLOT3D], picturedir, pictureext) diff --git a/test/VisuPrs/SWIG_scripts/A5.py b/test/VisuPrs/SWIG_scripts/A5.py index 8fefc133..cb8edcc8 100644 --- a/test/VisuPrs/SWIG_scripts/A5.py +++ b/test/VisuPrs/SWIG_scripts/A5.py @@ -69,7 +69,8 @@ if cur_view: pvsimple.Delete(cur_view) xy_view = pvsimple.CreateXYPlotView() xy_view.ChartTitle = 'Very useful data' -xy_view.AxisTitle = ['[ Wt ]', 'Frequency [ Hz ]'] +xy_view.BottomAxisTitle = '[ Wt ]' +xy_view.LeftAxisTitle = 'Frequency [ Hz ]' xy_rep = pvsimple.Show(ps) xy_rep.AttributeType = 'Row Data' diff --git a/test/VisuPrs/SWIG_scripts/A9.py b/test/VisuPrs/SWIG_scripts/A9.py index 52dc5b0e..e597187c 100644 --- a/test/VisuPrs/SWIG_scripts/A9.py +++ b/test/VisuPrs/SWIG_scripts/A9.py @@ -58,7 +58,7 @@ pvs.Render() # Load MED reader plugin pv_root_dir = os.getenv("PARAVIS_ROOT_DIR") -pvs.LoadPlugin(pv_root_dir + "/lib/paraview/libMedReaderPlugin.so") +pvs.LoadPlugin(pv_root_dir + "/lib/paraview/libMEDReaderPlugin.so") # Import MED file med_file = datadir + "pointe.med" diff --git a/test/VisuPrs/SWIG_scripts/B6.py b/test/VisuPrs/SWIG_scripts/B6.py index c6f57735..20dcca05 100644 --- a/test/VisuPrs/SWIG_scripts/B6.py +++ b/test/VisuPrs/SWIG_scripts/B6.py @@ -98,7 +98,8 @@ if cur_view: xy_view1 = pvsimple.CreateXYPlotView() xy_view1.ChartTitle = 'TEST table of real' -xy_view1.AxisTitle = ['[ Wt ]', 'Row 0 [ Hz ]'] +xy_view1.BottomAxisTitle = '[ Wt ]' +xy_view1.LeftAxisTitle = 'Row 0 [ Hz ]' # Display curves for the table of real tr_rep = pvsimple.Show(ps_tr) @@ -124,7 +125,7 @@ tr_rep.SeriesColor = ['Row 10', '0.2', '0.2', '0.9'] # Create another chart line view xy_view2 = pvsimple.CreateXYPlotView() xy_view2.ChartTitle = 'TEST table of integer' -xy_view2.AxisTitle = ['', 'FR [ m/h ]'] +xy_view2.LeftAxisTitle = 'FR [ m/h ]' # Display curves for the table of integer ti_rep = pvsimple.Show(ps_ti, xy_view2) diff --git a/test/VisuPrs/SWIG_scripts/B7.py b/test/VisuPrs/SWIG_scripts/B7.py index 6dce141a..a425c443 100644 --- a/test/VisuPrs/SWIG_scripts/B7.py +++ b/test/VisuPrs/SWIG_scripts/B7.py @@ -48,9 +48,8 @@ title = xy_view.ChartTitle xy_view.ChartTitle = "Change the title from python" pvsimple.Render(xy_view) -axis_title = xy_view.AxisTitle -xy_view.AxisTitle[0] = "Y axis" -xy_view.AxisTitle[1] = "X axis" +xy_view.LeftAxisTitle = "Y axis" +xy_view.BottomAxisTitle = "X axis" pvsimple.Render(xy_view) xy_view.ShowLegend = 0 diff --git a/test/VisuPrs/SWIG_scripts/C6.py b/test/VisuPrs/SWIG_scripts/C6.py index 1e6d4d05..5dea829b 100644 --- a/test/VisuPrs/SWIG_scripts/C6.py +++ b/test/VisuPrs/SWIG_scripts/C6.py @@ -26,7 +26,7 @@ import pvsimple # 1. Import tables from file file_path = tablesdir + "tables_test.xls" -table_reader = pvsimple.TableReader(FileName=file_path) +table_reader = pvsimple.CSVReader(FileName=file_path) if table_reader is None: print "FAILED to import tables from tables_test.xls file." @@ -37,7 +37,6 @@ if cur_view: xy_view = pvsimple.CreateXYPlotView() # 3. Display curves in the viewer -table_reader.TableNumber = 1 xy_rep = pvsimple.Show(table_reader) xy_rep.AttributeType = 'Row Data' xy_rep.UseIndexForXAxis = 0 diff --git a/test/VisuPrs/SWIG_scripts/C7.py b/test/VisuPrs/SWIG_scripts/C7.py index c408b88b..d45f0ca4 100755 --- a/test/VisuPrs/SWIG_scripts/C7.py +++ b/test/VisuPrs/SWIG_scripts/C7.py @@ -92,7 +92,12 @@ entity = EntityType.NODE # Get lookup table lookup_table = get_lookup_table(table_name, nb_components, vector_mode) -lookup_table.LockScalarRange = 0 +if hasattr(lookup_table,"LockDataRange"): + lookup_table.LockDataRange = 0 +elif hasattr(lookup_table,"LockScalarRange"): + lookup_table.LockScalarRange = 0 +else: + raise RuntimeError("Object %s has no 'LockDataRange' or 'LockScalarRange' attribute!"%(lookup_table)) # Set properties pointmap3d.ColorArrayName = (EntityType.get_pvtype(entity), table_name) diff --git a/test/VisuPrs/ScalarMap/CMakeLists.txt b/test/VisuPrs/ScalarMap/CMakeLists.txt index 5f043a05..939702cc 100644 --- a/test/VisuPrs/ScalarMap/CMakeLists.txt +++ b/test/VisuPrs/ScalarMap/CMakeLists.txt @@ -19,7 +19,7 @@ SET(BASE_TESTS A1 B0 E0 F3 G0) SET(ALL_TESTS A0 A1 A2 A3 A4 A5 A6 A7 A8 A9 B0 B1 B2 B3 E0 E1 E2 E3 E4 E5 E6 E7 E8 E9 - F1 F2 F3 F4 F5 F6 F7 F8 F9 G0 G1 G2) + F1 F2 F3 F4 F5 F6 F8 F9 G0 G1 G2) # For make test IF(SALOME_PARAVIS_ALL_TEST) diff --git a/test/VisuPrs/ScalarMap/F7.py b/test/VisuPrs/ScalarMap/F7.py deleted file mode 100644 index f70a9390..00000000 --- a/test/VisuPrs/ScalarMap/F7.py +++ /dev/null @@ -1,35 +0,0 @@ -# Copyright (C) 2010-2016 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 -# - -# This case corresponds to: /visu/ScalarMap/F7 case -# Create Scalar Map for all data of the given MED file - -import sys -from paravistest import datadir, pictureext, get_picture_dir -from presentations import CreatePrsForFile, PrsTypeEnum - -# Directory for saving snapshots -picturedir = get_picture_dir("ScalarMap/F7") - -file = datadir + "occ4050.med" -print " --------------------------------- " -print "file ", file -print " --------------------------------- " -print "CreatePrsForFile..." -CreatePrsForFile(file, [PrsTypeEnum.SCALARMAP], picturedir, pictureext) diff --git a/test/VisuPrs/ScalarMap/G2.py b/test/VisuPrs/ScalarMap/G2.py index f70feb4c..d8eda874 100644 --- a/test/VisuPrs/ScalarMap/G2.py +++ b/test/VisuPrs/ScalarMap/G2.py @@ -22,7 +22,7 @@ import sys import os -from paravistest import datadir, pictureext, get_picture_dir +from paravistest import datadir, pictureext, get_picture_dir, get_png_picture_resolution from pvsimple import GetActiveSource, GetRenderView, Render, OpenDataFile from presentations import ScalarMapOnField, hide_all, EntityType, PrsTypeEnum,reset_view,process_prs_for_test @@ -44,10 +44,13 @@ else: print "OK" aView = GetRenderView() +import time + aFieldEntity = EntityType.NODE aFieldName = "MODES___DEPL____________________" #create list to store picture files sizes -sizes=[] +sizesw=[] +sizesh=[] #create Scalar Map presentations for 10 timestamps for i in range(1,11): hide_all(aView, True) @@ -72,12 +75,23 @@ for i in range(1,11): # Show and record the presentation process_prs_for_test(aPrs, aView, pic_name) - sizes.append(os.path.getsize(pic_name)) + (w,h) = get_png_picture_resolution(pic_name) + sizesw.append(w) + sizesh.append(h) + +# check sizes of pictures: width +if abs(max(sizesw)-min(sizesw)) > 0: + print "ERROR!!! Pictures have different width !!!"; + for i in range(1,11): + picture_name = "time_stamp_"+str(i)+"."+pictureext + print "Picture: "+picture_name+"; width : "+str(sizesw[i-1]) + raise RuntimeError -# check sizes of pictures -if abs(max(sizes)-min(sizes)) > 0.01*max(sizes): - print "WARNING!!! Pictures have different sizes!!!"; +# check sizes of pictures: height +if abs(max(sizesh)-min(sizesh)) > 0: + print "WARNING!!! Pictures have different height !!!"; for i in range(1,11): picture_name = "time_stamp_"+str(i)+"."+pictureext - print "Picture: "+picture_name+"; size: "+str(sizes[i-1]) + print "Picture: "+picture_name+"; height : "+str(sizesh[i-1]) raise RuntimeError + diff --git a/test/VisuPrs/ScalarMap_On_DeformedShape/CMakeLists.txt b/test/VisuPrs/ScalarMap_On_DeformedShape/CMakeLists.txt index 8fa6aaeb..a76da696 100644 --- a/test/VisuPrs/ScalarMap_On_DeformedShape/CMakeLists.txt +++ b/test/VisuPrs/ScalarMap_On_DeformedShape/CMakeLists.txt @@ -19,7 +19,7 @@ SET(BASE_TESTS A0 B0 E0 F2) SET(ALL_TESTS A0 A1 A2 A3 A4 A5 A6 A7 A8 A9 B0 B1 B2 B3 E0 E1 E2 E3 E4 E5 E6 E7 E8 E9 - F1 F2 F3 F4 F5 F6 F7 F8) + F1 F2 F3 F4 F5 F6 F8) # For make test IF(SALOME_PARAVIS_ALL_TEST) diff --git a/test/VisuPrs/ScalarMap_On_DeformedShape/F7.py b/test/VisuPrs/ScalarMap_On_DeformedShape/F7.py deleted file mode 100755 index 52a22ff3..00000000 --- a/test/VisuPrs/ScalarMap_On_DeformedShape/F7.py +++ /dev/null @@ -1,35 +0,0 @@ -# Copyright (C) 2010-2016 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 -# - -# This case corresponds to: /visu/ScalarMap_On_DeformedShape/F7 case -# Create Scalar Map on Deformed Shape for all data of the given MED file - -import sys -from paravistest import datadir, pictureext, get_picture_dir -from presentations import CreatePrsForFile, PrsTypeEnum - -# Directory for saving snapshots -picturedir = get_picture_dir("ScalarMap_On_DeformedShape/F7") - -file = datadir + "occ4050.med" -print " --------------------------------- " -print "file ", file -print " --------------------------------- " -print "CreatePrsForFile..." -CreatePrsForFile(file, [PrsTypeEnum.DEFORMEDSHAPESCALARMAP], picturedir, pictureext) diff --git a/test/VisuPrs/StreamLines/B3.py b/test/VisuPrs/StreamLines/B3.py index dff72a03..a2338e3b 100644 --- a/test/VisuPrs/StreamLines/B3.py +++ b/test/VisuPrs/StreamLines/B3.py @@ -26,7 +26,7 @@ from paravistest import datadir, pictureext, get_picture_dir from presentations import CreatePrsForFile, PrsTypeEnum # Directory for saving snapshots -picturedir = get_picture_dir(sys.argv[1], "StreamLines/B3") +picturedir = get_picture_dir("StreamLines/B3") # Create presentations files = ["fra", "TimeStamps", "pointe", "Fields_group3D", "Hexa8", "Penta6", "Quad4", "Tetra4", "Tria3", "clo", "carre_en_quad4_seg2", "carre_en_quad4_seg2_fields", "cube_hexa8_quad4"] diff --git a/test/VisuPrs/StreamLines/B4.py b/test/VisuPrs/StreamLines/B4.py index af7cfc55..f41944ab 100644 --- a/test/VisuPrs/StreamLines/B4.py +++ b/test/VisuPrs/StreamLines/B4.py @@ -56,6 +56,8 @@ print "Maximum Step Length: ", stream_tracer.MaximumStepLength print "Maximum Steps: ", stream_tracer.MaximumSteps print "Maximum Streamline Length: ", stream_tracer.MaximumStreamlineLength print "Seed Type: ", type(stream_tracer.SeedType) -print "Center: ", stream_tracer.SeedType.Center -print "Number Of Points: ", stream_tracer.SeedType.NumberOfPoints -print "Radius: ", stream_tracer.SeedType.Radius +print "Point1: ", stream_tracer.SeedType.Point1 +print "Point2: ", stream_tracer.SeedType.Point2 +# print "Center: ", stream_tracer.SeedType.Center +# print "Number Of Points: ", stream_tracer.SeedType.NumberOfPoints +# print "Radius: ", stream_tracer.SeedType.Radius diff --git a/test/VisuPrs/StreamLines/CMakeLists.txt b/test/VisuPrs/StreamLines/CMakeLists.txt index cc81b7f1..e1ec48b4 100644 --- a/test/VisuPrs/StreamLines/CMakeLists.txt +++ b/test/VisuPrs/StreamLines/CMakeLists.txt @@ -19,7 +19,7 @@ SET(BASE_TESTS A1 B2 E0 F2) SET(ALL_TESTS A0 A1 A2 A3 A4 A5 A6 A7 A8 A9 B0 B1 B2 B3 B4 - E0 E1 E2 E3 E4 E5 E6 E7 E8 E9 F1 F2 F3 F4 F5 F6 F7 F8 F9 G0) + E0 E1 E2 E3 E4 E5 E6 E7 E8 E9 F1 F2 F3 F4 F5 F6 F8 F9 G0) # For make test IF(SALOME_PARAVIS_ALL_TEST) diff --git a/test/VisuPrs/StreamLines/F7.py b/test/VisuPrs/StreamLines/F7.py deleted file mode 100644 index 084dc2e3..00000000 --- a/test/VisuPrs/StreamLines/F7.py +++ /dev/null @@ -1,36 +0,0 @@ -# Copyright (C) 2010-2016 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 -# - -# This case corresponds to: /visu/StreamLines/F7 case -# Create Stream Lines for all fields of the the given MED file - -import sys - -from paravistest import datadir, pictureext, get_picture_dir -from presentations import CreatePrsForFile, PrsTypeEnum - -# Directory for saving snapshots -picturedir = get_picture_dir("StreamLines/F7") - -file = datadir + "occ4050.med" -print " --------------------------------- " -print "file ", file -print " --------------------------------- " -print "\nCreatePrsForFile..." -CreatePrsForFile(file, [PrsTypeEnum.STREAMLINES], picturedir, pictureext) diff --git a/test/VisuPrs/StreamLines/F9.py b/test/VisuPrs/StreamLines/F9.py index 9e24a93e..240b0336 100644 --- a/test/VisuPrs/StreamLines/F9.py +++ b/test/VisuPrs/StreamLines/F9.py @@ -45,7 +45,7 @@ view = pvsimple.GetRenderView() print "BREAKPOINT_1" for i in range(1, 11): - prs = StreamLinesOnField(med_reader, EntityType.NODE, "MODES_DEPL", i) + prs = StreamLinesOnField(med_reader, EntityType.NODE, "MODES___DEPL____________________", i) if prs is None: raise RuntimeError("Presentation on timestamp {0} is None!!!". format(i)) diff --git a/test/VisuPrs/StreamLines/G0.py b/test/VisuPrs/StreamLines/G0.py index 3f7f133c..587c2112 100644 --- a/test/VisuPrs/StreamLines/G0.py +++ b/test/VisuPrs/StreamLines/G0.py @@ -32,6 +32,6 @@ if med_reader is None: raise RuntimeError, "new_case.rmed was not imported!!!" # 2. Creation of a set of "StreamLines" presentations, based on time stamps of "RESU_DEPL" field -streamlines = StreamLinesOnField(med_reader, EntityType.NODE, 'RESU_DEPL', 1) +streamlines = StreamLinesOnField(med_reader, EntityType.NODE, 'RESU____DEPL____________________', 1) if streamlines is None: raise RuntimeError, "Presentation is None!!!" diff --git a/test/VisuPrs/Util/paravistest.py b/test/VisuPrs/Util/paravistest.py index 8121a2df..353cd049 100755 --- a/test/VisuPrs/Util/paravistest.py +++ b/test/VisuPrs/Util/paravistest.py @@ -28,6 +28,7 @@ import os import tempfile import getpass from datetime import date +import struct # Auxiliary variables @@ -349,3 +350,22 @@ def delete_with_inputs(obj): obj_to_delete = tmp_obj.Input pvsimple.Delete(tmp_obj) + +def get_png_picture_resolution(infile): + """Returns size (width, height) of the PNG image""" + f = open(infile, 'rb') + data = f.read(24) + f.close() + if not (data[:8] == '\211PNG\r\n\032\n'and (data[12:16] == 'IHDR')): + raise RuntimeError("File '%s' is not PNG image"%(infile)) + + w, h = struct.unpack('>LL', data[16:24]) + width = int(w) + height = int(h) + return (width,height) + +def save_trace(afile,atrace): + """Saves atrace in afile""" + f = open(afile, 'w') + f.write(atrace) + f.close() diff --git a/test/VisuPrs/Vectors/CMakeLists.txt b/test/VisuPrs/Vectors/CMakeLists.txt index ea052b18..71564a00 100644 --- a/test/VisuPrs/Vectors/CMakeLists.txt +++ b/test/VisuPrs/Vectors/CMakeLists.txt @@ -19,7 +19,7 @@ SET(BASE_TESTS A0 B1 E0 F1) SET(ALL_TESTS A0 A1 A2 A3 A4 A5 A6 A7 A8 A9 B0 B1 B2 B3 E0 E1 E2 E3 E4 E5 E6 E7 E8 E9 - F1 F2 F3 F4 F5 F6 F7 F8 F9) + F1 F2 F3 F4 F5 F6 F8 F9) # For make test IF(SALOME_PARAVIS_ALL_TEST) diff --git a/test/VisuPrs/Vectors/F7.py b/test/VisuPrs/Vectors/F7.py deleted file mode 100644 index 16b8e0a2..00000000 --- a/test/VisuPrs/Vectors/F7.py +++ /dev/null @@ -1,35 +0,0 @@ -# Copyright (C) 2010-2016 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 -# - -# This case corresponds to: /visu/Vectors/F7 case -# Create Vectors for all data of the given MED file - -import sys -from paravistest import datadir, pictureext, get_picture_dir -from presentations import CreatePrsForFile, PrsTypeEnum - -# Directory for saving snapshots -picturedir = get_picture_dir("Vectors/F7") - -file = datadir + "occ4050.med" -print " --------------------------------- " -print "file ", file -print " --------------------------------- " -print "CreatePrsForFile..." -CreatePrsForFile(file, [PrsTypeEnum.VECTORS], picturedir, pictureext) diff --git a/test/VisuPrs/bugs/C4.py b/test/VisuPrs/bugs/C4.py deleted file mode 100644 index 3d8375d4..00000000 --- a/test/VisuPrs/bugs/C4.py +++ /dev/null @@ -1,67 +0,0 @@ -# Copyright (C) 2010-2016 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 -# - -# This case corresponds to: /visu/bugs2/C4 case - -import sys -import os -from paravistest import datadir, pictureext, get_picture_dir -from presentations import * -import pvsimple - -picturedir = get_picture_dir("bugs/C4") - -# 1. Import MED file -med_file_path = datadir + "forma01f.resu.med" - -print 'Importing "forma01f.resu.med"....', -pvsimple.OpenDataFile(med_file_path) -med_reader = pvsimple.GetActiveSource() - -if med_reader is None: - print "FAILED" -else: - print "OK" - -# 2. Creation of ScalarMap On DeformedShape presentation -scales=[None, 0, 1e-05] -fields=["RESU1_DEPL", "RESU1_SIGM_ELNO_DEPL"] -entities=[EntityType.NODE, EntityType.CELL] -entities_str=["NODE", "CELL"] - -view = pvsimple.GetRenderView() - -for scale in scales: - for i in range(len(fields)): - print "Field: ", fields[i], "; Scale: ", scale - presentation = None - try: - presentation = DeformedShapeAndScalarMapOnField(med_reader, entities[i], fields[i], 1) - except ValueError as e: - print "Error:", e - - if presentation is not None: - if scale is not None: - presentation.Input.ScaleFactor = scale - # save picture - pic_path = os.path.join(picturedir, "MAIL_" + entities_str[i] + "_" + fields[i] + "_" + str(scale) + "_." + pictureext) - process_prs_for_test(presentation, view, pic_path) - else: - print "FAILED! Created presentation is None!!!" - diff --git a/test/VisuPrs/bugs/C7.py b/test/VisuPrs/bugs/C7.py deleted file mode 100644 index 43e819ff..00000000 --- a/test/VisuPrs/bugs/C7.py +++ /dev/null @@ -1,64 +0,0 @@ -# Copyright (C) 2010-2016 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 -# - -# This case corresponds to: /visu/bugs2/C7 case - -import os -import sys -from paravistest import datadir, pictureext, get_picture_dir -from presentations import * -import pvsimple - -picturedir = get_picture_dir("bugs/C7") - -# 1. Import MED file -med_file_path = datadir + "Bug583-Quadratique.resu.med" - -print 'Importing "Bug583-Quadratique.resu.med"....', -pvsimple.OpenDataFile(med_file_path) -med_reader = pvsimple.GetActiveSource() - -if med_reader is None: - raise RuntimeError, "File wasn't imported!!!" -else: - print "OK" - -# 2. Creation of GaussPoints presentations -mesh_name = "MAIL" -field_names = ["RESU_EQUI_ELNO_SIGM", "RESU_SIEF_ELGA_DEPL", "RESU_SIEF_ELNO_ELGA", "RESU_SIGM_ELNO_DEPL"] - -view = pvsimple.GetRenderView() - -print "BREAKPOINT_1" -error = 0 - -for field in field_names: - print "Creation of the GaussPoints presentation.. Field: ", field, "; Iteration: 1" - presentation = GaussPointsOnField1(med_reader, EntityType.CELL, field, 1) - if presentation is None: - print "ERROR!!! GaussPoints presentation wasn't created for the ", field, " field!!!" - error += 1 - else: - pic_path = os.path.join(picturedir, "GaussPoints_" + mesh_name + "_" + field + "." + pictureext) - process_prs_for_test(presentation, view, pic_path) - -if not error: - print "BREAKPOINT_2" -else: - raise RuntimeError, "There are some errors were occured... For more info see ERRORs above..." diff --git a/test/VisuPrs/bugs/CMakeLists.txt b/test/VisuPrs/bugs/CMakeLists.txt index 8f989714..44403460 100644 --- a/test/VisuPrs/bugs/CMakeLists.txt +++ b/test/VisuPrs/bugs/CMakeLists.txt @@ -17,9 +17,9 @@ # See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com # -SET(BASE_TESTS A0 B1 C3 D0 E0) -SET(ALL_TESTS A0 A1 A2 A3 A4 A5 A6 A7 A9 B1 C3 C4 C5 C6 C7 C8 C9 - D0 D1 D3 D5 D6 D7 E0) +SET(BASE_TESTS A0 B1 C3 E0) +SET(ALL_TESTS A0 A1 A2 A3 A4 A5 A6 A7 A9 B1 C3 C5 C6 C9 + D1 D3 D6 D7 E0) # For make test IF(SALOME_PARAVIS_ALL_TEST) diff --git a/test/VisuPrs/bugs/D0.py b/test/VisuPrs/bugs/D0.py deleted file mode 100644 index 71e13fd8..00000000 --- a/test/VisuPrs/bugs/D0.py +++ /dev/null @@ -1,78 +0,0 @@ -# Copyright (C) 2010-2016 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 -# - -# This case corresponds to: /visu/bugs3/D0 case - -import sys -import os -import time -from paravistest import datadir, pictureext, get_picture_dir -from presentations import * -import pvsimple - -picturedir = get_picture_dir("bugs/D0") - -# Aux method -def get_group_full_name(source, group_name): - result_name = group_name - - #full_names = source.Groups.Available - full_names = get_group_names(source) - for name in full_names: - if name.endswith(group_name): - result_name = name - break - - return result_name - -# -# NB! An 'Unknown exception' is raised, when a user try to open -# "Bug619-result_calcul_OCC.med" file in MED module via 'Add Data Source' functionality. -# Refer to LastTest.log file for more information. -# TODO: check MedReader pb. -# -# 1. Import of the "Bug619-result_calcul_OCC.med" file -med_file_path = datadir + "Bug619-result_calcul_OCC.med" - -pvsimple.OpenDataFile(med_file_path) -med_reader = pvsimple.GetActiveSource() - -if med_reader is None: - raise RuntimeError, "Bug619-result_calcul_OCC.med was not imported!!!" - -# 2. Creation of ScalarMap: -# iteration1: on the "TU_3D_G1" group -# iteration2: on the "TU_3D_D1" group -view = pvsimple.GetRenderView() -field_name = "MECASTATEQUI_ELNO_SIGM" - -groups = ['TU_3D_G1', 'TU_3D_D1'] - -for group_name in groups: - extract_group = pvsimple.ExtractGroup(med_reader) - #extract_group.Groups = [get_group_full_name(med_reader, group_name)] - extract_group.AllGroups = [get_group_full_name(extract_group, group_name)] - extract_group.UpdatePipeline() - - scalar_map = ScalarMapOnField(extract_group, EntityType.CELL, field_name, 1) - if scalar_map is None : - raise RuntimeError, "ScalarMap presentation on '" + group_name + "' group is None!!!" - - pic_path = os.path.join(picturedir, "npal18711_" + group_name + "." + pictureext) - process_prs_for_test(scalar_map, view, pic_path) diff --git a/test/VisuPrs/bugs/D1.py b/test/VisuPrs/bugs/D1.py index 27abc41e..554f9095 100644 --- a/test/VisuPrs/bugs/D1.py +++ b/test/VisuPrs/bugs/D1.py @@ -21,7 +21,7 @@ import sys import os -from paravistest import datadir, pictureext, get_picture_dir +from paravistest import datadir, pictureext, get_picture_dir, get_png_picture_resolution from presentations import * import pvsimple @@ -36,7 +36,8 @@ if med_reader1 is None: # 2. Creation of a set of "DeformedShape and ScalarMap" presentations, based on time stamps of "MODES_DEPL" field errors=0 -sizes=[] +sizew=[] +sizeh=[] for i in range(1,11): presentation = DeformedShapeAndScalarMapOnField(med_reader1, EntityType.NODE, "MODES___DEPL____________________", i) @@ -46,14 +47,24 @@ for i in range(1,11): pic_path = os.path.join(picturedir, "npal19999_1_time_stamp_" + str(i) + "." + pictureext) process_prs_for_test(presentation, pvsimple.GetRenderView(), pic_path) - sizes.append(os.path.getsize(pic_path)) + (h,w) = get_png_picture_resolution(pic_path) + sizew.append(w) + sizeh.append(h) -if abs(max(sizes)-min(sizes)) > 0.01*max(sizes): - print "WARNING!!! Pictures have different sizes!!!" +if abs(max(sizeh)-min(sizeh)) > 0.01*max(sizeh): + print "WARNING!!! Pictures have different height !!!" errors += 1 for i in range(1,11): - picture_name = "npal19999_1_time_stamp_" + str(i) + "." + pictureext - print "Picture: " + picture_name + "; size: " + str(sizes[i-1]) + picture_name = "npal19999_2_time_stamp_" + str(i) + "." + pictureext + print "Picture: " + picture_name + "; height : " + str(sizeh[i-1]) + raise RuntimeError + +if abs(max(sizew)-min(sizew)) > 0.01*max(sizew): + print "WARNING!!! Pictures have different width !!!" + errors += 1 + for i in range(1,11): + picture_name = "npal19999_2_time_stamp_" + str(i) + "." + pictureext + print "Picture: " + picture_name + "; width : " + str(sizew[i-1]) raise RuntimeError # 3. Import of the "Bug829_resu_mode.med" file at second time @@ -64,7 +75,8 @@ if med_reader2 is None: # 4. Creation of a set of "DeformedShape and ScalarMap" presentations, based on time stamps of "MODES_DEPL" field errors = 0 -sizes=[] +sizew=[] +sizeh=[] for i in range(1,11): presentation = DeformedShapeAndScalarMapOnField(med_reader2, EntityType.NODE, "MODES___DEPL____________________", 11-i) @@ -73,13 +85,23 @@ for i in range(1,11): pic_path = os.path.join(picturedir, "npal19999_2_time_stamp_" + str(i) + "." + pictureext) process_prs_for_test(presentation, pvsimple.GetRenderView(), pic_path) + (h,w) = get_png_picture_resolution(pic_path) + sizew.append(w) + sizeh.append(h) - sizes.append(os.path.getsize(pic_path)) +if abs(max(sizeh)-min(sizeh)) > 0.01*max(sizeh): + print "WARNING!!! Pictures have different height !!!" + errors += 1 + for i in range(1,11): + picture_name = "npal19999_2_time_stamp_" + str(i) + "." + pictureext + print "Picture: " + picture_name + "; height : " + str(sizeh[i-1]) + raise RuntimeError -if abs(max(sizes)-min(sizes)) > 0.01*max(sizes): - print "WARNING!!! Pictures have different sizes!!!" +if abs(max(sizew)-min(sizew)) > 0.01*max(sizew): + print "WARNING!!! Pictures have different width !!!" errors += 1 for i in range(1,11): picture_name = "npal19999_2_time_stamp_" + str(i) + "." + pictureext - print "Picture: " + picture_name + "; size: " + str(sizes[i-1]) + print "Picture: " + picture_name + "; width : " + str(sizew[i-1]) raise RuntimeError + diff --git a/test/VisuPrs/bugs/D5.py b/test/VisuPrs/bugs/D5.py index ae667ad5..0ab78541 100644 --- a/test/VisuPrs/bugs/D5.py +++ b/test/VisuPrs/bugs/D5.py @@ -48,7 +48,12 @@ for table_nb in range(0, tables_count): # Get lookup table lookup_table = get_lookup_table(field_name, nb_components, vector_mode) - lookup_table.LockScalarRange = 0 + if hasattr(lookup_table,"LockDataRange"): + lookup_table.LockDataRange = 0 + elif hasattr(lookup_table,"LockScalarRange"): + lookup_table.LockScalarRange = 0 + else: + raise RuntimeError("Object %s has no 'LockDataRange' or 'LockScalarRange' attribute!"%(lookup_table)) # Set properties prs.ColorArrayName = (EntityType.get_pvtype(EntityType.NODE), field_name) diff --git a/test/VisuPrs/dump_study/A0.py b/test/VisuPrs/dump_study/A0.py index dc4da469..6ca008c6 100644 --- a/test/VisuPrs/dump_study/A0.py +++ b/test/VisuPrs/dump_study/A0.py @@ -22,6 +22,14 @@ from paravistest import datadir, delete_with_inputs from presentations import * from pvsimple import * +from paravistest import save_trace +from paraview import smtrace + +GetActiveViewOrCreate('RenderView') + +config = smtrace.start_trace() +config.SetFullyTraceSupplementalProxies(True) +config.SetPropertiesToTraceOnCreate(config.RECORD_ALL_PROPERTIES) settings = {"Offset": [0.0001, 0.0002, 0], "ScalarMode": ("Component", 2), "Position": [0.1, 0.2], "Size": [0.15, 0.25], "Discretize": 1, "NbColors": 44, "NbLabels": 22, "Title": "My presentation", "UseLogScale": 1, "Orientation": 'Horizontal'} @@ -36,6 +44,8 @@ if med_reader is None : med_field = "vitesse" scalarmap = ScalarMapOnField(med_reader, EntityType.NODE, med_field, 1) +scalarmap.Visibility = 1 +scalarmap.SetScalarBarVisibility(GetActiveView(),1) # apply settings scalarmap.Position = settings["Offset"] @@ -52,9 +62,11 @@ bar.NumberOfLabels = settings["NbLabels"] bar.Title = settings["Title"] bar.Orientation = settings["Orientation"] + # 3. Dump Study +text = smtrace.stop_trace() path_to_save = os.path.join(os.getenv("HOME"), "ScalarMap.py") -SaveTrace( path_to_save ) +save_trace( path_to_save, text ) # 4. Delete the created objects, recreate the view delete_with_inputs(scalarmap) @@ -65,8 +77,8 @@ view = CreateRenderView() execfile(path_to_save) # 6. Checking of the settings done before dump -recreated_bar = view.Representations[0] -recreated_scalarmap = view.Representations[1] +recreated_bar = view.Representations[1] +recreated_scalarmap = view.Representations[0] errors = 0 tolerance = 1e-05 diff --git a/test/VisuPrs/dump_study/A1.py b/test/VisuPrs/dump_study/A1.py index 32d33460..80226504 100644 --- a/test/VisuPrs/dump_study/A1.py +++ b/test/VisuPrs/dump_study/A1.py @@ -23,6 +23,15 @@ from paravistest import datadir, delete_with_inputs from presentations import * from pvsimple import * +from paravistest import save_trace +from paraview import smtrace +GetActiveViewOrCreate('RenderView') + +config = smtrace.start_trace() +config.SetFullyTraceSupplementalProxies(True) +config.SetPropertiesToTraceOnCreate(config.RECORD_ALL_PROPERTIES) + + settings = {"Offset": [0.0001, 0.0002, 0], "ScalarMode": ("Component", 2), "Position": [0.1, 0.2], "Size": [0.15, 0.25], "Discretize": 1, "NbColors": 44, "NbLabels": 22, "Title": "My presentation", "UseLogScale": 1, "Orientation": 'Horizontal', "NbSurfaces": 444} # 1. TimeStamps.med import @@ -36,6 +45,8 @@ if med_reader is None : med_field = "vitesse" isosurfaces = IsoSurfacesOnField(med_reader, EntityType.NODE, med_field, 1) +isosurfaces.Visibility = 1 +isosurfaces.SetScalarBarVisibility(GetActiveView(),1) # apply settings isosurfaces.Position = settings["Offset"] @@ -59,8 +70,9 @@ bar.Title = settings["Title"] bar.Orientation = settings["Orientation"] # 3. Dump Study +text = smtrace.stop_trace() path_to_save = os.path.join(os.getenv("HOME"), "IsoSurfaces.py") -SaveTrace( path_to_save ) +save_trace( path_to_save, text ) # 4. Delete the created objects, recreate the view delete_with_inputs(isosurfaces) @@ -71,8 +83,8 @@ view = CreateRenderView() execfile(path_to_save) # 6. Checking of the settings done before dump -recreated_bar = view.Representations[0] -recreated_isosurfaces = view.Representations[1] +recreated_bar = view.Representations[1] +recreated_isosurfaces = view.Representations[0] errors = 0 tolerance = 1e-05 diff --git a/test/VisuPrs/dump_study/A2.py b/test/VisuPrs/dump_study/A2.py index e9c47ccf..b8fb5783 100644 --- a/test/VisuPrs/dump_study/A2.py +++ b/test/VisuPrs/dump_study/A2.py @@ -22,6 +22,14 @@ from paravistest import datadir, delete_with_inputs from presentations import * from pvsimple import * +from paravistest import save_trace +from paraview import smtrace + +GetActiveViewOrCreate('RenderView') + +config = smtrace.start_trace() +config.SetFullyTraceSupplementalProxies(True) +config.SetPropertiesToTraceOnCreate(config.RECORD_ALL_PROPERTIES) settings = {"Offset": [0.0001, 0.0002, 0], "ScalarMode": ("Component", 2), "Position": [0.1, 0.2], "Size": [0.15, 0.25], "Discretize": 1, "NbColors": 44, "NbLabels": 22, "Title": "My presentation", "UseLogScale": 1, "Orientation": 'Horizontal'} @@ -36,6 +44,8 @@ if med_reader is None : med_field = "vitesse" cutplanes = CutPlanesOnField(med_reader, EntityType.NODE, med_field, 1) +cutplanes.Visibility = 1 +cutplanes.SetScalarBarVisibility(GetActiveView(),1) # apply settings cutplanes.Position = settings["Offset"] @@ -60,8 +70,9 @@ bar.Title = settings["Title"] bar.Orientation = settings["Orientation"] # 3. Dump Study +text = smtrace.stop_trace() path_to_save = os.path.join(os.getenv("HOME"), "CutPlanes.py") -SaveTrace( path_to_save ) +save_trace( path_to_save, text ) # 4. Delete the created objects, recreate the view delete_with_inputs(cutplanes) @@ -72,8 +83,8 @@ view = CreateRenderView() execfile(path_to_save) # 6. Checking of the settings done before dump -recreated_bar = view.Representations[0] -recreated_cutplanes = view.Representations[1] +recreated_bar = view.Representations[1] +recreated_cutplanes = view.Representations[0] errors = 0 tolerance = 1e-05 diff --git a/test/VisuPrs/dump_study/A3.py b/test/VisuPrs/dump_study/A3.py index d79482da..67cf245f 100644 --- a/test/VisuPrs/dump_study/A3.py +++ b/test/VisuPrs/dump_study/A3.py @@ -22,6 +22,14 @@ from paravistest import datadir, delete_with_inputs from presentations import * from pvsimple import * +from paravistest import save_trace +from paraview import smtrace + +GetActiveViewOrCreate('RenderView') + +config = smtrace.start_trace() +config.SetFullyTraceSupplementalProxies(True) +config.SetPropertiesToTraceOnCreate(config.RECORD_ALL_PROPERTIES) settings = {"Offset": [0.0001, 0.0002, 0], "ScalarMode": ("Component", 2), "Position": [0.1, 0.2], "Size": [0.15, 0.25], "Discretize": 1, "NbColors": 44, "NbLabels": 22, "Title": "My presentation", "UseLogScale": 1, "Orientation": 'Horizontal', "Scale": 0.333, "ColorArray": "", "ColorComponents": [0.111, 0.222, 0.333]} @@ -35,7 +43,9 @@ if med_reader is None : # 2. DeformedShape creation med_field = "vitesse" -deformedshape = DeformedShapeOnField(med_reader, EntityType.NODE, med_field, 1) +deformedshape = DeformedShapeOnField(med_reader, EntityType.NODE, med_field, 1, None, True) +deformedshape.Visibility = 1 +deformedshape.SetScalarBarVisibility(GetActiveView(),1) # apply settings deformedshape.Position = settings["Offset"] @@ -57,8 +67,9 @@ bar.Title = settings["Title"] bar.Orientation = settings["Orientation"] # 3. Dump Study +text = smtrace.stop_trace() path_to_save = os.path.join(os.getenv("HOME"), "DeformedShape.py") -SaveTrace( path_to_save ) +save_trace( path_to_save, text ) # 4. Delete the created objects, recreate the view delete_with_inputs(deformedshape) @@ -69,8 +80,8 @@ view = CreateRenderView() execfile(path_to_save) # 6. Checking of the settings done before dump -recreated_bar = view.Representations[0] -recreated_deformedshape = view.Representations[1] +recreated_bar = view.Representations[1] +recreated_deformedshape = view.Representations[0] errors = 0 tolerance = 1e-05 @@ -159,8 +170,8 @@ if abs(scale - settings["Scale"]) > tolerance: # Color array name array_name = recreated_deformedshape.ColorArrayName[1] -if array_name != settings["ColorArray"]: - print "ERROR!!! Color array name of presentation is incorrect: ", array_name, " instead of ", settings["arrayName"] +if array_name != med_field: + print "ERROR!!! Color array name of presentation is incorrect: ", array_name , " instead of ", med_field errors += 1 # Color diff --git a/test/VisuPrs/dump_study/A4.py b/test/VisuPrs/dump_study/A4.py index 33e47078..1076346b 100644 --- a/test/VisuPrs/dump_study/A4.py +++ b/test/VisuPrs/dump_study/A4.py @@ -22,6 +22,15 @@ from paravistest import datadir, delete_with_inputs from presentations import * from pvsimple import * +from paravistest import save_trace +from paraview import smtrace + +GetActiveViewOrCreate('RenderView') + +config = smtrace.start_trace() +config.SetFullyTraceSupplementalProxies(True) +config.SetPropertiesToTraceOnCreate(config.RECORD_ALL_PROPERTIES) + settings = {"Offset": [0.0001, 0.0002, 0], "ScalarMode": ("Component", 1), "Position": [0.1, 0.2], "Size": [0.15, 0.25], "Discretize": 1, "NbColors": 44, "NbLabels": 22, "Title": "My presentation"} @@ -36,6 +45,8 @@ if med_reader is None : med_field = "pression" gausspoints = GaussPointsOnField(med_reader, EntityType.CELL, med_field, 1) +gausspoints.Visibility = 1 +gausspoints.SetScalarBarVisibility(GetActiveView(),1) # apply settings gausspoints.Position = settings["Offset"] @@ -51,8 +62,9 @@ bar.NumberOfLabels = settings["NbLabels"] bar.Title = settings["Title"] # 3. Dump Study +text = smtrace.stop_trace() path_to_save = os.path.join(os.getenv("HOME"), "GaussPoints.py") -SaveTrace( path_to_save ) +save_trace( path_to_save, text ) # 4. Delete the created objects, recreate the view delete_with_inputs(gausspoints) @@ -63,8 +75,8 @@ view = CreateRenderView() execfile(path_to_save) # 6. Checking of the settings done before dump -recreated_bar = view.Representations[0] -recreated_gausspoints = view.Representations[1] +recreated_bar = view.Representations[1] +recreated_gausspoints = view.Representations[0] errors = 0 tolerance = 1e-05 diff --git a/test/VisuPrs/dump_study/A5.py b/test/VisuPrs/dump_study/A5.py index 9b00410e..3c830d26 100644 --- a/test/VisuPrs/dump_study/A5.py +++ b/test/VisuPrs/dump_study/A5.py @@ -22,6 +22,14 @@ from paravistest import datadir, delete_with_inputs from presentations import * from pvsimple import * +from paravistest import save_trace +from paraview import smtrace + +GetActiveViewOrCreate('RenderView') + +config = smtrace.start_trace() +config.SetFullyTraceSupplementalProxies(True) +config.SetPropertiesToTraceOnCreate(config.RECORD_ALL_PROPERTIES) settings = {"Offset": [0.0001, 0.0002, 0], "ScalarMode": ("Component", 2), "Position": [0.1, 0.2], "Size": [0.15, 0.25], "Discretize": 1, "NbColors": 44, "NbLabels": 22, "Title": "My presentation", "UseLogScale": 1, "Orientation": 'Horizontal', "ScaleFactor": 0.25, "NbContours": 4} @@ -36,6 +44,8 @@ if med_reader is None : med_field = "VITESSE" plot3d = Plot3DOnField(med_reader, EntityType.NODE, med_field, 1, is_contour=True) +plot3d.Visibility = 1 +plot3d.SetScalarBarVisibility(GetActiveView(),1) # apply settings plot3d.Position = settings["Offset"] @@ -68,8 +78,9 @@ bar.Title = settings["Title"] bar.Orientation = settings["Orientation"] # 3. Dump Study +text = smtrace.stop_trace() path_to_save = os.path.join(os.getenv("HOME"), "Plot3D.py") -SaveTrace( path_to_save ) +save_trace( path_to_save, text ) # 4. Delete the created objects, recreate the view delete_with_inputs(plot3d) @@ -80,8 +91,8 @@ view = CreateRenderView() execfile(path_to_save) # 6. Checking of the settings done before dump -recreated_bar = view.Representations[0] -recreated_plot3d = view.Representations[1] +recreated_bar = view.Representations[1] +recreated_plot3d = view.Representations[0] errors = 0 tolerance = 1e-05 diff --git a/test/VisuPrs/dump_study/A6.py b/test/VisuPrs/dump_study/A6.py index d91da4e8..e5613916 100644 --- a/test/VisuPrs/dump_study/A6.py +++ b/test/VisuPrs/dump_study/A6.py @@ -22,6 +22,14 @@ from paravistest import datadir, delete_with_inputs from presentations import * from pvsimple import * +from paravistest import save_trace +from paraview import smtrace + +GetActiveViewOrCreate('RenderView') + +config = smtrace.start_trace() +config.SetFullyTraceSupplementalProxies(True) +config.SetPropertiesToTraceOnCreate(config.RECORD_ALL_PROPERTIES) settings = {"Offset": [0.0001, 0.0002, 0], "ScalarMode": ("Component", 2), "Position": [0.1, 0.2], "Size": [0.15, 0.25], "Discretize": 1, "NbColors": 44, "NbLabels": 22, "Title": "My presentation", "UseLogScale": 1, "Orientation": 'Horizontal', "Scale": 0.12929} @@ -36,6 +44,8 @@ if med_reader is None: med_field = "vitesse" prs = DeformedShapeAndScalarMapOnField(med_reader, EntityType.NODE, med_field, 1) +prs.Visibility = 1 +prs.SetScalarBarVisibility(GetActiveView(),1) # apply settings prs.Position = settings["Offset"] @@ -57,8 +67,9 @@ bar.Title = settings["Title"] bar.Orientation = settings["Orientation"] # 3. Dump Study +text = smtrace.stop_trace() path_to_save = os.path.join(os.getenv("HOME"), "ScalarMapOnDeformedShape.py") -SaveTrace( path_to_save ) +save_trace( path_to_save, text ) # 4. Delete the created objects, recreate the view delete_with_inputs(prs) @@ -69,8 +80,8 @@ view = CreateRenderView() execfile(path_to_save) # 6. Checking of the settings done before dump -recreated_bar = view.Representations[0] -recreated_prs = view.Representations[1] +recreated_bar = view.Representations[1] +recreated_prs = view.Representations[0] errors = 0 tolerance = 1e-05 diff --git a/test/VisuPrs/dump_study/A7.py b/test/VisuPrs/dump_study/A7.py index 54a0cc8b..8acbffe6 100644 --- a/test/VisuPrs/dump_study/A7.py +++ b/test/VisuPrs/dump_study/A7.py @@ -22,6 +22,15 @@ from paravistest import datadir, delete_with_inputs from presentations import * from pvsimple import * +from paravistest import save_trace +from paraview import smtrace + +GetActiveViewOrCreate('RenderView') + +config = smtrace.start_trace() +config.SetFullyTraceSupplementalProxies(True) +config.SetPropertiesToTraceOnCreate(config.RECORD_ALL_PROPERTIES) + # StreamLines settings settings = {'name': 'myStreamLines', @@ -74,8 +83,9 @@ stream.SeedType.NumberOfPoints = settings['SeedType.NumberOfPoints'] stream.SeedType.Radius = settings['SeedType.Radius'] # 4. Dump Study +text = smtrace.stop_trace() path_to_save = os.path.join(os.getenv("HOME"), "StreamLines.py") -SaveTrace( path_to_save ) +save_trace( path_to_save, text ) # 4. Delete the created objects delete_with_inputs(stream) diff --git a/test/VisuPrs/dump_study/A8.py b/test/VisuPrs/dump_study/A8.py index d70048a2..ab9580a5 100644 --- a/test/VisuPrs/dump_study/A8.py +++ b/test/VisuPrs/dump_study/A8.py @@ -22,8 +22,17 @@ from paravistest import datadir, delete_with_inputs from presentations import * from pvsimple import * +from paravistest import save_trace +from paraview import smtrace -settings = {"Offset": [0.0001, 0.0002, 0], "ScalarMode": ("Component", 2), "Position": [0.1, 0.2], "Size": [0.15, 0.25], "Discretize": 1, "NbColors": 44, "NbLabels": 22, "Title": "My presentation", "UseLogScale": 1, "Orientation": 'Horizontal', "Scale": 0.333, "ColorArray": "", "ColorComponents": [0.111, 0.222, 0.333], "LineWidth": 2, "GlyphType": 'Cone', "GlyphPos": [-0.5, 0.0, 0.0]} +GetActiveViewOrCreate('RenderView') + +config = smtrace.start_trace() +config.SetFullyTraceSupplementalProxies(True) +config.SetPropertiesToTraceOnCreate(config.RECORD_ALL_PROPERTIES) + + +settings = {"Offset": [0.0001, 0.0002, 0], "ScalarMode": ("Component", 2), "Position": [0.1, 0.2], "Size": [0.15, 0.25], "Discretize": 1, "NbColors": 44, "NbLabels": 22, "Title": "My presentation", "UseLogScale": 1, "Orientation": 'Horizontal', "Scale": 0.333, "ColorComponents": [0.111, 0.222, 0.333], "LineWidth": 2, "GlyphType": 'Cone', "GlyphPos": [-0.5, 0.0, 0.0]} # 1. TimeStamps.med import file_path = datadir + "TimeStamps.med" @@ -35,7 +44,9 @@ if med_reader is None : # 2. Vectors creation med_field = "vitesse" -vectors = VectorsOnField(med_reader, EntityType.NODE, med_field, 1) +vectors = VectorsOnField(med_reader, EntityType.NODE, med_field, 1,is_colored=True) +vectors.Visibility = 1 +vectors.SetScalarBarVisibility(GetActiveView(),1) # apply settings vectors.Position = settings["Offset"] @@ -45,8 +56,7 @@ vectors.LookupTable.Discretize = settings["Discretize"] vectors.LookupTable.NumberOfTableValues = settings["NbColors"] vectors.LookupTable.UseLogScale = settings["UseLogScale"] -vectors.Input.SetScaleFactor = settings["Scale"] -vectors.ColorArrayName = (None, '') +vectors.Input.ScaleFactor = settings["Scale"] vectors.AmbientColor = settings["ColorComponents"] vectors.LineWidth = settings["LineWidth"] @@ -63,8 +73,9 @@ bar.Orientation = settings["Orientation"] cone_glyth_type = type(vectors.Input.GlyphType) # 3. Dump Study +text = smtrace.stop_trace() path_to_save = os.path.join(os.getenv("HOME"), "Vectors.py") -SaveTrace( path_to_save ) +save_trace( path_to_save, text ) # 4. Delete the created objects, recreate the view delete_with_inputs(vectors) @@ -75,8 +86,8 @@ view = CreateRenderView() execfile(path_to_save) # 6. Checking of the settings done before dump -recreated_bar = view.Representations[0] -recreated_vectors = view.Representations[1] +recreated_bar = view.Representations[1] +recreated_vectors = view.Representations[0] errors = 0 tolerance = 1e-05 @@ -158,15 +169,15 @@ if orientation != settings["Orientation"]: errors += 1 # Scale factor -scale = recreated_vectors.Input.SetScaleFactor +scale = recreated_vectors.Input.ScaleFactor if abs(scale - settings["Scale"]) > tolerance: print "ERROR!!! Scale of presentation is incorrect: ", scale, " instead of ", settings["Scale"] errors += 1 # Color array name array_name = recreated_vectors.ColorArrayName[1] -if array_name != settings["ColorArray"]: - print "ERROR!!! Color array name of presentation is incorrect: ", array_name, " instead of ", settings["arrayName"] +if array_name != med_field: + print "ERROR!!! Color array name of presentation is incorrect: ", array_name, " instead of ", med_field errors += 1 # Color diff --git a/test/VisuPrs/dump_study/A9.py b/test/VisuPrs/dump_study/A9.py index 51bbfff2..23dba938 100644 --- a/test/VisuPrs/dump_study/A9.py +++ b/test/VisuPrs/dump_study/A9.py @@ -22,6 +22,14 @@ from paravistest import datadir, delete_with_inputs from presentations import * from pvsimple import * +from paravistest import save_trace +from paraview import smtrace + +GetActiveViewOrCreate('RenderView') + +config = smtrace.start_trace() +config.SetFullyTraceSupplementalProxies(True) +config.SetPropertiesToTraceOnCreate(config.RECORD_ALL_PROPERTIES) settings = {"Offset": [0.0001, 0.0002, 0], "ScalarMode": ("Component", 2), "Position": [0.1, 0.2], "Size": [0.15, 0.25], "Discretize": 1, "NbColors": 44, "NbLabels": 22, "Title": "My presentation", "UseLogScale": 1, "Orientation": 'Horizontal', "Orientation_BasePlane": [Orientation.ZX, 22, 33], "Orientation_CuttingPlanes": [Orientation.YZ, 44, 55], "Displacement": 0.1, "Displacement2": 0.2, "BasePlane_Position": 0.1, "NbLines": 3} @@ -46,6 +54,9 @@ d1 = settings["Displacement"] d2 = settings["Displacement2"] cutlines = CutLinesOnField(med_reader, EntityType.NODE, med_field, 1, nb_lines, orient1, base_ang1, base_ang2, orient2, cut_ang1, cut_ang2, d1, d2) +cutlines.Visibility = 1 +cutlines.SetScalarBarVisibility(GetActiveView(),1) + # apply settings cutlines.Position = settings["Offset"] @@ -70,8 +81,9 @@ bar.Title = settings["Title"] bar.Orientation = settings["Orientation"] # 3. Dump Study +text = smtrace.stop_trace() path_to_save = os.path.join(os.getenv("HOME"), "CutLines.py") -SaveTrace( path_to_save ) +save_trace( path_to_save, text ) # 4. Delete the created objects, recreate the view delete_with_inputs(cutlines) diff --git a/test/VisuPrs/dump_study/B0.py b/test/VisuPrs/dump_study/B0.py index 1c6171f4..fcea366a 100644 --- a/test/VisuPrs/dump_study/B0.py +++ b/test/VisuPrs/dump_study/B0.py @@ -22,6 +22,14 @@ from paravistest import datadir from presentations import * from pvsimple import * +from paravistest import save_trace +from paraview import smtrace + +GetActiveViewOrCreate('RenderView') + +config = smtrace.start_trace() +config.SetFullyTraceSupplementalProxies(True) +config.SetPropertiesToTraceOnCreate(config.RECORD_ALL_PROPERTIES) # 1. TimeStamps.med import file_path = datadir + "TimeStamps.med" @@ -57,8 +65,9 @@ for name in prs_names: prs_list.append(prs) # 3. Dump Study +text = smtrace.stop_trace() path_to_save = os.path.join(os.getenv("HOME"), "AllPresentations.py") -SaveTrace( path_to_save ) +save_trace( path_to_save, text ) # 4. Delete the created objects, recreate the view source_list = GetSources().values() diff --git a/test/VisuPrs/dump_study/B3.py b/test/VisuPrs/dump_study/B3.py index b9e9b77f..a497c918 100644 --- a/test/VisuPrs/dump_study/B3.py +++ b/test/VisuPrs/dump_study/B3.py @@ -22,6 +22,12 @@ import paravistest from presentations import * from pvsimple import * +from paravistest import save_trace +from paraview import smtrace + +config = smtrace.start_trace() +config.SetFullyTraceSupplementalProxies(True) +config.SetPropertiesToTraceOnCreate(config.RECORD_ALL_PROPERTIES) # 1. Table creation title = "My Table" @@ -69,8 +75,9 @@ table.UpdatePipeline() orig_script = table.Script # 2. Dump Study +text = smtrace.stop_trace() path_to_save = os.path.join(os.getenv("HOME"), "table.py") -SaveTrace(path_to_save) +save_trace( path_to_save, text ) # 3. Delete the table Delete(table) diff --git a/test/VisuPrs/dump_study/B4.py b/test/VisuPrs/dump_study/B4.py index 58cd338a..a0425170 100644 --- a/test/VisuPrs/dump_study/B4.py +++ b/test/VisuPrs/dump_study/B4.py @@ -22,6 +22,13 @@ import paravistest from presentations import * from pvsimple import * +from paravistest import save_trace +from paraview import smtrace + +config = smtrace.start_trace() +config.SetFullyTraceSupplementalProxies(True) +config.SetPropertiesToTraceOnCreate(config.RECORD_ALL_PROPERTIES) + # 1. Table creation title = "My Table" @@ -69,8 +76,9 @@ table.UpdatePipeline() orig_script = table.Script # 2. Dump Study +text = smtrace.stop_trace() path_to_save = os.path.join(os.getenv("HOME"), "table.py") -SaveTrace(path_to_save) +save_trace( path_to_save, text ) # 3. Delete the table Delete(table) diff --git a/test/VisuPrs/dump_study/CMakeLists.txt b/test/VisuPrs/dump_study/CMakeLists.txt index 96dda506..67115b6e 100644 --- a/test/VisuPrs/dump_study/CMakeLists.txt +++ b/test/VisuPrs/dump_study/CMakeLists.txt @@ -18,7 +18,7 @@ # SET(BASE_TESTS A0 B0) -SET(ALL_TESTS A0 A1 A2 A3 A4 A5 A6 A7 A8 A9 B0 B1 B3 B4 B5) +SET(ALL_TESTS A0 A1 A2 A3 A4 A5 A6 A7 A8 A9 B0 B3 B4 B5) # For make test IF(SALOME_PARAVIS_ALL_TEST) diff --git a/test/VisuPrs/imps/A1.py b/test/VisuPrs/imps/A1.py index 8409a800..95695413 100644 --- a/test/VisuPrs/imps/A1.py +++ b/test/VisuPrs/imps/A1.py @@ -41,7 +41,12 @@ def set_prs_colored(prs, proxy, entity, field_name, vector_mode, timestamp_nb): # Set field range data_range = get_data_range(proxy, entity, field_name, vector_mode) - lookup_table.LockScalarRange = 1 + if hasattr(lookup_table,"LockDataRange"): + lookup_table.LockDataRange = 1 + elif hasattr(lookup_table,"LockScalarRange"): + lookup_table.LockScalarRange = 1 + else: + raise RuntimeError("Object %s has no 'LockDataRange' or 'LockScalarRange' attribute!"%(lookup_table)) lookup_table.RGBPoints = [data_range[0], 0, 0, 1, data_range[1], 1, 0, 0] # Set properties -- 2.39.2