diff --git a/src/SofaSphFluid/ParticleSink.inl b/src/SofaSphFluid/ParticleSink.inl index b071073..77f052d 100644 --- a/src/SofaSphFluid/ParticleSink.inl +++ b/src/SofaSphFluid/ParticleSink.inl @@ -91,8 +91,8 @@ void ParticleSink::animateBegin(double /*dt*/, double time) if (!this->mstate) return; - const VecCoord& x = this->mstate->read(core::ConstVecCoordId::position())->getValue(); - const VecDeriv& v = this->mstate->read(core::ConstVecDerivId::velocity())->getValue(); + const VecCoord& x = this->mstate->read(core::vec_id::read_access::position)->getValue(); + const VecDeriv& v = this->mstate->read(core::vec_id::read_access::velocity)->getValue(); int n = int(x.size()); type::vector remove; for (int i=n-1; i>=0; --i) // always remove points in reverse order diff --git a/src/SofaSphFluid/ParticleSource.inl b/src/SofaSphFluid/ParticleSource.inl index 0226d95..2c3edef 100644 --- a/src/SofaSphFluid/ParticleSource.inl +++ b/src/SofaSphFluid/ParticleSource.inl @@ -307,8 +307,8 @@ void ParticleSource::animateBegin(double /*dt*/, double time) this->mstate->resize(i0 + nbParticlesToCreate); } - helper::WriteAccessor< Data > x = *this->mstate->write(core::VecCoordId::position()); - helper::WriteAccessor< Data > v = *this->mstate->write(core::VecDerivId::velocity()); + helper::WriteAccessor< Data > x = *this->mstate->write(core::vec_id::write_access::position); + helper::WriteAccessor< Data > v = *this->mstate->write(core::vec_id::write_access::velocity); for (size_t s = 0; s < nbParticlesToCreate; ++s) { x[i0 + s] = newX[s]; diff --git a/src/SofaSphFluid/ParticlesRepulsionForceField.inl b/src/SofaSphFluid/ParticlesRepulsionForceField.inl index da6bbb5..52b843a 100644 --- a/src/SofaSphFluid/ParticlesRepulsionForceField.inl +++ b/src/SofaSphFluid/ParticlesRepulsionForceField.inl @@ -131,7 +131,7 @@ void ParticlesRepulsionForceField::addDForce(const core::MechanicalPa VecDeriv& df = *d_df.beginEdit(); const VecDeriv& dx = d_dx.getValue(); - const VecCoord& x = this->mstate->read(core::ConstVecCoordId::position())->getValue(); + const VecCoord& x = this->mstate->read(core::vec_id::read_access::position)->getValue(); const Real h = distance.getValue(); const Real h2 = h*h; const Real ks = (Real)(stiffness.getValue() * sofa::core::mechanicalparams::kFactorIncludingRayleighDamping(mparams, this->rayleighStiffness.getValue())); @@ -182,7 +182,7 @@ void ParticlesRepulsionForceField::draw(const core::visual::VisualPar const auto stateLifeCycle = vparams->drawTool()->makeStateLifeCycle(); vparams->drawTool()->disableLighting(); - const VecCoord& x = this->mstate->read(core::ConstVecCoordId::position())->getValue(); + const VecCoord& x = this->mstate->read(core::vec_id::read_access::position)->getValue(); const Real h = distance.getValue(); std::vector colorVector; diff --git a/src/SofaSphFluid/SPHFluidForceField.inl b/src/SofaSphFluid/SPHFluidForceField.inl index c7bd2a9..a86e19d 100644 --- a/src/SofaSphFluid/SPHFluidForceField.inl +++ b/src/SofaSphFluid/SPHFluidForceField.inl @@ -415,7 +415,7 @@ void SPHFluidForceField::addDForce(const core::MechanicalParams* mpar const VecDeriv& dx1 = d_dx.getValue(); Real kFactor = (Real)sofa::core::mechanicalparams::kFactorIncludingRayleighDamping(mparams, this->rayleighStiffness.getValue()); - const VecCoord& p1 = this->mstate->read(core::ConstVecCoordId::position())->getValue(); + const VecCoord& p1 = this->mstate->read(core::vec_id::read_access::position)->getValue(); f1.resize(dx1.size()); for (unsigned int i=0; idforces.size(); i++) { @@ -451,7 +451,7 @@ void SPHFluidForceField::draw(const core::visual::VisualParams* vpara vparams->drawTool()->enableBlending(); vparams->drawTool()->disableDepthTest(); - const VecCoord& x = this->mstate->read(core::ConstVecCoordId::position())->getValue(); + const VecCoord& x = this->mstate->read(core::vec_id::read_access::position)->getValue(); std::vector colorVector; std::vector vertices; diff --git a/src/SofaSphFluid/SPHFluidSurfaceMapping.inl b/src/SofaSphFluid/SPHFluidSurfaceMapping.inl index 7e1917f..4f47f89 100644 --- a/src/SofaSphFluid/SPHFluidSurfaceMapping.inl +++ b/src/SofaSphFluid/SPHFluidSurfaceMapping.inl @@ -244,7 +244,7 @@ void SPHFluidSurfaceMapping::apply(const core::MechanicalParams * /*mpar //if (!sph) return; if (!grid) return; //const InReal invStep = (InReal)(1/d_mStep.getValue()); - Data< OutVecDeriv > *normals_data = this->toModel->write(core::VecDerivId::normal()); + Data< OutVecDeriv > *normals_data = this->toModel->write(core::vec_id::write_access::normal); OutVecDeriv *normals; //if toModel is not a VisualModelImpl //(consequently, it does not have any normal vector) @@ -516,7 +516,7 @@ void SPHFluidSurfaceMapping::draw(const core::visual::VisualParams* vpar std::vector< sofa::type::Vec3 > points2; - const OutVecCoord& out = this->toModel->read(core::ConstVecCoordId::position())->getValue(); + const OutVecCoord& out = this->toModel->read(core::vec_id::read_access::position)->getValue(); for (unsigned int i=0; i bool SpatialGridContainer::sortPoints() { if (mstate) - updateGrid(mstate->read(core::ConstVecCoordId::position())->getValue()); + updateGrid(mstate->read(core::vec_id::read_access::position)->getValue()); msg_info() << "sortPoints(): sorting..."; @@ -771,7 +771,7 @@ void SpatialGridContainer::handleEvent(sofa::core::objectmodel::Event else if (d_autoUpdate.getValue()) { if (mstate) - updateGrid(mstate->read(core::ConstVecCoordId::position())->getValue()); + updateGrid(mstate->read(core::vec_id::read_access::position)->getValue()); } } }