public class Ring extends java.lang.Object implements ITranslatable<Ring>, IScalable<Ring>, IRotatable<Ring>
| Constructor and Description |
|---|
Ring()
Constructs a new empty
Ring. |
Ring(Polygon... polygons)
|
Ring(Ring other)
|
| Modifier and Type | Method and Description |
|---|---|
Ring |
add(Polygon p)
|
java.lang.Object |
clone()
Overridden with public visibility as recommended within
Cloneable
. |
boolean |
contains(IGeometry g)
Checks if the given
IGeometry is fully contained by this
IMultiShape. |
boolean |
contains(Point p)
|
boolean |
equals(java.lang.Object obj) |
protected Line[] |
getAllEdges()
Collects all edges of the internal
IShapes. |
Rectangle |
getBounds()
|
Ring |
getCopy()
Returns a new identical copy of this
IGeometry. |
Polyline[] |
getOutlines()
Computes the outlines of this
IMultiShape. |
Line[] |
getOutlineSegments()
Computes the outline segments of this
AbstractMultiShape. |
Ring |
getRotatedCCW(Angle angle)
|
Ring |
getRotatedCCW(Angle angle,
double cx,
double cy)
|
Ring |
getRotatedCCW(Angle angle,
Point center)
|
Ring |
getRotatedCW(Angle angle)
|
Ring |
getRotatedCW(Angle angle,
double cx,
double cy)
|
Ring |
getRotatedCW(Angle angle,
Point center)
|
Ring |
getScaled(double factor)
Scales a copy of the calling object by the given factor relative to its
center
Point. |
Ring |
getScaled(double fx,
double fy)
Scales a copy of the calling object by the given factors relative to its
center
Point. |
Ring |
getScaled(double factor,
double cx,
double cy)
Scales a copy of the calling object by the given factor relative to the
given center
Point (cx, cy). |
Ring |
getScaled(double fx,
double fy,
double cx,
double cy)
Scales a copy of the calling object by the given factors relative to the
given center
Point (cx, cy). |
Ring |
getScaled(double fx,
double fy,
Point center)
Scales a copy of the calling object by the given factors relative to the
given center
Point. |
Ring |
getScaled(double factor,
Point center)
Scales a copy of the calling object by the given factor relative to the
given center
Point. |
Polygon[] |
getShapes()
Returns the
IShapes that constitute this IMultiShape. |
Ring |
getTransformed(AffineTransform t)
|
Ring |
getTranslated(double dx,
double dy)
Translates a copy of this object by the given values in x and y
direction.
|
Ring |
getTranslated(Point d)
Translates a copy of this object by the given
Point. |
int |
hashCode() |
Ring |
rotateCCW(Angle angle)
|
Ring |
rotateCCW(Angle angle,
double cx,
double cy)
|
Ring |
rotateCCW(Angle angle,
Point center)
|
Ring |
rotateCW(Angle angle)
|
Ring |
rotateCW(Angle angle,
double cx,
double cy)
|
Ring |
rotateCW(Angle angle,
Point center)
|
Ring |
scale(double factor)
Scales the calling object by the given factor relative to its center
Point. |
Ring |
scale(double fx,
double fy)
Scales the calling object by the given factors relative to the given
center
Point. |
Ring |
scale(double factor,
double cx,
double cy)
Scales the calling object by the given factor relative to the given
center
Point (cx, cy). |
Ring |
scale(double fx,
double fy,
double cx,
double cy)
Scales the calling object by the given factors relative to the given
center
Point (cx, cy). |
Ring |
scale(double fx,
double fy,
Point center)
Scales the calling object by the given factors relative to the given
center
Point. |
Ring |
scale(double factor,
Point center)
Scales the calling object by the given factor relative to the given
center
Point. |
Path |
toPath()
|
boolean |
touches(IGeometry g)
|
Ring |
translate(double dx,
double dy)
Translates the object by the given values in x and y direction.
|
Ring |
translate(Point d)
Translates the object by the given
Point. |
public Ring()
Ring.public Ring(Polygon... polygons)
public boolean contains(IGeometry g)
IMultiShapeIGeometry is fully contained by this
IMultiShape.contains in interface IMultiShapeg - The IGeometry which is tested for containment.true if the IGeometry is contained by this
IMultiShape, otherwise falsepublic boolean equals(java.lang.Object obj)
equals in class java.lang.Objectprotected Line[] getAllEdges()
IShapes. For a Region
the internal IShapes are Rectangles. For a Ring
the internal IShapes are Polygons (triangles).
The internal edges are needed to determine inner and outer segments of
the IMultiShape. Based on the outline of the IMultiShape,
the outline intersections can be computed. These outline intersections
are required to test if an ICurve is fully-contained by the
IMultiShape.IShapespublic Ring getCopy()
IGeometryIGeometry.public Ring 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<Ring>angle - rotation AngleIGeometry representing the result of the rotationpublic Ring 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<Ring>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 Ring 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<Ring>angle - rotation Anglecenter - relative Point for the rotationIGeometry representing the result of the rotationpublic Ring 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<Ring>angle - rotation AngleIGeometry representing the result of the rotationpublic Ring 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<Ring>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 Ring 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<Ring>angle - rotation Anglecenter - relative Point for the rotationIGeometry representing the result of the rotationpublic Ring getScaled(double factor)
IScalablePoint.public Ring getScaled(double fx, double fy)
IScalablePoint.public Ring getScaled(double factor, double cx, double cy)
IScalablePoint (cx, cy).public Ring getScaled(double fx, double fy, double cx, double cy)
IScalablePoint (cx, cy).public Ring getScaled(double fx, double fy, Point center)
IScalablePoint.public Ring getScaled(double factor, Point center)
IScalablePoint.public Polygon[] getShapes()
IMultiShapeIShapes that constitute this IMultiShape.getShapes in interface IMultiShapeIShapes, representing the parts that make up
this IMultiShape.public Ring 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 Ring getTranslated(double dx, double dy)
ITranslatablegetTranslated in interface ITranslatable<Ring>dx - x-translationdy - y-translationpublic Ring getTranslated(Point d)
ITranslatablePoint.getTranslated in interface ITranslatable<Ring>d - translation Pointpublic Ring rotateCCW(Angle angle)
Ring counter-clock-wise around its center
Point by the given Angle. Direct adaptation means, that
this PolyBezier is modified in-place.angle - rotation Anglethis for conveniencepublic Ring rotateCCW(Angle angle, double cx, double cy)
Ring counter-clock-wise around the given
point (specified by cx and cy) by the given Angle. Direct
adaptation means, that this PolyBezier is modified
in-place.public Ring rotateCCW(Angle angle, Point center)
Ring counter-clock-wise around the given
Point by the given Angle. Direct adaptation means, that
this PolyBezier is modified in-place.public Ring rotateCW(Angle angle)
Ring clock-wise around its center
Point by the given Angle. Direct adaptation means, that
this PolyBezier is modified in-place.angle - rotation Anglethis for conveniencepublic Ring rotateCW(Angle angle, double cx, double cy)
Ring clock-wise around the given point
(specified by cx and cy) by the given Angle. Direct adaptation
means, that this PolyBezier is modified in-place.public Ring rotateCW(Angle angle, Point center)
Ring clock-wise around the given
Point by the given Angle. Direct adaptation means, that
this PolyBezier is modified in-place.public Ring scale(double factor)
IScalablePoint.public Ring scale(double fx, double fy)
IScalablePoint.public Ring scale(double factor, double cx, double cy)
IScalablePoint (cx, cy).public Ring scale(double fx, double fy, double cx, double cy)
IScalablePoint (cx, cy).public Ring scale(double fx, double fy, Point center)
IScalablePoint.public Ring scale(double factor, Point center)
IScalablePoint.public Ring translate(double dx, double dy)
ITranslatabletranslate in interface ITranslatable<Ring>dx - x-translationdy - y-translationthis for conveniencepublic Ring translate(Point d)
ITranslatablePoint.translate in interface ITranslatable<Ring>d - translation Pointthis for conveniencepublic Polyline[] getOutlines()
IMultiShape
Computes the outlines of this IMultiShape.
The outlines are returned as an array of ICurves. For every
closed outline of this IMultiShape one ICurve is
returned.
getOutlines in interface IMultiShapeICurves, one for each closed outlinepublic Line[] getOutlineSegments()
Computes the outline segments of this AbstractMultiShape.
The outline segments of this AbstractMultiShape are those outline
segments of the internal IShapes that only exist once.
getOutlineSegments in interface IMultiShapeAbstractMultiShapepublic java.lang.Object clone()
Cloneable
.clone in class java.lang.Objectpublic final int hashCode()
hashCode in class java.lang.ObjectObject.hashCode()Copyright (c) 2014 itemis AG, and others. All rights reserved.