[vtkusers] Problem with the programmableGlyphFilter

Bill Lorensen bill.lorensen at gmail.com
Wed Jul 25 13:03:39 EDT 2012


I believe there is a bug in vtkProgrammableGlyphFilter where the input
source is changed in the calcGlyph method.

I'm investigating.

On Wed, Jul 25, 2012 at 11:40 AM, Johanna M. <jojo_pl at hotmail.com> wrote:

>  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
>
>
> _______________________________________________
> Powered by www.kitware.com
>
> Visit other Kitware open-source projects at
> http://www.kitware.com/opensource/opensource.html
>
> Please keep messages on-topic and check the VTK FAQ at:
> http://www.vtk.org/Wiki/VTK_FAQ
>
> Follow this link to subscribe/unsubscribe:
> http://www.vtk.org/mailman/listinfo/vtkusers
>
>


-- 
Unpaid intern in BillsBasement at noware dot com
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.vtk.org/pipermail/vtkusers/attachments/20120725/dc553506/attachment.htm>


More information about the vtkusers mailing list