pythagoras.i

## Interface IRectangle

• ### Field Summary

Fields
Modifier and Type Field and Description
`static int` `OUT_BOTTOM`
The bitmask that indicates that a point lies below this rectangle.
`static int` `OUT_LEFT`
The bitmask that indicates that a point lies to the left of this rectangle.
`static int` `OUT_RIGHT`
The bitmask that indicates that a point lies to the right of this rectangle.
`static int` `OUT_TOP`
The bitmask that indicates that a point lies above this rectangle.
• ### Method Summary

All Methods
Modifier and Type Method and Description
`Rectangle` `clone()`
Returns a mutable copy of this rectangle.
`int` `height()`
Returns the height of the framing rectangle.
`Rectangle` ```intersection(int rx, int ry, int rw, int rh)```
Returns the intersection of the specified rectangle and this rectangle (i.e.
`Rectangle` `intersection(IRectangle r)`
Returns the intersection of the supplied rectangle and this rectangle (i.e.
`Point` `location()`
Returns a copy of this rectangle's upper-left corner.
`Point` `location(Point target)`
Initializes the supplied point with this rectangle's upper-left corner.
`int` `maxX()`
Returns the maximum x-coordinate of the framing rectangle.
`int` `maxY()`
Returns the maximum y-coordinate of the framing rectangle.
`int` `minX()`
Returns the minimum x-coordinate of the framing rectangle.
`int` `minY()`
Returns the minimum y-coordinate of the framing rectangle.
`int` ```outcode(int px, int py)```
Returns a set of flags indicating where the specified point lies in relation to the bounds of this rectangle.
`int` `outcode(IPoint point)`
Returns a set of flags indicating where the supplied point lies in relation to the bounds of this rectangle.
`Dimension` `size()`
Returns a copy of this rectangle's size.
`Dimension` `size(Dimension target)`
Initializes the supplied dimension with this rectangle's size.
`Rectangle` `union(IRectangle r)`
Returns the union of the supplied rectangle and this rectangle (i.e.
`int` `width()`
Returns the width of the framing rectangle.
`int` `x()`
Returns the x-coordinate of the upper-left corner of the framing rectangle.
`int` `y()`
Returns the y-coordinate of the upper-left corner of the framing rectangle.
• ### Methods inherited from interface pythagoras.i.IShape

`bounds, bounds, contains, contains, contains, contains, intersects, intersects, isEmpty`
• ### Method Detail

• #### x

`int x()`
Returns the x-coordinate of the upper-left corner of the framing rectangle.
• #### y

`int y()`
Returns the y-coordinate of the upper-left corner of the framing rectangle.
• #### width

`int width()`
Returns the width of the framing rectangle.
• #### height

`int height()`
Returns the height of the framing rectangle.
• #### minX

`int minX()`
Returns the minimum x-coordinate of the framing rectangle.
• #### minY

`int minY()`
Returns the minimum y-coordinate of the framing rectangle.
• #### maxX

`int maxX()`
Returns the maximum x-coordinate of the framing rectangle. Note: this method differs from its floating-point counterparts in that it considers `(x + width - 1)` to be a rectangle's maximum x-coordinate.
• #### maxY

`int maxY()`
Returns the maximum y-coordinate of the framing rectangle. Note: this method differs from its floating-point counterparts in that it considers `(y + height - 1)` to be a rectangle's maximum x-coordinate.
• #### location

`Point location()`
Returns a copy of this rectangle's upper-left corner.
• #### location

`Point location(Point target)`
Initializes the supplied point with this rectangle's upper-left corner.
Returns:
the supplied point.
• #### size

`Dimension size()`
Returns a copy of this rectangle's size.
• #### size

`Dimension size(Dimension target)`
Initializes the supplied dimension with this rectangle's size.
Returns:
the supplied dimension.
• #### intersection

```Rectangle intersection(int rx,
int ry,
int rw,
int rh)```
Returns the intersection of the specified rectangle and this rectangle (i.e. the largest rectangle contained in both this and the specified rectangle).
• #### intersection

`Rectangle intersection(IRectangle r)`
Returns the intersection of the supplied rectangle and this rectangle (i.e. the largest rectangle contained in both this and the supplied rectangle).
• #### union

`Rectangle union(IRectangle r)`
Returns the union of the supplied rectangle and this rectangle (i.e. the smallest rectangle that contains both this and the supplied rectangle).
• #### outcode

```int outcode(int px,
int py)```
Returns a set of flags indicating where the specified point lies in relation to the bounds of this rectangle. See `OUT_LEFT`, etc.
• #### outcode

`int outcode(IPoint point)`
Returns a set of flags indicating where the supplied point lies in relation to the bounds of this rectangle. See `OUT_LEFT`, etc.
• #### clone

`Rectangle clone()`
Returns a mutable copy of this rectangle.