[vtk-developers] New feature: improved hover support

Karthik Krishnan karthik.krishnan at kitware.com
Wed Sep 9 12:40:53 EDT 2009


Hi Jeff / Ken:

Perhaps supporting both approaches may be worthwhile. They are two different
use cases, aren't they ?

1. You want immediate feedback about the regions your mouse is over, not
after a hover/delay. This is what the class vtkScenePicker already
accomplishes. The utility of the class arises during "Actor Selection". The
class was written with the intention of detecting when your mouse
transitions from one actor to another.

2. The second use case is what you have here. Detecting the actor over which
the mouse is once its hovered over an actor for a few seconds.


Picking the entire viewport during each still render is more appropriate for
(1). (This is what vtkScenePicker does)

Picking the entire viewport after each hover/delay may be more appropriate
for (2).


Thanks
--
karthik

On Wed, Sep 9, 2009 at 12:11 PM, Jeff Baumes <jeff.baumes at kitware.com>wrote:

> It is an option, but it's currently on by default. I can modify this. This
> was a "first effort" approach for generic hover labels in rendered views.
> There may be other strategies that may work in tandem with or replace this
> approach in the future.
> Jeff
>
>
> On Wed, Sep 9, 2009 at 11:59 AM, Moreland, Kenneth <kmorel at sandia.gov>wrote:
>
>>  In general, the idea of having a second render in the still render
>> (effectively doubling the time) is troubling.  If you have a lot of geometry
>> that takes a while to render (which is not uncommon in a 3D view), the added
>> rendering time is not acceptable.
>>
>> Is this behavior an option and is it off by default?
>>
>> -Ken
>>
>>
>> On 9/9/09 9:37 AM, "Jeff Baumes" <jeff.baumes at kitware.com> wrote:
>>
>> Basically yes. The exception is the render caused when the actual hover
>> text changes and the scene needs to be re-rendered, in which case the pick
>> render is not performed. The problem is knowing when a render caused any
>> pipeline updates or camera changes, which are the cases where you need to
>> re-generate the pick map. BTW the cached pick map is also used for
>> drag-selections.
>>
>> Thinking about it, it would probably be better to wait for the first
>> "mouse dwell" or drag-selection to update the pick map, I'll make a note of
>> that.
>>
>> Jeff
>>
>> On Wed, Sep 9, 2009 at 11:27 AM, Moreland, Kenneth <kmorel at sandia.gov>
>> wrote:
>>
>> Does that mean every still render is actually rendered twice with the
>> second one basically a pick render?
>>
>> -Ken
>>
>>
>>
>> On 9/9/09 9:04 AM, "Jeff Baumes" <jeff.baumes at kitware.com <
>> http://jeff.baumes@kitware.com> > wrote:
>>
>> I've just checked in a change that allows improved hover support in
>> vtkRenderView subclasses.
>>
>> After each render (except during interaction), the view automatically
>> takes a "snapshot" of what is currently rendered in a special render mode
>> that maps pixel locations particular actors and cells. When the user's mouse
>> stops over a cell, the render view looks up the hovered cell in the map and
>> sends it to its representations to possibly produce a hover label.
>> Representations manage the pipleline/mappers/actors for displaying a
>> particular type of data in a view. They implement support for hover queries
>> by overriding GetHoverTextInternal().
>>
>> This is currently implemented in vtkRenderedGraphRepresentation, where the
>> user may select the vertex and edge hover arrays.
>>
>> The view also allows the hover labels not to be rendered with OpenGL, but
>> invokes a HoverEvent when the hover label changes. This would allow an
>> application to capture these events and use real native tooltips (e.g. with
>> Qt) to show the hover labels.
>>
>> Jeff
>>
>>
>>
>>
>>    ****      Kenneth Moreland
>>     ***      Sandia National Laboratories
>> ***********
>> *** *** ***  email: kmorel at sandia.gov <http://kmorel@sandia.gov>
>> **  ***  **  phone: (505) 844-8919
>>     ***      web:   http://www.cs.unm.edu/~kmorel<http://www.cs.unm.edu/%7Ekmorel>
>>
>>
>>
>>
>>
>>
>>    ****      Kenneth Moreland
>>     ***      Sandia National Laboratories
>> ***********
>> *** *** ***  email: kmorel at sandia.gov
>> **  ***  **  phone: (505) 844-8919
>>     ***      web:   http://www.cs.unm.edu/~kmorel<http://www.cs.unm.edu/%7Ekmorel>
>>
>>
>
>
> --
> Jeff Baumes, Ph.D.
> R&D Engineer, Kitware Inc.
> (518) 881-4932
> jeff.baumes at kitware.com
>
> _______________________________________________
> 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
>
>
>


-- 
Karthik Krishnan
R&D Engineer,
Kitware Inc.
Ph: 518 881 4919
Fax: 518 371 4573
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://public.kitware.com/pipermail/vtk-developers/attachments/20090909/edcd5ead/attachment.html>


More information about the vtk-developers mailing list