[vtkusers] how to get output from a vtkTransformFilter ?
Amy Squillacote
amy.squillacote at kitware.com
Thu May 3 11:42:33 EDT 2007
Actually, vtkPoints is a concrete class, not an abstract one, and
vtkPolyData is a subclass of vtkPointSet, not vtkPoints.
Did you call Update() on the vtkTransformFilter before trying to get the
points from its output? If not, then the output was not filled in yet,
which is necessary before asking for its points.
If your dataset if a vtkPolyData, then use vtkTransformPolyDataFilter
because it is optimized for working with vtkPolyData.
- Amy
M.Salman at surrey.ac.uk wrote:
>
> Hi,
> I am not an expert in VTK just a normal user so my opinion may be
> wrong.One problem I see is to use an instance of vtkPoints which is an
> abstract class,I guess the output of the filter must be assigned to
> some concrete instance of any of a class derived from vtkPoints such
> as vtkPolyData.
> This is how I normally do this kind of stuff
>
>
> vtkTransformFilter* tf= vtkTransformFilter::New();
> vtkPolyData* data=vtkPolyData::New();//this polydata contains the
> points which you need to change
> vtkPolyData* result=vtkPolyData::New();
> ......//Apply changes to the the transform instance
> .....
> .....
> vtkTranformPolyDataFilter * pdf= vtkTranformPolyDataFilter::New();
> pdf->SetInput(data);
> pdf->SetTransform(tf);
> pdf->Update();
>
> result= pdf->GetOutput();
>
> result contains the changed version of data you can use GetPoints
> method to get changed points
>
> This is how I do it and I am sure there must be some more elegant and
> short way to do it .
>
> Regards
> M.Salman
> University of Surrey,U.K.
>
>
>
>
>
>
> -----Original Message-----
> From: vtkusers-bounces+m.salman=surrey.ac.uk at vtk.org on behalf of
> Emmanouil Moschidis
> Sent: Thu 03/05/2007 3:09 PM
> To: vtkusers at vtk.org
> Subject: [vtkusers] how to get output from a vtkTransformFilter ?
>
> Hi
> i am using a vtkTransformFilter to change the coordinates of some
> points. I apply the filter to the points and then i want to get the
> output but when the following line is executed:
>
> vtkPoints *Tdata=Tf->GetOutput()->GetPoints(); //Tf is the
> vtkTransformFilter
>
> i get this error:
>
> ERROR: In
> /Users/antoinerosset/VTK/Filtering/vtkDemandDrivenPipeline.cxx, line
> 635 vtkStreamingDemandDrivenPipeline (0x17bc1e50): Algorithm
> vtkTransformFilter(0x1e61a790) did not create output for port 0 when
> asked by REQUEST_DATA_OBJECT and does not specify a concrete
> DATA_TYPE_NAME.
>
>
> Does Anyone know what's wrong? Is there any other way of getting
> output (the modified points) from a vtkTransformFilter?
> thanks
>
>
> ---------------------------------
> Ahhh...imagining that irresistible "new car" smell?
> Check outnew cars at Yahoo! Autos.
>
> ------------------------------------------------------------------------
>
> _______________________________________________
> 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
>
--
Amy Squillacote
Kitware, Inc.
28 Corporate Drive
Clifton Park, NY 12065
Phone: (518) 371-3971 x106
More information about the vtkusers
mailing list