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 |
""" |
""" |
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() |
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. |
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) |
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 |
|
|