[vtk-developers] VTK 5.0 branch in mid-August

Brad King brad.king at kitware.com
Thu Aug 4 14:19:15 EDT 2005


lucantiga at softhome.net wrote:
> Hello everyone,
> I might have missed the end of the story, but in
> http://public.kitware.com/pipermail/vtk-developers/2005-June/003362.html
> the issue of pipelines holding downstream and upstream references was
> raised. The two solutions Ken proposed were
> 1) keeping a doubly linked list with strong references, assuming developers
> take care of disconnecting filters both ways
> 2) making downstream references weak, allowing developers to call
> something like the good old UnregisterAllOutputs (which I personally
> found very handy)
> I'm sorry if the issue has been already solved and I missed the boat, but
> I think this needs to be clarified before the release of VTK 5.

We've adopted solution 2.  Look in 
Filtering/vtkInformationExecutivePortVectorKey.cxx.  There is a macro at 
the top called VTK_USE_SINGLE_REF.  If defined it will use solution 2. 
Otherwise solution 1 will be used.  Currently it is always defined, and 
the option may eventually be removed altogether.

> In case solution 1) was adopted, what's the most correct way to
> detach and destroy the upstream part of a pipeline without deep copying
> its output?

Remove the input connections at the point where you want to break it and 
delete the filters.

-Brad



More information about the vtk-developers mailing list