diff --git a/src/BeamAdapter/component/BaseBeamInterpolation.h b/src/BeamAdapter/component/BaseBeamInterpolation.h index 8c4bbb51f..a765ea972 100644 --- a/src/BeamAdapter/component/BaseBeamInterpolation.h +++ b/src/BeamAdapter/component/BaseBeamInterpolation.h @@ -49,7 +49,6 @@ using sofa::type::Quat ; using sofa::type::Vec ; using sofa::type::Vec3d ; using sofa::type::vector; -using sofa::core::ConstVecCoordId; using sofa::core::behavior::MechanicalState; using sofa::component::statecontainer::MechanicalObject; @@ -170,11 +169,11 @@ class BaseBeamInterpolation : public virtual sofa::core::objectmodel::BaseObject /// spline base interpolation of points and transformation void interpolatePointUsingSpline(unsigned int edgeInList, const Real& baryCoord, const Vec3& localPos, const VecCoord& x, Vec3& posResult) { - interpolatePointUsingSpline(edgeInList, baryCoord, localPos, x, posResult, true, ConstVecCoordId::position()); + interpolatePointUsingSpline(edgeInList, baryCoord, localPos, x, posResult, true, sofa::core::vec_id::read_access::position); } void interpolatePointUsingSpline(unsigned int edgeInList, const Real& baryCoord, const Vec3& localPos, - const VecCoord& x, Vec3& posResult, bool recompute, const ConstVecCoordId& vecXId); + const VecCoord& x, Vec3& posResult, bool recompute, const sofa::core::ConstVecCoordId& vecXId); void InterpolateTransformUsingSpline(unsigned int edgeInList, const Real& baryCoord, const Vec3& localPos, diff --git a/src/BeamAdapter/component/BaseBeamInterpolation.inl b/src/BeamAdapter/component/BaseBeamInterpolation.inl index a66ac2883..ebbbbd23b 100644 --- a/src/BeamAdapter/component/BaseBeamInterpolation.inl +++ b/src/BeamAdapter/component/BaseBeamInterpolation.inl @@ -619,7 +619,7 @@ void BaseBeamInterpolation::interpolatePointUsingSpline(unsigned int const VecCoord& x, Vec3& posResult, bool recompute, - const ConstVecCoordId& vecXId) + const sofa::core::ConstVecCoordId& vecXId) { if (recompute) { diff --git a/src/BeamAdapter/component/BeamInterpolation.h b/src/BeamAdapter/component/BeamInterpolation.h index 78346a5ab..728e4ee72 100644 --- a/src/BeamAdapter/component/BeamInterpolation.h +++ b/src/BeamAdapter/component/BeamInterpolation.h @@ -47,7 +47,6 @@ namespace _beaminterpolation_ using sofa::component::fem::BaseBeamInterpolation; using sofa::helper::OptionsGroup; using sofa::core::topology::BaseMeshTopology; -using sofa::core::ConstVecCoordId; using sofa::core::behavior::MechanicalState; using sofa::component::statecontainer::MechanicalObject; @@ -148,7 +147,7 @@ class BeamInterpolation : public BaseBeamInterpolation Real &_Asy, Real &_Asz, Real &J) override; void getMechanicalParameters(sofa::Index beamId, Real& youngModulus, Real& cPoisson, Real& massDensity) override; - void getTangentUsingSplinePoints(unsigned int edgeInList, const Real& baryCoord, const ConstVecCoordId &vecXId, Vec3& t ); + void getTangentUsingSplinePoints(unsigned int edgeInList, const Real& baryCoord, const sofa::core::ConstVecCoordId &vecXId, Vec3& t ); /// computeActualLength => given the 4 control points of the spline, it provides an estimate of the length (using gauss points integration) diff --git a/src/BeamAdapter/component/BeamInterpolation.inl b/src/BeamAdapter/component/BeamInterpolation.inl index 51877342f..4a011261d 100644 --- a/src/BeamAdapter/component/BeamInterpolation.inl +++ b/src/BeamAdapter/component/BeamInterpolation.inl @@ -44,7 +44,6 @@ namespace sofa::component::fem::_beaminterpolation_ using sofa::core::topology::BaseMeshTopology ; using sofa::core::objectmodel::ComponentState ; using sofa::core::behavior::MechanicalState; -using sofa::core::ConstVecCoordId ; using sofa::core::objectmodel::BaseContext ; using sofa::helper::ReadAccessor ; @@ -188,7 +187,7 @@ void BeamInterpolation::bwdInit() DOF1TransformNode1.resize(edgeList.size()); } - ReadAccessor > statePos = this->m_mstate->read(ConstVecCoordId::position()) ; + ReadAccessor > statePos = this->m_mstate->read(sofa::core::vec_id::read_access::position) ; auto lengthList = sofa::helper::getWriteOnlyAccessor(this->d_lengthList); lengthList.clear(); @@ -478,8 +477,8 @@ void BeamInterpolation::getSplineRestTransform(unsigned int edgeInLis unsigned int node0Id, node1Id; this->getNodeIndices(edgeInList,node0Id,node1Id); - Coord global_0 = state->read(core::VecCoordId::restPosition())->getValue()[node0Id]; - Coord global_1 = state->read(core::VecCoordId::restPosition())->getValue()[node1Id]; + Coord global_0 = state->read(sofa::core::vec_id::read_access::restPosition)->getValue()[node0Id]; + Coord global_1 = state->read(sofa::core::vec_id::read_access::restPosition)->getValue()[node1Id]; Transform global_H_DOF0 = Transform(global_0.getCenter(),global_0.getOrientation()); Transform global_H_DOF1 = Transform(global_1.getCenter(),global_1.getOrientation()); @@ -508,7 +507,7 @@ void BeamInterpolation::getSplineRestTransform(unsigned int edgeInLis template void BeamInterpolation::getTangentUsingSplinePoints(unsigned int edgeInList, const Real& baryCoord, - const ConstVecCoordId &vecXId, Vec3& t ) + const sofa::core::ConstVecCoordId &vecXId, Vec3& t ) { const VectorVec3& splinePos = this->m_StateNodes->read(vecXId)->getValue(); @@ -563,16 +562,16 @@ void BeamInterpolation::updateInterpolation(){ if(d_vecID.getValue().getSelectedItem() == "current") { dmsg_info() <<" position " << msgendl - << " ="<< this->m_mstate->read( core::ConstVecCoordId::position() )->getValue( ) ; - x=this->m_mstate->read( core::ConstVecCoordId::position() ); + << " ="<< this->m_mstate->read( sofa::core::vec_id::read_access::position )->getValue( ) ; + x=this->m_mstate->read( sofa::core::vec_id::read_access::position ); } else if(d_vecID.getValue().getSelectedItem() == "free") { - x=this->m_mstate->read( core::ConstVecCoordId::freePosition() ) ; + x=this->m_mstate->read( sofa::core::vec_id::read_access::freePosition ) ; } else /// rest position { - x=this->m_mstate->read( core::ConstVecCoordId::restPosition() ) ; + x=this->m_mstate->read( sofa::core::vec_id::read_access::restPosition ) ; computeVel = false; } diff --git a/src/BeamAdapter/component/constraint/AdaptiveBeamLengthConstraint.inl b/src/BeamAdapter/component/constraint/AdaptiveBeamLengthConstraint.inl index 23e43fb7a..53caa4d03 100644 --- a/src/BeamAdapter/component/constraint/AdaptiveBeamLengthConstraint.inl +++ b/src/BeamAdapter/component/constraint/AdaptiveBeamLengthConstraint.inl @@ -34,7 +34,6 @@ namespace sofa::component::constraintset::_adaptivebeamlengthconstraint_ { using helper::ReadAccessor; -using sofa::core::ConstVecCoordId; using std::stringstream; using sofa::core::ConstraintParams; using sofa::linearalgebra::BaseVector; @@ -295,8 +294,8 @@ void AdaptiveBeamLengthConstraint::buildConstraintMatrix(const Constr m_nbConstraints = 0; m_cid = constraintId; - ReadAccessor > x = this->mstate->read(ConstVecCoordId::position()) ; - ReadAccessor > xfree = this->mstate->read(ConstVecCoordId::freePosition()) ; + ReadAccessor > x = this->mstate->read(sofa::core::vec_id::read_access::position) ; + ReadAccessor > xfree = this->mstate->read(sofa::core::vec_id::read_access::freePosition) ; auto c = sofa::helper::getWriteOnlyAccessor(c_d); diff --git a/src/BeamAdapter/component/constraint/AdaptiveBeamSlidingConstraint.inl b/src/BeamAdapter/component/constraint/AdaptiveBeamSlidingConstraint.inl index 131622877..10bdce8ac 100644 --- a/src/BeamAdapter/component/constraint/AdaptiveBeamSlidingConstraint.inl +++ b/src/BeamAdapter/component/constraint/AdaptiveBeamSlidingConstraint.inl @@ -1,4 +1,4 @@ -/****************************************************************************** +/****************************************************************************** * BeamAdapter plugin * * (c) 2006 Inria, University of Lille, CNRS * * * @@ -32,7 +32,6 @@ namespace sofa::component::constraintset::_adaptiveBeamSlidingConstraint_ { using sofa::core::behavior::ConstraintResolution ; -using sofa::core::ConstVecCoordId; using sofa::core::ConstraintParams; using sofa::helper::ReadAccessor; @@ -102,8 +101,8 @@ void AdaptiveBeamSlidingConstraint::internalInit() // We search for the closest segment, on which to project each point // Convention : object1 is the beam model, object2 is the list of point constraints - ReadAccessor > x1 = mstate1->read(ConstVecCoordId::position()) ; - ReadAccessor > x2 = mstate2->read(ConstVecCoordId::position()) ; + ReadAccessor > x1 = mstate1->read(sofa::core::vec_id::read_access::position) ; + ReadAccessor > x2 = mstate2->read(sofa::core::vec_id::read_access::position) ; unsigned int m2Size = x2.size(); m_previousPositions.clear(); @@ -154,8 +153,8 @@ void AdaptiveBeamSlidingConstraint::buildConstraintMatrix(const Const Real baryCoord; unsigned int beam = 0; - ReadAccessor > x1free=mstate1->read(ConstVecCoordId::freePosition()) ; - ReadAccessor > x2free=mstate2->read(ConstVecCoordId::freePosition()) ; + ReadAccessor > x1free=mstate1->read(sofa::core::vec_id::read_access::freePosition) ; + ReadAccessor > x2free=mstate2->read(sofa::core::vec_id::read_access::freePosition) ; unsigned int m2 = x2free.size(); WireBeamInterpolation* interpolation = m_interpolation.get(); @@ -274,7 +273,7 @@ void AdaptiveBeamSlidingConstraint::draw(const VisualParams* vparams) vparams->drawTool()->saveLastState(); - ReadAccessor > x = mstate2->read(ConstVecCoordId::position()); + ReadAccessor > x = mstate2->read(sofa::core::vec_id::read_access::position); sofa::type::Vec3 point; std::vector< sofa::type::Vec3 > points; std::vector< sofa::type::RGBAColor> colors; diff --git a/src/BeamAdapter/component/controller/AdaptiveBeamController.inl b/src/BeamAdapter/component/controller/AdaptiveBeamController.inl index 76f9eb1a7..f6d0c1acb 100644 --- a/src/BeamAdapter/component/controller/AdaptiveBeamController.inl +++ b/src/BeamAdapter/component/controller/AdaptiveBeamController.inl @@ -48,8 +48,6 @@ namespace sofa::component::controller::_adaptivebeamcontroller_ using sofa::core::objectmodel::BaseContext ; using std::string; -using sofa::core::VecCoordId; -using sofa::core::VecDerivId; //TODO(dmarchal 2017-05-17) to christian & euallie. // This component seems specific to radiology instrument... but its name suggest a very generic behavior @@ -229,8 +227,8 @@ void AdaptiveBeamController::onBeginAnimationStep(const double /*dt*/ template void AdaptiveBeamController::applyController() { - Data* datax = this->getMechanicalState()->write(VecCoordId::position()); - Data* datav = this->getMechanicalState()->write(VecDerivId::velocity()); + Data* datax = this->getMechanicalState()->write(sofa::core::vec_id::write_access::position); + Data* datav = this->getMechanicalState()->write(sofa::core::vec_id::write_access::velocity); auto x = sofa::helper::getWriteOnlyAccessor(*datax); auto v = sofa::helper::getWriteOnlyAccessor(*datav); diff --git a/src/BeamAdapter/component/controller/InterventionalRadiologyController.inl b/src/BeamAdapter/component/controller/InterventionalRadiologyController.inl index 7839c8d88..358344ca9 100644 --- a/src/BeamAdapter/component/controller/InterventionalRadiologyController.inl +++ b/src/BeamAdapter/component/controller/InterventionalRadiologyController.inl @@ -211,7 +211,7 @@ void InterventionalRadiologyController::bwdInit() return; } - WriteAccessor > x = *this->mState->write(core::VecCoordId::position()); + WriteAccessor > x = *this->mState->write(sofa::core::vec_id::write_access::position); for(unsigned int i=0; i::applyInterventionalRadiologyC totalLengthIsChanging(newCurvAbs, modifiedCurvAbs, idInstrumentTable); // => Get write access to current nodes/dofs - Data* datax = this->getMechanicalState()->write(core::VecCoordId::position()); + Data* datax = this->getMechanicalState()->write(sofa::core::vec_id::write_access::position); auto x = sofa::helper::getWriteOnlyAccessor(*datax); VecCoord xbuf = x.ref(); @@ -1036,8 +1036,8 @@ void InterventionalRadiologyController::fillInstrumentCurvAbsTable(co template void InterventionalRadiologyController::fixFirstNodesWithUntil(unsigned int firstSimulatedNode) { - WriteAccessor > xMstate = *getMechanicalState()->write(core::VecCoordId::position()); - WriteAccessor > vMstate = *getMechanicalState()->write(core::VecDerivId::velocity()); + WriteAccessor > xMstate = *getMechanicalState()->write(sofa::core::vec_id::write_access::position); + WriteAccessor > vMstate = *getMechanicalState()->write(sofa::core::vec_id::write_access::velocity); // set the position to startingPos for all the nodes that are not simulated // and add a fixedConstraint diff --git a/src/BeamAdapter/component/controller/SutureController.inl b/src/BeamAdapter/component/controller/SutureController.inl index f38a5f44a..195fbe0af 100644 --- a/src/BeamAdapter/component/controller/SutureController.inl +++ b/src/BeamAdapter/component/controller/SutureController.inl @@ -137,8 +137,8 @@ void SutureController::initWireModel() Real x_curv = 0.0; - Data* datax = getMechanicalState()->write(sofa::core::VecCoordId::position()); - Data* datav = getMechanicalState()->write(sofa::core::VecDerivId::velocity()); + Data* datax = getMechanicalState()->write(sofa::core::vec_id::write_access::position); + Data* datav = getMechanicalState()->write(sofa::core::vec_id::write_access::velocity); auto x = sofa::helper::getWriteOnlyAccessor(*datax); auto v = sofa::helper::getWriteOnlyAccessor(*datav); @@ -323,8 +323,8 @@ void SutureController::onBeginAnimationStep(const double dt) applyController(); // Propagate modifications - MechanicalProjectPositionAndVelocityVisitor(core::MechanicalParams::defaultInstance(), getContext()->getTime(), sofa::core::VecCoordId::position(),sofa::core::VecDerivId::velocity()); // apply projective constraints - MechanicalPropagateOnlyPositionAndVelocityVisitor(core::MechanicalParams::defaultInstance(), getContext()->getTime(),sofa::core::VecCoordId::position(),sofa::core::VecDerivId::velocity()).execute( getContext() ); + MechanicalProjectPositionAndVelocityVisitor(core::MechanicalParams::defaultInstance(), getContext()->getTime(), sofa::core::vec_id::write_access::position,sofa::core::vec_id::write_access::velocity); // apply projective constraints + MechanicalPropagateOnlyPositionAndVelocityVisitor(core::MechanicalParams::defaultInstance(), getContext()->getTime(),sofa::core::vec_id::write_access::position,sofa::core::vec_id::write_access::velocity).execute( getContext() ); simulation::UpdateMappingVisitor(core::ExecParams::defaultInstance()).execute(getContext()); } @@ -503,8 +503,8 @@ void SutureController::addImposedCurvAbs(type::vector &newCurvA template void SutureController::applyController() { - Data* datax = getMechanicalState()->write(sofa::core::VecCoordId::position()); - Data* datav = getMechanicalState()->write(sofa::core::VecDerivId::velocity()); + Data* datax = getMechanicalState()->write(sofa::core::vec_id::write_access::position); + Data* datav = getMechanicalState()->write(sofa::core::vec_id::write_access::velocity); auto x = sofa::helper::getWriteOnlyAccessor(*datax); auto v = sofa::helper::getWriteOnlyAccessor(*datav); type::vector newCurvAbs; @@ -1171,7 +1171,7 @@ void SutureController::updateControlPointsPositions() unsigned int numBeams = l_adaptiveInterpolation->getNumBeams(); Transform global_H0_local, global_H1_local; - const VecCoord& x = getMechanicalState()->write(sofa::core::VecCoordId::position())->getValue(); + const VecCoord& x = getMechanicalState()->read(sofa::core::vec_id::read_access::position)->getValue(); for (unsigned int b = 0; b < numBeams; b++) { l_adaptiveInterpolation->computeTransform(b, global_H0_local, global_H1_local, x); diff --git a/src/BeamAdapter/component/forcefield/AdaptiveBeamForceFieldAndMass.inl b/src/BeamAdapter/component/forcefield/AdaptiveBeamForceFieldAndMass.inl index a7f215d59..2f908fa46 100644 --- a/src/BeamAdapter/component/forcefield/AdaptiveBeamForceFieldAndMass.inl +++ b/src/BeamAdapter/component/forcefield/AdaptiveBeamForceFieldAndMass.inl @@ -54,7 +54,6 @@ using sofa::core::objectmodel::BaseContext ; using sofa::type::Vec3 ; using sofa::type::Quat ; using sofa::helper::ReadAccessor ; -using sofa::core::ConstVecCoordId ; using std::set ; using sofa::helper::ScopedAdvancedTimer; @@ -746,7 +745,7 @@ void AdaptiveBeamForceFieldAndMass::draw(const VisualParams *vparams) vparams->drawTool()->saveLastState(); - ReadAccessor > x = mstate->read(ConstVecCoordId::position()) ; + ReadAccessor > x = mstate->read(sofa::core::vec_id::read_access::position) ; unsigned int numBeams = l_interpolation->getNumBeams(); diff --git a/src/BeamAdapter/component/forcefield/AdaptiveInflatableBeamForceField.inl b/src/BeamAdapter/component/forcefield/AdaptiveInflatableBeamForceField.inl index d719597ab..cebba2b2b 100644 --- a/src/BeamAdapter/component/forcefield/AdaptiveInflatableBeamForceField.inl +++ b/src/BeamAdapter/component/forcefield/AdaptiveInflatableBeamForceField.inl @@ -57,7 +57,6 @@ using sofa::core::objectmodel::BaseContext ; using sofa::type::Vec3 ; using sofa::type::Quat ; using sofa::helper::ReadAccessor ; -using sofa::core::ConstVecCoordId ; using std::set ; template @@ -730,7 +729,7 @@ void AdaptiveInflatableBeamForceField::draw(const VisualParams *vpara if (!vparams->displayFlags().getShowForceFields() && !vparams->displayFlags().getShowBehaviorModels()) return; if (!mstate) return; - ReadAccessor > x = mstate->read(ConstVecCoordId::position()) ; + ReadAccessor > x = mstate->read(sofa::core::vec_id::read_access::position) ; unsigned int numBeams = l_interpolation->getNumBeams(); diff --git a/src/BeamAdapter/component/mapping/AdaptiveBeamMapping.inl b/src/BeamAdapter/component/mapping/AdaptiveBeamMapping.inl index 869a4b015..2a5c6fb1a 100644 --- a/src/BeamAdapter/component/mapping/AdaptiveBeamMapping.inl +++ b/src/BeamAdapter/component/mapping/AdaptiveBeamMapping.inl @@ -56,7 +56,6 @@ namespace _adaptivebeammapping_ using sofa::core::State; using helper::ReadAccessor; using helper::WriteAccessor; -using sofa::core::ConstVecCoordId; using sofa::helper::AdvancedTimer; using sofa::helper::ScopedAdvancedTimer; using sofa::core::MultiVecCoordId; @@ -233,20 +232,20 @@ void AdaptiveBeamMapping< TIn, TOut>::apply(const MechanicalParams* mparams, Dat } } - MultiVecCoordId x = VecCoordId::position(); - MultiVecCoordId xfree = VecCoordId::freePosition(); + MultiVecCoordId x = sofa::core::vec_id::write_access::position; + MultiVecCoordId xfree = sofa::core::vec_id::write_access::freePosition; const ConstMultiVecCoordId &xId = mparams->x(); - ConstVecCoordId xtest = xId.getId(this->fromModel); + sofa::core::ConstVecCoordId xtest = xId.getId(this->fromModel); if(xtest == xfree.getId(this->fromModel)) { - VecCoordId xfreeIn = VecCoordId::freePosition(); + VecCoordId xfreeIn = sofa::core::vec_id::write_access::freePosition; l_adaptativebeamInterpolation->updateBezierPoints(in, xfreeIn); } else if(xtest == x.getId(this->fromModel)) { - VecCoordId positionIn = VecCoordId::position(); + VecCoordId positionIn = sofa::core::vec_id::write_access::position; l_adaptativebeamInterpolation->updateBezierPoints(in, positionIn); } @@ -307,7 +306,7 @@ void AdaptiveBeamMapping< TIn, TOut>::applyJ(const core::MechanicalParams* mpara auto out = sofa::helper::getWriteOnlyAccessor(dOut); const InVecDeriv& in= dIn.getValue(); - Data& dataInX = *this->getFromModel()->write(VecCoordId::position()); + Data& dataInX = *this->getFromModel()->write(sofa::core::vec_id::write_access::position); auto x = sofa::helper::getWriteOnlyAccessor(dataInX); if (d_useCurvAbs.getValue() && !d_contactDuplicate.getValue()) @@ -392,7 +391,7 @@ void AdaptiveBeamMapping< TIn, TOut>::applyJT(const core::MechanicalParams* mpar auto out = sofa::helper::getWriteOnlyAccessor(dOut); const VecDeriv& in= dIn.getValue(); - const Data& dataInX = *this->getFromModel()->read(ConstVecCoordId::position()); + const Data& dataInX = *this->getFromModel()->read(sofa::core::vec_id::read_access::position); const InVecCoord& x = dataInX.getValue(); for (unsigned int i=0; i::applyJT(const core::ConstraintParams* cpar SCOPED_TIMER("AdaptiveBeamMapping_ApplyJT"); auto out = sofa::helper::getWriteOnlyAccessor(dOut); const OutMatrixDeriv& in = dIn.getValue(); - const Data& dataInX = *this->getFromModel()->read(ConstVecCoordId::position()); + const Data& dataInX = *this->getFromModel()->read(sofa::core::vec_id::read_access::position); const InVecCoord& x = dataInX.getValue(); m_isXBufferUsed = false; @@ -512,7 +511,7 @@ void AdaptiveBeamMapping< TIn, TOut>::bwdInit() if (ptsSize == 0) { - helper::ReadAccessor > xTo = this->toModel->read(sofa::core::ConstVecCoordId::position()) ; + helper::ReadAccessor > xTo = this->toModel->read(sofa::core::vec_id::read_access::position) ; if(xTo.size()==0) { diff --git a/src/BeamAdapter/component/mapping/BeamLengthMapping.inl b/src/BeamAdapter/component/mapping/BeamLengthMapping.inl index f894c1ab9..a13c61614 100644 --- a/src/BeamAdapter/component/mapping/BeamLengthMapping.inl +++ b/src/BeamAdapter/component/mapping/BeamLengthMapping.inl @@ -62,7 +62,6 @@ using namespace sofa::defaulttype; using sofa::core::State; using helper::ReadAccessor; using helper::WriteAccessor; -using sofa::core::ConstVecCoordId; using sofa::core::MultiVecCoordId; using sofa::core::VecCoordId; using sofa::core::VecDerivId; @@ -161,7 +160,7 @@ void BeamLengthMapping< TIn, TOut>::applyJ(const core::MechanicalParams* mparams VecDeriv& out = *dOut.beginEdit(); const InVecDeriv& in= dIn.getValue(); - const Data& dataInX = *this->getFromModel()->read(VecCoordId::position()); + const Data& dataInX = *this->getFromModel()->read(sofa::core::vec_id::read_access::position); const InVecCoord& x_in = dataInX.getValue(); unsigned int s = l_adaptativebeamInterpolation->getNumBeams(); @@ -233,7 +232,7 @@ void BeamLengthMapping< TIn, TOut>::applyJT(const core::MechanicalParams* mparam InVecDeriv& out = *dOut.beginEdit(); const VecDeriv& in= dIn.getValue(); - const Data& dataInX = *this->getFromModel()->read(VecCoordId::position()); + const Data& dataInX = *this->getFromModel()->read(sofa::core::vec_id::read_access::position); const InVecCoord& x_in = dataInX.getValue(); unsigned int s = l_adaptativebeamInterpolation->getNumBeams(); @@ -347,7 +346,7 @@ void BeamLengthMapping< TIn, TOut>::applyJT(const core::ConstraintParams* cparam InMatrixDeriv& out = *dOut.beginEdit(); const OutMatrixDeriv& in = dIn.getValue(); - const Data& dataInX = *this->getFromModel()->read(ConstVecCoordId::position()); + const Data& dataInX = *this->getFromModel()->read(sofa::core::vec_id::read_access::position); const InVecCoord& x_in = dataInX.getValue(); @@ -437,10 +436,10 @@ void BeamLengthMapping< TIn, TOut>::applyDJT(const MechanicalParams* mparams, co const SReal kfactor = mparams->kFactor(); - const Data& dataInX = *this->getFromModel()->read(VecCoordId::position()); + const Data& dataInX = *this->getFromModel()->read(sofa::core::vec_id::read_access::position); const InVecCoord& x_in = dataInX.getValue(); - const Data& dataIndX = *this->getFromModel()->read(VecDerivId::dx()); + const Data& dataIndX = *this->getFromModel()->read(sofa::core::vec_id::read_access::dx); const InVecDeriv& parentDisplacement = dataIndX.getValue(); helper::WriteAccessor > parentForce (*parentDfId[this->fromModel.get()].write()); @@ -597,7 +596,7 @@ void BeamLengthMapping::updateK(const core::MechanicalParams* mparams if( !geometricStiffness ) { K_geom.resize(0,0); return; } //helper::ReadAccessor > childForce( *childForceId[(const core::State*)this->getToModels()[0]].read() ); - const Data& dataInX = *this->getFromModel()->read(VecCoordId::position()); + const Data& dataInX = *this->getFromModel()->read(sofa::core::vec_id::read_access::position); const InVecCoord& x_in = dataInX.getValue(); //const VecDeriv& childForce = this->getToModel()->readForces().ref(); diff --git a/src/BeamAdapter/component/mapping/BeamProjectionDifferenceMultiMapping.inl b/src/BeamAdapter/component/mapping/BeamProjectionDifferenceMultiMapping.inl index 1b5833e87..9a31db153 100644 --- a/src/BeamAdapter/component/mapping/BeamProjectionDifferenceMultiMapping.inl +++ b/src/BeamAdapter/component/mapping/BeamProjectionDifferenceMultiMapping.inl @@ -454,9 +454,9 @@ void BeamProjectionDifferenceMultiMapping::applyDJT(const sofa template const sofa::type::vector* BeamProjectionDifferenceMultiMapping::getJs() { - const OutVecCoord& out = m_toModel->read(sofa::core::ConstVecCoordId::position())->getValue(); - const In1VecCoord& in1 = m_fromModel1->read(sofa::core::ConstVecCoordId::position())->getValue(); - const In2VecCoord& in2 = m_fromModel2->read(sofa::core::ConstVecCoordId::position())->getValue(); + const OutVecCoord& out = m_toModel->read(sofa::core::vec_id::read_access::position)->getValue(); + const In1VecCoord& in1 = m_fromModel1->read(sofa::core::vec_id::read_access::position)->getValue(); + const In2VecCoord& in2 = m_fromModel2->read(sofa::core::vec_id::read_access::position)->getValue(); typename SparseMatrixEigen1::CompressedMatrix& J1 = m_eigenJacobian1.compressedMatrix; typename SparseMatrixEigen1::CompressedMatrix& J2 = m_eigenJacobian2.compressedMatrix; diff --git a/src/BeamAdapter/component/mapping/MultiAdaptiveBeamMapping.inl b/src/BeamAdapter/component/mapping/MultiAdaptiveBeamMapping.inl index d28a27d03..ded3bc69c 100644 --- a/src/BeamAdapter/component/mapping/MultiAdaptiveBeamMapping.inl +++ b/src/BeamAdapter/component/mapping/MultiAdaptiveBeamMapping.inl @@ -226,24 +226,24 @@ void MultiAdaptiveBeamMapping< TIn, TOut>::assignSubMappingFromControllerInfo() const core::MechanicalParams* _mparams = core::MechanicalParams::defaultInstance(); - this->apply(_mparams /* PARAMS FIRST */, *this->getToModel()->write(sofa::core::VecCoordId::position()),*this->getFromModel()->read(sofa::core::ConstVecCoordId::position())); + this->apply(_mparams /* PARAMS FIRST */, *this->getToModel()->write(sofa::core::vec_id::write_access::position),*this->getFromModel()->read(sofa::core::vec_id::read_access::position)); - const Data& xfree_in = *this->getFromModel()->read(sofa::core::ConstVecCoordId::freePosition()); + const Data& xfree_in = *this->getFromModel()->read(sofa::core::vec_id::read_access::freePosition); - const Data& x_out = *this->getToModel()->read(sofa::core::VecCoordId::position()); - const Data& xfree_out = *this->getToModel()->read(sofa::core::VecCoordId::freePosition()); + const Data& x_out = *this->getToModel()->read(sofa::core::vec_id::read_access::position); + const Data& xfree_out = *this->getToModel()->read(sofa::core::vec_id::read_access::freePosition); core::behavior::MechanicalState* ms_out = dynamic_cast *> (this->getToModel()); if (x_out.getValue().size() != xfree_out.getValue().size()) { - ms_out->vInit(_mparams,sofa::core::VecCoordId::freePosition(),sofa::core::ConstVecCoordId::position()); - ms_out->vInit(_mparams,sofa::core::VecDerivId::freeVelocity(),sofa::core::ConstVecDerivId::velocity()); + ms_out->vInit(_mparams,sofa::core::vec_id::write_access::freePosition,sofa::core::vec_id::read_access::position); + ms_out->vInit(_mparams,sofa::core::vec_id::write_access::freeVelocity,sofa::core::vec_id::read_access::velocity); } if (xfree_in.getValue().size() > 0) { - this->apply(_mparams /* PARAMS FIRST */, *this->getToModel()->write(sofa::core::VecCoordId::freePosition()), *this->getFromModel()->read(sofa::core::ConstVecCoordId::freePosition())); + this->apply(_mparams /* PARAMS FIRST */, *this->getToModel()->write(sofa::core::vec_id::write_access::freePosition), *this->getFromModel()->read(sofa::core::vec_id::read_access::freePosition)); } }