ProjectedTextures
Prototype software for spacial augmented reality applications.
Main Page
Namespaces
Classes
Files
File List
File Members
All
Classes
Namespaces
Files
Functions
Variables
Enumerations
Enumerator
Macros
ShaderLamps
src
Geometry.h
Go to the documentation of this file.
1
#pragma once
2
3
#include <assimp/Importer.hpp>
4
#include <assimp/scene.h>
5
#include <assimp/postprocess.h>
6
#include <assimp/mesh.h>
7
8
#include <QVector>
9
#include <QVector2D>
10
#include <QVector3D>
11
#include <QMatrix4x4>
12
#include <QOpenGLFunctions>
13
#include <QThread>
14
15
#include "
Trackable.h
"
16
17
22
class
SceneDestroyer
:
23
public
QThread
24
{
25
public
:
26
SceneDestroyer
(Assimp::Importer*
importer
) : importer(importer){}
27
~SceneDestroyer
(
void
){}
28
29
protected
:
30
Assimp::Importer*
importer
;
31
void
run
(){
32
importer
->FreeScene();
33
}
34
};
35
36
40
struct
ColorSetInfo
{
41
QString
name
;
42
QMap<QString, QString>
legend
;
43
};
44
45
49
class
Geometry
:
50
public
Trackable
51
{
52
53
Q_OBJECT
54
55
public
:
62
Geometry
(QString
name
, QString
filename
, QVector<ColorSetInfo>
colorSetInfos
,
bool
renderOnProjector
=
true
);
63
~Geometry
(
void
);
64
65
//setters
70
void
setInherentTransform
(
Similarity
inherentTransform
){this->inherentTransform =
inherentTransform
;}
71
72
//getters
73
QString
getName
(){
return
name
;}
74
QString
getFilename
(
bool
wholePath);
76
bool
isValid
(){
return
valid
;}
78
bool
isRenderedOnProjector
(){
return
renderOnProjector
;}
79
int
getActiveColorSet
(){
return
activeColorSet
;}
82
QMatrix4x4
getModelMatrix
();
84
Similarity
getInherentTransform
(){
return
inherentTransform
;}
87
QVector<QVector4D>*
getPositions
(){
return
&
positions
;}
88
QVector<QVector3D>*
getNormals
(){
return
&
normals
;}
89
QVector<QVector2D>*
getUvs
(){
return
&
uvs
;}
90
QVector<GLuint>*
getIndices
(){
return
&
indices
;}
91
QVector<QVector4D>*
getVertexColors
(
int
layer);
93
QVector<ColorSetInfo>*
getColorSetInfos
(){
return
&
colorSetInfos
;}
95
bool
hasNormals
(){
return
!
normals
.isEmpty();}
96
bool
hasUvs
(){
return
!
uvs
.isEmpty();}
97
bool
hasVertexColors
(){
return
!
vertexColors
.isEmpty();}
99
int
numVertices
(){
return
positions
.size();}
100
int
numIndices
(){
return
indices
.size();}
101
int
numColorSets
(){
return
vertexColors
.size();}
105
protected
:
106
QString
name
;
107
QString
filename
;
109
Assimp::Importer
importer
;
110
SceneDestroyer
*
sd
;
112
bool
valid
;
113
bool
renderOnProjector
;
114
QVector<QVector4D>
positions
;
115
QVector<QVector3D>
normals
;
116
QVector<QVector2D>
uvs
;
117
QVector<GLuint>
indices
;
118
QVector<QVector<QVector4D>>
vertexColors
;
119
QVector<ColorSetInfo>
colorSetInfos
;
121
Similarity
inherentTransform
;
124
int
activeColorSet
;
126
void
freeAssimpScene
(){
importer
.FreeScene();}
131
public
slots:
132
void
scale
(
float
factor);
133
void
setScale
(
float
absScale);
134
void
setTranslation
(
float
x,
float
y,
float
z);
135
void
setRotation
(QQuaternion rotation);
136
void
setRotation
(
float
x,
float
y,
float
z);
137
void
setActiveColorSet
(
int
layer);
138
};
Generated on Fri Feb 19 2016 11:04:41 for ProjectedTextures by
1.8.4