[vtkusers] vtkTransformPolydataFilter ... how to get the transformed results
Michael Jackson
mike.jackson at bluequartz.net
Thu Mar 11 14:54:57 EST 2010
Wouldn't you want to do:
vtkPolyData* output = tpd->GetOutput();
as the output is just a raw pointer to a vtkPolyData object, which the
filter owns. If you then wrap that point inside a vtkSmartPointer
wouldn't you end up with 2 objects trying to free it(best case.)
___________________________________________________________
Mike Jackson www.bluequartz.net
Principal Software Engineer mike.jackson at bluequartz.net
BlueQuartz Software Dayton, Ohio
On Mar 11, 2010, at 8:51 AM, David Doria wrote:
> Hello everybody,
>
> I have a vtkLineSource object L1. I apply a transformation with the
> vtkTransformPolyDataFilter tpd.
>
> so... as L1 is defined by 2 points, I have a transform TT which
> defines the TransformPolyDataFilter.
> So I need to retrieve those 2 points but after the transform, so I
> call:
>
> vtkSmartPointer<vtkLineSource> tmplineDir =
> vtkLineSource::SafeDownCast(tpd->GetOutput());
>
> but the pointer it returns is NULL, causing of course a crash of the
> software.
> what am I missing? :)
>
> Many thanks.
> Giancarlo
>
>
>
>
> You can't cast a polydata as a lineSource, which you are trying to
> do with
> vtkLineSource::SafeDownCast(tpd->GetOutput());
>
> The output of tpd is a polydata, so you'd want to do
> vtkSmartPointer<vtkPolyData> output = tpd->GetOutput();
>
> ~David
> _______________________________________________
> 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