#ifndef QTMAIN_H
#define QTMAIN_H
#include <QWidget>
#include <QtGui>
#include <QtOpenGL>

#include "QtOpenGL/QGLWidget"

#include <src/glm.h>

class Qtmain : public QGLWidget
{
    Q_OBJECT

public:
    Qtmain(int pageId, int page_L_R, QString  imgPath,QString meshPath, QImage srcInput, QWidget *parent = 0, QGLWidget *shareWidget = 0);
        ~Qtmain();

signals :
    void displayed();
protected:

    void initializeGL();

    void resizeGL(int w, int h);

    void paintGL();

    void keyPressEvent(QKeyEvent *event);

private:
    void initialize(int pageId, int page_L_R, QImage srcInput);
    //void initializeDatabaseKHOI(int pageId, int page_L_R, QImage srcInput);
    //void initializeDatabaseWeb(int pageId, int page_L_R, int  imgId, QImage srcInput);
    void save(const char* filename, int w, int h);
    void keyboard(unsigned char key, int x, int y);
    void reshape (int w, int h);
    void display(void);
    void drawmodel(void);
    void init(void);
    bool LoadTreeTextures();
    void changePerspective();
    int _pageId, _page_L_R;
    QImage _srcInput;
};

#endif // QTMAIN_H
