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

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

Parent Directory Parent Directory | Revision Log Revision Log


Revision 833 - (show annotations)
Fri Sep 1 07:48:20 2006 UTC (14 years, 2 months ago) by jongui
File MIME type: text/x-python
File size: 1547 byte(s)
Added docstrings to openscene.py


1 """
2 class that shows a vector field by arrows
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 __copyright__=""" Copyright (c) 2006 by ACcESS MNRF
12 http://www.access.edu.au
13 Primary Business: Queensland, Australia"""
14 __license__="""Licensed under the Open Software License version 3.0
15 http://www.opensource.org/licenses/osl-3.0.php"""
16 __author__="Paul Cochrane, L. Gross"
17 __url__="http://www.iservo.edu.au/esys"
18 __version__="$Revision:$"
19 __date__="$Date:$"
20
21 import vtk
22
23 class Component:
24 pass
25
26 class Common:
27
28 def __init__(self, open_scene, data_collector):
29 self.open_scene = open_scene
30 self.data_collector = data_collector
31 self.vtk_mapper = None
32 self.vtk_actor = None
33
34 def setMapper(self, component):
35 self.vtk_mapper = vtk.vtkDataSetMapper()
36 eval("self.vtk_mapper.SetInput(%s)" % component)
37
38 def setActor(self):
39 self.vtk_actor = vtk.vtkActor()
40 self.vtk_actor.SetMapper(self.vtk_mapper)
41
42 def addActor(self):
43 self.open_scene.getRenderer().AddActor(self.vtk_actor)
44
45 def setOpacity(self, opacity):
46 self.getProperty().SetOpacity(opacity)
47
48 def setColor(self, red, green, blue):
49 self.getProperty().SetColor(red, green, blue)
50
51 def setRepresentation(self, representation):
52 eval("self.getProperty().SetRepresentationTo%s()" % representation)
53
54 def getProperty(self):
55 return self.vtk_actor.GetProperty()
56
57

  ViewVC Help
Powered by ViewVC 1.1.26