Maven module :un.api : api-geometry :
Class : un.api.geometry.BBox
Extends/Implements : un.impl.geometry.AbstractGeometry
Subclasses : -

N dimension bounding box.
author  Johann Sorel


Variables : dimension, upper, lower
Functions : BBox, BBox, BBox, BBox, BBox, getDimension, getUpper, getLower, getMiddle, getMin, getMiddle, getMax, getSpan, getExtent, getCorners3D, set, setRange, expand, expand, expand, expand, expand, expand, expand, expand, expand, grow, isEmpty, setToZero, setToNaN, isValid, reorder, getBoundingBox, getCentroid, equals, toChars, intersects, intersects, intersects, intersects, intersects, contains, localIntersect


protected int dimension

protected Tuple upper

protected Tuple lower


public void BBox (int dimension)

public void BBox (double[] min, double[] max)

public void BBox (Tuple lower, Tuple upper)

public void BBox (BBox other)

public void BBox (Extent extent)

public int getDimension ()

public Tuple getUpper ()

public Tuple getLower ()

public Tuple getMiddle ()

public double getMin (int ordinate)

public double getMiddle (int ordinate)

public double getMax (int ordinate)

public double getSpan (int ordinate)

public Extent getExtent ()

public Tuple[] getCorners3D (Tuple[] corners)


Copy values from given bounding box.
param  bbox not null
public void set (BBox bbox)

public void setRange (int ordinate, double min, double max)


Grow this bounding to contain the given one.
param  bbox
public void expand (BBox bbox)


Grow this bounding to contain the given point.
param  point
public void expand (Tuple point)


Grow this bounding to contain the given point.
param  point
public void expand (double[] point)


Grow this bounding to contain all tuples in buffer.
param  buffer
public void expand (TupleBuffer buffer)


Grow this bounding to contain the given point.
param  point
public void expand (float[] point)

public void expand (double px)

public void expand (double px, double py)

public void expand (double px, double py, double pz)

public void expand (double px, double py, double pz, double pw)


Expand the bbox in all directions by given amount.
public void grow (double amount)


return  true if lower corner equals upper corner.
public boolean isEmpty ()


Set all values to zero
public void setToZero ()


Set all values to NaN.
public void setToNaN ()


Check that all values are not NaN or Infinites.
return  true if valid
public boolean isValid ()


Reorder values, ensure min/max values are in
lower/upper corners.
public void reorder ()

public BBox getBoundingBox ()

public Point getCentroid ()

public boolean equals (Object obj)

public Chars toChars ()

public boolean intersects (Tuple coord)

public boolean intersects (Tuple coord, boolean includeBorder)

public boolean intersects (BBox bbox)

public boolean intersects (BBox bbox, boolean includeBorder)


Test intersection with an Extent.
The extent is interpreted as a BBox starting at coordinate zero on each dimension.
TODO : make extent a geometry ?
param  extent
param  includeBorder
return
public boolean intersects (Extent extent, boolean includeBorder)

public boolean contains (BBox bbox)


Intersect this bbox with given one, store the result in this bbox.
This method does not perform any verification.
param  bbox
return
public void localIntersect (BBox bbox)