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
4093abb5
Commit
4093abb5
authored
Aug 29, 2016
by
Philipp Adolf
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Consider regular triangles for edge table
parent
d14dc5a6
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
9 additions
and
3 deletions
+9
-3
subdivision.cpp
QTProject/subdivision.cpp
+8
-2
subdivision.h
QTProject/subdivision.h
+1
-1
No files found.
QTProject/subdivision.cpp
View file @
4093abb5
...
...
@@ -156,7 +156,7 @@ Subdivision::Tables Subdivision::precomputeTables(Input input) {
triangles
.
push_back
(
Triangle
(
vb
,
ib_regular
[
i
],
ib_regular
[
i
+
1
],
ib_regular
[
i
+
2
]));
}
precomputeEdgeTable
(
tables
,
triangles
,
(
unsigned
int
)
vb
.
length
());
precomputeEdgeTable
(
tables
,
triangles
,
triangles_regular
,
(
unsigned
int
)
vb
.
length
());
precomputeVertexTable
(
tables
,
vb
,
ib
);
//tables.patch_index_regular = getPatchIndexBuffer(ib, QVector<unsigned int>());//TODO pass regular and irregular index buffer?
...
...
@@ -164,7 +164,7 @@ Subdivision::Tables Subdivision::precomputeTables(Input input) {
return
tables
;
}
void
Subdivision
::
precomputeEdgeTable
(
Subdivision
::
Tables
&
tables
,
QVector
<
Triangle
>
&
triangles
,
unsigned
int
offset
)
{
void
Subdivision
::
precomputeEdgeTable
(
Subdivision
::
Tables
&
tables
,
QVector
<
Triangle
>
&
triangles
,
QVector
<
Triangle
>
&
triangles_regular
,
unsigned
int
offset
)
{
//compute edge table
//Format: first two entries: edge vertices. last two entries: distant vertices.
...
...
@@ -196,6 +196,12 @@ void Subdivision::precomputeEdgeTable(Subdivision::Tables &tables, QVector<Trian
insert_edge
(
opposite_edges
,
triangles
[
j
],
edge_b
,
edge_a
);
}
}
for
(
int
j
=
0
;
j
<
triangles_regular
.
length
();
j
++
){
if
(
triangle
.
get_shared_edge
(
triangles_regular
[
j
],
edge_a
,
edge_b
))
{
insert_edge
(
opposite_edges
,
triangle
,
edge_a
,
edge_b
);
// no need to insert the opposite edge of a regular triangle - it won't be processed by the outer loop
}
}
QVector
<
Triangle
::
Edge
>
opposite
=
opposite_edges
.
value
(
triangle
);
...
...
QTProject/subdivision.h
View file @
4093abb5
...
...
@@ -54,7 +54,7 @@ private:
QOpenGLShaderProgram
*
initComputeShaderProgram
(
QString
&
source
);
Tables
precomputeTables
(
Input
input
);
void
precomputeEdgeTable
(
Subdivision
::
Tables
&
tables
,
QVector
<
Triangle
>
&
triangles
,
unsigned
int
offset
);
void
precomputeEdgeTable
(
Subdivision
::
Tables
&
tables
,
QVector
<
Triangle
>
&
triangles
,
QVector
<
Triangle
>
&
triangles_regular
,
unsigned
int
offset
);
void
precomputeVertexTable
(
Subdivision
::
Tables
&
tables
,
QVector
<
Vertex
>
&
vb
,
QVector
<
unsigned
int
>
&
ib
);
void
findRegular
(
QVector
<
unsigned
int
>
index_buffer
,
QVector
<
Vertex
>
vertex_buffer
,
QVector
<
unsigned
int
>
&
regular
,
QVector
<
unsigned
int
>
&
irregular
);
Result
runShader
(
Input
input
,
Tables
&
tables
);
...
...
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