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
7e9bfcb3
Commit
7e9bfcb3
authored
8 years ago
by
Philipp Adolf
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Make precomputeVertexTable use Input
parent
51432f8a
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
9 additions
and
9 deletions
+9
-9
subdivision.cpp
QTProject/subdivision.cpp
+8
-8
subdivision.h
QTProject/subdivision.h
+1
-1
No files found.
QTProject/subdivision.cpp
View file @
7e9bfcb3
...
...
@@ -172,7 +172,7 @@ Subdivision::Tables Subdivision::precomputeTables(Input input) {
qCDebug
(
log_timing
)
<<
"precomputeEdgeTable:"
<<
formatTimeMeasurement
(
subTimer
.
elapsed
());
subTimer
.
restart
();
precomputeVertexTable
(
tables
,
vb
,
ib
,
ib_regular
);
precomputeVertexTable
(
tables
,
input
);
qCDebug
(
log_timing
)
<<
"precomputeVertexTable:"
<<
formatTimeMeasurement
(
subTimer
.
elapsed
());
//tables.patch_index_regular = getPatchIndexBuffer(ib, QVector<unsigned int>());//TODO pass regular and irregular index buffer?
...
...
@@ -302,13 +302,13 @@ void Subdivision::precomputeEdgeTable(Subdivision::Tables &tables, QVector<Trian
}
}
void
Subdivision
::
precomputeVertexTable
(
Subdivision
::
Tables
&
tables
,
QVector
<
Vertex
>
&
vb
,
QVector
<
unsigned
int
>
&
ib
,
QVector
<
unsigned
int
>
&
ib_regular
)
{
void
Subdivision
::
precomputeVertexTable
(
Subdivision
::
Tables
&
tables
,
Input
&
input
)
{
//compute vertex table
//Format: First entry: original vertex. Other entries: adjacent vertices.
QVector
<
QVector
<
unsigned
int
>
>
duplicates
;
//for debugging
QVector
<
unsigned
int
>
ib_combined
=
i
b
+
ib_regula
r
;
QVector
<
unsigned
int
>
ib_combined
=
i
nput
.
index_irregular_buffer
+
input
.
index_regular_buffe
r
;
unsigned
int
offset
=
0
;
for
(
int
i
=
0
;
i
<
vb
.
length
();
i
++
){
for
(
int
i
=
0
;
i
<
input
.
vertex_buffer
.
length
();
i
++
){
//hat evtl viel redundanz
QVector
<
Vertex
>
adj_v
;
//helfer
...
...
@@ -316,14 +316,14 @@ void Subdivision::precomputeVertexTable(Subdivision::Tables &tables, QVector<Ver
tables
.
vertex_indices
.
push_back
(
i
);
offset
++
;
Vertex
originalVertex
=
vb
[
i
];
Vertex
originalVertex
=
input
.
vertex_buffer
[
i
];
QVector
<
unsigned
int
>
d
;
for
(
int
j
=
0
;
j
<
ib_combined
.
length
();
j
++
){
//suche verweise auf vertex im indexbuffer
if
(
vb
[
ib_combined
[
j
]].
samePos
(
originalVertex
)){
if
(
input
.
vertex_buffer
[
ib_combined
[
j
]].
samePos
(
originalVertex
)){
d
.
push_back
(
j
);
unsigned
int
i1
,
i2
;
//indices for neighbour vertices
switch
(
j
%
3
)
{
...
...
@@ -342,8 +342,8 @@ void Subdivision::precomputeVertexTable(Subdivision::Tables &tables, QVector<Ver
}
Vertex
v1
,
v2
;
//neighbour vertices;
v1
=
vb
[
i1
];
v2
=
vb
[
i2
];
v1
=
input
.
vertex_buffer
[
i1
];
v2
=
input
.
vertex_buffer
[
i2
];
//check if vertices where already used to influence this vertex
//Note: Can't use contain. Contain uses equal (would have to implement equal, but we're only interested in the position here.
bool
found1
=
false
;
...
...
This diff is collapsed.
Click to expand it.
QTProject/subdivision.h
View file @
7e9bfcb3
...
...
@@ -57,7 +57,7 @@ private:
QOpenGLShaderProgram
*
initComputeShaderProgram
(
QString
&
source
);
Tables
precomputeTables
(
Input
input
);
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
,
QVector
<
unsigned
int
>
&
ib_regular
);
void
precomputeVertexTable
(
Subdivision
::
Tables
&
tables
,
Input
&
input
);
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
);
void
runVertexShader
(
GLuint
size
,
GLuint
vb_handle
,
GLuint
vertex_indices_handle
,
GLuint
vertex_offsets_handle
,
GLuint
output_handle
);
...
...
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