[vtkusers] Vtk 5/6 vs 4. Decouple filter output from pipeline
Alethea Bair-Sutherland
alethea at anatomage.com
Tue Jan 21 14:37:55 EST 2014
Say we have a vtk pipeline:
InputData -> Filter1 -> Filter2 -> OutputData
and we don't want to keep track of the inputs or filters once the outputdata has been produced, but would like to pass around OutputData as though it were an independent object. In the past, (vtk 4) we had used the following:
Filter2->Update();
OuputData->Register(NULL); // increment reference count
OutputData->SetSource(NULL); // remove old source (decrements reference count)
Filter2->Delete();Filter1->Delete();
InputData->Delete();
It seems like the vtk 6 equivalent is the following?
Filter2->Update();
OuputData = vtkDataSet::New(); // make new object of desired type
OutputData->ShallowCopy(Filter2->GetOutputPort()); // shallow copy filter output
Filter2->Delete();Filter1->Delete();
InputData->Delete();
Is this correct? Are there any cases where DeepCopy would be needed?
thanks for your help!
-Alethea
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.vtk.org/pipermail/vtkusers/attachments/20140121/ef603eb3/attachment.html>
More information about the vtkusers
mailing list