Package il.ac.idc.jdt
Class BoundingBox
- java.lang.Object
-
- il.ac.idc.jdt.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 Summary
Constructors Constructor Description BoundingBox()
Creates an empty bounding boxBoundingBox(double minx, double maxx, double miny, double maxy, double minz, double maxz)
Creates a bounding box given the extentBoundingBox(BoundingBox other)
Copy constructorBoundingBox(Point lowerLeft, Point upperRight)
Create a bounding box between lowerLeft and upperRight
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
contains(BoundingBox other)
Tests if the other BoundingBox lies wholely inside this BoundingBoxdouble
getHeight()
Point
getMaxPoint()
Point
getMinPoint()
double
getWidth()
boolean
isNull()
Returns true if this BoundingBox is a "null" envelope.double
maxX()
double
maxY()
double
minX()
double
minY()
String
toString()
BoundingBox
unionWith(BoundingBox other)
Unify the BoundingBoxes of this and the other BoundingBox
-
-
-
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 coordinatemaxx
- maximum x coordinateminy
- minimum y coordinatemaxy
- maximum y coordinate
-
-
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
-
-