|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectmath.geom2d.polygon.MultiPolygon2D
public class MultiPolygon2D
A polygonal domain whose boundary is composed of several disjoint continuous LinearRing2D.
| Field Summary |
|---|
| Fields inherited from interface math.geom2d.Shape2D |
|---|
ACCURACY |
| Constructor Summary | |
|---|---|
MultiPolygon2D()
|
|
MultiPolygon2D(java.util.Collection<LinearRing2D> lines)
|
|
MultiPolygon2D(LinearRing2D... rings)
|
|
MultiPolygon2D(LinearRing2D ring)
|
|
MultiPolygon2D(SimplePolygon2D polygon)
|
|
| Method Summary | |
|---|---|
void |
addRing(LinearRing2D ring)
|
void |
addVertex(Point2D position)
Adds a vertex at the end of the last ring of this polygon. |
boolean |
almostEquals(GeometricObject2D obj,
double eps)
Checks if the two objects are similar up to a given threshold value. |
double |
area()
Computes the signed area of the polygon. |
Polygon2D |
asPolygon(int n)
Returns an approximation of the domain as a polygon, or a MultiPolygon. |
CirculinearContourArray2D<LinearRing2D> |
boundary()
Returns the boundary of the set. |
Box2D |
boundingBox()
Returns the bounding box of the shape. |
CirculinearDomain2D |
buffer(double dist)
Computes the buffer of the shape, formed by the set of points located at a distance from the shape that is lower or equal to d. |
Point2D |
centroid()
Computes the centroid (center of mass) of the polygon. |
void |
clearRings()
|
Polygon2D |
clip(Box2D box)
Clips the polygon with the specified box. |
MultiPolygon2D |
clone()
|
int |
closestVertexIndex(Point2D point)
Computes the index of the closest vertex to the input point. |
Polygon2D |
complement()
Returns the domain which complements this domain in the plane. |
boolean |
contains(double x,
double y)
Checks if the shape contains the planar point defined by (x,y). |
boolean |
contains(Point2D point)
Checks if the shape contains the given point. |
java.util.Collection<LinearRing2D> |
contours()
Returns the set of contours that enclose this domain. |
static MultiPolygon2D |
create(java.util.Collection<LinearRing2D> rings)
|
static MultiPolygon2D |
create(LinearRing2D... rings)
|
double |
distance(double x,
double y)
Returns the distance of the shape to the given point, specified by x and y, or the distance of point to the frontier of the shape in the case of a plain (i.e. fillable) shape. |
double |
distance(Point2D p)
Returns the distance of the shape to the given point, or the distance of point to the frontier of the shape in the case of a plain shape. |
void |
draw(java.awt.Graphics2D g2)
Draws the boundary of the domain, using current Stroke and color. |
int |
edgeNumber()
Returns the number of edges of the polygon |
java.util.Collection<LineSegment2D> |
edges()
Return the edges as line segments of the polygon |
boolean |
equals(java.lang.Object obj)
|
void |
fill(java.awt.Graphics2D g)
Fills the interior of the domain, using the Graphics current Paint. |
LinearRing2D |
getRing(int index)
|
void |
insertRing(int index,
LinearRing2D ring)
|
void |
insertVertex(int index,
Point2D point)
Inserts a vertex at the given position |
boolean |
isBounded()
Returns true if the shape is bounded, that is if we can draw a finite rectangle enclosing the shape. |
boolean |
isEmpty()
The MultiPolygon2D is empty either if it contains no ring, or if all rings are empty. |
void |
removeRing(LinearRing2D ring)
|
void |
removeVertex(int i)
Returns the i-th vertex of the polygon. |
int |
ringNumber()
|
void |
setRing(int index,
LinearRing2D ring)
|
void |
setVertex(int i,
Point2D point)
Sets the position of the i-th vertex of this polygon. |
MultiPolygon2D |
transform(AffineTransform2D trans)
Transforms the shape by an affine transform. |
CirculinearDomain2D |
transform(CircleInversion2D inv)
Transforms the shape by a circle inversion. |
Point2D |
vertex(int i)
Returns the i-th vertex of the polygon. |
int |
vertexNumber()
Returns the total number of vertices in this polygon. |
java.util.Collection<Point2D> |
vertices()
Returns the vertices (singular points) of the polygon |
| Methods inherited from class java.lang.Object |
|---|
getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public MultiPolygon2D()
public MultiPolygon2D(LinearRing2D ring)
public MultiPolygon2D(LinearRing2D... rings)
public MultiPolygon2D(SimplePolygon2D polygon)
public MultiPolygon2D(java.util.Collection<LinearRing2D> lines)
| Method Detail |
|---|
public static MultiPolygon2D create(java.util.Collection<LinearRing2D> rings)
public static MultiPolygon2D create(LinearRing2D... rings)
public void addRing(LinearRing2D ring)
public void insertRing(int index,
LinearRing2D ring)
public void removeRing(LinearRing2D ring)
public void clearRings()
public LinearRing2D getRing(int index)
public void setRing(int index,
LinearRing2D ring)
public int ringNumber()
public double area()
area in interface Polygon2Dpublic Point2D centroid()
centroid in interface Polygon2Dpublic java.util.Collection<LineSegment2D> edges()
Polygon2D
edges in interface Polygon2Dpublic int edgeNumber()
Polygon2D
edgeNumber in interface Polygon2Dpublic java.util.Collection<Point2D> vertices()
Polygon2D
vertices in interface Polygon2Dpublic Point2D vertex(int i)
vertex in interface Polygon2Di - index of the vertex, between 0 and the number of vertices minus one
public void setVertex(int i,
Point2D point)
setVertex in interface Polygon2Di - index of the vertex, between 0 and the number of verticespoint - the new position of the vertexpublic void addVertex(Point2D position)
addVertex in interface Polygon2Dposition - the position of the new vertex
java.lang.RuntimeException - if this MultiPolygon does not contain any ring
public void insertVertex(int index,
Point2D point)
insertVertex in interface Polygon2Dindex - index at which the specified vertex is to be insertedpoint - the position of the new vertexpublic void removeVertex(int i)
removeVertex in interface Polygon2Di - index of the vertex, between 0 and the number of vertices minus onepublic int vertexNumber()
vertexNumber in interface Polygon2Dpublic int closestVertexIndex(Point2D point)
closestVertexIndex in interface Polygon2Dpublic CirculinearDomain2D transform(CircleInversion2D inv)
CirculinearShape2D
transform in interface CirculinearDomain2Dtransform in interface CirculinearShape2Dinv - the circle inversion
public CirculinearDomain2D buffer(double dist)
CirculinearShape2D
buffer in interface CirculinearShape2Ddist - the maximal distance between a point of the buffer and the
shape
public Polygon2D asPolygon(int n)
Domain2D
asPolygon in interface Domain2Dpublic CirculinearContourArray2D<LinearRing2D> boundary()
Domain2DThe returned curve is oriented, with an interior and an exterior.
boundary in interface CirculinearDomain2Dboundary in interface Domain2Dboundary in interface Polygon2Dpublic java.util.Collection<LinearRing2D> contours()
Domain2D
contours in interface CirculinearDomain2Dcontours in interface Domain2Dcontours in interface Polygon2DContour2Dpublic Polygon2D complement()
Domain2D
complement in interface CirculinearDomain2Dcomplement in interface Domain2Dcomplement in interface Polygon2Dpublic Box2D boundingBox()
Shape2D
boundingBox in interface Shape2Dpublic Polygon2D clip(Box2D box)
clip in interface Domain2Dclip in interface Polygon2Dclip in interface Shape2Dbox - the clipping box
public double distance(Point2D p)
Shape2D
distance in interface Shape2D
public double distance(double x,
double y)
Shape2D
distance in interface Shape2Dpublic boolean isBounded()
Shape2D
isBounded in interface Shape2Dpublic boolean isEmpty()
isEmpty in interface Shape2Dpublic MultiPolygon2D transform(AffineTransform2D trans)
Shape2D
transform in interface Domain2Dtransform in interface Polygon2Dtransform in interface Shape2Dtrans - an affine transform
public boolean contains(Point2D point)
Shape2D
contains in interface Shape2D
public boolean contains(double x,
double y)
Shape2D
contains in interface Shape2Dpublic void draw(java.awt.Graphics2D g2)
Domain2D
draw in interface Domain2Ddraw in interface Shape2Dg2 - the Graphics to draw onpublic void fill(java.awt.Graphics2D g)
Domain2D
fill in interface Domain2Dg - the Graphics to fill on
public boolean almostEquals(GeometricObject2D obj,
double eps)
GeometricObject2D
almostEquals in interface GeometricObject2Dobj - the object to compareeps - a threshold value, for example the minimal coordinate difference
public boolean equals(java.lang.Object obj)
equals in class java.lang.Objectpublic MultiPolygon2D clone()
clone in class java.lang.Object
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||