| 446 | |
| 447 | template <typename FeatureType> |
| 448 | void |
| 449 | ICCVTutorial<FeatureType>::keyboard_callback( |
| 450 | const pcl::visualization::KeyboardEvent& event, void*) |
| 451 | { |
| 452 | if (event.keyUp()) { |
| 453 | switch (event.getKeyCode()) { |
| 454 | case '1': |
| 455 | if (!visualizer_.removePointCloud("source_points")) { |
| 456 | visualizer_.addPointCloud(source_, "source_points"); |
| 457 | } |
| 458 | break; |
| 459 | |
| 460 | case '2': |
| 461 | if (!visualizer_.removePointCloud("target_points")) { |
| 462 | visualizer_.addPointCloud(target_, "target_points"); |
| 463 | } |
| 464 | break; |
| 465 | |
| 466 | case '3': |
| 467 | if (!visualizer_.removePointCloud("source_segmented")) { |
| 468 | visualizer_.addPointCloud(source_segmented_, "source_segmented"); |
| 469 | } |
| 470 | break; |
| 471 | |
| 472 | case '4': |
| 473 | if (!visualizer_.removePointCloud("target_segmented")) { |
| 474 | visualizer_.addPointCloud(target_segmented_, "target_segmented"); |
| 475 | } |
| 476 | break; |
| 477 | |
| 478 | case '5': |
| 479 | if (!visualizer_.removePointCloud("source_keypoints")) { |
| 480 | pcl::visualization::PointCloudColorHandlerCustom<pcl::PointXYZI> keypoint_color( |
| 481 | source_keypoints_, 0, 0, 255); |
| 482 | visualizer_.addPointCloud( |
| 483 | source_keypoints_, keypoint_color, "source_keypoints"); |
| 484 | } |
| 485 | break; |
| 486 | |
| 487 | case '6': |
| 488 | if (!visualizer_.removePointCloud("target_keypoints")) { |
| 489 | pcl::visualization::PointCloudColorHandlerCustom<pcl::PointXYZI> keypoint_color( |
| 490 | target_keypoints_, 255, 0, 0); |
| 491 | visualizer_.addPointCloud( |
| 492 | target_keypoints_, keypoint_color, "target_keypoints"); |
| 493 | } |
| 494 | break; |
| 495 | |
| 496 | case '7': |
| 497 | if (!show_source2target_) |
| 498 | visualizer_.addCorrespondences<pcl::PointXYZI>( |
| 499 | source_keypoints_, target_keypoints_, source2target_, "source2target"); |
| 500 | else |
| 501 | visualizer_.removeCorrespondences("source2target"); |
| 502 | |
| 503 | show_source2target_ = !show_source2target_; |
| 504 | break; |
| 505 |
nothing calls this directly
no test coverage detected