org.apache.commons.math3.geometry.euclidean.twod
Class PolygonsSet.Edge

java.lang.Object
  extended by 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
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
PolygonsSet.Edge(PolygonsSet.Vertex start, PolygonsSet.Vertex end, Line line)
          Build an edge not contained in any node yet.
 
Method Summary
 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.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

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

PolygonsSet.Edge

public PolygonsSet.Edge(PolygonsSet.Vertex start,
                        PolygonsSet.Vertex end,
                        Line line)
Build an edge not contained in any node yet.

Parameters:
start - start vertex
end - end vertex
line - 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)


Copyright (c) 2003-2013 Apache Software Foundation