[vtkusers] BorderWidget with mouse

John Drescher drescherjm at gmail.com
Fri Oct 22 14:20:19 EDT 2010


On Fri, Oct 22, 2010 at 2:16 PM, Leonardo M. Ramé <l.rame at griensu.com> wrote:
> Hi, I'm testing vtkBorderWidget but I don't like the results I'm
> getting.
>
> This code places a borderWidget in a QVTKwidget, then I can manipulate
> it with the mouse:
>
>    borderWidget = vtkBorderWidget::New();
>    borderWidget->SetInteractor(this->GetInteractor());
>    borderWidget->CreateDefaultRepresentation();
>    borderWidget->On();
>
> What I would like is to let the user pick a point in the QVTKWidget,
> then start dragging to create a box, like many drawing programs do. When
> the box is created, the user should resize it (vtkBorderWidget already
> does this), and, when the user click inside the borderWidget and drag
> the mouse, the widget should move until the user stop dragging.
>
> Does anybody knows how can I get this behavior? or a similar widget that
> alows me to do this?.
>

Derive your class from vtkBorderWidget and add the additional drag
functionality.

John



More information about the vtkusers mailing list