------------------------------------------------------------------------------
| 361 | |
| 362 | //------------------------------------------------------------------------------ |
| 363 | void vtkSphereWidget::OnLeftButtonDown() |
| 364 | { |
| 365 | if (!this->Interactor) |
| 366 | { |
| 367 | return; |
| 368 | } |
| 369 | |
| 370 | int X = this->Interactor->GetEventPosition()[0]; |
| 371 | int Y = this->Interactor->GetEventPosition()[1]; |
| 372 | |
| 373 | // Okay, make sure that the pick is in the current renderer |
| 374 | if (!this->CurrentRenderer || !this->CurrentRenderer->IsInViewport(X, Y)) |
| 375 | { |
| 376 | this->State = vtkSphereWidget::Outside; |
| 377 | return; |
| 378 | } |
| 379 | |
| 380 | // Okay, we can process this. Try to pick handles first; |
| 381 | // if no handles picked, then try to pick the sphere. |
| 382 | vtkAssemblyPath* path = this->GetAssemblyPath(X, Y, 0., this->Picker); |
| 383 | |
| 384 | if (path == nullptr) |
| 385 | { |
| 386 | this->State = vtkSphereWidget::Outside; |
| 387 | return; |
| 388 | } |
| 389 | else if (path->GetFirstNode()->GetViewProp() == this->SphereActor) |
| 390 | { |
| 391 | this->State = vtkSphereWidget::Moving; |
| 392 | this->HighlightSphere(1); |
| 393 | } |
| 394 | else if (path->GetFirstNode()->GetViewProp() == this->HandleActor) |
| 395 | { |
| 396 | this->State = vtkSphereWidget::Positioning; |
| 397 | this->HighlightHandle(1); |
| 398 | } |
| 399 | |
| 400 | this->EventCallbackCommand->SetAbortFlag(1); |
| 401 | this->StartInteraction(); |
| 402 | this->InvokeEvent(vtkCommand::StartInteractionEvent, nullptr); |
| 403 | this->Interactor->Render(); |
| 404 | } |
| 405 | |
| 406 | //------------------------------------------------------------------------------ |
| 407 | void vtkSphereWidget::OnMouseMove() |
no test coverage detected