Class ClickableBounds

java.lang.Object
org.opentrafficsim.base.geometry.ClickableBounds

public class ClickableBounds extends Object
Creates bounds that are at least 2m of size in the x and y direction, useful for animation objects a user may click on.

Copyright (c) 2023-2024 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
  • Method Details

    • get

      public static OtsBounds2d get(org.djutils.draw.bounds.Bounds<?,?,?> bounds)
      Creates bounds that are at least 2m of size in the x and y direction.
      Parameters:
      bounds - Bounds<?, ?, ?>; actual object bounds.
      Returns:
      Bounds<?, ?, ?>; bounds that are at least 2m of size in the x and y direction.
    • get

      public static BoundingPolygon get(org.djutils.draw.line.PolyLine2d flattenedLine)
      Creates bounds that are clickable from a line, generating an area of 2m wide.
      Parameters:
      flattenedLine - PolyLine2d; line.
      Returns:
      BoundingPolygon; bounding polygon.