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

Diff of /trunk/pyvisi/py_src/ellipsoid.py

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1037 by jongui, Fri Mar 16 05:00:32 2007 UTC revision 1054 by jongui, Thu Mar 22 03:41:46 2007 UTC
# Line 11  from sphere import Sphere Line 11  from sphere import Sphere
11  from normals import Normals  from normals import Normals
12  from glyph import  TensorGlyph  from glyph import  TensorGlyph
13  from outline import Outline  from outline import Outline
14  from point import StructuredPoints  from point import StructuredPoints, MaskPoints
15  from probe import Probe  from probe import Probe
16    from average import CellDataToPointData
17    
18  # NOTE: DataSetMapper, Actor3D, Sphere, Normals, TensorGlyph,  # NOTE: DataSetMapper, Actor3D, Sphere, Normals, TensorGlyph
19  # StructuredPoints and Probe  were inherited to allow access to their  # and MaskPoints  were inherited to allow access to their
20  # public methods from the driver.  # public methods from the driver.
21  class Ellipsoid(DataSetMapper, Actor3D, Sphere, Normals, TensorGlyph,  class Ellipsoid(DataSetMapper, Actor3D, Sphere, Normals, TensorGlyph,
22          StructuredPoints, Probe):          MaskPoints):
23      """      """
24      Class that shows a tensor field using ellipsoids. The ellipsoids can either      Class that shows a tensor field using ellipsoids. The ellipsoids can either
25      be colored or grey-scaled, depending on the lookup table used.      be colored or grey-scaled, depending on the lookup table used.
# Line 28  class Ellipsoid(DataSetMapper, Actor3D, Line 29  class Ellipsoid(DataSetMapper, Actor3D,
29      # This saves the user from specifying the viewport when there is only one.      # This saves the user from specifying the viewport when there is only one.
30      # If no lut is specified, the color scheme will be used.      # If no lut is specified, the color scheme will be used.
31      def __init__(self, scene, data_collector, viewport = Viewport.SOUTH_WEST,      def __init__(self, scene, data_collector, viewport = Viewport.SOUTH_WEST,
32              lut = Lut.COLOR, outline = True):              lut = Lut.COLOR, cell_to_point = False, outline = True):
33          """          """
34          @type scene: L{Scene <scene.Scene>} object          @type scene: L{Scene <scene.Scene>} object
35          @param scene: Scene in which objects are to be rendered on          @param scene: Scene in which objects are to be rendered on
# Line 39  class Ellipsoid(DataSetMapper, Actor3D, Line 40  class Ellipsoid(DataSetMapper, Actor3D,
40          @param viewport: Viewport in which objects are to be rendered on          @param viewport: Viewport in which objects are to be rendered on
41          @type lut : L{Lut <constant.Lut>} constant          @type lut : L{Lut <constant.Lut>} constant
42          @param lut: Lookup table color scheme          @param lut: Lookup table color scheme
43            @type cell_to_point: Boolean
44            @param cell_to_point: Converts cell data to point data (by averaging)
45          @type outline: Boolean          @type outline: Boolean
46          @param outline: Places an outline around the domain surface          @param outline: Places an outline around the domain surface
47          """          """
# Line 78  class Ellipsoid(DataSetMapper, Actor3D, Line 81  class Ellipsoid(DataSetMapper, Actor3D,
81              lookup_table = LookupTable()              lookup_table = LookupTable()
82              lookup_table._setLookupTableToGreyScale()              lookup_table._setLookupTableToGreyScale()
83    
84          StructuredPoints.__init__(self, data_collector._getOutput())          #StructuredPoints.__init__(self, data_collector._getOutput())
85          Probe.__init__(self, data_collector._getOutput(),          #Probe.__init__(self, data_collector._getOutput(),
86                  StructuredPoints._getStructuredPoints(self))          #       StructuredPoints._getStructuredPoints(self))
87    
88            if(cell_to_point == True): # Converts cell data to point data.
89                c2p = CellDataToPointData(data_collector._getOutput())
90                MaskPoints.__init__(self, c2p._getOutput())
91            elif(cell_to_point == False): # No conversion happens.  
92                MaskPoints.__init__(self, data_collector._getOutput())
93    
94          Sphere.__init__(self)          Sphere.__init__(self)
95          TensorGlyph.__init__(self, Probe._getOutput(self),          #TensorGlyph.__init__(self, Probe._getOutput(self),
96            TensorGlyph.__init__(self, MaskPoints._getOutput(self),
97                  Sphere._getOutput(self))                  Sphere._getOutput(self))
98          Normals.__init__(self, TensorGlyph._getOutput(self))          Normals.__init__(self, TensorGlyph._getOutput(self))
99    
# Line 188  class EllipsoidOnPlaneCut(DataSetMapper, Line 198  class EllipsoidOnPlaneCut(DataSetMapper,
198                  lookup_table._getLookupTable())                  lookup_table._getLookupTable())
199          DataSetMapper._setScalarRange(self, data_collector._getScalarRange())          DataSetMapper._setScalarRange(self, data_collector._getScalarRange())
200    
201            data_collector._paramForUpdatingMultipleSources(VizType.ELLIPSOID,
202                    ColorMode.SCALAR, DataSetMapper._getDataSetMapper(self))
203    
204          Actor3D.__init__(self, DataSetMapper._getDataSetMapper(self))          Actor3D.__init__(self, DataSetMapper._getDataSetMapper(self))
205          scene._addActor3D(viewport, Actor3D._getActor3D(self))          scene._addActor3D(viewport, Actor3D._getActor3D(self))
206    
# Line 285  class EllipsoidOnPlaneClip(DataSetMapper Line 298  class EllipsoidOnPlaneClip(DataSetMapper
298              lookup_table._getLookupTable())              lookup_table._getLookupTable())
299          DataSetMapper._setScalarRange(self, data_collector._getScalarRange())          DataSetMapper._setScalarRange(self, data_collector._getScalarRange())
300    
301            data_collector._paramForUpdatingMultipleSources(VizType.ELLIPSOID,
302                    ColorMode.SCALAR, DataSetMapper._getDataSetMapper(self))
303    
304          Actor3D.__init__(self, DataSetMapper._getDataSetMapper(self))          Actor3D.__init__(self, DataSetMapper._getDataSetMapper(self))
305          scene._addActor3D(viewport, Actor3D._getActor3D(self))          scene._addActor3D(viewport, Actor3D._getActor3D(self))
306    

Legend:
Removed from v.1037  
changed lines
  Added in v.1054

  ViewVC Help
Powered by ViewVC 1.1.26