Tornado-Visualization/datenvisualisierung_sose2024/horizontalslicerenderer.h
2024-06-15 20:50:23 +02:00

39 lines
1.2 KiB
C++

#ifndef HORIZONTALSLICERENDERER_H
#define HORIZONTALSLICERENDERER_H
#include "horizontalslicetoimagemapper.h"
#include <QOpenGLShaderProgram>
#include <QOpenGLBuffer>
#include <QOpenGLVertexArrayObject>
class HorizontalSliceRenderer
{
public:
HorizontalSliceRenderer();
virtual ~HorizontalSliceRenderer();
// Draw the bounding box to the current OpenGL viewport.
void drawBoundingBox(QMatrix4x4 mvpMatrix);
void setMapper(HorizontalSliceToImageMapper *mappery);
void drawFrame(QMatrix4x4 mvpMatrix);
void initFrame();
void drawImage(QMatrix4x4 mvpMatrix);
int z;
void moveSlice(int steps);
void drawCube(QMatrix4x4 mvpMatrix);
HorizontalSliceRenderer(int z, int zs);
private:
void initOpenGLShaders();
void initBoundingBoxGeometry();
int zs;
HorizontalSliceToImageMapper* mapper;
QOpenGLShaderProgram shaderProgram;
QOpenGLShaderProgram shaderProgramTexture;
QOpenGLBuffer vertexBuffer;
QOpenGLBuffer frameBuffer;
QOpenGLVertexArrayObject vertexArrayObject;
QOpenGLVertexArrayObject frameArrayObject; //very important don't forgetty
QImage img;
};
#endif // HORIZONTALSLICERENDERER_H