/[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 1042 by jongui, Fri Mar 16 05:00:32 2007 UTC revision 1043 by jongui, Mon Mar 19 06:46:34 2007 UTC
# Line 12  from glyph import  Glyph3D Line 12  from glyph import  Glyph3D
12  from outline import Outline  from outline import Outline
13  from probe import Probe  from probe import Probe
14  from point import StructuredPoints  from point import StructuredPoints
15    from average import CellDataToPointData
16    
17  # NOTE: DataSetMapper, Actor3D, Arrow2D, Arrow3D, Glyph3D, StructuredPoints and  # NOTE: DataSetMapper, Actor3D, Arrow2D, Arrow3D, Glyph3D, StructuredPoints and
18  # Probe were inherited to allow access to their public methods from the driver.  # Probe were inherited to allow access to their public methods from the driver.
# Line 30  class Velocity(DataSetMapper, Actor3D, A Line 31  class Velocity(DataSetMapper, Actor3D, A
31      # If no lut is specified, the color scheme will be used.      # If no lut is specified, the color scheme will be used.
32      def __init__(self, scene, data_collector, viewport = Viewport.SOUTH_WEST,      def __init__(self, scene, data_collector, viewport = Viewport.SOUTH_WEST,
33              color_mode = ColorMode.VECTOR, arrow = Arrow.TWO_D,                color_mode = ColorMode.VECTOR, arrow = Arrow.TWO_D,  
34              lut = Lut.COLOR, outline = True):              lut = Lut.COLOR, cell_to_point = False, outline = True):
35          """          """
36          @type scene: L{Scene <scene.Scene>} object          @type scene: L{Scene <scene.Scene>} object
37          @param scene: Scene in which objects are to be rendered on          @param scene: Scene in which objects are to be rendered on
# Line 45  class Velocity(DataSetMapper, Actor3D, A Line 46  class Velocity(DataSetMapper, Actor3D, A
46          @param arrow: Type of arrow (two dimensional or three dimensional)          @param arrow: Type of arrow (two dimensional or three dimensional)
47          @type lut : L{Lut <constant.Lut>} constant          @type lut : L{Lut <constant.Lut>} constant
48          @param lut: Lookup table color scheme          @param lut: Lookup table color scheme
49            @type cell_to_point: Boolean
50            @param cell_to_point: Converts cell data to point data (by averaging)
51          @type outline: Boolean          @type outline: Boolean
52          @param outline: Places an outline around the domain surface          @param outline: Places an outline around the domain surface
53          """          """
# Line 84  class Velocity(DataSetMapper, Actor3D, A Line 87  class Velocity(DataSetMapper, Actor3D, A
87              lookup_table = LookupTable()              lookup_table = LookupTable()
88              lookup_table._setLookupTableToGreyScale()              lookup_table._setLookupTableToGreyScale()
89    
90            """
91            if(cell_to_point == True): # Converts cell data to point data.
92                print "YES..."
93                c2p = CellDataToPointData(data_collector._getOutput())
94                StructuredPoints.__init__(self, c2p._getOutput())
95                Probe.__init__(self, c2p._getOutput(),
96                        StructuredPoints._getStructuredPoints(self))
97            elif(cell_to_point == False): # No conversion happens.  
98                print "NO..."
99                StructuredPoints.__init__(self, data_collector._getOutput())
100                Probe.__init__(self, data_collector._getOutput(),
101                        StructuredPoints._getStructuredPoints(self))
102            """
103          StructuredPoints.__init__(self, data_collector._getOutput())          StructuredPoints.__init__(self, data_collector._getOutput())
104          Probe.__init__(self, data_collector._getOutput(),          Probe.__init__(self, data_collector._getOutput(),
105                  StructuredPoints._getStructuredPoints(self))                  StructuredPoints._getStructuredPoints(self))
# Line 94  class Velocity(DataSetMapper, Actor3D, A Line 110  class Velocity(DataSetMapper, Actor3D, A
110                      Arrow2D._getOutput(self))                      Arrow2D._getOutput(self))
111          elif(arrow == Arrow.THREE_D): # Use 3D arrows.          elif(arrow == Arrow.THREE_D): # Use 3D arrows.
112              Arrow3D.__init__(self)              Arrow3D.__init__(self)
113                #Glyph3D.__init__(self, data_collector._getOutput(),
114              Glyph3D.__init__(self, Probe._getOutput(self),              Glyph3D.__init__(self, Probe._getOutput(self),
115                      Arrow3D._getOutput(self))                      Arrow3D._getOutput(self))
116    
117            
118            #c2p = CellDataToPointData(Glyph3D._getOutput(self))
119            #DataSetMapper.__init__(self, c2p._getOutput(),
120            #       lookup_table._getLookupTable())
121    
122          DataSetMapper.__init__(self, Glyph3D._getOutput(self),          DataSetMapper.__init__(self, Glyph3D._getOutput(self),
123                  lookup_table._getLookupTable())                  lookup_table._getLookupTable())
124    
# Line 225  class VelocityOnPlaneCut(DataSetMapper, Line 247  class VelocityOnPlaneCut(DataSetMapper,
247              Glyph3D._setRange(self, data_collector._getVectorRange())              Glyph3D._setRange(self, data_collector._getVectorRange())
248              DataSetMapper._setScalarRange(self,              DataSetMapper._setScalarRange(self,
249                      data_collector._getVectorRange())                      data_collector._getVectorRange())
250                data_collector._paramForUpdatingMultipleSources(VizType.VELOCITY,
251                        ColorMode.VECTOR, DataSetMapper._getDataSetMapper(self),
252                        Glyph3D._getGlyph3D(self))
253    
254          elif(color_mode == ColorMode.SCALAR): # Color velocity by scalar.          elif(color_mode == ColorMode.SCALAR): # Color velocity by scalar.
255              Glyph3D._setColorModeByScalar(self)              Glyph3D._setColorModeByScalar(self)
256              Glyph3D._setRange(self, data_collector._getVectorRange())              Glyph3D._setRange(self, data_collector._getScalarRange())
257              DataSetMapper._setScalarRange(self,              DataSetMapper._setScalarRange(self,
258                      data_collector._getScalarRange())                      data_collector._getScalarRange())
259                data_collector._paramForUpdatingMultipleSources(VizType.VELOCITY,
260                        ColorMode.SCALAR, DataSetMapper._getDataSetMapper(self),
261                        Glyph3D._getGlyph3D(self))
262    
263          Actor3D.__init__(self, DataSetMapper._getDataSetMapper(self))          Actor3D.__init__(self, DataSetMapper._getDataSetMapper(self))
264          scene._addActor3D(viewport, Actor3D._getActor3D(self))          scene._addActor3D(viewport, Actor3D._getActor3D(self))
# Line 341  class VelocityOnPlaneClip(DataSetMapper, Line 370  class VelocityOnPlaneClip(DataSetMapper,
370              Glyph3D._setRange(self, data_collector._getVectorRange())              Glyph3D._setRange(self, data_collector._getVectorRange())
371              DataSetMapper._setScalarRange(self,              DataSetMapper._setScalarRange(self,
372                      data_collector._getVectorRange())                      data_collector._getVectorRange())
373                data_collector._paramForUpdatingMultipleSources(VizType.VELOCITY,
374                        ColorMode.VECTOR, DataSetMapper._getDataSetMapper(self),
375                        Glyph3D._getGlyph3D(self))
376    
377          elif(color_mode == ColorMode.SCALAR): # Color velocity by scalar.          elif(color_mode == ColorMode.SCALAR): # Color velocity by scalar.
378              Glyph3D._setColorModeByScalar(self)              Glyph3D._setColorModeByScalar(self)
379              Glyph3D._setRange(self, data_collector._getVectorRange())              Glyph3D._setRange(self, data_collector._getScalarRange())
380              DataSetMapper._setScalarRange(self,              DataSetMapper._setScalarRange(self,
381                      data_collector._getScalarRange())                      data_collector._getScalarRange())
382                data_collector._paramForUpdatingMultipleSources(VizType.VELOCITY,
383                        ColorMode.SCALAR, DataSetMapper._getDataSetMapper(self),
384                        Glyph3D._getGlyph3D(self))
385    
386          Actor3D.__init__(self, DataSetMapper._getDataSetMapper(self))          Actor3D.__init__(self, DataSetMapper._getDataSetMapper(self))
387          scene._addActor3D(viewport, Actor3D._getActor3D(self))          scene._addActor3D(viewport, Actor3D._getActor3D(self))

Legend:
Removed from v.1042  
changed lines
  Added in v.1043

  ViewVC Help
Powered by ViewVC 1.1.26