| 625 | } |
| 626 | |
| 627 | void vtkBoxWidget::OnMiddleButtonDown() |
| 628 | { |
| 629 | int X = this->Interactor->GetEventPosition()[0]; |
| 630 | int Y = this->Interactor->GetEventPosition()[1]; |
| 631 | |
| 632 | // Okay, we can process this. Try to pick handles first; |
| 633 | // if no handles picked, then pick the bounding box. |
| 634 | if (!this->CurrentRenderer || !this->CurrentRenderer->IsInViewport(X, Y)) |
| 635 | { |
| 636 | this->State = vtkBoxWidget::Outside; |
| 637 | return; |
| 638 | } |
| 639 | |
| 640 | vtkAssemblyPath* path = this->GetAssemblyPath(X, Y, 0., this->HandlePicker); |
| 641 | |
| 642 | if (path != nullptr) |
| 643 | { |
| 644 | this->State = vtkBoxWidget::Moving; |
| 645 | this->CurrentHandle = this->Handle[6]; |
| 646 | this->HighlightOutline(1); |
| 647 | this->HandlePicker->GetPickPosition(this->LastPickPosition); |
| 648 | this->ValidPick = 1; |
| 649 | } |
| 650 | else |
| 651 | { |
| 652 | path = this->GetAssemblyPath(X, Y, 0., this->HexPicker); |
| 653 | |
| 654 | if (path != nullptr) |
| 655 | { |
| 656 | this->State = vtkBoxWidget::Moving; |
| 657 | this->CurrentHandle = this->Handle[6]; |
| 658 | this->HighlightOutline(1); |
| 659 | this->HexPicker->GetPickPosition(this->LastPickPosition); |
| 660 | this->ValidPick = 1; |
| 661 | } |
| 662 | else |
| 663 | { |
| 664 | this->HighlightFace(this->HighlightHandle(nullptr)); |
| 665 | this->State = vtkBoxWidget::Outside; |
| 666 | return; |
| 667 | } |
| 668 | } |
| 669 | |
| 670 | this->EventCallbackCommand->SetAbortFlag(1); |
| 671 | this->StartInteraction(); |
| 672 | this->InvokeEvent(vtkCommand::StartInteractionEvent, nullptr); |
| 673 | this->Interactor->Render(); |
| 674 | } |
| 675 | |
| 676 | void vtkBoxWidget::OnMiddleButtonUp() |
| 677 | { |
no test coverage detected