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('/')
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
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
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
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
# 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
# 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
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
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
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)
# 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
# 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
# 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
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
# 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
if nb_points or nb_cells:
# prs = pvs.GetRepresentation(proxy)
prs = pvs.Show()
- prs.ColorArrayName = ''
+ prs.ColorArrayName = (None, '')
display_only(prs)
return prs
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})
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)
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)
+++ /dev/null
-# 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)
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)
+++ /dev/null
-# 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)
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)
+++ /dev/null
-# 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)
+++ /dev/null
-# 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)
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)
+++ /dev/null
-# 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)
#
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)
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)
+++ /dev/null
-# 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)
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)
+++ /dev/null
-# 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)
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)
+++ /dev/null
-# 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)
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'
# 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"
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)
# 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)
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
# 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."
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
# 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)
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)
+++ /dev/null
-# 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)
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
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)
# 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 "<b>ERROR!!! Pictures have different width !!!</b>";
+ 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 "<b>WARNING!!! Pictures have different sizes!!!</b>";
+# check sizes of pictures: height
+if abs(max(sizesh)-min(sizesh)) > 0:
+ print "<b>WARNING!!! Pictures have different height !!!</b>";
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
+
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)
+++ /dev/null
-# 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)
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"]
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
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)
+++ /dev/null
-# 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)
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))
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!!!"
import tempfile
import getpass
from datetime import date
+import struct
# Auxiliary variables
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()
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)
+++ /dev/null
-# 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)
+++ /dev/null
-# 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!!!"
-
+++ /dev/null
-# 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..."
# 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)
+++ /dev/null
-# 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)
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
# 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)
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
# 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)
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
+
# 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)
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'}
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"]
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)
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
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
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"]
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)
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
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'}
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"]
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)
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
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]}
# 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"]
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)
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
# 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
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"}
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"]
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)
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
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}
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"]
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)
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
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}
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"]
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)
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
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',
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)
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"
# 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"]
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"]
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)
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
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
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}
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"]
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)
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"
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()
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"
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)
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"
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)
#
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)
# 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