MantisBT - VTK
View Issue Details
0013323VTK(No Category)public2012-07-24 10:442016-08-12 09:55
edice 
Will Schroeder 
normalminorhave not tried
closedmoved 
5.8.0 
 
TBD
incorrect functionality
0013323: vtkInteractorStyle.cxx uses outdated EventPosition
In this code from vtkInteractorStyle.cxx:
    case 'f' :
    case 'F' :
      {
      if(this->CurrentRenderer!=0)
        {
        this->AnimState = VTKIS_ANIM_ON;
        vtkAssemblyPath *path = NULL;
        this->FindPokedRenderer(rwi->GetEventPosition()[0],
                                rwi->GetEventPosition()[1]);


The InteractorStyle is responding to a key press, and is using "EventPosition" to determine the poked renderer and the pick coordinate.

However, in QVTKInteractorAdapter.cxx (and also likely in the equivalent for MFC, Cocoa, etc) this is what is done in response to a key press:

iren->SetKeyEventInformation(
      (e2->modifiers() & Qt::ControlModifier),
      (e2->modifiers() & Qt::ShiftModifier),
      ascii_key, e2->count(), keysym);

SetKeyEventInformation() does everything except set EventPosition.
So the interactor style is using an EventPosition that was set during the last MouseMove or other mouse event.

That is normally ok, unless the mouse is moved outside the widget. The widget still has the focus and receives key presses, but EventPosition is left at the last known mouse position (at the point it left the window).


Fixes:
a)
Instead, the key event should call SetEventInformation() with the current mouse cursor position (from QCursor::pos(), converted to widget coords).

b)
The InteractorStyle should not use EventPosition, but instead use a mechanism to query the current mouse position.
hackaton, Interaction
Issue History
2012-07-24 10:44ediceNew Issue
2014-10-02 09:31Will SchroederAssigned To => Will Schroeder
2014-10-02 10:03Will SchroederTag Attached: hackaton
2014-10-02 12:52Will SchroederTag Attached: Interaction
2014-10-02 12:57Will SchroederNote Added: 0033485
2014-10-02 12:57Will SchroederNote Edited: 0033485bug_revision_view_page.php?bugnote_id=33485#r855
2016-07-06 16:48Berk GeveciStatusbacklog => expired
2016-07-06 16:48Berk GeveciNote Added: 0036266
2016-07-07 05:13ediceNote Added: 0036321
2016-07-07 05:13ediceNote Added: 0036322
2016-07-07 07:59Dave DeMarleNote Added: 0036324
2016-07-07 07:59Dave DeMarleStatusexpired => backlog
2016-07-07 07:59Dave DeMarleResolutionopen => reopened
2016-07-14 23:15ediceNote Added: 0036518
2016-07-27 11:20Cory QuammenNote Added: 0036631
2016-08-12 09:55Kitware RobotNote Added: 0037290
2016-08-12 09:55Kitware RobotStatusbacklog => closed
2016-08-12 09:55Kitware RobotResolutionreopened => moved

Notes
(0033485)
Will Schroeder   
2014-10-02 12:57   
Postponed for review when we redesign VTK widgets and interactors (added Interaction tag)

(0036266)
Berk Geveci   
2016-07-06 16:48   
Setting to status of bugs that have not been updated in the last year to expired. Please re-open if still important.
(0036321)
edice   
2016-07-07 05:13   
This is still important, was stated that it would be reviewed in the future... still waiting for the review... people are busy, I understand, so please leave this issue open until it can be processed.
(0036322)
edice   
2016-07-07 05:13   
How do I un-expire this issue?
(0036324)
Dave DeMarle   
2016-07-07 07:59   
Should be a "Change status to:" dropdown above. Perhaps permission levels prevent your from accessing it. One oddity is that in the subsequent dialog, Mantis says "issue expired" instead of "issue backlog" when you do change it, but despite the text the state changes correctly.
(0036518)
edice   
2016-07-14 23:15   
Thanks for the tip Dave
(0036631)
Cory Quammen   
2016-07-27 11:20   
edice, would you be willing to contribute a patch via our gitlab review process?

https://gitlab.kitware.com/vtk/vtk/blob/master/CONTRIBUTING.md [^]

You are likely now the expert on these particular pieces of VTK code, so a merge request on gitlab would be most welcome.
(0037290)
Kitware Robot   
2016-08-12 09:55   
Resolving issue as `moved`.

This issue tracker is no longer used. Further discussion of this issue may take place in the current VTK Issues page linked in the banner at the top of this page.