1 # Copyright (C) 2010-2016 CEA/DEN, EDF R&D
3 # This library is free software; you can redistribute it and/or
4 # modify it under the terms of the GNU Lesser General Public
5 # License as published by the Free Software Foundation; either
6 # version 2.1 of the License, or (at your option) any later version.
8 # This library is distributed in the hope that it will be useful,
9 # but WITHOUT ANY WARRANTY; without even the implied warranty of
10 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
11 # Lesser General Public License for more details.
13 # You should have received a copy of the GNU Lesser General Public
14 # License along with this library; if not, write to the Free Software
15 # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
17 # See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
20 # This case corresponds to: /visu/united1/B0 case
22 from paravistest import datadir, compare_lists
23 from presentations import *
29 file_path = datadir + "TimeStamps.med"
30 pvsimple.OpenDataFile(file_path)
31 med_reader = pvsimple.GetActiveSource()
33 if med_reader is None:
38 # 2. Create scalar map on deformed shape
39 smondefshape = DeformedShapeAndScalarMapOnField(med_reader, EntityType.NODE, 'vitesse', 1)
40 if smondefshape is None:
48 smondefshape.Position = [0, 0, 0]
49 error = error + compare_lists(smondefshape.Position, [0,0,0])
52 smondefshape.LookupTable.VectorMode = 'Magnitude'
53 if smondefshape.LookupTable.VectorMode != 'Magnitude':
54 print "ScalarMode is wrong..."
59 bar.Position = [0.01, 0.01]
60 error = error + compare_lists(bar.Position, [0.01, 0.01])
63 bar.Position2 = [0.05, 0.5]
64 error = error + compare_lists(bar.Position2, [0.05, 0.5])
66 # Number of colors and labels
67 smondefshape.LookupTable.NumberOfTableValues = 4
68 bar.NumberOfLabels = 5
70 nb_colors = smondefshape.LookupTable.NumberOfTableValues
71 nb_labels = bar.NumberOfLabels
72 error = error + compare_lists([nb_colors, nb_labels], [4, 5])
75 bar.Title = 'Pression, Pa'
76 bar.ComponentTitle = "Comp."
78 if bar.Title != 'Pression, Pa':
79 print "Title is wrong..."
82 if bar.ComponentTitle!= 'Comp.':
83 print "Component title is wrong..."
87 smondefshape.LookupTable.UseLogScale = 0
88 if smondefshape.LookupTable.UseLogScale != 0:
89 print "Error!!! Scaling is wrong"
93 bar.Orientation = 'Horizontal'
94 if bar.Orientation != 'Horizontal':
95 print "ERROR!!! Scalar Bar orientation is wrong..."
99 smondefshape.Input.ScaleFactor = 0.15
100 error = error + compare_lists([smondefshape.Input.ScaleFactor], [0.15])
104 raise RuntimeError, "There is(are) some error(s) was(were) found... For more info see ERRORs above..."