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

Method StartClip

Rendering/VR/vtkVRInteractorStyle.cxx:464–510  ·  view source on GitHub ↗

------------------------------------------------------------------------------

Source from the content-addressed store, hash-verified

462
463//------------------------------------------------------------------------------
464void 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//------------------------------------------------------------------------------
513void vtkVRInteractorStyle::EndClip(vtkEventDataDevice3D* ed)

Callers 1

StartActionMethod · 0.95

Calls 5

ForEachNonWidgetPropFunction · 0.85
GetMapperMethod · 0.80
AddClippingPlaneMethod · 0.80
NewFunction · 0.50
GetDeviceMethod · 0.45

Tested by

no test coverage detected