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
885e3f3d
Commit
885e3f3d
authored
Sep 01, 2016
by
Kai Westerkamp
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'patchRender' of…
Merge branch 'patchRender' of
ssh://git.breab.org:2223/kai/Unterteilungsalgorithmen
into patchRender
parents
e28d3501
6fbdc2c2
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
27 additions
and
5 deletions
+27
-5
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
vertex.h
QTProject/vertex.h
+0
-5
No files found.
QTProject/subdivision.cpp
View file @
885e3f3d
This diff is collapsed.
Click to expand it.
QTProject/subdivision.h
View file @
885e3f3d
...
@@ -85,6 +85,7 @@ private:
...
@@ -85,6 +85,7 @@ private:
/**
/**
* @brief matchAndCompleteTriangle if vertices at indices tx ty matches vertices at indices sxsy, sysz or szsy,
* @brief matchAndCompleteTriangle if vertices at indices tx ty matches vertices at indices sxsy, sysz or szsy,
* fill tz with third source vertex index.
* 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 sx source triangle: first vertex index
* @param sy source triangle: second vertex index
* @param sy source triangle: second vertex index
* @param sz source triangle: third vertex index
* @param sz source triangle: third vertex index
...
@@ -95,6 +96,7 @@ private:
...
@@ -95,6 +96,7 @@ private:
* @return true if triangles could be matched and tz was filled.
* @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
);
bool
matchAndCompleteTriangle
(
unsigned
int
sx
,
unsigned
int
sy
,
unsigned
int
sz
,
unsigned
int
tx
,
unsigned
int
ty
,
unsigned
int
&
tz
,
QVector
<
Vertex
>
vb
);
};
};
#endif
#endif
QTProject/triangle.cpp
View file @
885e3f3d
...
@@ -64,6 +64,11 @@ bool Triangle::get_shared_edge(Triangle other, Edge &edge_a, Edge &edge_b) const
...
@@ -64,6 +64,11 @@ bool Triangle::get_shared_edge(Triangle other, Edge &edge_a, Edge &edge_b) const
return
false
;
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
{
bool
Triangle
::
get_shared_edge_
(
const
Triangle
&
other
,
Edge
&
edge_a
,
Edge
&
edge_b
)
const
{
if
(
u
().
samePos
(
other
.
u
()))
{
if
(
u
().
samePos
(
other
.
u
()))
{
if
(
v
().
samePos
(
other
.
w
()))
{
if
(
v
().
samePos
(
other
.
w
()))
{
...
@@ -108,6 +113,21 @@ bool Triangle::get_shared_edge_(const Triangle &other, Edge &edge_a, Edge &edge_
...
@@ -108,6 +113,21 @@ bool Triangle::get_shared_edge_(const Triangle &other, Edge &edge_a, Edge &edge_
return
false
;
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
)
{
Triangle
&
Triangle
::
operator
=
(
const
Triangle
&
other
)
{
this
->
vertex_buffer_
=
other
.
vertex_buffer_
;
this
->
vertex_buffer_
=
other
.
vertex_buffer_
;
this
->
u_
=
other
.
u_
;
this
->
u_
=
other
.
u_
;
...
...
QTProject/triangle.h
View file @
885e3f3d
...
@@ -35,6 +35,8 @@ class Triangle {
...
@@ -35,6 +35,8 @@ class Triangle {
bool
get_shared_edge
(
Triangle
other
,
Edge
&
edge_a
,
Edge
&
edge_b
)
const
;
bool
get_shared_edge
(
Triangle
other
,
Edge
&
edge_a
,
Edge
&
edge_b
)
const
;
bool
hasSharedEdge
(
Triangle
other
);
Triangle
&
operator
=
(
const
Triangle
&
other
);
Triangle
&
operator
=
(
const
Triangle
&
other
);
// == and < both ignore the vertex buffer, they only compare indices.
// == and < both ignore the vertex buffer, they only compare indices.
...
@@ -42,6 +44,9 @@ class Triangle {
...
@@ -42,6 +44,9 @@ class Triangle {
bool
operator
==
(
const
Triangle
&
other
)
const
;
bool
operator
==
(
const
Triangle
&
other
)
const
;
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
:
private
:
QVector
<
Vertex
>
vertex_buffer_
;
QVector
<
Vertex
>
vertex_buffer_
;
unsigned
int
u_
;
unsigned
int
u_
;
...
...
QTProject/vertex.h
View file @
885e3f3d
...
@@ -22,11 +22,6 @@ struct Vertex
...
@@ -22,11 +22,6 @@ struct Vertex
bool
samePos
(
const
Vertex
&
other
)
const
;
bool
samePos
(
const
Vertex
&
other
)
const
;
bool
operator
==
(
const
Vertex
&
other
)
const
{
return
samePos
(
other
);
}
};
};
#pragma pack(pop)
#pragma pack(pop)
...
...
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