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

Method OnLeftButtonDown

Interaction/Widgets/vtkBoxWidget.cxx:554–608  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

552}
553
554void vtkBoxWidget::OnLeftButtonDown()
555{
556 int X = this->Interactor->GetEventPosition()[0];
557 int Y = this->Interactor->GetEventPosition()[1];
558
559 // Okay, we can process this. Try to pick handles first;
560 // if no handles picked, then pick the bounding box.
561 if (!this->CurrentRenderer || !this->CurrentRenderer->IsInViewport(X, Y))
562 {
563 this->State = vtkBoxWidget::Outside;
564 return;
565 }
566
567 vtkAssemblyPath* path = this->GetAssemblyPath(X, Y, 0., this->HandlePicker);
568
569 if (path != nullptr)
570 {
571 this->State = vtkBoxWidget::Moving;
572 this->HighlightFace(this->HighlightHandle(path->GetFirstNode()->GetViewProp()));
573 this->HandlePicker->GetPickPosition(this->LastPickPosition);
574 this->ValidPick = 1;
575 }
576 else
577 {
578 path = this->GetAssemblyPath(X, Y, 0., this->HexPicker);
579
580 if (path != nullptr)
581 {
582 this->State = vtkBoxWidget::Moving;
583 this->HexPicker->GetPickPosition(this->LastPickPosition);
584 this->ValidPick = 1;
585 if (!this->Interactor->GetShiftKey())
586 {
587 this->HighlightHandle(nullptr);
588 this->HighlightFace(this->HexPicker->GetCellId());
589 }
590 else
591 {
592 this->CurrentHandle = this->Handle[6];
593 this->HighlightOutline(1);
594 }
595 }
596 else
597 {
598 this->HighlightFace(this->HighlightHandle(nullptr));
599 this->State = vtkBoxWidget::Outside;
600 return;
601 }
602 }
603
604 this->EventCallbackCommand->SetAbortFlag(1);
605 this->StartInteraction();
606 this->InvokeEvent(vtkCommand::StartInteractionEvent, nullptr);
607 this->Interactor->Render();
608}
609
610void vtkBoxWidget::OnLeftButtonUp()
611{

Callers 1

ProcessEventsMethod · 0.95

Calls 12

HighlightFaceMethod · 0.95
HighlightHandleMethod · 0.95
HighlightOutlineMethod · 0.95
IsInViewportMethod · 0.80
GetFirstNodeMethod · 0.80
GetPickPositionMethod · 0.80
InvokeEventMethod · 0.80
RenderMethod · 0.65
GetAssemblyPathMethod · 0.45
GetViewPropMethod · 0.45
GetCellIdMethod · 0.45
StartInteractionMethod · 0.45

Tested by

no test coverage detected