math.geom3d
Class Box3D

Package class diagram package Box3D
java.lang.Object
  extended by math.geom3d.Box3D

public class Box3D
extends Object

Author:
dlegland

Constructor Summary
Box3D()
          Empty constructor (size and position zero)
Box3D(double x0, double x1, double y0, double y1, double z0, double z1)
          Main constructor, given bounds for x coord, bounds for y coord, and bounds for z coord.
Box3D(Point3D p1, Point3D p2)
          Constructor from 2 points, giving extreme coordinates of the box.
Box3D(javax.vecmath.Tuple3d p1, javax.vecmath.Tuple3d p2)
           
 
Method Summary
 double getDepth()
          Returns the depth, i.e. the difference between the min and max z coord
 double getHeight()
          Returns the height, i.e. the difference between the min and max y coord
 double getMaxX()
           
 double getMaxY()
           
 double getMaxZ()
           
 double getMinX()
           
 double getMinY()
           
 double getMinZ()
           
 double getWidth()
          Returns the width, i.e. the difference between the min and max x coord
 Box3D intersection(Box3D box)
          Returns the Box2D which is contained both by this box and by the specified box.
 Box3D union(Box3D box)
          Returns the Box2D which contains both this box and the specified box.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Box3D

public Box3D()
Empty constructor (size and position zero)


Box3D

public Box3D(double x0,
             double x1,
             double y0,
             double y1,
             double z0,
             double z1)
Main constructor, given bounds for x coord, bounds for y coord, and bounds for z coord. A check is performed to ensure first bound is lower than second bound.


Box3D

public Box3D(Point3D p1,
             Point3D p2)
Constructor from 2 points, giving extreme coordinates of the box.


Box3D

public Box3D(javax.vecmath.Tuple3d p1,
             javax.vecmath.Tuple3d p2)
Method Detail

getMinX

public double getMinX()

getMaxX

public double getMaxX()

getMinY

public double getMinY()

getMaxY

public double getMaxY()

getMinZ

public double getMinZ()

getMaxZ

public double getMaxZ()

getWidth

public double getWidth()
Returns the width, i.e. the difference between the min and max x coord


getHeight

public double getHeight()
Returns the height, i.e. the difference between the min and max y coord


getDepth

public double getDepth()
Returns the depth, i.e. the difference between the min and max z coord


union

public Box3D union(Box3D box)
Returns the Box2D which contains both this box and the specified box.

Parameters:
box - the bounding box to include
Returns:
this

intersection

public Box3D intersection(Box3D box)
Returns the Box2D which is contained both by this box and by the specified box.

Parameters:
box - the bounding box to include
Returns:
this


Copyright © 2012 AMIS research group, Faculty of Mathematics and Physics, Charles University in Prague, Czech Republic. All Rights Reserved.