Class ASQuad


  • public class ASQuad
    extends ASObject
    ASQuad represents a convex quadrilateral. An ASQuad is typically used to represent a bounding box (a rectangle) which has undergone an affine transformation (e.g., scaled, rotated, skewed, etc.). In this sense, the coordinate tags (p1, p2, p3, p4) do not necessarily correspond to the actual relative location of the coordinates. Instead, they correspond to the logical corners of the object encased in the quad. For instance, a word has a natural bounding box (rectangle) with a well- defined upper-left, upper-right, lower-left, and lower-right corners. When rotated 45 degrees, the coordinates of the quad rotate with the word and the tags are considered affixed to the bounding box of the word.
    • Constructor Detail

      • ASQuad

        public ASQuad​(ASCoordinate p1,
                      ASCoordinate p2,
                      ASCoordinate p3,
                      ASCoordinate p4)
        Parameters:
        p1 - lower-left corner relative to the object enclosed by the quad
        p2 - lower-right corner relative to the object enclosed by the quad
        p3 - upper-right corner relative to the object enclosed by the quad
        p4 - upper-left corner relative to the object enclosed by the quad
      • ASQuad

        public ASQuad​(ASRectangle rect)
        Construct a quad from a rectangle
        Parameters:
        rect -
      • ASQuad

        public ASQuad​(ASQuad quad)
        Copy constructor
        Parameters:
        quad -
    • Method Detail

      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object
      • getMinX

        public double getMinX()
      • getMaxX

        public double getMaxX()
      • getMinY

        public double getMinY()
      • getMaxY

        public double getMaxY()