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 protectedAbstractEllipse(double centerX, double centerY)
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description protected static doublegetA(double sin, double cos, double radiusA2, double radiusB2)Compute the A constant for an ellipse.protected static doublegetB(double sin, double cos, double radiusA2, double radiusB2)Compute the B constant for an ellipse.protected static doublegetC(double sin, double cos, double radiusA2, double radiusB2)Compute the C constant for an ellipse.PointgetCenter()Get the center point for this circle.doublegetCenterX()Get the X coordinate for the center point.doublegetCenterY()Get the Y coordinate for the center point.doublegetHeight()Get the height of this shape's bounding box.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.protected abstract doublegetRadiusA()Get the first radius for the ellipse.protected abstract doublegetRadiusB()Get the second for the ellipse.protected doublegetRotationAngle()Get the rotation angle for this ellipse (in radians).protected doublegetRotationCos()Get the cosine of the rotation angle.protected doublegetRotationSin()Get the sine of the rotation angle.doublegetWidth()Get the width of this shape's bounding box.abstract booleanintersects(Rectangle box, AbstractEllipse other)Check for intersection withother.booleanintersects(Rectangle box, AbstractPolygon poly)Check if this ellipse intersects withpoly.booleanintersects(Rectangle box, Shape other)Check if this shape intersects withother.voidsetCenter(Point value)voidsetCenterX(double value)voidsetCenterY(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:
intersectsin 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.
-
-