MCPcopy Create free account
hub / github.com/PointCloudLibrary/pcl / OnKeyDown

Method OnKeyDown

visualization/src/interactor_style.cpp:515–1154  ·  view source on GitHub ↗

/////////////////////////////////////////////////////////////////////////////////////////

Source from the content-addressed store, hash-verified

513
514//////////////////////////////////////////////////////////////////////////////////////////////
515void
516pcl::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

Callers

nothing calls this directly

Calls 14

NewFunction · 0.85
print_valueFunction · 0.85
rad2degFunction · 0.85
emptyMethod · 0.45
sizeMethod · 0.45
getGeometryMethod · 0.45
SetPointsMethod · 0.45
getColorMethod · 0.45
findMethod · 0.45
push_backMethod · 0.45
getFieldNameMethod · 0.45
beginMethod · 0.45

Tested by

no test coverage detected