From 7a243c89fa06758bd3c9a66d865fb96b5d13c564 Mon Sep 17 00:00:00 2001 From: hugtalbot Date: Wed, 28 Jan 2026 08:30:00 +0100 Subject: [PATCH 1/7] [Lifecycle] v26.06 : SOFA_ATTRIBUTE_DEPRECATED --- .../geometry/TriangleOctreeCollisionModel.h | 4 -- .../component/collision/geometry/config.h.in | 8 ---- .../iterative/MatrixLinearSolver.h | 8 ++-- .../linearsolver/iterative/config.h.in | 6 +-- .../gl/component/rendering2d/OglColorMap.cpp | 11 ----- .../gl/component/rendering2d/OglColorMap.h | 4 +- .../sofa/gl/component/rendering2d/config.h.in | 6 +-- .../Core/src/sofa/core/CollisionModel.h | 9 ++-- .../behavior/BaseConstraintCorrection.cpp | 7 ---- .../core/behavior/BaseConstraintCorrection.h | 6 +-- .../src/sofa/core/behavior/ConstraintSolver.h | 9 ++-- .../src/sofa/core/behavior/LinearSolver.cpp | 5 --- .../src/sofa/core/behavior/LinearSolver.h | 4 +- Sofa/framework/Core/src/sofa/core/config.h.in | 18 ++++---- .../Core/src/sofa/core/loader/MeshLoader.cpp | 3 -- .../Core/src/sofa/core/loader/MeshLoader.h | 4 -- .../Core/src/sofa/simulation/AnimateVisitor.h | 41 +------------------ .../Core/src/sofa/simulation/config.h.in | 8 ---- 18 files changed, 35 insertions(+), 126 deletions(-) diff --git a/Sofa/Component/Collision/Geometry/src/sofa/component/collision/geometry/TriangleOctreeCollisionModel.h b/Sofa/Component/Collision/Geometry/src/sofa/component/collision/geometry/TriangleOctreeCollisionModel.h index 1a36dfb96c9..f3c622c9914 100644 --- a/Sofa/Component/Collision/Geometry/src/sofa/component/collision/geometry/TriangleOctreeCollisionModel.h +++ b/Sofa/Component/Collision/Geometry/src/sofa/component/collision/geometry/TriangleOctreeCollisionModel.h @@ -51,8 +51,4 @@ class SOFA_COMPONENT_COLLISION_GEOMETRY_API TriangleOctreeCollisionModel : publi void buildOctree (); }; - -using TriangleOctreeModel SOFA_ATTRIBUTE_DEPRECATED__RENAMED_TRIANGLEOCTREEMODEL() = TriangleOctreeCollisionModel; - - } // namespace sofa::component::collision::geometry diff --git a/Sofa/Component/Collision/Geometry/src/sofa/component/collision/geometry/config.h.in b/Sofa/Component/Collision/Geometry/src/sofa/component/collision/geometry/config.h.in index 602e001ec3c..3b0655c441a 100644 --- a/Sofa/Component/Collision/Geometry/src/sofa/component/collision/geometry/config.h.in +++ b/Sofa/Component/Collision/Geometry/src/sofa/component/collision/geometry/config.h.in @@ -38,11 +38,3 @@ namespace sofa::component::collision::geometry } // namespace sofa::component::collision::geometry -#ifdef SOFA_BUILD_SOFA_COMPONENT_COLLISION_GEOMETRY -#define SOFA_ATTRIBUTE_DEPRECATED__RENAMED_TRIANGLEOCTREEMODEL() -#else -#define SOFA_ATTRIBUTE_DEPRECATED__RENAMED_TRIANGLEOCTREEMODEL() \ - SOFA_ATTRIBUTE_DEPRECATED( \ - "v25.12", "v26.06", \ - "TriangleOctreeModel has been renamed to TriangleOctreeCollisionModel in PR5766") -#endif diff --git a/Sofa/Component/LinearSolver/Iterative/src/sofa/component/linearsolver/iterative/MatrixLinearSolver.h b/Sofa/Component/LinearSolver/Iterative/src/sofa/component/linearsolver/iterative/MatrixLinearSolver.h index f0f134841bc..046ab333476 100644 --- a/Sofa/Component/LinearSolver/Iterative/src/sofa/component/linearsolver/iterative/MatrixLinearSolver.h +++ b/Sofa/Component/LinearSolver/Iterative/src/sofa/component/linearsolver/iterative/MatrixLinearSolver.h @@ -196,12 +196,12 @@ class MatrixLinearSolver : public BaseMatrixLinea void resizeSystem(Size n) = delete; /// Get the linear system right-hand term vector, or nullptr if this solver does not build it - SOFA_ITERATIVE_SOLVER_ATTRIBUTE_DEPRECATED_ASSEMBLY_API() - Vector* getSystemRHVector() { return l_linearSystem ? l_linearSystem->getRHSVector() : nullptr; } + SOFA_ITERATIVE_SOLVER_ATTRIBUTE_DISABLED_ASSEMBLY_API() + Vector* getSystemRHVector() = delete; /// Get the linear system left-hand term vector, or nullptr if this solver does not build it - SOFA_ITERATIVE_SOLVER_ATTRIBUTE_DEPRECATED_ASSEMBLY_API() - Vector* getSystemLHVector() { return l_linearSystem ? l_linearSystem->getSolutionVector() : nullptr; } + SOFA_ITERATIVE_SOLVER_ATTRIBUTE_DISABLED_ASSEMBLY_API() + Vector* getSystemLHVector() = delete; /// Returns the linear system component associated to the linear solver sofa::component::linearsystem::TypedMatrixLinearSystem* getLinearSystem() const override { return l_linearSystem.get(); } diff --git a/Sofa/Component/LinearSolver/Iterative/src/sofa/component/linearsolver/iterative/config.h.in b/Sofa/Component/LinearSolver/Iterative/src/sofa/component/linearsolver/iterative/config.h.in index 7448cce2c43..9eac98209b4 100644 --- a/Sofa/Component/LinearSolver/Iterative/src/sofa/component/linearsolver/iterative/config.h.in +++ b/Sofa/Component/LinearSolver/Iterative/src/sofa/component/linearsolver/iterative/config.h.in @@ -38,10 +38,10 @@ namespace sofa::component::linearsolver::iterative } // namespace sofa::component::linearsolver::iterative #ifdef SOFA_BUILD_SOFA_COMPONENT_LINEARSOLVER_ITERATIVE -#define SOFA_ITERATIVE_SOLVER_ATTRIBUTE_DEPRECATED_ASSEMBLY_API() +#define SOFA_ITERATIVE_SOLVER_ATTRIBUTE_DISABLED_ASSEMBLY_API() #else -#define SOFA_ITERATIVE_SOLVER_ATTRIBUTE_DEPRECATED_ASSEMBLY_API() \ - SOFA_ATTRIBUTE_DEPRECATED("v25.12", "v26.06", "The assembly of the linear system is no longer the responsibility of the solver. Instead, a linear system component lives along with the linear solver. This component is in charge of the assembly.") +#define SOFA_ITERATIVE_SOLVER_ATTRIBUTE_DISABLED_ASSEMBLY_API() \ + SOFA_ATTRIBUTE_DISABLED("v25.12", "v26.06", "The assembly of the linear system is no longer the responsibility of the solver. Instead, a linear system component lives along with the linear solver. This component is in charge of the assembly.") #endif #ifdef SOFA_BUILD_SOFA_COMPONENT_LINEARSOLVER_ITERATIVE diff --git a/Sofa/GL/Component/Rendering2D/src/sofa/gl/component/rendering2d/OglColorMap.cpp b/Sofa/GL/Component/Rendering2D/src/sofa/gl/component/rendering2d/OglColorMap.cpp index 28e561922a0..c186e37f724 100644 --- a/Sofa/GL/Component/Rendering2D/src/sofa/gl/component/rendering2d/OglColorMap.cpp +++ b/Sofa/GL/Component/Rendering2D/src/sofa/gl/component/rendering2d/OglColorMap.cpp @@ -103,17 +103,6 @@ void OglColorMap::reinit() m_colorMap.reinit(); } -OglColorMap* OglColorMap::getDefault() -{ - static OglColorMap::SPtr defaultOglColorMap; - if (defaultOglColorMap == nullptr) - { - defaultOglColorMap = sofa::core::objectmodel::New(); - defaultOglColorMap->init(); - } - return defaultOglColorMap.get(); -} - void OglColorMap::deleteTexture() { if (texture != 0) diff --git a/Sofa/GL/Component/Rendering2D/src/sofa/gl/component/rendering2d/OglColorMap.h b/Sofa/GL/Component/Rendering2D/src/sofa/gl/component/rendering2d/OglColorMap.h index 24bedbcb349..fc7f5ddd11a 100644 --- a/Sofa/GL/Component/Rendering2D/src/sofa/gl/component/rendering2d/OglColorMap.h +++ b/Sofa/GL/Component/Rendering2D/src/sofa/gl/component/rendering2d/OglColorMap.h @@ -84,8 +84,8 @@ class SOFA_GL_COMPONENT_RENDERING2D_API OglColorMap : public sofa::core::visual: return m_colorMap.getColor(i); } - SOFA_ATTRIBUTE_DEPRECATED__OGLCOLORMAPGETDEFAULT() - static OglColorMap* getDefault(); + SOFA_ATTRIBUTE_DISABLED__OGLCOLORMAPGETDEFAULT() + static OglColorMap* getDefault() = delete; template helper::ColorMap::evaluator getEvaluator(Real vmin, Real vmax) diff --git a/Sofa/GL/Component/Rendering2D/src/sofa/gl/component/rendering2d/config.h.in b/Sofa/GL/Component/Rendering2D/src/sofa/gl/component/rendering2d/config.h.in index db372b30797..6631b06173d 100644 --- a/Sofa/GL/Component/Rendering2D/src/sofa/gl/component/rendering2d/config.h.in +++ b/Sofa/GL/Component/Rendering2D/src/sofa/gl/component/rendering2d/config.h.in @@ -38,8 +38,8 @@ namespace sofa::gl::component::rendering2d } // namespace sofa::gl::component::rendering2d #ifdef SOFA_BUILD_SOFA_GL_COMPONENT_RENDERING2D -#define SOFA_ATTRIBUTE_DEPRECATED__OGLCOLORMAPGETDEFAULT() +#define SOFA_ATTRIBUTE_DISABLED__OGLCOLORMAPGETDEFAULT() #else -#define SOFA_ATTRIBUTE_DEPRECATED__OGLCOLORMAPGETDEFAULT() \ - SOFA_ATTRIBUTE_DEPRECATED("v25.12", "v26.06", "") +#define SOFA_ATTRIBUTE_DISABLED__OGLCOLORMAPGETDEFAULT() \ + SOFA_ATTRIBUTE_DISABLED("v25.12", "v26.06", "") #endif diff --git a/Sofa/framework/Core/src/sofa/core/CollisionModel.h b/Sofa/framework/Core/src/sofa/core/CollisionModel.h index 9157e4bc178..1926b9b9ed3 100644 --- a/Sofa/framework/Core/src/sofa/core/CollisionModel.h +++ b/Sofa/framework/Core/src/sofa/core/CollisionModel.h @@ -329,8 +329,8 @@ class SOFA_CORE_API CollisionModel : public virtual objectmodel::BaseObject /// @name Experimental methods /// @{ - SOFA_ATTRIBUTE_DEPRECATED__NAME_CHANGED() - [[nodiscard]] SReal getProximity() const { return getContactDistance(); } + SOFA_ATTRIBUTE_DISABLED__NAME_CHANGED() + [[nodiscard]] SReal getProximity() const = delete; /// Get distance to the actual (visual) surface [[nodiscard]] SReal getContactDistance() const { return d_contactDistance.getValue(); } @@ -376,8 +376,9 @@ class SOFA_CORE_API CollisionModel : public virtual objectmodel::BaseObject /// Set of differents parameters void setContactDistance (const SReal a) { d_contactDistance.setValue(a); } - SOFA_ATTRIBUTE_DEPRECATED__NAME_CHANGED() - void setProximity (const SReal a) { setContactDistance(a); } + + SOFA_ATTRIBUTE_DISABLED__NAME_CHANGED() + void setProximity (const SReal a) = delete; void setContactResponse (const std::string &a) { contactResponse.setValue(a); } diff --git a/Sofa/framework/Core/src/sofa/core/behavior/BaseConstraintCorrection.cpp b/Sofa/framework/Core/src/sofa/core/behavior/BaseConstraintCorrection.cpp index d98535ce3a6..1dda9995993 100644 --- a/Sofa/framework/Core/src/sofa/core/behavior/BaseConstraintCorrection.cpp +++ b/Sofa/framework/Core/src/sofa/core/behavior/BaseConstraintCorrection.cpp @@ -29,18 +29,11 @@ namespace sofa::core::behavior BaseConstraintCorrection::BaseConstraintCorrection(){} BaseConstraintCorrection::~BaseConstraintCorrection() {} -void BaseConstraintCorrection::rebuildSystem(SReal /*massFactor*/, SReal /*forceFactor*/){} - void BaseConstraintCorrection::getComplianceWithConstraintMerge(linearalgebra::BaseMatrix* /*Wmerged*/, std::vector & /*constraint_merge*/) { msg_warning() << "getComplianceWithConstraintMerge is not implemented yet " ; } -void BaseConstraintCorrection::computeResidual(const core::ExecParams* /*params*/, linearalgebra::BaseVector * /*lambda*/) -{ - dmsg_warning() << "ComputeResidual is not implemented in " << this->getName() ; -} - void BaseConstraintCorrection::getBlockDiagonalCompliance(linearalgebra::BaseMatrix* /*W*/, int /*begin*/,int /*end*/) { dmsg_warning() << "getBlockDiagonalCompliance(linearalgebra::BaseMatrix* W) is not implemented in " << this->getTypeName() ; diff --git a/Sofa/framework/Core/src/sofa/core/behavior/BaseConstraintCorrection.h b/Sofa/framework/Core/src/sofa/core/behavior/BaseConstraintCorrection.h index cee49a9017e..5a8d7f42b77 100644 --- a/Sofa/framework/Core/src/sofa/core/behavior/BaseConstraintCorrection.h +++ b/Sofa/framework/Core/src/sofa/core/behavior/BaseConstraintCorrection.h @@ -110,13 +110,13 @@ class SOFA_CORE_API BaseConstraintCorrection : public virtual objectmodel::BaseO /// Rebuild the system using a mass and force factor /// Experimental API used to investigate convergence issues. - SOFA_ATTRIBUTE_DEPRECATED__REBUILDSYSTEM() virtual void rebuildSystem(SReal /*massFactor*/, SReal /*forceFactor*/); + SOFA_ATTRIBUTE_DISABLED__REBUILDSYSTEM() virtual void rebuildSystem(SReal /*massFactor*/, SReal /*forceFactor*/) = delete; /// Compute the residual in the newton iterations due to the constraints forces /// i.e. compute Vecid::force() += J^t lambda /// the result is accumulated in Vecid::force() - SOFA_ATTRIBUTE_DEPRECATED__COMPUTERESIDUAL() - virtual void computeResidual(const core::ExecParams* /*params*/, linearalgebra::BaseVector * /*lambda*/) ; + SOFA_ATTRIBUTE_DISABLED__COMPUTERESIDUAL() + virtual void computeResidual(const core::ExecParams* /*params*/, linearalgebra::BaseVector * /*lambda*/) = delete; virtual void applyContactForce(const linearalgebra::BaseVector *f) = 0; virtual void resetContactForce() = 0; diff --git a/Sofa/framework/Core/src/sofa/core/behavior/ConstraintSolver.h b/Sofa/framework/Core/src/sofa/core/behavior/ConstraintSolver.h index f0d45044c20..cdc31974309 100644 --- a/Sofa/framework/Core/src/sofa/core/behavior/ConstraintSolver.h +++ b/Sofa/framework/Core/src/sofa/core/behavior/ConstraintSolver.h @@ -74,7 +74,7 @@ class SOFA_CORE_API ConstraintSolver : public virtual objectmodel::BaseObject * Rebuild the system using a mass and force factor. * Experimental API used to investigate convergence issues. */ - SOFA_ATTRIBUTE_DEPRECATED__REBUILDSYSTEM() virtual void rebuildSystem(SReal /*massfactor*/, SReal /*forceFactor*/){} + SOFA_ATTRIBUTE_DISABLED__REBUILDSYSTEM() virtual void rebuildSystem(SReal /*massfactor*/, SReal /*forceFactor*/) = delete; /** * Use the system previously built and solve it with the appropriate algorithm @@ -90,11 +90,8 @@ class SOFA_CORE_API ConstraintSolver : public virtual objectmodel::BaseObject /// Compute the residual in the newton iterations due to the constraints forces /// i.e. compute Vecid::force() += J^t lambda /// the result is accumulated in Vecid::force() - SOFA_ATTRIBUTE_DEPRECATED__COMPUTERESIDUAL() - virtual void computeResidual(const core::ExecParams* /*params*/) - { - dmsg_error() << "ComputeResidual is not implemented in " << this->getName() ; - } + SOFA_ATTRIBUTE_DISABLED__COMPUTERESIDUAL() + virtual void computeResidual(const core::ExecParams* /*params*/) = delete; /// @name Resolution DOFs vectors API /// @{ diff --git a/Sofa/framework/Core/src/sofa/core/behavior/LinearSolver.cpp b/Sofa/framework/Core/src/sofa/core/behavior/LinearSolver.cpp index 5a47af3681d..53e44f684c4 100644 --- a/Sofa/framework/Core/src/sofa/core/behavior/LinearSolver.cpp +++ b/Sofa/framework/Core/src/sofa/core/behavior/LinearSolver.cpp @@ -42,10 +42,5 @@ void LinearSolver::applyConstraintForce(const sofa::core::ConstraintParams*, msg_error() << "applyConstraintForce has not been implemented."; } -void LinearSolver::computeResidual(const core::ExecParams*, linearalgebra::BaseVector*) -{ - msg_error() << "computeResidual has not been implemented."; -} - } // namespace sofa::core::behavior diff --git a/Sofa/framework/Core/src/sofa/core/behavior/LinearSolver.h b/Sofa/framework/Core/src/sofa/core/behavior/LinearSolver.h index 7bc3a8402c9..f4d0cb2d8c3 100644 --- a/Sofa/framework/Core/src/sofa/core/behavior/LinearSolver.h +++ b/Sofa/framework/Core/src/sofa/core/behavior/LinearSolver.h @@ -135,9 +135,9 @@ class SOFA_CORE_API LinearSolver : public BaseLinearSolver /// Compute the residual in the newton iterations due to the constraints forces /// i.e. compute mparams->dF() = J^t lambda /// the result is written in mparams->dF() - SOFA_ATTRIBUTE_DEPRECATED__COMPUTERESIDUAL() + SOFA_ATTRIBUTE_DISABLED__COMPUTERESIDUAL() virtual void computeResidual(const core::ExecParams* /*params*/, - linearalgebra::BaseVector* /*f*/); + linearalgebra::BaseVector* /*f*/) = delete; /// Multiply the inverse of the system matrix by the transpose of the given matrix, and multiply /// the result with the given matrix J diff --git a/Sofa/framework/Core/src/sofa/core/config.h.in b/Sofa/framework/Core/src/sofa/core/config.h.in index bf8192e77b6..1b18dd13a05 100644 --- a/Sofa/framework/Core/src/sofa/core/config.h.in +++ b/Sofa/framework/Core/src/sofa/core/config.h.in @@ -86,10 +86,10 @@ #ifdef SOFA_BUILD_SOFA_CORE -#define SOFA_ATTRIBUTE_DEPRECATED__NAME_CHANGED() +#define SOFA_ATTRIBUTE_DISABLED__NAME_CHANGED() #else -#define SOFA_ATTRIBUTE_DEPRECATED__NAME_CHANGED() \ -SOFA_ATTRIBUTE_DEPRECATED("v25.12", "v26.06", "Use getContactDistance or setContactDistance instead.") +#define SOFA_ATTRIBUTE_DISABLED__NAME_CHANGED() \ +SOFA_ATTRIBUTE_DISABLED("v25.12", "v26.06", "Use getContactDistance or setContactDistance instead.") #endif #ifdef SOFA_BUILD_SOFA_CORE @@ -141,10 +141,10 @@ SOFA_ATTRIBUTE_DEPRECATED("v25.12", "v26.06", "Use getContactDistance or setCont #endif #ifdef SOFA_BUILD_SOFA_CORE -#define SOFA_ATTRIBUTE_DEPRECATED__REBUILDSYSTEM() +#define SOFA_ATTRIBUTE_DISABLED__REBUILDSYSTEM() #else -#define SOFA_ATTRIBUTE_DEPRECATED__REBUILDSYSTEM() \ - SOFA_ATTRIBUTE_DEPRECATED("v25.12", "v26.06", "It was an experimental function no longer used.") +#define SOFA_ATTRIBUTE_DISABLED__REBUILDSYSTEM() \ + SOFA_ATTRIBUTE_DISABLED("v25.12", "v26.06", "It was an experimental function no longer used.") #endif @@ -156,10 +156,10 @@ SOFA_ATTRIBUTE_DEPRECATED("v25.12", "v26.06", "Use getContactDistance or setCont #endif #ifdef SOFA_BUILD_SOFA_CORE -#define SOFA_ATTRIBUTE_DEPRECATED__COMPUTERESIDUAL() +#define SOFA_ATTRIBUTE_DISABLED__COMPUTERESIDUAL() #else -#define SOFA_ATTRIBUTE_DEPRECATED__COMPUTERESIDUAL() \ - SOFA_ATTRIBUTE_DEPRECATED("v25.12", "v26.06", "The method computeResidual is not used") +#define SOFA_ATTRIBUTE_DISABLED__COMPUTERESIDUAL() \ + SOFA_ATTRIBUTE_DISABLED("v25.12", "v26.06", "The method computeResidual is not used") #endif diff --git a/Sofa/framework/Core/src/sofa/core/loader/MeshLoader.cpp b/Sofa/framework/Core/src/sofa/core/loader/MeshLoader.cpp index fac3ed6e282..e8f04fa2ca4 100644 --- a/Sofa/framework/Core/src/sofa/core/loader/MeshLoader.cpp +++ b/Sofa/framework/Core/src/sofa/core/loader/MeshLoader.cpp @@ -63,9 +63,6 @@ MeshLoader::MeshLoader() : BaseLoader() , d_transformation(initData(&d_transformation, type::Matrix4::Identity(), "transformation", "4x4 Homogeneous matrix to transform the DOFs (when present replace any)")) , d_previousTransformation(type::Matrix4::Identity() ) { - d_pentahedra.setOriginalData(&d_prisms); - d_pentahedraGroups.setOriginalData(&d_prismsGroups); - addAlias(&d_tetrahedra, "tetras"); addAlias(&d_hexahedra, "hexas"); addAlias(&d_prisms, "pentas"); diff --git a/Sofa/framework/Core/src/sofa/core/loader/MeshLoader.h b/Sofa/framework/Core/src/sofa/core/loader/MeshLoader.h index 079530efb74..2191a04a3f6 100644 --- a/Sofa/framework/Core/src/sofa/core/loader/MeshLoader.h +++ b/Sofa/framework/Core/src/sofa/core/loader/MeshLoader.h @@ -162,8 +162,6 @@ class SOFA_CORE_API MeshLoader : public BaseLoader Data< type::vector< Tetrahedron > > d_tetrahedra; ///< Tetrahedra of the mesh loaded Data< type::vector< Hexahedron > > d_hexahedra; ///< Hexahedra of the mesh loaded Data< type::vector< Prism > > d_prisms; - SOFA_ATTRIBUTE_DEPRECATED("v25.12", "v26.06", "Pentahedron is renamed to Prism") - objectmodel::lifecycle::RenamedData> d_pentahedra; ///< Pentahedra of the mesh loaded Data< type::vector< HighOrderTetrahedronPosition > > d_highOrderTetrahedronPositions; ///< High order tetrahedron points of the mesh loaded Data< type::vector< HighOrderHexahedronPosition > > d_highOrderHexahedronPositions; ///< High order hexahedron points of the mesh loaded Data< type::vector< Pyramid > > d_pyramids; ///< Pyramids of the mesh loaded @@ -183,8 +181,6 @@ class SOFA_CORE_API MeshLoader : public BaseLoader Data< type::vector< PrimitiveGroup > > d_prismsGroups; ///< Groups of Prisms Data< type::vector< PrimitiveGroup > > d_pyramidsGroups; ///< Groups of Pyramids - objectmodel::lifecycle::RenamedData> d_pentahedraGroups; - Data< bool > d_flipNormals; ///< Flip Normals Data< bool > d_triangulate; ///< Divide all polygons into triangles Data< bool > d_createSubelements; ///< Divide all n-D elements into their (n-1)-D boundary elements (e.g. tetrahedra to triangles) diff --git a/Sofa/framework/Simulation/Core/src/sofa/simulation/AnimateVisitor.h b/Sofa/framework/Simulation/Core/src/sofa/simulation/AnimateVisitor.h index 6122ad2c3ac..e2c4db1110a 100644 --- a/Sofa/framework/Simulation/Core/src/sofa/simulation/AnimateVisitor.h +++ b/Sofa/framework/Simulation/Core/src/sofa/simulation/AnimateVisitor.h @@ -22,43 +22,4 @@ #pragma once #include -SOFA_HEADER_DEPRECATED_NOT_REPLACED("v25.12", "v26.06") - -#include -#include -#include -#include - -#include - -namespace sofa::simulation -{ - -class SOFA_SIMULATION_CORE_API SOFA_ATTRIBUTE_DEPRECATED_ANIMATEVISITOR() AnimateVisitor : public Visitor -{ - -protected : - SReal dt; - bool firstNodeVisited; - -public: - AnimateVisitor(const core::ExecParams* params, SReal dt); - - void setDt(SReal v) { dt = v; } - SReal getDt() const { return dt; } - - virtual void processCollisionPipeline(simulation::Node* node, core::collision::Pipeline* obj); - virtual void fwdInteractionForceField(simulation::Node* node, core::behavior::BaseInteractionForceField* obj); - - Result processNodeTopDown(simulation::Node* node) override; - - /// Specify whether this action can be parallelized. - bool isThreadSafe() const override { return true; } - - /// Return a category name for this action. - /// Only used for debugging / profiling purposes - const char* getCategoryName() const override { return "animate"; } - const char* getClassName() const override { return "AnimateVisitor"; } -}; - -} // namespace sofa::simulation +SOFA_HEADER_DISABLED_NOT_REPLACED("v25.12", "v26.06") \ No newline at end of file diff --git a/Sofa/framework/Simulation/Core/src/sofa/simulation/config.h.in b/Sofa/framework/Simulation/Core/src/sofa/simulation/config.h.in index 808e6f67a28..1ba6f008f85 100644 --- a/Sofa/framework/Simulation/Core/src/sofa/simulation/config.h.in +++ b/Sofa/framework/Simulation/Core/src/sofa/simulation/config.h.in @@ -57,11 +57,3 @@ SOFA_ATTRIBUTE_DISABLED( \ "v24.12", "v25.06", "Use the other setSystemMBKMatrix overload instead.") #endif // SOFA_BUILD_SOFA_SIMULATION_CORE - -#ifdef SOFA_BUILD_SOFA_SIMULATION_CORE -#define SOFA_ATTRIBUTE_DEPRECATED_ANIMATEVISITOR() -#else -#define SOFA_ATTRIBUTE_DEPRECATED_ANIMATEVISITOR() \ - SOFA_ATTRIBUTE_DEPRECATED( \ - "v25.12", "v26.06", "No longer used since #3959") -#endif // SOFA_BUILD_SOFA_SIMULATION_CORE From 4122088ca0f2e25eb53e25e3870c09f3404cb4a3 Mon Sep 17 00:00:00 2001 From: hugtalbot Date: Wed, 28 Jan 2026 10:07:37 +0100 Subject: [PATCH 2/7] Remove AnimateVisitor.cpp --- Sofa/framework/Simulation/Core/CMakeLists.txt | 1 - 1 file changed, 1 deletion(-) diff --git a/Sofa/framework/Simulation/Core/CMakeLists.txt b/Sofa/framework/Simulation/Core/CMakeLists.txt index d1ce0ecd4d9..ddf07a26ff3 100644 --- a/Sofa/framework/Simulation/Core/CMakeLists.txt +++ b/Sofa/framework/Simulation/Core/CMakeLists.txt @@ -148,7 +148,6 @@ set(HEADER_FILES set(SOURCE_FILES ${SRC_ROOT}/AnimateBeginEvent.cpp ${SRC_ROOT}/AnimateEndEvent.cpp - ${SRC_ROOT}/AnimateVisitor.cpp ${SRC_ROOT}/BaseMechanicalVisitor.cpp ${SRC_ROOT}/BehaviorUpdatePositionVisitor.cpp ${SRC_ROOT}/CleanupVisitor.cpp From 43c46616c5f2b153afa0c315b4551ded64b882ed Mon Sep 17 00:00:00 2001 From: hugtalbot Date: Wed, 28 Jan 2026 10:08:55 +0100 Subject: [PATCH 3/7] Actually remove AnimateVisitor.cpp --- .../src/sofa/simulation/AnimateVisitor.cpp | 185 ------------------ 1 file changed, 185 deletions(-) delete mode 100644 Sofa/framework/Simulation/Core/src/sofa/simulation/AnimateVisitor.cpp diff --git a/Sofa/framework/Simulation/Core/src/sofa/simulation/AnimateVisitor.cpp b/Sofa/framework/Simulation/Core/src/sofa/simulation/AnimateVisitor.cpp deleted file mode 100644 index 2c07778e0a9..00000000000 --- a/Sofa/framework/Simulation/Core/src/sofa/simulation/AnimateVisitor.cpp +++ /dev/null @@ -1,185 +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 -#include -#include - -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include -#include - -#include -using sofa::simulation::mechanicalvisitor::MechanicalResetConstraintVisitor; - -#include -using sofa::simulation::mechanicalvisitor::MechanicalBeginIntegrationVisitor; - -#include -using sofa::simulation::mechanicalvisitor::MechanicalProjectPositionAndVelocityVisitor; - -#include -using sofa::simulation::mechanicalvisitor::MechanicalPropagateOnlyPositionAndVelocityVisitor; - -#include -using sofa::simulation::mechanicalvisitor::MechanicalEndIntegrationVisitor; - -#include -using sofa::simulation::mechanicalvisitor::MechanicalAccumulateMatrixDeriv; - -#include -using sofa::simulation::mechanicalvisitor::MechanicalBuildConstraintMatrix; - -using namespace sofa::core; - -namespace sofa::simulation -{ - - -AnimateVisitor::AnimateVisitor(const core::ExecParams* params, SReal dt) - : Visitor(params) - , dt(dt) - , firstNodeVisited(false) -{ -} - -void AnimateVisitor::fwdInteractionForceField(simulation::Node*, core::behavior::BaseInteractionForceField* obj) -{ - helper::ScopedAdvancedTimer timer("InteractionFF", obj); - - const MultiVecDerivId ffId = vec_id::write_access::externalForce; - MechanicalParams mparams; - mparams.setDt(this->dt); - obj->addForce(&mparams, ffId); -} - -void AnimateVisitor::processCollisionPipeline(simulation::Node* node, core::collision::Pipeline* obj) -{ - helper::ScopedAdvancedTimer collisionTimer("Collision", obj); - - { - helper::ScopedAdvancedTimer timer("begin collision", obj); - CollisionBeginEvent evBegin; - PropagateEventVisitor eventPropagation( params, &evBegin); - eventPropagation.execute(node->getContext()); - } - - CollisionVisitor act(this->params); - node->execute(&act); - - { - helper::ScopedAdvancedTimer timer("end collision", obj); - CollisionEndEvent evEnd; - PropagateEventVisitor eventPropagation( params, &evEnd); - eventPropagation.execute(node->getContext()); - } -} - -Visitor::Result AnimateVisitor::processNodeTopDown(simulation::Node* node) -{ - if (!node->isActive()) return Visitor::RESULT_PRUNE; - if (node->isSleeping()) return Visitor::RESULT_PRUNE; - if (!firstNodeVisited) - { - firstNodeVisited=true; - - sofa::core::ConstraintParams cparams(*this->params); - MechanicalResetConstraintVisitor resetConstraint(&cparams); - node->execute(&resetConstraint); - } - - if (dt == 0) setDt(node->getDt()); - else node->setDt(dt); - - if (node->collisionPipeline != nullptr) - { - processCollisionPipeline(node, node->collisionPipeline); - } - if (!node->solver.empty() ) - { - sofa::helper::AdvancedTimer::StepVar timer("Mechanical",node); - const SReal nextTime = node->getTime() + dt; - { - IntegrateBeginEvent evBegin; - PropagateEventVisitor eventPropagation( this->params, &evBegin); - eventPropagation.execute(node); - } - - MechanicalBeginIntegrationVisitor beginVisitor(this->params, dt); - node->execute(&beginVisitor); - - sofa::core::MechanicalParams m_mparams(*this->params); - m_mparams.setDt(dt); - - core::ConstraintParams cparams; - { - unsigned int constraintId=0; - MechanicalBuildConstraintMatrix buildConstraintMatrix(&cparams, core::vec_id::write_access::constraintJacobian, constraintId ); - buildConstraintMatrix.execute(node); - } - - { - MechanicalAccumulateMatrixDeriv accumulateMatrixDeriv(&cparams, core::vec_id::write_access::constraintJacobian); - accumulateMatrixDeriv.execute(node); - } - - for( unsigned i=0; isolver.size(); i++ ) - { - ctime_t t0 = begin(node, node->solver[i]); - node->solver[i]->solve(params, getDt()); - end(node, node->solver[i], t0); - } - - MechanicalProjectPositionAndVelocityVisitor(&m_mparams, nextTime, - sofa::core::vec_id::write_access::position, sofa::core::vec_id::write_access::velocity - ).execute( node ); - MechanicalPropagateOnlyPositionAndVelocityVisitor(&m_mparams, nextTime, - vec_id::write_access::position, - vec_id::write_access::velocity).execute( node ); - - MechanicalEndIntegrationVisitor endVisitor(this->params, dt); - node->execute(&endVisitor); - - { - IntegrateEndEvent evBegin; - PropagateEventVisitor eventPropagation(this->params, &evBegin); - eventPropagation.execute(node); - } - - return RESULT_PRUNE; - } - - // process InteractionForceFields - for_each(this, node, node->interactionForceField, &AnimateVisitor::fwdInteractionForceField); - return RESULT_CONTINUE; -} - -} // namespace sofa::simulation - From 004fff7e950e094c0bd8cb81e4c0a912f63b7853 Mon Sep 17 00:00:00 2001 From: hugtalbot Date: Wed, 28 Jan 2026 13:26:21 +0100 Subject: [PATCH 4/7] forgotten change --- .../collision/geometry/TriangleOctreeCollisionModel.cpp | 1 - 1 file changed, 1 deletion(-) diff --git a/Sofa/Component/Collision/Geometry/src/sofa/component/collision/geometry/TriangleOctreeCollisionModel.cpp b/Sofa/Component/Collision/Geometry/src/sofa/component/collision/geometry/TriangleOctreeCollisionModel.cpp index 62abb5bdc39..83aa57fd8e7 100644 --- a/Sofa/Component/Collision/Geometry/src/sofa/component/collision/geometry/TriangleOctreeCollisionModel.cpp +++ b/Sofa/Component/Collision/Geometry/src/sofa/component/collision/geometry/TriangleOctreeCollisionModel.cpp @@ -38,7 +38,6 @@ void registerTriangleOctreeModel(sofa::core::ObjectFactory* factory) { factory->registerObjects(core::ObjectRegistrationData("Collision model using a triangular mesh mapped to an Octree.") .add < TriangleOctreeCollisionModel >() - .addAlias("TriangleOctreeModel")); // SOFA_ATTRIBUTE_DEPRECATED__RENAMED_TRIANGLEOCTREEMODEL() } TriangleOctreeCollisionModel::TriangleOctreeCollisionModel () From f6061d4d33efa145fedaec912c8137b733f22c5e Mon Sep 17 00:00:00 2001 From: hugtalbot Date: Wed, 28 Jan 2026 15:02:22 +0100 Subject: [PATCH 5/7] Remove all occurrences of computeResidual further to mark final --- .../GenericConstraintCorrection.cpp | 6 ------ .../correction/GenericConstraintCorrection.h | 2 -- .../solver/GenericConstraintSolver.cpp | 8 -------- .../solver/GenericConstraintSolver.h | 1 - .../iterative/MatrixLinearSolver.cpp | 5 ----- .../iterative/MatrixLinearSolver.h | 5 ----- .../iterative/MatrixLinearSolver.inl | 19 ------------------- .../preconditioner/WarpPreconditioner.h | 2 -- .../preconditioner/WarpPreconditioner.inl | 6 ------ 9 files changed, 54 deletions(-) diff --git a/Sofa/Component/Constraint/Lagrangian/Correction/src/sofa/component/constraint/lagrangian/correction/GenericConstraintCorrection.cpp b/Sofa/Component/Constraint/Lagrangian/Correction/src/sofa/component/constraint/lagrangian/correction/GenericConstraintCorrection.cpp index bba4b86ad9f..f1a1805697d 100644 --- a/Sofa/Component/Constraint/Lagrangian/Correction/src/sofa/component/constraint/lagrangian/correction/GenericConstraintCorrection.cpp +++ b/Sofa/Component/Constraint/Lagrangian/Correction/src/sofa/component/constraint/lagrangian/correction/GenericConstraintCorrection.cpp @@ -229,12 +229,6 @@ void GenericConstraintCorrection::applyContactForce(const BaseVector *f) applyMotionCorrection(&cparams, core::vec_id::write_access::position, core::vec_id::write_access::velocity, dx, force); } -void GenericConstraintCorrection::computeResidual(const ExecParams* params, linearalgebra::BaseVector *lambda) -{ - l_linearSolver.get()->computeResidual(params, lambda); -} - - void GenericConstraintCorrection::getComplianceMatrix(linearalgebra::BaseMatrix* Minv) const { if (!l_ODESolver.get()) diff --git a/Sofa/Component/Constraint/Lagrangian/Correction/src/sofa/component/constraint/lagrangian/correction/GenericConstraintCorrection.h b/Sofa/Component/Constraint/Lagrangian/Correction/src/sofa/component/constraint/lagrangian/correction/GenericConstraintCorrection.h index 11c82ed8b2b..c932c478c47 100644 --- a/Sofa/Component/Constraint/Lagrangian/Correction/src/sofa/component/constraint/lagrangian/correction/GenericConstraintCorrection.h +++ b/Sofa/Component/Constraint/Lagrangian/Correction/src/sofa/component/constraint/lagrangian/correction/GenericConstraintCorrection.h @@ -112,8 +112,6 @@ class SOFA_COMPONENT_CONSTRAINT_LAGRANGIAN_CORRECTION_API GenericConstraintCorre void resetContactForce() override; - void computeResidual(const core::ExecParams* params, linearalgebra::BaseVector *lambda) override; - SingleLink l_linearSolver; ///< Link towards the linear solver used to compute the compliance matrix, requiring the inverse of the linear system matrix SingleLink l_ODESolver; ///< Link towards the ODE solver used to recover the integration factors Data< SReal > d_complianceFactor; ///< Factor applied to the position factor and velocity factor used to calculate compliance matrix diff --git a/Sofa/Component/Constraint/Lagrangian/Solver/src/sofa/component/constraint/lagrangian/solver/GenericConstraintSolver.cpp b/Sofa/Component/Constraint/Lagrangian/Solver/src/sofa/component/constraint/lagrangian/solver/GenericConstraintSolver.cpp index 3d10afb5224..87c68978f6c 100644 --- a/Sofa/Component/Constraint/Lagrangian/Solver/src/sofa/component/constraint/lagrangian/solver/GenericConstraintSolver.cpp +++ b/Sofa/Component/Constraint/Lagrangian/Solver/src/sofa/component/constraint/lagrangian/solver/GenericConstraintSolver.cpp @@ -299,14 +299,6 @@ bool GenericConstraintSolver::solveSystem(const core::ConstraintParams * /*cPara return true; } -void GenericConstraintSolver::computeResidual(const core::ExecParams* eparam) -{ - for (const auto& cc : l_constraintCorrections) - { - cc->computeResidual(eparam,¤t_cp->f); - } -} - sofa::type::vector GenericConstraintSolver::filteredConstraintCorrections() const { sofa::type::vector filteredConstraintCorrections; diff --git a/Sofa/Component/Constraint/Lagrangian/Solver/src/sofa/component/constraint/lagrangian/solver/GenericConstraintSolver.h b/Sofa/Component/Constraint/Lagrangian/Solver/src/sofa/component/constraint/lagrangian/solver/GenericConstraintSolver.h index fe70f01834e..4e96b5388fa 100644 --- a/Sofa/Component/Constraint/Lagrangian/Solver/src/sofa/component/constraint/lagrangian/solver/GenericConstraintSolver.h +++ b/Sofa/Component/Constraint/Lagrangian/Solver/src/sofa/component/constraint/lagrangian/solver/GenericConstraintSolver.h @@ -55,7 +55,6 @@ class SOFA_COMPONENT_CONSTRAINT_LAGRANGIAN_SOLVER_API GenericConstraintSolver : void rebuildSystem(const SReal massFactor, const SReal forceFactor) override; bool solveSystem(const core::ConstraintParams * /*cParams*/, MultiVecId res1, MultiVecId res2=MultiVecId::null()) override; bool applyCorrection(const core::ConstraintParams * /*cParams*/, MultiVecId res1, MultiVecId res2=MultiVecId::null()) override; - void computeResidual(const core::ExecParams* /*params*/) override; ConstraintProblem* getConstraintProblem() override; void lockConstraintProblem(sofa::core::objectmodel::BaseObject* from, ConstraintProblem* p1, ConstraintProblem* p2 = nullptr) override; diff --git a/Sofa/Component/LinearSolver/Iterative/src/sofa/component/linearsolver/iterative/MatrixLinearSolver.cpp b/Sofa/Component/LinearSolver/Iterative/src/sofa/component/linearsolver/iterative/MatrixLinearSolver.cpp index 20ae5d57cbb..70222b3bcb1 100644 --- a/Sofa/Component/LinearSolver/Iterative/src/sofa/component/linearsolver/iterative/MatrixLinearSolver.cpp +++ b/Sofa/Component/LinearSolver/Iterative/src/sofa/component/linearsolver/iterative/MatrixLinearSolver.cpp @@ -39,11 +39,6 @@ void MatrixLinearSolver -void MatrixLinearSolver::computeResidual(const core::ExecParams* /*params*/,linearalgebra::BaseVector* /*f*/) { - //todo -} - template<> GraphScatteredVector* MatrixLinearSolver::createPersistentVector() { diff --git a/Sofa/Component/LinearSolver/Iterative/src/sofa/component/linearsolver/iterative/MatrixLinearSolver.h b/Sofa/Component/LinearSolver/Iterative/src/sofa/component/linearsolver/iterative/MatrixLinearSolver.h index 046ab333476..87c742cfe5a 100644 --- a/Sofa/Component/LinearSolver/Iterative/src/sofa/component/linearsolver/iterative/MatrixLinearSolver.h +++ b/Sofa/Component/LinearSolver/Iterative/src/sofa/component/linearsolver/iterative/MatrixLinearSolver.h @@ -246,8 +246,6 @@ class MatrixLinearSolver : public BaseMatrixLinea void applyConstraintForce(const sofa::core::ConstraintParams* cparams, sofa::core::MultiVecDerivId dx, const linearalgebra::BaseVector* f) override; - void computeResidual(const core::ExecParams* params, linearalgebra::BaseVector* f) override; - ///< Parallelize the computation of the product J*M^{-1}*J^T where M is the ///< matrix of the linear system and J is any matrix with compatible dimensions Data d_parallelInverseProduct; @@ -370,9 +368,6 @@ GraphScatteredVector* MatrixLinearSolver SOFA_COMPONENT_LINEARSOLVER_ITERATIVE_API void MatrixLinearSolver::applyConstraintForce(const sofa::core::ConstraintParams* /*cparams*/, sofa::core::MultiVecDerivId /*dx*/, const linearalgebra::BaseVector* /*f*/); -template<> SOFA_COMPONENT_LINEARSOLVER_ITERATIVE_API -void MatrixLinearSolver::computeResidual(const core::ExecParams* params,linearalgebra::BaseVector* f); - template<> SOFA_COMPONENT_LINEARSOLVER_ITERATIVE_API void MatrixLinearSolver::checkLinearSystem(); diff --git a/Sofa/Component/LinearSolver/Iterative/src/sofa/component/linearsolver/iterative/MatrixLinearSolver.inl b/Sofa/Component/LinearSolver/Iterative/src/sofa/component/linearsolver/iterative/MatrixLinearSolver.inl index 5f6e5cdf599..cb657e88c5a 100644 --- a/Sofa/Component/LinearSolver/Iterative/src/sofa/component/linearsolver/iterative/MatrixLinearSolver.inl +++ b/Sofa/Component/LinearSolver/Iterative/src/sofa/component/linearsolver/iterative/MatrixLinearSolver.inl @@ -506,23 +506,4 @@ void MatrixLinearSolver::applyConstraintForce(const sofa::core::C l_linearSystem->dispatchSystemRHS(cparams->lambda()); } -template -void MatrixLinearSolver::computeResidual(const core::ExecParams* params,linearalgebra::BaseVector* f) -{ - auto* rhsVector = l_linearSystem->getRHSVector(); - rhsVector->clear(); - rhsVector->resize(l_linearSystem->getSystemBaseMatrix()->colSize()); - - /// rhs = J^t * f - internalData.projectForceInConstraintSpace(rhsVector, f); - - sofa::simulation::common::VectorOperations vop( params, this->getContext() ); - sofa::core::behavior::MultiVecDeriv force(&vop, core::vec_id::write_access::force ); - - // force += rhs - executeVisitor( MechanicalMultiVectorPeqBaseVectorVisitor(core::execparams::defaultInstance(), force, rhsVector, nullptr) ); -} - - - } // namespace sofa::component::linearsolver diff --git a/Sofa/Component/LinearSolver/Preconditioner/src/sofa/component/linearsolver/preconditioner/WarpPreconditioner.h b/Sofa/Component/LinearSolver/Preconditioner/src/sofa/component/linearsolver/preconditioner/WarpPreconditioner.h index 94958d3e855..066bd697156 100644 --- a/Sofa/Component/LinearSolver/Preconditioner/src/sofa/component/linearsolver/preconditioner/WarpPreconditioner.h +++ b/Sofa/Component/LinearSolver/Preconditioner/src/sofa/component/linearsolver/preconditioner/WarpPreconditioner.h @@ -72,8 +72,6 @@ class WarpPreconditioner : public sofa::component::linearsolver::MatrixLinearSol bool addMInvJt(linearalgebra::BaseMatrix* result, linearalgebra::BaseMatrix* J, SReal fact) override; - void computeResidual(const core::ExecParams* params, linearalgebra::BaseVector* /*f*/) override; - protected: void checkLinearSystem() override; diff --git a/Sofa/Component/LinearSolver/Preconditioner/src/sofa/component/linearsolver/preconditioner/WarpPreconditioner.inl b/Sofa/Component/LinearSolver/Preconditioner/src/sofa/component/linearsolver/preconditioner/WarpPreconditioner.inl index 19c2553567c..22c2c6c880d 100644 --- a/Sofa/Component/LinearSolver/Preconditioner/src/sofa/component/linearsolver/preconditioner/WarpPreconditioner.inl +++ b/Sofa/Component/LinearSolver/Preconditioner/src/sofa/component/linearsolver/preconditioner/WarpPreconditioner.inl @@ -158,10 +158,4 @@ bool WarpPreconditioner::addMInvJt(linearalgebra return l_linearSolver->addMInvJt(result,&j_local,fact); } -template -void WarpPreconditioner::computeResidual(const core::ExecParams* params, linearalgebra::BaseVector* f) -{ - l_linearSolver->computeResidual(params,f); -} - } // namespace sofa::component::linearsolver::preconditioner From 9f1233eef9662a0969a0fef1ee0628a566f998c1 Mon Sep 17 00:00:00 2001 From: hugtalbot Date: Wed, 28 Jan 2026 15:16:39 +0100 Subject: [PATCH 6/7] Remove all occurrences of rebuildSystem as marked delete --- .../correction/GenericConstraintCorrection.cpp | 4 ---- .../correction/GenericConstraintCorrection.h | 2 -- .../correction/LinearSolverConstraintCorrection.h | 3 --- .../correction/LinearSolverConstraintCorrection.inl | 8 -------- .../lagrangian/solver/GenericConstraintSolver.cpp | 12 ------------ .../lagrangian/solver/GenericConstraintSolver.h | 1 - .../sofa/core/behavior/BaseConstraintCorrection.h | 3 ++- 7 files changed, 2 insertions(+), 31 deletions(-) diff --git a/Sofa/Component/Constraint/Lagrangian/Correction/src/sofa/component/constraint/lagrangian/correction/GenericConstraintCorrection.cpp b/Sofa/Component/Constraint/Lagrangian/Correction/src/sofa/component/constraint/lagrangian/correction/GenericConstraintCorrection.cpp index f1a1805697d..94b1bc1dc71 100644 --- a/Sofa/Component/Constraint/Lagrangian/Correction/src/sofa/component/constraint/lagrangian/correction/GenericConstraintCorrection.cpp +++ b/Sofa/Component/Constraint/Lagrangian/Correction/src/sofa/component/constraint/lagrangian/correction/GenericConstraintCorrection.cpp @@ -133,10 +133,6 @@ void GenericConstraintCorrection::removeConstraintSolver(ConstraintSolver *s) constraintsolvers.remove(s); } -void GenericConstraintCorrection::rebuildSystem(SReal massFactor, SReal forceFactor) -{ -} - void GenericConstraintCorrection::addComplianceInConstraintSpace(const ConstraintParams *cparams, BaseMatrix* W) { if (!l_ODESolver.get()) return; diff --git a/Sofa/Component/Constraint/Lagrangian/Correction/src/sofa/component/constraint/lagrangian/correction/GenericConstraintCorrection.h b/Sofa/Component/Constraint/Lagrangian/Correction/src/sofa/component/constraint/lagrangian/correction/GenericConstraintCorrection.h index c932c478c47..d7321a26b37 100644 --- a/Sofa/Component/Constraint/Lagrangian/Correction/src/sofa/component/constraint/lagrangian/correction/GenericConstraintCorrection.h +++ b/Sofa/Component/Constraint/Lagrangian/Correction/src/sofa/component/constraint/lagrangian/correction/GenericConstraintCorrection.h @@ -106,8 +106,6 @@ class SOFA_COMPONENT_CONSTRAINT_LAGRANGIAN_CORRECTION_API GenericConstraintCorre void applyPredictiveConstraintForce(const core::ConstraintParams *cparams, core::MultiVecDerivId f, const linearalgebra::BaseVector *lambda) override; - void rebuildSystem(SReal massFactor, SReal forceFactor) override; - void applyContactForce(const linearalgebra::BaseVector *f) override; void resetContactForce() override; diff --git a/Sofa/Component/Constraint/Lagrangian/Correction/src/sofa/component/constraint/lagrangian/correction/LinearSolverConstraintCorrection.h b/Sofa/Component/Constraint/Lagrangian/Correction/src/sofa/component/constraint/lagrangian/correction/LinearSolverConstraintCorrection.h index 018dd80649b..6c29d54bc21 100644 --- a/Sofa/Component/Constraint/Lagrangian/Correction/src/sofa/component/constraint/lagrangian/correction/LinearSolverConstraintCorrection.h +++ b/Sofa/Component/Constraint/Lagrangian/Correction/src/sofa/component/constraint/lagrangian/correction/LinearSolverConstraintCorrection.h @@ -80,9 +80,6 @@ class LinearSolverConstraintCorrection : public sofa::core::behavior::Constraint void applyVelocityCorrection(const sofa::core::ConstraintParams *cparams, Data< VecDeriv>& v, Data< VecDeriv>& dv, const Data< VecDeriv >& f) override; - void rebuildSystem(SReal massFactor, SReal forceFactor) override; - - /// @name Deprecated API /// @{ diff --git a/Sofa/Component/Constraint/Lagrangian/Correction/src/sofa/component/constraint/lagrangian/correction/LinearSolverConstraintCorrection.inl b/Sofa/Component/Constraint/Lagrangian/Correction/src/sofa/component/constraint/lagrangian/correction/LinearSolverConstraintCorrection.inl index 305166be82e..aa9e512f740 100644 --- a/Sofa/Component/Constraint/Lagrangian/Correction/src/sofa/component/constraint/lagrangian/correction/LinearSolverConstraintCorrection.inl +++ b/Sofa/Component/Constraint/Lagrangian/Correction/src/sofa/component/constraint/lagrangian/correction/LinearSolverConstraintCorrection.inl @@ -209,14 +209,6 @@ void LinearSolverConstraintCorrection::addComplianceInConstraintSpace addRegularization(W); } - -template -void LinearSolverConstraintCorrection::rebuildSystem(SReal massFactor, SReal forceFactor) -{ - SOFA_UNUSED(massFactor); - SOFA_UNUSED(forceFactor); -} - template void LinearSolverConstraintCorrection::getComplianceMatrix(linearalgebra::BaseMatrix* Minv) const { diff --git a/Sofa/Component/Constraint/Lagrangian/Solver/src/sofa/component/constraint/lagrangian/solver/GenericConstraintSolver.cpp b/Sofa/Component/Constraint/Lagrangian/Solver/src/sofa/component/constraint/lagrangian/solver/GenericConstraintSolver.cpp index 87c68978f6c..7337ed5bfd9 100644 --- a/Sofa/Component/Constraint/Lagrangian/Solver/src/sofa/component/constraint/lagrangian/solver/GenericConstraintSolver.cpp +++ b/Sofa/Component/Constraint/Lagrangian/Solver/src/sofa/component/constraint/lagrangian/solver/GenericConstraintSolver.cpp @@ -205,18 +205,6 @@ bool GenericConstraintSolver::buildSystem(const core::ConstraintParams *cParams, return true; } - -void GenericConstraintSolver::rebuildSystem(const SReal massFactor, const SReal forceFactor) -{ - for (const auto& cc : l_constraintCorrections) - { - if (cc->isActive()) - { - cc->rebuildSystem(massFactor, forceFactor); - } - } -} - void printLCP(std::ostream& file, SReal *q, SReal **M, SReal *f, int dim, bool printMatrix = true) { file.precision(9); diff --git a/Sofa/Component/Constraint/Lagrangian/Solver/src/sofa/component/constraint/lagrangian/solver/GenericConstraintSolver.h b/Sofa/Component/Constraint/Lagrangian/Solver/src/sofa/component/constraint/lagrangian/solver/GenericConstraintSolver.h index 4e96b5388fa..328ae118cbc 100644 --- a/Sofa/Component/Constraint/Lagrangian/Solver/src/sofa/component/constraint/lagrangian/solver/GenericConstraintSolver.h +++ b/Sofa/Component/Constraint/Lagrangian/Solver/src/sofa/component/constraint/lagrangian/solver/GenericConstraintSolver.h @@ -52,7 +52,6 @@ class SOFA_COMPONENT_CONSTRAINT_LAGRANGIAN_SOLVER_API GenericConstraintSolver : bool prepareStates(const core::ConstraintParams * /*cParams*/, MultiVecId res1, MultiVecId res2=MultiVecId::null()) override; bool buildSystem(const core::ConstraintParams * /*cParams*/, MultiVecId res1, MultiVecId res2=MultiVecId::null()) override; - void rebuildSystem(const SReal massFactor, const SReal forceFactor) override; bool solveSystem(const core::ConstraintParams * /*cParams*/, MultiVecId res1, MultiVecId res2=MultiVecId::null()) override; bool applyCorrection(const core::ConstraintParams * /*cParams*/, MultiVecId res1, MultiVecId res2=MultiVecId::null()) override; ConstraintProblem* getConstraintProblem() override; diff --git a/Sofa/framework/Core/src/sofa/core/behavior/BaseConstraintCorrection.h b/Sofa/framework/Core/src/sofa/core/behavior/BaseConstraintCorrection.h index 5a8d7f42b77..4135391148e 100644 --- a/Sofa/framework/Core/src/sofa/core/behavior/BaseConstraintCorrection.h +++ b/Sofa/framework/Core/src/sofa/core/behavior/BaseConstraintCorrection.h @@ -110,7 +110,8 @@ class SOFA_CORE_API BaseConstraintCorrection : public virtual objectmodel::BaseO /// Rebuild the system using a mass and force factor /// Experimental API used to investigate convergence issues. - SOFA_ATTRIBUTE_DISABLED__REBUILDSYSTEM() virtual void rebuildSystem(SReal /*massFactor*/, SReal /*forceFactor*/) = delete; + SOFA_ATTRIBUTE_DISABLED__REBUILDSYSTEM() + virtual void rebuildSystem(SReal /*massFactor*/, SReal /*forceFactor*/) = delete; /// Compute the residual in the newton iterations due to the constraints forces /// i.e. compute Vecid::force() += J^t lambda From 29d5396d992a14d87988a8a7233adceebecb91fe Mon Sep 17 00:00:00 2001 From: hugtalbot Date: Wed, 28 Jan 2026 15:31:02 +0100 Subject: [PATCH 7/7] Replace TriangleOctreeModel with TriangleOctreeCollisionModel --- .../detection/algorithm/RayTraceDetection.cpp | 2 +- .../detection/algorithm/RayTraceDetection.h | 2 +- .../algorithm/RayTraceNarrowPhase.cpp | 24 +++++++++---------- .../detection/algorithm/RayTraceNarrowPhase.h | 2 +- .../collision/geometry/TriangleOctreeModel.h | 2 +- .../geometry/TriangleOctreeCollisionModel.cpp | 4 ++-- .../component/collision/geometry/init.cpp | 4 ++-- .../Collision/Detection/RayTraceCollision.scn | 24 +++++++++---------- 8 files changed, 32 insertions(+), 32 deletions(-) diff --git a/Sofa/Component/Collision/Detection/Algorithm/src/sofa/component/collision/detection/algorithm/RayTraceDetection.cpp b/Sofa/Component/Collision/Detection/Algorithm/src/sofa/component/collision/detection/algorithm/RayTraceDetection.cpp index 95fa8f5d95a..bb057169510 100644 --- a/Sofa/Component/Collision/Detection/Algorithm/src/sofa/component/collision/detection/algorithm/RayTraceDetection.cpp +++ b/Sofa/Component/Collision/Detection/Algorithm/src/sofa/component/collision/detection/algorithm/RayTraceDetection.cpp @@ -30,7 +30,7 @@ namespace sofa::component::collision::detection::algorithm void registerRayTraceDetection(sofa::core::ObjectFactory* factory) { - factory->registerObjects(core::ObjectRegistrationData("Collision detection using TriangleOctreeModel.") + factory->registerObjects(core::ObjectRegistrationData("Collision detection using TriangleOctreeCollisionModel.") .add()); } diff --git a/Sofa/Component/Collision/Detection/Algorithm/src/sofa/component/collision/detection/algorithm/RayTraceDetection.h b/Sofa/Component/Collision/Detection/Algorithm/src/sofa/component/collision/detection/algorithm/RayTraceDetection.h index 6a2d5e1bf58..076a52de04a 100644 --- a/Sofa/Component/Collision/Detection/Algorithm/src/sofa/component/collision/detection/algorithm/RayTraceDetection.h +++ b/Sofa/Component/Collision/Detection/Algorithm/src/sofa/component/collision/detection/algorithm/RayTraceDetection.h @@ -33,7 +33,7 @@ namespace sofa::component::collision::detection::algorithm * * For each point in one object, we trace a ray following the opposite of the point's normal * up to find a triangle in the other object. Both triangles are tested to evaluate if they are in - * colliding state. It must be used with a TriangleOctreeModel,as an octree is used to traverse the object. + * colliding state. It must be used with a TriangleOctreeCollisionModel,as an octree is used to traverse the object. */ class SOFA_COMPONENT_COLLISION_DETECTION_ALGORITHM_API RayTraceDetection final : public sofa::core::objectmodel::BaseObject diff --git a/Sofa/Component/Collision/Detection/Algorithm/src/sofa/component/collision/detection/algorithm/RayTraceNarrowPhase.cpp b/Sofa/Component/Collision/Detection/Algorithm/src/sofa/component/collision/detection/algorithm/RayTraceNarrowPhase.cpp index fd83c888bc3..dbac380d020 100644 --- a/Sofa/Component/Collision/Detection/Algorithm/src/sofa/component/collision/detection/algorithm/RayTraceNarrowPhase.cpp +++ b/Sofa/Component/Collision/Detection/Algorithm/src/sofa/component/collision/detection/algorithm/RayTraceNarrowPhase.cpp @@ -36,18 +36,18 @@ using sofa::helper::TriangleOctree; void registerRayTraceNarrowPhase(sofa::core::ObjectFactory* factory) { - factory->registerObjects(core::ObjectRegistrationData("Narrow phase of the collision detection using TriangleOctreeModel") + factory->registerObjects(core::ObjectRegistrationData("Narrow phase of the collision detection using TriangleOctreeCollisionModel") .add < RayTraceNarrowPhase >()); } void RayTraceNarrowPhase::findPairsVolume (CubeCollisionModel * cm1, CubeCollisionModel * cm2) { - /*Obtain the CollisionModel at the lowest level, in this case it must be a TriangleOctreeModel */ + /*Obtain the CollisionModel at the lowest level, in this case it must be a TriangleOctreeCollisionModel */ - TriangleOctreeModel *tm1 = - dynamic_cast < TriangleOctreeModel * >(cm1->getLast ()); - TriangleOctreeModel *tm2 = - dynamic_cast < TriangleOctreeModel * >(cm2->getLast ()); + TriangleOctreeCollisionModel *tm1 = + dynamic_cast < TriangleOctreeCollisionModel * >(cm1->getLast ()); + TriangleOctreeCollisionModel *tm2 = + dynamic_cast < TriangleOctreeCollisionModel * >(cm2->getLast ()); if (!tm1 || !tm2) return; @@ -66,7 +66,7 @@ void RayTraceNarrowPhase::findPairsVolume (CubeCollisionModel * cm1, CubeCollisi } - /* get the output vector for a TriangleOctreeModel, TriangleOctreeModel Collision*/ + /* get the output vector for a TriangleOctreeCollisionModel, TriangleOctreeCollisionModel Collision*/ /*Get the cube representing the bounding box of both Models */ // sofa::core::collision::DetectionOutputVector *& contacts=outputsMap[std::make_pair(tm1, tm2)]; core::collision::DetectionOutputVector*& contacts = this->getDetectionOutputs(tm1, tm2); @@ -76,17 +76,17 @@ void RayTraceNarrowPhase::findPairsVolume (CubeCollisionModel * cm1, CubeCollisi { contacts = new sofa::core::collision::TDetectionOutputVector < - TriangleOctreeModel, TriangleOctreeModel >; + TriangleOctreeCollisionModel, TriangleOctreeCollisionModel >; } - TDetectionOutputVector < TriangleOctreeModel, - TriangleOctreeModel > *outputs = - static_cast < TDetectionOutputVector < TriangleOctreeModel, - TriangleOctreeModel > *>(contacts); + TDetectionOutputVector < TriangleOctreeCollisionModel, + TriangleOctreeCollisionModel > *outputs = + static_cast < TDetectionOutputVector < TriangleOctreeCollisionModel, + TriangleOctreeCollisionModel > *>(contacts); Cube cube1 (cm1, 0); const Cube cube2 (cm2, 0); diff --git a/Sofa/Component/Collision/Detection/Algorithm/src/sofa/component/collision/detection/algorithm/RayTraceNarrowPhase.h b/Sofa/Component/Collision/Detection/Algorithm/src/sofa/component/collision/detection/algorithm/RayTraceNarrowPhase.h index 1686e74a5bc..d26d08e4809 100644 --- a/Sofa/Component/Collision/Detection/Algorithm/src/sofa/component/collision/detection/algorithm/RayTraceNarrowPhase.h +++ b/Sofa/Component/Collision/Detection/Algorithm/src/sofa/component/collision/detection/algorithm/RayTraceNarrowPhase.h @@ -37,7 +37,7 @@ namespace sofa::component::collision::detection::algorithm * * For each point in one object, we trace a ray following the opposite of the point's normal * up to find a triangle in the other object. Both triangles are tested to evaluate if they are in - * colliding state. It must be used with a TriangleOctreeModel,as an octree is used to traverse the object. + * colliding state. It must be used with a TriangleOctreeCollisionModel,as an octree is used to traverse the object. */ class SOFA_COMPONENT_COLLISION_DETECTION_ALGORITHM_API RayTraceNarrowPhase : public core::collision::NarrowPhaseDetection { diff --git a/Sofa/Component/Collision/Geometry/compat/sofa/component/collision/geometry/TriangleOctreeModel.h b/Sofa/Component/Collision/Geometry/compat/sofa/component/collision/geometry/TriangleOctreeModel.h index 302f392ac54..386029f3640 100644 --- a/Sofa/Component/Collision/Geometry/compat/sofa/component/collision/geometry/TriangleOctreeModel.h +++ b/Sofa/Component/Collision/Geometry/compat/sofa/component/collision/geometry/TriangleOctreeModel.h @@ -23,4 +23,4 @@ #include #include -SOFA_HEADER_DEPRECATED("v25.12", "v26.06", "sofa/component/collision/geometry/TriangleOctreeModel.h") +SOFA_HEADER_DISABLED("v25.12", "v26.06", "sofa/component/collision/geometry/TriangleOctreeCollisionModel.h") diff --git a/Sofa/Component/Collision/Geometry/src/sofa/component/collision/geometry/TriangleOctreeCollisionModel.cpp b/Sofa/Component/Collision/Geometry/src/sofa/component/collision/geometry/TriangleOctreeCollisionModel.cpp index 83aa57fd8e7..a6f9019aff2 100644 --- a/Sofa/Component/Collision/Geometry/src/sofa/component/collision/geometry/TriangleOctreeCollisionModel.cpp +++ b/Sofa/Component/Collision/Geometry/src/sofa/component/collision/geometry/TriangleOctreeCollisionModel.cpp @@ -34,10 +34,10 @@ typedef core::topology::BaseMeshTopology::Triangle Triangle; namespace sofa::component::collision::geometry { -void registerTriangleOctreeModel(sofa::core::ObjectFactory* factory) +void registerTriangleOctreeCollisionModel(sofa::core::ObjectFactory* factory) { factory->registerObjects(core::ObjectRegistrationData("Collision model using a triangular mesh mapped to an Octree.") - .add < TriangleOctreeCollisionModel >() + .add < TriangleOctreeCollisionModel >()); } TriangleOctreeCollisionModel::TriangleOctreeCollisionModel () diff --git a/Sofa/Component/Collision/Geometry/src/sofa/component/collision/geometry/init.cpp b/Sofa/Component/Collision/Geometry/src/sofa/component/collision/geometry/init.cpp index c5f15490448..ab1ff0c042d 100644 --- a/Sofa/Component/Collision/Geometry/src/sofa/component/collision/geometry/init.cpp +++ b/Sofa/Component/Collision/Geometry/src/sofa/component/collision/geometry/init.cpp @@ -35,7 +35,7 @@ extern void registerSphereCollisionModel(sofa::core::ObjectFactory* factory); extern void registerTetrahedronCollisionModel(sofa::core::ObjectFactory* factory); extern void registerTriangleCollisionModel(sofa::core::ObjectFactory* factory); extern void registerTriangleModelInRegularGrid(sofa::core::ObjectFactory* factory); -extern void registerTriangleOctreeModel(sofa::core::ObjectFactory* factory); +extern void registerTriangleOctreeCollisionModel(sofa::core::ObjectFactory* factory); extern "C" { SOFA_EXPORT_DYNAMIC_LIBRARY void initExternalModule(); @@ -70,7 +70,7 @@ void registerObjects(sofa::core::ObjectFactory* factory) registerTetrahedronCollisionModel(factory); registerTriangleCollisionModel(factory); registerTriangleModelInRegularGrid(factory); - registerTriangleOctreeModel(factory); + registerTriangleOctreeCollisionModel(factory); } void init() diff --git a/examples/Component/Collision/Detection/RayTraceCollision.scn b/examples/Component/Collision/Detection/RayTraceCollision.scn index 7e682842f91..b1ddb4a4d8a 100644 --- a/examples/Component/Collision/Detection/RayTraceCollision.scn +++ b/examples/Component/Collision/Detection/RayTraceCollision.scn @@ -1,7 +1,7 @@ - + @@ -36,7 +36,7 @@ - + @@ -56,7 +56,7 @@ - + @@ -76,7 +76,7 @@ - + @@ -96,7 +96,7 @@ - + @@ -116,7 +116,7 @@ - + @@ -136,7 +136,7 @@ - + @@ -156,7 +156,7 @@ - + @@ -176,7 +176,7 @@ - + @@ -196,7 +196,7 @@ - + @@ -216,7 +216,7 @@ - + @@ -224,7 +224,7 @@ - +