SWBF2-Classic-Msh-Viewer/QtMeshViewer/Header/GeometryEngine.h
Anakin 86dfe32145 add wireframe paint option,
write file information on the screen,
bug fixes
2017-01-16 14:24:30 +01:00

45 lines
999 B
C++

#pragma once
#include "..\Header\FileInterface.h"
#include <QObject>
#include <QOpenGLFunctions>
#include <QOpenGLShaderProgram>
#include <QOpenGLBuffer>
#include <QOpenGLTexture>
#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);
virtual ~GeometryEngine();
private:
QOpenGLBuffer m_arrayBuf;
QOpenGLBuffer m_indexBuf;
QVector<Material>* m_materials = Q_NULLPTR;
QVector<DrawInformation> m_drawList;
BoundingBox m_boundings;
void clearData();
public slots:
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);
};