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

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

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1205 - (hide annotations)
Fri Jun 29 04:44:04 2007 UTC (13 years, 1 month ago) by jongui
File MIME type: text/x-python
File size: 20605 byte(s)
- Fixed a minor bug in the Velocity module.
- Added the Rectangle module which enables rectangles to be created.
- Added corresponding examples and test cases for the Rectangle.
- Updated the guide and necessary epydocs.



1 ksteube 1147 """
2 jongui 1197 @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 ksteube 1147 """
9    
10 jongui 1197 __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 ksteube 1147 import vtk
22     from mapper import DataSetMapper
23     from lookuptable import LookupTable
24     from actor import Actor3D
25 jongui 1148 from constant import Viewport, Color, Arrow, ColorMode, Lut
26 ksteube 1147 from arrow import Arrow2D, Arrow3D
27     from glyph import Glyph3D
28     from outline import Outline
29     from point import MaskPoints
30     from average import CellDataToPointData
31    
32     # NOTE: DataSetMapper, Actor3D, Arrow2D, Arrow3D, Glyph3D and
33     # MaskPoints were inherited to allow access to their public
34     # methods from the driver.
35     class Velocity(DataSetMapper, Actor3D, Arrow2D, Arrow3D, Glyph3D, MaskPoints):
36     """
37     Class that shows a vector field using arrows. The arrows can either be
38     colored or grey-scaled, depending on the lookup table used. If the arrows
39     are colored, there are two possible coloring modes, either using vector data
40     or scalar data. Similarly, there are two possible types of
41     arrows, either using two-dimensional or three-dimensional.
42     """
43    
44     # The SOUTH_WEST default viewport is used when there is only one viewport.
45     # This saves the user from specifying the viewport when there is only one.
46     # If no lut is specified, the color scheme will be used.
47 jongui 1148 def __init__(self, scene, data_collector, arrow = Arrow.TWO_D,
48     color_mode = ColorMode.VECTOR, viewport = Viewport.SOUTH_WEST,
49 ksteube 1147 lut = Lut.COLOR, cell_to_point = False, outline = True):
50     """
51     Initialise the Velocity.
52    
53     @attention: The source can either be point or cell data. If the
54     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.
56     If a conversion is needed, the 'cell_to_point' flag must be set to
57 jongui 1199 'True', otherwise 'False' (which is the default). On occasions, an
58     inaccurate object may be rendered from cell data even after conversion.
59 ksteube 1147
60     @type scene: L{Scene <scene.Scene>} object
61     @param scene: Scene in which objects are to be rendered on
62     @type data_collector: L{DataCollector <datacollector.DataCollector>}
63     object
64     @param data_collector: Deal with source of data for visualisation
65 jongui 1148 @type arrow: L{Arrow <constant.Arrow>} constant
66     @param arrow: Type of arrow (two dimensional or three dimensional)
67     @type color_mode: L{ColorMode <constant.ColorMode>} constant
68     @param color_mode: Type of color mode
69 ksteube 1147 @type viewport: L{Viewport <constant.Viewport>} constant
70     @param viewport: Viewport in which objects are to be rendered on
71     @type lut : L{Lut <constant.Lut>} constant
72     @param lut: Lookup table color scheme
73     @type cell_to_point: Boolean
74     @param cell_to_point: Converts cell data to point data (by averaging)
75     @type outline: Boolean
76     @param outline: Places an outline around the domain surface
77     """
78    
79 jongui 1148 self.__data_collector = data_collector
80     self.__arrow = arrow
81     self.__color_mode = color_mode
82     self.__viewport = viewport
83     self.__lut = lut
84     self.__cell_to_point = cell_to_point
85     self.__outline = outline
86    
87     self.__modified = True # Keeps track whether Velocity has been modified.
88     MaskPoints.__init__(self)
89     Glyph3D.__init__(self)
90     DataSetMapper.__init__(self)
91     Actor3D.__init__(self)
92     scene._addVisualizationModules(self)
93 ksteube 1147
94 jongui 1148 # ----- Outline -----
95 ksteube 1147
96 jongui 1148 # NOTE: Changes cannot be made to the Outline's properties from the
97     # driver.
98     if(self.__outline == True):
99     outline = Outline(self.__data_collector._getDataCollectorOutput())
100     mapper = DataSetMapper()
101     mapper._setupDataSetMapper(outline._getOutlineOutput())
102 ksteube 1147
103 jongui 1148 actor3D = Actor3D()
104     actor3D._setupActor3D(mapper._getDataSetMapper())
105 ksteube 1147 # Default outline color is black.
106 jongui 1148 actor3D.setColor(Color.BLACK)
107 ksteube 1147
108     # Default line width is 1.
109 jongui 1148 actor3D._setLineWidth(1)
110 jongui 1158 scene._addActor3D(self.__viewport, actor3D._getActor3D())
111 ksteube 1147
112     # ----- Velocity -----
113    
114     # NOTE: Lookup table color mapping (color or grey scale) MUST be set
115     # before DataSetMapper. If it is done after DataSetMapper, no effect
116     # will take place.
117 jongui 1148 if(self.__lut == Lut.COLOR): # Colored lookup table.
118 ksteube 1147 lookup_table = LookupTable()
119     lookup_table._setTableValue()
120 jongui 1148 elif(self.__lut == Lut.GREY_SCALE): # Grey scaled lookup table.
121 ksteube 1147 lookup_table = LookupTable()
122     lookup_table._setLookupTableToGreyScale()
123    
124 jongui 1148 if(self.__cell_to_point == True): # Converts cell data to point data.
125     c2p = CellDataToPointData(
126     self.__data_collector._getDataCollectorOutput())
127     self._setupMaskPoints(c2p._getCellToPointOutput())
128     elif(self.__cell_to_point == False): # No conversion happens.
129     self._setupMaskPoints(data_collector._getDataCollectorOutput())
130 ksteube 1147
131 jongui 1148 if(self.__arrow == Arrow.TWO_D): # Use 2D arrows.
132 ksteube 1147 Arrow2D.__init__(self)
133 jongui 1148 self._setupGlyph3D(self._getMaskPointsOutput(),
134     self._getArrow2DOutput())
135 ksteube 1147 elif(arrow == Arrow.THREE_D): # Use 3D arrows.
136     Arrow3D.__init__(self)
137 jongui 1148 self._setupGlyph3D(self._getMaskPointsOutput(),
138     self._getArrow3DOutput())
139 ksteube 1147
140 jongui 1148 self._setupDataSetMapper(self._getGlyph3DOutput(),
141 ksteube 1147 lookup_table._getLookupTable())
142    
143 jongui 1148 self._setupActor3D(self._getDataSetMapper())
144 jongui 1158 scene._addActor3D(self.__viewport, self._getActor3D())
145 ksteube 1147
146 jongui 1148 def _isModified(self):
147     """
148     Return whether the Velocity or DataCollector has been modified.
149 ksteube 1147
150 jongui 1148 @rtype: Boolean
151     @return: True or False
152     """
153 ksteube 1147
154 jongui 1148 return self.__modified or self.__data_collector._isModified()
155 ksteube 1147
156 jongui 1158 def _render(self, scene):
157 jongui 1148 """
158     Render the velocity.
159 jongui 1158
160     @type scene: L{Scene <scene.Scene>} object
161     @param scene: Scene in which objects are to be rendered on
162 jongui 1148 """
163    
164     if (self._isModified() == True):
165     if(self.__data_collector._isScalarSet() == True):
166     self.__data_collector._setActiveScalar()
167     if(self.__data_collector._isVectorSet() == True):
168     self.__data_collector._setActiveVector()
169    
170     # Color velocity by vector.
171     if(self.__color_mode == ColorMode.VECTOR):
172     self._setColorModeByVector()
173 jongui 1189
174     # 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 jongui 1148 # Color velocity by scalar.
185     elif(self.__color_mode == ColorMode.SCALAR):
186     self._setColorModeByScalar()
187    
188 jongui 1189 # 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 jongui 1148 self.__modified = False
199    
200    
201 ksteube 1147 ###############################################################################
202    
203    
204     from transform import Transform
205     from plane import Plane
206     from cutter import Cutter
207    
208     # NOTE: DataSetMapper, Actor3D, Arrow2D, Arrow3D, Glyph3D, Transform, Plane,
209     # Cutter and MaskPoints were inherited to allow access to
210     # their public methods from the driver.
211     class VelocityOnPlaneCut(DataSetMapper, Actor3D, Arrow2D, Arrow3D,
212     Glyph3D, Transform, Plane, Cutter, MaskPoints):
213     """
214     This class works in a similar way to L{MapOnPlaneCut <map.MapOnPlaneCut>},
215 jongui 1148 except that it shows a vector field using arrows cut using a plane.
216 ksteube 1147 """
217    
218     # The SOUTH_WEST default viewport is used when there is only one viewport.
219     # This saves the user from specifying the viewport when there is only one.
220     # If no lut is specified, the color scheme willbe used.
221     def __init__(self, scene, data_collector, arrow = Arrow.TWO_D,
222     color_mode = ColorMode.VECTOR, viewport = Viewport.SOUTH_WEST,
223     lut = Lut.COLOR, cell_to_point = False, outline = True):
224     """
225     Initialise the VelocityOnPlaneCut.
226    
227     @attention: The source can either be point or cell data. If the
228     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.
230     If a conversion is needed, the 'cell_to_point' flag must be set to
231 jongui 1199 'True', otherwise 'False' (which is the default). On occasions, an
232     inaccurate object may be rendered from cell data even after conversion.
233 ksteube 1147
234     @type scene: L{Scene <scene.Scene>} object
235     @param scene: Scene in which objects are to be rendered on
236     @type data_collector: L{DataCollector <datacollector.DataCollector>}
237     object
238     @param data_collector: Deal with source of data for visualisation
239     @type arrow: L{Arrow <constant.Arrow>} constant
240     @param arrow: Type of arrow (two dimensional or three dimensional)
241     @type color_mode: L{ColorMode <constant.ColorMode>} constant
242     @param color_mode: Type of color mode
243     @type viewport: L{Viewport <constant.Viewport>} constant
244     @param viewport: Viewport in which objects are to be rendered on
245     @type lut : L{Lut <constant.Lut>} constant
246     @param lut: Lookup table color scheme
247     @type cell_to_point: Boolean
248     @param cell_to_point: Converts cell data to point data (by averaging)
249     @type outline: Boolean
250     @param outline: Places an outline around the domain surface
251     """
252    
253 jongui 1148 self.__data_collector = data_collector
254     self.__arrow = arrow
255     self.__color_mode = color_mode
256     self.__viewport = viewport
257     self.__lut = lut
258     self.__cell_to_point = cell_to_point
259     self.__outline = outline
260    
261     # Keeps track whether VelocityOnPlaneCut has been modified.
262     self.__modified = True
263     Transform.__init__(self)
264     Plane.__init__(self)
265     Cutter.__init__(self)
266     MaskPoints.__init__(self)
267     Glyph3D.__init__(self)
268     DataSetMapper.__init__(self)
269     Actor3D.__init__(self)
270     scene._addVisualizationModules(self)
271 ksteube 1147
272 jongui 1148 # ----- Outline -----
273 ksteube 1147
274 jongui 1148 # NOTE: Changes cannot be made to the Outline's properties from the
275     # driver.
276     if(self.__outline == True):
277     outline = Outline(self.__data_collector._getDataCollectorOutput())
278     mapper = DataSetMapper()
279     mapper._setupDataSetMapper(outline._getOutlineOutput())
280 ksteube 1147
281 jongui 1148 actor3D = Actor3D()
282     actor3D._setupActor3D(mapper._getDataSetMapper())
283 ksteube 1147 # Default outline color is black.
284 jongui 1148 actor3D.setColor(Color.BLACK)
285 ksteube 1147
286     # Default line width is 1.
287 jongui 1148 actor3D._setLineWidth(1)
288 jongui 1158 scene._addActor3D(self.__viewport, actor3D._getActor3D())
289 ksteube 1147
290     # ----- Velocity on a cut plane -----
291    
292     # NOTE: Lookup table color mapping (color or grey scale) MUST be set
293     # before DataSetMapper. If it is done after DataSetMapper, no effect
294     # will take place.
295     if(lut == Lut.COLOR): # Colored lookup table.
296     lookup_table = LookupTable()
297     lookup_table._setTableValue()
298     elif(lut == Lut.GREY_SCALE): # Grey scaled lookup table.
299     lookup_table = LookupTable()
300     lookup_table._setLookupTableToGreyScale()
301    
302 jongui 1148 self._setupPlane(self._getTransform())
303 ksteube 1147
304 jongui 1148 if(self.__cell_to_point == True): # Converts cell data to point data.
305     c2p = CellDataToPointData(
306     self.__data_collector._getDataCollectorOutput())
307     self._setupCutter(c2p._getCellToPointOutput(), self._getPlane())
308     elif(self.__cell_to_point == False): # No conversion happens.
309     self._setupCutter(self.__data_collector._getDataCollectorOutput(),
310     self._getPlane())
311 ksteube 1147
312 jongui 1148 self._setupMaskPoints(self._getCutterOutput())
313 ksteube 1147
314 jongui 1148 if(self.__arrow == Arrow.TWO_D): # Use 2D arrows.
315 ksteube 1147 Arrow2D.__init__(self)
316 jongui 1148 self._setupGlyph3D(self._getMaskPointsOutput(),
317 jongui 1205 self._getArrow2DOutput())
318 jongui 1148 elif(self.__arrow == Arrow.THREE_D): # Use 3D arrows.
319 ksteube 1147 Arrow3D.__init__(self)
320 jongui 1148 self._setupGlyph3D(self._getMaskPointsOutput(),
321     self._getArrow3DOutput())
322 ksteube 1147
323 jongui 1148 self._setupDataSetMapper(self._getGlyph3DOutput(),
324 ksteube 1147 lookup_table._getLookupTable())
325    
326 jongui 1148 self._setupActor3D(self._getDataSetMapper())
327 jongui 1158 scene._addActor3D(self.__viewport, self._getActor3D())
328 jongui 1148
329     def _isModified(self):
330     """
331     Return whether the VelocityOnPlaneCut or DataCollector has been
332     modified.
333 ksteube 1147
334 jongui 1148 @rtype: Boolean
335     @return: True or False
336     """
337 ksteube 1147
338 jongui 1148 return self.__modified or self.__data_collector._isModified()
339 ksteube 1147
340 jongui 1158 def _render(self, scene):
341 jongui 1148 """
342 jongui 1158 Render the velocity cut using a plane.
343    
344     @type scene: L{Scene <scene.Scene>} object
345     @param scene: Scene in which objects are to be rendered on
346 jongui 1148 """
347 ksteube 1147
348 jongui 1148 if (self._isModified() == True):
349     if(self.__data_collector._isVectorSet() == True):
350     self.__data_collector._setActiveVector()
351     # Color velocity by vector.
352     if(self.__color_mode == ColorMode.VECTOR):
353     self._setColorModeByVector()
354 jongui 1189
355     # 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 jongui 1148 # Color velocity by scalar.
366     elif(self.__color_mode == ColorMode.SCALAR):
367     self._setColorModeByScalar()
368    
369 jongui 1189 # 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 jongui 1148 self.__modified = False
380    
381    
382 ksteube 1147 ###############################################################################
383    
384    
385     from clipper import Clipper
386    
387     # NOTE: DataSetMapper, Actor3D, Arrow2D, Arrow3D, Glyph3D, Transform, Plane,
388     # Clipper and MaskPoints were inherited to allow access to
389     # their public methods from the driver.
390     class VelocityOnPlaneClip(DataSetMapper, Actor3D, Arrow2D, Arrow3D,
391     Glyph3D, Transform, Plane, Clipper, MaskPoints):
392     """
393     This class works in a similar way to L{MapOnPlaneClip <map.MapOnPlaneClip>}
394     , except that it shows a vector field using arrows clipped using a plane.
395     """
396    
397     # The SOUTH_WEST default viewport is used when there is only one viewport.
398     # This saves the user from specifying the viewport when there is only one.
399     # If no lut is specified, the color scheme will be used.
400     def __init__(self, scene, data_collector, arrow = Arrow.TWO_D,
401     color_mode = ColorMode.VECTOR, viewport = Viewport.SOUTH_WEST,
402     lut = Lut.COLOR, cell_to_point = False, outline = True):
403     """
404     Initialise the VelocityOnPlaneClip.
405    
406     @attention: The source can either be point or cell data. If the
407     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.
409     If a conversion is needed, the 'cell_to_point' flag must be set to
410 jongui 1199 'True', otherwise 'False' (which is the default). On occasions, an
411     inaccurate object may be rendered from cell data even after conversion.
412 ksteube 1147
413     @type scene: L{Scene <scene.Scene>} object
414     @param scene: Scene in which objects are to be rendered on
415     @type data_collector: L{DataCollector <datacollector.DataCollector>}
416     object
417     @param data_collector: Deal with source of data for visualisation
418     @type arrow: L{Arrow <constant.Arrow>} constant
419     @param arrow: Type of arrow (two dimensional or three dimensional)
420     @type color_mode: L{ColorMode <constant.ColorMode>} constant
421     @param color_mode: Type of color mode
422     @type viewport: L{Viewport <constant.Viewport>} constant
423     @param viewport: Viewport in which objects are to be rendered on
424     @type lut : L{Lut <constant.Lut>} constant
425     @param lut: Lookup table color scheme
426     @type cell_to_point: Boolean
427     @param cell_to_point: Converts cell data to point data (by averaging)
428     @type outline: Boolean
429     @param outline: Places an outline around the domain surface
430     """
431    
432 jongui 1148 self.__data_collector = data_collector
433     self.__arrow = arrow
434     self.__color_mode = color_mode
435     self.__viewport = viewport
436     self.__lut = lut
437     self.__cell_to_point = cell_to_point
438     self.__outline = outline
439    
440     # Keeps track whether VelocityOnPlaneCut has been modified.
441     self.__modified = True
442     Transform.__init__(self)
443     Plane.__init__(self)
444     Clipper.__init__(self)
445     MaskPoints.__init__(self)
446     Glyph3D.__init__(self)
447     DataSetMapper.__init__(self)
448     Actor3D.__init__(self)
449     scene._addVisualizationModules(self)
450 ksteube 1147
451 jongui 1148 # ----- Outline -----
452 ksteube 1147
453 jongui 1148 # NOTE: Changes cannot be made to the Outline's properties from the
454     # driver.
455     if(self.__outline == True):
456     outline = Outline(self.__data_collector._getDataCollectorOutput())
457     mapper = DataSetMapper()
458     mapper._setupDataSetMapper(outline._getOutlineOutput())
459 ksteube 1147
460 jongui 1148 actor3D = Actor3D()
461     actor3D._setupActor3D(mapper._getDataSetMapper())
462 ksteube 1147 # Default outline color is black.
463 jongui 1148 actor3D.setColor(Color.BLACK)
464 ksteube 1147
465     # Default line width is 1.
466 jongui 1148 actor3D._setLineWidth(1)
467 jongui 1158 scene._addActor3D(self.__viewport, actor3D._getActor3D())
468 ksteube 1147
469     # ----- Velocity on a clipped plane -----
470    
471     # NOTE: Lookup table color mapping (color or grey scale) MUST be set
472     # before DataSetMapper. If it is done after DataSetMapper, no effect
473     # will take place.
474 jongui 1148 if(self.__lut == Lut.COLOR): # Colored lookup table.
475 ksteube 1147 lookup_table = LookupTable()
476     lookup_table._setTableValue()
477 jongui 1148 elif(self.__lut == Lut.GREY_SCALE): # Grey scaled lookup table.
478 ksteube 1147 lookup_table = LookupTable()
479     lookup_table._setLookupTableToGreyScale()
480    
481 jongui 1148 self._setupPlane(self._getTransform())
482 ksteube 1147
483 jongui 1148 if(self.__cell_to_point == True): # Converts cell data to point data.
484     c2p = CellDataToPointData(
485     self.__data_collector._getDataCollectorOutput())
486     self._setupMaskPoints(c2p._getCellToPointOutput())
487     elif(self.__cell_to_point == False): # No conversion happens.
488     self._setupMaskPoints(
489     self.__data_collector._getDataCollectorOutput())
490 ksteube 1147
491     # NOTE: Glyph3D must come before Clipper. Otherwise clipping may not
492     # work correctly.
493 jongui 1148 if(self.__arrow == Arrow.TWO_D): # Use 2D arrows.
494 ksteube 1147 Arrow2D.__init__(self)
495 jongui 1148 self._setupGlyph3D(self._getMaskPointsOutput(),
496     self._getArrow2DOutput())
497     elif(self.__arrow == Arrow.THREE_D): # Use 3D arrows.
498 ksteube 1147 Arrow3D.__init__(self)
499 jongui 1148 self._setupGlyph3D(self._getMaskPointsOutput(),
500     self._getArrow3DOutput())
501 ksteube 1147
502 jongui 1148 self._setupClipper(self._getGlyph3DOutput(), self._getPlane())
503     self._setClipFunction()
504 ksteube 1147
505     # NOTE: Clipper must come after Glyph. Otherwise clipping
506     # may not work correctly.
507 jongui 1148 self._setupDataSetMapper(self._getClipperOutput(),
508 ksteube 1147 lookup_table._getLookupTable())
509    
510 jongui 1148 self._setupActor3D(self._getDataSetMapper())
511 jongui 1158 scene._addActor3D(self.__viewport, self._getActor3D())
512 jongui 1148
513     def _isModified(self):
514     """
515     Return whether the VelocityOnPlaneClip or DataCollector has been
516     modified.
517 ksteube 1147
518 jongui 1148 @rtype: Boolean
519     @return: True or False
520     """
521 ksteube 1147
522 jongui 1148 return self.__modified or self.__data_collector._isModified()
523    
524 jongui 1158 def _render(self, scene):
525 jongui 1148 """
526     Render the velocity clip using a plane..
527 jongui 1158
528     @type scene: L{Scene <scene.Scene>} object
529     @param scene: Scene in which objects are to be rendered on
530 jongui 1148 """
531    
532     if (self._isModified() == True):
533     if(self.__data_collector._isVectorSet() == True):
534     self.__data_collector._setActiveVector()
535     # Color velocity by vector.
536     if(self.__color_mode == ColorMode.VECTOR):
537     self._setColorModeByVector()
538 jongui 1189
539     # 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 jongui 1148 # Color velocity by scalar.
550     elif(self.__color_mode == ColorMode.SCALAR):
551     self._setColorModeByScalar()
552    
553 jongui 1189 # 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 jongui 1148 self.__modified = False
564    
565    

  ViewVC Help
Powered by ViewVC 1.1.26