#ifndef INTERPOLATOR_H
#define INTERPOLATOR_H

#include "Slope.h"
#include "global_defines.h"

struct FahrprofilData;
struct WidgetData;

class Interpolator
{
public:
    Interpolator(double posX, double posY, FahrprofilData *dataX, FahrprofilData *dataY, WidgetData &widgetData);

    void calc(double h1, double h2, double offset_y, double offset_y2,double n1, double n2, double s_max, double a_ymax, double a_xmax, double pause, double zwischenpause);
    void calcCheck(double h1, double s_max, double a_ymax, double a_xmax);
    void calc(InterpolatorData ipoData);
    void setPositionX(double pos);
    void setPositionY(double pos);
    void setPositionxY(double posx, double posy);
    void setOverrideY(double val);
    double beschleunigunsWegX() const;
    double beschleunigunsWegY() const;

private:
    SlopeCalcData scd_x;
    SlopeCalcData scd_y;
    PrivateSlopeCalcData pscd_x;
    PrivateSlopeCalcData pscd_y;

    double m_position_X;
    double m_position_Y;
    double m_factor_old;
    double s_wurf_y;
    double m_zwichenpause;
    double m_factorVx;
    double m_beschleunigungswegX;
    double m_beschleunigungswegY;
    FahrprofilData *fbd_X;
    FahrprofilData *fbd_Y;
    WidgetData &m_widgetData;

    void calcInit(double h, double n,
                  double s_max, double a_max_y,
                  double a_max_x);
};

#endif // INTERPOLATOR_H
