------------------------------------------------------------------------------
| 382 | |
| 383 | //------------------------------------------------------------------------------ |
| 384 | void 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 | //------------------------------------------------------------------------------ |
| 430 | void vtkVRInteractorStyle::EndPositionProp(vtkEventDataDevice3D* edata) |
no test coverage detected