23 |
object |
object |
24 |
@param data_collector: Deal with source of data for visualisation |
@param data_collector: Deal with source of data for visualisation |
25 |
@type viewport: L{Viewport <constant.Viewport>} constant |
@type viewport: L{Viewport <constant.Viewport>} constant |
26 |
@param viewport: Viewport in which object are to be rendered on |
@param viewport: Viewport in which objects are to be rendered on |
27 |
""" |
""" |
28 |
|
|
29 |
self.__scene = scene |
self.__scene = scene |
43 |
self.setFocalPoint(GlobalPosition(center[0], center[1], center[2])) |
self.setFocalPoint(GlobalPosition(center[0], center[1], center[2])) |
44 |
|
|
45 |
# Default camera position is the center of the object but with a slight |
# Default camera position is the center of the object but with a slight |
46 |
# distance on the z-axis. |
# distance along the z-axis. |
47 |
self.setPosition(GlobalPosition(center[0], center[1], center[2] * 3)) |
self.setPosition(GlobalPosition(center[0], center[1], center[2] * 4)) |
48 |
|
|
49 |
# Assign the camera to the appropriate renderer |
# Assign the camera to the appropriate renderer |
50 |
self.__scene._setActiveCamera(self.__viewport, self.__vtk_camera) |
self.__scene._setActiveCamera(self.__viewport, self.__vtk_camera) |
133 |
""" |
""" |
134 |
|
|
135 |
self.__vtk_camera.Roll(-angle) |
self.__vtk_camera.Roll(-angle) |
136 |
|
self.__resetCamera() |
137 |
|
|
138 |
def backView(self): |
def backView(self): |
139 |
""" |
""" |
177 |
|
|
178 |
def isometricView(self): |
def isometricView(self): |
179 |
""" |
""" |
180 |
Rotate the camera to view the isometric side of the rendered object. |
Rotate the camera to view the isometric angle of the rendered object. |
181 |
""" |
""" |
182 |
|
|
183 |
self.roll(-45) |
self.roll(-45) |
187 |
""" |
""" |
188 |
Reposition the camera so that all actors can be seen. Needs to |
Reposition the camera so that all actors can be seen. Needs to |
189 |
be called whenever the camera's settings are modified in order for the |
be called whenever the camera's settings are modified in order for the |
190 |
changes to take effect correctly. |
changes to take effect. |
191 |
""" |
""" |
192 |
|
|
193 |
self.__scene._getRenderer()[self.__viewport].ResetCamera() |
self.__scene._getRenderer()[self.__viewport].ResetCamera() |