[vtkusers] Destroying a view after it has been added to a vtkViewUpdater

Byron Ponten vtkbyron at gmail.com
Sun Sep 5 12:39:30 EDT 2010


I have the following:


   - Qt application that uses MDI to create infoviz plots.
   - All plots synchronize with the same selection model patterned after
   discussion in "Kitware Source - Issue 9 . April 2009 - Selections in VTK"
   (with the exception of using an annotationlink instead of a selectionlink)
   thus all views are added to a vtkViewUpdater.
   - An MDI window is closed and the associated vtkView is destroyed.
   - Perform a selection in one of the remaining views.

This causes a problem because the view updater is still holding on to the
now deleted view and thus produces a segmentation violation.

The two solutions I've come up with so far are:

Option 1.
Added a new method to vtkViewUpdater called "RemoveView(vtkView* view).
This surgically removes the view in question from the internal vector of
views in the view updater.

Option 2.
Destroy the view updater and annotation link and rebuild all from scratch
whenever a view is destroyed.


So, is there a better way to do this given the current VTK API?  If not
should RemoveView() be added to vtkViewUpdater?

Thanks!

-byron
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.vtk.org/pipermail/vtkusers/attachments/20100905/985e184a/attachment.htm>


More information about the vtkusers mailing list