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

Method OnMiddleButtonDown

Interaction/Widgets/vtkPointWidget.cxx:342–374  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

340}
341
342void vtkPointWidget::OnMiddleButtonDown()
343{
344 int X = this->Interactor->GetEventPosition()[0];
345 int Y = this->Interactor->GetEventPosition()[1];
346
347 // Okay, make sure that the pick is in the current renderer
348 if (!this->CurrentRenderer || !this->CurrentRenderer->IsInViewport(X, Y))
349 {
350 this->State = vtkPointWidget::Outside;
351 return;
352 }
353
354 // Okay, we can process this.
355 vtkAssemblyPath* path = this->GetAssemblyPath(X, Y, 0., this->CursorPicker);
356
357 if (path != nullptr)
358 {
359 this->State = vtkPointWidget::Translating;
360 this->Highlight(1);
361 this->ConstraintAxis = this->DetermineConstraintAxis(-1, nullptr);
362 }
363 else
364 {
365 this->State = vtkPointWidget::Outside;
366 this->ConstraintAxis = -1;
367 return;
368 }
369
370 this->EventCallbackCommand->SetAbortFlag(1);
371 this->StartInteraction();
372 this->InvokeEvent(vtkCommand::StartInteractionEvent, nullptr);
373 this->Interactor->Render();
374}
375
376void vtkPointWidget::OnMiddleButtonUp()
377{

Callers 1

ProcessEventsMethod · 0.95

Calls 7

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

Tested by

no test coverage detected