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

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

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1029 - (show annotations)
Wed Mar 14 05:01:13 2007 UTC (12 years, 5 months ago) by jongui
File MIME type: text/x-python
File size: 1904 byte(s)
Fixed problems in relation to updates propagating when multiple files/sources are read.
1 from esys.pyvisi import Scene, DataCollector, MapOnPlaneCut, Camera
2 from esys.pyvisi import VelocityOnPlaneCut, StreamLine, EllipsoidOnPlaneCut
3 from esys.pyvisi import ContourOnPlaneClip, Text2D, LocalPosition
4 from esys.pyvisi.constant import *
5
6 s = Scene(renderer = Renderer.ONLINE, num_viewport = 1, x_size = 1152,
7 y_size = 864)
8
9 dc1 = DataCollector(source = Source.XML)
10 dc1.setFileName(file_name =
11 "/home/jongui/trunk/pyvisi/test/python/data_data/interior_3D.xml")
12
13 mopc1 = MapOnPlaneCut(scene = s, data_collector = dc1,
14 viewport = Viewport.SOUTH_WEST)
15 mopc1.setPlaneToXY()
16
17 vopc1 = VelocityOnPlaneCut(scene = s, data_collector = dc1,
18 arrow = Arrow.THREE_D, color_mode = ColorMode.SCALAR)
19 vopc1.setScaleFactor(scale_factor = 0.2)
20 vopc1.setPlaneToYZ(offset = 2.999)
21 vopc1.setDimension(x = 1.5, y = 1.5, z = 1.5)
22
23 sl1 = StreamLine(scene = s, data_collector = dc1,
24 viewport = Viewport.SOUTH_WEST, lut = Lut.COLOR, outline = True,
25 color_mode = ColorMode.SCALAR)
26 sl1.setTubeRadius(radius = 0.02)
27
28 eopc1 = EllipsoidOnPlaneCut(scene = s, data_collector = dc1,
29 viewport = Viewport.SOUTH_WEST, lut = Lut.COLOR, outline = True)
30 eopc1.setScaleFactor(scale_factor = 0.1)
31 eopc1.setPlaneToXZ()
32 eopc1.rotateX(angle = -40)
33 eopc1.translate(x_offset = 0, y_offset = 0.2, z_offset = 0)
34 eopc1.setDimension(x = 1, y = 1, z = 1)
35
36 ctropc1 = ContourOnPlaneClip(scene = s, data_collector = dc1,
37 viewport = Viewport.SOUTH_WEST, lut = Lut.COLOR, outline = True)
38 ctropc1.setPlaneToXY()
39 ctropc1.rotateY(angle = 10)
40 ctropc1.generateContours(contours = 3)
41
42 t1 = Text2D(scene = s, viewport = Viewport.SOUTH_WEST, text = "Pyvisi")
43 t1.setPosition(LocalPosition(x_coor = 530, y_coor = 30))
44 t1.setColor(color = Color.BLACK)
45 t1.setFontSize(size = 30)
46 t1.boldOn()
47
48 c1 = Camera(scene = s, data_collector = dc1, viewport = Viewport.SOUTH_WEST)
49 c1.isometricView()
50
51 s.render()

  ViewVC Help
Powered by ViewVC 1.1.26