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 |
|
|
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 |
""" |
""" |
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 |