Class Shoulder
java.lang.Object
org.djutils.event.LocalEventProducer
org.opentrafficsim.road.network.lane.CrossSectionElement
org.opentrafficsim.road.network.lane.Shoulder
- All Implemented Interfaces:
Serializable
,Remote
,Locatable
,org.djutils.event.EventProducer
,org.opentrafficsim.base.Identifiable
,Drawable
Represents a shoulder. The purpose opf this class is to be able to toggle animation of shoulders, without also toggling lanes
and stripes.
Copyright (c) 2013-2023 Delft University of Technology, PO Box 5, 2600 AA, Delft, the Netherlands. All rights reserved.
BSD-style license. See OpenTrafficSim License.
- Author:
- Alexander Verbraeck, Peter Knoppers, Wouter Schakel
- See Also:
-
Field Summary
Fields inherited from class org.opentrafficsim.road.network.lane.CrossSectionElement
crossSectionSlices, FIXUPPOINTPROPORTION, length, MAXIMUMDIRECTIONERROR, parentLink
Fields inherited from interface org.djutils.event.EventProducer
FIRST_POSITION, LAST_POSITION
-
Constructor Summary
Constructors -
Method Summary
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, getWidth, getWidth, hashCode
Methods inherited from class org.djutils.event.LocalEventProducer
addListener, addListener, addListener, addListener, fireEvent, fireEvent, fireEvent, fireTimedEvent, fireTimedEvent, fireTimedEvent, fireUnverifiedEvent, fireUnverifiedEvent, fireUnverifiedTimedEvent, fireUnverifiedTimedEvent, getEventListenerMap, getEventTypesWithListeners, getListenerReferences, hasListeners, numberOfListeners, removeAllListeners, removeAllListeners, removeListener
-
Constructor Details
-
Shoulder
public Shoulder(CrossSectionLink parentLink, String id, Length lateralPositionStart, Length lateralPositionEnd, Length beginWidth, Length endWidth, boolean fixGradualLateralOffset) throws OtsGeometryException, NetworkException Creates a shoulder element.- 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
-
-
Method Details
-
getZ
public final double getZ()Retrieve the Z offset (used to determine what covers what when drawing).- Specified by:
getZ
in interfaceLocatable
- Overrides:
getZ
in classCrossSectionElement
- Returns:
- double; the Z-offset for drawing (what's on top, what's underneath).
-
toString
- Overrides:
toString
in classCrossSectionElement
-