Package il.ac.idc.jdt

Class BoundingBox

  • All Implemented Interfaces:
    Serializable

    public class BoundingBox
    extends Object
    implements Serializable
    Created by IntelliJ IDEA. User: Aviad Segev Date: 22/11/2009 Time: 20:29:56 BoundingBox represents a horizontal bounding rectangle defined by its lower left and upper right point. This is usually used as a rough approximation of@SuppressWarnings("serial") the bounded geometry
    See Also:
    Serialized Form
    • Constructor Detail

      • BoundingBox

        public BoundingBox()
        Creates an empty bounding box
      • BoundingBox

        public BoundingBox​(BoundingBox other)
        Copy constructor
        Parameters:
        other - the copied bounding box
      • BoundingBox

        public BoundingBox​(double minx,
                           double maxx,
                           double miny,
                           double maxy,
                           double minz,
                           double maxz)
        Creates a bounding box given the extent
        Parameters:
        minx - minimum x coordinate
        maxx - maximum x coordinate
        miny - minimum y coordinate
        maxy - maximum y coordinate
      • BoundingBox

        public BoundingBox​(Point lowerLeft,
                           Point upperRight)
        Create a bounding box between lowerLeft and upperRight
        Parameters:
        lowerLeft - lower left point of the box
        upperRight - upper left point of the box
    • Method Detail

      • isNull

        public boolean isNull()
        Returns true if this BoundingBox is a "null" envelope.
        Returns:
        true if this BoundingBox is uninitialized or is the envelope of the empty geometry.
      • contains

        public boolean contains​(BoundingBox other)
        Tests if the other BoundingBox lies wholely inside this BoundingBox
        Parameters:
        other - the BoundingBox to check
        Returns:
        true if this BoundingBox contains the other BoundingBox
      • unionWith

        public BoundingBox unionWith​(BoundingBox other)
        Unify the BoundingBoxes of this and the other BoundingBox
        Parameters:
        other - another BoundingBox
        Returns:
        The union of the two BoundingBoxes
      • minX

        public double minX()
        Returns:
        Minimum x value
      • minY

        public double minY()
        Returns:
        Minimum y value
      • maxX

        public double maxX()
        Returns:
        Maximum x value
      • maxY

        public double maxY()
        Returns:
        Maximum y value
      • getWidth

        public double getWidth()
        Returns:
        Width of the bounding box
      • getHeight

        public double getHeight()
        Returns:
        Height of the bounding box
      • getMinPoint

        public Point getMinPoint()
        Returns:
        Maximum coordinate of bounding box
      • getMaxPoint

        public Point getMaxPoint()
        Returns:
        Minimum coordinate of bounding box