#ifndef QT_VIEW_HPP
#define QT_VIEW_HPP

#include <iostream>

#include <QWidget>
#include <QPainter>
#include <QOpenGLWidget>
#include <QMouseEvent>

#include <GL/glut.h>

#include "geometry.hpp"

using namespace std;

class QtView:public QOpenGLWidget{
protected:
  Geometry* geometry;
public:
  QtView();
  void setGeometry(Geometry* geometry);
  void initializeGL();
  void paintGL();
  void resizeGL(int x,int h);
  void drawTriangle(size_t ix1,size_t iz1,size_t ix2,size_t iz2,size_t ix3,size_t iz3);
};

inline
QtView::QtView():QOpenGLWidget(){
  geometry=nullptr;
}

inline void
QtView::setGeometry(Geometry* _geometry){
  geometry=_geometry;
}

#endif
