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

Contents of /trunk/pyvisi/py_src/examples/map.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: 1587 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 DataCollector, Map, 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 # One DataCollector can be used to specify only one scalar, vector and tensor
8 # attribute from a source. If a second scalar, vector or tensor attribute
9 # needs to be specified from the same source, a second DataCollector must be
10 # created as shown below. In the case below, two scalar attributes 'scalar1'
11 # and 'scalar2' were specified.
12 dc1 = DataCollector(source = Source.XML)
13 dc1.setFileName(file_name =
14 "/home/jongui/results.xml")
15 dc1.setActiveScalar(scalar = "scalar1")
16
17 dc2 = DataCollector(source = Source.XML)
18 dc2.setFileName(file_name =
19 "/home/jongui/results.xml")
20 dc2.setActiveScalar(scalar = "scalar2")
21
22 # Create a map instance for the first viewport.
23 m1 = Map(scene = s, data_collector = dc1, viewport = Viewport.SOUTH_WEST,
24 lut = Lut.COLOR, outline = True)
25 m1.setRepresentationToWireframe()
26
27 # Create a map instance for the second viewport.
28 m2 = Map(scene = s, data_collector = dc2, viewport = Viewport.NORTH_WEST,
29 lut = Lut.COLOR, outline = True)
30 m2.setColor(color = Color.BLUE)
31
32 # Create a map instance for the third viewport.
33 m3 = Map(scene = s, data_collector = dc1, viewport = Viewport.NORTH_EAST,
34 lut = Lut.GREY_SCALE, outline = True)
35
36 # Create a map instance the fourth viewport.
37 m4 = Map(scene = s, data_collector = dc2, viewport = Viewport.SOUTH_EAST,
38 lut = Lut.COLOR, outline = True)
39 m4.setOpacity(opacity = 0.5)
40
41 s.render()

  ViewVC Help
Powered by ViewVC 1.1.26