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
c58d06a0
Commit
c58d06a0
authored
Sep 27, 2016
by
Alisa Jung
Committed by
Philipp Adolf
Sep 28, 2016
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
removed redundant code
parent
8a65f39d
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
12 additions
and
9 deletions
+12
-9
mesh.cpp
QTProject/mesh.cpp
+3
-3
subdivision.cpp
QTProject/subdivision.cpp
+3
-6
triangle.cpp
QTProject/triangle.cpp
+4
-0
triangle.h
QTProject/triangle.h
+2
-0
No files found.
QTProject/mesh.cpp
View file @
c58d06a0
...
...
@@ -106,9 +106,9 @@ void Mesh::MeshEntry::init(QOpenGLFunctions_4_3_Core *f,QVector<Vertex>& Vertice
QMap
<
Edge
,
unsigned
int
>
sharpEdges
;
if
(
fakeSharpness
){
for
(
int
i
=
0
;
i
<
Indices
.
size
();
i
+=
3
){
sharpEdges
.
insert
(
Edge
(
Indices
[
i
],
Indices
[
i
+
1
]),
2
);
sharpEdges
.
insert
(
Edge
(
Indices
[
i
+
1
],
Indices
[
i
+
2
]),
2
);
sharpEdges
.
insert
(
Edge
(
Indices
[
i
+
2
],
Indices
[
i
]),
2
);
sharpEdges
.
insert
(
Edge
(
Indices
[
i
],
Indices
[
i
+
1
]),
3
);
sharpEdges
.
insert
(
Edge
(
Indices
[
i
+
1
],
Indices
[
i
+
2
]),
3
);
sharpEdges
.
insert
(
Edge
(
Indices
[
i
+
2
],
Indices
[
i
]),
3
);
}
}
buffers
[
0
].
reset
(
new
SubdivEntry
);
...
...
QTProject/subdivision.cpp
View file @
c58d06a0
...
...
@@ -927,11 +927,6 @@ QVector<unsigned int> Subdivision::patchIBToTriangleIB(QVector<unsigned int> ib)
bool
isVertexRegular
(
Triangle
&
triangle
,
Triangle
::
Neighbor
current_neighbor
,
QMap
<
Triangle
,
Triangle
::
Neighbors
>
neighbors
)
{
assert
(
current_neighbor
.
triangle
!=
NULL
);
unsigned
int
count
=
1
;
bool
is_sharp
=
triangle
.
get_sharpness_uv
()
>
0
||
triangle
.
get_sharpness_vw
()
>
0
||
triangle
.
get_sharpness_wu
()
>
0
;
if
(
is_sharp
)
return
false
;
while
(
count
<
6
&&
*
current_neighbor
.
triangle
!=
triangle
)
{
count
++
;
current_neighbor
=
neighbors
.
value
(
*
current_neighbor
.
triangle
).
get_neighbor
(
rotate_edge_name
(
current_neighbor
.
edge
.
name
));
...
...
@@ -951,7 +946,9 @@ void Subdivision::findRegular(QVector<Triangle> triangles, QMap<Triangle, Triang
Triangle
::
Neighbors
ns
=
neighbors
.
value
(
triangle
);
bool
is_regular
=
true
;
if
(
triangle
.
has_sharp_edge
()){
is_regular
=
false
;
}
if
(
!
isVertexRegular
(
triangle
,
ns
.
uv
,
neighbors
))
{
is_regular
=
false
;
}
...
...
QTProject/triangle.cpp
View file @
c58d06a0
...
...
@@ -62,6 +62,10 @@ unsigned int Triangle::get_sharpness_wu() const {
return
sharpness_wu
;
}
bool
Triangle
::
has_sharp_edge
()
const
{
return
(
sharpness_uv
>
0
||
sharpness_vw
>
0
||
sharpness_wu
>
0
);
}
bool
Triangle
::
get_shared_edge
(
Triangle
other
,
Edge
&
edge_a
,
Edge
&
edge_b
)
const
{
if
(
get_shared_edge_
(
other
,
edge_a
,
edge_b
))
{
return
true
;
...
...
QTProject/triangle.h
View file @
c58d06a0
...
...
@@ -55,6 +55,8 @@ class Triangle {
unsigned
int
get_sharpness_vw
()
const
;
unsigned
int
get_sharpness_wu
()
const
;
bool
has_sharp_edge
()
const
;
bool
get_shared_edge
(
Triangle
other
,
Edge
&
edge_a
,
Edge
&
edge_b
)
const
;
bool
hasSharedEdge
(
Triangle
other
);
...
...
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