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

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

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

revision 1148 by jongui, Wed May 16 22:45:33 2007 UTC revision 1189 by jongui, Thu Jun 7 05:31:25 2007 UTC
# Line 57  class StreamLine(DataSetMapper, Actor3D, Line 57  class StreamLine(DataSetMapper, Actor3D,
57          @param outline: Places an outline around the domain surface          @param outline: Places an outline around the domain surface
58          """          """
59    
         self.__scene = scene  
60          self.__data_collector = data_collector          self.__data_collector = data_collector
61          self.__viewport = viewport          self.__viewport = viewport
62          self.__color_mode = color_mode          self.__color_mode = color_mode
# Line 90  class StreamLine(DataSetMapper, Actor3D, Line 89  class StreamLine(DataSetMapper, Actor3D,
89    
90              # Default line width is 1.              # Default line width is 1.
91              actor3D._setLineWidth(1)              actor3D._setLineWidth(1)
92              self.__scene._addActor3D(self.__viewport, actor3D._getActor3D())              scene._addActor3D(self.__viewport, actor3D._getActor3D())
93    
94          # ----- Streamline -----          # ----- Streamline -----
95    
# Line 122  class StreamLine(DataSetMapper, Actor3D, Line 121  class StreamLine(DataSetMapper, Actor3D,
121                  lookup_table._getLookupTable())                  lookup_table._getLookupTable())
122    
123          self._setupActor3D(self._getDataSetMapper())          self._setupActor3D(self._getDataSetMapper())
124          self.__scene._addActor3D(self.__viewport, self._getActor3D())          scene._addActor3D(self.__viewport, self._getActor3D())
125    
126      def _isModified(self):        def _isModified(self):  
127          """          """
# Line 134  class StreamLine(DataSetMapper, Actor3D, Line 133  class StreamLine(DataSetMapper, Actor3D,
133    
134          return self.__modified or self.__data_collector._isModified()          return self.__modified or self.__data_collector._isModified()
135    
136      def _render(self):      def _render(self, scene):
137          """          """
138          Render the streamline.          Render the streamline.
139    
140            @type scene: L{Scene <scene.Scene>} object
141            @param scene: Scene in which objects are to be rendered on
142          """          """
143    
144          if (self._isModified() == True):          if (self._isModified() == True):
# Line 156  class StreamLine(DataSetMapper, Actor3D, Line 158  class StreamLine(DataSetMapper, Actor3D,
158              if(self.__color_mode == ColorMode.VECTOR):                            if(self.__color_mode == ColorMode.VECTOR):              
159                  self._setScalarVisibilityOn()                  self._setScalarVisibilityOn()
160                  self._setSpeedScalarsOn()                  self._setSpeedScalarsOn()
161                  self._setScalarRange(self.__data_collector._getVectorRange())  
162                    # self._isScalarRangeSet checks whether the scalar range has
163                    # beenspecified by the user. If it has, then the scalar range
164                    # read from the source will be ignored.
165                    if(not(self._isScalarRangeSet())):
166                        self._setScalarRange(\
167                                self.__data_collector._getVectorRange())
168              # Color streamline by scalar.              # Color streamline by scalar.
169              elif(self.__color_mode == ColorMode.SCALAR):                              elif(self.__color_mode == ColorMode.SCALAR):                
170                  self._setScalarVisibilityOn()                  self._setScalarVisibilityOn()
171                  self._setSpeedScalarsOff()                  self._setSpeedScalarsOff()
172                  self._setScalarRange(self.__data_collector._getScalarRange())  
173                    # self._isScalarRangeSet checks whether the scalar range has
174                    # beenspecified by the user. If it has, then the scalar range
175                    # read from the source will be ignored.
176                    if(not(self._isScalarRangeSet())):
177                        self._setScalarRange(\
178                                self.__data_collector._getScalarRange())
179    
180              self.__modified = False              self.__modified = False
181    

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

  ViewVC Help
Powered by ViewVC 1.1.26