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
bb1cedb8
Commit
bb1cedb8
authored
Sep 19, 2016
by
Philipp Adolf
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Rename method
parent
6cf6fd52
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
11 additions
and
8 deletions
+11
-8
subdivision.cpp
QTProject/subdivision.cpp
+10
-7
subdivision.h
QTProject/subdivision.h
+1
-1
No files found.
QTProject/subdivision.cpp
View file @
bb1cedb8
...
...
@@ -13,7 +13,7 @@ Subdivision::~Subdivision()
delete
edgeShader
;
}
QString
Subdivision
::
getTimeSting
(
int
time
){
QString
Subdivision
::
formatTimeMeasurement
(
int
time
){
return
QString
(
"%1m %2s %3ms"
).
arg
(
time
/
60000
,
2
,
10
,
QChar
(
'0'
))
.
arg
((
time
%
60000
)
/
1000
,
2
,
10
,
QChar
(
'0'
))
.
arg
((
time
%
1000
)
,
3
,
10
,
QChar
(
'0'
));
...
...
@@ -163,17 +163,17 @@ Subdivision::Tables Subdivision::precomputeTables(Input input) {
for
(
int
i
=
0
;
i
<
ib_regular
.
length
();
i
+=
3
)
{
triangles
.
push_back
(
Triangle
(
&
vb
,
ib_regular
[
i
],
ib_regular
[
i
+
1
],
ib_regular
[
i
+
2
]));
}
qCDebug
(
log_timing
)
<<
"building Triangles:"
<<
getTimeSting
(
trianglesTimer
.
elapsed
());
qCDebug
(
log_timing
)
<<
"building Triangles:"
<<
formatTimeMeasurement
(
trianglesTimer
.
elapsed
());
QTime
subTimer
;
subTimer
.
start
();
precomputeEdgeTable
(
tables
,
triangles
,
triangles_regular
,
(
unsigned
int
)
vb
.
length
());
qCDebug
(
log_timing
)
<<
"precomputeEdgeTable:"
<<
getTimeSting
(
subTimer
.
elapsed
());
qCDebug
(
log_timing
)
<<
"precomputeEdgeTable:"
<<
formatTimeMeasurement
(
subTimer
.
elapsed
());
subTimer
.
restart
();
precomputeVertexTable
(
tables
,
vb
,
ib
,
ib_regular
);
qCDebug
(
log_timing
)
<<
"precomputeVertexTable:"
<<
getTimeSting
(
subTimer
.
elapsed
());
qCDebug
(
log_timing
)
<<
"precomputeVertexTable:"
<<
formatTimeMeasurement
(
subTimer
.
elapsed
());
//tables.patch_index_regular = getPatchIndexBuffer(ib, QVector<unsigned int>());//TODO pass regular and irregular index buffer?
qCDebug
(
log_subdiv
)
<<
"Precompute Tables Done"
;
...
...
@@ -399,7 +399,7 @@ void Subdivision::splitRegular(Mesh *mesh) {
current_mesh
->
buffers
[
0
]
->
updateIndices
();
qCDebug
(
log_timing
)
<<
"splitRegular(mesh): time: "
<<
getTimeSting
(
totalTimer
.
elapsed
());
qCDebug
(
log_timing
)
<<
"splitRegular(mesh): time: "
<<
formatTimeMeasurement
(
totalTimer
.
elapsed
());
qCDebug
(
log_subdiv
)
<<
"splitRegular(mesh): regular: "
<<
regular
.
length
();
qCDebug
(
log_subdiv
)
<<
"splitRegular(mesh): irregular: "
<<
irregular
.
length
();
}
...
...
@@ -431,7 +431,10 @@ QVector<unsigned int> Subdivision::getPatchIndexBuffer(QVector<unsigned int> ib_
qCDebug
(
log_timing
)
<<
"PatchIndexBuffer started"
;
QVector
<
unsigned
int
>
pib
;
if
(
ib_regular
.
size
()
==
0
)
return
pib
;
QTime
tempTimer
;
tempTimer
.
start
();
QVector
<
unsigned
int
>
ib_combined
=
ib_regular
+
ib_irregular
;
//DO NOT swap regular and irregular! iteration over ib_combined starting from index in ib_regular
qCDebug
(
log_timing
)
<<
"ib_combined:"
<<
formatTimeMeasurement
(
tempTimer
.
elapsed
());
QMap
<
Triangle
,
QVector
<
Triangle
>>
adj
;
// qDebug()<<"combined lenght"<<ib_combined.length();
for
(
int
i
=
0
;
i
<
ib_combined
.
length
()
-
2
;
i
+=
3
){
...
...
@@ -581,7 +584,7 @@ QVector<unsigned int> Subdivision::getPatchIndexBuffer(QVector<unsigned int> ib_
pib
.
push_back
(
i11
);
}
qCDebug
(
log_timing
)
<<
"PatchIndexBuffer done:"
<<
getTimeSting
(
totalTimer
.
elapsed
());
qCDebug
(
log_timing
)
<<
"PatchIndexBuffer done:"
<<
formatTimeMeasurement
(
totalTimer
.
elapsed
());
return
pib
;
}
...
...
@@ -641,7 +644,7 @@ void Subdivision::findRegular(QVector<unsigned int> index_buffer, QVector<Vertex
irregular
.
push_back
(
index_buffer
[
i
+
2
]);
}
}
qCDebug
(
log_timing
)
<<
"Find Regular done:"
<<
getTimeSting
(
totalTimer
.
elapsed
());
qCDebug
(
log_timing
)
<<
"Find Regular done:"
<<
formatTimeMeasurement
(
totalTimer
.
elapsed
());
}
bool
Subdivision
::
matchAndCompleteTriangleIndices
(
unsigned
int
sx
,
unsigned
int
sy
,
unsigned
int
sz
,
unsigned
int
tx
,
unsigned
int
ty
,
unsigned
int
&
tz
){
...
...
QTProject/subdivision.h
View file @
bb1cedb8
...
...
@@ -48,7 +48,7 @@ private:
bool
is_regular
;
};
QString
getTimeSting
(
int
time
);
QString
formatTimeMeasurement
(
int
time
);
QOpenGLFunctions_4_3_Core
*
f
;
QOpenGLShaderProgram
*
edgeShader
;
...
...
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