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

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

Parent Directory Parent Directory | Revision Log Revision Log


Revision 994 - (show annotations)
Fri Feb 23 07:00:54 2007 UTC (12 years, 1 month ago) by jongui
File MIME type: text/x-python
File size: 1042 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.OFFLINE_JPG, 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(offset = 0.1)
20
21 #c1 = Camera(scene = s, data_collector = dc1, viewport = Viewport.SOUTH_WEST)
22 #c1.isometricView()
23
24 # Generate multiple images from the tranlsation.
25 for i in range(0, 30):
26 print "Generating image: ", i
27 s.saveImage("output/%04d.jpg" % i)
28 mopc1.translate(0.1,0,0)

  ViewVC Help
Powered by ViewVC 1.1.26