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
Nested ClassesModifier and TypeClassDescriptionstatic enumThe different types of BaseBounds that are currently supported. -
Method Summary
Modifier and TypeMethodDescriptionabstract voidadd(float x, float y, float z) abstract voidabstract booleancontains(float x, float y) abstract booleanabstract BaseBoundscopy()Duplicates this instance.abstract BaseBoundsderiveWithNewBounds(float minX, float minY, float minZ, float maxX, float maxY, float maxZ) abstract BaseBoundsderiveWithNewBounds(BaseBounds other) abstract BaseBoundsderiveWithNewBoundsAndSort(float minX, float minY, float minZ, float maxX, float maxY, float maxZ) abstract BaseBoundsderiveWithPadding(float h, float v, float d) abstract BaseBoundsderiveWithUnion(BaseBounds other) abstract booleandisjoint(float x, float y, float width, float height) abstract RectBoundsflattenInto(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.BoundsTypeabstract floatgetDepth()Convenience function for getting the depth of this bounds.abstract floatConvenience function for getting the height of this bounds.static BaseBoundsgetInstance(float minX, float minY, float maxX, float maxY) static BaseBoundsgetInstance(float minX, float minY, float minZ, float maxX, float maxY, float maxZ) abstract floatgetMaxX()abstract floatgetMaxY()abstract floatgetMaxZ()abstract floatgetMinX()abstract floatgetMinY()abstract floatgetMinZ()abstract floatgetWidth()Convenience function for getting the width of this bounds.abstract booleanintersects(float x, float y, float width, float height) abstract voidintersectWith(float minX, float minY, float minZ, float maxX, float maxY, float maxZ) abstract voidintersectWith(BaseBounds other) abstract booleanis2D()Return true if this bounds is of a 2D BoundsType, else false.abstract booleanisEmpty()abstract BaseBoundsabstract voidroundOut()abstract voidsetBoundsAndSort(float minX, float minY, float minZ, float maxX, float maxY, float maxZ) abstract voidsetBoundsAndSort(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 voidabstract voidtranslate(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
-