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

Method StartPositionProp

Rendering/VR/vtkVRInteractorStyle.cxx:384–427  ·  view source on GitHub ↗

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

Source from the content-addressed store, hash-verified

382
383//------------------------------------------------------------------------------
384void vtkVRInteractorStyle::StartPositionProp(vtkEventDataDevice3D* edata)
385{
386 if (this->GrabWithRay)
387 {
388 if (!this->HardwareSelect(edata->GetDevice(), true))
389 {
390 return;
391 }
392
393 vtkSelection* selection = this->HardwarePicker->GetSelection();
394
395 if (!selection || selection->GetNumberOfNodes() == 0)
396 {
397 return;
398 }
399
400 vtkSelectionNode* node = selection->GetNode(0);
401 this->InteractionProp =
402 vtkProp3D::SafeDownCast(node->GetProperties()->Get(vtkSelectionNode::PROP()));
403 }
404 else
405 {
406 double pos[3];
407 edata->GetWorldPosition(pos);
408 this->FindPickedActor(pos, nullptr);
409 }
410
411 if (this->InteractionProp == nullptr)
412 {
413 return;
414 }
415
416 this->InteractionState[static_cast<int>(edata->GetDevice())] = VTKIS_POSITION_PROP;
417 this->InteractionProps[static_cast<int>(edata->GetDevice())] = this->InteractionProp;
418
419 // Don't start action if a controller is already positioning the prop
420 int rc = static_cast<int>(vtkEventDataDevice::RightController);
421 int lc = static_cast<int>(vtkEventDataDevice::LeftController);
422 if (this->InteractionProps[rc] == this->InteractionProps[lc])
423 {
424 this->EndPositionProp(edata);
425 return;
426 }
427}
428
429//------------------------------------------------------------------------------
430void vtkVRInteractorStyle::EndPositionProp(vtkEventDataDevice3D* edata)

Callers 1

StartActionMethod · 0.95

Calls 9

HardwareSelectMethod · 0.95
EndPositionPropMethod · 0.95
GetDeviceMethod · 0.45
GetSelectionMethod · 0.45
GetNumberOfNodesMethod · 0.45
GetNodeMethod · 0.45
GetMethod · 0.45
GetWorldPositionMethod · 0.45
FindPickedActorMethod · 0.45

Tested by

no test coverage detected