ParaView/Python/Dealing with time: Difference between revisions

From KitwarePublic
Jump to navigationJump to search
mNo edit summary
(Replaced content with "{{ParaView/Template/DeprecatedUsersGuide}} {{ParaView/Template/Footer}}")
Tag: Replaced
 
Line 1: Line 1:
If a reader or a filter supports time, it is easy to request a certain time step from Python. All time requests are set on views, which then propagate them to the representations which then propagate them to the visualization pipeline. Here is an example demonstrating how a time request can be made.
{{ParaView/Template/DeprecatedUsersGuide}}


<source lang="python">
>>> Show(ExodusIIReader(FileName=".../can.ex2"))
>>> Render()
# Get a nice view angle
>>> cam = GetActiveCamera()
>>> cam.Elevation(45)
>>> Render()
# Check the current view time
>>> view = GetActiveView()
>>> view.ViewTime
0.0
>>> reader = GetActiveSource()
>>> reader.TimestepValues
[0.0, 0.00010007373930420727, 0.00019990510190837085,
0.00029996439116075635, 0.00040008654468692839,
...]
>>> tsteps = reader.TimestepValues
# Let’s be fancy and use a time annotation filter. This will show the
# current time value of the reader as text in the corner of the view.
>>> annTime = AnnotateTimeFilter(reader)
# Show the filter
>>> Show(annTime)
# Look at a few time steps. Note that the time value is requested not
# the time step index.
>>> view.ViewTime = tsteps[2]
>>> Render()
>>> view.ViewTime = tsteps[4]
>>> Render()
</source>
Back to [[ParaView/PythonRecipes]].
{{ParaView/Template/Footer}}
{{ParaView/Template/Footer}}

Latest revision as of 18:48, 24 June 2024

PAGE DELETED
The Paraview's User Guide and Reference Manual have been moved from the Wiki to The ParaView Guide. Please use the history if you want to access the old version of this document.



ParaView: [Welcome | Site Map]