Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
U
Unterteilungsalgorithmen
Project
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
3
Issues
3
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Kai Westerkamp
Unterteilungsalgorithmen
Commits
2799525e
Commit
2799525e
authored
Aug 25, 2016
by
Philipp Adolf
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Change log level of some qDebug messages
parent
7dd34947
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
53 additions
and
53 deletions
+53
-53
mainwidget.cpp
QTProject/mainwidget.cpp
+1
-1
mesh.cpp
QTProject/mesh.cpp
+19
-19
subdivision.cpp
QTProject/subdivision.cpp
+26
-26
texture.cpp
QTProject/texture.cpp
+6
-6
triangle.cpp
QTProject/triangle.cpp
+1
-1
No files found.
QTProject/mainwidget.cpp
View file @
2799525e
...
@@ -194,7 +194,7 @@ QOpenGLShaderProgram* MainWidget::initShaderProgram(QString vertSource, QString
...
@@ -194,7 +194,7 @@ QOpenGLShaderProgram* MainWidget::initShaderProgram(QString vertSource, QString
qCritical
()
<<
"Linking shader failed:"
<<
shader
->
log
();
qCritical
()
<<
"Linking shader failed:"
<<
shader
->
log
();
exit
(
5
);
exit
(
5
);
}
}
q
Debug
()
<<
"Linking Shader done"
;
q
Info
()
<<
"Linking Shader done"
;
return
shader
;
return
shader
;
...
...
QTProject/mesh.cpp
View file @
2799525e
...
@@ -9,7 +9,7 @@ Mesh::SubdivEntry::SubdivEntry()
...
@@ -9,7 +9,7 @@ Mesh::SubdivEntry::SubdivEntry()
Mesh
::
SubdivEntry
::~
SubdivEntry
()
Mesh
::
SubdivEntry
::~
SubdivEntry
()
{
{
qDebug
()
<<
"FIXME: Delete Called: num vertex:"
<<
vertices
.
size
();
qDebug
()
<<
"FIXME: Delete Called: num vertex:"
<<
vertices
.
size
();
/*f->glDeleteBuffers(1, &VB_handle);
/*f->glDeleteBuffers(1, &VB_handle);
f->glDeleteBuffers(1, &IB_irregular_handle);
f->glDeleteBuffers(1, &IB_irregular_handle);
f->glDeleteBuffers(1, &IB_regular_handle);
f->glDeleteBuffers(1, &IB_regular_handle);
...
@@ -149,10 +149,10 @@ Mesh::Mesh(QOpenGLFunctions_4_3_Core *f,QString fileName)
...
@@ -149,10 +149,10 @@ Mesh::Mesh(QOpenGLFunctions_4_3_Core *f,QString fileName)
aiProcess_Triangulate
aiProcess_Triangulate
);
);
qDebug
()
<<
"File Read"
;
qDebug
()
<<
"File Read"
;
if
(
!
scene
)
if
(
!
scene
)
{
{
qDebug
()
<<
importer
.
GetErrorString
();
qDebug
()
<<
importer
.
GetErrorString
();
}
else
{
}
else
{
QString
dir
=
QFileInfo
(
fileName
).
path
();
QString
dir
=
QFileInfo
(
fileName
).
path
();
...
@@ -166,10 +166,10 @@ Mesh::Mesh(QOpenGLFunctions_4_3_Core *f,QString fileName)
...
@@ -166,10 +166,10 @@ Mesh::Mesh(QOpenGLFunctions_4_3_Core *f,QString fileName)
material
->
Get
(
AI_MATKEY_NAME
,
mname
);
material
->
Get
(
AI_MATKEY_NAME
,
mname
);
initMaterial
(
dir
,
i
,
material
);
initMaterial
(
dir
,
i
,
material
);
qDebug
()
<<
"Loaded Material"
<<
(
i
+
1
)
<<
"/"
<<
scene
->
mNumMaterials
<<
":"
<<
mname
.
C_Str
()
<<
"Shininess"
<<
materials
[
i
].
Shininess
;
qDebug
()
<<
"Loaded Material"
<<
(
i
+
1
)
<<
"/"
<<
scene
->
mNumMaterials
<<
":"
<<
mname
.
C_Str
()
<<
"Shininess"
<<
materials
[
i
].
Shininess
;
}
}
}
}
qDebug
()
<<
"Materials Read"
;
qDebug
()
<<
"Materials Read"
;
//Init Mesh
//Init Mesh
if
(
scene
->
HasMeshes
())
if
(
scene
->
HasMeshes
())
...
@@ -181,11 +181,11 @@ Mesh::Mesh(QOpenGLFunctions_4_3_Core *f,QString fileName)
...
@@ -181,11 +181,11 @@ Mesh::Mesh(QOpenGLFunctions_4_3_Core *f,QString fileName)
}
}
}
else
{
}
else
{
qWarning
()
<<
"No Mesh found"
;
qWarning
()
<<
"No Mesh found"
;
return
;
return
;
}
}
qDebug
()
<<
"Mesh Read"
;
qDebug
()
<<
"Mesh Read"
;
//init Nodes
//init Nodes
if
(
scene
->
mRootNode
!=
NULL
)
if
(
scene
->
mRootNode
!=
NULL
)
...
@@ -200,9 +200,9 @@ Mesh::Mesh(QOpenGLFunctions_4_3_Core *f,QString fileName)
...
@@ -200,9 +200,9 @@ Mesh::Mesh(QOpenGLFunctions_4_3_Core *f,QString fileName)
{
{
rootNode
.
meshes
[
i
]
=
i
;
rootNode
.
meshes
[
i
]
=
i
;
}
}
qDebug
()
<<
"No Root Node"
;
qDebug
()
<<
"No Root Node"
;
}
}
qDebug
()
<<
"Nodes Read"
;
qDebug
()
<<
"Nodes Read"
;
globalInverseTransform
=
rootNode
.
transformation
.
inverted
();
globalInverseTransform
=
rootNode
.
transformation
.
inverted
();
...
@@ -211,7 +211,7 @@ Mesh::Mesh(QOpenGLFunctions_4_3_Core *f,QString fileName)
...
@@ -211,7 +211,7 @@ Mesh::Mesh(QOpenGLFunctions_4_3_Core *f,QString fileName)
QVector3D
max
=
QVector3D
(
-
amax
,
-
amax
,
-
amax
);
QVector3D
max
=
QVector3D
(
-
amax
,
-
amax
,
-
amax
);
findObjectDimension
(
rootNode
,
QMatrix4x4
(),
min
,
max
);
findObjectDimension
(
rootNode
,
QMatrix4x4
(),
min
,
max
);
qDebug
()
<<
"AABB"
<<
min
<<
max
;
qDebug
()
<<
"AABB"
<<
min
<<
max
;
float
dist
=
qMax
(
max
.
x
()
-
min
.
x
(),
qMax
(
max
.
y
()
-
min
.
y
(),
max
.
z
()
-
min
.
z
()));
float
dist
=
qMax
(
max
.
x
()
-
min
.
x
(),
qMax
(
max
.
y
()
-
min
.
y
(),
max
.
z
()
-
min
.
z
()));
float
sc
=
100.0
/
dist
;
float
sc
=
100.0
/
dist
;
...
@@ -256,7 +256,7 @@ Mesh::Mesh(QOpenGLFunctions_4_3_Core *f, Mesh *mesh, QVector<Vertex> &vertex_buf
...
@@ -256,7 +256,7 @@ Mesh::Mesh(QOpenGLFunctions_4_3_Core *f, Mesh *mesh, QVector<Vertex> &vertex_buf
QVector3D
max
=
QVector3D
(
-
amax
,
-
amax
,
-
amax
);
QVector3D
max
=
QVector3D
(
-
amax
,
-
amax
,
-
amax
);
findObjectDimension
(
rootNode
,
QMatrix4x4
(),
min
,
max
);
findObjectDimension
(
rootNode
,
QMatrix4x4
(),
min
,
max
);
qDebug
()
<<
"AABB"
<<
min
<<
max
;
qDebug
()
<<
"AABB"
<<
min
<<
max
;
float
dist
=
qMax
(
max
.
x
()
-
min
.
x
(),
qMax
(
max
.
y
()
-
min
.
y
(),
max
.
z
()
-
min
.
z
()));
float
dist
=
qMax
(
max
.
x
()
-
min
.
x
(),
qMax
(
max
.
y
()
-
min
.
y
(),
max
.
z
()
-
min
.
z
()));
float
sc
=
100.0
/
dist
;
float
sc
=
100.0
/
dist
;
...
@@ -290,16 +290,16 @@ void Mesh::initNode(const aiScene *scene, aiNode *node, Node &newNode,QString de
...
@@ -290,16 +290,16 @@ void Mesh::initNode(const aiScene *scene, aiNode *node, Node &newNode,QString de
newNode
.
transformation
=
QMatrix4x4
(
node
->
mTransformation
[
0
]);
newNode
.
transformation
=
QMatrix4x4
(
node
->
mTransformation
[
0
]);
newNode
.
meshes
.
resize
(
node
->
mNumMeshes
);
newNode
.
meshes
.
resize
(
node
->
mNumMeshes
);
if
(
debug
)
qDebug
()
<<
debugoffset
.
toStdString
().
c_str
()
<<
"NodeName"
<<
newNode
.
name
;
if
(
debug
)
qDebug
()
<<
debugoffset
.
toStdString
().
c_str
()
<<
"NodeName"
<<
newNode
.
name
;
if
(
debug
)
qDebug
()
<<
debugoffset
.
toStdString
().
c_str
()
<<
" NumMeshes"
<<
newNode
.
meshes
.
size
();
if
(
debug
)
qDebug
()
<<
debugoffset
.
toStdString
().
c_str
()
<<
" NumMeshes"
<<
newNode
.
meshes
.
size
();
for
(
uint
i
=
0
;
i
<
node
->
mNumMeshes
;
++
i
)
for
(
uint
i
=
0
;
i
<
node
->
mNumMeshes
;
++
i
)
{
{
newNode
.
meshes
[
i
]
=
node
->
mMeshes
[
i
];
newNode
.
meshes
[
i
]
=
node
->
mMeshes
[
i
];
if
(
debug
)
qDebug
()
<<
debugoffset
.
toStdString
().
c_str
()
<<
" MeshName"
<<
entries
[
newNode
.
meshes
[
i
]].
name
;
if
(
debug
)
qDebug
()
<<
debugoffset
.
toStdString
().
c_str
()
<<
" MeshName"
<<
entries
[
newNode
.
meshes
[
i
]].
name
;
}
}
if
(
debug
)
qDebug
()
<<
debugoffset
.
toStdString
().
c_str
()
<<
" NumChildren"
<<
node
->
mNumChildren
;
if
(
debug
)
qDebug
()
<<
debugoffset
.
toStdString
().
c_str
()
<<
" NumChildren"
<<
node
->
mNumChildren
;
QString
newDebug
=
QString
(
debugoffset
).
append
(
" "
);
QString
newDebug
=
QString
(
debugoffset
).
append
(
" "
);
for
(
uint
i
=
0
;
i
<
node
->
mNumChildren
;
++
i
)
for
(
uint
i
=
0
;
i
<
node
->
mNumChildren
;
++
i
)
{
{
...
@@ -344,7 +344,7 @@ void Mesh::initMaterial(QString dir, unsigned int i, const aiMaterial* material)
...
@@ -344,7 +344,7 @@ void Mesh::initMaterial(QString dir, unsigned int i, const aiMaterial* material)
materials
[
i
].
texture
.
Load
(
GL_TEXTURE_2D
,
QString
(
FullPath
.
c_str
()));
materials
[
i
].
texture
.
Load
(
GL_TEXTURE_2D
,
QString
(
FullPath
.
c_str
()));
materials
[
i
].
hasTexture
=
true
;
materials
[
i
].
hasTexture
=
true
;
}
else
{
}
else
{
q
Debug
()
<<
"Warning No Texture"
;
q
Warning
()
<<
"Warning No Texture"
;
materials
[
i
].
hasTexture
=
false
;
materials
[
i
].
hasTexture
=
false
;
}
}
}
}
...
@@ -381,7 +381,7 @@ void Mesh::initMeshEntry(int index, aiMesh * entry) {
...
@@ -381,7 +381,7 @@ void Mesh::initMeshEntry(int index, aiMesh * entry) {
entries
[
index
].
name
=
entry
->
mName
.
length
!=
0
?
entry
->
mName
.
C_Str
()
:
""
;
entries
[
index
].
name
=
entry
->
mName
.
length
!=
0
?
entry
->
mName
.
C_Str
()
:
""
;
entries
[
index
].
materialIndex
=
entry
->
mMaterialIndex
;
entries
[
index
].
materialIndex
=
entry
->
mMaterialIndex
;
qDebug
()
<<
"Loaded Mesh:"
<<
entries
[
index
].
name
<<
"HasBones:"
<<
entry
->
HasBones
();
qDebug
()
<<
"Loaded Mesh:"
<<
entries
[
index
].
name
<<
"HasBones:"
<<
entry
->
HasBones
();
entries
[
index
].
init
(
f
,
Vertices
,
Indices
);
entries
[
index
].
init
(
f
,
Vertices
,
Indices
);
}
}
...
@@ -390,7 +390,7 @@ void Mesh::render(QOpenGLShaderProgram *shader, QMatrix4x4 V,QMatrix4x4 P, int s
...
@@ -390,7 +390,7 @@ void Mesh::render(QOpenGLShaderProgram *shader, QMatrix4x4 V,QMatrix4x4 P, int s
if
(
!
loaded
)
if
(
!
loaded
)
return
;
return
;
if
(
f
==
NULL
){
if
(
f
==
NULL
){
q
Debug
()
<<
"OpenGL Funktions
= null"
;
q
Critical
()
<<
"OpenGL functions =
= null"
;
return
;
return
;
}
}
...
@@ -429,7 +429,7 @@ void Mesh::renderMesh(QOpenGLShaderProgram *shader, int index, int subdivision,
...
@@ -429,7 +429,7 @@ void Mesh::renderMesh(QOpenGLShaderProgram *shader, int index, int subdivision,
{
{
int
MaterialIndex
=
entries
[
index
].
materialIndex
;
int
MaterialIndex
=
entries
[
index
].
materialIndex
;
if
(
MaterialIndex
<
materials
.
size
())
{
if
(
MaterialIndex
<
materials
.
size
())
{
// qDebug()
<<materials[MaterialIndex].Diffuse<<materials[MaterialIndex].Specular<<materials[MaterialIndex].Shininess<<
materials[MaterialIndex].hasTexture;
// qDebug()
<< materials[MaterialIndex].Diffuse << materials[MaterialIndex].Specular << materials[MaterialIndex].Shininess <<
materials[MaterialIndex].hasTexture;
if
(
regular
)
{
if
(
regular
)
{
shader
->
setUniformValue
(
"materialInfo.Diffuse"
,
QVector3D
(
0.0
f
,
0.0
f
,
1.0
f
));
shader
->
setUniformValue
(
"materialInfo.Diffuse"
,
QVector3D
(
0.0
f
,
0.0
f
,
1.0
f
));
...
...
QTProject/subdivision.cpp
View file @
2799525e
...
@@ -27,22 +27,22 @@ void Subdivision::init() {
...
@@ -27,22 +27,22 @@ void Subdivision::init() {
}
}
QOpenGLShaderProgram
*
Subdivision
::
initComputeShaderProgram
(
QString
&
source
){
QOpenGLShaderProgram
*
Subdivision
::
initComputeShaderProgram
(
QString
&
source
){
q
Debug
()
<<
"Compiling compute shader ..."
;
q
Info
()
<<
"Compiling compute shader ..."
;
QOpenGLShader
*
computeShader
=
new
QOpenGLShader
(
QOpenGLShader
::
Compute
);
QOpenGLShader
*
computeShader
=
new
QOpenGLShader
(
QOpenGLShader
::
Compute
);
if
(
!
computeShader
->
compileSourceFile
(
source
)){
if
(
!
computeShader
->
compileSourceFile
(
source
)){
qCritical
()
<<
"Compute Shader"
<<
source
<<
"failed"
<<
computeShader
->
log
();
qCritical
()
<<
"Compute Shader"
<<
source
<<
"failed"
<<
computeShader
->
log
();
exit
(
5
);
exit
(
5
);
}
}
qDebug
()
<<
"Adding compute shader ..."
;
qDebug
()
<<
"Adding compute shader ..."
;
QOpenGLShaderProgram
*
shader
=
new
QOpenGLShaderProgram
();
QOpenGLShaderProgram
*
shader
=
new
QOpenGLShaderProgram
();
shader
->
addShader
(
computeShader
);
shader
->
addShader
(
computeShader
);
qDebug
()
<<
"Linking compute shader ..."
;
qDebug
()
<<
"Linking compute shader ..."
;
if
(
!
shader
->
link
()){
if
(
!
shader
->
link
()){
qCritical
()
<<
"Linking compute shader failed:"
<<
shader
->
log
();
qCritical
()
<<
"Linking compute shader failed:"
<<
shader
->
log
();
exit
(
5
);
exit
(
5
);
}
}
qDebug
()
<<
"Linking compute shader done"
;
qDebug
()
<<
"Linking compute shader done"
;
return
shader
;
return
shader
;
}
}
...
@@ -53,7 +53,7 @@ void Subdivision::subdivide(Mesh *mesh, int level) {
...
@@ -53,7 +53,7 @@ void Subdivision::subdivide(Mesh *mesh, int level) {
int
first_mesh_index
=
-
1
;
int
first_mesh_index
=
-
1
;
if
(
!
root
.
getFirstMeshIndex
(
first_mesh_index
))
{
if
(
!
root
.
getFirstMeshIndex
(
first_mesh_index
))
{
qCritical
()
<<
"No mesh found, aborting subdivision"
;
qCritical
()
<<
"No mesh found, aborting subdivision"
;
return
;
return
;
}
}
...
@@ -62,7 +62,7 @@ void Subdivision::subdivide(Mesh *mesh, int level) {
...
@@ -62,7 +62,7 @@ void Subdivision::subdivide(Mesh *mesh, int level) {
Input
input
;
Input
input
;
int
currentMax
=
current_mesh
->
buffers
.
size
()
-
1
;
int
currentMax
=
current_mesh
->
buffers
.
size
()
-
1
;
q
Debug
()
<<
"Subdiv Level"
<<
level
<<
"Requested. Current Max:"
<<
currentMax
;
q
Info
()
<<
"Subdiv Level"
<<
level
<<
"Requested. Current Max:"
<<
currentMax
;
if
(
level
<=
currentMax
)
if
(
level
<=
currentMax
)
return
;
return
;
...
@@ -144,11 +144,11 @@ Subdivision::Tables Subdivision::precomputeTables(Input input) {
...
@@ -144,11 +144,11 @@ Subdivision::Tables Subdivision::precomputeTables(Input input) {
QVector
<
unsigned
int
>
ib
=
input
.
index_buffer
;
QVector
<
unsigned
int
>
ib
=
input
.
index_buffer
;
if
(
debugOutput
)
if
(
debugOutput
)
qDebug
()
<<
"Index Buffer: "
<<
ib
;
qDebug
()
<<
"Index Buffer: "
<<
ib
;
QVector
<
Vertex
>
vb
=
input
.
vertex_buffer
;
QVector
<
Vertex
>
vb
=
input
.
vertex_buffer
;
if
(
debugOutput
)
if
(
debugOutput
)
qDebug
()
<<
"Vertex Buffer: "
<<
vb
;
qDebug
()
<<
"Vertex Buffer: "
<<
vb
;
QVector
<
Triangle
>
triangles
;
QVector
<
Triangle
>
triangles
;
for
(
int
i
=
0
;
i
<
ib
.
length
();
i
+=
3
)
{
for
(
int
i
=
0
;
i
<
ib
.
length
();
i
+=
3
)
{
...
@@ -261,12 +261,12 @@ Subdivision::Tables Subdivision::precomputeTables(Input input) {
...
@@ -261,12 +261,12 @@ Subdivision::Tables Subdivision::precomputeTables(Input input) {
tables
.
index_buffer
.
push_back
(
wu
);
tables
.
index_buffer
.
push_back
(
wu
);
}
}
qDebug
()
<<
"Done with edge table. "
<<
tables
.
edge_indices
.
length
();
qDebug
()
<<
"Done with edge table. "
<<
tables
.
edge_indices
.
length
();
if
(
debugOutput
){
if
(
debugOutput
){
qDebug
()
<<
"Eedges found. Table: "
<<
tables
.
edge_indices
;
qDebug
()
<<
"Eedges found. Table: "
<<
tables
.
edge_indices
;
qDebug
()
<<
"Table (long version):"
;
qDebug
()
<<
"Table (long version):"
;
for
(
int
i
=
0
;
i
<
tables
.
edge_indices
.
length
();
i
++
){
for
(
int
i
=
0
;
i
<
tables
.
edge_indices
.
length
();
i
++
){
qDebug
()
<<
"blub:"
<<
tables
.
edge_indices
[
i
];
qDebug
()
<<
"blub:"
<<
tables
.
edge_indices
[
i
];
}
}
}
}
...
@@ -334,15 +334,15 @@ Subdivision::Tables Subdivision::precomputeTables(Input input) {
...
@@ -334,15 +334,15 @@ Subdivision::Tables Subdivision::precomputeTables(Input input) {
tables
.
vertex_offsets
.
push_back
(
offset
);
tables
.
vertex_offsets
.
push_back
(
offset
);
qDebug
()
<<
"Done with vertex index table. "
;
qDebug
()
<<
"Done with vertex index table. "
;
if
(
debugOutput
){
if
(
debugOutput
){
qDebug
()
<<
"Duplicates: "
;
qDebug
()
<<
"Duplicates: "
;
for
(
int
i
=
0
;
i
<
duplicates
.
length
();
i
++
){
for
(
int
i
=
0
;
i
<
duplicates
.
length
();
i
++
){
qDebug
()
<<
duplicates
[
i
];
qDebug
()
<<
duplicates
[
i
];
}
}
}
}
qDebug
()
<<
"Precompute Tables Done"
;
tables
.
index_regular
=
getPatchIndexBuffer
(
ib
);
tables
.
index_regular
=
getPatchIndexBuffer
(
ib
);
qInfo
()
<<
"Precompute Tables Done"
;
return
tables
;
return
tables
;
}
}
...
@@ -351,7 +351,7 @@ void Subdivision::splitRegular(Mesh *mesh) {
...
@@ -351,7 +351,7 @@ void Subdivision::splitRegular(Mesh *mesh) {
int
first_mesh_index
=
-
1
;
int
first_mesh_index
=
-
1
;
if
(
!
root
.
getFirstMeshIndex
(
first_mesh_index
))
{
if
(
!
root
.
getFirstMeshIndex
(
first_mesh_index
))
{
qCritical
()
<<
"No mesh found, aborting subdivision"
;
qCritical
()
<<
"No mesh found, aborting subdivision"
;
return
;
return
;
}
}
...
@@ -411,7 +411,7 @@ QVector<unsigned int> Subdivision::getPatchIndexBuffer(QVector<unsigned int> ib)
...
@@ -411,7 +411,7 @@ QVector<unsigned int> Subdivision::getPatchIndexBuffer(QVector<unsigned int> ib)
}
}
}
}
if
(
count3
!=
5
||
count6
!=
5
||
count7
!=
5
){
if
(
count3
!=
5
||
count6
!=
5
||
count7
!=
5
){
qWarning
()
<<
"Counts wrong! 3: "
<<
count3
<<
", 6: "
<<
count6
<<
", 7: "
<<
count7
;
qWarning
()
<<
"Counts wrong! 3: "
<<
count3
<<
", 6: "
<<
count6
<<
", 7: "
<<
count7
;
}
}
...
@@ -434,7 +434,7 @@ QVector<unsigned int> Subdivision::getPatchIndexBuffer(QVector<unsigned int> ib)
...
@@ -434,7 +434,7 @@ QVector<unsigned int> Subdivision::getPatchIndexBuffer(QVector<unsigned int> ib)
}
}
if
(
!
(
found36
&&
found67
&&
found73
)){
if
(
!
(
found36
&&
found67
&&
found73
)){
qWarning
()
<<
"Didnt find neighbour. duplicate vertex? Abort."
;
qWarning
()
<<
"Didnt find neighbour. duplicate vertex? Abort."
;
return
pib
;
return
pib
;
}
}
}
}
...
@@ -468,12 +468,12 @@ QVector<unsigned int> Subdivision::getPatchIndexBuffer(QVector<unsigned int> ib)
...
@@ -468,12 +468,12 @@ QVector<unsigned int> Subdivision::getPatchIndexBuffer(QVector<unsigned int> ib)
found11
|=
matchAndCompleteTriangle
(
j0
,
j1
,
j2
,
i7
,
i10
,
i11
);
found11
|=
matchAndCompleteTriangle
(
j0
,
j1
,
j2
,
i7
,
i10
,
i11
);
}
}
if
(
!
(
found0
&&
found1
&&
found5
&&
found9
&&
found8
&&
found11
)){
if
(
!
(
found0
&&
found1
&&
found5
&&
found9
&&
found8
&&
found11
)){
qWarning
()
<<
"Couldnt find some neighbour at i= "
<<
i
;
qWarning
()
<<
"Couldnt find some neighbour at i= "
<<
i
;
qWarning
()
<<
found0
<<
found1
<<
found5
<<
found9
<<
found8
<<
found11
;
qWarning
()
<<
found0
<<
found1
<<
found5
<<
found9
<<
found8
<<
found11
;
qWarning
()
<<
"Abort computing patch index buffer."
;
qWarning
()
<<
"Abort computing patch index buffer."
;
return
pib
;
return
pib
;
}
}
//else qWarning()
<<
"found all neighbours for patch.";
//else qWarning()
<<
"found all neighbours for patch.";
pib
.
push_back
(
i0
);
pib
.
push_back
(
i0
);
pib
.
push_back
(
i1
);
pib
.
push_back
(
i1
);
pib
.
push_back
(
i2
);
pib
.
push_back
(
i2
);
...
@@ -551,7 +551,7 @@ bool Subdivision::matchAndCompleteTriangle(unsigned int sx, unsigned int sy, uns
...
@@ -551,7 +551,7 @@ bool Subdivision::matchAndCompleteTriangle(unsigned int sx, unsigned int sy, uns
}
}
Subdivision
::
Result
Subdivision
::
runShader
(
Input
input
,
Tables
&
tables
)
{
Subdivision
::
Result
Subdivision
::
runShader
(
Input
input
,
Tables
&
tables
)
{
q
Debug
()
<<
"Running compute shader"
;
q
Info
()
<<
"Running compute shader"
;
Result
result
;
Result
result
;
...
...
QTProject/texture.cpp
View file @
2799525e
...
@@ -14,11 +14,11 @@ void Texture::Load(GLenum textureTarget, QString fileName)
...
@@ -14,11 +14,11 @@ void Texture::Load(GLenum textureTarget, QString fileName)
//load
//load
if
(
fileName
.
isEmpty
()){
if
(
fileName
.
isEmpty
()){
q
Debug
()
<<
"No Image to load"
;
q
Warning
()
<<
"No Image to load"
;
return
;
return
;
}
}
qDebug
()
<<
"Loading Texture:"
<<
fileName
;
qDebug
()
<<
"Loading Texture:"
<<
fileName
;
QString
suffix
=
QFileInfo
(
fileName
).
completeSuffix
();
QString
suffix
=
QFileInfo
(
fileName
).
completeSuffix
();
...
@@ -29,15 +29,15 @@ void Texture::Load(GLenum textureTarget, QString fileName)
...
@@ -29,15 +29,15 @@ void Texture::Load(GLenum textureTarget, QString fileName)
if
(
!
QFile
::
exists
(
fileName
))
if
(
!
QFile
::
exists
(
fileName
))
{
{
qDebug
()
<<
"File "
<<
fileName
<<
"don't exists"
;
qDebug
()
<<
"File "
<<
fileName
<<
"don't exists"
;
return
;
return
;
}
}
QImage
*
texture
=
new
QImage
(
fileName
,
suffix
.
toStdString
().
c_str
());
QImage
*
texture
=
new
QImage
(
fileName
,
suffix
.
toStdString
().
c_str
());
if
(
texture
==
NULL
||
texture
->
isNull
()){
if
(
texture
==
NULL
||
texture
->
isNull
()){
qDebug
()
<<
"Could not load Texture:"
<<
fileName
<<
"Suffix:"
<<
suffix
;
qDebug
()
<<
"Could not load Texture:"
<<
fileName
<<
"Suffix:"
<<
suffix
;
qDebug
()
<<
QImageReader
::
supportedImageFormats
();
qDebug
()
<<
QImageReader
::
supportedImageFormats
();
return
;
return
;
}
}
...
@@ -55,7 +55,7 @@ void Texture::Load(GLenum textureTarget, QString fileName)
...
@@ -55,7 +55,7 @@ void Texture::Load(GLenum textureTarget, QString fileName)
glBindTexture
(
this
->
textureTarget
,
0
);
glBindTexture
(
this
->
textureTarget
,
0
);
qDebug
()
<<
"Loaded texture"
+
fileName
;
qDebug
()
<<
"Loaded texture"
+
fileName
;
}
}
Texture
::~
Texture
(){
Texture
::~
Texture
(){
...
...
QTProject/triangle.cpp
View file @
2799525e
...
@@ -158,7 +158,7 @@ Triangle::Edge::Name rotate_edge_name(Triangle::Edge::Name edge) {
...
@@ -158,7 +158,7 @@ Triangle::Edge::Name rotate_edge_name(Triangle::Edge::Name edge) {
case
Triangle
:
:
Edge
::
Name
::
wu
:
case
Triangle
:
:
Edge
::
Name
::
wu
:
return
Triangle
::
Edge
::
Name
::
uv
;
return
Triangle
::
Edge
::
Name
::
uv
;
default
:
default
:
q
Debu
g
()
<<
"Default case should be unreachable"
;
q
Warnin
g
()
<<
"Default case should be unreachable"
;
return
Triangle
::
Edge
::
Name
::
uv
;
return
Triangle
::
Edge
::
Name
::
uv
;
}
}
}
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment