[vtkusers] Heads Up Display (picking, vtkActor2D, transparent renderers)

Jorrit Schaap jorrit at lkeb.azl.nl
Mon Aug 21 04:44:32 EDT 2000


Hello everybody,

Introduction:
I'm trying to make a Heads Up Display (HUD) in my renderwindow.
For this I use vtkActor2D's that display text in one of the corners, for
example "parallel" or "perspective". I would like to be able to click on
the text, then get a popup menu (not using MFC, or any other GUI, just
VTK), and make a selection. Maybe in the future Ii would like to make
some nifty sliders and other controls, just using VTK.
I know this is all possible, 'cause I already build it. The problem is
that the HUD is drawn into a renderWindow that can contain very large
datasets that take a long time to render. So if you click any of the
HUD-controls, the whole scene gets rendered. This takes to log, and
isn't necesary.

What's needed:
- A vtkRenderWindow containing one renderer (or more) for the scene, and
a transparent renderer lying on top of that containing the HUD.
- If a mouse button is pressed, then first it is checked if any of the
HUD-controls is picked. This involves picking vtkActor2D's, which isn't
working correctly for some videocards at the moment (my SGI320 for
example) Only if none of the HUD-controls is picked, then the mouse
event is passed on to the other renderers.

Proposed new Class:

vtkHUDRenderer:
- This is a transparent renderer (i.e. it has a transparent background).
This can be done by modifying the Clear function. (See Patrick Lagace's
mail from July 20)
- It sizes itself to the renderer over which it is placed.
- It layouts the HUD. (for example, if you have some clickable text in
the upper-right corner, and you resize the window, then the text is
placed automaticaly in the upper-right corner again) This can be don
easely using relative coordinates.

Proposed existing Classes to be modified:

vtkRenderWindow:
- has to know about the existence of the vtkHUDRenderer. If it exists,
it has to be rendered later than all other renderers (See Patrick
Lagace's mail from July 20 again)

vtkRenderWindowInteractor:
- has to know about the existence of the vtkHUDRenderer. If it exists,
then the mouse-events should be passed to the vtkHUDRenderer first. This
render returns if it used the event (a HUD-control was picked). If not,
then the interactor passes the event on to the other renderers.


If this is all implemented, we can start making some more nifty controls
then clickable text. This should of course not be limited to
vtkActor2D's. Any vtkProp should be able to be used.
I'm willing to implement all this stuff, and share it with the rest of
you, 'cause I think it is something that is realy missing in VTK (which
is a splendid package btw). I just want to know if anybody has some
further ideas about this, and if Kitware is willing to accept the
changes to the existing classes.

Hope to hear from any of you!

Best Regards, Jorrit.





More information about the vtkusers mailing list