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

Diff of /trunk/pyvisi/py_src/examples/seriesofreadsoffline.py

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 993 by jongui, Tue Feb 13 04:05:13 2007 UTC revision 994 by jongui, Fri Feb 23 07:00:54 2007 UTC
# Line 1  Line 1 
1  from esys.pyvisi import Scene, DataCollector, MapOnScalarClip, Camera  from esys.pyvisi import Scene, DataCollector, MapOnScalarClip, Camera, Map, Contour
2  from esys.pyvisi.constant import *  from esys.pyvisi.constant import *
3    import time
4    
5  s = Scene(renderer = Renderer.OFFLINE_JPG, num_viewport = 1, x_size = 1152,  s = Scene(renderer = Renderer.OFFLINE_JPG, num_viewport = 4, x_size = 1152,
6          y_size = 864)          y_size = 864)
7    
8  dc1 = DataCollector(source = Source.XML)  dc1 = DataCollector(source = Source.XML)
9  dc1.setFileName(file_name =  dc1.setFileName(file_name =
10          "/home/jongui/data/laurent/subduction/source/function.0001.vtk")          "/home/jongui/data/laurent/talus/source/phi_talus_lava.0200.vtu")
11    dc1.setActiveScalar("lava")
12    
13  # Create a map on scalar clip instance.  dc2 = DataCollector(source = Source.XML)
14  mosc1_1 = MapOnScalarClip(scene = s, data_collector = dc1, lut = Lut.GREY_SCALE)  dc2.setFileName(file_name =
15            "/home/jongui/data/laurent/talus/source/phi_talus_lava.0200.vtu")
16    
17    mosc1_1 = Contour(scene = s, data_collector = dc1, lut = Lut.COLOR,
18            viewport = Viewport.SOUTH_WEST)
19    mosc1_1.generateContours(0)
20    
21    mosc1_2 = Contour(scene = s, data_collector = dc2, lut = Lut.COLOR,
22            viewport = Viewport.SOUTH_WEST)
23    mosc1_2.generateContours(0)
24    
 c1 = Camera(scene = s, data_collector = dc1, viewport = Viewport.SOUTH_WEST)  
 c1.isometricView()  
25    
26  # Generate multiple images from multiple files.  # Generate multiple images from multiple files.
27  for i in range(1,50):  for i in range(90, 600):
28      print "Generating image", i      print "Generating image", i
29      dc1.setFileName(file_name =      dc1.setFileName(file_name =
30              "/home/jongui/data/laurent/subduction/source/function.%04d.vtk" % i)          "/home/jongui/data/laurent/talus/source/phi_talus_lava.%04d.vtu" % i)
31      s.saveImage("output/%04d.jpg" % i)      dc1.setActiveScalar("lava")
32        dc2.setFileName(file_name =
33            "/home/jongui/data/laurent/talus/source/phi_talus_lava.%04d.vtu" % i)
34    
35        s.saveImage("output/%04d.jpg" % i)

Legend:
Removed from v.993  
changed lines
  Added in v.994

  ViewVC Help
Powered by ViewVC 1.1.26