public static class VerticalDecomposition.Line extends Segment
Modifier and Type | Field and Description |
---|---|
private java.util.List<VerticalDecomposition.Trapezoid> |
trapsAbove
Trapezoids with this line as its bottom segment.
|
private java.util.List<VerticalDecomposition.Trapezoid> |
trapsBelow
Trapezoids with this line as its top segment.
|
Constructor and Description |
---|
Line(java.awt.geom.Point2D p1,
java.awt.geom.Point2D p2)
Constructs a new line with the given
end points.
|
Modifier and Type | Method and Description |
---|---|
private void |
addTrapAbove(VerticalDecomposition.Trapezoid trap)
Adds a given trapezoid to the list of trapezoids above this line.
|
private void |
addTrapBelow(VerticalDecomposition.Trapezoid trap)
Adds a given trapezoid to the list of trapezoids below this line.
|
VerticalDecomposition.Trapezoid |
getLeftmostTrapAbove()
Gets the leftmost trapezoid that is above this line.
|
VerticalDecomposition.Trapezoid |
getLeftmostTrapBelow()
Gets the leftmost trapezoid that is below this line.
|
VerticalDecomposition.Trapezoid |
getRightmostTrapAbove()
Gets the rightmost trapezoid that is above this line.
|
VerticalDecomposition.Trapezoid |
getRightmostTrapBelow()
Gets the rightmost trapezoid that is below this line.
|
java.util.List<VerticalDecomposition.Trapezoid> |
getTrapsAbove()
Retrieves the list of trapezoids above this line.
|
java.util.List<VerticalDecomposition.Trapezoid> |
getTrapsBelow()
Retrieves the list of trapezoids below this line.
|
static VerticalDecomposition.Line |
orientedLine(java.awt.geom.Point2D p1,
java.awt.geom.Point2D p2)
Create an oriented line segment given two points.
|
private void |
removeTrapAbove(VerticalDecomposition.Trapezoid trap)
Removes a given trapezoid from the list of trapezoids above this line.
|
private void |
removeTrapBelow(VerticalDecomposition.Trapezoid trap)
Removes a given trapezoid from the list of trapezoids below this line.
|
equals, getBounds2D, getP1, getP2, getX1, getX2, getY1, getY2, hashCode, setLine, toString
clone, contains, contains, contains, contains, getBounds, getPathIterator, getPathIterator, intersects, intersects, intersectsLine, intersectsLine, linesIntersect, ptLineDist, ptLineDist, ptLineDist, ptLineDistSq, ptLineDistSq, ptLineDistSq, ptSegDist, ptSegDist, ptSegDist, ptSegDistSq, ptSegDistSq, ptSegDistSq, relativeCCW, relativeCCW, relativeCCW, setLine, setLine
private java.util.List<VerticalDecomposition.Trapezoid> trapsBelow
private java.util.List<VerticalDecomposition.Trapezoid> trapsAbove
public Line(java.awt.geom.Point2D p1, java.awt.geom.Point2D p2)
p1
- The first end point of the line.p2
- The second end point of the line.public static VerticalDecomposition.Line orientedLine(java.awt.geom.Point2D p1, java.awt.geom.Point2D p2)
p1
- The first point.p2
- The second point.public java.util.List<VerticalDecomposition.Trapezoid> getTrapsAbove()
public java.util.List<VerticalDecomposition.Trapezoid> getTrapsBelow()
private void addTrapAbove(VerticalDecomposition.Trapezoid trap)
trap
- The trapezoid to add.private void addTrapBelow(VerticalDecomposition.Trapezoid trap)
trap
- The trapezoid to add.private void removeTrapAbove(VerticalDecomposition.Trapezoid trap)
trap
- The trapezoid to remove.private void removeTrapBelow(VerticalDecomposition.Trapezoid trap)
trap
- The trapezoid to remove.public VerticalDecomposition.Trapezoid getLeftmostTrapAbove()
public VerticalDecomposition.Trapezoid getRightmostTrapAbove()
public VerticalDecomposition.Trapezoid getLeftmostTrapBelow()
public VerticalDecomposition.Trapezoid getRightmostTrapBelow()