Class BaseBounds

java.lang.Object
com.sun.javafx.geom.BaseBounds
Direct Known Subclasses:
BoxBounds, RectBounds

public abstract class BaseBounds extends Object
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).
  • Method Details

    • copy

      public abstract BaseBounds 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

      public abstract BaseBounds.BoundsType 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

      public abstract BaseBounds deriveWithUnion(BaseBounds other)
    • deriveWithNewBounds

      public abstract BaseBounds deriveWithNewBounds(BaseBounds other)
    • 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

      public abstract BaseBounds deriveWithPadding(float h, float v, float d)
    • intersectWith

      public abstract void intersectWith(BaseBounds other)
    • intersectWith

      public abstract void intersectWith(float minX, float minY, float minZ, float maxX, float maxY, float maxZ)
    • setBoundsAndSort

      public 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).
    • setBoundsAndSort

      public abstract void setBoundsAndSort(float minX, float minY, float minZ, float maxX, float maxY, float maxZ)
    • add

      public abstract void add(Point2D p)
    • add

      public abstract void add(float x, float y, float z)
    • contains

      public abstract boolean contains(Point2D p)
    • 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

      public 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.
      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

      public abstract BaseBounds 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

      public static BaseBounds getInstance(float minX, float minY, float maxX, float maxY)