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
IShape s. |
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
IShape s 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)
IMultiShape
IGeometry
is fully contained by this
IMultiShape
.contains
in interface IMultiShape
g
- The IGeometry
which is tested for containment.true
if the IGeometry
is contained by this
IMultiShape
, otherwise false
public boolean equals(java.lang.Object obj)
equals
in class java.lang.Object
protected Line[] getAllEdges()
IShape
s. For a Region
the internal IShape
s are Rectangle
s. For a Ring
the internal IShape
s are Polygon
s (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
.IShape
spublic Ring getCopy()
IGeometry
IGeometry
.public Ring 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<Ring>
angle
- rotation Angle
IGeometry
representing the result of the rotationpublic Ring 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<Ring>
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 Ring 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<Ring>
angle
- rotation Angle
center
- relative Point
for the rotationIGeometry
representing the result of the rotationpublic Ring 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<Ring>
angle
- rotation Angle
IGeometry
representing the result of the rotationpublic Ring 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<Ring>
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 Ring 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<Ring>
angle
- rotation Angle
center
- relative Point
for the rotationIGeometry
representing the result of the rotationpublic Ring getScaled(double factor)
IScalable
Point
.public Ring getScaled(double fx, double fy)
IScalable
Point
.public Ring getScaled(double factor, double cx, double cy)
IScalable
Point
(cx, cy).public Ring getScaled(double fx, double fy, double cx, double cy)
IScalable
Point
(cx, cy).public Ring getScaled(double fx, double fy, Point center)
IScalable
Point
.public Ring getScaled(double factor, Point center)
IScalable
Point
.public Polygon[] getShapes()
IMultiShape
IShape
s that constitute this IMultiShape
.getShapes
in interface IMultiShape
IShape
s, 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 IGeometry
t
- The AffineTransform
to be appliedPath
representation of this
IGeometry
public Ring getTranslated(double dx, double dy)
ITranslatable
getTranslated
in interface ITranslatable<Ring>
dx
- x-translationdy
- y-translationpublic Ring getTranslated(Point d)
ITranslatable
Point
.getTranslated
in interface ITranslatable<Ring>
d
- translation Point
public 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 Angle
this
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 Angle
this
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)
IScalable
Point
.public Ring scale(double fx, double fy)
IScalable
Point
.public Ring scale(double factor, double cx, double cy)
IScalable
Point
(cx, cy).public Ring scale(double fx, double fy, double cx, double cy)
IScalable
Point
(cx, cy).public Ring scale(double fx, double fy, Point center)
IScalable
Point
.public Ring scale(double factor, Point center)
IScalable
Point
.public Ring translate(double dx, double dy)
ITranslatable
translate
in interface ITranslatable<Ring>
dx
- x-translationdy
- y-translationthis
for conveniencepublic Ring translate(Point d)
ITranslatable
Point
.translate
in interface ITranslatable<Ring>
d
- translation Point
this
for conveniencepublic Polyline[] getOutlines()
IMultiShape
Computes the outlines of this IMultiShape
.
The outlines are returned as an array of ICurve
s. For every
closed outline of this IMultiShape
one ICurve
is
returned.
getOutlines
in interface IMultiShape
ICurve
s, 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 IShape
s that only exist once.
getOutlineSegments
in interface IMultiShape
AbstractMultiShape
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.