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

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

Parent Directory Parent Directory | Revision Log Revision Log


Revision 992 - (show annotations)
Fri Feb 23 03:35:33 2007 UTC (12 years, 6 months ago) by jongui
File MIME type: text/x-python
File size: 2414 byte(s)
Fix minor bugs in relation to setting the active scalar, vector and tensor for both the scaling and coloring options.
1 from esys.pyvisi import Scene, DataCollector, MapOnPlaneCut, Camera
2 from esys.pyvisi.constant import *
3
4 s = Scene(renderer = Renderer.ONLINE, num_viewport = 4, x_size = 1152,
5 y_size = 864)
6
7 # Create two data collector instances for two different sources.
8 dc1 = DataCollector(source = Source.XML)
9 dc1.setFileName(file_name =
10 "/home/jongui/trunk/pyvisi/test/python/data_data/interior_3D.xml")
11
12 dc2 = DataCollector(source = Source.XML)
13 dc2.setFileName(file_name =
14 "/home/jongui/data/laurent/subduction/source/function.0001.vtk")
15
16 # NOTE: There is a difference between (1) performing rotation followed by
17 # translation and (2) performing translation followed by rotation.
18
19 # Create a map on plane cut instance for the first viewport.
20 mopc1 = MapOnPlaneCut(scene = s, data_collector = dc1,
21 viewport = Viewport.SOUTH_WEST)
22 mopc1.setPlaneToYZ(offset = 1.5)
23
24 c1 = Camera(scene = s, data_collector = dc1, viewport = Viewport.SOUTH_WEST)
25 c1.isometricView()
26
27 # Create three map on plane cut instances for the second viewport.
28 mopc2_1 = MapOnPlaneCut(scene = s, data_collector = dc1,
29 viewport = Viewport.NORTH_WEST)
30 mopc2_1.setPlaneToYZ(offset = 1.5)
31
32 mopc2_2 = MapOnPlaneCut(scene = s, data_collector = dc1,
33 viewport = Viewport.NORTH_WEST)
34 mopc2_2.setPlaneToXZ(offset = 1.5)
35
36 mopc2_3 = MapOnPlaneCut(scene = s, data_collector = dc1,
37 viewport = Viewport.NORTH_WEST)
38 mopc2_3.setPlaneToXY()
39
40 c2 = Camera(scene = s, data_collector = dc2, viewport = Viewport.NORTH_WEST)
41 c2.isometricView()
42
43 # Create a map on plane cut instance for the third viewport.
44 mopc3 = MapOnPlaneCut(scene = s, data_collector = dc2,
45 viewport = Viewport.NORTH_EAST)
46 mopc3.setPlaneToXY()
47 mopc3.rotateX(angle = 89.9)
48
49 c3 = Camera(scene = s, data_collector = dc2, viewport = Viewport.NORTH_EAST)
50 c3.bottomView()
51 c3.azimuth(angle = -40)
52
53 # Create two map on plance cut instances for the fourth viewport.
54 mopc4_1 = MapOnPlaneCut(scene = s, data_collector = dc2,
55 viewport = Viewport.SOUTH_EAST)
56 mopc4_1.setPlaneToXZ()
57 mopc4_1.rotateZ(angle = -20)
58 mopc4_1.setOpacity(opacity = 0.8)
59
60 mopc4_2 = MapOnPlaneCut(scene = s, data_collector = dc2,
61 viewport = Viewport.SOUTH_EAST)
62 mopc4_2.setPlaneToXY()
63 mopc4_2.rotateY(angle = 20)
64 mopc4_2.setOpacity(opacity = 0.8)
65
66 c4 = Camera(scene = s, data_collector = dc2, viewport = Viewport.SOUTH_EAST)
67 c4.elevation(angle = -30)
68
69 s.render()

  ViewVC Help
Powered by ViewVC 1.1.26