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

Diff of /trunk/doc/examples/pyvisi/all.py

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1209 by jongui, Thu Jun 21 23:17:16 2007 UTC revision 1210 by jongui, Tue Jul 3 05:47:34 2007 UTC
# Line 18  FILE_3D = "interior_3D.xml" Line 18  FILE_3D = "interior_3D.xml"
18  IMAGE_NAME = "all.jpg"  IMAGE_NAME = "all.jpg"
19  JPG_RENDERER = Renderer.ONLINE_JPG  JPG_RENDERER = Renderer.ONLINE_JPG
20    
21  # Create a Scene with four viewports.  # Create a Scene.
22  s = Scene(renderer = JPG_RENDERER, num_viewport = 1, x_size = X_SIZE,  s = Scene(renderer = JPG_RENDERER, num_viewport = 1, x_size = X_SIZE,
23          y_size = Y_SIZE)          y_size = Y_SIZE)
24    
# Line 26  s = Scene(renderer = JPG_RENDERER, num_v Line 26  s = Scene(renderer = JPG_RENDERER, num_v
26  dc1 = DataCollector(source = Source.XML)  dc1 = DataCollector(source = Source.XML)
27  dc1.setFileName(file_name = os.path.join(PYVISI_EXAMPLE_MESHES_PATH, FILE_3D))  dc1.setFileName(file_name = os.path.join(PYVISI_EXAMPLE_MESHES_PATH, FILE_3D))
28    
29  # Create a  MapOnPlaneCut.  # Create a MapOnPlaneCut.
30  mopc1 = MapOnPlaneCut(scene = s, data_collector = dc1,  mopc1 = MapOnPlaneCut(scene = s, data_collector = dc1,
31          viewport = Viewport.SOUTH_WEST)          viewport = Viewport.SOUTH_WEST)
32  mopc1.setPlaneToXY()  mopc1.setPlaneToXY()
# Line 37  vopc1 = VelocityOnPlaneCut(scene = s, da Line 37  vopc1 = VelocityOnPlaneCut(scene = s, da
37  vopc1.setScaleFactor(scale_factor = 0.2)  vopc1.setScaleFactor(scale_factor = 0.2)
38  vopc1.setPlaneToYZ(offset = 2.999)  vopc1.setPlaneToYZ(offset = 2.999)
39    
40  # Create a  SstreamLine.  # Create a StreamLine.
41  sl1 = StreamLine(scene = s, data_collector = dc1,  sl1 = StreamLine(scene = s, data_collector = dc1,
42          viewport = Viewport.SOUTH_WEST, lut = Lut.COLOR, outline = True,          viewport = Viewport.SOUTH_WEST, lut = Lut.COLOR, outline = True,
43          color_mode = ColorMode.SCALAR)          color_mode = ColorMode.SCALAR)
44  sl1.setTubeRadius(radius = 0.02)  sl1.setTubeRadius(radius = 0.02)
45    
46  # Create a  EllipsoidOnPlaneCut.  # Create an EllipsoidOnPlaneCut.
47  eopc1 = EllipsoidOnPlaneCut(scene = s, data_collector = dc1,  eopc1 = EllipsoidOnPlaneCut(scene = s, data_collector = dc1,
48          viewport = Viewport.SOUTH_WEST, lut = Lut.COLOR, outline = True)          viewport = Viewport.SOUTH_WEST, lut = Lut.COLOR, outline = True)
49  eopc1.setScaleFactor(scale_factor = 0.1)  eopc1.setScaleFactor(scale_factor = 0.1)
# Line 51  eopc1.setPlaneToXZ() Line 51  eopc1.setPlaneToXZ()
51  eopc1.rotateX(angle = -40)  eopc1.rotateX(angle = -40)
52  eopc1.translate(x_offset = 0, y_offset = 0.2, z_offset = 0)  eopc1.translate(x_offset = 0, y_offset = 0.2, z_offset = 0)
53    
54  # Create a  ContourOnPlaneClip.  # Create a ContourOnPlaneClip.
55  ctropc1 = ContourOnPlaneClip(scene = s, data_collector = dc1,  ctropc1 = ContourOnPlaneClip(scene = s, data_collector = dc1,
56          viewport  = Viewport.SOUTH_WEST, lut = Lut.COLOR, outline = True)          viewport  = Viewport.SOUTH_WEST, lut = Lut.COLOR, outline = True)
57  ctropc1.setPlaneToXY()  ctropc1.setPlaneToXY()
58  ctropc1.rotateY(angle = 10)  ctropc1.rotateY(angle = 10)
59  ctropc1.generateContours(contours =  3)  ctropc1.generateContours(contours =  3)
60    
61  # Create a  2D text.  # Create a 2D text.
62  t1 = Text2D(scene = s, viewport = Viewport.SOUTH_WEST, text = "Pyvisi")  t1 = Text2D(scene = s, viewport = Viewport.SOUTH_WEST, text = "Pyvisi")
63  t1.setPosition(LocalPosition(x_coor = 350, y_coor = 730))  t1.setPosition(LocalPosition(x_coor = 350, y_coor = 730))
64  t1.setColor(color = Color.BLACK)  t1.setColor(color = Color.BLACK)

Legend:
Removed from v.1209  
changed lines
  Added in v.1210

  ViewVC Help
Powered by ViewVC 1.1.26