Hi,

the problem here is that you accidentally mixed an old Interaction Event with a 
new Interaction.
What you are looking for is the InteractionPositionEvent (see [1] for an 
inheritance diagram).

This should work:


  InteractionPositionEvent* pos = dynamic_cast<InteractionPositionEvent*> 
(interactionEvent);
  if (pos != NULL)
  {
    m_DisplayPosition = pos->GetPointerPositionOnScreen();
    m_WorldPosition = pos->GetPositionInWorld();
  }

Are you working in the  2D or 3D  render window ?

Best
Christian

[1] http://docs.mitk.org/nightly-qt4/classmitk_1_1InteractionEvent.html


________________________________________
From: Alyson Roger [[email protected]]
Sent: Tuesday, December 10, 2013 4:03 PM
To: [email protected]
Subject: [mitk-users] Mouse Interaction

hello Mitk users,

I am defining my own interaction according to the last discussion on "add a new 
state machine".  I want to realize a mouse hover that detect if a DataNode is 
present in the RenderingWindow at the same position as my mouse pointer. The 
interactor detects the movement of the mouse, but when I intend to pick up the 
coordinates of the mouse pointer in the RenderingWindow through the 
DisplayPositionEvent, it gives me NULL results.

Here is my code where I can not go over the while loop for any position of the 
mouse.

bool mitk::MyPlaneDataInteractor::ColorOnPlane(StateMachineAction* 
stateMachineAction, InteractionEvent* interactionEvent)
{
    const DisplayPositionEvent *dpe = dynamic_cast<const 
DisplayPositionEvent*>(interactionEvent);
    while(dpe == NULL)
    {
        break;
    }

 ... rest of the code

}


Someone has any idea of how can I pick up my mouse position with my interactor?

Thanks.


--
Alyson ROGER

+54 11 5645-8674
[email protected]<mailto:[email protected]>



------------------------------------------------------------------------------
Rapidly troubleshoot problems before they affect your business. Most IT 
organizations don't have a clear picture of how application performance 
affects their revenue. With AppDynamics, you get 100% visibility into your 
Java,.NET, & PHP application. Start your 15-day FREE TRIAL of AppDynamics Pro!
http://pubads.g.doubleclick.net/gampad/clk?id=84349831&iu=/4140/ostg.clktrk
_______________________________________________
mitk-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/mitk-users

Reply via email to