#ifndef WIDGETS_GRAPHPLOTTER_SPLINEINTERPOLATOR_H
#define WIDGETS_GRAPHPLOTTER_SPLINEINTERPOLATOR_H

#include "Spline.h"
#include "Interpolator.h"


// -- TDE NAMESPACE ----------------------------------------------------

namespace TDE {

// -- Widgets NAMESPACE ------------------------------------------------

namespace Widgets {

namespace Plot {


// interpolate a set of points with Natural Cubic Splines
class SplineInterpolator : public Interpolator
{
public:
	SplineInterpolator(const std::vector<Point>& points);
	virtual ~SplineInterpolator();

	virtual double compute(double x) const;
	boost::optional<const Spline&> findSpline(double x) const;

	std::vector<Spline> splines;
};


} /* end of namespace Plot */

} /* end of namespace Widgets */

} /* end of namespace TDE */

#endif /* WIDGETS_GRAPHPLOTTER_SPLINEINTERPOLATOR_H */
