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/imps/A2 case
23 from paravistest import datadir
24 from presentations import *
25 import pvserver as paravis
28 my_paravis = paravis.myParavis
31 med_file = "pointe.med"
32 entity = EntityType.NODE
33 field_name = "fieldnodedouble";
37 print 'Import "pointe.med"....................',
38 med_file_path = datadir + med_file
39 OpenDataFile(med_file_path)
40 med_reader = pvsimple.GetActiveSource()
42 if med_reader is None:
47 # 2. Create Scalar Map
48 print "Build Scalar Map presentation"
49 scalar_map = ScalarMapOnField(med_reader, entity, field_name, timestamp)
51 display_only(scalar_map)
53 time.sleep(sleep_delay)
55 # 3. Set representation type to Point
56 print "Set representation type to Point"
57 scalar_map.Representation = 'Points'
59 time.sleep(sleep_delay)
61 # 4. Set representation type to Point Sprite
62 print "Set Point Sprite representation"
63 scalar_map.Representation = 'Point Sprite'
65 data_range = get_data_range(med_reader, entity,
66 field_name, 'Magnitude')
67 mult = abs(0.1 / data_range[1])
68 scalar_map.RadiusScalarRange = data_range
69 scalar_map.RadiusTransferFunctionEnabled = 1
70 scalar_map.RadiusMode = 'Scalar'
71 scalar_map.RadiusArray = ['POINTS', field_name]
72 scalar_map.RadiusTransferFunctionMode = 'Table'
73 scalar_map.RadiusScalarRange = data_range
74 scalar_map.RadiusUseScalarRange = 1
75 scalar_map.RadiusIsProportional = 1
76 scalar_map.RadiusProportionalFactor = mult