Class Shape2d
java.lang.Object
nl.tudelft.simulation.language.d2.Shape2d
Shape utilities for world coordinates.
Copyright (c) 2002-2025 Delft University of Technology, Jaffalaan 5, 2628 BX Delft, the Netherlands. All rights reserved. See for project information DSOL Manual. The DSOL project is distributed under a three-clause BSD-style license, which can be found at DSOL License.
- Author:
- Peter Jacobs
-
Method Summary
Modifier and TypeMethodDescriptionstatic booleancontains(org.djutils.draw.bounds.Bounds2d r1, org.djutils.draw.bounds.Bounds2d r2) is r1 completely in r2.static booleanintersects(org.djutils.draw.bounds.Bounds2d r1, org.djutils.draw.bounds.Bounds2d r2) do the rectangles really intersect (so, not being contained)?static booleanoverlaps(org.djutils.draw.bounds.Bounds2d extent, org.djutils.draw.bounds.Bounds2d shape) overlaps extent and shape.
-
Method Details
-
overlaps
public static boolean overlaps(org.djutils.draw.bounds.Bounds2d extent, org.djutils.draw.bounds.Bounds2d shape) overlaps extent and shape. Overlap = Intersect + Contain- Parameters:
extent- the extentshape- the shape- Returns:
- whether extent overlaps shape
-
intersects
public static boolean intersects(org.djutils.draw.bounds.Bounds2d r1, org.djutils.draw.bounds.Bounds2d r2) do the rectangles really intersect (so, not being contained)?- Parameters:
r1- the first rectangler2- the second rectangle- Returns:
- whether r1 really intersects r2
-
contains
public static boolean contains(org.djutils.draw.bounds.Bounds2d r1, org.djutils.draw.bounds.Bounds2d r2) is r1 completely in r2.- Parameters:
r1- the first rectangler2- the second rectangle- Returns:
- whether r1 in r2
-