36 #ifndef OPENPSTD_VIEWER2D_H 37 #define OPENPSTD_VIEWER2D_H 39 #include <QOpenGLWidget> 41 #include <boost/numeric/ublas/vector.hpp> 44 #include <QOpenGLFunctions> 45 #include <QOpenGLShaderProgram> 46 #include <QOpenGLTexture> 47 #include "operations/BaseOperation.h" 48 #include <QOpenGLBuffer> 70 static MinMaxValue CombineList(std::vector<MinMaxValue> list);
73 void DeleteNothing(
void *ptr);
75 void DeleteTexture(
void *ptr);
82 explicit Viewer2D(QWidget *parent = 0);
84 virtual QSize sizeHint()
const override;
86 virtual QSize minimumSizeHint()
const override;
88 void UpdateFromModel(std::shared_ptr<Model>
const &model);
90 void SetOperationRunner(std::shared_ptr<OperationRunner> operationRunner);
94 virtual void resizeGL(
int w,
int h)
override;
96 virtual void initializeGL()
override;
98 virtual void paintGL()
override;
100 virtual void mousePressEvent(QMouseEvent *mouseEvent)
override;
102 virtual void mouseReleaseEvent(QMouseEvent *mouseEvent)
override;
104 virtual void mouseMoveEvent(QMouseEvent *mouseEvent)
override;
106 virtual void wheelEvent(QWheelEvent *qWheelEvent)
override;
109 std::vector<std::shared_ptr<Layer>> layers;
110 std::shared_ptr<OperationRunner> operationRunner;
113 void GLError(std::string name);
121 virtual bool GetVisible()
124 virtual void SetVisible(
bool value)
125 { visible = value; };
127 virtual void InitializeGL(QObject *context,
128 std::unique_ptr<QOpenGLFunctions,
void (*)(
void *)>
const &f) = 0;
130 virtual void PaintGLVisibilityCheck(QObject *context,
131 std::unique_ptr<QOpenGLFunctions,
void (*)(
void *)>
const &f)
134 { this->PaintGL(context, f); }
137 virtual void PaintGL(QObject *context, std::unique_ptr<QOpenGLFunctions,
void (*)(
void *)>
const &f) = 0;
139 virtual void UpdateScene(std::shared_ptr<Model>
const &m,
140 std::unique_ptr<QOpenGLFunctions,
void (*)(
void *)>
const &f) = 0;
151 #endif //OPENPSTD_VIEWER2D_H This is the general namespace of the OpenPSTD application.
Definition: Boundary.cpp:33
Definition: Viewer2D.h:148
Definition: Viewer2D.h:115
Definition: Viewer2D.h:57
Definition: Viewer2D.h:77