| 397 | } |
| 398 | |
| 399 | void 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 |
no test coverage detected