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

Method OnLeftButtonDown

Interaction/Widgets/vtkBrokenLineWidget.cxx:524–566  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

522}
523
524void vtkBrokenLineWidget::OnLeftButtonDown()
525{
526 int X = this->Interactor->GetEventPosition()[0];
527 int Y = this->Interactor->GetEventPosition()[1];
528
529 // Okay, make sure that the pick is in the current renderer
530 if (!this->CurrentRenderer || !this->CurrentRenderer->IsInViewport(X, Y))
531 {
532 this->State = vtkBrokenLineWidget::Outside;
533 return;
534 }
535
536 this->State = vtkBrokenLineWidget::Moving;
537
538 // Okay, we can process this. Try to pick handles first;
539 // if no handles picked, then try to pick the line.
540 vtkAssemblyPath* path = this->GetAssemblyPath(X, Y, 0., this->HandlePicker);
541
542 if (path != nullptr)
543 {
544 this->CurrentHandleIndex = this->HighlightHandle(path->GetFirstNode()->GetViewProp());
545 }
546 else
547 {
548 path = this->GetAssemblyPath(X, Y, 0., this->LinePicker);
549
550 if (path != nullptr)
551 {
552 this->HighlightLine(1);
553 }
554 else
555 {
556 this->CurrentHandleIndex = this->HighlightHandle(nullptr);
557 this->State = vtkBrokenLineWidget::Outside;
558 return;
559 }
560 }
561
562 this->EventCallbackCommand->SetAbortFlag(1);
563 this->StartInteraction();
564 this->InvokeEvent(vtkCommand::StartInteractionEvent, nullptr);
565 this->Interactor->Render();
566}
567
568void vtkBrokenLineWidget::OnLeftButtonUp()
569{

Callers 1

ProcessEventsHandlerMethod · 0.95

Calls 9

HighlightHandleMethod · 0.95
HighlightLineMethod · 0.95
IsInViewportMethod · 0.80
GetFirstNodeMethod · 0.80
InvokeEventMethod · 0.80
RenderMethod · 0.65
GetAssemblyPathMethod · 0.45
GetViewPropMethod · 0.45
StartInteractionMethod · 0.45

Tested by

no test coverage detected