From: rnv Date: Wed, 10 Feb 2016 12:19:01 +0000 (+0300) Subject: Update ParaVis non-regression test base in the following ways: X-Git-Tag: V8_1_0a1~28 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=4219a9d9679780c1891cf8f4d5cf178df0220ecd;p=modules%2Fparavis.git Update ParaVis non-regression test base in the following ways: 1) Remove tests which use corrupted med files, namelly - forma01f.resu.med (bugs/C4); - zzzz121b.med (ImportMedField/B3); - Bug619-result_calcul_OCC.med (bugs/D0); 2) Remove GaussPoints/C5 test and */F7 tests since these tests are used occ4050.med file, which is corrupted; 3) Disable TableReader tests (Tables/*, bugs/C8, bugs/D5 ); 4) Change way of the comparision sizes of the picture: compare resolution instead size in bytes; 5) Adoptation tests for ParaView-5.0.0. --- diff --git a/CMakeLists.txt b/CMakeLists.txt index 027dc6c7..cb4abe68 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -65,7 +65,7 @@ LIST(APPEND CMAKE_MODULE_PATH "${PROJECT_SOURCE_DIR}/adm_local/cmake_files") # ============ OPTION(SALOME_BUILD_DOC "Generate SALOME GUI documentation" ON) OPTION(SALOME_BUILD_TESTS "Build SALOME tests" ON) -OPTION(SALOME_PARAVIS_ALL_TEST "Add all tests for Salome PARAVIS module" OFF) +OPTION(SALOME_PARAVIS_ALL_TEST "Add all tests for Salome PARAVIS module" ON) OPTION(SALOME_PARAVIS_BUILD_PLUGINS "Build PARAVIS plugins (MEDReader, etc ...)" ON) OPTION(SALOME_PARAVIS_BUILD_CORBA_PLUGINS "Build PARAVIS CORBA plugins (ParaMEDCorba -- this requires the SALOME MED module)" ON) OPTION(SALOME_PARAVIS_USE_GEOM_SOURCE "Import a GEOMETRY object to PARAVIS via its Corba IOR" OFF) diff --git a/src/PV_SWIG/presentations.py b/src/PV_SWIG/presentations.py index c8802d0c..02097ac4 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('/') @@ -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 diff --git a/test/VisuPrs/CMakeLists.txt b/test/VisuPrs/CMakeLists.txt index cb17f4ac..0791257f 100644 --- a/test/VisuPrs/CMakeLists.txt +++ b/test/VisuPrs/CMakeLists.txt @@ -51,7 +51,8 @@ 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 diff --git a/test/VisuPrs/CutLines/CMakeLists.txt b/test/VisuPrs/CutLines/CMakeLists.txt index 1ac03051..9f44641b 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,9 @@ FOREACH(tfile ${TEST_NAMES}) SET_TESTS_PROPERTIES(${TEST_NAME} PROPERTIES ENVIRONMENT "${tests_env}") ENDFOREACH() +# Increase timeout for specific tests +SET_TESTS_PROPERTIES(CUTLINES_F4 PROPERTIES TIMEOUT 5000) + # 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 0480624c..00000000 --- a/test/VisuPrs/CutLines/F7.py +++ /dev/null @@ -1,35 +0,0 @@ -# Copyright (C) 2010-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 -# - -# 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 fb438d6b..09362362 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 86917ebd..00000000 --- a/test/VisuPrs/CutPlanes/F7.py +++ /dev/null @@ -1,35 +0,0 @@ -# Copyright (C) 2010-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 -# - -# 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 6ba51528..c0c1ac92 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 3b79a0b3..00000000 --- a/test/VisuPrs/DeformedShape/F7.py +++ /dev/null @@ -1,35 +0,0 @@ -# Copyright (C) 2010-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 -# - -# 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 28afebc5..00000000 --- a/test/VisuPrs/GaussPoints/C5.py +++ /dev/null @@ -1,59 +0,0 @@ -# Copyright (C) 2010-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 -# - -# 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 f45b6ec2..540e317d 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 1f303605..00000000 --- a/test/VisuPrs/ImportMedField/B3.py +++ /dev/null @@ -1,29 +0,0 @@ -# Copyright (C) 2010-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 -# - -# 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 3a9dd576..7106d67d 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 1ee8e35f..97ae621c 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 fac1ee43..00000000 --- a/test/VisuPrs/IsoSurfaces/F7.py +++ /dev/null @@ -1,35 +0,0 @@ -# Copyright (C) 2010-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 -# - -# 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 dbd9e4c1..c01ad8c2 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 7a7d9f40..00000000 --- a/test/VisuPrs/MeshPresentation/F7.py +++ /dev/null @@ -1,35 +0,0 @@ -# Copyright (C) 2010-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 -# - -# 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 c8e6ad44..a3b133d1 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 a2fede0b..00000000 --- a/test/VisuPrs/Plot3D/F7.py +++ /dev/null @@ -1,35 +0,0 @@ -# Copyright (C) 2010-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 -# - -# 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 6df0be1b..62ef2168 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 40e29653..515be7d4 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 ada4c64b..9deac837 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 4953deb6..54d973dd 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 dad9c8be..76f7a93f 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 a74c8d12..c9592746 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 cd1158e5..16b0e1ca 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 da55c773..00000000 --- a/test/VisuPrs/ScalarMap/F7.py +++ /dev/null @@ -1,35 +0,0 @@ -# Copyright (C) 2010-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 -# - -# 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 9a3bc7f8..e007fe88 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 f8d88951..36c0b384 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 8fa9272e..00000000 --- a/test/VisuPrs/ScalarMap_On_DeformedShape/F7.py +++ /dev/null @@ -1,35 +0,0 @@ -# Copyright (C) 2010-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 -# - -# 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 3e79f55d..4f9190f4 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 9aaf6cfd..67e11ba6 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 2ca5f84d..a95832bc 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 e1987c7f..00000000 --- a/test/VisuPrs/StreamLines/F7.py +++ /dev/null @@ -1,36 +0,0 @@ -# Copyright (C) 2010-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 -# - -# 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 d23f2071..de650734 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 ab42d0b3..d2e554fb 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 1f787726..3ecd6896 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 04bc4f28..1ac975f8 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 1a121a0e..00000000 --- a/test/VisuPrs/Vectors/F7.py +++ /dev/null @@ -1,35 +0,0 @@ -# Copyright (C) 2010-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 -# - -# 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 1c3fdff9..00000000 --- a/test/VisuPrs/bugs/C4.py +++ /dev/null @@ -1,67 +0,0 @@ -# Copyright (C) 2010-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 -# - -# 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/CMakeLists.txt b/test/VisuPrs/bugs/CMakeLists.txt index e06ed1bd..2a0c0907 100644 --- a/test/VisuPrs/bugs/CMakeLists.txt +++ b/test/VisuPrs/bugs/CMakeLists.txt @@ -18,8 +18,8 @@ # 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(ALL_TESTS A0 A1 A2 A3 A4 A5 A6 A7 A9 B1 C3 C5 C6 C7 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 80b4fd58..00000000 --- a/test/VisuPrs/bugs/D0.py +++ /dev/null @@ -1,78 +0,0 @@ -# Copyright (C) 2010-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 -# - -# 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 e781c12b..dacae295 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 6323f013..11b6b14a 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 8087706f..762f28c7 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'} @@ -52,9 +60,10 @@ bar.NumberOfLabels = settings["NbLabels"] bar.Title = settings["Title"] bar.Orientation = settings["Orientation"] +text = smtrace.stop_trace() # 3. Dump Study 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) diff --git a/test/VisuPrs/imps/A1.py b/test/VisuPrs/imps/A1.py index 118ec742..56c3525f 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