Hi Klaus,
I did not directly see a reason why MouseMoveEvents are not processed.
To debug Interaction, you can set a brakepoint into mitkBaseRenderer line 611 
(MITK 0.12.2) in method MouseMoveEvent(..). Here the events are sent to 
EventMapper and should be matched to a mitk event ID and passed to your state 
machine via Globalinteraction.

In general to debug interaction is tricky as debugging will interfere with 
interaction. For this I have added debug outputs via mbi log (cmake-flag 
mbilog_enable_debug_messages) that show the behavior of state machines. But for 
this changes you would have to update.
Taking a look into 0.12 I just saw a flag (INTERDEBUG), that you could activate 
to log interaction: See mitkEventMapper.cpp line 505.

Hope this helps,
Ingmar


Von: Klaus Drechsler [mailto:[email protected]]
Gesendet: Donnerstag, 27. Januar 2011 10:11
An: [email protected]
Betreff: [mitk-users] Interactor doesn´t get mouse move events

Hi,

I have problems capturing mouse move events. They do not seem to get through to 
my interactor.

I defined the following statemachine:

  <stateMachine NAME="MyInteractions">
    <state NAME="WaitForMouseClick" ID="1" START_STATE="TRUE">
      <transition NAME="click" NEXT_STATE_ID="2" EVENT_ID="1">
        <action ID="10000" />
      </transition>
    </state>
    <state NAME="MouseMoveOrRelease" ID="2">
      <transition NAME="move" NEXT_STATE_ID="2" EVENT_ID="530">
        <action ID="10002" />
      </transition>
      <transition NAME="release" NEXT_STATE_ID="1" EVENT_ID="505">
        <action ID="10001" />
      </transition>
    </state>
  </stateMachine>



ExecuteAction is implemented as follows:

switch (action->GetActionId())
{
case 10000: //mouse clicked
{
   std::cout << "mouse clicked " << event->GetWorldPosition() << std::endl;
   ok=true;
   break;
}

case 10001: //mouse released
{
   std::cout << "mouse released " << event->GetWorldPosition() << std::endl;
   ok=true;
   break;
}
case 10002: //mouse move
{
   std::cout << "mouse moved " << event->GetWorldPosition() << std::endl;
   ok=true;
   break;
}

default:
   ok = Superclass::ExecuteAction(action, stateEvent);
}

mitk::RenderingManager::GetInstance()->RequestUpdateAll();
return ok;




In my functionality I attach the interactor to a surface:
m_DeformSurfaceInteractor  = SurfaceDeformInteractor::New("MyInteractions", 
m_SurfaceNode);


I expect to get the following events:

1. Left mouse button clicked
2. Mouse is moved with left mouse button clicked
3. Left mouse button is released


But in the DOS bos I only see "mouse released" and "mouse clicked". No move 
events.


At the beginning of ExecuteAction I print out the received ActionIDs:
std::cout << action->GetActionId() << std::endl;

However, my interactor only receives 10000 and 10001. Not 10002.


Can someone enlight me what I have overseen? What do I have to do to capture 
mouse move events?


I am still using MITK 0.12 together with "mainapp" (and cannot upgrade 
currently), but it should also work with this version as AffineInteractor for 
example does something similar (e.g. translate object with left button+move), 
but I do not see what I am missing. The documentation could not help me either 
(or I am too blind to find it :)).


I am thankful for any help!

Best wishes,
 Klaus

------------------------------------------------------------------------------
Special Offer-- Download ArcSight Logger for FREE (a $49 USD value)!
Finally, a world-class log management solution at an even better price-free!
Download using promo code Free_Logger_4_Dev2Dev. Offer expires 
February 28th, so secure your free ArcSight Logger TODAY! 
http://p.sf.net/sfu/arcsight-sfd2d
_______________________________________________
mitk-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/mitk-users

Reply via email to