1 # Copyright (C) 2010-2014 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 *
27 my_paravis = paravis.myParavis
32 file_path = datadir + "TimeStamps.med"
33 my_paravis.ImportFile(file_path)
34 med_reader = pvsimple.GetActiveSource()
36 if med_reader is None:
41 # 2. Create scalar map on deformed shape
42 smondefshape = DeformedShapeAndScalarMapOnField(med_reader, EntityType.NODE, 'vitesse', 1)
43 if smondefshape is None:
51 smondefshape.Position = [0, 0, 0]
52 error = error + compare_lists(smondefshape.Position, [0,0,0])
55 smondefshape.LookupTable.VectorMode = 'Magnitude'
56 if smondefshape.LookupTable.VectorMode != 'Magnitude':
57 print "ScalarMode is wrong..."
62 bar.Position = [0.01, 0.01]
63 error = error + compare_lists(bar.Position, [0.01, 0.01])
66 bar.Position2 = [0.05, 0.5]
67 error = error + compare_lists(bar.Position2, [0.05, 0.5])
69 # Number of colors and labels
70 smondefshape.LookupTable.NumberOfTableValues = 4
71 bar.NumberOfLabels = 5
73 nb_colors = smondefshape.LookupTable.NumberOfTableValues
74 nb_labels = bar.NumberOfLabels
75 error = error + compare_lists([nb_colors, nb_labels], [4, 5])
78 bar.Title = 'Pression, Pa'
79 bar.ComponentTitle = "Comp."
81 if bar.Title != 'Pression, Pa':
82 print "Title is wrong..."
85 if bar.ComponentTitle!= 'Comp.':
86 print "Component title is wrong..."
90 smondefshape.LookupTable.UseLogScale = 0
91 if smondefshape.LookupTable.UseLogScale != 0:
92 print "Error!!! Scaling is wrong"
96 bar.Orientation = 'Horizontal'
97 if bar.Orientation != 'Horizontal':
98 print "ERROR!!! Scalar Bar orientation is wrong..."
102 smondefshape.Input.ScaleFactor = 0.15
103 error = error + compare_lists([smondefshape.Input.ScaleFactor], [0.15])
107 raise RuntimeError, "There is(are) some error(s) was(were) found... For more info see ERRORs above..."