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

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

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

revision 1077 by jongui, Fri Mar 16 05:00:32 2007 UTC revision 1078 by jongui, Thu Apr 5 06:18:47 2007 UTC
# Line 24  class Camera: Line 24  class Camera:
24          @param scene: Scene in which objects are to be rendered on          @param scene: Scene in which objects are to be rendered on
25          @type data_collector: L{DataCollector <datacollector.DataCollector>}          @type data_collector: L{DataCollector <datacollector.DataCollector>}
26                  object                  object
27          @param data_collector: Deal with source of data for visualisation          @param data_collector: Deal with the source data for vizualisation
28          @type viewport: L{Viewport <constant.Viewport>} constant          @type viewport: L{Viewport <constant.Viewport>} constant
29          @param viewport: Viewport in which objects are to be rendered on          @param viewport: Viewport in which objects are to be rendered on
30          """          """
# Line 41  class Camera: Line 41  class Camera:
41          Setup the camera.          Setup the camera.
42          """          """
43    
         # Default camera focal point is the center of the object.  
         center = self.__data_collector._getOutput().GetCenter()  
         #self.setFocalPoint(GlobalPosition(center[0], center[1], center[2]))  
   
         # Default camera position is the center of the object but with a slight  
         # distance along the z-axis.  
         #self.setPosition(GlobalPosition(center[0], center[1], center[2] * 4))  
   
44          # Assign the camera to the appropriate renderer          # Assign the camera to the appropriate renderer
45          self.__scene._setActiveCamera(self.__viewport, self.__vtk_camera)          self.__scene._setActiveCamera(self.__viewport, self.__vtk_camera)
46          self.__resetCamera()              self.__resetCamera()    
# Line 118  class Camera: Line 110  class Camera:
110    
111          self.__vtk_camera.Elevation(angle)          self.__vtk_camera.Elevation(angle)
112          # Recompute the view up vector. If not used the elevation angle is            # Recompute the view up vector. If not used the elevation angle is  
113          # unable to exceed 87/-87 degrees. Also, a warning resetting the          # unable to exceed 87/-87 degrees. A warning resetting the
114          # view up will also be thrown and the rendered object may be incorrect.          # view up will also be thrown and the rendered object may be incorrect.
115          # With the view up recomputed, the elevation angle can reach between          # With the view up recomputed, the elevation angle can reach between
116          # 90/-90 degrees. Exceeding that, the rendered object may be incorrect.          # 90/-90 degrees. Exceeding that, the rendered object may be incorrect.
# Line 185  class Camera: Line 177  class Camera:
177          the rendered object.          the rendered object.
178    
179          @type distance: Number          @type distance: Number
180          @param distance: Amount to move towards or away          @param distance: Amount to move towards or away the rendered object
181          """          """
182    
183          self.__vtk_camera.Dolly(distance)          self.__vtk_camera.Dolly(distance)
# Line 194  class Camera: Line 186  class Camera:
186      def __resetCameraClippingRange(self):      def __resetCameraClippingRange(self):
187          """          """
188          Reset the camera clipping range based on the bounds of the visible          Reset the camera clipping range based on the bounds of the visible
189          actors. This ensures the rendered object is not cut off.          actors. This ensures the rendered object is not cut-off.
190          Needs to be called whenever the camera's settings are modified.          Needs to be called whenever the camera's settings are modified.
191          """          """
192    

Legend:
Removed from v.1077  
changed lines
  Added in v.1078

  ViewVC Help
Powered by ViewVC 1.1.26