@@ -139,7 +139,7 @@ void BeamInterpolation<DataTypes>::computeCrossSectionInertiaMatrix()
139139 }
140140 else
141141 {
142- Size nbEdges = this ->m_topology ->getNbEdges ();
142+ Size nbEdges = this ->l_topology ->getNbEdges ();
143143 m_section.resize (nbEdges);
144144 if ( crossSectionShape.getValue ().getSelectedItem () == " elliptic" )
145145 {
@@ -197,7 +197,7 @@ void BeamInterpolation<DataTypes>::init()
197197 if (this ->d_componentState .getValue () == ComponentState::Invalid)
198198 return ;
199199
200- Size nbEdges = this ->m_topology ->getNbEdges ();
200+ Size nbEdges = this ->l_topology ->getNbEdges ();
201201 checkDataSize (m_defaultRadius, d_radius, nbEdges);
202202 checkDataSize (m_defaultInnerRadius, d_innerRadius, nbEdges);
203203 checkDataSize (m_defaultLengthY, d_lengthY, nbEdges);
@@ -211,7 +211,7 @@ void BeamInterpolation<DataTypes>::init()
211211 auto edgeList = sofa::helper::getWriteOnlyAccessor (this ->d_edgeList );
212212 edgeList.clear ();
213213
214- for (unsigned int i=0 ; i<this ->m_topology ->getNbEdges (); i++)
214+ for (unsigned int i=0 ; i<this ->l_topology ->getNbEdges (); i++)
215215 {
216216 edgeList.push_back (i);
217217 }
@@ -225,7 +225,7 @@ void BeamInterpolation<DataTypes>::init()
225225 DOF1TransformNode1.resize (edgeList.size ());
226226 }
227227
228- ReadAccessor<Data<VecCoord> > statePos = this ->m_mstate ->read (sofa::core::vec_id::read_access::position) ;
228+ ReadAccessor<Data<VecCoord> > statePos = this ->l_mstate ->read (sofa::core::vec_id::read_access::position) ;
229229
230230 auto lengthList = sofa::helper::getWriteOnlyAccessor (this ->d_lengthList );
231231 lengthList.clear ();
@@ -335,17 +335,18 @@ bool BeamInterpolation<DataTypes>::interpolationIsAlreadyInitialized()
335335template <class DataTypes >
336336bool BeamInterpolation<DataTypes>::verifyTopology()
337337{
338+ const auto nbEdges = this ->l_topology ->getNbEdges ();
339+
338340 // TODO(dmarchal) This contains "code" specific slang that cannot be understood by user.
339- dmsg_info () << " The vector _topologyEdges is now set with " << this ->m_topologyEdges ->size () << " edges" ;
340-
341+ dmsg_info () << " The vector _topologyEdges is now set with " << nbEdges << " edges" ;
341342
342343 const VecElementID &edgeList = this ->d_edgeList .getValue ();
343344 for (unsigned int j = 0 ; j < edgeList.size (); j++)
344345 {
345- if (edgeList[j] > this -> m_topologyEdges -> size () )
346+ if (edgeList[j] > nbEdges )
346347 {
347348 msg_error () << " The provided edge index '" << edgeList[j] << " 'is larger than '"
348- << this -> m_topologyEdges -> size () << " ' the amount of edges in the topology. " ;
349+ << nbEdges << " ' the amount of edges in the topology. " ;
349350 return false ;
350351 }
351352 }
@@ -420,7 +421,7 @@ void BeamInterpolation<DataTypes>::getMechanicalSampling(Real& dx, const Real x_
420421{
421422 SOFA_UNUSED (x_localcurv_abs);
422423
423- const auto numLines = this ->m_topologyEdges -> size ();
424+ const auto numLines = this ->l_topology -> getNbEdges ();
424425 dx = getRestTotalLength ()/numLines;
425426}
426427
@@ -429,14 +430,14 @@ void BeamInterpolation<DataTypes>::getCollisionSampling(Real &dx, const Real x_l
429430{
430431 SOFA_UNUSED (x_localcurv_abs);
431432
432- const auto numLines = this ->m_topologyEdges -> size ();
433+ const auto numLines = this ->l_topology -> getNbEdges ();
433434 dx = getRestTotalLength ()/numLines;
434435}
435436
436437template <class DataTypes >
437438void BeamInterpolation<DataTypes>::getNumberOfCollisionSegment(Real &dx, unsigned int &numLines)
438439{
439- numLines = static_cast <unsigned int >(this ->m_topologyEdges -> size ());
440+ numLines = static_cast <unsigned int >(this ->l_topology -> getNbEdges ());
440441 dx = getRestTotalLength ()/numLines;
441442}
442443
@@ -599,16 +600,16 @@ void BeamInterpolation<DataTypes>::updateInterpolation(){
599600 if (d_vecID.getValue ().getSelectedItem () == " current" )
600601 {
601602 dmsg_info () <<" position " << msgendl
602- << " =" << this ->m_mstate ->read ( sofa::core::vec_id::read_access::position )->getValue ( ) ;
603- x=this ->m_mstate ->read ( sofa::core::vec_id::read_access::position );
603+ << " =" << this ->l_mstate ->read ( sofa::core::vec_id::read_access::position )->getValue ( ) ;
604+ x=this ->l_mstate ->read ( sofa::core::vec_id::read_access::position );
604605 }
605606 else if (d_vecID.getValue ().getSelectedItem () == " free" )
606607 {
607- x=this ->m_mstate ->read ( sofa::core::vec_id::read_access::freePosition ) ;
608+ x=this ->l_mstate ->read ( sofa::core::vec_id::read_access::freePosition ) ;
608609 }
609610 else // / rest position
610611 {
611- x=this ->m_mstate ->read ( sofa::core::vec_id::read_access::restPosition ) ;
612+ x=this ->l_mstate ->read ( sofa::core::vec_id::read_access::restPosition ) ;
612613 computeVel = false ;
613614 }
614615
0 commit comments