typedefcurve_abc<double,double,true,pointX_t,pointX_t>curve_abc_t;// base abstract class
typedefcurve_abc<double,double,true,point3_t,point3_t>curve_3_t;// generic class of curve of size 3
typedefcurve_abc<double,double,true,matrix3_t,point3_t>curve_rotation_t;// templated class used for the rotation (return dimension are fixed)
typedefcurve_abc<double,double,true,transform_t,point6_t>curve_SE3_t;// templated abstract class used for all the se3 curves (return dimension are fixed)
/// \brief Add a new curve to piecewise curve, which should be defined in \f$[T_{min},T_{max}]\f$ where
/// \f$T_{min}\f$
/// is equal to \f$T_{max}\f$ of the actual piecewise curve. The curve added should be of type Curve as
/// defined in the template.
/// \param cf : curve to add.
///
voidadd_curve(constcurve_t&cf){
if(size_==0&&dim_==0){// first curve added
dim_=cf.dim();
voidadd_curve_ptr(constcurve_ptr_t&cf){
if(size_==0){// first curve added
dim_=cf->dim();
}
// Check time continuity : Beginning time of cf must be equal to T_max_ of actual piecewise curve.
if(size_!=0&&!(fabs(cf.min()-T_max_)<MARGIN)){
throwstd::invalid_argument(
"Can not add new Polynom to PiecewiseCurve : time discontinuity between T_max_ and pol.min()");
if(size_!=0&&!(fabs(cf->min()-T_max_)<MARGIN)){
std::stringstreamss;ss<<"Can not add new Polynom to PiecewiseCurve : time discontinuity between T_max_ and pol.min(). Current T_max is "<<T_max_<<" new curve min is "<<cf->min();
throwstd::invalid_argument(ss.str().c_str());
}
if(cf.dim()!=dim_){
throwstd::invalid_argument(
"All the curves in a piecewiseCurve should have the same dimension");
if(cf->dim()!=dim_){
std::stringstreamss;ss<<"All the curves in a piecewiseCurve should have the same dimension. Current dim is "<<dim_<<" dim of the new curve is "<<cf->dim();