From 3ec753e9ea64315dfe2d4498e16f1023ef20bc37 Mon Sep 17 00:00:00 2001 From: Heiko Thiel Date: Thu, 4 Apr 2019 14:07:13 +0200 Subject: [PATCH 1/3] Remove BOOST_FILESYSTEM_VERSION switch, because v3 is currently the only supported version by Boost (v2 isn't supported anymore since Boost 1.48) --- .../3d_rec_framework/pc_source/mesh_source.h | 8 ------ .../pc_source/registered_views_source.h | 27 ------------------- .../apps/3d_rec_framework/pc_source/source.h | 12 --------- .../pipeline/impl/global_nn_classifier.hpp | 4 --- .../impl/global_nn_recognizer_crh.hpp | 4 --- .../impl/global_nn_recognizer_cvfh.hpp | 4 --- .../pipeline/impl/local_recognizer.hpp | 4 --- .../tools/local_recognition_mian_dataset.cpp | 27 ------------------- .../face_detection_apps_utils.h | 10 ------- apps/src/openni_grab_frame.cpp | 8 ------ .../iccv2011/src/build_all_object_models.cpp | 12 --------- .../iros2011/src/build_all_object_models.cpp | 12 --------- gpu/kinfu/tools/kinfu_app.cpp | 4 --- gpu/kinfu_large_scale/tools/kinfuLS_app.cpp | 4 --- io/src/image_grabber.cpp | 24 ----------------- .../face_detector_data_provider.h | 15 ----------- test/io/test_grabbers.cpp | 9 ------- visualization/tools/pcd_grabber_viewer.cpp | 9 ------- 18 files changed, 197 deletions(-) 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 61ad732e671..51b2dca1d9b 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 @@ -114,11 +114,7 @@ namespace pcl std::vector < std::string > strs; std::vector < std::string > strs_; -#if BOOST_FILESYSTEM_VERSION == 3 std::string file = (itr->path ().filename ()).string(); -#else - std::string file = (itr->path ()).filename (); -#endif boost::split (strs, file, boost::is_any_of (".")); boost::split (strs_, file, boost::is_any_of ("_")); @@ -127,11 +123,7 @@ namespace pcl if (extension == "pcd" && strs_[0] == "view") { -#if BOOST_FILESYSTEM_VERSION == 3 view_filenames.push_back ((itr->path ().filename ()).string()); -#else - view_filenames.push_back ((itr->path ()).filename ()); -#endif number_of_views++; } diff --git a/apps/3d_rec_framework/include/pcl/apps/3d_rec_framework/pc_source/registered_views_source.h b/apps/3d_rec_framework/include/pcl/apps/3d_rec_framework/pc_source/registered_views_source.h index 96cacab6fe6..ac06ed1db22 100644 --- a/apps/3d_rec_framework/include/pcl/apps/3d_rec_framework/pc_source/registered_views_source.h +++ b/apps/3d_rec_framework/include/pcl/apps/3d_rec_framework/pc_source/registered_views_source.h @@ -73,11 +73,7 @@ namespace pcl std::vector < std::string > strs; std::vector < std::string > strs_; -#if BOOST_FILESYSTEM_VERSION == 3 std::string file = (itr->path ().filename ()).string(); -#else - std::string file = (itr->path ()).filename (); -#endif boost::split (strs, file, boost::is_any_of (".")); boost::split (strs_, file, boost::is_any_of ("_")); @@ -86,11 +82,7 @@ namespace pcl if (extension == "pcd" && (strs_[0].compare (view_prefix_) == 0)) { -#if BOOST_FILESYSTEM_VERSION == 3 view_filenames.push_back ((itr->path ().filename ()).string()); -#else - view_filenames.push_back ((itr->path ()).filename ()); -#endif number_of_views++; } @@ -134,11 +126,7 @@ namespace pcl std::vector < std::string > strs; std::vector < std::string > strs_; -#if BOOST_FILESYSTEM_VERSION == 3 std::string file = (itr->path ().filename ()).string(); -#else - std::string file = (itr->path ()).filename (); -#endif boost::split (strs, file, boost::is_any_of (".")); boost::split (strs_, file, boost::is_any_of ("_")); @@ -147,12 +135,7 @@ namespace pcl if (extension == "pcd" && strs_[0] == "view") { -#if BOOST_FILESYSTEM_VERSION == 3 view_filenames.push_back ((itr->path ().filename ()).string()); -#else - view_filenames.push_back ((itr->path ()).filename ()); -#endif - number_of_views++; } } @@ -295,23 +278,13 @@ namespace pcl //check if its a directory, then get models in it if (bf::is_directory (*itr)) { -#if BOOST_FILESYSTEM_VERSION == 3 std::string so_far = rel_path_so_far + (itr->path ().filename ()).string() + "/"; -#else - std::string so_far = rel_path_so_far + (itr->path ()).filename () + "/"; -#endif - bf::path curr_path = itr->path (); if (isleafDirectory (curr_path)) { -#if BOOST_FILESYSTEM_VERSION == 3 std::string path = rel_path_so_far + (itr->path ().filename ()).string(); -#else - std::string path = rel_path_so_far + (itr->path ()).filename (); -#endif relative_paths.push_back (path); - } else { diff --git a/apps/3d_rec_framework/include/pcl/apps/3d_rec_framework/pc_source/source.h b/apps/3d_rec_framework/include/pcl/apps/3d_rec_framework/pc_source/source.h index 55c7c8ec065..f4ffde31ac5 100644 --- a/apps/3d_rec_framework/include/pcl/apps/3d_rec_framework/pc_source/source.h +++ b/apps/3d_rec_framework/include/pcl/apps/3d_rec_framework/pc_source/source.h @@ -174,11 +174,7 @@ namespace pcl //check if its a directory, then get models in it if (bf::is_directory (*itr)) { -#if BOOST_FILESYSTEM_VERSION == 3 std::string so_far = rel_path_so_far + (itr->path ().filename ()).string() + "/"; -#else - std::string so_far = rel_path_so_far + (itr->path ()).filename () + "/"; -#endif bf::path curr_path = itr->path (); getModelsInDirectory (curr_path, so_far, relative_paths, ext); @@ -187,22 +183,14 @@ namespace pcl { //check that it is a ply file and then add, otherwise ignore.. std::vector < std::string > strs; -#if BOOST_FILESYSTEM_VERSION == 3 std::string file = (itr->path ().filename ()).string(); -#else - std::string file = (itr->path ()).filename (); -#endif boost::split (strs, file, boost::is_any_of (".")); std::string extension = strs[strs.size () - 1]; if (extension.compare (ext) == 0) { -#if BOOST_FILESYSTEM_VERSION == 3 std::string path = rel_path_so_far + (itr->path ().filename ()).string(); -#else - std::string path = rel_path_so_far + (itr->path ()).filename (); -#endif relative_paths.push_back (path); } diff --git a/apps/3d_rec_framework/include/pcl/apps/3d_rec_framework/pipeline/impl/global_nn_classifier.hpp b/apps/3d_rec_framework/include/pcl/apps/3d_rec_framework/pipeline/impl/global_nn_classifier.hpp index 7693e24d930..831fc696991 100644 --- a/apps/3d_rec_framework/include/pcl/apps/3d_rec_framework/pipeline/impl/global_nn_classifier.hpp +++ b/apps/3d_rec_framework/include/pcl/apps/3d_rec_framework/pipeline/impl/global_nn_classifier.hpp @@ -20,11 +20,7 @@ template class Distance, typename PointInT, typename FeatureT> for (bf::directory_iterator itr_in (inside); itr_in != end_itr; ++itr_in) { -#if BOOST_FILESYSTEM_VERSION == 3 std::string file_name = (itr_in->path ().filename ()).string(); -#else - std::string file_name = (itr_in->path ()).filename (); -#endif std::vector < std::string > strs; boost::split (strs, file_name, boost::is_any_of ("_")); diff --git a/apps/3d_rec_framework/include/pcl/apps/3d_rec_framework/pipeline/impl/global_nn_recognizer_crh.hpp b/apps/3d_rec_framework/include/pcl/apps/3d_rec_framework/pipeline/impl/global_nn_recognizer_crh.hpp index 1784dd880bb..8e11a068411 100644 --- a/apps/3d_rec_framework/include/pcl/apps/3d_rec_framework/pipeline/impl/global_nn_recognizer_crh.hpp +++ b/apps/3d_rec_framework/include/pcl/apps/3d_rec_framework/pipeline/impl/global_nn_recognizer_crh.hpp @@ -92,11 +92,7 @@ template class Distance, typename PointInT, typename FeatureT> for (bf::directory_iterator itr_in (inside); itr_in != end_itr; ++itr_in) { -#if BOOST_FILESYSTEM_VERSION == 3 std::string file_name = (itr_in->path ().filename ()).string(); -#else - std::string file_name = (itr_in->path ()).filename (); -#endif std::vector < std::string > strs; boost::split (strs, file_name, boost::is_any_of ("_")); diff --git a/apps/3d_rec_framework/include/pcl/apps/3d_rec_framework/pipeline/impl/global_nn_recognizer_cvfh.hpp b/apps/3d_rec_framework/include/pcl/apps/3d_rec_framework/pipeline/impl/global_nn_recognizer_cvfh.hpp index 8442644ae98..405d417588c 100644 --- a/apps/3d_rec_framework/include/pcl/apps/3d_rec_framework/pipeline/impl/global_nn_recognizer_cvfh.hpp +++ b/apps/3d_rec_framework/include/pcl/apps/3d_rec_framework/pipeline/impl/global_nn_recognizer_cvfh.hpp @@ -119,11 +119,7 @@ template class Distance, typename PointInT, typename FeatureT> for (bf::directory_iterator itr_in (inside); itr_in != end_itr; ++itr_in) { -#if BOOST_FILESYSTEM_VERSION == 3 std::string file_name = (itr_in->path ().filename ()).string(); -#else - std::string file_name = (itr_in->path ()).filename (); -#endif std::vector < std::string > strs; boost::split (strs, file_name, boost::is_any_of ("_")); diff --git a/apps/3d_rec_framework/include/pcl/apps/3d_rec_framework/pipeline/impl/local_recognizer.hpp b/apps/3d_rec_framework/include/pcl/apps/3d_rec_framework/pipeline/impl/local_recognizer.hpp index 4c2a7af3ad1..bfcbb0ae562 100644 --- a/apps/3d_rec_framework/include/pcl/apps/3d_rec_framework/pipeline/impl/local_recognizer.hpp +++ b/apps/3d_rec_framework/include/pcl/apps/3d_rec_framework/pipeline/impl/local_recognizer.hpp @@ -21,11 +21,7 @@ template class Distance, typename PointInT, typename FeatureT> for (bf::directory_iterator itr_in (inside); itr_in != end_itr; ++itr_in) { -#if BOOST_FILESYSTEM_VERSION == 3 std::string file_name = (itr_in->path ().filename ()).string(); -#else - std::string file_name = (itr_in->path ()).filename (); -#endif std::vector < std::string > strs; boost::split (strs, file_name, boost::is_any_of ("_")); diff --git a/apps/3d_rec_framework/src/tools/local_recognition_mian_dataset.cpp b/apps/3d_rec_framework/src/tools/local_recognition_mian_dataset.cpp index 43760c7b1cc..80513ce1ed0 100644 --- a/apps/3d_rec_framework/src/tools/local_recognition_mian_dataset.cpp +++ b/apps/3d_rec_framework/src/tools/local_recognition_mian_dataset.cpp @@ -30,12 +30,7 @@ getScenesInDirectory (bf::path & dir, std::string & rel_path_so_far, std::vector //check if its a directory, then get models in it if (bf::is_directory (*itr)) { - -#if BOOST_FILESYSTEM_VERSION == 3 std::string so_far = rel_path_so_far + (itr->path ().filename ()).string() + "/"; -#else - std::string so_far = rel_path_so_far + (itr->path ()).filename () + "/"; -#endif bf::path curr_path = itr->path (); getScenesInDirectory (curr_path, so_far, relative_paths); } @@ -43,24 +38,14 @@ getScenesInDirectory (bf::path & dir, std::string & rel_path_so_far, std::vector { //check that it is a ply file and then add, otherwise ignore.. std::vector < std::string > strs; -#if BOOST_FILESYSTEM_VERSION == 3 std::string file = (itr->path ().filename ()).string(); -#else - std::string file = (itr->path ().filename ()); -#endif boost::split (strs, file, boost::is_any_of (".")); std::string extension = strs[strs.size () - 1]; if (extension == "pcd") { - -#if BOOST_FILESYSTEM_VERSION == 3 std::string path = rel_path_so_far + (itr->path ().filename ()).string(); -#else - std::string path = rel_path_so_far + (itr->path ()).filename (); -#endif - relative_paths.push_back (path); } } @@ -261,11 +246,7 @@ getModelsInDirectory (bf::path & dir, std::string & rel_path_so_far, std::vector //check if its a directory, then get models in it if (bf::is_directory (*itr)) { -#if BOOST_FILESYSTEM_VERSION == 3 std::string so_far = rel_path_so_far + (itr->path ().filename ()).string() + "/"; -#else - std::string so_far = rel_path_so_far + (itr->path ()).filename () + "/"; -#endif bf::path curr_path = itr->path (); getModelsInDirectory (curr_path, so_far, relative_paths, ext); @@ -274,22 +255,14 @@ getModelsInDirectory (bf::path & dir, std::string & rel_path_so_far, std::vector { //check that it is a ply file and then add, otherwise ignore.. std::vector < std::string > strs; -#if BOOST_FILESYSTEM_VERSION == 3 std::string file = (itr->path ().filename ()).string(); -#else - std::string file = (itr->path ()).filename (); -#endif boost::split (strs, file, boost::is_any_of (".")); std::string extension = strs[strs.size () - 1]; if (extension.compare (ext) == 0) { -#if BOOST_FILESYSTEM_VERSION == 3 std::string path = rel_path_so_far + (itr->path ().filename ()).string(); -#else - std::string path = rel_path_so_far + (itr->path ()).filename (); -#endif relative_paths.push_back (path); } diff --git a/apps/include/pcl/apps/face_detection/face_detection_apps_utils.h b/apps/include/pcl/apps/face_detection/face_detection_apps_utils.h index 562d2f8d3fd..0cd2045feda 100644 --- a/apps/include/pcl/apps/face_detection/face_detection_apps_utils.h +++ b/apps/include/pcl/apps/face_detection/face_detection_apps_utils.h @@ -85,23 +85,13 @@ namespace face_detection_apps_utils { //check that it is a ply file and then add, otherwise ignore.. std::vector < std::string > strs; -#if BOOST_FILESYSTEM_VERSION == 3 std::string file = (itr->path().filename()).string(); -#else - std::string file = (itr->path ()).filename (); -#endif - boost::split (strs, file, boost::is_any_of (".")); std::string extension = strs[strs.size () - 1]; if (extension.compare (ext) == 0) { -#if BOOST_FILESYSTEM_VERSION == 3 std::string path = rel_path_so_far + (itr->path().filename()).string(); -#else - std::string path = rel_path_so_far + (itr->path ()).filename (); -#endif - relative_paths.push_back (path); } } diff --git a/apps/src/openni_grab_frame.cpp b/apps/src/openni_grab_frame.cpp index adaa1de8526..d136a80179b 100644 --- a/apps/src/openni_grab_frame.cpp +++ b/apps/src/openni_grab_frame.cpp @@ -235,19 +235,11 @@ class OpenNIGrabFrame std::cerr << "directory \"" << path.parent_path () << "\" does not exist!\n"; exit (1); } -#if BOOST_FILESYSTEM_VERSION == 3 file_name_ = path.stem ().string (); -#else - file_name_ = path.stem (); -#endif } std::cout << "dir: " << dir_name_ << " :: " << path.parent_path () << std::endl; -#if BOOST_FILESYSTEM_VERSION == 3 std::cout << "file: " << file_name_ << " :: " << path.stem (). string () << std::endl; -#else - std::cout << "file: " << file_name_ << " :: " << path.stem () << std::endl; -#endif if (pcd_format == "b" || pcd_format == "all") format_ |= 1; diff --git a/doc/tutorials/content/sources/iccv2011/src/build_all_object_models.cpp b/doc/tutorials/content/sources/iccv2011/src/build_all_object_models.cpp index b7b77174946..ee1a0bc8923 100644 --- a/doc/tutorials/content/sources/iccv2011/src/build_all_object_models.cpp +++ b/doc/tutorials/content/sources/iccv2011/src/build_all_object_models.cpp @@ -18,31 +18,19 @@ getModelsInDirectory (bf::path & dir, std::string & rel_path_so_far, std::vector //check if its a directory, then get models in it if (bf::is_directory (*itr)) { -#if BOOST_FILESYSTEM_VERSION == 3 std::string so_far = rel_path_so_far + itr->path ().filename ().string () + "/"; -#else - std::string so_far = rel_path_so_far + itr->path ().filename () + "/"; -#endif bf::path curr_path = itr->path (); getModelsInDirectory (curr_path, so_far, relative_paths); } else { std::vector strs; -#if BOOST_FILESYSTEM_VERSION == 3 std::string file = itr->path ().filename ().string (); -#else - std::string file = itr->path ().filename (); -#endif boost::split (strs, file, boost::is_any_of (".")); std::string extension = strs[strs.size () - 1]; if((file.compare (0, 3, "raw") == 0) && extension == "pcd") { -#if BOOST_FILESYSTEM_VERSION == 3 std::string path = rel_path_so_far + itr->path ().filename ().string (); -#else - std::string path = rel_path_so_far + itr->path ().filename (); -#endif relative_paths.push_back (path); } } diff --git a/doc/tutorials/content/sources/iros2011/src/build_all_object_models.cpp b/doc/tutorials/content/sources/iros2011/src/build_all_object_models.cpp index b7b77174946..ee1a0bc8923 100644 --- a/doc/tutorials/content/sources/iros2011/src/build_all_object_models.cpp +++ b/doc/tutorials/content/sources/iros2011/src/build_all_object_models.cpp @@ -18,31 +18,19 @@ getModelsInDirectory (bf::path & dir, std::string & rel_path_so_far, std::vector //check if its a directory, then get models in it if (bf::is_directory (*itr)) { -#if BOOST_FILESYSTEM_VERSION == 3 std::string so_far = rel_path_so_far + itr->path ().filename ().string () + "/"; -#else - std::string so_far = rel_path_so_far + itr->path ().filename () + "/"; -#endif bf::path curr_path = itr->path (); getModelsInDirectory (curr_path, so_far, relative_paths); } else { std::vector strs; -#if BOOST_FILESYSTEM_VERSION == 3 std::string file = itr->path ().filename ().string (); -#else - std::string file = itr->path ().filename (); -#endif boost::split (strs, file, boost::is_any_of (".")); std::string extension = strs[strs.size () - 1]; if((file.compare (0, 3, "raw") == 0) && extension == "pcd") { -#if BOOST_FILESYSTEM_VERSION == 3 std::string path = rel_path_so_far + itr->path ().filename ().string (); -#else - std::string path = rel_path_so_far + itr->path ().filename (); -#endif relative_paths.push_back (path); } } diff --git a/gpu/kinfu/tools/kinfu_app.cpp b/gpu/kinfu/tools/kinfu_app.cpp index d7043fe680f..3bf8d4c043b 100644 --- a/gpu/kinfu/tools/kinfu_app.cpp +++ b/gpu/kinfu/tools/kinfu_app.cpp @@ -187,11 +187,7 @@ vector getPcdFilesInDir(const string& directory) if (fs::is_regular_file(pos->status()) ) if (fs::extension(*pos) == ".pcd") { -#if BOOST_FILESYSTEM_VERSION == 3 result.push_back (pos->path ().string ()); -#else - result.push_back (pos->path ()); -#endif cout << "added: " << result.back() << endl; } diff --git a/gpu/kinfu_large_scale/tools/kinfuLS_app.cpp b/gpu/kinfu_large_scale/tools/kinfuLS_app.cpp index 6d021551974..e9804fd5b74 100644 --- a/gpu/kinfu_large_scale/tools/kinfuLS_app.cpp +++ b/gpu/kinfu_large_scale/tools/kinfuLS_app.cpp @@ -129,11 +129,7 @@ vector getPcdFilesInDir(const string& directory) if (fs::is_regular_file(pos->status()) ) if (fs::extension(*pos) == ".pcd") { -#if BOOST_FILESYSTEM_VERSION == 3 result.push_back (pos->path ().string ()); -#else - result.push_back (pos->path ()); -#endif cout << "added: " << result.back() << endl; } diff --git a/io/src/image_grabber.cpp b/io/src/image_grabber.cpp index 1475bc156f2..8d1074dfe65 100644 --- a/io/src/image_grabber.cpp +++ b/io/src/image_grabber.cpp @@ -312,15 +312,9 @@ pcl::ImageGrabberBase::ImageGrabberImpl::loadDepthAndRGBFiles (const std::string boost::filesystem::directory_iterator end_itr; for (boost::filesystem::directory_iterator itr (dir); itr != end_itr; ++itr) { -#if BOOST_FILESYSTEM_VERSION == 3 extension = boost::algorithm::to_upper_copy (boost::filesystem::extension (itr->path ())); pathname = itr->path ().string (); basename = boost::filesystem::basename (itr->path ()); -#else - extension = boost::algorithm::to_upper_copy (boost::filesystem::extension (itr->leaf ())); - pathname = itr->path ().filename (); - basename = boost::filesystem::basename (itr->leaf ()); -#endif if (!boost::filesystem::is_directory (itr->status ()) && isValidExtension (extension)) { @@ -361,15 +355,9 @@ pcl::ImageGrabberBase::ImageGrabberImpl::loadDepthAndRGBFiles (const std::string // First iterate over depth images for (boost::filesystem::directory_iterator itr (depth_dir); itr != end_itr; ++itr) { -#if BOOST_FILESYSTEM_VERSION == 3 extension = boost::algorithm::to_upper_copy (boost::filesystem::extension (itr->path ())); pathname = itr->path ().string (); basename = boost::filesystem::basename (itr->path ()); -#else - extension = boost::algorithm::to_upper_copy (boost::filesystem::extension (itr->leaf ())); - pathname = itr->path ().filename (); - basename = boost::filesystem::basename (itr->leaf ()); -#endif if (!boost::filesystem::is_directory (itr->status ()) && isValidExtension (extension)) { @@ -382,15 +370,9 @@ pcl::ImageGrabberBase::ImageGrabberImpl::loadDepthAndRGBFiles (const std::string // Then iterate over RGB images for (boost::filesystem::directory_iterator itr (rgb_dir); itr != end_itr; ++itr) { -#if BOOST_FILESYSTEM_VERSION == 3 extension = boost::algorithm::to_upper_copy (boost::filesystem::extension (itr->path ())); pathname = itr->path ().string (); basename = boost::filesystem::basename (itr->path ()); -#else - extension = boost::algorithm::to_upper_copy (boost::filesystem::extension (itr->leaf ())); - pathname = itr->path ().filename (); - basename = boost::filesystem::basename (itr->leaf ()); -#endif if (!boost::filesystem::is_directory (itr->status ()) && isValidExtension (extension)) { @@ -429,15 +411,9 @@ pcl::ImageGrabberBase::ImageGrabberImpl::loadPCLZFFiles (const std::string &dir) boost::filesystem::directory_iterator end_itr; for (boost::filesystem::directory_iterator itr (dir); itr != end_itr; ++itr) { -#if BOOST_FILESYSTEM_VERSION == 3 extension = boost::algorithm::to_upper_copy (boost::filesystem::extension (itr->path ())); pathname = itr->path ().string (); basename = boost::filesystem::basename (itr->path ()); -#else - extension = boost::algorithm::to_upper_copy (boost::filesystem::extension (itr->leaf ())); - pathname = itr->path ().filename (); - basename = boost::filesystem::basename (itr->leaf ()); -#endif if (!boost::filesystem::is_directory (itr->status ()) && isValidExtension (extension)) { diff --git a/recognition/include/pcl/recognition/face_detection/face_detector_data_provider.h b/recognition/include/pcl/recognition/face_detection/face_detector_data_provider.h index cf159db9a60..114cece571a 100644 --- a/recognition/include/pcl/recognition/face_detection/face_detector_data_provider.h +++ b/recognition/include/pcl/recognition/face_detection/face_detector_data_provider.h @@ -44,35 +44,20 @@ namespace pcl //check if its a directory, then get models in it if (bf::is_directory (*itr)) { -#if BOOST_FILESYSTEM_VERSION == 3 std::string so_far = rel_path_so_far + (itr->path ().filename ()).string () + "/"; -#else - std::string so_far = rel_path_so_far + (itr->path ()).filename () + "/"; -#endif - bf::path curr_path = itr->path (); getFilesInDirectory (curr_path, so_far, relative_paths, ext); } else { //check that it is a ply file and then add, otherwise ignore.. std::vector < std::string > strs; -#if BOOST_FILESYSTEM_VERSION == 3 std::string file = (itr->path ().filename ()).string (); -#else - std::string file = (itr->path ()).filename (); -#endif - boost::split (strs, file, boost::is_any_of (".")); std::string extension = strs[strs.size () - 1]; if (extension.compare (ext) == 0) { -#if BOOST_FILESYSTEM_VERSION == 3 std::string path = rel_path_so_far + (itr->path ().filename ()).string (); -#else - std::string path = rel_path_so_far + (itr->path ()).filename (); -#endif - relative_paths.push_back (path); } } diff --git a/test/io/test_grabbers.cpp b/test/io/test_grabbers.cpp index fba88871bcb..de1250d5246 100644 --- a/test/io/test_grabbers.cpp +++ b/test/io/test_grabbers.cpp @@ -530,19 +530,10 @@ int boost::filesystem::directory_iterator end_itr; for (boost::filesystem::directory_iterator itr (pcd_dir_); itr != end_itr; ++itr) { -#if BOOST_FILESYSTEM_VERSION == 3 if (!is_directory (itr->status ()) && boost::algorithm::to_upper_copy (boost::filesystem::extension (itr->path ())) == ".PCD" ) -#else - if (!is_directory (itr->status ()) && boost::algorithm::to_upper_copy (boost::filesystem::extension (itr->leaf ())) == ".PCD" ) -#endif { -#if BOOST_FILESYSTEM_VERSION == 3 pcd_files_.push_back (itr->path ().string ()); std::cout << "added: " << itr->path ().string () << std::endl; -#else - pcd_files_.push_back (itr->pcd_dir_ ().string ()); - std::cout << "added: " << itr->pcd_dir_ () << std::endl; -#endif } } sort (pcd_files_.begin (), pcd_files_.end ()); diff --git a/visualization/tools/pcd_grabber_viewer.cpp b/visualization/tools/pcd_grabber_viewer.cpp index 971e152298c..874edad3ddc 100644 --- a/visualization/tools/pcd_grabber_viewer.cpp +++ b/visualization/tools/pcd_grabber_viewer.cpp @@ -193,19 +193,10 @@ main (int argc, char** argv) boost::filesystem::directory_iterator end_itr; for (boost::filesystem::directory_iterator itr (path); itr != end_itr; ++itr) { -#if BOOST_FILESYSTEM_VERSION == 3 if (!is_directory (itr->status ()) && boost::algorithm::to_upper_copy (boost::filesystem::extension (itr->path ())) == ".PCD" ) -#else - if (!is_directory (itr->status ()) && boost::algorithm::to_upper_copy (boost::filesystem::extension (itr->leaf ())) == ".PCD" ) -#endif { -#if BOOST_FILESYSTEM_VERSION == 3 pcd_files.push_back (itr->path ().string ()); std::cout << "added: " << itr->path ().string () << std::endl; -#else - pcd_files.push_back (itr->path ().string ()); - std::cout << "added: " << itr->path () << std::endl; -#endif } } } From 48a15142dd9eb31281bc7ec31efdb0fcbf6ea6a9 Mon Sep 17 00:00:00 2001 From: Heiko Thiel Date: Thu, 4 Apr 2019 14:09:46 +0200 Subject: [PATCH 2/3] Drop unnecessary BOOST_VERSION checks, because minimum required Boost version is 1.55 --- io/include/pcl/io/boost.h | 4 ---- segmentation/src/min_cut_segmentation.cpp | 3 --- 2 files changed, 7 deletions(-) diff --git a/io/include/pcl/io/boost.h b/io/include/pcl/io/boost.h index afd8a25277c..f424bfedb61 100644 --- a/io/include/pcl/io/boost.h +++ b/io/include/pcl/io/boost.h @@ -62,15 +62,11 @@ #include #include #include -#if BOOST_VERSION >= 104700 #include -#endif #include #include #include -#if BOOST_VERSION >= 104900 #include -#endif #include #define BOOST_PARAMETER_MAX_ARITY 7 #include diff --git a/segmentation/src/min_cut_segmentation.cpp b/segmentation/src/min_cut_segmentation.cpp index e79c6734cdb..22dc57e136a 100644 --- a/segmentation/src/min_cut_segmentation.cpp +++ b/segmentation/src/min_cut_segmentation.cpp @@ -37,7 +37,6 @@ */ #include -#if BOOST_VERSION > 103999 #include #include @@ -46,5 +45,3 @@ // Instantiations of specific point types PCL_INSTANTIATE(MinCutSegmentation, PCL_XYZ_POINT_TYPES) - -#endif From 5de156c97201074248a149ab9282f8c5610f82ca Mon Sep 17 00:00:00 2001 From: Heiko Thiel Date: Thu, 4 Apr 2019 14:12:39 +0200 Subject: [PATCH 3/3] Drop obsolete Boost version checks in CMakeLists --- segmentation/CMakeLists.txt | 23 +++-------------------- tools/CMakeLists.txt | 7 ++----- 2 files changed, 5 insertions(+), 25 deletions(-) diff --git a/segmentation/CMakeLists.txt b/segmentation/CMakeLists.txt index d0f35a640a7..008fc001165 100644 --- a/segmentation/CMakeLists.txt +++ b/segmentation/CMakeLists.txt @@ -15,6 +15,7 @@ endif() set(srcs src/extract_clusters.cpp src/extract_polygonal_prism_data.cpp + src/min_cut_segmentation.cpp src/sac_segmentation.cpp src/seeded_hue_segmentation.cpp src/segment_differences.cpp @@ -34,18 +35,13 @@ set(srcs src/lccp_segmentation.cpp src/cpc_segmentation.cpp ) -# NOTE: boost/graph/boykov_kolmogorov_max_flow.hpp only exists for versions > 1.43 -if(Boost_MAJOR_VERSION GREATER 1 OR Boost_MINOR_VERSION GREATER 43) - list(APPEND srcs - src/min_cut_segmentation.cpp - ) -endif() set(incs "include/pcl/${SUBSYS_NAME}/boost.h" "include/pcl/${SUBSYS_NAME}/extract_clusters.h" "include/pcl/${SUBSYS_NAME}/extract_labeled_clusters.h" "include/pcl/${SUBSYS_NAME}/extract_polygonal_prism_data.h" + "include/pcl/${SUBSYS_NAME}/min_cut_segmentation.h" "include/pcl/${SUBSYS_NAME}/sac_segmentation.h" "include/pcl/${SUBSYS_NAME}/seeded_hue_segmentation.h" "include/pcl/${SUBSYS_NAME}/segment_differences.h" @@ -77,17 +73,11 @@ set(incs "include/pcl/${SUBSYS_NAME}/cpc_segmentation.h" ) -# NOTE: boost/graph/boykov_kolmogorov_max_flow.hpp only exists for versions > 1.43 -if(Boost_MAJOR_VERSION GREATER 1 OR Boost_MINOR_VERSION GREATER 43) - list(APPEND incs - "include/pcl/${SUBSYS_NAME}/min_cut_segmentation.h" - ) -endif() - set(impl_incs "include/pcl/${SUBSYS_NAME}/impl/extract_clusters.hpp" "include/pcl/${SUBSYS_NAME}/impl/extract_labeled_clusters.hpp" "include/pcl/${SUBSYS_NAME}/impl/extract_polygonal_prism_data.hpp" + "include/pcl/${SUBSYS_NAME}/impl/min_cut_segmentation.hpp" "include/pcl/${SUBSYS_NAME}/impl/sac_segmentation.hpp" "include/pcl/${SUBSYS_NAME}/impl/seeded_hue_segmentation.hpp" "include/pcl/${SUBSYS_NAME}/impl/segment_differences.hpp" @@ -109,13 +99,6 @@ set(impl_incs "include/pcl/${SUBSYS_NAME}/impl/cpc_segmentation.hpp" ) -# NOTE: boost/graph/boykov_kolmogorov_max_flow.hpp only exists for versions > 1.43 -if(Boost_MAJOR_VERSION GREATER 1 OR Boost_MINOR_VERSION GREATER 43) - list(APPEND impl_incs - "include/pcl/${SUBSYS_NAME}/impl/min_cut_segmentation.hpp" - ) -endif() - set(LIB_NAME "pcl_${SUBSYS_NAME}") include_directories("${CMAKE_CURRENT_SOURCE_DIR}/include") PCL_ADD_LIBRARY("${LIB_NAME}" "${SUBSYS_NAME}" ${srcs} ${incs} ${impl_incs}) diff --git a/tools/CMakeLists.txt b/tools/CMakeLists.txt index f82b57fd63b..cfb83d57d92 100644 --- a/tools/CMakeLists.txt +++ b/tools/CMakeLists.txt @@ -81,11 +81,8 @@ target_link_libraries (pcl_unary_classifier_segment pcl_common pcl_io pcl_segmen PCL_ADD_EXECUTABLE (pcl_crf_segmentation "${SUBSYS_NAME}" crf_segmentation.cpp) target_link_libraries (pcl_crf_segmentation pcl_common pcl_io pcl_segmentation) -# NOTE: boost/uuid/uuid.hpp only exists for versions > 1.41 -if(Boost_MAJOR_VERSION GREATER 1 OR Boost_MINOR_VERSION GREATER 41) - PCL_ADD_EXECUTABLE (pcl_add_gaussian_noise "${SUBSYS_NAME}" add_gaussian_noise.cpp) - target_link_libraries (pcl_add_gaussian_noise pcl_common pcl_io) -endif() +PCL_ADD_EXECUTABLE (pcl_add_gaussian_noise "${SUBSYS_NAME}" add_gaussian_noise.cpp) +target_link_libraries (pcl_add_gaussian_noise pcl_common pcl_io) PCL_ADD_EXECUTABLE (pcl_outlier_removal "${SUBSYS_NAME}" outlier_removal.cpp) target_link_libraries (pcl_outlier_removal pcl_common pcl_io pcl_filters)