public class Ellipse extends AbstractRectangleBasedGeometry<Ellipse,PolyBezier> implements IShape
PrecisionUtils
) to compensate for rounding effects.Constructor and Description |
---|
Ellipse(double x,
double y,
double width,
double height)
Constructs a new
Ellipse so that it is fully contained within the
framing rectangle defined by (x, y, width, height). |
Ellipse(Rectangle r)
|
Modifier and Type | Method and Description |
---|---|
java.lang.Object |
clone()
Overridden with public visibility as recommended within
Cloneable
. |
boolean |
contains(IGeometry g)
|
boolean |
contains(Line l)
|
boolean |
contains(Point p)
|
boolean |
equals(double x,
double y,
double width,
double height)
Tests whether this
Ellipse and the ellipse defined by the given
bounds are equal. |
boolean |
equals(java.lang.Object o)
Tests whether this
Ellipse is equal to the given Object . |
Ellipse |
getCopy()
Returns a new
Ellipse with the same location and size than this
one. |
Point[] |
getIntersections(Ellipse e2)
|
Point[] |
getIntersections(ICurve c)
|
Point[] |
getIntersections(Line line)
|
ICurve |
getOutline()
|
CubicCurve[] |
getOutlineSegments()
Calculates the outline segments of this
Ellipse . |
PolyBezier |
getRotatedCCW(Angle angle)
|
PolyBezier |
getRotatedCCW(Angle angle,
double cx,
double cy)
|
PolyBezier |
getRotatedCCW(Angle angle,
Point center)
|
PolyBezier |
getRotatedCW(Angle angle)
|
PolyBezier |
getRotatedCW(Angle angle,
double cx,
double cy)
|
PolyBezier |
getRotatedCW(Angle angle,
Point center)
|
CurvedPolygon |
getTransformed(AffineTransform t)
|
int |
hashCode() |
Path |
toPath()
Returns a
Path representation of this Ellipse , which is
an approximation of the four outline
segments by means of CubicCurve s. |
java.lang.String |
toString() |
boolean |
touches(IGeometry g)
|
expand, expand, getBounds, getCenter, getExpanded, getExpanded, getHeight, getLocation, getScaled, getScaled, getScaled, getScaled, getScaled, getScaled, getShrinked, getShrinked, getSize, getTranslated, getTranslated, getWidth, getX, getY, scale, scale, scale, scale, scale, scale, setBounds, setBounds, setBounds, setHeight, setLocation, setLocation, setSize, setSize, setWidth, setX, setY, shrink, shrink, translate, translate
public Ellipse(double x, double y, double width, double height)
Ellipse
so that it is fully contained within the
framing rectangle defined by (x, y, width, height).x
- The x-coordinate of the framing rectangley
- The y-coordinate of the framing rectanglewidth
- The width of the framing rectangleheight
- The height of the framing rectanglepublic boolean contains(Line l)
public boolean equals(double x, double y, double width, double height)
Ellipse
and the ellipse defined by the given
bounds are equal.x
- the x-coordinate of the bounds defining define the ellipse to
testy
- the y-coordinate of the bounds defining the ellipse to testwidth
- the width of the bounds defining the ellipse to testheight
- the height of the bounds defining the ellipse to testtrue
if this Ellipse
and the ellipse defined
via the given bounds are (imprecisely) regarded to be equal,
false
otherwisepublic boolean equals(java.lang.Object o)
Ellipse
is equal to the given Object
.public Ellipse getCopy()
Ellipse
with the same location and size than this
one.public ICurve getOutline()
IShape
getOutline
in interface IShape
ICurve
representing this IShape
's outline.public CubicCurve[] getOutlineSegments()
Ellipse
. The outline
segments are approximated by CubicCurve
s. The outline segments
are returned in the following order:
0deg
to 90deg
(quadrant I)90deg
to 180deg
(quadrant II)180deg
to 270deg
(quadrant III)270deg
to 360deg
(quadrant IV)Angle
of 0deg
is oriented to the right.
Increasing an Angle
rotates counter-clockwise (CCW).getOutlineSegments
in interface IShape
CubicCurve
s representing the outline of this
Ellipse
public PolyBezier getRotatedCCW(Angle angle)
IRotatable
Angle
counter-clock-wise
(CCW) around its center Point
. Does not necessarily return an
object of the same type.getRotatedCCW
in interface IRotatable<PolyBezier>
angle
- rotation Angle
IGeometry
representing the result of the rotationpublic PolyBezier getRotatedCCW(Angle angle, double cx, double cy)
IRotatable
Angle
counter-clock-wise (CCW) around the specified center Point
(cx,
cy). Does not necessarily return an object of the same type.getRotatedCCW
in interface IRotatable<PolyBezier>
angle
- rotation Angle
cx
- x-coordinate of the relative Point
for the rotationcy
- y-coordinate of the relative Point
for the rotationIGeometry
representing the result of the rotationpublic PolyBezier getRotatedCCW(Angle angle, Point center)
IRotatable
Angle
counter-clock-wise (CCW) around the specified center Point
. Does
not necessarily return an object of the same type.getRotatedCCW
in interface IRotatable<PolyBezier>
angle
- rotation Angle
center
- relative Point
for the rotationIGeometry
representing the result of the rotationpublic PolyBezier getRotatedCW(Angle angle)
IRotatable
Angle
clock-wise (CW)
around its center Point
. Does not necessarily return an object of
the same type.getRotatedCW
in interface IRotatable<PolyBezier>
angle
- rotation Angle
IGeometry
representing the result of the rotationpublic PolyBezier getRotatedCW(Angle angle, double cx, double cy)
IRotatable
Angle
clock-wise (CW)
around the specified center Point
(cx, cy). Does not necessarily
return an object of the same type.getRotatedCW
in interface IRotatable<PolyBezier>
angle
- rotation Angle
cx
- x-coordinate of the relative Point
for the rotationcy
- y-coordinate of the relative Point
for the rotationIGeometry
representing the result of the rotationpublic PolyBezier getRotatedCW(Angle angle, Point center)
IRotatable
Angle
clock-wise (CW)
around the specified center Point
. Does not necessarily return an
object of the same type.getRotatedCW
in interface IRotatable<PolyBezier>
angle
- rotation Angle
center
- relative Point
for the rotationIGeometry
representing the result of the rotationpublic CurvedPolygon getTransformed(AffineTransform t)
Path
representation of this IGeometry
. Subclasses may override this
method to return a more specific representation.getTransformed
in interface IGeometry
getTransformed
in interface IShape
t
- The AffineTransform
to be appliedPath
representation of this
IGeometry
IGeometry.getTransformed(AffineTransform)
public Path toPath()
Path
representation of this Ellipse
, which is
an approximation of the four outline
segments
by means of CubicCurve
s.toPath
in interface IGeometry
Path
representation for this IGeometry
.IGeometry.toPath()
public java.lang.String toString()
toString
in class java.lang.Object
public java.lang.Object clone()
Cloneable
.clone
in class java.lang.Object
public final int hashCode()
hashCode
in class java.lang.Object
Object.hashCode()
Copyright (c) 2014 itemis AG, and others. All rights reserved.