: Interface GeometricObject

Class | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## Interface GeometricObject

All Known Implementing Classes:
  Ellipse, Line, Point, Polygon, Rectangle

public interface GeometricObject
extends Terminal

All the objects who want to be Geometric must implement this interface.

Field Summary
`static int` | `CIRCLE`
`static int` | `ELLIPSE`
`static int` | `LINE`
`static int` | `POINT`
`static int` | `POLYGON`
`static int` | `RECTANGLE` Available GeometricObject types.
`static int` | `SQUARE`

Method Summary
`boolean` | `containsGeometricObject(GeometricObject object)` Returns false if the argument is not completely inside this object.
`boolean` | `containsGeometricObjects(GeometricObject[] objects)` Returns false if the objects in the input array are completely inside this object.
`Polygon` | `getDataPoints()` This method is used to get the original data points that forms this GeometricObject
`Polygon` | `getPolygonalBounds()` This method should return a polygon that fully contains the current object.
`Rectangle` | `getRectangularBounds()` This method should return the Rectangular bounds of the object.
`boolean` | `pointIsOn(Point p, int radius)` Returns true if the point is within +-radius distance from the curve defining the object.
`boolean` | `pointIsOnOriginal(Point p, int radius)` Returns true if the point is within +-radius distance from the original curve defining the object.
`void` | `setDataPoints(Polygon points)` This method is used to set the original data points that forms this GeometricObject
`int` | `spatialRelation(GeometricObject object)` This method should return the spatial relation of the input parameter with respect to this object.
`boolean` | `touches(GeometricObject object)` This method should return true if the input object touches this geometric object.

Methods inherited from interface Terminal
`getTimeStamp, setTimeStamp`

Methods inherited from interface Paintable
`getType, paint, paint, paintOriginal, setGraphicsContext`

Field Detail

### RECTANGLE

    public static final int RECTANGLE

  Available GeometricObject types.

### SQUARE

    public static final int SQUARE

### ELLIPSE

    public static final int ELLIPSE

### CIRCLE

    public static final int CIRCLE

### POLYGON

    public static final int POLYGON

### LINE

    public static final int LINE

### POINT

    public static final int POINT

Method Detail

### pointIsOn

    public boolean pointIsOn(Point p,
                             int radius)

  Returns true if the point is within +-radius distance from the curve defining the object. Returns false o/w.

### pointIsOnOriginal

    public boolean pointIsOnOriginal(Point p,
                                     int radius)

  Returns true if the point is within +-radius distance from the original curve defining the object. Returns false o/w.

### getPolygonalBounds

    public Polygon getPolygonalBounds()

  This method should return a polygon that fully contains the current object. The polygon is implicity closed and the last point doesn't necessarily have to be the same as the first (zeroth) point.

### touches

    public boolean touches(GeometricObject object)

  This method should return true if the input object touches this geometric object.

### spatialRelation

    public int spatialRelation(GeometricObject object)

  This method should return the spatial relation of the input parameter with respect to this object. see the SpatialRelation class for a detailed list of possible spatial relations. Another version of this method should be implemented for handling spatial relations where a rotated coordinate system is to be used.

### getRectangularBounds

    public Rectangle getRectangularBounds()

  This method should return the Rectangular bounds of the object.

### containsGeometricObject

    public boolean containsGeometricObject(GeometricObject object)

  Returns false if the argument is not completely inside this object. Return true O/W.

### containsGeometricObjects

    public boolean containsGeometricObjects(GeometricObject[] objects)

  Returns false if the objects in the input array are completely inside this object. Return true O/W.

### setDataPoints

    public void setDataPoints(Polygon points)

  This method is used to set the original data points that forms this GeometricObject

### getDataPoints

    public Polygon getDataPoints()

  This method is used to get the original data points that forms this GeometricObject

Class | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD