Package il.ac.idc.jdt
Class BoundingBox
java.lang.Object
il.ac.idc.jdt.BoundingBox
- All Implemented Interfaces:
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:
-
Constructor Summary
ConstructorsConstructorDescriptionCreates 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
Modifier and TypeMethodDescriptionbooleancontains(BoundingBox other) Tests if the other BoundingBox lies wholely inside this BoundingBoxdoubledoublegetWidth()booleanisNull()Returns true if this BoundingBox is a "null" envelope.doublemaxX()doublemaxY()doubleminX()doubleminY()toString()unionWith(BoundingBox other) Unify the BoundingBoxes of this and the other BoundingBox
-
Constructor Details
-
BoundingBox
public BoundingBox()Creates an empty bounding box -
BoundingBox
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
-
BoundingBox
Create a bounding box between lowerLeft and upperRight- Parameters:
lowerLeft- lower left point of the boxupperRight- upper left point of the box
-
-
Method Details
-
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
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
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
-
toString
-
getMinPoint
- Returns:
- Maximum coordinate of bounding box
-
getMaxPoint
- Returns:
- Minimum coordinate of bounding box
-