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

Method OnMiddleButtonDown

Interaction/Widgets/vtkBoxWidget.cxx:627–674  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

625}
626
627void 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
676void vtkBoxWidget::OnMiddleButtonUp()
677{

Callers 1

ProcessEventsMethod · 0.95

Calls 9

HighlightOutlineMethod · 0.95
HighlightFaceMethod · 0.95
HighlightHandleMethod · 0.95
IsInViewportMethod · 0.80
GetPickPositionMethod · 0.80
InvokeEventMethod · 0.80
RenderMethod · 0.65
GetAssemblyPathMethod · 0.45
StartInteractionMethod · 0.45

Tested by

no test coverage detected