diff --git a/SofaKernel/modules/Sofa.Compat/src/sofa/core/visual/DrawTool.h b/SofaKernel/modules/Sofa.Compat/src/sofa/core/visual/DrawTool.h index 90aa3afb00d..0f5328fb468 100644 --- a/SofaKernel/modules/Sofa.Compat/src/sofa/core/visual/DrawTool.h +++ b/SofaKernel/modules/Sofa.Compat/src/sofa/core/visual/DrawTool.h @@ -21,13 +21,6 @@ ******************************************************************************/ #pragma once -#include +#include - -SOFA_DEPRECATED_HEADER(v21.06, "sofa/helper/visual/DrawTool.h") - -namespace sofa::core::visual -{ - using DrawTool = sofa::helper::visual::DrawTool; - -} // namespace sofa::core::visual +SOFA_DISABLED_HEADER("v20.12 (PR#1649)", "v21.06", "sofa/helper/visual/DrawTool.h") diff --git a/SofaKernel/modules/Sofa.Compat/src/sofa/core/visual/DrawToolGL.h b/SofaKernel/modules/Sofa.Compat/src/sofa/core/visual/DrawToolGL.h index 8422260f355..c31912b9fa1 100644 --- a/SofaKernel/modules/Sofa.Compat/src/sofa/core/visual/DrawToolGL.h +++ b/SofaKernel/modules/Sofa.Compat/src/sofa/core/visual/DrawToolGL.h @@ -21,26 +21,6 @@ ******************************************************************************/ #pragma once +#include -#if __has_include() -#include -#define GL_DRAWTOOLGL_ENABLE_WRAPPER - -SOFA_DEPRECATED_HEADER(v21.06, "sofa/gl/DrawToolGL.h") - -#else -#error "OpenGL headers have been moved to Sofa.GL. Therefore you will need to link against Sofa.GL if you need OpenGL (PR1649), and include instead of this one." -#endif - -#ifdef GL_DRAWTOOLGL_ENABLE_WRAPPER - -namespace sofa::core::visual -{ - using DrawToolGL = sofa::gl::DrawToolGL; - -} // namespace sofa::core::visual - -#endif // GL_DRAWTOOLGL_ENABLE_WRAPPER - -#undef GL_DRAWTOOLGL_ENABLE_WRAPPER - +SOFA_DISABLED_HEADER("v20.12 (PR#1649)", "v21.06", "sofa/gl/DrawToolGL.h") diff --git a/SofaKernel/modules/Sofa.Compat/src/sofa/defaulttype/BoundingBox.h b/SofaKernel/modules/Sofa.Compat/src/sofa/defaulttype/BoundingBox.h index 1e414296c03..b193a5a425f 100644 --- a/SofaKernel/modules/Sofa.Compat/src/sofa/defaulttype/BoundingBox.h +++ b/SofaKernel/modules/Sofa.Compat/src/sofa/defaulttype/BoundingBox.h @@ -23,7 +23,7 @@ #include -// SOFA_DEPRECATED_HEADER(v21.12, "sofa/type/BoundingBox.h") +// SOFA_DEPRECATED_HEADER("v21.06", "v21.12", "sofa/type/BoundingBox.h") namespace sofa::defaulttype { diff --git a/SofaKernel/modules/Sofa.Compat/src/sofa/defaulttype/Frame.h b/SofaKernel/modules/Sofa.Compat/src/sofa/defaulttype/Frame.h index 54de017e2c7..508374b2013 100644 --- a/SofaKernel/modules/Sofa.Compat/src/sofa/defaulttype/Frame.h +++ b/SofaKernel/modules/Sofa.Compat/src/sofa/defaulttype/Frame.h @@ -23,7 +23,7 @@ #include -// SOFA_DEPRECATED_HEADER(v21.12, "sofa/type/Frame.h") +// SOFA_DEPRECATED_HEADER("v21.06", "v21.12", "sofa/type/Frame.h") namespace sofa::defaulttype { diff --git a/SofaKernel/modules/Sofa.Compat/src/sofa/defaulttype/Mat.h b/SofaKernel/modules/Sofa.Compat/src/sofa/defaulttype/Mat.h index 928326889a8..65a89eb1dba 100644 --- a/SofaKernel/modules/Sofa.Compat/src/sofa/defaulttype/Mat.h +++ b/SofaKernel/modules/Sofa.Compat/src/sofa/defaulttype/Mat.h @@ -32,7 +32,7 @@ // The following SOFA_DEPRECATED_HEADER is commented to avoid a massive number of warnings. // This flag will be enabled once all the code base in Sofa is ported to Sofa.Type. // (PR #1790) -//SOFA_DEPRECATED_HEADER(v21.12, "sofa/type/Mat.h") +//SOFA_DEPRECATED_HEADER("v21.06", "v21.12", "sofa/type/Mat.h") namespace sofa::defaulttype { diff --git a/SofaKernel/modules/Sofa.Compat/src/sofa/defaulttype/MatSym.h b/SofaKernel/modules/Sofa.Compat/src/sofa/defaulttype/MatSym.h index 2036374190f..82c07a85e8c 100644 --- a/SofaKernel/modules/Sofa.Compat/src/sofa/defaulttype/MatSym.h +++ b/SofaKernel/modules/Sofa.Compat/src/sofa/defaulttype/MatSym.h @@ -27,7 +27,7 @@ // The following SOFA_DEPRECATED_HEADER is commented to avoid a massive number of warnings. // This flag will be enabled once all the code base in Sofa is ported to Sofa.Type. // (PR #1790) -// SOFA_DEPRECATED_HEADER(v21.12, "sofa/type/MatSym.h") +// SOFA_DEPRECATED_HEADER("v21.06", "v21.12", "sofa/type/MatSym.h") namespace sofa::defaulttype { diff --git a/SofaKernel/modules/Sofa.Compat/src/sofa/defaulttype/Mat_solve_Cholesky.h b/SofaKernel/modules/Sofa.Compat/src/sofa/defaulttype/Mat_solve_Cholesky.h index b22773c789b..3c0077ff6ed 100644 --- a/SofaKernel/modules/Sofa.Compat/src/sofa/defaulttype/Mat_solve_Cholesky.h +++ b/SofaKernel/modules/Sofa.Compat/src/sofa/defaulttype/Mat_solve_Cholesky.h @@ -23,4 +23,4 @@ #include -SOFA_DEPRECATED_HEADER(v21.12, "sofa/type/Mat_solve_Cholesky.h") +SOFA_DEPRECATED_HEADER("v21.06", "v21.12", "sofa/type/Mat_solve_Cholesky.h") diff --git a/SofaKernel/modules/Sofa.Compat/src/sofa/defaulttype/Mat_solve_LU.h b/SofaKernel/modules/Sofa.Compat/src/sofa/defaulttype/Mat_solve_LU.h index f696ce18daf..e09d7933e83 100644 --- a/SofaKernel/modules/Sofa.Compat/src/sofa/defaulttype/Mat_solve_LU.h +++ b/SofaKernel/modules/Sofa.Compat/src/sofa/defaulttype/Mat_solve_LU.h @@ -23,4 +23,4 @@ #include -SOFA_DEPRECATED_HEADER(v21.12, "sofa/type/Mat_solve_LU.h") +SOFA_DEPRECATED_HEADER("v21.06", "v21.12", "sofa/type/Mat_solve_LU.h") diff --git a/SofaKernel/modules/Sofa.Compat/src/sofa/defaulttype/Mat_solve_SVD.h b/SofaKernel/modules/Sofa.Compat/src/sofa/defaulttype/Mat_solve_SVD.h index 87fa25ba9e1..bfec8005a25 100644 --- a/SofaKernel/modules/Sofa.Compat/src/sofa/defaulttype/Mat_solve_SVD.h +++ b/SofaKernel/modules/Sofa.Compat/src/sofa/defaulttype/Mat_solve_SVD.h @@ -23,4 +23,4 @@ #include -SOFA_DEPRECATED_HEADER(v21.12, "sofa/type/Mat_solve_SVD.h") +SOFA_DEPRECATED_HEADER("v21.06", "v21.12", "sofa/type/Mat_solve_SVD.h") diff --git a/SofaKernel/modules/Sofa.Compat/src/sofa/defaulttype/Quat.h b/SofaKernel/modules/Sofa.Compat/src/sofa/defaulttype/Quat.h index f43c5b1a085..69ddad862c0 100644 --- a/SofaKernel/modules/Sofa.Compat/src/sofa/defaulttype/Quat.h +++ b/SofaKernel/modules/Sofa.Compat/src/sofa/defaulttype/Quat.h @@ -26,7 +26,7 @@ // The following SOFA_DEPRECATED_HEADER is commented to avoid a massive number of warnings. // This flag will be enabled once all the code base in Sofa is ported to Sofa.Type. // (PR #1790) -// SOFA_DEPRECATED_HEADER(v21.12, "sofa/type/Quat.h") +// SOFA_DEPRECATED_HEADER("v21.06", "v21.12", "sofa/type/Quat.h") #include #include diff --git a/SofaKernel/modules/Sofa.Compat/src/sofa/defaulttype/RGBAColor.h b/SofaKernel/modules/Sofa.Compat/src/sofa/defaulttype/RGBAColor.h index 19ad44386ad..0ea358d9cef 100644 --- a/SofaKernel/modules/Sofa.Compat/src/sofa/defaulttype/RGBAColor.h +++ b/SofaKernel/modules/Sofa.Compat/src/sofa/defaulttype/RGBAColor.h @@ -25,7 +25,6 @@ namespace sofa::defaulttype { - [[deprecated("sofa::defaulttype::RGBAColor is now part in sofa::type::RGBAColor. Please update your code.")]] + SOFA_ATTRIBUTE_DEPRECATED("v21.06 (PR#1818)", "v21.12", "Use sofa::type::RGBAColor instead.") typedef sofa::type::RGBAColor RGBAColor; - -} // namespace sofa::defaulttype +} diff --git a/SofaKernel/modules/Sofa.Compat/src/sofa/defaulttype/Ray.h b/SofaKernel/modules/Sofa.Compat/src/sofa/defaulttype/Ray.h index 4e175c190b2..cbd537dccca 100644 --- a/SofaKernel/modules/Sofa.Compat/src/sofa/defaulttype/Ray.h +++ b/SofaKernel/modules/Sofa.Compat/src/sofa/defaulttype/Ray.h @@ -23,7 +23,7 @@ #include -// SOFA_DEPRECATED_HEADER(v21.12, "sofa/defaulttype/Ray.h") +// SOFA_DEPRECATED_HEADER("v21.06", "v21.12", "sofa/defaulttype/Ray.h") namespace sofa::defaulttype { diff --git a/SofaKernel/modules/Sofa.Compat/src/sofa/defaulttype/Vec.h b/SofaKernel/modules/Sofa.Compat/src/sofa/defaulttype/Vec.h index 845ddbb7b1a..b5e2f04155a 100644 --- a/SofaKernel/modules/Sofa.Compat/src/sofa/defaulttype/Vec.h +++ b/SofaKernel/modules/Sofa.Compat/src/sofa/defaulttype/Vec.h @@ -27,7 +27,7 @@ // The following SOFA_DEPRECATED_HEADER is commented to avoid a massive number of warnings. // This flag will be enabled once all the code base in Sofa is ported to Sofa.Type. // (PR #1790) -//SOFA_DEPRECATED_HEADER(v21.12, "sofa/type/Vec.h") +//SOFA_DEPRECATED_HEADER("v21.06", "v21.12", "sofa/type/Vec.h") namespace sofa::defaulttype { diff --git a/SofaKernel/modules/Sofa.Compat/src/sofa/helper/DualQuat.h b/SofaKernel/modules/Sofa.Compat/src/sofa/helper/DualQuat.h index b42598973fb..20dcb506907 100644 --- a/SofaKernel/modules/Sofa.Compat/src/sofa/helper/DualQuat.h +++ b/SofaKernel/modules/Sofa.Compat/src/sofa/helper/DualQuat.h @@ -26,7 +26,7 @@ // The following SOFA_DEPRECATED_HEADER is commented to avoid a massive number of warnings. // This flag will be enabled once all the code base in Sofa is ported to Sofa.Type. // (PR #1790) -// SOFA_DEPRECATED_HEADER(v21.12, "sofa/type/DualQuat.h") +// SOFA_DEPRECATED_HEADER("v21.06", "v21.12", "sofa/type/DualQuat.h") namespace sofa::helper { diff --git a/SofaKernel/modules/Sofa.Compat/src/sofa/helper/DualQuat.inl b/SofaKernel/modules/Sofa.Compat/src/sofa/helper/DualQuat.inl index 3a8703adb87..1c4bacb718c 100644 --- a/SofaKernel/modules/Sofa.Compat/src/sofa/helper/DualQuat.inl +++ b/SofaKernel/modules/Sofa.Compat/src/sofa/helper/DualQuat.inl @@ -26,4 +26,4 @@ // The following SOFA_DEPRECATED_HEADER is commented to avoid a massive number of warnings. // This flag will be enabled once all the code base in Sofa is ported to Sofa.Type. // (PR #1790) -// SOFA_DEPRECATED_HEADER(v21.12, "sofa/type/DualQuat.inl") +// SOFA_DEPRECATED_HEADER("v21.06", "v21.12", "sofa/type/DualQuat.inl") diff --git a/SofaKernel/modules/Sofa.Compat/src/sofa/helper/Quater.h b/SofaKernel/modules/Sofa.Compat/src/sofa/helper/Quater.h index ed8434c0e6f..8888c70ede5 100644 --- a/SofaKernel/modules/Sofa.Compat/src/sofa/helper/Quater.h +++ b/SofaKernel/modules/Sofa.Compat/src/sofa/helper/Quater.h @@ -26,7 +26,7 @@ // The following SOFA_DEPRECATED_HEADER is commented to avoid a massive number of warnings. // This flag will be enabled once all the code base in Sofa is ported to Sofa.Type. // (PR #1790) -//SOFA_DEPRECATED_HEADER(v21.12, "sofa/type/Quat.h") +//SOFA_DEPRECATED_HEADER("v21.06", "v21.12", "sofa/type/Quat.h") #include #include diff --git a/SofaKernel/modules/Sofa.Compat/src/sofa/helper/Quater.inl b/SofaKernel/modules/Sofa.Compat/src/sofa/helper/Quater.inl index 98485cdf9fc..1821243a436 100644 --- a/SofaKernel/modules/Sofa.Compat/src/sofa/helper/Quater.inl +++ b/SofaKernel/modules/Sofa.Compat/src/sofa/helper/Quater.inl @@ -26,4 +26,4 @@ // The following SOFA_DEPRECATED_HEADER is commented to avoid a massive number of warnings. // This flag will be enabled once all the code base in Sofa is ported to Sofa.Type. // (PR #1790) -// SOFA_DEPRECATED_HEADER(v21.12, "sofa/type/Quat.inl") +// SOFA_DEPRECATED_HEADER("v21.06", "v21.12", "sofa/type/Quat.inl") diff --git a/SofaKernel/modules/Sofa.Compat/src/sofa/helper/SVector.h b/SofaKernel/modules/Sofa.Compat/src/sofa/helper/SVector.h index 6504cf2485c..9853eac84f0 100644 --- a/SofaKernel/modules/Sofa.Compat/src/sofa/helper/SVector.h +++ b/SofaKernel/modules/Sofa.Compat/src/sofa/helper/SVector.h @@ -25,7 +25,7 @@ // The following SOFA_DEPRECATED_HEADER is commented to avoid a massive number of warnings. // This flag will be enabled once all the code base in Sofa is ported to Sofa.Type. -//SOFA_DEPRECATED_HEADER(v21.12, "sofa/type/SVector.h") +//SOFA_DEPRECATED_HEADER("v21.06", "v21.12", "sofa/type/SVector.h") namespace sofa::helper { diff --git a/SofaKernel/modules/Sofa.Compat/src/sofa/helper/fixed_array.h b/SofaKernel/modules/Sofa.Compat/src/sofa/helper/fixed_array.h index 3ad561539ef..2612e96254e 100644 --- a/SofaKernel/modules/Sofa.Compat/src/sofa/helper/fixed_array.h +++ b/SofaKernel/modules/Sofa.Compat/src/sofa/helper/fixed_array.h @@ -26,7 +26,7 @@ // The following SOFA_DEPRECATED_HEADER is commented to avoid a massive number of warnings. // This flag will be enabled once all the code base in Sofa is ported to Sofa.Type. // (PR #1790) -//SOFA_DEPRECATED_HEADER(v21.12, "sofa/type/fixed_array.h") +//SOFA_DEPRECATED_HEADER("v21.06", "v21.12", "sofa/type/fixed_array.h") namespace sofa::helper { diff --git a/SofaKernel/modules/Sofa.Compat/src/sofa/helper/fixed_array_algorithms.h b/SofaKernel/modules/Sofa.Compat/src/sofa/helper/fixed_array_algorithms.h index f92c8416c8d..22415592338 100644 --- a/SofaKernel/modules/Sofa.Compat/src/sofa/helper/fixed_array_algorithms.h +++ b/SofaKernel/modules/Sofa.Compat/src/sofa/helper/fixed_array_algorithms.h @@ -26,7 +26,7 @@ // The following SOFA_DEPRECATED_HEADER is commented to avoid a massive number of warnings. // This flag will be enabled once all the code base in Sofa is ported to Sofa.Type. // (PR #1790) -//SOFA_DEPRECATED_HEADER(v21.12, "sofa/type/fixed_array_algorithms.h") +//SOFA_DEPRECATED_HEADER("v21.06", "v21.12", "sofa/type/fixed_array_algorithms.h") namespace sofa::helper::pairwise { diff --git a/SofaKernel/modules/Sofa.Compat/src/sofa/helper/gl/Axis.h b/SofaKernel/modules/Sofa.Compat/src/sofa/helper/gl/Axis.h index f1cb26e1a53..959a4473d75 100644 --- a/SofaKernel/modules/Sofa.Compat/src/sofa/helper/gl/Axis.h +++ b/SofaKernel/modules/Sofa.Compat/src/sofa/helper/gl/Axis.h @@ -21,26 +21,6 @@ ******************************************************************************/ #pragma once -#include +#include -#if __has_include() -#include -#define GL_AXIS_ENABLE_WRAPPER - -SOFA_DEPRECATED_HEADER(v21.06, "sofa/gl/Axis.h") - -#else -#error "OpenGL headers have been moved to Sofa.GL. Therefore you will need to link against Sofa.GL if you need OpenGL (PR1649), and include instead of this one." -#endif - -#ifdef GL_AXIS_ENABLE_WRAPPER - -namespace sofa::helper::gl -{ - using Axis = sofa::gl::Axis; - -} // namespace sofa::helper::gl - -#endif // GL_AXIS_ENABLE_WRAPPER - -#undef GL_AXIS_ENABLE_WRAPPER +SOFA_DISABLED_HEADER("v20.12 (PR#1649)", "v21.06", "sofa/gl/Axis.h") diff --git a/SofaKernel/modules/Sofa.Compat/src/sofa/helper/gl/BasicShapes.h b/SofaKernel/modules/Sofa.Compat/src/sofa/helper/gl/BasicShapes.h index b5399132111..12d41079151 100644 --- a/SofaKernel/modules/Sofa.Compat/src/sofa/helper/gl/BasicShapes.h +++ b/SofaKernel/modules/Sofa.Compat/src/sofa/helper/gl/BasicShapes.h @@ -21,78 +21,6 @@ ******************************************************************************/ #pragma once -#include +#include -#if __has_include() -#include -#define GL_BASICSHAPES_ENABLE_WRAPPER - -SOFA_DEPRECATED_HEADER(v21.06, "sofa/gl/BasicShapes.h") - -#else -#error "OpenGL headers have been moved to Sofa.GL. Therefore you will need to link against Sofa.GL if you need OpenGL (PR1649), and include instead of this one." -#endif - -#ifdef GL_BASICSHAPES_ENABLE_WRAPPER -#include - -namespace sofa::helper::gl -{ -template -void drawCone(const V& p1, const V& p2, const float& radius1, const float& radius2, const int subd = 8) -{ - sofa::gl::drawCone(p1, p2, radius1, radius2, subd); -} - - -template -void drawCylinder(const V& p1, const V& p2, const float& rad, const int subd = 8) -{ - sofa::gl::drawCylinder(p1, p2, rad, subd); -} - - -template -void drawArrow(const V& p1, const V& p2, const float& rad, const int subd = 8) -{ - sofa::gl::drawArrow(p1, p2, rad, subd); -} - - -template -void drawSphere(const V& center, const float& rad, const int subd1 = 8, const int subd2 = 8) -{ - sofa::gl::drawSphere(center, rad, subd1, subd2); -} - -template -void drawEllipsoid(const V& center, const float& radx, const float& rady, const float& radz, const int subd1 = 8, const int subd2 = 8) -{ - sofa::gl::drawEllipsoid(center, radx, rady, subd1, subd2); -} - -template -void drawWireSphere(const V& center, const float& rad, const int subd1 = 8, const int subd2 = 8) -{ - sofa::gl::drawWireSphere(center, rad, subd1, subd2); -} - -template -void drawTorus(const float* coordinateMatrix, const float& bodyRad = 0.0, const float& rad = 1.0, const int precision = 20, - const V& color = sofa::helper::fixed_array(255, 215, 180)) -{ - sofa::gl::drawTorus(coordinateMatrix, bodyRad, rad, precision, color); -} - -template -void drawEmptyParallelepiped(const V& vert1, const V& vert2, const V& vert3, const V& vert4, const V& vecFromFaceToOppositeFace, const float& rad = 1.0, const int precision = 8, - const V& color = sofa::helper::fixed_array(255, 0, 0)) -{ - sofa::gl::drawEmptyParallelepiped(vert1, vert2, vert3, vert4, vecFromFaceToOppositeFace, rad, precision, color); -} - -} // namespace sofa::helper::gl - -#endif // GL_BASICSHAPES_ENABLE_WRAPPER - -#undef GL_BASICSHAPES_ENABLE_WRAPPER +SOFA_DISABLED_HEADER("v20.12 (PR#1649)", "v21.06", "sofa/gl/BasicShapes.h") diff --git a/SofaKernel/modules/Sofa.Compat/src/sofa/helper/gl/Capture.h b/SofaKernel/modules/Sofa.Compat/src/sofa/helper/gl/Capture.h index b2856d41f4b..05098edc152 100644 --- a/SofaKernel/modules/Sofa.Compat/src/sofa/helper/gl/Capture.h +++ b/SofaKernel/modules/Sofa.Compat/src/sofa/helper/gl/Capture.h @@ -21,26 +21,6 @@ ******************************************************************************/ #pragma once -#include +#include -#if __has_include() -#include -#define GL_CAPTURE_ENABLE_WRAPPER - -SOFA_DEPRECATED_HEADER(v21.06, "sofa/gl/Capture.h") - -#else -#error "OpenGL headers have been moved to Sofa.GL. Therefore you will need to link against Sofa.GL if you need OpenGL (PR1649), and include instead of this one." -#endif - -#ifdef GL_CAPTURE_ENABLE_WRAPPER - -namespace sofa::helper::gl -{ - using Capture = sofa::gl::Capture; - -} // namespace sofa::helper::gl - -#endif // GL_CAPTURE_ENABLE_WRAPPER - -#undef GL_CAPTURE_ENABLE_WRAPPER +SOFA_DISABLED_HEADER("v20.12 (PR#1649)", "v21.06", "sofa/gl/Capture.h") diff --git a/SofaKernel/modules/Sofa.Compat/src/sofa/helper/gl/Color.h b/SofaKernel/modules/Sofa.Compat/src/sofa/helper/gl/Color.h index 85fdd22b3d5..4ed871aba71 100644 --- a/SofaKernel/modules/Sofa.Compat/src/sofa/helper/gl/Color.h +++ b/SofaKernel/modules/Sofa.Compat/src/sofa/helper/gl/Color.h @@ -21,26 +21,6 @@ ******************************************************************************/ #pragma once -#include +#include -#if __has_include() -#include -#define GL_COLOR_ENABLE_WRAPPER - -SOFA_DEPRECATED_HEADER(v21.06, "sofa/gl/Color.h") - -#else -#error "OpenGL headers have been moved to Sofa.GL. Therefore you will need to link against Sofa.GL if you need OpenGL (PR1649), and include instead of this one." -#endif - -#ifdef GL_COLOR_ENABLE_WRAPPER - -namespace sofa::helper::gl -{ - using Color = sofa::gl::Color; - -} // namespace sofa::helper::gl - -#endif // GL_COLOR_ENABLE_WRAPPER - -#undef GL_COLOR_ENABLE_WRAPPER +SOFA_DISABLED_HEADER("v20.12 (PR#1649)", "v21.06", "sofa/gl/Color.h") diff --git a/SofaKernel/modules/Sofa.Compat/src/sofa/helper/gl/Cylinder.h b/SofaKernel/modules/Sofa.Compat/src/sofa/helper/gl/Cylinder.h index 8b836da3d71..0ac678c28c1 100644 --- a/SofaKernel/modules/Sofa.Compat/src/sofa/helper/gl/Cylinder.h +++ b/SofaKernel/modules/Sofa.Compat/src/sofa/helper/gl/Cylinder.h @@ -21,26 +21,6 @@ ******************************************************************************/ #pragma once -#include +#include -#if __has_include() -#include -#define GL_CYLINDER_ENABLE_WRAPPER - -SOFA_DEPRECATED_HEADER(v21.06, "sofa/gl/Cylinder.h") - -#else -#error "OpenGL headers have been moved to Sofa.GL. Therefore you will need to link against Sofa.GL if you need OpenGL (PR1649), and include instead of this one." -#endif - -#ifdef GL_CYLINDER_ENABLE_WRAPPER - -namespace sofa::helper::gl -{ - using Cylinder = sofa::gl::Cylinder; - -} // namespace sofa::helper::gl - -#endif // GL_CYLINDER_ENABLE_WRAPPER - -#undef GL_CYLINDER_ENABLE_WRAPPER +SOFA_DISABLED_HEADER("v20.12 (PR#1649)", "v21.06", "sofa/gl/Cylinder.h") diff --git a/SofaKernel/modules/Sofa.Compat/src/sofa/helper/gl/FrameBufferObject.h b/SofaKernel/modules/Sofa.Compat/src/sofa/helper/gl/FrameBufferObject.h index e9890b12ef0..a07034c7719 100644 --- a/SofaKernel/modules/Sofa.Compat/src/sofa/helper/gl/FrameBufferObject.h +++ b/SofaKernel/modules/Sofa.Compat/src/sofa/helper/gl/FrameBufferObject.h @@ -21,27 +21,6 @@ ******************************************************************************/ #pragma once -#include +#include -#if __has_include() -#include -#define GL_FRAMEBUFFER_ENABLE_WRAPPER - -SOFA_DEPRECATED_HEADER(v21.06, "sofa/gl/FrameBufferObject.h") - -#else -#error "OpenGL headers have been moved to Sofa.GL. Therefore you will need to link against Sofa.GL if you need OpenGL (PR1649), and include instead of this one." -#endif - -#ifdef GL_FRAMEBUFFER_ENABLE_WRAPPER - -namespace sofa::helper::gl -{ - using fboParameters = sofa::gl::fboParameters; - using FrameBufferObject = sofa::gl::FrameBufferObject; - -} // namespace sofa::helper::gl - -#endif // GL_FRAMEBUFFER_ENABLE_WRAPPER - -#undef GL_FRAMEBUFFER_ENABLE_WRAPPER +SOFA_DISABLED_HEADER("v20.12 (PR#1649)", "v21.06", "sofa/gl/FrameBufferObject.h") diff --git a/SofaKernel/modules/Sofa.Compat/src/sofa/helper/gl/GLSLShader.h b/SofaKernel/modules/Sofa.Compat/src/sofa/helper/gl/GLSLShader.h index 78c69afe4f4..de8447d411d 100644 --- a/SofaKernel/modules/Sofa.Compat/src/sofa/helper/gl/GLSLShader.h +++ b/SofaKernel/modules/Sofa.Compat/src/sofa/helper/gl/GLSLShader.h @@ -21,24 +21,6 @@ ******************************************************************************/ #pragma once -#include +#include -#if __has_include() -#include -#define GL_GLSLSHADER_ENABLE_WRAPPER - -SOFA_DEPRECATED_HEADER(v21.06, "sofa/gl/GLSLShader.h") - -#else -#error "OpenGL headers have been moved to Sofa.GL. Therefore you will need to link against Sofa.GL if you need OpenGL (PR1649), and include instead of this one." -#endif - -#ifdef GL_GLSLSHADER_ENABLE_WRAPPER - -namespace sofa::helper::gl -{ - using GLSLShader = sofa::gl::GLSLShader; - -} // namespace sofa::helper::gl - -#endif // GL_AXIS_ENABLE_WRAPPER +SOFA_DISABLED_HEADER("v20.12 (PR#1649)", "v21.06", "sofa/gl/GLSLShader.h") diff --git a/SofaKernel/modules/Sofa.Compat/src/sofa/helper/gl/RAII.h b/SofaKernel/modules/Sofa.Compat/src/sofa/helper/gl/RAII.h index 37bc68a68a4..9a3d05c744f 100644 --- a/SofaKernel/modules/Sofa.Compat/src/sofa/helper/gl/RAII.h +++ b/SofaKernel/modules/Sofa.Compat/src/sofa/helper/gl/RAII.h @@ -21,31 +21,6 @@ ******************************************************************************/ #pragma once -#include +#include -#if __has_include() -#include - -SOFA_DEPRECATED_HEADER(v21.06, "sofa/gl/RAII.h") -#define GL_RAII_ENABLE_WRAPPER - -#else -#error "OpenGL headers have been moved to Sofa.GL; you will need to link against your library if you need OpenGL, and include instead of this one." -#endif - -#ifdef GL_RAII_ENABLE_WRAPPER - -namespace sofa::helper::gl -{ - template - using Enable = sofa::gl::Enable; - - template - using Disable = sofa::gl::Disable; - - -} // namespace sofa::helper::gl - -#endif // GL_RAII_ENABLE_WRAPPER - -#undef GL_RAII_ENABLE_WRAPPER +SOFA_DISABLED_HEADER("v20.12 (PR#1649)", "v21.06", "sofa/gl/RAII.h") diff --git a/SofaKernel/modules/Sofa.Compat/src/sofa/helper/gl/Texture.h b/SofaKernel/modules/Sofa.Compat/src/sofa/helper/gl/Texture.h index 6aab3b191ad..2193c8dd255 100644 --- a/SofaKernel/modules/Sofa.Compat/src/sofa/helper/gl/Texture.h +++ b/SofaKernel/modules/Sofa.Compat/src/sofa/helper/gl/Texture.h @@ -21,26 +21,6 @@ ******************************************************************************/ #pragma once -#include +#include -#if __has_include() -#include -#define GL_TEXTURE_ENABLE_WRAPPER - -SOFA_DEPRECATED_HEADER(v21.06, "sofa/gl/Texture.h") - -#else -#error "OpenGL headers have been moved to Sofa.GL. Therefore you will need to link against Sofa.GL if you need OpenGL (PR1649), and include instead of this one." -#endif - -#ifdef GL_TEXTURE_ENABLE_WRAPPER - -namespace sofa::helper::gl -{ - using Texture = sofa::gl::Texture; - -} // namespace sofa::helper::gl - -#endif // GL_TEXTURE_ENABLE_WRAPPER - -#undef GL_TEXTURE_ENABLE_WRAPPER +SOFA_DISABLED_HEADER("v20.12 (PR#1649)", "v21.06", "sofa/gl/Texture.h") diff --git a/SofaKernel/modules/Sofa.Compat/src/sofa/helper/gl/Trackball.h b/SofaKernel/modules/Sofa.Compat/src/sofa/helper/gl/Trackball.h index 698788778b0..8b73f352c14 100644 --- a/SofaKernel/modules/Sofa.Compat/src/sofa/helper/gl/Trackball.h +++ b/SofaKernel/modules/Sofa.Compat/src/sofa/helper/gl/Trackball.h @@ -21,13 +21,6 @@ ******************************************************************************/ #pragma once -#include - -SOFA_DEPRECATED_HEADER(v21.06, "sofa/helper/visual/Trackball.h") - -namespace sofa::helper::gl -{ - using Trackball = sofa::helper::visual::Trackball; - -} // namespace sofa::helper::gl +#include +SOFA_DISABLED_HEADER("v20.12 (PR#1649)", "v21.06", "sofa/helper/visual/Trackball.h") diff --git a/SofaKernel/modules/Sofa.Compat/src/sofa/helper/gl/Transformation.h b/SofaKernel/modules/Sofa.Compat/src/sofa/helper/gl/Transformation.h index 255db5eb6aa..1c5ba46dacb 100644 --- a/SofaKernel/modules/Sofa.Compat/src/sofa/helper/gl/Transformation.h +++ b/SofaKernel/modules/Sofa.Compat/src/sofa/helper/gl/Transformation.h @@ -21,14 +21,6 @@ ******************************************************************************/ #pragma once -#include +#include -SOFA_DEPRECATED_HEADER(v21.06, "sofa/helper/visual/Transformation.h") - -SOFA_PRAGMA_WARNING("Transformation has been stripped of its OpenGL code, use sofa::gl::TransformationGL if you need its OpenGL implementation.") - -namespace sofa::helper::gl -{ - using Transformation = sofa::helper::visual::Transformation; - -} // namespace sofa::helper::gl +SOFA_DISABLED_HEADER("v20.12 (PR#1649)", "v21.06", "sofa/helper/visual/Transformation.h") diff --git a/SofaKernel/modules/Sofa.Compat/src/sofa/helper/gl/VideoRecorderFFMPEG.h b/SofaKernel/modules/Sofa.Compat/src/sofa/helper/gl/VideoRecorderFFMPEG.h index d7ee6d9f19d..5dea0ab9c4e 100644 --- a/SofaKernel/modules/Sofa.Compat/src/sofa/helper/gl/VideoRecorderFFMPEG.h +++ b/SofaKernel/modules/Sofa.Compat/src/sofa/helper/gl/VideoRecorderFFMPEG.h @@ -21,26 +21,6 @@ ******************************************************************************/ #pragma once -#include +#include -#if __has_include() -#include -#define GL_VIDEORECORDERFFMPEG_ENABLE_WRAPPER - -SOFA_DEPRECATED_HEADER(v21.06, "sofa/gl/VideoRecorderFFMPEG.h") - -#else -#error "OpenGL headers have been moved to Sofa.GL. Therefore you will need to link against Sofa.GL if you need OpenGL (PR1649), and include instead of this one." -#endif - -#ifdef GL_VIDEORECORDERFFMPEG_ENABLE_WRAPPER - -namespace sofa::helper::gl -{ - using VideoRecorderFFMPEG = sofa::gl::VideoRecorderFFMPEG; - -} // namespace sofa::helper::gl - -#endif // GL_VIDEORECORDERFFMPEG_ENABLE_WRAPPER - -#undef GL_VIDEORECORDERFFMPEG_ENABLE_WRAPPER +SOFA_DISABLED_HEADER("v20.12 (PR#1649)", "v21.06", "sofa/gl/VideoRecorderFFMPEG.h") diff --git a/SofaKernel/modules/Sofa.Compat/src/sofa/helper/gl/glText.h b/SofaKernel/modules/Sofa.Compat/src/sofa/helper/gl/glText.h index 6998f543144..ba63f918320 100644 --- a/SofaKernel/modules/Sofa.Compat/src/sofa/helper/gl/glText.h +++ b/SofaKernel/modules/Sofa.Compat/src/sofa/helper/gl/glText.h @@ -21,24 +21,6 @@ ******************************************************************************/ #pragma once -#include +#include -#if __has_include() -#include -#define GL_GLTEXT_ENABLE_WRAPPER - -SOFA_DEPRECATED_HEADER(v21.06, "sofa/gl/glText.h") - -#else -#error "OpenGL headers have been moved to Sofa.GL. Therefore you will need to link against Sofa.GL if you need OpenGL (PR1649), and include instead of this one." -#endif - -#ifdef GL_GLTEXT_ENABLE_WRAPPER - -namespace sofa::helper::gl -{ - using GlText = sofa::gl::GlText; - -} // namespace sofa::helper::gl - -#endif // GL_GLTEXT_ENABLE_WRAPPER +SOFA_DISABLED_HEADER("v20.12 (PR#1649)", "v21.06", "sofa/gl/glText.h") diff --git a/SofaKernel/modules/Sofa.Compat/src/sofa/helper/gl/glText.inl b/SofaKernel/modules/Sofa.Compat/src/sofa/helper/gl/glText.inl index 99f20c0c426..bc58160f1a0 100644 --- a/SofaKernel/modules/Sofa.Compat/src/sofa/helper/gl/glText.inl +++ b/SofaKernel/modules/Sofa.Compat/src/sofa/helper/gl/glText.inl @@ -21,14 +21,6 @@ ******************************************************************************/ #pragma once -#include -#include +#include -#if __has_include() -#include - -SOFA_DEPRECATED_HEADER(v21.06, "sofa/gl/glText.inl") - -#else -#error "OpenGL headers have been moved to Sofa.GL. Therefore you will need to link against Sofa.GL if you need OpenGL (PR1649), and include instead of this one." -#endif +SOFA_DISABLED_HEADER("v20.12 (PR#1649)", "v21.06", "sofa/gl/glText.inl") diff --git a/SofaKernel/modules/Sofa.Compat/src/sofa/helper/gl/template.h b/SofaKernel/modules/Sofa.Compat/src/sofa/helper/gl/template.h index 80372826e5a..c868717d4e1 100644 --- a/SofaKernel/modules/Sofa.Compat/src/sofa/helper/gl/template.h +++ b/SofaKernel/modules/Sofa.Compat/src/sofa/helper/gl/template.h @@ -20,303 +20,7 @@ * Contact information: contact@sofa-framework.org * ******************************************************************************/ #pragma once -#include -#if __has_include() -#include -#define GL_TEMPLATE_ENABLE_WRAPPER +#include -SOFA_DEPRECATED_HEADER(v21.06, "sofa/gl/template.h") - -#else -#error "OpenGL headers have been moved to Sofa.GL. Therefore you will need to link against Sofa.GL if you need OpenGL (PR1649), and include instead of this one." -#endif - -#ifdef GL_TEMPLATE_ENABLE_WRAPPER -namespace sofa::helper::gl -{ - -template -inline void glVertexNv(const float* /*p*/) -{ -} - -template<> -inline void glVertexNv<3>(const float* p) -{ - sofa::gl::glVertexNv<3>(p); -} - -template<> -inline void glVertexNv<2>(const float* p) -{ - sofa::gl::glVertexNv<2>(p); -} - -template<> -inline void glVertexNv<1>(const float* p) -{ - sofa::gl::glVertexNv<1>(p); -} - -template -inline void glVertexNv(const double* p) -{ - sofa::gl::glVertexNv(p); -} - -template<> -inline void glVertexNv<2>(const double* p) -{ - sofa::gl::glVertexNv<2>(p); -} - -template<> -inline void glVertexNv<1>(const double* p) -{ - sofa::gl::glVertexNv<1>(p); -} - -template -inline void glVertexT(const Coord& c) -{ - sofa::gl::glVertexT(c); -} - -template<> -inline void glVertexT(const double& c) -{ - sofa::gl::glVertexT(c); -} - -template<> -inline void glVertexT(const float& c) -{ - sofa::gl::glVertexT(c); -} - - -//////////////////////////////////////// - -template -inline void glTexCoordNv(const float* /*p*/) -{ -} - -template<> -inline void glTexCoordNv<3>(const float* p) -{ - sofa::gl::glTexCoordNv<3>(p); -} - -template<> -inline void glTexCoordNv<2>(const float* p) -{ - sofa::gl::glTexCoordNv<2>(p); -} - -template<> -inline void glTexCoordNv<1>(const float* p) -{ - sofa::gl::glTexCoordNv<1>(p); -} - -template -inline void glTexCoordNv(const double* p) -{ - sofa::gl::glTexCoordNv(p); -} - -template<> -inline void glTexCoordNv<2>(const double* p) -{ - sofa::gl::glTexCoordNv<2>(p); -} - -template<> -inline void glTexCoordNv<1>(const double* p) -{ - sofa::gl::glTexCoordNv<1>(p); -} - -template -inline void glTexCoordT(const Coord& c) -{ - sofa::gl::glTexCoordT(c); -} - -template<> -inline void glTexCoordT(const double& c) -{ - sofa::gl::glTexCoordT(c); -} - -template<> -inline void glTexCoordT(const float& c) -{ - sofa::gl::glTexCoordT(c); -} - - - -/////////////////////////////////////// - -template -inline void glNormalNv(const float* p) -{ - sofa::gl::glNormalNv(p); -} - -template<> -inline void glNormalNv<2>(const float* p) -{ - sofa::gl::glNormalNv<2>(p); -} - -template<> -inline void glNormalNv<1>(const float* p) -{ - sofa::gl::glNormalNv<1>(p); -} - -template -inline void glNormalNv(const double* p) -{ - sofa::gl::glNormalNv(p); -} - -template<> -inline void glNormalNv<2>(const double* p) -{ - sofa::gl::glNormalNv<2>(p); -} - -template<> -inline void glNormalNv<1>(const double* p) -{ - sofa::gl::glNormalNv<1>(p); -} - -template -inline void glNormalT(const Coord& c) -{ - sofa::gl::glNormalNv(c.ptr()); -} - -template<> -inline void glNormalT(const double& c) -{ - sofa::gl::glNormalT(c); -} - -template<> -inline void glNormalT(const float& c) -{ - sofa::gl::glNormalT(c); -} -//////// -inline void glTranslate(const float& c1, const float& c2, const float& c3) -{ - sofa::gl::glTranslate(c1, c2, c3); -} - -inline void glTranslate(const double& c1, const double& c2, const double& c3) -{ - sofa::gl::glTranslate(c1, c2, c3); -} - -template -inline void glTranslateNv(const float* p) -{ - sofa::gl::glTranslateNv(p); -} - -template<> -inline void glTranslateNv<2>(const float* p) -{ - sofa::gl::glTranslateNv<2>(p); -} - -template<> -inline void glTranslateNv<1>(const float* p) -{ - sofa::gl::glTranslateNv<1>(p); -} - -template -inline void glTranslateNv(const double* p) -{ - sofa::gl::glTranslateNv(p); -} - -template<> -inline void glTranslateNv<2>(const double* p) -{ - sofa::gl::glTranslateNv<2>(p); -} - -template<> -inline void glTranslateNv<1>(const double* p) -{ - sofa::gl::glTranslateNv<1>(p); -} - -template -inline void glTranslateT(const Coord& c) -{ - sofa::gl::glTranslateT(c); -} - -template<> -inline void glTranslateT(const double& c) -{ - sofa::gl::glTranslateT(c); -} - -template<> -inline void glTranslateT(const float& c) -{ - sofa::gl::glTranslateT(c); -} - - -//////////// - - - - -inline void glScale(const float& c1, const float& c2, const float& c3) -{ - sofa::gl::glScale(c1, c2, c3); -} - -inline void glScale(const double& c1, const double& c2, const double& c3) -{ - sofa::gl::glScale(c1, c2, c3); -} - -inline void glRotate(const GLfloat &value, const float& c1, const float& c2, const float& c3) -{ - sofa::gl::glRotate(value, c1, c2, c3); -} - -inline void glRotate(const GLdouble &value, const double& c1, const double& c2, const double& c3) -{ - sofa::gl::glRotate(value, c1, c2, c3); -} - -inline void glMultMatrix(const float* p) -{ - sofa::gl::glMultMatrix(p); -} - -inline void glMultMatrix(const double* p) -{ - sofa::gl::glMultMatrix(p); -} - -} - -#endif // GL_TEMPLATE_ENABLE_WRAPPER - -#undef GL_TEMPLATE_ENABLE_WRAPPER +SOFA_DISABLED_HEADER("v20.12 (PR#1649)", "v21.06", "sofa/gl/template.h") diff --git a/SofaKernel/modules/Sofa.Compat/src/sofa/helper/stable_vector.h b/SofaKernel/modules/Sofa.Compat/src/sofa/helper/stable_vector.h index 33bd292ba0f..a8777cf9279 100644 --- a/SofaKernel/modules/Sofa.Compat/src/sofa/helper/stable_vector.h +++ b/SofaKernel/modules/Sofa.Compat/src/sofa/helper/stable_vector.h @@ -25,7 +25,7 @@ // The following SOFA_DEPRECATED_HEADER is commented to avoid a massive number of warnings. // This flag will be enabled once all the code base in Sofa is ported to Sofa.Type. -//SOFA_DEPRECATED_HEADER(v21.12, "sofa/type/stable_vector.h") +//SOFA_DEPRECATED_HEADER("v21.06", "v21.12", "sofa/type/stable_vector.h") namespace sofa::helper { diff --git a/SofaKernel/modules/Sofa.Compat/src/sofa/helper/system/gl.h b/SofaKernel/modules/Sofa.Compat/src/sofa/helper/system/gl.h index 91b3a0ea294..18563f6f8f5 100644 --- a/SofaKernel/modules/Sofa.Compat/src/sofa/helper/system/gl.h +++ b/SofaKernel/modules/Sofa.Compat/src/sofa/helper/system/gl.h @@ -20,13 +20,7 @@ * Contact information: contact@sofa-framework.org * ******************************************************************************/ #pragma once -#include -#if __has_include() -#include +#include -SOFA_DEPRECATED_HEADER(v21.06, "sofa/gl/gl.h") - -#else -#error "OpenGL headers have been moved to Sofa.GL; you will need to link against your library if you need OpenGL, and include instead of this one." -#endif \ No newline at end of file +SOFA_DISABLED_HEADER("v20.12 (PR#1649)", "v21.06", "sofa/gl/gl.h") diff --git a/SofaKernel/modules/Sofa.Compat/src/sofa/helper/system/glu.h b/SofaKernel/modules/Sofa.Compat/src/sofa/helper/system/glu.h index 1f229766395..f74cb611fb5 100644 --- a/SofaKernel/modules/Sofa.Compat/src/sofa/helper/system/glu.h +++ b/SofaKernel/modules/Sofa.Compat/src/sofa/helper/system/glu.h @@ -20,13 +20,7 @@ * Contact information: contact@sofa-framework.org * ******************************************************************************/ #pragma once -#include -#if __has_include() -#include +#include -SOFA_DEPRECATED_HEADER(v21.06, "sofa/gl/glu.h") - -#else -#error "OpenGL headers have been moved to Sofa.GL; you will need to link against your library if you need OpenGL, and include instead of this one." -#endif \ No newline at end of file +SOFA_DISABLED_HEADER("v20.12 (PR#1649)", "v21.06", "sofa/gl/glu.h") diff --git a/SofaKernel/modules/Sofa.Compat/src/sofa/helper/types/Material.h b/SofaKernel/modules/Sofa.Compat/src/sofa/helper/types/Material.h index 675ab4dcf13..49c96ad3e9a 100644 --- a/SofaKernel/modules/Sofa.Compat/src/sofa/helper/types/Material.h +++ b/SofaKernel/modules/Sofa.Compat/src/sofa/helper/types/Material.h @@ -23,7 +23,7 @@ #include -// SOFA_DEPRECATED_HEADER(v21.12, "sofa/helper/types/Material.h") +// SOFA_DEPRECATED_HEADER("v21.06", "v21.12", "sofa/helper/types/Material.h") namespace sofa::helper::types { diff --git a/SofaKernel/modules/Sofa.Compat/src/sofa/helper/types/PrimitiveGroup.h b/SofaKernel/modules/Sofa.Compat/src/sofa/helper/types/PrimitiveGroup.h index e8abe23089e..0f667ed8466 100644 --- a/SofaKernel/modules/Sofa.Compat/src/sofa/helper/types/PrimitiveGroup.h +++ b/SofaKernel/modules/Sofa.Compat/src/sofa/helper/types/PrimitiveGroup.h @@ -23,7 +23,7 @@ #include -// SOFA_DEPRECATED_HEADER(v21.12, "sofa/helper/types/PrimitiveGroup.h") +// SOFA_DEPRECATED_HEADER("v21.06", "v21.12", "sofa/helper/types/PrimitiveGroup.h") namespace sofa::helper::types { diff --git a/SofaKernel/modules/Sofa.Compat/src/sofa/helper/types/RGBAColor.h b/SofaKernel/modules/Sofa.Compat/src/sofa/helper/types/RGBAColor.h index f89b8941594..15794d72b33 100644 --- a/SofaKernel/modules/Sofa.Compat/src/sofa/helper/types/RGBAColor.h +++ b/SofaKernel/modules/Sofa.Compat/src/sofa/helper/types/RGBAColor.h @@ -23,7 +23,7 @@ #include -// SOFA_DEPRECATED_HEADER(v21.12, "sofa/helper/types/RGBAColor.h") +// SOFA_DEPRECATED_HEADER("v21.06", "v21.12", "sofa/helper/types/RGBAColor.h") namespace sofa::helper::types { diff --git a/SofaKernel/modules/Sofa.Compat/src/sofa/helper/vector.h b/SofaKernel/modules/Sofa.Compat/src/sofa/helper/vector.h index 806541e88b2..83cff71557c 100644 --- a/SofaKernel/modules/Sofa.Compat/src/sofa/helper/vector.h +++ b/SofaKernel/modules/Sofa.Compat/src/sofa/helper/vector.h @@ -25,7 +25,7 @@ // The following SOFA_DEPRECATED_HEADER is commented to avoid a massive number of warnings. // This flag will be enabled once all the code base in Sofa is ported to Sofa.Type. -//SOFA_DEPRECATED_HEADER(v21.12, "sofa/type/vector.h") +//SOFA_DEPRECATED_HEADER("v21.06", "v21.12", "sofa/type/vector.h") namespace sofa::helper { diff --git a/SofaKernel/modules/Sofa.Compat/src/sofa/helper/vectorData.h b/SofaKernel/modules/Sofa.Compat/src/sofa/helper/vectorData.h index c05f3c1ac23..7be707b1c8f 100644 --- a/SofaKernel/modules/Sofa.Compat/src/sofa/helper/vectorData.h +++ b/SofaKernel/modules/Sofa.Compat/src/sofa/helper/vectorData.h @@ -24,7 +24,7 @@ #include -SOFA_DEPRECATED_HEADER(v21.12, "sofa/core/objectmodel/vectorData.h") +SOFA_DEPRECATED_HEADER("v21.06", "v21.12", "sofa/core/objectmodel/vectorData.h") namespace sofa::helper { diff --git a/SofaKernel/modules/Sofa.Compat/src/sofa/helper/vectorLinks.h b/SofaKernel/modules/Sofa.Compat/src/sofa/helper/vectorLinks.h index 8097ec0dc58..9543555e141 100644 --- a/SofaKernel/modules/Sofa.Compat/src/sofa/helper/vectorLinks.h +++ b/SofaKernel/modules/Sofa.Compat/src/sofa/helper/vectorLinks.h @@ -24,7 +24,7 @@ #include -SOFA_DEPRECATED_HEADER(v21.12, "sofa/core/objectmodel/vectorLinks.h") +SOFA_DEPRECATED_HEADER("v21.06", "v21.12", "sofa/core/objectmodel/vectorLinks.h") namespace sofa::helper { diff --git a/SofaKernel/modules/Sofa.Compat/src/sofa/helper/vector_algebra.h b/SofaKernel/modules/Sofa.Compat/src/sofa/helper/vector_algebra.h index fd13f7459b8..2682b5d36e6 100644 --- a/SofaKernel/modules/Sofa.Compat/src/sofa/helper/vector_algebra.h +++ b/SofaKernel/modules/Sofa.Compat/src/sofa/helper/vector_algebra.h @@ -23,7 +23,7 @@ #include -SOFA_DEPRECATED_HEADER(v21.12, "sofa/type/vector_algebra.h") +SOFA_DEPRECATED_HEADER("v21.06", "v21.12", "sofa/type/vector_algebra.h") namespace sofa::helper { diff --git a/SofaKernel/modules/Sofa.Compat/src/sofa/helper/vector_algorithm.h b/SofaKernel/modules/Sofa.Compat/src/sofa/helper/vector_algorithm.h index a7cf29127c8..9b67f195d07 100644 --- a/SofaKernel/modules/Sofa.Compat/src/sofa/helper/vector_algorithm.h +++ b/SofaKernel/modules/Sofa.Compat/src/sofa/helper/vector_algorithm.h @@ -23,7 +23,7 @@ #include -SOFA_DEPRECATED_HEADER(v21.12, "sofa/type/vector_algorithm.h") +SOFA_DEPRECATED_HEADER("v21.06", "v21.12", "sofa/type/vector_algorithm.h") namespace sofa::helper { diff --git a/SofaKernel/modules/Sofa.Compat/src/sofa/helper/vector_device.h b/SofaKernel/modules/Sofa.Compat/src/sofa/helper/vector_device.h index 9c47c5986ac..31b3a950ceb 100644 --- a/SofaKernel/modules/Sofa.Compat/src/sofa/helper/vector_device.h +++ b/SofaKernel/modules/Sofa.Compat/src/sofa/helper/vector_device.h @@ -25,7 +25,7 @@ // The following SOFA_DEPRECATED_HEADER is commented to avoid a massive number of warnings. // This flag will be enabled once all the code base in Sofa is ported to Sofa.Type. -//SOFA_DEPRECATED_HEADER(v21.12, "sofa/type/vector_device.h") +//SOFA_DEPRECATED_HEADER("v21.06", "v21.12", "sofa/type/vector_device.h") namespace sofa::helper { diff --git a/SofaKernel/modules/Sofa.Config/src/sofa/config.h.in b/SofaKernel/modules/Sofa.Config/src/sofa/config.h.in index 22f50bdcee6..a6bc859a056 100644 --- a/SofaKernel/modules/Sofa.Config/src/sofa/config.h.in +++ b/SofaKernel/modules/Sofa.Config/src/sofa/config.h.in @@ -114,30 +114,63 @@ typedef unsigned __int64 uint64_t; #define sofa_do_tostring(a) #a #define sofa_tostring(a) sofa_do_tostring(a) -#ifdef _WIN32 -# define SOFA_PRAGMA_MESSAGE(text) __pragma(message(__FILE__ "(" sofa_tostring(__LINE__) "): " #text)) -# define SOFA_PRAGMA_WARNING(text) __pragma(message(__FILE__ "(" sofa_tostring(__LINE__) "): warning: " #text)) +#if defined(_WIN32) + #define SOFA_PRAGMA_MESSAGE(text) __pragma(message(__FILE__ "(" sofa_tostring(__LINE__) "): " text)) + #define SOFA_PRAGMA_WARNING(text) __pragma(message(__FILE__ "(" sofa_tostring(__LINE__) "): warning: " text)) + #define SOFA_PRAGMA_ERROR(text) __pragma(message(__FILE__ "(" sofa_tostring(__LINE__) "): error: " text)) +#elif defined(__clang__) + #define SOFA_DO_PRAGMA(x) _Pragma(#x) + #define SOFA_PRAGMA_MESSAGE(text) SOFA_DO_PRAGMA(message text) + #define SOFA_PRAGMA_WARNING(text) SOFA_DO_PRAGMA(GCC warning text) + #define SOFA_PRAGMA_ERROR(text) SOFA_DO_PRAGMA(GCC error text) #else -# define SOFA_DO_PRAGMA(x) _Pragma(#x) -# define SOFA_PRAGMA_MESSAGE(text) SOFA_DO_PRAGMA(message #text) -# define SOFA_PRAGMA_WARNING(text) SOFA_DO_PRAGMA(GCC warning #text) + #define SOFA_DO_PRAGMA(x) _Pragma(#x) + #define SOFA_PRAGMA_MESSAGE(text) SOFA_DO_PRAGMA(message #text) + #define SOFA_PRAGMA_WARNING(text) SOFA_DO_PRAGMA(GCC warning #text) + #define SOFA_PRAGMA_ERROR(text) SOFA_DO_PRAGMA(GCC error #text) #endif /************* DEPRECATION MACROS *************/ -#define SOFA_DEPRECATED_HEADER(untilVersion, newHeader) SOFA_PRAGMA_WARNING( \ - This header is deprecated and will be removed at SOFA untilVersion. \ - To fix this warning you must include newHeader instead. ) +// Empty class to be used to highlight deprecated objects at compilation time. +class DeprecatedAndRemoved {}; + +#define SOFA_DEPRECATED_HEADER(deprecateDate, disableDate, newHeader) \ + SOFA_PRAGMA_WARNING( \ + "This header has been DEPRECATED since " deprecateDate ". " \ + "You have until " disableDate " to fix your code. " \ + "To fix this warning you must include " newHeader " instead." ) + +#define SOFA_DISABLED_HEADER(deprecateDate, disableDate, newHeader) \ + SOFA_PRAGMA_ERROR( \ + "This header has been DISABLED since " disableDate " " \ + "after being deprecated on " deprecateDate ". " \ + "To fix this error you must include " newHeader " instead. " ) + + +#define SOFA_DEPRECATED_HEADER_NOT_REPLACED(deprecateDate, disableDate) \ + SOFA_PRAGMA_WARNING( \ + "This header has been DEPRECATED since " deprecateDate ". " \ + "You have until " disableDate " to fix your code. " \ + "It will not replaced by another one. " ) + +#define SOFA_DISABLED_HEADER_NOT_REPLACED(deprecateDate, disableDate) \ + SOFA_PRAGMA_ERROR( \ + "This header has been DISABLED since " disableDate " " \ + "after being deprecated on " deprecateDate ". "\ + "It is not replaced by another one. " \ + "Contact the SOFA Consortium for more information. " ) + #define SOFA_ATTRIBUTE_DEPRECATED(deprecateDate, removeDate, toFixMsg) \ [[deprecated( \ - "It is still usable but has been DEPRECATED since " deprecateDate ". " \ - "You have until " removeDate " to fix your code. " toFixMsg)]] + "It is still usable but has been DEPRECATED since " deprecateDate ". " \ + "You have until " removeDate " to fix your code. " toFixMsg)]] #define SOFA_ATTRIBUTE_DISABLED(deprecateDate, disableDate, toFixMsg) \ [[deprecated( \ - "It is not usable anymore because it has been DISABLED since " disableDate " " \ - "after being deprecated on " deprecateDate ". " toFixMsg)]] + "It is not usable anymore because it has been DISABLED since " disableDate " " \ + "after being deprecated on " deprecateDate ". " toFixMsg)]] #define SOFA_ATTRIBUTE_DEPRECATED__CLASSNAME_INTROSPECTION() \ @@ -145,6 +178,11 @@ typedef unsigned __int64 uint64_t; "v20.06 (PR#1283)", "v21.06", \ "Information on how to update your code is provided in the PR description. ") +#define SOFA_ATTRIBUTE_DISABLED__CLASSNAME_INTROSPECTION() \ + SOFA_ATTRIBUTE_DISABLED( \ + "v20.06 (PR#1283)", "v21.06", \ + "Information on how to update your code is provided in the PR description. ") + #define SOFA_ATTRIBUTE_DISABLED__COMPONENTSTATE(msg) \ SOFA_ATTRIBUTE_DISABLED( \ @@ -206,16 +244,51 @@ typedef unsigned __int64 uint64_t; "ExecParams are not needed anymore. " \ "Remove the ExecParams argument from your call. ") -#define SOFA_ATTRIBUTE_CLEANING__QUAT_API(msg) \ + +#define SOFA_ATTRIBUTE_DEPRECATED__QUAT_API(msg) \ SOFA_ATTRIBUTE_DEPRECATED( \ "v21.06 (PR#1878)", "v21.12", \ "Quat was refactored. " msg) + #define SOFA_ATTRIBUTE_DISABLED__BASEOBJECT_SEARCH(msg) \ SOFA_ATTRIBUTE_DISABLED( \ "v21.06 (PR#1842)", "v21.06 (PR#1842)", \ "This function was removed as it duplicates a function that can be done using getContext(). " msg) + +#define SOFA_ATTRIBUTE_DEPRECATED__REFERENCES_IN_MESHLOADER() \ + SOFA_ATTRIBUTE_DEPRECATED( \ + "v20.12 (PR#1627)", "v21.06", \ + "This should use a reference instead of a pointer. ") + +#define SOFA_ATTRIBUTE_DISABLED__REFERENCES_IN_MESHLOADER() \ + SOFA_ATTRIBUTE_DISABLED( \ + "v20.12 (PR#1627)", "v21.06", \ + "This should use a reference instead of a pointer. ") + + +#define SOFA_ATTRIBUTE_DEPRECATED__DRAWTOOL_USES_RGBACOLOR() \ + SOFA_ATTRIBUTE_DEPRECATED( \ + "v20.12 (PR#1626)", "v21.06", \ + "Use RGBAColor to define colors. ") + +#define SOFA_ATTRIBUTE_DISABLED__DRAWTOOL_USES_RGBACOLOR() \ + SOFA_ATTRIBUTE_DISABLED( \ + "v20.12 (PR#1626)", "v21.06", \ + "Use RGBAColor to define colors. ") + + +#define SOFA_ATTRIBUTE_DEPRECATED__CUSTOM_OPERATOR() \ + SOFA_ATTRIBUTE_DEPRECATED( \ + "v21.06 (PR#1808)", "v21.12", \ + "Replace std::cout << myaccessor by std::cout << myaccessor.ref() ") + +#define SOFA_ATTRIBUTE_DISABLED__CUSTOM_OPERATOR() \ + SOFA_ATTRIBUTE_DISABLED( \ + "v21.06 (PR#1808)", "v21.12", \ + "replace std::cout << myaccessor by std::cout << myaccessor.ref() ") + /**********************************************/ #define SOFA_DECL_CLASS(name) // extern "C" { int sofa_concat(class_,name) = 0; } diff --git a/SofaKernel/modules/Sofa.GL/src/sofa/gl/glfont.cpp b/SofaKernel/modules/Sofa.GL/src/sofa/gl/glfont.cpp index 5dc2e34875a..4127cb0350f 100644 --- a/SofaKernel/modules/Sofa.GL/src/sofa/gl/glfont.cpp +++ b/SofaKernel/modules/Sofa.GL/src/sofa/gl/glfont.cpp @@ -19,7 +19,7 @@ * * * Contact information: contact@sofa-framework.org * ******************************************************************************/ -#include +#include #if defined (__linux__) # include # include diff --git a/SofaKernel/modules/Sofa.Testing/compat/SofaSimulationGraph/testing/BaseSimulationTest.h b/SofaKernel/modules/Sofa.Testing/compat/SofaSimulationGraph/testing/BaseSimulationTest.h index 194f3d7c718..57223b501bb 100644 --- a/SofaKernel/modules/Sofa.Testing/compat/SofaSimulationGraph/testing/BaseSimulationTest.h +++ b/SofaKernel/modules/Sofa.Testing/compat/SofaSimulationGraph/testing/BaseSimulationTest.h @@ -23,7 +23,7 @@ #include -//SOFA_DEPRECATED_HEADER(v21.12, "sofa/testing/BaseSimulationTest.h") +//SOFA_DEPRECATED_HEADER("v21.06", "v21.12", "sofa/testing/BaseSimulationTest.h") namespace sofa::helper { diff --git a/SofaKernel/modules/Sofa.Testing/compat/sofa/helper/testing/BaseTest.h b/SofaKernel/modules/Sofa.Testing/compat/sofa/helper/testing/BaseTest.h index e4a2b1a4358..d0f35082d8f 100644 --- a/SofaKernel/modules/Sofa.Testing/compat/sofa/helper/testing/BaseTest.h +++ b/SofaKernel/modules/Sofa.Testing/compat/sofa/helper/testing/BaseTest.h @@ -23,7 +23,7 @@ #include -//SOFA_DEPRECATED_HEADER(v21.12, "sofa/testing/BaseTest.h") +//SOFA_DEPRECATED_HEADER("v21.06", "v21.12", "sofa/testing/BaseTest.h") namespace sofa::helper { diff --git a/SofaKernel/modules/Sofa.Testing/compat/sofa/helper/testing/NumericTest.h b/SofaKernel/modules/Sofa.Testing/compat/sofa/helper/testing/NumericTest.h index 7134296a962..6594385bece 100644 --- a/SofaKernel/modules/Sofa.Testing/compat/sofa/helper/testing/NumericTest.h +++ b/SofaKernel/modules/Sofa.Testing/compat/sofa/helper/testing/NumericTest.h @@ -23,7 +23,7 @@ #include -//SOFA_DEPRECATED_HEADER(v21.12, "sofa/testing/NumericTest.h") +//SOFA_DEPRECATED_HEADER("v21.06", "v21.12", "sofa/testing/NumericTest.h") namespace sofa::helper { diff --git a/SofaKernel/modules/Sofa.Testing/compat/sofa/helper/testing/TestMessageHandler.h b/SofaKernel/modules/Sofa.Testing/compat/sofa/helper/testing/TestMessageHandler.h index 7254c6acca6..0d8c2138d3d 100644 --- a/SofaKernel/modules/Sofa.Testing/compat/sofa/helper/testing/TestMessageHandler.h +++ b/SofaKernel/modules/Sofa.Testing/compat/sofa/helper/testing/TestMessageHandler.h @@ -23,7 +23,7 @@ #include -//SOFA_DEPRECATED_HEADER(v21.12, "sofa/testing/TestMessageHandler.h") +//SOFA_DEPRECATED_HEADER("v21.06", "v21.12", "sofa/testing/TestMessageHandler.h") namespace sofa::helper::logging { diff --git a/SofaKernel/modules/Sofa.Type/src/sofa/type/DualQuat.h b/SofaKernel/modules/Sofa.Type/src/sofa/type/DualQuat.h index 07c5629c68e..eb965f6054c 100644 --- a/SofaKernel/modules/Sofa.Type/src/sofa/type/DualQuat.h +++ b/SofaKernel/modules/Sofa.Type/src/sofa/type/DualQuat.h @@ -73,8 +73,7 @@ class SOFA_TYPE_API DualQuatCoord3 template // Deprecated flag is commented, as MSVC2017 cannot handle the associated template syntax. (works well with MSVC2019) - //[[deprecated("This constructor has been deleted in #PR 1790 because of dependency on Defaulttype." \ - // "Use DualQuatCoord3(c.getCenter(), c.getOrientation()) instead.")]] + //SOFA_ATTRIBUTE_DEPRECATED("v21.06 (PR#1790)", "v21.12", "Use DualQuatCoord3(c.getCenter(), c.getOrientation()) instead.") DualQuatCoord3(const sofa::defaulttype::RigidCoord<3, real2>& c) = delete; DualQuatCoord3(const Pos& p, const sofa::type::Quat& q) diff --git a/SofaKernel/modules/Sofa.Type/src/sofa/type/Quat.h b/SofaKernel/modules/Sofa.Type/src/sofa/type/Quat.h index f071c77c667..f9f7b9a6ddd 100644 --- a/SofaKernel/modules/Sofa.Type/src/sofa/type/Quat.h +++ b/SofaKernel/modules/Sofa.Type/src/sofa/type/Quat.h @@ -106,7 +106,7 @@ class SOFA_TYPE_API Quat /// Convert the quaternion into an orientation matrix void toMatrix(Mat3x3 &m) const; - SOFA_ATTRIBUTE_CLEANING__QUAT_API("Function toMatrix(mat4x4) will be removed. Use toHomogeneousMatrix() instead") + SOFA_ATTRIBUTE_DEPRECATED__QUAT_API("Function toMatrix(mat4x4) will be removed. Use toHomogeneousMatrix() instead") void toMatrix(Mat4x4 &m) const { toHomogeneousMatrix(m); } /// Convert the quaternion into an orientation homogeneous matrix @@ -205,7 +205,7 @@ class SOFA_TYPE_API Quat /// Sets this quaternion to the rotation required to rotate direction vector vFrom to direction vector vTo. vFrom and vTo are assumed to be normalized. void setFromUnitVectors(const Vec3& vFrom, const Vec3& vTo); - SOFA_ATTRIBUTE_CLEANING__QUAT_API("This function will be removed. use iostream operators instead.") + SOFA_ATTRIBUTE_DEPRECATED__QUAT_API("This function will be removed. use iostream operators instead.") void print(); auto slerp(const Quat &q1, Real t) const -> Quat; diff --git a/SofaKernel/modules/Sofa.Type/src/sofa/type/Vec.h b/SofaKernel/modules/Sofa.Type/src/sofa/type/Vec.h index 6db31816bf5..64e2ae5e46a 100644 --- a/SofaKernel/modules/Sofa.Type/src/sofa/type/Vec.h +++ b/SofaKernel/modules/Sofa.Type/src/sofa/type/Vec.h @@ -431,20 +431,6 @@ class Vec : public sofa::type::fixed_array return this->elems[i]; } - /// Cast into a const array of values. - /// CHANGE(Jeremie A.): removed it as it confuses some compilers. Use ptr() or data() instead - //operator const real*() const - //{ - // return this->elems; - //} - - /// Cast into an array of values. - /// CHANGE(Jeremie A.): removed it as it confuses some compilers. Use ptr() or data() instead - //operator real*() - //{ - // return this->elems; - //} - /// Cast into a const array of values. const ValueType* ptr() const { diff --git a/SofaKernel/modules/SofaBaseCollision/src/SofaBaseCollision/CubeModel.cpp b/SofaKernel/modules/SofaBaseCollision/src/SofaBaseCollision/CubeModel.cpp index c3416dfb122..5e8909278ff 100644 --- a/SofaKernel/modules/SofaBaseCollision/src/SofaBaseCollision/CubeModel.cpp +++ b/SofaKernel/modules/SofaBaseCollision/src/SofaBaseCollision/CubeModel.cpp @@ -33,8 +33,6 @@ using namespace sofa::defaulttype; int CubeCollisionModelClass = core::RegisterObject("Collision model representing a cube") .add< CubeCollisionModel >() - .addAlias("Cube") - .addAlias("CubeModel") ; CubeCollisionModel::CubeCollisionModel() diff --git a/SofaKernel/modules/SofaBaseCollision/src/SofaBaseCollision/CubeModel.h b/SofaKernel/modules/SofaBaseCollision/src/SofaBaseCollision/CubeModel.h index c41ca81bb82..f14d9a827a7 100644 --- a/SofaKernel/modules/SofaBaseCollision/src/SofaBaseCollision/CubeModel.h +++ b/SofaKernel/modules/SofaBaseCollision/src/SofaBaseCollision/CubeModel.h @@ -182,6 +182,4 @@ inline const sofa::defaulttype::Vector3& Cube::getConeAxis() const return model->elems[index].coneAxis; } -using CubeModel [[deprecated("The CubeModel is now deprecated, please use CubeCollisionModel instead. Compatibility stops at v20.06")]] = CubeCollisionModel; - } // namespace sofa::component::collision diff --git a/SofaKernel/modules/SofaBaseCollision/src/SofaBaseCollision/CylinderModel.cpp b/SofaKernel/modules/SofaBaseCollision/src/SofaBaseCollision/CylinderModel.cpp index a25ac430ea5..1ed1633f100 100644 --- a/SofaKernel/modules/SofaBaseCollision/src/SofaBaseCollision/CylinderModel.cpp +++ b/SofaKernel/modules/SofaBaseCollision/src/SofaBaseCollision/CylinderModel.cpp @@ -31,9 +31,6 @@ using namespace helper; int RigidCylinderCollisionModelClass = core::RegisterObject("Collision model which represents a set of rigid cylinders") .add< CylinderCollisionModel >() - - .addAlias("Cylinder") - .addAlias("CylinderModel") ; template class SOFA_SOFABASECOLLISION_API TCylinder; diff --git a/SofaKernel/modules/SofaBaseCollision/src/SofaBaseCollision/CylinderModel.h b/SofaKernel/modules/SofaBaseCollision/src/SofaBaseCollision/CylinderModel.h index 0d07e09f0f7..bb877abad03 100644 --- a/SofaKernel/modules/SofaBaseCollision/src/SofaBaseCollision/CylinderModel.h +++ b/SofaKernel/modules/SofaBaseCollision/src/SofaBaseCollision/CylinderModel.h @@ -64,6 +64,7 @@ class TCylinder: public core::TCollisionElementIterator< CylinderCollisionModel< const Coord & v()const; }; +using Cylinder = TCylinder; /** @@ -153,14 +154,9 @@ inline TCylinder::TCylinder(ParentModel* model, Index index) template inline TCylinder::TCylinder(const core::CollisionElementIterator& i) : core::TCollisionElementIterator(static_cast(i.getCollisionModel()), i.getIndex()) -{ -} - - -using CylinderModel [[deprecated("The CylinderModel is now deprecated, please use CylinderCollisionModel instead. Compatibility stops at v20.06")]] = CylinderCollisionModel; -using Cylinder = TCylinder; +{} -#if !defined(SOFA_COMPONENT_COLLISION_CYLINDERCOLLISIONMODEL_CPP) +#if !defined(SOFA_COMPONENT_COLLISION_CYLINDERCOLLISIONMODEL_CPP) extern template class SOFA_SOFABASECOLLISION_API TCylinder; extern template class SOFA_SOFABASECOLLISION_API CylinderCollisionModel; #endif diff --git a/SofaKernel/modules/SofaBaseCollision/src/SofaBaseCollision/SphereModel.cpp b/SofaKernel/modules/SofaBaseCollision/src/SofaBaseCollision/SphereModel.cpp index 1e73fa3dbe8..19ee9b758aa 100644 --- a/SofaKernel/modules/SofaBaseCollision/src/SofaBaseCollision/SphereModel.cpp +++ b/SofaKernel/modules/SofaBaseCollision/src/SofaBaseCollision/SphereModel.cpp @@ -44,12 +44,8 @@ Vector3 TSphere::getContactPointWithSurfacePoint( const } int SphereModelClass = core::RegisterObject("Collision model which represents a set of Spheres") - .add< SphereCollisionModel >() + .add >() .add >() - - .addAlias("TSphereModel") - .addAlias("Sphere") - .addAlias("SphereModel") ; template class SOFA_SOFABASECOLLISION_API TSphere; diff --git a/SofaKernel/modules/SofaBaseCollision/src/SofaBaseCollision/SphereModel.h b/SofaKernel/modules/SofaBaseCollision/src/SofaBaseCollision/SphereModel.h index bc1017d81be..bcb2d61d2fb 100644 --- a/SofaKernel/modules/SofaBaseCollision/src/SofaBaseCollision/SphereModel.h +++ b/SofaKernel/modules/SofaBaseCollision/src/SofaBaseCollision/SphereModel.h @@ -206,19 +206,14 @@ inline typename DataTypes::Real TSphere::r() const { return (Real) th template inline bool TSphere::hasFreePosition() const { return this->model->mstate->read(core::ConstVecCoordId::freePosition())->isSet(); } - -template using TSphereModel [[deprecated("The TSphereModel is now deprecated, please use SphereCollisionModel instead. Compatibility stops at v20.06")]] = SphereCollisionModel; -using SphereModel [[deprecated("The SphereModel is now deprecated, please use SphereCollisionModel instead. Compatibility stops at v20.06")]] = SphereCollisionModel; using Sphere = TSphere; +using RigidSphere = TSphere; +using RigidSphereModel = SphereCollisionModel; -typedef SphereCollisionModel RigidSphereModel; -typedef TSphere RigidSphere; - -#if !defined(SOFA_COMPONENT_COLLISION_SPHERECOLLISIONMODEL_CPP) +#if !defined(SOFA_COMPONENT_COLLISION_SPHERECOLLISIONMODEL_CPP) extern template class SOFA_SOFABASECOLLISION_API TSphere; extern template class SOFA_SOFABASECOLLISION_API SphereCollisionModel; extern template class SOFA_SOFABASECOLLISION_API SphereCollisionModel; - #endif } // namespace sofa::component::collision diff --git a/SofaKernel/modules/SofaBaseMechanics/src/SofaBaseMechanics/BarycentricMapping.h b/SofaKernel/modules/SofaBaseMechanics/src/SofaBaseMechanics/BarycentricMapping.h index 20500695ba9..60132726df7 100644 --- a/SofaKernel/modules/SofaBaseMechanics/src/SofaBaseMechanics/BarycentricMapping.h +++ b/SofaKernel/modules/SofaBaseMechanics/src/SofaBaseMechanics/BarycentricMapping.h @@ -88,7 +88,7 @@ class BarycentricMapping : public core::Mapping } protected: - [[deprecated("Mapping::eigen_type has been removed in PR1664. Use sofa::linearsolver::EigenSparseMatrix, if not possible contact developpers.")]] + SOFA_ATTRIBUTE_DISABLED("v21.06 (PR#1764)", "v21.06 (PR#1764)", "Use sofa::linearsolver::EigenSparseMatrix instead.") typedef void eigen_type; BarycentricMapping(core::State* from, core::State* to, diff --git a/SofaKernel/modules/SofaBaseMechanics/src/SofaBaseMechanics/MechanicalObject.inl b/SofaKernel/modules/SofaBaseMechanics/src/SofaBaseMechanics/MechanicalObject.inl index 808e4338979..e2d918ac042 100644 --- a/SofaKernel/modules/SofaBaseMechanics/src/SofaBaseMechanics/MechanicalObject.inl +++ b/SofaKernel/modules/SofaBaseMechanics/src/SofaBaseMechanics/MechanicalObject.inl @@ -332,7 +332,7 @@ void MechanicalObject::parse ( sofa::core::objectmodel::BaseObjectDes if (arg->getAttribute("isToPrint")!=nullptr) { - msg_deprecated() << "The 'isToPrint' data field has been deprecated in Sofa 19.06 due to lack of consistency in how it should work." << msgendl + msg_deprecated() << "The 'isToPrint' data field has been deprecated in SOFA v19.06 due to lack of consistency in how it should work." << msgendl "Please contact sofa-dev team in case you need similar."; } diff --git a/SofaKernel/modules/SofaBaseMechanics/src/SofaBaseMechanics/UniformMass.h b/SofaKernel/modules/SofaBaseMechanics/src/SofaBaseMechanics/UniformMass.h index bcc838400ff..162187b428f 100644 --- a/SofaKernel/modules/SofaBaseMechanics/src/SofaBaseMechanics/UniformMass.h +++ b/SofaKernel/modules/SofaBaseMechanics/src/SofaBaseMechanics/UniformMass.h @@ -147,21 +147,6 @@ class UniformMass : public core::behavior::Mass void draw(const core::visual::VisualParams* vparams) override; - //Temporary function to warn the user when old attribute names are used until v19.12 - void parse( sofa::core::objectmodel::BaseObjectDescription* arg ) override - { - if (arg->getAttribute("mass")) - { - msg_warning() << "input data 'mass' changed for 'vertexMass', please update your scene (see PR#637)"; - } - if (arg->getAttribute("totalmass")) - { - msg_warning() << "input data 'totalmass' changed for 'totalMass', please update your scene (see PR#637)"; - } - Inherited::parse(arg); - } - - private: template @@ -199,7 +184,7 @@ class UniformMass : public core::behavior::Mass }; -//Specialization for rigids +// Specialization for rigids template <> void UniformMass::init(); template <> @@ -215,15 +200,13 @@ double UniformMass::getPotenti template <> void UniformMass::draw(const core::visual::VisualParams* vparams); - -#if !defined(SOFA_COMPONENT_MASS_UNIFORMMASS_CPP) +#if !defined(SOFA_COMPONENT_MASS_UNIFORMMASS_CPP) extern template class SOFA_SOFABASEMECHANICS_API UniformMass; extern template class SOFA_SOFABASEMECHANICS_API UniformMass; extern template class SOFA_SOFABASEMECHANICS_API UniformMass; extern template class SOFA_SOFABASEMECHANICS_API UniformMass; extern template class SOFA_SOFABASEMECHANICS_API UniformMass; extern template class SOFA_SOFABASEMECHANICS_API UniformMass; - #endif } // namespace sofa::component::mass diff --git a/SofaKernel/modules/SofaBaseTopology/src/SofaBaseTopology/MeshTopology.cpp b/SofaKernel/modules/SofaBaseTopology/src/SofaBaseTopology/MeshTopology.cpp index f2fb66f5d17..501ed7a76bf 100644 --- a/SofaKernel/modules/SofaBaseTopology/src/SofaBaseTopology/MeshTopology.cpp +++ b/SofaKernel/modules/SofaBaseTopology/src/SofaBaseTopology/MeshTopology.cpp @@ -523,7 +523,7 @@ void MeshTopology::parse(core::objectmodel::BaseObjectDescription* arg) { if (arg->getAttribute("isToPrint")!=nullptr) { - msg_deprecated() << "The 'isToPrint' data field has been deprecated in Sofa 19.06 due to lack of consistency in how it should work." << msgendl + msg_deprecated() << "The 'isToPrint' data field has been deprecated in SOFA v19.06 due to lack of consistency in how it should work." << msgendl "Please contact sofa-dev team in case you need similar."; } Inherit1::parse(arg); diff --git a/SofaKernel/modules/SofaBaseTopology/src/SofaBaseTopology/PointSetTopologyModifier.h b/SofaKernel/modules/SofaBaseTopology/src/SofaBaseTopology/PointSetTopologyModifier.h index 46bb4a1efc0..1fc2f53b8af 100644 --- a/SofaKernel/modules/SofaBaseTopology/src/SofaBaseTopology/PointSetTopologyModifier.h +++ b/SofaKernel/modules/SofaBaseTopology/src/SofaBaseTopology/PointSetTopologyModifier.h @@ -102,7 +102,7 @@ class SOFA_SOFABASETOPOLOGY_API PointSetTopologyModifier : public core::topology virtual void removePoints(sofa::helper::vector< PointID >& indices, const bool removeDOF = true); - /// This Method has been removed in PR #1860 as it was never used nor supported + SOFA_ATTRIBUTE_DISABLED("v21.06 (PR#1860)", "v21.06 (PR#1860)", "This method was never used nor supported.") void propagateTopologicalChangesWithoutReset() = delete; diff --git a/SofaKernel/modules/SofaCore/CMakeLists.txt b/SofaKernel/modules/SofaCore/CMakeLists.txt index e3fddee1d7f..e646407e4af 100644 --- a/SofaKernel/modules/SofaCore/CMakeLists.txt +++ b/SofaKernel/modules/SofaCore/CMakeLists.txt @@ -90,14 +90,11 @@ set(HEADER_FILES ${SRC_ROOT}/collision/NarrowPhaseDetection.h ${SRC_ROOT}/collision/Pipeline.h ${SRC_ROOT}/config.h.in - ${SRC_ROOT}/core.h ${SRC_ROOT}/init.h ${SRC_ROOT}/fwd.h ${SRC_ROOT}/loader/BaseLoader.h ${SRC_ROOT}/loader/ImageLoader.h - ${SRC_ROOT}/loader/Material.h ${SRC_ROOT}/loader/MeshLoader.h - ${SRC_ROOT}/loader/PrimitiveGroup.h ${SRC_ROOT}/loader/SceneLoader.h ${SRC_ROOT}/loader/VoxelLoader.h ${SRC_ROOT}/objectmodel/AbstractDataLink.h diff --git a/SofaKernel/modules/SofaCore/src/sofa/core/DataTracker.cpp b/SofaKernel/modules/SofaCore/src/sofa/core/DataTracker.cpp index 80202414d18..f8a8868bcb8 100644 --- a/SofaKernel/modules/SofaCore/src/sofa/core/DataTracker.cpp +++ b/SofaKernel/modules/SofaCore/src/sofa/core/DataTracker.cpp @@ -25,14 +25,10 @@ namespace sofa { - namespace core { - - - void DataTracker::trackData( const objectmodel::BaseData& data ) { m_dataTrackers[&data] = data.getCounter(); @@ -63,8 +59,6 @@ void DataTracker::clean() it->second = it->first->getCounter(); } - - //////////////////// void DataTrackerDDGNode::addInputs(std::initializer_list datas) { @@ -115,29 +109,6 @@ void DataTrackerCallback::update() } -void DataTrackerEngine::addCallback( std::function f) -{ - m_callbacks.push_back(f); -} - -/// Each callback in the engine is called, setting its owner's component state to the value returned by the last callback. -/// Because each callback overwrites the state of the same component, it is important that within a component, all -/// callbacks perform the same checks to determine the value of the ComponentState. -void DataTrackerEngine::update() -{ - updateAllInputsIfDirty(); - core::objectmodel::ComponentState cs = core::objectmodel::ComponentState::Valid; - - for(auto& callback : m_callbacks) - cs = callback(); - - if (m_owner) - m_owner->d_componentState.setValue(cs); - cleanDirty(); -} - - - } } diff --git a/SofaKernel/modules/SofaCore/src/sofa/core/DataTracker.h b/SofaKernel/modules/SofaCore/src/sofa/core/DataTracker.h index 2abb6972d9c..dce9f145702 100644 --- a/SofaKernel/modules/SofaCore/src/sofa/core/DataTracker.h +++ b/SofaKernel/modules/SofaCore/src/sofa/core/DataTracker.h @@ -185,23 +185,11 @@ namespace core /////////////////////// - class SOFA_CORE_API DataTrackerEngine : public DataTrackerDDGNode - { - public: - [[deprecated("2020-06-17: DataTrackerEngine has been deprecated, use DataTrackerCallback instead. DataTrackerCallback only supports 1 callback at a time, but multiple DataTrackerCallbacks can be created within a single component")]] - DataTrackerEngine() : DataTrackerDDGNode() {} - /// set the update function to call - /// when asking for an output and any input changed. - void addCallback(std::function f); - - /// Calls the callback when one of the data has changed. - void update() override; - - protected: - std::vector> m_callbacks; - std::string m_name {""}; - sofa::core::objectmodel::Base* m_owner {nullptr}; - }; + SOFA_ATTRIBUTE_DISABLED("v20.06 (PR#1406)", "v21.06", + "Use DataTrackerCallback instead. \ + DataTrackerCallback only supports 1 callback at a time, \ + but multiple DataTrackerCallbacks can be created within a single component.") + typedef DeprecatedAndRemoved DataTrackerEngine; ///////////////////////// diff --git a/SofaKernel/modules/SofaCore/src/sofa/core/ObjectFactory.h b/SofaKernel/modules/SofaCore/src/sofa/core/ObjectFactory.h index d9e564d938f..16fd1df821c 100644 --- a/SofaKernel/modules/SofaCore/src/sofa/core/ObjectFactory.h +++ b/SofaKernel/modules/SofaCore/src/sofa/core/ObjectFactory.h @@ -72,7 +72,8 @@ class SOFA_CORE_API ObjectFactory /// BaseClass structure associated with the type of intanciated objects. virtual const objectmodel::BaseClass* getClass() = 0; - virtual std::string shortName(objectmodel::BaseObjectDescription* arg) = 0; + SOFA_ATTRIBUTE_DISABLED__CLASSNAME_INTROSPECTION() + std::string shortName(objectmodel::BaseObjectDescription* arg) = delete; /// The name of the library or executable containing the binary code for this component virtual const char* getTarget() = 0; @@ -228,14 +229,6 @@ class ObjectCreator : public ObjectFactory::Creator { return RealObject::HeaderFileLocation(); } - - SOFA_ATTRIBUTE_DEPRECATED__CLASSNAME_INTROSPECTION() - virtual std::string shortName(objectmodel::BaseObjectDescription* arg) override - { - SOFA_UNUSED(arg); - return sofa::helper::NameDecoder::getShortName(); - } - }; /** diff --git a/SofaKernel/modules/SofaCore/src/sofa/core/VecId.h b/SofaKernel/modules/SofaCore/src/sofa/core/VecId.h index 4fa7d1652c7..9afa389f29b 100644 --- a/SofaKernel/modules/SofaCore/src/sofa/core/VecId.h +++ b/SofaKernel/modules/SofaCore/src/sofa/core/VecId.h @@ -22,6 +22,7 @@ #ifndef SOFA_CORE_VECID_H #define SOFA_CORE_VECID_H +#include #include #include #include @@ -151,8 +152,8 @@ class TStandardVec static MyVecId constraintJacobian() { return MyVecId(1);} // jacobian matrix of constraints static MyVecId mappingJacobian() { return MyVecId(2);} // accumulated matrix of the mappings - [[deprecated("HolonomicC has be deprecated.")]] - static MyVecId holonomicC() { return MyVecId(1); } + SOFA_ATTRIBUTE_DISABLED("v17.06 (PR#276)", "v21.06", "See VecId.h to remove this message and replace by constraintMatrix") + static MyVecId holonomicC() = delete; enum { V_FIRST_DYNAMIC_INDEX = 3 }; ///< This is the first index used for dynamically allocated vectors static std::string getName(const MyVecId& v) diff --git a/SofaKernel/modules/SofaCore/src/sofa/core/core.h b/SofaKernel/modules/SofaCore/src/sofa/core/core.h deleted file mode 100644 index 2bd43319157..00000000000 --- a/SofaKernel/modules/SofaCore/src/sofa/core/core.h +++ /dev/null @@ -1,31 +0,0 @@ -/****************************************************************************** -* SOFA, Simulation Open-Framework Architecture * -* (c) 2006 INRIA, USTL, UJF, CNRS, MGH * -* * -* This program is free software; you can redistribute it and/or modify it * -* under the terms of the GNU Lesser General Public License as published by * -* the Free Software Foundation; either version 2.1 of the License, or (at * -* your option) any later version. * -* * -* This program is distributed in the hope that it will be useful, but WITHOUT * -* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or * -* FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License * -* for more details. * -* * -* You should have received a copy of the GNU Lesser General Public License * -* along with this program. If not, see . * -******************************************************************************* -* Authors: The SOFA Team and external contributors (see Authors.txt) * -* * -* Contact information: contact@sofa-framework.org * -******************************************************************************/ -#ifndef SOFA_CORE_CORE_H -#define SOFA_CORE_CORE_H - -// Backward compatibility header - -#include - -SOFA_DEPRECATED_HEADER(v21.06, "sofa/core/config.h") - -#endif diff --git a/SofaKernel/modules/SofaCore/src/sofa/core/loader/Material.h b/SofaKernel/modules/SofaCore/src/sofa/core/loader/Material.h deleted file mode 100644 index 586975c51be..00000000000 --- a/SofaKernel/modules/SofaCore/src/sofa/core/loader/Material.h +++ /dev/null @@ -1,27 +0,0 @@ -/****************************************************************************** -* SOFA, Simulation Open-Framework Architecture * -* (c) 2006 INRIA, USTL, UJF, CNRS, MGH * -* * -* This program is free software; you can redistribute it and/or modify it * -* under the terms of the GNU Lesser General Public License as published by * -* the Free Software Foundation; either version 2.1 of the License, or (at * -* your option) any later version. * -* * -* This program is distributed in the hope that it will be useful, but WITHOUT * -* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or * -* FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License * -* for more details. * -* * -* You should have received a copy of the GNU Lesser General Public License * -* along with this program. If not, see . * -******************************************************************************* -* Authors: The SOFA Team and external contributors (see Authors.txt) * -* * -* Contact information: contact@sofa-framework.org * -******************************************************************************/ -///The Material object that was previously in this sofa::core::loader is now in sofa::helper:types::Material. -///The following lines is there to provide backward compatibility with existing code base. -///This is just there for a transitional period of time and has be removed at sofa release 21.06 -#error Material is now located in sofa/helper/types/Material.h - - diff --git a/SofaKernel/modules/SofaCore/src/sofa/core/loader/MeshLoader.h b/SofaKernel/modules/SofaCore/src/sofa/core/loader/MeshLoader.h index a49c32e101d..eb321972be2 100644 --- a/SofaKernel/modules/SofaCore/src/sofa/core/loader/MeshLoader.h +++ b/SofaKernel/modules/SofaCore/src/sofa/core/loader/MeshLoader.h @@ -22,28 +22,21 @@ #ifndef SOFA_CORE_LOADER_MESHLOADER_H #define SOFA_CORE_LOADER_MESHLOADER_H +#include #include #include -#include +#include #include -namespace sofa -{ - namespace helper - { - namespace io - { - class Mesh; - } - } +namespace sofa::helper::io { + class Mesh; +} -namespace core -{ - -namespace loader +namespace sofa::core::loader { +using sofa::type::PrimitiveGroup; using sofa::defaulttype::Vec3; using topology::Topology; @@ -239,129 +232,61 @@ class SOFA_CORE_API MeshLoader : public BaseLoader void copyMeshToData(helper::io::Mesh& _mesh); /// Deprecation with pointer versions -#define DEPRECATE_POINTER \ - [[deprecated("This function has been deprecated in #PR 1627. The function will be removed " \ - "in the v21.06 release. This should use a reference instead of a pointer.")]] - - DEPRECATE_POINTER - void addPosition(helper::vector< sofa::defaulttype::Vec<3, SReal> >* pPositions, const sofa::defaulttype::Vec<3, SReal>& p) - { - addPosition(*pPositions, p); - } - DEPRECATE_POINTER - void addPosition(helper::vector >* pPositions, SReal x, SReal y, SReal z) - { - addPosition(*pPositions, x,y,z); - } - - DEPRECATE_POINTER - void addPolyline(helper::vector* pPolylines, Polyline p) - { - addPolyline(*pPolylines, p); - } - - DEPRECATE_POINTER - void addEdge(helper::vector* pEdges, const Edge& p) - { - addEdge(*pEdges, p); - } - DEPRECATE_POINTER - void addEdge(helper::vector* pEdges, Topology::EdgeID p0, Topology::EdgeID p1) - { - addEdge(*pEdges, p0, p1); - } - - DEPRECATE_POINTER - void addTriangle(helper::vector* pTriangles, const Triangle& p) - { - addTriangle(*pTriangles, p); - } - DEPRECATE_POINTER - void addTriangle(helper::vector* pTriangles, Topology::TriangleID p0, Topology::TriangleID p1, Topology::TriangleID p2) - { - addTriangle(*pTriangles, p0,p1,p2); - } - - DEPRECATE_POINTER - void addQuad(helper::vector* pQuads, const Quad& p) - { - addQuad(*pQuads, p); - } - DEPRECATE_POINTER - void addQuad(helper::vector* pQuads, Topology::QuadID p0, Topology::QuadID p1, Topology::QuadID p2, Topology::QuadID p3) - { - addQuad(*pQuads, p0, p1, p2, p3); - } - - DEPRECATE_POINTER - void addPolygon(helper::vector< helper::vector >* pPolygons, const helper::vector& p) - { - addPolygon(*pPolygons, p); - } - - DEPRECATE_POINTER - void addTetrahedron(helper::vector* pTetrahedra, const Tetrahedron& p) - { - addTetrahedron(*pTetrahedra, p); - } - DEPRECATE_POINTER - void addTetrahedron(helper::vector* pTetrahedra, Topology::TetrahedronID p0, Topology::TetrahedronID p1, Topology::TetrahedronID p2, Topology::TetrahedronID p3) - { - addTetrahedron(*pTetrahedra, p0, p1, p2, p3); - } - - DEPRECATE_POINTER - void addHexahedron(helper::vector< Hexahedron>* pHexahedra, const Hexahedron& p) - { - addHexahedron(*pHexahedra, p); - } - DEPRECATE_POINTER + SOFA_ATTRIBUTE_DISABLED__REFERENCES_IN_MESHLOADER() + void addPosition(helper::vector< sofa::defaulttype::Vec<3, SReal> >* pPositions, const sofa::defaulttype::Vec<3, SReal>& p) = delete; + SOFA_ATTRIBUTE_DISABLED__REFERENCES_IN_MESHLOADER() + void addPosition(helper::vector >* pPositions, SReal x, SReal y, SReal z) = delete; + + SOFA_ATTRIBUTE_DISABLED__REFERENCES_IN_MESHLOADER() + void addPolyline(helper::vector* pPolylines, Polyline p) = delete; + + SOFA_ATTRIBUTE_DISABLED__REFERENCES_IN_MESHLOADER() + void addEdge(helper::vector* pEdges, const Edge& p) = delete; + SOFA_ATTRIBUTE_DISABLED__REFERENCES_IN_MESHLOADER() + void addEdge(helper::vector* pEdges, Topology::EdgeID p0, Topology::EdgeID p1) = delete; + + SOFA_ATTRIBUTE_DISABLED__REFERENCES_IN_MESHLOADER() + void addTriangle(helper::vector* pTriangles, const Triangle& p) = delete; + SOFA_ATTRIBUTE_DISABLED__REFERENCES_IN_MESHLOADER() + void addTriangle(helper::vector* pTriangles, Topology::TriangleID p0, Topology::TriangleID p1, Topology::TriangleID p2) = delete; + + SOFA_ATTRIBUTE_DISABLED__REFERENCES_IN_MESHLOADER() + void addQuad(helper::vector* pQuads, const Quad& p) = delete; + SOFA_ATTRIBUTE_DISABLED__REFERENCES_IN_MESHLOADER() + void addQuad(helper::vector* pQuads, Topology::QuadID p0, Topology::QuadID p1, Topology::QuadID p2, Topology::QuadID p3) = delete; + + SOFA_ATTRIBUTE_DISABLED__REFERENCES_IN_MESHLOADER() + void addPolygon(helper::vector< helper::vector >* pPolygons, const helper::vector& p) = delete; + + SOFA_ATTRIBUTE_DISABLED__REFERENCES_IN_MESHLOADER() + void addTetrahedron(helper::vector* pTetrahedra, const Tetrahedron& p) = delete; + SOFA_ATTRIBUTE_DISABLED__REFERENCES_IN_MESHLOADER() + void addTetrahedron(helper::vector* pTetrahedra, Topology::TetrahedronID p0, Topology::TetrahedronID p1, Topology::TetrahedronID p2, Topology::TetrahedronID p3) = delete; + + SOFA_ATTRIBUTE_DISABLED__REFERENCES_IN_MESHLOADER() + void addHexahedron(helper::vector< Hexahedron>* pHexahedra, const Hexahedron& p) = delete; + SOFA_ATTRIBUTE_DISABLED__REFERENCES_IN_MESHLOADER() void addHexahedron(helper::vector< Hexahedron>* pHexahedra, Topology::HexahedronID p0, Topology::HexahedronID p1, Topology::HexahedronID p2, Topology::HexahedronID p3, - Topology::HexahedronID p4, Topology::HexahedronID p5, Topology::HexahedronID p6, Topology::HexahedronID p7) - { - addHexahedron(*pHexahedra, p0, p1, p2, p3, p4, p5, p6, p7); - } + Topology::HexahedronID p4, Topology::HexahedronID p5, Topology::HexahedronID p6, Topology::HexahedronID p7) = delete; - DEPRECATE_POINTER - void addPentahedron(helper::vector< Pentahedron>* pPentahedra, const Pentahedron& p) - { - addPentahedron(*pPentahedra, p); - } - DEPRECATE_POINTER + SOFA_ATTRIBUTE_DISABLED__REFERENCES_IN_MESHLOADER() + void addPentahedron(helper::vector< Pentahedron>* pPentahedra, const Pentahedron& p) = delete; + SOFA_ATTRIBUTE_DISABLED__REFERENCES_IN_MESHLOADER() void addPentahedron(helper::vector< Pentahedron>* pPentahedra, Topology::ElemID p0, Topology::ElemID p1, Topology::ElemID p2, Topology::ElemID p3, - Topology::ElemID p4, Topology::ElemID p5) - { - addPentahedron(*pPentahedra, p0, p1, p2, p3, p4, p5); - } + Topology::ElemID p4, Topology::ElemID p5) = delete; - DEPRECATE_POINTER - void addPyramid(helper::vector< Pyramid>* pPyramids, const Pyramid& p) - { - addPyramid(*pPyramids, p); - } - DEPRECATE_POINTER + SOFA_ATTRIBUTE_DISABLED__REFERENCES_IN_MESHLOADER() + void addPyramid(helper::vector< Pyramid>* pPyramids, const Pyramid& p) = delete; + SOFA_ATTRIBUTE_DISABLED__REFERENCES_IN_MESHLOADER() void addPyramid(helper::vector< Pyramid>* pPyramids, - Topology::ElemID p0, Topology::ElemID p1, Topology::ElemID p2, Topology::ElemID p3, Topology::ElemID p4) - { - addPyramid(*pPyramids, p0, p1, p2, p3, p4); - } + Topology::ElemID p0, Topology::ElemID p1, Topology::ElemID p2, Topology::ElemID p3, Topology::ElemID p4) = delete; - DEPRECATE_POINTER - void copyMeshToData(helper::io::Mesh* _mesh) - { - copyMeshToData(*_mesh); - } - -#undef DEPRECATE_POINTER + SOFA_ATTRIBUTE_DISABLED__REFERENCES_IN_MESHLOADER() + void copyMeshToData(helper::io::Mesh* _mesh) = delete; }; - -} // namespace loader - -} // namespace core - -} // namespace sofa +} // namespace sofa::core::loader #endif diff --git a/SofaKernel/modules/SofaCore/src/sofa/core/loader/PrimitiveGroup.h b/SofaKernel/modules/SofaCore/src/sofa/core/loader/PrimitiveGroup.h deleted file mode 100644 index 1ba0057c8e1..00000000000 --- a/SofaKernel/modules/SofaCore/src/sofa/core/loader/PrimitiveGroup.h +++ /dev/null @@ -1,35 +0,0 @@ -/****************************************************************************** -* SOFA, Simulation Open-Framework Architecture * -* (c) 2006 INRIA, USTL, UJF, CNRS, MGH * -* * -* This program is free software; you can redistribute it and/or modify it * -* under the terms of the GNU Lesser General Public License as published by * -* the Free Software Foundation; either version 2.1 of the License, or (at * -* your option) any later version. * -* * -* This program is distributed in the hope that it will be useful, but WITHOUT * -* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or * -* FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License * -* for more details. * -* * -* You should have received a copy of the GNU Lesser General Public License * -* along with this program. If not, see . * -******************************************************************************* -* Authors: The SOFA Team and external contributors (see Authors.txt) * -* * -* Contact information: contact@sofa-framework.org * -******************************************************************************/ -#pragma once -#include - -namespace sofa::core::loader -{ - -///The PrimitiveGroup object that was previously in this sofa::core::loader is now in sofa::helper:types::Material. -///The following lines is there to provide backward compatibility with existing code base. -///This is just there for a transitional period of time and will be removed after 2018-01-07 -//TODO(dmarchal 2020-12-29): Delete that around 2021-05-01 -using sofa::helper::types::PrimitiveGroup; - -} // namespace sofa - diff --git a/SofaKernel/modules/SofaCore/src/sofa/core/objectmodel/Base.cpp b/SofaKernel/modules/SofaCore/src/sofa/core/objectmodel/Base.cpp index 14c8167e6fc..2cf27b2130d 100644 --- a/SofaKernel/modules/SofaCore/src/sofa/core/objectmodel/Base.cpp +++ b/SofaKernel/modules/SofaCore/src/sofa/core/objectmodel/Base.cpp @@ -37,13 +37,7 @@ using sofa::helper::logging::Message ; #define ERROR_LOG_SIZE 100 -namespace sofa -{ - -namespace core -{ - -namespace objectmodel +namespace sofa::core::objectmodel { using std::string; @@ -647,58 +641,6 @@ void Base::writeDatas (std::ostream& out, const std::string& separator) } } -/////////////////////////////////////////////////////////////////////////////////////////////////// -//////////////////////////// DEPRECATED SECTION /////////////////////////////////////////////////// -/// Everything below this point is deprecated and will be removed soon ! -/// Do not use it anymore. For each function a replacement is suggested. - -const std::string Base::getWarnings() const -{ - dmsg_deprecated(this) << " getWarning() is deprecated." - " Using deprecated code may result in lower performances or un-expected behavior." - " To remove this warning you need to use getLoggedMessage() instead. "; - - std::stringstream tmpstr ; - for(Message& m : m_messageslog){ - if(m.type()==Message::Error || m.type()==Message::Warning || m.type()==Message::Fatal) - { - tmpstr << m.messageAsString() ; - } - } - return tmpstr.str(); -} - -const std::string Base::getOutputs() const -{ - dmsg_deprecated(this) << " getOutputs() is deprecated." - " Using deprecated code may result in lower performances or un-expected behavior." - " To remove this warning you need to use getLoggedMessage() instead. "; - - std::stringstream tmpstr ; - for(Message& m : m_messageslog){ - if(m.type()==Message::Info || m.type()==Message::Advice || m.type()==Message::Deprecated){ - tmpstr << m.messageAsString() ; - } - } - return tmpstr.str(); -} - -void Base::clearWarnings() -{ - dmsg_deprecated(this) << " clearWarnings() is deprecated." - " Using deprecated code may result in lower performances or un-expected behavior." - " To remove this warning you need to use clearLoggedMessages() instead. "; - clearLoggedMessages(); -} - -void Base::clearOutputs() -{ - dmsg_deprecated(this) << " clearOutput() is deprecated." - " Using deprecated code may result in lower performances or un-expected behavior." - " To remove this warning you need to use clearLoggedMessages() instead. "; - clearLoggedMessages(); -} - /// Set the source filename (where the component is implemented) void Base::setDefinitionSourceFileName(const std::string& sourceFileName) { @@ -751,16 +693,10 @@ int Base::getInstanciationSourceFilePos() const return m_instanciationSourceFilePos; } +} // namespace sofa::core::objectmodel - -} // namespace objectmodel - -} // namespace core - -namespace helper -{ -namespace logging +namespace sofa::helper::logging { SofaComponentInfo::SofaComponentInfo(const sofa::core::objectmodel::Base* c) @@ -771,6 +707,4 @@ SofaComponentInfo::SofaComponentInfo(const sofa::core::objectmodel::Base* c) m_name = c->getName() ; } -} // namespace logging -} // namespace helper -} // namespace sofa +} // namespace sofa::helper::logging diff --git a/SofaKernel/modules/SofaCore/src/sofa/core/objectmodel/Base.h b/SofaKernel/modules/SofaCore/src/sofa/core/objectmodel/Base.h index 4986f9677e1..c8bf9722b6e 100644 --- a/SofaKernel/modules/SofaCore/src/sofa/core/objectmodel/Base.h +++ b/SofaKernel/modules/SofaCore/src/sofa/core/objectmodel/Base.h @@ -40,8 +40,7 @@ // forward declaration of castable classes // @author Matthieu Nesme, 2015 // it is not super elegant, but it is way more efficient than dynamic_cast -namespace sofa { -namespace core { +namespace sofa::core { class BaseState; class BaseMapping; class BehaviorModel; @@ -89,30 +88,19 @@ namespace collision { class Intersection; class Pipeline; } // namespace collision -namespace loader -{ +namespace loader { class BaseLoader; } // namespace loader -} // namespace core -} // namespace sofa +} // namespace sofa::core // VisitorScheduler -// Empty class to be used to highlight deprecated objects at compilation time. -class DeprecatedAndRemoved {}; - #define SOFA_BASE_CAST_IMPLEMENTATION(CLASSNAME) \ virtual const CLASSNAME* to##CLASSNAME() const override { return this; } \ virtual CLASSNAME* to##CLASSNAME() override { return this; } -namespace sofa -{ - -namespace core -{ - -namespace objectmodel +namespace sofa::core::objectmodel { /** @@ -388,13 +376,6 @@ class SOFA_CORE_API Base /// runs the stream processing mutable helper::system::SofaEndl sendl; - ////////////// DEPRECATED ///////////////////////////////////////////////////////////////////////////// - const std::string getWarnings() const; /// use getLoggedMessageAsString() or getLoggedMessage instead. - const std::string getOutputs() const; /// use getLoggedMessageAsString() or getLoggedMessage instead. - void clearWarnings(); /// use clearLoggedMessages() instead - void clearOutputs(); /// use clearLoggedMessages() instead - /////////////////////////////////////////////////////////////////////////////////////////////////////// - void processStream(std::ostream& out); void addMessage(const sofa::helper::logging::Message& m) const ; @@ -435,12 +416,8 @@ class SOFA_CORE_API Base /// \code T* ptr = nullptr; std::string type = T::typeName(ptr); \endcode /// This way derived classes can redefine the typeName method template - SOFA_ATTRIBUTE_DEPRECATED__CLASSNAME_INTROSPECTION() - static std::string typeName(const T* ptr = nullptr) - { - SOFA_UNUSED(ptr); - return sofa::helper::NameDecoder::decodeTypeName(typeid(T)); - } + SOFA_ATTRIBUTE_DISABLED__CLASSNAME_INTROSPECTION() + static std::string typeName(const T* ptr = nullptr) = delete; /// Helper method to get the class name of a type derived from this class /// @@ -448,12 +425,8 @@ class SOFA_CORE_API Base /// \code std::string type = Base::className(); \endcode /// This way derived classes can redefine the className method template - SOFA_ATTRIBUTE_DEPRECATED__CLASSNAME_INTROSPECTION() - static std::string className(const T* ptr = nullptr) - { - SOFA_UNUSED(ptr); - return sofa::helper::NameDecoder::decodeClassName(typeid(T)); - } + SOFA_ATTRIBUTE_DISABLED__CLASSNAME_INTROSPECTION() + static std::string className(const T* ptr = nullptr) = delete; /// Helper method to get the namespace name of a type derived from this class /// @@ -461,12 +434,8 @@ class SOFA_CORE_API Base /// \code std::string type = Base::namespaceName(); \endcode /// This way derived classes can redefine the namespaceName method template - SOFA_ATTRIBUTE_DEPRECATED__CLASSNAME_INTROSPECTION() - static std::string namespaceName(const T* ptr = nullptr) - { - SOFA_UNUSED(ptr); - return sofa::helper::NameDecoder::decodeNamespaceName(typeid(T)); - } + SOFA_ATTRIBUTE_DISABLED__CLASSNAME_INTROSPECTION() + static std::string namespaceName(const T* ptr = nullptr) = delete; /// Helper method to get the template name of a type derived from this class /// @@ -474,12 +443,8 @@ class SOFA_CORE_API Base /// \code std::string type = Base::templateName); \endcode /// This way derived classes can redefine the templateName method template - SOFA_ATTRIBUTE_DEPRECATED__CLASSNAME_INTROSPECTION() - static std::string templateName(const T* ptr = nullptr) - { - SOFA_UNUSED(ptr); - return sofa::helper::NameDecoder::decodeTemplateName(typeid(T)); - } + SOFA_ATTRIBUTE_DISABLED__CLASSNAME_INTROSPECTION() + static std::string templateName(const T* ptr = nullptr) = delete; /// Helper method to get the shortname of a type derived from this class. /// The default implementation return the class name. @@ -598,44 +563,37 @@ class SOFA_CORE_API Base /// @} }; +} // namespace sofa::core::objectmodel -} // namespace objectmodel - -} // namespace core - -} // namespace sofa /// This allow Base object to interact with the messaging system. -namespace sofa +namespace sofa::helper::logging { -namespace helper -{ -namespace logging + +inline bool notMuted(const sofa::core::objectmodel::Base* t){ return t->notMuted(); } +inline bool notMuted(sofa::core::objectmodel::Base* t){ return t->notMuted(); } + +class SOFA_CORE_API SofaComponentInfo : public ComponentInfo { - inline bool notMuted(const sofa::core::objectmodel::Base* t){ return t->notMuted(); } - inline bool notMuted(sofa::core::objectmodel::Base* t){ return t->notMuted(); } +public: + const sofa::core::objectmodel::Base* m_component ; + std::string m_name; - class SOFA_CORE_API SofaComponentInfo : public ComponentInfo + SofaComponentInfo(const sofa::core::objectmodel::Base* c); + const std::string& name() const { return m_name; } + std::ostream& toStream(std::ostream &out) const { - public: - const sofa::core::objectmodel::Base* m_component ; - std::string m_name; - - SofaComponentInfo(const sofa::core::objectmodel::Base* c); - const std::string& name() const { return m_name; } - std::ostream& toStream(std::ostream &out) const - { - out << m_sender << "(" << m_name << ")" ; - return out ; - } - }; - - /// This construct a new ComponentInfo object from a Base object. - inline ComponentInfo::SPtr getComponentInfo(const sofa::core::objectmodel::Base* t) - { - return ComponentInfo::SPtr( new SofaComponentInfo(t) ) ; + out << m_sender << "(" << m_name << ")" ; + return out ; } -} // logging -} // helper -} // sofa +}; + +/// This construct a new ComponentInfo object from a Base object. +inline ComponentInfo::SPtr getComponentInfo(const sofa::core::objectmodel::Base* t) +{ + return ComponentInfo::SPtr( new SofaComponentInfo(t) ) ; +} + +} // namespace sofa::helper::logging + #endif diff --git a/SofaKernel/modules/SofaCore/src/sofa/core/objectmodel/BaseClass.cpp b/SofaKernel/modules/SofaCore/src/sofa/core/objectmodel/BaseClass.cpp index 35f724abd12..aa4b374e0b3 100644 --- a/SofaKernel/modules/SofaCore/src/sofa/core/objectmodel/BaseClass.cpp +++ b/SofaKernel/modules/SofaCore/src/sofa/core/objectmodel/BaseClass.cpp @@ -53,26 +53,6 @@ DeprecatedBaseClass::DeprecatedBaseClass() shortName = "DeprecatedBaseClass::shortname"; } -std::string BaseClass::decodeFullName(const std::type_info& t) -{ - return sofa::helper::NameDecoder::decodeFullName(t); -} - -std::string BaseClass::decodeTypeName(const std::type_info& t) -{ - return sofa::helper::NameDecoder::decodeTypeName(t); -} - -std::string BaseClass::decodeClassName(const std::type_info& t) -{ - return sofa::helper::NameDecoder::decodeClassName(t); -} - -std::string BaseClass::decodeNamespaceName(const std::type_info& t) -{ - return sofa::helper::NameDecoder::decodeNamespaceName(t); -} - } // namespace objectmodel diff --git a/SofaKernel/modules/SofaCore/src/sofa/core/objectmodel/BaseClass.h b/SofaKernel/modules/SofaCore/src/sofa/core/objectmodel/BaseClass.h index b594e478df3..86905d7f01e 100644 --- a/SofaKernel/modules/SofaCore/src/sofa/core/objectmodel/BaseClass.h +++ b/SofaKernel/modules/SofaCore/src/sofa/core/objectmodel/BaseClass.h @@ -99,36 +99,30 @@ class SOFA_CORE_API BaseClass virtual Base* dynamicCast(Base* obj) const = 0; virtual bool isInstance(Base* obj) const = 0; - ///////////////////////////////// DEPRECATED ////////////////////////////////////////////////// /// Helper method to decode the type name - SOFA_ATTRIBUTE_DEPRECATED__CLASSNAME_INTROSPECTION() - static std::string decodeFullName(const std::type_info& t); + SOFA_ATTRIBUTE_DISABLED__CLASSNAME_INTROSPECTION() + static std::string decodeFullName(const std::type_info& t) = delete; /// Helper method to decode the type name to a more readable form if possible - SOFA_ATTRIBUTE_DEPRECATED__CLASSNAME_INTROSPECTION() - static std::string decodeTypeName(const std::type_info& t); + SOFA_ATTRIBUTE_DISABLED__CLASSNAME_INTROSPECTION() + static std::string decodeTypeName(const std::type_info& t) = delete; /// Helper method to extract the class name (removing namespaces and templates) - SOFA_ATTRIBUTE_DEPRECATED__CLASSNAME_INTROSPECTION() - static std::string decodeClassName(const std::type_info& t); + SOFA_ATTRIBUTE_DISABLED__CLASSNAME_INTROSPECTION() + static std::string decodeClassName(const std::type_info& t) = delete; /// Helper method to extract the namespace (removing class name and templates) - SOFA_ATTRIBUTE_DEPRECATED__CLASSNAME_INTROSPECTION() - static std::string decodeNamespaceName(const std::type_info& t); + SOFA_ATTRIBUTE_DISABLED__CLASSNAME_INTROSPECTION() + static std::string decodeNamespaceName(const std::type_info& t) = delete; /// Helper method to extract the template name (removing namespaces and class name) - SOFA_ATTRIBUTE_DEPRECATED__CLASSNAME_INTROSPECTION() - static std::string decodeTemplateName(const std::type_info& t); + SOFA_ATTRIBUTE_DISABLED__CLASSNAME_INTROSPECTION() + static std::string decodeTemplateName(const std::type_info& t) = delete; /// Helper method to get the type name template - SOFA_ATTRIBUTE_DEPRECATED__CLASSNAME_INTROSPECTION() - static std::string defaultTypeName(const T* = nullptr) - { - return sofa::helper::NameDecoder::decodeTypeName(typeid(T)); - } - - + SOFA_ATTRIBUTE_DISABLED__CLASSNAME_INTROSPECTION() + static std::string defaultTypeName(const T* = nullptr) = delete; }; class SOFA_CORE_API DeprecatedBaseClass : public BaseClass diff --git a/SofaKernel/modules/SofaCore/src/sofa/core/objectmodel/Data.h b/SofaKernel/modules/SofaCore/src/sofa/core/objectmodel/Data.h index 21b6b4e5ff3..7d393eea77d 100644 --- a/SofaKernel/modules/SofaCore/src/sofa/core/objectmodel/Data.h +++ b/SofaKernel/modules/SofaCore/src/sofa/core/objectmodel/Data.h @@ -487,14 +487,14 @@ WriteAccessor > getWriteAccessor(core::objectmodel::D } template -[[deprecated("2021-02-01: this function has been replaced with getWriteAccessor in PR #1807. You can probably update your code by removing aspect related calls. To update your code, use the new function.")]] +SOFA_ATTRIBUTE_DEPRECATED("v21.06 (PR#1807)", "v21.12", "You can probably update your code by removing aspect related calls. To update your code, use the new function.") WriteAccessor > write(core::objectmodel::Data& data) { return getWriteAccessor(data); } template -[[deprecated("2021-02-01: Aspect have been deprecated for complete removal in PR #1269. You can probably update your code by removing aspect related calls. If the feature was important to you contact sofa-dev. ")]] +SOFA_ATTRIBUTE_DISABLED__ASPECT("You can probably update your code by removing aspect related calls.") WriteAccessor > write(core::objectmodel::Data& data, const core::ExecParams*) = delete; template @@ -504,14 +504,14 @@ ReadAccessor > getReadAccessor(const core::objectmode } template -[[deprecated("2021-02-01: Aspect have been deprecated for complete removal in PR #1807. You can probably update your code by removing aspect related calls. To update your code, use the new function.")]] +SOFA_ATTRIBUTE_DEPRECATED("v21.06 (PR#1807)", "v21.12", "You can probably update your code by removing aspect related calls. To update your code, use the new function.") ReadAccessor > read(const core::objectmodel::Data& data) { return getReadAccessor(data); } template -[[deprecated("2021-02-01: Aspect have been deprecated for complete removal in PR #1269. You can probably update your code by removing aspect related calls. If the feature was important to you contact sofa-dev. ")]] +SOFA_ATTRIBUTE_DISABLED__ASPECT("You can probably update your code by removing aspect related calls.") ReadAccessor > read(const core::objectmodel::Data& data, const core::ExecParams*) = delete; /// Easy syntax for getting write only access to a Data using operator ->. Example: writeOnly(someFlagData)->setFlagValue(true); diff --git a/SofaKernel/modules/SofaCore/src/sofa/core/objectmodel/DataFileName.cpp b/SofaKernel/modules/SofaCore/src/sofa/core/objectmodel/DataFileName.cpp index f1d2e2ec766..ea9eeb30985 100644 --- a/SofaKernel/modules/SofaCore/src/sofa/core/objectmodel/DataFileName.cpp +++ b/SofaKernel/modules/SofaCore/src/sofa/core/objectmodel/DataFileName.cpp @@ -85,8 +85,7 @@ void DataFileName::updatePath() { if( m_fullpath.find(path) == 0 ) { - m_relativepath=DataRepository.relativeToPath(m_fullpath, path, - false /*option for backward compatibility*/); + m_relativepath = DataRepository.relativeToPath(m_fullpath, path); break; } } diff --git a/SofaKernel/modules/SofaCore/src/sofa/core/objectmodel/Link.h b/SofaKernel/modules/SofaCore/src/sofa/core/objectmodel/Link.h index 8d012e8c16c..eb526ecbfc7 100644 --- a/SofaKernel/modules/SofaCore/src/sofa/core/objectmodel/Link.h +++ b/SofaKernel/modules/SofaCore/src/sofa/core/objectmodel/Link.h @@ -468,7 +468,7 @@ class TLink : public BaseLink m_owner->addLink(this); } - [[deprecated("2021-01-01: CheckPath as been deprecated for complete removal in PR. You can update your code by using PathResolver::CheckPath(Base*, BaseClass*, string).")]] + SOFA_ATTRIBUTE_DEPRECATED("v21.06 (PR#1717)", "v21.12", "Use PathResolver::CheckPaths(Base*, BaseClass*, string) instead.") static bool CheckPath(const std::string& path, Base* context) { return PathResolver::CheckPath(context, sofa::core::objectmodel::base::GetClass(), path); @@ -611,7 +611,7 @@ class MultiLink : public TLink SeqEdges; typedef sofa::helper::vector SeqTriangles; diff --git a/SofaKernel/modules/SofaCore/src/sofa/core/visual/VisualParams.h b/SofaKernel/modules/SofaCore/src/sofa/core/visual/VisualParams.h index 9714024d5ea..84f7d8dbae2 100644 --- a/SofaKernel/modules/SofaCore/src/sofa/core/visual/VisualParams.h +++ b/SofaKernel/modules/SofaCore/src/sofa/core/visual/VisualParams.h @@ -140,17 +140,16 @@ class SOFA_CORE_API VisualParams : public ExecParams /// Get the projection matrix used to draw the scene. This OpenGL matrix defines the camera coordinate system with respect to the viewport, including perspective if any. void getProjectionMatrix( double m[16] ) const { for(unsigned i=0; i<16; i++) m[i] = m_projectionMatrix[i]; } - /// set those deprecations as error ASAP - [[deprecated("sceneTransform in DrawTool is removed from VisualParam, use with the ModelView and Perspective Matrices instead.")]] + SOFA_ATTRIBUTE_DEPRECATED("v21.06 (PR#1649)", "v21.12", "Use with the ModelView and Perspective Matrices instead.") helper::visual::Transformation& sceneTransform() { return m_sceneTransform; } - [[deprecated("sceneTransform in DrawTool is removed from VisualParam, use with the ModelView and Perspective Matrices instead.")]] + SOFA_ATTRIBUTE_DEPRECATED("v21.06 (PR#1649)", "v21.12", "Use with the ModelView and Perspective Matrices instead.") const helper::visual::Transformation& sceneTransform() const { return m_sceneTransform; } - //[[deprecated("frameBufferObject in DrawTool is removed from VisualParam, use your rendering API instead.")]] + //SOFA_ATTRIBUTE_DEPRECATED("v21.06 (PR#1649)", "v21.12", "Use your rendering API instead.") //sofa::gl::FrameBufferObject*& frameBufferObject() { return m_boundFrameBuffer; } - //[[deprecated("frameBufferObject in DrawTool is removed from VisualParam, use your rendering API instead.")]] + //SOFA_ATTRIBUTE_DEPRECATED("v21.06 (PR#1649)", "v21.12", "Use your rendering API instead.") //sofa::gl::FrameBufferObject*& frameBufferObject() const { return m_boundFrameBuffer; } bool isSupported(unsigned int api) const diff --git a/SofaKernel/modules/SofaDefaultType/CMakeLists.txt b/SofaKernel/modules/SofaDefaultType/CMakeLists.txt index 8975eb2ff3d..1722387233d 100644 --- a/SofaKernel/modules/SofaDefaultType/CMakeLists.txt +++ b/SofaKernel/modules/SofaDefaultType/CMakeLists.txt @@ -21,7 +21,6 @@ set(HEADER_FILES ${SRC_ROOT}/TypeInfoRegistryTools.h ${SRC_ROOT}/TopologyTypes.h ${SRC_ROOT}/VecTypes.h - ${SRC_ROOT}/defaulttype.h ${SRC_ROOT}/config.h.in ${SRC_ROOT}/init.h ${SRC_ROOT}/fwd.h diff --git a/SofaKernel/modules/SofaDefaultType/src/sofa/defaulttype/TopologyTypes.h b/SofaKernel/modules/SofaDefaultType/src/sofa/defaulttype/TopologyTypes.h index ee5a582f284..72677a9be74 100644 --- a/SofaKernel/modules/SofaDefaultType/src/sofa/defaulttype/TopologyTypes.h +++ b/SofaKernel/modules/SofaDefaultType/src/sofa/defaulttype/TopologyTypes.h @@ -22,22 +22,18 @@ #ifndef SOFA_DEFAULTTYPE_TOPOLOGYTYPES_H #define SOFA_DEFAULTTYPE_TOPOLOGYTYPES_H +#include #include -namespace sofa +namespace sofa::defaulttype { -namespace defaulttype -{ - -using index_type [[deprecated("PR#1515 (2020-10-14) index_type has been moved and renamed. From now on, please sofa::Index instead of sofa::defaulttype::index_type.")]] = sofa::Index; -[[deprecated("PR#1515 (2020-10-14) InvalidID has been moved. From now on, please sofa::InvalidID instead of sofa::defaulttype::InvalidID. ")]] -constexpr sofa::Index InvalidID = sofa::InvalidID; +SOFA_ATTRIBUTE_DISABLED("v20.12 (PR#1515)", "v21.06", "Use sofa::Index instead of sofa::defaulttype::index_type") +typedef DeprecatedAndRemoved index_type; -} // namespace defaulttype - -} // namespace sofa +SOFA_ATTRIBUTE_DISABLED("v20.12 (PR#1515)", "v21.06", "Use sofa::InvalidID instead of sofa::defaulttype::InvalidID") +typedef DeprecatedAndRemoved InvalidID; +} // namespace sofa::defaulttype #endif //SOFA_DEFAULTTYPE_TOPOLOGYTYPES_H - diff --git a/SofaKernel/modules/SofaDefaultType/src/sofa/defaulttype/Vec3Types.h b/SofaKernel/modules/SofaDefaultType/src/sofa/defaulttype/Vec3Types.h deleted file mode 100644 index 1968b83ab99..00000000000 --- a/SofaKernel/modules/SofaDefaultType/src/sofa/defaulttype/Vec3Types.h +++ /dev/null @@ -1,22 +0,0 @@ -/****************************************************************************** -* SOFA, Simulation Open-Framework Architecture * -* (c) 2006 INRIA, USTL, UJF, CNRS, MGH * -* * -* This program is free software; you can redistribute it and/or modify it * -* under the terms of the GNU Lesser General Public License as published by * -* the Free Software Foundation; either version 2.1 of the License, or (at * -* your option) any later version. * -* * -* This program is distributed in the hope that it will be useful, but WITHOUT * -* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or * -* FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License * -* for more details. * -* * -* You should have received a copy of the GNU Lesser General Public License * -* along with this program. If not, see . * -******************************************************************************* -* Authors: The SOFA Team and external contributors (see Authors.txt) * -* * -* Contact information: contact@sofa-framework.org * -******************************************************************************/ -#error This file will be removed after sofa 21.06 release. Update your code by replacing #include with #include diff --git a/SofaKernel/modules/SofaDefaultType/src/sofa/defaulttype/defaulttype.h b/SofaKernel/modules/SofaDefaultType/src/sofa/defaulttype/defaulttype.h deleted file mode 100644 index 85418bf0041..00000000000 --- a/SofaKernel/modules/SofaDefaultType/src/sofa/defaulttype/defaulttype.h +++ /dev/null @@ -1,31 +0,0 @@ -/****************************************************************************** -* SOFA, Simulation Open-Framework Architecture * -* (c) 2006 INRIA, USTL, UJF, CNRS, MGH * -* * -* This program is free software; you can redistribute it and/or modify it * -* under the terms of the GNU Lesser General Public License as published by * -* the Free Software Foundation; either version 2.1 of the License, or (at * -* your option) any later version. * -* * -* This program is distributed in the hope that it will be useful, but WITHOUT * -* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or * -* FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License * -* for more details. * -* * -* You should have received a copy of the GNU Lesser General Public License * -* along with this program. If not, see . * -******************************************************************************* -* Authors: The SOFA Team and external contributors (see Authors.txt) * -* * -* Contact information: contact@sofa-framework.org * -******************************************************************************/ -#ifndef SOFA_DEFAULTTYPE_DEFAULTTYPE_H -#define SOFA_DEFAULTTYPE_DEFAULTTYPE_H - -// Backward compatibility header - -#include - -SOFA_DEPRECATED_HEADER(v21.06, "sofa/defaulttype/config.h") - -#endif diff --git a/SofaKernel/modules/SofaEngine/src/SofaEngine/BoxROI.inl b/SofaKernel/modules/SofaEngine/src/SofaEngine/BoxROI.inl index edd118df462..cee48f4aaa6 100644 --- a/SofaKernel/modules/SofaEngine/src/SofaEngine/BoxROI.inl +++ b/SofaKernel/modules/SofaEngine/src/SofaEngine/BoxROI.inl @@ -132,14 +132,17 @@ BoxROI::BoxROI() template void BoxROI::parse( sofa::core::objectmodel::BaseObjectDescription* arg ) { + // TODO: remove for v21.12 if (arg->getAttribute("rest_position")!=nullptr) { - msg_deprecated() << "The 'rest_position' data field has been deprecated in Sofa 20.06. Use the attribute 'position' instead." << msgendl + msg_deprecated() << "The 'rest_position' data field has been deprecated since SOFA v20.06. " + "Use the attribute 'position' instead." << msgendl "Please contact sofa-dev team in case you need similar."; } if (arg->getAttribute("isVisible")!=nullptr) { - msg_deprecated() << "The 'isVisible' data field has been deprecated in Sofa 20.06. Use the attribute 'drawBoxes' instead." << msgendl + msg_deprecated() << "The 'isVisible' data field has been deprecated since SOFA v20.06. " + "Use the attribute 'drawBoxes' instead." << msgendl "Please contact sofa-dev team in case you need similar."; } Inherit1::parse(arg); diff --git a/SofaKernel/modules/SofaExplicitOdeSolver/src/SofaExplicitOdeSolver/EulerSolver.cpp b/SofaKernel/modules/SofaExplicitOdeSolver/src/SofaExplicitOdeSolver/EulerSolver.cpp index 2233a2ca075..f5bbea34ff1 100644 --- a/SofaKernel/modules/SofaExplicitOdeSolver/src/SofaExplicitOdeSolver/EulerSolver.cpp +++ b/SofaKernel/modules/SofaExplicitOdeSolver/src/SofaExplicitOdeSolver/EulerSolver.cpp @@ -39,11 +39,6 @@ using namespace core::behavior; int EulerExplicitSolverClass = core::RegisterObject("A simple explicit time integrator") .add< EulerExplicitSolver >() - .addAlias("Euler") - .addAlias("EulerExplicit") - .addAlias("ExplicitEuler") - .addAlias("EulerSolver") - .addAlias("ExplicitEulerSolver") ; EulerExplicitSolver::EulerExplicitSolver() diff --git a/SofaKernel/modules/SofaHelper/CMakeLists.txt b/SofaKernel/modules/SofaHelper/CMakeLists.txt index aede068c4c6..2dca8a570dd 100644 --- a/SofaKernel/modules/SofaHelper/CMakeLists.txt +++ b/SofaKernel/modules/SofaHelper/CMakeLists.txt @@ -26,7 +26,6 @@ set(SRC_ROOT "src/sofa/helper") # HEADERS + SOURCES set(HEADER_FILES ${SRC_ROOT}/config.h.in - ${SRC_ROOT}/helper.h ${SRC_ROOT}/AdvancedTimer.h ${SRC_ROOT}/BackTrace.h ${SRC_ROOT}/cast.h @@ -96,7 +95,6 @@ set(HEADER_FILES ${SRC_ROOT}/system/PluginManager.h ${SRC_ROOT}/system/SetDirectory.h ${SRC_ROOT}/system/SofaOStream.h - ${SRC_ROOT}/system/config.h ${SRC_ROOT}/system/console.h ${SRC_ROOT}/system/console_internal.h ${SRC_ROOT}/system/thread/CTime.h diff --git a/SofaKernel/modules/SofaHelper/src/sofa/helper/AdvancedTimer.h b/SofaKernel/modules/SofaHelper/src/sofa/helper/AdvancedTimer.h index 1bf3e054869..4787e016560 100644 --- a/SofaKernel/modules/SofaHelper/src/sofa/helper/AdvancedTimer.h +++ b/SofaKernel/modules/SofaHelper/src/sofa/helper/AdvancedTimer.h @@ -386,8 +386,7 @@ class SOFA_HELPER_API AdvancedTimer * @param node simulation::Node* * @return std::string, the output if JSON format is set */ - [[deprecated("This function has been deleted in #PR 1770 because of simulation::Node dependency." \ - "Use end(id, node->getTime(), node->getDt()) instead.")]] + SOFA_ATTRIBUTE_DEPRECATED("v21.06 (PR#1770)", "v21.12", "Use end(id, node->getTime(), node->getDt()) instead.") static std::string end(IdTimer id, simulation::Node* node) = delete; static bool isActive(); diff --git a/SofaKernel/modules/SofaHelper/src/sofa/helper/ColorMap.cpp b/SofaKernel/modules/SofaHelper/src/sofa/helper/ColorMap.cpp index 787b1e1b0ac..9949dbe99b9 100644 --- a/SofaKernel/modules/SofaHelper/src/sofa/helper/ColorMap.cpp +++ b/SofaKernel/modules/SofaHelper/src/sofa/helper/ColorMap.cpp @@ -131,7 +131,6 @@ ColorMap* ColorMap::getDefault() if (defaultColorMap == nullptr) { defaultColorMap = new ColorMap(); std::string tmp(""); - //defaultOglColorMap->initOld(tmp); // TODO: replace initOld() with init() defaultColorMap->init(); } return defaultColorMap; diff --git a/SofaKernel/modules/SofaHelper/src/sofa/helper/ComponentChange.cpp b/SofaKernel/modules/SofaHelper/src/sofa/helper/ComponentChange.cpp index e2e0f497639..5e80708e4fa 100644 --- a/SofaKernel/modules/SofaHelper/src/sofa/helper/ComponentChange.cpp +++ b/SofaKernel/modules/SofaHelper/src/sofa/helper/ComponentChange.cpp @@ -31,7 +31,6 @@ namespace lifecycle std::map deprecatedComponents = { // SofaMiscForceField - {"LennardJonesForceField", Deprecated("v17.12", "v18.12")}, {"MatrixMass", Deprecated("v19.06", "v19.12")}, }; @@ -160,7 +159,6 @@ std::map uncreatableComponents = { // SofaMiscForceField was pluginized in #1520 { "GearSpringForceField", Pluginized("v20.12", "SofaMiscForceField") }, { "MeshMatrixMass", Pluginized("v20.12", "SofaMiscForceField") }, - { "LennardJonesForceField", Pluginized("v20.12", "SofaMiscForceField") }, // SofaMiscMapping was pluginized in #1520 { "BeamLinearMapping", Pluginized("v20.12", "SofaMiscMapping") }, @@ -545,9 +543,21 @@ std::map uncreatableComponents = { //{ "MechanicalObject", Pluginized("v20.12", "SofaBaseMechanics") }, //{ "SubsetMapping", Pluginized("v20.12", "SofaBaseMechanics") }, //{ "UniformMass", Pluginized("v20.12", "SofaBaseMechanics") }, + + + + /***********************/ + // REMOVED SINCE v21.06 + + {"LennardJonesForceField", Removed("v17.12", "v21.06")}, + {"LengthContainer", Removed("v21.06", "v21.06")}, + {"PoissonContainer", Removed("v21.06", "v21.06")}, + {"RadiusContainer", Removed("v21.06", "v21.06")}, + {"StiffnessContainer", Removed("v21.06", "v21.06")}, /***********************/ // REMOVED SINCE v20.12 + { "DynamicSparseGridTopologyAlgorithms", Removed("v20.12", "v20.12") }, { "HexahedronSetTopologyAlgorithms", Removed("v20.12", "v20.12") }, { "TetrahedronSetTopologyAlgorithms", Removed("v20.12", "v20.12") }, @@ -559,40 +569,16 @@ std::map uncreatableComponents = { /***********************/ // REMOVED SINCE v20.06 - // SofaKernel - {"Point", Removed("v19.12", "v20.06")}, - {"TPointModel", Removed("v19.12", "v20.06")}, - {"PointModel", Removed("v19.12", "v20.06")}, - {"PointMesh", Removed("v19.12", "v20.06")}, - {"PointSet", Removed("v19.12", "v20.06")}, - - {"Line", Removed("v19.12", "v20.06")}, - {"TLineModel", Removed("v19.12", "v20.06")}, - {"LineMeshModel", Removed("v19.12", "v20.06")}, - {"LineSetModel", Removed("v19.12", "v20.06")}, - {"LineMesh", Removed("v19.12", "v20.06")}, - {"LineSet", Removed("v19.12", "v20.06")}, - {"LineModel", Removed("v19.12", "v20.06")}, - - {"Triangle", Removed("v19.12", "v20.06")}, - {"TriangleSet", Removed("v19.12", "v20.06")}, - {"TriangleMesh", Removed("v19.12", "v20.06")}, - {"TriangleSetModel", Removed("v19.12", "v20.06")}, - {"TriangleMeshModel", Removed("v19.12", "v20.06")}, - {"TriangleModel", Removed("v19.12", "v20.06")}, - {"TTriangleModel", Removed("v19.12", "v20.06")}, - - {"Sphere", Removed("v19.12", "v20.06")}, - {"SphereModel", Removed("v19.12", "v20.06")}, - {"TSphereModel", Removed("v19.12", "v20.06")}, + {"Euler", Removed("v19.12", "v20.06")}, + {"EulerExplicit", Removed("v19.12", "v20.06")}, + {"ExplicitEuler", Removed("v19.12", "v20.06")}, + {"EulerSolver", Removed("v19.12", "v20.06")}, + {"ExplicitEulerSolver", Removed("v19.12", "v20.06")}, {"Capsule", Removed("v19.12", "v20.06")}, {"CapsuleModel", Removed("v19.12", "v20.06")}, {"TCapsuleModel", Removed("v19.12", "v20.06")}, - {"RigidCapsule", Removed("v19.12", "v20.06")}, - {"CapsuleModel", Removed("v19.12", "v20.06")}, - {"Cube", Removed("v19.12", "v20.06")}, {"CubeModel", Removed("v19.12", "v20.06")}, @@ -602,17 +588,45 @@ std::map uncreatableComponents = { {"Cylinder", Removed("v19.12", "v20.06")}, {"CylinderModel", Removed("v19.12", "v20.06")}, + {"Line", Removed("v19.12", "v20.06")}, + {"TLineModel", Removed("v19.12", "v20.06")}, + {"LineMeshModel", Removed("v19.12", "v20.06")}, + {"LineSetModel", Removed("v19.12", "v20.06")}, + {"LineMesh", Removed("v19.12", "v20.06")}, + {"LineSet", Removed("v19.12", "v20.06")}, + {"LineModel", Removed("v19.12", "v20.06")}, + + {"OBB", Removed("v19.12", "v20.06")}, + {"OBBModel", Removed("v19.12", "v20.06")}, + {"TOBBModel", Removed("v19.12", "v20.06")}, + + {"Point", Removed("v19.12", "v20.06")}, + {"TPointModel", Removed("v19.12", "v20.06")}, + {"PointModel", Removed("v19.12", "v20.06")}, + {"PointMesh", Removed("v19.12", "v20.06")}, + {"PointSet", Removed("v19.12", "v20.06")}, + {"Ray", Removed("v19.12", "v20.06")}, {"RayModel", Removed("v19.12", "v20.06")}, + {"RigidCapsule", Removed("v19.12", "v20.06")}, + {"RigidCapsuleModel", Removed("v19.12", "v20.06")}, + {"RigidCapsuleCollisionModel", Removed("v19.12", "v20.06")}, + + {"Sphere", Removed("v19.12", "v20.06")}, + {"SphereModel", Removed("v19.12", "v20.06")}, + {"TSphereModel", Removed("v19.12", "v20.06")}, + {"Tetrahedron", Removed("v19.12", "v20.06")}, {"TetrahedronModel", Removed("v19.12", "v20.06")}, - {"Euler", Removed("v19.12", "v20.06")}, - {"EulerExplicit", Removed("v19.12", "v20.06")}, - {"ExplicitEuler", Removed("v19.12", "v20.06")}, - {"EulerSolver", Removed("v19.12", "v20.06")}, - {"ExplicitEulerSolver", Removed("v19.12", "v20.06")}, + {"Triangle", Removed("v19.12", "v20.06")}, + {"TriangleSet", Removed("v19.12", "v20.06")}, + {"TriangleMesh", Removed("v19.12", "v20.06")}, + {"TriangleSetModel", Removed("v19.12", "v20.06")}, + {"TriangleMeshModel", Removed("v19.12", "v20.06")}, + {"TriangleModel", Removed("v19.12", "v20.06")}, + {"TTriangleModel", Removed("v19.12", "v20.06")}, /***********************/ // REMOVED SINCE v18.12 diff --git a/SofaKernel/modules/SofaHelper/src/sofa/helper/accessor.h b/SofaKernel/modules/SofaHelper/src/sofa/helper/accessor.h index da3aad5ec4a..5e450a2eb33 100644 --- a/SofaKernel/modules/SofaHelper/src/sofa/helper/accessor.h +++ b/SofaKernel/modules/SofaHelper/src/sofa/helper/accessor.h @@ -74,7 +74,7 @@ class ReadAccessor }; template -[[deprecated("Custom operator<< for accessor have been deprecated in #PR1808. Just replace std::cout << myaccessor by std::cout << myccessor.ref()")]] +SOFA_ATTRIBUTE_DEPRECATED__CUSTOM_OPERATOR() std::ostream& operator<<( std::ostream& os, const ReadAccessor& vec ) = delete; @@ -131,11 +131,11 @@ class WriteAccessor }; template -[[deprecated("Custom operator<< for accessor have been deprecated in #PR1808. Just replace std::cout << myaccessor by std::cout << myccessor.ref()")]] +SOFA_ATTRIBUTE_DEPRECATED__CUSTOM_OPERATOR() std::ostream& operator<< ( std::ostream& os, const WriteAccessor& vec ) = delete; template -[[deprecated("Custom operator<< for accessor have been deprecated in #PR1808. Just replace std::cout << myaccessor by std::cout << myccessor.ref()")]] +SOFA_ATTRIBUTE_DEPRECATED__CUSTOM_OPERATOR() std::istream& operator>> ( std::istream& in, WriteAccessor& vec ) = delete; /** Identical to WriteAccessor for default implementation, but different for some template specializations such as core::objectmodel::Data @@ -190,7 +190,7 @@ class ReadAccessorVector }; template -[[deprecated("Custom operator<< for accessor have been deprecated in #PR1808. Just replace std::cout << myaccessor by std::cout << myccessor.ref()")]] +SOFA_ATTRIBUTE_DEPRECATED__CUSTOM_OPERATOR() std::ostream& operator<< ( std::ostream& os, const ReadAccessorVector& vec ) = delete; diff --git a/SofaKernel/modules/SofaHelper/src/sofa/helper/helper.h b/SofaKernel/modules/SofaHelper/src/sofa/helper/helper.h deleted file mode 100644 index e47407e53a3..00000000000 --- a/SofaKernel/modules/SofaHelper/src/sofa/helper/helper.h +++ /dev/null @@ -1,31 +0,0 @@ -/****************************************************************************** -* SOFA, Simulation Open-Framework Architecture * -* (c) 2006 INRIA, USTL, UJF, CNRS, MGH * -* * -* This program is free software; you can redistribute it and/or modify it * -* under the terms of the GNU Lesser General Public License as published by * -* the Free Software Foundation; either version 2.1 of the License, or (at * -* your option) any later version. * -* * -* This program is distributed in the hope that it will be useful, but WITHOUT * -* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or * -* FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License * -* for more details. * -* * -* You should have received a copy of the GNU Lesser General Public License * -* along with this program. If not, see . * -******************************************************************************* -* Authors: The SOFA Team and external contributors (see Authors.txt) * -* * -* Contact information: contact@sofa-framework.org * -******************************************************************************/ -#ifndef SOFA_HELPER_HELPER_H -#define SOFA_HELPER_HELPER_H - -// Backward compatibility header - -#include - -SOFA_DEPRECATED_HEADER(v21.06, "sofa/helper/config.h") - -#endif diff --git a/SofaKernel/modules/SofaHelper/src/sofa/helper/system/FileRepository.cpp b/SofaKernel/modules/SofaHelper/src/sofa/helper/system/FileRepository.cpp index 671b851736d..c5e00b3071e 100644 --- a/SofaKernel/modules/SofaHelper/src/sofa/helper/system/FileRepository.cpp +++ b/SofaKernel/modules/SofaHelper/src/sofa/helper/system/FileRepository.cpp @@ -327,7 +327,7 @@ const std::string FileRepository::getPathsJoined() } /*static*/ -std::string FileRepository::relativeToPath(std::string path, std::string refPath, bool doLowerCaseOnWin32) +std::string FileRepository::relativeToPath(std::string path, std::string refPath) { /// This condition replace the #ifdef in the code. /// The advantage is that the code is compiled and is @@ -344,25 +344,14 @@ std::string FileRepository::relativeToPath(std::string path, std::string refPath /// WIN32 is a pain here because of mixed case formatting with randomly /// picked slash and backslash to separate dirs. - ///TODO(dmarchal 2017-05-01): remove the deprecated part in one year. std::string tmppath; std::replace(path.begin(),path.end(),'\\' , '/' ); std::replace(refPath.begin(),refPath.end(),'\\' , '/' ); std::transform(refPath.begin(), refPath.end(), refPath.begin(), ::tolower ); - if( doLowerCaseOnWin32 ) - { - dmsg_deprecated("FileRepository") << "Using relativePath(doLowerCaseOnWin32=true) is a deprecated behavior since 2017-05-01. " - "This behavior will be removed in 2018-05-01 and you need to update your code to use new " - "API"; - /// The complete path is lowered... and copied into the tmppath; - std::transform(path.begin(), path.end(), path.begin(), ::tolower ); - tmppath = path ; - }else{ - tmppath = path ; - std::transform(tmppath.begin(), tmppath.end(), tmppath.begin(), ::tolower ); - } + tmppath = path ; + std::transform(tmppath.begin(), tmppath.end(), tmppath.begin(), ::tolower ); std::string::size_type loc = tmppath.find( refPath, 0 ); if (loc==0) diff --git a/SofaKernel/modules/SofaHelper/src/sofa/helper/system/FileRepository.h b/SofaKernel/modules/SofaHelper/src/sofa/helper/system/FileRepository.h index 026900d7a0a..ed2fe3799a2 100644 --- a/SofaKernel/modules/SofaHelper/src/sofa/helper/system/FileRepository.h +++ b/SofaKernel/modules/SofaHelper/src/sofa/helper/system/FileRepository.h @@ -120,7 +120,7 @@ class SOFA_HELPER_API FileRepository /// On WIN32 the implementation was also returning the path in lower case. This behavior is now /// deprecated and should be remove the 2018-05-01. Until this date new implementation can be /// used by setting doLowerCaseOnWin32=false; - static std::string relativeToPath(std::string path, std::string refPath, bool doLowerCaseOnWin32=true); + static std::string relativeToPath(std::string path, std::string refPath); const std::vector< std::string > &getPaths() const {return vpath;} diff --git a/SofaKernel/modules/SofaHelper/src/sofa/helper/system/config.h b/SofaKernel/modules/SofaHelper/src/sofa/helper/system/config.h deleted file mode 100644 index ebdd0b8ef3e..00000000000 --- a/SofaKernel/modules/SofaHelper/src/sofa/helper/system/config.h +++ /dev/null @@ -1,31 +0,0 @@ -/****************************************************************************** -* SOFA, Simulation Open-Framework Architecture * -* (c) 2006 INRIA, USTL, UJF, CNRS, MGH * -* * -* This program is free software; you can redistribute it and/or modify it * -* under the terms of the GNU Lesser General Public License as published by * -* the Free Software Foundation; either version 2.1 of the License, or (at * -* your option) any later version. * -* * -* This program is distributed in the hope that it will be useful, but WITHOUT * -* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or * -* FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License * -* for more details. * -* * -* You should have received a copy of the GNU Lesser General Public License * -* along with this program. If not, see . * -******************************************************************************* -* Authors: The SOFA Team and external contributors (see Authors.txt) * -* * -* Contact information: contact@sofa-framework.org * -******************************************************************************/ -#ifndef SOFA_HELPER_SYSTEM_CONFIG_H -#define SOFA_HELPER_SYSTEM_CONFIG_H - -// Backward compatibility header - -#include - -SOFA_DEPRECATED_HEADER(v21.06, "sofa/helper/config.h") - -#endif // SOFA_HELPER_SYSTEM_CONFIG_H diff --git a/SofaKernel/modules/SofaHelper/src/sofa/helper/visual/DrawTool.h b/SofaKernel/modules/SofaHelper/src/sofa/helper/visual/DrawTool.h index 624cb95d5b2..e18a7224e9a 100644 --- a/SofaKernel/modules/SofaHelper/src/sofa/helper/visual/DrawTool.h +++ b/SofaKernel/modules/SofaHelper/src/sofa/helper/visual/DrawTool.h @@ -226,191 +226,185 @@ class DrawTool /// Compatibility wrapper functions using Vec4f = sofa::defaulttype::Vec4f; -#define DISABLE_VEC4F \ - [[deprecated("This function has been deprecated in #PR 1626 and then disabled starting from the v21.06 release." \ - "Vec4f defining a color is obsolete, use RGBAColor instead.")]] - // Necessary to not break existing code // as std::vector is not a std::vector - DISABLE_VEC4F + SOFA_ATTRIBUTE_DISABLED__DRAWTOOL_USES_RGBACOLOR() void drawPoints(const std::vector& points, float size, const std::vector& colour) = delete; - DISABLE_VEC4F + SOFA_ATTRIBUTE_DISABLED__DRAWTOOL_USES_RGBACOLOR() void drawLines(const std::vector& points, float size, const std::vector& colours) = delete; - DISABLE_VEC4F + SOFA_ATTRIBUTE_DISABLED__DRAWTOOL_USES_RGBACOLOR() void drawTriangles(const std::vector& points, const std::vector< Vec3i >& index, const std::vector& normal, const std::vector& colour) = delete; - DISABLE_VEC4F + SOFA_ATTRIBUTE_DISABLED__DRAWTOOL_USES_RGBACOLOR() void drawTriangles(const std::vector& points, const std::vector< Vec4f >& colour) = delete; - DISABLE_VEC4F + SOFA_ATTRIBUTE_DISABLED__DRAWTOOL_USES_RGBACOLOR() void drawTriangles(const std::vector& points, const std::vector& normal, const std::vector< Vec4f >& colour) = delete; - DISABLE_VEC4F + SOFA_ATTRIBUTE_DISABLED__DRAWTOOL_USES_RGBACOLOR() void drawQuads(const std::vector& points, const std::vector& colours) = delete; - DISABLE_VEC4F + SOFA_ATTRIBUTE_DISABLED__DRAWTOOL_USES_RGBACOLOR() void drawPoints(const std::vector& points, float size, const Vec4f& colour) = delete; - DISABLE_VEC4F + SOFA_ATTRIBUTE_DISABLED__DRAWTOOL_USES_RGBACOLOR() void drawLine(const Vector3& p1, const Vector3& p2, const Vec4f& colour) = delete; - DISABLE_VEC4F + SOFA_ATTRIBUTE_DISABLED__DRAWTOOL_USES_RGBACOLOR() void drawInfiniteLine(const Vector3& point, const Vector3& direction, const Vec4f& color) = delete; - DISABLE_VEC4F + SOFA_ATTRIBUTE_DISABLED__DRAWTOOL_USES_RGBACOLOR() void drawLines(const std::vector& points, float size, const Vec4f& colour) = delete; - DISABLE_VEC4F + SOFA_ATTRIBUTE_DISABLED__DRAWTOOL_USES_RGBACOLOR() void drawLines(const std::vector& points, const std::vector< Vec2i >& index, float size, const Vec4f& colour) = delete; - DISABLE_VEC4F + SOFA_ATTRIBUTE_DISABLED__DRAWTOOL_USES_RGBACOLOR() void drawLineStrip(const std::vector& points, float size, const Vec4f& colour) = delete; - DISABLE_VEC4F + SOFA_ATTRIBUTE_DISABLED__DRAWTOOL_USES_RGBACOLOR() void drawLineLoop(const std::vector& points, float size, const Vec4f& colour) = delete; - DISABLE_VEC4F + SOFA_ATTRIBUTE_DISABLED__DRAWTOOL_USES_RGBACOLOR() void drawDisk(float radius, double from, double to, int resolution, const Vec4f& color) = delete; - DISABLE_VEC4F + SOFA_ATTRIBUTE_DISABLED__DRAWTOOL_USES_RGBACOLOR() void drawCircle(float radius, float lineThickness, int resolution, const Vec4f& color) = delete; - DISABLE_VEC4F + SOFA_ATTRIBUTE_DISABLED__DRAWTOOL_USES_RGBACOLOR() void drawTriangles(const std::vector& points, const Vec4f& colour) = delete; - DISABLE_VEC4F + SOFA_ATTRIBUTE_DISABLED__DRAWTOOL_USES_RGBACOLOR() void drawTriangles(const std::vector& points, const Vector3& normal, const Vec4f& colour) = delete; - DISABLE_VEC4F + SOFA_ATTRIBUTE_DISABLED__DRAWTOOL_USES_RGBACOLOR() void drawTriangles(const std::vector& points, const std::vector< Vec3i >& index, const std::vector& normal, const Vec4f& colour) = delete; - DISABLE_VEC4F + SOFA_ATTRIBUTE_DISABLED__DRAWTOOL_USES_RGBACOLOR() void drawTriangleStrip(const std::vector& points, const std::vector& normal, const Vec4f& colour) = delete; - DISABLE_VEC4F + SOFA_ATTRIBUTE_DISABLED__DRAWTOOL_USES_RGBACOLOR() void drawTriangleFan(const std::vector& points, const std::vector& normal, const Vec4f& colour) = delete; - DISABLE_VEC4F + SOFA_ATTRIBUTE_DISABLED__DRAWTOOL_USES_RGBACOLOR() void drawFrame(const Vector3& position, const Quaternion& orientation, const Vec3f& size, const Vec4f& colour) = delete; - DISABLE_VEC4F + SOFA_ATTRIBUTE_DISABLED__DRAWTOOL_USES_RGBACOLOR() void drawSpheres(const std::vector& points, const std::vector& radius, const Vec4f& colour) = delete; - DISABLE_VEC4F + SOFA_ATTRIBUTE_DISABLED__DRAWTOOL_USES_RGBACOLOR() void drawSpheres(const std::vector& points, float radius, const Vec4f& colour) = delete; - DISABLE_VEC4F + SOFA_ATTRIBUTE_DISABLED__DRAWTOOL_USES_RGBACOLOR() void drawFakeSpheres(const std::vector& points, const std::vector& radius, const Vec4f& colour) = delete; - DISABLE_VEC4F + SOFA_ATTRIBUTE_DISABLED__DRAWTOOL_USES_RGBACOLOR() void drawFakeSpheres(const std::vector& points, float radius, const Vec4f& colour) = delete; - DISABLE_VEC4F + SOFA_ATTRIBUTE_DISABLED__DRAWTOOL_USES_RGBACOLOR() void drawCone(const Vector3& p1, const Vector3& p2, float radius1, float radius2, const Vec4f& colour, int subd = 16) = delete; - DISABLE_VEC4F + SOFA_ATTRIBUTE_DISABLED__DRAWTOOL_USES_RGBACOLOR() void drawCube(const float& radius, const Vec4f& colour, const int& subd = 16) = delete; - DISABLE_VEC4F + SOFA_ATTRIBUTE_DISABLED__DRAWTOOL_USES_RGBACOLOR() void drawCylinder(const Vector3& p1, const Vector3& p2, float radius, const Vec4f& colour, int subd = 16) = delete; - DISABLE_VEC4F + SOFA_ATTRIBUTE_DISABLED__DRAWTOOL_USES_RGBACOLOR() void drawCapsule(const Vector3& p1, const Vector3& p2, float radius, const Vec4f& colour, int subd = 16) = delete; - DISABLE_VEC4F + SOFA_ATTRIBUTE_DISABLED__DRAWTOOL_USES_RGBACOLOR() void drawArrow(const Vector3& p1, const Vector3& p2, float radius, const Vec4f& colour, int subd = 16) = delete; - DISABLE_VEC4F + SOFA_ATTRIBUTE_DISABLED__DRAWTOOL_USES_RGBACOLOR() void drawArrow(const Vector3& p1, const Vector3& p2, float radius, float coneLength, const Vec4f& colour, int subd = 16) = delete; - DISABLE_VEC4F + SOFA_ATTRIBUTE_DISABLED__DRAWTOOL_USES_RGBACOLOR() void drawArrow(const Vector3& p1, const Vector3& p2, float radius, float coneLength, float coneRadius, const Vec4f& color, int subd = 16) = delete; - DISABLE_VEC4F + SOFA_ATTRIBUTE_DISABLED__DRAWTOOL_USES_RGBACOLOR() void drawCross(const Vector3& p, float length, const Vec4f& colour) = delete; - DISABLE_VEC4F + SOFA_ATTRIBUTE_DISABLED__DRAWTOOL_USES_RGBACOLOR() void drawPlus(const float& radius, const Vec4f& colour, const int& subd = 16) = delete; - DISABLE_VEC4F + SOFA_ATTRIBUTE_DISABLED__DRAWTOOL_USES_RGBACOLOR() void drawPoint(const Vector3& p, const Vec4f& c) = delete; - DISABLE_VEC4F + SOFA_ATTRIBUTE_DISABLED__DRAWTOOL_USES_RGBACOLOR() void drawPoint(const Vector3& p, const Vector3& n, const Vec4f& c) = delete; - DISABLE_VEC4F + SOFA_ATTRIBUTE_DISABLED__DRAWTOOL_USES_RGBACOLOR() void drawTriangle(const Vector3& p1, const Vector3& p2, const Vector3& p3, const Vector3& normal, const Vec4f& c1, const Vec4f& c2, const Vec4f& c3) = delete; - DISABLE_VEC4F + + SOFA_ATTRIBUTE_DISABLED__DRAWTOOL_USES_RGBACOLOR() void drawTriangle(const Vector3& p1, const Vector3& p2, const Vector3& p3, const Vector3& normal1, const Vector3& normal2, const Vector3& normal3, const Vec4f& c1, const Vec4f& c2, const Vec4f& c3) = delete; - DISABLE_VEC4F + SOFA_ATTRIBUTE_DISABLED__DRAWTOOL_USES_RGBACOLOR() void drawQuad(const Vector3& p1, const Vector3& p2, const Vector3& p3, const Vector3& p4, const Vector3& normal, const Vec4f& c) = delete; - DISABLE_VEC4F + SOFA_ATTRIBUTE_DISABLED__DRAWTOOL_USES_RGBACOLOR() void drawQuad(const Vector3& p1, const Vector3& p2, const Vector3& p3, const Vector3& p4, const Vector3& normal1, const Vector3& normal2, const Vector3& normal3, const Vector3& normal4, const Vec4f& c1, const Vec4f& c2, const Vec4f& c3, const Vec4f& c4) = delete; - DISABLE_VEC4F + SOFA_ATTRIBUTE_DISABLED__DRAWTOOL_USES_RGBACOLOR() void drawQuads(const std::vector& points, const Vec4f& colour) = delete; - DISABLE_VEC4F + SOFA_ATTRIBUTE_DISABLED__DRAWTOOL_USES_RGBACOLOR() void drawTetrahedron(const Vector3& p0, const Vector3& p1, const Vector3& p2, const Vector3& p3, const Vec4f& colour) = delete; - DISABLE_VEC4F + SOFA_ATTRIBUTE_DISABLED__DRAWTOOL_USES_RGBACOLOR() void drawTetrahedra(const std::vector& points, const Vec4f& colour) = delete; - DISABLE_VEC4F + SOFA_ATTRIBUTE_DISABLED__DRAWTOOL_USES_RGBACOLOR() void drawScaledTetrahedra(const std::vector& points, const Vec4f& colour, const float scale) = delete; - DISABLE_VEC4F + SOFA_ATTRIBUTE_DISABLED__DRAWTOOL_USES_RGBACOLOR() void drawHexahedron(const Vector3& p0, const Vector3& p1, const Vector3& p2, const Vector3& p3, const Vector3& p4, const Vector3& p5, const Vector3& p6, const Vector3& p7, const Vec4f& colour) = delete; - DISABLE_VEC4F + SOFA_ATTRIBUTE_DISABLED__DRAWTOOL_USES_RGBACOLOR() void drawHexahedra(const std::vector& points, const Vec4f& colour) = delete; - DISABLE_VEC4F + SOFA_ATTRIBUTE_DISABLED__DRAWTOOL_USES_RGBACOLOR() void drawScaledHexahedra(const std::vector& points, const Vec4f& colour, const float scale) = delete; - DISABLE_VEC4F + SOFA_ATTRIBUTE_DISABLED__DRAWTOOL_USES_RGBACOLOR() void drawSphere(const Vector3& p, float radius, const Vec4f& colour) = delete; - DISABLE_VEC4F + SOFA_ATTRIBUTE_DISABLED__DRAWTOOL_USES_RGBACOLOR() void draw3DText(const Vector3& p, float scale, const Vec4f& color, const char* text) = delete; - DISABLE_VEC4F + SOFA_ATTRIBUTE_DISABLED__DRAWTOOL_USES_RGBACOLOR() void draw3DText_Indices(const std::vector& positions, float scale, const Vec4f& color) = delete; - DISABLE_VEC4F + SOFA_ATTRIBUTE_DISABLED__DRAWTOOL_USES_RGBACOLOR() void setMaterial(const Vec4f& colour) = delete; - DISABLE_VEC4F + SOFA_ATTRIBUTE_DISABLED__DRAWTOOL_USES_RGBACOLOR() void resetMaterial(const Vec4f& colour) = delete; - DISABLE_VEC4F + SOFA_ATTRIBUTE_DISABLED__DRAWTOOL_USES_RGBACOLOR() void writeOverlayText(int x, int y, unsigned fontSize, const Vec4f& color, const char* text) = delete; - -#undef DISABLE_VEC4F - }; } // namespace sofa::helper::visual diff --git a/SofaKernel/modules/SofaImplicitOdeSolver/src/SofaImplicitOdeSolver/StaticSolver.cpp b/SofaKernel/modules/SofaImplicitOdeSolver/src/SofaImplicitOdeSolver/StaticSolver.cpp index bcc8abcb637..8d3f0d5592d 100644 --- a/SofaKernel/modules/SofaImplicitOdeSolver/src/SofaImplicitOdeSolver/StaticSolver.cpp +++ b/SofaKernel/modules/SofaImplicitOdeSolver/src/SofaImplicitOdeSolver/StaticSolver.cpp @@ -79,46 +79,49 @@ void StaticSolver::parse(sofa::core::objectmodel::BaseObjectDescription* arg) const char* val=arg->getAttribute("massCoef",nullptr) ; if(val) { - msg_deprecated() << "The attribute 'massCoef' is deprecated since SOFA 19.06'" << msgendl + msg_deprecated() << "The attribute 'massCoef' is deprecated since SOFA v19.06'" << msgendl << "This data was previously used for stabilization purposes but it was preventing" << msgendl - << "from computing a strictly-static system (Use the forum for any question)"; + << "from computing a strictly-static system." << msgendl + << "Use the Forum for any question."; } val=arg->getAttribute("dampingCoef",nullptr) ; if(val) { - msg_deprecated() << "The attribute 'dampingCoef' is deprecated since SOFA 19.06'" << msgendl + msg_deprecated() << "The attribute 'dampingCoef' is deprecated since SOFA v19.06'" << msgendl << "This data was previously used for stabilization purposes but it was preventing" << msgendl - << "from computing a strictly-static system (Use the forum for any question)"; + << "from computing a strictly-static system." << msgendl + << "Use the Forum for any question."; } val=arg->getAttribute("stiffnessCoef",nullptr) ; if(val) { - msg_deprecated() << "The attribute 'stiffnessCoef' is deprecated since SOFA 19.06'" << msgendl + msg_deprecated() << "The attribute 'stiffnessCoef' is deprecated since SOFA v19.06'" << msgendl << "This data was previously used for stabilization purposes but it was preventing" << msgendl - << "from computing a strictly-static system (Use the forum for any question)"; + << "from computing a strictly-static system." << msgendl + << "Use the Forum for any question."; } val=arg->getAttribute("applyIncrementFactor",nullptr) ; if(val) { - msg_deprecated() << "The attribute 'applyIncrementFactor' is deprecated since SOFA 19.06'" << msgendl + msg_deprecated() << "The attribute 'applyIncrementFactor' is deprecated since SOFA v19.06'" << msgendl << "The incremental loading is now supposed to be done within the desired ForceField." << msgendl - << "(Use the forum for any question)"; + << "Use the Forum for any question."; } val=arg->getAttribute("correction_tolerance_threshold",nullptr) ; if(val) { - msg_deprecated() << "The attribute 'correction_tolerance_threshold' is deprecated since SOFA 21.06'" << msgendl + msg_deprecated() << "The attribute 'correction_tolerance_threshold' is deprecated since SOFA v21.06'" << msgendl << "The attribute was renamed for '" << d_absolute_correction_tolerance_threshold.getName() << "'."; arg->setAttribute(d_absolute_correction_tolerance_threshold.getName(), val); } val=arg->getAttribute("residual_tolerance_threshold",nullptr) ; if(val) { - msg_deprecated() << "The attribute 'residual_tolerance_threshold' is deprecated since SOFA 21.06'" << msgendl + msg_deprecated() << "The attribute 'residual_tolerance_threshold' is deprecated since SOFA v21.06'" << msgendl << "The attribute was renamed for '" << d_absolute_residual_tolerance_threshold.getName() << "'."; arg->setAttribute(d_absolute_residual_tolerance_threshold.getName(), val); } diff --git a/SofaKernel/modules/SofaMeshCollision/src/SofaMeshCollision/Line.h b/SofaKernel/modules/SofaMeshCollision/src/SofaMeshCollision/Line.h index 734c15e571e..b445b0464eb 100644 --- a/SofaKernel/modules/SofaMeshCollision/src/SofaMeshCollision/Line.h +++ b/SofaKernel/modules/SofaMeshCollision/src/SofaMeshCollision/Line.h @@ -23,5 +23,5 @@ #include #include -SOFA_DEPRECATED_HEADER(v21.12, "SofaMeshCollision/LineModel.h") +SOFA_DEPRECATED_HEADER("v21.06", "v21.12", "SofaMeshCollision/LineModel.h") diff --git a/SofaKernel/modules/SofaMeshCollision/src/SofaMeshCollision/LineModel.cpp b/SofaKernel/modules/SofaMeshCollision/src/SofaMeshCollision/LineModel.cpp index 81537dfc774..a96335fddb5 100644 --- a/SofaKernel/modules/SofaMeshCollision/src/SofaMeshCollision/LineModel.cpp +++ b/SofaKernel/modules/SofaMeshCollision/src/SofaMeshCollision/LineModel.cpp @@ -28,15 +28,9 @@ namespace sofa::component::collision int LineCollisionModelClass = core::RegisterObject("collision model using a linear mesh, as described in MeshTopology") .add< LineCollisionModel >() - .addAlias("TLineModel") - .addAlias("Line") - .addAlias("LineMeshModel") - .addAlias("LineSetModel") - .addAlias("LineMesh") - .addAlias("LineSet") - .addAlias("LineModel"); + ; template class SOFA_SOFAMESHCOLLISION_API TLine; template class SOFA_SOFAMESHCOLLISION_API LineCollisionModel; -} ///namespace sofa::component::collision +} // namespace sofa::component::collision diff --git a/SofaKernel/modules/SofaMeshCollision/src/SofaMeshCollision/LineModel.h b/SofaKernel/modules/SofaMeshCollision/src/SofaMeshCollision/LineModel.h index 56fb6e47378..dec50906e41 100644 --- a/SofaKernel/modules/SofaMeshCollision/src/SofaMeshCollision/LineModel.h +++ b/SofaKernel/modules/SofaMeshCollision/src/SofaMeshCollision/LineModel.h @@ -71,6 +71,7 @@ class TLine : public core::TCollisionElementIterator; template class SOFA_SOFAMESHCOLLISION_API LineCollisionModel : public core::CollisionModel @@ -194,13 +195,9 @@ inline TLine::TLine(const core::CollisionElementIterator& i) { } -template using TLineModel [[deprecated("The TLineModel is now deprecated, please use LineCollisionModel instead. Compatibility stops at v20.06")]] = LineCollisionModel; -using LineModel [[deprecated("The LineModel is now deprecated, please use LineCollisionModel instead. Compatibility stops at v20.06")]] = LineCollisionModel; -using Line = TLine; - -#if !defined(SOFA_COMPONENT_COLLISION_LINECOLLISIONMODEL_CPP) +#if !defined(SOFA_COMPONENT_COLLISION_LINECOLLISIONMODEL_CPP) extern template class SOFA_SOFAMESHCOLLISION_API TLine; extern template class SOFA_SOFAMESHCOLLISION_API LineCollisionModel; #endif -} //namespace sofa::component::collision +} // namespace sofa::component::collision diff --git a/SofaKernel/modules/SofaMeshCollision/src/SofaMeshCollision/Point.h b/SofaKernel/modules/SofaMeshCollision/src/SofaMeshCollision/Point.h index 6e9a77aadb5..98d51ed4e9f 100644 --- a/SofaKernel/modules/SofaMeshCollision/src/SofaMeshCollision/Point.h +++ b/SofaKernel/modules/SofaMeshCollision/src/SofaMeshCollision/Point.h @@ -24,4 +24,4 @@ #include -SOFA_DEPRECATED_HEADER(v21.12, "SofaMeshCollision/PointModel.h") +SOFA_DEPRECATED_HEADER("v21.06", "v21.12", "SofaMeshCollision/PointModel.h") diff --git a/SofaKernel/modules/SofaMeshCollision/src/SofaMeshCollision/PointModel.cpp b/SofaKernel/modules/SofaMeshCollision/src/SofaMeshCollision/PointModel.cpp index 622e011527e..b5dce7b1231 100644 --- a/SofaKernel/modules/SofaMeshCollision/src/SofaMeshCollision/PointModel.cpp +++ b/SofaKernel/modules/SofaMeshCollision/src/SofaMeshCollision/PointModel.cpp @@ -28,14 +28,8 @@ namespace sofa::component::collision int PointCollisionModelClass = core::RegisterObject("Collision model which represents a set of points") .add< PointCollisionModel >() - - .addAlias("TPointModel") - .addAlias("Point") - .addAlias("PointModel") - .addAlias("PointMesh") - .addAlias("PointSet") ; template class SOFA_SOFAMESHCOLLISION_API PointCollisionModel; -} //namespace sofa::component::collision +} // namespace sofa::component::collision diff --git a/SofaKernel/modules/SofaMeshCollision/src/SofaMeshCollision/PointModel.h b/SofaKernel/modules/SofaMeshCollision/src/SofaMeshCollision/PointModel.h index 24e94e69f5c..3e6b9886d7e 100644 --- a/SofaKernel/modules/SofaMeshCollision/src/SofaMeshCollision/PointModel.h +++ b/SofaKernel/modules/SofaMeshCollision/src/SofaMeshCollision/PointModel.h @@ -60,6 +60,7 @@ class TPoint : public core::TCollisionElementIterator; template class SOFA_SOFAMESHCOLLISION_API PointCollisionModel : public core::CollisionModel @@ -186,13 +187,8 @@ inline typename DataTypes::Deriv TPoint::n() const { return ((unsigne template inline bool TPoint::hasFreePosition() const { return this->model->mstate->read(core::ConstVecCoordId::freePosition())->isSet(); } -template using TPointModel [[deprecated("The TPointModel is now deprecated, please use PointCollisionModel instead. Compatibility stops at v20.06")]] = PointCollisionModel; -using PointModel [[deprecated("The PointModel is now deprecated, please use PointCollisionModel instead. Compatibility stops at v20.06")]] = PointCollisionModel; -using Point = TPoint; - -#if !defined(SOFA_COMPONENT_COLLISION_POINTCOLLISIONMODEL_CPP) +#if !defined(SOFA_COMPONENT_COLLISION_POINTCOLLISIONMODEL_CPP) extern template class SOFA_SOFAMESHCOLLISION_API PointCollisionModel; - #endif //bool Point::testLMD(const Vector3 &PQ, double &coneFactor, double &coneExtension); diff --git a/SofaKernel/modules/SofaMeshCollision/src/SofaMeshCollision/Triangle.h b/SofaKernel/modules/SofaMeshCollision/src/SofaMeshCollision/Triangle.h index 22ec7e58d8d..ead915c2369 100644 --- a/SofaKernel/modules/SofaMeshCollision/src/SofaMeshCollision/Triangle.h +++ b/SofaKernel/modules/SofaMeshCollision/src/SofaMeshCollision/Triangle.h @@ -23,5 +23,5 @@ #include #include -SOFA_DEPRECATED_HEADER(v21.12, "SofaMeshCollision/TriangleModel.h") +SOFA_DEPRECATED_HEADER("v21.06", "v21.12", "SofaMeshCollision/TriangleModel.h") diff --git a/SofaKernel/modules/SofaMeshCollision/src/SofaMeshCollision/TriangleModel.cpp b/SofaKernel/modules/SofaMeshCollision/src/SofaMeshCollision/TriangleModel.cpp index 6318d7b30bc..d1bc750eedd 100644 --- a/SofaKernel/modules/SofaMeshCollision/src/SofaMeshCollision/TriangleModel.cpp +++ b/SofaKernel/modules/SofaMeshCollision/src/SofaMeshCollision/TriangleModel.cpp @@ -28,14 +28,6 @@ namespace sofa::component::collision int TriangleCollisionModelClass = core::RegisterObject("collision model using a triangular mesh, as described in BaseMeshTopology") .add< TriangleCollisionModel >() - - .addAlias("TTriangleModel") - .addAlias("TriangleModel") - .addAlias("TriangleMeshModel") - .addAlias("TriangleSetModel") - .addAlias("TriangleMesh") - .addAlias("TriangleSet") - .addAlias("Triangle") ; template class SOFA_SOFAMESHCOLLISION_API TTriangle; diff --git a/SofaKernel/modules/SofaMeshCollision/src/SofaMeshCollision/TriangleModel.h b/SofaKernel/modules/SofaMeshCollision/src/SofaMeshCollision/TriangleModel.h index 5643dbb351c..797d5554dff 100644 --- a/SofaKernel/modules/SofaMeshCollision/src/SofaMeshCollision/TriangleModel.h +++ b/SofaKernel/modules/SofaMeshCollision/src/SofaMeshCollision/TriangleModel.h @@ -96,6 +96,7 @@ class TTriangle : public core::TCollisionElementIterator< TriangleCollisionModel return (p1()*(1-bary[0]-bary[1])) + (p2()*bary[0]) + (p3()*bary[1]); } }; +using Triangle = TTriangle; /** * This class will create collision elements based on a triangle and/or quad mesh. @@ -242,10 +243,6 @@ inline TTriangle::TTriangle(ParentModel* model, Index index, helper:: SOFA_UNUSED(x); } -template using TTriangleModel [[deprecated("The TTriangleModel is now deprecated, please use TriangleCollisionModel instead. Compatibility stops at v20.06")]] = TriangleCollisionModel; -using TriangleModel [[deprecated("The TriangleModel is now deprecated, please use TriangleCollisionModel instead. Compatibility stops at v20.06")]] = TriangleCollisionModel; -using Triangle = TTriangle; - #if !defined(SOFA_COMPONENT_COLLISION_TRIANGLECOLLISIONMODEL_CPP) extern template class SOFA_SOFAMESHCOLLISION_API TTriangle; extern template class SOFA_SOFAMESHCOLLISION_API TriangleCollisionModel; diff --git a/SofaKernel/modules/SofaSimpleFem/SofaSimpleFem_test/scenes/TetrahedronDiffusionFEMForceField.scn b/SofaKernel/modules/SofaSimpleFem/SofaSimpleFem_test/scenes/TetrahedronDiffusionFEMForceField.scn index 18c5120b4b2..043733c8217 100644 --- a/SofaKernel/modules/SofaSimpleFem/SofaSimpleFem_test/scenes/TetrahedronDiffusionFEMForceField.scn +++ b/SofaKernel/modules/SofaSimpleFem/SofaSimpleFem_test/scenes/TetrahedronDiffusionFEMForceField.scn @@ -18,7 +18,7 @@ - + diff --git a/SofaKernel/modules/SofaSimulationCommon/CMakeLists.txt b/SofaKernel/modules/SofaSimulationCommon/CMakeLists.txt index bb982a34fa8..d281cceea24 100644 --- a/SofaKernel/modules/SofaSimulationCommon/CMakeLists.txt +++ b/SofaKernel/modules/SofaSimulationCommon/CMakeLists.txt @@ -7,7 +7,6 @@ sofa_find_package(TinyXML REQUIRED) set(HEADER_FILES ${SOFASIMULATIONCOMMON_SRC}/config.h.in - ${SOFASIMULATIONCOMMON_SRC}/common.h ${SOFASIMULATIONCOMMON_SRC}/init.h ${SOFASIMULATIONCOMMON_SRC}/initSofaSimulationCommon.h ${SOFASIMULATIONCOMMON_SRC}/FindByTypeVisitor.h diff --git a/SofaKernel/modules/SofaSimulationCommon/src/SofaSimulationCommon/common.h b/SofaKernel/modules/SofaSimulationCommon/src/SofaSimulationCommon/common.h deleted file mode 100644 index 466cac9e3ed..00000000000 --- a/SofaKernel/modules/SofaSimulationCommon/src/SofaSimulationCommon/common.h +++ /dev/null @@ -1,27 +0,0 @@ -/****************************************************************************** -* SOFA, Simulation Open-Framework Architecture * -* (c) 2006 INRIA, USTL, UJF, CNRS, MGH * -* * -* This program is free software; you can redistribute it and/or modify it * -* under the terms of the GNU Lesser General Public License as published by * -* the Free Software Foundation; either version 2.1 of the License, or (at * -* your option) any later version. * -* * -* This program is distributed in the hope that it will be useful, but WITHOUT * -* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or * -* FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License * -* for more details. * -* * -* You should have received a copy of the GNU Lesser General Public License * -* along with this program. If not, see . * -******************************************************************************* -* Authors: The SOFA Team and external contributors (see Authors.txt) * -* * -* Contact information: contact@sofa-framework.org * -******************************************************************************/ -#pragma once -#include - -SOFA_DEPRECATED_HEADER(v21.06, "SofaSimulationCommon/config.h") - -#endif diff --git a/SofaKernel/modules/SofaSimulationCommon/src/SofaSimulationCommon/xml/XML.cpp b/SofaKernel/modules/SofaSimulationCommon/src/SofaSimulationCommon/xml/XML.cpp index ddd399fbf03..39585aefa23 100644 --- a/SofaKernel/modules/SofaSimulationCommon/src/SofaSimulationCommon/xml/XML.cpp +++ b/SofaKernel/modules/SofaSimulationCommon/src/SofaSimulationCommon/xml/XML.cpp @@ -239,26 +239,6 @@ BaseElement* createNode(TiXmlNode* root, const char *basefilename,ElementNameHel return node; } - -/* - //TODO properly remove this. -static void dumpNode(BaseElement* node, std::string prefix0="==", std::string prefix=" ") -{ - std::cout << prefix0; - std::cout << node->getClass()<<" name "<getName()<<" type "<getType()< it = node->begin(); - BaseElement::child_iterator<> end = node->end(); - while (it != end) - { - BaseElement::child_iterator<> next = it; - ++next; - if (next==end) dumpNode(it, prefix+"\\-", prefix+" "); - else dumpNode(it, prefix+"+-", prefix+"| "); - it = next; - } -} -*/ - BaseElement* processXMLLoading(const char *filename, const TiXmlDocument &doc, bool fromMem) { ElementNameHelper resolveElementName; diff --git a/SofaKernel/modules/SofaSimulationCore/CMakeLists.txt b/SofaKernel/modules/SofaSimulationCore/CMakeLists.txt index a0ce52afc63..3649266c332 100644 --- a/SofaKernel/modules/SofaSimulationCore/CMakeLists.txt +++ b/SofaKernel/modules/SofaSimulationCore/CMakeLists.txt @@ -6,7 +6,6 @@ set(SRC_ROOT "src/sofa/simulation") set(HEADER_FILES ${SRC_ROOT}/config.h.in ${SRC_ROOT}/fwd.h - ${SRC_ROOT}/simulationcore.h ${SRC_ROOT}/AnimateBeginEvent.h ${SRC_ROOT}/AnimateEndEvent.h ${SRC_ROOT}/AnimateVisitor.h diff --git a/SofaKernel/modules/SofaSimulationCore/src/sofa/simulation/Simulation.h b/SofaKernel/modules/SofaSimulationCore/src/sofa/simulation/Simulation.h index 982492e8dc7..d5e8b0ccff9 100644 --- a/SofaKernel/modules/SofaSimulationCore/src/sofa/simulation/Simulation.h +++ b/SofaKernel/modules/SofaSimulationCore/src/sofa/simulation/Simulation.h @@ -47,7 +47,7 @@ class SOFA_SIMULATION_CORE_API Simulation: public virtual sofa::core::objectmode public: SOFA_CLASS(Simulation, sofa::core::objectmodel::Base); - [[deprecated("Simulation::DisplayFlags is deprecated use sofa::core::visual::DisplayFlags instead.")]] + SOFA_ATTRIBUTE_DEPRECATED("v21.06 (PR#1730)", "v21.12", "Use sofa::core::visual::DisplayFlags instead.") typedef int DisplayFlags; Simulation(); diff --git a/SofaKernel/modules/SofaSimulationCore/src/sofa/simulation/UpdateLinksVisitor.cpp b/SofaKernel/modules/SofaSimulationCore/src/sofa/simulation/UpdateLinksVisitor.cpp index ef80ca3b6a3..7d42da8e529 100644 --- a/SofaKernel/modules/SofaSimulationCore/src/sofa/simulation/UpdateLinksVisitor.cpp +++ b/SofaKernel/modules/SofaSimulationCore/src/sofa/simulation/UpdateLinksVisitor.cpp @@ -43,7 +43,7 @@ Visitor::Result UpdateLinksVisitor::processNodeTopDown(simulation::Node* node) } //TODO(dmarchal): why do we clear the messsage logs when we update the links ? - //node->clearWarnings(); node->clearOutputs(); + //node->clearLoggedMessages(); node->clearLoggedMessages(); return RESULT_CONTINUE; } diff --git a/SofaKernel/modules/SofaSimulationCore/src/sofa/simulation/simulationcore.h b/SofaKernel/modules/SofaSimulationCore/src/sofa/simulation/simulationcore.h deleted file mode 100644 index 7c3a862a454..00000000000 --- a/SofaKernel/modules/SofaSimulationCore/src/sofa/simulation/simulationcore.h +++ /dev/null @@ -1,31 +0,0 @@ -/****************************************************************************** -* SOFA, Simulation Open-Framework Architecture * -* (c) 2006 INRIA, USTL, UJF, CNRS, MGH * -* * -* This program is free software; you can redistribute it and/or modify it * -* under the terms of the GNU Lesser General Public License as published by * -* the Free Software Foundation; either version 2.1 of the License, or (at * -* your option) any later version. * -* * -* This program is distributed in the hope that it will be useful, but WITHOUT * -* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or * -* FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License * -* for more details. * -* * -* You should have received a copy of the GNU Lesser General Public License * -* along with this program. If not, see . * -******************************************************************************* -* Authors: The SOFA Team and external contributors (see Authors.txt) * -* * -* Contact information: contact@sofa-framework.org * -******************************************************************************/ -#ifndef SOFA_SIMULATION_CORE_H -#define SOFA_SIMULATION_CORE_H - -// Backward compatibility header - -#include - -SOFA_DEPRECATED_HEADER(v21.06, "sofa/simulation/config.h") - -#endif diff --git a/SofaKernel/modules/SofaSimulationGraph/CMakeLists.txt b/SofaKernel/modules/SofaSimulationGraph/CMakeLists.txt index beba009315d..d0f637a1903 100644 --- a/SofaKernel/modules/SofaSimulationGraph/CMakeLists.txt +++ b/SofaKernel/modules/SofaSimulationGraph/CMakeLists.txt @@ -7,7 +7,6 @@ set(HEADER_FILES ${SOFASIMULATIONGRAPH_SRC}/config.h.in ${SOFASIMULATIONGRAPH_SRC}/init.h ${SOFASIMULATIONGRAPH_SRC}/initSofaSimulationGraph.h - ${SOFASIMULATIONGRAPH_SRC}/graph.h ${SOFASIMULATIONGRAPH_SRC}/DAGNode.h ${SOFASIMULATIONGRAPH_SRC}/DAGNodeMultiMappingElement.h ${SOFASIMULATIONGRAPH_SRC}/DAGSimulation.h diff --git a/SofaKernel/modules/SofaSimulationGraph/src/SofaSimulationGraph/graph.h b/SofaKernel/modules/SofaSimulationGraph/src/SofaSimulationGraph/graph.h deleted file mode 100644 index d571f4e3938..00000000000 --- a/SofaKernel/modules/SofaSimulationGraph/src/SofaSimulationGraph/graph.h +++ /dev/null @@ -1,26 +0,0 @@ -/****************************************************************************** -* SOFA, Simulation Open-Framework Architecture * -* (c) 2006 INRIA, USTL, UJF, CNRS, MGH * -* * -* This program is free software; you can redistribute it and/or modify it * -* under the terms of the GNU Lesser General Public License as published by * -* the Free Software Foundation; either version 2.1 of the License, or (at * -* your option) any later version. * -* * -* This program is distributed in the hope that it will be useful, but WITHOUT * -* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or * -* FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License * -* for more details. * -* * -* You should have received a copy of the GNU Lesser General Public License * -* along with this program. If not, see . * -******************************************************************************* -* Authors: The SOFA Team and external contributors (see Authors.txt) * -* * -* Contact information: contact@sofa-framework.org * -******************************************************************************/ -#pragma once -#include - -SOFA_DEPRECATED_HEADER(v21.06, "SofaSimulationGraph/config.h") - diff --git a/SofaKernel/modules/SofaSimulationTree/src/SofaSimulationTree/tree.h b/SofaKernel/modules/SofaSimulationTree/src/SofaSimulationTree/tree.h deleted file mode 100644 index 5014eae67bc..00000000000 --- a/SofaKernel/modules/SofaSimulationTree/src/SofaSimulationTree/tree.h +++ /dev/null @@ -1,31 +0,0 @@ -/****************************************************************************** -* SOFA, Simulation Open-Framework Architecture * -* (c) 2006 INRIA, USTL, UJF, CNRS, MGH * -* * -* This program is free software; you can redistribute it and/or modify it * -* under the terms of the GNU Lesser General Public License as published by * -* the Free Software Foundation; either version 2.1 of the License, or (at * -* your option) any later version. * -* * -* This program is distributed in the hope that it will be useful, but WITHOUT * -* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or * -* FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License * -* for more details. * -* * -* You should have received a copy of the GNU Lesser General Public License * -* along with this program. If not, see . * -******************************************************************************* -* Authors: The SOFA Team and external contributors (see Authors.txt) * -* * -* Contact information: contact@sofa-framework.org * -******************************************************************************/ -#ifndef SOFA_SIMULATION_TREE_TREE_H -#define SOFA_SIMULATION_TREE_TREE_H - -// Backward compatibility header - -#include - -SOFA_DEPRECATED_HEADER(v21.06, "SofaSimulationTree/config.h") - -#endif diff --git a/applications/plugins/BulletCollisionDetection/BulletCollisionDetection.h b/applications/plugins/BulletCollisionDetection/BulletCollisionDetection.h index ced647649a1..b8393d993ea 100644 --- a/applications/plugins/BulletCollisionDetection/BulletCollisionDetection.h +++ b/applications/plugins/BulletCollisionDetection/BulletCollisionDetection.h @@ -42,7 +42,7 @@ #include -//#include +//#include //#include #include "BulletSphereModel.h" diff --git a/applications/plugins/BulletCollisionDetection/examples/GlobalBulletCollision.py b/applications/plugins/BulletCollisionDetection/examples/GlobalBulletCollision.py index 0c7b481f96e..483023a1e8d 100644 --- a/applications/plugins/BulletCollisionDetection/examples/GlobalBulletCollision.py +++ b/applications/plugins/BulletCollisionDetection/examples/GlobalBulletCollision.py @@ -29,7 +29,7 @@ def createGraph(self,node): mec=mapped.createObject('MechanicalObject', src='@loader',name='the_bol') mec.applyScale(50,50,50) mapped.createObject('BulletTriangleModel', name='Floor', simulated=0, moving=0, margin="1") - #floorNode.createObject('Line', name='Floor', simulated=0, moving=0) + #floorNode.createObject('LineCollisionModel', name='Floor', simulated=0, moving=0) mapped.createObject('OglModel', name='FloorV', filename='mesh/SaladBowl.obj',texturename='textures/texture.bmp')#, texturename='textures/SaladBowl$.bmp') mapped.createObject('RigidMapping',template='Rigid,Vec3d',name='rigid_mapping',input='@../father',output='@the_bol') #self.generatePrimitives1(40) diff --git a/applications/plugins/BulletCollisionDetection/examples/PrimitiveCreation.py b/applications/plugins/BulletCollisionDetection/examples/PrimitiveCreation.py index 17a0126e479..745d513df37 100644 --- a/applications/plugins/BulletCollisionDetection/examples/PrimitiveCreation.py +++ b/applications/plugins/BulletCollisionDetection/examples/PrimitiveCreation.py @@ -31,7 +31,7 @@ def createRigidCapsule(parentNode,name,x,y,z,*args): meca = node.createObject('MechanicalObject',name='rigidDOF',template='Rigid',position=str(x)+' '+str(y)+' '+str(z)+' 0 0 0 1',velocity='0 0 '+str(falling_speed)+' 0 0 0 1') mass = node.createObject('UniformMass',name='mass',totalMass=1) - node.createObject('TCapsuleModel',template='Rigid',name='capsule_model',radii=str(radius),heights=str(height)) + node.createObject('CapsuleCollisionModel',template='Rigid',name='capsule_model',radii=str(radius),heights=str(height)) return 0 @@ -96,7 +96,7 @@ def createFlexCapsule(parentNode,name,x,y,z,*args): node.createObject('MechanicalObject',template='Vec3d',name='falling_particle',position=str(x + x_rand)+' '+str(y + y_rand)+' '+str(z + z_rand + capsule_height)+' '+str(x - x_rand)+' '+str(y - y_rand)+' '+str(z - z_rand),velocity='0 0 '+str(falling_speed)) mass = node.createObject('UniformMass',name='mass') node.createObject('MeshTopology', name='meshTopology34',edges='0 1',drawEdges='1') - node.createObject('TCapsuleModel',template='Vec3d',name='capsule_model',defaultRadius=str(radius)) + node.createObject('CapsuleCollisionModel',template='Vec3d',name='capsule_model',defaultRadius=str(radius)) return 0 @@ -161,7 +161,7 @@ def createCapsuleChain(parentNode,name,length,x,y,z): node.createObject('StiffSpringForceField',template='Vec3d',name='springforcefield',stiffness='100',damping='1',spring=springs) mass = node.createObject('UniformMass',name='mass') node.createObject('MeshTopology', name='meshTopology34',edges=topo_edges,drawEdges='1') - node.createObject('TCapsuleModel',template='Vec3d',name='capsule_model',defaultRadius=str(radius)) + node.createObject('CapsuleCollisionModel',template='Vec3d',name='capsule_model',defaultRadius=str(radius)) return 0 @@ -184,7 +184,7 @@ def createOBB(parentNode,name,x,y,z,*args): meca = node.createObject('MechanicalObject',name='rigidDOF',template='Rigid',position=str(x)+' '+str(y)+' '+str(z)+' 0 0 0 1',velocity='0 0 '+str(falling_speed)+' 0 0 0 1') mass = node.createObject('UniformMass',name='mass',totalMass=1) - node.createObject('TOBBModel',template='Rigid',name='OBB_model',extents=str(a)+' '+str(b)+' '+str(c)) + node.createObject('OBBCollisionModel',template='Rigid',name='OBB_model',extents=str(a)+' '+str(b)+' '+str(c)) return 0 diff --git a/applications/plugins/Compliant/Compliant_test/CompliantImplicitSolver_test.cpp b/applications/plugins/Compliant/Compliant_test/CompliantImplicitSolver_test.cpp index 1519f012564..b98e90d979c 100644 --- a/applications/plugins/Compliant/Compliant_test/CompliantImplicitSolver_test.cpp +++ b/applications/plugins/Compliant/Compliant_test/CompliantImplicitSolver_test.cpp @@ -6,7 +6,7 @@ #include #include -#include +#include using namespace sofa::modeling; diff --git a/applications/plugins/Compliant/Compliant_test/DiagonalStiffness_test.cpp b/applications/plugins/Compliant/Compliant_test/DiagonalStiffness_test.cpp index 427686f5899..3b0ceabed42 100644 --- a/applications/plugins/Compliant/Compliant_test/DiagonalStiffness_test.cpp +++ b/applications/plugins/Compliant/Compliant_test/DiagonalStiffness_test.cpp @@ -22,7 +22,7 @@ #include #include -#include +#include using sofa::helper::logging::Message ; #include diff --git a/applications/plugins/Compliant/Compliant_test/UniformStiffness_test.cpp b/applications/plugins/Compliant/Compliant_test/UniformStiffness_test.cpp index 02c1677cdf5..c3663ccd77c 100644 --- a/applications/plugins/Compliant/Compliant_test/UniformStiffness_test.cpp +++ b/applications/plugins/Compliant/Compliant_test/UniformStiffness_test.cpp @@ -22,7 +22,7 @@ #include #include -#include +#include using sofa::helper::logging::Message ; #include diff --git a/applications/plugins/Compliant/Compliant_test/python/scene_AffineMultiMapping.py b/applications/plugins/Compliant/Compliant_test/python/scene_AffineMultiMapping.py index 9f7ddeffa02..7b42ab9e7ea 100644 --- a/applications/plugins/Compliant/Compliant_test/python/scene_AffineMultiMapping.py +++ b/applications/plugins/Compliant/Compliant_test/python/scene_AffineMultiMapping.py @@ -29,7 +29,7 @@ def insert_point(node, name, position, mass = 1.0): res.createObject('UniformMass', mass = mass) - res.createObject('SphereModel', radius = 0.01) + res.createObject('SphereCollisionModel', radius = 0.01) return res diff --git a/applications/plugins/Compliant/Compliant_test/python/scene_UniformCompliance.py b/applications/plugins/Compliant/Compliant_test/python/scene_UniformCompliance.py index 9910be5bb81..f03d223712b 100644 --- a/applications/plugins/Compliant/Compliant_test/python/scene_UniformCompliance.py +++ b/applications/plugins/Compliant/Compliant_test/python/scene_UniformCompliance.py @@ -20,7 +20,7 @@ def insert_point(node, name, position, mass = 1.0): res.createObject('UniformMass', mass = mass) - res.createObject('SphereModel', radius = 0.1) + res.createObject('SphereCollisionModel', radius = 0.1) return res diff --git a/applications/plugins/Compliant/Compliant_test/python/scene_lambda_propagation.py b/applications/plugins/Compliant/Compliant_test/python/scene_lambda_propagation.py index 4058764476b..eb77c464ac6 100644 --- a/applications/plugins/Compliant/Compliant_test/python/scene_lambda_propagation.py +++ b/applications/plugins/Compliant/Compliant_test/python/scene_lambda_propagation.py @@ -23,7 +23,7 @@ def insert_point(node, name, position, mass = 1.0): res.createObject('UniformMass', mass = mass) - res.createObject('SphereModel', radius = 0.1) + res.createObject('SphereCollisionModel', radius = 0.1) return res diff --git a/applications/plugins/Compliant/Compliant_test/python/scene_restitution.py b/applications/plugins/Compliant/Compliant_test/python/scene_restitution.py index 9ccce837949..2efed7540de 100644 --- a/applications/plugins/Compliant/Compliant_test/python/scene_restitution.py +++ b/applications/plugins/Compliant/Compliant_test/python/scene_restitution.py @@ -43,7 +43,7 @@ def createScene(root): fixedNode.createObject('MechanicalObject',template="Rigid",position="0 0 0 0 0 0 1") fixedNode.createObject('RigidMass',mass="1",inertia="1 1 1") fixedNode.createObject('FixedConstraint',template="Rigid",indices="0") - fixedNode.createObject('Sphere',contactRestitution=1) + fixedNode.createObject('SphereCollisionModel',contactRestitution=1) ######################## moving spheres ######################## @@ -53,7 +53,7 @@ def createScene(root): movingNode = root.createChild('moving'+str(c)) movingNode.createObject('MechanicalObject',template="Rigid",name="dofs",position="0.5 0 0 0 0 0 1",velocity=str(vel)+" 0 0 0 0 0") movingNode.createObject('RigidMass',mass="1",inertia="1 1 1") - movingNode.createObject('Sphere',contactRestitution=c,group=1) + movingNode.createObject('SphereCollisionModel',contactRestitution=c,group=1) return 0 diff --git a/applications/plugins/Compliant/Compliant_test/python_test_list.cpp b/applications/plugins/Compliant/Compliant_test/python_test_list.cpp index 4392770668c..c638f17b00d 100644 --- a/applications/plugins/Compliant/Compliant_test/python_test_list.cpp +++ b/applications/plugins/Compliant/Compliant_test/python_test_list.cpp @@ -1,4 +1,4 @@ -#include +#include namespace sofa { diff --git a/applications/plugins/Compliant/examples/StructuralAPI.py b/applications/plugins/Compliant/examples/StructuralAPI.py index 68562cef332..ad1cc35d1de 100644 --- a/applications/plugins/Compliant/examples/StructuralAPI.py +++ b/applications/plugins/Compliant/examples/StructuralAPI.py @@ -161,7 +161,7 @@ def createSceneAndController(root): body2.dofs.showObject=True body2.dofs.showObjectScale=1 # collision model - body2.node.createObject("Sphere", group="1") + body2.node.createObject("SphereCollisionModel", group="1") # visual model body2.visualModel = body2.addVisualModel( "mesh/cube.obj" ) body2.visualModel.model.setColor(0,1,0,1) diff --git a/applications/plugins/Compliant/examples/contact/bowl1.py b/applications/plugins/Compliant/examples/contact/bowl1.py index 0aac5fed786..a26a3725473 100644 --- a/applications/plugins/Compliant/examples/contact/bowl1.py +++ b/applications/plugins/Compliant/examples/contact/bowl1.py @@ -85,7 +85,7 @@ def createScene(node): dofs.velocity = vel.tolist() mass = particles.createObject('UniformMass', template = 'Vec3d') - model = particles.createObject('SphereModel', template = 'Vec3d', + model = particles.createObject('SphereCollisionModel', template = 'Vec3d', selfCollision = True, radius = 0.1) diff --git a/applications/plugins/Compliant/examples/contact/bowl2.py b/applications/plugins/Compliant/examples/contact/bowl2.py index b0fd92ae236..d059e90324b 100644 --- a/applications/plugins/Compliant/examples/contact/bowl2.py +++ b/applications/plugins/Compliant/examples/contact/bowl2.py @@ -88,7 +88,7 @@ def createScene(node): dofs.velocity = vel.tolist() mass = p.createObject('UniformMass', template = 'Vec3d') - model = p.createObject('SphereModel', template = 'Vec3d', + model = p.createObject('SphereCollisionModel', template = 'Vec3d', selfCollision = True, radius = 0.1) diff --git a/applications/plugins/Compliant/examples/contact/friction.scn b/applications/plugins/Compliant/examples/contact/friction.scn index 21e084db514..4e3cbadcb3a 100644 --- a/applications/plugins/Compliant/examples/contact/friction.scn +++ b/applications/plugins/Compliant/examples/contact/friction.scn @@ -52,7 +52,7 @@ - + diff --git a/applications/plugins/Compliant/examples/contact/penalty.scn b/applications/plugins/Compliant/examples/contact/penalty.scn index 5ac51874438..38369974bde 100644 --- a/applications/plugins/Compliant/examples/contact/penalty.scn +++ b/applications/plugins/Compliant/examples/contact/penalty.scn @@ -20,20 +20,20 @@ - + - + - + diff --git a/applications/plugins/Compliant/examples/contact/restitution+friction.scn b/applications/plugins/Compliant/examples/contact/restitution+friction.scn index f75eb119e17..f4e5d2af777 100644 --- a/applications/plugins/Compliant/examples/contact/restitution+friction.scn +++ b/applications/plugins/Compliant/examples/contact/restitution+friction.scn @@ -119,7 +119,7 @@ - + diff --git a/applications/plugins/Compliant/examples/contact/restitution.scn b/applications/plugins/Compliant/examples/contact/restitution.scn index 1ddd46e448a..baf1b6e8bba 100644 --- a/applications/plugins/Compliant/examples/contact/restitution.scn +++ b/applications/plugins/Compliant/examples/contact/restitution.scn @@ -118,7 +118,7 @@ - + diff --git a/applications/plugins/Compliant/examples/contact/soup.py b/applications/plugins/Compliant/examples/contact/soup.py index 7fd96cfd778..64141c065b1 100644 --- a/applications/plugins/Compliant/examples/contact/soup.py +++ b/applications/plugins/Compliant/examples/contact/soup.py @@ -58,7 +58,7 @@ def createScene(root): floorColNode.createObject('MechanicalObject') floorColNode.createObject('RigidMapping') - floorColNode.createObject('Triangle', name='Floor', simulated=0, moving=0, proximity=0.01) + floorColNode.createObject('TriangleCollisionModel', name='Floor', simulated=0, moving=0, proximity=0.01) ######################## spheres ######################## @@ -85,7 +85,7 @@ def createScene(root): for y in range(-3,3): r = random.random()*2e-1 for z in xrange(1): - sphereNode = root.createChild('Sphere'+str(i)) + sphereNode = root.createChild('SphereCollisionModel'+str(i)) sphereNode.createObject('MechanicalObject',template='Vec3d',position=str(x*2.5+r)+" "+str(y*2.5+r)+" "+str(20+2.5*(z+1)), velocity='0 0 -1') sphereNode.createObject('SphereCollisionModel',template='Vec3d',name='sphere_model',radius=1,selfCollision="0") sphereNode.createObject('UniformMass',name='mass',mass=.1) diff --git a/applications/plugins/Compliant/examples/contact/unilateral_sequential.scn b/applications/plugins/Compliant/examples/contact/unilateral_sequential.scn index 63b5272361a..8340d187d15 100644 --- a/applications/plugins/Compliant/examples/contact/unilateral_sequential.scn +++ b/applications/plugins/Compliant/examples/contact/unilateral_sequential.scn @@ -21,20 +21,20 @@ - + - + - + diff --git a/applications/plugins/Compliant/examples/contact/viscous_friction.scn b/applications/plugins/Compliant/examples/contact/viscous_friction.scn index 6e8845d8198..d1046320fc4 100644 --- a/applications/plugins/Compliant/examples/contact/viscous_friction.scn +++ b/applications/plugins/Compliant/examples/contact/viscous_friction.scn @@ -55,7 +55,7 @@ - + diff --git a/applications/plugins/Compliant/examples/gear.py b/applications/plugins/Compliant/examples/gear.py index fd203b8263d..31d8edb6f55 100644 --- a/applications/plugins/Compliant/examples/gear.py +++ b/applications/plugins/Compliant/examples/gear.py @@ -52,13 +52,13 @@ def createScene(root): body0.dofs.showObject = True body0.dofs.showObjectScale = r0*1.1 body0.dofs.velocity="0 0 0 0 1 0" - body0.node.createObject('Sphere', radius=r0) + body0.node.createObject('SphereCollisionModel', radius=r0) body1 = StructuralAPI.RigidBody( gearNode, "body_1" ) body1.setManually( [1,0,0,0,0,0,1], 1, [1,1,1] ) body1.dofs.showObject = True body1.dofs.showObjectScale = r1*1.1 - body1.node.createObject('Sphere', radius=r1) + body1.node.createObject('SphereCollisionModel', radius=r1) body0.node.createObject('PartialFixedConstraint', fixedDirections="1 1 1 1 0 1") @@ -90,13 +90,13 @@ def createScene(root): body0.dofs.showObject = True body0.dofs.showObjectScale = r0*1.1 body0.dofs.velocity="0 0 0 0 1 0" - body0.node.createObject('Sphere', radius=r0) + body0.node.createObject('SphereCollisionModel', radius=r0) body1 = StructuralAPI.RigidBody( beltNode, "body_1" ) body1.setManually( [1.5,-2,0,0,0,0,1], 1, [1,1,1] ) body1.dofs.showObject = True body1.dofs.showObjectScale = r1*1.1 - body1.node.createObject('Sphere', radius=r1) + body1.node.createObject('SphereCollisionModel', radius=r1) body0.node.createObject('PartialFixedConstraint', fixedDirections="1 1 1 1 0 1") @@ -130,13 +130,13 @@ def createScene(root): body0.dofs.showObject = True body0.dofs.showObjectScale = r0*1.1 body0.dofs.velocity="0 0 0 1 0 0" - body0.node.createObject('Sphere', radius=r0) + body0.node.createObject('SphereCollisionModel', radius=r0) body1 = StructuralAPI.RigidBody( angleNode, "body_1" ) body1.setManually( [1,-4,0,0,0,0,1], 1, [1,1,1] ) body1.dofs.showObject = True body1.dofs.showObjectScale = r1*1.1 - body1.node.createObject('Sphere', radius=r1) + body1.node.createObject('SphereCollisionModel', radius=r1) body0.node.createObject('PartialFixedConstraint', fixedDirections="1 1 1 0 1 1") @@ -166,13 +166,13 @@ def createScene(root): body0.dofs.showObject = True body0.dofs.showObjectScale = 0.55 body0.dofs.velocity="0 0 0 0 0 1" - body0.node.createObject('Sphere', radius=0.5) + body0.node.createObject('SphereCollisionModel', radius=0.5) body1 = StructuralAPI.RigidBody( rackNode, "body_1" ) body1.setManually( [-2,-6.71,0, 0,0,0.7071067811865476,0.7071067811865476], 1, [1,1,1] ) body1.dofs.showObject = True body1.dofs.showObjectScale = 0.3 - body1.node.createObject('Capsule', radii="0.2", heights="5") + body1.node.createObject('CapsuleCollisionModel', radii="0.2", heights="5") body0.node.createObject('PartialFixedConstraint', fixedDirections="1 1 1 1 1 0") diff --git a/applications/plugins/Compliant/examples/knee/knee.py b/applications/plugins/Compliant/examples/knee/knee.py index 0711526ab4f..7c68ccd6dbf 100644 --- a/applications/plugins/Compliant/examples/knee/knee.py +++ b/applications/plugins/Compliant/examples/knee/knee.py @@ -82,7 +82,7 @@ def createScene( node ): condyles = femur.dofs.map_vec3('condyles', vec( w, h, 0, -w, h, 0) ) - condyles.createObject('SphereModel', radius = radius) + condyles.createObject('SphereCollisionModel', radius = radius) tibia = rigid.Body(scene, 'tibia', draw = True) tibia.length = 0.6 diff --git a/applications/plugins/Compliant/examples/knee/plane_test.py b/applications/plugins/Compliant/examples/knee/plane_test.py index dce8d4e6722..804fa55e0b9 100644 --- a/applications/plugins/Compliant/examples/knee/plane_test.py +++ b/applications/plugins/Compliant/examples/knee/plane_test.py @@ -54,7 +54,7 @@ def createScene(node): position = '1 2 1') point.createObject('UniformMass', template = 'Vec3', mass = 1) - point.createObject('SphereModel', radius = 0.01) + point.createObject('SphereCollisionModel', radius = 0.01) test = constraint.PointInHalfSpace(scene, plane.getObject('dofs'), dofs) diff --git a/applications/plugins/Compliant/examples/knee/rigid.py b/applications/plugins/Compliant/examples/knee/rigid.py index efb82c8fe74..40970e70875 100644 --- a/applications/plugins/Compliant/examples/knee/rigid.py +++ b/applications/plugins/Compliant/examples/knee/rigid.py @@ -232,7 +232,7 @@ def __init__(self, node, filename, **kwargs): name = 'dofs', template = 'Vec3') - triangles = self.node.createObject('TriangleModel', + triangles = self.node.createObject('TriangleCollisionModel', name = 'model') mapping = self.node.createObject('RigidMapping') diff --git a/applications/plugins/Compliant/python/Compliant/Rigid.py b/applications/plugins/Compliant/python/Compliant/Rigid.py index a60e072ad63..e84343a3cee 100644 --- a/applications/plugins/Compliant/python/Compliant/Rigid.py +++ b/applications/plugins/Compliant/python/Compliant/Rigid.py @@ -215,7 +215,7 @@ def insert(self, node): name = 'dofs', position = '@loader.position') - model = collision.createObject('TriangleModel', + model = collision.createObject('TriangleCollisionModel', name = 'model', template = 'Vec3', contactFriction = self.mu) diff --git a/applications/plugins/Compliant/python/Compliant/StructuralAPI.py b/applications/plugins/Compliant/python/Compliant/StructuralAPI.py index ea133d54413..65a855a5e38 100644 --- a/applications/plugins/Compliant/python/Compliant/StructuralAPI.py +++ b/applications/plugins/Compliant/python/Compliant/StructuralAPI.py @@ -140,7 +140,7 @@ def __init__(self, node, filepath, scale3d, offset, name_suffix=''): self.loader = SofaPython.Tools.meshLoader(self.node, filename=filepath, name='loader', scale3d=concat(scale3d), translation=concat(offset[:3]) , rotation=concat(r), triangulate=True) self.topology = self.node.createObject('MeshTopology', name='topology', src="@loader" ) self.dofs = self.node.createObject('MechanicalObject', name='dofs', template="Vec3"+template_suffix ) - self.triangles = self.node.createObject('TriangleModel', name='model') + self.triangles = self.node.createObject('TriangleCollisionModel', name='model') self.mapping = self.node.createObject('RigidMapping', name="mapping") self.normals = None self.visual = None diff --git a/applications/plugins/ExternalBehaviorModel/example/MultiMapping.py b/applications/plugins/ExternalBehaviorModel/example/MultiMapping.py index 4acba827f3d..ccf97ee8c61 100644 --- a/applications/plugins/ExternalBehaviorModel/example/MultiMapping.py +++ b/applications/plugins/ExternalBehaviorModel/example/MultiMapping.py @@ -20,7 +20,7 @@ def createGraph(self,node): rigidCollisionNode.createObject('MeshObjLoader', filename="mesh/cube.obj", name="loader") rigidCollisionNode.createObject('MeshTopology', src="@loader") rigidCollisionNode.createObject('MechanicalObject', name="rigidCollisionDofs", template='Vec3d', position="@loader.position", showObject='1', showObjectScale='0.8') - rigidCollisionNode.createObject('Triangle') + rigidCollisionNode.createObject('TriangleCollisionModel') rigidCollisionNode.createObject('RigidMapping') diff --git a/applications/plugins/Flexible/Flexible_test/python_test_list.cpp b/applications/plugins/Flexible/Flexible_test/python_test_list.cpp index 02aea5814f1..9124e91f61b 100644 --- a/applications/plugins/Flexible/Flexible_test/python_test_list.cpp +++ b/applications/plugins/Flexible/Flexible_test/python_test_list.cpp @@ -1,4 +1,4 @@ -#include +#include namespace sofa { diff --git a/applications/plugins/Flexible/deformationMapping/BaseDeformationMultiMapping.inl b/applications/plugins/Flexible/deformationMapping/BaseDeformationMultiMapping.inl index 0351cf03e88..4d623bd6919 100644 --- a/applications/plugins/Flexible/deformationMapping/BaseDeformationMultiMapping.inl +++ b/applications/plugins/Flexible/deformationMapping/BaseDeformationMultiMapping.inl @@ -26,7 +26,7 @@ #include "BaseDeformationImpl.inl" #include "../quadrature/BaseGaussPointSampler.h" #include -#include +#include #include #ifdef _OPENMP diff --git a/applications/plugins/Flexible/examples/visualization/dualQuatSkinning.scn b/applications/plugins/Flexible/examples/visualization/dualQuatSkinning.scn index 5abfc6b1fa5..30f7fcf35a7 100644 --- a/applications/plugins/Flexible/examples/visualization/dualQuatSkinning.scn +++ b/applications/plugins/Flexible/examples/visualization/dualQuatSkinning.scn @@ -138,7 +138,7 @@ - + diff --git a/applications/plugins/LMConstraint/tutorials/houseOfCards/houseOfCards.cpp b/applications/plugins/LMConstraint/tutorials/houseOfCards/houseOfCards.cpp index 0bf11920e39..d7d4dcc4a31 100644 --- a/applications/plugins/LMConstraint/tutorials/houseOfCards/houseOfCards.cpp +++ b/applications/plugins/LMConstraint/tutorials/houseOfCards/houseOfCards.cpp @@ -62,9 +62,9 @@ Node::SPtr createCard(Node::SPtr parent, const Coord3& position, const Coord3& static int colorIdx=0; std::vector modelTypes; - modelTypes.push_back("Triangle"); - modelTypes.push_back("Line"); - modelTypes.push_back("Point"); + modelTypes.push_back("TriangleCollisionModel"); + modelTypes.push_back("LineCollisionModel"); + modelTypes.push_back("PointCollisionModel"); Node::SPtr card = sofa::modeling::createEulerSolverNode(parent,"Rigid","Implicit"); diff --git a/applications/plugins/LeapMotion/src/LeapMotionDriver.h b/applications/plugins/LeapMotion/src/LeapMotionDriver.h index 5f809581270..3e17bb77bff 100644 --- a/applications/plugins/LeapMotion/src/LeapMotionDriver.h +++ b/applications/plugins/LeapMotion/src/LeapMotionDriver.h @@ -28,7 +28,7 @@ #include #include #include -#include +#include #include #include #include diff --git a/applications/plugins/ManifoldTopologies/examples/ManifoldTriangleSurfaceCutting.scn b/applications/plugins/ManifoldTopologies/examples/ManifoldTriangleSurfaceCutting.scn index 65eb05924c6..44d4554a273 100644 --- a/applications/plugins/ManifoldTopologies/examples/ManifoldTriangleSurfaceCutting.scn +++ b/applications/plugins/ManifoldTopologies/examples/ManifoldTriangleSurfaceCutting.scn @@ -22,7 +22,7 @@ - + diff --git a/applications/plugins/ManifoldTopologies/examples/mamailleMani.scn b/applications/plugins/ManifoldTopologies/examples/mamailleMani.scn index e04a275da61..c0a59250ea9 100644 --- a/applications/plugins/ManifoldTopologies/examples/mamailleMani.scn +++ b/applications/plugins/ManifoldTopologies/examples/mamailleMani.scn @@ -22,7 +22,7 @@ - + diff --git a/applications/plugins/MeshSTEPLoader/STEPShapeMapping.h b/applications/plugins/MeshSTEPLoader/STEPShapeMapping.h index d6cf0d7adb9..a443549ed8c 100644 --- a/applications/plugins/MeshSTEPLoader/STEPShapeMapping.h +++ b/applications/plugins/MeshSTEPLoader/STEPShapeMapping.h @@ -63,13 +63,13 @@ class STEPShapeExtractor : public sofa::core::DataEngine if (loader == NULL) { - context->serr << "Cannot create "<sendl; + context->serr << "Cannot create "<()<<" as input model is missing or invalid." << context->sendl; return false; } if (topology == NULL) { - context->serr << "Cannot create "<sendl; + context->serr << "Cannot create "<()<<" as output model is missing or invalid." << context->sendl; return false; } diff --git a/applications/plugins/OptiTrackNatNet/OptiTrackNatNetDevice.cpp b/applications/plugins/OptiTrackNatNet/OptiTrackNatNetDevice.cpp index f3972fe2189..483c43e9c97 100644 --- a/applications/plugins/OptiTrackNatNet/OptiTrackNatNetDevice.cpp +++ b/applications/plugins/OptiTrackNatNet/OptiTrackNatNetDevice.cpp @@ -27,7 +27,7 @@ #include #include #include -#include +#include #include #include #include diff --git a/applications/plugins/PSL/PSL_test/PSL_test.cpp b/applications/plugins/PSL/PSL_test/PSL_test.cpp index f81f3caa72c..bfd0f7adba8 100644 --- a/applications/plugins/PSL/PSL_test/PSL_test.cpp +++ b/applications/plugins/PSL/PSL_test/PSL_test.cpp @@ -28,10 +28,10 @@ #include using sofa::helper::testing::BaseTest ; -#include +#include using sofa::Python_test ; -#include +#include #include using sofa::simulation::Simulation ; diff --git a/applications/plugins/PSL/PSL_test/python_test.cpp b/applications/plugins/PSL/PSL_test/python_test.cpp index aea19b363fd..0ed5f16ae9c 100644 --- a/applications/plugins/PSL/PSL_test/python_test.cpp +++ b/applications/plugins/PSL/PSL_test/python_test.cpp @@ -26,7 +26,7 @@ #include -#include +#include using sofa::Python_test ; using sofa::Python_test_list ; diff --git a/applications/plugins/Registration/ClosestPointRegistrationForceField.inl b/applications/plugins/Registration/ClosestPointRegistrationForceField.inl index 4d70ac95170..f885f2eb71f 100644 --- a/applications/plugins/Registration/ClosestPointRegistrationForceField.inl +++ b/applications/plugins/Registration/ClosestPointRegistrationForceField.inl @@ -24,7 +24,7 @@ #include "ClosestPointRegistrationForceField.h" #include -#include +#include #include #include #include diff --git a/applications/plugins/Registration/python/Registration/sml.py b/applications/plugins/Registration/python/Registration/sml.py index 54d613de16e..9d647077852 100644 --- a/applications/plugins/Registration/python/Registration/sml.py +++ b/applications/plugins/Registration/python/Registration/sml.py @@ -117,7 +117,7 @@ def __insert_registration_node(self): registration_node.createObject('MeshTopology', name='topo', src='@./source_topology') registration_node.createObject('MechanicalObject', name='DOFs') - registration_node.createObject('Triangle') + registration_node.createObject('TriangleCollisionModel') registration_node.createObject('RigidMapping', template='Rigid3d,Vec3d', input="@" + Tools.node_path_rel(registration_node, self.nodes["dofRigid"]), diff --git a/applications/plugins/RigidScale/examples/mapping/bonesWithRigidScaleToAffineMultiMapping.py b/applications/plugins/RigidScale/examples/mapping/bonesWithRigidScaleToAffineMultiMapping.py index dac48261e5b..5a40ec93fcd 100755 --- a/applications/plugins/RigidScale/examples/mapping/bonesWithRigidScaleToAffineMultiMapping.py +++ b/applications/plugins/RigidScale/examples/mapping/bonesWithRigidScaleToAffineMultiMapping.py @@ -107,7 +107,7 @@ def createGraph(self, root): objContactNode.createObject('MeshTopology', name='topo', src='@../source') objContactNode.createObject('MechanicalObject', name='DOFs') objContactNode.createObject('UniformMass', totalMass=1) - objContactNode.createObject('TriangleModel') + objContactNode.createObject('TriangleCollisionModel') objContactNode.createObject('LinearMapping', template='Affine,Vec3d') # Visual model objVisuNode = objContactNode.createChild('visual') @@ -132,7 +132,7 @@ def createGraph(self, root): surfaceRegistrationNode = objMainNode.createChild('reg_force') surfaceRegistrationNode.createObject('MeshTopology', name='topo', src='@../source') surfaceRegistrationNode.createObject('MechanicalObject', name='DOFs') - surfaceRegistrationNode.createObject('Triangle') + surfaceRegistrationNode.createObject('TriangleCollisionModel') surfaceRegistrationNode.createObject('LinearMapping', template='Affine,Vec3d', assemble=0) surfaceRegistrationNode.createObject('NormalsFromPoints', name='normalsFromPoints', template='Vec3d', position='@DOFs.position', triangles='@topo.triangles', invertNormals=0) surfaceRegistrationNode.createObject('ClosestPointRegistrationForceField', name='ICP', template='Vec3d' diff --git a/applications/plugins/RigidScale/examples/mapping/cageLocalScaling.py b/applications/plugins/RigidScale/examples/mapping/cageLocalScaling.py index d3f315f03f0..3eb61624c11 100755 --- a/applications/plugins/RigidScale/examples/mapping/cageLocalScaling.py +++ b/applications/plugins/RigidScale/examples/mapping/cageLocalScaling.py @@ -91,7 +91,7 @@ def createGraph(self, root): objContactNode.createObject('MeshTopology', name='topo', src='@../source') objContactNode.createObject('MechanicalObject', name='DOFs') objContactNode.createObject('UniformMass', totalMass=1) - objContactNode.createObject('TriangleModel') + objContactNode.createObject('TriangleCollisionModel') objContactNode.createObject('LinearMapping', template='Affine,Vec3d') # Visual model objVisuNode = objContactNode.createChild('visual') diff --git a/applications/plugins/RigidScale/examples/mapping/monkey.py b/applications/plugins/RigidScale/examples/mapping/monkey.py index f668f3137fe..a20a2a0858d 100755 --- a/applications/plugins/RigidScale/examples/mapping/monkey.py +++ b/applications/plugins/RigidScale/examples/mapping/monkey.py @@ -103,7 +103,7 @@ def createGraph(self, root): objContactNode = self.affineNode.createChild('registration') objContactNode.createObject('MeshTopology', name='topo', src='@../source') objContactNode.createObject('MechanicalObject', name='DOFs') - objContactNode.createObject('TriangleModel') + objContactNode.createObject('TriangleCollisionModel') objContactNode.createObject('LinearMapping', template='Affine,Vec3d') # Visual model objVisuNode = objContactNode.createChild('visual') @@ -125,4 +125,4 @@ def onEndAnimationStep(self, dt): isNegative = True print "value : ", xi if isNegative : - print "Negative values still exist : ", self.t \ No newline at end of file + print "Negative values still exist : ", self.t diff --git a/applications/plugins/RigidScale/examples/mapping/rigidScaleToAffineMultiMapping.py b/applications/plugins/RigidScale/examples/mapping/rigidScaleToAffineMultiMapping.py index f24afcbc6de..8ea5544e443 100755 --- a/applications/plugins/RigidScale/examples/mapping/rigidScaleToAffineMultiMapping.py +++ b/applications/plugins/RigidScale/examples/mapping/rigidScaleToAffineMultiMapping.py @@ -81,7 +81,7 @@ def createGraph(self, root): objContactNode.createObject('MeshTopology', name='topo', src='@../source') objContactNode.createObject('MechanicalObject', name='DOFs') objContactNode.createObject('UniformMass', totalMass=1) - objContactNode.createObject('TriangleModel') + objContactNode.createObject('TriangleCollisionModel') objContactNode.createObject('LinearMapping', template='Affine,Vec3d') # Visual model objVisuNode = objContactNode.createChild('visual') diff --git a/applications/plugins/RigidScale/examples/mapping/rigidScaleToRigidMultiMapping.py b/applications/plugins/RigidScale/examples/mapping/rigidScaleToRigidMultiMapping.py index ba1daa29383..3482ca730c6 100755 --- a/applications/plugins/RigidScale/examples/mapping/rigidScaleToRigidMultiMapping.py +++ b/applications/plugins/RigidScale/examples/mapping/rigidScaleToRigidMultiMapping.py @@ -87,7 +87,7 @@ def createGraph(self, root): objContactNode.createObject('MeshTopology', name='topo', src='@../source') objContactNode.createObject('MechanicalObject', name='DOFs') objContactNode.createObject('UniformMass', totalMass=1) - objContactNode.createObject('TriangleModel') + objContactNode.createObject('TriangleCollisionModel') objContactNode.createObject('LinearMapping', template='Affine,Vec3d') # Visual model objVisuNode = objContactNode.createChild('visual') diff --git a/applications/plugins/RigidScale/mapping/RigidScaleToAffineMultiMapping.inl b/applications/plugins/RigidScale/mapping/RigidScaleToAffineMultiMapping.inl index bc55b84ed1f..d947856a900 100755 --- a/applications/plugins/RigidScale/mapping/RigidScaleToAffineMultiMapping.inl +++ b/applications/plugins/RigidScale/mapping/RigidScaleToAffineMultiMapping.inl @@ -153,7 +153,7 @@ void RigidScaleToAffineMultiMapping::applyJT(const helper::vector< InMa std::cout<<"applyJT(const helper::vector< In1MatrixDeriv*>& /*outConstraint1*/ ,\ const helper::vector< In2MatrixDeriv*>& /*outConstraint2*/ ,\ const helper::vector& /*inConstraint*/)\ - NOT IMPLEMENTED BY " << core::objectmodel::BaseClass::decodeClassName(typeid(*this)) << std::endl; + NOT IMPLEMENTED BY " << helper::NameDecoder::decodeClassName(typeid(*this)) << std::endl; } template diff --git a/applications/plugins/RigidScale/mapping/RigidScaleToRigidMultiMapping.inl b/applications/plugins/RigidScale/mapping/RigidScaleToRigidMultiMapping.inl index 1c13b248cc6..bb3bbeea272 100755 --- a/applications/plugins/RigidScale/mapping/RigidScaleToRigidMultiMapping.inl +++ b/applications/plugins/RigidScale/mapping/RigidScaleToRigidMultiMapping.inl @@ -147,7 +147,7 @@ void RigidScaleToRigidMultiMapping::applyJT(const helper::vector< InMat std::cout<<"applyJT(const helper::vector< In1MatrixDeriv*>& /*outConstraint1*/ ,\ const helper::vector< In2MatrixDeriv*>& /*outConstraint2*/ ,\ const helper::vector& /*inConstraint*/)\ - NOT IMPLEMENTED BY " << core::objectmodel::BaseClass::decodeClassName(typeid(*this)) << std::endl; + NOT IMPLEMENTED BY " << helper::NameDecoder::decodeClassName(typeid(*this)) << std::endl; } template diff --git a/applications/plugins/RigidScale/python/RigidScale/API.py b/applications/plugins/RigidScale/python/RigidScale/API.py index 4debf05b3d4..74e491aa3f7 100755 --- a/applications/plugins/RigidScale/python/RigidScale/API.py +++ b/applications/plugins/RigidScale/python/RigidScale/API.py @@ -315,7 +315,7 @@ def __init__(self, node, filepath, scale3d, offset, name_suffix='', generatedDir self.loader = SofaPython.Tools.meshLoader(self.node, filename=filepath, name='loader', scale3d=concat(scale3d), translation=concat(offset[:3]) , rotation=concat(r), triangulate=True) self.topology = self.node.createObject('MeshTopology', name='topology', src='@loader') self.dofs = self.node.createObject('MechanicalObject', name='dofs', template='Vec3'+template_suffix) - self.triangles = self.node.createObject('TriangleModel', name='model') + self.triangles = self.node.createObject('TriangleCollisionModel', name='model') if generatedDir is None: self.mapping = self.node.createObject('LinearMapping', template='Affine,Vec3'+template_suffix, name='mapping') else: diff --git a/applications/plugins/SceneCreator/src/SceneCreator/SceneCreator.cpp b/applications/plugins/SceneCreator/src/SceneCreator/SceneCreator.cpp index 60f87cfe469..f9f3869a34f 100644 --- a/applications/plugins/SceneCreator/src/SceneCreator/SceneCreator.cpp +++ b/applications/plugins/SceneCreator/src/SceneCreator/SceneCreator.cpp @@ -89,7 +89,7 @@ Node::SPtr createEulerSolverNode(Node::SPtr parent, const std::string& name, co if (scheme == "Explicit") { - simpleapi::createObject(node, "EulerSolver", {{"name","Euler Explicit"}}); + simpleapi::createObject(node, "EulerExplicitSolver", {{"name","Euler Explicit"}}); return node ; } @@ -322,12 +322,13 @@ Node::SPtr createVisualNodeRigid(Node::SPtr parent, BaseObject::SPtr dofRigid, void addCollisionModels(Node::SPtr parent, const std::vector &elements) { std::map alias = { - {"Triangle", "TriangleCollisionModel"}, - {"Line", "LineCollisionModel"}, - {"Point", "PointCollisionModel"}, - {"Sphere", "SphereCollisionModel"}, - {"Capsule", "CapsuleCollisionModel"}, - {"OBB", "OBBCollisionModel"}}; + {"TriangleCollisionModel", "TriangleCollisionModel"}, + {"LineCollisionModel", "LineCollisionModel"}, + {"PointCollisionModel", "PointCollisionModel"}, + {"SphereCollisionModel", "SphereCollisionModel"}, + {"CapsuleCollisionModel", "CapsuleCollisionModel"}, + {"OBBCollisionModel", "OBBCollisionModel"}, + }; for (auto& element : elements) { @@ -424,9 +425,9 @@ simulation::Node::SPtr addCube(simulation::Node::SPtr parent, const std::string& // Add collisions models std::vector colElements; - colElements.push_back("Triangle"); - colElements.push_back("Line"); - colElements.push_back("Point"); + colElements.push_back("TriangleCollisionModel"); + colElements.push_back("LineCollisionModel"); + colElements.push_back("PointCollisionModel"); sofa::modeling::addCollisionModels(cube, colElements); //Node VISUAL @@ -495,7 +496,7 @@ simulation::Node::SPtr addCylinder(simulation::Node::SPtr parent, const std::str {"axis", str(axis)}}); - addCollisionModels(cylinder, {"Triangle", "Line", "Point"}); + addCollisionModels(cylinder, {"TriangleCollisionModel", "LineCollisionModel", "PointCollisionModel"}); //Node VISUAL createVisualNodeVec3(cylinder, dofFEM, "", "red", Deriv3(), Deriv3(), MT_Identity); @@ -557,7 +558,7 @@ simulation::Node::SPtr addSphere(simulation::Node::SPtr parent, const std::strin {"radius", str(radius)}, {"axis", str(axis)}}); - addCollisionModels(sphere, {"Triangle", "Line", "Point"}); + addCollisionModels(sphere, {"TriangleCollisionModel", "LineCollisionModel", "PointCollisionModel"}); createVisualNodeVec3(sphere, dofFEM, "", "red", Deriv3(), Deriv3(), MT_Identity); return sphere; @@ -618,7 +619,7 @@ simulation::Node::SPtr addPlane(simulation::Node::SPtr parent, const std::string {"max", " 0.5 0.5 0.5 "} }); - addCollisionModels(plane, {"Triangle", "Line", "Point"}); + addCollisionModels(plane, {"TriangleCollisionModel", "LineCollisionModel", "PointCollisionModel"}); createVisualNodeVec3(plane, dofPlane, "", "green", Deriv3(), Deriv3(), MT_Identity); return plane; diff --git a/applications/plugins/SixenseHydra/RazerHydraDriver.h b/applications/plugins/SixenseHydra/RazerHydraDriver.h index 4fbb23c10b2..5e75d38db9a 100644 --- a/applications/plugins/SixenseHydra/RazerHydraDriver.h +++ b/applications/plugins/SixenseHydra/RazerHydraDriver.h @@ -41,7 +41,7 @@ #include #include -#include +#include #include #include diff --git a/applications/plugins/SofaAssimp/examples/character_clothes.py b/applications/plugins/SofaAssimp/examples/character_clothes.py index 36ec1d90588..ac58273053a 100644 --- a/applications/plugins/SofaAssimp/examples/character_clothes.py +++ b/applications/plugins/SofaAssimp/examples/character_clothes.py @@ -71,9 +71,9 @@ def createBox(parent): collisionNode.createObject('MeshObjLoader', name='loader', filename=mesh_path + 'cube.obj') collisionNode.createObject('MeshTopology', position='@loader.position', edges='@loader.edges', triangles='@loader.triangles', quads='@loader.quads', tetrahedra='@loader.tetras', hexahedra='@loader.hexas') collisionNode.createObject('MechanicalObject', template='Vec3d', name='vertices', position='@loader.position') - collisionNode.createObject('Triangle', template='Vec3d') - collisionNode.createObject('Line', template='Vec3d') - collisionNode.createObject('Point', template='Vec3d') + collisionNode.createObject('TriangleCollisionModel', template='Vec3d') + collisionNode.createObject('LineCollisionModel', template='Vec3d') + collisionNode.createObject('PointCollisionModel', template='Vec3d') collisionNode.createObject('RigidMapping', template='Rigid,Vec3d', input='@../model', output='@./vertices') @@ -91,9 +91,9 @@ def createChlothes(parent): parent.createObject('UniformMass') parent.createObject('MeshTopology', name='mesh', position='@loader.position', edges='@loader.edges', triangles='@loader.triangles', quads='@loader.quads', tetrahedra='@loader.tetras', hexahedra='@loader.hexas') - parent.createObject('Triangle', template='Vec3d', name='models', proximity='0', selfCollision=clothSelfCollision) - parent.createObject('Line', template='Vec3d', name='models', proximity='0', selfCollision=clothSelfCollision) - parent.createObject('Point', template='Vec3d', name='models', proximity='0', selfCollision=clothSelfCollision) + parent.createObject('TriangleCollisionModel', template='Vec3d', name='models', proximity='0', selfCollision=clothSelfCollision) + parent.createObject('LineCollisionModel', template='Vec3d', name='models', proximity='0', selfCollision=clothSelfCollision) + parent.createObject('PointCollisionModel', template='Vec3d', name='models', proximity='0', selfCollision=clothSelfCollision) #parent.createObject('ConstantForceField', force='9.81 -9.81 9.81', points='0') #0 24 599 623 #parent.createObject('ConstantForceField', force='-9.81 -9.81 9.81', points='24') diff --git a/applications/plugins/SofaCUDA/sofa/gpu/cuda/CudaCollision.cpp b/applications/plugins/SofaCUDA/sofa/gpu/cuda/CudaCollision.cpp index 0f4c3222253..b363d245d5b 100644 --- a/applications/plugins/SofaCUDA/sofa/gpu/cuda/CudaCollision.cpp +++ b/applications/plugins/SofaCUDA/sofa/gpu/cuda/CudaCollision.cpp @@ -42,7 +42,7 @@ #include #include #include -#include +#include #include #include #include diff --git a/applications/plugins/SofaCUDA/sofa/gpu/cuda/CudaCollisionDistanceGrid.cpp b/applications/plugins/SofaCUDA/sofa/gpu/cuda/CudaCollisionDistanceGrid.cpp index 13694dfe2a7..b7ff3f7ea4f 100644 --- a/applications/plugins/SofaCUDA/sofa/gpu/cuda/CudaCollisionDistanceGrid.cpp +++ b/applications/plugins/SofaCUDA/sofa/gpu/cuda/CudaCollisionDistanceGrid.cpp @@ -41,7 +41,7 @@ #include #include #include -#include +#include #include #include diff --git a/applications/plugins/SofaCUDA/sofa/gpu/cuda/CudaMatrix.h b/applications/plugins/SofaCUDA/sofa/gpu/cuda/CudaMatrix.h index 10c878484cf..4e3d8d60555 100644 --- a/applications/plugins/SofaCUDA/sofa/gpu/cuda/CudaMatrix.h +++ b/applications/plugins/SofaCUDA/sofa/gpu/cuda/CudaMatrix.h @@ -480,7 +480,7 @@ class CudaMatrix DEBUG_OUT_M(SPACEN << "copyToHost" << std::endl); //#ifndef NDEBUG - if (mycudaVerboseLevel>=LOG_TRACE) std::cout << "CUDA: GPU->CPU copy of "<=LOG_TRACE) std::cout << "CUDA: GPU->CPU copy of "<=LOG_TRACE) std::cout << "CUDA: CPU->GPU copy of "<=LOG_TRACE) std::cout << "CUDA: CPU->GPU copy of "< +#include #endif // SOFACUDA_HAVE_SOFA_GL == 1 namespace sofa @@ -89,13 +89,13 @@ public : static void memcpyHostToDevice(int d, device_pointer dDestPointer, const host_pointer hSrcPointer, size_t n) { - if (mycudaVerboseLevel>=LOG_TRACE) std::cout << "CUDA: CPU->GPU copy of "<=LOG_TRACE) std::cout << "CUDA: CPU->GPU copy of "<=LOG_TRACE) std::cout << "CUDA: GPU->CPU copy of "<=LOG_TRACE) std::cout << "CUDA: GPU->CPU copy of "< #include #include -#include +#include namespace sofa { @@ -37,8 +37,6 @@ namespace cuda int CudaPointCollisionModelClass = core::RegisterObject("GPU-based point collision model using CUDA") .add< CudaPointCollisionModel >() - .addAlias("CudaPoint") - .addAlias("CudaPointModel") ; using namespace defaulttype; diff --git a/applications/plugins/SofaCUDA/sofa/gpu/cuda/CudaPointModel.h b/applications/plugins/SofaCUDA/sofa/gpu/cuda/CudaPointModel.h index 9a7419758ab..c39e937a86b 100644 --- a/applications/plugins/SofaCUDA/sofa/gpu/cuda/CudaPointModel.h +++ b/applications/plugins/SofaCUDA/sofa/gpu/cuda/CudaPointModel.h @@ -31,13 +31,7 @@ #include #include -namespace sofa -{ - -namespace gpu -{ - -namespace cuda +namespace sofa::gpu::cuda { using namespace sofa::defaulttype; @@ -115,13 +109,6 @@ inline std::size_t CudaPoint::getSize() return model->groupSize.getValue(); } -using CudaPointModel [[deprecated("The CudaPointModel is now deprecated, please use CudaPointCollisionModel instead. Compatibility stops at v20.06")]] = CudaPointCollisionModel; - - -} // namespace cuda - -} // namespace gpu - -} // namespace sofa +} // namespace sofa::gpu::cuda #endif diff --git a/applications/plugins/SofaCUDA/sofa/gpu/cuda/CudaSphereModel.h b/applications/plugins/SofaCUDA/sofa/gpu/cuda/CudaSphereModel.h index 2ae6051cf9b..d405ab2d8b7 100644 --- a/applications/plugins/SofaCUDA/sofa/gpu/cuda/CudaSphereModel.h +++ b/applications/plugins/SofaCUDA/sofa/gpu/cuda/CudaSphereModel.h @@ -35,7 +35,6 @@ namespace gpu namespace cuda { -using CudaSphereModel [[deprecated("The CudaSphereModel is now deprecated, please use sofa::component::collision::SphereCollisionModel instead. Compatibility stops at v20.06")]] = sofa::component::collision::SphereCollisionModel; using CudaSphere = sofa::component::collision::TSphere; diff --git a/applications/plugins/SofaCUDA/sofa/gpu/cuda/CudaTypes.h b/applications/plugins/SofaCUDA/sofa/gpu/cuda/CudaTypes.h index af7ade5fd08..62970eb01b8 100644 --- a/applications/plugins/SofaCUDA/sofa/gpu/cuda/CudaTypes.h +++ b/applications/plugins/SofaCUDA/sofa/gpu/cuda/CudaTypes.h @@ -24,7 +24,7 @@ #include "CudaCommon.h" #include "mycuda.h" -#include +#include #include #include #include diff --git a/applications/plugins/SofaCarving/SofaCarving_test/SofaCarving_test.cpp b/applications/plugins/SofaCarving/SofaCarving_test/SofaCarving_test.cpp index b06674d639d..81751d92820 100644 --- a/applications/plugins/SofaCarving/SofaCarving_test/SofaCarving_test.cpp +++ b/applications/plugins/SofaCarving/SofaCarving_test/SofaCarving_test.cpp @@ -173,13 +173,13 @@ bool SofaCarving_test::createScene(const std::string& carvingDistance) { "output", "@Container" } }); - createObject(nodeSurface, "TriangleSet", { + createObject(nodeSurface, "TriangleCollisionModel", { { "name", "Triangle Model" }, { "tags", "CarvingSurface" }, { "group", "0" } }); - createObject(nodeSurface, "PointSet", { + createObject(nodeSurface, "PointCollisionModel", { { "name", "Point Model" }, { "tags", "CarvingSurface" }, { "group", "0" } diff --git a/applications/plugins/SofaOpenCL/OpenCLMemoryManager.h b/applications/plugins/SofaOpenCL/OpenCLMemoryManager.h index 41e32736965..82b00816b43 100644 --- a/applications/plugins/SofaOpenCL/OpenCLMemoryManager.h +++ b/applications/plugins/SofaOpenCL/OpenCLMemoryManager.h @@ -114,14 +114,14 @@ class OpenCLMemoryManager: public sofa::helper::MemoryManager static void memcpyHostToDevice(int d, device_pointer dDestPointer,const host_pointer hSrcPointer, size_t n) { DEBUG_TEXT("OpenCLMemoryManager::memcpyHostToDevice"); - if (myopenclVerboseLevel>=LOG_TRACE) std::cout << "OPENCL: CPU->GPU copy of "<=LOG_TRACE) std::cout << "OPENCL: CPU->GPU copy of "<=LOG_TRACE) std::cout << "OPENCL: GPU->CPU copy of "<=LOG_TRACE) std::cout << "OPENCL: GPU->CPU copy of "<" - PUBLIC "$" PUBLIC "$" ) diff --git a/applications/plugins/SofaPython/SofaPython_test/python/test_BindingSofa.py b/applications/plugins/SofaPython/SofaPython_test/python/test_BindingSofa.py index f6660c9af0c..5b1d7d8713e 100644 --- a/applications/plugins/SofaPython/SofaPython_test/python/test_BindingSofa.py +++ b/applications/plugins/SofaPython/SofaPython_test/python/test_BindingSofa.py @@ -4,6 +4,6 @@ from SofaTest import * def createScene(rootNode): print("Aliases: "+str(Sofa.getAliasesFor("VisualModel"))) - print("Aliases: "+str(Sofa.getAliasesFor("SphereModel"))) + print("Aliases: "+str(Sofa.getAliasesFor("SphereCollisionModel"))) print("Components for target: "+str(Sofa.getComponentsFromTarget("SofaMiscCollision"))) ASSERT_EQ(type(Sofa.getComponentsFromTarget("SofaMiscCollision")), list) diff --git a/applications/plugins/SofaPython/SofaPython_test/python_test_list.cpp b/applications/plugins/SofaPython/SofaPython_test/python_test_list.cpp index 6074041ddf2..3b7fcc1de24 100644 --- a/applications/plugins/SofaPython/SofaPython_test/python_test_list.cpp +++ b/applications/plugins/SofaPython/SofaPython_test/python_test_list.cpp @@ -1,4 +1,4 @@ -#include +#include namespace sofa { diff --git a/applications/plugins/SofaPython/compat/SofaTest/Python_test.h b/applications/plugins/SofaPython/compat/SofaTest/Python_test.h deleted file mode 100644 index 95bc8551a8d..00000000000 --- a/applications/plugins/SofaPython/compat/SofaTest/Python_test.h +++ /dev/null @@ -1,25 +0,0 @@ -/****************************************************************************** -* SOFA, Simulation Open-Framework Architecture * -* (c) 2006 INRIA, USTL, UJF, CNRS, MGH * -* * -* This program is free software; you can redistribute it and/or modify it * -* under the terms of the GNU Lesser General Public License as published by * -* the Free Software Foundation; either version 2.1 of the License, or (at * -* your option) any later version. * -* * -* This program is distributed in the hope that it will be useful, but WITHOUT * -* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or * -* FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License * -* for more details. * -* * -* You should have received a copy of the GNU Lesser General Public License * -* along with this program. If not, see . * -******************************************************************************* -* Authors: The SOFA Team and external contributors (see Authors.txt) * -* * -* Contact information: contact@sofa-framework.org * -******************************************************************************/ -#include - -SOFA_DEPRECATED_HEADER(v21.06, "SofaPython/Python_test.h") - diff --git a/applications/plugins/SofaPython/doc/SofaDays_oct2013/3_OneParticle/particle.py b/applications/plugins/SofaPython/doc/SofaDays_oct2013/3_OneParticle/particle.py index b5968b7ea35..665ea50c692 100644 --- a/applications/plugins/SofaPython/doc/SofaDays_oct2013/3_OneParticle/particle.py +++ b/applications/plugins/SofaPython/doc/SofaDays_oct2013/3_OneParticle/particle.py @@ -4,7 +4,7 @@ def oneParticleSample(node): node.name='oneParticleSample' node.gravity=[0.0, -9.81, 0.0] - solver = node.createObject('EulerSolver', name='solver') + solver = node.createObject('EulerExplicitSolver', name='solver') solver.printLog = 'false' node.addObject(solver); particule_node = node.createChild('particle_node') diff --git a/applications/plugins/SofaPython/doc/SofaDays_oct2013/4_ObjectCreator/ObjectCreator.py b/applications/plugins/SofaPython/doc/SofaDays_oct2013/4_ObjectCreator/ObjectCreator.py index a234ff597a3..d0a724441f7 100644 --- a/applications/plugins/SofaPython/doc/SofaDays_oct2013/4_ObjectCreator/ObjectCreator.py +++ b/applications/plugins/SofaPython/doc/SofaDays_oct2013/4_ObjectCreator/ObjectCreator.py @@ -25,9 +25,9 @@ def createDragon(parentNode,name,x,y,z,color): SurfNode.createObject('MeshObjLoader', name="loader", filename="mesh/dragon.obj") SurfNode.createObject('Mesh', src="@loader") SurfNode.createObject('MechanicalObject', src="@loader", dx=x, dy=y, dz=z) - SurfNode.createObject('Triangle') - SurfNode.createObject('Line') - SurfNode.createObject('Point') + SurfNode.createObject('TriangleCollisionModel') + SurfNode.createObject('LineCollisionModel') + SurfNode.createObject('PointCollisionModel') SurfNode.createObject('BarycentricMapping') return node @@ -61,9 +61,9 @@ def createArmadillo(parentNode,name,x,y,z,color): SurfNode.createObject('MeshObjLoader', name="loader", filename="mesh/Armadillo_verysimplified.obj") SurfNode.createObject('Mesh', src="@loader") SurfNode.createObject('MechanicalObject', src="@loader", dx=x, dy=y, dz=z) - SurfNode.createObject('Triangle') - SurfNode.createObject('Line') - SurfNode.createObject('Point') + SurfNode.createObject('TriangleCollisionModel') + SurfNode.createObject('LineCollisionModel') + SurfNode.createObject('PointCollisionModel') SurfNode.createObject('BarycentricMapping') return node diff --git a/applications/plugins/SofaPython/doc/SofaDays_oct2013/7_BoxCanon/ObjectCreator.py b/applications/plugins/SofaPython/doc/SofaDays_oct2013/7_BoxCanon/ObjectCreator.py index 5d7d8afdef9..b8919c4c44d 100644 --- a/applications/plugins/SofaPython/doc/SofaDays_oct2013/7_BoxCanon/ObjectCreator.py +++ b/applications/plugins/SofaPython/doc/SofaDays_oct2013/7_BoxCanon/ObjectCreator.py @@ -25,9 +25,9 @@ def createDragon(parentNode,name,x,y,z,color): SurfNode.createObject('MeshObjLoader', name="loader", filename="mesh/dragon.obj") SurfNode.createObject('Mesh', src="@loader") SurfNode.createObject('MechanicalObject', src="@loader", dx=x, dy=y, dz=z) - SurfNode.createObject('Triangle') - SurfNode.createObject('Line') - SurfNode.createObject('Point') + SurfNode.createObject('TriangleCollisionModel') + SurfNode.createObject('LineCollisionModel') + SurfNode.createObject('PointCollisionModel') SurfNode.createObject('BarycentricMapping') return node @@ -61,9 +61,9 @@ def createArmadillo(parentNode,name,x,y,z,color): SurfNode.createObject('MeshObjLoader', name="loader", filename="mesh/Armadillo_verysimplified.obj") SurfNode.createObject('Mesh', src="@loader") SurfNode.createObject('MechanicalObject', src="@loader", dx=x, dy=y, dz=z) - SurfNode.createObject('Triangle') - SurfNode.createObject('Line') - SurfNode.createObject('Point') + SurfNode.createObject('TriangleCollisionModel') + SurfNode.createObject('LineCollisionModel') + SurfNode.createObject('PointCollisionModel') SurfNode.createObject('BarycentricMapping') return node @@ -92,9 +92,9 @@ def createCube(parentNode,name,x,y,z,vx,vy,vz,color): SurfNode.createObject('MeshObjLoader',name='loader',filename='mesh/PokeCube.obj') SurfNode.createObject('Mesh',src='@loader') SurfNode.createObject('MechanicalObject',src='@loader') - SurfNode.createObject('Triangle') - SurfNode.createObject('Line') - SurfNode.createObject('Point') + SurfNode.createObject('TriangleCollisionModel') + SurfNode.createObject('LineCollisionModel') + SurfNode.createObject('PointCollisionModel') SurfNode.createObject('RigidMapping') return node diff --git a/applications/plugins/SofaPython/doc/SofaDays_oct2013/7_BoxCanon/controller.py b/applications/plugins/SofaPython/doc/SofaDays_oct2013/7_BoxCanon/controller.py index 14d64d728ba..3e24a936022 100644 --- a/applications/plugins/SofaPython/doc/SofaDays_oct2013/7_BoxCanon/controller.py +++ b/applications/plugins/SofaPython/doc/SofaDays_oct2013/7_BoxCanon/controller.py @@ -25,22 +25,22 @@ def onKeyPressed(self,k): # LEFT key : left if ord(k)==18: print 'Cube launched (left)!' - obj = ObjectCreator.createCube(self.rootNode,'Cube',-50,50,0,60,fireAngle,0,'blue') + obj = ObjectCreator.createCube(self.rootNode,'CubeCollisionModel',-50,50,0,60,fireAngle,0,'blue') #obj.findData('restVelocity').value=[0.0, 20.0, 0.0 ] # RIGHT key : right if ord(k)==20: print 'Cube launched (right)!' - obj = ObjectCreator.createCube(self.rootNode,'Cube',50,50,0,-60,fireAngle,0,'magenta') + obj = ObjectCreator.createCube(self.rootNode,'CubeCollisionModel',50,50,0,-60,fireAngle,0,'magenta') #obj.findData('restVelocity').value=[0.0, 20.0, 0.0 ] # UP key : front if ord(k)==19: print 'Cube launched (front)!' - obj = ObjectCreator.createCube(self.rootNode,'Cube',0,50,50,0,fireAngle,-60,'yellow') + obj = ObjectCreator.createCube(self.rootNode,'CubeCollisionModel',0,50,50,0,fireAngle,-60,'yellow') #obj.findData('restVelocity').value=[0.0, 20.0, 0.0 ] # DOWN key : rear if ord(k)==21: print 'Cube launched (back)!' - obj = ObjectCreator.createCube(self.rootNode,'Cube',0,50,-50,0,fireAngle,60,'cyan') + obj = ObjectCreator.createCube(self.rootNode,'CubeCollisionModel',0,50,-50,0,fireAngle,60,'cyan') #obj.findData('restVelocity').value=[0.0, 20.0, 0.0 ] return 0 diff --git a/applications/plugins/SofaPython/doc/SofaDays_oct2013/8_PythonScene/tuto8.py b/applications/plugins/SofaPython/doc/SofaDays_oct2013/8_PythonScene/tuto8.py index 5188f155fe1..ee465ed92a1 100644 --- a/applications/plugins/SofaPython/doc/SofaDays_oct2013/8_PythonScene/tuto8.py +++ b/applications/plugins/SofaPython/doc/SofaDays_oct2013/8_PythonScene/tuto8.py @@ -21,9 +21,9 @@ def createArmadillo(parentNode,name,x,y,z,color): SurfNode.createObject('MeshObjLoader', name='loader', filename='mesh/Armadillo_verysimplified.obj') SurfNode.createObject('Mesh',src='@loader') SurfNode.createObject('MechanicalObject', name='meca', src='@loader') - SurfNode.createObject('Triangle') - SurfNode.createObject('Line') - SurfNode.createObject('Point') + SurfNode.createObject('TriangleCollisionModel') + SurfNode.createObject('LineCollisionModel') + SurfNode.createObject('PointCollisionModel') SurfNode.createObject('BarycentricMapping') return node @@ -65,9 +65,9 @@ def createScene(rootNode): floorNode.createObject('MeshObjLoader', name='loader', filename='mesh/floor2b.obj') floorNode.createObject('Mesh', src='@loader') floorNode.createObject('MechanicalObject', src='@loader') - floorNode.createObject('Triangle', name='Floor', simulated=0, moving=0) - floorNode.createObject('Line', name='Floor', simulated=0, moving=0) - floorNode.createObject('Point', name='Floor', simulated=0, moving=0) + floorNode.createObject('TriangleCollisionModel', name='Floor', simulated=0, moving=0) + floorNode.createObject('LineCollisionModel', name='Floor', simulated=0, moving=0) + floorNode.createObject('PointCollisionModel', name='Floor', simulated=0, moving=0) floorNode.createObject('OglModel', name='FloorV', filename='mesh/floor2b.obj', texturename='textures/floor.bmp') # make some dynamic meshes spawn... diff --git a/applications/plugins/SofaPython/examples/Components/collision/GlobalCollision.py b/applications/plugins/SofaPython/examples/Components/collision/GlobalCollision.py index 58bbeb6f431..cc96ebe13a1 100644 --- a/applications/plugins/SofaPython/examples/Components/collision/GlobalCollision.py +++ b/applications/plugins/SofaPython/examples/Components/collision/GlobalCollision.py @@ -26,7 +26,7 @@ def createGraph(self,node): floorNode.createObject("UniformMass", name="floorMass") mec.applyScale(50,50,50) floorNode.createObject('TriangleCollisionModel', name='Floor', simulated=0, moving=0) - #floorNode.createObject('Line', name='Floor', simulated=0, moving=0) + #floorNode.createObject('LineCollisionModel', name='Floor', simulated=0, moving=0) floorNode.createObject('MeshObjLoader', name='bowlLoader', filename='mesh/SaladBowl.obj') floorNode.createObject('OglModel', name='FloorV', src='@bowlLoader',texturename='textures/texture.bmp')#, texturename='textures/SaladBowl$.bmp') floorNode.createObject("FixedConstraint", name="fixedConstraint", fixAll=1) diff --git a/applications/plugins/SofaPython/examples/Components/collision/GlobalSaladCollision.py b/applications/plugins/SofaPython/examples/Components/collision/GlobalSaladCollision.py index 9a52539c203..d2f9f1ba237 100644 --- a/applications/plugins/SofaPython/examples/Components/collision/GlobalSaladCollision.py +++ b/applications/plugins/SofaPython/examples/Components/collision/GlobalSaladCollision.py @@ -25,7 +25,7 @@ def createGraph(self,node): mec=floorNode.createObject('MechanicalObject', src='@loader',name='the_bol') mec.applyScale(50,50,50) floorNode.createObject('TriangleCollisionModel', name='Floor', simulated=0, moving=0) - #floorNode.createObject('Line', name='Floor', simulated=0, moving=0) + #floorNode.createObject('LineCollisionModel', name='Floor', simulated=0, moving=0) floorNode.createObject('MeshObjLoader', name='bowlLoader', filename='mesh/SaladBowl.obj') floorNode.createObject('OglModel', name='FloorV', src='@bowlLoader',texturename='textures/texture.bmp')#, texturename='textures/SaladBowl$.bmp') floorNode.createObject('FixedConstraint',fixAll=True) diff --git a/applications/plugins/SofaPython/examples/Components/collision/PrimitiveCreation.py b/applications/plugins/SofaPython/examples/Components/collision/PrimitiveCreation.py index a4eb41f2699..761d754fc97 100644 --- a/applications/plugins/SofaPython/examples/Components/collision/PrimitiveCreation.py +++ b/applications/plugins/SofaPython/examples/Components/collision/PrimitiveCreation.py @@ -126,7 +126,7 @@ def createOBB(parentNode,name,x,y,z,*args): meca = node.createObject('MechanicalObject',name='rigidDOF',template='Rigid',position=str(x)+' '+str(y)+' '+str(z)+' 0 0 0 1',velocity='0 0 '+str(falling_speed)+' 0 0 0 1') mass = node.createObject('UniformMass',name='mass',totalMass=1) - node.createObject('TOBBModel',template='Rigid',name='OBB_model',extents=str(a)+' '+str(b)+' '+str(c)) + node.createObject('OBBCollisionModel',template='Rigid',name='OBB_model',extents=str(a)+' '+str(b)+' '+str(c)) return node diff --git a/applications/plugins/SofaPython/examples/DAG.py b/applications/plugins/SofaPython/examples/DAG.py index edfdcf2351c..b893e5af410 100644 --- a/applications/plugins/SofaPython/examples/DAG.py +++ b/applications/plugins/SofaPython/examples/DAG.py @@ -27,9 +27,9 @@ def createDragon(parentnode,name,color): SurfNode.createObject('MeshObjLoader', name='loader', filename='mesh/dragon.obj') SurfNode.createObject('Mesh',src='@loader') SurfNode.createObject('MechanicalObject',src='@loader') - SurfNode.createObject('Triangle') - SurfNode.createObject('Line') - SurfNode.createObject('Point') + SurfNode.createObject('TriangleCollisionModel') + SurfNode.createObject('LineCollisionModel') + SurfNode.createObject('PointCollisionModel') SurfNode.createObject('BarycentricMapping') return node diff --git a/applications/plugins/SofaPython/examples/ExampleController.py b/applications/plugins/SofaPython/examples/ExampleController.py index 0289be373af..8de9bbc8bc7 100755 --- a/applications/plugins/SofaPython/examples/ExampleController.py +++ b/applications/plugins/SofaPython/examples/ExampleController.py @@ -31,7 +31,7 @@ def testNodes(node): def oneParticleSample(node): node.findData('name').value='oneParticleSample' node.findData('gravity').value=[0.0, -9.81, 0.0] - solver = node.createObject('EulerSolver',printLog='false') + solver = node.createObject('EulerExplicitSolver',printLog='false') particule_node = node.createChild('particle_node') particle = particule_node.createObject('MechanicalObject') particle.resize(1) diff --git a/applications/plugins/SofaPython/examples/sceneDataIO_read.py b/applications/plugins/SofaPython/examples/sceneDataIO_read.py index b44c390c571..0f84fc2ed15 100644 --- a/applications/plugins/SofaPython/examples/sceneDataIO_read.py +++ b/applications/plugins/SofaPython/examples/sceneDataIO_read.py @@ -78,7 +78,7 @@ def createGraph(self, root): contactNode.createObject('MeshTopology', name='topo', src='@../grid') contactNode.createObject('MechanicalObject', name='DOFs') contactNode.createObject('UniformMass', totalMass=1) - contactNode.createObject('TriangleModel') + contactNode.createObject('TriangleCollisionModel') contactNode.createObject('LinearMapping', template='Affine,Vec3d') visuNode = contactNode.createChild('visual') diff --git a/applications/plugins/SofaPython/examples/sceneDataIO_write.py b/applications/plugins/SofaPython/examples/sceneDataIO_write.py index 277e3092681..628ddcac235 100644 --- a/applications/plugins/SofaPython/examples/sceneDataIO_write.py +++ b/applications/plugins/SofaPython/examples/sceneDataIO_write.py @@ -77,7 +77,7 @@ def createGraph(self, root): contactNode.createObject('MeshTopology', name='topo', src='@../grid') contactNode.createObject('MechanicalObject', name='DOFs') contactNode.createObject('UniformMass', totalMass=1) - contactNode.createObject('TriangleModel') + contactNode.createObject('TriangleCollisionModel') contactNode.createObject('LinearMapping', template='Affine,Vec3d') visuNode = contactNode.createChild('visual') diff --git a/applications/plugins/SofaSimpleGUI/SofaGL.h b/applications/plugins/SofaSimpleGUI/SofaGL.h index 46f9cf275d1..b2f1bf404e2 100644 --- a/applications/plugins/SofaSimpleGUI/SofaGL.h +++ b/applications/plugins/SofaSimpleGUI/SofaGL.h @@ -4,7 +4,7 @@ #include #include "SofaScene.h" #include -#include +#include #include "PickedPoint.h" #include "SpringInteractor.h" diff --git a/applications/plugins/SofaSimpleGUI/VisualPickVisitor.cpp b/applications/plugins/SofaSimpleGUI/VisualPickVisitor.cpp index 595cc4491ed..3cc8ac4efdb 100644 --- a/applications/plugins/SofaSimpleGUI/VisualPickVisitor.cpp +++ b/applications/plugins/SofaSimpleGUI/VisualPickVisitor.cpp @@ -4,7 +4,7 @@ using std::cout; using std::cerr; using std::endl; -#include +#include #include #include #include diff --git a/applications/plugins/SofaTest/CMakeLists.txt b/applications/plugins/SofaTest/CMakeLists.txt index eaddcf8151f..2f8ef42bce9 100644 --- a/applications/plugins/SofaTest/CMakeLists.txt +++ b/applications/plugins/SofaTest/CMakeLists.txt @@ -21,8 +21,6 @@ list(APPEND HEADER_FILES MultiMapping_test.h Multi2Mapping_test.h PrimitiveCreation.h - TestMessageHandler.h - #LogMessage.h ) list(APPEND SOURCE_FILES Elasticity_test.cpp @@ -31,16 +29,6 @@ list(APPEND SOURCE_FILES AffinePatch_test.cpp ) -if(SOFA_WITH_DEPRECATED_COMPONENTS) - list(APPEND HEADER_FILES - Elasticity_test_deprecated.h - Elasticity_test_deprecated.inl - ) - list(APPEND SOURCE_FILES - Elasticity_test_deprecated.cpp - ) -endif() - sofa_find_package(SofaFramework REQUIRED) sofa_find_package(SofaMiscForceField REQUIRED) sofa_find_package(SofaMiscMapping REQUIRED) diff --git a/applications/plugins/SofaTest/Elasticity_test_deprecated.cpp b/applications/plugins/SofaTest/Elasticity_test_deprecated.cpp deleted file mode 100644 index 4e81d87eb34..00000000000 --- a/applications/plugins/SofaTest/Elasticity_test_deprecated.cpp +++ /dev/null @@ -1,8 +0,0 @@ -#include "Elasticity_test_deprecated.inl" -namespace sofa { - -using namespace sofa::defaulttype; - -template struct SOFA_SOFATEST_API Elasticity_test_deprecated; - -} diff --git a/applications/plugins/SofaTest/Elasticity_test_deprecated.h b/applications/plugins/SofaTest/Elasticity_test_deprecated.h deleted file mode 100644 index 64f651e195b..00000000000 --- a/applications/plugins/SofaTest/Elasticity_test_deprecated.h +++ /dev/null @@ -1,55 +0,0 @@ -/****************************************************************************** -* SOFA, Simulation Open-Framework Architecture * -* (c) 2006 INRIA, USTL, UJF, CNRS, MGH * -* * -* This program is free software; you can redistribute it and/or modify it * -* under the terms of the GNU General Public License as published by the Free * -* Software Foundation; either version 2 of the License, or (at your option) * -* any later version. * -* * -* This program is distributed in the hope that it will be useful, but WITHOUT * -* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or * -* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for * -* more details. * -* * -* You should have received a copy of the GNU General Public License along * -* with this program. If not, see . * -******************************************************************************* -* Authors: The SOFA Team and external contributors (see Authors.txt) * -* * -* Contact information: contact@sofa-framework.org * -******************************************************************************/ -#ifndef SOFA_Elasticity_test_deprecated_H -#define SOFA_Elasticity_test_deprecated_H - - -#include "Elasticity_test.h" - -namespace sofa { - -template< class DataTypes> -struct SOFA_SOFATEST_API Elasticity_test_deprecated: public Elasticity_test -{ - typedef component::container::MechanicalObject DOFs; - typedef typename DOFs::Coord Coord; - typedef typename DOFs::Deriv Deriv; - -/// Create sun-planet system -simulation::Node::SPtr createSunPlanetSystem( - simulation::Node::SPtr root, - double mSun, - double mPlanet, - double g, - Coord xSun, - Deriv vSun, - Coord xPlanet, - Deriv vPlanet); - -}; - - - - -} // namespace sofa - -#endif diff --git a/applications/plugins/SofaTest/Elasticity_test_deprecated.inl b/applications/plugins/SofaTest/Elasticity_test_deprecated.inl deleted file mode 100644 index 5ea6092fe8e..00000000000 --- a/applications/plugins/SofaTest/Elasticity_test_deprecated.inl +++ /dev/null @@ -1,120 +0,0 @@ -/****************************************************************************** -* SOFA, Simulation Open-Framework Architecture * -* (c) 2006 INRIA, USTL, UJF, CNRS, MGH * -* * -* This program is free software; you can redistribute it and/or modify it * -* under the terms of the GNU General Public License as published by the Free * -* Software Foundation; either version 2 of the License, or (at your option) * -* any later version. * -* * -* This program is distributed in the hope that it will be useful, but WITHOUT * -* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or * -* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for * -* more details. * -* * -* You should have received a copy of the GNU General Public License along * -* with this program. If not, see . * -******************************************************************************* -* Authors: The SOFA Team and external contributors (see Authors.txt) * -* * -* Contact information: contact@sofa-framework.org * -******************************************************************************/ -#ifndef SOFA_Elasticity_test_deprecated_INL -#define SOFA_Elasticity_test_deprecated_INL - -#include "Elasticity_test_deprecated.h" - -// Solvers -#include -#include -#include - -// Box roi -#include -#include -#include - -// Constraint -#include -#include -#include -#include - -// ForceField -#include -#include - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -namespace sofa -{ - -typedef component::container::MechanicalObject MechanicalObject3; -typedef component::projectiveconstraintset::FixedConstraint FixedConstraint3; -typedef component::mass::UniformMass UniformMass3; - -template -simulation::Node::SPtr Elasticity_test_deprecated::createSunPlanetSystem( - simulation::Node::SPtr root, - double mSun, - double mPlanet, - double g, - Coord xSun, - Deriv vSun, - Coord xPlanet, - Deriv vPlanet) -{ - -// Mechanical object with 2 dofs: first sun, second planet -MechanicalObject3::SPtr sunPlanet_dof = modeling::addNew(root,"sunPlanet_MO"); - -// Set position and velocity -sunPlanet_dof->resize(2); -// Position -MechanicalObject3::VecCoord positions(2); -positions[0] = xSun; -positions[1]= xPlanet; -MechanicalObject3::WriteVecCoord xdof = sunPlanet_dof->writePositions(); -copyToData( xdof, positions ); -// Velocity -MechanicalObject3::VecDeriv velocities(2); -velocities[0] = vSun; -velocities[1]= vPlanet; -MechanicalObject3::WriteVecDeriv vdof = sunPlanet_dof->writeVelocities(); -copyToData( vdof, velocities ); - -// Fix sun -FixedConstraint3::SPtr fixed = modeling::addNew(root,"FixedSun"); -fixed->addConstraint(0); - -// Uniform Mass -UniformMass3::SPtr massPtr = modeling::addNew(root,"mass"); -massPtr->d_totalMass.setValue(mPlanet + mSun); - -// Lennard Jones Force Field -//TODO: Find another FF to add in this test. If Sympletic solver are not deprecated. Erik STC #4 -typename component::forcefield::LennardJonesForceField::SPtr ff = - modeling::addNew >(root); -// Set froce field parameters -ff->setAlpha(1); -ff->setBeta(-1); -ff->setAInit(mPlanet*mSun*g); - -return root; - -} - - -}// sofa - -#endif - diff --git a/applications/plugins/SofaTest/InitPlugin_test.h b/applications/plugins/SofaTest/InitPlugin_test.h index 45e80d24e12..f79c0bdeb81 100644 --- a/applications/plugins/SofaTest/InitPlugin_test.h +++ b/applications/plugins/SofaTest/InitPlugin_test.h @@ -106,7 +106,7 @@ The SofaTest plugin has a python API giving a Controller. You can write a Sofa s - Test a pure python function (independent from SOFA) You simply need to create a python script with a function "run()" return the test result as a boolean. -Your python scripts must be added to the gtest framework with the SofaTest/Python_test.h API to be executed automatically +Your python scripts must be added to the gtest framework with the SofaPython/Python_test.h API to be executed automatically Note that arguments can be given, so the same script can be called with several parameters (accessible as argc/argv on the python side). Have a look to SofaTest_test for an example. diff --git a/applications/plugins/SofaTest/SofaTest_test/python_test_list.cpp b/applications/plugins/SofaTest/SofaTest_test/python_test_list.cpp index 6fc58ab74e6..d21d72248f6 100644 --- a/applications/plugins/SofaTest/SofaTest_test/python_test_list.cpp +++ b/applications/plugins/SofaTest/SofaTest_test/python_test_list.cpp @@ -1,4 +1,4 @@ -#include +#include namespace sofa { diff --git a/applications/plugins/SofaTest/SofaTest_test/scenes/damping.py b/applications/plugins/SofaTest/SofaTest_test/scenes/damping.py index d3bb30ea0b5..3b5bd86d9c8 100644 --- a/applications/plugins/SofaTest/SofaTest_test/scenes/damping.py +++ b/applications/plugins/SofaTest/SofaTest_test/scenes/damping.py @@ -108,7 +108,7 @@ def createScene(node): rigidFile.write( 'cntr 0 0 0\n' ) rigidFile.close() - #node.createObject('EulerSolver',name='odesolver') + #node.createObject('EulerExplicitSolver',name='odesolver') #node.createObject('RequiredPlugin', pluginName = 'Compliant') #node.createObject('CompliantImplicitSolver',name='odesolver',stabilization='0') #node.createObject('LDLTSolver',name = 'numsolver') diff --git a/applications/plugins/SofaTest/TestMessageHandler.h b/applications/plugins/SofaTest/TestMessageHandler.h deleted file mode 100644 index e74f7adad3c..00000000000 --- a/applications/plugins/SofaTest/TestMessageHandler.h +++ /dev/null @@ -1,4 +0,0 @@ -//TODO(dmarchal 2017-10-20) Remove this test handler in 6/12 month. -/// This one is kept only for a transitional period -#include - diff --git a/applications/plugins/image/CMakeLists.txt b/applications/plugins/image/CMakeLists.txt index a71d687bdd0..ccd235d93f0 100644 --- a/applications/plugins/image/CMakeLists.txt +++ b/applications/plugins/image/CMakeLists.txt @@ -12,11 +12,7 @@ sofa_find_package(SofaPython QUIET) sofa_find_package(MultiThreading QUIET) sofa_find_package(ZLIB) sofa_find_package(Freenect QUIET) -sofa_find_package(DiffusionSolver QUIET) -if(NOT DiffusionSolver_FOUND) - # warning to remove at v19.12 - message(SEND_ERROR "image: DiffusionSolver is now a plugin, make sure you activated the associated CMake option (PLUGIN_DIFFUSIONSOLVER)") -endif() +sofa_find_package(DiffusionSolver REQUIRED) list(APPEND CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR}) diff --git a/applications/projects/Modeler/lib/GraphModeler.cpp b/applications/projects/Modeler/lib/GraphModeler.cpp index 613ed5fd936..b1b2e0fa71a 100644 --- a/applications/projects/Modeler/lib/GraphModeler.cpp +++ b/applications/projects/Modeler/lib/GraphModeler.cpp @@ -195,7 +195,7 @@ BaseObject::SPtr GraphModeler::addComponent(Node::SPtr parent, const ClassEntry: { core::objectmodel::BaseObjectDescription arg; std::ostringstream oss; - oss << c->shortName(&description) << numComponent++; + oss << description.getName() << description.getType() << numComponent++; arg.setName(oss.str()); object = c->createInstance(parent->getContext(), &arg); @@ -729,7 +729,7 @@ Node::SPtr GraphModeler::buildNodeFromBaseElement(Node::SPtr node,xml::BaseEleme itemGraph->setText(0,name.c_str()); } } - newNode->clearWarnings(); + newNode->clearLoggedMessages(); return newNode; } diff --git a/applications/projects/SofaFlowVR/Main.cpp b/applications/projects/SofaFlowVR/Main.cpp index 76f37427ec2..91dbed5033b 100644 --- a/applications/projects/SofaFlowVR/Main.cpp +++ b/applications/projects/SofaFlowVR/Main.cpp @@ -57,7 +57,7 @@ #endif #include -#include +#include #include using sofa::helper::system::thread::CTime; diff --git a/applications/projects/SofaGuiGlut/Main.cpp b/applications/projects/SofaGuiGlut/Main.cpp index 09b9fc950c6..d6327b65e22 100644 --- a/applications/projects/SofaGuiGlut/Main.cpp +++ b/applications/projects/SofaGuiGlut/Main.cpp @@ -60,7 +60,7 @@ using sofa::gui::GUIManager; #include #include -#include +#include using sofa::core::ExecParams ; diff --git a/applications/projects/SofaGuiGlut/SimpleGUI.h b/applications/projects/SofaGuiGlut/SimpleGUI.h index 004fd4b4156..f96bf660adc 100644 --- a/applications/projects/SofaGuiGlut/SimpleGUI.h +++ b/applications/projects/SofaGuiGlut/SimpleGUI.h @@ -33,8 +33,8 @@ #include #include #include -#include -#include +#include +#include #include #include #include diff --git a/applications/projects/SofaGuiGlut/glut.h b/applications/projects/SofaGuiGlut/glut.h index 05d2f796587..f8a92a4855e 100644 --- a/applications/projects/SofaGuiGlut/glut.h +++ b/applications/projects/SofaGuiGlut/glut.h @@ -22,7 +22,7 @@ #ifndef SOFA_HELPER_SYSTEM_GLUT_H #define SOFA_HELPER_SYSTEM_GLUT_H -#include +#include #if defined (__APPLE__) #include #else diff --git a/applications/projects/SofaPhysicsAPI/SofaPhysicsSimulation.cpp b/applications/projects/SofaPhysicsAPI/SofaPhysicsSimulation.cpp index c59b1e0e8c1..1a0811108c7 100644 --- a/applications/projects/SofaPhysicsAPI/SofaPhysicsSimulation.cpp +++ b/applications/projects/SofaPhysicsAPI/SofaPhysicsSimulation.cpp @@ -22,8 +22,8 @@ #include "SofaPhysicsAPI.h" #include "SofaPhysicsSimulation.h" -#include -#include +#include +#include #include #include diff --git a/applications/projects/generateDoc/generateDoc.cpp b/applications/projects/generateDoc/generateDoc.cpp index 9f2391ddad3..34a22e657e7 100644 --- a/applications/projects/generateDoc/generateDoc.cpp +++ b/applications/projects/generateDoc/generateDoc.cpp @@ -157,7 +157,7 @@ bool generateFactoryPHPDoc(const std::string& filename, const std::string& url) for (std::vector::iterator it = classes.begin(), itend = classes.end(); it != itend; ++it) { ObjectFactory::ClassEntry::SPtr entry = *it; - std::string nameSpace = objectmodel::BaseClass::decodeNamespaceName(entry->creatorMap.begin()->second->type()); + std::string nameSpace = sofa::helper::NameDecoder::decodeNamespaceName(entry->creatorMap.begin()->second->type()); sortedClasses[nameSpace].push_back(entry); } @@ -271,7 +271,7 @@ bool generateFactoryPHPDoc(const std::string& filename, const std::string& url) else out << " "; out << ""; - std::string nameSpace = it1->first; //objectmodel::BaseClass::decodeNamespaceName(entry->creatorMap.begin()->second->type()); + std::string nameSpace = it1->first; // sofa::helper::NameDecoder::decodeNamespaceName(entry->creatorMap.begin()->second->type()); out << ""; out << ""<< xmlencode(nameSpace) <<""; out << ""; diff --git a/applications/projects/generateTypedefs/Main.cpp b/applications/projects/generateTypedefs/Main.cpp index d7704da1839..f6aa1be9f8f 100644 --- a/applications/projects/generateTypedefs/Main.cpp +++ b/applications/projects/generateTypedefs/Main.cpp @@ -289,7 +289,7 @@ void printIncludes( const CategoryLibrary &category) const std::type_info& defaultTypeInfo=component.getEntry()->creatorMap.begin()->second->type(); - std::string namespaceComponent = sofa::core::objectmodel::BaseClass::decodeNamespaceName(component.getEntry()->creatorMap.begin()->second->type()); + std::string namespaceComponent = sofa::helper::NameDecoder::decodeNamespaceName(component.getEntry()->creatorMap.begin()->second->type()); std::size_t positionDoublePoints = namespaceComponent.find("::"); while (positionDoublePoints != std::string::npos) @@ -298,13 +298,13 @@ void printIncludes( const CategoryLibrary &category) positionDoublePoints = namespaceComponent.find("::"); } - std::string filename = namespaceComponent+"/"+sofa::core::objectmodel::BaseClass::decodeClassName(defaultTypeInfo)+".h"; + std::string filename = namespaceComponent+"/"+sofa::helper::NameDecoder::decodeClassName(defaultTypeInfo)+".h"; std::string f(pathIncludeFiles+filename); if (sofa::helper::system::DataRepository.findFile( f ) ) { output << "#include <" << namespaceComponent << "/" - << sofa::core::objectmodel::BaseClass::decodeClassName(defaultTypeInfo) << ".h>\n"; + << sofa::helper::NameDecoder::decodeClassName(defaultTypeInfo) << ".h>\n"; includeComponents.insert(std::make_pair(component.getName(),output.str())); } @@ -342,7 +342,7 @@ void printFullTypedefs( const CategoryLibrary &category, TYPES t) const std::string finalName = component.getName() + templateExtension[templateName]; simplificationTypedefComponents.insert(std::make_pair(component.getName(),finalName + " " + finalName.substr(0,finalName.size()-1))); - typedefComponents.insert(std::make_pair(component.getName(), sofa::core::objectmodel::BaseClass::decodeFullName(typeInfo) + " " + finalName)); + typedefComponents.insert(std::make_pair(component.getName(), sofa::helper::NameDecoder::decodeFullName(typeInfo) + " " + finalName)); } } else @@ -425,7 +425,7 @@ void printFullTypedefs( const CategoryLibrary &category, TYPES t) smartFinalName = componentName + cat(inputTemplateExtensions,outputTemplateExtensions,separatorCombination);; } simplificationTypedefComponents.insert(std::make_pair(component.getName(),finalName + " " + smartFinalName)); - typedefComponents.insert(std::make_pair(component.getName(), sofa::core::objectmodel::BaseClass::decodeFullName(typeInfo) + " " + finalName)); + typedefComponents.insert(std::make_pair(component.getName(), sofa::helper::NameDecoder::decodeFullName(typeInfo) + " " + finalName)); } } } diff --git a/applications/projects/sofaTypedefs/Main.cpp b/applications/projects/sofaTypedefs/Main.cpp index 55db7db20cd..6277ed837f2 100644 --- a/applications/projects/sofaTypedefs/Main.cpp +++ b/applications/projects/sofaTypedefs/Main.cpp @@ -231,12 +231,12 @@ int main(int argc, char** argv) if(!templateName.empty()) { - target_h << "typedef " << sofa::core::objectmodel::BaseClass::decodeFullName(type) + target_h << "typedef " << sofa::helper::NameDecoder::decodeFullName(type) << " " << creator->getClass()->className << "_" << templateName << ";"; } else { - target_h << "typedef " << sofa::core::objectmodel::BaseClass::decodeFullName(type) + target_h << "typedef " << sofa::helper::NameDecoder::decodeFullName(type) << " " << creator->getClass()->className << ";"; } target_h << std::endl; diff --git a/applications/tutorials/chainHybrid/chainHybrid.cpp b/applications/tutorials/chainHybrid/chainHybrid.cpp index eddc268283c..e14ccbadaea 100644 --- a/applications/tutorials/chainHybrid/chainHybrid.cpp +++ b/applications/tutorials/chainHybrid/chainHybrid.cpp @@ -66,7 +66,7 @@ Node *createChainHybrid(Node *root) { const std::string visualModel="mesh/torus.obj"; const std::string collisionModel="mesh/torus_for_collision.obj"; - std::vector collisionModelTypes = { "Triangle", "Line", "Point" }; + std::vector collisionModelTypes = { "TriangleCollisionModel", "LineCollisionModel", "PointCollisionModel" }; // Elements of the scene //------------------------------------ diff --git a/doc/src_examples/example4/Data/SOFA_logo.bmp b/doc/src_examples/example4/Data/SOFA_logo.bmp deleted file mode 100644 index 7bf9e290ac1..00000000000 Binary files a/doc/src_examples/example4/Data/SOFA_logo.bmp and /dev/null differ diff --git a/doc/src_examples/example4/Doxyfile b/doc/src_examples/example4/Doxyfile deleted file mode 100644 index 35cae1a6643..00000000000 --- a/doc/src_examples/example4/Doxyfile +++ /dev/null @@ -1,275 +0,0 @@ -# Doxyfile 1.4.1-KDevelop - -#--------------------------------------------------------------------------- -# Project related configuration options -#--------------------------------------------------------------------------- -PROJECT_NAME = example.kdevelop -PROJECT_NUMBER = 0.1 -OUTPUT_DIRECTORY = -CREATE_SUBDIRS = NO -OUTPUT_LANGUAGE = English -USE_WINDOWS_ENCODING = NO -BRIEF_MEMBER_DESC = YES -REPEAT_BRIEF = YES -ABBREVIATE_BRIEF = "The $name class" \ - "The $name widget" \ - "The $name file" \ - is \ - provides \ - specifies \ - contains \ - represents \ - a \ - an \ - the -ALWAYS_DETAILED_SEC = NO -INLINE_INHERITED_MEMB = NO -FULL_PATH_NAMES = YES -STRIP_FROM_PATH = /home/allardj/work/Sofa/ -STRIP_FROM_INC_PATH = -SHORT_NAMES = NO -JAVADOC_AUTOBRIEF = NO -MULTILINE_CPP_IS_BRIEF = NO -DETAILS_AT_TOP = NO -INHERIT_DOCS = YES -DISTRIBUTE_GROUP_DOC = NO -TAB_SIZE = 4 -ALIASES = -OPTIMIZE_OUTPUT_FOR_C = NO -OPTIMIZE_OUTPUT_JAVA = NO -SUBGROUPING = YES -#--------------------------------------------------------------------------- -# Build related configuration options -#--------------------------------------------------------------------------- -EXTRACT_ALL = YES -EXTRACT_PRIVATE = YES -EXTRACT_STATIC = YES -EXTRACT_LOCAL_CLASSES = YES -EXTRACT_LOCAL_METHODS = YES -HIDE_UNDOC_MEMBERS = NO -HIDE_UNDOC_CLASSES = NO -HIDE_FRIEND_COMPOUNDS = NO -HIDE_IN_BODY_DOCS = NO -INTERNAL_DOCS = YES -CASE_SENSE_NAMES = YES -HIDE_SCOPE_NAMES = NO -SHOW_INCLUDE_FILES = YES -INLINE_INFO = YES -SORT_MEMBER_DOCS = YES -SORT_BRIEF_DOCS = NO -SORT_BY_SCOPE_NAME = NO -GENERATE_TODOLIST = YES -GENERATE_TESTLIST = YES -GENERATE_BUGLIST = YES -GENERATE_DEPRECATEDLIST= YES -ENABLED_SECTIONS = -MAX_INITIALIZER_LINES = 30 -SHOW_USED_FILES = YES -SHOW_DIRECTORIES = YES -FILE_VERSION_FILTER = -#--------------------------------------------------------------------------- -# configuration options related to warning and progress messages -#--------------------------------------------------------------------------- -QUIET = NO -WARNINGS = YES -WARN_IF_UNDOCUMENTED = YES -WARN_IF_DOC_ERROR = YES -WARN_NO_PARAMDOC = NO -WARN_FORMAT = "$file:$line: $text" -WARN_LOGFILE = -#--------------------------------------------------------------------------- -# configuration options related to the input files -#--------------------------------------------------------------------------- -INPUT = /home/allardj/Sofa/doc/src_examples/example3 -FILE_PATTERNS = *.c \ - *.cc \ - *.cxx \ - *.cpp \ - *.c++ \ - *.java \ - *.ii \ - *.ixx \ - *.ipp \ - *.i++ \ - *.inl \ - *.h \ - *.hh \ - *.hxx \ - *.hpp \ - *.h++ \ - *.idl \ - *.odl \ - *.cs \ - *.php \ - *.php3 \ - *.inc \ - *.m \ - *.mm \ - *.dox \ - *.C \ - *.CC \ - *.C++ \ - *.II \ - *.I++ \ - *.H \ - *.HH \ - *.H++ \ - *.CS \ - *.PHP \ - *.PHP3 \ - *.M \ - *.MM \ - *.C \ - *.H \ - *.tlh \ - *.diff \ - *.patch \ - *.moc \ - *.xpm \ - *.dox -RECURSIVE = yes -EXCLUDE = -EXCLUDE_SYMLINKS = NO -EXCLUDE_PATTERNS = -EXAMPLE_PATH = -EXAMPLE_PATTERNS = * -EXAMPLE_RECURSIVE = NO -IMAGE_PATH = -INPUT_FILTER = -FILTER_PATTERNS = -FILTER_SOURCE_FILES = NO -#--------------------------------------------------------------------------- -# configuration options related to source browsing -#--------------------------------------------------------------------------- -SOURCE_BROWSER = YES -INLINE_SOURCES = NO -STRIP_CODE_COMMENTS = YES -REFERENCED_BY_RELATION = YES -REFERENCES_RELATION = YES -VERBATIM_HEADERS = YES -#--------------------------------------------------------------------------- -# configuration options related to the alphabetical class index -#--------------------------------------------------------------------------- -ALPHABETICAL_INDEX = YES -COLS_IN_ALPHA_INDEX = 3 -IGNORE_PREFIX = -#--------------------------------------------------------------------------- -# configuration options related to the HTML output -#--------------------------------------------------------------------------- -GENERATE_HTML = YES -HTML_OUTPUT = html -HTML_FILE_EXTENSION = .html -HTML_HEADER = -HTML_FOOTER = -HTML_STYLESHEET = -HTML_ALIGN_MEMBERS = YES -GENERATE_HTMLHELP = NO -CHM_FILE = -HHC_LOCATION = -GENERATE_CHI = NO -BINARY_TOC = NO -TOC_EXPAND = NO -DISABLE_INDEX = NO -ENUM_VALUES_PER_LINE = 4 -GENERATE_TREEVIEW = YES -TREEVIEW_WIDTH = 250 -#--------------------------------------------------------------------------- -# configuration options related to the LaTeX output -#--------------------------------------------------------------------------- -GENERATE_LATEX = NO -LATEX_OUTPUT = latex -LATEX_CMD_NAME = latex -MAKEINDEX_CMD_NAME = makeindex -COMPACT_LATEX = NO -PAPER_TYPE = a4wide -EXTRA_PACKAGES = -LATEX_HEADER = -PDF_HYPERLINKS = NO -USE_PDFLATEX = NO -LATEX_BATCHMODE = NO -LATEX_HIDE_INDICES = NO -#--------------------------------------------------------------------------- -# configuration options related to the RTF output -#--------------------------------------------------------------------------- -GENERATE_RTF = NO -RTF_OUTPUT = rtf -COMPACT_RTF = NO -RTF_HYPERLINKS = NO -RTF_STYLESHEET_FILE = -RTF_EXTENSIONS_FILE = -#--------------------------------------------------------------------------- -# configuration options related to the man page output -#--------------------------------------------------------------------------- -GENERATE_MAN = NO -MAN_OUTPUT = man -MAN_EXTENSION = .3 -MAN_LINKS = NO -#--------------------------------------------------------------------------- -# configuration options related to the XML output -#--------------------------------------------------------------------------- -GENERATE_XML = yes -XML_OUTPUT = xml -XML_SCHEMA = -XML_DTD = -XML_PROGRAMLISTING = YES -#--------------------------------------------------------------------------- -# configuration options for the AutoGen Definitions output -#--------------------------------------------------------------------------- -GENERATE_AUTOGEN_DEF = NO -#--------------------------------------------------------------------------- -# configuration options related to the Perl module output -#--------------------------------------------------------------------------- -GENERATE_PERLMOD = NO -PERLMOD_LATEX = NO -PERLMOD_PRETTY = YES -PERLMOD_MAKEVAR_PREFIX = -#--------------------------------------------------------------------------- -# Configuration options related to the preprocessor -#--------------------------------------------------------------------------- -ENABLE_PREPROCESSING = YES -MACRO_EXPANSION = NO -EXPAND_ONLY_PREDEF = NO -SEARCH_INCLUDES = YES -INCLUDE_PATH = -INCLUDE_FILE_PATTERNS = -PREDEFINED = -EXPAND_AS_DEFINED = -SKIP_FUNCTION_MACROS = YES -#--------------------------------------------------------------------------- -# Configuration::additions related to external references -#--------------------------------------------------------------------------- -TAGFILES = -GENERATE_TAGFILE = example.tag -ALLEXTERNALS = NO -EXTERNAL_GROUPS = YES -PERL_PATH = /usr/bin/perl -#--------------------------------------------------------------------------- -# Configuration options related to the dot tool -#--------------------------------------------------------------------------- -CLASS_DIAGRAMS = YES -HIDE_UNDOC_RELATIONS = YES -HAVE_DOT = YES -CLASS_GRAPH = YES -COLLABORATION_GRAPH = YES -GROUP_GRAPHS = YES -UML_LOOK = NO -TEMPLATE_RELATIONS = NO -INCLUDE_GRAPH = YES -INCLUDED_BY_GRAPH = YES -CALL_GRAPH = NO -GRAPHICAL_HIERARCHY = YES -DIRECTORY_GRAPH = YES -DOT_IMAGE_FORMAT = png -DOT_PATH = -DOTFILE_DIRS = -MAX_DOT_GRAPH_WIDTH = 1024 -MAX_DOT_GRAPH_HEIGHT = 1024 -MAX_DOT_GRAPH_DEPTH = 1000 -DOT_TRANSPARENT = NO -DOT_MULTI_TARGETS = NO -GENERATE_LEGEND = YES -DOT_CLEANUP = YES -#--------------------------------------------------------------------------- -# Configuration::additions related to the search engine -#--------------------------------------------------------------------------- -SEARCHENGINE = NO diff --git a/doc/src_examples/example4/LennardJonesForceField.cpp b/doc/src_examples/example4/LennardJonesForceField.cpp deleted file mode 100644 index 8b8db7320a5..00000000000 --- a/doc/src_examples/example4/LennardJonesForceField.cpp +++ /dev/null @@ -1,41 +0,0 @@ -#include "LennardJonesForceField.inl" -#include "Sofa/Components/Common/Vec3Types.h" -#include "Sofa/Components/XML/ForceFieldNode.h" - -using namespace Sofa::Components; -using namespace Sofa::Components::Common; -using namespace Sofa::Core; - -namespace Sofa -{ -namespace Components -{ -namespace Common -{ - -template -void create(LennardJonesForceField*& obj, XML::Node* arg) -{ - XML::createWithParent< LennardJonesForceField, MechanicalModel >(obj, arg); - if (obj!=NULL) - { - if (arg->getAttribute("alpha")) obj->setAlpha(atof(arg->getAttribute("alpha"))); - if (arg->getAttribute("beta")) obj->setBeta(atof(arg->getAttribute("beta"))); - if (arg->getAttribute("fmax")) obj->setFMax(atof(arg->getAttribute("fmax"))); - if (arg->getAttribute("dmax")) obj->setDMax(atof(arg->getAttribute("dmax"))); - else if (arg->getAttribute("d0")) obj->setDMax(2*atof(arg->getAttribute("d0"))); - if (arg->getAttribute("d0")) obj->setD0(atof(arg->getAttribute("d0"))); - if (arg->getAttribute("p0")) obj->setP0(atof(arg->getAttribute("p0"))); - } -} -} -} -} - -// Each instance of our class must be compiled -template class LennardJonesForceField; -template class LennardJonesForceField; - -// And registered in the Factory -Creator< XML::ForceFieldNode::Factory, LennardJonesForceField > LennardJonesForceField3fClass("LennardJones", true); -Creator< XML::ForceFieldNode::Factory, LennardJonesForceField > LennardJonesForceField3dClass("LennardJones", true); diff --git a/doc/src_examples/example4/LennardJonesForceField.h b/doc/src_examples/example4/LennardJonesForceField.h deleted file mode 100644 index ea078a41326..00000000000 --- a/doc/src_examples/example4/LennardJonesForceField.h +++ /dev/null @@ -1,58 +0,0 @@ -#ifndef LENNARDJONESFORCEFIELD_H -#define LENNARDJONESFORCEFIELD_H - -#include "Sofa/Core/ForceField.h" -#include "Sofa/Core/MechanicalModel.h" -#include "Sofa/Abstract/VisualModel.h" - -template -class LennardJonesForceField : public Sofa::Core::ForceField, public Sofa::Abstract::VisualModel -{ -public: - typedef Sofa::Core::ForceField Inherit; - typedef typename DataTypes::VecCoord VecCoord; - typedef typename DataTypes::VecDeriv VecDeriv; - typedef typename DataTypes::Coord Coord; - typedef typename DataTypes::Deriv Deriv; - typedef typename Coord::value_type Real; - -protected: - Sofa::Core::MechanicalModel* object; - - Real a,b,alpha,beta,dmax,fmax; - Real d0,p0; - - struct DForce - { - unsigned int a,b; - Real df; - }; - - std::vector dforces; - -public: - LennardJonesForceField(Sofa::Core::MechanicalModel* object, const std::string& /*name*/="") - : object(object), a(1), b(1), alpha(6), beta(12), dmax(2), fmax(1), d0(1), p0(1) - { - } - - void setAlpha(Real v) { alpha = v; } - void setBeta(Real v) { beta = v; } - void setFMax(Real v) { fmax = v; } - void setDMax(Real v) { dmax = v; } - void setD0(Real v) { d0 = v; } - void setP0(Real v) { p0 = v; } - - virtual void init(); - - virtual void addForce(); - - virtual void addDForce(); - - // -- VisualModel interface - void draw(); - void initTextures() { } - void update() { } -}; - -#endif diff --git a/doc/src_examples/example4/LennardJonesForceField.inl b/doc/src_examples/example4/LennardJonesForceField.inl deleted file mode 100644 index 35eb54d96d4..00000000000 --- a/doc/src_examples/example4/LennardJonesForceField.inl +++ /dev/null @@ -1,112 +0,0 @@ -#ifndef LENNARDJONESFORCEFIELD_INL -#define LENNARDJONESFORCEFIELD_INL - -#include "LennardJonesForceField.h" -#include "Sofa/Components/Scene.h" -#include - -template -void LennardJonesForceField::init() -{ - a = (p0 * (Real)pow(d0,alpha)) / (1-alpha/beta); - b = (p0 * (Real)pow(d0,beta)) / (beta/alpha-1); - std::cout << "Lennard-Jones initialized: alpha="<=2)?argv[1]:"test1.scn"); - MainLoop(argv[0]); - return 0; -} diff --git a/doc/src_examples/example4/example4.pro b/doc/src_examples/example4/example4.pro deleted file mode 100644 index eaac20eea3d..00000000000 --- a/doc/src_examples/example4/example4.pro +++ /dev/null @@ -1,7 +0,0 @@ -include(../examples.cfg) - -TARGET = run - -SOURCES = Main.cpp LennardJonesForceField.cpp -HEADERS = LennardJonesForceField.h LennardJonesForceField.inl - diff --git a/doc/src_examples/example4/test1.scn b/doc/src_examples/example4/test1.scn deleted file mode 100644 index bc718d725f0..00000000000 --- a/doc/src_examples/example4/test1.scn +++ /dev/null @@ -1,21 +0,0 @@ - - - - - - - - - - - - - - - - diff --git a/examples/Components/collision/OBBCap.scn b/examples/Components/collision/OBBCap.scn index f963289a0ad..8a9c48f7fa0 100644 --- a/examples/Components/collision/OBBCap.scn +++ b/examples/Components/collision/OBBCap.scn @@ -14,7 +14,7 @@ - + diff --git a/examples/Components/collision/OBBCap1.scn b/examples/Components/collision/OBBCap1.scn index f82c7b1f6f9..b9ef9cef36e 100644 --- a/examples/Components/collision/OBBCap1.scn +++ b/examples/Components/collision/OBBCap1.scn @@ -14,7 +14,7 @@ - + diff --git a/examples/Components/collision/OBBCapEdgeEdge.scn b/examples/Components/collision/OBBCapEdgeEdge.scn index f23e84dfdd1..c5da629dbc9 100644 --- a/examples/Components/collision/OBBCapEdgeEdge.scn +++ b/examples/Components/collision/OBBCapEdgeEdge.scn @@ -14,7 +14,7 @@ - + diff --git a/examples/Components/collision/OBBCapEdgeVertex.scn b/examples/Components/collision/OBBCapEdgeVertex.scn index a41824e6d92..f1b0fedc2a6 100644 --- a/examples/Components/collision/OBBCapEdgeVertex.scn +++ b/examples/Components/collision/OBBCapEdgeVertex.scn @@ -14,7 +14,7 @@ - + diff --git a/examples/Components/collision/OBBCapVertexEdge.scn b/examples/Components/collision/OBBCapVertexEdge.scn index 833b34527cf..5dfff55f354 100644 --- a/examples/Components/collision/OBBCapVertexEdge.scn +++ b/examples/Components/collision/OBBCapVertexEdge.scn @@ -14,7 +14,7 @@ - + diff --git a/examples/Components/collision/OBBCapVertexVertex.scn b/examples/Components/collision/OBBCapVertexVertex.scn index 4e3902158cb..4e63466a7a1 100644 --- a/examples/Components/collision/OBBCapVertexVertex.scn +++ b/examples/Components/collision/OBBCapVertexVertex.scn @@ -14,7 +14,7 @@ - + diff --git a/examples/Components/collision/OBBOBB.scn b/examples/Components/collision/OBBOBB.scn index 71e5b2a8d44..12adfa0f89f 100644 --- a/examples/Components/collision/OBBOBB.scn +++ b/examples/Components/collision/OBBOBB.scn @@ -14,11 +14,11 @@ - + - + diff --git a/examples/Components/collision/OBBOBB2.scn b/examples/Components/collision/OBBOBB2.scn index 5c656c2ff02..18ceac37e6c 100644 --- a/examples/Components/collision/OBBOBB2.scn +++ b/examples/Components/collision/OBBOBB2.scn @@ -13,12 +13,12 @@ - + - + diff --git a/examples/Components/collision/OBBOBBAlea.scn b/examples/Components/collision/OBBOBBAlea.scn index 0a43d662c18..7f5c655cd33 100644 --- a/examples/Components/collision/OBBOBBAlea.scn +++ b/examples/Components/collision/OBBOBBAlea.scn @@ -14,11 +14,11 @@ - + - + diff --git a/examples/Components/collision/OBBOBBCollision.scn b/examples/Components/collision/OBBOBBCollision.scn index e03f8d16e92..f61e4d5656a 100644 --- a/examples/Components/collision/OBBOBBCollision.scn +++ b/examples/Components/collision/OBBOBBCollision.scn @@ -13,12 +13,12 @@ - + - + diff --git a/examples/Components/collision/OBBOBBEdgeEdge.scn b/examples/Components/collision/OBBOBBEdgeEdge.scn index 539cd24bc89..33214ea299b 100644 --- a/examples/Components/collision/OBBOBBEdgeEdge.scn +++ b/examples/Components/collision/OBBOBBEdgeEdge.scn @@ -14,11 +14,11 @@ - + - + diff --git a/examples/Components/collision/OBBOBBEdgeVertex.scn b/examples/Components/collision/OBBOBBEdgeVertex.scn index c6f774788e3..85bfa6b04aa 100644 --- a/examples/Components/collision/OBBOBBEdgeVertex.scn +++ b/examples/Components/collision/OBBOBBEdgeVertex.scn @@ -14,11 +14,11 @@ - + - + diff --git a/examples/Components/collision/OBBOBBFaceEdge.scn b/examples/Components/collision/OBBOBBFaceEdge.scn index 70eada84608..2f333bf4d05 100644 --- a/examples/Components/collision/OBBOBBFaceEdge.scn +++ b/examples/Components/collision/OBBOBBFaceEdge.scn @@ -14,11 +14,11 @@ - + - + diff --git a/examples/Components/collision/OBBOBBVertexVertex.scn b/examples/Components/collision/OBBOBBVertexVertex.scn index 79b8d30dec2..69468e2d82a 100644 --- a/examples/Components/collision/OBBOBBVertexVertex.scn +++ b/examples/Components/collision/OBBOBBVertexVertex.scn @@ -14,11 +14,11 @@ - + - + diff --git a/examples/Components/collision/OBBSphere.scn b/examples/Components/collision/OBBSphere.scn index c688efcf729..919736ab57f 100644 --- a/examples/Components/collision/OBBSphere.scn +++ b/examples/Components/collision/OBBSphere.scn @@ -19,6 +19,6 @@ - + diff --git a/examples/Components/collision/OBBSphere2.scn b/examples/Components/collision/OBBSphere2.scn index 1e24b074876..309690be8e5 100644 --- a/examples/Components/collision/OBBSphere2.scn +++ b/examples/Components/collision/OBBSphere2.scn @@ -19,6 +19,6 @@ - + diff --git a/examples/Components/collision/OBBSphereEdge.scn b/examples/Components/collision/OBBSphereEdge.scn index 898fa959d63..d5323955988 100644 --- a/examples/Components/collision/OBBSphereEdge.scn +++ b/examples/Components/collision/OBBSphereEdge.scn @@ -19,6 +19,6 @@ - + diff --git a/examples/Components/collision/OBBSphereVertex.scn b/examples/Components/collision/OBBSphereVertex.scn index ffc63de72f7..de06973048c 100644 --- a/examples/Components/collision/OBBSphereVertex.scn +++ b/examples/Components/collision/OBBSphereVertex.scn @@ -19,6 +19,6 @@ - + diff --git a/examples/Components/collision/OBBTri.scn b/examples/Components/collision/OBBTri.scn index 83a6d21934d..adf3d364266 100644 --- a/examples/Components/collision/OBBTri.scn +++ b/examples/Components/collision/OBBTri.scn @@ -26,6 +26,6 @@ - + diff --git a/examples/Components/collision/OBBTriEdgeEdge.scn b/examples/Components/collision/OBBTriEdgeEdge.scn index 57e0a0c29ba..4b7e0cbbbe7 100644 --- a/examples/Components/collision/OBBTriEdgeEdge.scn +++ b/examples/Components/collision/OBBTriEdgeEdge.scn @@ -25,6 +25,6 @@ - + diff --git a/examples/Components/collision/OBBTriEdgeEdge2.scn b/examples/Components/collision/OBBTriEdgeEdge2.scn index 27f2e68dde0..c679d768eb0 100644 --- a/examples/Components/collision/OBBTriEdgeEdge2.scn +++ b/examples/Components/collision/OBBTriEdgeEdge2.scn @@ -25,6 +25,6 @@ - + diff --git a/examples/Components/collision/OBBTriEdgeVerex.scn b/examples/Components/collision/OBBTriEdgeVerex.scn index 3c26fedbb2d..302a8ed3cad 100644 --- a/examples/Components/collision/OBBTriEdgeVerex.scn +++ b/examples/Components/collision/OBBTriEdgeVerex.scn @@ -25,6 +25,6 @@ - + diff --git a/examples/Components/collision/OBBTriFaceVertex.scn b/examples/Components/collision/OBBTriFaceVertex.scn index 8ef02146ef2..7c5abc1c3cc 100644 --- a/examples/Components/collision/OBBTriFaceVertex.scn +++ b/examples/Components/collision/OBBTriFaceVertex.scn @@ -25,6 +25,6 @@ - + diff --git a/examples/Components/collision/OBBTriVertexEdge.scn b/examples/Components/collision/OBBTriVertexEdge.scn index fe6964943d3..64a65e1d5f2 100644 --- a/examples/Components/collision/OBBTriVertexEdge.scn +++ b/examples/Components/collision/OBBTriVertexEdge.scn @@ -25,6 +25,6 @@ - + diff --git a/examples/Components/collision/OBBTriVertexFace.scn b/examples/Components/collision/OBBTriVertexFace.scn index 470677226f4..f992d0cb87b 100644 --- a/examples/Components/collision/OBBTriVertexFace.scn +++ b/examples/Components/collision/OBBTriVertexFace.scn @@ -25,6 +25,6 @@ - + diff --git a/examples/Components/forcefield/LennardJonesForceField.scn b/examples/Components/forcefield/LennardJonesForceField.scn deleted file mode 100644 index 746a072c39d..00000000000 --- a/examples/Components/forcefield/LennardJonesForceField.scn +++ /dev/null @@ -1,30 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - diff --git a/examples/Components/forcefield/TetrahedronDiffusionFEMForceField.scn b/examples/Components/forcefield/TetrahedronDiffusionFEMForceField.scn index f6511f56923..269b01016d8 100644 --- a/examples/Components/forcefield/TetrahedronDiffusionFEMForceField.scn +++ b/examples/Components/forcefield/TetrahedronDiffusionFEMForceField.scn @@ -23,7 +23,7 @@ - + diff --git a/modules/SofaBoundaryCondition/SofaBoundaryCondition_test/PartialFixedConstraint_test.cpp b/modules/SofaBoundaryCondition/SofaBoundaryCondition_test/PartialFixedConstraint_test.cpp index a4bacc67f6f..146af2d1de2 100644 --- a/modules/SofaBoundaryCondition/SofaBoundaryCondition_test/PartialFixedConstraint_test.cpp +++ b/modules/SofaBoundaryCondition/SofaBoundaryCondition_test/PartialFixedConstraint_test.cpp @@ -81,7 +81,7 @@ struct PartialFixedConstraint_test : public BaseSimulationTest sofa::simulation::setSimulation(simulation = new sofa::simulation::graph::DAGSimulation()); simulation::Node::SPtr root = simulation->createNewGraph("root"); root->setGravity( defaulttype::Vector3(0,0,0) ); - simulation::Node::SPtr node = createEulerSolverNode(root,"EulerSolver", integrationScheme); + simulation::Node::SPtr node = createEulerSolverNode(root,"EulerExplicitSolver", integrationScheme); mstate = New >(); mstate->resize(1); diff --git a/modules/SofaBoundaryCondition/src/SofaBoundaryCondition/ConstantForceField.h b/modules/SofaBoundaryCondition/src/SofaBoundaryCondition/ConstantForceField.h index ccb75deb1e6..d6d09cbf57b 100644 --- a/modules/SofaBoundaryCondition/src/SofaBoundaryCondition/ConstantForceField.h +++ b/modules/SofaBoundaryCondition/src/SofaBoundaryCondition/ConstantForceField.h @@ -107,9 +107,6 @@ class ConstantForceField : public core::behavior::ForceField /// Set a force to a given particle void setForce( unsigned i, const Deriv& f ); - /// Parse function (to be removed after v19.12) - void parse(sofa::core::objectmodel::BaseObjectDescription* arg) override; - using Inherit::addAlias ; using Inherit::addKToMatrix; @@ -135,16 +132,13 @@ SReal ConstantForceField::getPotentialEnergy(const cor template <> SReal ConstantForceField::getPotentialEnergy(const core::MechanicalParams*, const DataVecCoord& ) const; - - -#if !defined(SOFA_COMPONENT_FORCEFIELD_CONSTANTFORCEFIELD_CPP) +#if !defined(SOFA_COMPONENT_FORCEFIELD_CONSTANTFORCEFIELD_CPP) extern template class SOFA_SOFABOUNDARYCONDITION_API ConstantForceField; extern template class SOFA_SOFABOUNDARYCONDITION_API ConstantForceField; extern template class SOFA_SOFABOUNDARYCONDITION_API ConstantForceField; extern template class SOFA_SOFABOUNDARYCONDITION_API ConstantForceField; extern template class SOFA_SOFABOUNDARYCONDITION_API ConstantForceField; extern template class SOFA_SOFABOUNDARYCONDITION_API ConstantForceField; - #endif } // namespace sofa::component::forcefield diff --git a/modules/SofaBoundaryCondition/src/SofaBoundaryCondition/ConstantForceField.inl b/modules/SofaBoundaryCondition/src/SofaBoundaryCondition/ConstantForceField.inl index e938de7f79d..b8282f55ef7 100644 --- a/modules/SofaBoundaryCondition/src/SofaBoundaryCondition/ConstantForceField.inl +++ b/modules/SofaBoundaryCondition/src/SofaBoundaryCondition/ConstantForceField.inl @@ -53,31 +53,6 @@ ConstantForceField::ConstantForceField() } -template -void ConstantForceField::parse(BaseObjectDescription* arg) -{ - /// Now warning the user when using old API - /// TODO: remove for 20.06 - const char* val1=arg->getAttribute("points",nullptr) ; - if(val1) - { - msg_error() << "The attribute 'points' is no longer valid. " - << "It has been converted into 'indices' since Sofa 17.06 '" ; - - } - /// Now warning the user when using old API - /// TODO: remove for 20.06 - const char* val2=arg->getAttribute("arrowSizeCoef",nullptr) ; - if(val2) - { - msg_error() << "The attribute 'arrowSizeCoef' is no longer valid. " - << "It has been converted into 'showArrowSize' since Sofa 19.12 '" ; - - } - Inherit::parse(arg) ; -} - - template void ConstantForceField::init() { diff --git a/modules/SofaBoundaryCondition/src/SofaBoundaryCondition/PlaneForceField.h b/modules/SofaBoundaryCondition/src/SofaBoundaryCondition/PlaneForceField.h index 2e5eeead2be..0102d6bde69 100644 --- a/modules/SofaBoundaryCondition/src/SofaBoundaryCondition/PlaneForceField.h +++ b/modules/SofaBoundaryCondition/src/SofaBoundaryCondition/PlaneForceField.h @@ -118,17 +118,6 @@ class PlaneForceField : public core::behavior::ForceField void draw(const core::visual::VisualParams* vparams) override; void drawPlane(const core::visual::VisualParams*, float size=0.0f); void computeBBox(const core::ExecParams *, bool onlyVisible=false) override; - - //TODO(htalbot) remove after v18.12 - //Temporary function to warn the user when old attribute names are used - void parse( sofa::core::objectmodel::BaseObjectDescription* arg ) override - { - if (arg->getAttribute("color")) - { - msg_warning() << "input data 'color' changed for 'planeColor'"; - } - Inherit::parse(arg); - } }; diff --git a/modules/SofaExporter/src/SofaExporter/BlenderExporter.cpp b/modules/SofaExporter/src/SofaExporter/BlenderExporter.cpp index a08e2175e36..088cbee3bc8 100644 --- a/modules/SofaExporter/src/SofaExporter/BlenderExporter.cpp +++ b/modules/SofaExporter/src/SofaExporter/BlenderExporter.cpp @@ -22,24 +22,13 @@ #include #include -namespace sofa +namespace sofa::component::_blenderexporter_ { +using namespace defaulttype; - namespace component - { +int BlenderExportClass = core::RegisterObject("Export the simulation result as blender point cache files") + .add< BlenderExporter >() + .add< BlenderExporter >() + ; - namespace misc - { - using namespace defaulttype; - - int BlenderExportClass = core::RegisterObject("Export the simulation result as blender point cache files") - .add< BlenderExporter >() - .add< BlenderExporter >() - - ; - - } // namespace misc - - } // namespace component - -} // namespace sofa +} // sofa::component::_blenderexporter_ diff --git a/modules/SofaExporter/src/SofaExporter/BlenderExporter.h b/modules/SofaExporter/src/SofaExporter/BlenderExporter.h index afebfd5ab4e..88aa855ab4a 100644 --- a/modules/SofaExporter/src/SofaExporter/BlenderExporter.h +++ b/modules/SofaExporter/src/SofaExporter/BlenderExporter.h @@ -38,7 +38,9 @@ #include -namespace sofa::component::misc +namespace sofa::component +{ +namespace _blenderexporter_ { /** @@ -109,8 +111,21 @@ class SOFA_SOFAEXPORTER_API BlenderExporter: public core::objectmodel::BaseObjec protected: unsigned frameCounter; +}; +} // namespace _blenderexporter_ -}; +namespace exporter { + template + using BlenderExporter = _blenderexporter_::BlenderExporter; +} // namespace exporter + +// Import the object in the "old" namespace to allow smooth update of code base. +namespace misc { + template + using BlenderExporter + SOFA_ATTRIBUTE_DEPRECATED__SOFAEXPORTER_NAMESPACE_2106() + = _blenderexporter_::BlenderExporter; +} // namespace misc -} // namespace sofa::component::misc +} // namespace sofa::component diff --git a/modules/SofaExporter/src/SofaExporter/BlenderExporter.inl b/modules/SofaExporter/src/SofaExporter/BlenderExporter.inl index 99049d6a7fc..ea58bafe3af 100644 --- a/modules/SofaExporter/src/SofaExporter/BlenderExporter.inl +++ b/modules/SofaExporter/src/SofaExporter/BlenderExporter.inl @@ -23,213 +23,203 @@ #include #include -namespace sofa +namespace sofa::component::_blenderexporter_ { - namespace component +using namespace std; + +template +BlenderExporter::BlenderExporter() + : path(initData(&path,"path","output path")), + baseName(initData(&baseName, "baseName", "Base name for the output files")), + simulationType(initData(&simulationType,0, "simulationType", "simulation type (0: soft body, 1: particles, 2:cloth, 3:hair)")), + simulationStep(initData(&simulationStep,2, "step", "save the simulation result every step frames")), + nbPtsByHair(initData(&nbPtsByHair,20, "nbPtsByHair", "number of element by hair strand")), + frameCounter(0) +{ + Inherit::f_listening.setValue(true); +} + +template +void BlenderExporter::init() +{ + mmodel = getContext()->template get(sofa::core::objectmodel::BaseContext::SearchDirection::Local); + if(mmodel == nullptr) + msg_error()<<"Initialization failed!"; + Inherit::init(); + // if hair type simulation, create an additional information frame + if(simulationType.getValue()==Hair) { + ostringstream iss; + iss< +void BlenderExporter::reset() +{ + frameCounter=0; +} - namespace misc +template +void BlenderExporter::handleEvent(sofa::core::objectmodel::Event* event) +{ + + if (simulation::AnimateBeginEvent::checkEventType(event)) + { + if(!(frameCounter%simulationStep.getValue())) // save a new frame! { + int frameNumber = frameCounter/simulationStep.getValue(); + ostringstream iss; + iss< - BlenderExporter::BlenderExporter() - : path(initData(&path,"path","output path")), - baseName(initData(&baseName, "baseName", "Base name for the output files")), - simulationType(initData(&simulationType,0, "simulationType", "simulation type (0: soft body, 1: particles, 2:cloth, 3:hair)")), - simulationStep(initData(&simulationStep,2, "step", "save the simulation result every step frames")), - nbPtsByHair(initData(&nbPtsByHair,20, "nbPtsByHair", "number of element by hair strand")), - frameCounter(0) + if(file) { - Inherit::f_listening.setValue(true); - } + msg_info()<<"writing in "< - void BlenderExporter::init() - { - mmodel = getContext()->template get(sofa::core::objectmodel::BaseContext::SearchDirection::Local); - if(mmodel == nullptr) - msg_error()<<"Initialization failed!"; - Inherit::init(); - // if hair type simulation, create an additional information frame + // ############# write header + + const string bphysics = "BPHYSICS"; + file.write(bphysics.c_str(),8); + + // types + unsigned type; + if(simulationType.getValue()==Hair) + type = Cloth; // blender hair exception + else + type = simulationType.getValue(); + file.write((char*)&type,4); + + // number of data + auto size = mmodel->getSize(); if(simulationType.getValue()==Hair) { - ostringstream iss; - iss< - void BlenderExporter::reset() - { - frameCounter=0; - } + // dataType + unsigned dataType; + switch (simulationType.getValue()) + { + case SoftBody: dataType = 6; + break; + case Hair: dataType = 22; + break; + default: dataType = 6; + break; + } + file.write((char*)&dataType,4); + + // ############# write data + + float pos[3]={0,0,0}; + float vel[3]={0,0,0}; + float rest[3]={0,0,0}; + float pos0[3]={0,0,0}; + float vel0[3]={0,0,0}; - template - void BlenderExporter::handleEvent(sofa::core::objectmodel::Event* event) - { - if (simulation::AnimateBeginEvent::checkEventType(event)) + ReadVecCoord posData = mmodel->readPositions(); + + + for(int i=size-1; i>=0; i--) { - if(!(frameCounter%simulationStep.getValue())) // save a new frame! + //create an additional point for root tangent + if((simulationType.getValue() == Hair && (i%nbPtsByHair.getValue()==0))) { - int frameNumber = frameCounter/simulationStep.getValue(); - ostringstream iss; - iss<getSize(); - if(simulationType.getValue()==Hair) - { - unsigned sizeHair = size+size/(nbPtsByHair.getValue()); - file.write((char*)&sizeHair,4); - } - else - file.write((char*)&size,4); - - // dataType - unsigned dataType; - switch (simulationType.getValue()) - { - case SoftBody: dataType = 6; - break; - case Hair: dataType = 22; - break; - default: dataType = 6; - break; - } - file.write((char*)&dataType,4); - - // ############# write data - - float pos[3]={0,0,0}; - float vel[3]={0,0,0}; - float rest[3]={0,0,0}; - float pos0[3]={0,0,0}; - float vel0[3]={0,0,0}; - - - ReadVecCoord posData = mmodel->readPositions(); - - - for(int i=size-1; i>=0; i--) - { - //create an additional point for root tangent - if((simulationType.getValue() == Hair && (i%nbPtsByHair.getValue()==0))) - { - - defaulttype::Vector3 x0 = T::getCPos(posData[i]); - defaulttype::Vector3 x1 = T::getCPos(posData[i+1]); - - x1 = x1-x0; - x1.normalize(); - - x0 = x0+x1; - - pos0[0] = (float)x0[0]; - pos0[1] = (float)x0[1]; - pos0[2] = (float)x0[2]; - - file.write((char*)pos0,12); - file.write((char*)vel0,12); - file.write((char*)pos0,12); - } - - //Coord x0=restData[i]; - Coord x=posData[i]; - pos[0] = (float)x[0]; - pos[1] = (float)x[1]; - pos[2] = (float)x[2]; - - Deriv v; - if((mmodel->read(core::ConstVecDerivId::velocity())) && ( (defaulttype::BaseVector::Index)mmodel->readVelocities().size()>i)) - { - v =mmodel->readVelocities()[i]; - vel[0] = (float)v[0]; - vel[1] = (float)v[1]; - vel[2] = (float)v[2]; - } - - Coord x0; - if((mmodel->read(core::ConstVecCoordId::restPosition())) && ( (defaulttype::BaseVector::Index)mmodel->readRestPositions().size()>i)) - { - x0 =mmodel->readRestPositions()[i]; - rest[0] = (float)x0[0]; - rest[1] = (float)x0[1]; - rest[2] = (float)x0[2]; - } - - - - switch (simulationType.getValue()) - { - case SoftBody: - file.write((char*)pos,12); - file.write((char*)vel,12); - break; - case Hair: - file.write((char*)pos,12); - file.write((char*)vel,12); - file.write((char*)rest,12); - break; - default: - file.write((char*)pos,12); - file.write((char*)vel,12); - break; - } - } - file.close(); - } - else - msg_error() << "Unable to create the following file: "<read(core::ConstVecDerivId::velocity())) && ( (defaulttype::BaseVector::Index)mmodel->readVelocities().size()>i)) + { + v =mmodel->readVelocities()[i]; + vel[0] = (float)v[0]; + vel[1] = (float)v[1]; + vel[2] = (float)v[2]; + } + + Coord x0; + if((mmodel->read(core::ConstVecCoordId::restPosition())) && ( (defaulttype::BaseVector::Index)mmodel->readRestPositions().size()>i)) + { + x0 =mmodel->readRestPositions()[i]; + rest[0] = (float)x0[0]; + rest[1] = (float)x0[1]; + rest[2] = (float)x0[2]; + } + + + + switch (simulationType.getValue()) + { + case SoftBody: + file.write((char*)pos,12); + file.write((char*)vel,12); + break; + case Hair: + file.write((char*)pos,12); + file.write((char*)vel,12); + file.write((char*)rest,12); + break; + default: + file.write((char*)pos,12); + file.write((char*)vel,12); + break; + } + } + file.close(); } + else + msg_error() << "Unable to create the following file: "<(event); - switch(ev->getKey()) - { - case 'E': - case 'e': - //done(18.12) really remove the behavior and write a message explaining the proper design. - //done(17.12) wrote a message to discourage the use of this behavior - msg_deprecated() << "Writing the mesh by pressing key is now removed from Sofa." - "To implement component or scene specific interaction it is better to implement it " - "using an external C++ controller or pythonScriptController." - "Ask to the sofa forum for help if needed."; - //writeMesh(); - break; - } - } - BaseSimulationExporter::handleEvent(event); + BaseSimulationExporter::handleEvent(event); } -} // namespace misc - -} // namespace component - -} // namespace sofa +} // namespace sofa::component::_meshexporter_ diff --git a/modules/SofaExporter/src/SofaExporter/MeshExporter.h b/modules/SofaExporter/src/SofaExporter/MeshExporter.h index 0983aa7c0fd..f1164874473 100644 --- a/modules/SofaExporter/src/SofaExporter/MeshExporter.h +++ b/modules/SofaExporter/src/SofaExporter/MeshExporter.h @@ -47,12 +47,8 @@ namespace sofa { ////////////////////////////////// DECLARATION ///////////////////////////////////////////////////// -namespace sofa +namespace sofa::component { - -namespace component -{ - namespace _meshexporter_ { @@ -109,21 +105,20 @@ class SOFA_SOFAEXPORTER_API MeshExporter : public BaseSimulationExporter std::string getMeshFilename(const char* ext); }; -} /// namespace _meshexporter_ - -//todo(18.06): remove the old namespaces... -/// Import the object in the "old" namespace to allow smooth update of code base. -namespace misc { - using _meshexporter_::MeshExporter ; -} +} // namespace _meshexporter_ -/// Import the object in the exporter namespace to avoid having all the object straight in component. +// Import the object in the exporter namespace to avoid having all the object straight in component. namespace exporter { - using _meshexporter_::MeshExporter ; -} + using MeshExporter = _meshexporter_::MeshExporter; +} // namespace exporter -} /// namespace component +// Import the object in the "old" namespace to allow smooth update of code base. +namespace misc { + using MeshExporter + SOFA_ATTRIBUTE_DEPRECATED__SOFAEXPORTER_NAMESPACE_1712() + = _meshexporter_::MeshExporter; +} // namespace misc -} /// namespace sofa +} // namespace sofa::component #endif // SOFA_COMPONENT_MISC_MESHEXPORTER_H diff --git a/modules/SofaExporter/src/SofaExporter/OBJExporter.cpp b/modules/SofaExporter/src/SofaExporter/OBJExporter.cpp index db4b25e48b9..355483c3acd 100644 --- a/modules/SofaExporter/src/SofaExporter/OBJExporter.cpp +++ b/modules/SofaExporter/src/SofaExporter/OBJExporter.cpp @@ -97,43 +97,6 @@ bool OBJExporter::writeOBJ() void OBJExporter::handleEvent(Event *event) { - if (KeypressedEvent::checkEventType(event)) - { - KeypressedEvent *ev = static_cast(event); - - switch(ev->getKey()) - { - - case 'E': - case 'e': - { - //todo(18.06) remove the behavior - msg_deprecated() << "Hard coded interaction behavior in component is now a deprecated behavior." - "Scene specific interaction should be implement using an external controller or pythonScriptController." - "Please update your scene because this behavior will be removed in Sofa 18.06"; - writeOBJ(); - break; - } - - case 'P': - case 'p': - { - //todo(18.06) remove the behavior - msg_deprecated() << "Hard coded interaction behavior in component is now a deprecated behavior." - "Scene specific interaction should be implement using an external controller or pythonScriptController" - "Please update your scene because this behavior will be removed in Sofa 18.06"; - - if (!d_isEnabled.getValue()){ - msg_info() << "Starting OBJ sequence export..." ; - }else{ - msg_info() << "Ending OBJ sequence export..." ; - } - d_isEnabled = !d_isEnabled.getValue() ; - break; - } - } - } - BaseSimulationExporter::handleEvent(event) ; } diff --git a/modules/SofaExporter/src/SofaExporter/OBJExporter.h b/modules/SofaExporter/src/SofaExporter/OBJExporter.h index c7f97f1d238..882183ecfe1 100644 --- a/modules/SofaExporter/src/SofaExporter/OBJExporter.h +++ b/modules/SofaExporter/src/SofaExporter/OBJExporter.h @@ -27,42 +27,46 @@ #include -namespace sofa +namespace sofa::component { - -namespace component -{ - namespace _objexporter_ { -using sofa::simulation::BaseSimulationExporter ; -using sofa::core::objectmodel::Event ; -using sofa::core::objectmodel::Base ; +using sofa::simulation::BaseSimulationExporter; +using sofa::core::objectmodel::Event; +using sofa::core::objectmodel::Base; class SOFA_SOFAEXPORTER_API OBJExporter : public BaseSimulationExporter { public: SOFA_CLASS(OBJExporter, BaseSimulationExporter); - bool write() override ; + bool write() override; bool writeOBJ(); - void handleEvent(Event *event) override ; + void handleEvent(Event *event) override; protected: ~OBJExporter() override; }; -} - -using _objexporter_::OBJExporter ; +} // namespace _objexporter_ -/// This is for compatibility with old code base in which OBJExporter where in sofa::component::misc. -namespace misc { using _objexporter_::OBJExporter ; } +// Import the object in the exporter namespace to avoid having all the object straight in component. +namespace exporter { + using OBJExporter = _objexporter_::OBJExporter; +} // namespace exporter -} +// Import the object in the "old" namespaces to allow smooth update of code base. +using OBJExporter + SOFA_ATTRIBUTE_DEPRECATED__SOFAEXPORTER_NAMESPACE_2106() + = _objexporter_::OBJExporter; +namespace misc { + using OBJExporter + SOFA_ATTRIBUTE_DEPRECATED__SOFAEXPORTER_NAMESPACE_1712() + = _objexporter_::OBJExporter; +} // namespace misc -} +} // namespace sofa::component #endif /* OBJEXPORTER_H_ */ diff --git a/modules/SofaExporter/src/SofaExporter/STLExporter.cpp b/modules/SofaExporter/src/SofaExporter/STLExporter.cpp index 7ac0e8685c2..4cc6b97c4b9 100644 --- a/modules/SofaExporter/src/SofaExporter/STLExporter.cpp +++ b/modules/SofaExporter/src/SofaExporter/STLExporter.cpp @@ -312,27 +312,6 @@ void STLExporter::handleEvent(Event *event) if(d_componentState.getValue() != ComponentState::Valid) return ; - if (KeypressedEvent::checkEventType(event)) - { - KeypressedEvent *ev = static_cast(event); - switch(ev->getKey()) - { - - case 'E': - case 'e': - //todo(18.06) remove the behavior - msg_deprecated() << "Hard coded interaction behavior in component is now a deprecated behavior." - "Scene specific interaction should be implement using an external controller or pythonScriptController." - "Please update your scene because this behavior will be removed in Sofa 18.06"; - if(d_binaryFormat.getValue()) - writeSTLBinary(false); - else - writeSTL(false); - break; - } - } - - if (GUIEvent::checkEventType(event)) { GUIEvent *guiEvent = static_cast(event); diff --git a/modules/SofaExporter/src/SofaExporter/STLExporter.h b/modules/SofaExporter/src/SofaExporter/STLExporter.h index ed4aae10eb9..f0ffb09f666 100644 --- a/modules/SofaExporter/src/SofaExporter/STLExporter.h +++ b/modules/SofaExporter/src/SofaExporter/STLExporter.h @@ -46,12 +46,8 @@ namespace sofa { ////////////////////////////////// DECLARATION ///////////////////////////////////////////////////// -namespace sofa +namespace sofa::component { - -namespace component -{ - namespace _stlexporter_ { @@ -90,20 +86,19 @@ class SOFA_SOFAEXPORTER_API STLExporter : public BaseSimulationExporter VisualModel* m_inputvmodel {nullptr}; }; -} /// _stlexporter_ - -//todo(18.06): remove the old namespaces... -/// Import the object in the "old" namespace to allow smooth update of code base. -namespace misc { - using _stlexporter_::STLExporter ; -} +} // namespace _stlexporter_ namespace exporter { - using _stlexporter_::STLExporter ; -} + using STLExporter = _stlexporter_::STLExporter; +} // namespace exporter -} +// Import the object in the "old" namespaces to allow smooth update of code base. +namespace misc { + using STLExporter + SOFA_ATTRIBUTE_DEPRECATED("v17.12 (PR#372)", "v21.12", "Use sofa::component::STLExporter instead.") + = _stlexporter_::STLExporter; +} // namespace misc -} +} // namespace sofa::component #endif /* STLEXPORTER_H_ */ diff --git a/modules/SofaExporter/src/SofaExporter/VTKExporter.cpp b/modules/SofaExporter/src/SofaExporter/VTKExporter.cpp index b5e34d87ba6..3ca935d6d3a 100644 --- a/modules/SofaExporter/src/SofaExporter/VTKExporter.cpp +++ b/modules/SofaExporter/src/SofaExporter/VTKExporter.cpp @@ -26,13 +26,7 @@ #include #include -namespace sofa -{ - -namespace component -{ - -namespace misc +namespace sofa::component::_vtkexporter_ { int VTKExporterClass = core::RegisterObject("Save State vectors from file at each timestep") @@ -994,8 +988,4 @@ void VTKExporter::bwdInit() (fileFormat.getValue()) ? writeVTKXML() : writeVTKSimple(); } -} - -} - -} +} // namespace sofa::component::_vtkexporter_ diff --git a/modules/SofaExporter/src/SofaExporter/VTKExporter.h b/modules/SofaExporter/src/SofaExporter/VTKExporter.h index c59701f85b7..afede5e8bd4 100644 --- a/modules/SofaExporter/src/SofaExporter/VTKExporter.h +++ b/modules/SofaExporter/src/SofaExporter/VTKExporter.h @@ -31,13 +31,9 @@ #include -namespace sofa +namespace sofa::component { - -namespace component -{ - -namespace misc +namespace _vtkexporter_ { class SOFA_SOFAEXPORTER_API VTKExporter : public core::objectmodel::BaseObject @@ -96,10 +92,19 @@ class SOFA_SOFAEXPORTER_API VTKExporter : public core::objectmodel::BaseObject void handleEvent(sofa::core::objectmodel::Event *) override; }; -} +} // namespace _vtkexporter_ + +namespace exporter { + using VTKExporter = _vtkexporter_::VTKExporter; +} // namespace exporter -} +// Import the object in the "old" namespace to allow smooth update of code base. +namespace misc { + using VTKExporter + SOFA_ATTRIBUTE_DEPRECATED__SOFAEXPORTER_NAMESPACE_2106() + = _vtkexporter_::VTKExporter; +} // namespace misc -} +} // namespace sofa::component #endif /* VTKEXPORTER_H_ */ diff --git a/modules/SofaExporter/src/SofaExporter/config.h.in b/modules/SofaExporter/src/SofaExporter/config.h.in index 3e170d43d22..cbbc8f1273f 100644 --- a/modules/SofaExporter/src/SofaExporter/config.h.in +++ b/modules/SofaExporter/src/SofaExporter/config.h.in @@ -33,4 +33,24 @@ # define SOFA_SOFAEXPORTER_API SOFA_IMPORT_DYNAMIC_LIBRARY #endif +// DEPRECATION MACROS + +#define SOFA_ATTRIBUTE_DEPRECATED__SOFAEXPORTER_NAMESPACE_1712() \ + SOFA_ATTRIBUTE_DEPRECATED( \ + "v17.12 (PR#372)", "v21.12", \ + "This class is now in sofa::component::exporter namespace. ") +#define SOFA_ATTRIBUTE_DEPRECATED__SOFAEXPORTER_NAMESPACE_2106() \ + SOFA_ATTRIBUTE_DEPRECATED( \ + "v21.06", "v21.12", \ + "This class is now in sofa::component::exporter namespace. ") + +#define SOFA_ATTRIBUTE_DISABLED__SOFAEXPORTER_NAMESPACE_1712() \ + SOFA_ATTRIBUTE_DISABLED( \ + "v17.12 (PR#372)", "v21.12", \ + "This class is now in sofa::component::exporter namespace. ") +#define SOFA_ATTRIBUTE_DISABLED__SOFAEXPORTER_NAMESPACE_2106() \ + SOFA_ATTRIBUTE_DISABLED( \ + "v21.06", "v21.12", \ + "This class is now in sofa::component::exporter namespace. ") + #endif diff --git a/modules/SofaGeneralEngine/src/SofaGeneralEngine/GroupFilterYoungModulus.h b/modules/SofaGeneralEngine/src/SofaGeneralEngine/GroupFilterYoungModulus.h index e8f6a3a7aac..3c4b3b2fd07 100644 --- a/modules/SofaGeneralEngine/src/SofaGeneralEngine/GroupFilterYoungModulus.h +++ b/modules/SofaGeneralEngine/src/SofaGeneralEngine/GroupFilterYoungModulus.h @@ -27,7 +27,7 @@ #include #include #include -#include +#include namespace sofa::component::engine { @@ -54,7 +54,7 @@ class GroupFilterYoungModulus : public core::DataEngine void doUpdate() override; //Input - Data > f_groups; ///< Groups + Data > f_groups; ///< Groups Data > f_primitives; ///< not mandatory Data > f_elementsGroup; ///< Vector of groups (each element gives its group //Output diff --git a/modules/SofaGeneralEngine/src/SofaGeneralEngine/GroupFilterYoungModulus.inl b/modules/SofaGeneralEngine/src/SofaGeneralEngine/GroupFilterYoungModulus.inl index 9fdfaf53d0d..0c29402320d 100644 --- a/modules/SofaGeneralEngine/src/SofaGeneralEngine/GroupFilterYoungModulus.inl +++ b/modules/SofaGeneralEngine/src/SofaGeneralEngine/GroupFilterYoungModulus.inl @@ -60,7 +60,7 @@ void GroupFilterYoungModulus::doUpdate() //Input const std::string& strMap = p_mapGroupModulus.getValue(); const helper::vector& primitives = f_primitives.getValue(); - const helper::vector& groups = f_groups.getValue(); + const helper::vector& groups = f_groups.getValue(); const helper::vector& elementsGroup = f_elementsGroup.getValue(); const Real& defaultModulus = p_defaultModulus.getValue(); @@ -78,7 +78,7 @@ void GroupFilterYoungModulus::doUpdate() //does not matter if primitives is empty int maxSize = primitives.size(); - std::map mapMG; + std::map mapMG; //read string and tokenize while(end != std::string::npos ) @@ -123,10 +123,10 @@ void GroupFilterYoungModulus::doUpdate() youngModulusVector.resize(maxSize); std::fill(youngModulusVector.begin(), youngModulusVector.end(), defaultModulus); - typename std::map::const_iterator itMapMG; + typename std::map::const_iterator itMapMG; for (itMapMG = mapMG.begin() ; itMapMG != mapMG.end() ; itMapMG++) { - sofa::core::loader::PrimitiveGroup pg = (*itMapMG).first; + sofa::type::PrimitiveGroup pg = (*itMapMG).first; Real ym = (*itMapMG).second; for (int i=pg.p0 ; igetClassName() << " component is deprecated. It will be removed in v21.12." << msgendl - << " As a replacement, use a BroadPhase component, such as [" << broadPhaseComponentsString - << "]," << msgendl - << " AND a NarrowPhase component, such as [" << narrowPhaseComponentsString << "]." << msgendl - << " " << BruteForceBroadPhase::GetClass()->className << " and " << DirectSAPNarrowPhase::GetClass()->className << " have been automatically added to your scene for backward compatibility."; + msg_deprecated() << this->getClassName() << " component is deprecated. It will be removed in SOFA v21.12" << msgendl + << " As a replacement, use a BroadPhase component such as [" << broadPhaseComponentsString << "] " << msgendl + << " AND a NarrowPhase component such as [" << narrowPhaseComponentsString << "]." << msgendl + << " " << BruteForceBroadPhase::GetClass()->className << " and " << DirectSAPNarrowPhase::GetClass()->className + << " have been automatically added to your scene for backward compatibility."; } void DirectSAP::findAllDetectionComponents(std::vector &broadPhaseComponents, diff --git a/modules/SofaGeneralSimpleFem/src/SofaGeneralSimpleFem/BeamFEMForceField.inl b/modules/SofaGeneralSimpleFem/src/SofaGeneralSimpleFem/BeamFEMForceField.inl index b749ed16ba1..857014d8e98 100644 --- a/modules/SofaGeneralSimpleFem/src/SofaGeneralSimpleFem/BeamFEMForceField.inl +++ b/modules/SofaGeneralSimpleFem/src/SofaGeneralSimpleFem/BeamFEMForceField.inl @@ -397,13 +397,14 @@ void BeamFEMForceField::initLarge(int i, Index a, Index b) dQ = qDiff(quatB, quatA); dQ.normalize(); - dW = dQ.quatToRotationVector(); // TODO(e.coevoet) remove before v20: - // Use of quatToRotationVector instead of toEulerVector: dW = dQ.quatToRotationVector(); - // this is done to keep the old behavior (before the - // correction of the toEulerVector function). If the - // purpose was to obtain the Eulerian vector and not the - // rotation vector please use the following line instead - // dW = dQ.toEulerVector(); + // TODO(e.coevoet) remove before v20.12 + // Use of quatToRotationVector instead of toEulerVector: dW = dQ.quatToRotationVector(); + // this is done to keep the old behavior (before the + // correction of the toEulerVector function). If the + // purpose was to obtain the Eulerian vector and not the + // rotation vector please use the following line instead + // dW = dQ.toEulerVector(); + dW = dQ.quatToRotationVector(); SReal Theta = dW.norm(); @@ -457,14 +458,14 @@ void BeamFEMForceField::accumulateForceLarge( VecDeriv& f, const VecC defaulttype::Quat tmpQ = qDiff(dQ,dQ0); tmpQ.normalize(); - u = tmpQ.quatToRotationVector();// TODO(e.coevoet) remove before v20: - // Use of quatToRotationVector instead of toEulerVector: u = tmpQ.quatToRotationVector(); - // this is done to keep the old behavior (before the - // correction of the toEulerVector function). If the - // purpose was to obtain the Eulerian vector and not the - // rotation vector please use the following line instead - // u = tmpQ.toEulerVector(); - + // TODO(e.coevoet) remove before v20.12 + // Use of quatToRotationVector instead of toEulerVector: u = tmpQ.quatToRotationVector(); + // this is done to keep the old behavior (before the + // correction of the toEulerVector function). If the + // purpose was to obtain the Eulerian vector and not the + // rotation vector please use the following line instead + // u = tmpQ.toEulerVector(); + u = tmpQ.quatToRotationVector(); depl[3] = 0.0; depl[4] = 0.0; depl[5] = 0.0; depl[9] = u[0]; depl[10]= u[1]; depl[11]= u[2]; diff --git a/modules/SofaGeneralSimpleFem/src/SofaGeneralSimpleFem/LengthContainer.h b/modules/SofaGeneralSimpleFem/src/SofaGeneralSimpleFem/LengthContainer.h index 0fa0df3d7de..84fe13c76f2 100644 --- a/modules/SofaGeneralSimpleFem/src/SofaGeneralSimpleFem/LengthContainer.h +++ b/modules/SofaGeneralSimpleFem/src/SofaGeneralSimpleFem/LengthContainer.h @@ -21,4 +21,6 @@ ******************************************************************************/ #pragma once -#error "LengthContainer has been removed in v21.06 (PR2099)." +#include + +SOFA_DISABLED_HEADER_NOT_REPLACED("v21.06 (PR#2099)","v21.06 (PR#2099)") diff --git a/modules/SofaGeneralSimpleFem/src/SofaGeneralSimpleFem/PoissonContainer.h b/modules/SofaGeneralSimpleFem/src/SofaGeneralSimpleFem/PoissonContainer.h index 3861527a552..84fe13c76f2 100644 --- a/modules/SofaGeneralSimpleFem/src/SofaGeneralSimpleFem/PoissonContainer.h +++ b/modules/SofaGeneralSimpleFem/src/SofaGeneralSimpleFem/PoissonContainer.h @@ -21,4 +21,6 @@ ******************************************************************************/ #pragma once -#error "PoissonContainer has been removed in v21.06 (PR2099)." +#include + +SOFA_DISABLED_HEADER_NOT_REPLACED("v21.06 (PR#2099)","v21.06 (PR#2099)") diff --git a/modules/SofaGeneralSimpleFem/src/SofaGeneralSimpleFem/RadiusContainer.h b/modules/SofaGeneralSimpleFem/src/SofaGeneralSimpleFem/RadiusContainer.h index 384a46a4a49..84fe13c76f2 100644 --- a/modules/SofaGeneralSimpleFem/src/SofaGeneralSimpleFem/RadiusContainer.h +++ b/modules/SofaGeneralSimpleFem/src/SofaGeneralSimpleFem/RadiusContainer.h @@ -20,6 +20,7 @@ * Contact information: contact@sofa-framework.org * ******************************************************************************/ #pragma once -#include -#error "RadiusContainer has been removed in v21.06 (PR2099)." +#include + +SOFA_DISABLED_HEADER_NOT_REPLACED("v21.06 (PR#2099)","v21.06 (PR#2099)") diff --git a/modules/SofaGeneralSimpleFem/src/SofaGeneralSimpleFem/StiffnessContainer.h b/modules/SofaGeneralSimpleFem/src/SofaGeneralSimpleFem/StiffnessContainer.h index 9a8371faaa7..84fe13c76f2 100644 --- a/modules/SofaGeneralSimpleFem/src/SofaGeneralSimpleFem/StiffnessContainer.h +++ b/modules/SofaGeneralSimpleFem/src/SofaGeneralSimpleFem/StiffnessContainer.h @@ -21,4 +21,6 @@ ******************************************************************************/ #pragma once -#error "StiffnessContainer has been removed in v21.06 (PR2099)." +#include + +SOFA_DISABLED_HEADER_NOT_REPLACED("v21.06 (PR#2099)","v21.06 (PR#2099)") diff --git a/modules/SofaGraphComponent/SofaGraphComponent_test/SceneChecker_test.cpp b/modules/SofaGraphComponent/SofaGraphComponent_test/SceneChecker_test.cpp index cefc0461ad8..5dfb3f518d5 100644 --- a/modules/SofaGraphComponent/SofaGraphComponent_test/SceneChecker_test.cpp +++ b/modules/SofaGraphComponent/SofaGraphComponent_test/SceneChecker_test.cpp @@ -93,7 +93,7 @@ struct SceneChecker_test : public BaseSimulationTest scene << " \n" << " \n" << missStr - << " \n" + << " \n" << " \n"; Node::SPtr root = SceneLoaderXML::loadFromMemory ("testscene", @@ -215,8 +215,8 @@ struct SceneChecker_test : public BaseSimulationTest void checkUsingAlias(bool sceneWithAlias) { - std::string withAlias = "Triangle"; - std::string withoutAlias = "TriangleCollisionModel"; + std::string withAlias = "Mesh"; + std::string withoutAlias = "MeshTopology"; std::string componentName = sceneWithAlias ? withAlias : withoutAlias; std::stringstream scene; @@ -224,7 +224,6 @@ struct SceneChecker_test : public BaseSimulationTest << " \n" << " \n" << " \n" - << " \n" << " <" << componentName << "/> \n" << " \n"; diff --git a/modules/SofaGraphComponent/src/SofaGraphComponent/BackgroundSetting.h b/modules/SofaGraphComponent/src/SofaGraphComponent/BackgroundSetting.h deleted file mode 100644 index 7260ca454b2..00000000000 --- a/modules/SofaGraphComponent/src/SofaGraphComponent/BackgroundSetting.h +++ /dev/null @@ -1,22 +0,0 @@ -/****************************************************************************** -* SOFA, Simulation Open-Framework Architecture * -* (c) 2006 INRIA, USTL, UJF, CNRS, MGH * -* * -* This program is free software; you can redistribute it and/or modify it * -* under the terms of the GNU Lesser General Public License as published by * -* the Free Software Foundation; either version 2.1 of the License, or (at * -* your option) any later version. * -* * -* This program is distributed in the hope that it will be useful, but WITHOUT * -* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or * -* FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License * -* for more details. * -* * -* You should have received a copy of the GNU Lesser General Public License * -* along with this program. If not, see . * -******************************************************************************* -* Authors: The SOFA Team and external contributors (see Authors.txt) * -* * -* Contact information: contact@sofa-framework.org * -******************************************************************************/ -#error This file has been moved to a new location for release 19.06. You need to update your code by replacing #include by #include -SOFA_DEPRECATED_HEADER(v21.12, "sofa/gui/ArgumentParser") +SOFA_DEPRECATED_HEADER("v21.06", "v21.12", "sofa/gui/ArgumentParser") namespace sofa::helper { diff --git a/modules/SofaGuiCommon/src/sofa/gui/SofaGUI.h b/modules/SofaGuiCommon/src/sofa/gui/SofaGUI.h deleted file mode 100644 index f698cfc3808..00000000000 --- a/modules/SofaGuiCommon/src/sofa/gui/SofaGUI.h +++ /dev/null @@ -1,25 +0,0 @@ -/****************************************************************************** -* SOFA, Simulation Open-Framework Architecture * -* (c) 2006 INRIA, USTL, UJF, CNRS, MGH * -* * -* This program is free software; you can redistribute it and/or modify it * -* under the terms of the GNU General Public License as published by the Free * -* Software Foundation; either version 2 of the License, or (at your option) * -* any later version. * -* * -* This program is distributed in the hope that it will be useful, but WITHOUT * -* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or * -* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for * -* more details. * -* * -* You should have received a copy of the GNU General Public License along * -* with this program. If not, see . * -******************************************************************************* -* Authors: The SOFA Team and external contributors (see Authors.txt) * -* * -* Contact information: contact@sofa-framework.org * -******************************************************************************/ -#pragma once -#include - -SOFA_DEPRECATED_HEADER(v21.06, "sofa/gui/config.h") diff --git a/modules/SofaGuiQt/CMakeLists.txt b/modules/SofaGuiQt/CMakeLists.txt index ef59f5377a6..378a6e3198c 100644 --- a/modules/SofaGuiQt/CMakeLists.txt +++ b/modules/SofaGuiQt/CMakeLists.txt @@ -154,7 +154,6 @@ set(MOC_HEADER_FILES ) set(HEADER_FILES ${SRC_ROOT}/config.h.in - ${SRC_ROOT}/SofaGuiQt.h ${SRC_ROOT}/qt.conf.h ${SRC_ROOT}/FileManagement.h ${SRC_ROOT}/GraphListenerQListView.h diff --git a/modules/SofaGuiQt/src/sofa/gui/qt/DataFilenameWidget.cpp b/modules/SofaGuiQt/src/sofa/gui/qt/DataFilenameWidget.cpp index 3c7633a9e2c..afa61f1be0c 100644 --- a/modules/SofaGuiQt/src/sofa/gui/qt/DataFilenameWidget.cpp +++ b/modules/SofaGuiQt/src/sofa/gui/qt/DataFilenameWidget.cpp @@ -91,7 +91,7 @@ void DataFileNameWidget::raiseDialog() if (s.isNull() ) return; fileName=std::string (s.toStdString()); - fileName = sofa::helper::system::FileRepository::relativeToPath(fileName,SofaPath,false); + fileName = sofa::helper::system::FileRepository::relativeToPath(fileName,SofaPath); openFilePath->setText( QString( fileName.c_str() ) ); } diff --git a/modules/SofaGuiQt/src/sofa/gui/qt/ModifyObject.cpp b/modules/SofaGuiQt/src/sofa/gui/qt/ModifyObject.cpp index efae840af8b..e7d92fdba4c 100644 --- a/modules/SofaGuiQt/src/sofa/gui/qt/ModifyObject.cpp +++ b/modules/SofaGuiQt/src/sofa/gui/qt/ModifyObject.cpp @@ -335,7 +335,7 @@ void ModifyObject::createDialog(core::objectmodel::Base* base) void ModifyObject::clearMessages() { - basenode->clearWarnings(); + basenode->clearLoggedMessages(); messageEdit->clear(); std::stringstream tmp; diff --git a/modules/SofaGuiQt/src/sofa/gui/qt/QDisplayPropertyWidget.cpp b/modules/SofaGuiQt/src/sofa/gui/qt/QDisplayPropertyWidget.cpp index 11407f30f86..936b2f45192 100644 --- a/modules/SofaGuiQt/src/sofa/gui/qt/QDisplayPropertyWidget.cpp +++ b/modules/SofaGuiQt/src/sofa/gui/qt/QDisplayPropertyWidget.cpp @@ -608,7 +608,7 @@ void QDisplayPropertyWidget::clearComponentOutput() QVariant variant = signalEmitter->property("base"); sofa::core::objectmodel::Base* base = static_cast(variant.value()); if(base) - base->clearOutputs(); + base->clearLoggedMessages(); } void QDisplayPropertyWidget::clearComponentWarning() @@ -620,7 +620,7 @@ void QDisplayPropertyWidget::clearComponentWarning() QVariant variant = signalEmitter->property("base"); sofa::core::objectmodel::Base* base = static_cast(variant.value()); if(base) - base->clearWarnings(); + base->clearLoggedMessages(); } QTreeWidgetItem* QDisplayPropertyWidget::findComponent(const QString& component) const diff --git a/modules/SofaGuiQt/src/sofa/gui/qt/SofaGuiQt.h b/modules/SofaGuiQt/src/sofa/gui/qt/SofaGuiQt.h deleted file mode 100644 index cb367b9f35c..00000000000 --- a/modules/SofaGuiQt/src/sofa/gui/qt/SofaGuiQt.h +++ /dev/null @@ -1,25 +0,0 @@ -/****************************************************************************** -* SOFA, Simulation Open-Framework Architecture * -* (c) 2006 INRIA, USTL, UJF, CNRS, MGH * -* * -* This program is free software; you can redistribute it and/or modify it * -* under the terms of the GNU General Public License as published by the Free * -* Software Foundation; either version 2 of the License, or (at your option) * -* any later version. * -* * -* This program is distributed in the hope that it will be useful, but WITHOUT * -* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or * -* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for * -* more details. * -* * -* You should have received a copy of the GNU General Public License along * -* with this program. If not, see . * -******************************************************************************* -* Authors: The SOFA Team and external contributors (see Authors.txt) * -* * -* Contact information: contact@sofa-framework.org * -******************************************************************************/ -#pragma once -#include - -SOFA_DEPRECATED_HEADER(v21.06, "sofa/gui/qt/config.h") diff --git a/modules/SofaMiscCollision/src/SofaMiscCollision/CapsuleModel.cpp b/modules/SofaMiscCollision/src/SofaMiscCollision/CapsuleModel.cpp index e56bacb0eee..2f424233438 100644 --- a/modules/SofaMiscCollision/src/SofaMiscCollision/CapsuleModel.cpp +++ b/modules/SofaMiscCollision/src/SofaMiscCollision/CapsuleModel.cpp @@ -30,11 +30,6 @@ using namespace sofa::defaulttype; int CapsuleCollisionModelClass = core::RegisterObject("Collision model which represents a set of Capsules") .add< CapsuleCollisionModel >() - - .addAlias("Capsule") - .addAlias("CapsuleModel") - .addAlias("TCapsuleModel") - ; template class SOFA_MISC_COLLISION_API TCapsule; diff --git a/modules/SofaMiscCollision/src/SofaMiscCollision/CapsuleModel.h b/modules/SofaMiscCollision/src/SofaMiscCollision/CapsuleModel.h index 801f2b3ecc7..786f9af4c05 100644 --- a/modules/SofaMiscCollision/src/SofaMiscCollision/CapsuleModel.h +++ b/modules/SofaMiscCollision/src/SofaMiscCollision/CapsuleModel.h @@ -71,6 +71,7 @@ class TCapsule : public core::TCollisionElementIterator< CapsuleCollisionModel & other)const; }; +using Capsule = TCapsule; /** *A capsule model is a set of capsules. It is linked to a topology more precisely edge topology since a capsule @@ -187,15 +188,9 @@ inline TCapsule::TCapsule(ParentModel* model, Index index) template inline TCapsule::TCapsule(const core::CollisionElementIterator& i) : core::TCollisionElementIterator(static_cast(i.getCollisionModel()), i.getIndex()) -{ -} - -template using TCapsuleModel [[deprecated("The TCapsuleModel is now deprecated, please use CapsuleCollisionModel instead. Compatibility stops at v20.06")]] = CapsuleCollisionModel; -using CapsuleModel [[deprecated("The CapsuleModel is now deprecated, please use CapsuleCollisionModel instead. Compatibility stops at v20.06")]] = CapsuleCollisionModel; -using Capsule = TCapsule; - +{} -#if !defined(SOFA_COMPONENT_COLLISION_CAPSULECOLLISIONMODEL_CPP) +#if !defined(SOFA_COMPONENT_COLLISION_CAPSULECOLLISIONMODEL_CPP) extern template class SOFA_MISC_COLLISION_API TCapsule; extern template class SOFA_MISC_COLLISION_API CapsuleCollisionModel; #endif diff --git a/modules/SofaMiscCollision/src/SofaMiscCollision/OBBModel.cpp b/modules/SofaMiscCollision/src/SofaMiscCollision/OBBModel.cpp index e48233c4f82..17f72c1a2a9 100644 --- a/modules/SofaMiscCollision/src/SofaMiscCollision/OBBModel.cpp +++ b/modules/SofaMiscCollision/src/SofaMiscCollision/OBBModel.cpp @@ -32,10 +32,6 @@ using namespace helper; int OBBModelClass = core::RegisterObject("Collision model which represents a set of OBBs") .add< OBBCollisionModel >() - - .addAlias("OBB") - .addAlias("OBBModel") - .addAlias("TOBBModel") ; template class SOFA_MISC_COLLISION_API OBBCollisionModel; diff --git a/modules/SofaMiscCollision/src/SofaMiscCollision/OBBModel.h b/modules/SofaMiscCollision/src/SofaMiscCollision/OBBModel.h index 778858b459a..3e82b42ab96 100644 --- a/modules/SofaMiscCollision/src/SofaMiscCollision/OBBModel.h +++ b/modules/SofaMiscCollision/src/SofaMiscCollision/OBBModel.h @@ -120,6 +120,7 @@ class TOBB : public core::TCollisionElementIterator< OBBCollisionModel; template< class TDataTypes> @@ -262,17 +263,11 @@ inline TOBB::TOBB(ParentModel* model, Index index) template inline TOBB::TOBB(const core::CollisionElementIterator& i) : core::TCollisionElementIterator(static_cast(i.getCollisionModel()), i.getIndex()) -{ -} - - -using OBBModel [[deprecated("The OBBModel is now deprecated, please use OBBCollisionModel instead. Compatibility stops at v20.06")]] = OBBCollisionModel; -using OBB = TOBB; +{} -#if !defined(SOFA_COMPONENT_COLLISION_OBBMODEL_CPP) +#if !defined(SOFA_COMPONENT_COLLISION_OBBMODEL_CPP) extern template class SOFA_MISC_COLLISION_API TOBB; extern template class SOFA_MISC_COLLISION_API OBBCollisionModel; - #endif } // namespace sofa::component::collision diff --git a/modules/SofaMiscCollision/src/SofaMiscCollision/RigidCapsuleModel.cpp b/modules/SofaMiscCollision/src/SofaMiscCollision/RigidCapsuleModel.cpp index c40ee778269..88ded296513 100644 --- a/modules/SofaMiscCollision/src/SofaMiscCollision/RigidCapsuleModel.cpp +++ b/modules/SofaMiscCollision/src/SofaMiscCollision/RigidCapsuleModel.cpp @@ -32,10 +32,6 @@ using namespace helper; int RigidCapsuleCollisionModelClass = core::RegisterObject("Collision model which represents a set of rigid capsules") .add< CapsuleCollisionModel >() - - .addAlias("RigidCapsule") - .addAlias("RigidCapsuleModel") - .addAlias("RigidCapsuleCollisionModel") ; template class SOFA_MISC_COLLISION_API TCapsule; diff --git a/modules/SofaMiscCollision/src/SofaMiscCollision/RigidCapsuleModel.h b/modules/SofaMiscCollision/src/SofaMiscCollision/RigidCapsuleModel.h index 5a89e42ac96..773050007a5 100644 --- a/modules/SofaMiscCollision/src/SofaMiscCollision/RigidCapsuleModel.h +++ b/modules/SofaMiscCollision/src/SofaMiscCollision/RigidCapsuleModel.h @@ -79,6 +79,7 @@ class TCapsule > : public core::TColl bool shareSameVertex(const TCapsule > & other)const; }; +using RigidCapsule = TCapsule; /** @@ -180,17 +181,11 @@ inline TCapsule >::TCapsule(ParentMod template inline TCapsule >::TCapsule(const core::CollisionElementIterator& i) : core::TCollisionElementIterator(static_cast(i.getCollisionModel()), i.getIndex()) -{ -} - -using RigidCapsuleModel [[deprecated("The RigidCapsuleModel is now deprecated, please use CapsuleCollisionModel instead. Compatibility stops at v20.06")]] = CapsuleCollisionModel; -using RigidCapsuleCollisionModel [[deprecated("The RigidCapsuleCollisionModel is now deprecated, please use CapsuleCollisionModel instead. Compatibility stops at v20.06")]] = CapsuleCollisionModel; -using RigidCapsule = TCapsule; +{} -#if !defined(SOFA_COMPONENT_COLLISION_RIGIDCAPSULECOLLISIONMODEL_CPP) +#if !defined(SOFA_COMPONENT_COLLISION_RIGIDCAPSULECOLLISIONMODEL_CPP) extern template class SOFA_MISC_COLLISION_API TCapsule; extern template class SOFA_MISC_COLLISION_API CapsuleCollisionModel; - #endif } // namespace sofa::component::collision diff --git a/modules/SofaMiscCollision/src/SofaMiscCollision/TetrahedronModel.cpp b/modules/SofaMiscCollision/src/SofaMiscCollision/TetrahedronModel.cpp index 9b4e97f48e2..1719d2c94f3 100644 --- a/modules/SofaMiscCollision/src/SofaMiscCollision/TetrahedronModel.cpp +++ b/modules/SofaMiscCollision/src/SofaMiscCollision/TetrahedronModel.cpp @@ -44,8 +44,6 @@ using namespace sofa::defaulttype; int TetrahedronCollisionModelClass = core::RegisterObject("collision model using a tetrahedral mesh, as described in BaseMeshTopology") .add< TetrahedronCollisionModel >() - .addAlias("Tetrahedron") - .addAlias("TetrahedronModel") ; TetrahedronCollisionModel::TetrahedronCollisionModel() diff --git a/modules/SofaMiscCollision/src/SofaMiscCollision/TetrahedronModel.h b/modules/SofaMiscCollision/src/SofaMiscCollision/TetrahedronModel.h index 4f5323eb635..fceb2123d90 100644 --- a/modules/SofaMiscCollision/src/SofaMiscCollision/TetrahedronModel.h +++ b/modules/SofaMiscCollision/src/SofaMiscCollision/TetrahedronModel.h @@ -31,13 +31,7 @@ #include -namespace sofa -{ - -namespace component -{ - -namespace collision +namespace sofa::component::collision { class TetrahedronCollisionModel; @@ -194,12 +188,6 @@ extern template SOFA_MISC_COLLISION_API core::behavior::MechanicalState. * -******************************************************************************* -* Authors: The SOFA Team and external contributors (see Authors.txt) * -* * -* Contact information: contact@sofa-framework.org * -******************************************************************************/ -#include "LennardJonesForceField_test.inl" -#include - -namespace sofa { - - using namespace sofa::defaulttype; - - template struct LennardJonesForceField_test; - -} diff --git a/modules/SofaMiscFem/SofaMiscFem_test/LennardJonesForceField_test.h b/modules/SofaMiscFem/SofaMiscFem_test/LennardJonesForceField_test.h deleted file mode 100644 index 255418a538e..00000000000 --- a/modules/SofaMiscFem/SofaMiscFem_test/LennardJonesForceField_test.h +++ /dev/null @@ -1,59 +0,0 @@ -/****************************************************************************** -* SOFA, Simulation Open-Framework Architecture * -* (c) 2006 INRIA, USTL, UJF, CNRS, MGH * -* * -* This program is free software; you can redistribute it and/or modify it * -* under the terms of the GNU General Public License as published by the Free * -* Software Foundation; either version 2 of the License, or (at your option) * -* any later version. * -* * -* This program is distributed in the hope that it will be useful, but WITHOUT * -* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or * -* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for * -* more details. * -* * -* You should have received a copy of the GNU General Public License along * -* with this program. If not, see . * -******************************************************************************* -* Authors: The SOFA Team and external contributors (see Authors.txt) * -* * -* Contact information: contact@sofa-framework.org * -******************************************************************************/ -#ifndef SOFA_LENNARDJONESFORCEFIELD_TEST_H -#define SOFA_LENNARDJONESFORCEFIELD_TEST_H - -#include -using sofa::testing::BaseSimulationTest; - -#include -#include - -//Including Simulation -#include - -namespace sofa { - - template< class DataTypes> - struct LennardJonesForceField_test : public BaseSimulationTest - { - typedef component::container::MechanicalObject DOFs; - typedef typename DOFs::Real Real; - typedef typename DOFs::Coord Coord; - typedef typename DOFs::Deriv Deriv; - - /// Create sun-planet system - simulation::Node::SPtr createSunPlanetSystem( - simulation::Node::SPtr root, - double mSun, - double mPlanet, - double g, - Coord xSun, - Deriv vSun, - Coord xPlanet, - Deriv vPlanet); - - }; - -} // namespace sofa - -#endif diff --git a/modules/SofaMiscFem/SofaMiscFem_test/LennardJonesForceField_test.inl b/modules/SofaMiscFem/SofaMiscFem_test/LennardJonesForceField_test.inl deleted file mode 100644 index 8ddd45db0df..00000000000 --- a/modules/SofaMiscFem/SofaMiscFem_test/LennardJonesForceField_test.inl +++ /dev/null @@ -1,123 +0,0 @@ -/****************************************************************************** -* SOFA, Simulation Open-Framework Architecture * -* (c) 2006 INRIA, USTL, UJF, CNRS, MGH * -* * -* This program is free software; you can redistribute it and/or modify it * -* under the terms of the GNU General Public License as published by the Free * -* Software Foundation; either version 2 of the License, or (at your option) * -* any later version. * -* * -* This program is distributed in the hope that it will be useful, but WITHOUT * -* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or * -* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for * -* more details. * -* * -* You should have received a copy of the GNU General Public License along * -* with this program. If not, see . * -******************************************************************************* -* Authors: The SOFA Team and external contributors (see Authors.txt) * -* * -* Contact information: contact@sofa-framework.org * -******************************************************************************/ -#ifndef SOFA_LENNARDJONESFORCEFIELD_TEST_INL -#define SOFA_LENNARDJONESFORCEFIELD_TEST_INL - -#include "LennardJonesForceField_test.h" - -// Solvers -#include -#include -#include - -// Box roi -#include -#include -#include - -// Constraint -#include -#include -#include -#include - -// ForceField -#include -#include - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include - -namespace sofa -{ - - typedef component::container::MechanicalObject MechanicalObject3; - typedef component::mass::UniformMass UniformMass3; - typedef component::projectiveconstraintset::FixedConstraint FixedConstraint3; - - /// Create a scene with a regular grid and an affine constraint for patch test - - template - simulation::Node::SPtr LennardJonesForceField_test::createSunPlanetSystem( - simulation::Node::SPtr root, - double mSun, - double mPlanet, - double g, - Coord xSun, - Deriv vSun, - Coord xPlanet, - Deriv vPlanet) - { - - // Mechanical object with 2 dofs: first sun, second planet - MechanicalObject3::SPtr sunPlanet_dof = modeling::addNew(root, "sunPlanet_MO"); - - // Set position and velocity - sunPlanet_dof->resize(2); - // Position - MechanicalObject3::VecCoord positions(2); - positions[0] = xSun; - positions[1] = xPlanet; - MechanicalObject3::WriteVecCoord xdof = sunPlanet_dof->writePositions(); - sofa::testing::copyToData(xdof, positions); - // Velocity - MechanicalObject3::VecDeriv velocities(2); - velocities[0] = vSun; - velocities[1] = vPlanet; - MechanicalObject3::WriteVecDeriv vdof = sunPlanet_dof->writeVelocities(); - sofa::testing::copyToData(vdof, velocities); - - // Fix sun - FixedConstraint3::SPtr fixed = modeling::addNew(root, "FixedSun"); - fixed->addConstraint(0); - - // Uniform Mass - UniformMass3::SPtr massPtr = modeling::addNew(root, "mass"); - massPtr->d_totalMass.setValue(mPlanet + mSun); - - // Lennard Jones Force Field - typename component::forcefield::LennardJonesForceField::SPtr ff = - modeling::addNew >(root); - // Set froce field parameters - ff->setAlpha(1); - ff->setBeta(-1); - ff->setAInit(mPlanet*mSun*g); - - return root; - - } - - -}// sofa - -#endif // SOFA_LENNARDJONESFORCEFIELD_TEST_INL - diff --git a/modules/SofaMiscForceField/CMakeLists.txt b/modules/SofaMiscForceField/CMakeLists.txt index bb5c1eb4151..b0c836e87ea 100644 --- a/modules/SofaMiscForceField/CMakeLists.txt +++ b/modules/SofaMiscForceField/CMakeLists.txt @@ -23,16 +23,6 @@ list(APPEND SOURCE_FILES ${SOFAMISCFORCEFIELD_SRC}/MeshMatrixMass.cpp ) -if(SOFA_WITH_DEPRECATED_COMPONENTS) - list(APPEND HEADER_FILES - ${SOFAMISCFORCEFIELD_SRC}/LennardJonesForceField.h - ${SOFAMISCFORCEFIELD_SRC}/LennardJonesForceField.inl - ) - list(APPEND SOURCE_FILES - ${SOFAMISCFORCEFIELD_SRC}/LennardJonesForceField.cpp - ) -endif() - sofa_find_package(SofaFramework REQUIRED) # SofaHelper sofa_find_package(SofaBaseMechanics REQUIRED) sofa_find_package(SofaDeformable REQUIRED) @@ -63,4 +53,4 @@ cmake_dependent_option(SOFAMISCFORCEFIELD_BUILD_TESTS "Compile the automatic tes if(SOFAMISCFORCEFIELD_BUILD_TESTS) enable_testing() add_subdirectory(SofaMiscForceField_test) -endif() \ No newline at end of file +endif() diff --git a/modules/SofaMiscForceField/src/SofaMiscForceField/LennardJonesForceField.cpp b/modules/SofaMiscForceField/src/SofaMiscForceField/LennardJonesForceField.cpp deleted file mode 100644 index 732de519d48..00000000000 --- a/modules/SofaMiscForceField/src/SofaMiscForceField/LennardJonesForceField.cpp +++ /dev/null @@ -1,42 +0,0 @@ -/****************************************************************************** -* SOFA, Simulation Open-Framework Architecture * -* (c) 2006 INRIA, USTL, UJF, CNRS, MGH * -* * -* This program is free software; you can redistribute it and/or modify it * -* under the terms of the GNU Lesser General Public License as published by * -* the Free Software Foundation; either version 2.1 of the License, or (at * -* your option) any later version. * -* * -* This program is distributed in the hope that it will be useful, but WITHOUT * -* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or * -* FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License * -* for more details. * -* * -* You should have received a copy of the GNU Lesser General Public License * -* along with this program. If not, see . * -******************************************************************************* -* Authors: The SOFA Team and external contributors (see Authors.txt) * -* * -* Contact information: contact@sofa-framework.org * -******************************************************************************/ -#define SOFA_COMPONENT_FORCEFIELD_LENNARDJONESFORCEFIELD_CPP - -#include -#include -#include - -namespace sofa::component::forcefield -{ - -using namespace sofa::defaulttype; -using namespace core::behavior; - -int LennardJonesForceFieldClass = core::RegisterObject("Lennard-Jones forces for fluids") - .add< LennardJonesForceField >() - - ; - -template class SOFA_SOFAMISCFORCEFIELD_API LennardJonesForceField; - - -} // namespace sofa::component::forcefield diff --git a/modules/SofaMiscForceField/src/SofaMiscForceField/LennardJonesForceField.h b/modules/SofaMiscForceField/src/SofaMiscForceField/LennardJonesForceField.h deleted file mode 100644 index a89aaaf2420..00000000000 --- a/modules/SofaMiscForceField/src/SofaMiscForceField/LennardJonesForceField.h +++ /dev/null @@ -1,99 +0,0 @@ -/****************************************************************************** -* SOFA, Simulation Open-Framework Architecture * -* (c) 2006 INRIA, USTL, UJF, CNRS, MGH * -* * -* This program is free software; you can redistribute it and/or modify it * -* under the terms of the GNU Lesser General Public License as published by * -* the Free Software Foundation; either version 2.1 of the License, or (at * -* your option) any later version. * -* * -* This program is distributed in the hope that it will be useful, but WITHOUT * -* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or * -* FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License * -* for more details. * -* * -* You should have received a copy of the GNU Lesser General Public License * -* along with this program. If not, see . * -******************************************************************************* -* Authors: The SOFA Team and external contributors (see Authors.txt) * -* * -* Contact information: contact@sofa-framework.org * -******************************************************************************/ -#pragma once - -#include - -#include -#include -#include - - -namespace sofa::component::forcefield -{ - -template -class LennardJonesForceField : public sofa::core::behavior::ForceField -{ -public: - SOFA_CLASS(SOFA_TEMPLATE(LennardJonesForceField, DataTypes), SOFA_TEMPLATE(core::behavior::ForceField, DataTypes)); - - typedef sofa::core::behavior::ForceField Inherit; - typedef typename DataTypes::VecCoord VecCoord; - typedef typename DataTypes::VecDeriv VecDeriv; - typedef typename DataTypes::Coord Coord; - typedef typename DataTypes::Deriv Deriv; - typedef typename Coord::value_type Real; - - typedef core::objectmodel::Data DataVecDeriv; - typedef core::objectmodel::Data DataVecCoord; - -protected: - Real a,b; - Data aInit; ///< a for Gravitational FF which corresponds to G*m1*m2 alpha should be equal to 1 and beta to 0. - Data alpha; ///< Alpha - Data beta; ///< Beta - Data dmax; ///< DMax - Data fmax; ///< FMax - Data d0; ///< d0 - Data p0; ///< p0 - Data damping; ///< Damping - - struct DForce - { - unsigned int a,b; - Real df; - }; - - sofa::helper::vector dforces; - - LennardJonesForceField(); -public: - - void setAInit(Real v) { aInit.setValue(v); } - void setAlpha(Real v) { alpha.setValue(v); } - void setBeta(Real v) { beta.setValue(v); } - void setFMax(Real v) { fmax.setValue(v); } - void setDMax(Real v) { dmax.setValue(v); } - void setD0(Real v) { d0.setValue(v); } - void setP0(Real v) { p0.setValue(v); } - void setDamping(Real v) { damping.setValue(v); } - - - void init() override; - - void addForce(const core::MechanicalParams* mparams, DataVecDeriv& d_f, const DataVecCoord& d_x, const DataVecDeriv& d_v) override; - void addDForce(const core::MechanicalParams* mparams, DataVecDeriv& d_df, const DataVecDeriv& d_dx) override; - SReal getPotentialEnergy(const core::MechanicalParams*, const DataVecCoord& d_x) const override; - - void draw(const core::visual::VisualParams* vparams) override; - -}; - -#if !defined(SOFA_COMPONENT_FORCEFIELD_LENNARDJONESFORCEFIELD_CPP) - -extern template class SOFA_SOFAMISCFORCEFIELD_API LennardJonesForceField; - - -#endif // !defined(SOFA_COMPONENT_FORCEFIELD_LENNARDJONESFORCEFIELD_CPP) - -} // namespace sofa::component::forcefield diff --git a/modules/SofaMiscForceField/src/SofaMiscForceField/LennardJonesForceField.inl b/modules/SofaMiscForceField/src/SofaMiscForceField/LennardJonesForceField.inl deleted file mode 100644 index a920d159395..00000000000 --- a/modules/SofaMiscForceField/src/SofaMiscForceField/LennardJonesForceField.inl +++ /dev/null @@ -1,234 +0,0 @@ -/****************************************************************************** -* SOFA, Simulation Open-Framework Architecture * -* (c) 2006 INRIA, USTL, UJF, CNRS, MGH * -* * -* This program is free software; you can redistribute it and/or modify it * -* under the terms of the GNU Lesser General Public License as published by * -* the Free Software Foundation; either version 2.1 of the License, or (at * -* your option) any later version. * -* * -* This program is distributed in the hope that it will be useful, but WITHOUT * -* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or * -* FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License * -* for more details. * -* * -* You should have received a copy of the GNU Lesser General Public License * -* along with this program. If not, see . * -******************************************************************************* -* Authors: The SOFA Team and external contributors (see Authors.txt) * -* * -* Contact information: contact@sofa-framework.org * -******************************************************************************/ -#pragma once - -#include -#include -#include -#include - -namespace sofa::component::forcefield -{ - -template -LennardJonesForceField::LennardJonesForceField() - : a(1) - , b(1) - , aInit (initData(&aInit ,Real(0), "aInit" ,"a for Gravitational FF which corresponds to G*m1*m2 alpha should be equal to 1 and beta to 0.")) - , alpha (initData(&alpha ,Real(6), "alpha" ,"Alpha")) - , beta (initData(&beta ,Real(12),"beta" ,"Beta")) - , dmax (initData(&dmax ,Real(2), "dmax" ,"DMax")) - , fmax (initData(&fmax ,Real(1), "fmax" ,"FMax")) - , d0 (initData(&d0 ,Real(1), "d0" ,"d0")) - , p0 (initData(&p0 ,Real(1), "p0" ,"p0")) - , damping(initData(&damping,Real(0), "damping","Damping")) -{ -} - -template -void LennardJonesForceField::init() -{ - this->Inherit::init(); - - assert( this->mstate ); - - if(aInit.getValue()!=0) - a = aInit.getValue(); - else - { - a = (p0.getValue() * (Real)pow(d0.getValue(),alpha.getValue())) / (1-alpha.getValue()/beta.getValue()); - b = (p0.getValue() * (Real)pow(d0.getValue(),beta.getValue())) / (beta.getValue()/alpha.getValue()-1); - - // Validity check: compute force and potential at d0 - Real f0 = a*alpha.getValue()*(Real)pow(d0.getValue(),-alpha.getValue()-1)-b*beta.getValue()*(Real)pow(d0.getValue(),-beta.getValue()-1); - - msg_error_when(fabs(f0) > 0.001) << "Lennard-Jones initialization failed: f0=" << f0; - Real cp0 = (a*(Real)pow(d0.getValue(),-alpha.getValue())-b*(Real)pow(d0.getValue(),-beta.getValue())); - - msg_error_when(fabs(cp0 / p0.getValue() - 1) > 0.001) << "Lennard-Jones initialization failed: cp0=" << cp0; - - // Debug - if (this->f_printLog.getValue()) - { - std::stringstream tmp; - for (Real d = 0; d> *this; -// -// return; -//} - void OglColorMap::init() { reinit(); @@ -124,7 +109,6 @@ OglColorMap* OglColorMap::getDefault() if (defaultOglColorMap == nullptr) { defaultOglColorMap = sofa::core::objectmodel::New< OglColorMap >(); std::string tmp(""); - //defaultOglColorMap->initOld(tmp); // TODO: replace initOld() with init() defaultOglColorMap->init(); } return defaultOglColorMap.get(); diff --git a/modules/SofaOpenglVisual/src/SofaOpenglVisual/OglColorMap.h b/modules/SofaOpenglVisual/src/SofaOpenglVisual/OglColorMap.h index b8d14c02a3a..a678a709eea 100644 --- a/modules/SofaOpenglVisual/src/SofaOpenglVisual/OglColorMap.h +++ b/modules/SofaOpenglVisual/src/SofaOpenglVisual/OglColorMap.h @@ -70,8 +70,6 @@ class SOFA_OPENGL_VISUAL_API OglColorMap : public sofa::core::visual::VisualMode sofa::helper::ColorMap m_colorMap; GLuint texture; - void initOld(const std::string &data); - void init() override; void reinit() override; diff --git a/modules/SofaOpenglVisual/src/SofaOpenglVisual/OglLabel.cpp b/modules/SofaOpenglVisual/src/SofaOpenglVisual/OglLabel.cpp index 2249c0c1268..1e6c04a62c6 100644 --- a/modules/SofaOpenglVisual/src/SofaOpenglVisual/OglLabel.cpp +++ b/modules/SofaOpenglVisual/src/SofaOpenglVisual/OglLabel.cpp @@ -75,7 +75,7 @@ void OglLabel::parse(BaseObjectDescription *arg) /// A send the message after the parsing of the base class so that the "name" of the component /// is correctly reported in the message. - msg_deprecated() << "Attribute color='contrast' is deprecated since Sofa 17.06. " << msgendl + msg_deprecated() << "Attribute color='contrast' is deprecated since SOFA v17.06" << msgendl << "Using deprecated attributes may result in lower performance or un-expected behaviors" << msgendl << "To remove this message you need to update your scene by replacing color='contrast' with " " selectContrastingColor='true'" ; diff --git a/modules/SofaOpenglVisual/src/SofaOpenglVisual/OglLineAxis.cpp b/modules/SofaOpenglVisual/src/SofaOpenglVisual/OglLineAxis.cpp index 64e741340d9..418caf6a660 100644 --- a/modules/SofaOpenglVisual/src/SofaOpenglVisual/OglLineAxis.cpp +++ b/modules/SofaOpenglVisual/src/SofaOpenglVisual/OglLineAxis.cpp @@ -23,7 +23,7 @@ #include "OglLineAxis.h" #include #include -#include +#include namespace sofa diff --git a/modules/SofaOpenglVisual/src/SofaOpenglVisual/OglModel.cpp b/modules/SofaOpenglVisual/src/SofaOpenglVisual/OglModel.cpp index 29b4dfdf73d..8bcca41fb3b 100644 --- a/modules/SofaOpenglVisual/src/SofaOpenglVisual/OglModel.cpp +++ b/modules/SofaOpenglVisual/src/SofaOpenglVisual/OglModel.cpp @@ -23,7 +23,7 @@ #include #include #include -#include +#include #include #include #include @@ -134,7 +134,7 @@ void OglModel::parse(core::objectmodel::BaseObjectDescription* arg) { if (arg->getAttribute("isToPrint")!=nullptr) { - msg_deprecated() << "The 'isToPrint' data field has been deprecated in Sofa 19.06 due to lack of consistency in how it should work." << msgendl + msg_deprecated() << "The 'isToPrint' data field has been deprecated in SOFA v19.06 due to lack of consistency in how it should work." << msgendl "Please contact sofa-dev team in case you need similar."; } Inherit1::parse(arg); diff --git a/modules/SofaOpenglVisual/src/SofaOpenglVisual/OglSceneFrame.h b/modules/SofaOpenglVisual/src/SofaOpenglVisual/OglSceneFrame.h index 473f187f354..e87496837c6 100644 --- a/modules/SofaOpenglVisual/src/SofaOpenglVisual/OglSceneFrame.h +++ b/modules/SofaOpenglVisual/src/SofaOpenglVisual/OglSceneFrame.h @@ -25,7 +25,7 @@ #include #include -#include +#include #include namespace sofa diff --git a/modules/SofaOpenglVisual/src/SofaOpenglVisual/OglViewport.cpp b/modules/SofaOpenglVisual/src/SofaOpenglVisual/OglViewport.cpp index 6b31be96b36..1953413e5ec 100644 --- a/modules/SofaOpenglVisual/src/SofaOpenglVisual/OglViewport.cpp +++ b/modules/SofaOpenglVisual/src/SofaOpenglVisual/OglViewport.cpp @@ -27,7 +27,7 @@ #include #include #include -#include +#include #include namespace sofa diff --git a/modules/SofaUserInteraction/src/SofaUserInteraction/RayModel.cpp b/modules/SofaUserInteraction/src/SofaUserInteraction/RayModel.cpp index bfd061e7913..adc9b5d08ed 100644 --- a/modules/SofaUserInteraction/src/SofaUserInteraction/RayModel.cpp +++ b/modules/SofaUserInteraction/src/SofaUserInteraction/RayModel.cpp @@ -31,8 +31,6 @@ namespace sofa::component::collision int RayCollisionModelClass = core::RegisterObject("Collision model representing a ray in space, e.g. a mouse click") .add< RayCollisionModel >() - .addAlias("Ray") - .addAlias("RayModel") ; diff --git a/modules/SofaUserInteraction/src/SofaUserInteraction/RayModel.h b/modules/SofaUserInteraction/src/SofaUserInteraction/RayModel.h index 0a6ee3cbd3d..4dc1c7b0284 100644 --- a/modules/SofaUserInteraction/src/SofaUserInteraction/RayModel.h +++ b/modules/SofaUserInteraction/src/SofaUserInteraction/RayModel.h @@ -117,6 +117,4 @@ inline void Ray::setL(SReal newL) model->length[index] = newL; } -using RayModel [[deprecated("The RayModel is now deprecated, please use RayCollisionModel instead. Compatibility stops at v20.06")]] = RayCollisionModel; - -} //namespace sofa::component::collision +} // namespace sofa::component::collision diff --git a/tools/sofa-launcher/example.py b/tools/sofa-launcher/example.py index daae82598e6..f9ccae94b6a 100644 --- a/tools/sofa-launcher/example.py +++ b/tools/sofa-launcher/example.py @@ -32,7 +32,7 @@ def testNodes(node): def oneParticleSample(node): node.findData('name').value='oneParticleSample' node.findData('gravity').value=$GRAVITYPY - solver = node.createObject('EulerSolver',printLog='false') + solver = node.createObject('EulerExplicitSolver',printLog='false') particule_node = node.createChild('particle_node') particle = particule_node.createObject('MechanicalObject') particle.resize(1)