2016-12-29 12:37:15 +00:00
|
|
|
#pragma once
|
add exe icon,
signal-slot for openFile,
resetView on openFile,
cleanup when open a new file,
triangulate quad poly now correctly, more not working, bug from previous version,
next:
fix 5,6,.. triangulation,
triClothMan, IC Helmet, still buggy,
2017-01-02 11:21:32 +00:00
|
|
|
#include <QObject>
|
2016-12-24 15:03:37 +00:00
|
|
|
#include <QOpenGLFunctions>
|
|
|
|
#include <QOpenGLShaderProgram>
|
|
|
|
#include <QOpenGLBuffer>
|
2016-12-29 13:06:25 +00:00
|
|
|
#include <QVector>
|
2017-01-28 15:54:36 +00:00
|
|
|
#include "FileInterface.h"
|
|
|
|
|
2016-12-24 15:03:37 +00:00
|
|
|
|
2016-12-31 11:31:38 +00:00
|
|
|
struct DrawInformation {
|
|
|
|
unsigned int offset;
|
|
|
|
unsigned int size;
|
|
|
|
unsigned int textureIndex;
|
|
|
|
QMatrix4x4 modelMatrix;
|
|
|
|
};
|
|
|
|
|
add exe icon,
signal-slot for openFile,
resetView on openFile,
cleanup when open a new file,
triangulate quad poly now correctly, more not working, bug from previous version,
next:
fix 5,6,.. triangulation,
triClothMan, IC Helmet, still buggy,
2017-01-02 11:21:32 +00:00
|
|
|
class GeometryEngine : public QObject, protected QOpenGLFunctions
|
2016-12-24 15:03:37 +00:00
|
|
|
{
|
add exe icon,
signal-slot for openFile,
resetView on openFile,
cleanup when open a new file,
triangulate quad poly now correctly, more not working, bug from previous version,
next:
fix 5,6,.. triangulation,
triClothMan, IC Helmet, still buggy,
2017-01-02 11:21:32 +00:00
|
|
|
Q_OBJECT
|
|
|
|
|
2016-12-24 15:03:37 +00:00
|
|
|
public:
|
2017-01-04 13:35:27 +00:00
|
|
|
GeometryEngine(QObject *parent = Q_NULLPTR);
|
2016-12-29 12:37:15 +00:00
|
|
|
virtual ~GeometryEngine();
|
2016-12-24 15:03:37 +00:00
|
|
|
|
2017-01-28 15:54:36 +00:00
|
|
|
// attributes
|
2016-12-24 15:03:37 +00:00
|
|
|
private:
|
2016-12-29 13:06:25 +00:00
|
|
|
QOpenGLBuffer m_arrayBuf;
|
|
|
|
QOpenGLBuffer m_indexBuf;
|
2017-01-15 11:26:15 +00:00
|
|
|
QVector<Material>* m_materials = Q_NULLPTR;
|
2017-01-20 15:26:58 +00:00
|
|
|
Material* m_defaultMaterial;
|
2017-01-28 15:54:36 +00:00
|
|
|
BoundingBox m_boundings;
|
|
|
|
QVector<DrawInformation> m_drawList;
|
2016-12-30 11:36:05 +00:00
|
|
|
|
2017-01-28 15:54:36 +00:00
|
|
|
// functions
|
|
|
|
private:
|
add exe icon,
signal-slot for openFile,
resetView on openFile,
cleanup when open a new file,
triangulate quad poly now correctly, more not working, bug from previous version,
next:
fix 5,6,.. triangulation,
triClothMan, IC Helmet, still buggy,
2017-01-02 11:21:32 +00:00
|
|
|
void clearData();
|
2017-02-05 15:57:12 +00:00
|
|
|
void setupPipeline(QOpenGLShaderProgram * program);
|
2016-12-29 12:37:15 +00:00
|
|
|
|
2017-01-28 15:54:36 +00:00
|
|
|
public:
|
2017-01-29 23:02:32 +00:00
|
|
|
void drawGeometry(QOpenGLShaderProgram *program);
|
2017-01-07 14:59:16 +00:00
|
|
|
void loadFile(QString filePath);
|
add exe icon,
signal-slot for openFile,
resetView on openFile,
cleanup when open a new file,
triangulate quad poly now correctly, more not working, bug from previous version,
next:
fix 5,6,.. triangulation,
triClothMan, IC Helmet, still buggy,
2017-01-02 11:21:32 +00:00
|
|
|
|
2017-01-28 15:54:36 +00:00
|
|
|
// signals
|
add exe icon,
signal-slot for openFile,
resetView on openFile,
cleanup when open a new file,
triangulate quad poly now correctly, more not working, bug from previous version,
next:
fix 5,6,.. triangulation,
triClothMan, IC Helmet, still buggy,
2017-01-02 11:21:32 +00:00
|
|
|
signals:
|
|
|
|
void requestResetView();
|
2017-01-04 13:35:27 +00:00
|
|
|
void requestUpdate();
|
2016-12-24 15:03:37 +00:00
|
|
|
};
|
|
|
|
|