MCPcopy Create free account
hub / github.com/Kitware/VTK / HandleMotionEvent

Method HandleMotionEvent

Rendering/UI/vtkAndroidRenderWindowInteractor.cxx:399–457  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

397}
398
399void vtkAndroidRenderWindowInteractor::HandleMotionEvent(
400 int actionType, int actionId, int numPtrs, int* xPtr, int* yPtr, int* idPtr, int metaState)
401{
402 for (int i = 0; i < numPtrs; ++i)
403 {
404 this->SetEventInformationFlipY(
405 xPtr[i], yPtr[i], metaState & AMETA_CTRL_ON, metaState & AMETA_SHIFT_ON, 0, 0, 0, idPtr[i]);
406 }
407
408 switch (actionType)
409 {
410 case AMOTION_EVENT_ACTION_POINTER_DOWN:
411 case AMOTION_EVENT_ACTION_DOWN:
412 {
413 // just return if it is already down
414 if (this->GetPointerIndexForExistingContact(actionId) > -1)
415 {
416 return;
417 }
418 int index = this->GetPointerIndexForContact(actionId);
419 if (index > -1)
420 {
421 this->SetPointerIndex(index);
422 this->LeftButtonPressEvent();
423 }
424 }
425 return;
426 // an up event ends all
427 case AMOTION_EVENT_ACTION_UP:
428 {
429 // kill off all current pointers
430 for (int i = 0; i < VTKI_MAX_POINTERS; i++)
431 {
432 if (this->IsPointerIndexSet(i))
433 {
434 this->SetPointerIndex(i);
435 this->LeftButtonReleaseEvent();
436 this->ClearPointerIndex(i);
437 }
438 }
439 return;
440 }
441 case AMOTION_EVENT_ACTION_POINTER_UP:
442 {
443 // is it already down?
444 int i = this->GetPointerIndexForExistingContact(actionId);
445 if (i > -1)
446 {
447 this->SetPointerIndex(i);
448 this->LeftButtonReleaseEvent();
449 this->ClearContact(actionId);
450 }
451 }
452 return;
453 case AMOTION_EVENT_ACTION_MOVE:
454 this->MouseMoveEvent();
455 return;
456 } // end switch action

Calls 8

IsPointerIndexSetMethod · 0.80
ClearPointerIndexMethod · 0.80
ClearContactMethod · 0.80
LeftButtonPressEventMethod · 0.45
MouseMoveEventMethod · 0.45

Tested by

no test coverage detected