19 |
__version__="$Revision:$" |
__version__="$Revision:$" |
20 |
__date__="$Date:$" |
__date__="$Date:$" |
21 |
|
|
22 |
from common import PyvisiObject |
import vtk |
23 |
|
|
24 |
|
class Camera: |
25 |
|
def __init__(self, open_scene): |
26 |
|
self.open_scene = open_scene |
27 |
|
self.vtk_camera = None |
28 |
|
|
29 |
|
self.setCamera() |
30 |
|
|
31 |
|
def setCamera(self): |
32 |
|
self.vtk_camera = vtk.vtkCamera() |
33 |
|
self.open_scene.getRenderer().SetActiveCamera(self.vtk_camera) |
34 |
|
|
35 |
|
def setClippingRange(self, near_clipping, far_clipping): |
36 |
|
self.vtk_camera.SetClippingRange(near_clipping, far_clipping) |
37 |
|
|
38 |
|
def setFocalPoint(self, x_coor, y_coor, z_coor): |
39 |
|
self.vtk_camera.SetFocalPoint(x_coor, y_coor, z_coor) |
40 |
|
|
41 |
|
def setPosition(self, x_coor, y_coor, z_coor): |
42 |
|
self.vtk_camera.SetPosition(x_coor, y_coor, z_coor) |
43 |
|
|
44 |
|
def setViewUp(self, x_view, y_view, z_view): |
45 |
|
self.vtk_camera.SetViewUp(x_view, y_view, z_view) |
46 |
|
|
47 |
|
|
48 |
|
|
49 |
|
|
50 |
|
|
|
class Camera(PyvisiObject): |
|
|
""" |
|
|
A camera |
|
|
""" |
|
|
pass |
|
51 |
|
|
52 |
class FrontView(Camera): |
class FrontView(Camera): |
53 |
pass |
pass |