public final class Arc extends AbstractRectangleBasedGeometry<T,S> implements ICurve
Arc, which is defined by its
enclosing framing Rectangle, a start Angle (relative to the
x-axis), and an angular extend in counter-clockwise (CCW) direction.| 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 |
|---|
Arc(AbstractRectangleBasedGeometry<?,?> r,
Angle startAngle,
Angle angularExtent)
Constructs a new
Arc of the given values. |
Arc(double x,
double y,
double width,
double height,
Angle startAngle,
Angle angularExtent)
Constructs a new
Arc of 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(Point p)
|
boolean |
equals(java.lang.Object obj) |
Angle |
getAngularExtent()
|
Rectangle |
getBounds()
|
Arc |
getCopy()
Returns a new identical copy of this
IGeometry. |
Point[] |
getIntersections(ICurve c)
|
ICurve[] |
getOverlaps(ICurve c)
|
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. |
Point |
getProjection(Point reference)
|
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)
|
Angle |
getStartAngle()
Returns this
AbstractArcBasedGeometry's start Angle. |
IGeometry |
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() |
boolean |
intersects(ICurve c)
|
boolean |
overlaps(ICurve c)
|
T |
setAngularExtent(Angle angularExtent)
Sets the extension
Angle of this AbstractArcBasedGeometry
. |
T |
setStartAngle(Angle startAngle)
Sets the start
Angle of this AbstractArcBasedGeometry. |
CubicCurve[] |
toBezier()
Computes a list of
BezierCurves that approximate the
ICurve. |
Path |
toPath()
|
java.lang.String |
toString() |
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, translatefinalize, getClass, notify, notifyAll, wait, wait, waitgetP1, getP2, getX1, getX2, getY1, getY2getTransformed, toPath, touchesprotected Angle startAngle
Angle to the x-axis at which this
AbstractArcBasedGeometry begins.public Arc(AbstractRectangleBasedGeometry<?,?> r, Angle startAngle, Angle angularExtent)
Arc of the given values. An Arc is cut
out of an Ellipse. The start Angle is the
counter-clockwise (CCW) Angle to the x-axis at which the
Arc begins. The angular extent is the CCW Angle that
spans the Arc, i.e. the resulting end Angle of the
Arc is the sum of the start Angle and the angular extent.public Arc(double x,
double y,
double width,
double height,
Angle startAngle,
Angle angularExtent)
Arc of the given values. An Arc is cut
out of an Ellipse. The start Angle is the
counter-clockwise (CCW) Angle to the x-axis at which the
Arc begins. The angular extent is the CCW Angle that
spans the Arc, i.e. the resulting end Angle of the
Arc is the sum of the start Angle and the angular extent.x - the x coordinate of the bounds of the Ellipse of which
the Arc is cut outy - the y coordinate of the bounds of the Ellipse of which
the Arc is cut outwidth - the width of the bounds of the Ellipse of which the
Arc is cut outheight - the height of the bounds of the Ellipse of which the
Arc is cut outstartAngle - the CCW Angle at which the Arc beginsangularExtent - the CCW Angle that spans the Arcpublic boolean equals(java.lang.Object obj)
equals in class java.lang.Objectpublic Rectangle getBounds()
IGeometrygetBounds in interface IGeometrygetBounds in class AbstractRectangleBasedGeometry<Arc,PolyBezier>Rectangle object that fully encloses this
IGeometrypublic Arc getCopy()
IGeometryIGeometry.public Point[] getIntersections(ICurve c)
ICurvegetIntersections in interface ICurvec - The ICurve to compute intersection points with.public ICurve[] getOverlaps(ICurve c)
ICurvegetOverlaps in interface ICurvec - The curve to compute overlaps with.public Point getProjection(Point reference)
ICurvePoint onto
this ICurve, i.e. a Point on this ICurve that is
closest to the given reference Point. Note, thatgetProjection in interface ICurvereference - The reference Point for which to return the
projection.Point onto
this ICurve.public PolyBezier getRotatedCCW(Angle angle)
IRotatableAngle 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 AngleIGeometry representing the result of the rotationpublic PolyBezier getRotatedCCW(Angle angle, double cx, double cy)
IRotatableAngle
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 Anglecx - 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)
IRotatableAngle
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 Anglecenter - relative Point for the rotationIGeometry representing the result of the rotationpublic PolyBezier getRotatedCW(Angle angle)
IRotatableAngle clock-wise (CW)
around its center Point. Does not necessarily return an object of
the same type.getRotatedCW in interface IRotatable<PolyBezier>angle - rotation AngleIGeometry representing the result of the rotationpublic PolyBezier getRotatedCW(Angle angle, double cx, double cy)
IRotatableAngle 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 Anglecx - 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)
IRotatableAngle 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 Anglecenter - relative Point for the rotationIGeometry representing the result of the rotationpublic boolean intersects(ICurve c)
ICurveICurve and the given ICurve intersect, i.e.
whether a final set of intersection points exists. Two curves intersect
if they touch (see IGeometry.touches(IGeometry)) but do not
overlap (see ICurve.overlaps(ICurve)).intersects in interface ICurvec - The ICurve to test for intersections.true if they intersect, false otherwisepublic boolean overlaps(ICurve c)
ICurveICurve and the given ICurve overlap, i.e.
whether an infinite set of intersection points exists. Two curves overlap
if they touch (see IGeometry.touches(IGeometry)) but not
intersect (see ICurve.intersects(ICurve)).public CubicCurve[] toBezier()
ICurveBezierCurves that approximate the
ICurve. For example, a Line or a BezierCurve in
general could return a list with the curve itself as its only element.
But an Ellipse or an Arc may return a list of consecutive
BezierCurves which approximate the ICurve.toBezier in interface ICurveBezierCurves that approximate the
ICurvepublic java.lang.String toString()
toString in class java.lang.Objectprotected CubicCurve[] computeBezierApproximation()
CubicCurve approximation for this
AbstractArcBasedGeometry. It is approximated by a maximum of four
CubicCurves, each of which covers a maximum of 90 degrees.CubicCurve approximation for this
AbstractArcBasedGeometrypublic Angle getAngularExtent()
Angle of this
AbstractArcBasedGeometry, i.e. the Angle defining the
span of this AbstractArcBasedGeometry.Angle of this
AbstractArcBasedGeometrypublic Point getP1()
Point of this AbstractArcBasedGeometry.Point of this AbstractArcBasedGeometrypublic Point getP2()
Point of this AbstractArcBasedGeometry.Point of this AbstractArcBasedGeometrypublic Angle getStartAngle()
AbstractArcBasedGeometry's start Angle.AbstractArcBasedGeometry's start Anglepublic double getX1()
Point of this
AbstractArcBasedGeometry.Point of this
AbstractArcBasedGeometrypublic double getX2()
Point of this
AbstractArcBasedGeometry.Point of this
AbstractArcBasedGeometrypublic double getY1()
Point of this
AbstractArcBasedGeometry.Point of this
AbstractArcBasedGeometrypublic double getY2()
Point of this
AbstractArcBasedGeometry.Point of this
AbstractArcBasedGeometrypublic T setAngularExtent(Angle angularExtent)
Angle of this AbstractArcBasedGeometry
.angularExtent - the new extension Angle for this
AbstractArcBasedGeometrythis for conveniencepublic T setStartAngle(Angle startAngle)
Angle of this AbstractArcBasedGeometry.startAngle - the new start Angle for this
AbstractArcBasedGeometrythis for conveniencepublic Path toPath()
IGeometryPath representation for this IGeometry.IGeometry.toPath()public java.lang.Object clone()
Cloneable
.clone in class java.lang.Objectpublic IGeometry getTransformed(AffineTransform t)
Path
representation of this IGeometry. Subclasses may override this
method to return a more specific representation.getTransformed in interface IGeometryt - The AffineTransform to be appliedPath representation of this
IGeometrypublic final int hashCode()
hashCode in class java.lang.ObjectObject.hashCode()Copyright (c) 2014 itemis AG, and others. All rights reserved.