------------------------------------------------------------------------------
| 670 | |
| 671 | //------------------------------------------------------------------------------ |
| 672 | void vtkLineWidget::OnMiddleButtonDown() |
| 673 | { |
| 674 | int forward = 0; |
| 675 | |
| 676 | int X = this->Interactor->GetEventPosition()[0]; |
| 677 | int Y = this->Interactor->GetEventPosition()[1]; |
| 678 | |
| 679 | // Okay, make sure that the pick is in the current renderer |
| 680 | if (!this->CurrentRenderer || !this->CurrentRenderer->IsInViewport(X, Y)) |
| 681 | { |
| 682 | this->State = vtkLineWidget::Outside; |
| 683 | return; |
| 684 | } |
| 685 | |
| 686 | // Okay, we can process this. Try to pick handles first; |
| 687 | // if no handles picked, then pick the bounding box. |
| 688 | vtkAssemblyPath* path = this->GetAssemblyPath(X, Y, 0., this->HandlePicker); |
| 689 | |
| 690 | if (path != nullptr) |
| 691 | { |
| 692 | this->EventCallbackCommand->SetAbortFlag(1); |
| 693 | this->StartInteraction(); |
| 694 | this->InvokeEvent(vtkCommand::StartInteractionEvent, nullptr); |
| 695 | this->State = vtkLineWidget::MovingLine; |
| 696 | this->HighlightHandles(1); |
| 697 | this->HighlightLine(1); |
| 698 | this->EnablePointWidget(); |
| 699 | forward = this->ForwardEvent(vtkCommand::LeftButtonPressEvent); |
| 700 | } |
| 701 | else |
| 702 | { |
| 703 | path = this->GetAssemblyPath(X, Y, 0., this->LinePicker); |
| 704 | |
| 705 | if (path != nullptr) |
| 706 | { |
| 707 | this->EventCallbackCommand->SetAbortFlag(1); |
| 708 | this->StartInteraction(); |
| 709 | this->InvokeEvent(vtkCommand::StartInteractionEvent, nullptr); |
| 710 | // The highlight methods set the LastPickPosition, so they are ordered |
| 711 | this->HighlightHandles(1); |
| 712 | this->HighlightLine(1); |
| 713 | this->State = vtkLineWidget::MovingLine; |
| 714 | this->EnablePointWidget(); |
| 715 | forward = this->ForwardEvent(vtkCommand::LeftButtonPressEvent); |
| 716 | } |
| 717 | else |
| 718 | { |
| 719 | this->State = vtkLineWidget::Outside; |
| 720 | return; |
| 721 | } |
| 722 | } |
| 723 | |
| 724 | if (!forward) |
| 725 | { |
| 726 | this->Interactor->Render(); |
| 727 | } |
| 728 | } |
| 729 |
no test coverage detected