[vtk-developers] 2D vs 3D rubber band interactor style

David Doria daviddoria+vtk at gmail.com
Tue Feb 2 19:56:57 EST 2010


On Tue, Feb 2, 2010 at 6:46 PM, David E DeMarle <dave.demarle at kitware.com>wrote:

> The rubber band interactor styles should definately be unified. I stole
> from rubberbandzoom to make rubberbandpick and later the other two were
> stolen from one of those.
>
> They should all have a common helper class which does the xor rendering of
> the rubber band (and whatever else is common) and leaves the functionality
> differences to the existing classes.
>
> David E DeMarle
>
>
What about just a vtkInteractorStyleRubberBand superclass for
the vtkInteractorStyleRubberBand* classes?

OnLeftButtonDown() and OnLeftButtonUp() should be the same for all the
rubberband classes - they just get the start and end position of the
rubberband selection.

I believe RedrawRubberBand() is also the same for all of them.

So OnLeftButtonDown(), OnLeftButtonUp(), and RedrawRubberBand() could just
live in the superclass.

Those 3 functions are the bulk of the duplicated code. The other mouse
buttons could stay duplicated because they are short and the name of the
class doesn't indicate anything about what those buttons should do.

Thoughts?

David
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://public.kitware.com/pipermail/vtk-developers/attachments/20100202/e964ee36/attachment.html>


More information about the vtk-developers mailing list