/[escript]/temp_trunk_copy/pyvisi/py_src/light.py
ViewVC logotype

Diff of /temp_trunk_copy/pyvisi/py_src/light.py

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

trunk/pyvisi/py_src/light.py revision 1148 by jongui, Wed May 16 22:45:33 2007 UTC temp_trunk_copy/pyvisi/py_src/light.py revision 1384 by phornby, Fri Jan 11 02:29:38 2008 UTC
# Line 1  Line 1 
1  """  """
2  @author: John NGUI  @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  """  """
9    
10    __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  import vtk  import vtk
22  from position import GlobalPosition  from position import GlobalPosition
23  from constant import Viewport  from constant import Viewport
# Line 24  class Light: Line 40  class Light:
40          @param viewport: Viewport in which objects are to be rendered on          @param viewport: Viewport in which objects are to be rendered on
41          """          """
42    
         self.__scene = scene  
43          self.__viewport = viewport          self.__viewport = viewport
44          self.__vtk_light = vtk.vtkLight()          self.__vtk_light = vtk.vtkLight()
45    
# Line 33  class Light: Line 48  class Light:
48          # Keeps track whether the modification to the light was due to the          # Keeps track whether the modification to the light was due to the
49          # instantiation. If it is, then __setupLight() method is called.          # instantiation. If it is, then __setupLight() method is called.
50          self.__initialization = True          self.__initialization = True
51          self.__scene._addVisualizationModules(self)          scene._addVisualizationModules(self)
52    
53      def __setupLight(self):      def __setupLight(self, scene):
54          """          """
55          Set up the light and associate it with the renderer.          Set up the light and associate it with the renderer.
56    
57            @type scene: L{Scene <scene.Scene>} object
58            @param scene: Scene in which objects are to be rendered on
59          """          """
60    
61          self.__scene._addLight(self.__viewport, self.__vtk_light)          scene._addLight(self.__viewport, self.__vtk_light)
62    
63      def setColor(self, color):      def setColor(self, color):
64          """          """
# Line 118  class Light: Line 136  class Light:
136          else:          else:
137              return False              return False
138    
139      def _render(self):      def _render(self, scene):
140          """          """
141          Render the light.          Render the light.
142    
143            @type scene: L{Scene <scene.Scene>} object
144            @param scene: Scene in which objects are to be rendered on
145          """          """
146    
147          if(self._isModified() == True):          if(self._isModified() == True):
148              # Will only be true once only when the light is instantiated.              # Will only be true once only when the light is instantiated.
149              if(self.__initialization == True):              if(self.__initialization == True):
150                  self.__setupLight()                  self.__setupLight(scene)
151                  self.__initialization == False                  self.__initialization == False
152    
153              self.__isModified = False              self.__modified = False
154                            
155    

Legend:
Removed from v.1148  
changed lines
  Added in v.1384

  ViewVC Help
Powered by ViewVC 1.1.26