public class Edge
extends java.lang.Object
SphericalPolygonsSet.getBoundaryLoops()
,
Vertex
Modifier and Type | Field and Description |
---|---|
private Circle |
circle
Circle supporting the edge.
|
private Vertex |
end
End vertex.
|
private double |
length
Length of the arc.
|
private Vertex |
start
Start vertex.
|
Constructor and Description |
---|
Edge(Vertex start,
Vertex end,
double length,
Circle circle)
Build an edge not contained in any node yet.
|
Modifier and Type | Method and Description |
---|---|
private Vertex |
addSubEdge(Vertex subStart,
Vertex subEnd,
double subLength,
java.util.List<Edge> list,
Circle splitCircle)
Add a sub-edge to a list if long enough.
|
Circle |
getCircle()
Get the circle supporting this edge.
|
Vertex |
getEnd()
Get end vertex.
|
double |
getLength()
Get the length of the arc.
|
Vector3D |
getPointAt(double alpha)
Get an intermediate point.
|
Vertex |
getStart()
Get start vertex.
|
(package private) void |
setNextEdge(Edge next)
Connect the instance with a following edge.
|
(package private) void |
split(Circle splitCircle,
java.util.List<Edge> outsideList,
java.util.List<Edge> insideList)
Split the edge.
|
private final Vertex start
private Vertex end
private final double length
private final Circle circle
public Vertex getStart()
public Vertex getEnd()
public double getLength()
public Circle getCircle()
public Vector3D getPointAt(double alpha)
The angle along the edge should normally be between 0 and getLength()
in order to remain within edge limits. However, there are no checks on the
value of the angle, so user can rebuild the full circle on which an edge is
defined if they want.
alpha
- angle along the edge, counted from getStart()
void setNextEdge(Edge next)
next
- edge following the instancevoid split(Circle splitCircle, java.util.List<Edge> outsideList, java.util.List<Edge> insideList)
Once split, this edge is not referenced anymore by the vertices, it is replaced by the two or three sub-edges and intermediate splitting vertices are introduced to connect these sub-edges together.
splitCircle
- circle splitting the edge in several partsoutsideList
- list where to put parts that are outside of the split circleinsideList
- list where to put parts that are inside the split circleprivate Vertex addSubEdge(Vertex subStart, Vertex subEnd, double subLength, java.util.List<Edge> list, Circle splitCircle)
If the length of the sub-edge to add is smaller than the Circle.getTolerance()
tolerance of the support circle, it will be ignored.
subStart
- start of the sub-edgesubEnd
- end of the sub-edgesubLength
- length of the sub-edgesplitCircle
- circle splitting the edge in several partslist
- list where to put the sub-edgesubEnd
if the edge was long enough and really
added, subStart
if the edge was too small and therefore ignored)