diff --git a/Sofa/Component/AnimationLoop/CMakeLists.txt b/Sofa/Component/AnimationLoop/CMakeLists.txt index d7ac975e565..1023e443859 100644 --- a/Sofa/Component/AnimationLoop/CMakeLists.txt +++ b/Sofa/Component/AnimationLoop/CMakeLists.txt @@ -5,8 +5,8 @@ set(SOFACOMPONENTANIMATIONLOOP_SOURCE_DIR "src/sofa/component/animationloop") set(HEADER_FILES ${SOFACOMPONENTANIMATIONLOOP_SOURCE_DIR}/config.h.in - ${SOFACOMPONENTANIMATIONLOOP_SOURCE_DIR}/FreeMotionAnimationLoop.h ${SOFACOMPONENTANIMATIONLOOP_SOURCE_DIR}/ConstraintAnimationLoop.h + ${SOFACOMPONENTANIMATIONLOOP_SOURCE_DIR}/FreeMotionAnimationLoop.h ${SOFACOMPONENTANIMATIONLOOP_SOURCE_DIR}/MultiStepAnimationLoop.h ${SOFACOMPONENTANIMATIONLOOP_SOURCE_DIR}/MultiTagAnimationLoop.h ) @@ -14,7 +14,6 @@ set(HEADER_FILES set(SOURCE_FILES ${SOFACOMPONENTANIMATIONLOOP_SOURCE_DIR}/init.cpp ${SOFACOMPONENTANIMATIONLOOP_SOURCE_DIR}/FreeMotionAnimationLoop.cpp - ${SOFACOMPONENTANIMATIONLOOP_SOURCE_DIR}/ConstraintAnimationLoop.cpp ${SOFACOMPONENTANIMATIONLOOP_SOURCE_DIR}/MultiStepAnimationLoop.cpp ${SOFACOMPONENTANIMATIONLOOP_SOURCE_DIR}/MultiTagAnimationLoop.cpp ) diff --git a/Sofa/Component/AnimationLoop/src/sofa/component/animationloop/ConstraintAnimationLoop.cpp b/Sofa/Component/AnimationLoop/src/sofa/component/animationloop/ConstraintAnimationLoop.cpp deleted file mode 100644 index 61ec57f65ca..00000000000 --- a/Sofa/Component/AnimationLoop/src/sofa/component/animationloop/ConstraintAnimationLoop.cpp +++ /dev/null @@ -1,967 +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 -#include -#include -#include - - -#include - -#include ///< ConstraintResolution. - -#include - -#include - -#include -using sofa::simulation::mechanicalvisitor::MechanicalVInitVisitor; - -#include -using sofa::simulation::mechanicalvisitor::MechanicalBeginIntegrationVisitor; - -#include -using sofa::simulation::mechanicalvisitor::MechanicalVOpVisitor; - -#include -using sofa::simulation::mechanicalvisitor::MechanicalProjectPositionVisitor; - -#include -using sofa::simulation::mechanicalvisitor::MechanicalPropagateOnlyPositionVisitor; - -#include -using sofa::simulation::mechanicalvisitor::MechanicalProjectJacobianMatrixVisitor; - -#include -using sofa::simulation::mechanicalvisitor::MechanicalEndIntegrationVisitor; - -#include -using sofa::simulation::mechanicalvisitor::MechanicalResetConstraintVisitor; - -#include -#include -#include - -/// Change that to true if you want to print extra message on this component. -/// You can eventually link that to an object attribute. -#define EMIT_EXTRA_DEBUG_MESSAGE false - -namespace sofa::component::animationloop -{ - -using namespace sofa::linearalgebra; -using namespace sofa::defaulttype; -using namespace helper::system::thread; -using namespace core::behavior; -using namespace sofa::simulation; - -ConstraintProblem::ConstraintProblem(bool printLog) -{ - SOFA_UNUSED(printLog); - - this->_tol = 0.0001; - this->_dim = 0; - - _timer = new CTime(); -} - -ConstraintProblem::~ConstraintProblem() -{ - _dFree.clear(); - _d.clear(); - _W.clear(); - _force.clear(); - // if not null delete the old constraintProblem - for(int i=0; i<_dim; i++) - { - if (_constraintsResolutions[i] != nullptr) - { - delete _constraintsResolutions[i]; - _constraintsResolutions[i] = nullptr; - } - } - _constraintsResolutions.clear(); // _constraintsResolutions.clear(); - delete(_timer); -} - -void ConstraintProblem::clear(int dim, const SReal&tol) -{ - // if not null delete the old constraintProblem - for(int i=0; i<_dim; i++) - { - if (_constraintsResolutions[i] != nullptr) - { - delete _constraintsResolutions[i]; - _constraintsResolutions[i] = nullptr; - } - } - _dFree.clear(); - _dFree.resize(dim); - _d.resize(dim); - _W.resize(dim,dim); - _force.resize(dim); - _df.resize(dim); - _constraintsResolutions.resize(dim); // _constraintsResolutions.clear(); - this->_tol = tol; - this->_dim = dim; -} - - -void ConstraintProblem::gaussSeidelConstraintTimed(SReal &timeout, int numItMax) -{ - SReal error=0.0; - - const SReal t0 = (SReal)_timer->getTime() ; - const SReal timeScale = 1.0 / (SReal)CTime::getTicksPerSec(); - - for(int i=0; igetNbLines(); - - //2. for each line we compute the actual value of d - // (a)d is set to dfree - std::vector errF(&_force[j], &_force[j+nb]); - std::copy_n(_dFree.begin() + j, nb, _d.begin() + j); - - // (b) contribution of forces are added to d - for(int k=0; k<_dim; k++) - for(int l=0; l_W.ptr(); - _constraintsResolutions[j]->resolution(j, this->getW()->lptr(), this->getD()->ptr(), this->getF()->ptr(), _dFree.ptr()); - - //4. the error is measured (displacement due to the new resolution (i.e. due to the new force)) - if(nb > 1) - { - SReal terr = 0.0; - for(int l=0; lgetTime(); - const SReal dt = (t1 - t0)*timeScale; - if(dt > timeout) - { - return; - } - /////////////////////////////////////////////////////// - - if(error < _tol*(_dim+1) && i>0) // do not stop at the first iteration (that is used for initial guess computation) - { - return; - } - } - - msg_info("ConstraintAnimationLoop") << "------ No convergence in gaussSeidelConstraint Timed before time criterion !: error = " - << error << " ------" << msgendl; - -} - -ConstraintAnimationLoop::ConstraintAnimationLoop() : - d_displayTime(initData(&d_displayTime, false, "displayTime","Display time for each important step of ConstraintAnimationLoop.")) - , d_tol( initData(&d_tol, 0.00001_sreal, "tolerance", "Tolerance of the Gauss-Seidel")) - , d_maxIt( initData(&d_maxIt, 1000, "maxIterations", "Maximum number of iterations of the Gauss-Seidel")) - , d_doCollisionsFirst(initData(&d_doCollisionsFirst, false, "doCollisionsFirst","Compute the collisions first (to support penality-based contacts)")) - , d_doubleBuffer( initData(&d_doubleBuffer, false, "doubleBuffer","Double the buffer dedicated to the constraint problem to make it accessible to another thread")) - , d_scaleTolerance( initData(&d_scaleTolerance, true, "scaleTolerance","Scale the error tolerance with the number of constraints")) - , d_allVerified( initData(&d_allVerified, false, "allVerified","All constraints must be verified (each constraint's error < tolerance)")) - , d_sor( initData(&d_sor, 1.0_sreal, "sor","Successive Over Relaxation parameter (0-2)")) - , d_schemeCorrection( initData(&d_schemeCorrection, false, "schemeCorrection","Apply new scheme where compliance is progressively corrected")) - , d_realTimeCompensation( initData(&d_realTimeCompensation, false, "realTimeCompensation","If the total computational time T < dt, sleep(dt-T)")) - , d_graphErrors( initData(&d_graphErrors,"graphErrors","Sum of the constraints' errors at each iteration")) - , d_graphConstraints( initData(&d_graphConstraints,"graphConstraints","Graph of each constraint's error at the end of the resolution")) - , d_graphForces( initData(&d_graphForces,"graphForces","Graph of each constraint's force at each step of the resolution")) -{ - bufCP1 = false; - - d_graphErrors.setWidget("graph"); - d_graphErrors.setGroup("Graph"); - - d_graphConstraints.setWidget("graph"); - d_graphConstraints.setGroup("Graph"); - - d_graphForces.setWidget("graph"); - d_graphForces.setGroup("Graph2"); - - CP1.clear(0,d_tol.getValue()); - CP2.clear(0,d_tol.getValue()); - - timer = nullptr; - - msg_deprecated("ConstraintAnimationLoop") << "WARNING : ConstraintAnimationLoop is deprecated. Please use the combination of FreeMotionAnimationLoop and GenericConstraintSolver." ; -} - -ConstraintAnimationLoop::~ConstraintAnimationLoop() -{ - if (timer != nullptr) - { - delete timer; - timer = nullptr; - } -} - -void ConstraintAnimationLoop::init() -{ - // Prevents ConstraintCorrection accumulation due to multiple AnimationLoop initialization on dynamic components Add/Remove operations. - if (!constraintCorrections.empty()) - { - constraintCorrections.clear(); - } - - getContext()->get ( &constraintCorrections, core::objectmodel::BaseContext::SearchDown ); -} - - -void ConstraintAnimationLoop::launchCollisionDetection(const core::ExecParams* params) -{ - dmsg_info_when(EMIT_EXTRA_DEBUG_MESSAGE) - <<"computeCollision is called"; - - ////////////////// COLLISION DETECTION/////////////////////////////////////////////////////////////////////////////////////////// - { - SCOPED_TIMER("Collision"); - computeCollision(params); - } - ///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// - - if ( d_displayTime.getValue() ) - { - msg_info() <<" computeCollision " << ( (SReal) timer->getTime() - time)*timeScale <<" ms"; - time = (SReal) timer->getTime(); - } - -} - - -void ConstraintAnimationLoop::freeMotion(const core::ExecParams* params, simulation::Node *context, SReal &dt) -{ - dmsg_info_when(EMIT_EXTRA_DEBUG_MESSAGE) - <<"Free Motion is called" ; - - ///////////////////////////////////////////// FREE MOTION ///////////////////////////////////////////////////////////// - { - 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 - /////////// - if(d_schemeCorrection.getValue()) - { - sofa::core::ConstraintParams cparams(*params); - sofa::core::MultiVecDerivId f = core::vec_id::write_access::externalForce; - - for (auto cc : constraintCorrections) - { - cc->applyPredictiveConstraintForce(&cparams, f, getCP()->getF()); - } - } - - simulation::SolveVisitor(params, dt, true).execute(context); - - { - sofa::core::MechanicalParams mparams(*params); - sofa::core::MultiVecCoordId xfree = sofa::core::vec_id::write_access::freePosition; - mparams.x() = xfree; - MechanicalProjectPositionVisitor(&mparams, 0, xfree ).execute(context); - MechanicalPropagateOnlyPositionVisitor(&mparams, 0, xfree ).execute(context); - } - } - - //////// TODO : propagate velocity !! - - ////////propagate acceleration ? ////// - - //this is done to set dx to zero in subgraph - core::MultiVecDerivId dx_id = core::vec_id::write_access::dx; - MechanicalVOpVisitor(params, dx_id, core::ConstVecId::null(), core::ConstVecId::null(), 1.0 ).setMapped(true).execute(context); - - ///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// - - if ( d_displayTime.getValue() ) - { - msg_info() << ">>>>> Begin display ConstraintAnimationLoop time"; - msg_info() <<" Free Motion " << ( (SReal) timer->getTime() - time)*timeScale <<" ms"; - time = (SReal) timer->getTime(); - } -} - -void ConstraintAnimationLoop::setConstraintEquations(const core::ExecParams* params, simulation::Node *context) -{ - for (const auto cc : constraintCorrections) - { - cc->resetContactForce(); - } - - //////////////////////////////////////CONSTRAINTS RESOLUTION////////////////////////////////////////////////////////////////////// - msg_info_when(EMIT_EXTRA_DEBUG_MESSAGE) <<"constraints Matrix construction is called" ; - - { - SCOPED_TIMER_VARNAME(constraintDefinitionTimer, "Constraints definition"); - - if(!d_schemeCorrection.getValue()) - { - /// calling resetConstraint & setConstraint & accumulateConstraint visitors - /// and resize the constraint problem that will be solved - unsigned int numConstraints = 0; - writeAndAccumulateAndCountConstraintDirections(params, context, numConstraints); - } - - - core::MechanicalParams mparams = core::MechanicalParams(*params); - MechanicalProjectJacobianMatrixVisitor(&mparams).execute(context); - - /// calling GetConstraintViolationVisitor: each constraint provides its present violation - /// for a given state (by default: free_position TODO: add VecId to make this method more generic) - getIndividualConstraintViolations(params, context); - - if(!d_schemeCorrection.getValue()) - { - /// calling getConstraintResolution: each constraint provides a method that is used to solve it during GS iterations - getIndividualConstraintSolvingProcess(params, context); - } - } - - /// calling getCompliance projected in the contact space => getDelassusOperator(_W) = H*C*Ht - computeComplianceInConstraintSpace(); - - if ( d_displayTime.getValue() ) - { - msg_info()<<" Build problem in the constraint space " << ( (SReal) timer->getTime() - time)*timeScale<<" ms"; - time = (SReal) timer->getTime(); - } -} - -void ConstraintAnimationLoop::writeAndAccumulateAndCountConstraintDirections(const core::ExecParams* params, simulation::Node *context, unsigned int &numConstraints) -{ - core::ConstraintParams cparams = core::ConstraintParams(*params); - cparams.setX(core::vec_id::read_access::freePosition); - cparams.setV(core::vec_id::read_access::freeVelocity); - - // calling resetConstraint on LMConstraints and MechanicalStates - MechanicalResetConstraintVisitor(&cparams).execute(context); - - // calling applyConstraint on each constraint - sofa::simulation::mechanicalvisitor::MechanicalBuildConstraintMatrix(&cparams, core::vec_id::write_access::constraintJacobian, numConstraints).execute(context); - - sofa::helper::AdvancedTimer::valSet("numConstraints", numConstraints); - - // calling accumulateConstraint on the mappings - sofa::simulation::mechanicalvisitor::MechanicalAccumulateMatrixDeriv(&cparams, core::vec_id::write_access::constraintJacobian).execute(context); - - getCP()->clear(numConstraints,this->d_tol.getValue()); -} - -void ConstraintAnimationLoop::getIndividualConstraintViolations(const core::ExecParams* params, simulation::Node *context) -{ - core::ConstraintParams cparams = core::ConstraintParams(*params); - cparams.setX(core::vec_id::read_access::freePosition); - cparams.setV(core::vec_id::read_access::freeVelocity); - - constraint::lagrangian::solver::MechanicalGetConstraintViolationVisitor(&cparams, getCP()->getDfree()).execute(context); -} - -void ConstraintAnimationLoop::getIndividualConstraintSolvingProcess(const core::ExecParams* params, simulation::Node *context) -{ - /// calling getConstraintResolution: each constraint provides a method that is used to solve it during GS iterations - core::ConstraintParams cparams = core::ConstraintParams(*params); - cparams.setX(core::vec_id::read_access::freePosition); - cparams.setV(core::vec_id::read_access::freeVelocity); - - sofa::component::constraint::lagrangian::solver::MechanicalGetConstraintResolutionVisitor(&cparams, getCP()->getConstraintResolutions(), 0).execute(context); -} - -void ConstraintAnimationLoop::computeComplianceInConstraintSpace() -{ - /// calling getCompliance => getDelassusOperator(_W) = H*C*Ht - dmsg_info_when(EMIT_EXTRA_DEBUG_MESSAGE) << " 4. get Compliance " ; - - SCOPED_TIMER_VARNAME(getComplianceTimer, "Get Compliance"); - for (const auto cc : constraintCorrections) - { - cc->addComplianceInConstraintSpace(core::constraintparams::defaultInstance(), getCP()->getW()); - } -} - -void ConstraintAnimationLoop::correctiveMotion(const core::ExecParams* params, simulation::Node *node) -{ - dmsg_info_when(EMIT_EXTRA_DEBUG_MESSAGE) - <<"constraintCorrections motion is called" ; - - SCOPED_TIMER_VARNAME(correctiveMotionTimer, "Corrective Motion"); - - if(d_schemeCorrection.getValue()) - { - // IF SCHEME CORRECTIVE=> correct the motion using dF - for (const auto cc : constraintCorrections) - { - cc->applyContactForce(getCP()->getdF()); - } - } - else - { - // ELSE => only correct the motion using F - for (const auto cc : constraintCorrections) - { - cc->applyContactForce(getCP()->getF()); - } - } - - simulation::common::MechanicalOperations mop(params, node); - - mop.propagateV(core::vec_id::write_access::velocity); - - mop.propagateDx(core::vec_id::write_access::dx, true); - - // "mapped" x = xfree + dx - MechanicalVOpVisitor(params, core::vec_id::write_access::position, core::vec_id::read_access::freePosition, core::vec_id::read_access::dx, 1.0 ).setOnlyMapped(true).execute(node); - - if(!d_schemeCorrection.getValue()) - { - for (const auto cc : constraintCorrections) - { - cc->resetContactForce(); - } - } -} - -void ConstraintAnimationLoop::step ( const core::ExecParams* params, SReal dt ) -{ - auto node = dynamic_cast(this->l_node.get()); - - static SReal simulationTime=0.0; - - simulationTime+=dt; -#ifdef SOFA_DUMP_VISITOR_INFO - simulation::Visitor::printNode("Step"); -#endif - - { - AnimateBeginEvent ev ( dt ); - PropagateEventVisitor act ( params, &ev ); - node->execute ( act ); - } - - - SReal startTime = node->getTime(); - - BehaviorUpdatePositionVisitor beh(params , node->getDt()); - node->execute ( beh ); - - UpdateInternalDataVisitor uid(params); - node->execute ( uid ); - - - if (simulationTime>0.1) - d_activateSubGraph.setValue(true); - else - d_activateSubGraph.setValue(false); - - time = 0.0; - SReal totaltime = 0.0; - timeScale = 1.0 / (SReal)CTime::getTicksPerSec() * 1000; - if ( d_displayTime.getValue() ) - { - if (timer == nullptr) - timer = new CTime(); - - time = (SReal) timer->getTime(); - totaltime = time; - msg_info()<getTime(); - } - else - { - SReal actTime = SReal(timer->getTime()); - SReal compTimeDiff = actTime - compTime; - SReal iterationTimeDiff = actTime - iterationTime; - iterationTime = actTime; - msg_info() << "Total time = " << iterationTimeDiff ; - int toSleep = (int)floor(dt*1000000-compTimeDiff); - if (toSleep > 0) - std::this_thread::sleep_for(std::chrono::microseconds(toSleep)); - else - msg_error() << "Cannot achieve frequency for dt = " << dt ; - compTime = (SReal)timer->getTime(); - } - } -#endif - - dmsg_info() << " step is called" ; - - // This solver will work in freePosition and freeVelocity vectors. - // We need to initialize them if it's not already done. - MechanicalVInitVisitor(params, core::vec_id::write_access::freePosition, core::vec_id::read_access::position, true).execute(node); - MechanicalVInitVisitor(params, core::vec_id::write_access::freeVelocity, core::vec_id::read_access::velocity).execute(node); - - if (d_doCollisionsFirst.getValue()) - { - /// COLLISION - launchCollisionDetection(params); - } - - // Update the BehaviorModels => to be removed ? - // Required to allow the RayPickInteractor interaction - { - SCOPED_TIMER_VARNAME(behaviorUpdateTimer, "BehaviorUpdate"); - simulation::BehaviorUpdatePositionVisitor(params, dt).execute(node); - } - - - if(d_schemeCorrection.getValue()) - { - // Compute the predictive force: - numConstraints = 0; - - //1. Find the new constraint direction - writeAndAccumulateAndCountConstraintDirections(params, node, numConstraints); - - //2. Get the constraint solving process: - getIndividualConstraintSolvingProcess(params, node); - - //3. Use the stored forces to compute - if (EMIT_EXTRA_DEBUG_MESSAGE) - { - computePredictiveForce(CP.getSize(), CP.getF()->ptr(), CP.getConstraintResolutions()); - msg_info() << "getF() after computePredictiveForce:" ; - helper::resultToString(std::cout,CP.getF()->ptr(),CP.getSize()); - } - } - - if (EMIT_EXTRA_DEBUG_MESSAGE) - { - (*CP.getF())*=0.0; - computePredictiveForce(CP.getSize(), CP.getF()->ptr(), CP.getConstraintResolutions()); - msg_info() << "getF() after re-computePredictiveForce:" ; - helper::resultToString(std::cout,CP.getF()->ptr(),CP.getSize()); - } - - /// FREE MOTION - freeMotion(params, node, dt); - - - - if (!d_doCollisionsFirst.getValue()) - { - /// COLLISION - launchCollisionDetection(params); - } - - //////////////// BEFORE APPLYING CONSTRAINT : propagate position through mapping - core::MechanicalParams mparams(*params); - MechanicalProjectPositionVisitor(&mparams, 0, core::vec_id::write_access::position).execute(node); - MechanicalPropagateOnlyPositionVisitor(&mparams, 0, core::vec_id::write_access::position).execute(node); - - - /// CONSTRAINT SPACE & COMPLIANCE COMPUTATION - setConstraintEquations(params, node); - - if (EMIT_EXTRA_DEBUG_MESSAGE) - { - msg_info() << "getF() after setConstraintEquations:" ; - helper::resultToString(std::cout, CP.getF()->ptr(),CP.getSize()); - } - - { - SCOPED_TIMER_VARNAME(gaussSeidelTimer, "GaussSeidel"); - if (EMIT_EXTRA_DEBUG_MESSAGE) - msg_info() << "Gauss-Seidel solver is called on problem of size " << CP.getSize() ; - - if(d_schemeCorrection.getValue()) - (*CP.getF())*=0.0; - - gaussSeidelConstraint(CP.getSize(), CP.getDfree()->ptr(), CP.getW()->lptr(), CP.getF()->ptr(), CP.getD()->ptr(), CP.getConstraintResolutions(), CP.getdF()->ptr()); - } - - if (EMIT_EXTRA_DEBUG_MESSAGE) - helper::printLCP(CP.getDfree()->ptr(), CP.getW()->lptr(), CP.getF()->ptr(), CP.getSize()); - - if ( d_displayTime.getValue() ) - { - msg_info() << " Solve with GaussSeidel " << ( (SReal) timer->getTime() - time)*timeScale<<" ms" ; - time = (SReal) timer->getTime(); - } - - /// CORRECTIVE MOTION - correctiveMotion(params, node); - - if ( d_displayTime.getValue() ) - { - msg_info() << " ContactCorrections " << ( (SReal) timer->getTime() - time)*timeScale <<" ms" << msgendl - << " = Total " << ( (SReal) timer->getTime() - totaltime)*timeScale <<" ms" << msgendl - << " With : " << CP.getSize() << " constraints" << msgendl - << "<<<<< End display ConstraintAnimationLoop time." ; - } - - MechanicalEndIntegrationVisitor endVisitor(params, dt); - node->execute(&endVisitor); - node->setTime ( startTime + dt ); - node->execute(params); // propagate time - - { - AnimateEndEvent ev ( dt ); - PropagateEventVisitor act ( params, &ev ); - node->execute ( act ); - } - - { - SCOPED_TIMER_VARNAME(updateMappingTimer, "UpdateMapping"); - - node->execute(params); - sofa::helper::AdvancedTimer::step("UpdateMappingEndEvent"); - { - UpdateMappingEndEvent ev ( dt ); - PropagateEventVisitor act ( params , &ev ); - node->execute ( act ); - } - } - - if (d_computeBoundingBox.getValue()) - { - SCOPED_TIMER_VARNAME(updateBBoxTimer, "UpdateBBox"); - node->execute(params); - } - -#ifdef SOFA_DUMP_VISITOR_INFO - simulation::Visitor::printCloseNode("Step"); -#endif - - -} - -void ConstraintAnimationLoop::computePredictiveForce(int dim, SReal* force, std::vector& res) -{ - for(int i=0; iinitForce(i, force); - i += res[i]->getNbLines(); - } -} - -void ConstraintAnimationLoop::gaussSeidelConstraint(int dim, SReal* dfree, SReal** w, SReal* force, - SReal* d, std::vector& res, SReal* df=nullptr) -{ - if(!dim) - return; - - int iter, nb; - SReal error=0.0; - - SReal tolerance = d_tol.getValue(); - int numItMax = d_maxIt.getValue(); - bool convergence = false; - SReal sor = d_sor.getValue(); - bool allVerified = d_allVerified.getValue(); - sofa::type::vector tempForces; - if(sor != 1.0) tempForces.resize(dim); - - if(d_scaleTolerance.getValue() && !allVerified) - tolerance *= dim; - - for(int i=0; iinit(i, w, force); - i += res[i]->getNbLines(); - } - - { - auto* graphs = d_graphForces.beginEdit(); - graphs->clear(); - d_graphForces.endEdit(); - } - - if(d_schemeCorrection.getValue()) - { - msg_info() << "shemeCorrection => LCP before step 1"; - helper::printLCP(dfree, w, force, dim); - ///////// scheme correction : step 1 => modification of dfree - for(int j=0; j storage of force value - for(int j=0; j& graph_residuals = (*d_graphErrors.beginEdit())["Error"]; - graph_residuals.clear(); - - sofa::type::vector tabErrors; - tabErrors.resize(dim); - - for(iter=0; itergetNbLines(); - - bool check = true; - for (int b=0; b errF(&force[j], &force[j+nb]); - std::copy_n(&dfree[j], nb, &d[j]); - - // (b) contribution of forces are added to d - for(int k=0; kresolution(j, w, d, force, dfree); - - //4. the error is measured (displacement due to the new resolution (i.e. due to the new force)) - SReal contraintError = 0.0; - if(nb > 1) - { - for(int l=0; l tolerance) - constraintsAreVerified = false; - - contraintError += lineError; - } - } - else - { - contraintError = fabs(w[j][j] * (force[j] - errF[0])); - if(contraintError > tolerance) - constraintsAreVerified = false; - } - - if(res[j]->getTolerance()) - { - if(contraintError > res[j]->getTolerance()) - constraintsAreVerified = false; - contraintError *= tolerance / res[j]->getTolerance(); - } - - error += contraintError; - tabErrors[j] = contraintError; - - j += nb; - } - else - { - std::fill_n(&force[j], nb, 0); - msg_info_when(iter==0) << "constraint %d has a compliance equal to zero on the diagonal" ; - j += nb; - } - } - - - /// display a graph with the force of each constraint dimension at each iteration - std::map < std::string, sofa::type::vector >* graphs = d_graphForces.beginEdit(); - for(int j=0; j& graph_force = (*graphs)[oss.str()]; - graph_force.push_back(force[j]); - } - d_graphForces.endEdit(); - - graph_residuals.push_back(error); - - if(sor != 1.0) - { - for(int j=0; j0) // do not stop at the first iteration (that is used for initial guess computation) - { - convergence = true; - break; - } - } - - if (EMIT_EXTRA_DEBUG_MESSAGE) - { - if (!convergence) - { - msg_error() << "No convergence in gaussSeidelConstraint : error = " << error; - } - else if (d_displayTime.getValue()) - { - msg_info() << "Convergence after " << iter+1 << " iterations."; - } - } - - sofa::helper::AdvancedTimer::valSet("GS iterations", iter+1); - - for(int i=0; istore(i, force, convergence); - int t = res[i]->getNbLines(); - i += t; - } - - if(d_schemeCorrection.getValue()) - { - ///////// scheme correction : step 3 => the corrective motion is only based on the diff of the force value: compute this diff - for(int j=0; j& graph_constraints = (*d_graphConstraints.beginEdit())["Constraints"]; - graph_constraints.clear(); - - for(int j=0; jgetNbLines(); - - if(tabErrors[j]) - graph_constraints.push_back(tabErrors[j]); - else if(res[j]->getTolerance()) - graph_constraints.push_back(res[j]->getTolerance()); - else - graph_constraints.push_back(tolerance); - - j += nb; - } - d_graphConstraints.endEdit(); -} - - - - -void ConstraintAnimationLoop::debugWithContact(int numConstraints) -{ - const SReal mu=0.8; - ConstraintProblem& CP = (d_doubleBuffer.getValue() && bufCP1) ? CP2 : CP1; - helper::nlcp_gaussseidel(numConstraints, CP.getDfree()->ptr(), CP.getW()->lptr(), CP.getF()->ptr(), mu, d_tol.getValue(), d_maxIt.getValue(), false, EMIT_EXTRA_DEBUG_MESSAGE); - CP.getF()->clear(); - CP.getF()->resize(numConstraints); - -} - -ConstraintProblem* ConstraintAnimationLoop::getCP() -{ - if (d_doubleBuffer.getValue() && bufCP1) - return &CP2; - else - return &CP1; -} - -void registerConstraintAnimationLoop(sofa::core::ObjectFactory* factory) -{ - factory->registerObjects(core::ObjectRegistrationData("Constraint animation loop manager") - .add< ConstraintAnimationLoop >()); -} - -} //namespace sofa::component::animationloop diff --git a/Sofa/Component/AnimationLoop/src/sofa/component/animationloop/ConstraintAnimationLoop.h b/Sofa/Component/AnimationLoop/src/sofa/component/animationloop/ConstraintAnimationLoop.h index 43c65a90504..9d01c25b23c 100644 --- a/Sofa/Component/AnimationLoop/src/sofa/component/animationloop/ConstraintAnimationLoop.h +++ b/Sofa/Component/AnimationLoop/src/sofa/component/animationloop/ConstraintAnimationLoop.h @@ -22,148 +22,4 @@ #pragma once #include -SOFA_HEADER_DEPRECATED_NOT_REPLACED("v26.06", "v26.12") - - -#include -#include -#include -#include -#include -#include -#include -#include - -#include -#include -#include - -#include - -namespace sofa::simulation::mechanicalvisitor -{ - class MechanicalAccumulateMatrixDeriv; - class MechanicalBuildConstraintMatrix; -} - -namespace sofa::component::constraint::lagrangian::solver -{ - class MechanicalGetConstraintResolutionVisitor; -} - -namespace sofa::component::animationloop -{ - -class SOFA_COMPONENT_ANIMATIONLOOP_API ConstraintProblem -{ -protected: - sofa::linearalgebra::LPtrFullMatrix _W; - sofa::linearalgebra::FullVector _dFree, _force, _d, _df;// cf. These Duriez + _df for scheme correction - std::vector _constraintsResolutions; - SReal _tol; - int _dim; - sofa::helper::system::thread::CTime *_timer; - -public: - ConstraintProblem(bool printLog=false); - virtual ~ConstraintProblem(); - virtual void clear(int dim, const SReal &tol); - - inline int getSize(void) {return _dim;} - inline sofa::linearalgebra::LPtrFullMatrix* getW(void) {return &_W;} - inline sofa::linearalgebra::FullVector* getDfree(void) {return &_dFree;} - inline sofa::linearalgebra::FullVector* getD(void) {return &_d;} - inline sofa::linearalgebra::FullVector* getF(void) {return &_force;} - inline sofa::linearalgebra::FullVector* getdF(void) {return &_df;} - inline std::vector& getConstraintResolutions(void) {return _constraintsResolutions;} - inline SReal *getTolerance(void) {return &_tol;} - - void gaussSeidelConstraintTimed(SReal &timeout, int numItMax); -}; - - - - -class SOFA_COMPONENT_ANIMATIONLOOP_API ConstraintAnimationLoop : public sofa::simulation::CollisionAnimationLoop -{ -public: - typedef sofa::simulation::CollisionAnimationLoop Inherit; - - SOFA_CLASS(ConstraintAnimationLoop, sofa::simulation::CollisionAnimationLoop); -protected: - ConstraintAnimationLoop(); - ~ConstraintAnimationLoop() override; -public: - - void step(const core::ExecParams* params, SReal dt) override; - void init() override; - - Data d_displayTime; ///< Display time for each important step of ConstraintAnimationLoop. - Data d_tol; ///< Tolerance of the Gauss-Seidel - Data d_maxIt; ///< Maximum number of iterations of the Gauss-Seidel - Data d_doCollisionsFirst; ///< Compute the collisions first (to support penality-based contacts) - Data d_doubleBuffer; ///< Double the buffer dedicated to the constraint problem to make it accessible to another thread - Data d_scaleTolerance; ///< Scale the error tolerance with the number of constraints - Data d_allVerified; ///< All constraints must be verified (each constraint's error < tolerance) - Data d_sor; ///< Successive Over Relaxation parameter (0-2) - Data d_schemeCorrection; ///< Apply new scheme where compliance is progressively corrected - Data d_realTimeCompensation; ///< If the total computational time T < dt, sleep(dt-T) - - Data d_activateSubGraph; - - Data > > d_graphErrors; ///< Sum of the constraints' errors at each iteration - Data > > d_graphConstraints; ///< Graph of each constraint's error at the end of the resolution - Data > > d_graphForces; ///< Graph of each constraint's force at each step of the resolution - - ConstraintProblem *getConstraintProblem() {return bufCP1 ? &CP1 : &CP2;} - -protected: - void launchCollisionDetection(const core::ExecParams* params); - void freeMotion(const core::ExecParams* params, simulation::Node *context, SReal &dt); - void setConstraintEquations(const core::ExecParams* params, simulation::Node *context); - void correctiveMotion(const core::ExecParams* params, simulation::Node *context); - void debugWithContact(int numConstraints); - - /// Specific procedures that are called for setting the constraints: - - /// 1.calling resetConstraint & setConstraint & accumulateConstraint visitors - /// and resize the constraint problem that will be solved - void writeAndAccumulateAndCountConstraintDirections(const core::ExecParams* params, simulation::Node *context, unsigned int &numConstraints); - - /// 2.calling GetConstraintViolationVisitor: each constraint provides its present violation - /// for a given state (by default: free_position TODO: add VecId to make this method more generic) - void getIndividualConstraintViolations(const core::ExecParams* params, simulation::Node *context); - - /// 3.calling getConstraintResolution: each constraint provides a method that is used to solve it during GS iterations - void getIndividualConstraintSolvingProcess(const core::ExecParams* params, simulation::Node *context); - - /// 4.calling addComplianceInConstraintSpace projected in the contact space => getDelassusOperator(_W) = H*C*Ht - virtual void computeComplianceInConstraintSpace(); - - - /// method for predictive scheme: - void computePredictiveForce(int dim, SReal* force, std::vector& res); - - - - void gaussSeidelConstraint(int dim, SReal* dfree, SReal** w, SReal* force, SReal* d, std::vector& res, SReal* df); - - std::vector constraintCorrections; - - - virtual ConstraintProblem* getCP(); - - sofa::helper::system::thread::CTime *timer; - SReal timeScale, time ; - - - unsigned int numConstraints; - - bool bufCP1; - SReal compTime, iterationTime; - -private: - ConstraintProblem CP1, CP2; -}; - -} //namespace sofa::component::animationloop +SOFA_HEADER_DISABLED_NOT_REPLACED("v26.06", "v26.12") diff --git a/Sofa/Component/AnimationLoop/src/sofa/component/animationloop/init.cpp b/Sofa/Component/AnimationLoop/src/sofa/component/animationloop/init.cpp index a1f69c55929..0fc267133c0 100644 --- a/Sofa/Component/AnimationLoop/src/sofa/component/animationloop/init.cpp +++ b/Sofa/Component/AnimationLoop/src/sofa/component/animationloop/init.cpp @@ -26,7 +26,6 @@ namespace sofa::component::animationloop { -extern void registerConstraintAnimationLoop(sofa::core::ObjectFactory* factory); extern void registerFreeMotionAnimationLoop(sofa::core::ObjectFactory* factory); extern void registerMultiStepAnimationLoop(sofa::core::ObjectFactory* factory); extern void registerMultiTagAnimationLoop(sofa::core::ObjectFactory* factory); @@ -55,7 +54,6 @@ const char* getModuleVersion() void registerObjects(sofa::core::ObjectFactory* factory) { - registerConstraintAnimationLoop(factory); registerFreeMotionAnimationLoop(factory); registerMultiStepAnimationLoop(factory); registerMultiTagAnimationLoop(factory); diff --git a/Sofa/Component/Collision/Response/Contact/src/sofa/component/collision/response/contact/PenalityContactForceField.inl b/Sofa/Component/Collision/Response/Contact/src/sofa/component/collision/response/contact/PenalityContactForceField.inl index 0d86c9c7c05..d1d33f9c70c 100644 --- a/Sofa/Component/Collision/Response/Contact/src/sofa/component/collision/response/contact/PenalityContactForceField.inl +++ b/Sofa/Component/Collision/Response/Contact/src/sofa/component/collision/response/contact/PenalityContactForceField.inl @@ -355,7 +355,8 @@ void PenalityContactForceField::grabPoint( { if (contactsRef[i].m1 == index[j]) { - result.push_back(std::make_pair(static_cast< core::objectmodel::BaseComponent *>(this),mstate2Pos[contactsRef[i].m2])); + const auto& p2 = mstate2Pos[contactsRef[i].m2]; + result.push_back(std::make_pair(static_cast< core::objectmodel::BaseComponent *>(this), type::Vec3f(p2[0], p2[1], p2[2]))); triangle.push_back(contactsRef[i].index2); index_point.push_back(index[j]); } @@ -371,7 +372,8 @@ void PenalityContactForceField::grabPoint( { if (contactsRef[i].m2 == index[j]) { - result.push_back(std::make_pair(static_cast< core::objectmodel::BaseComponent *>(this), mstate1Pos[contactsRef[i].m1])); + const auto& p1 = mstate1Pos[contactsRef[i].m1]; + result.push_back(std::make_pair(static_cast< core::objectmodel::BaseComponent *>(this), type::Vec3f(p1[0], p1[1], p1[2]))); triangle.push_back(contactsRef[i].index1); index_point.push_back(index[j]); } diff --git a/Sofa/Component/Constraint/Lagrangian/Model/src/sofa/component/constraint/lagrangian/model/BilateralLagrangianConstraint.h b/Sofa/Component/Constraint/Lagrangian/Model/src/sofa/component/constraint/lagrangian/model/BilateralLagrangianConstraint.h index 050e8d19135..e2bda902aca 100644 --- a/Sofa/Component/Constraint/Lagrangian/Model/src/sofa/component/constraint/lagrangian/model/BilateralLagrangianConstraint.h +++ b/Sofa/Component/Constraint/Lagrangian/Model/src/sofa/component/constraint/lagrangian/model/BilateralLagrangianConstraint.h @@ -101,7 +101,6 @@ class BilateralLagrangianConstraint : public PairInteractionConstraint d_restVector; ///< Relative position to maintain between attached points (optional) VecCoord initialDifference; - SOFA_ATTRIBUTE_DISABLED__BILATERALREMOVEUNUSEDTOLERANCE() DeprecatedAndRemoved d_numericalTolerance; ///< a real value specifying the tolerance during the constraint solving. (default=0.0001 Data d_activate; ///< control constraint activation (true by default) Data d_keepOrientDiff; ///< keep the initial difference in orientation (only for rigids) diff --git a/Sofa/Component/Constraint/Lagrangian/Model/src/sofa/component/constraint/lagrangian/model/UniformLagrangianConstraint.inl b/Sofa/Component/Constraint/Lagrangian/Model/src/sofa/component/constraint/lagrangian/model/UniformLagrangianConstraint.inl index 401e5481c75..2e939fa60bf 100644 --- a/Sofa/Component/Constraint/Lagrangian/Model/src/sofa/component/constraint/lagrangian/model/UniformLagrangianConstraint.inl +++ b/Sofa/Component/Constraint/Lagrangian/Model/src/sofa/component/constraint/lagrangian/model/UniformLagrangianConstraint.inl @@ -23,7 +23,7 @@ #pragma once #include -#include +#include #include #include diff --git a/Sofa/Component/Constraint/Lagrangian/Model/src/sofa/component/constraint/lagrangian/model/config.h.in b/Sofa/Component/Constraint/Lagrangian/Model/src/sofa/component/constraint/lagrangian/model/config.h.in index 8e10405fbb7..21419cdc890 100644 --- a/Sofa/Component/Constraint/Lagrangian/Model/src/sofa/component/constraint/lagrangian/model/config.h.in +++ b/Sofa/Component/Constraint/Lagrangian/Model/src/sofa/component/constraint/lagrangian/model/config.h.in @@ -36,13 +36,3 @@ namespace sofa::component::constraint::lagrangian::model constexpr const char* MODULE_NAME = "@PROJECT_NAME@"; constexpr const char* MODULE_VERSION = "@PROJECT_VERSION@"; } // namespace sofa::component::constraint::lagrangian::model - - -#ifdef SOFA_BUILD_SOFA_COMPONENT_CONSTRAINT_LAGRANGIAN_MODEL -#define SOFA_ATTRIBUTE_DISABLED__BILATERALREMOVEUNUSEDTOLERANCE() -#else -#define SOFA_ATTRIBUTE_DISABLED__BILATERALREMOVEUNUSEDTOLERANCE() \ - SOFA_ATTRIBUTE_DISABLED( \ - "v25.06", "v25.12", \ - "Data \'d_numericalTolerance\' has been removed since it was actually not taken into account") -#endif \ No newline at end of file diff --git a/Sofa/Component/Constraint/Lagrangian/Solver/src/sofa/component/constraint/lagrangian/solver/LCPConstraintSolver.h b/Sofa/Component/Constraint/Lagrangian/Solver/src/sofa/component/constraint/lagrangian/solver/LCPConstraintSolver.h index 0e4b2f06903..e28e7018ec0 100644 --- a/Sofa/Component/Constraint/Lagrangian/Solver/src/sofa/component/constraint/lagrangian/solver/LCPConstraintSolver.h +++ b/Sofa/Component/Constraint/Lagrangian/Solver/src/sofa/component/constraint/lagrangian/solver/LCPConstraintSolver.h @@ -81,11 +81,11 @@ class SOFA_COMPONENT_CONSTRAINT_LAGRANGIAN_SOLVER_API LCPConstraintSolver : publ Data d_mu; ///< Friction coefficient Data d_minW; ///< If not zero, constraints whose self-compliance (i.e. the corresponding value on the diagonal of W) is smaller than this threshold will be ignored Data d_maxF; ///< If not zero, constraints whose response force becomes larger than this threshold will be ignored - DeprecatedAndRemoved d_multi_grid; ///< activate multi_grid resolution (NOT STABLE YET) - DeprecatedAndRemoved d_multi_grid_levels; ///< if multi_grid is active: how many levels to create (>=2) - DeprecatedAndRemoved d_merge_method; ///< if multi_grid is active: which method to use to merge constraints (0 = compliance-based, 1 = spatial coordinates) - DeprecatedAndRemoved d_merge_spatial_step; ///< if merge_method is 1: grid size reduction between multigrid levels - DeprecatedAndRemoved d_merge_local_levels; ///< if merge_method is 1: up to the specified level of the multigrid, constraints are grouped locally, i.e. separately within each contact pairs, while on upper levels they are grouped globally independently of contact pairs. + SOFA_ATTRIBUTE_DISABLED__LCPCONSTRAINTSOLVERMULTIGRID() DeprecatedAndRemoved d_multi_grid; ///< activate multi_grid resolution (NOT STABLE YET) + SOFA_ATTRIBUTE_DISABLED__LCPCONSTRAINTSOLVERMULTIGRID() DeprecatedAndRemoved d_multi_grid_levels; ///< if multi_grid is active: how many levels to create (>=2) + SOFA_ATTRIBUTE_DISABLED__LCPCONSTRAINTSOLVERMULTIGRID() DeprecatedAndRemoved d_merge_method; ///< if multi_grid is active: which method to use to merge constraints (0 = compliance-based, 1 = spatial coordinates) + SOFA_ATTRIBUTE_DISABLED__LCPCONSTRAINTSOLVERMULTIGRID() DeprecatedAndRemoved d_merge_spatial_step; ///< if merge_method is 1: grid size reduction between multigrid levels + SOFA_ATTRIBUTE_DISABLED__LCPCONSTRAINTSOLVERMULTIGRID() DeprecatedAndRemoved d_merge_local_levels; ///< if merge_method is 1: up to the specified level of the multigrid, constraints are grouped locally, i.e. separately within each contact pairs, while on upper levels they are grouped globally independently of contact pairs. Data> d_constraintForces; ///< OUTPUT: constraint forces (stored only if computeConstraintForces=True) Data d_computeConstraintForces; ///< The indices of the constraintForces to store in the constraintForce data field @@ -93,10 +93,10 @@ class SOFA_COMPONENT_CONSTRAINT_LAGRANGIAN_SOLVER_API LCPConstraintSolver : publ Data > > d_graph; ///< Graph of residuals at each iteration - DeprecatedAndRemoved d_showLevels; ///< Number of constraint levels to display + SOFA_ATTRIBUTE_DISABLED__LCPCONSTRAINTSOLVERMULTIGRID() DeprecatedAndRemoved d_showLevels; ///< Number of constraint levels to display Data d_showCellWidth; ///< Distance between each constraint cells Data d_showTranslation; ///< Position of the first cell - DeprecatedAndRemoved d_showLevelTranslation; ///< Translation between levels + SOFA_ATTRIBUTE_DISABLED__LCPCONSTRAINTSOLVERMULTIGRID() DeprecatedAndRemoved d_showLevelTranslation; ///< Translation between levels ConstraintProblem* getConstraintProblem() override; void lockConstraintProblem(sofa::core::objectmodel::BaseComponent* from, ConstraintProblem* p1, ConstraintProblem* p2=nullptr) override; ///< Do not use the following LCPs until the next call to this function. This is used to prevent concurrent access to the LCP when using a LCPForceFeedback through an haptic thread diff --git a/Sofa/Component/Constraint/Lagrangian/Solver/src/sofa/component/constraint/lagrangian/solver/config.h.in b/Sofa/Component/Constraint/Lagrangian/Solver/src/sofa/component/constraint/lagrangian/solver/config.h.in index 38f5c33c274..5680d032042 100644 --- a/Sofa/Component/Constraint/Lagrangian/Solver/src/sofa/component/constraint/lagrangian/solver/config.h.in +++ b/Sofa/Component/Constraint/Lagrangian/Solver/src/sofa/component/constraint/lagrangian/solver/config.h.in @@ -31,6 +31,13 @@ # define SOFA_COMPONENT_CONSTRAINT_LAGRANGIAN_SOLVER_API SOFA_IMPORT_DYNAMIC_LIBRARY #endif +#ifdef SOFA_BUILD_SOFA_COMPONENT_CONSTRAINT_LAGRANGIAN_SOLVER +#define SOFA_ATTRIBUTE_DISABLED__LCPCONSTRAINTSOLVERMULTIGRID() +#else +#define SOFA_ATTRIBUTE_DISABLED__LCPCONSTRAINTSOLVERMULTIGRID() \ + SOFA_ATTRIBUTE_DISABLED("v25.12", "v27.06", "Multigrid support has been removed from LCPConstraintSolver.") +#endif + namespace sofa::component::constraint::lagrangian::solver { constexpr const char* MODULE_NAME = "@PROJECT_NAME@"; diff --git a/Sofa/Component/Diffusion/src/sofa/component/diffusion/TetrahedronDiffusionFEMForceField.h b/Sofa/Component/Diffusion/src/sofa/component/diffusion/TetrahedronDiffusionFEMForceField.h index 7b2afa1a710..d20641abf23 100644 --- a/Sofa/Component/Diffusion/src/sofa/component/diffusion/TetrahedronDiffusionFEMForceField.h +++ b/Sofa/Component/Diffusion/src/sofa/component/diffusion/TetrahedronDiffusionFEMForceField.h @@ -99,10 +99,6 @@ class TetrahedronDiffusionFEMForceField : public core::behavior::ForceField d_constantDiffusionCoefficient; /// Vector of diffusivities associated with all tetras Data > d_tetraDiffusionCoefficient; - /// bool used to specify 1D diffusion - /// This data is now useless, as it can be deduced from the template - DeprecatedAndRemoved d_1DDiffusion; - /// Ratio for anisotropic diffusion Data d_transverseAnisotropyRatio; /// Vector for transverse anisotropy diff --git a/Sofa/Component/LinearSolver/Direct/src/sofa/component/linearsolver/direct/EigenDirectSparseSolver.h b/Sofa/Component/LinearSolver/Direct/src/sofa/component/linearsolver/direct/EigenDirectSparseSolver.h index 32c73b925e9..85d2cdc81d2 100644 --- a/Sofa/Component/LinearSolver/Direct/src/sofa/component/linearsolver/direct/EigenDirectSparseSolver.h +++ b/Sofa/Component/LinearSolver/Direct/src/sofa/component/linearsolver/direct/EigenDirectSparseSolver.h @@ -68,7 +68,6 @@ class EigenDirectSparseSolver protected: - DeprecatedAndRemoved d_orderingMethod; std::string m_selectedOrderingMethod; std::unique_ptr m_solver; diff --git a/Sofa/Component/LinearSolver/Iterative/CMakeLists.txt b/Sofa/Component/LinearSolver/Iterative/CMakeLists.txt index 300a11f361a..e96fac4f8b6 100644 --- a/Sofa/Component/LinearSolver/Iterative/CMakeLists.txt +++ b/Sofa/Component/LinearSolver/Iterative/CMakeLists.txt @@ -16,8 +16,6 @@ set(HEADER_FILES ${SOFACOMPONENTLINEARSOLVERITERATIVE_SOURCE_DIR}/MatrixLinearSystem[GraphScattered].h ${SOFACOMPONENTLINEARSOLVERITERATIVE_SOURCE_DIR}/MinResLinearSolver.h ${SOFACOMPONENTLINEARSOLVERITERATIVE_SOURCE_DIR}/MinResLinearSolver.inl - ${SOFACOMPONENTLINEARSOLVERITERATIVE_SOURCE_DIR}/ShewchukPCGLinearSolver.h - ${SOFACOMPONENTLINEARSOLVERITERATIVE_SOURCE_DIR}/ShewchukPCGLinearSolver.inl ${SOFACOMPONENTLINEARSOLVERITERATIVE_SOURCE_DIR}/PCGLinearSolver.h ${SOFACOMPONENTLINEARSOLVERITERATIVE_SOURCE_DIR}/PCGLinearSolver.inl ${SOFACOMPONENTLINEARSOLVERITERATIVE_SOURCE_DIR}/PreconditionedMatrixFreeSystem.h 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 66a5e5e23ea..f9f41e1c0e7 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 @@ -65,9 +65,6 @@ class BaseMatrixLinearSolver : public sofa::core::behavior::LinearSolver virtual void solve(Matrix& M, Vector& solution, Vector& rh) = 0; - SOFA_ITERATIVE_SOLVER_ATTRIBUTE_REMOVE_ASSEMBLY_API() - virtual Matrix * getSystemMatrix() final = delete; - }; /// Empty class used for default solver implementation without multi-threading support @@ -194,10 +191,6 @@ class MatrixLinearSolver : public BaseMatrixLinea void init() override; - /// Reset the current linear system. - SOFA_ITERATIVE_SOLVER_ATTRIBUTE_REMOVE_ASSEMBLY_API() - 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_DISABLED_ASSEMBLY_API() Vector* getSystemRHVector() = delete; @@ -212,10 +205,6 @@ class MatrixLinearSolver : public BaseMatrixLinea /// Solve the system as constructed using the previous methods void solveSystem() override; - /// Apply the solution of the system to all the objects - SOFA_ITERATIVE_SOLVER_ATTRIBUTE_REMOVE_ASSEMBLY_API() - void applySystemSolution() = delete; - /// Invert the system, this method is optional because it's call when solveSystem() is called for the first time void invertSystem() override; @@ -332,12 +321,6 @@ class MatrixLinearSolver : public BaseMatrixLinea virtual MatrixInvertData * createInvertData(); - SOFA_ITERATIVE_SOLVER_ATTRIBUTE_REMOVE_ASSEMBLY_API() - DeprecatedAndRemoved linearSystem; - - SOFA_ITERATIVE_SOLVER_ATTRIBUTE_REMOVE_ASSEMBLY_API() - DeprecatedAndRemoved currentMFactor, currentBFactor, currentKFactor; - bool singleThreadAddJMInvJtLocal(Matrix * /*M*/,ResMatrixType * result,const JMatrixType * J, SReal fact); Data d_factorizationInvalidation; diff --git a/Sofa/Component/LinearSolver/Iterative/src/sofa/component/linearsolver/iterative/ShewchukPCGLinearSolver.h b/Sofa/Component/LinearSolver/Iterative/src/sofa/component/linearsolver/iterative/ShewchukPCGLinearSolver.h deleted file mode 100644 index 0e41cbc1933..00000000000 --- a/Sofa/Component/LinearSolver/Iterative/src/sofa/component/linearsolver/iterative/ShewchukPCGLinearSolver.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_HEADER_DISABLED("v24.12", "v25.12", "sofa/component/linearsolver/iterative/PCGLinearSolver.h") - diff --git a/Sofa/Component/LinearSolver/Iterative/src/sofa/component/linearsolver/iterative/ShewchukPCGLinearSolver.inl b/Sofa/Component/LinearSolver/Iterative/src/sofa/component/linearsolver/iterative/ShewchukPCGLinearSolver.inl deleted file mode 100644 index 7bc02cf58c9..00000000000 --- a/Sofa/Component/LinearSolver/Iterative/src/sofa/component/linearsolver/iterative/ShewchukPCGLinearSolver.inl +++ /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_HEADER_DISABLED("v24.12", "v25.12", "sofa/component/linearsolver/iterative/PCGLinearSolver.inl") 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 9eac98209b4..6d99a0b0115 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 @@ -44,9 +44,3 @@ namespace sofa::component::linearsolver::iterative 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 -#define SOFA_ITERATIVE_SOLVER_ATTRIBUTE_REMOVE_ASSEMBLY_API() -#else -#define SOFA_ITERATIVE_SOLVER_ATTRIBUTE_REMOVE_ASSEMBLY_API() \ - SOFA_ATTRIBUTE_DISABLED("v25.12", "v25.12", "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 diff --git a/Sofa/Component/LinearSystem/compat/sofa/component/linearsystem/MappingGraph.h b/Sofa/Component/LinearSystem/compat/sofa/component/linearsystem/MappingGraph.h index 6aa664670b2..84bb4acc718 100644 --- a/Sofa/Component/LinearSystem/compat/sofa/component/linearsystem/MappingGraph.h +++ b/Sofa/Component/LinearSystem/compat/sofa/component/linearsystem/MappingGraph.h @@ -23,9 +23,4 @@ #include #include -SOFA_HEADER_DEPRECATED("v26.06", "v26.12", "sofa/simulation/MappingGraph.h") - -namespace sofa::component::linearsystem -{ -using MappingGraph = sofa::simulation::MappingGraph; -} +SOFA_HEADER_DISABLED("v26.06", "v26.12", "sofa/simulation/MappingGraph.h") diff --git a/Sofa/Component/ODESolver/Backward/src/sofa/component/odesolver/backward/StaticSolver.cpp b/Sofa/Component/ODESolver/Backward/src/sofa/component/odesolver/backward/StaticSolver.cpp index 5b57a4f6af2..b6c0ac227b8 100644 --- a/Sofa/Component/ODESolver/Backward/src/sofa/component/odesolver/backward/StaticSolver.cpp +++ b/Sofa/Component/ODESolver/Backward/src/sofa/component/odesolver/backward/StaticSolver.cpp @@ -39,43 +39,8 @@ void registerStaticSolver(sofa::core::ObjectFactory* factory) StaticSolver::StaticSolver() : l_newtonSolver(initLink("newtonSolver", "Link to a NewtonRaphsonSolver")) - , d_newton_iterations(this, "newton_iterations") - , d_absolute_correction_tolerance_threshold(this, "absolute_correction_tolerance_threshold") - , d_relative_correction_tolerance_threshold(this, "relative_correction_tolerance_threshold") - , d_absolute_residual_tolerance_threshold(this, "absolute_residual_tolerance_threshold") - , d_relative_residual_tolerance_threshold(this, "relative_residual_tolerance_threshold") - , d_should_diverge_when_residual_is_growing(this, "should_diverge_when_residual_is_growing") {} -void StaticSolver::parse(core::objectmodel::BaseObjectDescription* arg) -{ - Inherit1::parse(arg); - - const auto warnNewAttribute = [&, arg](auto& data, const std::string& newAttributeName) - { - if (const char* attribute = arg->getAttribute(data.m_name)) - { - try - { - data.value.emplace(std::stod(attribute)); - msg_warning() << "The attribute '" << data.m_name - << "' is no longer defined in this component. Instead, define the attribute '" - << newAttributeName << "' in the NewtonRaphsonSolver component associated with this StaticSolver."; - } - catch (const std::exception&) - { - msg_warning() << "Invalid value '" << attribute << "' for deprecated attribute '" << data.m_name << "'"; - } - } - }; - - warnNewAttribute(d_newton_iterations, "maxNbIterationsNewton"); - warnNewAttribute(d_absolute_correction_tolerance_threshold, "absoluteEstimateDifferenceThreshold"); - warnNewAttribute(d_relative_correction_tolerance_threshold, "relativeEstimateDifferenceThreshold"); - warnNewAttribute(d_absolute_residual_tolerance_threshold, "absoluteResidualStoppingThreshold"); - warnNewAttribute(d_relative_residual_tolerance_threshold, "relativeEstimateDifferenceThreshold"); -} - void StaticSolver::init() { OdeSolver::init(); @@ -92,23 +57,6 @@ void StaticSolver::init() newtonRaphsonSolver->setName(this->getContext()->getNameHelper().resolveName(newtonRaphsonSolver->getClassName(), core::ComponentNameHelper::Convention::xml)); this->getContext()->addObject(newtonRaphsonSolver); l_newtonSolver.set(newtonRaphsonSolver); - - const auto setDeprecatedAttribute = [&](const NewtonRaphsonDeprecatedData& oldData, Data& newData) - { - if (oldData.value.has_value()) - { - newData.setValue(*oldData.value); - msg_warning() << "The attribute '" << newData.getName() << "' in " << newData.getOwner()->getPathName() - << " is set from the deprecated attribute '" << oldData.m_name << "'. This will be removed in the future."; - } - }; - - setDeprecatedAttribute(d_newton_iterations, l_newtonSolver->d_maxNbIterationsNewton); - setDeprecatedAttribute(d_absolute_correction_tolerance_threshold, l_newtonSolver->d_absoluteEstimateDifferenceThreshold); - setDeprecatedAttribute(d_relative_correction_tolerance_threshold, l_newtonSolver->d_relativeEstimateDifferenceThreshold); - setDeprecatedAttribute(d_absolute_residual_tolerance_threshold, l_newtonSolver->d_absoluteResidualStoppingThreshold); - setDeprecatedAttribute(d_relative_residual_tolerance_threshold, l_newtonSolver->d_relativeEstimateDifferenceThreshold); - } } diff --git a/Sofa/Component/ODESolver/Backward/src/sofa/component/odesolver/backward/StaticSolver.h b/Sofa/Component/ODESolver/Backward/src/sofa/component/odesolver/backward/StaticSolver.h index d353c90dec6..21daab10818 100644 --- a/Sofa/Component/ODESolver/Backward/src/sofa/component/odesolver/backward/StaticSolver.h +++ b/Sofa/Component/ODESolver/Backward/src/sofa/component/odesolver/backward/StaticSolver.h @@ -25,7 +25,6 @@ #include #include #include -#include namespace sofa::component::odesolver::backward { @@ -44,7 +43,6 @@ class SOFA_COMPONENT_ODESOLVER_BACKWARD_API StaticSolver : core::MultiVecCoordId xResult, core::MultiVecDerivId vResult) override; - void parse(core::objectmodel::BaseObjectDescription* arg) override; void init() override; SingleLink - struct NewtonRaphsonDeprecatedData : core::objectmodel::lifecycle::RemovedData - { - NewtonRaphsonDeprecatedData(Base* b, const std::string name) - : RemovedData(b, "v25.06", "v25.12", name, "The Data related to the Newton-Raphson parameters must be defined in the NewtonRaphsonSolver component.") - {} - - std::optional value; - }; - - SOFA_ATTRIBUTE_DISABLED__NEWTONRAPHSON_IN_STATICSOLVER() NewtonRaphsonDeprecatedData d_newton_iterations; - SOFA_ATTRIBUTE_DISABLED__NEWTONRAPHSON_IN_STATICSOLVER() NewtonRaphsonDeprecatedData d_absolute_correction_tolerance_threshold; - SOFA_ATTRIBUTE_DISABLED__NEWTONRAPHSON_IN_STATICSOLVER() NewtonRaphsonDeprecatedData d_relative_correction_tolerance_threshold; - SOFA_ATTRIBUTE_DISABLED__NEWTONRAPHSON_IN_STATICSOLVER() NewtonRaphsonDeprecatedData d_absolute_residual_tolerance_threshold; - SOFA_ATTRIBUTE_DISABLED__NEWTONRAPHSON_IN_STATICSOLVER() NewtonRaphsonDeprecatedData d_relative_residual_tolerance_threshold; - SOFA_ATTRIBUTE_DISABLED__NEWTONRAPHSON_IN_STATICSOLVER() NewtonRaphsonDeprecatedData d_should_diverge_when_residual_is_growing; }; } diff --git a/Sofa/Component/ODESolver/Backward/src/sofa/component/odesolver/backward/config.h.in b/Sofa/Component/ODESolver/Backward/src/sofa/component/odesolver/backward/config.h.in index 28eee686445..91214f5f4d7 100644 --- a/Sofa/Component/ODESolver/Backward/src/sofa/component/odesolver/backward/config.h.in +++ b/Sofa/Component/ODESolver/Backward/src/sofa/component/odesolver/backward/config.h.in @@ -37,10 +37,3 @@ namespace sofa::component::odesolver::backward constexpr const char* MODULE_VERSION = "@PROJECT_VERSION@"; } // namespace sofa::component::odesolver::backward - -#ifdef SOFA_BUILD_SOFA_COMPONENT_ODESOLVER_BACKWARD -#define SOFA_ATTRIBUTE_DISABLED__NEWTONRAPHSON_IN_STATICSOLVER() -#else -#define SOFA_ATTRIBUTE_DISABLED__NEWTONRAPHSON_IN_STATICSOLVER() \ - SOFA_ATTRIBUTE_DISABLED("v25.06", "v25.12", "The Data are defined in the NewtonRaphsonSolver component.") -#endif diff --git a/Sofa/Component/SolidMechanics/FEM/Elastic/src/sofa/component/solidmechanics/fem/elastic/BaseLinearElasticityFEMForceField.h b/Sofa/Component/SolidMechanics/FEM/Elastic/src/sofa/component/solidmechanics/fem/elastic/BaseLinearElasticityFEMForceField.h index 430f286c538..c31fdf3c83e 100644 --- a/Sofa/Component/SolidMechanics/FEM/Elastic/src/sofa/component/solidmechanics/fem/elastic/BaseLinearElasticityFEMForceField.h +++ b/Sofa/Component/SolidMechanics/FEM/Elastic/src/sofa/component/solidmechanics/fem/elastic/BaseLinearElasticityFEMForceField.h @@ -55,8 +55,8 @@ class BaseLinearElasticityFEMForceField : virtual public core::behavior::ForceFi Real getYoungModulusInElement(sofa::Size elementId) const; Real getPoissonRatioInElement(sofa::Size elementId) const; - SOFA_ATTRIBUTE_DEPRECATED__TOLAMEPARAMETERS() static std::pair toLameParameters(_2DMaterials, Real youngModulus, Real poissonRatio); - SOFA_ATTRIBUTE_DEPRECATED__TOLAMEPARAMETERS() static std::pair toLameParameters(_3DMaterials, Real youngModulus, Real poissonRatio); + SOFA_ATTRIBUTE_DISABLED__TOLAMEPARAMETERS() static std::pair toLameParameters(_2DMaterials, Real youngModulus, Real poissonRatio) = delete; + SOFA_ATTRIBUTE_DISABLED__TOLAMEPARAMETERS() static std::pair toLameParameters(_3DMaterials, Real youngModulus, Real poissonRatio) = delete; protected: diff --git a/Sofa/Component/SolidMechanics/FEM/Elastic/src/sofa/component/solidmechanics/fem/elastic/BaseLinearElasticityFEMForceField.inl b/Sofa/Component/SolidMechanics/FEM/Elastic/src/sofa/component/solidmechanics/fem/elastic/BaseLinearElasticityFEMForceField.inl index 92b6712179f..bf4104f7881 100644 --- a/Sofa/Component/SolidMechanics/FEM/Elastic/src/sofa/component/solidmechanics/fem/elastic/BaseLinearElasticityFEMForceField.inl +++ b/Sofa/Component/SolidMechanics/FEM/Elastic/src/sofa/component/solidmechanics/fem/elastic/BaseLinearElasticityFEMForceField.inl @@ -143,40 +143,4 @@ auto BaseLinearElasticityFEMForceField::getPoissonRatioInElement(sofa return getVecRealInElement(elementId, d_poissonRatio, defaultPoissonRatioValue); } -template -auto BaseLinearElasticityFEMForceField::toLameParameters( - const _2DMaterials elementType, - const Real youngModulus, - const Real poissonRatio) -> std::pair -{ - SOFA_UNUSED(elementType); - - LameLambda lambda { 0 }; - LameMu mu { 0 }; - - sofa::component::solidmechanics::fem::elastic::toLameParameters<2, Real>( - YoungModulus(youngModulus), PoissonRatio(poissonRatio), - lambda, mu); - - return {lambda.get(), mu.get()}; -} - -template -auto BaseLinearElasticityFEMForceField::toLameParameters( - const _3DMaterials elementType, - const Real youngModulus, - const Real poissonRatio) -> std::pair -{ - SOFA_UNUSED(elementType); - - LameLambda lambda { 0 }; - LameMu mu { 0 }; - - sofa::component::solidmechanics::fem::elastic::toLameParameters<3, Real>( - YoungModulus(youngModulus), PoissonRatio(poissonRatio), - lambda, mu); - - return {lambda.get(), mu.get()}; -} - } diff --git a/Sofa/Component/SolidMechanics/FEM/Elastic/src/sofa/component/solidmechanics/fem/elastic/config.h.in b/Sofa/Component/SolidMechanics/FEM/Elastic/src/sofa/component/solidmechanics/fem/elastic/config.h.in index defe9b50c19..81a9d11d19b 100644 --- a/Sofa/Component/SolidMechanics/FEM/Elastic/src/sofa/component/solidmechanics/fem/elastic/config.h.in +++ b/Sofa/Component/SolidMechanics/FEM/Elastic/src/sofa/component/solidmechanics/fem/elastic/config.h.in @@ -38,8 +38,8 @@ namespace sofa::component::solidmechanics::fem::elastic } // namespace sofa::component::solidmechanics::fem::elastic #ifdef SOFA_BUILD_SOFA_COMPONENT_SOLIDMECHANICS_FEM_ELASTIC -#define SOFA_ATTRIBUTE_DEPRECATED__TOLAMEPARAMETERS() +#define SOFA_ATTRIBUTE_DISABLED__TOLAMEPARAMETERS() #else -#define SOFA_ATTRIBUTE_DEPRECATED__TOLAMEPARAMETERS() \ - SOFA_ATTRIBUTE_DEPRECATED("v26.06", "v26.12", "Use the generic overload in LameParameters.h instead.") +#define SOFA_ATTRIBUTE_DISABLED__TOLAMEPARAMETERS() \ + SOFA_ATTRIBUTE_DISABLED("v26.06", "v26.12", "Use the generic overload in LameParameters.h instead.") #endif diff --git a/Sofa/Component/Topology/Container/Dynamic/src/sofa/component/topology/container/dynamic/TriangleSetGeometryAlgorithms.h b/Sofa/Component/Topology/Container/Dynamic/src/sofa/component/topology/container/dynamic/TriangleSetGeometryAlgorithms.h index e0cbc8cfaef..5b3fae7bc80 100644 --- a/Sofa/Component/Topology/Container/Dynamic/src/sofa/component/topology/container/dynamic/TriangleSetGeometryAlgorithms.h +++ b/Sofa/Component/Topology/Container/Dynamic/src/sofa/component/topology/container/dynamic/TriangleSetGeometryAlgorithms.h @@ -394,13 +394,13 @@ class TriangleSetGeometryAlgorithms : public EdgeSetGeometryAlgorithms computeTriangleBarycoefs(const TriangleID ind_t, const sofa::type::Vec<3, Real>& p) const; - SOFA_ATTRIBUTE_DEPRECATED("v25.06", "v26.12", "Use sofa::component::topology::container::dynamic::TriangleSetGeometryAlgorithms::computeTriangleBarycentricCoordinates with useRestPosition set to true") + SOFA_ATTRIBUTE_DEPRECATED("v25.06", "v27.06", "Use sofa::component::topology::container::dynamic::TriangleSetGeometryAlgorithms::computeTriangleBarycentricCoordinates with useRestPosition set to true") sofa::type::vector< SReal > computeRestTriangleBarycoefs(const TriangleID ind_t, const sofa::type::Vec<3, Real>& p) const; - SOFA_ATTRIBUTE_DEPRECATED("v25.06", "v26.12", "Use sofa::component::topology::container::dynamic::TriangleSetGeometryAlgorithms::computeTriangleBarycentricCoordinates") + SOFA_ATTRIBUTE_DEPRECATED("v25.06", "v27.06", "Use sofa::component::topology::container::dynamic::TriangleSetGeometryAlgorithms::computeTriangleBarycentricCoordinates") sofa::type::vector< SReal > compute3PointsBarycoefs(const sofa::type::Vec<3, Real>& p, PointID ind_p1, PointID ind_p2, diff --git a/Sofa/GL/Component/Rendering2D/src/sofa/gl/component/rendering2d/OglLabel.h b/Sofa/GL/Component/Rendering2D/src/sofa/gl/component/rendering2d/OglLabel.h index b13963cba9e..15b2da051e2 100644 --- a/Sofa/GL/Component/Rendering2D/src/sofa/gl/component/rendering2d/OglLabel.h +++ b/Sofa/GL/Component/Rendering2D/src/sofa/gl/component/rendering2d/OglLabel.h @@ -49,8 +49,6 @@ class SOFA_GL_COMPONENT_RENDERING2D_API OglLabel : public core::visual::VisualMo Data d_color; ///< The color of the text to display. (default='gray') Data d_selectContrastingColor ; ///< Override the color value but one that contrast with the background color Data d_updateLabelEveryNbSteps; ///< Update the display of the label every nb of time steps - core::objectmodel::lifecycle::RemovedData d_visible {this, "v23.06", "23.12", "visible", "Use the 'enable' data field instead of 'visible'"}; - void init() override; void reinit() override; diff --git a/Sofa/GL/src/sofa/gl/DrawToolGL.cpp b/Sofa/GL/src/sofa/gl/DrawToolGL.cpp index fbbe4087f13..8f5742eab28 100644 --- a/Sofa/GL/src/sofa/gl/DrawToolGL.cpp +++ b/Sofa/GL/src/sofa/gl/DrawToolGL.cpp @@ -472,12 +472,12 @@ void DrawToolGL::drawTriangleFan(const std::vector &points, void DrawToolGL::drawFrame(const Vec3& position, const Quaternion &orientation, const Vec<3,float> &size) { setPolygonMode(0,false); - gl::Frame::draw(position, orientation, size, type::RGBAColor::red(), type::RGBAColor::green(), type::RGBAColor::blue()); + gl::Frame::draw(position, orientation, type::Vec3(size[0], size[1], size[2]), type::RGBAColor::red(), type::RGBAColor::green(), type::RGBAColor::blue()); } void DrawToolGL::drawFrame(const Vec3& position, const Quaternion &orientation, const Vec<3,float> &size, const type::RGBAColor &color) { setPolygonMode(0,false); - gl::Frame::draw(position, orientation, size, color, color, color); + gl::Frame::draw(position, orientation, type::Vec3(size[0], size[1], size[2]), color, color, color); } ///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// diff --git a/Sofa/GUI/Common/src/sofa/gui/common/OperationFactory.h b/Sofa/GUI/Common/src/sofa/gui/common/OperationFactory.h index f570ea89ff3..be9fffa56cd 100644 --- a/Sofa/GUI/Common/src/sofa/gui/common/OperationFactory.h +++ b/Sofa/GUI/Common/src/sofa/gui/common/OperationFactory.h @@ -65,9 +65,6 @@ class SOFA_GUI_COMMON_API OperationFactory } - SOFA_ATTRIBUTE_DISABLED__TYPO() - static Operation* Instanciate(const std::string &name) = delete; - static Operation* Instantiate(const std::string &name) { const RegisterStorage ® = getInstance()->registry; diff --git a/Sofa/GUI/Common/src/sofa/gui/common/config.h.in b/Sofa/GUI/Common/src/sofa/gui/common/config.h.in index 68853ed544e..cac59fd367e 100644 --- a/Sofa/GUI/Common/src/sofa/gui/common/config.h.in +++ b/Sofa/GUI/Common/src/sofa/gui/common/config.h.in @@ -33,10 +33,3 @@ #else # define SOFA_GUI_COMMON_API SOFA_IMPORT_DYNAMIC_LIBRARY #endif - -#ifdef SOFA_BUILD_SOFA_CORE -#define SOFA_ATTRIBUTE_DISABLED__TYPO() -#else -#define SOFA_ATTRIBUTE_DISABLED__TYPO() \ - SOFA_ATTRIBUTE_DISABLED("v25.06", "v25.12", "Use function Instantiate instead.") -#endif diff --git a/Sofa/framework/Core/CMakeLists.txt b/Sofa/framework/Core/CMakeLists.txt index 8e02de279d4..a1e2e34f2f8 100644 --- a/Sofa/framework/Core/CMakeLists.txt +++ b/Sofa/framework/Core/CMakeLists.txt @@ -40,7 +40,6 @@ set(HEADER_FILES ${SRC_ROOT}/DataTrackerCallback.h ${SRC_ROOT}/DataTrackerFunctor.h ${SRC_ROOT}/DerivativeMatrix.h - ${SRC_ROOT}/DevBaseMonitor.h ${SRC_ROOT}/ExecParams.h ${SRC_ROOT}/fwd.h ${SRC_ROOT}/init.h diff --git a/Sofa/framework/Core/src/sofa/core/CollisionModel.cpp b/Sofa/framework/Core/src/sofa/core/CollisionModel.cpp index 0bf883450e9..96e78d3d60d 100644 --- a/Sofa/framework/Core/src/sofa/core/CollisionModel.cpp +++ b/Sofa/framework/Core/src/sofa/core/CollisionModel.cpp @@ -120,7 +120,6 @@ CollisionModel::CollisionModel() , l_collElemActiver(initLink("collisionElementActiver", "CollisionElementActiver component that activates or deactivates collision element(s) during execution")) { - proximity.setOriginalData(&d_contactDistance); addAlias(&d_contactDistance, "proximity"); d_numberOfContacts.setReadOnly(true); diff --git a/Sofa/framework/Core/src/sofa/core/CollisionModel.h b/Sofa/framework/Core/src/sofa/core/CollisionModel.h index d799ddbde66..9c6b525f272 100644 --- a/Sofa/framework/Core/src/sofa/core/CollisionModel.h +++ b/Sofa/framework/Core/src/sofa/core/CollisionModel.h @@ -25,8 +25,6 @@ #include #include -#include - //todo(dmarchal 2018-06-19) I really wonder why a collision model has a dependency to a RGBAColors. #include @@ -407,8 +405,8 @@ class SOFA_CORE_API CollisionModel : public virtual objectmodel::BaseComponent Data bSelfCollision; - SOFA_ATTRIBUTE_RENAMED__COLLISIONMODEL_PROXIMITY() - objectmodel::lifecycle::RenamedData proximity; + SOFA_ATTRIBUTE_DISABLED__COLLISIONMODEL_PROXIMITY() + DeprecatedAndRemoved proximity; /// Distance to the actual (visual) surface Data d_contactDistance; diff --git a/Sofa/framework/Core/src/sofa/core/DevBaseMonitor.h b/Sofa/framework/Core/src/sofa/core/DevBaseMonitor.h deleted file mode 100644 index 4bea5f09dc9..00000000000 --- a/Sofa/framework/Core/src/sofa/core/DevBaseMonitor.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 - -//header moved in the plugin SofaValidation -SOFA_HEADER_DISABLED("v24.12", "v25.12", "SofaValidation/DevBaseMonitor.h") diff --git a/Sofa/framework/Core/src/sofa/core/behavior/BaseConstraint.h b/Sofa/framework/Core/src/sofa/core/behavior/BaseConstraint.h index 1f92946f6d4..e4398d69a4c 100644 --- a/Sofa/framework/Core/src/sofa/core/behavior/BaseConstraint.h +++ b/Sofa/framework/Core/src/sofa/core/behavior/BaseConstraint.h @@ -23,9 +23,9 @@ #include -SOFA_HEADER_DEPRECATED("v25.12", "v26.12", "sofa/core/behavior/BaseLagrangianConstraint.h") +SOFA_HEADER_DISABLED("v25.12", "v26.12", "sofa/core/behavior/BaseLagrangianConstraint.h") namespace sofa::core::behavior { -using BaseConstraint SOFA_ATTRIBUTE_DEPRECATED("v25.12", "v26.12", "BaseConstraint has been renamed to BaseLagrangianConstraint") = BaseLagrangianConstraint; +using BaseConstraint SOFA_ATTRIBUTE_DISABLED("v25.12", "v26.12", "BaseConstraint has been renamed to BaseLagrangianConstraint") = BaseLagrangianConstraint; } diff --git a/Sofa/framework/Core/src/sofa/core/behavior/BaseLagrangianConstraint.h b/Sofa/framework/Core/src/sofa/core/behavior/BaseLagrangianConstraint.h index 29483011a2f..7d4ca53a4ee 100644 --- a/Sofa/framework/Core/src/sofa/core/behavior/BaseLagrangianConstraint.h +++ b/Sofa/framework/Core/src/sofa/core/behavior/BaseLagrangianConstraint.h @@ -82,13 +82,6 @@ class SOFA_CORE_API BaseLagrangianConstraint : public BaseConstraintSet virtual void getConstraintInfo(const ConstraintParams* cParams, VecConstraintBlockInfo& blocks, VecPersistentID& ids); - //DEPRECATED(v25.06, v25.12) - typedef sofa::type::vector> VecConstCoord; - typedef sofa::type::vector> VecConstDeriv; - typedef sofa::type::vector VecConstArea; - SOFA_ATTRIBUTE_DISABLED__DELETED_ARGUMENTS() - virtual void getConstraintInfo(const core::ConstraintParams* cParams, VecConstraintBlockInfo& blocks, VecPersistentID& ids, VecConstCoord& positions, VecConstDeriv& directions, VecConstArea& areas) final = delete; - /// Add the corresponding ConstraintResolution using the offset parameter /// \param cParams defines the state vectors to use for positions and velocities. Also defines the order of the constraint (POS, VEL, ACC) and resolution parameters (smoothness, ...) /// \param resTab is the result vector that contains the constraint resolution algorithms diff --git a/Sofa/framework/Core/src/sofa/core/behavior/Constraint.h b/Sofa/framework/Core/src/sofa/core/behavior/Constraint.h index 3641d740e98..3815183f561 100644 --- a/Sofa/framework/Core/src/sofa/core/behavior/Constraint.h +++ b/Sofa/framework/Core/src/sofa/core/behavior/Constraint.h @@ -23,10 +23,10 @@ #include -SOFA_HEADER_DEPRECATED("v25.12", "v26.12", "sofa/core/behavior/LagrangianConstraint.h") +SOFA_HEADER_DISABLED("v25.12", "v26.12", "sofa/core/behavior/LagrangianConstraint.h") namespace sofa::core::behavior { template -using Constraint SOFA_ATTRIBUTE_DEPRECATED("v25.12", "v26.12", "Constraint has been renamed to LagrangianConstraint") = LagrangianConstraint; +using Constraint SOFA_ATTRIBUTE_DISABLED("v25.12", "v26.12", "Constraint has been renamed to LagrangianConstraint") = LagrangianConstraint; } diff --git a/Sofa/framework/Core/src/sofa/core/behavior/Constraint.inl b/Sofa/framework/Core/src/sofa/core/behavior/Constraint.inl index 8cd5117155b..c638a717039 100644 --- a/Sofa/framework/Core/src/sofa/core/behavior/Constraint.inl +++ b/Sofa/framework/Core/src/sofa/core/behavior/Constraint.inl @@ -23,4 +23,4 @@ #include -SOFA_HEADER_DEPRECATED("v25.12", "v26.12", "sofa/core/behavior/LagrangianConstraint.inl") +SOFA_HEADER_DISABLED("v25.12", "v26.12", "sofa/core/behavior/LagrangianConstraint.inl") diff --git a/Sofa/framework/Core/src/sofa/core/behavior/LinearSolver.h b/Sofa/framework/Core/src/sofa/core/behavior/LinearSolver.h index f4d0cb2d8c3..20cd9d26cd6 100644 --- a/Sofa/framework/Core/src/sofa/core/behavior/LinearSolver.h +++ b/Sofa/framework/Core/src/sofa/core/behavior/LinearSolver.h @@ -40,21 +40,6 @@ class SOFA_CORE_API LinearSolver : public BaseLinearSolver SOFA_ABSTRACT_CLASS(LinearSolver, BaseLinearSolver) SOFA_BASE_CAST_IMPLEMENTATION(LinearSolver) - /// Reset the current linear system. - SOFA_CORE_ATTRIBUTE_REMOVE_ASSEMBLY_API() - virtual void resetSystem() final = delete; - - /// Set the linear system matrix, combining the mechanical M,B,K matrices using the given coefficients - /// - /// @todo Should we put this method in a specialized class for mechanical systems, or express it using more general terms (i.e. coefficients of the second order ODE to solve) - SOFA_CORE_ATTRIBUTE_REMOVE_ASSEMBLY_API() - virtual void setSystemMBKMatrix(const MechanicalParams* mparams) final = delete; - - /// Rebuild the system using a mass and force factor - /// Experimental API used to investigate convergence issues. - SOFA_CORE_ATTRIBUTE_REMOVE_ASSEMBLY_API() - virtual void rebuildSystem(SReal /*massFactor*/, SReal /*forceFactor*/) final = delete; - virtual sofa::core::behavior::BaseMatrixLinearSystem* getLinearSystem() const = 0; /// Indicate if the solver updates the system in parallel @@ -63,23 +48,6 @@ class SOFA_CORE_API LinearSolver : public BaseLinearSolver /// Returns true if the solver supports non-symmetric systems virtual bool supportNonSymmetricSystem() const { return false; } - /// Indicate if the solver updated the system after the last call of setSystemMBKMatrix (should return true if isParallelSolver return false) - SOFA_CORE_ATTRIBUTE_REMOVE_ASSEMBLY_API() - virtual bool hasUpdatedMatrix() final = delete; - - /// This function is use for the preconditioner it must be called at each time step event if setSystemMBKMatrix is not called - SOFA_CORE_ATTRIBUTE_REMOVE_ASSEMBLY_API() - virtual void updateSystemMatrix() final = delete; - - /// Set the linear system right-hand term vector, from the values contained in the (Mechanical/Physical)State objects - SOFA_CORE_ATTRIBUTE_REMOVE_ASSEMBLY_API() - virtual void setSystemRHVector(core::MultiVecDerivId v) final = delete; - - /// Set the initial estimate of the linear system left-hand term vector, from the values contained in the (Mechanical/Physical)State objects - /// This vector will be replaced by the solution of the system once solveSystem is called - SOFA_CORE_ATTRIBUTE_REMOVE_ASSEMBLY_API() - virtual void setSystemLHVector(core::MultiVecDerivId v) final = delete; - /// Solve the system as constructed using the previous methods virtual void solveSystem() = 0; @@ -161,36 +129,13 @@ class SOFA_CORE_API LinearSolver : public BaseLinearSolver return false; } - /// Get the linear system matrix, or nullptr if this solver does not build it - SOFA_CORE_ATTRIBUTE_REMOVE_ASSEMBLY_API() - virtual linearalgebra::BaseMatrix* getSystemBaseMatrix() final = delete; - - /// Get the linear system right-hand term vector, or nullptr if this solver does not build it - SOFA_CORE_ATTRIBUTE_REMOVE_ASSEMBLY_API() - virtual linearalgebra::BaseVector* getSystemRHBaseVector() final = delete; - - /// Get the linear system left-hand term vector, or nullptr if this solver does not build it - SOFA_CORE_ATTRIBUTE_REMOVE_ASSEMBLY_API() - virtual linearalgebra::BaseVector* getSystemLHBaseVector() final = delete; - - /// Get the linear system inverse matrix, or nullptr if this solver does not build it - SOFA_CORE_ATTRIBUTE_REMOVE_ASSEMBLY_API() - virtual linearalgebra::BaseMatrix* getSystemInverseBaseMatrix() final = delete; - /// Read the Matrix solver from a file virtual bool readFile(std::istream& /*in*/) { return false;} /// Read the Matrix solver from a file virtual bool writeFile(std::ostream& /*out*/) {return false;} - /// Ask the solver to no longer update the system matrix - SOFA_CORE_ATTRIBUTE_REMOVE_ASSEMBLY_API() - virtual void freezeSystemMatrix() = delete; - protected: - - SOFA_CORE_ATTRIBUTE_REMOVE_ASSEMBLY_API() - DeprecatedAndRemoved frozen; }; } // namespace sofa::core::behavior diff --git a/Sofa/framework/Core/src/sofa/core/config.h.in b/Sofa/framework/Core/src/sofa/core/config.h.in index 2215e894724..4085822dd2f 100644 --- a/Sofa/framework/Core/src/sofa/core/config.h.in +++ b/Sofa/framework/Core/src/sofa/core/config.h.in @@ -51,15 +51,7 @@ #define SOFA_ATTRIBUTE_DEPRECATED__REGISTEROBJECT() #else #define SOFA_ATTRIBUTE_DEPRECATED__REGISTEROBJECT() \ - SOFA_ATTRIBUTE_DEPRECATED("v24.12", "v26.12", "RegisterObject and the associated implicit registration is being phased out. Use ObjectRegistrationData and explicit registration from now on. See #4429 for more information.") -#endif - - -#ifdef SOFA_BUILD_SOFA_CORE -#define SOFA_ATTRIBUTE_DISABLED__DELETED_ARGUMENTS() -#else -#define SOFA_ATTRIBUTE_DISABLED__DELETED_ARGUMENTS() \ - SOFA_ATTRIBUTE_DISABLED("v25.06", "v25.12", "Signature has changed, use 'getConstraintResolution(const ConstraintParams* cParams, std::vector &resTab, unsigned int &offset)' instead") + SOFA_ATTRIBUTE_DEPRECATED("v24.12", "v27.06", "RegisterObject and the associated implicit registration is being phased out. Use ObjectRegistrationData and explicit registration from now on. See #4429 for more information.") #endif @@ -71,10 +63,10 @@ SOFA_ATTRIBUTE_DISABLED("v25.12", "v26.06", "Use getContactDistance or setContac #endif #ifdef SOFA_BUILD_SOFA_CORE -#define SOFA_ATTRIBUTE_DEPRECATED__TOBASECONSTRAINT() +#define SOFA_ATTRIBUTE_DISABLED__TOBASECONSTRAINT() #else -#define SOFA_ATTRIBUTE_DEPRECATED__TOBASECONSTRAINT() \ - SOFA_ATTRIBUTE_DEPRECATED("v25.12", "v26.12", "Use toBaseLagrangianConstraint instead.") +#define SOFA_ATTRIBUTE_DISABLED__TOBASECONSTRAINT() \ + SOFA_ATTRIBUTE_DISABLED("v25.12", "v26.12", "Use toBaseLagrangianConstraint instead.") #endif #ifdef SOFA_BUILD_SOFA_CORE @@ -93,10 +85,10 @@ SOFA_ATTRIBUTE_DEPRECATED("v26.06", "v29.06", "Use toBaseComponent instead.") #ifdef SOFA_BUILD_SOFA_CORE -#define SOFA_ATTRIBUTE_RENAMED__COLLISIONMODEL_PROXIMITY() +#define SOFA_ATTRIBUTE_DISABLED__COLLISIONMODEL_PROXIMITY() #else -#define SOFA_ATTRIBUTE_RENAMED__COLLISIONMODEL_PROXIMITY() \ - SOFA_ATTRIBUTE_DEPRECATED("v25.12", "v26.12", "Data 'proximity' has been renamed to 'contactDistance'") +#define SOFA_ATTRIBUTE_DISABLED__COLLISIONMODEL_PROXIMITY() \ + SOFA_ATTRIBUTE_DISABLED("v25.12", "v26.12", "Data 'proximity' has been renamed to 'contactDistance'") #endif #ifdef SOFA_BUILD_SOFA_CORE @@ -107,12 +99,6 @@ SOFA_ATTRIBUTE_DEPRECATED("v26.06", "v29.06", "Use toBaseComponent instead.") #endif -#ifdef SOFA_BUILD_SOFA_CORE -#define SOFA_CORE_ATTRIBUTE_REMOVE_ASSEMBLY_API() -#else -#define SOFA_CORE_ATTRIBUTE_REMOVE_ASSEMBLY_API() \ - SOFA_ATTRIBUTE_DISABLED("v25.12", "v25.12", "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_CORE #define SOFA_CORE_DEPRECATED_RENAME_CREATOR_BASEOBJECTCREATOR() diff --git a/Sofa/framework/Core/src/sofa/core/objectmodel/Base.h b/Sofa/framework/Core/src/sofa/core/objectmodel/Base.h index ce62107d239..01893bc96b6 100644 --- a/Sofa/framework/Core/src/sofa/core/objectmodel/Base.h +++ b/Sofa/framework/Core/src/sofa/core/objectmodel/Base.h @@ -440,8 +440,8 @@ class SOFA_CORE_API Base : public IntrusiveObject #undef SOFA_BASE_CAST_DEFINITION - SOFA_ATTRIBUTE_DEPRECATED__TOBASECONSTRAINT() virtual const behavior::BaseLagrangianConstraint* toBaseConstraint() const { return toBaseLagrangianConstraint(); } - SOFA_ATTRIBUTE_DEPRECATED__TOBASECONSTRAINT() virtual behavior::BaseLagrangianConstraint* toBaseConstraint() { return toBaseLagrangianConstraint(); } + SOFA_ATTRIBUTE_DISABLED__TOBASECONSTRAINT() virtual const behavior::BaseLagrangianConstraint* toBaseConstraint() const = delete; + SOFA_ATTRIBUTE_DISABLED__TOBASECONSTRAINT() virtual behavior::BaseLagrangianConstraint* toBaseConstraint() = delete; SOFA_ATTRIBUTE_DEPRECATED__TOBASEOBJECT() virtual const objectmodel::BaseComponent* toBaseObject() const { return toBaseComponent(); } SOFA_ATTRIBUTE_DEPRECATED__TOBASEOBJECT() virtual objectmodel::BaseComponent* toBaseObject() { return toBaseComponent(); } diff --git a/Sofa/framework/Geometry/src/sofa/geometry/Prism.h b/Sofa/framework/Geometry/src/sofa/geometry/Prism.h index 9ae91e534ab..d053432ea99 100644 --- a/Sofa/framework/Geometry/src/sofa/geometry/Prism.h +++ b/Sofa/framework/Geometry/src/sofa/geometry/Prism.h @@ -48,6 +48,6 @@ struct Prism */ }; -using Pentahedron SOFA_ATTRIBUTE_DEPRECATED("v25.12", "v26.06", "Pentahedron is renamed to Prism") = Prism; +using Pentahedron SOFA_ATTRIBUTE_DISABLED("v25.12", "v26.06", "Pentahedron is renamed to Prism") = Prism; } // namespace sofa::geometry diff --git a/Sofa/framework/Helper/src/sofa/helper/ComponentChange.cpp b/Sofa/framework/Helper/src/sofa/helper/ComponentChange.cpp index 41835aa4239..0b15cf9abaf 100644 --- a/Sofa/framework/Helper/src/sofa/helper/ComponentChange.cpp +++ b/Sofa/framework/Helper/src/sofa/helper/ComponentChange.cpp @@ -26,9 +26,6 @@ namespace sofa::helper::lifecycle { std::map > deprecatedComponents = { - {"RayTraceDetection", Deprecated("v21.06", "v21.12")}, - {"BruteForceDetection", Deprecated("v21.06", "v21.12")}, - {"DirectSAP", Deprecated("v21.06", "v21.12")}, {"RigidRigidMapping", Deprecated("v23.06", "v23.12", "You can use the component RigidMapping with template='Rigid3,Rigid3' instead.")}, {"ConstraintAnimationLoop", Deprecated("v26.06", "v26.12", "Use FreeMotionAnimationLoop instead.")}, }; @@ -370,7 +367,6 @@ std::map > movedComponents = { { "UncoupledConstraintCorrection", Moved("v22.06", "SofaConstraint", Sofa.Component.Constraint.Lagrangian.Correction) }, { "UniformConstraint", Moved("v22.06", "SofaConstraint", Sofa.Component.Constraint.Lagrangian.Model) }, { "UnilateralInteractionConstraint", Moved("v22.06", "SofaConstraint", Sofa.Component.Constraint.Lagrangian.Model) }, - { "ConstraintAnimationLoop", Moved("v22.06", "SofaConstraint", Sofa.Component.AnimationLoop) }, { "FreeMotionAnimationLoop", Moved("v22.06", "SofaConstraint", Sofa.Component.AnimationLoop) }, { "LocalMinDistance", Moved("v22.06", "SofaConstraint", Sofa.Component.Collision.Detection.Intersection) }, diff --git a/Sofa/framework/Helper/src/sofa/helper/config.h.in b/Sofa/framework/Helper/src/sofa/helper/config.h.in index 474c18665af..f91ca261d3e 100644 --- a/Sofa/framework/Helper/src/sofa/helper/config.h.in +++ b/Sofa/framework/Helper/src/sofa/helper/config.h.in @@ -40,11 +40,3 @@ # define SOFA_HELPER_API SOFA_IMPORT_DYNAMIC_LIBRARY #endif - -#ifdef SOFA_BUILD_SOFA_HELPER -#define SOFA_HELPER_FILESYSTEM_FINDORCREATEAVALIDPATH_DISABLED() -#else -#define SOFA_HELPER_FILESYSTEM_FINDORCREATEAVALIDPATH_DISABLED() \ -SOFA_ATTRIBUTE_DISABLED( \ -"v25.06", "v25.12", "It is not clear that this function works on folders or files. Use ensureFolderExists or ensureFolderForFileExists instead.") -#endif // SOFA_BUILD_SOFA_HELPER diff --git a/Sofa/framework/Helper/src/sofa/helper/system/FileSystem.h b/Sofa/framework/Helper/src/sofa/helper/system/FileSystem.h index 65897c9df4e..5800b8f7b42 100644 --- a/Sofa/framework/Helper/src/sofa/helper/system/FileSystem.h +++ b/Sofa/framework/Helper/src/sofa/helper/system/FileSystem.h @@ -98,11 +98,6 @@ static bool removeAll(const std::string& path) ; /// @return true if the file was deleted, false if it did not exist. static bool removeFile(const std::string& path); -/// @brief check that all element in the path exists or create them. (This function accepts relative paths) -/// -/// @return the valid path. -SOFA_HELPER_FILESYSTEM_FINDORCREATEAVALIDPATH_DISABLED() -static std::string findOrCreateAValidPath(const std::string path) = delete; /// @brief Ensures that a folder exists at the specified path. If the folder does not exist, it will be created. /// diff --git a/Sofa/framework/Testing/src/sofa/testing/BaseTest.h b/Sofa/framework/Testing/src/sofa/testing/BaseTest.h index 7861e04ac5a..b6e22dcfdd4 100644 --- a/Sofa/framework/Testing/src/sofa/testing/BaseTest.h +++ b/Sofa/framework/Testing/src/sofa/testing/BaseTest.h @@ -51,12 +51,6 @@ class SOFA_TESTING_API BaseTest : public ::testing::Test virtual void doSetUp() {}; virtual void doTearDown() {}; - SOFA_ATTRIBUTE_DISABLED__TESTING_ONSETUP() - virtual void onSetUp() = delete; - - SOFA_ATTRIBUTE_DISABLED__TESTING_ONTEARDOWN() - virtual void onTearDown() = delete; - /// Seed value static int seed; diff --git a/Sofa/framework/Testing/src/sofa/testing/config.h.in b/Sofa/framework/Testing/src/sofa/testing/config.h.in index c947df666c1..09a918c6d2c 100644 --- a/Sofa/framework/Testing/src/sofa/testing/config.h.in +++ b/Sofa/framework/Testing/src/sofa/testing/config.h.in @@ -36,19 +36,3 @@ constexpr char SOFA_TESTING_RESOURCES_DIR[] = "@SOFA_TESTING_RESOURCES_DIR@"; # define SOFA_TESTING_API SOFA_IMPORT_DYNAMIC_LIBRARY #endif - -#ifdef SOFA_BUILD_SOFA_TESTING -#define SOFA_ATTRIBUTE_DISABLED__TESTING_ONSETUP() -#else -#define SOFA_ATTRIBUTE_DISABLED__TESTING_ONSETUP() \ - SOFA_ATTRIBUTE_DISABLED( \ - "v25.06", "v25.12", "Use doSetUp instead.") -#endif // SOFA_BUILD_SOFA_TESTING - -#ifdef SOFA_BUILD_SOFA_TESTING -#define SOFA_ATTRIBUTE_DISABLED__TESTING_ONTEARDOWN() -#else -#define SOFA_ATTRIBUTE_DISABLED__TESTING_ONTEARDOWN() \ - SOFA_ATTRIBUTE_DISABLED( \ - "v25.06", "v25.12", "Use doTearDown instead.") -#endif // SOFA_BUILD_SOFA_TESTING diff --git a/Sofa/framework/Topology/src/sofa/topology/Prism.h b/Sofa/framework/Topology/src/sofa/topology/Prism.h index 97fedb540f1..7dc77154cab 100644 --- a/Sofa/framework/Topology/src/sofa/topology/Prism.h +++ b/Sofa/framework/Topology/src/sofa/topology/Prism.h @@ -29,7 +29,7 @@ namespace sofa::topology { using Prism = sofa::topology::Element; - using Pentahedron SOFA_ATTRIBUTE_DEPRECATED("v25.12", "v26.06", "Pentahedron is renamed to Prism") = Prism; + using Pentahedron SOFA_ATTRIBUTE_DISABLED("v25.12", "v26.06", "Pentahedron is renamed to Prism") = Prism; static constexpr Prism InvalidPrism; } diff --git a/Sofa/framework/Type/CMakeLists.txt b/Sofa/framework/Type/CMakeLists.txt index 9d8596f2809..b56d104c446 100644 --- a/Sofa/framework/Type/CMakeLists.txt +++ b/Sofa/framework/Type/CMakeLists.txt @@ -39,7 +39,6 @@ set(HEADER_FILES ${SOFATYPESRC_ROOT}/StrongType.h ${SOFATYPESRC_ROOT}/trait/Rebind.h ${SOFATYPESRC_ROOT}/trait/TypeTrait.h - ${SOFATYPESRC_ROOT}/trait/is_container.h ${SOFATYPESRC_ROOT}/trait/is_fixed_array.h ${SOFATYPESRC_ROOT}/trait/is_specialization_of.h ${SOFATYPESRC_ROOT}/trait/is_vector.h diff --git a/Sofa/framework/Type/src/sofa/type/BoundingBox.h b/Sofa/framework/Type/src/sofa/type/BoundingBox.h index 89df6bf8176..22c78e79e90 100644 --- a/Sofa/framework/Type/src/sofa/type/BoundingBox.h +++ b/Sofa/framework/Type/src/sofa/type/BoundingBox.h @@ -126,15 +126,12 @@ class SOFA_TYPE_API BoundingBox template -class SOFA_ATTRIBUTE_DEPRECATED__TBOUNDINGBOX() TBoundingBox : public BoundingBox +class SOFA_ATTRIBUTE_DISABLED__TBOUNDINGBOX() TBoundingBox : public BoundingBox { public: - TBoundingBox(const TReal* minBBoxPtr, const TReal* maxBBoxPtr) - :BoundingBox(sofa::type::Vec3(minBBoxPtr),sofa::type::Vec3(maxBBoxPtr)) - { - } + TBoundingBox(const TReal* minBBoxPtr, const TReal* maxBBoxPtr) = delete; - TBoundingBox() : BoundingBox() {} + TBoundingBox() = delete; }; diff --git a/Sofa/framework/Type/src/sofa/type/Mat.h b/Sofa/framework/Type/src/sofa/type/Mat.h index 2f223c92034..f4887fcb4c9 100644 --- a/Sofa/framework/Type/src/sofa/type/Mat.h +++ b/Sofa/framework/Type/src/sofa/type/Mat.h @@ -238,7 +238,9 @@ class Mat template constexpr void operator=(const Mat& m) noexcept { - std::copy(m.begin(), m.begin()+(L>L2?L2:L), this->begin()); + constexpr Size minL = (L>L2?L2:L); + for (Size i = 0; i < minL; i++) + (*this)[i].set(m[i]); } template @@ -1014,20 +1016,14 @@ constexpr real determinant(const Mat<1,1,real>& m) noexcept /// Generalized-determinant of a 2x3 matrix. /// Mirko Radi, "About a Determinant of Rectangular 2×n Matrix and its Geometric Interpretation" template -SOFA_ATTRIBUTE_DEPRECATED__NONSQUAREDETERMINANT() -constexpr real determinant(const Mat<2,3,real>& m) noexcept -{ - return m(0,0)*m(1,1) - m(0,1)*m(1,0) - ( m(0,0)*m(1,2) - m(0,2)*m(1,0) ) + m(0,1)*m(1,2) - m(0,2)*m(1,1); -} +SOFA_ATTRIBUTE_DISABLED__NONSQUAREDETERMINANT() +constexpr real determinant(const Mat<2,3,real>& m) noexcept = delete; /// Generalized-determinant of a 3x2 matrix. /// Mirko Radi, "About a Determinant of Rectangular 2×n Matrix and its Geometric Interpretation" template -SOFA_ATTRIBUTE_DEPRECATED__NONSQUAREDETERMINANT() -constexpr real determinant(const Mat<3,2,real>& m) noexcept -{ - return m(0,0)*m(1,1) - m(1,0)*m(0,1) - ( m(0,0)*m(2,1) - m(2,0)*m(0,1) ) + m(1,0)*m(2,1) - m(2,0)*m(1,1); -} +SOFA_ATTRIBUTE_DISABLED__NONSQUAREDETERMINANT() +constexpr real determinant(const Mat<3,2,real>& m) noexcept = delete; /** * Computes the absolute value of the generalized determinant of a given matrix. diff --git a/Sofa/framework/Type/src/sofa/type/Vec.h b/Sofa/framework/Type/src/sofa/type/Vec.h index 070d40682c4..c619816b371 100644 --- a/Sofa/framework/Type/src/sofa/type/Vec.h +++ b/Sofa/framework/Type/src/sofa/type/Vec.h @@ -162,21 +162,13 @@ class Vec } template - SOFA_ATTRIBUTE_DEPRECATED__VEC_FROM_DIFFERENT_VEC() - constexpr Vec(const Vec& p) noexcept - { - for(Size i=0; ielems[i] = static_cast(p(i)); - } + SOFA_ATTRIBUTE_DISABLED__VEC_FROM_DIFFERENT_VEC() + constexpr Vec(const Vec& p) noexcept = delete; /// Constructor from an array of values. template - SOFA_ATTRIBUTE_DEPRECATED__VEC_FROM_POINTER() - explicit constexpr Vec(const real2* p) noexcept - { - for(Size i=0; ielems[i] = static_cast(p[i]); - } + SOFA_ATTRIBUTE_DISABLED__VEC_FROM_POINTER() + explicit constexpr Vec(const real2* p) noexcept = delete; /// Special access to first element. template=1),int>::type = 0> @@ -237,23 +229,13 @@ class Vec /// Assignment operator from an array of values. template - SOFA_ATTRIBUTE_DEPRECATED__VEC_FROM_POINTER() - constexpr void operator=(const real2* p) noexcept - { - //static_assert(false); - for(Size i=0; ielems[i] = (ValueType)p[i]; - } + SOFA_ATTRIBUTE_DISABLED__VEC_FROM_POINTER() + constexpr void operator=(const real2* p) noexcept = delete; /// Assignment from a vector with different dimensions. template - SOFA_ATTRIBUTE_DEPRECATED__VEC_FROM_DIFFERENT_VEC() - constexpr void operator=(const Vec& v) noexcept - { - //static_assert(false); - for(Size i=0; i<(N>M?M:N); i++) - this->elems[i] = (ValueType)v(i); - } + SOFA_ATTRIBUTE_DISABLED__VEC_FROM_DIFFERENT_VEC() + constexpr void operator=(const Vec& v) noexcept = delete; // assign one value to all elements constexpr void assign(const ValueType& value) noexcept diff --git a/Sofa/framework/Type/src/sofa/type/config.h.in b/Sofa/framework/Type/src/sofa/type/config.h.in index 933401c6d22..9671dfad61a 100644 --- a/Sofa/framework/Type/src/sofa/type/config.h.in +++ b/Sofa/framework/Type/src/sofa/type/config.h.in @@ -36,38 +36,29 @@ #ifdef SOFA_BUILD_SOFA_TYPE -#define SOFA_ATTRIBUTE_DEPRECATED__IS_CONTAINER() +#define SOFA_ATTRIBUTE_DISABLED__TBOUNDINGBOX() #else -#define SOFA_ATTRIBUTE_DEPRECATED__IS_CONTAINER() \ - SOFA_ATTRIBUTE_DISABLED( \ - "v25.06", "v25.12", \ - "Use std::ranges::ranges concept instead.") +#define SOFA_ATTRIBUTE_DISABLED__TBOUNDINGBOX() \ + SOFA_ATTRIBUTE_DISABLED("v25.12", "v26.12", "TBoundingBox is being phased out, use BoundingBox instead (PR 5676).") #endif #ifdef SOFA_BUILD_SOFA_TYPE -#define SOFA_ATTRIBUTE_DEPRECATED__TBOUNDINGBOX() +#define SOFA_ATTRIBUTE_DISABLED__VEC_FROM_POINTER() #else -#define SOFA_ATTRIBUTE_DEPRECATED__TBOUNDINGBOX() \ - SOFA_ATTRIBUTE_DEPRECATED("v25.12", "v26.12", "TBoundingBox is being phased out, use BoundingBox instead (PR 5676).") +#define SOFA_ATTRIBUTE_DISABLED__VEC_FROM_POINTER() \ + SOFA_ATTRIBUTE_DISABLED("v25.12", "v26.12", "Assignment and construction from raw pointer is being phased out (PR 5675).") #endif #ifdef SOFA_BUILD_SOFA_TYPE -#define SOFA_ATTRIBUTE_DEPRECATED__VEC_FROM_POINTER() +#define SOFA_ATTRIBUTE_DISABLED__VEC_FROM_DIFFERENT_VEC() #else -#define SOFA_ATTRIBUTE_DEPRECATED__VEC_FROM_POINTER() \ - SOFA_ATTRIBUTE_DEPRECATED("v25.12", "v26.12", "Assignment and construction from raw pointer is being phased out (PR 5675).") +#define SOFA_ATTRIBUTE_DISABLED__VEC_FROM_DIFFERENT_VEC() \ + SOFA_ATTRIBUTE_DISABLED("v25.12", "v26.12", "Assignment and construction from a different Vec is being phased out (PR 5675).") #endif #ifdef SOFA_BUILD_SOFA_TYPE -#define SOFA_ATTRIBUTE_DEPRECATED__VEC_FROM_DIFFERENT_VEC() +#define SOFA_ATTRIBUTE_DISABLED__NONSQUAREDETERMINANT() #else -#define SOFA_ATTRIBUTE_DEPRECATED__VEC_FROM_DIFFERENT_VEC() \ - SOFA_ATTRIBUTE_DEPRECATED("v25.12", "v26.12", "Assignment and construction from a different Vec is being phased out (PR 5675).") -#endif - -#ifdef SOFA_BUILD_SOFA_TYPE -#define SOFA_ATTRIBUTE_DEPRECATED__NONSQUAREDETERMINANT() -#else -#define SOFA_ATTRIBUTE_DEPRECATED__NONSQUAREDETERMINANT() \ - SOFA_ATTRIBUTE_DEPRECATED("v26.06", "v26.12", "Determinant for non-square matrix is not well-defined.") +#define SOFA_ATTRIBUTE_DISABLED__NONSQUAREDETERMINANT() \ + SOFA_ATTRIBUTE_DISABLED("v26.06", "v26.12", "Determinant for non-square matrix is not well-defined.") #endif diff --git a/Sofa/framework/Type/src/sofa/type/trait/is_container.h b/Sofa/framework/Type/src/sofa/type/trait/is_container.h deleted file mode 100644 index 52891c57812..00000000000 --- a/Sofa/framework/Type/src/sofa/type/trait/is_container.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 -#include - -SOFA_HEADER_DISABLED_NOT_REPLACED("v25.06", "v25.12") diff --git a/applications/plugins/Geomagic/src/Geomagic/GeomagicDriver.cpp b/applications/plugins/Geomagic/src/Geomagic/GeomagicDriver.cpp index 01274a08370..a1e616bbb27 100644 --- a/applications/plugins/Geomagic/src/Geomagic/GeomagicDriver.cpp +++ b/applications/plugins/Geomagic/src/Geomagic/GeomagicDriver.cpp @@ -527,8 +527,8 @@ void GeomagicDriver::computeBBox(const core::ExecParams* params, bool onlyVisib SOFA_UNUSED(params); if (!onlyVisible) return; - SReal minBBox[3] = {1e10,1e10,1e10}; - SReal maxBBox[3] = {-1e10,-1e10,-1e10}; + Vec3 minBBox = {1e10,1e10,1e10}; + Vec3 maxBBox = {-1e10,-1e10,-1e10}; minBBox[0] = d_posDevice.getValue().getCenter()[0]-d_positionBase.getValue()[0]*d_scale.getValue(); minBBox[1] = d_posDevice.getValue().getCenter()[1]-d_positionBase.getValue()[1]*d_scale.getValue(); @@ -538,7 +538,7 @@ void GeomagicDriver::computeBBox(const core::ExecParams* params, bool onlyVisib maxBBox[1] = d_posDevice.getValue().getCenter()[1]+d_positionBase.getValue()[1]*d_scale.getValue(); maxBBox[2] = d_posDevice.getValue().getCenter()[2]+d_positionBase.getValue()[2]*d_scale.getValue(); - this->f_bbox.setValue(sofa::type::TBoundingBox(minBBox,maxBBox)); + this->f_bbox.setValue(sofa::type::BoundingBox(minBBox,maxBBox)); } diff --git a/applications/plugins/SofaCUDA/src/SofaCUDA/init.cpp b/applications/plugins/SofaCUDA/src/SofaCUDA/init.cpp index 961f7f2b06d..e97b48fcc41 100644 --- a/applications/plugins/SofaCUDA/src/SofaCUDA/init.cpp +++ b/applications/plugins/SofaCUDA/src/SofaCUDA/init.cpp @@ -76,14 +76,3 @@ void init() } // namespace sofacuda -// compat -namespace sofa::gpu::cuda -{ - -void init() -{ - msg_warning("SofaCUDA") << "You must now call sofacuda::init() instead of sofa::gpu::cuda::init()"; - sofacuda::init(); -} - -} // sofa::gpu::cuda diff --git a/applications/plugins/SofaCUDA/src/SofaCUDA/init.h b/applications/plugins/SofaCUDA/src/SofaCUDA/init.h index 8dfae267df1..54fcd0b4f42 100644 --- a/applications/plugins/SofaCUDA/src/SofaCUDA/init.h +++ b/applications/plugins/SofaCUDA/src/SofaCUDA/init.h @@ -31,6 +31,6 @@ namespace sofacuda // compat namespace sofa::gpu::cuda { - SOFA_ATTRIBUTE_DEPRECATED("v26.06", "v26.12", "use sofacuda::init() instead") - SOFACUDA_API void init(); + SOFA_ATTRIBUTE_DISABLED("v26.06", "v26.12", "use sofacuda::init() instead") + SOFACUDA_API void init() = delete; } // namespace sofa::gpu::cuda diff --git a/applications/plugins/SofaDistanceGrid/extensions/CUDA/src/SofaDistanceGrid/CUDA/init.cpp b/applications/plugins/SofaDistanceGrid/extensions/CUDA/src/SofaDistanceGrid/CUDA/init.cpp index fd24b4bdf2a..c6d0387a02f 100644 --- a/applications/plugins/SofaDistanceGrid/extensions/CUDA/src/SofaDistanceGrid/CUDA/init.cpp +++ b/applications/plugins/SofaDistanceGrid/extensions/CUDA/src/SofaDistanceGrid/CUDA/init.cpp @@ -66,7 +66,7 @@ void init() sofa::helper::system::PluginManager::getInstance().registerPlugin(MODULE_NAME); sofadistancegrid::initSofaDistanceGrid(); - sofa::gpu::cuda::init(); + sofacuda::init(); first = false; } } diff --git a/applications/plugins/VolumetricRendering/extensions/CUDA/src/VolumetricRendering/CUDA/init.cpp b/applications/plugins/VolumetricRendering/extensions/CUDA/src/VolumetricRendering/CUDA/init.cpp index 39fe970d82b..b137d229913 100644 --- a/applications/plugins/VolumetricRendering/extensions/CUDA/src/VolumetricRendering/CUDA/init.cpp +++ b/applications/plugins/VolumetricRendering/extensions/CUDA/src/VolumetricRendering/CUDA/init.cpp @@ -61,7 +61,7 @@ void init() sofa::helper::system::PluginManager::getInstance().registerPlugin(MODULE_NAME); volumetricrendering::init(); - sofa::gpu::cuda::init(); + sofacuda::init(); first = false; } } diff --git a/applications/plugins/VolumetricRendering/src/VolumetricRendering/OglTetrahedralModel.inl b/applications/plugins/VolumetricRendering/src/VolumetricRendering/OglTetrahedralModel.inl index 97c4f0a0c99..e0989ebc14f 100644 --- a/applications/plugins/VolumetricRendering/src/VolumetricRendering/OglTetrahedralModel.inl +++ b/applications/plugins/VolumetricRendering/src/VolumetricRendering/OglTetrahedralModel.inl @@ -350,7 +350,7 @@ void OglTetrahedralModel::computeBBox(const core::ExecParams * params } } - this->f_bbox.setValue(sofa::type::TBoundingBox(minBBox, maxBBox)); + this->f_bbox.setValue(sofa::type::BoundingBox(sofa::type::Vec3(minBBox[0],minBBox[1],minBBox[2]), sofa::type::Vec3(maxBBox[0],maxBBox[1],maxBBox[2]))); } } diff --git a/applications/plugins/VolumetricRendering/src/VolumetricRendering/OglVolumetricModel.cpp b/applications/plugins/VolumetricRendering/src/VolumetricRendering/OglVolumetricModel.cpp index 6bd4b6e9fae..e02dff43648 100644 --- a/applications/plugins/VolumetricRendering/src/VolumetricRendering/OglVolumetricModel.cpp +++ b/applications/plugins/VolumetricRendering/src/VolumetricRendering/OglVolumetricModel.cpp @@ -341,7 +341,7 @@ void OglVolumetricModel::computeBarycenters() { const Tetrahedron& t = tetrahedra[i]; Coord barycenter = (positions[t[0]] + positions[t[1]] + positions[t[2]] + positions[t[3]])*0.25; - m_tetraBarycenters.push_back(barycenter); + m_tetraBarycenters.push_back(type::Vec3f(barycenter[0], barycenter[1], barycenter[2])); } m_hexaBarycenters.clear(); @@ -350,11 +350,12 @@ void OglVolumetricModel::computeBarycenters() const Hexahedron& h = hexahedra[i]; Coord barycenter = (positions[h[0]] + positions[h[1]] + positions[h[2]] + positions[h[3]] + positions[h[4]] + positions[h[5]] + positions[h[6]] + positions[h[7]])*0.125; - m_hexaBarycenters.push_back(barycenter); - m_hexaBarycenters.push_back(barycenter); - m_hexaBarycenters.push_back(barycenter); - m_hexaBarycenters.push_back(barycenter); - m_hexaBarycenters.push_back(barycenter); + const type::Vec3f fBarycenter(barycenter[0], barycenter[1], barycenter[2]); + m_hexaBarycenters.push_back(fBarycenter); + m_hexaBarycenters.push_back(fBarycenter); + m_hexaBarycenters.push_back(fBarycenter); + m_hexaBarycenters.push_back(fBarycenter); + m_hexaBarycenters.push_back(fBarycenter); } unsigned int tetraBarycentersBufferSize = m_tetraBarycenters.size() * 3 * sizeof(GLfloat); unsigned int hexaBarycentersBufferSize = m_hexaBarycenters.size() * 3 * sizeof(GLfloat); @@ -512,7 +513,7 @@ void OglVolumetricModel::computeBBox(const core::ExecParams * params, bool onlyV if (maxBBox[1] < v[1]) maxBBox[1] = v[1]; if (maxBBox[2] < v[2]) maxBBox[2] = v[2]; } - this->f_bbox.setValue(sofa::type::TBoundingBox(minBBox, maxBBox)); + this->f_bbox.setValue(sofa::type::BoundingBox(sofa::type::Vec3(minBBox[0],minBBox[1],minBBox[2]), sofa::type::Vec3(maxBBox[0],maxBBox[1],maxBBox[2]))); } }