Skip to content

Commit

Permalink
Explicitly creating the pipeline and using a glyph instead of vectors to
Browse files Browse the repository at this point in the history
avoid silly problems with the visualization of scalars as glyphs.
  • Loading branch information
prabhuramachandran committed May 6, 2011
1 parent 16161f5 commit 25ba822
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions source/pysph/tools/mayavi_viewer.py
Original file line number Diff line number Diff line change
Expand Up @@ -106,12 +106,11 @@ def _particle_array_changed(self, pa):
x, y, z, u, v, w = pa.x, pa.y, pa.z, pa.u, pa.v, pa.w
s = getattr(pa, self.scalar)
p = self.plot
mlab = self.scene.mlab
if p is None:
p = self.scene.mlab.quiver3d(x, y, z, u, v, w, scalars=s,
mode='point',
scale_mode='none')
p.glyph.color_mode = 'color_by_scalar'
p.glyph.glyph_source.glyph_position = 'center'
src = mlab.pipeline.vector_scatter(x, y, z, u, v, w,
scalars=s)
p = mlab.pipeline.glyph(src, mode='point', scale_mode='none')
p.actor.property.point_size = 3
p.mlab_source.dataset.point_data.scalars.name = self.scalar
scm = p.module_manager.scalar_lut_manager
Expand Down

0 comments on commit 25ba822

Please sign in to comment.