/[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 994 - (show annotations)
Fri Feb 23 07:00:54 2007 UTC (12 years, 2 months ago) by jongui
File MIME type: text/x-python
File size: 1975 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, 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.SCALAR)
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 # Create one streamline instance for the second viewport.
22 sl2 = StreamLine(scene = s, data_collector = dc1,
23 viewport = Viewport.NORTH_WEST, lut = Lut.COLOR, outline = True)
24 sl2.setPointSourceRadius(radius = 0.4)
25 sl2.setPointSourceNumberOfPoints(points = 5)
26 sl2.setTubeRadiusToVaryByScalar()
27
28 cam2 = Camera(scene = s, data_collector = dc1, viewport = Viewport.NORTH_WEST)
29 cam2.elevation(angle = -40)
30
31 # Create one streamline instance for the third viewport.
32 sl3 = StreamLine(scene = s, data_collector = dc1,
33 viewport = Viewport.NORTH_EAST, lut = Lut.COLOR, outline = True,
34 color_mode = ColorMode.SCALAR)
35 sl3.setPointSourceCenter(GlobalPosition(x_coor = 0.2, y_coor = 0.2,
36 z_coor = 0.2))
37
38 cam3 = Camera(scene = s, data_collector = dc1, viewport = Viewport.NORTH_EAST)
39 cam3.elevation(angle = -60)
40
41 # Create one streamline instance for the fourth viewport.
42 sl4 = StreamLine(scene = s, data_collector = dc1,
43 viewport = Viewport.SOUTH_EAST, lut = Lut.COLOR, outline = True)
44 sl4.setPointSourceCenter(GlobalPosition(x_coor = 0.7, y_coor = 0.7,
45 z_coor = 0.2))
46 sl4.setMaximumPropagationTime(100)
47
48 cam4 = Camera(scene = s, data_collector = dc1, viewport = Viewport.SOUTH_EAST)
49 cam4.elevation(angle = -60)
50
51 s.render()
52

  ViewVC Help
Powered by ViewVC 1.1.26