Package org.opentrafficsim.base.geometry
Interface OtsBounds2d
- All Superinterfaces:
org.djutils.draw.bounds.Bounds<OtsBounds2d,org.djutils.draw.point.Point2d, org.djutils.draw.Drawable2d>
- All Known Implementing Classes:
BoundingBox,BoundingBoxRounded,BoundingCircle,BoundingPolygon,BoundingRectangle
public interface OtsBounds2d
extends org.djutils.draw.bounds.Bounds<OtsBounds2d,org.djutils.draw.point.Point2d,org.djutils.draw.Drawable2d>
Bounds for generic usage within the OTS context. All input is assumed to be transformed to this bound's space. Default
methods use the polygon representation of the bounds. For many shapes there may be faster methods to determine information.
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
FieldsModifier and TypeFieldDescriptionstatic final org.djutils.draw.point.Point2dStandard mid point. -
Method Summary
Modifier and TypeMethodDescriptionorg.djutils.draw.line.Polygon2dReturns a polygon representation of the bounds, such that an intersection can be derived.default booleancontains(org.djutils.draw.Drawable2d drawable) default booleancontains(org.djutils.draw.point.Point2d point) default booleancovers(org.djutils.draw.Drawable2d drawable) default booleancovers(org.djutils.draw.point.Point2d point) default booleandisjoint(org.djutils.draw.Drawable2d drawable) default doublegetMaxX()default doublegetMaxY()default doublegetMinX()default doublegetMinY()default OtsBounds2dintersection(OtsBounds2d otherBounds) default booleanintersects(OtsBounds2d otherBounds) default org.djutils.draw.point.Point2dmidPoint()default doublesignedDistance(org.djutils.draw.point.Point2d point) Signed distance function.Methods inherited from interface org.djutils.draw.bounds.Bounds
getDeltaX, getDeltaY
-
Field Details
-
CENTER
static final org.djutils.draw.point.Point2d CENTERStandard mid point.
-
-
Method Details
-
getMinX
default double getMinX()- Specified by:
getMinXin interfaceorg.djutils.draw.bounds.Bounds<OtsBounds2d,org.djutils.draw.point.Point2d, org.djutils.draw.Drawable2d>
-
getMaxX
default double getMaxX()- Specified by:
getMaxXin interfaceorg.djutils.draw.bounds.Bounds<OtsBounds2d,org.djutils.draw.point.Point2d, org.djutils.draw.Drawable2d>
-
getMinY
default double getMinY()- Specified by:
getMinYin interfaceorg.djutils.draw.bounds.Bounds<OtsBounds2d,org.djutils.draw.point.Point2d, org.djutils.draw.Drawable2d>
-
getMaxY
default double getMaxY()- Specified by:
getMaxYin interfaceorg.djutils.draw.bounds.Bounds<OtsBounds2d,org.djutils.draw.point.Point2d, org.djutils.draw.Drawable2d>
-
midPoint
default org.djutils.draw.point.Point2d midPoint()- Specified by:
midPointin interfaceorg.djutils.draw.bounds.Bounds<OtsBounds2d,org.djutils.draw.point.Point2d, org.djutils.draw.Drawable2d>
-
contains
- Specified by:
containsin interfaceorg.djutils.draw.bounds.Bounds<OtsBounds2d,org.djutils.draw.point.Point2d, org.djutils.draw.Drawable2d> - Throws:
NullPointerException
-
covers
- Specified by:
coversin interfaceorg.djutils.draw.bounds.Bounds<OtsBounds2d,org.djutils.draw.point.Point2d, org.djutils.draw.Drawable2d> - Throws:
NullPointerException
-
covers
- Specified by:
coversin interfaceorg.djutils.draw.bounds.Bounds<OtsBounds2d,org.djutils.draw.point.Point2d, org.djutils.draw.Drawable2d> - Throws:
NullPointerException
-
contains
- Specified by:
containsin interfaceorg.djutils.draw.bounds.Bounds<OtsBounds2d,org.djutils.draw.point.Point2d, org.djutils.draw.Drawable2d> - Throws:
NullPointerException
-
disjoint
- Specified by:
disjointin interfaceorg.djutils.draw.bounds.Bounds<OtsBounds2d,org.djutils.draw.point.Point2d, org.djutils.draw.Drawable2d> - Throws:
NullPointerException
-
intersects
- Specified by:
intersectsin interfaceorg.djutils.draw.bounds.Bounds<OtsBounds2d,org.djutils.draw.point.Point2d, org.djutils.draw.Drawable2d>
-
intersection
- Specified by:
intersectionin interfaceorg.djutils.draw.bounds.Bounds<OtsBounds2d,org.djutils.draw.point.Point2d, org.djutils.draw.Drawable2d>
-
asPolygon
org.djutils.draw.line.Polygon2d asPolygon()Returns a polygon representation of the bounds, such that an intersection can be derived.- Returns:
- Polygon2d; polygon representation of the bounds.
-
signedDistance
default double signedDistance(org.djutils.draw.point.Point2d point) Signed distance function. The coordinates must be transformed to this bound's space. Negative distances returned are inside the bounds, with the absolute value of the distance towards the edge. The default implementation is based on the polygon representation and is expensive.- Parameters:
point- Point2d; point for which distance is returned.- Returns:
- double; distance from point to these bounds.
-