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 void
addArguments(java.lang.StringBuilder buffer)
Ellipse
clone()
boolean
contains(double x, double y)
Return true if this shape contains the point defined by (x
,y
).boolean
equals(java.lang.Object other)
boolean
fastIntersects(Rectangle other)
Check if this shape's bounding box intersects withbox
.Rectangle
getBoundingBox()
Get the rectangle that represents the bounding box that fully contains this shape.double
getRadiusA()
Get the first radius for the ellipse.double
getRadiusB()
Get the second for the ellipse.double
getRotationAngle()
Get the rotation angle for this ellipse (in radians).java.lang.String
getTypeName()
int
hashCode()
boolean
intersects(Rectangle box, AbstractEllipse other)
Check for intersection withother
.boolean
intersects(Rectangle box, Shape shape)
Check if this shape intersects withother
.Ellipse
readExternal(java.io.DataInput in)
void
setRadiusA(double value)
void
setRadiusB(double value)
void
setRotationAngle(double value)
void
writeExternal(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:
getTypeName
in classShape
-
getRotationAngle
public double getRotationAngle()
Get the rotation angle for this ellipse (in radians).- Overrides:
getRotationAngle
in 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:
getRadiusA
in 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:
getRadiusB
in 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:
intersects
in 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:
intersects
in classAbstractEllipse
-
fastIntersects
public boolean fastIntersects(Rectangle other)
Check if this shape's bounding box intersects withbox
.- Specified by:
fastIntersects
in classShape
-
getBoundingBox
public Rectangle getBoundingBox()
Get the rectangle that represents the bounding box that fully contains this shape.- Specified by:
getBoundingBox
in classShape
-
equals
public boolean equals(java.lang.Object other)
- Overrides:
equals
in classjava.lang.Object
-
addArguments
public void addArguments(java.lang.StringBuilder buffer)
- Specified by:
addArguments
in classShape
-
readExternal
public Ellipse readExternal(java.io.DataInput in) throws java.io.IOException
- Specified by:
readExternal
in classShape
- Throws:
java.io.IOException
-
writeExternal
public void writeExternal(java.io.DataOutput out) throws java.io.IOException
- Specified by:
writeExternal
in classShape
- Throws:
java.io.IOException
-
-