public abstract class CrossSectionElement extends Object implements nl.tudelft.simulation.dsol.animation.LocatableInterface
Copyright (c) 2013-2014 Delft University of Technology, PO Box 5, 2600 AA, Delft, the Netherlands. All rights
reserved.
BSD-style license. See OpenTrafficSim License.
Constructor and Description |
---|
CrossSectionElement(CrossSectionLink<?,?> parentLink,
DoubleScalar.Rel<LengthUnit> lateralOffsetAtBegin,
DoubleScalar.Rel<LengthUnit> lateralOffsetAtEnd,
DoubleScalar.Rel<LengthUnit> beginWidth,
DoubleScalar.Rel<LengthUnit> endWidth)
Note: LEFT is seen as a positive lateral direction, RIGHT as a negative lateral direction, with the
direction from the StartNode towards the EndNode as the longitudinal direction.
|
Modifier and Type | Method and Description |
---|---|
javax.media.j3d.Bounds |
getBounds() |
com.vividsolutions.jts.geom.LineString |
getCenterLine()
Retrieve the center line or design line of this CrossSectionElement.
|
com.vividsolutions.jts.geom.Geometry |
getContour() |
DoubleScalar.Rel<LengthUnit> |
getLateralBoundaryPosition(LateralDirectionality lateralDirection,
double fractionalLongitudinalPosition)
Return the lateral offset from the design line of the parent Link of the Left or Right boundary of this
CrossSectionElement at the specified fractional longitudinal position.
|
DoubleScalar.Rel<LengthUnit> |
getLateralBoundaryPosition(LateralDirectionality lateralDirection,
DoubleScalar.Rel<LengthUnit> longitudinalPosition)
Return the lateral offset from the design line of the parent Link of the Left or Right boundary of this
CrossSectionElement at the specified longitudinal position.
|
DoubleScalar.Rel<LengthUnit> |
getLateralCenterPosition(double fractionalPosition)
Retrieve the lateral offset from the Link design line at the specified longitudinal position.
|
DoubleScalar<LengthUnit> |
getLateralCenterPosition(DoubleScalar.Rel<LengthUnit> longitudinalPosition)
Retrieve the lateral offset from the Link design line at the specified longitudinal position.
|
DoubleScalar.Rel<LengthUnit> |
getLength()
Return the length of this CrossSectionElement as measured along the design line (which equals the center line).
|
nl.tudelft.simulation.language.d3.DirectedPoint |
getLocation() |
CrossSectionLink<?,?> |
getParentLink() |
DoubleScalar.Rel<LengthUnit> |
getWidth(double fractionalPosition)
Return the width of this CrossSectionElement at a specified fractional longitudinal position.
|
DoubleScalar.Rel<LengthUnit> |
getWidth(DoubleScalar.Rel<LengthUnit> longitudinalPosition)
Return the width of this CrossSectionElement at a specified longitudinal position.
|
protected abstract double |
getZ() |
static void |
printCoordinate(String prefix,
com.vividsolutions.jts.geom.Coordinate coordinate)
Print one Coordinate on the console.
|
static void |
printCoordinates(String prefix,
com.vividsolutions.jts.geom.Coordinate[] coordinates)
Print an array of coordinates on the console.
|
static void |
printCoordinates(String prefix,
com.vividsolutions.jts.geom.Coordinate[] coordinates,
int fromIndex,
int toIndex)
Print part of an array of coordinates on the console.
|
static void |
printCoordinates(String prefix,
com.vividsolutions.jts.geom.Geometry geometry)
Print coordinates of a Geometry on the console.
|
static void |
printCoordinates(String prefix,
com.vividsolutions.jts.geom.Geometry geometry,
int fromIndex,
int toIndex)
Print coordinates of a Geometry on the console.
|
String |
toString() |
public CrossSectionElement(CrossSectionLink<?,?> parentLink, DoubleScalar.Rel<LengthUnit> lateralOffsetAtBegin, DoubleScalar.Rel<LengthUnit> lateralOffsetAtEnd, DoubleScalar.Rel<LengthUnit> beginWidth, DoubleScalar.Rel<LengthUnit> endWidth) throws NetworkException
parentLink
- CrossSectionLink; Link to which the element belongs.lateralOffsetAtBegin
- DoubleScalar.Rel<LengthUnit>; the lateral offset of the design line of the new
CrossSectionLink with respect to the design line of the parent Link at the start of the parent LinklateralOffsetAtEnd
- DoubleScalar.Rel<LengthUnit>; the lateral offset of the design line of the new
CrossSectionLink with respect to the design line of the parent Link at the end of the parent LinkbeginWidth
- DoubleScalar.Rel<LengthUnit>; width at start, positioned symmetrically around the
design lineendWidth
- DoubleScalar.Rel<LengthUnit>; width at end, positioned symmetrically around the
design lineNetworkException
- when creation of the geometry failspublic final CrossSectionLink<?,?> getParentLink()
public final DoubleScalar.Rel<LengthUnit> getLateralCenterPosition(double fractionalPosition)
fractionalPosition
- double; fractional longitudinal position on this Lanepublic final DoubleScalar<LengthUnit> getLateralCenterPosition(DoubleScalar.Rel<LengthUnit> longitudinalPosition)
longitudinalPosition
- DoubleScalar.Rel<LengthUnit>; the longitudinal position on this Lanepublic final DoubleScalar.Rel<LengthUnit> getWidth(DoubleScalar.Rel<LengthUnit> longitudinalPosition)
longitudinalPosition
- DoubleScalar<LengthUnit>; the longitudinal positionpublic final DoubleScalar.Rel<LengthUnit> getWidth(double fractionalPosition)
fractionalPosition
- double; the fractional longitudinal positionprotected abstract double getZ()
public final nl.tudelft.simulation.language.d3.DirectedPoint getLocation() throws RemoteException
getLocation
in interface nl.tudelft.simulation.dsol.animation.LocatableInterface
RemoteException
public final javax.media.j3d.Bounds getBounds() throws RemoteException
getBounds
in interface nl.tudelft.simulation.dsol.animation.LocatableInterface
RemoteException
public final com.vividsolutions.jts.geom.Geometry getContour()
public final com.vividsolutions.jts.geom.LineString getCenterLine()
public static void printCoordinate(String prefix, com.vividsolutions.jts.geom.Coordinate coordinate)
prefix
- String; text to put before the outputcoordinate
- Coordinate; the coordinate to printpublic static void printCoordinates(String prefix, com.vividsolutions.jts.geom.Geometry geometry, int fromIndex, int toIndex)
prefix
- String; text to put before the outputgeometry
- Geometry; the coordinates to printfromIndex
- int; index of the first coordinate to printtoIndex
- int; one higher than the index of the last coordinate to printpublic static void printCoordinates(String prefix, com.vividsolutions.jts.geom.Geometry geometry)
prefix
- String; text to put before the outputgeometry
- Geometry; the coordinates to printpublic static void printCoordinates(String prefix, com.vividsolutions.jts.geom.Coordinate[] coordinates)
prefix
- String; text to put before the coordinatescoordinates
- Coordinate[]; the coordinates to printpublic static void printCoordinates(String prefix, com.vividsolutions.jts.geom.Coordinate[] coordinates, int fromIndex, int toIndex)
prefix
- String; text to put before the outputcoordinates
- Coordinate[]; the coordinates to printfromIndex
- int; index of the first coordinate to printtoIndex
- int; one higher than the index of the last coordinate to printpublic final DoubleScalar.Rel<LengthUnit> getLength()
public final DoubleScalar.Rel<LengthUnit> getLateralBoundaryPosition(LateralDirectionality lateralDirection, double fractionalLongitudinalPosition)
lateralDirection
- LateralDirectionality; LEFT, or RIGHTfractionalLongitudinalPosition
- double; ranges from 0.0 (begin of parentLink) to 1.0 (end of parentLink)public final DoubleScalar.Rel<LengthUnit> getLateralBoundaryPosition(LateralDirectionality lateralDirection, DoubleScalar.Rel<LengthUnit> longitudinalPosition)
lateralDirection
- LateralDirectionality; LEFT, or RIGHTlongitudinalPosition
- DoubleScalar.Rel<LengthUnit>; the position along the length of this
CrossSectionElementCopyright © 2014–2015 Delft University of Technology. All rights reserved.