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
6fbdc2c2
Commit
6fbdc2c2
authored
Sep 01, 2016
by
Alisa Jung
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Performance Boost for getPatchIndexBuffer? TODO Kai mess das mal
Conflicts: QTProject/subdivision.cpp
parent
02506fd3
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
27 additions
and
0 deletions
+27
-0
subdivision.cpp
QTProject/subdivision.cpp
+0
-0
subdivision.h
QTProject/subdivision.h
+2
-0
triangle.cpp
QTProject/triangle.cpp
+20
-0
triangle.h
QTProject/triangle.h
+5
-0
No files found.
QTProject/subdivision.cpp
View file @
6fbdc2c2
This diff is collapsed.
Click to expand it.
QTProject/subdivision.h
View file @
6fbdc2c2
...
...
@@ -83,6 +83,7 @@ private:
/**
* @brief matchAndCompleteTriangle if vertices at indices tx ty matches vertices at indices sxsy, sysz or szsy,
* fill tz with third source vertex index.
* both s(xyz) and t(xyz) are in SAME DIRECTION: matches sx with tx, sy with ty (..)
* @param sx source triangle: first vertex index
* @param sy source triangle: second vertex index
* @param sz source triangle: third vertex index
...
...
@@ -93,6 +94,7 @@ private:
* @return true if triangles could be matched and tz was filled.
*/
bool
matchAndCompleteTriangle
(
unsigned
int
sx
,
unsigned
int
sy
,
unsigned
int
sz
,
unsigned
int
tx
,
unsigned
int
ty
,
unsigned
int
&
tz
,
QVector
<
Vertex
>
vb
);
};
#endif
QTProject/triangle.cpp
View file @
6fbdc2c2
...
...
@@ -64,6 +64,11 @@ bool Triangle::get_shared_edge(Triangle other, Edge &edge_a, Edge &edge_b) const
return
false
;
}
bool
Triangle
::
hasSharedEdge
(
Triangle
other
){
Edge
a
,
b
;
return
get_shared_edge
(
other
,
a
,
b
);
}
bool
Triangle
::
get_shared_edge_
(
const
Triangle
&
other
,
Edge
&
edge_a
,
Edge
&
edge_b
)
const
{
if
(
u
().
samePos
(
other
.
u
()))
{
if
(
v
().
samePos
(
other
.
w
()))
{
...
...
@@ -108,6 +113,21 @@ bool Triangle::get_shared_edge_(const Triangle &other, Edge &edge_a, Edge &edge_
return
false
;
}
//e.g. first.name = uv, next.name = vw
bool
Triangle
::
next_ctrclockwise
(
Edge
first
,
Edge
next
)
const
{
return
(
first
.
name
==
Triangle
::
Edge
::
Name
::
uv
&&
next
.
name
==
Triangle
::
Edge
::
Name
::
vw
)
||
(
first
.
name
==
Triangle
::
Edge
::
Name
::
vw
&&
next
.
name
==
Triangle
::
Edge
::
Name
::
wu
)
||
(
first
.
name
==
Triangle
::
Edge
::
Name
::
wu
&&
next
.
name
==
Triangle
::
Edge
::
Name
::
uv
);
}
//e.g. first.name = vw, next.name = uv
bool
Triangle
::
next_clockwise
(
Edge
first
,
Edge
next
)
const
{
return
next_ctrclockwise
(
next
,
first
);
}
Triangle
&
Triangle
::
operator
=
(
const
Triangle
&
other
)
{
this
->
vertex_buffer_
=
other
.
vertex_buffer_
;
this
->
u_
=
other
.
u_
;
...
...
QTProject/triangle.h
View file @
6fbdc2c2
...
...
@@ -35,6 +35,8 @@ class Triangle {
bool
get_shared_edge
(
Triangle
other
,
Edge
&
edge_a
,
Edge
&
edge_b
)
const
;
bool
hasSharedEdge
(
Triangle
other
);
Triangle
&
operator
=
(
const
Triangle
&
other
);
// == and < both ignore the vertex buffer, they only compare indices.
...
...
@@ -42,6 +44,9 @@ class Triangle {
bool
operator
==
(
const
Triangle
&
other
)
const
;
bool
operator
<
(
const
Triangle
&
other
)
const
;
bool
next_ctrclockwise
(
Edge
first
,
Edge
next
)
const
;
bool
next_clockwise
(
Edge
first
,
Edge
next
)
const
;
private
:
QVector
<
Vertex
>
vertex_buffer_
;
unsigned
int
u_
;
...
...
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