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
97c17290
Commit
97c17290
authored
8 years ago
by
Kai Westerkamp
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'patchRender' of…
Merge branch 'patchRender' of
ssh://git.breab.org:2223/kai/Unterteilungsalgorithmen
into patchRender
parents
e6e3b59f
4422b074
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
20 additions
and
0 deletions
+20
-0
subdivision.cpp
QTProject/subdivision.cpp
+19
-0
subdivision.h
QTProject/subdivision.h
+1
-0
No files found.
QTProject/subdivision.cpp
View file @
97c17290
...
...
@@ -355,6 +355,25 @@ void Subdivision::buildNeighborsMap(QVector<Vertex> &vb, QVector<Triangle> &tria
qCDebug
(
log_timing
)
<<
"buildNeighborsMap_gpu done:"
<<
formatTimeMeasurement
(
timer
.
elapsed
());
}
/**
* Returns triangles that use a vertex except for the starting triangle.
*
* @param triangle the starting triangle. Will not be returned.
* @param current_neighbor a neighbor of the starting triangle.
* @param neighbors neighbors of triangles
* @return all neighbors of the first vertex of the neighbor except for the starting triangle.
*/
QVector
<
Triangle
>
Subdivision
::
vertexNeighbors
(
Triangle
&
triangle
,
Triangle
::
Neighbor
current_neighbor
,
QMap
<
Triangle
,
Triangle
::
Neighbors
>
neighbors
)
{
QVector
<
Triangle
>
ns
;
do
{
assert
(
current_neighbor
.
triangle
!=
NULL
);
ns
.
push_back
(
*
current_neighbor
.
triangle
);
current_neighbor
=
neighbors
.
value
(
*
current_neighbor
.
triangle
).
get_neighbor
(
rotate_edge_name
(
current_neighbor
.
edge
.
name
));
}
while
(
*
current_neighbor
.
triangle
!=
triangle
);
assert
(
current_neighbor
.
triangle
!=
NULL
);
return
ns
;
}
void
Subdivision
::
precomputeEdgeTable
(
Subdivision
::
Tables
&
tables
,
QVector
<
Triangle
>
&
triangles
,
QMap
<
Triangle
,
Triangle
::
Neighbors
>
&
neighbors
,
unsigned
int
offset
)
{
//compute edge table
//Format: first two entries: edge vertices. last two entries: distant vertices.
...
...
This diff is collapsed.
Click to expand it.
QTProject/subdivision.h
View file @
97c17290
...
...
@@ -59,6 +59,7 @@ private:
QOpenGLShaderProgram
*
initComputeShaderProgram
(
QString
&
source
);
Tables
precomputeTables
(
Input
input
);
void
buildNeighborsMap
(
QVector
<
Vertex
>
&
vb
,
QVector
<
Triangle
>
&
triangles
,
QMap
<
Triangle
,
Triangle
::
Neighbors
>
&
neighbors
);
QVector
<
Triangle
>
vertexNeighbors
(
Triangle
&
triangle
,
Triangle
::
Neighbor
current_neighbor
,
QMap
<
Triangle
,
Triangle
::
Neighbors
>
neighbors
);
void
precomputeEdgeTable
(
Subdivision
::
Tables
&
tables
,
QVector
<
Triangle
>
&
triangles
,
QMap
<
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
);
...
...
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