Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
7
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Open sidebar
vadere
vadere
Commits
a2a75c7c
Commit
a2a75c7c
authored
Nov 15, 2016
by
Benedikt Zoennchen
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
implement a first simple point location algorithm
parent
1014513a
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
5 additions
and
11 deletions
+5
-11
VadereUtils/src/org/vadere/util/delaunay/Face.java
VadereUtils/src/org/vadere/util/delaunay/Face.java
+0
-4
VadereUtils/src/org/vadere/util/delaunay/HalfEdge.java
VadereUtils/src/org/vadere/util/delaunay/HalfEdge.java
+5
-7
No files found.
VadereUtils/src/org/vadere/util/delaunay/Face.java
View file @
a2a75c7c
...
...
@@ -2,7 +2,6 @@ package org.vadere.util.delaunay;
import
org.jetbrains.annotations.NotNull
;
import
org.vadere.util.geometry.shapes.VPoint
;
import
org.vadere.util.geometry.shapes.VPolygon
;
import
java.awt.geom.Path2D
;
...
...
@@ -12,7 +11,6 @@ import java.util.List;
import
java.util.stream.Stream
;
import
java.util.stream.StreamSupport
;
public
class
Face
implements
Iterable
<
HalfEdge
>
{
/**
...
...
@@ -62,13 +60,11 @@ public class Face implements Iterable<HalfEdge> {
return
new
VPolygon
(
path2D
);
}
@Override
public
Iterator
<
HalfEdge
>
iterator
()
{
return
new
HalfEdgeIterator
();
}
public
Stream
<
HalfEdge
>
stream
()
{
Iterable
<
HalfEdge
>
iterable
=
()
->
iterator
();
return
StreamSupport
.
stream
(
iterable
.
spliterator
(),
false
);
...
...
VadereUtils/src/org/vadere/util/delaunay/HalfEdge.java
View file @
a2a75c7c
...
...
@@ -4,7 +4,7 @@ import org.jetbrains.annotations.NotNull;
import
org.vadere.util.geometry.shapes.VLine
;
import
org.vadere.util.geometry.shapes.VPoint
;
import
java.util.Optional
;
/**
* Created by bzoennchen on 13.11.16.
...
...
@@ -38,9 +38,7 @@ public class HalfEdge {
private
Face
face
;
public
HalfEdge
(
final
VPoint
end
,
final
Face
face
)
{
public
HalfEdge
(
@NotNull
final
VPoint
end
,
@NotNull
final
Face
face
)
{
this
.
end
=
end
;
this
.
face
=
face
;
}
...
...
@@ -66,14 +64,14 @@ public class HalfEdge {
}
public
HalfEdge
getTwin
()
{
return
twin
;
public
Optional
<
HalfEdge
>
getTwin
()
{
return
Optional
.
ofNullable
(
twin
)
;
}
public
void
setTwin
(
final
@NotNull
HalfEdge
twin
)
{
this
.
twin
=
twin
;
if
(
twin
.
getTwin
()
!=
this
)
{
if
(
!
twin
.
getTwin
()
.
isPresent
()
||
twin
.
getTwin
().
get
()
!=
this
)
{
twin
.
setTwin
(
this
);
}
}
...
...
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