/////////////////////////////////////////////////////////////////////////////////////////
| 513 | |
| 514 | ////////////////////////////////////////////////////////////////////////////////////////////// |
| 515 | void |
| 516 | pcl::visualization::PCLVisualizerInteractorStyle::OnKeyDown () |
| 517 | { |
| 518 | if (!init_) |
| 519 | { |
| 520 | pcl::console::print_error ("[PCLVisualizerInteractorStyle] Interactor style not initialized. Please call Initialize () before continuing.\n"); |
| 521 | return; |
| 522 | } |
| 523 | |
| 524 | if (!rens_) |
| 525 | { |
| 526 | pcl::console::print_error ("[PCLVisualizerInteractorStyle] No renderer collection given! Use SetRendererCollection () before continuing.\n"); |
| 527 | return; |
| 528 | } |
| 529 | |
| 530 | FindPokedRenderer (Interactor->GetEventPosition ()[0], Interactor->GetEventPosition ()[1]); |
| 531 | |
| 532 | if (!wif_->GetInput ()) |
| 533 | { |
| 534 | wif_->SetInput (Interactor->GetRenderWindow ()); |
| 535 | wif_->Modified (); |
| 536 | snapshot_writer_->Modified (); |
| 537 | } |
| 538 | |
| 539 | // Save the initial windows width/height |
| 540 | if (win_height_ == -1 || win_width_ == -1) |
| 541 | { |
| 542 | int *win_size = Interactor->GetRenderWindow ()->GetSize (); |
| 543 | win_height_ = win_size[0]; |
| 544 | win_width_ = win_size[1]; |
| 545 | } |
| 546 | |
| 547 | // Get the status of special keys (Cltr+Alt+Shift) |
| 548 | bool shift = Interactor->GetShiftKey (); |
| 549 | bool ctrl = Interactor->GetControlKey (); |
| 550 | bool alt = Interactor->GetAltKey (); |
| 551 | |
| 552 | bool keymod = false; |
| 553 | switch (modifier_) |
| 554 | { |
| 555 | case INTERACTOR_KB_MOD_ALT: |
| 556 | { |
| 557 | keymod = alt; |
| 558 | break; |
| 559 | } |
| 560 | case INTERACTOR_KB_MOD_CTRL: |
| 561 | { |
| 562 | keymod = ctrl; |
| 563 | break; |
| 564 | } |
| 565 | case INTERACTOR_KB_MOD_SHIFT: |
| 566 | { |
| 567 | keymod = shift; |
| 568 | break; |
| 569 | } |
| 570 | } |
| 571 | |
| 572 | // ---[ Check the rest of the key codes |
nothing calls this directly
no test coverage detected