[vtkusers] Propagate transformation from vtkActor to vtkPolydata
Alex Malyushytskyy
alexmalvtk at gmail.com
Thu Dec 6 20:34:37 EST 2012
I would keep transformation instead and polydata unchanged until you
need either re-create an actor or access transformed polydata.
Problem is that you change polydata and it is immediately affect pypeline.
You may for example store transformation matrix within polydata as a
custom data,
Alex
On Wed, Dec 5, 2012 at 9:20 AM, NsPx <nspx.roronoa at gmail.com> wrote:
> Hi all,
>
> After moving a vtkActor, I want to propagate the transformation to its
> vtkPolydata.
>
> My code :
>
> vtkMatrix4x4* matrix = actor->GetMatrix();
>
> vtkSmartPointer<vtkTransform> transform =
> vtkSmartPointer<vtkTransform>::New();
> transform->SetMatrix( matrix );
>
> vtkSmartPointer<vtkTransformPolyDataFilter> filter=
> vtkSmartPointer<vtkTransformPolyDataFilter>::New();
> filter->SetTransform( transform);
> filter->SetInput( polyData);
> filter->Update();
>
> polyData->DeepCopy( filter->GetOutput());
>
> How can I prevent the actor from being updated again ?
> I tried to apply the reverse matrix to the actor but I failed, I'm a little
> bit confused about which function I have to call, ( PokeMatrix() ?
> Set/AddPosition() ? ... ).
>
> Thanks by advance for helping me.
>
>
> _______________________________________________
> 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
>
More information about the vtkusers
mailing list