SWBF2-Classic-Msh-Viewer/QtMeshViewer/Header/GeometryEngine.h

45 lines
999 B
C
Raw Normal View History

2016-12-29 12:37:15 +00:00
#pragma once
#include "..\Header\FileInterface.h"
#include <QObject>
#include <QOpenGLFunctions>
#include <QOpenGLShaderProgram>
#include <QOpenGLBuffer>
2016-12-29 12:37:15 +00:00
#include <QOpenGLTexture>
2016-12-29 13:06:25 +00:00
#include <QVector>
struct DrawInformation {
unsigned int offset;
unsigned int size;
unsigned int textureIndex;
QMatrix4x4 modelMatrix;
};
class GeometryEngine : public QObject, protected QOpenGLFunctions
{
Q_OBJECT
public:
GeometryEngine(QObject *parent = Q_NULLPTR);
2016-12-29 12:37:15 +00:00
virtual ~GeometryEngine();
private:
2016-12-29 13:06:25 +00:00
QOpenGLBuffer m_arrayBuf;
QOpenGLBuffer m_indexBuf;
QVector<Material>* m_materials = Q_NULLPTR;
QVector<DrawInformation> m_drawList;
BoundingBox m_boundings;
void clearData();
2016-12-29 12:37:15 +00:00
public slots:
2017-01-07 14:59:16 +00:00
void loadFile(QString filePath);
void drawGeometry(QOpenGLShaderProgram *program, bool wireframe);
signals:
void requestResetView();
void sendMessage(QString message, int severity);
void requestUpdate();
void sendFileInfo(QString name, QVector<Material>* materials, int vertices, int triangle);
};