[vtkusers] How to change source in vtkProgrammableGlyphFilter
David Doria
daviddoria+vtk at gmail.com
Tue Aug 24 07:22:02 EDT 2010
On Mon, Aug 23, 2010 at 11:26 PM, Jong Youl Choi <jychoi at indiana.edu> wrote:
>
> Hi all,
>
> I have tried to change a source (from sphere to cone) in
> vtkProgrammableGlyphFilter with no luck. My code is as follow:
>
> vtkProgrammableGlyphFilter *glyph =
vtkProgrammableGlyphFilter::New();
> vtkSphereSource *sphere = vtkSphereSource::New();
> glyph->SetInput(plot); // plot is vtkPolyData
> glyph->SetSource(sphere->GetOutput()); // sphere is vtkSphereSource
> glyph->SetGlyphMethod(CalcGlyph, glyph);
>
> And CalcGlyph is defined:
>
> void CalcGlyph(void *arg)
> {
> vtkProgrammableGlyphFilter *glyph = (vtkProgrammableGlyphFilter*)
arg;
> VTK_CREATE(vtkConeSource, cone);
> glyph->SetSource(cone->GetOutput()); // Tried to reset the source
>
> double xyz[3];
> glyph->GetPoint(xyz);
>
> cone->SetCenter(xyz);
> }
>
> Is there any way to replace or change the source initially defined in
> vtkProgrammableGlyphFilter? Thank you for your help in advance.
>
> Thanks,
> Jong
>
> --
> Jong Youl Choi
I'm not familiar with vtkProgrammableGlyphFilter, but it doesn't sound like
you're doing anything that vtkGlyph3D can't do:
http://www.vtk.org/Wiki/VTK/Examples/Cxx/Visualization/ScaleGlyphs
David
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.vtk.org/pipermail/vtkusers/attachments/20100824/ed0b329b/attachment.htm>
More information about the vtkusers
mailing list