/[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 859 by jongui, Wed Sep 20 03:23:16 2006 UTC revision 860 by jongui, Thu Sep 28 08:17:29 2006 UTC
# Line 16  class Image(Common): Line 16  class Image(Common):
16          @type scene: L{Scene <scene.Scene>} object          @type scene: L{Scene <scene.Scene>} object
17          @param scene: Scene in which components are to be added to          @param scene: Scene in which components are to be added to
18          @type format: String          @type format: String
19          @param format: Format of the image (i.e. jpg)          @param format: Format of the image (i.e. jpeg)
20          """          """
21    
22          Common.__init__(self, scene)          Common.__init__(self, scene)
# Line 25  class Image(Common): Line 25  class Image(Common):
25    
26      def getImageReader(self, format):      def getImageReader(self, format):
27          """          """
28          Determines the image format and returns the corresponding image reader.          Determine the image format and return the corresponding image reader.
   
29          @type format: String          @type format: String
30          @param format: Format of the image (i.e. jpg)          @param format: Format of the image
31          @rtype: vtkImageReader2 (i.e. vtkJPEGReader)          @rtype: vtkImageReader2 (i.e. vtkJPEGReader)
32          @return: VTK image reader          @return: VTK image reader that is used to read an image
33          """          """
34    
35          if(format == "jpeg"):          if(format == "jpeg"):
# Line 46  class Image(Common): Line 45  class Image(Common):
45    
46      def setFileName(self, file_name):      def setFileName(self, file_name):
47          """          """
48          Set the file name, and setup the mapper as well as the actor.            Set the file name setup the mapper and the actor.  
           
49          @type file_name: String          @type file_name: String
50          @param file_name: Image file name          @param file_name: Image file name from which data is to be read
51          """          """
52    
53          vtk_plane = vtk.vtkPlaneSource()          vtk_plane = vtk.vtkPlaneSource()
54          self.vtk_image_reader.SetFileName(file_name)          self.vtk_image_reader.SetFileName(file_name)
   
55          self.setTexture()          self.setTexture()
         #self.setPlane()  
56    
57          Common.setMapperInput(self, vtk_plane.GetOutput())          Common.setMapperInput(self, vtk_plane.GetOutput())
58          Common.setMapperTexture(self, self.vtk_texture)          Common.setActorTexture(self, self.vtk_texture)
59          Common.setActorInput(self)          Common.setActorInput(self)
60          Common.addActor(self)          Common.addActor(self)
61    
# Line 70  class Image(Common): Line 66  class Image(Common):
66    
67          self.vtk_texture.SetInput(self.vtk_image_reader.GetOutput())              self.vtk_texture.SetInput(self.vtk_image_reader.GetOutput())    
68    
 #   def setPlane(self):  
 """  
 Set the texture coordinates (generated from the plane), which controls  
 the positioning of the texture on a surface.  
 """  
   
 #self.vtk_plane = vtk.vtkPlaneSource()  
           
   
69    

Legend:
Removed from v.859  
changed lines
  Added in v.860

  ViewVC Help
Powered by ViewVC 1.1.26