#ifndef WIDGETSIMU_H
#define WIDGETSIMU_H

#include <QtGui/QGraphicsView>
#include <math.h>
#include <stdlib.h>
#include <time.h>
#include <sys/types.h>
#include <sys/timeb.h>
#include <string.h>
#include <QKeyEvent>

#include <windows.h>

#include <QGLWidget>
#include "sailboat.h"

class WidgetSimu : public QGLWidget
{
    Q_OBJECT
public:
    explicit WidgetSimu(QWidget *parent = 0);

signals:

public slots:
   void Start();
   void Clock();

protected:
    void initializeGL();
    void paintGL();
    void resizeGL(int width, int height);
    void mousePressEvent(QMouseEvent *event);
    void mouseMoveEvent(QMouseEvent *event);
    void enterEvent(QEvent *event);
    void keyPressEvent(QKeyEvent *event);

private:
    void DrawMer();
    void DrawBouees();
    void DrawSailboat();
    void DrawCircle();
    void DrawCable();

    void DrawArrow(double x,double y, double z, double angle, double L, double rouge, double vert, double bleu);
    int xRotCam,yRotCam,zRotCam;
    double xCam,yCam,zCam;
    float Zoom;

    sailboat sailboat1;

    QPoint lastMousePos;
};

#endif // WIDGETSIMU_H
