/[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 974 by jongui, Thu Feb 15 04:36:38 2007 UTC revision 992 by jongui, Fri Feb 23 03:35:33 2007 UTC
# Line 77  class Velocity(DataSetMapper, Actor3D, A Line 77  class Velocity(DataSetMapper, Actor3D, A
77    
78          # ----- Velocity -----          # ----- Velocity -----
79    
80            # NOTE: Two 'ifs' were used instead of an if-elif because an active
81            # scalar and an active vector attribute may be specified at the same
82            # time. One may be for the color mode and the other for the
83            # scaling mode.
84          if(vector != None):          if(vector != None):
85              data_collector._setActiveVector(vector)              data_collector._setActiveVector(vector)
86          elif(scalar != None):          if(scalar != None):
87              data_collector._setActiveScalar(scalar)              data_collector._setActiveScalar(scalar)
88    
89          # NOTE: Lookup table color mapping (color or grey scale) MUST be set          # NOTE: Lookup table color mapping (color or grey scale) MUST be set
# Line 109  class Velocity(DataSetMapper, Actor3D, A Line 113  class Velocity(DataSetMapper, Actor3D, A
113                  lookup_table._getLookupTable())                  lookup_table._getLookupTable())
114    
115          if(color_mode == ColorMode.VECTOR): # Color velocity by vector.          if(color_mode == ColorMode.VECTOR): # Color velocity by vector.
             print "vector .."  
116              Glyph3D._setColorModeByVector(self)              Glyph3D._setColorModeByVector(self)
117              Glyph3D._setRange(self, data_collector._getVectorRange())              Glyph3D._setRange(self, data_collector._getVectorRange())
118              DataSetMapper._setScalarRange(self,              DataSetMapper._setScalarRange(self,
119                      data_collector._getVectorRange())                      data_collector._getVectorRange())
             print data_collector._getVectorRange()  
120          elif(color_mode == ColorMode.SCALAR): # Color velocity by scalar.          elif(color_mode == ColorMode.SCALAR): # Color velocity by scalar.
             print "scalar.."  
121              Glyph3D._setColorModeByScalar(self)              Glyph3D._setColorModeByScalar(self)
122              Glyph3D._setRange(self, data_collector._getScalarRange())              Glyph3D._setRange(self, data_collector._getVectorRange())
123              DataSetMapper._setScalarRange(self,              DataSetMapper._setScalarRange(self,
124                      data_collector._getScalarRange())                      data_collector._getScalarRange())
             print data_collector._getScalarRange()  
125    
126          Actor3D.__init__(self, DataSetMapper._getDataSetMapper(self))          Actor3D.__init__(self, DataSetMapper._getDataSetMapper(self))
127          scene._addActor3D(viewport, Actor3D._getActor3D(self))          scene._addActor3D(viewport, Actor3D._getActor3D(self))
# Line 198  class VelocityOnPlaneCut(DataSetMapper, Line 198  class VelocityOnPlaneCut(DataSetMapper,
198    
199          # ----- Velocity on a cut plane -----          # ----- Velocity on a cut plane -----
200    
201            # NOTE: Two 'ifs' were used instead of an if-elif because an active
202            # scalar and an active vector attribute may be specified at the same
203            # time. One may be for the color mode and the other for the
204            # scaling mode.
205          if(vector != None):          if(vector != None):
206              data_collector._setActiveVector(vector)              data_collector._setActiveVector(vector)
207          elif(scalar != None):          if(scalar != None):
208              data_collector._setActiveScalar(scalar)              data_collector._setActiveScalar(scalar)
209    
210          # NOTE: Lookup table color mapping (color or grey scale) MUST be set          # NOTE: Lookup table color mapping (color or grey scale) MUST be set
# Line 226  class VelocityOnPlaneCut(DataSetMapper, Line 230  class VelocityOnPlaneCut(DataSetMapper,
230          if(arrow == Arrow.TWO_D): # Use 2D arrows.          if(arrow == Arrow.TWO_D): # Use 2D arrows.
231              Arrow2D.__init__(self)              Arrow2D.__init__(self)
232              Glyph3D.__init__(self, Cutter._getOutput(self),              Glyph3D.__init__(self, Cutter._getOutput(self),
233                      Arrow2D._getOutput(self), data_collector._getScalarRange())                      Arrow2D._getOutput(self))
234          elif(arrow == Arrow.THREE_D): # Use 3D arrows.          elif(arrow == Arrow.THREE_D): # Use 3D arrows.
235              Arrow3D.__init__(self)              Arrow3D.__init__(self)
236              Glyph3D.__init__(self, Cutter._getOutput(self),              Glyph3D.__init__(self, Cutter._getOutput(self),
237                      Arrow3D._getOutput(self), data_collector._getScalarRange())                      Arrow3D._getOutput(self))
238    
239          DataSetMapper.__init__(self, Glyph3D._getOutput(self),          DataSetMapper.__init__(self, Glyph3D._getOutput(self),
240                  lookup_table._getLookupTable())                  lookup_table._getLookupTable())
241    
242          if(color_mode == ColorMode.VECTOR): # Color velocity by vector.          if(color_mode == ColorMode.VECTOR): # Color velocity by vector.
243              Glyph3D._setColorModeByVector(self)              Glyph3D._setColorModeByVector(self)
244                Glyph3D._setRange(self, data_collector._getVectorRange())
245              DataSetMapper._setScalarRange(self,              DataSetMapper._setScalarRange(self,
246                      data_collector._getVectorRange())                      data_collector._getVectorRange())
247          elif(color_mode == ColorMode.SCALAR): # Color velocity by scalar.          elif(color_mode == ColorMode.SCALAR): # Color velocity by scalar.
248              Glyph3D._setColorModeByScalar(self)              Glyph3D._setColorModeByScalar(self)
249                Glyph3D._setRange(self, data_collector._getVectorRange())
250              DataSetMapper._setScalarRange(self,              DataSetMapper._setScalarRange(self,
251                      data_collector._getScalarRange())                      data_collector._getScalarRange())
252    
# Line 317  class VelocityOnPlaneClip(DataSetMapper, Line 323  class VelocityOnPlaneClip(DataSetMapper,
323    
324          # ----- Velocity on a clipped plane -----          # ----- Velocity on a clipped plane -----
325    
326            # NOTE: Two 'ifs' were used instead of an if-elif because an active
327            # scalar and an active vector attribute may be specified at the same
328            # time. One may be for the color mode and the other for the
329            # scaling mode.
330          if(vector != None):          if(vector != None):
331              data_collector._setActiveVector(vector)              data_collector._setActiveVector(vector)
332          elif(scalar != None):          if(scalar != None):
333              data_collector._setActiveScalar(scalar)              data_collector._setActiveScalar(scalar)
334    
335          # NOTE: Lookup table color mapping (color or grey scale) MUST be set          # NOTE: Lookup table color mapping (color or grey scale) MUST be set
# Line 345  class VelocityOnPlaneClip(DataSetMapper, Line 355  class VelocityOnPlaneClip(DataSetMapper,
355              Arrow2D.__init__(self)              Arrow2D.__init__(self)
356              #Glyph3D.__init__(self, data_collector._getOutput(),              #Glyph3D.__init__(self, data_collector._getOutput(),
357              Glyph3D.__init__(self, Probe._getOutput(self),              Glyph3D.__init__(self, Probe._getOutput(self),
358                      Arrow2D._getOutput(self), data_collector._getScalarRange())                      Arrow2D._getOutput(self))
359          elif(arrow == Arrow.THREE_D): # Use 3D arrows.          elif(arrow == Arrow.THREE_D): # Use 3D arrows.
360              Arrow3D.__init__(self)              Arrow3D.__init__(self)
361              Glyph3D.__init__(self, Probe._getOutput(self),              Glyph3D.__init__(self, Probe._getOutput(self),
362                      Arrow3D._getOutput(self), data_collector._getScalarRange())                      Arrow3D._getOutput(self))
363                    
364          # NOTE: Clipper must come after Glyph3D. Otherwise, the output will          # NOTE: Clipper must come after Glyph3D. Otherwise, the output will
365          # be incorrect.          # be incorrect.
# Line 362  class VelocityOnPlaneClip(DataSetMapper, Line 372  class VelocityOnPlaneClip(DataSetMapper,
372    
373          if(color_mode == ColorMode.VECTOR): # Color velocity by vector.          if(color_mode == ColorMode.VECTOR): # Color velocity by vector.
374              Glyph3D._setColorModeByVector(self)              Glyph3D._setColorModeByVector(self)
375                Glyph3D._setRange(self, data_collector._getVectorRange())
376              DataSetMapper._setScalarRange(self,              DataSetMapper._setScalarRange(self,
377                      data_collector._getVectorRange())                      data_collector._getVectorRange())
378          elif(color_mode == ColorMode.SCALAR): # Color velocity by scalar.          elif(color_mode == ColorMode.SCALAR): # Color velocity by scalar.
379              Glyph3D._setColorModeByScalar(self)              Glyph3D._setColorModeByScalar(self)
380                Glyph3D._setRange(self, data_collector._getVectorRange())
381              DataSetMapper._setScalarRange(self,              DataSetMapper._setScalarRange(self,
382                      data_collector._getScalarRange())                      data_collector._getScalarRange())
383    

Legend:
Removed from v.974  
changed lines
  Added in v.992

  ViewVC Help
Powered by ViewVC 1.1.26