Package org.eclipse.gef.geometry.planar

## Interface IGeometry

All Superinterfaces:
  `java.lang.Cloneable`, `java.io.Serializable`

All Known Subinterfaces:
  `ICurve`, `IMultiShape`, `IShape`

All Known Implementing Classes:
  `Arc`, `BezierCurve`, `CubicCurve`, `CurvedPolygon`, `Ellipse`, `Line`, `Path`, `Pie`, `PolyBezier`, `Polygon`, `Polyline`, `QuadraticCurve`, `Rectangle`, `Region`, `Ring`, `RoundedRectangle`

    public interface IGeometry
    extends java.lang.Cloneable, java.io.Serializable

A glance at the list of implementing classes reveals that the `IGeometry` interface bundles all the basic common methods for planar geometric objects. These methods enable you to test if a `Point` belongs to an `IGeometry` using the `contains(Point)` method. The `getBounds()` method returns a bounding box of the `IGeometry` that you call that method on. Moreover, you can bake a copy of an `IGeometry` using its `getCopy()` method. To apply an `AffineTransform` to an `IGeometry`, use the `getTransformed(AffineTransform)` method. Additionally, every `IGeometry` can be transfered into a `Path` by using the `toPath()` method. And you can check if two `IGeometry`s are touching each other, i.e. they have at least one `Point` in common, via the `touches(IGeometry)` method.

### Method Summary

All Methods Instance Methods Abstract Methods
`boolean` `contains​(Point p)` Returns whether the given `Point` is contained within this `IGeometry`.
`Rectangle` `getBounds()` Returns the smallest `Rectangle` fully enclosing this `IGeometry`.
`IGeometry` `getCopy()` Returns a new identical copy of this `IGeometry`.
`IGeometry` `getTransformed​(AffineTransform t)` Returns a new `IGeometry`, which represents the given `IGeometry` after the application of the given `AffineTransform`.
`Path` `toPath()` Converts this `IGeometry` into a `Path` representation.
`boolean` `touches​(IGeometry g)` Returns `true` if the input `IGeometry` touches this `IGeometry`, i.e. there is at least one common point.

### Method Detail

#### contains

    boolean contains​(Point p)

Returns whether the given `Point` is contained within this `IGeometry`. This includes the case that the `Point` lies on the border of this `IGeometry`.

Parameters:
  `p` - The `Point` being tested for containment
Returns:
  `true` if the `Point` is contained within this `IGeometry`, `false` otherwise.

#### getBounds

    Rectangle getBounds()

Returns the smallest `Rectangle` fully enclosing this `IGeometry`.

Returns:
  A new `Rectangle` object that fully encloses this `IGeometry`

#### getCopy

    IGeometry getCopy()

Returns a new identical copy of this `IGeometry`.

Returns:
  a copy identical to this `IGeometry`

#### getTransformed

    IGeometry getTransformed​(AffineTransform t)

Returns a new `IGeometry`, which represents the given `IGeometry` after the application of the given `AffineTransform`. In case the `AffineTransform` may be performed type intrinsic (e.g. scaling on a `Rectangle`), an object of the same type is returned.

Parameters:
  `t` - The `AffineTransform` to be applied
Returns:
  A new `IGeometry` object representing this `IGeometry` after the application of the given `AffineTransform`.

#### toPath

    Path toPath()

Converts this `IGeometry` into a `Path` representation.

Returns:
  A new `Path` representation for this `IGeometry`.

#### touches

    boolean touches​(IGeometry g)

Returns `true` if the input `IGeometry` touches this `IGeometry`, i.e. there is at least one common point.

Parameters:
  `g` - The `IGeometry` for the intersection test
Returns:
  `true` if the input `IGeometry` and this `IGeometry` have at least one common point.