#ifndef WIDGETS_GRAPHPLOTTER_LINEARINTERPOLATOR_H
#define WIDGETS_GRAPHPLOTTER_LINEARINTERPOLATOR_H

#include "Interpolator.h"


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

namespace TDE {

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

namespace Widgets {

namespace Plot {


class LinearInterpolator : public Interpolator
{
public:
	typedef std::pair<int, int> Segment;

	LinearInterpolator(const std::vector<Point>& points);
	virtual ~LinearInterpolator();

	virtual double compute(double x) const;
	boost::optional<Segment> findSegment(double x) const;
	std::vector<Point> m_points;
};


} /* end of namespace Plot */

} /* end of namespace Widgets */

} /* end of namespace TDE */

#endif /* WIDGETS_GRAPHPLOTTER_LINEARINTERPOLATOR_H */
