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

Method OnRightButtonDown

Interaction/Widgets/vtkPointWidget.cxx:392–428  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

390}
391
392void vtkPointWidget::OnRightButtonDown()
393{
394 int X = this->Interactor->GetEventPosition()[0];
395 int Y = this->Interactor->GetEventPosition()[1];
396
397 // Okay, make sure that the pick is in the current renderer
398 if (!this->CurrentRenderer || !this->CurrentRenderer->IsInViewport(X, Y))
399 {
400 this->State = vtkPointWidget::Outside;
401 return;
402 }
403
404 // Okay, we can process this. Pick the cursor.
405 vtkAssemblyPath* path = this->GetAssemblyPath(X, Y, 0., this->CursorPicker);
406
407 if (path != nullptr)
408 {
409 this->State = vtkPointWidget::Scaling;
410 int idx = this->CursorPicker->GetCellId();
411 if (idx >= 0 && idx < 3)
412 {
413 this->ConstraintAxis = idx;
414 }
415 this->Highlight(1);
416 }
417 else
418 {
419 this->State = vtkPointWidget::Outside;
420 this->ConstraintAxis = -1;
421 return;
422 }
423
424 this->EventCallbackCommand->SetAbortFlag(1);
425 this->StartInteraction();
426 this->InvokeEvent(vtkCommand::StartInteractionEvent, nullptr);
427 this->Interactor->Render();
428}
429
430void vtkPointWidget::OnRightButtonUp()
431{

Callers 1

ProcessEventsMethod · 0.95

Calls 7

HighlightMethod · 0.95
IsInViewportMethod · 0.80
InvokeEventMethod · 0.80
RenderMethod · 0.65
GetAssemblyPathMethod · 0.45
GetCellIdMethod · 0.45
StartInteractionMethod · 0.45

Tested by

no test coverage detected