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

public class Shoulder extends CrossSectionElement
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:
  • 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 Link
      beginWidth - 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 fails
      NetworkException - 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 interface Locatable
      Overrides:
      getZ in class CrossSectionElement
      Returns:
      double; the Z-offset for drawing (what's on top, what's underneath).
    • toString

      public String toString()
      Overrides:
      toString in class CrossSectionElement