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
8 years ago
by
Philipp Adolf
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Also use categories for info, warning, critical
parent
f4a2cb8f
Hide 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)
...
@@ -182,7 +182,7 @@ Mesh::Mesh(QOpenGLFunctions_4_3_Core *f,QString fileName)
}
}
}
else
{
}
else
{
q
Warning
(
)
<<
"No Mesh found"
;
q
CWarning
(
log_mesh
)
<<
"No Mesh found"
;
return
;
return
;
}
}
...
@@ -345,7 +345,7 @@ void Mesh::initMaterial(QString dir, unsigned int i, const aiMaterial* material)
...
@@ -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
].
texture
.
Load
(
GL_TEXTURE_2D
,
QString
(
FullPath
.
c_str
()));
materials
[
i
].
hasTexture
=
true
;
materials
[
i
].
hasTexture
=
true
;
}
else
{
}
else
{
q
Warning
(
)
<<
"Warning No Texture"
;
q
CWarning
(
log_mesh
)
<<
"Warning No Texture"
;
materials
[
i
].
hasTexture
=
false
;
materials
[
i
].
hasTexture
=
false
;
}
}
}
}
...
@@ -391,7 +391,7 @@ void Mesh::render(QOpenGLShaderProgram *shader, QMatrix4x4 V,QMatrix4x4 P, int s
...
@@ -391,7 +391,7 @@ void Mesh::render(QOpenGLShaderProgram *shader, QMatrix4x4 V,QMatrix4x4 P, int s
if
(
!
loaded
)
if
(
!
loaded
)
return
;
return
;
if
(
f
==
NULL
){
if
(
f
==
NULL
){
qC
ritical
(
)
<<
"OpenGL functions == null"
;
qC
Critical
(
log_mesh
)
<<
"OpenGL functions == null"
;
return
;
return
;
}
}
...
...
This diff is collapsed.
Click to expand it.
QTProject/subdivision.cpp
View file @
547955fa
...
@@ -23,10 +23,10 @@ void Subdivision::init() {
...
@@ -23,10 +23,10 @@ void Subdivision::init() {
}
}
QOpenGLShaderProgram
*
Subdivision
::
initComputeShaderProgram
(
QString
&
source
){
QOpenGLShaderProgram
*
Subdivision
::
initComputeShaderProgram
(
QString
&
source
){
q
Info
(
)
<<
"Compiling compute shader ..."
;
q
CInfo
(
log_subdiv
)
<<
"Compiling compute shader ..."
;
QOpenGLShader
*
computeShader
=
new
QOpenGLShader
(
QOpenGLShader
::
Compute
);
QOpenGLShader
*
computeShader
=
new
QOpenGLShader
(
QOpenGLShader
::
Compute
);
if
(
!
computeShader
->
compileSourceFile
(
source
)){
if
(
!
computeShader
->
compileSourceFile
(
source
)){
qC
ritical
(
)
<<
"Compute Shader"
<<
source
<<
"failed"
<<
computeShader
->
log
();
qC
Critical
(
log_subdiv
)
<<
"Compute Shader"
<<
source
<<
"failed"
<<
computeShader
->
log
();
exit
(
5
);
exit
(
5
);
}
}
...
@@ -35,7 +35,7 @@ QOpenGLShaderProgram *Subdivision::initComputeShaderProgram(QString &source){
...
@@ -35,7 +35,7 @@ QOpenGLShaderProgram *Subdivision::initComputeShaderProgram(QString &source){
shader
->
addShader
(
computeShader
);
shader
->
addShader
(
computeShader
);
qCDebug
(
log_subdiv
)
<<
"Linking compute shader ..."
;
qCDebug
(
log_subdiv
)
<<
"Linking compute shader ..."
;
if
(
!
shader
->
link
()){
if
(
!
shader
->
link
()){
qC
ritical
(
)
<<
"Linking compute shader failed:"
<<
shader
->
log
();
qC
Critical
(
log_subdiv
)
<<
"Linking compute shader failed:"
<<
shader
->
log
();
exit
(
5
);
exit
(
5
);
}
}
qCDebug
(
log_subdiv
)
<<
"Linking compute shader done"
;
qCDebug
(
log_subdiv
)
<<
"Linking compute shader done"
;
...
@@ -49,7 +49,7 @@ void Subdivision::subdivide(Mesh *mesh, int level) {
...
@@ -49,7 +49,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
))
{
qC
ritical
(
)
<<
"No mesh found, aborting subdivision"
;
qC
Critical
(
log_subdiv
)
<<
"No mesh found, aborting subdivision"
;
return
;
return
;
}
}
...
@@ -58,7 +58,7 @@ void Subdivision::subdivide(Mesh *mesh, int level) {
...
@@ -58,7 +58,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
Info
(
)
<<
"Subdiv Level"
<<
level
<<
"Requested. Current Max:"
<<
currentMax
;
q
CInfo
(
log_subdiv
)
<<
"Subdiv Level"
<<
level
<<
"Requested. Current Max:"
<<
currentMax
;
if
(
level
<=
currentMax
)
if
(
level
<=
currentMax
)
return
;
return
;
...
@@ -103,7 +103,7 @@ void insert_edge(QMap<Triangle, QVector<Triangle::Edge>> &opposite_edges, const
...
@@ -103,7 +103,7 @@ void insert_edge(QMap<Triangle, QVector<Triangle::Edge>> &opposite_edges, const
edges
[
2
]
=
edge_b
;
edges
[
2
]
=
edge_b
;
break
;
break
;
default
:
default
:
q
Warning
(
)
<<
"got"
<<
edge_a
.
name
<<
"as edge!"
;
q
CWarning
(
log_subdiv
)
<<
"got"
<<
edge_a
.
name
<<
"as edge!"
;
break
;
break
;
}
}
opposite_edges
.
insert
(
triangle
,
edges
);
opposite_edges
.
insert
(
triangle
,
edges
);
...
@@ -334,7 +334,7 @@ Subdivision::Tables Subdivision::precomputeTables(Input input) {
...
@@ -334,7 +334,7 @@ Subdivision::Tables Subdivision::precomputeTables(Input input) {
qCDebug
(
log_subdiv
)
<<
duplicates
[
i
];
qCDebug
(
log_subdiv
)
<<
duplicates
[
i
];
}
}
tables
.
index_regular
=
getPatchIndexBuffer
(
ib
);
tables
.
index_regular
=
getPatchIndexBuffer
(
ib
);
q
Info
(
)
<<
"Precompute Tables Done"
;
q
CInfo
(
log_subdiv
)
<<
"Precompute Tables Done"
;
return
tables
;
return
tables
;
}
}
...
@@ -343,7 +343,7 @@ void Subdivision::splitRegular(Mesh *mesh) {
...
@@ -343,7 +343,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
))
{
qC
ritical
(
)
<<
"No mesh found, aborting subdivision"
;
qC
Critical
(
log_subdiv
)
<<
"No mesh found, aborting subdivision"
;
return
;
return
;
}
}
...
@@ -403,7 +403,7 @@ QVector<unsigned int> Subdivision::getPatchIndexBuffer(QVector<unsigned int> ib)
...
@@ -403,7 +403,7 @@ QVector<unsigned int> Subdivision::getPatchIndexBuffer(QVector<unsigned int> ib)
}
}
}
}
if
(
count3
!=
5
||
count6
!=
5
||
count7
!=
5
){
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)
...
@@ -426,7 +426,7 @@ QVector<unsigned int> Subdivision::getPatchIndexBuffer(QVector<unsigned int> ib)
}
}
if
(
!
(
found36
&&
found67
&&
found73
)){
if
(
!
(
found36
&&
found67
&&
found73
)){
q
Warning
(
)
<<
"Didnt find neighbour. duplicate vertex? Abort."
;
q
CWarning
(
log_subdiv
)
<<
"Didnt find neighbour. duplicate vertex? Abort."
;
return
pib
;
return
pib
;
}
}
}
}
...
@@ -460,12 +460,12 @@ QVector<unsigned int> Subdivision::getPatchIndexBuffer(QVector<unsigned int> ib)
...
@@ -460,12 +460,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
)){
q
Warning
(
)
<<
"Couldnt find some neighbour at i= "
<<
i
;
q
CWarning
(
log_subdiv
)
<<
"Couldnt find some neighbour at i= "
<<
i
;
q
Warning
(
)
<<
found0
<<
found1
<<
found5
<<
found9
<<
found8
<<
found11
;
q
CWarning
(
log_subdiv
)
<<
found0
<<
found1
<<
found5
<<
found9
<<
found8
<<
found11
;
q
Warning
(
)
<<
"Abort computing patch index buffer."
;
q
CWarning
(
log_subdiv
)
<<
"Abort computing patch index buffer."
;
return
pib
;
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
(
i0
);
pib
.
push_back
(
i1
);
pib
.
push_back
(
i1
);
pib
.
push_back
(
i2
);
pib
.
push_back
(
i2
);
...
@@ -543,7 +543,7 @@ bool Subdivision::matchAndCompleteTriangle(unsigned int sx, unsigned int sy, uns
...
@@ -543,7 +543,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
Info
(
)
<<
"Running compute shader"
;
q
CInfo
(
log_subdiv
)
<<
"Running compute shader"
;
Result
result
;
Result
result
;
...
...
This diff is collapsed.
Click to expand it.
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