[vtk-developers] HOW DO YOU ... aggregate vtk Widget

kent williams nkwmailinglists at gmail.com
Thu Apr 3 16:54:53 EDT 2008


I have an application that allow tracing of 3D features in volume
images -- in our specific case, anatomical features of the brain.

To do this I use multiple instances of vtkContourWidget.

vtkContourWidget wasn't really designed to be used this way, but it
behaves remarkably well.  My empirical observation of its behavior is
that for a give rendering window, if there are multiple instances in
the view, you can only add points to the currently open Contour.  If
all contours are closed, which contour catches interactions depends on
whose control points to which the mouse cursor.  So even if you add 10
contours you can add points to only one contour at a time.

In my initial work on the tracer, all the state information, event
handlers, etc are associated with my class that encapsulates the
viewer in which tracing occurs.

I want to separate all the multiple contour widget management into
it's own class, so that it can be instantied and used with any vtk
viewer.  My question is this:
The obvious 'vtk' way to do this would be to sublcass
vtkAbstractWidget, but this carries with it all sorts of baggage I
don't care for. What I want -- call it vtkMultiContourWidget has all
its constituent vtkContourWidget instances, so it doesn't need
everything that's in vtkAbstractWidget.   So where should this new
class fit in the VTK class hierarchy? Should I just derive it from
vtkObject and then do whatever internal management necessary myself,
or ...



More information about the vtk-developers mailing list