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

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

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

revision 1157 by jongui, Wed May 16 22:45:33 2007 UTC revision 1158 by jongui, Tue May 22 04:24:01 2007 UTC
# Line 24  class Light: Line 24  class Light:
24          @param viewport: Viewport in which objects are to be rendered on          @param viewport: Viewport in which objects are to be rendered on
25          """          """
26    
         self.__scene = scene  
27          self.__viewport = viewport          self.__viewport = viewport
28          self.__vtk_light = vtk.vtkLight()          self.__vtk_light = vtk.vtkLight()
29    
# Line 33  class Light: Line 32  class Light:
32          # Keeps track whether the modification to the light was due to the          # Keeps track whether the modification to the light was due to the
33          # instantiation. If it is, then __setupLight() method is called.          # instantiation. If it is, then __setupLight() method is called.
34          self.__initialization = True          self.__initialization = True
35          self.__scene._addVisualizationModules(self)          scene._addVisualizationModules(self)
36    
37      def __setupLight(self):      def __setupLight(self, scene):
38          """          """
39          Set up the light and associate it with the renderer.          Set up the light and associate it with the renderer.
40    
41            @type scene: L{Scene <scene.Scene>} object
42            @param scene: Scene in which objects are to be rendered on
43          """          """
44    
45          self.__scene._addLight(self.__viewport, self.__vtk_light)          scene._addLight(self.__viewport, self.__vtk_light)
46    
47      def setColor(self, color):      def setColor(self, color):
48          """          """
# Line 118  class Light: Line 120  class Light:
120          else:          else:
121              return False              return False
122    
123      def _render(self):      def _render(self, scene):
124          """          """
125          Render the light.          Render the light.
126    
127            @type scene: L{Scene <scene.Scene>} object
128            @param scene: Scene in which objects are to be rendered on
129          """          """
130    
131          if(self._isModified() == True):          if(self._isModified() == True):
132              # Will only be true once only when the light is instantiated.              # Will only be true once only when the light is instantiated.
133              if(self.__initialization == True):              if(self.__initialization == True):
134                  self.__setupLight()                  self.__setupLight(scene)
135                  self.__initialization == False                  self.__initialization == False
136    
137              self.__isModified = False              self.__isModified = False

Legend:
Removed from v.1157  
changed lines
  Added in v.1158

  ViewVC Help
Powered by ViewVC 1.1.26