------------------------------------------------------------------------------
| 462 | |
| 463 | //------------------------------------------------------------------------------ |
| 464 | void vtkVRInteractorStyle::StartClip(vtkEventDataDevice3D* ed) |
| 465 | { |
| 466 | if (this->CurrentRenderer == nullptr) |
| 467 | { |
| 468 | return; |
| 469 | } |
| 470 | |
| 471 | vtkEventDataDevice dev = ed->GetDevice(); |
| 472 | this->InteractionState[static_cast<int>(dev)] = VTKIS_CLIP; |
| 473 | |
| 474 | if (!this->ClippingPlanes[static_cast<int>(dev)]) |
| 475 | { |
| 476 | this->ClippingPlanes[static_cast<int>(dev)] = vtkSmartPointer<vtkPlane>::New(); |
| 477 | } |
| 478 | |
| 479 | if (this->CurrentRenderer != nullptr) |
| 480 | { |
| 481 | ForEachNonWidgetProp(this->CurrentRenderer, |
| 482 | [this, dev](vtkProp* prop) |
| 483 | { |
| 484 | auto* actor = vtkActor::SafeDownCast(prop); |
| 485 | if (actor) |
| 486 | { |
| 487 | auto* mapper = actor->GetMapper(); |
| 488 | if (mapper) |
| 489 | { |
| 490 | mapper->AddClippingPlane(this->ClippingPlanes[static_cast<int>(dev)]); |
| 491 | } |
| 492 | return; |
| 493 | } |
| 494 | auto* volume = vtkVolume::SafeDownCast(prop); |
| 495 | if (volume) |
| 496 | { |
| 497 | auto* mapper = volume->GetMapper(); |
| 498 | if (mapper) |
| 499 | { |
| 500 | mapper->AddClippingPlane(this->ClippingPlanes[static_cast<int>(dev)]); |
| 501 | } |
| 502 | return; |
| 503 | } |
| 504 | }); |
| 505 | } |
| 506 | else |
| 507 | { |
| 508 | vtkWarningMacro(<< "no current renderer on the interactor style."); |
| 509 | } |
| 510 | } |
| 511 | |
| 512 | //------------------------------------------------------------------------------ |
| 513 | void vtkVRInteractorStyle::EndClip(vtkEventDataDevice3D* ed) |
no test coverage detected