Skip to content

Commit 62c77d7

Browse files
hugtalbotalxbilger
andauthored
Update Vec3 and .get() access (#6)
* Update Vec3 and .get() access * Better formatting --------- Co-authored-by: Alex Bilger <alxbilger@users.noreply.github.com>
1 parent aac5e23 commit 62c77d7

1 file changed

Lines changed: 5 additions & 5 deletions

File tree

src/PluginExample/MyMappingPendulumInPlane.inl

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ namespace sofa::component::mapping
3838
using helper::ReadAccessor;
3939
using helper::WriteAccessor;
4040
using type::Vec;
41-
using type::Vector3;
41+
using type::Vec3;
4242

4343

4444
template <class In, class Out>
@@ -81,7 +81,7 @@ void MyMappingPendulumInPlane<In, Out>::draw(const core::visual::VisualParams* v
8181
if (!vparams->displayFlags().getShowMappings()) return;
8282

8383
ReadAccessor<Data<VecOutCoord> > out (*this->toModel->read(core::ConstVecCoordId::position()));
84-
std::vector< Vector3 > points(out.size());
84+
std::vector< Vec3 > points(out.size());
8585

8686
for (unsigned int i=0; i<out.size(); i++)
8787
{
@@ -92,7 +92,7 @@ void MyMappingPendulumInPlane<In, Out>::draw(const core::visual::VisualParams* v
9292
points.resize(2*out.size());
9393
for (unsigned int i=0; i<out.size(); i++)
9494
{
95-
points[2*i] = Vector3(0, 0,0);
95+
points[2*i] = Vec3(0, 0, 0);
9696
points[2*i+1] = Out::getCPos(out[i]);
9797
}
9898
vparams->drawTool()->drawLines (points, 1, type::RGBAColor::green());
@@ -194,9 +194,9 @@ void MyMappingPendulumInPlane<In, Out>::applyDJT(const core::MechanicalParams* m
194194
core::MultiVecDerivId parentForceChangeId,
195195
core::ConstMultiVecDerivId)
196196
{
197-
ReadAccessor<Data<VecOutDeriv> > childForce (*mparams->readF(this->toModel));
197+
ReadAccessor<Data<VecOutDeriv> > childForce (*mparams->readF(this->toModel.get()));
198198
WriteAccessor<Data<VecInDeriv> > parentForce (*parentForceChangeId[this->fromModel.get()].write());
199-
ReadAccessor<Data<VecInDeriv> > parentDx (*mparams->readDx(this->fromModel));
199+
ReadAccessor<Data<VecInDeriv> > parentDx (*mparams->readDx(this->fromModel.get()));
200200
InReal kfactor = (InReal)mparams->kFactor();
201201

202202
for(unsigned i=0; i<parentForce.size(); i++)

0 commit comments

Comments
 (0)