61 lines
1.3 KiB
C++
61 lines
1.3 KiB
C++
#ifndef DRAWWIDGET_H
|
|
#define DRAWWIDGET_H
|
|
|
|
#include <sparrowrenderer.h>
|
|
#include <QOpenGLWidget>
|
|
|
|
#include "map.h"
|
|
#include "behavior.h"
|
|
|
|
class PixelPipeline;
|
|
class MapScene;
|
|
class FrameBuffer;
|
|
class Simulation;
|
|
|
|
class DrawWidget : public QOpenGLWidget
|
|
{
|
|
private:
|
|
Q_OBJECT
|
|
|
|
SparrowRenderer renderer;
|
|
|
|
// camera handling variables
|
|
QPoint lastMousePos;
|
|
bool grabbedMouse;
|
|
MapScene *m_map;
|
|
MapScene *m_dummyMap;
|
|
FrameBuffer *m_Qt_fbo;
|
|
PixelPipeline *m_pipeline;
|
|
int m_width;
|
|
int m_height;
|
|
|
|
bool new_simulation;
|
|
bool update_needed;
|
|
|
|
protected:
|
|
// Output
|
|
virtual void initializeGL();
|
|
virtual void paintGL();
|
|
virtual void resizeGL(int w, int h);
|
|
|
|
// Input
|
|
void mouseMoveEvent(QMouseEvent *event);
|
|
void mousePressEvent(QMouseEvent *event);
|
|
void mouseDoubleClickEvent(QMouseEvent * event);
|
|
void mouseReleaseEvent(QMouseEvent *event);
|
|
void wheelEvent(QWheelEvent *event);
|
|
|
|
public:
|
|
DrawWidget(QWidget *parent = 0);
|
|
~DrawWidget();
|
|
void startSimulation(MapScene *map);
|
|
void stopSimulation();
|
|
|
|
public slots:
|
|
void updateDudesBehavior();
|
|
void setFlatSphere(int);
|
|
void setSurfaceRatio(int);
|
|
};
|
|
|
|
#endif // DRAWWIDGET_H
|