[vtkusers] vtkContourWidget - continous line drawing

Dean Inglis dean.inglis at camris.ca
Fri Mar 5 09:13:32 EST 2010


Hi Karthik,

ok, I'll give it a shot without the custom callback command
and event translation mods.

Dean


> This is great. I tried it and I like it. Could you add this bit of
> functionality to the widget itself, perhaps yet another mode say,
> "ContinuousModeOn()" ?
>
> Thanks
> --
> karthik
>
> On Thu, Mar 4, 2010 at 6:04 PM, Dean Inglis <dean.inglis at camris.ca> wrote:
>> 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
>> _______________________________________________
>> Powered by www.kitware.com
>>
>> Visit other Kitware open-source projects at
>> http://www.kitware.com/opensource/opensource.html
>>
>> Please keep messages on-topic and check the VTK FAQ at:
>> http://www.vtk.org/Wiki/VTK_FAQ
>>
>> Follow this link to subscribe/unsubscribe:
>> http://www.vtk.org/mailman/listinfo/vtkusers
>>
>> 




More information about the vtkusers mailing list