Package com.sun.javafx.geom
Class BaseBounds
java.lang.Object
com.sun.javafx.geom.BaseBounds
- Direct Known Subclasses:
BoxBounds
,RectBounds
Base class for mutable bounds objects. There are two concrete specializations,
BoxBounds (3D) and RectBounds (2D). Various "derive" methods exist which are
used to mutate the bounds objects, such that they can be converted between the
different types as appropriate, or modified in place if possible. This allows
us to churn memory as little as possible without representing everything as
if it were in 3D space (there are some computational cost savings to being
able to ignore the Z values).
-
Nested Class Summary
Modifier and TypeClassDescriptionstatic enum
The different types of BaseBounds that are currently supported. -
Method Summary
Modifier and TypeMethodDescriptionabstract void
add
(float x, float y, float z) abstract void
abstract boolean
contains
(float x, float y) abstract boolean
abstract BaseBounds
copy()
Duplicates this instance.abstract BaseBounds
deriveWithNewBounds
(float minX, float minY, float minZ, float maxX, float maxY, float maxZ) abstract BaseBounds
deriveWithNewBounds
(BaseBounds other) abstract BaseBounds
deriveWithNewBoundsAndSort
(float minX, float minY, float minZ, float maxX, float maxY, float maxZ) abstract BaseBounds
deriveWithPadding
(float h, float v, float d) abstract BaseBounds
deriveWithUnion
(BaseBounds other) abstract boolean
disjoint
(float x, float y, float width, float height) abstract RectBounds
flattenInto
(RectBounds bounds) Sets the given RectBounds (or creates a new instance of bounds is null) to have the minX, minY, maxX, and maxY of this BoxBounds, dropping the Z values.abstract BaseBounds.BoundsType
abstract float
getDepth()
Convenience function for getting the depth of this bounds.abstract float
Convenience function for getting the height of this bounds.static BaseBounds
getInstance
(float minX, float minY, float maxX, float maxY) static BaseBounds
getInstance
(float minX, float minY, float minZ, float maxX, float maxY, float maxZ) abstract float
getMaxX()
abstract float
getMaxY()
abstract float
getMaxZ()
abstract float
getMinX()
abstract float
getMinY()
abstract float
getMinZ()
abstract float
getWidth()
Convenience function for getting the width of this bounds.abstract boolean
intersects
(float x, float y, float width, float height) abstract void
intersectWith
(float minX, float minY, float minZ, float maxX, float maxY, float maxZ) abstract void
intersectWith
(BaseBounds other) abstract boolean
is2D()
Return true if this bounds is of a 2D BoundsType, else false.abstract boolean
isEmpty()
abstract BaseBounds
abstract void
roundOut()
abstract void
setBoundsAndSort
(float minX, float minY, float minZ, float maxX, float maxY, float maxZ) abstract void
setBoundsAndSort
(Point2D p1, Point2D p2) Sets the bounds based on the given points, and also ensures that after having done so that this bounds instance is sorted (x1invalid input: '<'=x2 and y1invalid input: '<'=y2).protected abstract void
abstract void
translate
(float x, float y, float z)
-
Method Details
-
copy
Duplicates this instance. This differs from deriveWithNewBounds(other) where "other" would be this, in that derive methods may return the same instance, whereas copy will always return a new instance. -
is2D
public abstract boolean is2D()Return true if this bounds is of a 2D BoundsType, else false. -
getBoundsType
-
getWidth
public abstract float getWidth()Convenience function for getting the width of this bounds. The dimension along the X-Axis. -
getHeight
public abstract float getHeight()Convenience function for getting the height of this bounds. The dimension along the Y-Axis. -
getDepth
public abstract float getDepth()Convenience function for getting the depth of this bounds. The dimension along the Z-Axis. -
getMinX
public abstract float getMinX() -
getMinY
public abstract float getMinY() -
getMinZ
public abstract float getMinZ() -
getMaxX
public abstract float getMaxX() -
getMaxY
public abstract float getMaxY() -
getMaxZ
public abstract float getMaxZ() -
translate
public abstract void translate(float x, float y, float z) -
deriveWithUnion
-
deriveWithNewBounds
-
deriveWithNewBounds
public abstract BaseBounds deriveWithNewBounds(float minX, float minY, float minZ, float maxX, float maxY, float maxZ) -
deriveWithNewBoundsAndSort
public abstract BaseBounds deriveWithNewBoundsAndSort(float minX, float minY, float minZ, float maxX, float maxY, float maxZ) -
deriveWithPadding
-
intersectWith
-
intersectWith
public abstract void intersectWith(float minX, float minY, float minZ, float maxX, float maxY, float maxZ) -
setBoundsAndSort
Sets the bounds based on the given points, and also ensures that after having done so that this bounds instance is sorted (x1invalid input: '<'=x2 and y1invalid input: '<'=y2). -
setBoundsAndSort
public abstract void setBoundsAndSort(float minX, float minY, float minZ, float maxX, float maxY, float maxZ) -
add
-
add
public abstract void add(float x, float y, float z) -
contains
-
contains
public abstract boolean contains(float x, float y) -
intersects
public abstract boolean intersects(float x, float y, float width, float height) -
isEmpty
public abstract boolean isEmpty() -
roundOut
public abstract void roundOut() -
flattenInto
Sets the given RectBounds (or creates a new instance of bounds is null) to have the minX, minY, maxX, and maxY of this BoxBounds, dropping the Z values.- Parameters:
bounds
- The bounds to fill with values, or null. If null, a new RectBounds is returned. If not null, the given bounds will be populated and then returned- Returns:
- a non-null reference to a RectBounds containing the minX, minY, maxX, and maxY of this BoxBounds.
-
makeEmpty
-
disjoint
public abstract boolean disjoint(float x, float y, float width, float height) -
sortMinMax
protected abstract void sortMinMax() -
getInstance
public static BaseBounds getInstance(float minX, float minY, float minZ, float maxX, float maxY, float maxZ) -
getInstance
-