changed everything from std to qt

This commit is contained in:
Anakin
2017-02-02 14:44:48 +01:00
parent 5372838420
commit 8346e5916d
4 changed files with 141 additions and 128 deletions

View File

@@ -1,6 +1,6 @@
#pragma once
#include <QOpenGlTexture>
#include <fstream>
#include <QFile>
#include <QVector>
#include <QVector2D>
#include <QMatrix4x4>
@@ -21,17 +21,17 @@ struct VertexData
};
struct Segment {
std::uint32_t textureIndex = 0;
quint32 textureIndex = 0;
QVector<VertexData> vertices;
QVector<GLuint> indices;
};
struct Model {
std::string name = "";
std::string parent = "";
QString name = "";
QString parent = "";
QMatrix4x4 m4x4Translation;
QQuaternion quadRotation;
std::vector<Segment*> segmList;
QVector<Segment*> segmList;
};
struct Material {
@@ -48,8 +48,8 @@ struct Material {
float shininess = 80;
bool flags[8] = { false };
bool transparent = false;
std::uint8_t rendertype = 0;
std::uint8_t dataValues[2] = { 0 };
quint8 rendertype = 0;
quint8 dataValues[2] = { 0 };
};
class FileInterface
@@ -61,9 +61,9 @@ public:
, m_materials(new QVector<Material>)
{
//open file
m_file.open(path.toStdString().c_str(), std::ios::in | std::ios::binary);
m_file.setFileName(path);
if (!m_file.is_open())
if (!m_file.open(QIODevice::ReadOnly))
throw std::invalid_argument(std::string("ERROR: file not found: ") += path.toStdString());
m_filepath = path.left(path.lastIndexOf(QRegExp("/|\\\\")));
@@ -94,7 +94,7 @@ public:
protected:
QVector<Model*>* m_models;
std::fstream m_file;
QFile m_file;
QVector<Material>* m_materials;
BoundingBox m_sceneBbox;
QString m_filepath;