Interface ClickableLocatable

All Superinterfaces:
nl.tudelft.simulation.dsol.animation.Locatable, org.opentrafficsim.base.geometry.OtsLocatable, org.opentrafficsim.base.geometry.SpatialObject
All Known Subinterfaces:
AbstractLineAnimation.LaneBasedObjectData, BusStopAnimation.BusStopData, ClickableLineLocatable, ClickablePointLocatable, ConflictAnimation.ConflictData, CrossSectionElementAnimation.CrossSectionElementData, CrossSectionElementAnimation.ShoulderData, DetectorData, GtuGeneratorPositionAnimation.GtuGeneratorPositionData, LaneAnimation.LaneData, LaneDetectorAnimation.LaneDetectorData, LaneDetectorAnimation.LoopDetectorData, LaneDetectorAnimation.SinkData, LinkAnimation.LinkData, NodeAnimation.NodeData, PriorityAnimation.PriorityData, SpeedSignAnimation.SpeedSignData, StaticObjectAnimation.StaticObjectData, StripeAnimation.StripeData, TrafficLightAnimation.TrafficLightData, TrafficLightDetectorAnimation.TrafficLightDetectorData
All Known Implementing Classes:
LaneAnimation.CenterLine

public interface ClickableLocatable extends org.opentrafficsim.base.geometry.OtsLocatable
This class returns bounds that respond to contains(x, y) by checking the actual shape, while also accounting for a minimum clickable expanse. For line objects use ClickableLineLocatable.

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
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static final double
    Minimum expanse to click on object.
  • Method Summary

    Modifier and Type
    Method
    Description
    default org.djutils.draw.bounds.Bounds2d
     
    static org.djutils.draw.bounds.Bounds2d
    Returns bounds that comply to the actual shape.

    Methods inherited from interface nl.tudelft.simulation.dsol.animation.Locatable

    getDirZ, getZ

    Methods inherited from interface org.opentrafficsim.base.geometry.OtsLocatable

    getLocation, getShape

    Methods inherited from interface org.opentrafficsim.base.geometry.SpatialObject

    getContour
  • Field Details

    • EXPANSE

      static final double EXPANSE
      Minimum expanse to click on object.
      See Also:
  • Method Details

    • getBounds

      default org.djutils.draw.bounds.Bounds2d getBounds()
      Specified by:
      getBounds in interface nl.tudelft.simulation.dsol.animation.Locatable
      Specified by:
      getBounds in interface org.opentrafficsim.base.geometry.OtsLocatable
    • getBounds

      static org.djutils.draw.bounds.Bounds2d getBounds(ClickableLocatable locatable)
      Returns bounds that comply to the actual shape.
      Parameters:
      locatable - locatable
      Returns:
      bounds that comply to the actual shape.