From 8d21f54179907d33b160a3022e23406a45dc896b Mon Sep 17 00:00:00 2001 From: Florian Jung Date: Tue, 23 Jul 2019 17:19:42 +0200 Subject: [PATCH] Run include-what-you-use on the code --- include/Frame.h | 6 +++++- include/KeyFrame.h | 9 +++++++-- include/LocalMapping.h | 8 ++++++-- include/LoopClosing.h | 19 +++++++++++++++---- include/Map.h | 7 ++++--- include/Optimizer.h | 12 +++++++++++- include/PnPsolver.h | 6 ++++++ include/Sim3Solver.h | 4 ++++ include/Viewer.h | 5 +++-- src/Converter.cc | 4 ++++ src/Frame.cc | 14 +++++++++++++- src/FrameDrawer.cc | 11 ++++++++--- src/Initializer.cc | 11 ++++++++--- src/KeyFrame.cc | 14 +++++++++++++- src/KeyFrameDatabase.cc | 8 ++++++++ src/LocalMapping.cc | 16 ++++++++++++++-- src/LoopClosing.cc | 19 +++++++++++++++---- src/Map.cc | 3 +++ src/MapDrawer.cc | 11 +++++++++-- src/MapPoint.cc | 11 +++++++++++ src/ORBextractor.cc | 19 +++++++++++++------ src/PnPsolver.cc | 11 ++++++----- src/Sim3Solver.cc | 10 ++++++---- src/System.cc | 23 ++++++++++++++++++++--- src/Viewer.cc | 11 +++++++++-- 25 files changed, 221 insertions(+), 51 deletions(-) diff --git a/include/Frame.h b/include/Frame.h index a6a8032f57..176a7f5de9 100644 --- a/include/Frame.h +++ b/include/Frame.h @@ -23,6 +23,10 @@ #include +#include +#include +#include + #include "MapPoint.h" #include "Thirdparty/DBoW2/DBoW2/BowVector.h" #include "Thirdparty/DBoW2/DBoW2/FeatureVector.h" @@ -30,7 +34,7 @@ #include "KeyFrame.h" #include "ORBextractor.h" -#include +namespace ORB_SLAM2 { class ORBextractor; } namespace ORB_SLAM2 { diff --git a/include/KeyFrame.h b/include/KeyFrame.h index 67f4348273..71e3a5db5c 100644 --- a/include/KeyFrame.h +++ b/include/KeyFrame.h @@ -21,6 +21,13 @@ #ifndef KEYFRAME_H #define KEYFRAME_H +#include +#include +#include +#include +#include +#include + #include "MapPoint.h" #include "Thirdparty/DBoW2/DBoW2/BowVector.h" #include "Thirdparty/DBoW2/DBoW2/FeatureVector.h" @@ -29,8 +36,6 @@ #include "Frame.h" #include "KeyFrameDatabase.h" -#include - namespace ORB_SLAM2 { diff --git a/include/LocalMapping.h b/include/LocalMapping.h index 1361a5757a..5cf34dccd6 100644 --- a/include/LocalMapping.h +++ b/include/LocalMapping.h @@ -21,14 +21,16 @@ #ifndef LOCALMAPPING_H #define LOCALMAPPING_H +#include +#include +#include + #include "KeyFrame.h" #include "Map.h" #include "LoopClosing.h" #include "Tracking.h" #include "KeyFrameDatabase.h" -#include - namespace ORB_SLAM2 { @@ -36,6 +38,8 @@ namespace ORB_SLAM2 class Tracking; class LoopClosing; class Map; +class KeyFrame; +class MapPoint; class LocalMapping { diff --git a/include/LoopClosing.h b/include/LoopClosing.h index c3adf13acd..abcc167c48 100644 --- a/include/LoopClosing.h +++ b/include/LoopClosing.h @@ -21,17 +21,25 @@ #ifndef LOOPCLOSING_H #define LOOPCLOSING_H +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + #include "KeyFrame.h" #include "LocalMapping.h" #include "Map.h" #include "ORBVocabulary.h" #include "Tracking.h" - #include "KeyFrameDatabase.h" - -#include -#include #include "Thirdparty/g2o/g2o/types/types_seven_dof_expmap.h" +#include "Thirdparty/g2o/g2o/types/sim3.h" namespace ORB_SLAM2 { @@ -39,6 +47,9 @@ namespace ORB_SLAM2 class Tracking; class LocalMapping; class KeyFrameDatabase; +class KeyFrame; +class Map; +class MapPoint; class LoopClosing diff --git a/include/Map.h b/include/Map.h index a75339feea..53f2c8ca75 100644 --- a/include/Map.h +++ b/include/Map.h @@ -21,11 +21,12 @@ #ifndef MAP_H #define MAP_H -#include "MapPoint.h" -#include "KeyFrame.h" #include - #include +#include + +#include "MapPoint.h" +#include "KeyFrame.h" diff --git a/include/Optimizer.h b/include/Optimizer.h index 2c4378ed3b..0aca5822fb 100644 --- a/include/Optimizer.h +++ b/include/Optimizer.h @@ -21,18 +21,28 @@ #ifndef OPTIMIZER_H #define OPTIMIZER_H +#include +#include +#include +#include + #include "Map.h" #include "MapPoint.h" #include "KeyFrame.h" #include "LoopClosing.h" #include "Frame.h" - #include "Thirdparty/g2o/g2o/types/types_seven_dof_expmap.h" +namespace g2o { struct Sim3; } + namespace ORB_SLAM2 { class LoopClosing; +class Frame; +class KeyFrame; +class Map; +class MapPoint; class Optimizer { diff --git a/include/PnPsolver.h b/include/PnPsolver.h index 120f842d5e..5558dcbd41 100644 --- a/include/PnPsolver.h +++ b/include/PnPsolver.h @@ -53,11 +53,17 @@ #include #include +#include +#include +#include + #include "MapPoint.h" #include "Frame.h" namespace ORB_SLAM2 { +class Frame; +class MapPoint; class PnPsolver { public: diff --git a/include/Sim3Solver.h b/include/Sim3Solver.h index 9af66cb26f..35bb0882b4 100644 --- a/include/Sim3Solver.h +++ b/include/Sim3Solver.h @@ -23,6 +23,8 @@ #define SIM3SOLVER_H #include +#include +#include #include #include "KeyFrame.h" @@ -31,6 +33,8 @@ namespace ORB_SLAM2 { +class KeyFrame; +class MapPoint; class Sim3Solver { diff --git a/include/Viewer.h b/include/Viewer.h index 251e223c54..c842ed4965 100644 --- a/include/Viewer.h +++ b/include/Viewer.h @@ -22,13 +22,14 @@ #ifndef VIEWER_H #define VIEWER_H +#include +#include + #include "FrameDrawer.h" #include "MapDrawer.h" #include "Tracking.h" #include "System.h" -#include - namespace ORB_SLAM2 { diff --git a/src/Converter.cc b/src/Converter.cc index 524054c4a1..b0f2872d7b 100644 --- a/src/Converter.cc +++ b/src/Converter.cc @@ -21,6 +21,10 @@ #include "Converter.h" // IWYU pragma: associated +#include +#include +#include + namespace ORB_SLAM2 { diff --git a/src/Frame.cc b/src/Frame.cc index bb03714e72..1af0526fac 100644 --- a/src/Frame.cc +++ b/src/Frame.cc @@ -19,9 +19,21 @@ */ #include "Frame.h" // IWYU pragma: associated + +#include +#include +#include +#include +#include +#include +#include +#include +#include + #include "Converter.h" #include "ORBmatcher.h" -#include +#include "MapPoint.h" +#include "ORBextractor.h" namespace ORB_SLAM2 { diff --git a/src/FrameDrawer.cc b/src/FrameDrawer.cc index 7ab64aad11..03dffebdb7 100644 --- a/src/FrameDrawer.cc +++ b/src/FrameDrawer.cc @@ -19,10 +19,15 @@ */ #include "FrameDrawer.h" // IWYU pragma: associated -#include "Tracking.h" -#include -#include +#include +#include +#include + +#include "Tracking.h" +#include "Frame.h" +#include "Map.h" +#include "MapPoint.h" #include diff --git a/src/Initializer.cc b/src/Initializer.cc index ec85220877..92c78dc01f 100644 --- a/src/Initializer.cc +++ b/src/Initializer.cc @@ -20,10 +20,15 @@ #include "Initializer.h" // IWYU pragma: associated -#include "Thirdparty/DBoW2/DUtils/Random.h" +#include +#include +#include +#include +#include +#include -#include "Optimizer.h" -#include "ORBmatcher.h" +#include "Thirdparty/DBoW2/DUtils/Random.h" +#include "Frame.h" #include diff --git a/src/KeyFrame.cc b/src/KeyFrame.cc index d91c56b65a..082ab3a586 100644 --- a/src/KeyFrame.cc +++ b/src/KeyFrame.cc @@ -19,8 +19,20 @@ */ #include "KeyFrame.h" // IWYU pragma: associated + +#include +#include +#include +#include +#include +#include + #include "Converter.h" -#include "ORBmatcher.h" +#include "Frame.h" +#include "KeyFrameDatabase.h" +#include "Map.h" +#include "MapPoint.h" + #include namespace ORB_SLAM2 diff --git a/src/KeyFrameDatabase.cc b/src/KeyFrameDatabase.cc index 8759f74936..731e6d03b0 100644 --- a/src/KeyFrameDatabase.cc +++ b/src/KeyFrameDatabase.cc @@ -20,8 +20,16 @@ #include "KeyFrameDatabase.h" // IWYU pragma: associated +#include +#include +#include +#include +#include +#include + #include "KeyFrame.h" #include "Thirdparty/DBoW2/DBoW2/BowVector.h" +#include "Frame.h" #include diff --git a/src/LocalMapping.cc b/src/LocalMapping.cc index bd96728301..0c025fbb91 100644 --- a/src/LocalMapping.cc +++ b/src/LocalMapping.cc @@ -19,11 +19,23 @@ */ #include "LocalMapping.h" // IWYU pragma: associated + +#include +#include +#include +#include +#include +#include +#include +#include +#include + #include "LoopClosing.h" #include "ORBmatcher.h" #include "Optimizer.h" - -#include +#include "KeyFrame.h" +#include "Map.h" +#include "MapPoint.h" #include diff --git a/src/LoopClosing.cc b/src/LoopClosing.cc index 442fa71fe6..280cbb405a 100644 --- a/src/LoopClosing.cc +++ b/src/LoopClosing.cc @@ -20,15 +20,26 @@ #include "LoopClosing.h" // IWYU pragma: associated -#include "Sim3Solver.h" +#include +#include +#include +#include +#include +#include +#include +#include "Sim3Solver.h" #include "Converter.h" - #include "Optimizer.h" - #include "ORBmatcher.h" +#include "KeyFrame.h" +#include "KeyFrameDatabase.h" +#include "LocalMapping.h" +#include "Map.h" +#include "MapPoint.h" + +namespace DBoW2 { class BowVector; } -#include #include #include diff --git a/src/Map.cc b/src/Map.cc index 99c0b3c31c..87aa7d220a 100644 --- a/src/Map.cc +++ b/src/Map.cc @@ -20,6 +20,9 @@ #include "Map.h" // IWYU pragma: associated +#include "KeyFrame.h" +#include "MapPoint.h" + #include namespace ORB_SLAM2 diff --git a/src/MapDrawer.cc b/src/MapDrawer.cc index ad773ae8ee..a0b411a649 100644 --- a/src/MapDrawer.cc +++ b/src/MapDrawer.cc @@ -19,10 +19,17 @@ */ #include "MapDrawer.h" // IWYU pragma: associated -#include "MapPoint.h" -#include "KeyFrame.h" + #include +#include +#include #include +#include +#include + +#include "MapPoint.h" +#include "KeyFrame.h" +#include "Map.h" namespace ORB_SLAM2 { diff --git a/src/MapPoint.cc b/src/MapPoint.cc index fc7966640f..1ee29acee5 100644 --- a/src/MapPoint.cc +++ b/src/MapPoint.cc @@ -19,7 +19,18 @@ */ #include "MapPoint.h" // IWYU pragma: associated + +#include +#include +#include +#include +#include +#include + #include "ORBmatcher.h" +#include "Frame.h" +#include "KeyFrame.h" +#include "Map.h" #include diff --git a/src/ORBextractor.cc b/src/ORBextractor.cc index 9c121fdd81..4ca2c16c04 100644 --- a/src/ORBextractor.cc +++ b/src/ORBextractor.cc @@ -54,14 +54,21 @@ */ -#include -#include -#include -#include -#include - #include "ORBextractor.h" // IWYU pragma: associated +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + using namespace cv; using namespace std; diff --git a/src/PnPsolver.cc b/src/PnPsolver.cc index b515bdf381..f65b697d8b 100644 --- a/src/PnPsolver.cc +++ b/src/PnPsolver.cc @@ -48,16 +48,17 @@ * either expressed or implied, of the FreeBSD Project */ -#include - #include "PnPsolver.h" // IWYU pragma: associated +#include #include #include -#include -#include -#include "Thirdparty/DBoW2/DUtils/Random.h" #include +#include + +#include "Thirdparty/DBoW2/DUtils/Random.h" +#include "Frame.h" +#include "MapPoint.h" using namespace std; diff --git a/src/Sim3Solver.cc b/src/Sim3Solver.cc index 68437630fa..cb92505f72 100644 --- a/src/Sim3Solver.cc +++ b/src/Sim3Solver.cc @@ -21,15 +21,17 @@ #include "Sim3Solver.h" // IWYU pragma: associated +#include +#include +#include #include #include -#include -#include +#include +#include #include "KeyFrame.h" -#include "ORBmatcher.h" - #include "Thirdparty/DBoW2/DUtils/Random.h" +#include "MapPoint.h" namespace ORB_SLAM2 { diff --git a/src/System.cc b/src/System.cc index b58790d386..95ef708c20 100644 --- a/src/System.cc +++ b/src/System.cc @@ -21,14 +21,31 @@ #include "System.h" // IWYU pragma: associated -#include "Converter.h" -#include + #include -#include #include +#include +#include +#include +#include +#include +#include + +#include "Converter.h" +#include "Frame.h" +#include "FrameDrawer.h" +#include "KeyFrame.h" +#include "KeyFrameDatabase.h" +#include "LocalMapping.h" +#include "LoopClosing.h" +#include "Map.h" +#include "MapDrawer.h" +#include "Tracking.h" +#include "Viewer.h" namespace ORB_SLAM2 { +class MapPoint; System::System(const string &strVocFile, const string &strSettingsFile, const eSensor sensor, const bool bUseViewer):mSensor(sensor), mpViewer(static_cast(NULL)), mbReset(false),mbActivateLocalizationMode(false), diff --git a/src/Viewer.cc b/src/Viewer.cc index f9f6467257..9fc13e6505 100644 --- a/src/Viewer.cc +++ b/src/Viewer.cc @@ -19,10 +19,17 @@ */ #include "Viewer.h" // IWYU pragma: associated -#include -#include +#include #include +#include +#include +#include +#include + +#include "FrameDrawer.h" +#include "MapDrawer.h" +#include "System.h" namespace ORB_SLAM2 {