|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectaim4.map.lane.AbstractLane
aim4.map.lane.LineSegmentLane
public class LineSegmentLane
A lane class that can be represented by a directed line segment.
| Constructor Summary | |
|---|---|
LineSegmentLane(double x1,
double y1,
double x2,
double y2,
double width,
double speedLimit)
Constructs a line-segment lane using two sets of coordinates. |
|
LineSegmentLane(Line2D line,
double width,
double speedLimit)
Constructs a line-segment lane using a Line. |
|
LineSegmentLane(Point2D p1,
Point2D p2,
double width,
double speedLimit)
Constructs a line-segment lane using two points. |
|
| Method Summary | |
|---|---|
boolean |
contains(Point2D pos)
Whether or not the provided point can be considered "in" this Lane. |
double |
distanceAlongLane(Point2D pos)
Get the distance along the Lane from the start of the Lane to the Point in the center of the Lane nearest the given Point. |
Point2D |
getEndPoint()
Get the ending point of the Lane. |
double |
getHeadingAtNormalizedDistance(double normalizedDistance)
Get the heading of the Lane at a particular normalized distance from the start of the Lane. |
double |
getInitialHeading()
Get the heading of this Lane at its starting point. |
Point2D |
getLeadPoint(Point2D pos,
double leadDist)
/** Get a point further down the Lane from the nearest point to the given position. |
double |
getLength()
Get the length of this Lane. |
Point2D |
getPointAtNormalizedDistance(double normalizedDistance)
Get a point in the center of the lane at a particular normalized distance from the start of the Lane. |
Shape |
getShape()
Get a Shape describing this Lane, including its width. |
Shape |
getShape(double startFraction,
double endFraction)
Get a Shape describing an interval of this lane, using normalized distances. |
Point2D |
getStartPoint()
Get the starting point of the Lane. |
double |
getTerminalHeading()
Get the heading of this Lane at its ending point. |
double |
getWidth()
Get the width of this Lane, in meters. |
Point2D |
intersectionPoint(Line2D l)
The point at which the the given Line intersects the center of this Lane. |
Shape |
leftBorder()
Get a Shape representing the left border of this Lane. |
Point2D |
leftIntersectionPoint(Line2D l)
The point at which the the given Line intersects the left border of this Lane. |
double |
nearestDistance(Point2D pos)
Get the distance from a point to the center of the Lane. |
Point2D |
nearestPoint(Point2D p)
Get the point in the center of the Lane nearest to the provided point. |
double |
normalizedDistance(double distance)
Get the normalized distance at the distance from the starting point. |
double |
normalizedDistanceAlongLane(Point2D pos)
Get the normalized distance to the point in the center of the lane nearest the provided point. |
double |
remainingDistanceAlongLane(Point2D pos)
Get the amount of distance left in this Lane from the point on the Lane nearest to the given point. |
Shape |
rightBorder()
Get a Shape representing the right border of this Lane. |
Point2D |
rightIntersectionPoint(Line2D l)
The point at which the the given Line intersects the right border of this Lane. |
| Methods inherited from class aim4.map.lane.AbstractLane |
|---|
getId, getLaneIM, getLeftNeighbor, getNextLane, getPrevLane, getRightNeighbor, getSpeedLimit, hasLeftNeighbor, hasNextLane, hasPrevLane, hasRightNeighbor, setId, setLeftNeighbor, setNextLane, setPrevLane, setRightNeighbor |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public LineSegmentLane(Line2D line,
double width,
double speedLimit)
line - the line segment representing the center of the Lanewidth - the width of the Lane, in metersspeedLimit - the speed limit of the Lane, in meters per second
public LineSegmentLane(Point2D p1,
Point2D p2,
double width,
double speedLimit)
p1 - the starting Point of the Lanep2 - the ending Point of the Lanewidth - the width of the Lane, in metersspeedLimit - the speed limit of the Lane, in meters per second
public LineSegmentLane(double x1,
double y1,
double x2,
double y2,
double width,
double speedLimit)
x1 - the x coordinate of the starting point of the Laney1 - the y coordinate of the starting point of the Lanex2 - the x coordinate of the ending point of the Laney2 - the y coordinate of the ending point of the Lanewidth - the width of the Lane, in metersspeedLimit - the speed limit of the Lane, in meters per second| Method Detail |
|---|
public double getLength()
getLength in interface LanegetLength in class AbstractLanepublic Point2D getStartPoint()
getStartPoint in interface LanegetStartPoint in class AbstractLanepublic Point2D getEndPoint()
getEndPoint in interface LanegetEndPoint in class AbstractLanepublic Point2D getPointAtNormalizedDistance(double normalizedDistance)
getPointAtNormalizedDistance in interface LanegetPointAtNormalizedDistance in class AbstractLanenormalizedDistance - the normalized distance (between 0 and 1) from
the start of the Lane
public Point2D nearestPoint(Point2D p)
nearestPoint in interface LanenearestPoint in class AbstractLanep - the point to which the nearest point in the center of the Lane
should be found
public double nearestDistance(Point2D pos)
nearestDistance in interface LanenearestDistance in class AbstractLanepos - the point from which to find the distance to the Lane
public Point2D getLeadPoint(Point2D pos,
double leadDist)
getLeadPoint in interface LanegetLeadPoint in class AbstractLanepos - the position from which to calculate the nearest point in
the LaneleadDist - the lead distance further down the Lane, in meters
leadDist further down the Lane from
the closest point in the Lane to pospublic double distanceAlongLane(Point2D pos)
distanceAlongLane in interface LanedistanceAlongLane in class AbstractLanepos - the point to which to find the distance along the Lane
public double remainingDistanceAlongLane(Point2D pos)
remainingDistanceAlongLane in interface LaneremainingDistanceAlongLane in class AbstractLanepos - the point nearest which to find the distance to the end of the
Lane
public double normalizedDistanceAlongLane(Point2D pos)
normalizedDistanceAlongLane in interface LanenormalizedDistanceAlongLane in class AbstractLanepos - the point near to which to find the normalized distance
public double normalizedDistance(double distance)
distance - the distance along the center of the lane.
public double getInitialHeading()
getInitialHeading in interface LanegetInitialHeading in class AbstractLanepublic double getTerminalHeading()
getTerminalHeading in interface LanegetTerminalHeading in class AbstractLanepublic double getHeadingAtNormalizedDistance(double normalizedDistance)
getHeadingAtNormalizedDistance in interface LanegetHeadingAtNormalizedDistance in class AbstractLanenormalizedDistance - the normalized distance (between 0 and 1) from
the start of the Lane
public Point2D intersectionPoint(Line2D l)
intersectionPoint in interface LaneintersectionPoint in class AbstractLanel - the Line with which to find the intersection
null if it doesn't intersectpublic double getWidth()
getWidth in interface LanegetWidth in class AbstractLanepublic Shape getShape()
getShape in interface LanegetShape in class AbstractLane
public Shape getShape(double startFraction,
double endFraction)
getShape in interface LanegetShape in class AbstractLanestartFraction - the normalized distance from the start of the lane
to the start of the segment which the Shape
representsendFraction - the normalized distance from the start of the lane
to the end of the segment which the Shape represents
public boolean contains(Point2D pos)
contains in interface Lanecontains in class AbstractLanepos - the point to check
public Shape leftBorder()
leftBorder in interface LaneleftBorder in class AbstractLanepublic Shape rightBorder()
rightBorder in interface LanerightBorder in class AbstractLanepublic Point2D leftIntersectionPoint(Line2D l)
leftIntersectionPoint in interface LaneleftIntersectionPoint in class AbstractLanel - the Line with which to find the intersection
null if it doesn't intersectpublic Point2D rightIntersectionPoint(Line2D l)
rightIntersectionPoint in interface LanerightIntersectionPoint in class AbstractLanel - the Line with which to find the intersection
null if it doesn't intersect
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||