[vtkusers] building vtkPolyData in a function and return it

chrisyeshi chrisyeshi at gmail.com
Tue Sep 21 13:50:17 EDT 2010


What I am trying to do is to make a vtkpolydata in a function, and then apply
some sort of filter, and then return the vtkpolydata.

the actual code would look something like this:

vtkPolyData *poly1 = vtkPolyData::New();
// generate poly1 here
vtkPolyData *poly2 = vtkPolyData::New();
// generate poly2 here
vtkAppendPolyData *append = vtkAppendPolyData::New();
vtkPolyData *result = append->GetOutput();     // I tried deepcopy here, but
it doesn't work.

append->Delete();                                        // If I do not
delete these, it works, but memory leaks
poly2->Delete();
poly1->Delete();

return result;
-- 
View this message in context: http://vtk.1045678.n5.nabble.com/building-vtkPolyData-in-a-function-and-return-it-tp2848479p2848479.html
Sent from the VTK - Users mailing list archive at Nabble.com.



More information about the vtkusers mailing list