[vtk-developers] vtkRect2DWidget & window resize

John Platt jcplatt at lineone.net
Wed Apr 20 04:25:33 EDT 2005


Hi Thierry,

 

Thank you for your suggestion. I am not sure this will cure the problem
of 2 events easily. After mouse move, the widget sends
this->Interactor->Render(). If the widget is observing StartEvent on the
render window, this may have been fired by mouse move or a window
resize.

 

However, I can filter the ModifiedEvent sent by
vtkRect2DActor::SizeRect2D() in the widget to eat it if the left mouse
button is not down. Doing this just gives 2 events when the widget is
enabled which is much better.

 

Thanks.

 

John. 

 

-----Original Message-----
From: Thierry CARRARD [mailto:thierry.carrard at cea.fr] 
Sent: 19 April 2005 08:00
To: 'John Platt'
Subject: RE: [vtk-developers] vtkRect2DWidget & window resize

 

Hi,

 

Since window resize triggers a render, you could use the StartEvent from
the render window and track "rewin->GetSize()" changes.

 

  _____  

De : vtk-developers-bounces at vtk.org
[mailto:vtk-developers-bounces at vtk.org] De la part de John Platt
Envoyé : lundi 18 avril 2005 10:43
À : vtk-developers at vtk.org
Objet : [vtk-developers] vtkRect2DWidget & window resize

Hi,

 

Attached is a 2D widget for interactively changing a rectangular
selection in a viewport. I am currently using it with
vtkSelectVisiblePoints to specify a region for labelling. I would like
to submit this code but have a problem handling resize of the render
window.

 

The classes follow the same model as vtkScalarBarActor &
vtkScalarBarWidget. Changes in the rectangle actor due to mouse
interaction events are caught by the widget but I can’t find an event to
observe for resizing the window. The present solution is for
vtkRect2DActor::SizeRect2D() to send a Modified event to the widget
which then invokes a Modified event for observers of the widget. The
problem is that any interaction with the widget now fires 2 events, an
Interaction event and a Modified event. I would be grateful for
suggestions on alternative solutions.

 

There is also a minor problem with the cursor shape changing as it
passes over the rectangle when interacting with the camera (this is also
a feature of vtkScalarBarWidget).

 

I have also noticed that the bottom right pixel of the rectangle frame
is always missing. I am hoping this is a problem with my graphics card.

 

Any other comments are also welcomed.

 

John. 

 

 

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


More information about the vtk-developers mailing list