/[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 1054 by jongui, Thu Mar 22 03:41:46 2007 UTC revision 1056 by jongui, Thu Mar 22 06:52:08 2007 UTC
# Line 81  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    
         #StructuredPoints.__init__(self, data_collector._getOutput())  
         #Probe.__init__(self, data_collector._getOutput(),  
         #       StructuredPoints._getStructuredPoints(self))  
   
84          if(cell_to_point == True): # Converts cell data to point data.          if(cell_to_point == True): # Converts cell data to point data.
85              c2p = CellDataToPointData(data_collector._getOutput())              c2p = CellDataToPointData(data_collector._getOutput())
86              MaskPoints.__init__(self, c2p._getOutput())              MaskPoints.__init__(self, c2p._getOutput())
# Line 92  class Ellipsoid(DataSetMapper, Actor3D, Line 88  class Ellipsoid(DataSetMapper, Actor3D,
88              MaskPoints.__init__(self, data_collector._getOutput())              MaskPoints.__init__(self, data_collector._getOutput())
89    
90          Sphere.__init__(self)          Sphere.__init__(self)
         #TensorGlyph.__init__(self, Probe._getOutput(self),  
91          TensorGlyph.__init__(self, MaskPoints._getOutput(self),          TensorGlyph.__init__(self, MaskPoints._getOutput(self),
92                  Sphere._getOutput(self))                  Sphere._getOutput(self))
93          Normals.__init__(self, TensorGlyph._getOutput(self))          Normals.__init__(self, TensorGlyph._getOutput(self))
# Line 116  from plane import Plane Line 111  from plane import Plane
111  from cutter import Cutter  from cutter import Cutter
112    
113  # NOTE: DataSetMapper, Actor3D, Sphere, Normals, TensorGlyph, Transform, Plane,  # NOTE: DataSetMapper, Actor3D, Sphere, Normals, TensorGlyph, Transform, Plane,
114  # Cutter, StructuredPoints and Probe were inherited to allow access to  # Cutter and MaskPoints were inherited to allow access to
115  # their public methods from the driver.  # their public methods from the driver.
116  class EllipsoidOnPlaneCut(DataSetMapper, Actor3D, Sphere, Normals,    class EllipsoidOnPlaneCut(DataSetMapper, Actor3D, Sphere, Normals,  
117          TensorGlyph, Transform, Plane, Cutter, StructuredPoints, Probe):          TensorGlyph, Transform, Plane, Cutter, MaskPoints):
118      """      """
119      This class works in a similar way to L{MapOnPlaneCut <map.MapOnPlaneCut>},      This class works in a similar way to L{MapOnPlaneCut <map.MapOnPlaneCut>},
120      except that it shows a tensor field using ellipsoids cut using a plane.      except that it shows a tensor field using ellipsoids cut using a plane.
# Line 129  class EllipsoidOnPlaneCut(DataSetMapper, Line 124  class EllipsoidOnPlaneCut(DataSetMapper,
124      # 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.
125      # If no lut is specified, the color scheme will be used.      # If no lut is specified, the color scheme will be used.
126      def __init__(self, scene, data_collector, viewport = Viewport.SOUTH_WEST,      def __init__(self, scene, data_collector, viewport = Viewport.SOUTH_WEST,
127              lut = Lut.COLOR, outline = True):              lut = Lut.COLOR, cell_to_point = False, outline = True):
128          """          """
129          @type scene: L{Scene <scene.Scene>} object          @type scene: L{Scene <scene.Scene>} object
130          @param scene: Scene in which objects are to be rendered on          @param scene: Scene in which objects are to be rendered on
# Line 140  class EllipsoidOnPlaneCut(DataSetMapper, Line 135  class EllipsoidOnPlaneCut(DataSetMapper,
135          @param viewport: Viewport in which objects are to be rendered on          @param viewport: Viewport in which objects are to be rendered on
136          @type lut : L{Lut <constant.Lut>} constant          @type lut : L{Lut <constant.Lut>} constant
137          @param lut: Lookup table color scheme          @param lut: Lookup table color scheme
138            @type cell_to_point: Boolean
139            @param cell_to_point: Converts cell data to point data (by averaging)
140          @type outline: Boolean          @type outline: Boolean
141          @param outline: Places an outline around the domain surface          @param outline: Places an outline around the domain surface
142          """          """
# Line 182  class EllipsoidOnPlaneCut(DataSetMapper, Line 179  class EllipsoidOnPlaneCut(DataSetMapper,
179          Transform.__init__(self)              Transform.__init__(self)    
180          Plane.__init__(self, Transform._getTransform(self))          Plane.__init__(self, Transform._getTransform(self))
181    
182          StructuredPoints.__init__(self, data_collector._getOutput())          #StructuredPoints.__init__(self, data_collector._getOutput())
183          Probe.__init__(self, data_collector._getOutput(),          #Probe.__init__(self, data_collector._getOutput(),
184                  StructuredPoints._getStructuredPoints(self))          #       StructuredPoints._getStructuredPoints(self))
185    
186            if(cell_to_point == True): # Converts cell data to point data.
187                c2p = CellDataToPointData(data_collector._getOutput())
188                Cutter.__init__(self, c2p._getOutput(), Plane._getPlane(self))  
189            elif(cell_to_point == False): # No conversion happens.  
190                Cutter.__init__(self, data_collector._getOutput(),
191                        Plane._getPlane(self))  
192    
193            MaskPoints.__init__(self, Cutter._getOutput(self))
194    
195            #Cutter.__init__(self, Probe._getOutput(self),
196            #       Plane._getPlane(self))  
197    
         Cutter.__init__(self, Probe._getOutput(self),  
                 Plane._getPlane(self))    
198          Sphere.__init__(self)          Sphere.__init__(self)
199    
200          TensorGlyph.__init__(self, Cutter._getOutput(self),          #TensorGlyph.__init__(self, Cutter._getOutput(self),
201            TensorGlyph.__init__(self, MaskPoints._getOutput(self),
202                  Sphere._getOutput(self))                  Sphere._getOutput(self))
203          Normals.__init__(self, TensorGlyph._getOutput(self))          Normals.__init__(self, TensorGlyph._getOutput(self))
204    
# Line 211  class EllipsoidOnPlaneCut(DataSetMapper, Line 219  class EllipsoidOnPlaneCut(DataSetMapper,
219  from clipper import Clipper  from clipper import Clipper
220    
221  # NOTE: DataSetMapper, Actor3D, Sphere, Normals, TensorGlyph, Transform, Plane,  # NOTE: DataSetMapper, Actor3D, Sphere, Normals, TensorGlyph, Transform, Plane,
222  # Clipper, StructuredPoints and Probe were inherited to allow access to  # Clipper and MaskPoints were inherited to allow access to
223  # their public methods from the driver.  # their public methods from the driver.
224  class EllipsoidOnPlaneClip(DataSetMapper, Actor3D, Sphere, Normals,    class EllipsoidOnPlaneClip(DataSetMapper, Actor3D, Sphere, Normals,  
225      TensorGlyph, Transform, Plane, Clipper, StructuredPoints, Probe):      TensorGlyph, Transform, Plane, Clipper, MaskPoints):
226      """      """
227      This class works in a similar way to L{MapOnPlaneClip <map.MapOnPlaneClip>},      This class works in a similar way to L{MapOnPlaneClip <map.MapOnPlaneClip>},
228      except that it shows a tensor field using ellipsoids clipped using a plane.      except that it shows a tensor field using ellipsoids clipped using a plane.
# Line 224  class EllipsoidOnPlaneClip(DataSetMapper Line 232  class EllipsoidOnPlaneClip(DataSetMapper
232      # 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.
233      # If no lut is specified, the color scheme will be used.      # If no lut is specified, the color scheme will be used.
234      def __init__(self, scene, data_collector, viewport = Viewport.SOUTH_WEST,      def __init__(self, scene, data_collector, viewport = Viewport.SOUTH_WEST,
235              lut = Lut.COLOR, outline = True):              lut = Lut.COLOR, cell_to_point = False, outline = True):
236          """          """
237          @type scene: L{Scene <scene.Scene>} object          @type scene: L{Scene <scene.Scene>} object
238          @param scene: Scene in which objects are to be rendered on          @param scene: Scene in which objects are to be rendered on
# Line 235  class EllipsoidOnPlaneClip(DataSetMapper Line 243  class EllipsoidOnPlaneClip(DataSetMapper
243          @param viewport: Viewport in which object are to be rendered on          @param viewport: Viewport in which object are to be rendered on
244          @type lut : L{Lut <constant.Lut>} constant          @type lut : L{Lut <constant.Lut>} constant
245          @param lut: Lookup table color scheme          @param lut: Lookup table color scheme
246            @type cell_to_point: Boolean
247            @param cell_to_point: Converts cell data to point data (by averaging)
248          @type outline: Boolean          @type outline: Boolean
249          @param outline: Places an outline around the domain surface          @param outline: Places an outline around the domain surface
250          """          """
# Line 277  class EllipsoidOnPlaneClip(DataSetMapper Line 287  class EllipsoidOnPlaneClip(DataSetMapper
287          Transform.__init__(self)              Transform.__init__(self)    
288          Plane.__init__(self, Transform._getTransform(self))          Plane.__init__(self, Transform._getTransform(self))
289    
290          StructuredPoints.__init__(self, data_collector._getOutput())          if(cell_to_point == True): # Converts cell data to point data.
291          Probe.__init__(self, data_collector._getOutput(),              c2p = CellDataToPointData(data_collector._getOutput())
292                  StructuredPoints._getStructuredPoints(self))              Clipper.__init__(self, c2p._getOutput(),
293                        Plane._getPlane(self))  
294                Clipper._setClipFunction(self)
295            elif(cell_to_point == False): # No conversion happens.  
296                Clipper.__init__(self, data_collector._getOutput(),
297                        Plane._getPlane(self))  
298                Clipper._setClipFunction(self)
299    
300            MaskPoints.__init__(self, Clipper._getOutput(self))
301    
         # NOTE: TensorGlyph must come before Clipper. Otherwise the output  
         # will be incorrect.  
302          Sphere.__init__(self)          Sphere.__init__(self)
303          TensorGlyph.__init__(self, Probe._getOutput(self),          TensorGlyph.__init__(self, MaskPoints._getOutput(self),
304                  Sphere._getOutput(self))                  Sphere._getOutput(self))
305    
306          Normals.__init__(self, TensorGlyph._getOutput(self))          Normals.__init__(self, TensorGlyph._getOutput(self))
         # NOTE: Clipper must come after TensorGlyph. Otherwise the output  
         # will be incorrect.  
         Clipper.__init__(self, Normals._getOutput(self),  
                 Plane._getPlane(self))    
         Clipper._setClipFunction(self)  
307    
308          DataSetMapper.__init__(self, Clipper._getOutput(self),          DataSetMapper.__init__(self, Normals._getOutput(self),
309              lookup_table._getLookupTable())              lookup_table._getLookupTable())
310          DataSetMapper._setScalarRange(self, data_collector._getScalarRange())          DataSetMapper._setScalarRange(self, data_collector._getScalarRange())
311    

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

  ViewVC Help
Powered by ViewVC 1.1.26