curve_abc.h 1.74 KB
Newer Older
1
/**
2 3
* \file curve_abc.h
* \brief interface for a Curve of arbitrary dimension.
4 5 6 7 8 9 10 11
* \author Steve T.
* \version 0.1
* \date 06/17/2013
*
* Interface for a curve
*/


12 13
#ifndef _STRUCT_CURVE_ABC
#define _STRUCT_CURVE_ABC
14 15 16

#include "MathDefs.h"

17
#include <functional>
18 19 20

namespace spline
{
21 22 23
/// \struct curve_abc
/// \brief Represents a curve of dimension Dim
/// is Safe is false, no verification is made on the evaluation of the curve.
24
template<typename Time= double, typename Numeric=Time, std::size_t Dim=3, bool Safe=false
25 26 27 28 29 30
, typename Point= Eigen::Matrix<Numeric, Dim, 1> >
struct  curve_abc : std::unary_function<Time, Point>
{
	typedef Point 	point_t;
	typedef Time 	time_t;

31 32
/* Constructors - destructors */
	public:
33
	///\brief Constructor
34
    curve_abc(){}
35

36
	///\brief Destructor
stevet's avatar
stevet committed
37
    virtual ~curve_abc(){}
38 39 40 41 42 43
/* Constructors - destructors */

/*Operations*/
	public:
	///  \brief Evaluation of the cubic spline at time t.
	///  \param t : the time when to evaluate the spine
44
	///  \param return : the value x(t)
45
    virtual point_t operator()(const time_t t) const = 0;
46 47 48 49 50 51 52


    ///  \brief Evaluation of the derivative spline at time t.
    ///  \param t : the time when to evaluate the spline
    ///  \param order : order of the derivative
    ///  \param return : the value x(t)
    virtual point_t derivate(const time_t t, const std::size_t order) const = 0;
53 54 55
/*Operations*/

/*Helpers*/
stonneau's avatar
stonneau committed
56 57 58 59 60
	public:
	///  \brief Returns the minimum time for wich curve is defined
	virtual time_t min() const = 0;
	///  \brief Returns the maximum time for wich curve is defined
	virtual time_t max() const = 0;
t steve's avatar
t steve committed
61 62

    std::pair<time_t, time_t> timeRange() {return std::make_pair(min(), max());}
63 64 65 66
/*Helpers*/

	};
}
67
#endif //_STRUCT_CURVE_ABC
68