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
9fe1af47
Commit
9fe1af47
authored
Sep 27, 2016
by
Philipp Adolf
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
temp
parent
1e95e175
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
18 additions
and
2 deletions
+18
-2
mainwidget.cpp
QTProject/mainwidget.cpp
+1
-1
subdivision.cpp
QTProject/subdivision.cpp
+17
-1
No files found.
QTProject/mainwidget.cpp
View file @
9fe1af47
...
...
@@ -145,7 +145,7 @@ void MainWidget::initializeGL(){
subdivision
->
init
();
//loadNewMesh( "../Models/demon_head.3ds");
loadNewMesh
(
"../Models/
torus
.obj"
);
loadNewMesh
(
"../Models/
box
.obj"
);
}
void
MainWidget
::
loadNewMesh
(){
...
...
QTProject/subdivision.cpp
View file @
9fe1af47
...
...
@@ -550,11 +550,14 @@ void Subdivision::precomputeEdgeTable(Subdivision::Tables &tables, QVector<Trian
extra_it
.
next
();
Triangle
triangle
=
extra_it
.
key
();
qDebug
()
<<
triangle
;
unsigned
int
uv
,
vw
,
wu
;
int
uv
=
-
1
;
int
vw
=
-
1
;
int
wu
=
-
1
;
Edge
edge
;
Triangle
::
Neighbors
ns
=
neighbors
.
value
(
triangle
);
if
(
ns
.
uv
.
triangle
!=
NULL
)
{
edge
=
{
triangle
.
u_idx
(),
triangle
.
v_idx
()
};
if
(
edge_indices
.
contains
(
edge
))
{
uv
=
edge_indices
.
value
(
edge
);
...
...
@@ -570,7 +573,9 @@ void Subdivision::precomputeEdgeTable(Subdivision::Tables &tables, QVector<Trian
tables
.
edge_indices
.
push_back
(
triangle
.
w_idx
());
tables
.
edge_indices
.
push_back
(
ns
.
uv
.
edge
.
c
);
}
}
if
(
ns
.
vw
.
triangle
!=
NULL
)
{
edge
=
{
triangle
.
v_idx
(),
triangle
.
w_idx
()
};
if
(
edge_indices
.
contains
(
edge
))
{
vw
=
edge_indices
.
value
(
edge
);
...
...
@@ -586,7 +591,9 @@ void Subdivision::precomputeEdgeTable(Subdivision::Tables &tables, QVector<Trian
tables
.
edge_indices
.
push_back
(
triangle
.
u_idx
());
tables
.
edge_indices
.
push_back
(
ns
.
vw
.
edge
.
c
);
}
}
if
(
ns
.
wu
.
triangle
!=
NULL
)
{
edge
=
{
triangle
.
w_idx
(),
triangle
.
u_idx
()
};
if
(
edge_indices
.
contains
(
edge
))
{
wu
=
edge_indices
.
value
(
edge
);
...
...
@@ -602,23 +609,32 @@ void Subdivision::precomputeEdgeTable(Subdivision::Tables &tables, QVector<Trian
tables
.
edge_indices
.
push_back
(
triangle
.
v_idx
());
tables
.
edge_indices
.
push_back
(
ns
.
wu
.
edge
.
c
);
}
}
if
(
uv
>=
0
&&
wu
>=
0
)
{
tables
.
extra_triangles
.
push_back
(
triangle
.
u_idx
());
tables
.
extra_triangles
.
push_back
(
uv
);
tables
.
extra_triangles
.
push_back
(
wu
);
}
if
(
vw
>=
0
&&
uv
>=
0
)
{
tables
.
extra_triangles
.
push_back
(
triangle
.
v_idx
());
tables
.
extra_triangles
.
push_back
(
vw
);
tables
.
extra_triangles
.
push_back
(
uv
);
}
if
(
wu
>=
0
&&
vw
>=
0
)
{
tables
.
extra_triangles
.
push_back
(
triangle
.
w_idx
());
tables
.
extra_triangles
.
push_back
(
wu
);
tables
.
extra_triangles
.
push_back
(
vw
);
}
if
(
uv
>=
0
&&
vw
>=
0
&&
wu
>=
0
)
{
tables
.
extra_triangles
.
push_back
(
uv
);
tables
.
extra_triangles
.
push_back
(
vw
);
tables
.
extra_triangles
.
push_back
(
wu
);
}
}
qCDebug
(
log_subdiv
)
<<
"Done with edge table. "
<<
tables
.
edge_indices
.
length
();
if
(
log_subdiv_trace
().
isDebugEnabled
())
{
...
...
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