public abstract class CrossSectionElement extends Object implements nl.tudelft.simulation.dsol.animation.LocatableInterface, Serializable
Copyright (c) 2013-2015 Delft University of Technology, PO Box 5, 2600 AA, Delft, the Netherlands. All rights reserved.
BSD-style license. See OpenTrafficSim License.
$LastChangedDate: 2015-09-14 01:33:02 +0200 (Mon, 14 Sep 2015) $, @version $Revision: 1401 $, by $Author: averbraeck $,
initial version Aug 19, 2014
Modifier and Type | Field and Description |
---|---|
protected List<CrossSectionSlice> |
crossSectionSlices
The offsets and widths at positions along the line, relative to the design line of the parent link.
|
protected org.djunits.value.vdouble.scalar.Length.Rel |
length
The length of the line.
|
protected CrossSectionLink |
parentLink
Cross Section Link to which the element belongs.
|
Constructor and Description |
---|
CrossSectionElement(CrossSectionLink parentLink,
String id,
org.djunits.value.vdouble.scalar.Length.Rel lateralOffset,
org.djunits.value.vdouble.scalar.Length.Rel width)
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.
|
CrossSectionElement(CrossSectionLink parentLink,
String id,
org.djunits.value.vdouble.scalar.Length.Rel lateralOffsetAtBegin,
org.djunits.value.vdouble.scalar.Length.Rel lateralOffsetAtEnd,
org.djunits.value.vdouble.scalar.Length.Rel beginWidth,
org.djunits.value.vdouble.scalar.Length.Rel 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.
|
CrossSectionElement(CrossSectionLink parentLink,
String id,
List<CrossSectionSlice> crossSectionSlices)
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 |
---|---|
static org.opentrafficsim.core.geometry.OTSShape |
constructContour(CrossSectionElement cse)
Construct a buffer geometry by offsetting the linear geometry line with a distance and constructing a so-called "buffer"
around it.
|
boolean |
equals(Object obj) |
org.djunits.value.vdouble.scalar.Length.Rel |
getBeginWidth() |
javax.media.j3d.Bounds |
getBounds() |
org.opentrafficsim.core.geometry.OTSLine3D |
getCenterLine() |
org.opentrafficsim.core.geometry.OTSShape |
getContour() |
org.djunits.value.vdouble.scalar.Length.Rel |
getDesignLineOffsetAtBegin() |
org.djunits.value.vdouble.scalar.Length.Rel |
getDesignLineOffsetAtEnd() |
org.djunits.value.vdouble.scalar.Length.Rel |
getEndWidth() |
String |
getId() |
org.djunits.value.vdouble.scalar.Length.Rel |
getLateralBoundaryPosition(org.opentrafficsim.core.network.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.
|
org.djunits.value.vdouble.scalar.Length.Rel |
getLateralBoundaryPosition(org.opentrafficsim.core.network.LateralDirectionality lateralDirection,
org.djunits.value.vdouble.scalar.Length.Rel 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.
|
org.djunits.value.vdouble.scalar.Length.Rel |
getLateralCenterPosition(double fractionalPosition)
Retrieve the lateral offset from the Link design line at the specified longitudinal position.
|
org.djunits.value.vdouble.scalar.Length.Rel |
getLateralCenterPosition(org.djunits.value.vdouble.scalar.Length.Rel longitudinalPosition)
Retrieve the lateral offset from the Link design line at the specified longitudinal position.
|
org.djunits.value.vdouble.scalar.Length.Rel |
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() |
org.djunits.value.vdouble.scalar.Length.Rel |
getWidth(double fractionalPosition)
Return the width of this CrossSectionElement at a specified fractional longitudinal position.
|
org.djunits.value.vdouble.scalar.Length.Rel |
getWidth(org.djunits.value.vdouble.scalar.Length.Rel longitudinalPosition)
Return the width of this CrossSectionElement at a specified longitudinal position.
|
protected abstract double |
getZ() |
int |
hashCode() |
String |
toString() |
protected final CrossSectionLink parentLink
protected final List<CrossSectionSlice> crossSectionSlices
protected final org.djunits.value.vdouble.scalar.Length.Rel length
public CrossSectionElement(CrossSectionLink parentLink, String id, List<CrossSectionSlice> crossSectionSlices) throws org.opentrafficsim.core.geometry.OTSGeometryException, org.opentrafficsim.core.network.NetworkException
id
- String; The id of the CrosssSectionElement. Should be unique within the parentLink.parentLink
- CrossSectionLink; Link to which the element belongs.crossSectionSlices
- The offsets and widths at positions along the line, relative to the design line of the parent
link. If there is just one with and offset, there should just be one element in the list with Length.Rel = 0.
If there are more slices, the last one should be at the length of the design line. If not, a NetworkException
is thrown.org.opentrafficsim.core.geometry.OTSGeometryException
- when creation of the geometry failsorg.opentrafficsim.core.network.NetworkException
- when id equal to null or not unique, or there are multiple slices and the last slice does not
end at the length of the design line.public CrossSectionElement(CrossSectionLink parentLink, String id, org.djunits.value.vdouble.scalar.Length.Rel lateralOffsetAtBegin, org.djunits.value.vdouble.scalar.Length.Rel lateralOffsetAtEnd, org.djunits.value.vdouble.scalar.Length.Rel beginWidth, org.djunits.value.vdouble.scalar.Length.Rel endWidth) throws org.opentrafficsim.core.geometry.OTSGeometryException, org.opentrafficsim.core.network.NetworkException
id
- String; The id of the CrosssSectionElement. Should be unique within the parentLink.parentLink
- CrossSectionLink; Link to which the element belongs.lateralOffsetAtBegin
- Length.Rel; 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
- Length.Rel; 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
- Length.Rel; width at start, positioned symmetrically around the design lineendWidth
- Length.Rel; width at end, positioned symmetrically around the design lineorg.opentrafficsim.core.geometry.OTSGeometryException
- when creation of the geometry failsorg.opentrafficsim.core.network.NetworkException
- when id equal to null or not uniquepublic CrossSectionElement(CrossSectionLink parentLink, String id, org.djunits.value.vdouble.scalar.Length.Rel lateralOffset, org.djunits.value.vdouble.scalar.Length.Rel width) throws org.opentrafficsim.core.geometry.OTSGeometryException, org.opentrafficsim.core.network.NetworkException
id
- String; The id of the CrosssSectionElement. Should be unique within the parentLink.parentLink
- CrossSectionLink; Link to which the element belongs.lateralOffset
- Length.Rel; the lateral offset of the design line of the new CrossSectionLink with respect to the
design line of the parent Linkwidth
- Length.Rel; width, positioned symmetrically around the design lineorg.opentrafficsim.core.geometry.OTSGeometryException
- when creation of the geometry failsorg.opentrafficsim.core.network.NetworkException
- when id equal to null or not uniquepublic final CrossSectionLink getParentLink()
public final org.djunits.value.vdouble.scalar.Length.Rel getLateralCenterPosition(double fractionalPosition)
fractionalPosition
- double; fractional longitudinal position on this Lanepublic final org.djunits.value.vdouble.scalar.Length.Rel getLateralCenterPosition(org.djunits.value.vdouble.scalar.Length.Rel longitudinalPosition)
longitudinalPosition
- Length.Rel; the longitudinal position on this Lanepublic final org.djunits.value.vdouble.scalar.Length.Rel getWidth(org.djunits.value.vdouble.scalar.Length.Rel longitudinalPosition)
longitudinalPosition
- DoubleScalar<LengthUnit>; the longitudinal positionpublic final org.djunits.value.vdouble.scalar.Length.Rel getWidth(double fractionalPosition)
fractionalPosition
- double; the fractional longitudinal positionpublic final org.djunits.value.vdouble.scalar.Length.Rel getLength()
public final org.djunits.value.vdouble.scalar.Length.Rel getDesignLineOffsetAtBegin()
public final org.djunits.value.vdouble.scalar.Length.Rel getDesignLineOffsetAtEnd()
public final org.djunits.value.vdouble.scalar.Length.Rel getBeginWidth()
public final org.djunits.value.vdouble.scalar.Length.Rel getEndWidth()
protected abstract double getZ()
public final org.opentrafficsim.core.geometry.OTSLine3D getCenterLine()
public final org.opentrafficsim.core.geometry.OTSShape getContour()
public final String getId()
public final org.djunits.value.vdouble.scalar.Length.Rel getLateralBoundaryPosition(org.opentrafficsim.core.network.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 org.djunits.value.vdouble.scalar.Length.Rel getLateralBoundaryPosition(org.opentrafficsim.core.network.LateralDirectionality lateralDirection, org.djunits.value.vdouble.scalar.Length.Rel longitudinalPosition)
lateralDirection
- LateralDirectionality; LEFT, or RIGHTlongitudinalPosition
- Length.Rel; the position along the length of this CrossSectionElementpublic static org.opentrafficsim.core.geometry.OTSShape constructContour(CrossSectionElement cse) throws org.opentrafficsim.core.geometry.OTSGeometryException, org.opentrafficsim.core.network.NetworkException
cse
- the CrossSectionElement to construct the contour fororg.opentrafficsim.core.geometry.OTSGeometryException
- when construction of the geometry failsorg.opentrafficsim.core.network.NetworkException
- when the resulting contour is degenerate (cannot happen; we hope)public nl.tudelft.simulation.language.d3.DirectedPoint getLocation()
getLocation
in interface nl.tudelft.simulation.dsol.animation.LocatableInterface
public javax.media.j3d.Bounds getBounds()
getBounds
in interface nl.tudelft.simulation.dsol.animation.LocatableInterface
Copyright © 2014–2016 Delft University of Technology. All rights reserved.