/[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 1197 by jongui, Mon Jun 18 02:08:34 2007 UTC
# Line 1  Line 1 
1  """  """
2  @author: John NGUI  @var __author__: name of author
3    @var __copyright__: copyrights
4    @var __license__: licence agreement
5    @var __url__: url entry point on documentation
6    @var __version__: version
7    @var __date__: date of the version
8  """  """
9    
10    __author__="John Ngui, john.ngui@uq.edu.au"
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    __url__="http://www.iservo.edu.au/esys"
17    __version__="$Revision$"
18    __date__="$Date$"
19    
20    
21  import vtk  import vtk
22  from mapper import DataSetMapper  from mapper import DataSetMapper
23  from lookuptable import LookupTable  from lookuptable import LookupTable
# Line 57  class StreamLine(DataSetMapper, Actor3D, Line 73  class StreamLine(DataSetMapper, Actor3D,
73          @param outline: Places an outline around the domain surface          @param outline: Places an outline around the domain surface
74          """          """
75    
         self.__scene = scene  
76          self.__data_collector = data_collector          self.__data_collector = data_collector
77          self.__viewport = viewport          self.__viewport = viewport
78          self.__color_mode = color_mode          self.__color_mode = color_mode
# Line 90  class StreamLine(DataSetMapper, Actor3D, Line 105  class StreamLine(DataSetMapper, Actor3D,
105    
106              # Default line width is 1.              # Default line width is 1.
107              actor3D._setLineWidth(1)              actor3D._setLineWidth(1)
108              self.__scene._addActor3D(self.__viewport, actor3D._getActor3D())              scene._addActor3D(self.__viewport, actor3D._getActor3D())
109    
110          # ----- Streamline -----          # ----- Streamline -----
111    
# Line 122  class StreamLine(DataSetMapper, Actor3D, Line 137  class StreamLine(DataSetMapper, Actor3D,
137                  lookup_table._getLookupTable())                  lookup_table._getLookupTable())
138    
139          self._setupActor3D(self._getDataSetMapper())          self._setupActor3D(self._getDataSetMapper())
140          self.__scene._addActor3D(self.__viewport, self._getActor3D())          scene._addActor3D(self.__viewport, self._getActor3D())
141    
142      def _isModified(self):        def _isModified(self):  
143          """          """
# Line 134  class StreamLine(DataSetMapper, Actor3D, Line 149  class StreamLine(DataSetMapper, Actor3D,
149    
150          return self.__modified or self.__data_collector._isModified()          return self.__modified or self.__data_collector._isModified()
151    
152      def _render(self):      def _render(self, scene):
153          """          """
154          Render the streamline.          Render the streamline.
155    
156            @type scene: L{Scene <scene.Scene>} object
157            @param scene: Scene in which objects are to be rendered on
158          """          """
159    
160          if (self._isModified() == True):          if (self._isModified() == True):
# Line 156  class StreamLine(DataSetMapper, Actor3D, Line 174  class StreamLine(DataSetMapper, Actor3D,
174              if(self.__color_mode == ColorMode.VECTOR):                            if(self.__color_mode == ColorMode.VECTOR):              
175                  self._setScalarVisibilityOn()                  self._setScalarVisibilityOn()
176                  self._setSpeedScalarsOn()                  self._setSpeedScalarsOn()
177                  self._setScalarRange(self.__data_collector._getVectorRange())  
178                    # self._isScalarRangeSet checks whether the scalar range has
179                    # beenspecified by the user. If it has, then the scalar range
180                    # read from the source will be ignored.
181                    if(not(self._isScalarRangeSet())):
182                        self._setScalarRange(\
183                                self.__data_collector._getVectorRange())
184              # Color streamline by scalar.              # Color streamline by scalar.
185              elif(self.__color_mode == ColorMode.SCALAR):                              elif(self.__color_mode == ColorMode.SCALAR):                
186                  self._setScalarVisibilityOn()                  self._setScalarVisibilityOn()
187                  self._setSpeedScalarsOff()                  self._setSpeedScalarsOff()
188                  self._setScalarRange(self.__data_collector._getScalarRange())  
189                    # self._isScalarRangeSet checks whether the scalar range has
190                    # beenspecified by the user. If it has, then the scalar range
191                    # read from the source will be ignored.
192                    if(not(self._isScalarRangeSet())):
193                        self._setScalarRange(\
194                                self.__data_collector._getScalarRange())
195    
196              self.__modified = False              self.__modified = False
197    

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

  ViewVC Help
Powered by ViewVC 1.1.26