Class Rect

  • public final class Rect
    extends java.lang.Object
    A bounding box.

    AFE's coordinates are in y-positive. Values are: xmin, ymin, xmax, ymax where xmin <= xmax and ymin <= ymax.


    These objects are immutable.

    • Field Summary

      Modifier and Type Field Description
      static Rect emptyRect
      A rectangle with xmin = ymin = xmax = ymax = 0.
      double xmax  
      double xmin  
      double ymax  
      double ymin  
    • Constructor Summary

      Constructor Description
      Rect​(double[] vals)
      Create a Rect from an array of doubles.
      Rect​(double xmin, double ymin, double xmax, double ymax)  
    • Field Detail

      • xmin

        public final double xmin
      • ymin

        public final double ymin
      • xmax

        public final double xmax
      • ymax

        public final double ymax
      • emptyRect

        public static final Rect emptyRect
        A rectangle with xmin = ymin = xmax = ymax = 0.
    • Constructor Detail

      • Rect

        public Rect​(double xmin,
                    double ymin,
                    double xmax,
                    double ymax)
      • Rect

        public Rect​(double[] vals)
        Create a Rect from an array of doubles.
        vals - An array of length 4 whose entries are in the order xmin, ymin, xmax, ymax.
    • Method Detail

      • applyMatrix

        public Rect applyMatrix​(Matrix m)
        Convert this Rect through a matrix.
        m - the matrix
        the transformed bounding box
      • toEmSpace

        public Rect toEmSpace​(double unitsPerEmX,
                              double unitsPerEmY)
      • toDesignSpace

        public Rect toDesignSpace​(double unitsPerEmX,
                                  double unitsPerEmY)
      • toString

        public java.lang.String toString()
        toString in class java.lang.Object
      • equals

        public boolean equals​(java.lang.Object obj)
        equals in class java.lang.Object
      • hashCode

        public int hashCode()
        hashCode in class java.lang.Object