|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectedu.mit.sketch.geom.Arc
public class Arc
This class represents an arc described by its end-points p, q.
| Field Summary | |
|---|---|
double |
extent
extent in radians |
java.awt.Graphics |
graphics
Graphics context for this Geometric object. |
double |
start
start angle in radians |
long |
time_stamp
Time stamp of this object. |
| Constructor Summary | |
|---|---|
Arc(double start,
double extent,
double radius,
Point center,
boolean clockwise)
|
|
| 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. |
GeometricObject |
copy()
This method copies the geometric object (includeing the underlying data and returns it. |
static Arc |
fitArc(StrokeData strokeData)
|
static Arc |
fitArc(Vertex[] vertices)
|
java.awt.Rectangle |
getBounds()
Get the bounding box of this object |
Point |
getCenter()
returns center of the cirle that best matches this arc in a least squares sense |
boolean |
getClockwise()
|
Polygon |
getDataPoints()
This method is used to get the original data points that forms this GeometricObject |
double |
getExtent()
|
Point |
getHeadPoint()
returns the head point of the arc |
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 corresponds to this object. |
double |
getRadius()
returns radius of the cirle that best matches this arc in a least squares sense |
Rectangle |
getRectangularBounds()
Supplied for completeness. |
double |
getStart()
|
Point |
getTailPoint()
returns the tail point of the arc |
long |
getTimeStamp()
Returns the time stamp of the current Terminal |
java.lang.String |
getType()
Implement GeometricObject |
double |
leastSquaresError()
Return the LSQ error. |
void |
paint()
Draw the object |
void |
paint(java.awt.Graphics g)
Draw the object |
void |
paintOriginal(java.awt.Graphics g)
This method is used to paint the original data points that forms this GeometricObject |
boolean |
pointIsOn(Point p,
double radius)
Returns true if the point is within +-radius distance from the curve defining the object. |
boolean |
pointIsOnOriginal(Point p,
double radius)
Returns true if the point is within +-radius distance from the original curve defining the object. |
void |
setCenter(Point center)
|
void |
setClockwise(boolean clockwise)
|
void |
setDataPoints(Polygon points)
This method is used to set the original data points that forms this GeometricObject |
void |
setExtent(double extent)
|
void |
setGraphicsContext(java.awt.Graphics g)
Set graphics context for this Geometric object. |
void |
setOriginalVertices(Vertex[] pts)
|
void |
setRadius(double radius)
|
void |
setStart(double start)
|
void |
setTimeStamp(long time_stamp)
Sets the time stamp of the current Terminal |
int |
spatialRelation(GeometricObject object)
This method should return the spatial relation of the input parameter with respect to this object. |
java.lang.String |
toString()
Override toString |
boolean |
touches(GeometricObject object)
This method should return true if the input objects touch. |
void |
translate(double x,
double y)
Add the arguments to the (x, y) position of the object. |
| Methods inherited from class java.lang.Object |
|---|
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
public double start
public double extent
public long time_stamp
public transient java.awt.Graphics graphics
| Constructor Detail |
|---|
public Arc(double start,
double extent,
double radius,
Point center,
boolean clockwise)
| Method Detail |
|---|
public static Arc fitArc(Vertex[] vertices)
public static Arc fitArc(StrokeData strokeData)
public double getRadius()
public Point getCenter()
public Point getHeadPoint()
public Point getTailPoint()
public boolean getClockwise()
public java.lang.String getType()
getType in interface Paintablepublic java.lang.String toString()
toString in class java.lang.Objectpublic void paint()
paint in interface Paintablepublic void paint(java.awt.Graphics g)
paint in interface Paintablepaint in interface Painterpublic void paintOriginal(java.awt.Graphics g)
paintOriginal in interface Paintable
public boolean pointIsOn(Point p,
double radius)
pointIsOn in interface Translatable
public boolean pointIsOnOriginal(Point p,
double radius)
pointIsOnOriginal in interface Translatablepublic void setGraphicsContext(java.awt.Graphics g)
setGraphicsContext in interface Paintablepublic boolean touches(GeometricObject object)
touches in interface GeometricObjectpublic java.awt.Rectangle getBounds()
getBounds in interface GeometricObjectgetBounds in interface Painterpublic Rectangle getRectangularBounds()
getRectangularBounds in interface GeometricObjectpublic boolean containsGeometricObject(GeometricObject object)
containsGeometricObject in interface GeometricObjectpublic Polygon getPolygonalBounds()
getPolygonalBounds in interface GeometricObjectpublic int spatialRelation(GeometricObject object)
spatialRelation in interface GeometricObjectpublic void setTimeStamp(long time_stamp)
setTimeStamp in interface Terminalpublic long getTimeStamp()
getTimeStamp in interface Terminalpublic void setOriginalVertices(Vertex[] pts)
setOriginalVertices in interface GeometricObjectpublic Vertex[] getOriginalVertices()
GeometricObject
getOriginalVertices in interface GeometricObjectpublic void setDataPoints(Polygon points)
setDataPoints in interface GeometricObjectpublic Polygon getDataPoints()
getDataPoints in interface GeometricObject
public void translate(double x,
double y)
translate in interface Translatablepublic boolean containsGeometricObjects(GeometricObject[] objects)
containsGeometricObjects in interface GeometricObjectpublic double leastSquaresError()
public final GeometricObject copy()
GeometricObject
copy in interface GeometricObjectpublic double getExtent()
public void setExtent(double extent)
public double getStart()
public void setStart(double start)
public void setCenter(Point center)
public void setClockwise(boolean clockwise)
public void setRadius(double radius)
public int getIntType()
GeometricObject
getIntType in interface GeometricObject
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||