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

Method OnRightButtonDown

Interaction/Widgets/vtkLineWidget.cxx:757–801  ·  view source on GitHub ↗

------------------------------------------------------------------------------

Source from the content-addressed store, hash-verified

755
756//------------------------------------------------------------------------------
757void vtkLineWidget::OnRightButtonDown()
758{
759 int X = this->Interactor->GetEventPosition()[0];
760 int Y = this->Interactor->GetEventPosition()[1];
761
762 // Okay, make sure that the pick is in the current renderer
763 if (!this->CurrentRenderer || !this->CurrentRenderer->IsInViewport(X, Y))
764 {
765 this->State = vtkLineWidget::Outside;
766 return;
767 }
768
769 // Okay, we can process this. Try to pick handles first;
770 // if no handles picked, then pick the bounding box.
771 vtkAssemblyPath* path = this->GetAssemblyPath(X, Y, 0., this->HandlePicker);
772
773 if (path != nullptr)
774 {
775 this->HighlightLine(1);
776 this->HighlightHandles(1);
777 this->State = vtkLineWidget::Scaling;
778 }
779 else
780 {
781 path = this->GetAssemblyPath(X, Y, 0., this->LinePicker);
782
783 if (path != nullptr)
784 {
785 this->HighlightHandles(1);
786 this->HighlightLine(1);
787 this->State = vtkLineWidget::Scaling;
788 }
789 else
790 {
791 this->State = vtkLineWidget::Outside;
792 this->HighlightLine(0);
793 return;
794 }
795 }
796
797 this->EventCallbackCommand->SetAbortFlag(1);
798 this->StartInteraction();
799 this->InvokeEvent(vtkCommand::StartInteractionEvent, nullptr);
800 this->Interactor->Render();
801}
802
803//------------------------------------------------------------------------------
804void vtkLineWidget::OnRightButtonUp()

Callers 1

ProcessEventsMethod · 0.95

Calls 7

HighlightLineMethod · 0.95
HighlightHandlesMethod · 0.95
IsInViewportMethod · 0.80
InvokeEventMethod · 0.80
RenderMethod · 0.65
GetAssemblyPathMethod · 0.45
StartInteractionMethod · 0.45

Tested by

no test coverage detected