#ifndef WINDOW_H
#define WINDOW_H

#include "GLViewer.h"
#include <QMainWindow>
#include <QAction>
#include <QToolBar>
#include <QCheckBox>
#include <QGroupBox>
#include <QComboBox>
#include <QSlider>
#include <QLCDNumber>
#include <QSpinBox>
#include <QImage>
#include <QRadioButton>
#include <QLabel>

#include <vector>
#include <string>

#include "QTUtils.h"
#include "RayTracer.h"
#include "Material.h"

class GLViewer;
class QPushButton;
class QDoubleSpinBox;
class QSpinBox;
class Object;

class Window : public QMainWindow {
    Q_OBJECT
public:
    Window();
    virtual ~Window();

    static void showStatusMessage (const QString & msg);
    void setClickFocusDistance (int x, int y);
    void resetDofObjButtons();
    SRenderParameters initRenderParameters();
    void setSelectedObject(Object* obj);

public slots :
    void renderRayImage ();
    void gpuContinuousRender();
    void setBGColor ();
    void showRayImage ();
    void exportGLImage ();
    void exportRayImage ();
    void about ();
    void setDofQuality (int b);
    void setDofAperture (int b);
    void setFocusDistance (int b);
    void enableDoF(bool e);
    void toggleClickFocus();
    void setAAX(int);
    void setAAY(int);
    void enableAntiAliasing(bool);
    void enablePathTracing(bool e);
    void renderDofPreview();
    void setFOV (int b);
    void selectObject();
    void materialDiffuseChanged(double);
    void materialSpecularChanged(double);
    void materialTransparencyChanged(double);
    void materialIndiceChanged(double);
    void materialGlossChanged(double);
    void materialShininessChanged(int);
    void materialPureMirrorChanged(bool);
    void materialGlossFilteringChanged(bool);
    void materialColorChanged();
    void setRaytraceLights(bool);
    void enableShadows(bool);
	void loadScene();

private :
    QDockWidget* initControlDock();
    QDockWidget* initRenderControlDock();

    QActionGroup* actionGroup;
    QString currentDirectory;

    GLViewer* viewer;

    // DoF controls
    QLabel* focusLabel;
    QSlider* focus;
    QPushButton* dofButton;
    QPushButton* objButton;

    // Material controls
    QDoubleSpinBox* diffuseSpin;
    QDoubleSpinBox* specularSpin;
    QDoubleSpinBox* transparentSpin;
    QDoubleSpinBox* indiceSpin;
    QDoubleSpinBox* glossSpin;
    QSpinBox* shininessSpin;
    QCheckBox* pureMirrorCB;
    QCheckBox* filterGlossCB;
    QPushButton* colorButton;
    Material* mat;

    // Render parameters
    SRenderParameters parameters;
    Object* selectedObj;
};

#endif // WINDOW_H


// Some Emacs-Hints -- please don't remove:
//
//  Local Variables:
//  mode:C++
//  tab-width:4
//  End:
