[vtkusers] Problem with the programmableGlyphFilter

Johanna M. jojo_pl at hotmail.com
Wed Jul 25 11:40:06 EDT 2012


Hello everyone,
 
I have a big problem with the ProgrammableGlyphFilter and hope to get 
some help.
The calcGlyph does nothing important yet, except scaling an arrow and 
set the transformed arrow as the source of my
programmableGlyphFilter. The transformation in the calcGlyph method has 
no effect on changing the source of my
 
programmableGlyphFilter, so it always shows me the old arrow as declared 
in the main.
 
code in main:
{
     .................
     vtkSmartPointer<vtkArrowSource> arrow = 
vtkSmartPointer<vtkArrowSource>::New();
     vtkSmartPointer<vtkProgrammableGlyphFilter> filter =  
vtkSmartPointer<vtkProgrammableGlyphFilter>::New();
     filter->SetInput(polydata);
     filter->SetSource(arrow->GetOutput());
     filter->SetGlyphMethod(calcGlyph, filter);
     filter->Update();     // in case to use mitk::Surface
     .................
}
 
void calcGlyph(void *arg)
{
     vtkProgrammableGlyphFilter *glyphFilter = 
(vtkProgrammableGlyphFilter*) arg;
 
     vtkSmartPointer<vtkTransformPolyDataFilter> filter_transform = 
vtkSmartPointer<vtkTransformPolyDataFilter>::New();
     vtkSmartPointer<vtkTransform> transform = 
vtkSmartPointer<vtkTransform>::New();
     vtkSmartPointer<vtkArrowSource> arrow = 
vtkSmartPointer<vtkArrowSource>::New();
 
     transform->Scale(30, 2, 1);
     filter_transform->SetTransform(transform);
     filter_transform->SetInput(arrow->GetOutput());
     filter_transform->Update();
 
     glyphFilter->SetSource(filter_transform->GetOutput());
};
 
Can you imagine where the problem is?

Best regards

Johanna 
 		 	   		  
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.vtk.org/pipermail/vtkusers/attachments/20120725/d1c1373d/attachment.htm>


More information about the vtkusers mailing list