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

John Platt jcplatt at dsl.pipex.com
Wed Feb 3 04:46:36 EST 2010


David,

There has been some discussion on this before. RedrawRubberBand() is just 
too slow on Windows because it copies all the pixel data in the viewport. 
The attached version of vtkInteractorStyleRubberBandZoom just copies the 4 
lines of the box
and consequently is considerably quicker. It also zooms out if the control 
key is down. I would be pleased if this code could be used in any 
refactoring.

John.


----- Original Message ----- 
From: David Doria
Cc: VTK Developers
Sent: Wednesday, February 03, 2010 12:56 AM
Subject: Re: [vtk-developers] 2D vs 3D rubber band interactor style


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



_______________________________________________
Powered by www.kitware.com

Visit other Kitware open-source projects at 
http://www.kitware.com/opensource/opensource.html

Follow this link to subscribe/unsubscribe:
http://www.vtk.org/mailman/listinfo/vtk-developers 
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: vtkInteractorStyleRubberBandZoom1.h
URL: <http://public.kitware.com/pipermail/vtk-developers/attachments/20100203/beb001c2/attachment.h>
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: vtkInteractorStyleRubberBandZoom1.cxx
URL: <http://public.kitware.com/pipermail/vtk-developers/attachments/20100203/beb001c2/attachment.ksh>


More information about the vtk-developers mailing list