diff --git a/Sofa/Component/Constraint/Lagrangian/Model/src/sofa/component/constraint/lagrangian/model/FixedLagrangianConstraint.inl b/Sofa/Component/Constraint/Lagrangian/Model/src/sofa/component/constraint/lagrangian/model/FixedLagrangianConstraint.inl index 213cc7e346a..4f2d01ab645 100644 --- a/Sofa/Component/Constraint/Lagrangian/Model/src/sofa/component/constraint/lagrangian/model/FixedLagrangianConstraint.inl +++ b/Sofa/Component/Constraint/Lagrangian/Model/src/sofa/component/constraint/lagrangian/model/FixedLagrangianConstraint.inl @@ -70,8 +70,8 @@ void FixedLagrangianConstraint::getConstraintViolation(const core::Co SOFA_UNUSED(cParams); SOFA_UNUSED(x); SOFA_UNUSED(v); - const DataVecCoord * freePos = this->getMState()->read(sofa::core::VecId::freePosition()); - const DataVecCoord * restPos = this->getMState()->read(sofa::core::VecId::restPosition()); + const DataVecCoord * freePos = this->getMState()->read(sofa::core::vec_id::read_access::freePosition); + const DataVecCoord * restPos = this->getMState()->read(sofa::core::vec_id::read_access::restPosition); for(unsigned i=0; iflush(); diff --git a/Sofa/Component/SolidMechanics/FEM/Elastic/src/sofa/component/solidmechanics/fem/elastic/TetrahedralCorotationalFEMForceField.inl b/Sofa/Component/SolidMechanics/FEM/Elastic/src/sofa/component/solidmechanics/fem/elastic/TetrahedralCorotationalFEMForceField.inl index 0952d6c8f91..93d7fa1365f 100644 --- a/Sofa/Component/SolidMechanics/FEM/Elastic/src/sofa/component/solidmechanics/fem/elastic/TetrahedralCorotationalFEMForceField.inl +++ b/Sofa/Component/SolidMechanics/FEM/Elastic/src/sofa/component/solidmechanics/fem/elastic/TetrahedralCorotationalFEMForceField.inl @@ -1228,7 +1228,7 @@ void TetrahedralCorotationalFEMForceField::computeVonMisesStress() { typename core::behavior::MechanicalState* mechanicalObject; this->getContext()->get(mechanicalObject); - const VecCoord& X = mechanicalObject->read(core::ConstVecCoordId::position())->getValue(); + const VecCoord& X = mechanicalObject->read(core::vec_id::read_access::position)->getValue(); const sofa::core::topology::BaseMeshTopology::SeqTetrahedra& tetras = this->l_topology->getTetrahedra(); const type::vector::TetrahedronInformation>& tetrahedronInf = tetrahedronInfo.getValue(); diff --git a/Sofa/Component/StateContainer/src/sofa/component/statecontainer/MechanicalObject.inl b/Sofa/Component/StateContainer/src/sofa/component/statecontainer/MechanicalObject.inl index 919a37297e2..1ff437a0270 100644 --- a/Sofa/Component/StateContainer/src/sofa/component/statecontainer/MechanicalObject.inl +++ b/Sofa/Component/StateContainer/src/sofa/component/statecontainer/MechanicalObject.inl @@ -1032,7 +1032,7 @@ void MechanicalObject::init() //case if X0 has been set but not X if (read(core::vec_id::read_access::restPosition)->getValue().size() > x_wA.size()) { - vOp(core::execparams::defaultInstance(), core::VecId::position(), core::VecId::restPosition()); + vOp(core::execparams::defaultInstance(), sofa::core::vec_id::write_access::position, sofa::core::vec_id::read_access::restPosition); } // the given position and velocity vectors are empty @@ -1097,9 +1097,9 @@ void MechanicalObject::init() { // storing X0 from X if( restScale.getValue()!=1 ) - vOp(core::execparams::defaultInstance(), core::VecId::restPosition(), core::ConstVecId::null(), core::VecId::position(), restScale.getValue()); + vOp(core::execparams::defaultInstance(), sofa::core::vec_id::write_access::restPosition, core::ConstVecId::null(), sofa::core::vec_id::write_access::position, restScale.getValue()); else - vOp(core::execparams::defaultInstance(), core::VecId::restPosition(), core::VecId::position()); + vOp(core::execparams::defaultInstance(), sofa::core::vec_id::write_access::restPosition, sofa::core::vec_id::write_access::position); } @@ -1134,10 +1134,10 @@ void MechanicalObject::storeResetState() if( !isIndependent() ) return; // Save initial state for reset button - vOp(core::execparams::defaultInstance(), core::VecId::resetPosition(), core::VecId::position()); + vOp(core::execparams::defaultInstance(), sofa::core::vec_id::write_access::restPosition, sofa::core::vec_id::read_access::position); // we only store a resetVelocity if the velocity is not zero - helper::ReadAccessor< Data > v = *this->read(core::vec_id::write_access::velocity); + helper::ReadAccessor< Data > v = *this->read(core::vec_id::read_access::velocity); bool zero = true; for (unsigned int i=0; i::storeResetState() if (!zero) break; } if (!zero) - vOp(core::execparams::defaultInstance(), core::VecId::resetVelocity(), core::VecId::velocity()); + vOp(core::execparams::defaultInstance(), sofa::core::vec_id::write_access::resetVelocity, sofa::core::vec_id::read_access::velocity); } @@ -1155,24 +1155,24 @@ template void MechanicalObject::reset() { // resetting force for every dofs, even mapped ones - vOp(core::execparams::defaultInstance(), core::VecId::force()); + vOp(core::execparams::defaultInstance(), sofa::core::vec_id::write_access::force); if (!reset_position.isSet()) // mapped states are deduced from independent ones return; - vOp(core::execparams::defaultInstance(), core::VecId::position(), core::VecId::resetPosition()); + vOp(core::execparams::defaultInstance(), sofa::core::vec_id::write_access::position, sofa::core::vec_id::read_access::resetPosition); if (!reset_velocity.isSet()) { - vOp(core::execparams::defaultInstance(), core::VecId::velocity()); + vOp(core::execparams::defaultInstance(), sofa::core::vec_id::write_access::velocity); } else { - vOp(core::execparams::defaultInstance(), core::VecId::velocity(), core::VecId::resetVelocity()); + vOp(core::execparams::defaultInstance(), sofa::core::vec_id::write_access::velocity, sofa::core::vec_id::write_access::resetVelocity); } - if( xfree.isSet() ) vOp(core::execparams::defaultInstance(), core::VecId::freePosition(), core::VecId::position()); - if( vfree.isSet() ) vOp(core::execparams::defaultInstance(), core::VecId::freeVelocity(), core::VecId::velocity()); + if( xfree.isSet() ) vOp(core::execparams::defaultInstance(), sofa::core::vec_id::write_access::freePosition, sofa::core::vec_id::read_access::position); + if( vfree.isSet() ) vOp(core::execparams::defaultInstance(), sofa::core::vec_id::write_access::freeVelocity, sofa::core::vec_id::read_access::velocity); } @@ -1285,9 +1285,9 @@ SReal MechanicalObject::compareVec(core::ConstVecId v, std::istream & template void MechanicalObject::writeState(std::ostream& out) { - writeVec(core::VecId::position(),out); + writeVec(sofa::core::vec_id::read_access::position,out); out << " "; - writeVec(core::VecId::velocity(),out); + writeVec(sofa::core::vec_id::read_access::velocity,out); } template @@ -2445,11 +2445,11 @@ SReal MechanicalObject::getConstraintJacobianTimesVecDeriv(unsigned i const VecDeriv *data = 0; // Maybe we should extend this to restvelocity - if (id == core::ConstVecId::velocity()) + if (id == sofa::core::vec_id::read_access::velocity) { data = &v.getValue(); } - else if (id == core::ConstVecId::dx()) + else if (id == sofa::core::vec_id::read_access::dx) { data = &dx.getValue(); } diff --git a/Sofa/framework/Simulation/Core/src/sofa/simulation/Visitor.cpp b/Sofa/framework/Simulation/Core/src/sofa/simulation/Visitor.cpp index 9ae3a127876..30159c20351 100644 --- a/Sofa/framework/Simulation/Core/src/sofa/simulation/Visitor.cpp +++ b/Sofa/framework/Simulation/Core/src/sofa/simulation/Visitor.cpp @@ -289,16 +289,16 @@ void Visitor::debug_write_state_before( core::objectmodel::BaseObject* obj ) if( core::behavior::BaseMechanicalState* dof = obj->getContext()->getMechanicalState() ) { tmp<<", state:\nx= "; - dof->writeVec(core::VecId::position(), tmp); + dof->writeVec(sofa::core::vec_id::read_access::position, tmp); tmp<<"\nv= "; - dof->writeVec(core::VecId::velocity(), tmp); + dof->writeVec(sofa::core::vec_id::read_access::velocity, tmp); tmp<<"\ndx= "; - dof->writeVec(core::VecId::dx(), tmp); + dof->writeVec(sofa::core::vec_id::read_access::dx, tmp); tmp<<"\nf= "; - dof->writeVec(core::VecId::force(), tmp); + dof->writeVec(sofa::core::vec_id::read_access::force, tmp); } dmsg_info("Visitor(debug)") << tmp.str() ; } @@ -311,16 +311,16 @@ void Visitor::debug_write_state_after( core::objectmodel::BaseObject* obj ) if( core::behavior::BaseMechanicalState* dof = obj->getContext()->getMechanicalState() ) { tmp<<", state:\nx= "; - dof->writeVec(core::VecId::position(), tmp); + dof->writeVec(sofa::core::vec_id::read_access::position, tmp); tmp<<"\nv= "; - dof->writeVec(core::VecId::velocity(), tmp); + dof->writeVec(sofa::core::vec_id::read_access::velocity, tmp); tmp<<"\ndx= "; - dof->writeVec(core::VecId::dx(), tmp); + dof->writeVec(sofa::core::vec_id::read_access::dx, tmp); tmp<<"\nf= "; - dof->writeVec(core::VecId::force(), tmp); + dof->writeVec(sofa::core::vec_id::read_access::force, tmp); } dmsg_info("Visitor(debug)") << tmp.str() ; }