[vtkusers] How to change source in vtkProgrammableGlyphFilter

Jong Youl Choi jychoi at indiana.edu
Mon Aug 23 23:26:16 EDT 2010


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
Dept. of Computer Science
Indiana University at Bloomington
Homepage: http://www.cs.indiana.edu/~jychoi



More information about the vtkusers mailing list