/[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 972 - (show annotations)
Wed Feb 14 05:01:45 2007 UTC (14 years, 8 months ago) by jongui
File MIME type: text/x-python
File size: 1760 byte(s)
Added another example that utilises most of the modules available.
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(0.2)
20 vopc1.setPlaneToYZ(2.999)
21 vopc1.setDimension(1.5,1.5,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(0.02)
27
28 eopc1 = EllipsoidOnPlaneCut(scene = s, data_collector = dc1, tensor = None,
29 viewport = Viewport.SOUTH_WEST, lut = Lut.COLOR, outline = True)
30 eopc1.setScaleFactor(0.1)
31 eopc1.setPlaneToXZ()
32 eopc1.rotateX(-45)
33 eopc1.translate(0,1.6,0)
34 eopc1.setDimension(1,1,1)
35
36 ctropc1 = ContourOnPlaneClip(scene = s, data_collector = dc1, scalar = None,
37 viewport = Viewport.SOUTH_WEST, lut = Lut.COLOR, outline = True)
38 ctropc1.setPlaneToXY()
39 ctropc1.rotateY(10)
40 ctropc1.generateContours(3)
41
42 t1 = Text2D(scene = s, viewport = Viewport.SOUTH_WEST, text = "Pyvisi")
43 t1.setPosition(LocalPosition(530, 30))
44 t1.setColor(Color.BLACK)
45 t1.setFontSize(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