Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix compilation further to lifecycle v25.06 #10

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions src/SofaSphFluid/ParticleSink.inl
Original file line number Diff line number Diff line change
Expand Up @@ -91,8 +91,8 @@ void ParticleSink<DataTypes>::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<Index> remove;
for (int i=n-1; i>=0; --i) // always remove points in reverse order
Expand Down
4 changes: 2 additions & 2 deletions src/SofaSphFluid/ParticleSource.inl
Original file line number Diff line number Diff line change
Expand Up @@ -307,8 +307,8 @@ void ParticleSource<DataTypes>::animateBegin(double /*dt*/, double time)
this->mstate->resize(i0 + nbParticlesToCreate);
}

helper::WriteAccessor< Data<VecCoord> > x = *this->mstate->write(core::VecCoordId::position());
helper::WriteAccessor< Data<VecDeriv> > v = *this->mstate->write(core::VecDerivId::velocity());
helper::WriteAccessor< Data<VecCoord> > x = *this->mstate->write(core::vec_id::write_access::position);
helper::WriteAccessor< Data<VecDeriv> > v = *this->mstate->write(core::vec_id::write_access::velocity);
for (size_t s = 0; s < nbParticlesToCreate; ++s)
{
x[i0 + s] = newX[s];
Expand Down
4 changes: 2 additions & 2 deletions src/SofaSphFluid/ParticlesRepulsionForceField.inl
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,7 @@ void ParticlesRepulsionForceField<DataTypes>::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()));
Expand Down Expand Up @@ -182,7 +182,7 @@ void ParticlesRepulsionForceField<DataTypes>::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<sofa::type::RGBAColor> colorVector;
Expand Down
4 changes: 2 additions & 2 deletions src/SofaSphFluid/SPHFluidForceField.inl
Original file line number Diff line number Diff line change
Expand Up @@ -415,7 +415,7 @@ void SPHFluidForceField<DataTypes>::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; i<this->dforces.size(); i++)
{
Expand Down Expand Up @@ -451,7 +451,7 @@ void SPHFluidForceField<DataTypes>::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<sofa::type::RGBAColor> colorVector;
std::vector<sofa::type::Vec3> vertices;
Expand Down
4 changes: 2 additions & 2 deletions src/SofaSphFluid/SPHFluidSurfaceMapping.inl
Original file line number Diff line number Diff line change
Expand Up @@ -244,7 +244,7 @@ void SPHFluidSurfaceMapping<In,Out>::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)
Expand Down Expand Up @@ -516,7 +516,7 @@ void SPHFluidSurfaceMapping<In,Out>::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<out.size(); ++i)
{
points2.push_back(out[i]);
Expand Down
4 changes: 2 additions & 2 deletions src/SofaSphFluid/SpatialGridContainer.inl
Original file line number Diff line number Diff line change
Expand Up @@ -699,7 +699,7 @@ template<class DataTypes>
bool SpatialGridContainer<DataTypes>::sortPoints()
{
if (mstate)
updateGrid(mstate->read(core::ConstVecCoordId::position())->getValue());
updateGrid(mstate->read(core::vec_id::read_access::position)->getValue());

msg_info() << "sortPoints(): sorting...";

Expand Down Expand Up @@ -771,7 +771,7 @@ void SpatialGridContainer<DataTypes>::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());
}
}
}
Expand Down
Loading