public class Pie extends AbstractRectangleBasedGeometry<T,S> implements IShape
Pie
is a closed AbstractArcBasedGeometry
. It is the
complement of the Arc
, which is an open
AbstractArcBasedGeometry
.
The Pie
covers an area, therefore it implements the IShape
interface.Modifier and Type | Field and Description |
---|---|
protected Angle |
angularExtent
The counter-clockwise (CCW)
Angle that spans this
AbstractArcBasedGeometry . |
protected Angle |
startAngle
The counter-clockwise (CCW)
Angle to the x-axis at which this
AbstractArcBasedGeometry begins. |
Constructor and Description |
---|
Pie(AbstractRectangleBasedGeometry<?,?> r,
Angle startAngle,
Angle angularExtent)
Constructs a new
Pie from the given values. |
Pie(Arc arc)
|
Pie(double x,
double y,
double width,
double height,
Angle startAngle,
Angle angularExtent)
Constructs a new
Pie from the given values. |
Modifier and Type | Method and Description |
---|---|
java.lang.Object |
clone()
Overridden with public visibility as recommended within
Cloneable
. |
protected CubicCurve[] |
computeBezierApproximation()
Computes a
CubicCurve approximation for this
AbstractArcBasedGeometry . |
boolean |
contains(IGeometry g)
|
boolean |
contains(Point p)
|
Angle |
getAngularExtent()
|
Rectangle |
getBounds()
|
Pie |
getCopy()
Returns a new identical copy of this
IGeometry . |
PolyBezier |
getOutline()
|
BezierCurve[] |
getOutlineSegments()
|
Point |
getP1()
Returns the start
Point of this AbstractArcBasedGeometry . |
Point |
getP2()
Returns the end
Point of this AbstractArcBasedGeometry . |
Point |
getPoint(Angle angularExtent)
Computes a
Point on this AbstractArcBasedGeometry . |
Path |
getRotatedCCW(Angle angle)
|
Path |
getRotatedCCW(Angle angle,
double cx,
double cy)
|
Path |
getRotatedCCW(Angle angle,
Point center)
|
Path |
getRotatedCW(Angle angle)
|
Path |
getRotatedCW(Angle angle,
double cx,
double cy)
|
Path |
getRotatedCW(Angle angle,
Point center)
|
Angle |
getStartAngle()
Returns this
AbstractArcBasedGeometry 's start Angle . |
CurvedPolygon |
getTransformed(AffineTransform t)
|
double |
getX1()
Returns the x coordinate of the start
Point of this
AbstractArcBasedGeometry . |
double |
getX2()
Returns the x coordinate of the end
Point of this
AbstractArcBasedGeometry . |
double |
getY1()
Returns the y coordinate of the start
Point of this
AbstractArcBasedGeometry . |
double |
getY2()
Returns the y coordinate of the end
Point of this
AbstractArcBasedGeometry . |
int |
hashCode() |
T |
setAngularExtent(Angle angularExtent)
Sets the extension
Angle of this AbstractArcBasedGeometry
. |
T |
setStartAngle(Angle startAngle)
Sets the start
Angle of this AbstractArcBasedGeometry . |
Path |
toPath()
|
boolean |
touches(IGeometry g)
|
expand, expand, 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
protected Angle startAngle
Angle
to the x-axis at which this
AbstractArcBasedGeometry
begins.public Pie(AbstractRectangleBasedGeometry<?,?> r, Angle startAngle, Angle angularExtent)
Pie
from the given values.public Pie(Arc arc)
public Pie(double x, double y, double width, double height, Angle startAngle, Angle angularExtent)
Pie
from the given values.x
- The x-coordinate of the rectangular area which encloses thie
Pie
.y
- The y-coordinate of the rectangular area which encloses thie
Pie
.width
- The width of the rectangular area which encloses thie
Pie
.height
- The height of the rectangular area which encloses thie
Pie
.startAngle
- The counter-clockwise (CCW) Angle
to the x-axis at
which this Pie
begins.angularExtent
- The counter-clockwise (CCW) Angle
that spans this
Pie
.AbstractArcBasedGeometry.AbstractArcBasedGeometry(double, double,
double, double, Angle, Angle)
public Pie getCopy()
IGeometry
IGeometry
.getCopy
in interface IGeometry
IGeometry
IGeometry.getCopy()
public PolyBezier getOutline()
IShape
getOutline
in interface IShape
ICurve
representing this IShape
's outline.public BezierCurve[] getOutlineSegments()
IShape
getOutlineSegments
in interface IShape
ICurve
segments of this IShape
's outline.public Path 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<Path>
angle
- rotation Angle
IGeometry
representing the result of the rotationpublic Path 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<Path>
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 Path 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<Path>
angle
- rotation Angle
center
- relative Point
for the rotationIGeometry
representing the result of the rotationpublic Path 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<Path>
angle
- rotation Angle
IGeometry
representing the result of the rotationpublic Path 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<Path>
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 Path 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<Path>
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()
IGeometry
toPath
in interface IGeometry
Path
representation for this IGeometry
.IGeometry.toPath()
protected CubicCurve[] computeBezierApproximation()
CubicCurve
approximation for this
AbstractArcBasedGeometry
. It is approximated by a maximum of four
CubicCurve
s, each of which covers a maximum of 90 degrees.CubicCurve
approximation for this
AbstractArcBasedGeometry
public Angle getAngularExtent()
Angle
of this
AbstractArcBasedGeometry
, i.e. the Angle
defining the
span of this AbstractArcBasedGeometry
.Angle
of this
AbstractArcBasedGeometry
public Point getP1()
Point
of this AbstractArcBasedGeometry
.Point
of this AbstractArcBasedGeometry
public Point getP2()
Point
of this AbstractArcBasedGeometry
.Point
of this AbstractArcBasedGeometry
public Angle getStartAngle()
AbstractArcBasedGeometry
's start Angle
.AbstractArcBasedGeometry
's start Angle
public double getX1()
Point
of this
AbstractArcBasedGeometry
.Point
of this
AbstractArcBasedGeometry
public double getX2()
Point
of this
AbstractArcBasedGeometry
.Point
of this
AbstractArcBasedGeometry
public double getY1()
Point
of this
AbstractArcBasedGeometry
.Point
of this
AbstractArcBasedGeometry
public double getY2()
Point
of this
AbstractArcBasedGeometry
.Point
of this
AbstractArcBasedGeometry
public T setAngularExtent(Angle angularExtent)
Angle
of this AbstractArcBasedGeometry
.angularExtent
- the new extension Angle
for this
AbstractArcBasedGeometry
this
for conveniencepublic T setStartAngle(Angle startAngle)
Angle
of this AbstractArcBasedGeometry
.startAngle
- the new start Angle
for this
AbstractArcBasedGeometry
this
for conveniencepublic 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.