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

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

Parent Directory Parent Directory | Revision Log Revision Log


Revision 943 - (hide annotations)
Mon Jan 29 07:22:43 2007 UTC (14 years, 2 months ago) by jongui
File MIME type: text/x-python
File size: 1430 byte(s)
new pyvisi files
1 jongui 943 """
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    
12     # NOTE: DataSetMapper, Actor3D, Texture and PlaneSource were inherited to
13     # allow access to their public methods from the driver.
14     class Image(DataSetMapper, Actor3D, Texture, PlaneSource):
15     """
16     Class that displayes an image with interaction capability.
17     """
18    
19     # The SOUTH_WEST default viewport is used when there is only one viewport.
20     # This saves the user from specifying the viewport when there is only one.
21     def __init__(self, scene, image_reader, viewport = Viewport.SOUTH_WEST):
22     """
23     @type scene: L{Scene <scene.Scene>} object
24     @param scene: Scene in which objects are to be rendered on
25     @type image_reader: L{ImageReader <datacollector.ImageReader>}
26     object
27     @param image_reader: Deal with source of image for visualisation
28     @type viewport: L{Viewport <constant.Viewport>} constant
29     @param viewport: Viewport in which the object is to be rendered on
30     """
31    
32     # ----- Image -----
33     print "image"
34     Texture.__init__(self, image_reader._getOutput())
35     PlaneSource.__init__(self)
36     DataSetMapper.__init__(self, PlaneSource._getOutput(self))
37    
38     Actor3D.__init__(self, DataSetMapper._getDataSetMapper(self))
39     Actor3D._setTexture(self, Texture._getTexture(self))
40     scene._addActor3D(viewport, Actor3D._getActor3D(self))
41    
42    
43    

  ViewVC Help
Powered by ViewVC 1.1.26