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
cf654955
Commit
cf654955
authored
Sep 24, 2016
by
Philipp Adolf
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add method for converting IB to Triangles
parent
b6cc65b3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
12 additions
and
6 deletions
+12
-6
subdivision.cpp
QTProject/subdivision.cpp
+4
-6
triangle.cpp
QTProject/triangle.cpp
+6
-0
triangle.h
QTProject/triangle.h
+2
-0
No files found.
QTProject/subdivision.cpp
View file @
cf654955
...
...
@@ -161,13 +161,11 @@ Subdivision::Tables Subdivision::precomputeTables(Input input) {
QTime
trianglesTimer
;
trianglesTimer
.
start
();
QVector
<
Triangle
>
triangles
;
for
(
int
i
=
0
;
i
<
ib
.
length
();
i
+=
3
)
{
triangles
.
push_back
(
Triangle
(
&
vb
,
ib
[
i
],
ib
[
i
+
1
],
ib
[
i
+
2
]));
}
ibToTriangles
(
&
vb
,
ib
,
triangles
);
QVector
<
Triangle
>
triangles_regular
;
for
(
int
i
=
0
;
i
<
ib_regular
.
length
();
i
+=
3
)
{
triangles
.
push_back
(
Triangle
(
&
vb
,
ib_regular
[
i
],
ib_regular
[
i
+
1
],
ib_regular
[
i
+
2
]));
}
ibToTriangles
(
&
vb
,
ib_regular
,
triangles
);
qCDebug
(
log_timing
)
<<
"building Triangles:"
<<
formatTimeMeasurement
(
trianglesTimer
.
elapsed
());
QTime
subTimer
;
...
...
QTProject/triangle.cpp
View file @
cf654955
...
...
@@ -183,6 +183,12 @@ Triangle::Edge::Name rotate_edge_name(Triangle::Edge::Name edge) {
}
}
void
ibToTriangles
(
QVector
<
Vertex
>
*
vb
,
QVector
<
unsigned
int
>
&
ib
,
QVector
<
Triangle
>
&
triangles
)
{
for
(
int
i
=
0
;
i
<
ib
.
length
();
i
+=
3
)
{
triangles
.
push_back
(
Triangle
(
vb
,
ib
[
i
],
ib
[
i
+
1
],
ib
[
i
+
2
]));
}
}
QDebug
operator
<<
(
QDebug
d
,
const
Triangle
&
triangle
)
{
QDebugStateSaver
saver
(
d
);
d
.
nospace
()
<<
"Triangle("
<<
triangle
.
u_idx
()
<<
", "
<<
triangle
.
v_idx
()
<<
", "
<<
triangle
.
w_idx
()
<<
"; "
<<
triangle
.
u
().
pos
<<
", "
<<
triangle
.
v
().
pos
<<
", "
<<
triangle
.
w
().
pos
<<
")"
;
...
...
QTProject/triangle.h
View file @
cf654955
...
...
@@ -57,6 +57,8 @@ class Triangle {
bool
get_shared_edge_
(
const
Triangle
&
other
,
Edge
&
edge_a
,
Edge
&
edge_b
)
const
;
};
void
ibToTriangles
(
QVector
<
Vertex
>
*
vb
,
QVector
<
unsigned
int
>
&
ib
,
QVector
<
Triangle
>
&
triangles
);
QDebug
operator
<<
(
QDebug
d
,
const
Triangle
&
triangle
);
#endif
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