#ifndef MAINWINDOW_H
#define MAINWINDOW_H

#include <QtGui/QMainWindow>
#include <QTreeWidgetItem>
#include <QProgressBar>
#include "enginepreview.h"


namespace Ui
{
    class MainWindow;
}

class MainWindow : public QMainWindow
{
    Q_OBJECT

public:
    MainWindow(QWidget *parent = 0);
    ~MainWindow();

private:
    Ui::MainWindow *ui;
    ObjectInfo *current_object_info;
    CameraPath *current_cam_path_point;
    QPixmap clean_image;
    QProgressBar progressbar;
    QTimer timer;

public slots:
    void draw_heightmap();
    void rebuild_pixmap(int w, int h);
    QImage scale_heightmap(float scale, QImage input);
    unsigned int Bilinear(float x1,float y1, QImage *input);
    void update_fps();

private slots:
    void on_pushButton_3_clicked();
    void on_pushButton_2_pressed();
    void on_pushButton_5_pressed();
    void on_pushButton_4_pressed();
    void on_CamPathLength_valueChanged(double );
    void on_CamPathIsLoopStart_stateChanged(int );
    void on_CamPathYAngSlider_valueChanged(int value);
    void on_CamPathXAngSlider_valueChanged(int value);
    void on_CamPathPointZ_valueChanged(double );
    void on_CamPathPointY_valueChanged(double );
    void on_CamPathPointX_valueChanged(double );
    void on_CameraPath_itemClicked(QTreeWidgetItem* item, int column);
    void on_Generate_pressed();
    void on_pushButton_pressed();
    void on_actionExit_triggered();
    void on_ObjectYRotation_valueChanged(double );
    void on_ObjectXRotation_valueChanged(double );
    void on_ObjectZScale_valueChanged(double );
    void on_ObjectYScale_valueChanged(double );
    void on_ObjectXScale_valueChanged(double );
    void on_ObjectZPos_valueChanged(double );
    void on_ObjectYPos_valueChanged(double );
    void on_ObjectXPos_valueChanged(double );
    void on_ObjectZRotation_valueChanged(double );
    void on_ObjectTree_itemClicked(QTreeWidgetItem* item, int column);
    void on_spinBox_valueChanged(int );
    void on_actionLoadObject_triggered();
    void on_actionLoad_water_object_triggered();
    void on_ZScale_valueChanged(double );
    void on_YScale_valueChanged(double );
    void on_XScale_valueChanged(double );
    void on_verticalSlider_2_sliderMoved(int position);
    void on_CamYDial_sliderMoved(int position);
    void on_CamXDial_sliderMoved(int position);
    void on_actionOpen_data_triggered();
    void on_actionSave_triggered();
    void on_verticalSlider_sliderMoved(int position);
    void on_horizontalSlider_sliderMoved(int position);
    void on_ScaleSlider_sliderMoved(int position);
    void on_actionOpen_triggered();
    void on_MouseMove(QMouseEvent *event);
};

#endif // MAINWINDOW_H
