pythagoras.d

## Interface IShape

• ### Method Summary

All Methods
Modifier and Type Method and Description
`Rectangle` `bounds()`
Returns a copy of the bounding rectangle for this shape.
`Rectangle` `bounds(Rectangle target)`
Initializes the supplied rectangle with this shape's bounding rectangle.
`boolean` ```contains(double x, double y)```
Returns true if this shape contains the specified point.
`boolean` ```contains(double x, double y, double width, double height)```
Returns true if this shape completely contains the specified rectangle.
`boolean` `contains(IRectangle r)`
Returns true if this shape completely contains the supplied rectangle.
`boolean` `contains(XY point)`
Returns true if this shape contains the supplied point.
`boolean` ```intersects(double x, double y, double width, double height)```
Returns true if this shape intersects the specified rectangle.
`boolean` `intersects(IRectangle r)`
Returns true if this shape intersects the supplied rectangle.
`boolean` `isEmpty()`
Returns true if this shape encloses no area.
`PathIterator` `pathIterator(Transform at)`
Returns an iterator over the path described by this shape.
`PathIterator` ```pathIterator(Transform at, double flatness)```
Returns an iterator over the path described by this shape.
• ### Method Detail

• #### isEmpty

`boolean isEmpty()`
Returns true if this shape encloses no area.
• #### contains

```boolean contains(double x,
double y)```
Returns true if this shape contains the specified point.
• #### contains

`boolean contains(XY point)`
Returns true if this shape contains the supplied point.
• #### contains

```boolean contains(double x,
double y,
double width,
double height)```
Returns true if this shape completely contains the specified rectangle.
• #### contains

`boolean contains(IRectangle r)`
Returns true if this shape completely contains the supplied rectangle.
• #### intersects

```boolean intersects(double x,
double y,
double width,
double height)```
Returns true if this shape intersects the specified rectangle.
• #### intersects

`boolean intersects(IRectangle r)`
Returns true if this shape intersects the supplied rectangle.
• #### bounds

`Rectangle bounds()`
Returns a copy of the bounding rectangle for this shape.
• #### bounds

`Rectangle bounds(Rectangle target)`
Initializes the supplied rectangle with this shape's bounding rectangle.
Returns:
the supplied rectangle.
• #### pathIterator

`PathIterator pathIterator(Transform at)`
Returns an iterator over the path described by this shape.
Parameters:
`at` - if supplied, the points in the path are transformed using this.
• #### pathIterator

```PathIterator pathIterator(Transform at,
double flatness)```
Returns an iterator over the path described by this shape.
Parameters:
`at` - if supplied, the points in the path are transformed using this.
`flatness` - when approximating curved segments with lines, this controls the maximum distance the lines are allowed to deviate from the approximated curve, thus a higher flatness value generally allows for a path with fewer segments.