Skip to content

Commit 047a24f

Browse files
authored
Move filesystem headers to pcl_filesystem.h (#5945)
* Move filesystem headers to pcl_filesystem.h * Add missing pcl_filesystem.h * Corresponding line changes for vfh_recognition.rst
1 parent aa667c1 commit 047a24f

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

50 files changed

+110
-392
lines changed

apps/3d_rec_framework/include/pcl/apps/3d_rec_framework/utils/persistence_utils.h

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,8 @@
1+
#include <pcl/common/pcl_filesystem.h>
12
#include <pcl/io/pcd_io.h>
23

34
#include <boost/algorithm/string.hpp>
45

5-
#if (__cplusplus >= 201703L)
6-
#include <filesystem>
7-
namespace pcl_fs = std::filesystem;
8-
#else
9-
#include <boost/filesystem.hpp>
10-
namespace pcl_fs = boost::filesystem;
11-
#endif
12-
136
#include <fstream>
147

158
namespace pcl {

apps/in_hand_scanner/src/offline_integration.cpp

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -40,20 +40,13 @@
4040

4141
#include <pcl/apps/in_hand_scanner/integration.h>
4242
#include <pcl/apps/in_hand_scanner/offline_integration.h>
43+
#include <pcl/common/pcl_filesystem.h>
4344
#include <pcl/common/transforms.h>
4445
#include <pcl/features/integral_image_normal.h>
4546
#include <pcl/io/pcd_io.h>
4647

4748
#include <boost/algorithm/string/case_conv.hpp>
4849

49-
#if (__cplusplus >= 201703L)
50-
#include <filesystem>
51-
namespace pcl_fs = std::filesystem;
52-
#else
53-
#include <boost/filesystem.hpp>
54-
namespace pcl_fs = boost::filesystem;
55-
#endif
56-
5750
#include <QApplication>
5851
#include <QFileDialog>
5952
#include <QKeyEvent>

apps/include/pcl/apps/face_detection/face_detection_apps_utils.h

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -7,13 +7,7 @@
77

88
#pragma once
99

10-
#if (__cplusplus >= 201703L)
11-
#include <filesystem>
12-
namespace pcl_fs = std::filesystem;
13-
#else
14-
#include <boost/filesystem.hpp>
15-
namespace pcl_fs = boost::filesystem;
16-
#endif
10+
#include <pcl/common/pcl_filesystem.h>
1711

1812
namespace face_detection_apps_utils {
1913

apps/include/pcl/apps/pcd_video_player.h

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -35,21 +35,14 @@
3535
*/
3636

3737
#include <pcl/common/common.h>
38+
#include <pcl/common/pcl_filesystem.h>
3839
#include <pcl/common/time.h>
3940
#include <pcl/registration/transformation_estimation_svd.h>
4041
#include <pcl/visualization/pcl_visualizer.h>
4142
#include <pcl/visualization/point_cloud_handlers.h>
4243
#include <pcl/point_cloud.h>
4344
#include <pcl/point_types.h>
4445

45-
#if (__cplusplus >= 201703L)
46-
#include <filesystem>
47-
namespace pcl_fs = std::filesystem;
48-
#else
49-
#include <boost/filesystem.hpp>
50-
namespace pcl_fs = boost::filesystem;
51-
#endif
52-
5346
#include <QMainWindow>
5447
#include <QMutex>
5548
#include <QTimer>

apps/src/face_detection/filesystem_face_detection.cpp

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
* Author: Aitor Aldoma
66
*/
77

8+
#include <pcl/common/pcl_filesystem.h>
89
#include <pcl/console/parse.h>
910
#include <pcl/io/pcd_io.h>
1011
#include <pcl/recognition/face_detection/rf_face_detector_trainer.h>
@@ -13,14 +14,6 @@
1314
#include <pcl/apps/face_detection/face_detection_apps_utils.h>
1415
// clang-format on
1516

16-
#if (__cplusplus >= 201703L)
17-
#include <filesystem>
18-
namespace pcl_fs = std::filesystem;
19-
#else
20-
#include <boost/filesystem.hpp>
21-
namespace pcl_fs = boost::filesystem;
22-
#endif
23-
2417
bool SHOW_GT = false;
2518
bool VIDEO = false;
2619

apps/src/openni_grab_frame.cpp

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@
3535
* Christian Potthast (potthast@usc.edu)
3636
*/
3737

38+
#include <pcl/common/pcl_filesystem.h>
3839
#include <pcl/common/time.h>
3940
#include <pcl/console/parse.h>
4041
#include <pcl/console/print.h>
@@ -45,14 +46,6 @@
4546
#include <pcl/point_cloud.h>
4647
#include <pcl/point_types.h>
4748

48-
#if (__cplusplus >= 201703L)
49-
#include <filesystem>
50-
namespace pcl_fs = std::filesystem;
51-
#else
52-
#include <boost/filesystem.hpp>
53-
namespace pcl_fs = boost::filesystem;
54-
#endif
55-
5649
#include <mutex>
5750

5851
using namespace std::chrono_literals;

apps/src/stereo_ground_segmentation.cpp

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@
3636
#include <pcl/common/centroid.h> // for computeMeanAndCovarianceMatrix
3737
#include <pcl/common/distances.h>
3838
#include <pcl/common/intersections.h>
39+
#include <pcl/common/pcl_filesystem.h>
3940
#include <pcl/features/integral_image_normal.h>
4041
#include <pcl/io/pcd_io.h>
4142
#include <pcl/sample_consensus/sac_model_plane.h>
@@ -50,14 +51,6 @@
5051
#include <pcl/visualization/pcl_visualizer.h>
5152
#include <pcl/ModelCoefficients.h>
5253

53-
#if (__cplusplus >= 201703L)
54-
#include <filesystem> // for directory_iterator
55-
namespace pcl_fs = std::filesystem;
56-
#else
57-
#include <boost/filesystem.hpp> // for directory_iterator
58-
namespace pcl_fs = boost::filesystem;
59-
#endif
60-
6154
#include <mutex>
6255

6356
using PointT = pcl::PointXYZRGB;

common/CMakeLists.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -98,6 +98,7 @@ set(common_incs
9898
include/pcl/common/file_io.h
9999
include/pcl/common/intersections.h
100100
include/pcl/common/norms.h
101+
include/pcl/common/pcl_filesystem.h
101102
include/pcl/common/piecewise_linear_function.h
102103
include/pcl/common/polynomial_calculations.h
103104
include/pcl/common/poses_from_matches.h

common/include/pcl/common/impl/file_io.hpp

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -39,13 +39,7 @@
3939
#ifndef PCL_COMMON_FILE_IO_IMPL_HPP_
4040
#define PCL_COMMON_FILE_IO_IMPL_HPP_
4141

42-
#if (__cplusplus >= 201703L)
43-
#include <filesystem>
44-
namespace pcl_fs = std::filesystem;
45-
#else
46-
#include <boost/filesystem.hpp>
47-
namespace pcl_fs = boost::filesystem;
48-
#endif
42+
#include <pcl/common/pcl_filesystem.h>
4943

5044
#include <boost/range/iterator_range.hpp>
5145

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
/*
2+
* Software License Agreement (BSD License)
3+
*
4+
* Point Cloud Library (PCL) - www.pointclouds.org
5+
* Copyright (C) 2024 Kino <cybao292261@163.com>
6+
*
7+
* All rights reserved.
8+
*
9+
* Redistribution and use in source and binary forms, with or without
10+
* modification, are permitted provided that the following conditions
11+
* are met:
12+
*
13+
* * Redistributions of source code must retain the above copyright
14+
* notice, this list of conditions and the following disclaimer.
15+
* * Redistributions in binary form must reproduce the above
16+
* copyright notice, this list of conditions and the following
17+
* disclaimer in the documentation and/or other materials provided
18+
* with the distribution.
19+
* * Neither the name of the copyright holder(s) nor the names of its
20+
* contributors may be used to endorse or promote products derived
21+
* from this software without specific prior written permission.
22+
*
23+
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
24+
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
25+
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
26+
* FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
27+
* COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
28+
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
29+
* BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
30+
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
31+
* CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
32+
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
33+
* ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
34+
* POSSIBILITY OF SUCH DAMAGE.
35+
*
36+
* $Id$
37+
*/
38+
39+
#pragma once
40+
41+
#if (__cplusplus >= 201703L)
42+
#include <filesystem>
43+
namespace pcl_fs = std::filesystem;
44+
#else
45+
#include <boost/filesystem.hpp>
46+
namespace pcl_fs = boost::filesystem;
47+
#endif

0 commit comments

Comments
 (0)