/[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 943 by jongui, Mon Jan 29 07:22:43 2007 UTC revision 946 by jongui, Wed Jan 31 03:08:04 2007 UTC
# Line 6  import vtk Line 6  import vtk
6  from mapper import DataSetMapper  from mapper import DataSetMapper
7  from lookuptable import LookupTable  from lookuptable import LookupTable
8  from actor import Actor3D  from actor import Actor3D
9  from constant import Viewport, Color, Lut  from constant import Viewport, Color, Lut, ColorMode
10  from streamlinemodule import  StreamLineModule  from streamlinemodule import  StreamLineModule
11  from tube import Tube  from tube import Tube
12  from point import PointSource  from point import PointSource
# Line 24  class StreamLine(DataSetMapper, Actor3D, Line 24  class StreamLine(DataSetMapper, Actor3D,
24      # be loaded automatically. If no lut is specified, the color scheme will      # be loaded automatically. If no lut is specified, the color scheme will
25      # be used.      # be used.
26      def __init__(self, scene, data_collector, viewport = Viewport.SOUTH_WEST,      def __init__(self, scene, data_collector, viewport = Viewport.SOUTH_WEST,
27          lut = Lut.COLOR, outline = True):          lut = Lut.COLOR, outline = True, color_mode = ColorMode.VECTOR):
28    
29          """          """
30          @type scene: L{Scene <scene.Scene>} object          @type scene: L{Scene <scene.Scene>} object
# Line 88  class StreamLine(DataSetMapper, Actor3D, Line 88  class StreamLine(DataSetMapper, Actor3D,
88          DataSetMapper.__init__(self, Tube._getOutput(self),          DataSetMapper.__init__(self, Tube._getOutput(self),
89                  lookup_table._getLookupTable())                  lookup_table._getLookupTable())
90    
91          DataSetMapper._setScalarRange(self, data_collector._getScalarRange())          #DataSetMapper._setScalarRange(self, data_collector._getScalarRange())
92    
93            if(color_mode == ColorMode.VECTOR): # Color velocity by vector.
94                DataSetMapper._setScalarRange(self,
95                        data_collector._getVectorRange())
96                print "vector"
97            elif(color_mode == ColorMode.SCALAR): # Color velocity by scalar.
98                DataSetMapper._setScalarRange(self,
99                        data_collector._getScalarRange())
100                print "scalar"
101          Actor3D.__init__(self, DataSetMapper._getDataSetMapper(self))          Actor3D.__init__(self, DataSetMapper._getDataSetMapper(self))
102          scene._addActor3D(viewport, Actor3D._getActor3D(self))          scene._addActor3D(viewport, Actor3D._getActor3D(self))
103    

Legend:
Removed from v.943  
changed lines
  Added in v.946

  ViewVC Help
Powered by ViewVC 1.1.26