@@ -135,12 +135,12 @@ sofa::linearalgebra::BaseMatrix* Mapping<In,Out>::createMappedMatrix(const behav
135135template <class In , class Out >
136136void Mapping<In,Out>::apply(const MechanicalParams* mparams, MultiVecCoordId outPos, ConstMultiVecCoordId inPos)
137137{
138- State<In>* fromModel = this ->fromModel .get ();
139- State<Out>* toModel = this ->toModel .get ();
140- if (fromModel && toModel )
138+ State<In>* from = this ->fromModel .get ();
139+ State<Out>* to = this ->toModel .get ();
140+ if (from && to )
141141 {
142- OutDataVecCoord* out = outPos[toModel ].write ();
143- const InDataVecCoord* in = inPos[fromModel ].read ();
142+ OutDataVecCoord* out = outPos[to ].write ();
143+ const InDataVecCoord* in = inPos[from ].read ();
144144 if (out && in)
145145 {
146146 this ->apply (mparams, *out, *in);
@@ -151,12 +151,12 @@ void Mapping<In,Out>::apply(const MechanicalParams* mparams, MultiVecCoordId out
151151template <class In , class Out >
152152void Mapping<In,Out>::applyJ(const MechanicalParams* mparams, MultiVecDerivId outVel, ConstMultiVecDerivId inVel)
153153{
154- State<In>* fromModel = this ->fromModel .get ();
155- State<Out>* toModel = this ->toModel .get ();
156- if (fromModel && toModel )
154+ State<In>* from = this ->fromModel .get ();
155+ State<Out>* to = this ->toModel .get ();
156+ if (from && to )
157157 {
158- OutDataVecDeriv* out = outVel[toModel ].write ();
159- const InDataVecDeriv* in = inVel[fromModel ].read ();
158+ OutDataVecDeriv* out = outVel[to ].write ();
159+ const InDataVecDeriv* in = inVel[from ].read ();
160160 if (out && in)
161161 {
162162 this ->applyJ (mparams, *out, *in);
@@ -167,12 +167,12 @@ void Mapping<In,Out>::applyJ(const MechanicalParams* mparams, MultiVecDerivId ou
167167template <class In , class Out >
168168void Mapping<In,Out>::applyJT(const MechanicalParams *mparams, MultiVecDerivId inForce, ConstMultiVecDerivId outForce)
169169{
170- State<In>* fromModel = this ->fromModel .get ();
171- State<Out>* toModel = this ->toModel .get ();
172- if (fromModel && toModel )
170+ State<In>* from = this ->fromModel .get ();
171+ State<Out>* to = this ->toModel .get ();
172+ if (from && to )
173173 {
174- InDataVecDeriv* out = inForce[fromModel ].write ();
175- const OutDataVecDeriv* in = outForce[toModel ].read ();
174+ InDataVecDeriv* out = inForce[from ].write ();
175+ const OutDataVecDeriv* in = outForce[to ].read ();
176176 if (out && in)
177177 {
178178 this ->applyJT (mparams, *out, *in);
@@ -184,12 +184,12 @@ void Mapping<In,Out>::applyJT(const MechanicalParams *mparams, MultiVecDerivId i
184184template <class In , class Out >
185185void Mapping<In,Out>::applyJT(const ConstraintParams* cparams, MultiMatrixDerivId inConst, ConstMultiMatrixDerivId outConst )
186186{
187- State<In>* fromModel = this ->fromModel .get ();
188- State<Out>* toModel = this ->toModel .get ();
189- if (fromModel && toModel )
187+ State<In>* from = this ->fromModel .get ();
188+ State<Out>* to = this ->toModel .get ();
189+ if (from && to )
190190 {
191- InDataMatrixDeriv* out = inConst[fromModel ].write ();
192- const OutDataMatrixDeriv* in = outConst[toModel ].read ();
191+ InDataMatrixDeriv* out = inConst[from ].write ();
192+ const OutDataMatrixDeriv* in = outConst[to ].read ();
193193 if (out && in)
194194 {
195195 this ->applyJT (cparams, *out, *in);
@@ -208,13 +208,13 @@ void Mapping<In,Out>::applyDJT(const MechanicalParams* /*mparams */ , MultiVecDe
208208template <class In , class Out >
209209void Mapping<In,Out>::computeAccFromMapping(const MechanicalParams* mparams, MultiVecDerivId outAcc, ConstMultiVecDerivId inVel, ConstMultiVecDerivId inAcc )
210210{
211- State<In>* fromModel = this ->fromModel .get ();
212- State<Out>* toModel = this ->toModel .get ();
213- if (fromModel && toModel )
211+ State<In>* from = this ->fromModel .get ();
212+ State<Out>* to = this ->toModel .get ();
213+ if (from && to )
214214 {
215- OutDataVecDeriv* out = outAcc[toModel ].write ();
216- const InDataVecDeriv* inV = inVel[fromModel ].read ();
217- const InDataVecDeriv* inA = inAcc[fromModel ].read ();
215+ OutDataVecDeriv* out = outAcc[to ].write ();
216+ const InDataVecDeriv* inV = inVel[from ].read ();
217+ const InDataVecDeriv* inA = inAcc[from ].read ();
218218 if (out && inV && inA)
219219 this ->computeAccFromMapping (mparams, *out, *inV, *inA);
220220 }
0 commit comments