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

Method OnRightButtonDown

Interaction/Widgets/vtkSphereWidget.cxx:485–523  ·  view source on GitHub ↗

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

Source from the content-addressed store, hash-verified

483
484//------------------------------------------------------------------------------
485void vtkSphereWidget::OnRightButtonDown()
486{
487 if (!this->Interactor)
488 {
489 return;
490 }
491
492 this->State = vtkSphereWidget::Scaling;
493
494 int X = this->Interactor->GetEventPosition()[0];
495 int Y = this->Interactor->GetEventPosition()[1];
496
497 // Okay, make sure that the pick is in the current renderer
498 if (!this->CurrentRenderer || !this->CurrentRenderer->IsInViewport(X, Y))
499 {
500 this->State = vtkSphereWidget::Outside;
501 return;
502 }
503
504 // Okay, we can process this. Try to pick handles first;
505 // if no handles picked, then pick the bounding box.
506 vtkAssemblyPath* path = this->GetAssemblyPath(X, Y, 0., this->Picker);
507
508 if (path == nullptr)
509 {
510 this->State = vtkSphereWidget::Outside;
511 this->HighlightSphere(0);
512 return;
513 }
514 else
515 {
516 this->HighlightSphere(1);
517 }
518
519 this->EventCallbackCommand->SetAbortFlag(1);
520 this->StartInteraction();
521 this->InvokeEvent(vtkCommand::StartInteractionEvent, nullptr);
522 this->Interactor->Render();
523}
524
525//------------------------------------------------------------------------------
526void vtkSphereWidget::OnRightButtonUp()

Callers 1

ProcessEventsMethod · 0.95

Calls 6

HighlightSphereMethod · 0.95
IsInViewportMethod · 0.80
InvokeEventMethod · 0.80
RenderMethod · 0.65
GetAssemblyPathMethod · 0.45
StartInteractionMethod · 0.45

Tested by

no test coverage detected