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/bugs4/E0 case
23 from paravistest import datadir
24 from presentations import *
30 print 'Import "ResOK_0000.med"...............',
31 med_file_path = datadir + "ResOK_0000.med"
32 pvsimple.OpenDataFile(med_file_path)
33 med_reader = pvsimple.GetActiveSource()
34 if med_reader is None:
35 raise RuntimeError, "ResOK_0000.med was not imported!!!"
39 # TODO: in the original VISU script the timestamp id was equal to 2,
40 # but in PARAVIS it's inly one timestamp accessible
43 # 2. Create Scalar Map
44 field_name = 'vitesse'
46 print "Creating Scalar Map......."
47 scmap1 = ScalarMapOnField(med_reader, EntityType.NODE, field_name, timestamp_id)
49 raise RuntimeError, "ScalarMap presentation is None!!!"
56 print "WIREFRAME sur scmap1"
57 scmap1.Representation = 'Wireframe'
58 time.sleep(sleep_delay)
60 print "POINT sur scmap1"
61 scmap1.Representation = 'Points'
62 time.sleep(sleep_delay)
64 print "SURFACEFRAME sur scmap1"
65 scmap1.Representation = 'Surface With Edges'
66 time.sleep(sleep_delay)
68 # 3. Create Deformed Shape And Scalar Map
69 print "Creating DeformedShapeAndScalarMap......."
70 scmap2 = DeformedShapeAndScalarMapOnField(med_reader, EntityType.NODE, field_name, timestamp_id)
72 raise RuntimeError, "DeformedShapeAndScalarMapOnField presentation is None!!!"
76 scmap2.Input.ScaleFactor = 1.0
81 print "WIREFRAME sur scmap2"
82 scmap2.Representation = 'Wireframe'
83 time.sleep(sleep_delay)
85 print "POINT sur scmap2"
86 scmap2.Representation = 'Points'
87 time.sleep(sleep_delay)
89 print "SURFACEFRAME sur scmap2"
90 scmap2.Representation = 'Surface With Edges'
91 time.sleep(sleep_delay)
93 # 4.Create Deformed Shape
94 print "Creating DeformedShape........"
95 scmap3 = DeformedShapeOnField(med_reader, EntityType.NODE, field_name, timestamp_id)
97 raise RuntimeError, "DeformedShapeOnField presentation is None!!!"
101 print "WIREFRAME sur scmap3"
102 scmap3.Representation = 'Wireframe'
103 time.sleep(sleep_delay)
105 print "POINT sur scmap3"
106 scmap3.Representation = 'Points'
107 time.sleep(sleep_delay)
109 print "SURFACEFRAME sur scmap3"
110 scmap3.Representation = 'Surface With Edges'
111 time.sleep(sleep_delay)
113 scmap2.Input.ScaleFactor = 1.0
116 scmap3.ColorArrayName = (EntityType.get_pvtype(EntityType.NODE), field_name)