/[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 1147 by ksteube, Wed May 16 06:39:11 2007 UTC revision 1148 by jongui, Wed May 16 22:45:33 2007 UTC
# Line 39  class Image(DataSetMapper, Actor3D, Text Line 39  class Image(DataSetMapper, Actor3D, Text
39          @param viewport: Viewport in which the image is to be displayed          @param viewport: Viewport in which the image is to be displayed
40          """          """
41    
42            self.__scene = scene
43            self.__image_reader = image_reader
44            self.__viewport = viewport
45    
46            # Keeps track whether Image has been modified.
47            self.__modified = True
48            Texture.__init__(self)
49            PlaneSource.__init__(self)
50            Transform.__init__(self)
51            TransformFilter.__init__(self)
52            DataSetMapper.__init__(self)
53            Actor3D.__init__(self)
54            scene._addVisualizationModules(self)
55    
56          # ----- Image -----          # ----- Image -----
57    
58          Texture.__init__(self, image_reader._getOutput())          self._setupTexture(image_reader._getImageReaderOutput())
59          PlaneSource.__init__(self)          self._setupTransformFilter(self._getPlaneSourceOutput(),
60                    self._getTransform())
61    
62          Transform.__init__(self)          self._setupDataSetMapper(self._getTransformFilterOutput())
63          TransformFilter.__init__(self, PlaneSource._getOutput(self),          self._setupActor3D(self._getDataSetMapper())
64                  Transform._getTransform(self))  
65            self._setTexture(self._getTexture())
66            self.__scene._addActor3D(self.__viewport, self._getActor3D())
67    
68          DataSetMapper.__init__(self, TransformFilter._getOutput(self))      def _isModified(self):
69            """
70            Return whether the Image has been modified.
71    
72            @rtype: Boolean
73            @return: True or False
74            """
75    
76          Actor3D.__init__(self, DataSetMapper._getDataSetMapper(self))          if (self.__modified == True):
77          Actor3D._setTexture(self, Texture._getTexture(self))              return True
78            else:
79                return False
80    
81        def _render(self):
82            """
83            Render the image.
84            """
85    
86          scene._addActor3D(viewport, Actor3D._getActor3D(self))          if(self._isModified() == True):
87                self.__isModified = False
88                
89    

Legend:
Removed from v.1147  
changed lines
  Added in v.1148

  ViewVC Help
Powered by ViewVC 1.1.26