33 #ifndef PARAM_FUNC_DIST_HPP 34 #define PARAM_FUNC_DIST_HPP 63 template <
class TDerived>
64 struct ParamFuncsDistBaseCRTPTraits;
67 template <
typename TDerived>
71 using NumType =
typename ParamFuncsDistBaseCRTPTraits<TDerived>::NumType;
96 thisDerived().setDistCfModeImplCRTP(_distCfMode, _distRelFuncIdx);
102 thisDerived().setEvalDistImplCRTP(_funcsDistEval, _eAG);
109 return thisDerived().computeSImplCRTP();
116 return thisDerived().computeTImplCRTP(_s, _eAG);
125 thisDerived().computeS2TLatticeImplCRTP(_sLattice, _tLattice);
139 thisDerived().computeS2TLatticeImplCRTP(_arc0, _ds, _tLattice);
145 return static_cast<TDerived&
>(*this);
151 return static_cast<const TDerived&
>(*this);
155 template <
typename TNumType>
181 setDistCfModeImplVirt(_distCfMode, _distRelFuncIdx);
187 setEvalDistImplVirt(_funcsDistEval, _eAG);
194 return computeSImplVirt();
201 return computeTImplVirt(_s, _eAG);
208 void computeS2TLattice(
const std::vector<TNumType>& _sLattice, std::vector<TNumType>& _tLattice)
210 computeS2TLatticeImplVirt(_sLattice, _tLattice);
222 void computeS2TLattice(
const TNumType& _arc0,
const TNumType& _ds, std::vector<TNumType>& _tLattice)
224 computeS2TLatticeImplVirt(_arc0, _ds, _tLattice);
230 const std::vector<std::size_t>& _distRelFuncIdx) = 0;
233 virtual void setEvalDistImplVirt(
const TNumType& _funcsDistEval,
237 virtual TNumType computeSImplVirt()
const = 0;
240 virtual TNumType computeTImplVirt(
const TNumType& _s,
244 virtual void computeS2TLatticeImplVirt(
const std::vector<TNumType>& _sLattice, std::vector<TNumType>& _tLattice) = 0;
247 virtual void computeS2TLatticeImplVirt(
const TNumType& _arc0,
const TNumType& _ds,
248 std::vector<TNumType>& _tLattice) = 0;
251 template <
typename TDerived,
typename TNumType>
298 thisDerived().setDistCfModeImpl(_distCfMode, _distRelFuncIdx);
304 thisDerived().setEvalDistImpl(_funcsDistEval, _eAG);
310 return thisDerived().computeSImpl();
316 return thisDerived().computeTImpl(_s, _eAG);
322 thisDerived().computeS2TLatticeImpl(_sLattice, _tLattice);
328 thisDerived().computeS2TLatticeImpl(_arc0, _ds, _tLattice);
333 const std::vector<std::size_t>& _distRelFuncIdx)
override final 335 thisDerived().setDistCfModeImpl(_distCfMode, _distRelFuncIdx);
341 thisDerived().setEvalDistImpl(_funcsDistEval, _eAG);
347 return thisDerived().computeSImpl();
353 return thisDerived().computeTImpl(_s, _eAG);
358 std::vector<TNumType>& _tLattice)
override final 360 thisDerived().computeS2TLatticeImpl(_sLattice, _tLattice);
365 std::vector<TNumType>& _tLattice)
override final 367 thisDerived().computeS2TLatticeImpl(_arc0, _ds, _tLattice);
373 return static_cast<TDerived&
>(*this);
379 return static_cast<const TDerived&
>(*this);
382 template <
typename TDerived2>
384 template <
typename TNum2>
390 template <
typename TDerived,
typename TNumType>
399 #endif // PARAM_FUNC_DIST_HPP TNumType computeT(const TNumType &_s, const EvalArcGuarantee &_eAG=EvalArcGuarantee::NONE)
void computeS2TLattice(const TNumType &_arc0, const TNumType &_ds, std::vector< TNumType > &_tLattice)
Computes arc parametrization lattice given an inital arc and distance parametrized sampling interval...
const TDerived & thisDerived() const
virtual TNumType computeTImplVirt(const TNumType &_s, const EvalArcGuarantee &_eAG) overridefinal
void setEvalDistImplCRTP(const TNumType &_funcsDistEval, const EvalArcGuarantee &_eAG)
void computeS2TLattice(const std::vector< TNumType > &_sLattice, std::vector< TNumType > &_tLattice)
Computes arc parametrization lattice given a distance-parametrized lattice.
TNumType computeS() const
void setDistCfModeImplCRTP(TraveledDistCfMode _distCfMode, const std::vector< std::size_t > &_distRelFuncIdx)
virtual void setDistCfModeImplVirt(TraveledDistCfMode _distCfMode, const std::vector< std::size_t > &_distRelFuncIdx) overridefinal
virtual void computeS2TLatticeImplVirt(const TNumType &_arc0, const TNumType &_ds, std::vector< TNumType > &_tLattice) overridefinal
typename ParamFuncsDistBaseCRTPTraits< ParamFuncsDistBase< ParamFuncsSpline0Dist< TNumType, TFuncSize, TArcLatticeSize >, TNumType > >::NumType NumType
void computeS2TLatticeImplCRTP(const std::vector< TNumType > &_sLattice, std::vector< TNumType > &_tLattice)
void computeS2TLattice(const std::vector< NumType > &_sLattice, std::vector< NumType > &_tLattice)
Computes arc parametrization lattice given a distance-parametrized lattice.
std::shared_ptr< ParamFuncsDist const > ParamFuncsDistConstPtr
agent base center linear velocity is parametric function
virtual TNumType computeSImplVirt() const overridefinal
virtual void computeS2TLatticeImplVirt(const std::vector< TNumType > &_sLattice, std::vector< TNumType > &_tLattice) overridefinal
agent base center linear acceleration is parametric function
void computeS2TLattice(const NumType &_arc0, const NumType &_ds, std::vector< NumType > &_tLattice)
Computes arc parametrization lattice given an inital arc and distance parametrized sampling interval...
void setDistCfMode(TraveledDistCfMode _distCfMode, const std::vector< std::size_t > &_distRelFuncIdx)
Initializer of the Closed form distance computation mode.
TNumType computeTImplCRTP(const TNumType &_s, const EvalArcGuarantee &_eAG)
EvalArcGuarantee
Flags if any guarantees about evaluation arc relative to last evaluation arc are present.
void setEvalDist(const NumType &_funcsDistEval, const EvalArcGuarantee &_eAG=EvalArcGuarantee::NONE)
Moves to evaluation arc at which the traveled distance _funcsDistEval is achieved.
TNumType computeSImplCRTP() const
void setDistCfMode(TraveledDistCfMode _distCfMode, const std::vector< std::size_t > &_distRelFuncIdx)
Initializer of the Closed form distance computation mode.
no closed-form distance computation mode
const TDerived & thisDerived() const
void setEvalDist(const TNumType &_funcsDistEval, const EvalArcGuarantee &_eAG=EvalArcGuarantee::NONE)
Moves to evaluation arc at which the traveled distance _funcsDistEval is achieved.
virtual void setEvalDistImplVirt(const TNumType &_funcsDistEval, const EvalArcGuarantee &_eAG) overridefinal
std::shared_ptr< ParamFuncsDist > ParamFuncsDistPtr
NumType computeT(const NumType &_s, const EvalArcGuarantee &_eAG=EvalArcGuarantee::NONE)
TraveledDistCfMode
Required type of traveled distance computation relative to the parametric function.
void computeS2TLatticeImplCRTP(const TNumType &_arc0, const TNumType &_ds, std::vector< TNumType > &_tLattice)