Record Class CrossSectionGeometry
java.lang.Object
java.lang.Record
org.opentrafficsim.road.network.lane.CrossSectionGeometry
- Record Components:
centerLine- center lineabsoluteContour- contouroffset- offsetwidth- width
public record CrossSectionGeometry(OtsLine2d centerLine, Polygon2d absoluteContour, ContinuousPiecewiseLinearFunction offset, ContinuousPiecewiseLinearFunction 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 Summary
ConstructorsConstructorDescriptionCrossSectionGeometry(OtsLine2d centerLine, Polygon2d absoluteContour, ContinuousPiecewiseLinearFunction offset, ContinuousPiecewiseLinearFunction width) Constructor. -
Method Summary
Modifier and TypeMethodDescriptionReturns the value of theabsoluteContourrecord component.Returns the value of thecenterLinerecord component.final booleanIndicates whether some other object is "equal to" this one.Returns the location.Returns the relative contour.final inthashCode()Returns a hash code value for this object.static CrossSectionGeometryof(OffsetCurve2d designLine, OffsetFlattener2d flattener, ContinuousPiecewiseLinearFunction offset, ContinuousPiecewiseLinearFunction width) Create geometry based on design line, flattener, offset and width information.offset()Returns the value of theoffsetrecord component.final StringtoString()Returns a string representation of this record class.width()Returns the value of thewidthrecord component.
-
Constructor Details
-
CrossSectionGeometry
public CrossSectionGeometry(OtsLine2d centerLine, Polygon2d absoluteContour, ContinuousPiecewiseLinearFunction offset, ContinuousPiecewiseLinearFunction width) Constructor.- Throws:
NullPointerException- when centerLine, contour or slices isnull
-
-
Method Details
-
of
public static CrossSectionGeometry of(OffsetCurve2d designLine, OffsetFlattener2d flattener, ContinuousPiecewiseLinearFunction offset, ContinuousPiecewiseLinearFunction width) Create geometry based on design line, flattener, offset and width information.- Parameters:
designLine- design line relative to which offsets are definedflattener- flattener to flatten center line and contouroffset- offset informationwidth- offset information- Returns:
- geometry for cross-section element
-
getLocation
Returns the location.- Returns:
- returns the location of this geometry
-
getRelativeContour
Returns the relative contour.- Returns:
- relative contour
-
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. -
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. -
equals
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 withObjects::equals(Object,Object). -
centerLine
Returns the value of thecenterLinerecord component.- Returns:
- the value of the
centerLinerecord component
-
absoluteContour
Returns the value of theabsoluteContourrecord component.- Returns:
- the value of the
absoluteContourrecord component
-
offset
Returns the value of theoffsetrecord component.- Returns:
- the value of the
offsetrecord component
-
width
Returns the value of thewidthrecord component.- Returns:
- the value of the
widthrecord component
-