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

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

Parent Directory Parent Directory | Revision Log Revision Log


Revision 962 - (hide annotations)
Tue Feb 13 02:03:23 2007 UTC (12 years, 6 months ago) by jongui
File MIME type: text/x-python
File size: 2303 byte(s)
Added some examples.
1 jongui 962 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.
8     dc1 = DataCollector(source = Source.XML)
9     dc2 = DataCollector(source = Source.XML)
10    
11     dc1.setFileName(file_name =
12     "/home/jongui/trunk/pyvisi/test/python/data_data/interior_3D.xml")
13     dc2.setFileName(file_name =
14     "/home/jongui/data/laurent/subduction/source/function.0001.vtk")
15    
16     # NOTE: There is a difference between performing rotation then followed by
17     # translation and performing translation then 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(1.5)
23    
24     c1 = Camera(scene = s, data_collector = dc2, 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(1.5)
31    
32     mopc2_2 = MapOnPlaneCut(scene = s, data_collector = dc1,
33     viewport = Viewport.NORTH_WEST)
34     mopc2_2.setPlaneToXZ(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(89.9)
48    
49     c3 = Camera(scene = s, data_collector = dc2, viewport = Viewport.NORTH_EAST)
50     c3.bottomView()
51     c3.azimuth(-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(-20)
58     mopc4_1.setOpacity(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(20)
64     mopc4_2.setOpacity(0.8)
65    
66     c4 = Camera(scene = s, data_collector = dc2, viewport = Viewport.SOUTH_EAST)
67     c4.elevation(-30)
68    
69     s.render()

  ViewVC Help
Powered by ViewVC 1.1.26