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

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

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1199 - (hide annotations)
Wed Jun 20 05:01:30 2007 UTC (12 years, 2 months ago) by jongui
File MIME type: text/x-python
File size: 2680 byte(s)
- Updated the epydocs and guide.
Deleted redundant files and methods.
Tidied up the codes.
1 ksteube 1147 """
2 jongui 1197 @var __author__: name of author
3     @var __copyright__: copyrights
4     @var __license__: licence agreement
5     @var __url__: url entry point on documentation
6     @var __version__: version
7     @var __date__: date of the version
8 ksteube 1147 """
9    
10 jongui 1197 __author__="John Ngui, john.ngui@uq.edu.au"
11     __copyright__=""" Copyright (c) 2006 by ACcESS MNRF
12     http://www.access.edu.au
13     Primary Business: Queensland, Australia"""
14     __license__="""Licensed under the Open Software License version 3.0
15     http://www.opensource.org/licenses/osl-3.0.php"""
16     __url__="http://www.iservo.edu.au/esys"
17     __version__="$Revision$"
18     __date__="$Date$"
19    
20    
21 ksteube 1147 import vtk
22     from mapper import ImageMapper
23     from imagereslice import ImageReslice
24     from actor import Actor2D
25     from constant import Viewport
26    
27 jongui 1199 # NOTE: ImageMapper, ImageReslice and Actor2D were inherited to allow access
28 ksteube 1147 # to their public methods from the driver.
29     class Logo(ImageMapper, ImageReslice, Actor2D):
30     """
31 jongui 1154 Class that displays a static image, in particular a logo
32     (i.e. company symbol) and has NO interaction capability. The position and
33     size of the logo can be specified.
34 ksteube 1147 """
35    
36     # The SOUTH_WEST default viewport is used when there is only one viewport.
37     # This saves the user from specifying the viewport when there is only one.
38     def __init__(self, scene, image_reader, viewport = Viewport.SOUTH_WEST):
39     """
40     @type scene: L{Scene <scene.Scene>} object
41     @param scene: Scene in which the logo is to be displayed
42     @type image_reader: L{ImageReader <imagereader.ImageReader>}
43 jongui 1148 object
44 ksteube 1147 @param image_reader: Deal with source of data for vizualisation
45     @type viewport: L{Viewport <constant.Viewport>} constant
46     @param viewport: Viewport in which the logo is to be displayed
47     """
48    
49 jongui 1148 self.__image_reader = image_reader
50     self.__viewport = viewport
51    
52     self.__modified = True # Keeps track whether Logo has been modified.
53     ImageReslice.__init__(self)
54     ImageMapper.__init__(self)
55     Actor2D.__init__(self)
56     scene._addVisualizationModules(self)
57    
58 ksteube 1147 # ----- Logo -----
59    
60 jongui 1148 self._setupImageReslice(self.__image_reader._getImageReaderOutput())
61     self._setupImageMapper(self._getImageResliceOutput())
62 ksteube 1147
63 jongui 1148 self._setupActor2D(self._getImageMapper())
64 jongui 1158 scene._addActor2D(self.__viewport, self._getActor2D())
65 ksteube 1147
66 jongui 1148 def _isModified(self):
67     """
68     Return whether the Logo or DataCollector has been modified.
69    
70     @rtype: Boolean
71     @return: True or False
72     """
73    
74     return self.__modified or self.__data_collector._isModified()
75    
76 jongui 1158 def _render(self, scene):
77 jongui 1148 """
78     Render the logo.
79 jongui 1158
80     @type scene: L{Scene <scene.Scene>} object
81     @param scene: Scene in which the logo is to be displayed
82 jongui 1148 """
83    
84     if (self._isModified() == True):
85     self.__modified = False
86    
87    
88    

  ViewVC Help
Powered by ViewVC 1.1.26