Skip to content
Merged
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
10 changes: 5 additions & 5 deletions src/Registration/ClosestPointRegistrationForceField.inl
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,7 @@ template<class DataTypes>
void ClosestPointRegistrationForceField<DataTypes>::initSource()
{
// build k-d tree
const VecCoord& p = this->mstate->read(core::ConstVecCoordId::position())->getValue();
const VecCoord& p = this->mstate->read(core::vec_id::read_access::position)->getValue();
if(p.size()) sourceKdTree.build(p);

// detect border
Expand All @@ -177,7 +177,7 @@ void ClosestPointRegistrationForceField<DataTypes>::initTarget()
template<class DataTypes>
void ClosestPointRegistrationForceField<DataTypes>::updateClosestPoints()
{
const VecCoord& x = this->mstate->read(core::ConstVecCoordId::position())->getValue();
const VecCoord& x = this->mstate->read(core::vec_id::read_access::position)->getValue();
const VecCoord& tp = targetPositions.getValue();

unsigned int nbs=x.size(),nbt=tp.size();
Expand Down Expand Up @@ -210,7 +210,7 @@ void ClosestPointRegistrationForceField<DataTypes>::updateClosestPoints()
#pragma omp parallel for
#endif
for(int i=0;i<(int)nbt;i++)
sourceKdTree.getNClosest(closestTarget[i],tp[i], this->mstate->read(core::ConstVecCoordId::position())->getValue(),1);
sourceKdTree.getNClosest(closestTarget[i],tp[i], this->mstate->read(core::vec_id::read_access::position)->getValue(),1);
}


Expand Down Expand Up @@ -379,8 +379,8 @@ void ClosestPointRegistrationForceField<DataTypes>::draw(const core::visual::Vis

if (!vparams->displayFlags().getShowForceFields() && !drawColorMap.getValue()) return;

ReadAccessor< Data< VecCoord > > x(*this->getMState()->read(core::ConstVecCoordId::position()));
//const VecCoord& x = this->mstate->read(core::ConstVecCoordId::position())->getValue();
ReadAccessor< Data< VecCoord > > x(*this->getMState()->read(core::vec_id::read_access::position));
//const VecCoord& x = this->mstate->read(core::vec_id::read_access::position)->getValue();

unsigned int nb = this->closestPos.size();
if (vparams->displayFlags().getShowForceFields())
Expand Down
14 changes: 7 additions & 7 deletions src/Registration/IntensityProfileRegistrationForceField.inl
Original file line number Diff line number Diff line change
Expand Up @@ -114,8 +114,8 @@ void IntensityProfileRegistrationForceField<DataTypes,ImageTypes>::init()

if(this->mstate)
{
const VecCoord& x = this->mstate->read(core::ConstVecCoordId::position())->getValue();
//RDataRefVecCoord x(*this->getMState()->read(core::ConstVecCoordId::position()));
const VecCoord& x = this->mstate->read(core::vec_id::read_access::position)->getValue();
//RDataRefVecCoord x(*this->getMState()->read(core::vec_id::read_access::position));

RDataRefVecCoord dir(this->directions);
if (dir.size() != x.size())
Expand Down Expand Up @@ -158,8 +158,8 @@ void IntensityProfileRegistrationForceField<DataTypes,ImageTypes>::udpateProfile
// get current data
const CImg<T>& img = in->getCImg(t);
const VecCoord& pos = (ref?
this->mstate->read(core::ConstVecCoordId::restPosition())->getValue():
this->mstate->read(core::ConstVecCoordId::position())->getValue());
this->mstate->read(core::vec_id::read_access::restPosition)->getValue():
this->mstate->read(core::vec_id::read_access::position)->getValue());
const RDataRefVecCoord dir(ref?this->refDirections:this->directions);
if(dir.size() != pos.size()) return;

Expand Down Expand Up @@ -250,7 +250,7 @@ void IntensityProfileRegistrationForceField<DataTypes,ImageTypes>::udpateSimilar

if( IP->isEmpty() || IPref->isEmpty() || !this->mstate) return;

const VecCoord& pos = this->mstate->read(core::ConstVecCoordId::position())->getValue();
const VecCoord& pos = this->mstate->read(core::vec_id::read_access::position)->getValue();
const CImg<T>& prof = IP->getCImg(0);
const CImg<T>& profref = IPref->getCImg(0);

Expand Down Expand Up @@ -471,8 +471,8 @@ void IntensityProfileRegistrationForceField<DataTypes,ImageTypes>::draw(const co

if (!vparams->displayFlags().getShowForceFields()) return;

RDataRefVecCoord x(*this->getMState()->read(core::ConstVecCoordId::position()));
//const VecCoord& x = this->mstate->read(core::ConstVecCoordId::position())->getValue();
RDataRefVecCoord x(*this->getMState()->read(core::vec_id::read_access::position));
//const VecCoord& x = this->mstate->read(core::vec_id::read_access::position)->getValue();

unsigned int nb = this->targetPos.size();
if (vparams->displayFlags().getShowForceFields())
Expand Down
8 changes: 4 additions & 4 deletions src/Registration/RegistrationContactForceField.inl
Original file line number Diff line number Diff line change
Expand Up @@ -158,8 +158,8 @@ void RegistrationContactForceField<DataTypes>::draw(const core::visual::VisualPa
{
#if REGISTRATION_HAVE_SOFA_GL == 1
if (!((this->mstate1 == this->mstate2)?vparams->displayFlags().getShowForceFields():vparams->displayFlags().getShowInteractionForceFields())) return;
const VecCoord& p1 = this->mstate1->read(core::ConstVecCoordId::position())->getValue();
const VecCoord& p2 = this->mstate2->read(core::ConstVecCoordId::position())->getValue();
const VecCoord& p1 = this->mstate1->read(core::vec_id::read_access::position)->getValue();
const VecCoord& p2 = this->mstate2->read(core::vec_id::read_access::position)->getValue();
const type::vector<Contact>& cc = contacts.getValue();

glDisable(GL_LIGHTING);
Expand Down Expand Up @@ -237,7 +237,7 @@ template<class DataTypes>
if (contacts.getValue()[i].m1 == (int)index[j])
{
result.push_back(std::make_pair(static_cast< core::objectmodel::BaseObject *>(this),
this->mstate2->read(core::ConstVecCoordId::position())->getValue()[contacts.getValue()[i].m2])
this->mstate2->read(core::vec_id::read_access::position)->getValue()[contacts.getValue()[i].m2])
);
triangle.push_back(contacts.getValue()[i].index2);
index_point.push_back(index[j]);
Expand All @@ -255,7 +255,7 @@ template<class DataTypes>
if (contacts.getValue()[i].m2 == (int)index[j])
{
result.push_back(std::make_pair(static_cast< core::objectmodel::BaseObject *>(this),
this->mstate1->read(core::ConstVecCoordId::position())->getValue()[contacts.getValue()[i].m1])
this->mstate1->read(core::vec_id::read_access::position)->getValue()[contacts.getValue()[i].m1])
);

triangle.push_back(contacts.getValue()[i].index1);
Expand Down
Loading