Class Shoulder
- java.lang.Object
-
- org.djutils.event.EventProducer
-
- org.opentrafficsim.road.network.lane.CrossSectionElement
-
- org.opentrafficsim.road.network.lane.Shoulder
-
- All Implemented Interfaces:
Serializable
,Locatable
,EventProducerInterface
,Identifiable
,Drawable
public class Shoulder extends CrossSectionElement
Copyright (c) 2013-2020 Delft University of Technology, PO Box 5, 2600 AA, Delft, the Netherlands. All rights reserved.
BSD-style license. See OpenTrafficSim License.$LastChangedDate: 2015-09-03 13:38:01 +0200 (Thu, 03 Sep 2015) $, @version $Revision: 1378 $, by $Author: averbraeck $, initial version Aug 19, 2014
- Author:
- Alexander Verbraeck, Peter Knoppers, Guus Tamminga
- See Also:
- Serialized Form
-
-
Field Summary
-
Fields inherited from class org.opentrafficsim.road.network.lane.CrossSectionElement
crossSectionSlices, FIXUPPOINTPROPORTION, length, MAXIMUMDIRECTIONERROR, parentLink
-
Fields inherited from class org.djutils.event.EventProducer
eventProducerImpl
-
Fields inherited from interface org.djutils.event.EventProducerInterface
FIRST_POSITION, LAST_POSITION
-
-
Constructor Summary
Constructors Modifier Constructor Description Shoulder(CrossSectionLink parentLink, String id, List<CrossSectionSlice> crossSectionSlices)
Shoulder(CrossSectionLink parentLink, String id, Length lateralPosition, Length width)
Shoulder(CrossSectionLink parentLink, String id, Length lateralPositionStart, Length lateralPositionEnd, Length beginWidth, Length endWidth)
Shoulder(CrossSectionLink parentLink, String id, Length lateralPositionStart, Length lateralPositionEnd, Length beginWidth, Length endWidth, boolean fixGradualLateralOffset)
protected
Shoulder(CrossSectionLink newParentLink, SimulatorInterface.TimeDoubleUnit newSimulator, Shoulder cse)
Clone a Shoulder for a new network.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Shoulder
clone(CrossSectionLink newParentLink, SimulatorInterface.TimeDoubleUnit newSimulator)
Clone the CrossSectionElement for e.g., copying a network.protected double
getZ()
Retrieve the Z offset (used to determine what covers what when drawing).String
toString()
-
Methods inherited from class org.opentrafficsim.road.network.lane.CrossSectionElement
constructContour, equals, getBeginWidth, getBounds, getCenterLine, getContour, getDesignLineOffsetAtBegin, getDesignLineOffsetAtEnd, getEndWidth, getFullId, getId, getLateralBoundaryPosition, getLateralBoundaryPosition, getLateralCenterPosition, getLateralCenterPosition, getLength, getLocation, getNetwork, getParentLink, getSourceId, getWidth, getWidth, hashCode
-
Methods inherited from class org.djutils.event.EventProducer
addListener, addListener, addListener, addListener, fireEvent, fireEvent, fireEvent, fireEvent, fireEvent, fireEvent, fireEvent, fireEvent, fireEvent, fireEvent, fireEvent, fireTimedEvent, fireTimedEvent, fireTimedEvent, fireTimedEvent, fireTimedEvent, fireTimedEvent, fireTimedEvent, fireTimedEvent, fireTimedEvent, fireTimedEvent, fireUnverifiedEvent, fireUnverifiedEvent, fireUnverifiedEvent, fireUnverifiedEvent, fireUnverifiedEvent, fireUnverifiedEvent, fireUnverifiedEvent, fireUnverifiedEvent, fireUnverifiedEvent, fireUnverifiedEvent, fireUnverifiedEvent, fireUnverifiedTimedEvent, fireUnverifiedTimedEvent, fireUnverifiedTimedEvent, fireUnverifiedTimedEvent, fireUnverifiedTimedEvent, fireUnverifiedTimedEvent, fireUnverifiedTimedEvent, fireUnverifiedTimedEvent, fireUnverifiedTimedEvent, fireUnverifiedTimedEvent, fireUnverifiedTimedEvent, getEventTypesWithListeners, getListenerReferences, hasListeners, numberOfListeners, removeAllListeners, removeAllListeners, removeListener
-
-
-
-
Constructor Detail
-
Shoulder
public Shoulder(CrossSectionLink parentLink, String id, Length lateralPositionStart, Length lateralPositionEnd, Length beginWidth, Length endWidth, boolean fixGradualLateralOffset) throws OTSGeometryException, NetworkException
- Parameters:
parentLink
- CrossSectionLink; Cross Section Link to which the element belongs.id
- String; the id of the lane. Should be unique within the parentLink.lateralPositionStart
- Length; the lateral start position compared to the linear geometry of the Cross Section Link.lateralPositionEnd
- Length; the lateral end position compared to the linear geometry of the Cross Section LinkbeginWidth
- Length; start width, positioned <i>symmetrically around</i> the lateral start position.endWidth
- Length; end width, positioned <i>symmetrically around</i> the lateral end position.fixGradualLateralOffset
- boolean; true if gradualLateralOffset needs to be fixed- Throws:
OTSGeometryException
- when creation of the center line or contour geometry failsNetworkException
- when id equal to null or not unique
-
Shoulder
public Shoulder(CrossSectionLink parentLink, String id, Length lateralPositionStart, Length lateralPositionEnd, Length beginWidth, Length endWidth) throws OTSGeometryException, NetworkException
- Parameters:
parentLink
- CrossSectionLink; Cross Section Link to which the element belongs.id
- String; the id of the lane. Should be unique within the parentLink.lateralPositionStart
- Length; the lateral start position compared to the linear geometry of the Cross Section Link.lateralPositionEnd
- Length; the lateral end position compared to the linear geometry of the Cross Section LinkbeginWidth
- Length; start width, positioned <i>symmetrically around</i> the lateral start position.endWidth
- Length; end width, positioned <i>symmetrically around</i> the lateral end position.- Throws:
OTSGeometryException
- when creation of the center line or contour geometry failsNetworkException
- when id equal to null or not unique
-
Shoulder
public Shoulder(CrossSectionLink parentLink, String id, Length lateralPosition, Length width) throws OTSGeometryException, NetworkException
- Parameters:
parentLink
- CrossSectionLink; Cross Section Link to which the element belongs.id
- String; the id of the lane. Should be unique within the parentLink.lateralPosition
- Length; the lateral start position compared to the linear geometry of the Cross Section Link.width
- Length; the shoulder width, positioned <i>symmetrically around</i> the lateral start position.- Throws:
OTSGeometryException
- when creation of the center line or contour geometry failsNetworkException
- when id equal to null or not unique
-
Shoulder
public Shoulder(CrossSectionLink parentLink, String id, List<CrossSectionSlice> crossSectionSlices) throws OTSGeometryException, NetworkException
- Parameters:
parentLink
- CrossSectionLink; Cross Section Link to which the element belongs.id
- String; the id of the lane. Should be unique within the parentLink.crossSectionSlices
- List<CrossSectionSlice>; 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 = 0. If there are more slices, the last one should be at the length of the design line. If not, a NetworkException is thrown.- Throws:
OTSGeometryException
- when creation of the center line or contour geometry failsNetworkException
- when id equal to null or not unique
-
Shoulder
protected Shoulder(CrossSectionLink newParentLink, SimulatorInterface.TimeDoubleUnit newSimulator, Shoulder cse) throws NetworkException
Clone a Shoulder for a new network.- Parameters:
newParentLink
- CrossSectionLink; the new link to which the clone belongsnewSimulator
- SimulatorInterface.TimeDoubleUnit; the new simulator for this networkcse
- Shoulder; the element to clone from- Throws:
NetworkException
- if link already exists in the network, if name of the link is not unique, or if the start node or the end node of the link are not registered in the network.
-
-
Method Detail
-
getZ
protected final double getZ()
Retrieve the Z offset (used to determine what covers what when drawing).- Specified by:
getZ
in classCrossSectionElement
- Returns:
- double; the Z-offset for drawing (what's on top, what's underneath).
-
toString
public String toString()
- Overrides:
toString
in classCrossSectionElement
-
clone
public Shoulder clone(CrossSectionLink newParentLink, SimulatorInterface.TimeDoubleUnit newSimulator) throws NetworkException
Clone the CrossSectionElement for e.g., copying a network.- Specified by:
clone
in classCrossSectionElement
- Parameters:
newParentLink
- CrossSectionLink; the new link to which the clone belongsnewSimulator
- SimulatorInterface.TimeDoubleUnit; the new simulator for this network- Returns:
- a clone of this object
- Throws:
NetworkException
- in case the cloning fails
-
-