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
3368c442
Commit
3368c442
authored
Aug 25, 2016
by
Philipp Adolf
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Remove debugOutput variable
parent
d737b96a
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
13 additions
and
38 deletions
+13
-38
mainwidget.cpp
QTProject/mainwidget.cpp
+0
-6
mainwidget.h
QTProject/mainwidget.h
+0
-1
subdivision.cpp
QTProject/subdivision.cpp
+13
-28
subdivision.h
QTProject/subdivision.h
+0
-3
No files found.
QTProject/mainwidget.cpp
View file @
3368c442
...
@@ -158,12 +158,6 @@ void MainWidget::subdivide(int level){
...
@@ -158,12 +158,6 @@ void MainWidget::subdivide(int level){
}
}
void
MainWidget
::
setdebugOutput
(
bool
output
){
subdivision
->
setDebugOutbut
(
output
);
}
void
MainWidget
::
setRotation
(
bool
started
){
void
MainWidget
::
setRotation
(
bool
started
){
qDebug
()
<<
"rotation"
<<
started
;
qDebug
()
<<
"rotation"
<<
started
;
this
->
rotation
=
started
;
this
->
rotation
=
started
;
...
...
QTProject/mainwidget.h
View file @
3368c442
...
@@ -35,7 +35,6 @@ public slots:
...
@@ -35,7 +35,6 @@ public slots:
void
setRotation
(
bool
started
);
void
setRotation
(
bool
started
);
void
setWireframe
(
bool
active
);
void
setWireframe
(
bool
active
);
void
subdivide
(
int
level
);
void
subdivide
(
int
level
);
void
setdebugOutput
(
bool
output
);
protected
:
protected
:
void
initializeGL
();
void
initializeGL
();
...
...
QTProject/subdivision.cpp
View file @
3368c442
...
@@ -7,7 +7,6 @@
...
@@ -7,7 +7,6 @@
Subdivision
::
Subdivision
(
QOpenGLFunctions_4_3_Core
*
f
)
Subdivision
::
Subdivision
(
QOpenGLFunctions_4_3_Core
*
f
)
{
{
this
->
f
=
f
;
this
->
f
=
f
;
debugOutput
=
false
;
}
}
Subdivision
::~
Subdivision
()
Subdivision
::~
Subdivision
()
...
@@ -15,10 +14,6 @@ Subdivision::~Subdivision()
...
@@ -15,10 +14,6 @@ Subdivision::~Subdivision()
delete
edgeShader
;
delete
edgeShader
;
}
}
void
Subdivision
::
setDebugOutbut
(
bool
debug
){
this
->
debugOutput
=
debug
;
}
void
Subdivision
::
init
()
{
void
Subdivision
::
init
()
{
QString
source
=
QLatin1String
(
":/subdivision-edge.compute"
);
QString
source
=
QLatin1String
(
":/subdivision-edge.compute"
);
edgeShader
=
initComputeShaderProgram
(
source
);
edgeShader
=
initComputeShaderProgram
(
source
);
...
@@ -144,12 +139,10 @@ Subdivision::Tables Subdivision::precomputeTables(Input input) {
...
@@ -144,12 +139,10 @@ Subdivision::Tables Subdivision::precomputeTables(Input input) {
Tables
tables
;
Tables
tables
;
QVector
<
unsigned
int
>
ib
=
input
.
index_buffer
;
QVector
<
unsigned
int
>
ib
=
input
.
index_buffer
;
if
(
debugOutput
)
qCDebug
(
log_subdiv
)
<<
"Index Buffer: "
<<
ib
;
qCDebug
(
log_subdiv
)
<<
"Index Buffer: "
<<
ib
;
QVector
<
Vertex
>
vb
=
input
.
vertex_buffer
;
QVector
<
Vertex
>
vb
=
input
.
vertex_buffer
;
if
(
debugOutput
)
qCDebug
(
log_subdiv
)
<<
"Vertex Buffer: "
<<
vb
;
qCDebug
(
log_subdiv
)
<<
"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
)
{
...
@@ -263,12 +256,10 @@ Subdivision::Tables Subdivision::precomputeTables(Input input) {
...
@@ -263,12 +256,10 @@ Subdivision::Tables Subdivision::precomputeTables(Input input) {
}
}
qCDebug
(
log_subdiv
)
<<
"Done with edge table. "
<<
tables
.
edge_indices
.
length
();
qCDebug
(
log_subdiv
)
<<
"Done with edge table. "
<<
tables
.
edge_indices
.
length
();
if
(
debugOutput
){
qCDebug
(
log_subdiv
)
<<
"Eedges found. Table: "
<<
tables
.
edge_indices
;
qCDebug
(
log_subdiv
)
<<
"Eedges found. Table: "
<<
tables
.
edge_indices
;
qCDebug
(
log_subdiv
)
<<
"Table (long version):"
;
qCDebug
(
log_subdiv
)
<<
"Table (long version):"
;
for
(
int
i
=
0
;
i
<
tables
.
edge_indices
.
length
();
i
++
){
for
(
int
i
=
0
;
i
<
tables
.
edge_indices
.
length
();
i
++
){
qCDebug
(
log_subdiv
)
<<
"blub:"
<<
tables
.
edge_indices
[
i
];
qCDebug
(
log_subdiv
)
<<
"blub:"
<<
tables
.
edge_indices
[
i
];
}
}
}
//compute vertex table
//compute vertex table
...
@@ -336,11 +327,9 @@ Subdivision::Tables Subdivision::precomputeTables(Input input) {
...
@@ -336,11 +327,9 @@ Subdivision::Tables Subdivision::precomputeTables(Input input) {
tables
.
vertex_offsets
.
push_back
(
offset
);
tables
.
vertex_offsets
.
push_back
(
offset
);
qCDebug
(
log_subdiv
)
<<
"Done with vertex index table. "
;
qCDebug
(
log_subdiv
)
<<
"Done with vertex index table. "
;
if
(
debugOutput
){
qCDebug
(
log_subdiv
)
<<
"Duplicates: "
;
qCDebug
(
log_subdiv
)
<<
"Duplicates: "
;
for
(
int
i
=
0
;
i
<
duplicates
.
length
();
i
++
){
for
(
int
i
=
0
;
i
<
duplicates
.
length
();
i
++
){
qCDebug
(
log_subdiv
)
<<
duplicates
[
i
];
qCDebug
(
log_subdiv
)
<<
duplicates
[
i
];
}
}
}
tables
.
index_regular
=
getPatchIndexBuffer
(
ib
);
tables
.
index_regular
=
getPatchIndexBuffer
(
ib
);
qInfo
()
<<
"Precompute Tables Done"
;
qInfo
()
<<
"Precompute Tables Done"
;
...
@@ -592,19 +581,15 @@ Subdivision::Result Subdivision::runShader(Input input, Tables &tables) {
...
@@ -592,19 +581,15 @@ Subdivision::Result Subdivision::runShader(Input input, Tables &tables) {
Vertex
*
ptr
;
Vertex
*
ptr
;
ptr
=
(
Vertex
*
)
f
->
glMapBuffer
(
GL_SHADER_STORAGE_BUFFER
,
GL_WRITE_ONLY
);
ptr
=
(
Vertex
*
)
f
->
glMapBuffer
(
GL_SHADER_STORAGE_BUFFER
,
GL_WRITE_ONLY
);
if
(
debugOutput
)
qCDebug
(
log_subdiv
)
<<
"New vertices:"
;
qCDebug
(
log_subdiv
)
<<
"New vertices:"
;
for
(
int
i
=
0
;
i
<
input
.
vertex_buffer
.
size
();
i
++
)
{
for
(
int
i
=
0
;
i
<
input
.
vertex_buffer
.
size
();
i
++
)
{
if
(
debugOutput
)
qCDebug
(
log_subdiv
)
<<
ptr
[
i
].
pos
;
qCDebug
(
log_subdiv
)
<<
ptr
[
i
].
pos
;
result
.
vertex_buffer
.
push_back
(
ptr
[
i
]);
result
.
vertex_buffer
.
push_back
(
ptr
[
i
]);
}
}
if
(
debugOutput
)
qCDebug
(
log_subdiv
)
<<
"New edge points:"
;
qCDebug
(
log_subdiv
)
<<
"New edge points:"
;
for
(
int
i
=
0
;
i
<
tables
.
edge_indices
.
size
()
/
4
;
i
++
)
{
for
(
int
i
=
0
;
i
<
tables
.
edge_indices
.
size
()
/
4
;
i
++
)
{
if
(
debugOutput
)
qCDebug
(
log_subdiv
)
<<
ptr
[
edgeOffset
+
i
].
pos
;
qCDebug
(
log_subdiv
)
<<
ptr
[
edgeOffset
+
i
].
pos
;
result
.
vertex_buffer
.
push_back
(
ptr
[
edgeOffset
+
i
]);
result
.
vertex_buffer
.
push_back
(
ptr
[
edgeOffset
+
i
]);
}
}
...
...
QTProject/subdivision.h
View file @
3368c442
...
@@ -16,11 +16,8 @@ public:
...
@@ -16,11 +16,8 @@ public:
void
init
();
void
init
();
void
splitRegular
(
Mesh
*
mesh
);
void
splitRegular
(
Mesh
*
mesh
);
void
subdivide
(
Mesh
*
mesh
,
int
level
);
void
subdivide
(
Mesh
*
mesh
,
int
level
);
void
setDebugOutbut
(
bool
debug
);
private
:
private
:
bool
debugOutput
;
struct
Input
struct
Input
{
{
GLuint
vb_handle
;
GLuint
vb_handle
;
...
...
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