Record Class CrossSectionGeometry

java.lang.Object
java.lang.Record
org.opentrafficsim.road.network.lane.CrossSectionGeometry
Record Components:
centerLine - center line
contour - contour
offset - offset
width - width

public record CrossSectionGeometry(org.opentrafficsim.base.geometry.OtsLine2d centerLine, org.djutils.draw.line.Polygon2d contour, ContinuousLine.ContinuousDoubleFunction offset, ContinuousLine.ContinuousDoubleFunction width) extends Record
Cross-section element geometry. A static method of(...) is available to generate geometry based on a design line and information on offset and width.

Copyright (c) 2024-2024 Delft University of Technology, PO Box 5, 2600 AA, Delft, the Netherlands. All rights reserved.
BSD-style license. See OpenTrafficSim License.

Author:
Wouter Schakel
  • Constructor Details

  • Method Details

    • of

      Create geometry based on design line, flattener, offset and width information.
      Parameters:
      designLine - design line relative to which offsets are defined
      flattener - flattener to flatten center line and contour
      offset - offset information
      width - offset information
      Returns:
      geometry for cross-section element
    • toString

      public final String toString()
      Returns a string representation of this record class. The representation contains the name of the class, followed by the name and value of each of the record components.
      Specified by:
      toString in class Record
      Returns:
      a string representation of this object
    • hashCode

      public final int hashCode()
      Returns a hash code value for this object. The value is derived from the hash code of each of the record components.
      Specified by:
      hashCode in class Record
      Returns:
      a hash code value for this object
    • equals

      public final boolean equals(Object o)
      Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. All components in this record class are compared with Objects::equals(Object,Object).
      Specified by:
      equals in class Record
      Parameters:
      o - the object with which to compare
      Returns:
      true if this object is the same as the o argument; false otherwise.
    • centerLine

      public org.opentrafficsim.base.geometry.OtsLine2d centerLine()
      Returns the value of the centerLine record component.
      Returns:
      the value of the centerLine record component
    • contour

      public org.djutils.draw.line.Polygon2d contour()
      Returns the value of the contour record component.
      Returns:
      the value of the contour record component
    • offset

      Returns the value of the offset record component.
      Returns:
      the value of the offset record component
    • width

      Returns the value of the width record component.
      Returns:
      the value of the width record component