View Javadoc
1   package org.opentrafficsim.editor.extensions.map;
2   
3   import org.djunits.value.vdouble.scalar.Length;
4   import org.djutils.draw.line.PolyLine2d;
5   import org.djutils.draw.line.Polygon2d;
6   import org.opentrafficsim.draw.road.CrossSectionElementAnimation.ShoulderData;
7   import org.opentrafficsim.editor.XsdTreeNode;
8   import org.opentrafficsim.road.network.lane.SliceInfo;
9   
10  /**
11   * Shoulder data for in the editor. Implements {@code ShoulderData} additionally to extending {@code EditorCrossSectionData}.
12   * <p>
13   * Copyright (c) 2023-2024 Delft University of Technology, PO Box 5, 2600 AA, Delft, the Netherlands. All rights reserved. <br>
14   * BSD-style license. See <a href="https://opentrafficsim.org/docs/license.html">OpenTrafficSim License</a>.
15   * </p>
16   * @author <a href="https://github.com/wjschakel">Wouter Schakel</a>
17   */
18  public class MapShoulderData extends MapCrossSectionData implements ShoulderData
19  {
20  
21      /** Start offset. */
22      private final Length startOffset;
23  
24      /**
25       * Constructor.
26       * @param startOffset Length; start offset.
27       * @param linkNode XsdTreeNode; node representing the element.
28       * @param centerLine PolyLine2d; center line.
29       * @param contour PolyLine2d; contour.
30       * @param sliceInfo SliceInfo; slice info.
31       */
32      public MapShoulderData(final Length startOffset, final XsdTreeNode linkNode, final PolyLine2d centerLine,
33              final Polygon2d contour, final SliceInfo sliceInfo)
34      {
35          super(linkNode, centerLine, contour, sliceInfo);
36          this.startOffset = startOffset;
37      }
38  
39      /** {@inheritDoc} */
40      @Override
41      public String toString()
42      {
43          return "Shoulder " + getLinkId() + " " + this.startOffset;
44      }
45  
46  }