Package org.opentrafficsim.base.geometry
Interface OtsLocatable
- All Superinterfaces:
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 TypeMethodDescriptionstatic org.djutils.draw.line.Polygon2dboundsAsContour(OtsLocatable locatable) Generates a polygon as contour based on bounds and location of the locatable.static org.djutils.draw.bounds.Bounds2dcontourAsBounds(OtsLocatable locatable) Generates bounds based on polygon and location of the locatable.org.djutils.draw.bounds.Bounds2dReturns the bounds relative to the location.org.djutils.draw.point.Point2ddefault OtsShapegetShape()Returns the shape relative to the location.static org.djutils.draw.line.Polygon2drelativeContour(OtsLocatable locatable) Returns the contour of the locatable translated and rotated such that it is defined relative to the location.static org.djutils.draw.Transform2dtoBoundsTransform(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.Transform2dtoContourTransform(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.Polygon2dtransformContour(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 anOrientedPointfor rotation.static org.djutils.draw.line.PolyLine2dtransformLine(org.djutils.draw.line.PolyLine2d line, org.djutils.draw.point.Point2d location) Transform the line by location, which may also be anOrientedPointfor rotation.Methods inherited from interface nl.tudelft.simulation.dsol.animation.Locatable
getDirZ, getZMethods inherited from interface org.opentrafficsim.base.geometry.SpatialObject
getContour
-
Method Details
-
getLocation
org.djutils.draw.point.Point2d getLocation()- Specified by:
getLocationin interfacenl.tudelft.simulation.dsol.animation.Locatable
-
getBounds
org.djutils.draw.bounds.Bounds2d getBounds()Returns the bounds relative to the location.- Specified by:
getBoundsin interfacenl.tudelft.simulation.dsol.animation.Locatable- Returns:
- bounds relative to the location.
-
getShape
Returns the shape relative to the location.- Returns:
- the shape relative to the location.
-
boundsAsContour
Generates a polygon as contour based on bounds and location of the locatable.- Parameters:
locatable- locatable- Returns:
- contour
-
contourAsBounds
Generates bounds based on polygon and location of the locatable.- Parameters:
locatable- locatable- Returns:
- bounds
-
relativeContour
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 anOrientedPointfor rotation.- Parameters:
contour- contourlocation- location, which may also be anOrientedPointfor 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 anOrientedPointfor rotation.- Parameters:
line- linelocation- location, which may also be anOrientedPointfor 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 anOriented).- 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 anOriented).- Returns:
- transformation.
-