/[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 948 by jongui, Wed Jan 31 03:08:04 2007 UTC revision 949 by jongui, Fri Feb 2 05:33:05 2007 UTC
# Line 12  from tube import Tube Line 12  from tube import Tube
12  from point import PointSource  from point import PointSource
13  from outline import Outline  from outline import Outline
14    
15    # NOTE: DataSetMapper, Actor3D, PointSource, StreamLineModule and Tube  were
16    # inherited to allow access to their public methods from the driver.
17  class StreamLine(DataSetMapper, Actor3D, PointSource, StreamLineModule, Tube):  class StreamLine(DataSetMapper, Actor3D, PointSource, StreamLineModule, Tube):
18                    
19      """      """
# Line 24  class StreamLine(DataSetMapper, Actor3D, Line 26  class StreamLine(DataSetMapper, Actor3D,
26      # be loaded automatically. If no lut is specified, the color scheme will      # be loaded automatically. If no lut is specified, the color scheme will
27      # be used.      # be used.
28      def __init__(self, scene, data_collector, viewport = Viewport.SOUTH_WEST,      def __init__(self, scene, data_collector, viewport = Viewport.SOUTH_WEST,
29          lut = Lut.COLOR, outline = True, color_mode = ColorMode.VECTOR):          lut = Lut.COLOR, color_mode = ColorMode.VECTOR, outline = True):
30    
31          """          """
32          @type scene: L{Scene <scene.Scene>} object          @type scene: L{Scene <scene.Scene>} object
# Line 32  class StreamLine(DataSetMapper, Actor3D, Line 34  class StreamLine(DataSetMapper, Actor3D,
34          @type data_collector: L{DataCollector <datacollector.DataCollector>}          @type data_collector: L{DataCollector <datacollector.DataCollector>}
35                  object                  object
36          @param data_collector: Deal with source of data for visualisation          @param data_collector: Deal with source of data for visualisation
         @type tensor: String  
         @param tensor: Tensor field to load from the source file  
37          @type viewport: L{Viewport <constant.Viewport>} constant          @type viewport: L{Viewport <constant.Viewport>} constant
38          @param viewport: Viewport in which the object is to be rendered on          @param viewport: Viewport in which the object is to be rendered on
39          @type lut : L{Lut <constant.Lut>} constant          @type lut : L{Lut <constant.Lut>} constant
40          @param lut: Lookup table color scheme          @param lut: Lookup table color scheme
41            @type color_mode: L{ColorMode <constant.ColorMode>} constant
42            @param color_mode: Type of color mode
43          @type outline: Boolean          @type outline: Boolean
44          @param outline: Places an outline around the domain surface          @param outline: Places an outline around the domain surface
45          """          """
# Line 64  class StreamLine(DataSetMapper, Actor3D, Line 66  class StreamLine(DataSetMapper, Actor3D,
66              Actor3D._setLineWidth(self, 1)              Actor3D._setLineWidth(self, 1)
67              scene._addActor3D(viewport, Actor3D._getActor3D(self))              scene._addActor3D(viewport, Actor3D._getActor3D(self))
68    
   
69          # ----- Streamline -----          # ----- Streamline -----
70    
   
   
71          # NOTE: Lookup table color mapping (color or grey scale) MUST be set          # NOTE: Lookup table color mapping (color or grey scale) MUST be set
72          # before DataSetMapper. If it is done after DataSetMapper, no effect          # before DataSetMapper. If it is done after DataSetMapper, no effect
73          # will take place.          # will take place.
# Line 84  class StreamLine(DataSetMapper, Actor3D, Line 83  class StreamLine(DataSetMapper, Actor3D,
83                  PointSource._getOutput(self))                  PointSource._getOutput(self))
84    
85          Tube.__init__(self, StreamLineModule._getOutput(self))          Tube.__init__(self, StreamLineModule._getOutput(self))
   
86          DataSetMapper.__init__(self, Tube._getOutput(self),          DataSetMapper.__init__(self, Tube._getOutput(self),
87                  lookup_table._getLookupTable())                  lookup_table._getLookupTable())
88    
         #DataSetMapper._setScalarRange(self, data_collector._getScalarRange())  
   
89          if(color_mode == ColorMode.VECTOR): # Color velocity by vector.          if(color_mode == ColorMode.VECTOR): # Color velocity by vector.
90              DataSetMapper._setScalarRange(self,              DataSetMapper._setScalarRange(self,
91                      data_collector._getVectorRange())                      data_collector._getVectorRange())
             print "vector"  
92          elif(color_mode == ColorMode.SCALAR): # Color velocity by scalar.          elif(color_mode == ColorMode.SCALAR): # Color velocity by scalar.
93              DataSetMapper._setScalarRange(self,              DataSetMapper._setScalarRange(self,
94                      data_collector._getScalarRange())                      data_collector._getScalarRange())
95              print "scalar"  
96          Actor3D.__init__(self, DataSetMapper._getDataSetMapper(self))          Actor3D.__init__(self, DataSetMapper._getDataSetMapper(self))
97          scene._addActor3D(viewport, Actor3D._getActor3D(self))          scene._addActor3D(viewport, Actor3D._getActor3D(self))
98    

Legend:
Removed from v.948  
changed lines
  Added in v.949

  ViewVC Help
Powered by ViewVC 1.1.26