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

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

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1038 - (show annotations)
Fri Mar 16 05:15:37 2007 UTC (12 years, 4 months ago) by jongui
File MIME type: text/x-python
File size: 2001 byte(s)
Added more examples.
1 from esys.pyvisi import Scene, DataCollector, StreamLine, Camera, GlobalPosition
2 from esys.pyvisi.constant import *
3
4 s = Scene(renderer = Renderer.ONLINE, num_viewport = 4, x_size = 1000,
5 y_size = 800)
6
7 dc1 = DataCollector(source = Source.XML)
8 dc1.setFileName(file_name =
9 "/home/jongui/results.xml")
10 dc1.setActiveScalar("scalar2")
11
12 # Create one streamline instance for the first viewport.
13 sl1 = StreamLine(scene = s, data_collector = dc1,
14 viewport = Viewport.SOUTH_WEST, lut = Lut.COLOR, outline = True,
15 color_mode = ColorMode.VECTOR)
16 #sl1.setTubeRadius(radius = 0.01)
17
18 cam1 = Camera(scene = s, data_collector = dc1, viewport = Viewport.SOUTH_WEST)
19 cam1.elevation(angle = -40)
20
21 """
22 # Create one streamline instance for the second viewport.
23 sl2 = StreamLine(scene = s, data_collector = dc1,
24 viewport = Viewport.NORTH_WEST, lut = Lut.COLOR, outline = True)
25 #sl2.setPointSourceRadius(radius = 0.4)
26 #sl2.setPointSourceNumberOfPoints(points = 5)
27 sl2.setTubeRadiusToVaryByScalar()
28
29 cam2 = Camera(scene = s, data_collector = dc1, viewport = Viewport.NORTH_WEST)
30 cam2.elevation(angle = -40)
31 """
32
33 # Create one streamline instance for the third viewport.
34 """
35 sl3 = StreamLine(scene = s, data_collector = dc1,
36 viewport = Viewport.NORTH_EAST, lut = Lut.COLOR, outline = True,
37 color_mode = ColorMode.SCALAR)
38 sl3.setPointSourceCenter(GlobalPosition(x_coor = 0.2, y_coor = 0.2,
39 z_coor = 0.2))
40
41 cam3 = Camera(scene = s, data_collector = dc1, viewport = Viewport.NORTH_EAST)
42 cam3.elevation(angle = -60)
43 """
44
45 """
46 # Create one streamline instance for the fourth viewport.
47 sl4 = StreamLine(scene = s, data_collector = dc1,
48 viewport = Viewport.SOUTH_EAST, lut = Lut.COLOR, outline = True)
49 sl4.setPointSourceCenter(GlobalPosition(x_coor = 0.7, y_coor = 0.7,
50 z_coor = 0.2))
51 sl4.setMaximumPropagationTime(100)
52
53 cam4 = Camera(scene = s, data_collector = dc1, viewport = Viewport.SOUTH_EAST)
54 cam4.elevation(angle = -60)
55 """
56 s.render()
57

  ViewVC Help
Powered by ViewVC 1.1.26