/[escript]/trunk/pyvisi/py_src/image.py
ViewVC logotype

Contents of /trunk/pyvisi/py_src/image.py

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1110 - (show annotations)
Thu Apr 19 05:24:28 2007 UTC (12 years ago) by jongui
File MIME type: text/x-python
File size: 2016 byte(s)
Some test for the logo.
1 """
2 @author: John NGUI
3 """
4
5 import vtk
6 from mapper import DataSetMapper
7 from actor import Actor3D
8 from constant import Viewport
9 from texture import Texture
10 from plane import PlaneSource
11 from transform import Transform, TransformFilter
12
13 # NOTE: DataSetMapper, Actor3D, Texture, PlaneSource, Transform and
14 # TransformFilter were inherited to allow access to their public methods
15 # from the driver.
16 class Image(DataSetMapper, Actor3D, Texture, PlaneSource, Transform,
17 TransformFilter):
18 """
19 Class that displays an image which can be scaled (upwards and downwards)
20 and has interaction capability. The image can also be translated and
21 rotated along the X, Y and Z axes.
22
23 @bug: Translating an image works differently (opposite) compared to
24 translating a plane. For example, a positive translation along the
25 z-axis moves a plane up. However, if the identical translation is applied on
26 an image, the image moves down.
27 """
28
29 # The SOUTH_WEST default viewport is used when there is only one viewport.
30 # This saves the user from specifying the viewport when there is only one.
31 def __init__(self, scene, image_reader, viewport = Viewport.SOUTH_WEST):
32 """
33 @type scene: L{Scene <scene.Scene>} object
34 @param scene: Scene in which the image is to be displayed
35 @type image_reader: L{ImageReader <imagereader.ImageReader>}
36 object
37 @param image_reader: Deal with source of data for vizualisation
38 @type viewport: L{Viewport <constant.Viewport>} constant
39 @param viewport: Viewport in which the image is to be displayed
40 """
41
42 # ----- Image -----
43
44 Texture.__init__(self, image_reader._getOutput())
45 PlaneSource.__init__(self)
46
47 Transform.__init__(self)
48 TransformFilter.__init__(self, PlaneSource._getOutput(self),
49 Transform._getTransform(self))
50
51 DataSetMapper.__init__(self, TransformFilter._getOutput(self))
52
53 Actor3D.__init__(self, DataSetMapper._getDataSetMapper(self))
54 Actor3D._setTexture(self, Texture._getTexture(self))
55
56 scene._addActor3D(viewport, Actor3D._getActor3D(self))
57

  ViewVC Help
Powered by ViewVC 1.1.26