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
547955fa
Commit
547955fa
authored
Aug 25, 2016
by
Philipp Adolf
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Also use categories for info, warning, critical
parent
f4a2cb8f
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
18 additions
and
18 deletions
+18
-18
mesh.cpp
QTProject/mesh.cpp
+3
-3
subdivision.cpp
QTProject/subdivision.cpp
+15
-15
No files found.
QTProject/mesh.cpp
View file @
547955fa
...
...
@@ -182,7 +182,7 @@ Mesh::Mesh(QOpenGLFunctions_4_3_Core *f,QString fileName)
}
}
else
{
q
Warning
(
)
<<
"No Mesh found"
;
q
CWarning
(
log_mesh
)
<<
"No Mesh found"
;
return
;
}
...
...
@@ -345,7 +345,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
].
hasTexture
=
true
;
}
else
{
q
Warning
(
)
<<
"Warning No Texture"
;
q
CWarning
(
log_mesh
)
<<
"Warning No Texture"
;
materials
[
i
].
hasTexture
=
false
;
}
}
...
...
@@ -391,7 +391,7 @@ void Mesh::render(QOpenGLShaderProgram *shader, QMatrix4x4 V,QMatrix4x4 P, int s
if
(
!
loaded
)
return
;
if
(
f
==
NULL
){
qC
ritical
(
)
<<
"OpenGL functions == null"
;
qC
Critical
(
log_mesh
)
<<
"OpenGL functions == null"
;
return
;
}
...
...
QTProject/subdivision.cpp
View file @
547955fa
...
...
@@ -23,10 +23,10 @@ void Subdivision::init() {
}
QOpenGLShaderProgram
*
Subdivision
::
initComputeShaderProgram
(
QString
&
source
){
q
Info
(
)
<<
"Compiling compute shader ..."
;
q
CInfo
(
log_subdiv
)
<<
"Compiling compute shader ..."
;
QOpenGLShader
*
computeShader
=
new
QOpenGLShader
(
QOpenGLShader
::
Compute
);
if
(
!
computeShader
->
compileSourceFile
(
source
)){
qC
ritical
(
)
<<
"Compute Shader"
<<
source
<<
"failed"
<<
computeShader
->
log
();
qC
Critical
(
log_subdiv
)
<<
"Compute Shader"
<<
source
<<
"failed"
<<
computeShader
->
log
();
exit
(
5
);
}
...
...
@@ -35,7 +35,7 @@ QOpenGLShaderProgram *Subdivision::initComputeShaderProgram(QString &source){
shader
->
addShader
(
computeShader
);
qCDebug
(
log_subdiv
)
<<
"Linking compute shader ..."
;
if
(
!
shader
->
link
()){
qC
ritical
(
)
<<
"Linking compute shader failed:"
<<
shader
->
log
();
qC
Critical
(
log_subdiv
)
<<
"Linking compute shader failed:"
<<
shader
->
log
();
exit
(
5
);
}
qCDebug
(
log_subdiv
)
<<
"Linking compute shader done"
;
...
...
@@ -49,7 +49,7 @@ void Subdivision::subdivide(Mesh *mesh, int level) {
int
first_mesh_index
=
-
1
;
if
(
!
root
.
getFirstMeshIndex
(
first_mesh_index
))
{
qC
ritical
(
)
<<
"No mesh found, aborting subdivision"
;
qC
Critical
(
log_subdiv
)
<<
"No mesh found, aborting subdivision"
;
return
;
}
...
...
@@ -58,7 +58,7 @@ void Subdivision::subdivide(Mesh *mesh, int level) {
Input
input
;
int
currentMax
=
current_mesh
->
buffers
.
size
()
-
1
;
q
Info
(
)
<<
"Subdiv Level"
<<
level
<<
"Requested. Current Max:"
<<
currentMax
;
q
CInfo
(
log_subdiv
)
<<
"Subdiv Level"
<<
level
<<
"Requested. Current Max:"
<<
currentMax
;
if
(
level
<=
currentMax
)
return
;
...
...
@@ -103,7 +103,7 @@ void insert_edge(QMap<Triangle, QVector<Triangle::Edge>> &opposite_edges, const
edges
[
2
]
=
edge_b
;
break
;
default
:
q
Warning
(
)
<<
"got"
<<
edge_a
.
name
<<
"as edge!"
;
q
CWarning
(
log_subdiv
)
<<
"got"
<<
edge_a
.
name
<<
"as edge!"
;
break
;
}
opposite_edges
.
insert
(
triangle
,
edges
);
...
...
@@ -334,7 +334,7 @@ Subdivision::Tables Subdivision::precomputeTables(Input input) {
qCDebug
(
log_subdiv
)
<<
duplicates
[
i
];
}
tables
.
index_regular
=
getPatchIndexBuffer
(
ib
);
q
Info
(
)
<<
"Precompute Tables Done"
;
q
CInfo
(
log_subdiv
)
<<
"Precompute Tables Done"
;
return
tables
;
}
...
...
@@ -343,7 +343,7 @@ void Subdivision::splitRegular(Mesh *mesh) {
int
first_mesh_index
=
-
1
;
if
(
!
root
.
getFirstMeshIndex
(
first_mesh_index
))
{
qC
ritical
(
)
<<
"No mesh found, aborting subdivision"
;
qC
Critical
(
log_subdiv
)
<<
"No mesh found, aborting subdivision"
;
return
;
}
...
...
@@ -403,7 +403,7 @@ QVector<unsigned int> Subdivision::getPatchIndexBuffer(QVector<unsigned int> ib)
}
}
if
(
count3
!=
5
||
count6
!=
5
||
count7
!=
5
){
q
Warning
(
)
<<
"Counts wrong! 3: "
<<
count3
<<
", 6: "
<<
count6
<<
", 7: "
<<
count7
;
q
CWarning
(
log_subdiv
)
<<
"Counts wrong! 3: "
<<
count3
<<
", 6: "
<<
count6
<<
", 7: "
<<
count7
;
}
...
...
@@ -426,7 +426,7 @@ QVector<unsigned int> Subdivision::getPatchIndexBuffer(QVector<unsigned int> ib)
}
if
(
!
(
found36
&&
found67
&&
found73
)){
q
Warning
(
)
<<
"Didnt find neighbour. duplicate vertex? Abort."
;
q
CWarning
(
log_subdiv
)
<<
"Didnt find neighbour. duplicate vertex? Abort."
;
return
pib
;
}
}
...
...
@@ -460,12 +460,12 @@ QVector<unsigned int> Subdivision::getPatchIndexBuffer(QVector<unsigned int> ib)
found11
|=
matchAndCompleteTriangle
(
j0
,
j1
,
j2
,
i7
,
i10
,
i11
);
}
if
(
!
(
found0
&&
found1
&&
found5
&&
found9
&&
found8
&&
found11
)){
q
Warning
(
)
<<
"Couldnt find some neighbour at i= "
<<
i
;
q
Warning
(
)
<<
found0
<<
found1
<<
found5
<<
found9
<<
found8
<<
found11
;
q
Warning
(
)
<<
"Abort computing patch index buffer."
;
q
CWarning
(
log_subdiv
)
<<
"Couldnt find some neighbour at i= "
<<
i
;
q
CWarning
(
log_subdiv
)
<<
found0
<<
found1
<<
found5
<<
found9
<<
found8
<<
found11
;
q
CWarning
(
log_subdiv
)
<<
"Abort computing patch index buffer."
;
return
pib
;
}
//else q
Warning(
) << "found all neighbours for patch.";
//else q
CWarning(log_subdiv
) << "found all neighbours for patch.";
pib
.
push_back
(
i0
);
pib
.
push_back
(
i1
);
pib
.
push_back
(
i2
);
...
...
@@ -543,7 +543,7 @@ bool Subdivision::matchAndCompleteTriangle(unsigned int sx, unsigned int sy, uns
}
Subdivision
::
Result
Subdivision
::
runShader
(
Input
input
,
Tables
&
tables
)
{
q
Info
(
)
<<
"Running compute shader"
;
q
CInfo
(
log_subdiv
)
<<
"Running compute shader"
;
Result
result
;
...
...
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