[vtkusers] how to get output from a vtkTransformFilter ?

M.Salman at surrey.ac.uk M.Salman at surrey.ac.uk
Thu May 3 11:21:21 EDT 2007


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.

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.vtk.org/pipermail/vtkusers/attachments/20070503/9c387e5b/attachment.htm>


More information about the vtkusers mailing list