Interface OtsLocatable

All Superinterfaces:
nl.tudelft.simulation.dsol.animation.Locatable, SpatialObject

public interface OtsLocatable extends nl.tudelft.simulation.dsol.animation.Locatable, SpatialObject
Locatable that specifies return types.

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

    Modifier and Type
    Method
    Description
    static org.djutils.draw.line.Polygon2d
    Generates a polygon as contour based on bounds and location of the locatable.
    static org.djutils.draw.bounds.Bounds2d
    Generates bounds based on polygon and location of the locatable.
    org.djutils.draw.bounds.Bounds2d
    Returns the bounds relative to the location.
    org.djutils.draw.point.Point2d
     
    default OtsShape
    Returns the shape relative to the location.
    static org.djutils.draw.line.Polygon2d
    Returns the contour of the locatable translated and rotated such that it is defined relative to the location.
    static org.djutils.draw.Transform2d
    toBoundsTransform(org.djutils.draw.point.Point2d location)
    Returns a transformation by which absolute coordinates can be translated and rotated to the frame of the possibly oriented location around which bounds are defined.
    static org.djutils.draw.Transform2d
    toContourTransform(org.djutils.draw.point.Point2d location)
    Returns a transformation by which relative coordinates can be translated and rotated to the frame of the possibly oriented location around which bounds are defined.
    static org.djutils.draw.line.Polygon2d
    transformContour(org.djutils.draw.line.Polygon2d contour, org.djutils.draw.point.Point2d location)
    Transform the contour from the location to relative coordinates, which may also be an OrientedPoint for rotation.
    static org.djutils.draw.line.PolyLine2d
    transformLine(org.djutils.draw.line.PolyLine2d line, org.djutils.draw.point.Point2d location)
    Transform the line by location, which may also be an OrientedPoint for rotation.

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

    getDirZ, getZ

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

    getContour
  • Method Details

    • getLocation

      org.djutils.draw.point.Point2d getLocation()
      Specified by:
      getLocation in interface nl.tudelft.simulation.dsol.animation.Locatable
    • getBounds

      org.djutils.draw.bounds.Bounds2d getBounds()
      Returns the bounds relative to the location.
      Specified by:
      getBounds in interface nl.tudelft.simulation.dsol.animation.Locatable
      Returns:
      bounds relative to the location.
    • getShape

      default OtsShape getShape()
      Returns the shape relative to the location.
      Returns:
      the shape relative to the location.
    • boundsAsContour

      static org.djutils.draw.line.Polygon2d boundsAsContour(OtsLocatable locatable)
      Generates a polygon as contour based on bounds and location of the locatable.
      Parameters:
      locatable - locatable
      Returns:
      contour
    • contourAsBounds

      static org.djutils.draw.bounds.Bounds2d contourAsBounds(OtsLocatable locatable)
      Generates bounds based on polygon and location of the locatable.
      Parameters:
      locatable - locatable
      Returns:
      bounds
    • relativeContour

      static org.djutils.draw.line.Polygon2d relativeContour(OtsLocatable locatable)
      Returns the contour of the locatable translated and rotated such that it is defined relative to the location.
      Parameters:
      locatable - locatable
      Returns:
      contour relative to location
    • transformContour

      static org.djutils.draw.line.Polygon2d transformContour(org.djutils.draw.line.Polygon2d contour, org.djutils.draw.point.Point2d location)
      Transform the contour from the location to relative coordinates, which may also be an OrientedPoint for rotation.
      Parameters:
      contour - contour
      location - location, which may also be an OrientedPoint for rotation
      Returns:
      transformed contour
    • transformLine

      static org.djutils.draw.line.PolyLine2d transformLine(org.djutils.draw.line.PolyLine2d line, org.djutils.draw.point.Point2d location)
      Transform the line by location, which may also be an OrientedPoint for rotation.
      Parameters:
      line - line
      location - location, which may also be an OrientedPoint for rotation
      Returns:
      transformed line
    • toBoundsTransform

      static org.djutils.draw.Transform2d toBoundsTransform(org.djutils.draw.point.Point2d location)
      Returns a transformation by which absolute coordinates can be translated and rotated to the frame of the possibly oriented location around which bounds are defined.
      Parameters:
      location - location (can be an Oriented).
      Returns:
      transformation.
    • toContourTransform

      static org.djutils.draw.Transform2d toContourTransform(org.djutils.draw.point.Point2d location)
      Returns a transformation by which relative coordinates can be translated and rotated to the frame of the possibly oriented location around which bounds are defined.
      Parameters:
      location - location (can be an Oriented).
      Returns:
      transformation.