| 290 | } |
| 291 | |
| 292 | void 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 | |
| 326 | void vtkPointWidget::OnLeftButtonUp() |
| 327 | { |
no test coverage detected