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

kent williams nkwmailinglists at gmail.com
Mon Apr 14 17:23:31 EDT 2008


Heh.  I took a slightly different approach which involves treating the
existing vtk classes as a black box, and working around them.

What I've ended up with is a class that uses one or more
vtkContourWidgets, but when the user moves from slice to slice, the
contour points are save in a separate list.  So I have to catch when
the slice changes, and save the current slice's contour data points,
and then look up the new slice's contour points, and, using the same
pool of contour widgets, display the contours for the new slice.

Right now there is some dependencies on the VTKINRIA3D classes for
displaying curves in the off-axis planes, but the goal is to refactor
my Contour manager to derive from vtkAbstractWidget, so that I can
keep track of which curve is considered the 'active' curve for editing
purposes.  There's also a request for supporting more than one
multi-contour widget per view, to display and allow editing of
multiple masks...

On Sun, Apr 13, 2008 at 10:08 PM, Dean Inglis <dean.inglis at sympatico.ca> wrote:
> Hi Kent,
>
>  how odd that we seem to be working on the same problems!
>  Our solution for 3D image based contour work was to take
>  vtkContourRepresentation and vtkOrientedGlyphContourRepresentation,
>  and distill them down to one simple contour class. You can alter
>  vtkContourRepresentation to be a hybrid vtkProp but keep the
>  paradigm of nodes, interpolators and point placers.  With
>  multi-slice images you can use stl containers for contour
>  management: std::list for within slices and std::vector for between
>  slices.  You can do undo/redo contour editing by interfacing
>  vtkContourWidget to take the nodes of a contour class as input
>  for user interaction, or vtkAffineWidget for affine transforms
>  (translation, rotation, scaling).
>
>  HTH,
>  Dean
>
>



More information about the vtk-developers mailing list