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

Diff of /trunk/pyvisi/py_src/image.py

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 844 by gross, Fri Jul 28 10:37:16 2006 UTC revision 845 by jongui, Fri Sep 8 07:13:01 2006 UTC
# Line 1  Line 1 
1  """  import vtk
2  class that shows an image  from common import *
3    
4    class Image(Common):
5    
6        def __init__(self, scene, format):
7            Common.__init__(self, scene)
8            self.vtk_image_reader = self.determineReader(format)
9            self.vtk_texture = None
10            self.vtk_plane = None
11    
12        def determineReader(self, format):
13            if(format == "jpg"):
14                return vtk.vtkJPEGReader()  
15            elif(format == "bmp"):
16                return vtk.vtkBMPReader()
17    
18        def setFileName(self, file_name):
19            self.vtk_image_reader.SetFileName(file_name)
20    
21            self.setTexture()
22            self.setPlane()
23    
24            Common.setMapper(self, "self.vtk_plane.GetOutput()")
25            Common.setActor(self)
26            Common.setTexture(self.vtk_texture)
27            Common.addActor(self)
28    
29        def setTexture(self):
30            self.vtk_texture = vtk.vtkTexture()
31            self.vtk_texture.SetInput(self.vtk_image_reader.GetOutput())    
32    
33        def setPlane(self):
34            self.vtk_plane = vtk.vtkPlaneSource()
35            
36            
37            
38            
39            
40            
41    
42    
 @var __author__: name of author  
 @var __license__: licence agreement  
 @var __copyright__: copyrights  
 @var __url__: url entry point on documentation  
 @var __version__: version  
 @var __date__: date of the version  
 """  
 __copyright__="""  Copyright (c) 2006 by ACcESS MNRF  
                     http://www.access.edu.au  
                 Primary Business: Queensland, Australia"""  
 __license__="""Licensed under the Open Software License version 3.0  
              http://www.opensource.org/licenses/osl-3.0.php"""  
 __author__="Paul Cochrane, L. Gross"  
 __url__="http://www.iservo.edu.au/esys"  
 __version__="$Revision:$"  
 __date__="$Date:$"  
   
 from common import Component  
   
 class Image(Component):  
     """  
     shows an image  
     """  
     pass  

Legend:
Removed from v.844  
changed lines
  Added in v.845

  ViewVC Help
Powered by ViewVC 1.1.26