/[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 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: 1647 byte(s)
Fixed problems in relation to updates propagating when multiple files/sources are read.
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 with interaction capability.
20 """
21
22 # The SOUTH_WEST default viewport is used when there is only one viewport.
23 # This saves the user from specifying the viewport when there is only one.
24 def __init__(self, scene, image_reader, viewport = Viewport.SOUTH_WEST):
25 """
26 @type scene: L{Scene <scene.Scene>} object
27 @param scene: Scene in which objects are to be rendered on
28 @type image_reader: L{ImageReader <imagereader.ImageReader>}
29 object
30 @param image_reader: Deal with source of image for visualisation
31 @type viewport: L{Viewport <constant.Viewport>} constant
32 @param viewport: Viewport in which objects are to be rendered on
33 """
34
35 # ----- Image -----
36
37 Texture.__init__(self, image_reader._getOutput())
38 PlaneSource.__init__(self)
39
40 Transform.__init__(self)
41 TransformFilter.__init__(self, PlaneSource._getOutput(self),
42 Transform._getTransform(self))
43
44 DataSetMapper.__init__(self, TransformFilter._getOutput(self))
45
46 Actor3D.__init__(self, DataSetMapper._getDataSetMapper(self))
47 Actor3D._setTexture(self, Texture._getTexture(self))
48
49 scene._addActor3D(viewport, Actor3D._getActor3D(self))
50

  ViewVC Help
Powered by ViewVC 1.1.26