Package org.opentrafficsim.core
Interface DynamicSpatialObject
- All Superinterfaces:
SpatialObject
- All Known Implementing Classes:
Gtu
DynamicSpatialObject has two shapes: the shape that is registered in the Map is the shape that indicates where the object
can be present for the time frame for which intersections can be calculated. This is, for instance, a contour that
indicates the Minkowski sum of the locations of a GTU for the next time step. This contour IS registered in the spatial tree.
The getShape(time), however, provides the exact shape of the GTU at a fixed time instant. This contour is NOT registered in
the spatial tree.
Copyright (c) 2022-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 Summary
Modifier and TypeMethodDescriptionorg.djutils.draw.line.Polygon2d
getShape
(org.djunits.value.vdouble.scalar.Time time) Return the shape of a dynamic object at time 'time'.default org.djutils.draw.line.Polygon2d
transformShape
(org.djutils.draw.line.Polygon2d shape, org.djutils.draw.point.OrientedPoint2d p) Return the contour of the dynamic object at the right position and in the right direction.Methods inherited from interface org.opentrafficsim.core.SpatialObject
getShape
-
Method Details
-
getShape
org.djutils.draw.line.Polygon2d getShape(org.djunits.value.vdouble.scalar.Time time) Return the shape of a dynamic object at time 'time'. Note that the getShape() method without a time returns the Minkowski sum of all shapes of the spatial object for a validity time window, e.g., a contour that describes all locations of a GTU for the next time step, i.e., the contour of the GTU belonging to the next operational plan.- Parameters:
time
- Time; the time for which we want the shape- Returns:
- OtsShape; the shape of the object at time 'time'
-
transformShape
default org.djutils.draw.line.Polygon2d transformShape(org.djutils.draw.line.Polygon2d shape, org.djutils.draw.point.OrientedPoint2d p) throws OtsGeometryException Return the contour of the dynamic object at the right position and in the right direction.- Parameters:
shape
- OtsShape; the shape to translate and rotate for point pp
- OrientedPoint2d; the location and direction of the reference point of the object- Returns:
- Polygon2d; the contour of the dynamic object at the right position and in the right direction
- Throws:
OtsGeometryException
- on invalid geometry after transformation
-