/[escript]/trunk/pyvisi/py_src/examples/seriesofcutsonline.py
ViewVC logotype

Contents of /trunk/pyvisi/py_src/examples/seriesofcutsonline.py

Parent Directory Parent Directory | Revision Log Revision Log


Revision 994 - (show annotations)
Fri Feb 23 07:00:54 2007 UTC (12 years, 4 months ago) by jongui
File MIME type: text/x-python
File size: 967 byte(s)
Modified the way setActiveScalar, setActiveVector and setActiveTensor are specified. It appears that the attributes have to be set each time a new file is read.
1 from esys.pyvisi import Scene, DataCollector, MapOnPlaneCut, Camera
2 from esys.pyvisi.constant import *
3
4 s = Scene(renderer = Renderer.ONLINE, num_viewport = 1, x_size = 1152,
5 y_size = 864)
6
7 # Create two data collector instances.
8 dc1 = DataCollector(source = Source.XML)
9 dc1.setFileName(file_name =
10 "/home/jongui/trunk/pyvisi/test/python/data_data/interior_3D.xml")
11 dc1.setActiveScalar(scalar = "temperature")
12
13 # NOTE: There is a difference between performing rotation then followed by
14 # translation and performing translation then followed by rotation.
15
16 # Create a map on plane cut instance for the first viewport.
17 mopc1 = MapOnPlaneCut(scene = s, data_collector = dc1,
18 viewport = Viewport.SOUTH_WEST)
19 mopc1.setPlaneToYZ(0.1)
20
21 c1 = Camera(scene = s, data_collector = dc1, viewport = Viewport.SOUTH_WEST)
22 c1.isometricView()
23
24 # Animate multiple cuts from the translation.
25 for i in range(0, 60):
26 s.animate()
27 mopc1.translate(0.05,0,0)

  ViewVC Help
Powered by ViewVC 1.1.26