[vtkusers] vtkContourWidget - continous line drawing
Dean Inglis
dean.inglis at camris.ca
Thu Mar 4 18:04:15 EST 2010
I've figured out how to get vtkContourWidget to do continuous
or snap line drawing on a vtkImageActor by making use of a callback
and the widget's vtkWidgetEventTranslator, but its a bit kludgy.
Part of the problem is that the widget only fires off vtkCommand
events and not its vtkWidgetEvent events, so I had to do a mix of
observing both widget and renderwindowinteractor fired events.
With this set up the user can:
1) left button down to start a contour
2) left down and hold and drag draws continuously
3) left down and up snap draws if FollowCursor is set to on in the widget
4) right button down finishes the contour
5) middle button down deletes the contour
Im wondering if anyone has figured out a more elegant solution that
wouldnt involve all this lower level tinkering.
If anyone is interested, the code is attached.
thanks,
Dean
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: TestContourDrawing.cxx
URL: <http://www.vtk.org/pipermail/vtkusers/attachments/20100304/c8f413a1/attachment.asc>
More information about the vtkusers
mailing list