Skip to content

Commit

Permalink
* More fundamental headers come last
Browse files Browse the repository at this point in the history
* Increase value of Priority in .clang-format so in case a new dependency will be added not all values have to adjusted
  • Loading branch information
Heiko Thiel committed Apr 21, 2020
1 parent 98e3eed commit d3dedd4
Show file tree
Hide file tree
Showing 16 changed files with 53 additions and 44 deletions.
43 changes: 26 additions & 17 deletions .clang-format
Original file line number Diff line number Diff line change
Expand Up @@ -24,37 +24,46 @@ TabWidth: 2
UseTab: Never
IncludeBlocks: Regroup
IncludeCategories:
- Regex: '^<pcl/'
Priority: 1
# Main PCL includes of common module should be sorted at end of PCL includes
- Regex: '^<pcl/[^/]+>$'
Priority: 100
SortPriority: 101
# All other PCL includes, which are grouped into modules
- Regex: '^<pcl/.*/.*>$'
Priority: 100
SortPriority: 100
# Major 3rd-Party components of tests & modules
- Regex: '^<gtest/'
Priority: 2
Priority: 200
- Regex: '^<boost/'
Priority: 3
Priority: 210
- Regex: '^<(unsupported/)?Eigen/'
Priority: 4
Priority: 220
- Regex: '^<flann/'
Priority: 5
Priority: 230
# Major 3rd-Party components of apps
- Regex: '^<Q[^/]+>$'
Priority: 6
Priority: 300
- Regex: '^<ui_[^/]+\.h>$'
Priority: 6
Priority: 300
- Regex: '^<vtk[^/]+\.h>$'
Priority: 7
Priority: 310
# Minor 3rd-Party components
- Regex: '^<librealsense2/'
Priority: 8
Priority: 400
- Regex: '^<(ros|message_filters)/'
Priority: 9
Priority: 410
- Regex: '^<opencv(2)?/'
Priority: 10
Priority: 420
- Regex: '^<tide/'
Priority: 11
Priority: 430
- Regex: '^<thrust/'
Priority: 12
Priority: 440
- Regex: '^<(OpenGL|(GL(UT)?/))'
Priority: 13
Priority: 450
# Matches all std includes. Match them before any unknown include, so we can order them behind.
- Regex: '^<[a-z]+>$'
Priority: 15
Priority: 900
# Any unknown include
- Regex: '.*'
Priority: 14
Priority: 500
2 changes: 1 addition & 1 deletion ml/include/pcl/ml/densecrf.h
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,8 @@

#pragma once

#include <pcl/memory.h>
#include <pcl/ml/pairwise_potential.h>
#include <pcl/memory.h>
#include <pcl/pcl_macros.h>
#include <pcl/point_cloud.h>
#include <pcl/point_types.h>
Expand Down
2 changes: 1 addition & 1 deletion octree/include/pcl/octree/octree_nodes.h
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,8 @@

#pragma once

#include <pcl/memory.h>
#include <pcl/octree/octree_container.h>
#include <pcl/memory.h>
#include <pcl/pcl_macros.h>

#include <Eigen/Core>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,9 +38,9 @@

#pragma once

#include <pcl/memory.h>
#include <pcl/octree/octree2buf_base.h>
#include <pcl/octree/octree_pointcloud.h>
#include <pcl/memory.h>

namespace pcl {
namespace octree {
Expand Down
4 changes: 2 additions & 2 deletions simulation/include/pcl/simulation/model.h
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
#pragma once

#include <pcl/PolygonMesh.h>
#include <pcl/io/pcd_io.h>
#include <pcl/simulation/glsl_shader.h>
#include <pcl/PolygonMesh.h>
#include <pcl/memory.h>
#include <pcl/pcl_config.h>
#include <pcl/pcl_macros.h>
#include <pcl/point_types.h>
#include <pcl/simulation/glsl_shader.h>

#if defined(_WIN32) && !defined(APIENTRY) && !defined(__CYGWIN__)
#define WIN32_LEAN_AND_MEAN 1
Expand Down
6 changes: 3 additions & 3 deletions simulation/include/pcl/simulation/range_likelihood.h
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
#pragma once

#include <pcl/common/transforms.h>
#include <pcl/memory.h>
#include <pcl/pcl_config.h>
#include <pcl/pcl_macros.h>
#include <pcl/range_image/range_image_planar.h>
#include <pcl/simulation/camera.h>
#include <pcl/simulation/glsl_shader.h>
#include <pcl/simulation/scene.h>
#include <pcl/simulation/sum_reduce.h>
#include <pcl/memory.h>
#include <pcl/pcl_config.h>
#include <pcl/pcl_macros.h>

#include <Eigen/StdVector>

Expand Down
2 changes: 1 addition & 1 deletion simulation/include/pcl/simulation/sum_reduce.h
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@

#pragma once

#include <pcl/pcl_config.h>
#include <pcl/simulation/glsl_shader.h>
#include <pcl/simulation/model.h>
#include <pcl/pcl_config.h>

#include <GL/glew.h>
#ifdef OPENGL_IS_A_FRAMEWORK
Expand Down
2 changes: 1 addition & 1 deletion simulation/src/range_likelihood.cpp
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#include <pcl/common/time.h>
#include <pcl/pcl_config.h>
#include <pcl/simulation/range_likelihood.h>
#include <pcl/pcl_config.h>

#include <boost/math/distributions/normal.hpp>

Expand Down
6 changes: 3 additions & 3 deletions simulation/tools/sim_test_performance.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -13,14 +13,14 @@
#include <pcl/features/normal_3d.h>
#include <pcl/io/pcd_io.h>
#include <pcl/io/vtk_lib_io.h>
#include <pcl/memory.h>
#include <pcl/pcl_config.h>
#include <pcl/point_types.h>
#include <pcl/simulation/camera.h>
#include <pcl/simulation/model.h>
#include <pcl/simulation/range_likelihood.h>
#include <pcl/simulation/scene.h>
#include <pcl/surface/gp3.h>
#include <pcl/memory.h>
#include <pcl/pcl_config.h>
#include <pcl/point_types.h>

#include <Eigen/Dense>

Expand Down
6 changes: 3 additions & 3 deletions simulation/tools/sim_test_simple.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -23,16 +23,16 @@
#include <pcl/features/normal_3d.h>
#include <pcl/io/pcd_io.h>
#include <pcl/io/vtk_lib_io.h>
#include <pcl/memory.h>
#include <pcl/pcl_config.h>
#include <pcl/point_types.h>
#include <pcl/range_image/range_image_planar.h> // RangeImage
#include <pcl/simulation/camera.h>
#include <pcl/simulation/model.h>
#include <pcl/simulation/range_likelihood.h>
#include <pcl/simulation/scene.h>
#include <pcl/surface/gp3.h>
#include <pcl/visualization/cloud_viewer.h> // Pop-up viewer
#include <pcl/memory.h>
#include <pcl/pcl_config.h>
#include <pcl/point_types.h>

#include <Eigen/Dense>

Expand Down
6 changes: 3 additions & 3 deletions simulation/tools/sim_viewer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -45,9 +45,6 @@
#include <pcl/features/normal_3d.h>
#include <pcl/io/pcd_io.h>
#include <pcl/io/vtk_lib_io.h>
#include <pcl/memory.h>
#include <pcl/pcl_config.h>
#include <pcl/point_types.h>
#include <pcl/range_image/range_image_planar.h> // RangeImage
#include <pcl/simulation/camera.h>
#include <pcl/simulation/model.h>
Expand All @@ -60,6 +57,9 @@
#include <pcl/visualization/pcl_visualizer.h>
#include <pcl/visualization/point_cloud_handlers.h>
#include <pcl/visualization/point_picking_event.h>
#include <pcl/memory.h>
#include <pcl/pcl_config.h>
#include <pcl/point_types.h>

#include <Eigen/Dense>
#include <Eigen/Geometry>
Expand Down
6 changes: 3 additions & 3 deletions simulation/tools/simulation_io.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,12 @@

#include <pcl/io/pcd_io.h>
#include <pcl/io/vtk_lib_io.h>
#include <pcl/memory.h>
#include <pcl/pcl_config.h>
#include <pcl/point_types.h>
#include <pcl/simulation/camera.h>
#include <pcl/simulation/range_likelihood.h>
#include <pcl/simulation/scene.h>
#include <pcl/memory.h>
#include <pcl/pcl_config.h>
#include <pcl/point_types.h>

#include <GL/glew.h>

Expand Down
2 changes: 1 addition & 1 deletion stereo/include/pcl/stereo/digital_elevation_map.h
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,8 @@

#pragma once

#include <pcl/point_types.h>
#include <pcl/stereo/disparity_map_converter.h>
#include <pcl/point_types.h>

namespace pcl {

Expand Down
2 changes: 1 addition & 1 deletion stereo/include/pcl/stereo/impl/disparity_map_converter.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,8 @@

#include <pcl/common/intensity.h>
#include <pcl/console/print.h>
#include <pcl/point_types.h>
#include <pcl/stereo/disparity_map_converter.h>
#include <pcl/point_types.h>

#include <fstream>
#include <limits>
Expand Down
4 changes: 2 additions & 2 deletions stereo/include/pcl/stereo/stereo_grabber.h
Original file line number Diff line number Diff line change
Expand Up @@ -38,10 +38,10 @@
#pragma once

#include <pcl/common/time_trigger.h>
#include <pcl/conversions.h>
#include <pcl/io/grabber.h>
#include <pcl/point_cloud.h>
#include <pcl/stereo/stereo_matching.h>
#include <pcl/conversions.h>
#include <pcl/point_cloud.h>

namespace pcl {

Expand Down
2 changes: 1 addition & 1 deletion stereo/src/stereo_grabber.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -35,9 +35,9 @@
*
*/

#include <pcl/stereo/stereo_grabber.h>
#include <pcl/point_cloud.h>
#include <pcl/point_types.h>
#include <pcl/stereo/stereo_grabber.h>

///////////////////////////////////////////////////////////////////////////////////////////
//////////////////////// GrabberImplementation //////////////////////
Expand Down

0 comments on commit d3dedd4

Please sign in to comment.