/[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 945 by jongui, Tue Jan 30 22:34:27 2007 UTC revision 948 by jongui, Thu Feb 1 07:23:34 2007 UTC
# Line 8  from constant import Viewport Line 8  from constant import Viewport
8    
9  class Light:  class Light:
10      """      """
11      Class that defines a light and its settings.      Class that defines a light.
12      """      """
13    
14      # The SOUTH_WEST default viewport is used when there is only one viewport.      # The SOUTH_WEST default viewport is used when there is only one viewport.
# Line 23  class Light: Line 23  class Light:
23              object              object
24          @param data_collector: Source of data for visualization          @param data_collector: Source of data for visualization
25          @type viewport: L{Viewport <constant.Viewport>} constant          @type viewport: L{Viewport <constant.Viewport>} constant
26          @param viewport: Viewport in which the object is to be rendered on          @param viewport: Viewport in which objects are to be rendered on
27          """          """
28    
29          self.__scene = scene          self.__scene = scene
# Line 37  class Light: Line 37  class Light:
37          """          """
38          Set up the light and associate it with the renderer.          Set up the light and associate it with the renderer.
39          """          """
40    
41          self.__scene._addLight(self.__viewport, self.__vtk_light)          self.__scene._addLight(self.__viewport, self.__vtk_light)
42    
43      def setColor(self, color):      def setColor(self, color):
# Line 69  class Light: Line 70  class Light:
70    
71          self.__vtk_light.SetPosition(position._getGlobalPosition())          self.__vtk_light.SetPosition(position._getGlobalPosition())
72    
73        # Elevation and azimuth was set to zero so that users do not necessarily
74        # need to always change both at the same time.
75      def setAngle(self, elevation = 0, azimuth = 0):      def setAngle(self, elevation = 0, azimuth = 0):
76          """          """
77          Set the position and focal point of the light based on elevation and          Set the position and focal point of the light based on the specified
78          azimuth degree.          elevation and azimuth degrees.
79    
80          @type elevation: Number          @type elevation: Number
81          @param elevation: Degree to rotate the light to the top and bottom          @param elevation: Degree to rotate the light to the top and bottom
82          @type azimuth: Number          @type azimuth: Number
83          @param azimuth: Degree to rotate the camera to the left and right          @param azimuth: Degree to rotate the light to the left and right
84          """          """
85    
86          # NOTE: The elevation angle of light does not seem to suffer the same          # NOTE: The elevation angle of light does not seem to suffer the same

Legend:
Removed from v.945  
changed lines
  Added in v.948

  ViewVC Help
Powered by ViewVC 1.1.26