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

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

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

revision 1158 by jongui, Tue May 22 04:24:01 2007 UTC revision 1205 by jongui, Fri Jun 29 04:44:04 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 38  class Velocity(DataSetMapper, Actor3D, A Line 54  class Velocity(DataSetMapper, Actor3D, A
54          source is cell data, a conversion to point data may or may not be          source is cell data, a conversion to point data may or may not be
55          required, in order for the object to be rendered correctly.          required, in order for the object to be rendered correctly.
56          If a conversion is needed, the 'cell_to_point' flag must be set to          If a conversion is needed, the 'cell_to_point' flag must be set to
57          'True', otherwise 'False' (which is the default).          'True', otherwise 'False' (which is the default). On occasions, an
58            inaccurate object may be rendered from cell data even after conversion.
59    
60          @type scene: L{Scene <scene.Scene>} object          @type scene: L{Scene <scene.Scene>} object
61          @param scene: Scene in which objects are to be rendered on          @param scene: Scene in which objects are to be rendered on
# Line 153  class Velocity(DataSetMapper, Actor3D, A Line 170  class Velocity(DataSetMapper, Actor3D, A
170              # Color velocity by vector.              # Color velocity by vector.
171              if(self.__color_mode == ColorMode.VECTOR):                            if(self.__color_mode == ColorMode.VECTOR):              
172                  self._setColorModeByVector()                  self._setColorModeByVector()
173                  self._setRange(self.__data_collector._getVectorRange())  
174                  self._setScalarRange(self.__data_collector._getVectorRange())                  # self._isScalarRangeSet checks whether the scalar range has
175                    # been specified by the user. If it has, then the scalar range
176                    # read from the source will be ignored.
177                    if(not(self._isScalarRangeSet())):
178                        self._setRange(self.__data_collector._getVectorRange())
179                        self._setScalarRange(\
180                                self.__data_collector._getVectorRange())
181                    else:
182                        self._setRange(self._getDataSetMapperRange())
183                        
184              # Color velocity by scalar.              # Color velocity by scalar.
185              elif(self.__color_mode == ColorMode.SCALAR):                              elif(self.__color_mode == ColorMode.SCALAR):                
186                  self._setColorModeByScalar()                  self._setColorModeByScalar()
187                  self._setRange(self.__data_collector._getScalarRange())  
188                  self._setScalarRange(self.__data_collector._getScalarRange())                  # self._isScalarRangeSet checks whether the scalar range has
189                    # been specified by the user. If it has, then the scalar range
190                    # read from the source will be ignored.
191                    if(not(self._isScalarRangeSet())):
192                        self._setRange(self.__data_collector._getScalarRange())
193                        self._setScalarRange(\
194                                self.__data_collector._getScalarRange())
195                    else:
196                        self._setRange(self._getDataSetMapperRange())
197    
198              self.__modified = False              self.__modified = False
199    
# Line 194  class VelocityOnPlaneCut(DataSetMapper, Line 228  class VelocityOnPlaneCut(DataSetMapper,
228          source is cell data, a conversion to point data may or may not be          source is cell data, a conversion to point data may or may not be
229          required, in order for the object to be rendered correctly.          required, in order for the object to be rendered correctly.
230          If a conversion is needed, the 'cell_to_point' flag must be set to          If a conversion is needed, the 'cell_to_point' flag must be set to
231          'True', otherwise 'False' (which is the default).          'True', otherwise 'False' (which is the default). On occasions, an
232            inaccurate object may be rendered from cell data even after conversion.
233    
234          @type scene: L{Scene <scene.Scene>} object          @type scene: L{Scene <scene.Scene>} object
235          @param scene: Scene in which objects are to be rendered on          @param scene: Scene in which objects are to be rendered on
# Line 279  class VelocityOnPlaneCut(DataSetMapper, Line 314  class VelocityOnPlaneCut(DataSetMapper,
314          if(self.__arrow == Arrow.TWO_D): # Use 2D arrows.          if(self.__arrow == Arrow.TWO_D): # Use 2D arrows.
315              Arrow2D.__init__(self)              Arrow2D.__init__(self)
316              self._setupGlyph3D(self._getMaskPointsOutput(),              self._setupGlyph3D(self._getMaskPointsOutput(),
317                      self._getActor2DOutput())                      self._getArrow2DOutput())
318          elif(self.__arrow == Arrow.THREE_D): # Use 3D arrows.          elif(self.__arrow == Arrow.THREE_D): # Use 3D arrows.
319              Arrow3D.__init__(self)              Arrow3D.__init__(self)
320              self._setupGlyph3D(self._getMaskPointsOutput(),              self._setupGlyph3D(self._getMaskPointsOutput(),
# Line 316  class VelocityOnPlaneCut(DataSetMapper, Line 351  class VelocityOnPlaneCut(DataSetMapper,
351              # Color velocity by vector.              # Color velocity by vector.
352              if(self.__color_mode == ColorMode.VECTOR):                            if(self.__color_mode == ColorMode.VECTOR):              
353                  self._setColorModeByVector()                  self._setColorModeByVector()
354                  self._setRange(self.__data_collector._getVectorRange())  
355                  self._setScalarRange(self.__data_collector._getVectorRange())                  # self._isScalarRangeSet checks whether the scalar range has
356                    # been specified by the user. If it has, then the scalar range
357                    # read from the source will be ignored.
358                    if(not(self._isScalarRangeSet())):
359                        self._setRange(self.__data_collector._getVectorRange())
360                        self._setScalarRange(\
361                                self.__data_collector._getVectorRange())
362                    else:
363                        self._setRange(self._getDataSetMapperRange())
364    
365              # Color velocity by scalar.              # Color velocity by scalar.
366              elif(self.__color_mode == ColorMode.SCALAR):                              elif(self.__color_mode == ColorMode.SCALAR):                
367                  self._setColorModeByScalar()                  self._setColorModeByScalar()
368                  self._setRange(self.__data_collector._getScalarRange())  
369                  self._setScalarRange(self.__data_collector._getScalarRange())                  # self._isScalarRangeSet checks whether the scalar range has
370                    # been specified by the user. If it has, then the scalar range
371                    # read from the source will be ignored.
372                    if(not(self._isScalarRangeSet())):
373                        self._setRange(self.__data_collector._getScalarRange())
374                        self._setScalarRange(\
375                                self.__data_collector._getScalarRange())
376                    else:
377                        self._setRange(self._getDataSetMapperRange())
378    
379              self.__modified = False              self.__modified = False
380    
# Line 355  class VelocityOnPlaneClip(DataSetMapper, Line 407  class VelocityOnPlaneClip(DataSetMapper,
407          source is cell data, a conversion to point data may or may not be          source is cell data, a conversion to point data may or may not be
408          required, in order for the object to be rendered correctly.          required, in order for the object to be rendered correctly.
409          If a conversion is needed, the 'cell_to_point' flag must be set to          If a conversion is needed, the 'cell_to_point' flag must be set to
410          'True', otherwise 'False' (which is the default).          'True', otherwise 'False' (which is the default). On occasions, an
411            inaccurate object may be rendered from cell data even after conversion.
412    
413          @type scene: L{Scene <scene.Scene>} object          @type scene: L{Scene <scene.Scene>} object
414          @param scene: Scene in which objects are to be rendered on          @param scene: Scene in which objects are to be rendered on
# Line 482  class VelocityOnPlaneClip(DataSetMapper, Line 535  class VelocityOnPlaneClip(DataSetMapper,
535              # Color velocity by vector.              # Color velocity by vector.
536              if(self.__color_mode == ColorMode.VECTOR):                            if(self.__color_mode == ColorMode.VECTOR):              
537                  self._setColorModeByVector()                  self._setColorModeByVector()
538                  self._setRange(self.__data_collector._getVectorRange())  
539                  self._setScalarRange(self.__data_collector._getVectorRange())                  # self._isScalarRangeSet checks whether the scalar range has
540                    # been specified by the user. If it has, then the scalar range
541                    # read from the source will be ignored.
542                    if(not(self._isScalarRangeSet())):
543                        self._setRange(self.__data_collector._getVectorRange())
544                        self._setScalarRange(\
545                                self.__data_collector._getVectorRange())
546                    else:
547                        self._setRange(self._getDataSetMapperRange())
548    
549              # Color velocity by scalar.              # Color velocity by scalar.
550              elif(self.__color_mode == ColorMode.SCALAR):                              elif(self.__color_mode == ColorMode.SCALAR):                
551                  self._setColorModeByScalar()                  self._setColorModeByScalar()
552                  self._setRange(self.__data_collector._getScalarRange())  
553                  self._setScalarRange(self.__data_collector._getScalarRange())                  # self._isScalarRangeSet checks whether the scalar range has
554                    # been specified by the user. If it has, then the scalar range
555                    # read from the source will be ignored.
556                    if(not(self._isScalarRangeSet())):
557                        self._setRange(self.__data_collector._getScalarRange())
558                        self._setScalarRange(\
559                                self.__data_collector._getScalarRange())
560                    else:
561                        self._setRange(self._getDataSetMapperRange())
562    
563              self.__modified = False              self.__modified = False
564    

Legend:
Removed from v.1158  
changed lines
  Added in v.1205

  ViewVC Help
Powered by ViewVC 1.1.26