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

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

Parent Directory Parent Directory | Revision Log Revision Log


Revision 835 - (show annotations)
Mon Sep 4 22:20:28 2006 UTC (13 years, 11 months ago) by jongui
File MIME type: text/x-python
File size: 1094 byte(s)
Added more docstrings and updated the way positions, focal point and view angle are specified.


1 """
2 Class and functions associated with cameras and views
3 """
4
5 import vtk
6
7 class Camera:
8 def __init__(self, open_scene):
9 self.open_scene = open_scene
10 self.vtk_camera = None
11
12 self.setCamera()
13
14 def setCamera(self):
15 self.vtk_camera = vtk.vtkCamera()
16 self.open_scene.getRenderer().SetActiveCamera(self.vtk_camera)
17
18 def setClippingRange(self, near_clipping, far_clipping):
19 self.vtk_camera.SetClippingRange(near_clipping, far_clipping)
20
21 def setFocalPoint(self, position):
22 self.vtk_camera.SetFocalPoint(position.getXCoor(), position.getYCoor(),
23 position.getZCoor())
24
25 def setPosition(self, position):
26 self.vtk_camera.SetPosition(position.getXCoor(), position.getYCoor(),
27 position.getZCoor())
28
29 def setViewUp(self, position):
30 self.vtk_camera.SetViewUp(position.getXCoor(), position.getYCoor(),
31 position.getZCoor())
32
33
34
35
36
37
38 class FrontView(Camera):
39 pass
40
41 class BackView(Camera):
42 pass
43
44 class TopView(Camera):
45 pass
46
47 class BottomView(Camera):
48 pass
49
50 class LeftView(Camera):
51 pass
52
53 class RightView(Camera):
54 pass
55
56 class IsometricView(Camera):
57 pass

  ViewVC Help
Powered by ViewVC 1.1.26