Package com.attivio.sdk.geo
Class AbstractEllipse
- java.lang.Object
-
- com.attivio.sdk.geo.Shape
-
- com.attivio.sdk.geo.AbstractEllipse
-
- All Implemented Interfaces:
java.io.Externalizable
,java.io.Serializable
,java.lang.Cloneable
,java.lang.Comparable<Shape>
public abstract class AbstractEllipse extends Shape
Abstract ellipse definition.WARNING: this API is experimental and will likely change in the near future.
- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Modifier Constructor Description protected
AbstractEllipse(double centerX, double centerY)
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description protected static double
getA(double sin, double cos, double radiusA2, double radiusB2)
Compute the A constant for an ellipse.protected static double
getB(double sin, double cos, double radiusA2, double radiusB2)
Compute the B constant for an ellipse.protected static double
getC(double sin, double cos, double radiusA2, double radiusB2)
Compute the C constant for an ellipse.Point
getCenter()
Get the center point for this circle.double
getCenterX()
Get the X coordinate for the center point.double
getCenterY()
Get the Y coordinate for the center point.double
getHeight()
Get the height of this shape's bounding box.double
getMaxRadius()
Get the minimum radius for this ellipse.double
getMinRadius()
Get the maximum radius for this ellipse.Point
getPoint(double angle)
Get a point on this ellipse atangle
.double
getPointX(double angle)
Get the X coordinate for a point on this ellipse atangle
.double
getPointY(double angle)
Get the Y coordinate for a point on this ellipse atangle
.protected abstract double
getRadiusA()
Get the first radius for the ellipse.protected abstract double
getRadiusB()
Get the second for the ellipse.protected double
getRotationAngle()
Get the rotation angle for this ellipse (in radians).protected double
getRotationCos()
Get the cosine of the rotation angle.protected double
getRotationSin()
Get the sine of the rotation angle.double
getWidth()
Get the width of this shape's bounding box.abstract boolean
intersects(Rectangle box, AbstractEllipse other)
Check for intersection withother
.boolean
intersects(Rectangle box, AbstractPolygon poly)
Check if this ellipse intersects withpoly
.boolean
intersects(Rectangle box, Shape other)
Check if this shape intersects withother
.void
setCenter(Point value)
void
setCenterX(double value)
void
setCenterY(double value)
-
Methods inherited from class com.attivio.sdk.geo.Shape
addArguments, clone, compareTo, contains, contains, fastIntersects, getBoundingBox, getTypeName, hashCode, intersects, readExternal, readExternal, toString, toString, toString, valueOf, writeExternal, writeExternal
-
-
-
-
Method Detail
-
getWidth
public double getWidth()
Get the width of this shape's bounding box.
-
getHeight
public double getHeight()
Get the height of this shape's bounding box.
-
getCenter
public final Point getCenter()
Get the center point for this circle.
-
setCenter
public final void setCenter(Point value)
-
getCenterX
public final double getCenterX()
Get the X coordinate for the center point.
-
setCenterX
public final void setCenterX(double value)
-
getCenterY
public final double getCenterY()
Get the Y coordinate for the center point.
-
setCenterY
public final void setCenterY(double value)
-
getRotationAngle
protected double getRotationAngle()
Get the rotation angle for this ellipse (in radians).
-
getRadiusA
protected abstract double getRadiusA()
Get the first radius for the ellipse.This is the radius along the X plane.
-
getRadiusB
protected abstract double getRadiusB()
Get the second for the ellipse.This is the radius along the Y plane.
-
getMaxRadius
public double getMaxRadius()
Get the minimum radius for this ellipse.
-
getMinRadius
public double getMinRadius()
Get the maximum radius for this ellipse.
-
getRotationSin
protected double getRotationSin()
Get the sine of the rotation angle.
-
getRotationCos
protected double getRotationCos()
Get the cosine of the rotation angle.
-
getPoint
public Point getPoint(double angle)
Get a point on this ellipse atangle
.
-
getPointX
public double getPointX(double angle)
Get the X coordinate for a point on this ellipse atangle
.
-
getPointY
public double getPointY(double angle)
Get the Y coordinate for a point on this ellipse atangle
.
-
intersects
public boolean intersects(Rectangle box, Shape other)
Check if this shape intersects withother
.- Specified by:
intersects
in classShape
- Parameters:
box
- The bounding box of this shape fromShape.getBoundingBox()
.other
- The shape to check for intersection with
-
intersects
public abstract boolean intersects(Rectangle box, AbstractEllipse other)
Check for intersection withother
.
-
intersects
public boolean intersects(Rectangle box, AbstractPolygon poly)
Check if this ellipse intersects withpoly
.
-
getA
protected static double getA(double sin, double cos, double radiusA2, double radiusB2)
Compute the A constant for an ellipse.
-
getB
protected static double getB(double sin, double cos, double radiusA2, double radiusB2)
Compute the B constant for an ellipse.
-
getC
protected static double getC(double sin, double cos, double radiusA2, double radiusB2)
Compute the C constant for an ellipse.
-
-