Package com.attivio.sdk.geo
Class Circle
- java.lang.Object
-
- com.attivio.sdk.geo.Shape
-
- com.attivio.sdk.geo.AbstractEllipse
-
- com.attivio.sdk.geo.Circle
-
- All Implemented Interfaces:
java.io.Externalizable,java.io.Serializable,java.lang.Cloneable,java.lang.Comparable<Shape>
public final class Circle extends AbstractEllipse
Defines a circle.WARNING: this API is experimental and will likely change in the near future.
- See Also:
- Serialized Form
-
-
Field Summary
-
Fields inherited from class com.attivio.sdk.geo.AbstractEllipse
centerX, centerY
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddArguments(java.lang.StringBuilder buffer)Circleclone()booleancontains(double x, double y)Return true if this shape contains the point defined by (x,y).doubledistance(double x, double y)Calculate the distance between (x, y) and this circle's center.booleanequals(java.lang.Object other)booleanfastIntersects(Rectangle other)Check if this shape's bounding box intersects withbox.RectanglegetBoundingBox()Get the rectangle that represents the bounding box that fully contains this shape.doublegetMaxRadius()Get the minimum radius for this ellipse.doublegetMinRadius()Get the maximum radius for this ellipse.PointgetPoint(double angle)Get a point on this ellipse atangle.doublegetPointX(double angle)Get the X coordinate for a point on this ellipse atangle.doublegetPointY(double angle)Get the Y coordinate for a point on this ellipse atangle.doublegetRadius()Get the radius for this circle.protected doublegetRadiusA()Get the first radius for the ellipse.protected doublegetRadiusB()Get the second for the ellipse.protected doublegetRotationCos()Get the cosine of the rotation angle.protected doublegetRotationSin()Get the sine of the rotation angle.java.lang.StringgetTypeName()inthashCode()booleanintersects(Circle other)Check ifotherand thisCircleintersect.booleanintersects(Rectangle other)Check ifotherand thisCircleintersect.booleanintersects(Rectangle box, AbstractEllipse ellipse)Check for intersection withother.booleanintersects(Rectangle box, Shape shape)Check if this shape intersects withother.CirclereadExternal(java.io.DataInput in)voidsetRadius(double value)voidwriteExternal(java.io.DataOutput out)-
Methods inherited from class com.attivio.sdk.geo.AbstractEllipse
getA, getB, getC, getCenter, getCenterX, getCenterY, getHeight, getRotationAngle, getWidth, intersects, setCenter, setCenterX, setCenterY
-
Methods inherited from class com.attivio.sdk.geo.Shape
compareTo, contains, intersects, readExternal, toString, toString, toString, valueOf, writeExternal
-
-
-
-
Constructor Detail
-
Circle
public Circle()
-
Circle
public Circle(double centerX, double centerY, double radius)
-
Circle
public Circle(Point center, double radius)
-
-
Method Detail
-
getTypeName
public java.lang.String getTypeName()
- Specified by:
getTypeNamein classShape
-
getRadius
public double getRadius()
Get the radius for this circle.
-
setRadius
public void setRadius(double value)
-
getRadiusA
protected double getRadiusA()
Get the first radius for the ellipse.This is the radius along the X plane.
- Specified by:
getRadiusAin classAbstractEllipse
-
getRadiusB
protected double getRadiusB()
Get the second for the ellipse.This is the radius along the Y plane.
- Specified by:
getRadiusBin classAbstractEllipse
-
getMaxRadius
public double getMaxRadius()
Get the minimum radius for this ellipse.- Overrides:
getMaxRadiusin classAbstractEllipse
-
getMinRadius
public double getMinRadius()
Get the maximum radius for this ellipse.- Overrides:
getMinRadiusin classAbstractEllipse
-
getPoint
public Point getPoint(double angle)
Get a point on this ellipse atangle.- Overrides:
getPointin classAbstractEllipse
-
getPointX
public double getPointX(double angle)
Get the X coordinate for a point on this ellipse atangle.- Overrides:
getPointXin classAbstractEllipse
-
getPointY
public double getPointY(double angle)
Get the Y coordinate for a point on this ellipse atangle.- Overrides:
getPointYin classAbstractEllipse
-
getRotationCos
protected double getRotationCos()
Get the cosine of the rotation angle.- Overrides:
getRotationCosin classAbstractEllipse
-
getRotationSin
protected double getRotationSin()
Get the sine of the rotation angle.- Overrides:
getRotationSinin classAbstractEllipse
-
contains
public boolean contains(double x, double y)Return true if this shape contains the point defined by (x,y).
-
intersects
public boolean intersects(Rectangle box, Shape shape)
Check if this shape intersects withother.- Overrides:
intersectsin classAbstractEllipse- Parameters:
box- The bounding box of this shape fromShape.getBoundingBox().shape- The shape to check for intersection with
-
distance
public double distance(double x, double y)Calculate the distance between (x, y) and this circle's center.
-
intersects
public boolean intersects(Rectangle box, AbstractEllipse ellipse)
Check for intersection withother.- Specified by:
intersectsin classAbstractEllipse
-
fastIntersects
public boolean fastIntersects(Rectangle other)
Check if this shape's bounding box intersects withbox.- Specified by:
fastIntersectsin classShape
-
getBoundingBox
public Rectangle getBoundingBox()
Get the rectangle that represents the bounding box that fully contains this shape.- Specified by:
getBoundingBoxin classShape
-
equals
public boolean equals(java.lang.Object other)
- Overrides:
equalsin classjava.lang.Object
-
addArguments
public void addArguments(java.lang.StringBuilder buffer)
- Specified by:
addArgumentsin classShape
-
writeExternal
public void writeExternal(java.io.DataOutput out) throws java.io.IOException- Specified by:
writeExternalin classShape- Throws:
java.io.IOException
-
readExternal
public Circle readExternal(java.io.DataInput in) throws java.io.IOException
- Specified by:
readExternalin classShape- Throws:
java.io.IOException
-
-