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
13440614
Commit
13440614
authored
Sep 24, 2016
by
Philipp Adolf
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Build neighbors map in precomputeTables
parent
86b7a460
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
9 additions
and
7 deletions
+9
-7
subdivision.cpp
QTProject/subdivision.cpp
+8
-6
subdivision.h
QTProject/subdivision.h
+1
-1
No files found.
QTProject/subdivision.cpp
View file @
13440614
...
...
@@ -149,7 +149,13 @@ Subdivision::Tables Subdivision::precomputeTables(Input input) {
qCDebug
(
log_timing
)
<<
"building Triangles:"
<<
formatTimeMeasurement
(
subTimer
.
elapsed
());
subTimer
.
restart
();
precomputeEdgeTable
(
tables
,
triangles
,
triangles_regular
,
(
unsigned
int
)
vb
.
length
());
QMap
<
Triangle
,
Triangle
::
Neighbors
>
neighbors
;
QVector
<
Triangle
>
all_triangles
=
triangles
+
triangles_regular
;
buildNeighborsMap
(
all_triangles
,
neighbors
);
qCDebug
(
log_timing
)
<<
"building neighbors map:"
<<
formatTimeMeasurement
(
subTimer
.
elapsed
());
subTimer
.
restart
();
precomputeEdgeTable
(
tables
,
triangles
,
neighbors
,
(
unsigned
int
)
vb
.
length
());
qCDebug
(
log_timing
)
<<
"precomputeEdgeTable:"
<<
formatTimeMeasurement
(
subTimer
.
elapsed
());
QMap
<
unsigned
int
,
unsigned
int
>
modified_vertices
;
...
...
@@ -165,14 +171,10 @@ Subdivision::Tables Subdivision::precomputeTables(Input input) {
return
tables
;
}
void
Subdivision
::
precomputeEdgeTable
(
Subdivision
::
Tables
&
tables
,
QVector
<
Triangle
>
&
triangles
,
Q
Vector
<
Triangle
>
&
triangles_regular
,
unsigned
int
offset
)
{
void
Subdivision
::
precomputeEdgeTable
(
Subdivision
::
Tables
&
tables
,
QVector
<
Triangle
>
&
triangles
,
Q
Map
<
Triangle
,
Triangle
::
Neighbors
>
&
neighbors
,
unsigned
int
offset
)
{
//compute edge table
//Format: first two entries: edge vertices. last two entries: distant vertices.
QMap
<
Triangle
,
Triangle
::
Neighbors
>
neighbors
;
QVector
<
Triangle
>
all_triangles
=
triangles
+
triangles_regular
;
buildNeighborsMap
(
all_triangles
,
neighbors
);
// Maps edges to the index of the new vertex added on that edge. The keys are the indices of the two vertices defining the edge and must be in the order uv, vw or uw.
QMap
<
Edge
,
unsigned
int
>
edge_indices
;
...
...
QTProject/subdivision.h
View file @
13440614
...
...
@@ -57,7 +57,7 @@ private:
QOpenGLShaderProgram
*
initComputeShaderProgram
(
QString
&
source
);
Tables
precomputeTables
(
Input
input
);
void
precomputeEdgeTable
(
Subdivision
::
Tables
&
tables
,
QVector
<
Triangle
>
&
triangles
,
Q
Vector
<
Triangle
>
&
triangles_regular
,
unsigned
int
offset
);
void
precomputeEdgeTable
(
Subdivision
::
Tables
&
tables
,
QVector
<
Triangle
>
&
triangles
,
Q
Map
<
Triangle
,
Triangle
::
Neighbors
>
&
neighbors
,
unsigned
int
offset
);
void
precomputeVertexTable
(
Subdivision
::
Tables
&
tables
,
Input
&
input
,
QMap
<
unsigned
int
,
unsigned
int
>
&
modified_vertices
);
void
updateIndexBuffer
(
QVector
<
unsigned
int
>
&
index_buffer
,
QMap
<
unsigned
int
,
unsigned
int
>
map
);
void
findRegular
(
QVector
<
unsigned
int
>
index_buffer
,
QVector
<
Vertex
>
vertex_buffer
,
QVector
<
unsigned
int
>
&
regular
,
QVector
<
unsigned
int
>
&
irregular
);
...
...
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