Re Re: [vtkusers] vtkProgrammableGlyphFilter problem

Malcolm Drummond malcolm at geovision.co.za
Mon Jan 31 13:40:30 EST 2005


Sorry, I didn't look at your code properly.

You're not connected to the vtkTransformPolyDataFilter so it will have no
effect at all. What you're actually doing is repeatedly copying the
unmodified output of the source to the output of your programmable glyph
filter.

You either need to modify the position of the source or set a
vtkTransformPolyDataFilter as the filter's source and modify it's transform
from within the glyph method - this means you'll have to find a way to pass
the transform as an argument.

vtkSphereSource
    |
vtkTransformPolyDataFilter - vtkTransform
    |
vtkProgrammableGlyphFilter

Hope I got it right this time!
Malcolm

----- Original Message -----
From: "reyes mauricio" <mreyesa at hotmail.com>
To: <vtkusers at vtk.org>
Sent: Monday, January 31, 2005 6:53 PM
Subject: [vtkusers] vtkProgrammableGlyphFilter problem


> Hi VTK Users,
>
>    I'm using vtkProgrammableGlyphFilter to manipulate individually (via
> setGlyphMethod) scaling and orientation of spheres.
>
>   I cannot make the filter to work, it only gives me one single sphere as
> output
>
> ( vtkGlyph3D works well wit the input data I pass. It copy the sphere at
> different positions, but I need to scale them and orient them
differently )
>
> Thanks in advance,
>   Mauricio
>
> this is part of my code:
>
>
> // ********* part of code ************
>
>    vtkSphereSource *sphere=vtkSphereSource::New();
>    vtkProgrammableGlyphFilter *pfilter=vtkProgrammableGlyphFilter::New();
>    pfilter->SetSource(sphere->GetOutput());
>    pfilter->SetInput(pd);       <-------- pd (vtkPolyData)
>    pfilter->SetGlyphMethod(func,(void *)pfilter);
>
>   vtkPolyDataMapper *glyphMapper=vtkPolyDataMapper::New();
>   glyphMapper->SetInput(pfilter->GetOutput());
>
>   vtkActor *glyphActor=vtkActor::New();
>   glyphActor->SetMapper(glyphMapper);
>
> for the moment the function passed to SetGlyphMethod just scales:
>
> void static func(void *arg)
> {
>   vtkProgrammableGlyphFilter *pfilter=(vtkProgrammableGlyphFilter*)arg;
>
> //float point[3];
> //pfilter->GetPoint(point);
>
> vtkTransform *tr=vtkTransform::New();
>   tr->Scale(4,1,1); // testing
>
>   vtkTransformPolyDataFilter *pdf=vtkTransformPolyDataFilter::New();
>   pdf->SetInput(pfilter->GetSource());
>   pdf->SetTransform(tr);
>
>   tr->Delete();
>   pdf->Delete();
>
> }
>
> _________________________________________________________________
> Charla con tus amigos en línea mediante MSN Messenger:
> http://messenger.latam.msn.com/
>
> _______________________________________________
> This is the private VTK discussion list.
> Please keep messages on-topic. Check the FAQ at:
http://www.vtk.org/Wiki/VTK_FAQ
> Follow this link to subscribe/unsubscribe:
> http://www.vtk.org/mailman/listinfo/vtkusers
>




More information about the vtkusers mailing list