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

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

Parent Directory Parent Directory | Revision Log Revision Log


Revision 974 - (show annotations)
Thu Feb 15 04:36:38 2007 UTC (12 years, 7 months ago) by jongui
File MIME type: text/x-python
File size: 1654 byte(s)
Addressed the issue raised regarding the specific scalar/vector field used for colouring the rendered object for the velocity module. Users can now specify the specific field.
1 from esys.pyvisi import DataCollector, Velocity, Scene
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/trunk/pyvisi/test/python/data_data/interior_3D.xml")
10
11 # Create a velocity instance in the first viewport.
12 v1 = Velocity(scene = s, data_collector = dc1, vector = None, scalar = None,
13 viewport = Viewport.SOUTH_WEST, arrow = Arrow.THREE_D,
14 color_mode = ColorMode.VECTOR, lut = Lut.COLOR, outline = True)
15 v1.setRepresentationToWireframe()
16 v1.setScaleFactor(0.2)
17 v1.setScaleModeByScalar()
18 v1.setDimension(2,2,2)
19
20 # Create a velocity instance in the second viewport.
21 v2 = Velocity(scene = s, data_collector = dc1, vector = None, scalar = None,
22 viewport = Viewport.NORTH_WEST, arrow = Arrow.THREE_D,
23 color_mode = ColorMode.SCALAR, lut = Lut.COLOR, outline = True)
24 v2.setColor(Color.BLUE)
25 v2.setScaleFactor(0.2)
26
27 # Create a velocity instance in the third viewport.
28 v3 = Velocity(scene = s, data_collector = dc1, vector = None, scalar = None,
29 viewport = Viewport.NORTH_EAST, arrow = Arrow.TWO_D,
30 color_mode = ColorMode.VECTOR, lut = Lut.GREY_SCALE, outline = True)
31 v3.setScaleFactor(0.2)
32 v3.setDimension(4,4,4)
33
34 # Create a velocity instance in the fourth viewport.
35 v4 = Velocity(scene = s, data_collector = dc1, vector = None, scalar = None,
36 viewport = Viewport.SOUTH_EAST, arrow = Arrow.TWO_D,
37 color_mode = ColorMode.SCALAR, lut = Lut.COLOR, outline = True)
38 v4.setOpacity(0.5)
39 v4.setScaleFactor(0.2)
40
41 s.render()

  ViewVC Help
Powered by ViewVC 1.1.26