View Javadoc
1   package org.djutils.draw;
2   
3   import org.djutils.draw.bounds.Bounds2d;
4   import org.djutils.draw.point.Point2d;
5   
6   /**
7    * Drawable2d is the interface that all drawable objects that use 2D coordinates must implement.
8    * <p>
9    * Copyright (c) 2020-2024 Delft University of Technology, PO Box 5, 2600 AA, Delft, the Netherlands. All rights reserved. <br>
10   * BSD-style license. See <a href="https://djutils.org/docs/current/djutils/licenses.html">DJUTILS License</a>.
11   * </p>
12   * @author <a href="https://www.tudelft.nl/averbraeck">Alexander Verbraeck</a>
13   * @author <a href="https://www.tudelft.nl/pknoppers">Peter Knoppers</a>
14   */
15  public interface Drawable2d extends Drawable<Point2d>
16  {
17      /**
18       * Retrieve the bounding rectangle of the object.
19       * @return Bounds2d; the bounding box of the object
20       */
21      Bounds2d getBounds();
22  
23      @Override
24      default int getDimensions()
25      {
26          return 2;
27      }
28  
29  }