| 522 | } |
| 523 | |
| 524 | void vtkBrokenLineWidget::OnLeftButtonDown() |
| 525 | { |
| 526 | int X = this->Interactor->GetEventPosition()[0]; |
| 527 | int Y = this->Interactor->GetEventPosition()[1]; |
| 528 | |
| 529 | // Okay, make sure that the pick is in the current renderer |
| 530 | if (!this->CurrentRenderer || !this->CurrentRenderer->IsInViewport(X, Y)) |
| 531 | { |
| 532 | this->State = vtkBrokenLineWidget::Outside; |
| 533 | return; |
| 534 | } |
| 535 | |
| 536 | this->State = vtkBrokenLineWidget::Moving; |
| 537 | |
| 538 | // Okay, we can process this. Try to pick handles first; |
| 539 | // if no handles picked, then try to pick the line. |
| 540 | vtkAssemblyPath* path = this->GetAssemblyPath(X, Y, 0., this->HandlePicker); |
| 541 | |
| 542 | if (path != nullptr) |
| 543 | { |
| 544 | this->CurrentHandleIndex = this->HighlightHandle(path->GetFirstNode()->GetViewProp()); |
| 545 | } |
| 546 | else |
| 547 | { |
| 548 | path = this->GetAssemblyPath(X, Y, 0., this->LinePicker); |
| 549 | |
| 550 | if (path != nullptr) |
| 551 | { |
| 552 | this->HighlightLine(1); |
| 553 | } |
| 554 | else |
| 555 | { |
| 556 | this->CurrentHandleIndex = this->HighlightHandle(nullptr); |
| 557 | this->State = vtkBrokenLineWidget::Outside; |
| 558 | return; |
| 559 | } |
| 560 | } |
| 561 | |
| 562 | this->EventCallbackCommand->SetAbortFlag(1); |
| 563 | this->StartInteraction(); |
| 564 | this->InvokeEvent(vtkCommand::StartInteractionEvent, nullptr); |
| 565 | this->Interactor->Render(); |
| 566 | } |
| 567 | |
| 568 | void vtkBrokenLineWidget::OnLeftButtonUp() |
| 569 | { |
no test coverage detected