Class PolygonsSet.Edge
- java.lang.Object
-
- org.apache.commons.math3.geometry.euclidean.twod.PolygonsSet.Edge
-
- Enclosing class:
- PolygonsSet
private static class PolygonsSet.Edge extends java.lang.Object
Internal class for holding edges while they are processed to build a BSP tree.
-
-
Field Summary
Fields Modifier and Type Field Description private PolygonsSet.Vertex
end
End vertex.private Line
line
Line supporting the edge.private BSPTree<Euclidean2D>
node
Node whose cut hyperplane contains this edge.private PolygonsSet.Vertex
start
Start vertex.
-
Constructor Summary
Constructors Constructor Description Edge(PolygonsSet.Vertex start, PolygonsSet.Vertex end, Line line)
Build an edge not contained in any node yet.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description PolygonsSet.Vertex
getEnd()
Get end vertex.Line
getLine()
Get the line supporting this edge.BSPTree<Euclidean2D>
getNode()
Get the node whose cut hyperplane contains this edge.PolygonsSet.Vertex
getStart()
Get start vertex.void
setNode(BSPTree<Euclidean2D> node)
Set the node whose cut hyperplane contains this edge.PolygonsSet.Vertex
split(Line splitLine)
Split the edge.
-
-
-
Field Detail
-
start
private final PolygonsSet.Vertex start
Start vertex.
-
end
private final PolygonsSet.Vertex end
End vertex.
-
line
private final Line line
Line supporting the edge.
-
node
private BSPTree<Euclidean2D> node
Node whose cut hyperplane contains this edge.
-
-
Constructor Detail
-
Edge
Edge(PolygonsSet.Vertex start, PolygonsSet.Vertex end, Line line)
Build an edge not contained in any node yet.- Parameters:
start
- start vertexend
- end vertexline
- line supporting the edge
-
-
Method Detail
-
getStart
public PolygonsSet.Vertex getStart()
Get start vertex.- Returns:
- start vertex
-
getEnd
public PolygonsSet.Vertex getEnd()
Get end vertex.- Returns:
- end vertex
-
getLine
public Line getLine()
Get the line supporting this edge.- Returns:
- line supporting this edge
-
setNode
public void setNode(BSPTree<Euclidean2D> node)
Set the node whose cut hyperplane contains this edge.- Parameters:
node
- node whose cut hyperplane contains this edge
-
getNode
public BSPTree<Euclidean2D> getNode()
Get the node whose cut hyperplane contains this edge.- Returns:
- node whose cut hyperplane contains this edge (null if edge has not yet been inserted into the BSP tree)
-
split
public PolygonsSet.Vertex split(Line splitLine)
Split the edge.Once split, this edge is not referenced anymore by the vertices, it is replaced by the two half-edges and an intermediate splitting vertex is introduced to connect these two halves.
- Parameters:
splitLine
- line splitting the edge in two halves- Returns:
- split vertex (its incoming and outgoing edges are the two halves)
-
-