diff --git a/apps/3d_rec_framework/include/pcl/apps/3d_rec_framework/pc_source/mesh_source.h b/apps/3d_rec_framework/include/pcl/apps/3d_rec_framework/pc_source/mesh_source.h index 51b2dca1d9b..5f0fa6120e2 100644 --- a/apps/3d_rec_framework/include/pcl/apps/3d_rec_framework/pc_source/mesh_source.h +++ b/apps/3d_rec_framework/include/pcl/apps/3d_rec_framework/pc_source/mesh_source.h @@ -12,9 +12,11 @@ #include #include #include -#include + #include +#include + namespace pcl { namespace rec_3d_framework @@ -42,7 +44,7 @@ namespace pcl float radius_sphere_; float view_angle_; bool gen_organized_; - boost::function campos_constraints_func_; public: @@ -62,7 +64,7 @@ namespace pcl } void - setCamPosConstraints (boost::function & bb) { campos_constraints_func_ = bb; diff --git a/apps/3d_rec_framework/src/tools/global_classification.cpp b/apps/3d_rec_framework/src/tools/global_classification.cpp index 708a3b37530..84abcf4aeae 100644 --- a/apps/3d_rec_framework/src/tools/global_classification.cpp +++ b/apps/3d_rec_framework/src/tools/global_classification.cpp @@ -28,7 +28,7 @@ segmentAndClassify (typename pcl::rec_3d_framework::GlobalNNPipeline keyboard_cb = boost::bind (&OpenNIFrameSource::OpenNIFrameSource::onKeyboardEvent, &camera, _1); vis.registerKeyboardCallback (keyboard_cb); size_t previous_cluster_size = 0; diff --git a/apps/3d_rec_framework/src/tools/openni_frame_source.cpp b/apps/3d_rec_framework/src/tools/openni_frame_source.cpp index 456739d1048..ac3f35a4d6a 100644 --- a/apps/3d_rec_framework/src/tools/openni_frame_source.cpp +++ b/apps/3d_rec_framework/src/tools/openni_frame_source.cpp @@ -8,7 +8,7 @@ namespace OpenNIFrameSource OpenNIFrameSource::OpenNIFrameSource (const std::string& device_id) : grabber_ (device_id), frame_counter_ (0), active_ (true) { - boost::function frame_cb = boost::bind (&OpenNIFrameSource::onNewFrame, this, _1); grabber_.registerCallback (frame_cb); grabber_.start (); diff --git a/apps/in_hand_scanner/src/in_hand_scanner.cpp b/apps/in_hand_scanner/src/in_hand_scanner.cpp index c0519179682..0a8b3f96f8b 100644 --- a/apps/in_hand_scanner/src/in_hand_scanner.cpp +++ b/apps/in_hand_scanner/src/in_hand_scanner.cpp @@ -481,7 +481,7 @@ pcl::ihs::InHandScanner::startGrabberImpl () lock.lock (); if (destructor_called_) return; - boost::function new_data_cb = boost::bind (&pcl::ihs::InHandScanner::newDataCallback, this, _1); + std::function new_data_cb = boost::bind (&pcl::ihs::InHandScanner::newDataCallback, this, _1); new_data_connection_ = grabber_->registerCallback (new_data_cb); grabber_->start (); diff --git a/apps/include/pcl/apps/render_views_tesselated_sphere.h b/apps/include/pcl/apps/render_views_tesselated_sphere.h index 50f15e53e50..4d0376af935 100644 --- a/apps/include/pcl/apps/render_views_tesselated_sphere.h +++ b/apps/include/pcl/apps/render_views_tesselated_sphere.h @@ -7,10 +7,12 @@ #pragma once +#include + #include #include -#include -#include + +#include namespace pcl { @@ -37,7 +39,7 @@ namespace pcl bool compute_entropy_; vtkSmartPointer polydata_; bool gen_organized_; - boost::function campos_constraints_func_; struct camPosConstraintsAllTrue @@ -64,7 +66,7 @@ namespace pcl } void - setCamPosConstraints (boost::function & bb) + setCamPosConstraints (std::function & bb) { campos_constraints_func_ = bb; } diff --git a/apps/point_cloud_editor/include/pcl/apps/point_cloud_editor/cloudEditorWidget.h b/apps/point_cloud_editor/include/pcl/apps/point_cloud_editor/cloudEditorWidget.h index 62e643b859a..7db35ac2c09 100644 --- a/apps/point_cloud_editor/include/pcl/apps/point_cloud_editor/cloudEditorWidget.h +++ b/apps/point_cloud_editor/include/pcl/apps/point_cloud_editor/cloudEditorWidget.h @@ -40,8 +40,6 @@ #pragma once -#include -#include #include #include #include @@ -49,6 +47,10 @@ #include #include +#include + +#include + /// @brief class declaration for the widget for editing and viewing /// point clouds. class CloudEditorWidget : public QGLWidget @@ -251,7 +253,7 @@ class CloudEditorWidget : public QGLWidget return lhs.compare(rhs) < 0; } }; - typedef boost::function + typedef std::function FileLoadFunc; typedef std::map FileLoadMap; /// a map of file type extensions to loader functions. @@ -301,7 +303,7 @@ class CloudEditorWidget : public QGLWidget /// A flag indicates whether the cloud is initially colored or not. bool is_colored_; - typedef boost::function KeyMapFunc; + typedef std::function KeyMapFunc; /// map between pressed key and the corresponding functor std::map key_map_; diff --git a/apps/src/dinast_grabber_example.cpp b/apps/src/dinast_grabber_example.cpp index 7ada4ef9619..af720f52b64 100644 --- a/apps/src/dinast_grabber_example.cpp +++ b/apps/src/dinast_grabber_example.cpp @@ -74,7 +74,7 @@ class DinastProcessor run () { - boost::function f = + std::function f = boost::bind (&DinastProcessor::cloud_cb_, this, _1); boost::signals2::connection c = interface.registerCallback (f); diff --git a/apps/src/face_detection/openni_face_detection.cpp b/apps/src/face_detection/openni_face_detection.cpp index aea92209cca..379dfee15b2 100644 --- a/apps/src/face_detection/openni_face_detection.cpp +++ b/apps/src/face_detection/openni_face_detection.cpp @@ -21,7 +21,7 @@ void run(pcl::RFFaceDetectorTrainer & fdrf, bool heat_map = false, bool show_vot vis.addCoordinateSystem (0.1, "global"); //keyboard callback to stop getting frames and finalize application - boost::function keyboard_cb = boost::bind (&OpenNIFrameSource::OpenNIFrameSource::onKeyboardEvent, &camera, + std::function keyboard_cb = boost::bind (&OpenNIFrameSource::OpenNIFrameSource::onKeyboardEvent, &camera, _1); vis.registerKeyboardCallback (keyboard_cb); diff --git a/apps/src/face_detection/openni_frame_source.cpp b/apps/src/face_detection/openni_frame_source.cpp index ad64e654f4f..5e3c8a69f01 100644 --- a/apps/src/face_detection/openni_frame_source.cpp +++ b/apps/src/face_detection/openni_frame_source.cpp @@ -8,7 +8,7 @@ namespace OpenNIFrameSource OpenNIFrameSource::OpenNIFrameSource(const std::string& device_id) : grabber_ (device_id), frame_counter_ (0), active_ (true) { - boost::function frame_cb = boost::bind (&OpenNIFrameSource::onNewFrame, this, _1); + std::function frame_cb = boost::bind (&OpenNIFrameSource::onNewFrame, this, _1); grabber_.registerCallback (frame_cb); grabber_.start (); } diff --git a/apps/src/ni_agast.cpp b/apps/src/ni_agast.cpp index 5e194068775..fc6dc386c5e 100644 --- a/apps/src/ni_agast.cpp +++ b/apps/src/ni_agast.cpp @@ -193,7 +193,7 @@ class AGASTDemo void init () { - boost::function cloud_cb = boost::bind (&AGASTDemo::cloud_callback, this, _1); + std::function cloud_cb = boost::bind (&AGASTDemo::cloud_callback, this, _1); cloud_connection = grabber_.registerCallback (cloud_cb); } diff --git a/apps/src/ni_brisk.cpp b/apps/src/ni_brisk.cpp index 79a524a92af..a61b79bb3e2 100644 --- a/apps/src/ni_brisk.cpp +++ b/apps/src/ni_brisk.cpp @@ -99,7 +99,7 @@ class BRISKDemo void init () { - boost::function cloud_cb = boost::bind (&BRISKDemo::cloud_callback, this, _1); + std::function cloud_cb = boost::bind (&BRISKDemo::cloud_callback, this, _1); cloud_connection = grabber_.registerCallback (cloud_cb); } diff --git a/apps/src/ni_linemod.cpp b/apps/src/ni_linemod.cpp index fce68935e6e..54368d3d173 100644 --- a/apps/src/ni_linemod.cpp +++ b/apps/src/ni_linemod.cpp @@ -473,7 +473,7 @@ class NILinemod cloud_viewer_.registerMouseCallback (&NILinemod::mouse_callback, *this); cloud_viewer_.registerKeyboardCallback(&NILinemod::keyboard_callback, *this); cloud_viewer_.registerPointPickingCallback (&NILinemod::pp_callback, *this); - boost::function cloud_cb = boost::bind (&NILinemod::cloud_callback, this, _1); + std::function cloud_cb = boost::bind (&NILinemod::cloud_callback, this, _1); cloud_connection = grabber_.registerCallback (cloud_cb); image_viewer_.registerMouseCallback (&NILinemod::mouse_callback, *this); diff --git a/apps/src/ni_susan.cpp b/apps/src/ni_susan.cpp index 7a38c3a640d..4af0d077306 100644 --- a/apps/src/ni_susan.cpp +++ b/apps/src/ni_susan.cpp @@ -97,7 +97,7 @@ class SUSANDemo void init () { - boost::function cloud_cb = boost::bind (&SUSANDemo::cloud_callback, this, _1); + std::function cloud_cb = boost::bind (&SUSANDemo::cloud_callback, this, _1); cloud_connection = grabber_.registerCallback (cloud_cb); } diff --git a/apps/src/ni_trajkovic.cpp b/apps/src/ni_trajkovic.cpp index 0d517275f3d..6322f729339 100644 --- a/apps/src/ni_trajkovic.cpp +++ b/apps/src/ni_trajkovic.cpp @@ -111,7 +111,7 @@ class TrajkovicDemo void init () { - boost::function cloud_cb; + std::function cloud_cb; if (enable_3d_) cloud_cb = boost::bind (&TrajkovicDemo::cloud_callback_3d, this, _1); else diff --git a/apps/src/openni_3d_concave_hull.cpp b/apps/src/openni_3d_concave_hull.cpp index 07ffdfb8465..c46a21737b3 100644 --- a/apps/src/openni_3d_concave_hull.cpp +++ b/apps/src/openni_3d_concave_hull.cpp @@ -140,7 +140,7 @@ class OpenNI3DConcaveHull { pcl::Grabber* interface = new pcl::OpenNIGrabber (device_id_); - boost::function f = boost::bind (&OpenNI3DConcaveHull::cloud_cb, this, _1); + std::function f = boost::bind (&OpenNI3DConcaveHull::cloud_cb, this, _1); boost::signals2::connection c = interface->registerCallback (f); viewer.runOnVisualizationThread (boost::bind(&OpenNI3DConcaveHull::viz_cb, this, _1), "viz_cb"); diff --git a/apps/src/openni_3d_convex_hull.cpp b/apps/src/openni_3d_convex_hull.cpp index afd0a0ddff7..ab0b8d747ec 100644 --- a/apps/src/openni_3d_convex_hull.cpp +++ b/apps/src/openni_3d_convex_hull.cpp @@ -138,7 +138,7 @@ class OpenNI3DConvexHull { pcl::Grabber* interface = new pcl::OpenNIGrabber (device_id_); - boost::function f = boost::bind (&OpenNI3DConvexHull::cloud_cb, this, _1); + std::function f = boost::bind (&OpenNI3DConvexHull::cloud_cb, this, _1); boost::signals2::connection c = interface->registerCallback (f); viewer.runOnVisualizationThread (boost::bind(&OpenNI3DConvexHull::viz_cb, this, _1), "viz_cb"); diff --git a/apps/src/openni_boundary_estimation.cpp b/apps/src/openni_boundary_estimation.cpp index 65966f6b5ee..3dce5009fa0 100644 --- a/apps/src/openni_boundary_estimation.cpp +++ b/apps/src/openni_boundary_estimation.cpp @@ -159,7 +159,7 @@ class OpenNIIntegralImageNormalEstimation { pcl::Grabber* interface = new pcl::OpenNIGrabber (device_id_); - boost::function::ConstPtr &)> f = boost::bind (&OpenNIIntegralImageNormalEstimation::cloud_cb, this, _1); + std::function::ConstPtr &)> f = boost::bind (&OpenNIIntegralImageNormalEstimation::cloud_cb, this, _1); boost::signals2::connection c = interface->registerCallback (f); viewer.runOnVisualizationThread (boost::bind(&OpenNIIntegralImageNormalEstimation::viz_cb, this, _1), "viz_cb"); diff --git a/apps/src/openni_change_viewer.cpp b/apps/src/openni_change_viewer.cpp index 68c6b9c3ed5..2431425b709 100644 --- a/apps/src/openni_change_viewer.cpp +++ b/apps/src/openni_change_viewer.cpp @@ -123,7 +123,7 @@ class OpenNIChangeViewer { pcl::Grabber* interface = new pcl::OpenNIGrabber(); - boost::function::ConstPtr&)> f = + std::function::ConstPtr&)> f = boost::bind (&OpenNIChangeViewer::cloud_cb_, this, _1); boost::signals2::connection c = interface->registerCallback (f); diff --git a/apps/src/openni_color_filter.cpp b/apps/src/openni_color_filter.cpp index 4ecba3fe32d..2edcc77a2ac 100644 --- a/apps/src/openni_color_filter.cpp +++ b/apps/src/openni_color_filter.cpp @@ -73,7 +73,7 @@ class OpenNIPassthrough : viewer ("PCL OpenNI ColorFilter Viewer") , grabber_(grabber) { - boost::function f = boost::bind (&OpenNIPassthrough::cloud_cb_, this, _1); + std::function f = boost::bind (&OpenNIPassthrough::cloud_cb_, this, _1); boost::signals2::connection c = grabber_.registerCallback (f); std::vector lookup(1<<24, false); diff --git a/apps/src/openni_fast_mesh.cpp b/apps/src/openni_fast_mesh.cpp index 59b73ba92dc..6a17d06871e 100644 --- a/apps/src/openni_fast_mesh.cpp +++ b/apps/src/openni_fast_mesh.cpp @@ -106,7 +106,7 @@ class OpenNIFastMesh { pcl::Grabber* interface = new pcl::OpenNIGrabber (device_id_); - boost::function f = boost::bind (&OpenNIFastMesh::cloud_cb, this, _1); + std::function f = boost::bind (&OpenNIFastMesh::cloud_cb, this, _1); boost::signals2::connection c = interface->registerCallback (f); view.reset (new pcl::visualization::PCLVisualizer (argc, argv, "PCL OpenNI Mesh Viewer")); diff --git a/apps/src/openni_feature_persistence.cpp b/apps/src/openni_feature_persistence.cpp index e066081134c..41267584b67 100644 --- a/apps/src/openni_feature_persistence.cpp +++ b/apps/src/openni_feature_persistence.cpp @@ -190,7 +190,7 @@ class OpenNIFeaturePersistence { pcl::Grabber* interface = new pcl::OpenNIGrabber (device_id_); - boost::function f = boost::bind (&OpenNIFeaturePersistence::cloud_cb, this, _1); + std::function f = boost::bind (&OpenNIFeaturePersistence::cloud_cb, this, _1); boost::signals2::connection c = interface->registerCallback (f); viewer.runOnVisualizationThread (boost::bind(&OpenNIFeaturePersistence::viz_cb, this, _1), "viz_cb"); diff --git a/apps/src/openni_grab_frame.cpp b/apps/src/openni_grab_frame.cpp index f69cf4b99a2..3320eeddb3e 100644 --- a/apps/src/openni_grab_frame.cpp +++ b/apps/src/openni_grab_frame.cpp @@ -186,7 +186,7 @@ class OpenNIGrabFrame // make callback function from member function - boost::function f = boost::bind (&OpenNIGrabFrame::cloud_cb_, this, _1); + std::function f = boost::bind (&OpenNIGrabFrame::cloud_cb_, this, _1); // connect callback function for desired signal. In this case its a point cloud with color values boost::signals2::connection c = grabber_.registerCallback (f); diff --git a/apps/src/openni_grab_images.cpp b/apps/src/openni_grab_images.cpp index 545df268ebb..06842b71970 100644 --- a/apps/src/openni_grab_images.cpp +++ b/apps/src/openni_grab_images.cpp @@ -187,7 +187,7 @@ class OpenNIGrabFrame depth_image_viewer_.registerMouseCallback (&OpenNIGrabFrame::mouse_callback, *this); depth_image_viewer_.registerKeyboardCallback(&OpenNIGrabFrame::keyboard_callback, *this); - boost::function image_cb = boost::bind (&OpenNIGrabFrame::image_callback, this, _1, _2, _3); + std::function image_cb = boost::bind (&OpenNIGrabFrame::image_callback, this, _1, _2, _3); boost::signals2::connection image_connection = grabber_.registerCallback (image_cb); // start receiving point clouds diff --git a/apps/src/openni_ii_normal_estimation.cpp b/apps/src/openni_ii_normal_estimation.cpp index e364e427095..64de3f6fca5 100644 --- a/apps/src/openni_ii_normal_estimation.cpp +++ b/apps/src/openni_ii_normal_estimation.cpp @@ -163,7 +163,7 @@ class OpenNIIntegralImageNormalEstimation { pcl::Grabber* interface = new pcl::OpenNIGrabber (device_id_); - boost::function f = boost::bind (&OpenNIIntegralImageNormalEstimation::cloud_cb, this, _1); + std::function f = boost::bind (&OpenNIIntegralImageNormalEstimation::cloud_cb, this, _1); boost::signals2::connection c = interface->registerCallback (f); viewer.runOnVisualizationThread (boost::bind(&OpenNIIntegralImageNormalEstimation::viz_cb, this, _1), "viz_cb"); diff --git a/apps/src/openni_klt.cpp b/apps/src/openni_klt.cpp index 431587d54ad..b06723d2f1d 100644 --- a/apps/src/openni_klt.cpp +++ b/apps/src/openni_klt.cpp @@ -206,14 +206,14 @@ class OpenNIViewer void run () { - boost::function cloud_cb = boost::bind (&OpenNIViewer::cloud_callback, this, _1); + std::function cloud_cb = boost::bind (&OpenNIViewer::cloud_callback, this, _1); boost::signals2::connection cloud_connection = grabber_.registerCallback (cloud_cb); boost::signals2::connection image_connection; if (grabber_.providesCallback()) { image_viewer_.reset (new pcl::visualization::ImageViewer ("Pyramidal KLT Tracker")); - boost::function image_cb = boost::bind (&OpenNIViewer::image_callback, this, _1); + std::function image_cb = boost::bind (&OpenNIViewer::image_callback, this, _1); image_connection = grabber_.registerCallback (image_cb); } diff --git a/apps/src/openni_mls_smoothing.cpp b/apps/src/openni_mls_smoothing.cpp index 71dab9a7a3a..08513b9eecf 100644 --- a/apps/src/openni_mls_smoothing.cpp +++ b/apps/src/openni_mls_smoothing.cpp @@ -134,7 +134,7 @@ class OpenNISmoothing { pcl::Grabber* interface = new pcl::OpenNIGrabber (device_id_); - boost::function f = boost::bind (&OpenNISmoothing::cloud_cb_, this, _1); + std::function f = boost::bind (&OpenNISmoothing::cloud_cb_, this, _1); boost::signals2::connection c = interface->registerCallback (f); viewer.registerKeyboardCallback (keyboardEventOccurred, reinterpret_cast (&stop_computing_)); diff --git a/apps/src/openni_mobile_server.cpp b/apps/src/openni_mobile_server.cpp index 5ed13805b5d..281afd4238e 100644 --- a/apps/src/openni_mobile_server.cpp +++ b/apps/src/openni_mobile_server.cpp @@ -156,7 +156,7 @@ class PCLMobileServer run () { pcl::OpenNIGrabber grabber (device_id_); - boost::function handler_function = boost::bind (&PCLMobileServer::handleIncomingCloud, this, _1); + std::function handler_function = boost::bind (&PCLMobileServer::handleIncomingCloud, this, _1); grabber.registerCallback (handler_function); grabber.start (); diff --git a/apps/src/openni_octree_compression.cpp b/apps/src/openni_octree_compression.cpp index 1596135fa48..9c091193090 100644 --- a/apps/src/openni_octree_compression.cpp +++ b/apps/src/openni_octree_compression.cpp @@ -155,7 +155,7 @@ class SimpleOpenNIViewer pcl::Grabber* interface = new pcl::OpenNIGrabber(); // make callback function from member function - boost::function::ConstPtr&)> f = + std::function::ConstPtr&)> f = boost::bind (&SimpleOpenNIViewer::cloud_cb_, this, _1); // connect callback function for desired signal. In this case its a point cloud with color values @@ -210,7 +210,7 @@ struct EventHelper pcl::Grabber* interface = new pcl::OpenNIGrabber (); // make callback function from member function - boost::function::ConstPtr&)> f = boost::bind (&EventHelper::cloud_cb_, this, _1); // connect callback function for desired signal. In this case its a point cloud with color values diff --git a/apps/src/openni_organized_compression.cpp b/apps/src/openni_organized_compression.cpp index 0f6284693d7..f5f705ed16c 100644 --- a/apps/src/openni_organized_compression.cpp +++ b/apps/src/openni_organized_compression.cpp @@ -155,7 +155,7 @@ class SimpleOpenNIViewer pcl::Grabber* interface = new pcl::OpenNIGrabber(); // make callback function from member function - boost::function::ConstPtr&)> f = + std::function::ConstPtr&)> f = boost::bind (&SimpleOpenNIViewer::cloud_cb_, this, _1); // connect callback function for desired signal. In this case its a point cloud with color values @@ -246,7 +246,7 @@ struct EventHelper pcl::Grabber* interface = new pcl::OpenNIGrabber (); // make callback function from member function - boost::function::ConstPtr&)> f = boost::bind (&EventHelper::cloud_cb_, this, _1); // connect callback function for desired signal. In this case its a point cloud with color values @@ -271,7 +271,7 @@ struct EventHelper // Set the depth output format grabber.getDevice ()->setDepthOutputFormat (static_cast (depthformat)); - boost::function image_cb + std::function image_cb = boost::bind (&EventHelper::image_callback, this, _1, _2, _3); boost::signals2::connection image_connection = grabber.registerCallback (image_cb); diff --git a/apps/src/openni_organized_edge_detection.cpp b/apps/src/openni_organized_edge_detection.cpp index be96f2cadf5..ba1b65a947a 100644 --- a/apps/src/openni_organized_edge_detection.cpp +++ b/apps/src/openni_organized_edge_detection.cpp @@ -145,7 +145,7 @@ class OpenNIOrganizedEdgeDetection { pcl::Grabber* interface = new pcl::OpenNIGrabber (); - boost::function::ConstPtr&)> f = boost::bind (&OpenNIOrganizedEdgeDetection::cloud_cb_, this, _1); + std::function::ConstPtr&)> f = boost::bind (&OpenNIOrganizedEdgeDetection::cloud_cb_, this, _1); // Make and initialize a cloud viewer pcl::PointCloud::Ptr init_cloud_ptr (new pcl::PointCloud); diff --git a/apps/src/openni_organized_multi_plane_segmentation.cpp b/apps/src/openni_organized_multi_plane_segmentation.cpp index c5e93a64e07..ea9a17b3c7f 100644 --- a/apps/src/openni_organized_multi_plane_segmentation.cpp +++ b/apps/src/openni_organized_multi_plane_segmentation.cpp @@ -111,7 +111,7 @@ class OpenNIOrganizedMultiPlaneSegmentation { pcl::Grabber* interface = new pcl::OpenNIGrabber (); - boost::function::ConstPtr&)> f = boost::bind (&OpenNIOrganizedMultiPlaneSegmentation::cloud_cb_, this, _1); + std::function::ConstPtr&)> f = boost::bind (&OpenNIOrganizedMultiPlaneSegmentation::cloud_cb_, this, _1); //make a viewer pcl::PointCloud::Ptr init_cloud_ptr (new pcl::PointCloud); diff --git a/apps/src/openni_passthrough.cpp b/apps/src/openni_passthrough.cpp index e3a31aff7cf..145866262d1 100644 --- a/apps/src/openni_passthrough.cpp +++ b/apps/src/openni_passthrough.cpp @@ -71,7 +71,7 @@ OpenNIPassthrough::OpenNIPassthrough (pcl::OpenNIGrabber& grabber) ui_->qvtk_widget->update (); // Start the OpenNI data acquision - boost::function f = boost::bind (&OpenNIPassthrough::cloud_cb, this, _1); + std::function f = boost::bind (&OpenNIPassthrough::cloud_cb, this, _1); boost::signals2::connection c = grabber_.registerCallback (f); grabber_.start (); diff --git a/apps/src/openni_planar_convex_hull.cpp b/apps/src/openni_planar_convex_hull.cpp index da0a9f19540..6aea51788b6 100644 --- a/apps/src/openni_planar_convex_hull.cpp +++ b/apps/src/openni_planar_convex_hull.cpp @@ -121,7 +121,7 @@ class OpenNIPlanarSegmentation { pcl::Grabber* interface = new pcl::OpenNIGrabber (device_id_); - boost::function f = boost::bind (&OpenNIPlanarSegmentation::cloud_cb_, this, _1); + std::function f = boost::bind (&OpenNIPlanarSegmentation::cloud_cb_, this, _1); boost::signals2::connection c = interface->registerCallback (f); interface->start (); diff --git a/apps/src/openni_planar_segmentation.cpp b/apps/src/openni_planar_segmentation.cpp index 608091777a8..bae0d4ea9e0 100644 --- a/apps/src/openni_planar_segmentation.cpp +++ b/apps/src/openni_planar_segmentation.cpp @@ -116,7 +116,7 @@ class OpenNIPlanarSegmentation { pcl::Grabber* interface = new pcl::OpenNIGrabber (device_id_); - boost::function f = boost::bind (&OpenNIPlanarSegmentation::cloud_cb_, this, _1); + std::function f = boost::bind (&OpenNIPlanarSegmentation::cloud_cb_, this, _1); boost::signals2::connection c = interface->registerCallback (f); interface->start (); diff --git a/apps/src/openni_shift_to_depth_conversion.cpp b/apps/src/openni_shift_to_depth_conversion.cpp index 678a0aa3994..1aebb96007e 100644 --- a/apps/src/openni_shift_to_depth_conversion.cpp +++ b/apps/src/openni_shift_to_depth_conversion.cpp @@ -133,7 +133,7 @@ class SimpleOpenNIViewer grabber_->getDevice ()->setDepthOutputFormat (static_cast (depthformat)); // define image callback - boost::function image_cb = boost::bind (&SimpleOpenNIViewer::image_callback, this, _1, _2, _3); boost::signals2::connection image_connection = grabber_->registerCallback (image_cb); diff --git a/apps/src/openni_tracking.cpp b/apps/src/openni_tracking.cpp index 9a7bdf260b0..dc0dbef935e 100644 --- a/apps/src/openni_tracking.cpp +++ b/apps/src/openni_tracking.cpp @@ -638,7 +638,7 @@ class OpenNISegmentTracking run () { pcl::Grabber* interface = new pcl::OpenNIGrabber (device_id_); - boost::function f = + std::function f = boost::bind (&OpenNISegmentTracking::cloud_cb, this, _1); interface->registerCallback (f); diff --git a/apps/src/openni_uniform_sampling.cpp b/apps/src/openni_uniform_sampling.cpp index 01c52c3df39..7477d249ea1 100644 --- a/apps/src/openni_uniform_sampling.cpp +++ b/apps/src/openni_uniform_sampling.cpp @@ -123,7 +123,7 @@ class OpenNIUniformSampling { pcl::Grabber* interface = new pcl::OpenNIGrabber (device_id_); - boost::function f = boost::bind (&OpenNIUniformSampling::cloud_cb_, this, _1); + std::function f = boost::bind (&OpenNIUniformSampling::cloud_cb_, this, _1); boost::signals2::connection c = interface->registerCallback (f); viewer.runOnVisualizationThread (boost::bind(&OpenNIUniformSampling::viz_cb, this, _1), "viz_cb"); diff --git a/apps/src/openni_voxel_grid.cpp b/apps/src/openni_voxel_grid.cpp index 5f86781426b..15d8f846be4 100644 --- a/apps/src/openni_voxel_grid.cpp +++ b/apps/src/openni_voxel_grid.cpp @@ -113,7 +113,7 @@ class OpenNIVoxelGrid { pcl::Grabber* interface = new pcl::OpenNIGrabber (device_id_); - boost::function f = boost::bind (&OpenNIVoxelGrid::cloud_cb_, this, _1); + std::function f = boost::bind (&OpenNIVoxelGrid::cloud_cb_, this, _1); boost::signals2::connection c = interface->registerCallback (f); interface->start (); diff --git a/apps/src/organized_segmentation_demo.cpp b/apps/src/organized_segmentation_demo.cpp index 341b576df3c..4775bdd5732 100644 --- a/apps/src/organized_segmentation_demo.cpp +++ b/apps/src/organized_segmentation_demo.cpp @@ -211,7 +211,7 @@ OrganizedSegmentationDemo::OrganizedSegmentationDemo (pcl::Grabber& grabber) : g vis_->getInteractorStyle ()->setKeyboardModifier (pcl::visualization::INTERACTOR_KB_MOD_SHIFT); ui_->qvtk_widget->update (); - boost::function f = boost::bind (&OrganizedSegmentationDemo::cloud_cb, this, _1); + std::function f = boost::bind (&OrganizedSegmentationDemo::cloud_cb, this, _1); boost::signals2::connection c = grabber_.registerCallback(f); connect (ui_->captureButton, SIGNAL(clicked()), this, SLOT(toggleCapturePressed())); diff --git a/common/include/pcl/common/boost.h b/common/include/pcl/common/boost.h index 4cc420fd097..3c5d68c0cbb 100644 --- a/common/include/pcl/common/boost.h +++ b/common/include/pcl/common/boost.h @@ -49,7 +49,6 @@ #include #include #include -#include #include #include #include diff --git a/common/include/pcl/common/gaussian.h b/common/include/pcl/common/gaussian.h index 16c6d225eda..2760203ba13 100644 --- a/common/include/pcl/common/gaussian.h +++ b/common/include/pcl/common/gaussian.h @@ -39,10 +39,11 @@ #pragma once -#include #include #include -#include + +#include +#include namespace pcl { @@ -57,8 +58,6 @@ namespace pcl { public: - GaussianKernel () {} - static const unsigned MAX_KERNEL_WIDTH = 71; /** Computes the gaussian kernel and dervative assiociated to sigma. * The kernel and derivative width are adjusted according. @@ -108,7 +107,7 @@ namespace pcl */ template void convolveRows (const pcl::PointCloud &input, - boost::function field_accessor, + std::function field_accessor, const Eigen::VectorXf &kernel, pcl::PointCloud &output) const; @@ -134,7 +133,7 @@ namespace pcl */ template void convolveCols (const pcl::PointCloud &input, - boost::function field_accessor, + std::function field_accessor, const Eigen::VectorXf &kernel, pcl::PointCloud &output) const; @@ -170,7 +169,7 @@ namespace pcl */ template inline void convolve (const pcl::PointCloud &input, - boost::function field_accessor, + std::function field_accessor, const Eigen::VectorXf &horiz_kernel, const Eigen::VectorXf &vert_kernel, pcl::PointCloud &output) const @@ -216,7 +215,7 @@ namespace pcl */ template inline void computeGradients (const pcl::PointCloud &input, - boost::function field_accessor, + std::function field_accessor, const Eigen::VectorXf &gaussian_kernel, const Eigen::VectorXf &gaussian_kernel_derivative, pcl::PointCloud &grad_x, @@ -251,7 +250,7 @@ namespace pcl */ template inline void smooth (const pcl::PointCloud &input, - boost::function field_accessor, + std::function field_accessor, const Eigen::VectorXf &gaussian_kernel, pcl::PointCloud &output) const { diff --git a/common/include/pcl/common/impl/gaussian.hpp b/common/include/pcl/common/impl/gaussian.hpp index ef09383d783..3631a0de17e 100644 --- a/common/include/pcl/common/impl/gaussian.hpp +++ b/common/include/pcl/common/impl/gaussian.hpp @@ -42,9 +42,9 @@ #include -template void +template void pcl::GaussianKernel::convolveRows(const pcl::PointCloud &input, - boost::function field_accessor, + std::function field_accessor, const Eigen::VectorXf& kernel, pcl::PointCloud &output) const { @@ -75,9 +75,9 @@ pcl::GaussianKernel::convolveRows(const pcl::PointCloud &input, } } -template void +template void pcl::GaussianKernel::convolveCols(const pcl::PointCloud &input, - boost::function field_accessor, + std::function field_accessor, const Eigen::VectorXf& kernel, pcl::PointCloud &output) const { diff --git a/common/include/pcl/common/synchronizer.h b/common/include/pcl/common/synchronizer.h index c3d668e49af..fa83fb5a183 100644 --- a/common/include/pcl/common/synchronizer.h +++ b/common/include/pcl/common/synchronizer.h @@ -35,6 +35,7 @@ #pragma once +#include #include namespace pcl @@ -58,7 +59,7 @@ namespace pcl std::deque queueT1; std::deque queueT2; - using CallbackFunction = boost::function; + using CallbackFunction = std::function; std::map cb_; int callback_counter; @@ -109,7 +110,7 @@ namespace pcl for (typename std::map::iterator cb = cb_.begin (); cb != cb_.end (); ++cb) { - if (!cb->second.empty ()) + if (cb->second) { cb->second.operator()(queueT1.front ().second, queueT2.front ().second, queueT1.front ().first, queueT2.front ().first); } diff --git a/common/include/pcl/common/time_trigger.h b/common/include/pcl/common/time_trigger.h index fa06cf238b7..b9cfa72c264 100644 --- a/common/include/pcl/common/time_trigger.h +++ b/common/include/pcl/common/time_trigger.h @@ -40,11 +40,11 @@ #include #ifndef Q_MOC_RUN -#include #include #endif #include +#include #include #include @@ -56,7 +56,7 @@ namespace pcl class PCL_EXPORTS TimeTrigger { public: - using callback_type = boost::function; + using callback_type = std::function; /** \brief Timer class that calls a callback method periodically. Due to possible blocking calls, only one callback method can be registered per instance. * \param[in] interval_seconds interval in seconds @@ -73,7 +73,7 @@ namespace pcl ~TimeTrigger (); /** \brief registers a callback - * \param[in] callback callback function to the list of callbacks. signature has to be boost::function + * \param[in] callback callback function to the list of callbacks. signature has to be std::function * \return connection the connection, which can be used to disable/enable and remove callback from list */ boost::signals2::connection registerCallback (const callback_type& callback); diff --git a/cuda/apps/src/kinect_debayering.cpp b/cuda/apps/src/kinect_debayering.cpp index daa5fd7678b..5e8a75b3590 100644 --- a/cuda/apps/src/kinect_debayering.cpp +++ b/cuda/apps/src/kinect_debayering.cpp @@ -44,6 +44,7 @@ #include +#include #include #include @@ -72,7 +73,7 @@ class SimpleKinectTool cv::namedWindow("test", CV_WINDOW_AUTOSIZE); pcl::Grabber* interface = new pcl::OpenNIGrabber(device_id); - boost::function& image)> f = boost::bind (&SimpleKinectTool::cloud_cb_, this, _1); + std::function& image)> f = boost::bind (&SimpleKinectTool::cloud_cb_, this, _1); boost::signals2::connection c = interface->registerCallback (f); diff --git a/cuda/apps/src/kinect_dediscretize.cpp b/cuda/apps/src/kinect_dediscretize.cpp index ee336a62fae..3c391e9e697 100644 --- a/cuda/apps/src/kinect_dediscretize.cpp +++ b/cuda/apps/src/kinect_dediscretize.cpp @@ -48,6 +48,7 @@ #include +#include #include #include @@ -76,7 +77,7 @@ class SimpleKinectTool { pcl::Grabber* interface = new pcl::OpenNIGrabber(device_id); - boost::function& image, const boost::shared_ptr& depth_image, float)> f = boost::bind (&SimpleKinectTool::cloud_cb_, this, _1, _2, _3); + std::function& image, const boost::shared_ptr& depth_image, float)> f = boost::bind (&SimpleKinectTool::cloud_cb_, this, _1, _2, _3); boost::signals2::connection c = interface->registerCallback (f); diff --git a/cuda/apps/src/kinect_mapping.cpp b/cuda/apps/src/kinect_mapping.cpp index e8227b9b87d..75c9ba4157f 100644 --- a/cuda/apps/src/kinect_mapping.cpp +++ b/cuda/apps/src/kinect_mapping.cpp @@ -35,25 +35,24 @@ * */ -#include -#include #include #include #include #include #include #include +#include +#include +#include #include #include #include #include #include -#include #include #include - #include #include @@ -63,6 +62,7 @@ #include #include +#include #include #include @@ -243,13 +243,13 @@ class MultiRansac if (use_device) { std::cerr << "[RANSAC] Using GPU..." << std::endl; - boost::function& image, const boost::shared_ptr& depth_image, float)> f = boost::bind (&MultiRansac::cloud_cb, this, _1, _2, _3); + std::function& image, const boost::shared_ptr& depth_image, float)> f = boost::bind (&MultiRansac::cloud_cb, this, _1, _2, _3); c = interface->registerCallback (f); } else { std::cerr << "[RANSAC] Using CPU..." << std::endl; - boost::function& image, const boost::shared_ptr& depth_image, float)> f = boost::bind (&MultiRansac::cloud_cb, this, _1, _2, _3); + std::function& image, const boost::shared_ptr& depth_image, float)> f = boost::bind (&MultiRansac::cloud_cb, this, _1, _2, _3); c = interface->registerCallback (f); } diff --git a/cuda/apps/src/kinect_normals_cuda.cpp b/cuda/apps/src/kinect_normals_cuda.cpp index f114662b9de..14581e4668e 100644 --- a/cuda/apps/src/kinect_normals_cuda.cpp +++ b/cuda/apps/src/kinect_normals_cuda.cpp @@ -54,6 +54,7 @@ #include +#include #include #include @@ -193,13 +194,13 @@ class NormalEstimation if (use_device) { std::cerr << "[NormalEstimation] Using GPU..." << std::endl; - boost::function::ConstPtr&)> f = boost::bind (&NormalEstimation::file_cloud_cb, this, _1); + std::function::ConstPtr&)> f = boost::bind (&NormalEstimation::file_cloud_cb, this, _1); filegrabber->registerCallback (f); } else { std::cerr << "[NormalEstimation] Using CPU..." << std::endl; - boost::function::ConstPtr&)> f = boost::bind (&NormalEstimation::file_cloud_cb, this, _1); + std::function::ConstPtr&)> f = boost::bind (&NormalEstimation::file_cloud_cb, this, _1); filegrabber->registerCallback (f); } @@ -218,13 +219,13 @@ class NormalEstimation if (use_device) { std::cerr << "[NormalEstimation] Using GPU..." << std::endl; - boost::function& image, const boost::shared_ptr& depth_image, float)> f = boost::bind (&NormalEstimation::cloud_cb, this, _1, _2, _3); + std::function& image, const boost::shared_ptr& depth_image, float)> f = boost::bind (&NormalEstimation::cloud_cb, this, _1, _2, _3); c = grabber->registerCallback (f); } else { std::cerr << "[NormalEstimation] Using CPU..." << std::endl; - boost::function& image, const boost::shared_ptr& depth_image, float)> f = boost::bind (&NormalEstimation::cloud_cb, this, _1, _2, _3); + std::function& image, const boost::shared_ptr& depth_image, float)> f = boost::bind (&NormalEstimation::cloud_cb, this, _1, _2, _3); c = grabber->registerCallback (f); } diff --git a/cuda/apps/src/kinect_planes_cuda.cpp b/cuda/apps/src/kinect_planes_cuda.cpp index f3c6600fc4f..1df2fa83466 100644 --- a/cuda/apps/src/kinect_planes_cuda.cpp +++ b/cuda/apps/src/kinect_planes_cuda.cpp @@ -63,6 +63,7 @@ #include +#include #include #include @@ -253,13 +254,13 @@ class MultiRansac if (use_device) { std::cerr << "[RANSAC] Using GPU..." << std::endl; - boost::function& image, const boost::shared_ptr& depth_image, float)> f = boost::bind (&MultiRansac::cloud_cb, this, _1, _2, _3); + std::function& image, const boost::shared_ptr& depth_image, float)> f = boost::bind (&MultiRansac::cloud_cb, this, _1, _2, _3); c = interface->registerCallback (f); } else { std::cerr << "[RANSAC] Using CPU..." << std::endl; - boost::function& image, const boost::shared_ptr& depth_image, float)> f = boost::bind (&MultiRansac::cloud_cb, this, _1, _2, _3); + std::function& image, const boost::shared_ptr& depth_image, float)> f = boost::bind (&MultiRansac::cloud_cb, this, _1, _2, _3); c = interface->registerCallback (f); } @@ -282,7 +283,7 @@ class MultiRansac //else // std::cerr << "did not find file" << std::endl; // - //boost::function::ConstPtr&) > f = boost::bind (&MultiRansac::logo_cb, this, _1); + //std::function::ConstPtr&) > f = boost::bind (&MultiRansac::logo_cb, this, _1); //boost::signals2::connection c1 = filegrabber->registerCallback (f); //filegrabber->start (); diff --git a/cuda/apps/src/kinect_ransac.cpp b/cuda/apps/src/kinect_ransac.cpp index 7c9936eaccc..f90ea9cfa27 100644 --- a/cuda/apps/src/kinect_ransac.cpp +++ b/cuda/apps/src/kinect_ransac.cpp @@ -52,6 +52,7 @@ #include +#include #include #include @@ -168,13 +169,13 @@ class SimpleKinectTool if (use_device) { std::cerr << "[RANSAC] Using GPU..." << std::endl; - boost::function::ConstPtr&)> f = boost::bind (&SimpleKinectTool::file_cloud_cb, this, _1); + std::function::ConstPtr&)> f = boost::bind (&SimpleKinectTool::file_cloud_cb, this, _1); filegrabber->registerCallback (f); } else { std::cerr << "[RANSAC] Using CPU..." << std::endl; - boost::function::ConstPtr&)> f = boost::bind (&SimpleKinectTool::file_cloud_cb, this, _1); + std::function::ConstPtr&)> f = boost::bind (&SimpleKinectTool::file_cloud_cb, this, _1); filegrabber->registerCallback (f); } @@ -196,13 +197,13 @@ class SimpleKinectTool if (use_device) { std::cerr << "[RANSAC] Using GPU..." << std::endl; - boost::function& image, const boost::shared_ptr& depth_image, float)> f = boost::bind (&SimpleKinectTool::cloud_cb, this, _1, _2, _3); + std::function& image, const boost::shared_ptr& depth_image, float)> f = boost::bind (&SimpleKinectTool::cloud_cb, this, _1, _2, _3); c = interface->registerCallback (f); } else { std::cerr << "[RANSAC] Using CPU..." << std::endl; - boost::function& image, const boost::shared_ptr& depth_image, float)> f = boost::bind (&SimpleKinectTool::cloud_cb, this, _1, _2, _3); + std::function& image, const boost::shared_ptr& depth_image, float)> f = boost::bind (&SimpleKinectTool::cloud_cb, this, _1, _2, _3); c = interface->registerCallback (f); } diff --git a/cuda/apps/src/kinect_segmentation_cuda.cpp b/cuda/apps/src/kinect_segmentation_cuda.cpp index 9d45c7ad7cb..fa0d6ead8bd 100644 --- a/cuda/apps/src/kinect_segmentation_cuda.cpp +++ b/cuda/apps/src/kinect_segmentation_cuda.cpp @@ -58,6 +58,7 @@ #include +#include #include #include @@ -367,13 +368,13 @@ class Segmentation if (use_device) { std::cerr << "[Segmentation] Using GPU..." << std::endl; - boost::function::ConstPtr&)> f = boost::bind (&Segmentation::file_cloud_cb, this, _1); + std::function::ConstPtr&)> f = boost::bind (&Segmentation::file_cloud_cb, this, _1); filegrabber->registerCallback (f); } else { // std::cerr << "[Segmentation] Using CPU..." << std::endl; -// boost::function::ConstPtr&)> f = boost::bind (&Segmentation::file_cloud_cb, this, _1); +// std::function::ConstPtr&)> f = boost::bind (&Segmentation::file_cloud_cb, this, _1); // filegrabber->registerCallback (f); } @@ -392,13 +393,13 @@ class Segmentation if (use_device) { std::cerr << "[Segmentation] Using GPU..." << std::endl; - boost::function& image, const boost::shared_ptr& depth_image, float)> f = boost::bind (&Segmentation::cloud_cb, this, _1, _2, _3); + std::function& image, const boost::shared_ptr& depth_image, float)> f = boost::bind (&Segmentation::cloud_cb, this, _1, _2, _3); c = grabber->registerCallback (f); } else { // std::cerr << "[Segmentation] Using CPU..." << std::endl; -// boost::function& image, const boost::shared_ptr& depth_image, float)> f = boost::bind (&Segmentation::cloud_cb, this, _1, _2, _3); +// std::function& image, const boost::shared_ptr& depth_image, float)> f = boost::bind (&Segmentation::cloud_cb, this, _1, _2, _3); // c = grabber->registerCallback (f); } diff --git a/cuda/apps/src/kinect_segmentation_planes_cuda.cpp b/cuda/apps/src/kinect_segmentation_planes_cuda.cpp index 2d5bf5ae314..b02888f763c 100644 --- a/cuda/apps/src/kinect_segmentation_planes_cuda.cpp +++ b/cuda/apps/src/kinect_segmentation_planes_cuda.cpp @@ -57,6 +57,7 @@ #include #include +#include #include using namespace pcl::cuda; @@ -242,13 +243,13 @@ class Segmentation if (use_device) { std::cerr << "[Segmentation] Using GPU..." << std::endl; - boost::function::ConstPtr&)> f = boost::bind (&Segmentation::file_cloud_cb, this, _1); + std::function::ConstPtr&)> f = boost::bind (&Segmentation::file_cloud_cb, this, _1); filegrabber->registerCallback (f); } else { // std::cerr << "[Segmentation] Using CPU..." << std::endl; -// boost::function::ConstPtr&)> f = boost::bind (&Segmentation::file_cloud_cb, this, _1); +// std::function::ConstPtr&)> f = boost::bind (&Segmentation::file_cloud_cb, this, _1); // filegrabber->registerCallback (f); } @@ -267,13 +268,13 @@ class Segmentation if (use_device) { std::cerr << "[Segmentation] Using GPU..." << std::endl; - boost::function& image, const boost::shared_ptr& depth_image, float)> f = boost::bind (&Segmentation::cloud_cb, this, _1, _2, _3); + std::function& image, const boost::shared_ptr& depth_image, float)> f = boost::bind (&Segmentation::cloud_cb, this, _1, _2, _3); c = grabber->registerCallback (f); } else { // std::cerr << "[Segmentation] Using CPU..." << std::endl; -// boost::function& image, const boost::shared_ptr& depth_image, float)> f = boost::bind (&Segmentation::cloud_cb, this, _1, _2, _3); +// std::function& image, const boost::shared_ptr& depth_image, float)> f = boost::bind (&Segmentation::cloud_cb, this, _1, _2, _3); // c = grabber->registerCallback (f); } diff --git a/cuda/apps/src/kinect_tool_standalone.cpp b/cuda/apps/src/kinect_tool_standalone.cpp index c8e0c91d8ff..1258a003759 100644 --- a/cuda/apps/src/kinect_tool_standalone.cpp +++ b/cuda/apps/src/kinect_tool_standalone.cpp @@ -45,6 +45,7 @@ #include +#include #include #include @@ -77,7 +78,7 @@ class SimpleKinectTool { pcl::Grabber* interface = new pcl::OpenNIGrabber(device_id); - boost::function& image, const boost::shared_ptr& depth_image, float)> f = boost::bind (&SimpleKinectTool::cloud_cb_, this, _1, _2, _3); + std::function& image, const boost::shared_ptr& depth_image, float)> f = boost::bind (&SimpleKinectTool::cloud_cb_, this, _1, _2, _3); boost::signals2::connection c = interface->registerCallback (f); diff --git a/cuda/apps/src/kinect_viewer_cuda.cpp b/cuda/apps/src/kinect_viewer_cuda.cpp index 0f0ca8d3669..333a78748fb 100644 --- a/cuda/apps/src/kinect_viewer_cuda.cpp +++ b/cuda/apps/src/kinect_viewer_cuda.cpp @@ -45,6 +45,7 @@ #include +#include #include #include @@ -75,7 +76,7 @@ class KinectViewerCuda { pcl::Grabber* interface = new pcl::OpenNIGrabber(device_id); - boost::function& image, const boost::shared_ptr& depth_image, float)> + std::function& image, const boost::shared_ptr& depth_image, float)> f = boost::bind (&KinectViewerCuda::cloud_cb_, this, _1, _2, _3); boost::signals2::connection c = interface->registerCallback (f); diff --git a/doc/tutorials/content/dinast_grabber.rst b/doc/tutorials/content/dinast_grabber.rst index 59b0b9d9cbe..81f7c1e2129 100644 --- a/doc/tutorials/content/dinast_grabber.rst +++ b/doc/tutorials/content/dinast_grabber.rst @@ -75,7 +75,7 @@ The code from *apps/src/dinast_grabber_example.cpp* will be used for this tutori run () { - boost::function f = + std::function f = boost::bind (&DinastProcessor::cloud_cb_, this, _1); boost::signals2::connection c = interface.registerCallback (f); @@ -119,13 +119,13 @@ At the run function what we first have is actually the callback and its registra .. code-block:: cpp - boost::function f = + std::function f = boost::bind (&DinastProcessor::cloud_cb_, this, _1); boost::signals2::connection c = interface.registerCallback (f); We create a *boost::bind* object with the address of the callback *cloud_cb_*, we pass a reference to our DinastProcessor and the argument place holder *_1*. -The bind then gets casted to a boost::function object which is templated on the callback function type, in this case *void (const CloudConstPtr&)*. The resulting function object is then registered with the DinastGrabber interface. +The bind then gets casted to a std::function object which is templated on the callback function type, in this case *void (const CloudConstPtr&)*. The resulting function object is then registered with the DinastGrabber interface. The *registerCallback* call returns a *boost::signals2::connection* object, which we do not use in the this example. However, if you want to interrupt or cancel one or more of the registered data streams, you can call disconnect the callback without stopping the whole grabber: diff --git a/doc/tutorials/content/hdl_grabber.rst b/doc/tutorials/content/hdl_grabber.rst index 8c77a93cb41..008d7287eb3 100644 --- a/doc/tutorials/content/hdl_grabber.rst +++ b/doc/tutorials/content/hdl_grabber.rst @@ -125,7 +125,7 @@ So let's look at the code. The following represents a simplified version of *vis cloud_viewer_->setCameraPosition (0.0, 0.0, 30.0, 0.0, 1.0, 0.0, 0); cloud_viewer_->setCameraClipDistances (0.0, 50.0); - boost::function cloud_cb = boost::bind ( + std::function cloud_cb = boost::bind ( &SimpleHDLViewer::cloud_callback, this, _1); boost::signals2::connection cloud_connection = grabber_.registerCallback ( cloud_cb); diff --git a/doc/tutorials/content/mobile_streaming.rst b/doc/tutorials/content/mobile_streaming.rst index 26b6c651192..0c6e9941bff 100644 --- a/doc/tutorials/content/mobile_streaming.rst +++ b/doc/tutorials/content/mobile_streaming.rst @@ -100,7 +100,7 @@ few lines of the *run()* method: .. code-block:: cpp pcl::OpenNIGrabber grabber (device_id_); - boost::function handler_function = boost::bind (&PCLMobileServer::handleIncomingCloud, this, _1); + std::function handler_function = boost::bind (&PCLMobileServer::handleIncomingCloud, this, _1); grabber.registerCallback (handler_function); grabber.start (); diff --git a/doc/tutorials/content/openni_grabber.rst b/doc/tutorials/content/openni_grabber.rst index 8dabb753876..c79a5c3e7c7 100644 --- a/doc/tutorials/content/openni_grabber.rst +++ b/doc/tutorials/content/openni_grabber.rst @@ -59,7 +59,7 @@ So let's look at the code. From *visualization/tools/openni_viewer_simple.cpp* { pcl::Grabber* interface = new pcl::OpenNIGrabber(); - boost::function::ConstPtr&)> f = + std::function::ConstPtr&)> f = boost::bind (&SimpleOpenNIViewer::cloud_cb_, this, _1); interface->registerCallback (f); @@ -91,7 +91,7 @@ first, but it's not that bad. We create a *boost::bind* object with the address of the callback *cloud_cb_*, we pass a reference to our *SimpleOpenNIViewer* and the argument place holder *_1*. -The *bind* then gets casted to a *boost::function* object which is templated on +The *bind* then gets casted to a *std::function* object which is templated on the callback function type, in this case *void (const pcl::PointCloud::ConstPtr&)*. The resulting function object can the be registered with the *OpenNIGrabber* and subsequently started. Note that diff --git a/doc/tutorials/content/sources/davidsdk/davidsdk_images_viewer.cpp b/doc/tutorials/content/sources/davidsdk/davidsdk_images_viewer.cpp index aa8e06ad32a..bc45c5018a2 100644 --- a/doc/tutorials/content/sources/davidsdk/davidsdk_images_viewer.cpp +++ b/doc/tutorials/content/sources/davidsdk/davidsdk_images_viewer.cpp @@ -106,7 +106,7 @@ main (int argc, return (-1); PCL_WARN ("davidSDK connected\n"); - boost::function f = boost::bind (&grabberCallback, _1); + std::function f = boost::bind (&grabberCallback, _1); davidsdk_ptr->registerCallback (f); davidsdk_ptr->start (); waitForUser ("Press enter to quit"); diff --git a/doc/tutorials/content/sources/ensenso_cameras/ensenso_cloud_images_viewer.cpp b/doc/tutorials/content/sources/ensenso_cameras/ensenso_cloud_images_viewer.cpp index c02f1164c16..b3d10aeff37 100644 --- a/doc/tutorials/content/sources/ensenso_cameras/ensenso_cloud_images_viewer.cpp +++ b/doc/tutorials/content/sources/ensenso_cameras/ensenso_cloud_images_viewer.cpp @@ -129,7 +129,7 @@ main (void) //ensenso_ptr->initExtrinsicCalibration (5); // Disable projector if you want good looking images. // You won't be able to detect a calibration pattern with the projector enabled! - boost::function f = boost::bind (&grabberCallback, _1, _2); + std::function f = boost::bind (&grabberCallback, _1, _2); ensenso_ptr->registerCallback (f); cv::namedWindow ("Ensenso images", cv::WINDOW_AUTOSIZE); diff --git a/doc/tutorials/content/sources/gpu/people_detect/src/people_detect.cpp b/doc/tutorials/content/sources/gpu/people_detect/src/people_detect.cpp index 15c191b326a..3fdb7b4f52f 100644 --- a/doc/tutorials/content/sources/gpu/people_detect/src/people_detect.cpp +++ b/doc/tutorials/content/sources/gpu/people_detect/src/people_detect.cpp @@ -247,8 +247,8 @@ class PeoplePCDApp typedef openni_wrapper::DepthImage::Ptr DepthImagePtr; typedef openni_wrapper::Image::Ptr ImagePtr; - boost::function::ConstPtr&)> func1 = boost::bind (&PeoplePCDApp::source_cb1, this, _1); - boost::function func2 = boost::bind (&PeoplePCDApp::source_cb2, this, _1, _2, _3); + std::function::ConstPtr&)> func1 = boost::bind (&PeoplePCDApp::source_cb1, this, _1); + std::function func2 = boost::bind (&PeoplePCDApp::source_cb2, this, _1, _2, _3); boost::signals2::connection c = cloud_cb_ ? capture_.registerCallback (func1) : capture_.registerCallback (func2); { diff --git a/doc/tutorials/content/sources/ground_based_rgbd_people_detection/src/main_ground_based_people_detection.cpp b/doc/tutorials/content/sources/ground_based_rgbd_people_detection/src/main_ground_based_people_detection.cpp index 97a239b2025..0d60ed75b4a 100644 --- a/doc/tutorials/content/sources/ground_based_rgbd_people_detection/src/main_ground_based_people_detection.cpp +++ b/doc/tutorials/content/sources/ground_based_rgbd_people_detection/src/main_ground_based_people_detection.cpp @@ -139,7 +139,7 @@ int main (int argc, char** argv) PointCloudT::Ptr cloud (new PointCloudT); bool new_cloud_available_flag = false; pcl::Grabber* interface = new pcl::OpenNIGrabber(); - boost::function::ConstPtr&)> f = + std::function::ConstPtr&)> f = boost::bind (&cloud_cb_, _1, cloud, &new_cloud_available_flag); interface->registerCallback (f); interface->start (); diff --git a/doc/tutorials/content/sources/iccv2011/src/openni_capture.cpp b/doc/tutorials/content/sources/iccv2011/src/openni_capture.cpp index 9013441e37f..fbf3b5c4dc8 100644 --- a/doc/tutorials/content/sources/iccv2011/src/openni_capture.cpp +++ b/doc/tutorials/content/sources/iccv2011/src/openni_capture.cpp @@ -11,7 +11,7 @@ OpenNICapture::OpenNICapture (const std::string& device_id) , trigger_ (false) { // Register a callback function to our OpenNI grabber... - boost::function frame_cb = boost::bind (&OpenNICapture::onNewFrame, this, _1); + std::function frame_cb = boost::bind (&OpenNICapture::onNewFrame, this, _1); // ... and start grabbing frames grabber_.registerCallback (frame_cb); grabber_.start (); @@ -39,7 +39,7 @@ OpenNICapture::snap () // Initialize the visualizer ONLY if use_trigger is set to true preview_ = pcl::visualization::PCLVisualizer::Ptr (new pcl::visualization::PCLVisualizer ()); - boost::function keyboard_cb = + std::function keyboard_cb = boost::bind (&OpenNICapture::onKeyboardEvent, this, _1); preview_->registerKeyboardCallback (keyboard_cb); diff --git a/doc/tutorials/content/sources/iros2011/src/openni_capture.cpp b/doc/tutorials/content/sources/iros2011/src/openni_capture.cpp index c9c5bd9bb0c..9784ec00334 100644 --- a/doc/tutorials/content/sources/iros2011/src/openni_capture.cpp +++ b/doc/tutorials/content/sources/iros2011/src/openni_capture.cpp @@ -12,7 +12,7 @@ OpenNICapture::OpenNICapture (const std::string& device_id) , preview_ () { // Register a callback function to our OpenNI grabber... - boost::function frame_cb = boost::bind (&OpenNICapture::onNewFrame, this, _1); + std::function frame_cb = boost::bind (&OpenNICapture::onNewFrame, this, _1); // ... and start grabbing frames grabber_.registerCallback (frame_cb); grabber_.start (); @@ -42,7 +42,7 @@ OpenNICapture::snap () // Initialize the visualizer ONLY if use_trigger is set to true preview_ = new pcl::visualization::PCLVisualizer (); - boost::function keyboard_cb = + std::function keyboard_cb = boost::bind (&OpenNICapture::onKeyboardEvent, this, _1); preview_->registerKeyboardCallback (keyboard_cb); diff --git a/doc/tutorials/content/sources/openni_grabber/openni_grabber.cpp b/doc/tutorials/content/sources/openni_grabber/openni_grabber.cpp index b87555dfb21..c060df90ae6 100644 --- a/doc/tutorials/content/sources/openni_grabber/openni_grabber.cpp +++ b/doc/tutorials/content/sources/openni_grabber/openni_grabber.cpp @@ -29,7 +29,7 @@ class SimpleOpenNIProcessor pcl::Grabber* interface = new pcl::OpenNIGrabber(); // make callback function from member function - boost::function::ConstPtr&)> f = + std::function::ConstPtr&)> f = boost::bind (&SimpleOpenNIProcessor::cloud_cb_, this, _1); // connect callback function for desired signal. In this case its a point cloud with color values diff --git a/doc/tutorials/content/sources/openni_narf_keypoint_extraction/openni_narf_keypoint_extraction.cpp b/doc/tutorials/content/sources/openni_narf_keypoint_extraction/openni_narf_keypoint_extraction.cpp index 98b97feafc5..b9b984fe350 100644 --- a/doc/tutorials/content/sources/openni_narf_keypoint_extraction/openni_narf_keypoint_extraction.cpp +++ b/doc/tutorials/content/sources/openni_narf_keypoint_extraction/openni_narf_keypoint_extraction.cpp @@ -117,7 +117,7 @@ int main (int argc, char** argv) pcl::Grabber* interface = new pcl::OpenNIGrabber (device_id); EventHelper event_helper; - boost::function f_depth_image = + std::function f_depth_image = boost::bind (&EventHelper::depth_image_cb, &event_helper, _1); boost::signals2::connection c_depth_image = interface->registerCallback (f_depth_image); diff --git a/doc/tutorials/content/sources/openni_range_image_visualization/openni_range_image_visualization.cpp b/doc/tutorials/content/sources/openni_range_image_visualization/openni_range_image_visualization.cpp index 4632a3b6aff..6f67f7c66c7 100644 --- a/doc/tutorials/content/sources/openni_range_image_visualization/openni_range_image_visualization.cpp +++ b/doc/tutorials/content/sources/openni_range_image_visualization/openni_range_image_visualization.cpp @@ -94,7 +94,7 @@ int main (int argc, char** argv) pcl::Grabber* interface = new pcl::OpenNIGrabber (device_id); EventHelper event_helper; - boost::function f_depth_image = + std::function f_depth_image = boost::bind (&EventHelper::depth_image_cb, &event_helper, _1); boost::signals2::connection c_depth_image = interface->registerCallback (f_depth_image); diff --git a/doc/tutorials/content/sources/point_cloud_compression/point_cloud_compression.cpp b/doc/tutorials/content/sources/point_cloud_compression/point_cloud_compression.cpp index eddc1b2611a..938d66775ce 100644 --- a/doc/tutorials/content/sources/point_cloud_compression/point_cloud_compression.cpp +++ b/doc/tutorials/content/sources/point_cloud_compression/point_cloud_compression.cpp @@ -60,7 +60,7 @@ class SimpleOpenNIViewer pcl::Grabber* interface = new pcl::OpenNIGrabber (); // make callback function from member function - boost::function::ConstPtr&)> f = boost::bind (&SimpleOpenNIViewer::cloud_cb_, this, _1); // connect callback function for desired signal. In this case its a point cloud with color values diff --git a/doc/tutorials/content/sources/tracking/tracking_sample.cpp b/doc/tutorials/content/sources/tracking/tracking_sample.cpp index 307cf3de1fa..e3cce063cc2 100644 --- a/doc/tutorials/content/sources/tracking/tracking_sample.cpp +++ b/doc/tutorials/content/sources/tracking/tracking_sample.cpp @@ -275,7 +275,7 @@ main (int argc, char** argv) //Setup OpenNIGrabber and viewer pcl::visualization::CloudViewer* viewer_ = new pcl::visualization::CloudViewer("PCL OpenNI Tracking Viewer"); pcl::Grabber* interface = new pcl::OpenNIGrabber (device_id); - boost::function f = + std::function f = boost::bind (&cloud_cb, _1); interface->registerCallback (f); diff --git a/features/include/pcl/features/boost.h b/features/include/pcl/features/boost.h index e4b4bc357f7..c56147885ec 100644 --- a/features/include/pcl/features/boost.h +++ b/features/include/pcl/features/boost.h @@ -43,6 +43,5 @@ # pragma GCC system_header #endif -#include #include #include diff --git a/features/include/pcl/features/feature.h b/features/include/pcl/features/feature.h index 5cef4b398d2..15d9d67d5bd 100644 --- a/features/include/pcl/features/feature.h +++ b/features/include/pcl/features/feature.h @@ -44,12 +44,13 @@ # pragma GCC system_header #endif -#include #include // PCL includes #include #include +#include + namespace pcl { /** \brief Solve the eigenvalues and eigenvectors of a given 3x3 covariance matrix, and estimate the least-squares @@ -121,8 +122,8 @@ namespace pcl typedef pcl::PointCloud PointCloudOut; - typedef boost::function &, std::vector &)> SearchMethod; - typedef boost::function &, std::vector &)> SearchMethodSurface; + typedef std::function &, std::vector &)> SearchMethod; + typedef std::function &, std::vector &)> SearchMethodSurface; public: /** \brief Empty constructor. */ diff --git a/features/include/pcl/features/impl/integral_image_normal.hpp b/features/include/pcl/features/impl/integral_image_normal.hpp index 9d5a3c2530d..56bfc8c43fb 100644 --- a/features/include/pcl/features/impl/integral_image_normal.hpp +++ b/features/include/pcl/features/impl/integral_image_normal.hpp @@ -391,7 +391,7 @@ pcl::IntegralImageNormalEstimation::computePointNormal ( template void sumArea (int start_x, int start_y, int end_x, int end_y, const int width, const int height, - const boost::function &f, + const std::function &f, T & result) { if (start_x < 0) diff --git a/filters/include/pcl/filters/boost.h b/filters/include/pcl/filters/boost.h index 80b1af1e976..a9ff7e8462a 100644 --- a/filters/include/pcl/filters/boost.h +++ b/filters/include/pcl/filters/boost.h @@ -53,5 +53,4 @@ #include #include #include -#include #include diff --git a/filters/include/pcl/filters/model_outlier_removal.h b/filters/include/pcl/filters/model_outlier_removal.h index d968def0065..5aad78594ff 100644 --- a/filters/include/pcl/filters/model_outlier_removal.h +++ b/filters/include/pcl/filters/model_outlier_removal.h @@ -173,7 +173,7 @@ namespace pcl * \param[in] thresh pointer to a threshold function */ void - setThresholdFunction (boost::function thresh) + setThresholdFunction (std::function thresh) { threshold_function_ = thresh; } @@ -235,7 +235,7 @@ namespace pcl /** \brief The type of model to use (user given parameter). */ pcl::SacModel model_type_; - boost::function threshold_function_; + std::function threshold_function_; inline bool checkSingleThreshold (double value) diff --git a/gpu/kinfu/tools/kinfu_app.cpp b/gpu/kinfu/tools/kinfu_app.cpp index d2334823018..eacdf5decbf 100644 --- a/gpu/kinfu/tools/kinfu_app.cpp +++ b/gpu/kinfu/tools/kinfu_app.cpp @@ -37,6 +37,7 @@ #define _CRT_SECURE_NO_DEPRECATE +#include #include #include @@ -961,17 +962,17 @@ struct KinFuApp typedef boost::shared_ptr DepthImagePtr; typedef boost::shared_ptr ImagePtr; - boost::function func1_dev = boost::bind (&KinFuApp::source_cb2_device, this, _1, _2, _3); - boost::function func2_dev = boost::bind (&KinFuApp::source_cb1_device, this, _1); + std::function func1_dev = boost::bind (&KinFuApp::source_cb2_device, this, _1, _2, _3); + std::function func2_dev = boost::bind (&KinFuApp::source_cb1_device, this, _1); - boost::function func1_oni = boost::bind (&KinFuApp::source_cb2_oni, this, _1, _2, _3); - boost::function func2_oni = boost::bind (&KinFuApp::source_cb1_oni, this, _1); + std::function func1_oni = boost::bind (&KinFuApp::source_cb2_oni, this, _1, _2, _3); + std::function func2_oni = boost::bind (&KinFuApp::source_cb1_oni, this, _1); bool is_oni = dynamic_cast(&capture_) != nullptr; - boost::function func1 = is_oni ? func1_oni : func1_dev; - boost::function func2 = is_oni ? func2_oni : func2_dev; + std::function func1 = is_oni ? func1_oni : func1_dev; + std::function func2 = is_oni ? func2_oni : func2_dev; - boost::function::ConstPtr&) > func3 = boost::bind (&KinFuApp::source_cb3, this, _1); + std::function::ConstPtr&) > func3 = boost::bind (&KinFuApp::source_cb3, this, _1); bool need_colors = integrate_colors_ || registration_; if ( pcd_source_ && !capture_.providesCallback::ConstPtr&)>() ) diff --git a/gpu/kinfu_large_scale/tools/kinfuLS_app.cpp b/gpu/kinfu_large_scale/tools/kinfuLS_app.cpp index bb59465b4a3..6cd633e42a3 100644 --- a/gpu/kinfu_large_scale/tools/kinfuLS_app.cpp +++ b/gpu/kinfu_large_scale/tools/kinfuLS_app.cpp @@ -47,6 +47,7 @@ Work in progress: patch by Marco (AUG,19th 2012) #define _CRT_SECURE_NO_DEPRECATE +#include #include #include @@ -981,9 +982,9 @@ struct KinFuLSApp typedef boost::shared_ptr DepthImagePtr; typedef boost::shared_ptr ImagePtr; - boost::function func1 = boost::bind (&KinFuLSApp::source_cb2, this, _1, _2, _3); - boost::function func2 = boost::bind (&KinFuLSApp::source_cb1, this, _1); - boost::function::ConstPtr&) > func3 = boost::bind (&KinFuLSApp::source_cb3, this, _1); + std::function func1 = boost::bind (&KinFuLSApp::source_cb2, this, _1, _2, _3); + std::function func2 = boost::bind (&KinFuLSApp::source_cb1, this, _1); + std::function::ConstPtr&) > func3 = boost::bind (&KinFuLSApp::source_cb3, this, _1); bool need_colors = integrate_colors_ || registration_ || enable_texture_extraction_; diff --git a/gpu/kinfu_large_scale/tools/record_maps_rgb.cpp b/gpu/kinfu_large_scale/tools/record_maps_rgb.cpp index 15f3c7572cd..de6c34ac152 100644 --- a/gpu/kinfu_large_scale/tools/record_maps_rgb.cpp +++ b/gpu/kinfu_large_scale/tools/record_maps_rgb.cpp @@ -46,6 +46,7 @@ #include #include #include +#include #include #include @@ -257,9 +258,9 @@ void grabAndSend () { pcl::Grabber* interface = new pcl::OpenNIGrabber (); - //boost::function::ConstPtr& )> f = boost::bind(&grabberCallBack, _1); + //std::function::ConstPtr& )> f = boost::bind(&grabberCallBack, _1); - boost::function&, const boost::shared_ptr&, float constant)> f = boost::bind (&grabberMapsCallBack, _1, _2, _3); + std::function&, const boost::shared_ptr&, float constant)> f = boost::bind (&grabberMapsCallBack, _1, _2, _3); interface->registerCallback (f); diff --git a/gpu/people/tools/people_app.cpp b/gpu/people/tools/people_app.cpp index c037b23b0ed..a02cd77b7f5 100644 --- a/gpu/people/tools/people_app.cpp +++ b/gpu/people/tools/people_app.cpp @@ -56,6 +56,7 @@ #include #include +#include #include namespace pc = pcl::console; @@ -281,8 +282,8 @@ class PeoplePCDApp typedef boost::shared_ptr DepthImagePtr; typedef boost::shared_ptr ImagePtr; - boost::function >&)> func1 = boost::bind (&PeoplePCDApp::source_cb1, this, _1); - boost::function func2 = boost::bind (&PeoplePCDApp::source_cb2, this, _1, _2, _3); + std::function >&)> func1 = boost::bind (&PeoplePCDApp::source_cb1, this, _1); + std::function func2 = boost::bind (&PeoplePCDApp::source_cb2, this, _1, _2, _3); boost::signals2::connection c = cloud_cb_ ? capture_.registerCallback (func1) : capture_.registerCallback (func2); { diff --git a/gpu/people/tools/people_tracking.cpp b/gpu/people/tools/people_tracking.cpp index 5b7d032bb93..7fbdf43177d 100644 --- a/gpu/people/tools/people_tracking.cpp +++ b/gpu/people/tools/people_tracking.cpp @@ -5,7 +5,6 @@ **/ ////// ALL INCLUDES ///////////// -#include #include #include #include @@ -15,15 +14,17 @@ #include #include #include -#include #include #include -//#include -//#include #include #include #include +#include + +#include +#include + using namespace std::chrono_literals; class PeopleTrackingApp @@ -58,7 +59,7 @@ class PeopleTrackingApp { pcl::Grabber* interface = new pcl::OpenNIGrabber(); - boost::function::ConstPtr&)> f = + std::function::ConstPtr&)> f = boost::bind (&PeopleTrackingApp::cloud_cb_, this, _1); interface->registerCallback (f); diff --git a/io/include/pcl/io/boost.h b/io/include/pcl/io/boost.h index 1534b26d7a1..48ac17c5808 100644 --- a/io/include/pcl/io/boost.h +++ b/io/include/pcl/io/boost.h @@ -48,7 +48,6 @@ #include #include #include -#include #include #include #include diff --git a/io/include/pcl/io/grabber.h b/io/include/pcl/io/grabber.h index 6a24bb50aaa..fe6e96f6bc9 100644 --- a/io/include/pcl/io/grabber.h +++ b/io/include/pcl/io/grabber.h @@ -69,7 +69,7 @@ namespace pcl * \return Connection object, that can be used to disconnect the callback method from the signal again. */ template boost::signals2::connection - registerCallback (const boost::function& callback); + registerCallback (const std::function& callback); /** \brief indicates whether a signal with given parameter-type exists or not * \return true if signal exists, false otherwise @@ -231,7 +231,7 @@ namespace pcl } template boost::signals2::connection - Grabber::registerCallback (const boost::function & callback) + Grabber::registerCallback (const std::function & callback) { typedef boost::signals2::signal Signal; if (signals_.find (typeid (T).name ()) == signals_.end ()) diff --git a/io/include/pcl/io/openni2/openni2_device.h b/io/include/pcl/io/openni2/openni2_device.h index 499f233dc51..ab2471d862e 100644 --- a/io/include/pcl/io/openni2/openni2_device.h +++ b/io/include/pcl/io/openni2/openni2_device.h @@ -38,7 +38,7 @@ #include #include #include -#include +#include #include #include @@ -73,12 +73,12 @@ namespace pcl { public: - typedef boost::function, void* cookie) > ImageCallbackFunction; - typedef boost::function, void* cookie) > DepthImageCallbackFunction; - typedef boost::function, void* cookie) > IRImageCallbackFunction; + typedef std::function, void* cookie) > ImageCallbackFunction; + typedef std::function, void* cookie) > DepthImageCallbackFunction; + typedef std::function, void* cookie) > IRImageCallbackFunction; typedef unsigned CallbackHandle; - typedef boost::function StreamCallbackFunction; + typedef std::function StreamCallbackFunction; OpenNI2Device (const std::string& device_URI); virtual ~OpenNI2Device (); diff --git a/io/include/pcl/io/openni2/openni2_frame_listener.h b/io/include/pcl/io/openni2/openni2_frame_listener.h index 2e7a998578b..55f0a70c976 100644 --- a/io/include/pcl/io/openni2/openni2_frame_listener.h +++ b/io/include/pcl/io/openni2/openni2_frame_listener.h @@ -37,7 +37,7 @@ #pragma once -#include +#include #include "OpenNI.h" @@ -48,7 +48,7 @@ namespace pcl namespace openni2 { - typedef boost::function StreamCallbackFunction; + typedef std::function StreamCallbackFunction; /* Each NewFrameListener may only listen to one VideoStream at a time. **/ diff --git a/io/include/pcl/io/openni_camera/openni_device.h b/io/include/pcl/io/openni_camera/openni_device.h index c026ec22122..1d3aa745ece 100644 --- a/io/include/pcl/io/openni_camera/openni_device.h +++ b/io/include/pcl/io/openni_camera/openni_device.h @@ -40,18 +40,19 @@ #include #ifdef HAVE_OPENNI -#include -#include -#include -#include -#include -#include #include "openni_exception.h" #include "openni.h" #include #include +#include +#include +#include +#include +#include +#include +#include /// @todo Get rid of all exception-specifications, these are useless and soon to be deprecated @@ -79,9 +80,9 @@ namespace openni_wrapper } DepthMode; typedef boost::shared_ptr Ptr; - typedef boost::function, void* cookie) > ImageCallbackFunction; - typedef boost::function, void* cookie) > DepthImageCallbackFunction; - typedef boost::function, void* cookie) > IRImageCallbackFunction; + typedef std::function, void* cookie) > ImageCallbackFunction; + typedef std::function, void* cookie) > DepthImageCallbackFunction; + typedef std::function, void* cookie) > IRImageCallbackFunction; typedef unsigned CallbackHandle; public: @@ -280,7 +281,7 @@ namespace openni_wrapper virtual bool isIRStreamRunning () const throw (); - /** \brief registers a callback function of boost::function type for the image stream with an optional user defined parameter. + /** \brief registers a callback function of std::function type for the image stream with an optional user defined parameter. * The callback will always be called with a new image and the user data "cookie". * \param[in] callback the user callback to be called if a new image is available * \param[in] cookie the cookie that needs to be passed to the callback together with the new image. @@ -308,7 +309,7 @@ namespace openni_wrapper unregisterImageCallback (const CallbackHandle& callbackHandle) throw (); - /** \brief registers a callback function of boost::function type for the depth stream with an optional user defined parameter. + /** \brief registers a callback function of std::function type for the depth stream with an optional user defined parameter. * The callback will always be called with a new depth image and the user data "cookie". * \param[in] callback the user callback to be called if a new depth image is available * \param[in] cookie the cookie that needs to be passed to the callback together with the new depth image. @@ -335,7 +336,7 @@ namespace openni_wrapper bool unregisterDepthCallback (const CallbackHandle& callbackHandle) throw (); - /** \brief registers a callback function of boost::function type for the IR stream with an optional user defined parameter. + /** \brief registers a callback function of std::function type for the IR stream with an optional user defined parameter. * The callback will always be called with a new IR image and the user data "cookie". * \param[in] callback the user callback to be called if a new IR image is available * \param[in] cookie the cookie that needs to be passed to the callback together with the new IR image. @@ -445,9 +446,9 @@ namespace openni_wrapper OpenNIDevice (OpenNIDevice const &); OpenNIDevice& operator=(OpenNIDevice const &); protected: - typedef boost::function) > ActualImageCallbackFunction; - typedef boost::function) > ActualDepthImageCallbackFunction; - typedef boost::function) > ActualIRImageCallbackFunction; + typedef std::function) > ActualImageCallbackFunction; + typedef std::function) > ActualDepthImageCallbackFunction; + typedef std::function) > ActualIRImageCallbackFunction; OpenNIDevice (xn::Context& context, const xn::NodeInfo& device_node, const xn::NodeInfo& image_node, const xn::NodeInfo& depth_node, const xn::NodeInfo& ir_node); OpenNIDevice (xn::Context& context, const xn::NodeInfo& device_node, const xn::NodeInfo& depth_node, const xn::NodeInfo& ir_node); diff --git a/io/include/pcl/io/ply/ply_parser.h b/io/include/pcl/io/ply/ply_parser.h index 14cafa581ec..dac10174006 100644 --- a/io/include/pcl/io/ply/ply_parser.h +++ b/io/include/pcl/io/ply/ply_parser.h @@ -77,32 +77,32 @@ namespace pcl { public: - typedef boost::function info_callback_type; - typedef boost::function warning_callback_type; - typedef boost::function error_callback_type; + typedef std::function info_callback_type; + typedef std::function warning_callback_type; + typedef std::function error_callback_type; - typedef boost::function magic_callback_type; - typedef boost::function format_callback_type; - typedef boost::function comment_callback_type; - typedef boost::function obj_info_callback_type; - typedef boost::function end_header_callback_type; + typedef std::function magic_callback_type; + typedef std::function format_callback_type; + typedef std::function comment_callback_type; + typedef std::function obj_info_callback_type; + typedef std::function end_header_callback_type; - typedef boost::function begin_element_callback_type; - typedef boost::function end_element_callback_type; + typedef std::function begin_element_callback_type; + typedef std::function end_element_callback_type; typedef boost::tuple element_callbacks_type; - typedef boost::function element_definition_callback_type; + typedef std::function element_definition_callback_type; template struct scalar_property_callback_type { - typedef boost::function type; + typedef std::function type; }; template struct scalar_property_definition_callback_type { typedef typename scalar_property_callback_type::type scalar_property_callback_type; - typedef boost::function type; + typedef std::function type; }; typedef boost::mpl::vector scalar_types; @@ -169,19 +169,19 @@ namespace pcl template struct list_property_begin_callback_type { - typedef boost::function type; + typedef std::function type; }; template struct list_property_element_callback_type { - typedef boost::function type; + typedef std::function type; }; template struct list_property_end_callback_type { - typedef boost::function type; + typedef std::function type; }; template @@ -190,7 +190,7 @@ namespace pcl typedef typename list_property_begin_callback_type::type list_property_begin_callback_type; typedef typename list_property_element_callback_type::type list_property_element_callback_type; typedef typename list_property_end_callback_type::type list_property_end_callback_type; - typedef boost::function< + typedef std::function< boost::tuple< list_property_begin_callback_type, list_property_element_callback_type, diff --git a/io/include/pcl/io/ply_io.h b/io/include/pcl/io/ply_io.h index 3307e878d2c..c1f4effc338 100644 --- a/io/include/pcl/io/ply_io.h +++ b/io/include/pcl/io/ply_io.h @@ -283,7 +283,7 @@ namespace pcl * \param[in] element_name element name * \param[in] count number of instances */ - boost::tuple, boost::function > + boost::tuple, std::function > elementDefinitionCallback (const std::string& element_name, std::size_t count); bool @@ -293,7 +293,7 @@ namespace pcl * \param[in] element_name element name to which the property belongs * \param[in] property_name property name */ - template boost::function + template std::function scalarPropertyDefinitionCallback (const std::string& element_name, const std::string& property_name); /** \brief function called when a list property is parsed @@ -301,7 +301,7 @@ namespace pcl * \param[in] property_name list property name */ template - boost::tuple, boost::function, boost::function > + boost::tuple, std::function, std::function > listPropertyDefinitionCallback (const std::string& element_name, const std::string& property_name); /** \brief function called at the beginning of a list property parsing. diff --git a/io/src/ply_io.cpp b/io/src/ply_io.cpp index c242cad0541..61b563c9e17 100644 --- a/io/src/ply_io.cpp +++ b/io/src/ply_io.cpp @@ -46,7 +46,7 @@ #include #include -boost::tuple, boost::function > +boost::tuple, std::function > pcl::PLYReader::elementDefinitionCallback (const std::string& element_name, std::size_t count) { if (element_name == "vertex") @@ -63,14 +63,14 @@ pcl::PLYReader::elementDefinitionCallback (const std::string& element_name, std: cloud_->point_step = 0; cloud_->row_step = 0; vertex_count_ = 0; - return (boost::tuple, boost::function > ( + return (boost::tuple, std::function > ( boost::bind (&pcl::PLYReader::vertexBeginCallback, this), boost::bind (&pcl::PLYReader::vertexEndCallback, this))); } else if ((element_name == "face") && polygons_) { polygons_->reserve (count); - return (boost::tuple, boost::function > ( + return (boost::tuple, std::function > ( boost::bind (&pcl::PLYReader::faceBeginCallback, this), boost::bind (&pcl::PLYReader::faceEndCallback, this))); } @@ -82,7 +82,7 @@ pcl::PLYReader::elementDefinitionCallback (const std::string& element_name, std: else if (element_name == "range_grid") { range_grid_->reserve (count); - return (boost::tuple, boost::function > ( + return (boost::tuple, std::function > ( boost::bind (&pcl::PLYReader::rangeGridBeginCallback, this), boost::bind (&pcl::PLYReader::rangeGridEndCallback, this))); } @@ -127,7 +127,7 @@ pcl::PLYReader::amendProperty (const std::string& old_name, const std::string& n namespace pcl { template <> - boost::function + std::function PLYReader::scalarPropertyDefinitionCallback (const std::string& element_name, const std::string& property_name) { if (element_name == "vertex") @@ -196,7 +196,7 @@ namespace pcl } } - template <> boost::function + template <> std::function PLYReader::scalarPropertyDefinitionCallback (const std::string& element_name, const std::string& property_name) { if (element_name == "vertex") @@ -228,7 +228,7 @@ namespace pcl return {}; } - template <> boost::function + template <> std::function PLYReader::scalarPropertyDefinitionCallback (const std::string& element_name, const std::string& property_name) { if (element_name == "vertex") @@ -253,7 +253,7 @@ namespace pcl return {}; } - template boost::function + template std::function PLYReader::scalarPropertyDefinitionCallback (const std::string& element_name, const std::string& property_name) { if (element_name == "vertex") @@ -317,12 +317,12 @@ namespace pcl } template <> - boost::tuple, boost::function, boost::function > + boost::tuple, std::function, std::function > pcl::PLYReader::listPropertyDefinitionCallback (const std::string& element_name, const std::string& property_name) { if ((element_name == "range_grid") && (property_name == "vertex_indices" || property_name == "vertex_index")) { - return boost::tuple, boost::function, boost::function > ( + return boost::tuple, std::function, std::function > ( boost::bind (&pcl::PLYReader::rangeGridVertexIndicesBeginCallback, this, _1), boost::bind (&pcl::PLYReader::rangeGridVertexIndicesElementCallback, this, _1), boost::bind (&pcl::PLYReader::rangeGridVertexIndicesEndCallback, this) @@ -330,7 +330,7 @@ namespace pcl } else if ((element_name == "face") && (property_name == "vertex_indices" || property_name == "vertex_index") && polygons_) { - return boost::tuple, boost::function, boost::function > ( + return boost::tuple, std::function, std::function > ( boost::bind (&pcl::PLYReader::faceVertexIndicesBeginCallback, this, _1), boost::bind (&pcl::PLYReader::faceVertexIndicesElementCallback, this, _1), boost::bind (&pcl::PLYReader::faceVertexIndicesEndCallback, this) @@ -349,7 +349,7 @@ namespace pcl else cloud_->point_step = static_cast (std::numeric_limits::max ()); do_resize_ = true; - return boost::tuple, boost::function, boost::function > ( + return boost::tuple, std::function, std::function > ( boost::bind (&pcl::PLYReader::vertexListPropertyBeginCallback, this, property_name, _1), boost::bind (&pcl::PLYReader::vertexListPropertyContentCallback, this, _1), boost::bind (&pcl::PLYReader::vertexListPropertyEndCallback, this) @@ -362,7 +362,7 @@ namespace pcl } template - boost::tuple, boost::function, boost::function > + boost::tuple, std::function, std::function > pcl::PLYReader::listPropertyDefinitionCallback (const std::string& element_name, const std::string& property_name) { if (element_name == "vertex") @@ -378,7 +378,7 @@ namespace pcl else cloud_->point_step = static_cast (std::numeric_limits::max ()); do_resize_ = true; - return boost::tuple, boost::function, boost::function > ( + return boost::tuple, std::function, std::function > ( boost::bind (&pcl::PLYReader::vertexListPropertyBeginCallback, this, property_name, _1), boost::bind (&pcl::PLYReader::vertexListPropertyContentCallback, this, _1), boost::bind (&pcl::PLYReader::vertexListPropertyEndCallback, this) diff --git a/io/tools/hdl_grabber_example.cpp b/io/tools/hdl_grabber_example.cpp index af914de2b0c..79d830380a2 100644 --- a/io/tools/hdl_grabber_example.cpp +++ b/io/tools/hdl_grabber_example.cpp @@ -70,14 +70,14 @@ class SimpleHDLGrabber { pcl::HDLGrabber interface (calibrationFile, pcapFile); // make callback function from member function - boost::function >&, float, float)> f = + std::function >&, float, float)> f = boost::bind(&SimpleHDLGrabber::sectorScan, this, _1, _2, _3); // connect callback function for desired signal. In this case its a sector with XYZ and intensity information //boost::signals2::connection c = interface.registerCallback(f); // Register a callback function that gets complete 360 degree sweeps. - boost::function >&)> f2 = boost::bind( + std::function >&)> f2 = boost::bind( &SimpleHDLGrabber::sweepScan, this, _1); boost::signals2::connection c2 = interface.registerCallback(f2); diff --git a/io/tools/openni_grabber_depth_example.cpp b/io/tools/openni_grabber_depth_example.cpp index 2c2eb8d694f..c10f7862866 100644 --- a/io/tools/openni_grabber_depth_example.cpp +++ b/io/tools/openni_grabber_depth_example.cpp @@ -77,7 +77,7 @@ class SimpleOpenNIProcessor interface.getDevice ()->setDepthOutputFormat (mode); // make callback function from member function - boost::function&)> f2 = boost::bind (&SimpleOpenNIProcessor::imageDepthImageCallback, this, _1); + std::function&)> f2 = boost::bind (&SimpleOpenNIProcessor::imageDepthImageCallback, this, _1); // connect callback function for desired signal. In this case its a point cloud with color values boost::signals2::connection c2 = interface.registerCallback (f2); diff --git a/io/tools/openni_grabber_example.cpp b/io/tools/openni_grabber_example.cpp index f08a9481e9a..1ea1dbaef47 100644 --- a/io/tools/openni_grabber_example.cpp +++ b/io/tools/openni_grabber_example.cpp @@ -99,14 +99,14 @@ class SimpleOpenNIProcessor interface.getDevice ()->setDepthOutputFormat (mode); // make callback function from member function - boost::function::ConstPtr&)> f = + std::function::ConstPtr&)> f = boost::bind (&SimpleOpenNIProcessor::cloud_cb_, this, _1); // connect callback function for desired signal. In this case its a point cloud with color values boost::signals2::connection c = interface.registerCallback (f); // make callback function from member function - boost::function&, const boost::shared_ptr&, float constant)> f2 = + std::function&, const boost::shared_ptr&, float constant)> f2 = boost::bind (&SimpleOpenNIProcessor::imageDepthImageCallback, this, _1, _2, _3); // connect callback function for desired signal. In this case its a point cloud with color values diff --git a/io/tools/openni_pcd_recorder.cpp b/io/tools/openni_pcd_recorder.cpp index b45b96de7c7..13fed35786d 100644 --- a/io/tools/openni_pcd_recorder.cpp +++ b/io/tools/openni_pcd_recorder.cpp @@ -232,7 +232,7 @@ class Producer grabber->getDevice ()->setDepthOutputFormat (depth_mode_); Grabber* interface = grabber; - boost::function::ConstPtr&)> f = boost::bind (&Producer::grabberCallBack, this, _1); + std::function::ConstPtr&)> f = boost::bind (&Producer::grabberCallBack, this, _1); interface->registerCallback (f); interface->start (); diff --git a/io/tools/ply/ply2obj.cpp b/io/tools/ply/ply2obj.cpp index c531383372f..3c842dd9b76 100644 --- a/io/tools/ply/ply2obj.cpp +++ b/io/tools/ply/ply2obj.cpp @@ -81,15 +81,15 @@ class ply_to_obj_converter void error_callback (const std::string& filename, std::size_t line_number, const std::string& message); - boost::tuple, boost::function > + boost::tuple, std::function > element_definition_callback (const std::string& element_name, std::size_t count); - template boost::function + template std::function scalar_property_definition_callback (const std::string& element_name, const std::string& property_name); - template boost::tuple, - boost::function, - boost::function > + template boost::tuple, + std::function, + std::function > list_property_definition_callback (const std::string& element_name, const std::string& property_name); void @@ -155,19 +155,19 @@ ply_to_obj_converter::error_callback (const std::string& filename, std::size_t l std::cerr << filename << ":" << line_number << ": " << "error: " << message << std::endl; } -boost::tuple, boost::function > +boost::tuple, std::function > ply_to_obj_converter::element_definition_callback (const std::string& element_name, std::size_t) { if (element_name == "vertex") { - return boost::tuple, boost::function > ( + return boost::tuple, std::function > ( boost::bind (&ply_to_obj_converter::vertex_begin, this), boost::bind (&ply_to_obj_converter::vertex_end, this) ); } else if (element_name == "face") { - return boost::tuple, boost::function > ( + return boost::tuple, std::function > ( boost::bind (&ply_to_obj_converter::face_begin, this), boost::bind (&ply_to_obj_converter::face_end, this) ); @@ -177,7 +177,7 @@ ply_to_obj_converter::element_definition_callback (const std::string& element_na } } -template <> boost::function +template <> std::function ply_to_obj_converter::scalar_property_definition_callback (const std::string& element_name, const std::string& property_name) { if (element_name == "vertex") { @@ -199,11 +199,11 @@ ply_to_obj_converter::scalar_property_definition_callback (const std::string& el } } -template <> boost::tuple, boost::function, boost::function > +template <> boost::tuple, std::function, std::function > ply_to_obj_converter::list_property_definition_callback (const std::string& element_name, const std::string& property_name) { if ((element_name == "face") && (property_name == "vertex_indices")) { - return boost::tuple, boost::function, boost::function > ( + return boost::tuple, std::function, std::function > ( boost::bind (&ply_to_obj_converter::face_vertex_indices_begin, this, _1), boost::bind (&ply_to_obj_converter::face_vertex_indices_element, this, _1), boost::bind (&ply_to_obj_converter::face_vertex_indices_end, this) diff --git a/io/tools/ply/ply2ply.cpp b/io/tools/ply/ply2ply.cpp index fe6bffebc0d..31d5dc9c099 100644 --- a/io/tools/ply/ply2ply.cpp +++ b/io/tools/ply/ply2ply.cpp @@ -95,13 +95,13 @@ class ply_to_ply_converter void element_end_callback(); - boost::tuple, boost::function > + boost::tuple, std::function > element_definition_callback(const std::string& element_name, std::size_t count); template void scalar_property_callback(ScalarType scalar); - template boost::function + template std::function scalar_property_definition_callback(const std::string& element_name, const std::string& property_name); template void @@ -113,9 +113,9 @@ class ply_to_ply_converter template void list_property_end_callback(); - template boost::tuple, - boost::function, - boost::function > + template boost::tuple, + std::function, + std::function > list_property_definition_callback(const std::string& element_name, const std::string& property_name); void @@ -211,10 +211,10 @@ ply_to_ply_converter::element_end_callback() } } -boost::tuple, boost::function > ply_to_ply_converter::element_definition_callback(const std::string& element_name, std::size_t count) +boost::tuple, std::function > ply_to_ply_converter::element_definition_callback(const std::string& element_name, std::size_t count) { (*ostream_) << "element " << element_name << " " << count << "\n"; - return boost::tuple, boost::function >( + return boost::tuple, std::function >( boost::bind(&ply_to_ply_converter::element_begin_callback, this), boost::bind(&ply_to_ply_converter::element_end_callback, this) ); @@ -244,7 +244,7 @@ ply_to_ply_converter::scalar_property_callback(ScalarType scalar) } ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// -template boost::function +template std::function ply_to_ply_converter::scalar_property_definition_callback (const std::string&, const std::string& property_name) { (*ostream_) << "property " << pcl::io::ply::type_traits::old_name() << " " << property_name << "\n"; @@ -300,13 +300,13 @@ template void ply_to_ply_converter::list_property_end_callback() {} ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// -template boost::tuple, - boost::function, - boost::function > +template boost::tuple, + std::function, + std::function > ply_to_ply_converter::list_property_definition_callback (const std::string&, const std::string& property_name) { (*ostream_) << "property list " << pcl::io::ply::type_traits::old_name() << " " << pcl::io::ply::type_traits::old_name() << " " << property_name << "\n"; - return boost::tuple, boost::function, boost::function >( + return boost::tuple, std::function, std::function >( boost::bind(&ply_to_ply_converter::list_property_begin_callback, this, _1), boost::bind(&ply_to_ply_converter::list_property_element_callback, this, _1), boost::bind(&ply_to_ply_converter::list_property_end_callback, this) diff --git a/io/tools/ply/ply2raw.cpp b/io/tools/ply/ply2raw.cpp index a8605a7a44b..b23c727fdb2 100644 --- a/io/tools/ply/ply2raw.cpp +++ b/io/tools/ply/ply2raw.cpp @@ -103,15 +103,15 @@ class ply_to_raw_converter void error_callback (const std::string& filename, std::size_t line_number, const std::string& message); - boost::tuple, boost::function > + boost::tuple, std::function > element_definition_callback (const std::string& element_name, std::size_t count); - template boost::function + template std::function scalar_property_definition_callback (const std::string& element_name, const std::string& property_name); - template boost::tuple, - boost::function, - boost::function > + template boost::tuple, + std::function, + std::function > list_property_definition_callback (const std::string& element_name, const std::string& property_name); void @@ -168,17 +168,17 @@ ply_to_raw_converter::error_callback (const std::string& filename, std::size_t l std::cerr << filename << ":" << line_number << ": " << "error: " << message << std::endl; } -boost::tuple, boost::function > +boost::tuple, std::function > ply_to_raw_converter::element_definition_callback (const std::string& element_name, std::size_t) { if (element_name == "vertex") { - return boost::tuple, boost::function > ( + return boost::tuple, std::function > ( boost::bind (&ply_to_raw_converter::vertex_begin, this), boost::bind (&ply_to_raw_converter::vertex_end, this) ); } else if (element_name == "face") { - return boost::tuple, boost::function > ( + return boost::tuple, std::function > ( boost::bind (&ply_to_raw_converter::face_begin, this), boost::bind (&ply_to_raw_converter::face_end, this) ); @@ -188,7 +188,7 @@ ply_to_raw_converter::element_definition_callback (const std::string& element_na } } -template <> boost::function +template <> std::function ply_to_raw_converter::scalar_property_definition_callback (const std::string& element_name, const std::string& property_name) { if (element_name == "vertex") { @@ -210,16 +210,16 @@ ply_to_raw_converter::scalar_property_definition_callback (const std::string& el } } -template <> boost::tuple, - boost::function, - boost::function > +template <> boost::tuple, + std::function, + std::function > ply_to_raw_converter::list_property_definition_callback (const std::string& element_name, const std::string& property_name) { if ((element_name == "face") && (property_name == "vertex_indices")) { - return boost::tuple, - boost::function, - boost::function > ( + return boost::tuple, + std::function, + std::function > ( boost::bind (&ply_to_raw_converter::face_vertex_indices_begin, this, _1), boost::bind (&ply_to_raw_converter::face_vertex_indices_element, this, _1), boost::bind (&ply_to_raw_converter::face_vertex_indices_end, this) diff --git a/keypoints/include/pcl/keypoints/keypoint.h b/keypoints/include/pcl/keypoints/keypoint.h index 8b24101329e..ce5d3dc5417 100644 --- a/keypoints/include/pcl/keypoints/keypoint.h +++ b/keypoints/include/pcl/keypoints/keypoint.h @@ -39,10 +39,10 @@ // PCL includes #include -#include #include #include #include +#include namespace pcl { @@ -67,8 +67,8 @@ namespace pcl typedef typename PointCloudIn::Ptr PointCloudInPtr; typedef typename PointCloudIn::ConstPtr PointCloudInConstPtr; typedef pcl::PointCloud PointCloudOut; - typedef boost::function &, std::vector &)> SearchMethod; - typedef boost::function &, std::vector &)> SearchMethodSurface; + typedef std::function &, std::vector &)> SearchMethod; + typedef std::function &, std::vector &)> SearchMethodSurface; public: /** \brief Empty constructor. */ diff --git a/octree/include/pcl/octree/boost.h b/octree/include/pcl/octree/boost.h index f5cde574898..8db30618fb2 100644 --- a/octree/include/pcl/octree/boost.h +++ b/octree/include/pcl/octree/boost.h @@ -45,4 +45,3 @@ // Marking all Boost headers as system headers to remove warnings #include -#include diff --git a/octree/include/pcl/octree/octree_pointcloud_adjacency.h b/octree/include/pcl/octree/octree_pointcloud_adjacency.h index 15077fb3c7e..47ada826b39 100644 --- a/octree/include/pcl/octree/octree_pointcloud_adjacency.h +++ b/octree/include/pcl/octree/octree_pointcloud_adjacency.h @@ -154,7 +154,7 @@ namespace pcl * \param[in] transform_func A boost:function pointer to the transform to be used. The transform must have one * parameter (a point) which it modifies in place. */ void - setTransformFunction (boost::function transform_func) + setTransformFunction (std::function transform_func) { transform_func_ = transform_func; } @@ -216,7 +216,7 @@ namespace pcl /// Local leaf pointer vector used to make iterating through leaves fast. LeafVectorT leaf_vector_; - boost::function transform_func_; + std::function transform_func_; }; diff --git a/people/apps/main_ground_based_people_detection.cpp b/people/apps/main_ground_based_people_detection.cpp index e73b1096489..cc958ba0896 100644 --- a/people/apps/main_ground_based_people_detection.cpp +++ b/people/apps/main_ground_based_people_detection.cpp @@ -143,7 +143,7 @@ int main (int argc, char** argv) PointCloudT::Ptr cloud (new PointCloudT); bool new_cloud_available_flag = false; pcl::Grabber* interface = new pcl::OpenNIGrabber(); - boost::function::ConstPtr&)> f = + std::function::ConstPtr&)> f = boost::bind (&cloud_cb_, _1, cloud, &new_cloud_available_flag); interface->registerCallback (f); interface->start (); diff --git a/registration/include/pcl/registration/boost.h b/registration/include/pcl/registration/boost.h index f844ac42a6c..b5072351b1f 100644 --- a/registration/include/pcl/registration/boost.h +++ b/registration/include/pcl/registration/boost.h @@ -50,5 +50,4 @@ #include #include -#include #include diff --git a/registration/include/pcl/registration/correspondence_rejection_features.h b/registration/include/pcl/registration/correspondence_rejection_features.h index bcf55b95d61..d6f8f919da8 100644 --- a/registration/include/pcl/registration/correspondence_rejection_features.h +++ b/registration/include/pcl/registration/correspondence_rejection_features.h @@ -181,7 +181,7 @@ namespace pcl { public: typedef typename pcl::PointCloud::ConstPtr FeatureCloudConstPtr; - typedef boost::function &, int, std::vector &, + typedef std::function &, int, std::vector &, std::vector &)> SearchMethod; typedef typename pcl::PointRepresentation::ConstPtr PointRepresentationConstPtr; diff --git a/registration/include/pcl/registration/gicp.h b/registration/include/pcl/registration/gicp.h index 5299007c71d..3fd998dec20 100644 --- a/registration/include/pcl/registration/gicp.h +++ b/registration/include/pcl/registration/gicp.h @@ -354,7 +354,7 @@ namespace pcl const GeneralizedIterativeClosestPoint *gicp_; }; - boost::function &cloud_src, + std::function &cloud_src, const std::vector &src_indices, const pcl::PointCloud &cloud_tgt, const std::vector &tgt_indices, diff --git a/registration/include/pcl/registration/impl/ndt.hpp b/registration/include/pcl/registration/impl/ndt.hpp index 48dd6a9f9af..122ac7eee0a 100644 --- a/registration/include/pcl/registration/impl/ndt.hpp +++ b/registration/include/pcl/registration/impl/ndt.hpp @@ -148,7 +148,7 @@ pcl::NormalDistributionsTransform::computeTransformati p += delta_p; // Update Visualizer (untested) - if (!update_visualizer_.empty()) + if (update_visualizer_) update_visualizer_ (output, std::vector(), *target_, std::vector() ); double cos_angle = 0.5 * (transformation_.coeff (0, 0) + transformation_.coeff (1, 1) + transformation_.coeff (2, 2) - 1); diff --git a/registration/include/pcl/registration/impl/ndt_2d.hpp b/registration/include/pcl/registration/impl/ndt_2d.hpp index 3d8a7421b32..056198b1820 100644 --- a/registration/include/pcl/registration/impl/ndt_2d.hpp +++ b/registration/include/pcl/registration/impl/ndt_2d.hpp @@ -469,7 +469,7 @@ pcl::NormalDistributionsTransform2D::computeTransforma nr_iterations_++; - if (!update_visualizer_.empty()) + if (update_visualizer_) update_visualizer_ (output, *indices_, *target_, *indices_); //std::cout << "eps=" << fabs ((transformation - previous_transformation_).sum ()) << std::endl; diff --git a/registration/include/pcl/registration/registration.h b/registration/include/pcl/registration/registration.h index 5894a5229f9..6280529218b 100644 --- a/registration/include/pcl/registration/registration.h +++ b/registration/include/pcl/registration/registration.h @@ -95,6 +95,18 @@ namespace pcl typedef typename CorrespondenceEstimation::Ptr CorrespondenceEstimationPtr; typedef typename CorrespondenceEstimation::ConstPtr CorrespondenceEstimationConstPtr; + /** \brief The callback signature to the function updating intermediate source point cloud position + * during it's registration to the target point cloud. + * \param[in] cloud_src - the point cloud which will be updated to match target + * \param[in] indices_src - a selector of points in cloud_src + * \param[in] cloud_tgt - the point cloud we want to register against + * \param[in] indices_tgt - a selector of points in cloud_tgt + */ + using UpdateVisualizerCallbackSignature = void (const pcl::PointCloud&, + const std::vector&, + const pcl::PointCloud&, + const std::vector&); + /** \brief Empty constructor. */ Registration () : tree_ (new KdTree) @@ -367,10 +379,10 @@ namespace pcl * in order to update point cloud obtained after each iteration * \param[in] visualizerCallback reference of the user callback function */ - template inline bool - registerVisualizationCallback (boost::function &visualizerCallback) + inline bool + registerVisualizationCallback (std::function &visualizerCallback) { - if (!visualizerCallback.empty()) + if (visualizerCallback) { update_visualizer_ = visualizerCallback; return (true); @@ -572,10 +584,7 @@ namespace pcl /** \brief Callback function to update intermediate source point cloud position during it's registration * to the target point cloud. */ - boost::function &cloud_src, - const std::vector &indices_src, - const pcl::PointCloud &cloud_tgt, - const std::vector &indices_tgt)> update_visualizer_; + std::function update_visualizer_; /** \brief Search for the closest nearest neighbor of a given point. * \param cloud the point cloud dataset to use for nearest neighbor search diff --git a/segmentation/include/pcl/segmentation/conditional_euclidean_clustering.h b/segmentation/include/pcl/segmentation/conditional_euclidean_clustering.h index d1904322481..4823e5f5efc 100644 --- a/segmentation/include/pcl/segmentation/conditional_euclidean_clustering.h +++ b/segmentation/include/pcl/segmentation/conditional_euclidean_clustering.h @@ -37,11 +37,11 @@ #pragma once -#include - #include #include +#include + namespace pcl { typedef std::vector IndicesClusters; @@ -148,7 +148,7 @@ namespace pcl /** \brief Set the condition that needs to hold for neighboring points to be considered part of the same cluster. * This is an overloaded function provided for convenience. See the documentation for setConditionFunction(). */ inline void - setConditionFunction (boost::function condition_function) + setConditionFunction (std::function condition_function) { condition_function_ = condition_function; } @@ -237,7 +237,7 @@ namespace pcl SearcherPtr searcher_; /** \brief The condition function that needs to hold for clustering */ - boost::function condition_function_; + std::function condition_function_; /** \brief The distance to scan for cluster candidates (default = 0.0) */ float cluster_tolerance_; diff --git a/surface/include/pcl/surface/boost.h b/surface/include/pcl/surface/boost.h index 0bd171a70ea..75146e11fd2 100644 --- a/surface/include/pcl/surface/boost.h +++ b/surface/include/pcl/surface/boost.h @@ -44,6 +44,5 @@ #endif #include -#include #include #include diff --git a/surface/include/pcl/surface/impl/mls.hpp b/surface/include/pcl/surface/impl/mls.hpp index 368690f0aba..d26b9f47ac4 100644 --- a/surface/include/pcl/surface/impl/mls.hpp +++ b/surface/include/pcl/surface/impl/mls.hpp @@ -719,7 +719,7 @@ pcl::MLSResult::computeMLSSurface (const pcl::PointCloud &cloud, const std::vector &nn_indices, double search_radius, int polynomial_order, - boost::function weight_func) + std::function weight_func) { // Compute the plane coefficients EIGEN_ALIGN16 Eigen::Matrix3d covariance_matrix; @@ -777,7 +777,7 @@ pcl::MLSResult::computeMLSSurface (const pcl::PointCloud &cloud, { // Note: The max_sq_radius parameter is only used if weight_func was not defined double max_sq_radius = 1; - if (weight_func.empty()) + if (!weight_func) { max_sq_radius = search_radius * search_radius; weight_func = boost::bind (&pcl::MLSResult::computeMLSWeight, this, _1, max_sq_radius); diff --git a/surface/include/pcl/surface/mls.h b/surface/include/pcl/surface/mls.h index c33781570ed..7cd7a760bcb 100644 --- a/surface/include/pcl/surface/mls.h +++ b/surface/include/pcl/surface/mls.h @@ -39,11 +39,10 @@ #pragma once +#include #include #include -#include - // PCL includes #include #include @@ -210,7 +209,7 @@ namespace pcl const std::vector &nn_indices, double search_radius, int polynomial_order = 2, - boost::function weight_func = {}); + std::function weight_func = {}); Eigen::Vector3d query_point; /**< \brief The query point about which the mls surface was generated */ Eigen::Vector3d mean; /**< \brief The mean point of all the neighbors. */ @@ -274,7 +273,7 @@ namespace pcl typedef typename PointCloudIn::Ptr PointCloudInPtr; typedef typename PointCloudIn::ConstPtr PointCloudInConstPtr; - typedef boost::function &, std::vector &)> SearchMethod; + typedef std::function &, std::vector &)> SearchMethod; enum UpsamplingMethod { diff --git a/test/io/test_grabbers.cpp b/test/io/test_grabbers.cpp index de1250d5246..c1e74d366ce 100644 --- a/test/io/test_grabbers.cpp +++ b/test/io/test_grabbers.cpp @@ -45,7 +45,7 @@ TEST (PCL, PCDGrabber) pcl::PCDGrabber grabber (pcd_files_, 10, false); // TODO add directory functionality EXPECT_EQ (grabber.size (), pcds_.size ()); vector grabbed_clouds; - boost::function::ConstPtr&)> + std::function::ConstPtr&)> fxn = boost::bind (cloud_callback_vector, &grabbed_clouds, _1); grabber.registerCallback (fxn); grabber.start (); @@ -116,7 +116,7 @@ TEST (PCL, ImageGrabberTIFF) vector tiff_clouds; CloudT::ConstPtr cloud_buffer; bool signal_received = false; - boost::function::ConstPtr&)> + std::function::ConstPtr&)> fxn = boost::bind (cloud_callback, &signal_received, &cloud_buffer, _1); grabber.registerCallback (fxn); grabber.setCameraIntrinsics (525., 525., 320., 240.); // Setting old intrinsics which were used to generate these tests @@ -199,7 +199,7 @@ TEST (PCL, ImageGrabberPCLZF) vector pclzf_clouds; CloudT::ConstPtr cloud_buffer; bool signal_received = false; - boost::function::ConstPtr&)> + std::function::ConstPtr&)> fxn = boost::bind (cloud_callback, &signal_received, &cloud_buffer, _1); grabber.registerCallback (fxn); grabber.start (); @@ -278,7 +278,7 @@ TEST (PCL, ImageGrabberOMP) vector pclzf_clouds; CloudT::ConstPtr cloud_buffer; bool signal_received = false; - boost::function::ConstPtr&)> + std::function::ConstPtr&)> fxn = boost::bind (cloud_callback, &signal_received, &cloud_buffer, _1); grabber.registerCallback (fxn); grabber.setNumberOfThreads (0); // Let OMP select @@ -371,7 +371,7 @@ TEST (PCL, ImageGrabberSetIntrinsicsTIFF) vector tiff_clouds; CloudT::ConstPtr cloud_buffer; bool signal_received = false; - boost::function::ConstPtr&)> + std::function::ConstPtr&)> fxn = boost::bind (cloud_callback, &signal_received, &cloud_buffer, _1); grabber.registerCallback (fxn); grabber.start (); @@ -449,7 +449,7 @@ TEST (PCL, ImageGrabberSetIntrinsicsPCLZF) vector pclzf_clouds; CloudT::ConstPtr cloud_buffer; bool signal_received = false; - boost::function::ConstPtr&)> + std::function::ConstPtr&)> fxn = boost::bind (cloud_callback, &signal_received, &cloud_buffer, _1); grabber.registerCallback (fxn); grabber.start (); diff --git a/tools/davidsdk_viewer.cpp b/tools/davidsdk_viewer.cpp index fd678b108b8..fec5b5e9ef1 100644 --- a/tools/davidsdk_viewer.cpp +++ b/tools/davidsdk_viewer.cpp @@ -93,7 +93,7 @@ main (int argc, //davidsdk_ptr->setFileFormatToPLY(); std::cout << "Using " << davidsdk_ptr->getFileFormat () << " file format" << std::endl; - boost::function f = boost::bind (&grabberCallback, _1); davidsdk_ptr->registerCallback (f); davidsdk_ptr->start (); diff --git a/tools/depth_sense_viewer.cpp b/tools/depth_sense_viewer.cpp index 4187a03d6ed..153e326ff0f 100644 --- a/tools/depth_sense_viewer.cpp +++ b/tools/depth_sense_viewer.cpp @@ -140,7 +140,7 @@ class DepthSenseViewer void run () { - boost::function f = boost::bind (&DepthSenseViewer::cloudCallback, this, _1); + std::function f = boost::bind (&DepthSenseViewer::cloudCallback, this, _1); connection_ = grabber_.registerCallback (f); grabber_.start (); while (!viewer_.wasStopped ()) diff --git a/tools/ensenso_viewer.cpp b/tools/ensenso_viewer.cpp index 2733dc2825f..5e42a690f09 100644 --- a/tools/ensenso_viewer.cpp +++ b/tools/ensenso_viewer.cpp @@ -76,7 +76,7 @@ main (void) ensenso_ptr->openTcpPort (); ensenso_ptr->openDevice (); - boost::function f = boost::bind (&grabberCallback, _1); ensenso_ptr->registerCallback (f); ensenso_ptr->start (); diff --git a/tools/hdl_viewer_simple.cpp b/tools/hdl_viewer_simple.cpp index 084baed0d30..946b47e907e 100644 --- a/tools/hdl_viewer_simple.cpp +++ b/tools/hdl_viewer_simple.cpp @@ -147,11 +147,8 @@ class SimpleHDLViewer cloud_viewer_->initCameraParameters (); cloud_viewer_->setCameraPosition (0.0, 0.0, 30.0, 0.0, 1.0, 0.0, 0); cloud_viewer_->setCameraClipDistances (0.0, 50.0); - //cloud_viewer_->registerMouseCallback(&SimpleHDLViewer::mouse_callback, *this); - //cloud_viewer_->registerKeyboardCallback (&SimpleHDLViewer::keyboard_callback, *this); - //boost::function cloud_cb = boost::bind(&SimpleHDLViewer::cloud_callback, this, _1, _2, _3); - boost::function cloud_cb = boost::bind ( + std::function cloud_cb = boost::bind ( &SimpleHDLViewer::cloud_callback, this, _1); boost::signals2::connection cloud_connection = grabber_.registerCallback ( cloud_cb); diff --git a/tools/image_grabber_saver.cpp b/tools/image_grabber_saver.cpp index 12f36d16f9c..cf0d4d380ca 100644 --- a/tools/image_grabber_saver.cpp +++ b/tools/image_grabber_saver.cpp @@ -133,7 +133,7 @@ main (int argc, char** argv) //grabber->setFocalLength(focal_length); // FIXME EventHelper h; - boost::function::ConstPtr&) > f = boost::bind (&EventHelper::cloud_cb, &h, _1); + std::function::ConstPtr&) > f = boost::bind (&EventHelper::cloud_cb, &h, _1); boost::signals2::connection c1 = grabber->registerCallback (f); do diff --git a/tools/image_grabber_viewer.cpp b/tools/image_grabber_viewer.cpp index 71c19bfb8b9..2ba98e5c230 100644 --- a/tools/image_grabber_viewer.cpp +++ b/tools/image_grabber_viewer.cpp @@ -222,7 +222,7 @@ main (int argc, char** argv) EventHelper h; - boost::function::ConstPtr&) > f = boost::bind (&EventHelper::cloud_cb, &h, _1); + std::function::ConstPtr&) > f = boost::bind (&EventHelper::cloud_cb, &h, _1); boost::signals2::connection c1 = grabber->registerCallback (f); std::string mouse_msg_3D ("Mouse coordinates in PCL Visualizer"); diff --git a/tools/oni2pcd.cpp b/tools/oni2pcd.cpp index d6d133f0a99..bb3fbd82b06 100644 --- a/tools/oni2pcd.cpp +++ b/tools/oni2pcd.cpp @@ -83,7 +83,7 @@ main (int argc, char **argv) } pcl::ONIGrabber* grabber = new pcl::ONIGrabber (argv[1], false, false); - boost::function f = boost::bind (&cloud_cb, _1); + std::function f = boost::bind (&cloud_cb, _1); boost::signals2::connection c = grabber->registerCallback (f); while (grabber->hasDataLeft ()) diff --git a/tools/oni_viewer_simple.cpp b/tools/oni_viewer_simple.cpp index 39855e5c443..ab8c6e114a4 100644 --- a/tools/oni_viewer_simple.cpp +++ b/tools/oni_viewer_simple.cpp @@ -122,7 +122,7 @@ class SimpleONIViewer { //pcl::Grabber* interface = new pcl::OpenNIGrabber(device_id_, pcl::OpenNIGrabber::OpenNI_QQVGA_30Hz, pcl::OpenNIGrabber::OpenNI_VGA_30Hz); - boost::function f = boost::bind (&SimpleONIViewer::cloud_cb_, this, _1); + std::function f = boost::bind (&SimpleONIViewer::cloud_cb_, this, _1); boost::signals2::connection c = grabber_.registerCallback (f); diff --git a/tools/openni2_viewer.cpp b/tools/openni2_viewer.cpp index eb62b7eaeda..e088e587d65 100644 --- a/tools/openni2_viewer.cpp +++ b/tools/openni2_viewer.cpp @@ -177,7 +177,7 @@ class OpenNI2Viewer cloud_viewer_->registerMouseCallback (&OpenNI2Viewer::mouse_callback, *this); cloud_viewer_->registerKeyboardCallback (&OpenNI2Viewer::keyboard_callback, *this); cloud_viewer_->setCameraFieldOfView (1.02259994f); - boost::function cloud_cb = boost::bind (&OpenNI2Viewer::cloud_callback, this, _1); + std::function cloud_cb = boost::bind (&OpenNI2Viewer::cloud_callback, this, _1); boost::signals2::connection cloud_connection = grabber_.registerCallback (cloud_cb); boost::signals2::connection image_connection; @@ -186,7 +186,7 @@ class OpenNI2Viewer image_viewer_.reset (new pcl::visualization::ImageViewer ("PCL OpenNI image")); image_viewer_->registerMouseCallback (&OpenNI2Viewer::mouse_callback, *this); image_viewer_->registerKeyboardCallback (&OpenNI2Viewer::keyboard_callback, *this); - boost::function&) > image_cb = boost::bind (&OpenNI2Viewer::image_callback, this, _1); + std::function&) > image_cb = boost::bind (&OpenNI2Viewer::image_callback, this, _1); image_connection = grabber_.registerCallback (image_cb); } diff --git a/tools/openni_image.cpp b/tools/openni_image.cpp index 5966d555d8e..6062133a5ba 100644 --- a/tools/openni_image.cpp +++ b/tools/openni_image.cpp @@ -414,7 +414,7 @@ class Driver void grabAndSend () { - boost::function&, const boost::shared_ptr&, float) > image_cb = boost::bind (&Driver::image_callback, this, _1, _2, _3); + std::function&, const boost::shared_ptr&, float) > image_cb = boost::bind (&Driver::image_callback, this, _1, _2, _3); boost::signals2::connection image_connection = grabber_.registerCallback (image_cb); grabber_.start (); diff --git a/tools/openni_save_image.cpp b/tools/openni_save_image.cpp index 4e44ef74531..bfd7d24fcf8 100644 --- a/tools/openni_save_image.cpp +++ b/tools/openni_save_image.cpp @@ -104,7 +104,7 @@ class SimpleOpenNIViewer void run () { - boost::function image_cb = boost::bind (&SimpleOpenNIViewer::image_callback, this, _1, _2, _3); + std::function image_cb = boost::bind (&SimpleOpenNIViewer::image_callback, this, _1, _2, _3); boost::signals2::connection image_connection = grabber_.registerCallback (image_cb); grabber_.start (); diff --git a/tools/openni_viewer.cpp b/tools/openni_viewer.cpp index f7a6d2b1189..2ea7b8682d4 100644 --- a/tools/openni_viewer.cpp +++ b/tools/openni_viewer.cpp @@ -174,7 +174,7 @@ class OpenNIViewer { cloud_viewer_->registerMouseCallback (&OpenNIViewer::mouse_callback, *this); cloud_viewer_->registerKeyboardCallback(&OpenNIViewer::keyboard_callback, *this); - boost::function cloud_cb = boost::bind (&OpenNIViewer::cloud_callback, this, _1); + std::function cloud_cb = boost::bind (&OpenNIViewer::cloud_callback, this, _1); boost::signals2::connection cloud_connection = grabber_.registerCallback (cloud_cb); boost::signals2::connection image_connection; @@ -183,7 +183,7 @@ class OpenNIViewer image_viewer_.reset (new pcl::visualization::ImageViewer ("PCL OpenNI image")); image_viewer_->registerMouseCallback (&OpenNIViewer::mouse_callback, *this); image_viewer_->registerKeyboardCallback(&OpenNIViewer::keyboard_callback, *this); - boost::function&) > image_cb = boost::bind (&OpenNIViewer::image_callback, this, _1); + std::function&) > image_cb = boost::bind (&OpenNIViewer::image_callback, this, _1); image_connection = grabber_.registerCallback (image_cb); } diff --git a/tools/openni_viewer_simple.cpp b/tools/openni_viewer_simple.cpp index 57a89d2ca95..1bf5e1beb7f 100644 --- a/tools/openni_viewer_simple.cpp +++ b/tools/openni_viewer_simple.cpp @@ -172,7 +172,7 @@ class SimpleOpenNIViewer string keyMsg3D("Key event for PCL Visualizer"); cloud_viewer_.registerMouseCallback (&SimpleOpenNIViewer::mouse_callback, *this, (void*)(&mouseMsg3D)); cloud_viewer_.registerKeyboardCallback(&SimpleOpenNIViewer::keyboard_callback, *this, (void*)(&keyMsg3D)); - boost::function cloud_cb = boost::bind (&SimpleOpenNIViewer::cloud_callback, this, _1); + std::function cloud_cb = boost::bind (&SimpleOpenNIViewer::cloud_callback, this, _1); boost::signals2::connection cloud_connection = grabber_.registerCallback (cloud_cb); boost::signals2::connection image_connection; @@ -182,7 +182,7 @@ class SimpleOpenNIViewer string keyMsg2D("Key event for image viewer"); image_viewer_.registerMouseCallback (&SimpleOpenNIViewer::mouse_callback, *this, (void*)(&mouseMsg2D)); image_viewer_.registerKeyboardCallback(&SimpleOpenNIViewer::keyboard_callback, *this, (void*)(&keyMsg2D)); - boost::function&) > image_cb = boost::bind (&SimpleOpenNIViewer::image_callback, this, _1); + std::function&) > image_cb = boost::bind (&SimpleOpenNIViewer::image_callback, this, _1); image_connection = grabber_.registerCallback (image_cb); } unsigned char* rgb_data = 0; diff --git a/tools/pcd_grabber_viewer.cpp b/tools/pcd_grabber_viewer.cpp index 3a3eb30c4a7..efd9694f473 100644 --- a/tools/pcd_grabber_viewer.cpp +++ b/tools/pcd_grabber_viewer.cpp @@ -211,7 +211,7 @@ main (int argc, char** argv) } EventHelper h; - boost::function::ConstPtr&) > f = boost::bind (&EventHelper::cloud_cb, &h, _1); + std::function::ConstPtr&) > f = boost::bind (&EventHelper::cloud_cb, &h, _1); boost::signals2::connection c1 = grabber->registerCallback (f); std::string mouse_msg_3D ("Mouse coordinates in PCL Visualizer"); diff --git a/tools/pcl_video.cpp b/tools/pcl_video.cpp index aaf4e1c3e83..10bdc8fedbd 100644 --- a/tools/pcl_video.cpp +++ b/tools/pcl_video.cpp @@ -191,7 +191,7 @@ class Recorder // Set up a callback to get clouds from a grabber and write them to the // file. pcl::Grabber* interface(new pcl::OpenNIGrabber()); - boost::function::ConstPtr&)> f( + std::function::ConstPtr&)> f( boost::bind(&Recorder::Callback, this, _1)); interface->registerCallback(f); // Start the first cluster diff --git a/tools/real_sense_viewer.cpp b/tools/real_sense_viewer.cpp index d9df8e8c1d2..47509b8fc57 100644 --- a/tools/real_sense_viewer.cpp +++ b/tools/real_sense_viewer.cpp @@ -170,7 +170,7 @@ class RealSenseViewer void run () { - boost::function f = boost::bind (&RealSenseViewer::cloudCallback, this, _1); + std::function f = boost::bind (&RealSenseViewer::cloudCallback, this, _1); connection_ = grabber_.registerCallback (f); grabber_.start (); printMode (grabber_.getMode ()); diff --git a/tools/vlp_viewer.cpp b/tools/vlp_viewer.cpp index c2e4152d4dd..c51070d604e 100644 --- a/tools/vlp_viewer.cpp +++ b/tools/vlp_viewer.cpp @@ -160,7 +160,7 @@ class SimpleVLPViewer cloud_viewer_->setCameraClipDistances (0.0, 50.0); cloud_viewer_->registerKeyboardCallback (&SimpleVLPViewer::keyboard_callback, *this); - boost::function cloud_cb = boost::bind (&SimpleVLPViewer::cloud_callback, this, _1); boost::signals2::connection cloud_connection = grabber_.registerCallback (cloud_cb); diff --git a/visualization/include/pcl/visualization/boost.h b/visualization/include/pcl/visualization/boost.h index 89990b55bb6..2c589bc44c8 100644 --- a/visualization/include/pcl/visualization/boost.h +++ b/visualization/include/pcl/visualization/boost.h @@ -45,7 +45,6 @@ //https://bugreports.qt-project.org/browse/QTBUG-22829 #ifndef Q_MOC_RUN -#include #include #define BOOST_PARAMETER_MAX_ARITY 7 #include diff --git a/visualization/include/pcl/visualization/cloud_viewer.h b/visualization/include/pcl/visualization/cloud_viewer.h index 04878d5878a..aea76dfb3bd 100644 --- a/visualization/include/pcl/visualization/cloud_viewer.h +++ b/visualization/include/pcl/visualization/cloud_viewer.h @@ -109,7 +109,7 @@ namespace pcl /** Visualization callable function, may be used for running things on the UI thread. */ - typedef boost::function1 VizCallable; + typedef std::function VizCallable; /** \brief Run a callbable object on the UI thread. Will persist until removed * @param x Use boost::ref(x) for a function object that you would like to not copy @@ -206,13 +206,13 @@ namespace pcl boost::scoped_ptr impl_; boost::signals2::connection - registerMouseCallback (boost::function); + registerMouseCallback (std::function); boost::signals2::connection - registerKeyboardCallback (boost::function); + registerKeyboardCallback (std::function); boost::signals2::connection - registerPointPickingCallback (boost::function); + registerPointPickingCallback (std::function); }; } } diff --git a/visualization/include/pcl/visualization/image_viewer.h b/visualization/include/pcl/visualization/image_viewer.h index d8ad61a08bb..f139ac90ad8 100644 --- a/visualization/include/pcl/visualization/image_viewer.h +++ b/visualization/include/pcl/visualization/image_viewer.h @@ -495,14 +495,14 @@ namespace pcl return (registerKeyboardCallback (boost::bind (callback, boost::ref (instance), _1, cookie))); } - /** \brief Register a callback boost::function for keyboard events + /** \brief Register a callback std::function for keyboard events * \param[in] cb the boost function that will be registered as a callback for a keyboard event * \return a connection object that allows to disconnect the callback function. */ boost::signals2::connection - registerKeyboardCallback (boost::function cb); + registerKeyboardCallback (std::function cb); - /** \brief Register a callback boost::function for mouse events + /** \brief Register a callback std::function for mouse events * \param[in] callback the function that will be registered as a callback for a mouse event * \param[in] cookie user data that is passed to the callback * \return a connection object that allows to disconnect the callback function. @@ -532,7 +532,7 @@ namespace pcl * \return a connection object that allows to disconnect the callback function. */ boost::signals2::connection - registerMouseCallback (boost::function cb); + registerMouseCallback (std::function cb); /** \brief Set the position in screen coordinates. * \param[in] x where to move the window to (X) diff --git a/visualization/include/pcl/visualization/interactor_style.h b/visualization/include/pcl/visualization/interactor_style.h index b85b294b064..6f834f2623a 100644 --- a/visualization/include/pcl/visualization/interactor_style.h +++ b/visualization/include/pcl/visualization/interactor_style.h @@ -165,32 +165,32 @@ namespace pcl setUseVbos (const bool use_vbos) { use_vbos_ = use_vbos; } /** \brief Register a callback function for mouse events - * \param[in] cb a boost function that will be registered as a callback for a mouse event + * \param[in] cb a std function that will be registered as a callback for a mouse event * \return a connection object that allows to disconnect the callback function. */ boost::signals2::connection - registerMouseCallback (boost::function cb); + registerMouseCallback (std::function cb); - /** \brief Register a callback boost::function for keyboard events - * \param[in] cb a boost function that will be registered as a callback for a keyboard event + /** \brief Register a callback std::function for keyboard events + * \param[in] cb a std function that will be registered as a callback for a keyboard event * \return a connection object that allows to disconnect the callback function. */ boost::signals2::connection - registerKeyboardCallback (boost::function cb); + registerKeyboardCallback (std::function cb); /** \brief Register a callback function for point picking events - * \param[in] cb a boost function that will be registered as a callback for a point picking event + * \param[in] cb a std function that will be registered as a callback for a point picking event * \return a connection object that allows to disconnect the callback function. */ boost::signals2::connection - registerPointPickingCallback (boost::function cb); + registerPointPickingCallback (std::function cb); /** \brief Register a callback function for area picking events - * \param[in] cb a boost function that will be registered as a callback for a area picking event + * \param[in] cb a std function that will be registered as a callback for a area picking event * \return a connection object that allows to disconnect the callback function. */ boost::signals2::connection - registerAreaPickingCallback (boost::function cb); + registerAreaPickingCallback (std::function cb); /** \brief Save the current rendered image to disk, as a PNG screenshot. * \param[in] file the name of the PNG file diff --git a/visualization/include/pcl/visualization/pcl_visualizer.h b/visualization/include/pcl/visualization/pcl_visualizer.h index 59df5feb714..0fecde19c7d 100644 --- a/visualization/include/pcl/visualization/pcl_visualizer.h +++ b/visualization/include/pcl/visualization/pcl_visualizer.h @@ -159,12 +159,12 @@ namespace pcl void setWindowBorders (bool mode); - /** \brief Register a callback boost::function for keyboard events - * \param[in] cb a boost function that will be registered as a callback for a keyboard event + /** \brief Register a callback std::function for keyboard events + * \param[in] cb a std function that will be registered as a callback for a keyboard event * \return a connection object that allows to disconnect the callback function. */ boost::signals2::connection - registerKeyboardCallback (boost::function cb); + registerKeyboardCallback (std::function cb); /** \brief Register a callback function for keyboard events * \param[in] callback the function that will be registered as a callback for a keyboard event @@ -190,11 +190,11 @@ namespace pcl } /** \brief Register a callback function for mouse events - * \param[in] cb a boost function that will be registered as a callback for a mouse event + * \param[in] cb a std function that will be registered as a callback for a mouse event * \return a connection object that allows to disconnect the callback function. */ boost::signals2::connection - registerMouseCallback (boost::function cb); + registerMouseCallback (std::function cb); /** \brief Register a callback function for mouse events * \param[in] callback the function that will be registered as a callback for a mouse event @@ -220,11 +220,11 @@ namespace pcl } /** \brief Register a callback function for point picking events - * \param[in] cb a boost function that will be registered as a callback for a point picking event + * \param[in] cb a std function that will be registered as a callback for a point picking event * \return a connection object that allows to disconnect the callback function. */ boost::signals2::connection - registerPointPickingCallback (boost::function cb); + registerPointPickingCallback (std::function cb); /** \brief Register a callback function for point picking events * \param[in] callback the function that will be registered as a callback for a point picking event @@ -247,11 +247,11 @@ namespace pcl } /** \brief Register a callback function for area picking events - * \param[in] cb a boost function that will be registered as a callback for an area picking event + * \param[in] cb a std function that will be registered as a callback for an area picking event * \return a connection object that allows to disconnect the callback function. */ boost::signals2::connection - registerAreaPickingCallback (boost::function cb); + registerAreaPickingCallback (std::function cb); /** \brief Register a callback function for area picking events * \param[in] callback the function that will be registered as a callback for an area picking event diff --git a/visualization/include/pcl/visualization/registration_visualizer.h b/visualization/include/pcl/visualization/registration_visualizer.h index fd5c0415b62..708abad3541 100644 --- a/visualization/include/pcl/visualization/registration_visualizer.h +++ b/visualization/include/pcl/visualization/registration_visualizer.h @@ -170,7 +170,7 @@ namespace pcl std::string registration_method_name_; /** \brief Callback function linked to pcl::Registration::update_visualizer_ */ - boost::function &cloud_src, const std::vector &indices_src, const pcl::PointCloud< PointTarget> &cloud_tgt, const std::vector &indices_tgt)> update_visualizer_; diff --git a/visualization/include/pcl/visualization/window.h b/visualization/include/pcl/visualization/window.h index 74768b465e5..e5515c6cbf6 100644 --- a/visualization/include/pcl/visualization/window.h +++ b/visualization/include/pcl/visualization/window.h @@ -147,17 +147,17 @@ namespace pcl * @brief registering a callback function for mouse events * @return connection object that allows to disconnect the callback function. */ - // param the boost function that will be registered as a callback for a mouse event + // param the std function that will be registered as a callback for a mouse event boost::signals2::connection - registerMouseCallback (boost::function ); + registerMouseCallback (std::function ); /** - * @brief registering a callback boost::function for keyboard events + * @brief registering a callback std::function for keyboard events * @return connection object that allows to disconnect the callback function. */ - // param the boost function that will be registered as a callback for a keyboard event + // param the std function that will be registered as a callback for a keyboard event boost::signals2::connection - registerKeyboardCallback (boost::function ); + registerKeyboardCallback (std::function ); void emitMouseEvent (unsigned long event_id); diff --git a/visualization/src/cloud_viewer.cpp b/visualization/src/cloud_viewer.cpp index b465c8c5e58..f8904cfe4a3 100644 --- a/visualization/src/cloud_viewer.cpp +++ b/visualization/src/cloud_viewer.cpp @@ -341,21 +341,21 @@ pcl::visualization::CloudViewer::wasStopped (int) ///////////////////////////////////////////////////////////////////////////////////////////// boost::signals2::connection -pcl::visualization::CloudViewer::registerKeyboardCallback (boost::function callback) +pcl::visualization::CloudViewer::registerKeyboardCallback (std::function callback) { return impl_->viewer_->registerKeyboardCallback (callback); } ///////////////////////////////////////////////////////////////////////////////////////////// boost::signals2::connection -pcl::visualization::CloudViewer::registerMouseCallback (boost::function callback) +pcl::visualization::CloudViewer::registerMouseCallback (std::function callback) { return impl_->viewer_->registerMouseCallback (callback); } ///////////////////////////////////////////////////////////////////////////////////////////// boost::signals2::connection -pcl::visualization::CloudViewer::registerPointPickingCallback (boost::function callback) +pcl::visualization::CloudViewer::registerPointPickingCallback (std::function callback) { return (impl_->viewer_->registerPointPickingCallback (callback)); } diff --git a/visualization/src/image_viewer.cpp b/visualization/src/image_viewer.cpp index b51c292303d..92b94b7ca26 100644 --- a/visualization/src/image_viewer.cpp +++ b/visualization/src/image_viewer.cpp @@ -388,7 +388,7 @@ pcl::visualization::ImageViewer::spinOnce (int time, bool force_redraw) ////////////////////////////////////////////////////////////////////////////////////////// boost::signals2::connection pcl::visualization::ImageViewer::registerMouseCallback ( - boost::function callback) + std::function callback) { // just add observer at first time when a callback is registered if (mouse_signal_.empty ()) @@ -409,7 +409,7 @@ pcl::visualization::ImageViewer::registerMouseCallback ( ////////////////////////////////////////////////////////////////////////////////////////// boost::signals2::connection pcl::visualization::ImageViewer::registerKeyboardCallback ( - boost::function callback) + std::function callback) { // just add observer at first time when a callback is registered if (keyboard_signal_.empty ()) diff --git a/visualization/src/interactor_style.cpp b/visualization/src/interactor_style.cpp index 331605d1b1a..d8313bbabeb 100644 --- a/visualization/src/interactor_style.cpp +++ b/visualization/src/interactor_style.cpp @@ -483,28 +483,28 @@ pcl::visualization::PCLVisualizerInteractorStyle::OnChar () ////////////////////////////////////////////////////////////////////////////////////////////// boost::signals2::connection -pcl::visualization::PCLVisualizerInteractorStyle::registerMouseCallback (boost::function callback) +pcl::visualization::PCLVisualizerInteractorStyle::registerMouseCallback (std::function callback) { return (mouse_signal_.connect (callback)); } ////////////////////////////////////////////////////////////////////////////////////////////// boost::signals2::connection -pcl::visualization::PCLVisualizerInteractorStyle::registerKeyboardCallback (boost::function callback) +pcl::visualization::PCLVisualizerInteractorStyle::registerKeyboardCallback (std::function callback) { return (keyboard_signal_.connect (callback)); } ////////////////////////////////////////////////////////////////////////////////////////////// boost::signals2::connection -pcl::visualization::PCLVisualizerInteractorStyle::registerPointPickingCallback (boost::function callback) +pcl::visualization::PCLVisualizerInteractorStyle::registerPointPickingCallback (std::function callback) { return (point_picking_signal_.connect (callback)); } ////////////////////////////////////////////////////////////////////////////////////////////// boost::signals2::connection -pcl::visualization::PCLVisualizerInteractorStyle::registerAreaPickingCallback (boost::function callback) +pcl::visualization::PCLVisualizerInteractorStyle::registerAreaPickingCallback (std::function callback) { return (area_picking_signal_.connect (callback)); } diff --git a/visualization/src/pcl_visualizer.cpp b/visualization/src/pcl_visualizer.cpp index 236b1cf7ee7..4a48e300c8e 100644 --- a/visualization/src/pcl_visualizer.cpp +++ b/visualization/src/pcl_visualizer.cpp @@ -464,21 +464,21 @@ pcl::visualization::PCLVisualizer::getCameraParameters (pcl::visualization::Came ///////////////////////////////////////////////////////////////////////////////////////////// boost::signals2::connection -pcl::visualization::PCLVisualizer::registerKeyboardCallback (boost::function callback) +pcl::visualization::PCLVisualizer::registerKeyboardCallback (std::function callback) { return (style_->registerKeyboardCallback (callback)); } ///////////////////////////////////////////////////////////////////////////////////////////// boost::signals2::connection -pcl::visualization::PCLVisualizer::registerMouseCallback (boost::function callback) +pcl::visualization::PCLVisualizer::registerMouseCallback (std::function callback) { return (style_->registerMouseCallback (callback)); } ///////////////////////////////////////////////////////////////////////////////////////////// boost::signals2::connection -pcl::visualization::PCLVisualizer::registerPointPickingCallback (boost::function callback) +pcl::visualization::PCLVisualizer::registerPointPickingCallback (std::function callback) { return (style_->registerPointPickingCallback (callback)); } @@ -492,7 +492,7 @@ pcl::visualization::PCLVisualizer::registerPointPickingCallback (void (*callback ///////////////////////////////////////////////////////////////////////////////////////////// boost::signals2::connection -pcl::visualization::PCLVisualizer::registerAreaPickingCallback (boost::function callback) +pcl::visualization::PCLVisualizer::registerAreaPickingCallback (std::function callback) { return (style_->registerAreaPickingCallback (callback)); } diff --git a/visualization/src/window.cpp b/visualization/src/window.cpp index 01bde6b8656..5d886ed2419 100644 --- a/visualization/src/window.cpp +++ b/visualization/src/window.cpp @@ -190,7 +190,7 @@ pcl::visualization::Window::spinOnce (int time, bool force_redraw) ///////////////////////////////////////////////////////////////////////////////////////////// boost::signals2::connection -pcl::visualization::Window::registerMouseCallback (boost::function callback) +pcl::visualization::Window::registerMouseCallback (std::function callback) { // just add observer at first time when a callback is registered if (mouse_signal_.empty ()) @@ -210,7 +210,7 @@ pcl::visualization::Window::registerMouseCallback (boost::function callback) +pcl::visualization::Window::registerKeyboardCallback (std::function callback) { // just add observer at first time when a callback is registered if (keyboard_signal_.empty ())