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

Method OnLeftButtonDown

Interaction/Widgets/vtkPointWidget.cxx:292–324  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

290}
291
292void vtkPointWidget::OnLeftButtonDown()
293{
294 int X = this->Interactor->GetEventPosition()[0];
295 int Y = this->Interactor->GetEventPosition()[1];
296
297 // Okay, make sure that the pick is in the current renderer
298 if (!this->CurrentRenderer || !this->CurrentRenderer->IsInViewport(X, Y))
299 {
300 this->State = vtkPointWidget::Outside;
301 return;
302 }
303
304 vtkAssemblyPath* path = this->GetAssemblyPath(X, Y, 0., this->CursorPicker);
305
306 if (path != nullptr)
307 {
308 this->State = vtkPointWidget::Moving;
309 this->Highlight(1);
310 this->ConstraintAxis = this->DetermineConstraintAxis(-1, nullptr);
311 }
312 else
313 {
314 this->State = vtkPointWidget::Outside;
315 this->Highlight(0);
316 this->ConstraintAxis = -1;
317 return;
318 }
319
320 this->EventCallbackCommand->SetAbortFlag(1);
321 this->StartInteraction();
322 this->InvokeEvent(vtkCommand::StartInteractionEvent, nullptr);
323 this->Interactor->Render();
324}
325
326void vtkPointWidget::OnLeftButtonUp()
327{

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