-
Notifications
You must be signed in to change notification settings - Fork 0
/
ImportFormat.hpp
51 lines (40 loc) · 1.17 KB
/
ImportFormat.hpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
#pragma once
#include <QRegularExpression>
#include <QVector2D>
#include <QVector3D>
#include <vector>
#include <Qt3DCore/QEntity>
#include <Qt3DRender/QAttribute>
using Qt3DRender::QAttribute;
using Qt3DCore::QEntity;
class ImportFormat {
public:
ImportFormat();
virtual ~ImportFormat();
void fillBuffers();
void loadFile(const std::string&);
void addGeometryToModel(QEntity*);
protected:
virtual void importPositionData() = 0;
virtual void importTextureCoordsData() = 0;
virtual void importNormalsData() = 0;
virtual void importFacesData() = 0;
protected:
QRegularExpression positionRegex;
QString positionRegexMatchGroup;
QRegularExpression texCoordsRegex;
QString texCoordsRegexMatchGroup;
QRegularExpression normalRegex;
QString normalRegexMatchGroup;
QRegularExpression facesRegex;
QString facesRegexMatchGroup;
QString dataFromFile;
std::vector<QVector3D> vertices;
std::vector<QVector2D> textures;
std::vector<QVector3D> normals;
std::vector<unsigned short> faces;
std::vector<unsigned short> indices;
uint8_t vertexSize {0};
uint8_t textureSize {0};
uint8_t normalSize {0};
};