org.jzy3d.plot3d.builder.delaunay.jdt
Class BoundingBox

java.lang.Object
  extended by org.jzy3d.plot3d.builder.delaunay.jdt.BoundingBox

public class BoundingBox
extends java.lang.Object

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 the bounded geometry


Constructor Summary
BoundingBox()
          Creates an empty bounding box
BoundingBox(BoundingBox other)
          Copy constructor
BoundingBox(double minx, double maxx, double miny, double maxy)
          Creates a bounding box given the extent
BoundingBox(Point_dt lowerLeft, Point_dt upperRight)
          Create a bounding box between lowerLeft and upperRight
 
Method Summary
 boolean contains(BoundingBox other)
          Tests if the other BoundingBox lies wholely inside this BoundingBox
 double getHeight()
           
 Point_dt getMaxPoint()
           
 Point_dt getMinPoint()
           
 double getWidth()
           
 boolean isNull()
          Returns true if this BoundingBox is a "null" envelope.
 double maxX()
           
 double maxY()
           
 double minX()
           
 double minY()
           
 BoundingBox unionWith(BoundingBox other)
          Unify the BoundingBoxes of this and the other BoundingBox
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

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)
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_dt lowerLeft,
                   Point_dt 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_dt getMinPoint()
Returns:
Maximum coordinate of bounding box

getMaxPoint

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