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
0415637a
Commit
0415637a
authored
Sep 26, 2016
by
Philipp Adolf
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Allow neighbors to be missing
parent
1a5d98e7
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
15 additions
and
9 deletions
+15
-9
subdivision.cpp
QTProject/subdivision.cpp
+15
-9
No files found.
QTProject/subdivision.cpp
View file @
0415637a
...
...
@@ -271,18 +271,14 @@ void Subdivision::buildNeighborsMap(QVector<Vertex> &vb, QVector<Triangle> &tria
subTimer
.
restart
();
f
->
glBindBuffer
(
GL_SHADER_STORAGE_BUFFER
,
output_handle
);
GLint
*
out_ptr
=
(
GLint
*
)
f
->
glMapBuffer
(
GL_SHADER_STORAGE_BUFFER
,
GL_READ_ONLY
);
bool
valid
=
true
;
for
(
int
i
=
0
;
i
<
3
*
triangles
.
length
();
i
++
)
{
if
(
out_ptr
[
i
]
<
0
||
out_ptr
[
i
]
>=
triangles
.
length
())
{
qCWarning
(
log_subdiv
)
<<
"Invalid neighbor:"
<<
i
<<
out_ptr
[
i
];
valid
=
false
;
}
}
if
(
valid
)
{
for
(
int
i
=
0
;
i
<
triangles
.
length
();
i
++
)
{
Triangle
::
Neighbors
ns
;
GLint
other
=
out_ptr
[
3
*
i
+
0
];
assert
(
other
<
triangles
.
length
());
if
(
other
<
0
)
{
ns
.
uv
.
triangle
=
NULL
;
}
else
{
ns
.
uv
.
triangle
=
&
(
triangles
[
other
]);
if
(
out_ptr
[
3
*
other
+
0
]
==
i
)
{
ns
.
uv
.
edge
.
name
=
Triangle
::
Edge
::
Name
::
uv
;
...
...
@@ -300,8 +296,13 @@ void Subdivision::buildNeighborsMap(QVector<Vertex> &vb, QVector<Triangle> &tria
ns
.
uv
.
edge
.
b
=
ns
.
uv
.
triangle
->
u_idx
();
ns
.
uv
.
edge
.
c
=
ns
.
uv
.
triangle
->
v_idx
();
}
}
other
=
out_ptr
[
3
*
i
+
1
];
assert
(
other
<
triangles
.
length
());
if
(
other
<
0
)
{
ns
.
vw
.
triangle
=
NULL
;
}
else
{
ns
.
vw
.
triangle
=
&
(
triangles
[
other
]);
if
(
out_ptr
[
3
*
other
+
0
]
==
i
)
{
ns
.
vw
.
edge
.
name
=
Triangle
::
Edge
::
Name
::
uv
;
...
...
@@ -319,8 +320,13 @@ void Subdivision::buildNeighborsMap(QVector<Vertex> &vb, QVector<Triangle> &tria
ns
.
vw
.
edge
.
b
=
ns
.
vw
.
triangle
->
u_idx
();
ns
.
vw
.
edge
.
c
=
ns
.
vw
.
triangle
->
v_idx
();
}
}
other
=
out_ptr
[
3
*
i
+
2
];
assert
(
other
<
triangles
.
length
());
if
(
other
<
0
)
{
ns
.
wu
.
triangle
=
NULL
;
}
else
{
ns
.
wu
.
triangle
=
&
(
triangles
[
other
]);
if
(
out_ptr
[
3
*
other
+
0
]
==
i
)
{
ns
.
wu
.
edge
.
name
=
Triangle
::
Edge
::
Name
::
uv
;
...
...
@@ -338,10 +344,10 @@ void Subdivision::buildNeighborsMap(QVector<Vertex> &vb, QVector<Triangle> &tria
ns
.
wu
.
edge
.
b
=
ns
.
wu
.
triangle
->
u_idx
();
ns
.
wu
.
edge
.
c
=
ns
.
wu
.
triangle
->
v_idx
();
}
}
neighbors
.
insert
(
triangles
[
i
],
ns
);
}
}
f
->
glUnmapBuffer
(
GL_SHADER_STORAGE_BUFFER
);
qCDebug
(
log_timing
)
<<
"Building map:"
<<
formatTimeMeasurement
(
subTimer
.
elapsed
());
...
...
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