edu.mit.sketch.geom
Interface GeometricObject

All Superinterfaces:
Paintable, Painter, Terminal, Translatable
All Known Implementing Classes:
Arc, CompositeGeometricObject, Ellipse, GeneralPath, Line, Point, Polygon, Rectangle, Shade, Spiral, Spring, Vertex

public interface GeometricObject
extends Terminal, Translatable

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


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 not completely inside this object.
 GeometricObject copy()
          This method copies the geometric object (includeing the underlying data and returns it.
 java.awt.Rectangle getBounds()
          Return the bounds in the form of a java Rectangle.
 Polygon getDataPoints()
          This method is used to get the original data points that forms this GeometricObject
 int getIntType()
          Returns the static descriptive type that it is;
 Vertex[] getOriginalVertices()
          This method is used to get the original data points that form the geometric object in their vertex form.
 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.
 void setDataPoints(Polygon points)
          This method is used to set the original data points that forms this GeometricObject
 void setOriginalVertices(Vertex[] pts)
           
 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 edu.mit.sketch.grammar.Terminal
getTimeStamp, setTimeStamp
 
Methods inherited from interface edu.mit.sketch.ui.Paintable
getType, paint, paint, paintOriginal, setGraphicsContext
 
Methods inherited from interface edu.mit.sketch.geom.Translatable
pointIsOn, pointIsOnOriginal, translate
 

Method Detail

getIntType

int getIntType()
Returns the static descriptive type that it is;

Returns:
the int value of the type

getPolygonalBounds

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

boolean touches(GeometricObject object)
This method should return true if the input object touches this geometric object.


spatialRelation

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

Rectangle getRectangularBounds()
This method should return the Rectangular bounds of the object.


getBounds

java.awt.Rectangle getBounds()
Return the bounds in the form of a java Rectangle.

Specified by:
getBounds in interface Painter

containsGeometricObject

boolean containsGeometricObject(GeometricObject object)
Returns false if the argument is not completely inside this object. Return true O/W.


containsGeometricObjects

boolean containsGeometricObjects(GeometricObject[] objects)
Returns false if the objects in the input array are not completely inside this object. Return true O/W.


setDataPoints

void setDataPoints(Polygon points)
This method is used to set the original data points that forms this GeometricObject


getDataPoints

Polygon getDataPoints()
This method is used to get the original data points that forms this GeometricObject


getOriginalVertices

Vertex[] getOriginalVertices()
This method is used to get the original data points that form the geometric object in their vertex form.


setOriginalVertices

void setOriginalVertices(Vertex[] pts)

copy

GeometricObject copy()
This method copies the geometric object (includeing the underlying data and returns it.