Package com.attivio.sdk.geo
Class Ellipse
- java.lang.Object
-
- com.attivio.sdk.geo.Shape
-
- com.attivio.sdk.geo.AbstractEllipse
-
- com.attivio.sdk.geo.Ellipse
-
- All Implemented Interfaces:
java.io.Externalizable,java.io.Serializable,java.lang.Cloneable,java.lang.Comparable<Shape>
public class Ellipse extends AbstractEllipse
Defines an ellipse.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
-
-
Constructor Summary
Constructors Constructor Description Ellipse()Ellipse(double centerX, double centerY, double radiusA, double radiusB, double rotationAngle)Construct an ellipse.Ellipse(Point center, double radiusA, double radiusB)Construct an ellipse.Ellipse(Point center, double radiusA, double radiusB, double rotationAngle)Construct an ellipse.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddArguments(java.lang.StringBuilder buffer)Ellipseclone()booleancontains(double x, double y)Return true if this shape contains the point defined by (x,y).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.doublegetRadiusA()Get the first radius for the ellipse.doublegetRadiusB()Get the second for the ellipse.doublegetRotationAngle()Get the rotation angle for this ellipse (in radians).java.lang.StringgetTypeName()inthashCode()booleanintersects(Rectangle box, AbstractEllipse other)Check for intersection withother.booleanintersects(Rectangle box, Shape shape)Check if this shape intersects withother.EllipsereadExternal(java.io.DataInput in)voidsetRadiusA(double value)voidsetRadiusB(double value)voidsetRotationAngle(double value)voidwriteExternal(java.io.DataOutput out)-
Methods inherited from class com.attivio.sdk.geo.AbstractEllipse
getA, getB, getC, getCenter, getCenterX, getCenterY, getHeight, getMaxRadius, getMinRadius, getPoint, getPointX, getPointY, getRotationCos, getRotationSin, 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
-
Ellipse
public Ellipse()
-
Ellipse
public Ellipse(Point center, double radiusA, double radiusB)
Construct an ellipse.- Parameters:
center- center point of ellipse.radiusA- the radius on the semimajor axisradiusB- the radius on the semiminor axis
-
Ellipse
public Ellipse(Point center, double radiusA, double radiusB, double rotationAngle)
Construct an ellipse.- Parameters:
center- center point of ellipse.radiusA- the radius on the semimajor axisradiusB- the radius on the semiminor axisrotationAngle- the rotation angle of the ellipse around the center point (in radians)
-
Ellipse
public Ellipse(double centerX, double centerY, double radiusA, double radiusB, double rotationAngle)Construct an ellipse.- Parameters:
centerX- x coordinate for center of ellipse.centerY- y coordinate for center of ellipse.radiusA- the radius on the semimajor axisradiusB- the radius on the semiminor axisrotationAngle- the rotation angle of the ellipse around the center point (in radians)
-
-
Method Detail
-
getTypeName
public java.lang.String getTypeName()
- Specified by:
getTypeNamein classShape
-
getRotationAngle
public double getRotationAngle()
Get the rotation angle for this ellipse (in radians).- Overrides:
getRotationAnglein classAbstractEllipse
-
setRotationAngle
public void setRotationAngle(double value)
-
getRadiusA
public double getRadiusA()
Get the first radius for the ellipse.This is the radius along the X plane.
- Specified by:
getRadiusAin classAbstractEllipse
-
setRadiusA
public void setRadiusA(double value)
-
getRadiusB
public double getRadiusB()
Get the second for the ellipse.This is the radius along the Y plane.
- Specified by:
getRadiusBin classAbstractEllipse
-
setRadiusB
public void setRadiusB(double value)
-
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
-
intersects
public boolean intersects(Rectangle box, AbstractEllipse other)
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
-
readExternal
public Ellipse readExternal(java.io.DataInput in) throws java.io.IOException
- Specified by:
readExternalin classShape- Throws:
java.io.IOException
-
writeExternal
public void writeExternal(java.io.DataOutput out) throws java.io.IOException- Specified by:
writeExternalin classShape- Throws:
java.io.IOException
-
-