Class BoundingBox
java.lang.Object
org.biojava.nbio.structure.contact.BoundingBox
- All Implemented Interfaces:
Serializable
A bounding box for short cutting some geometrical calculations.
See http://en.wikipedia.org/wiki/Bounding_volume
- Author:
- Jose Duarte
- See Also:
-
Field Summary
-
Constructor Summary
ConstructorDescriptionBoundingBox
(double xmin, double xmax, double ymin, double ymax, double zmin, double zmax) BoundingBox
(javax.vecmath.Point3d[] atoms) Constructs a BoundingBox by calculating maxs and mins of given array of atoms.BoundingBox
(BoundingBox[] boxes) Given a set of bounding boxes returns a bounding box that bounds all of them. -
Method Summary
Modifier and TypeMethodDescriptionboolean
contains
(javax.vecmath.Point3d atom) Check if a given point falls within this boxdouble[]
Returns the dimensions of this bounding box.double[]
getMinMax
(double[] array) Returns an array of size 2 with min and max values of given double arrayboolean
overlaps
(BoundingBox o, double cutoff) Returns true if this bounding box overlaps given one, i.e. they are within one cutoff distance in one of their 3 dimensions.toString()
void
translate
(javax.vecmath.Vector3d translation)
-
Field Details
-
xmin
-
xmax
-
ymin
-
ymax
-
zmin
-
zmax
-
-
Constructor Details
-
BoundingBox
-
BoundingBox
-
BoundingBox
Constructs a BoundingBox by calculating maxs and mins of given array of atoms.- Parameters:
atoms
- the atom array- Throws:
IllegalArgumentException
- if atom array is emptyNullPointerException
- if input is null
-
BoundingBox
Given a set of bounding boxes returns a bounding box that bounds all of them.- Parameters:
boxes
- an array of bounding boxes- Throws:
IllegalArgumentException
- if input array is emptyNullPointerException
- if input is null
-
-
Method Details
-
getDimensions
Returns the dimensions of this bounding box.- Returns:
- a double array (x,y,z) with the dimensions of the box.
-
overlaps
Returns true if this bounding box overlaps given one, i.e. they are within one cutoff distance in one of their 3 dimensions.- Parameters:
cutoff
-- Returns:
-
contains
Check if a given point falls within this box- Parameters:
atom
-- Returns:
-
translate
-
getMinMax
Returns an array of size 2 with min and max values of given double array- Parameters:
array
-- Returns:
-
toString
-