Package org.faceless.graph
Class BoundingBox
- java.lang.Object
-
- org.faceless.graph.BoundingBox
-
public final class BoundingBox extends Object
A
BoundingBoxis a simple cube which is used to define the "Bounding Box", or the smallest cube that contains a object, on aCanvas.This class is used internally by the library and is of no interest to end users
-
-
Constructor Summary
Constructors Constructor Description BoundingBox(Point[] p)BoundingBox(Point p1, Point p2)Create a new Bounding Box with one corner at p1 and the other at p2
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Pointcenter()Return the center of the boxbooleancontains(BoundingBox b)Returns true if this contains the specified bounding box.voidexpand(Point p)Expand a box to include the specified pointdoublegetDepth()Return the depth of this boxdoublegetHeight()Return the height of this boxdoublegetMaxX()Return the hightest X value of this boxdoublegetMaxY()Return the hightest Y value of this boxdoublegetMaxZ()Return the hightest Z value of this boxdoublegetMinX()Return the lowest X value of this boxdoublegetMinY()Return the lowest Y value of this boxdoublegetMinZ()Return the lowest Z value of this boxdoublegetWidth()Return the width of this boxBoundingBoxintersection(BoundingBox b)Return a new bounding box that is the intersection of this and the specified box.BoundingBoxsuperset(BoundingBox b)Return the smallest bounding box that contains this box and the box passed as a parameter.StringtoString()
-
-
-
Method Detail
-
expand
public void expand(Point p)
Expand a box to include the specified point
-
contains
public boolean contains(BoundingBox b)
Returns true if this contains the specified bounding box.
-
superset
public BoundingBox superset(BoundingBox b)
Return the smallest bounding box that contains this box and the box passed as a parameter.
-
intersection
public BoundingBox intersection(BoundingBox b)
Return a new bounding box that is the intersection of this and the specified box. Returns null if no intersection exists
-
center
public Point center()
Return the center of the box
-
getMinX
public double getMinX()
Return the lowest X value of this box
-
getMinY
public double getMinY()
Return the lowest Y value of this box
-
getMinZ
public double getMinZ()
Return the lowest Z value of this box
-
getMaxX
public double getMaxX()
Return the hightest X value of this box
-
getMaxY
public double getMaxY()
Return the hightest Y value of this box
-
getMaxZ
public double getMaxZ()
Return the hightest Z value of this box
-
getWidth
public double getWidth()
Return the width of this box
-
getHeight
public double getHeight()
Return the height of this box
-
getDepth
public double getDepth()
Return the depth of this box
-
-