[vtkusers] ProgrammableGlyphFilter example
Gib Bogle
g.bogle at auckland.ac.nz
Mon Nov 3 22:53:13 EST 2014
There seems to be something funny about this example:
http://vtk.org/Wiki/VTK/Examples/Cxx/Visualization/ProgrammableGlyphFilter
I believe it should render a cone, a cube, and a sphere, but when I build and run it with VTK-5.10.1, I see only the cone. Strangely, the console output is:
Calling CalcGlyph for point 0
Point coords are: 0 0 0
Calling CalcGlyph for point 1
Point coords are: 5 0 0
Calling CalcGlyph for point 2
Point coords are: 10 0 0
which makes it look as if it is creating the cube (point 1) and sphere (point 2).
The comment in this code in main():
glyphFilter->SetGlyphMethod(CalcGlyph, glyphFilter);
//need a default glyph, but this should not be used
vtkSmartPointer<vtkConeSource> coneSource = vtkSmartPointer<vtkConeSource>::New();
#if VTK_MAJOR_VERSION <= 5
glyphFilter->SetSource(coneSource->GetOutput());
#else
glyphFilter->SetSourceConnection(coneSource->GetOutputPort());
#endif
suggests that although coneSource is initially set as the source for glyphFilter, it is expected that this will be overridden by the code in CalcGlyph(), but in fact this is not happening. What is missing?
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://public.kitware.com/pipermail/vtkusers/attachments/20141104/d57fdc3f/attachment.html>
More information about the vtkusers
mailing list