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

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

Parent Directory Parent Directory | Revision Log Revision Log


Revision 830 - (hide annotations)
Thu Aug 31 05:41:09 2006 UTC (14 years, 1 month ago) by jongui
File MIME type: text/x-python
File size: 1628 byte(s)
Added the light and camera components.


1 gross 792 """
2     Class and functions associated with cameras and views
3    
4     @var __author__: name of author
5     @var __license__: licence agreement
6     @var __copyright__: copyrights
7     @var __url__: url entry point on documentation
8     @var __version__: version
9     @var __date__: date of the version
10     """
11    
12     __copyright__=""" Copyright (c) 2006 by ACcESS MNRF
13     http://www.access.edu.au
14     Primary Business: Queensland, Australia"""
15     __license__="""Licensed under the Open Software License version 3.0
16     http://www.opensource.org/licenses/osl-3.0.php"""
17     __author__="Paul Cochrane, L. Gross"
18     __url__="http://www.iservo.edu.au/esys"
19     __version__="$Revision:$"
20     __date__="$Date:$"
21    
22 jongui 830 import vtk
23 gross 792
24 jongui 830 class Camera:
25     def __init__(self, open_scene):
26     self.open_scene = open_scene
27     self.vtk_camera = None
28 gross 792
29 jongui 830 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    
51    
52 gross 792 class FrontView(Camera):
53     pass
54    
55     class BackView(Camera):
56     pass
57    
58     class TopView(Camera):
59     pass
60    
61     class BottomView(Camera):
62     pass
63    
64     class LeftView(Camera):
65     pass
66    
67     class RightView(Camera):
68     pass
69    
70     class IsometricView(Camera):
71     pass

  ViewVC Help
Powered by ViewVC 1.1.26