Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[SofaKernel] Header include cleanup #638

Merged
merged 30 commits into from
May 31, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
30 commits
Select commit Hold shift + click to select a range
b7b5d9b
[all] FIX VS2017 build (Windows)
guparan Mar 26, 2018
47ae31d
FIX: VS2017 another way: explicit template instantiations before the …
epernod Apr 10, 2018
ea5921a
Merge remote-tracking branch 'upstream/master'
epernod Apr 13, 2018
870287f
[SofaBaseCollision] UPDATE: remove all unnecessary header include ins…
epernod Apr 13, 2018
2e1c309
[SofaBaseCollision] FIX: compilation. BaseIntTool header include is s…
epernod Apr 18, 2018
d07bff6
[SofaKernel] remove some header includes inside other headers in Sofa…
epernod Apr 18, 2018
b3c87d3
[SofaGui CMakeLists] Remove deprecated option SOFA_GUI_GLUT which is …
epernod May 10, 2018
2cefc62
[SofaGeneralLoader] CLEAN: remove unnecessary header includes in load…
epernod May 14, 2018
96c2049
[SofaKernelTopology] CLEAN: remove unnecessary header includes in sof…
epernod May 15, 2018
bd51340
[SofaGeneralTopology] CLEAN: remove unnecessary header includes in so…
epernod May 15, 2018
738b61c
[SofaKernel] CLEAN: remove unnecessary header includes in sofa::core
epernod May 16, 2018
aac50b2
[SofaKernel] CLEAN: remove unnecessary header includes in sofa::core:…
epernod May 17, 2018
a8b27ec
[SofaKernel] CLEAN: remove unnecessary header includes in sofa::core:…
epernod May 17, 2018
847bff6
[SofaKernel] FIX: compilation on gcc
epernod May 17, 2018
00fc74c
[SofaKernel] CLEAN: remove unnecessary header includes in sofa::core:…
epernod May 18, 2018
c383555
[SofaKernel] CLEAN: remove unnecessary header includes in sofa::helpe…
epernod May 18, 2018
4fe1fa2
[SofaKernel] FIX: compilation
epernod May 20, 2018
641378a
[SofaKernel] FIX: Try to fix linux compilation
epernod May 21, 2018
d553c2b
[SofaKernel] FIX: Try to fix macos compilation
epernod May 21, 2018
4ab963c
[SofaKernel] FIX: Try to fix msvc and macos compilations
epernod May 21, 2018
9a65c7f
[SofaKernel] FIX: Try to fix macos compilation again
epernod May 21, 2018
64854e7
[SofaKernel] CLEAN: remove unnecessary header includes in sofa::core:…
epernod May 23, 2018
09b1958
[Plugin Registration] Fix compilation due to header move.
epernod May 24, 2018
f5e7a87
[Plugin Flexible] Fix compilation due to header move. in an inl file …
epernod May 24, 2018
940555e
[Plugin optiTrackNatNet] Fix compilation due to header move.
epernod May 25, 2018
e5598fb
[SofaKernel] FIX: compilation, strlen is in cstring not string.
epernod May 28, 2018
0826474
[SofaKernel] FIX: reverse last commit
epernod May 28, 2018
e2cf12b
[SofaKernel] FIX: compilation of StringUtils on linux
epernod May 28, 2018
b5584a2
[SofaGeneralLoader] Revert: class GeneralLoader.h and some config.h i…
epernod May 28, 2018
bb4e3d2
Merge branch 'master' into header_include_cleanup
epernod May 30, 2018
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 1 addition & 10 deletions SofaGui/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -78,16 +78,7 @@ list(APPEND SOFAGUI_TARGETS SofaGuiCommon)

## OpenGL-based GUIs
if(NOT SOFA_NO_OPENGL)
## Glut GUI
if(SOFA_HAVE_GLUT)
option(SOFAGUI_GLUT "Compile the Glut GUI" OFF)
if(SOFAGUI_GLUT)
set(SOFA_GUI_GLUT 1) # cmakedefine
list(APPEND SOFAGUI_TARGETS SofaGuiGlut)
add_subdirectory(../applications/sofa/gui/glut ${CMAKE_CURRENT_BINARY_DIR}/SofaGuiGlut)
endif()
endif()


option(SOFAGUI_HEADLESS_RECORDER "Compile the headless recorder (Linux only)" OFF)
if(SOFAGUI_HEADLESS_RECORDER)
set(SOFA_GUI_HEADLESS_RECORDER 1) # cmakedefine
Expand Down
7 changes: 0 additions & 7 deletions SofaKernel/framework/sofa/core/BaseMapping.h
Original file line number Diff line number Diff line change
Expand Up @@ -22,17 +22,10 @@
#ifndef SOFA_CORE_BASEMAPPING_H
#define SOFA_CORE_BASEMAPPING_H

#include <cstdlib>
#include <string>
#include <iostream>

#include <sofa/core/objectmodel/BaseObject.h>
#include <sofa/core/BehaviorModel.h>
#include <sofa/core/behavior/MechanicalState.h>
#include <sofa/core/ConstraintParams.h>
#include <sofa/core/MechanicalParams.h>
#include <sofa/core/VecId.h>
#include <sofa/helper/vector.h>

namespace sofa
{
Expand Down
1 change: 0 additions & 1 deletion SofaKernel/framework/sofa/core/CollisionModel.h
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@
#ifndef SOFA_CORE_COLLISIONMODEL_H
#define SOFA_CORE_COLLISIONMODEL_H

#include <vector>
#include <sofa/core/objectmodel/BaseObject.h>
#include <sofa/core/CollisionElement.h>

Expand Down
4 changes: 1 addition & 3 deletions SofaKernel/framework/sofa/core/DataEngine.h
Original file line number Diff line number Diff line change
Expand Up @@ -27,10 +27,8 @@
#endif

#include <sofa/core/core.h>
#include <sofa/core/objectmodel/DDGNode.h>
#include <sofa/core/objectmodel/BaseObject.h>
#include <list>
#include "DataTracker.h"
#include <sofa/core/DataTracker.h>

namespace sofa
{
Expand Down
4 changes: 0 additions & 4 deletions SofaKernel/framework/sofa/core/Mapping.h
Original file line number Diff line number Diff line change
Expand Up @@ -23,11 +23,7 @@
#define SOFA_CORE_MAPPING_H

#include <sofa/core/BaseMapping.h>
#include <sofa/core/State.h>
#include <sofa/core/behavior/BaseMechanicalState.h>

#include <sofa/defaulttype/Vec3Types.h>
#include <sofa/defaulttype/RigidTypes.h>

namespace sofa
{
Expand Down
1 change: 0 additions & 1 deletion SofaKernel/framework/sofa/core/Multi2Mapping.h
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@

#include <sofa/core/BaseMapping.h>
#include <sofa/core/core.h>
#include <sofa/core/VecId.h>


namespace sofa
Expand Down
2 changes: 0 additions & 2 deletions SofaKernel/framework/sofa/core/MultiMapping.h
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,7 @@
#define SOFA_CORE_MULTIMAPPING_H

#include <sofa/core/BaseMapping.h>
#include <sofa/core/State.h>
#include <sofa/core/core.h>
#include <sofa/core/VecId.h>

namespace sofa
{
Expand Down
1 change: 0 additions & 1 deletion SofaKernel/framework/sofa/core/MultiVecId.h
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@

#include <sofa/core/VecId.h>

#include <map>

namespace sofa
{
Expand Down
6 changes: 0 additions & 6 deletions SofaKernel/framework/sofa/core/ObjectFactory.h
Original file line number Diff line number Diff line change
Expand Up @@ -23,14 +23,8 @@
#define SOFA_CORE_OBJECTFACTORY_H

#include <sofa/helper/system/config.h>
#include <sofa/core/objectmodel/BaseObjectDescription.h>
#include <sofa/core/objectmodel/BaseContext.h>
#include <sofa/core/objectmodel/BaseObject.h>

#include <map>
#include <memory>
#include <iostream>
#include <typeinfo>

namespace sofa
{
Expand Down
5 changes: 0 additions & 5 deletions SofaKernel/framework/sofa/core/Plugin.h
Original file line number Diff line number Diff line change
Expand Up @@ -50,12 +50,7 @@ public: \


#include <sofa/core/core.h>
#include <sofa/core/ObjectFactory.h>

#include <map>
#include <set>
#include <string>
#include <vector>

namespace sofa
{
Expand Down
4 changes: 0 additions & 4 deletions SofaKernel/framework/sofa/core/PluginManager.h
Original file line number Diff line number Diff line change
Expand Up @@ -26,10 +26,6 @@
#include <sofa/helper/system/DynamicLibrary.h>
#include <sofa/helper/system/FileSystem.h>

#include <map>
#include <set>
#include <string>
#include <vector>

namespace sofa
{
Expand Down
2 changes: 0 additions & 2 deletions SofaKernel/framework/sofa/core/State.h
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,7 @@

#include <sofa/core/core.h>
#include <sofa/core/BaseState.h>
#include <sofa/defaulttype/VecTypes.h>
#include <sofa/defaulttype/RigidTypes.h>
#include <limits>

namespace sofa
{
Expand Down
4 changes: 0 additions & 4 deletions SofaKernel/framework/sofa/core/VecId.h
Original file line number Diff line number Diff line change
Expand Up @@ -23,11 +23,7 @@
#define SOFA_CORE_VECID_H

#include <sofa/core/objectmodel/BaseObject.h>
#include <sofa/defaulttype/Vec.h>
#include <sofa/helper/logging/Messaging.h>

#include <sstream>
#include <iostream>

namespace sofa
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@
#define SOFA_CORE_BEHAVIOR_BASEANIMATIONLOOP_H

#include <sofa/core/objectmodel/BaseObject.h>
#include <sofa/core/ExecParams.h>

namespace sofa
{
Expand Down
5 changes: 0 additions & 5 deletions SofaKernel/framework/sofa/core/behavior/BaseConstraint.h
Original file line number Diff line number Diff line change
Expand Up @@ -23,13 +23,8 @@
#define SOFA_CORE_BEHAVIOR_BASECONSTRAINT_H

#include <sofa/core/behavior/BaseConstraintSet.h>
#include <sofa/core/behavior/BaseMechanicalState.h>
#include <sofa/core/behavior/MultiMatrixAccessor.h>

#include <sofa/defaulttype/BaseMatrix.h>
#include <sofa/defaulttype/BaseVector.h>

#include <vector>

namespace sofa
{
Expand Down
3 changes: 0 additions & 3 deletions SofaKernel/framework/sofa/core/behavior/BaseConstraintSet.h
Original file line number Diff line number Diff line change
Expand Up @@ -22,12 +22,9 @@
#ifndef SOFA_CORE_BEHAVIOR_BASECONSTRAINTSET_H
#define SOFA_CORE_BEHAVIOR_BASECONSTRAINTSET_H

#include <sofa/core/objectmodel/BaseObject.h>
#include <sofa/core/ConstraintParams.h>
#include <sofa/core/MultiVecId.h>
#include <sofa/core/core.h>

#include <sofa/defaulttype/BaseVector.h>


namespace sofa
Expand Down
5 changes: 0 additions & 5 deletions SofaKernel/framework/sofa/core/behavior/BaseForceField.h
Original file line number Diff line number Diff line change
Expand Up @@ -23,13 +23,8 @@
#define SOFA_CORE_BEHAVIOR_BASEFORCEFIELD_H

#include <sofa/core/core.h>
#include <sofa/core/MultiVecId.h>
#include <sofa/core/MechanicalParams.h>
#include <sofa/core/objectmodel/BaseObject.h>
#include <sofa/core/behavior/MultiMatrixAccessor.h>
#include <sofa/defaulttype/BaseMatrix.h>
#include <sofa/defaulttype/BaseVector.h>
#include <sofa/defaulttype/Vec.h>

namespace sofa
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@
#define SOFA_CORE_BEHAVIOR_BASEINTERACTIONCONSTRAINT_H

#include <sofa/core/behavior/BaseConstraint.h>
#include <sofa/core/behavior/BaseMechanicalState.h>

namespace sofa
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,6 @@
#define SOFA_CORE_BEHAVIOR_BASEINTERACTIONFORCEFIELD_H

#include <sofa/core/behavior/BaseForceField.h>
#include <sofa/core/behavior/BaseMechanicalState.h>
#include <sofa/core/MechanicalParams.h>
namespace sofa
{

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@
#define SOFA_CORE_BEHAVIOR_BASEINTERACTIONPROJECTIVECONSTRAINTSET_H

#include <sofa/core/behavior/BaseProjectiveConstraintSet.h>
#include <sofa/core/behavior/BaseMechanicalState.h>

namespace sofa
{
Expand Down
1 change: 0 additions & 1 deletion SofaKernel/framework/sofa/core/behavior/BaseLMConstraint.h
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@
#ifndef SOFA_COMPONENT_CONSTRAINT_BASELMCONSTRAINT_H
#define SOFA_COMPONENT_CONSTRAINT_BASELMCONSTRAINT_H

#include <sofa/core/behavior/BaseMechanicalState.h>
#include <sofa/core/behavior/BaseConstraintSet.h>
#include <sofa/core/core.h>

Expand Down
5 changes: 0 additions & 5 deletions SofaKernel/framework/sofa/core/behavior/BaseMass.h
Original file line number Diff line number Diff line change
Expand Up @@ -23,13 +23,8 @@
#define SOFA_CORE_BEHAVIOR_BASEMASS_H

#include <sofa/core/core.h>
#include <sofa/core/MultiVecId.h>
#include <sofa/core/MechanicalParams.h>
#include <sofa/core/objectmodel/BaseObject.h>
#include <sofa/core/behavior/MultiMatrixAccessor.h>
#include <sofa/defaulttype/BaseMatrix.h>
#include <sofa/defaulttype/BaseVector.h>
#include <sofa/defaulttype/Vec.h>
namespace sofa
{

Expand Down
3 changes: 0 additions & 3 deletions SofaKernel/framework/sofa/core/behavior/BaseMechanicalState.h
Original file line number Diff line number Diff line change
Expand Up @@ -22,17 +22,14 @@
#ifndef SOFA_CORE_BEHAVIOR_BASEMECHANICALSTATE_H
#define SOFA_CORE_BEHAVIOR_BASEMECHANICALSTATE_H

#include <sofa/config/build_option_experimental_features.h>
Copy link
Contributor

@damienmarchal damienmarchal May 31, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I merged without noticing this one.
It shouldnt be removed.
Because this one add some macro that are tested with
#ifdef XXXXX

So removing it "compile" but the resulting code is not working anymore.
....

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A very bad things is that even in condition like #if MACRO == 1
When the macro is not defined then its value is == 0 so removing the include line is silent.
https://gcc.gnu.org/onlinedocs/cpp/If.html

A workaround I can propose it to do:

#define MYTEST() 0 
....
#if MYTEST() 
        std::cout << "COUCOU A" << std::endl ;
#else
        std::cout << "COUCOU B" << std::endl ;
#endif 

So that we get error when MYTEST is not defined (the bad things is that the error is not very clear with some compilers):
with gcc:
toto.cpp:8:11: error: missing binary operator before token "("
#if MYTEST()

with clang:
toto.cpp:8:5: error: function-like macro 'MYTEST' is not defined
#if MYTEST()
^


#include <sofa/core/BaseState.h>
#include <sofa/core/MultiVecId.h>
#include <sofa/defaulttype/BaseMatrix.h>
#include <sofa/defaulttype/BaseVector.h>
#include <sofa/defaulttype/Vec.h>
#include <sofa/defaulttype/Quat.h>
#include <sofa/helper/StateMask.h>

#include <iostream>


namespace sofa
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@
#ifndef SOFA_CORE_BEHAVIOR_BASEVECTOROPERATION_H
#define SOFA_CORE_BEHAVIOR_BASEVECTOROPERATION_H

#include <sofa/core/MultiVecId.h>
#include <sofa/core/ExecParams.h>
#include <sofa/core/objectmodel/BaseContext.h>
#include <sofa/core/behavior/BaseMechanicalState.h>
Expand Down
2 changes: 0 additions & 2 deletions SofaKernel/framework/sofa/core/behavior/Constraint.h
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,6 @@
#include <sofa/core/core.h>
#include <sofa/core/behavior/BaseConstraint.h>
#include <sofa/core/behavior/MechanicalState.h>
#include <sofa/defaulttype/Vec3Types.h>
#include <sofa/defaulttype/RigidTypes.h>

namespace sofa
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,6 @@
#include <sofa/core/behavior/BaseConstraintCorrection.h>
#include <sofa/core/behavior/MechanicalState.h>

#include <sofa/defaulttype/VecTypes.h>
#include <sofa/defaulttype/RigidTypes.h>


namespace sofa
Expand Down
2 changes: 0 additions & 2 deletions SofaKernel/framework/sofa/core/behavior/ConstraintSolver.h
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,6 @@

#include <sofa/core/objectmodel/BaseObject.h>
#include <sofa/core/behavior/BaseConstraintSet.h>
#include <sofa/core/behavior/BaseMechanicalState.h>
#include <sofa/core/MechanicalParams.h>

namespace sofa
{
Expand Down
7 changes: 0 additions & 7 deletions SofaKernel/framework/sofa/core/behavior/ForceField.h
Original file line number Diff line number Diff line change
Expand Up @@ -24,13 +24,6 @@

#include <sofa/core/core.h>
#include <sofa/core/behavior/BaseForceField.h>
#include <sofa/core/behavior/MechanicalState.h>
#include <sofa/core/objectmodel/Data.h>
#include <sofa/core/MechanicalParams.h>
#include <sofa/defaulttype/BaseVector.h>
#include <sofa/defaulttype/Vec.h>
#include <sofa/defaulttype/VecTypes.h>
#include <sofa/defaulttype/RigidTypes.h>

namespace sofa
{
Expand Down
2 changes: 0 additions & 2 deletions SofaKernel/framework/sofa/core/behavior/InertiaForce.h
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,6 @@
#define SOFA_CORE_INTERTIAFORCE_H

#include <sofa/defaulttype/VecTypes.h>
#include <sofa/defaulttype/RigidTypes.h>
#include <sofa/defaulttype/LaparoscopicRigidTypes.h>
#include <sofa/core/objectmodel/BaseContext.h>

namespace sofa
Expand Down
3 changes: 0 additions & 3 deletions SofaKernel/framework/sofa/core/behavior/LMConstraint.h
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,6 @@
#include <sofa/core/core.h>
#include <sofa/core/behavior/BaseLMConstraint.h>
#include <sofa/core/behavior/MechanicalState.h>
#include <sofa/core/objectmodel/BaseObject.h>
#include <sofa/defaulttype/VecTypes.h>
#include <sofa/defaulttype/RigidTypes.h>

namespace sofa
{
Expand Down
7 changes: 3 additions & 4 deletions SofaKernel/framework/sofa/core/behavior/LinearSolver.h
Original file line number Diff line number Diff line change
Expand Up @@ -23,12 +23,11 @@
#define SOFA_CORE_BEHAVIOR_LINEARSOLVER_H

#include <sofa/core/objectmodel/BaseObject.h>
#include <sofa/core/behavior/BaseMechanicalState.h>
#include <sofa/core/behavior/MultiMatrixAccessor.h>
#include <sofa/core/MultiVecId.h>

#include <sofa/core/MechanicalParams.h>
#include <sofa/defaulttype/BaseMatrix.h>
#include <sofa/defaulttype/BaseVector.h>

#include <sofa/core/behavior/MultiMatrixAccessor.h>
#include <sofa/core/ConstraintParams.h>


Expand Down
7 changes: 0 additions & 7 deletions SofaKernel/framework/sofa/core/behavior/Mass.h
Original file line number Diff line number Diff line change
Expand Up @@ -23,15 +23,8 @@
#define SOFA_CORE_BEHAVIOR_MASS_H

#include <sofa/core/core.h>
#include <sofa/core/MultiVecId.h>
#include <sofa/core/MechanicalParams.h>
#include <sofa/core/behavior/BaseMass.h>
#include <sofa/core/behavior/ForceField.h>
#include <sofa/core/behavior/MechanicalState.h>
#include <sofa/core/objectmodel/Data.h>
#include <sofa/defaulttype/Vec.h>
#include <sofa/defaulttype/VecTypes.h>
#include <sofa/defaulttype/RigidTypes.h>

namespace sofa
{
Expand Down
2 changes: 0 additions & 2 deletions SofaKernel/framework/sofa/core/behavior/MechanicalState.h
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,7 @@
#define SOFA_CORE_BEHAVIOR_MECHANICALSTATE_H

#include <sofa/core/behavior/BaseMechanicalState.h>
#include <sofa/core/VecId.h>
#include <sofa/core/State.h>
#include <sofa/defaulttype/DataTypeInfo.h>

namespace sofa
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,12 +22,8 @@
#ifndef SOFA_CORE_BEHAVIOR_MIXEDINTERACTIONCONSTRAINT_H
#define SOFA_CORE_BEHAVIOR_MIXEDINTERACTIONCONSTRAINT_H

#include <sofa/core/core.h>
#include <sofa/core/ConstraintParams.h>
#include <sofa/core/behavior/BaseInteractionConstraint.h>
#include <sofa/core/behavior/MechanicalState.h>
#include <sofa/defaulttype/VecTypes.h>
#include <sofa/defaulttype/RigidTypes.h>

namespace sofa
{
Expand Down
Loading