diff --git a/Sofa/Component/AnimationLoop/src/sofa/component/animationloop/ConstraintAnimationLoop.cpp b/Sofa/Component/AnimationLoop/src/sofa/component/animationloop/ConstraintAnimationLoop.cpp index ae7faf39edc..eaf2972d9cc 100644 --- a/Sofa/Component/AnimationLoop/src/sofa/component/animationloop/ConstraintAnimationLoop.cpp +++ b/Sofa/Component/AnimationLoop/src/sofa/component/animationloop/ConstraintAnimationLoop.cpp @@ -53,9 +53,6 @@ #include using sofa::simulation::mechanicalvisitor::MechanicalVInitVisitor; -#include -using sofa::simulation::mechanicalvisitor::MechanicalBeginIntegrationVisitor; - #include using sofa::simulation::mechanicalvisitor::MechanicalVOpVisitor; @@ -299,8 +296,6 @@ void ConstraintAnimationLoop::freeMotion(const core::ExecParams* params, simulat { SCOPED_TIMER_VARNAME(freeMotionTimer, "Free Motion"); - MechanicalBeginIntegrationVisitor(params, dt).execute(context); - ////////////////// (optional) PREDICTIVE CONSTRAINT FORCES /////////////////////////////////////////////////////////////////////////////////////////// /// When scheme Correction is used, the constraint forces computed at the previous time-step /// are applied during the first motion, so which is no more a "free" motion but a "predictive" motion diff --git a/Sofa/Component/AnimationLoop/src/sofa/component/animationloop/FreeMotionAnimationLoop.cpp b/Sofa/Component/AnimationLoop/src/sofa/component/animationloop/FreeMotionAnimationLoop.cpp index 2f7954ea96b..934e48340f5 100644 --- a/Sofa/Component/AnimationLoop/src/sofa/component/animationloop/FreeMotionAnimationLoop.cpp +++ b/Sofa/Component/AnimationLoop/src/sofa/component/animationloop/FreeMotionAnimationLoop.cpp @@ -51,10 +51,6 @@ #include using sofa::simulation::mechanicalvisitor::MechanicalVInitVisitor; - -#include -using sofa::simulation::mechanicalvisitor::MechanicalBeginIntegrationVisitor; - #include using sofa::simulation::mechanicalvisitor::MechanicalVOpVisitor; @@ -225,13 +221,6 @@ void FreeMotionAnimationLoop::step(const sofa::core::ExecParams* params, SReal d dmsg_info() << "updateInternal performed - beginVisitor called" ; - - // MechanicalBeginIntegrationVisitor - MechanicalBeginIntegrationVisitor beginVisitor(params, dt); - node->execute(&beginVisitor); - - dmsg_info() << "beginVisitor performed - SolveVisitor for freeMotion is called" ; - { SCOPED_TIMER("MechanicalComputeGeometricStiffness"); MechanicalComputeGeometricStiffness geometricStiffnessVisitor(&mop.mparams, cparams.lambda()); diff --git a/Sofa/framework/Core/src/sofa/core/behavior/BaseMechanicalState.h b/Sofa/framework/Core/src/sofa/core/behavior/BaseMechanicalState.h index 8252df17d3c..b02006174cc 100644 --- a/Sofa/framework/Core/src/sofa/core/behavior/BaseMechanicalState.h +++ b/Sofa/framework/Core/src/sofa/core/behavior/BaseMechanicalState.h @@ -178,6 +178,7 @@ class SOFA_CORE_API BaseMechanicalState : public virtual BaseState /// @{ /// Called at the beginning of each integration step. + SOFA_CORE_DEPRECATED_BEGININTEGRATION() virtual void beginIntegration(SReal /*dt*/) { // it is no longer necessary to switch forceId to internalForce here... diff --git a/Sofa/framework/Core/src/sofa/core/config.h.in b/Sofa/framework/Core/src/sofa/core/config.h.in index 8db6ccdbd43..9c9f884f64f 100644 --- a/Sofa/framework/Core/src/sofa/core/config.h.in +++ b/Sofa/framework/Core/src/sofa/core/config.h.in @@ -154,6 +154,13 @@ SOFA_ATTRIBUTE_DEPRECATED("v26.12", "v27.12", "Use BaseContext instead of Contex SOFA_ATTRIBUTE_DEPRECATED("v26.12", "v27.12", "Use resetVec instead.") #endif +#ifdef SOFA_BUILD_SOFA_CORE +#define SOFA_CORE_DEPRECATED_BEGININTEGRATION() +#else +#define SOFA_CORE_DEPRECATED_BEGININTEGRATION() \ + SOFA_ATTRIBUTE_DEPRECATED("v26.12", "v27.12", "`beginIntegration` method was empty for a long time.") +#endif + #ifdef SOFA_BUILD_SOFA_CORE #define SOFA_ATTRIBUTE_DEPRECATED__ADDDFORCE_OVERLOAD() #else diff --git a/Sofa/framework/Simulation/Core/src/sofa/simulation/DefaultAnimationLoop.cpp b/Sofa/framework/Simulation/Core/src/sofa/simulation/DefaultAnimationLoop.cpp index 28d40dafdae..37f5ed12089 100644 --- a/Sofa/framework/Simulation/Core/src/sofa/simulation/DefaultAnimationLoop.cpp +++ b/Sofa/framework/Simulation/Core/src/sofa/simulation/DefaultAnimationLoop.cpp @@ -176,10 +176,6 @@ void DefaultAnimationLoop::propagateAnimateBeginEvent(const core::ExecParams* pa void DefaultAnimationLoop::beginIntegration(const core::ExecParams* params, SReal dt) const { propagateIntegrateBeginEvent(params); - - SCOPED_TIMER("beginIntegration"); - mechanicalvisitor::MechanicalBeginIntegrationVisitor beginVisitor(params, dt); - m_node->execute(&beginVisitor); } void DefaultAnimationLoop::propagateIntegrateBeginEvent(const core::ExecParams* params) const 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 f7766f6e445..2b58c9f1c60 100644 --- a/Sofa/framework/Simulation/Core/src/sofa/simulation/config.h.in +++ b/Sofa/framework/Simulation/Core/src/sofa/simulation/config.h.in @@ -313,6 +313,13 @@ SOFA_ATTRIBUTE_DEPRECATED("v26.12", "v27.06", "`MechanicalGetMomentumVisitor` was not used.") #endif +#ifdef SOFA_BUILD_SOFA_SIMULATION_CORE +#define SOFA_ATTRIBUTE_DEPRECATED__MECHANICALBEGININTEGRATIONVISITOR() +#else +#define SOFA_ATTRIBUTE_DEPRECATED__MECHANICALBEGININTEGRATIONVISITOR() \ + SOFA_ATTRIBUTE_DEPRECATED("v26.12", "v27.06", "This visitor calls a deprecated method `beginIntegration`.") +#endif + #ifdef SOFA_BUILD_SOFA_SIMULATION_CORE #define SOFA_ATTRIBUTE_DEPRECATED__COMPUTEDF_OVERLOAD() #else diff --git a/Sofa/framework/Simulation/Core/src/sofa/simulation/mechanicalvisitor/MechanicalBeginIntegrationVisitor.cpp b/Sofa/framework/Simulation/Core/src/sofa/simulation/mechanicalvisitor/MechanicalBeginIntegrationVisitor.cpp index 4f9609c9fdf..ee2073f705b 100644 --- a/Sofa/framework/Simulation/Core/src/sofa/simulation/mechanicalvisitor/MechanicalBeginIntegrationVisitor.cpp +++ b/Sofa/framework/Simulation/Core/src/sofa/simulation/mechanicalvisitor/MechanicalBeginIntegrationVisitor.cpp @@ -19,7 +19,7 @@ * * * Contact information: contact@sofa-framework.org * ******************************************************************************/ - +#define SOFA_SIMULATION_MECHANICALVISITOR_MECHANICALBEGININTEGRATIONVISITOR_CPP #include #include @@ -39,4 +39,4 @@ Visitor::Result MechanicalBeginIntegrationVisitor::fwdMappedMechanicalState(simu return RESULT_CONTINUE; } -} \ No newline at end of file +} diff --git a/Sofa/framework/Simulation/Core/src/sofa/simulation/mechanicalvisitor/MechanicalBeginIntegrationVisitor.h b/Sofa/framework/Simulation/Core/src/sofa/simulation/mechanicalvisitor/MechanicalBeginIntegrationVisitor.h index 48ee29bc1f4..a5ead16395c 100644 --- a/Sofa/framework/Simulation/Core/src/sofa/simulation/mechanicalvisitor/MechanicalBeginIntegrationVisitor.h +++ b/Sofa/framework/Simulation/Core/src/sofa/simulation/mechanicalvisitor/MechanicalBeginIntegrationVisitor.h @@ -23,12 +23,16 @@ #include +#if !defined(SOFA_SIMULATION_MECHANICALVISITOR_MECHANICALBEGININTEGRATIONVISITOR_CPP) +SOFA_HEADER_DEPRECATED_NOT_REPLACED("v26.12", "v27.06") +#endif + namespace sofa::simulation::mechanicalvisitor { /** Visitor used to prepare a time integration step. Typically, does nothing. */ -class SOFA_SIMULATION_CORE_API MechanicalBeginIntegrationVisitor : public BaseMechanicalVisitor +class SOFA_SIMULATION_CORE_API SOFA_ATTRIBUTE_DEPRECATED__MECHANICALBEGININTEGRATIONVISITOR() MechanicalBeginIntegrationVisitor : public BaseMechanicalVisitor { public: SReal dt; @@ -54,4 +58,4 @@ class SOFA_SIMULATION_CORE_API MechanicalBeginIntegrationVisitor : public BaseMe return true; } }; -} \ No newline at end of file +}