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/animation/A1 case
25 from paravistest import *
26 from presentations import *
27 from pvsimple import *
29 # 1. TimeStamps.med import
30 print 'Importing "TimeStamps.med"................',
31 file_path = datadir + "TimeStamps.med"
32 OpenDataFile(file_path)
33 med_reader = GetActiveSource()
34 if med_reader is None:
39 # 2. CutLines creation
40 print "Creating Cut Lines........................",
42 cutlines = CutLinesOnField(med_reader, EntityType.NODE, med_field, 1,
44 orientation1=Orientation.XY, orientation2=Orientation.ZX)
51 print "Getting a Viewer.........................",
52 view = GetRenderView()
57 cutlines.Visibility = 1
59 cutlines.Visibility = 0
61 display_only(cutlines, view=view)
65 print "Get Animation scene.....................",
66 scene = GetAnimationScene()
72 print "Duration default... ", scene.Duration
77 print "Duration ... ", scene.Duration
79 print "Loop ... ", scene.Loop
81 print "Loop ... ", scene.Loop
83 print "Loop ... ", scene.Loop
85 print "AnimationTime ... ", scene.AnimationTime
93 print "AnimationTime ... ", scene.AnimationTime
100 print "AnimationTime ... ", scene.AnimationTime
102 scene.AnimationTime = -1
103 scene.AnimationTime = scene.TimeKeeper.TimestepValues[1]
104 scene.AnimationTime = scene.TimeKeeper.TimestepValues[0]
106 nb_frames = scene.NumberOfFrames
107 print "NumberOfFrames ... ", nb_frames