本文整理汇总了C++中pcl::visualization::KeyboardEvent::keyUp方法的典型用法代码示例。如果您正苦于以下问题:C++ KeyboardEvent::keyUp方法的具体用法?C++ KeyboardEvent::keyUp怎么用?C++ KeyboardEvent::keyUp使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类pcl::visualization::KeyboardEvent
的用法示例。
在下文中一共展示了KeyboardEvent::keyUp方法的13个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: switch
void
keyboard_callback (const pcl::visualization::KeyboardEvent& event, void*)
{
double opacity;
if (event.keyUp())
{
switch (event.getKeyCode())
{
case '1':
viewer.getPointCloudRenderingProperties (pcl::visualization::PCL_VISUALIZER_OPACITY, opacity, "nan boundary edges");
viewer.setPointCloudRenderingProperties (pcl::visualization::PCL_VISUALIZER_OPACITY, 1.0-opacity, "nan boundary edges");
break;
case '2':
viewer.getPointCloudRenderingProperties (pcl::visualization::PCL_VISUALIZER_OPACITY, opacity, "occluding edges");
viewer.setPointCloudRenderingProperties (pcl::visualization::PCL_VISUALIZER_OPACITY, 1.0-opacity, "occluding edges");
break;
case '3':
viewer.getPointCloudRenderingProperties (pcl::visualization::PCL_VISUALIZER_OPACITY, opacity, "occluded edges");
viewer.setPointCloudRenderingProperties (pcl::visualization::PCL_VISUALIZER_OPACITY, 1.0-opacity, "occluded edges");
break;
case '4':
viewer.getPointCloudRenderingProperties (pcl::visualization::PCL_VISUALIZER_OPACITY, opacity, "high curvature edges");
viewer.setPointCloudRenderingProperties (pcl::visualization::PCL_VISUALIZER_OPACITY, 1.0-opacity, "high curvature edges");
break;
case '5':
viewer.getPointCloudRenderingProperties (pcl::visualization::PCL_VISUALIZER_OPACITY, opacity, "rgb edges");
viewer.setPointCloudRenderingProperties (pcl::visualization::PCL_VISUALIZER_OPACITY, 1.0-opacity, "rgb edges");
break;
}
}
}
示例2: keyboard_callback
void keyboard_callback (const pcl::visualization::KeyboardEvent& event, void*)
{
// do stuff and visualize here
if (event.keyUp ())
{
switch (event.getKeyCode ())
{
case 'b':
case 'B':
if (threshold_ < 0.1f)
threshold_ += 0.001f;
process ();
break;
case 'v':
case 'V':
if (threshold_ > 0.001f)
threshold_ -= 0.001f;
process ();
break;
case 'n':
case 'N':
depth_dependent_ = !depth_dependent_;
process ();
break;
case 'm':
case 'M':
polygon_refinement_ = !polygon_refinement_;
process ();
break;
}
}
}
示例3: keyboardCallback
void keyboardCallback(const pcl::visualization::KeyboardEvent &event) {
if(event.getKeySym() == "v" && event.keyUp()) {
std::cout << "Saving...";
pcl::io::savePCDFile("capture.pcd", *cloud);
std::cout << "done" << std::endl;
}
}
示例4: keyboardEventCloudViewer
void Visualizer::keyboardEventCloudViewer(const pcl::visualization::KeyboardEvent &event, void *)
{
if(event.keyUp())
{
if(event.getKeySym() == "Left")
{
nextAnnotator();
}
else if(event.getKeySym() == "Right")
{
prevAnnotator();
}
else if(event.getKeySym() == "Escape")
{
shutdown();
}
else if(event.getKeySym() == "Insert")
{
save = true;
}
else if(event.getKeyCode() > 0)
{
callbackKeyHandler(event.getKeyCode(), DrawingAnnotator::CLOUD_VIEWER);
}
}
}
示例5: keyboardEventOccurred
//---------------------------------------------------------------------------------------------------------------------
void Gui::keyboardEventOccurred(const pcl::visualization::KeyboardEvent &_event, void* _viewer_void){
boost::shared_ptr<pcl::visualization::PCLVisualizer> viewer = *static_cast<boost::shared_ptr<pcl::visualization::PCLVisualizer> *> (_viewer_void);
std::cout << _event.getKeySym() << " was pressed";
if ((_event.getKeySym() == "1") && _event.keyUp()) {
std::cout << " => guess visualization toggled" << std::endl;
mShowGuess = !mShowGuess;
}
if ((_event.getKeySym() == "2") && _event.keyUp()) {
std::cout << " => icp result visualization toggled" << std::endl;
mShowIcpResult = !mShowIcpResult;
}
if ((_event.getKeySym() == "3") && _event.keyUp()) {
std::cout << " => candidate visualization toggled" << std::endl;
mShowCandidates = !mShowCandidates;
} else {
std::cout << std::endl;
}
}
示例6: if
void
keyboardCB (const pcl::visualization::KeyboardEvent &event, void* params_void)
{
CallbackParameters* params = static_cast<CallbackParameters*> (params_void);
if (event.getKeyCode () == 13 /*enter*/ && event.keyUp ())
update (params);
else if ( event.getKeyCode () == '1' && event.keyUp () )
{
// Switch models visibility
params->show_models_ = !params->show_models_;
for ( list<vtkActor*>::iterator it = params->model_actors_.begin () ; it != params->model_actors_.end () ; ++it )
(*it)->SetVisibility (static_cast<int> (params->show_models_));
params->viz_.getRenderWindow ()->Render ();
}
}
示例7: switch
void
keyboard_callback (const pcl::visualization::KeyboardEvent& event, void*)
{
if (event.keyUp ())
{
switch (event.getKeyCode ())
{
case 27:
case 'Q':
case 'q': quit_ = true; visualizer_->close ();
break;
case ' ': continuous_ = !continuous_;
break;
}
}
}
示例8: lock
void
keyboard_callback (const pcl::visualization::KeyboardEvent& event, void*)
{
static pcl::PCDWriter writer;
static std::ostringstream frame;
if (event.keyUp ())
{
if ((event.getKeyCode () == 's') || (event.getKeyCode () == 'S'))
{
boost::mutex::scoped_lock lock (cloud_mutex_);
frame.str ("frame-");
frame << boost::posix_time::to_iso_string (boost::posix_time::microsec_clock::local_time ()) << ".pcd";
writer.writeBinaryCompressed (frame.str (), *cloud_);
PCL_INFO ("Written cloud %s.\n", frame.str ().c_str ());
}
}
}
示例9: switch
void
keyboard_callback (const pcl::visualization::KeyboardEvent& event, void *)
{
if (event.keyUp ())
{
switch (event.getKeyCode())
{
case 's':
case 'S':
saveCloud = true; // save pcd file
break;
case 't':
case 'T':
++toggleView %= 2;
break;
}
}
}
示例10: if
static void
keyboardCallback(const pcl::visualization::KeyboardEvent &e, void *cookie)
{
OpenNIShoter* recorder = reinterpret_cast<OpenNIShoter*> (cookie);
int key = e.getKeyCode ();
if (e.keyUp())
{
if ((key == 'q') || (key == 'Q'))
{
recorder->exit_ = true;
}
else if ((key == 's') || (key == 'S'))
{
recorder->get_image_ = true;
}
}
}
示例11: switch
/** \brief Callback for setting options in the visualizer via keyboard.
* \param[in] event Registered keyboard event */
void
keyboard_callback (const pcl::visualization::KeyboardEvent& event, void*)
{
int key = event.getKeyCode ();
if (event.keyUp ())
switch (key)
{
case (int)'1': show_voxel_centroids = !show_voxel_centroids; break;
case (int)'2': show_supervoxels = !show_supervoxels; break;
case (int)'3': show_graph = !show_graph; break;
case (int)'4': show_normals = !show_normals; break;
case (int)'5': show_supervoxel_normals = !show_supervoxel_normals; break;
case (int)'0': show_refined = !show_refined; break;
case (int)'h': case (int)'H': show_help = !show_help; break;
default: break;
}
}
示例12: switch
void ICCVTutorial<FeatureType>::keyboard_callback (const pcl::visualization::KeyboardEvent& event, void*)
{
if (event.keyUp())
{
switch (event.getKeyCode())
{
case '1':
if (!visualizer_.removePointCloud("source_points"))
{
visualizer_.addPointCloud(source_, "source_points");
}
break;
case '2':
if (!visualizer_.removePointCloud("target_points"))
{
visualizer_.addPointCloud(target_, "target_points");
}
break;
case '3':
if (!visualizer_.removePointCloud("source_segmented"))
{
visualizer_.addPointCloud(source_segmented_, "source_segmented");
}
break;
case '4':
if (!visualizer_.removePointCloud("target_segmented"))
{
visualizer_.addPointCloud(target_segmented_, "target_segmented");
}
break;
case '5':
if (!visualizer_.removePointCloud("source_keypoints"))
{
pcl::visualization::PointCloudColorHandlerCustom<pcl::PointXYZI> keypoint_color (source_keypoints_, 0, 0, 255);
//pcl::visualization::PointCloudColorHandlerGenericField<pcl::PointXYZI> keypoint_color (source_keypoints_, "intensity");
visualizer_.addPointCloud(source_keypoints_, keypoint_color, "source_keypoints");
}
break;
case '6':
if (!visualizer_.removePointCloud("target_keypoints"))
{
//pcl::visualization::PointCloudColorHandlerGenericField<pcl::PointXYZI> keypoint_color (target_keypoints_, "intensity");
pcl::visualization::PointCloudColorHandlerCustom<pcl::PointXYZI> keypoint_color (target_keypoints_, 255, 0, 0);
visualizer_.addPointCloud(target_keypoints_, keypoint_color, "target_keypoints");
}
break;
case '7':
if (!show_source2target_)
visualizer_.addCorrespondences<pcl::PointXYZI>(source_keypoints_, target_keypoints_, source2target_, "source2target");
else
visualizer_.removeCorrespondences("source2target");
show_source2target_ = !show_source2target_;
break;
case '8':
if (!show_target2source_)
visualizer_.addCorrespondences<pcl::PointXYZI>(target_keypoints_, source_keypoints_, target2source_, "target2source");
else
visualizer_.removeCorrespondences("target2source");
show_target2source_ = !show_target2source_;
break;
case '9':
if (!show_correspondences)
visualizer_.addCorrespondences<pcl::PointXYZI>(source_keypoints_, target_keypoints_, *correspondences_, "correspondences");
else
visualizer_.removeCorrespondences("correspondences");
show_correspondences = !show_correspondences;
break;
case 'i':
case 'I':
if (!visualizer_.removePointCloud("transformed"))
visualizer_.addPointCloud(source_transformed_, "transformed");
break;
case 'r':
case 'R':
if (!visualizer_.removePointCloud("registered"))
visualizer_.addPointCloud(source_registered_, "registered");
break;
case 't':
case 'T':
visualizer_.addPolygonMesh(surface_, "surface");
break;
}
}
}
示例13: update
void
keyboardCB (const pcl::visualization::KeyboardEvent &event, void* params_void)
{
if (event.getKeyCode () == 13 /*enter*/ && event.keyUp ())
update (static_cast<CallbackParameters*> (params_void));
}