|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object math.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(Collection<LinearRing2D> lines)
|
|
MultiPolygon2D(LinearRing2D ring)
|
|
MultiPolygon2D(LinearRing2D[] rings)
|
|
MultiPolygon2D(SimplePolygon2D polygon)
|
Method Summary | |
---|---|
void |
addPolygon(SimplePolygon2D polygon)
|
void |
addPolyline(LinearRing2D ring)
Deprecated. |
void |
addRing(LinearRing2D ring)
|
MultiPolygon2D |
clip(Box2D box)
Returns a new instance of MultiPolygon2D. |
MultiPolygon2D |
clone()
|
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. |
void |
draw(Graphics2D g2)
Draws the boundary of the domain, using current Stroke and color. |
boolean |
equals(Object obj)
|
void |
fill(Graphics2D g)
Fills the interior of the domain, using the Graphics current Paint. |
CirculinearBoundarySet2D<LinearRing2D> |
getBoundary()
Returns the boundary of the set. |
Box2D |
getBoundingBox()
Returns the bounding box of the shape. |
CirculinearDomain2D |
getBuffer(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. |
double |
getDistance(double x,
double y)
get 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. |
double |
getDistance(Point2D p)
get 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. |
int |
getEdgeNumber()
Returns the number of edges of the polygon |
Collection<LineSegment2D> |
getEdges()
Return the edges as line segments of the polygon |
Collection<SimplePolygon2D> |
getPolygons()
Return the set of (oriented) polygons forming this MultiPolygon2D. |
Collection<LinearRing2D> |
getRings()
Returns the set of rings comprising the boundary of this polygon. |
Point2D |
getVertex(int i)
Returns the i-th vertex of the polygon. |
int |
getVertexNumber()
Returns the number of vertices of the polygon |
Collection<Point2D> |
getVertices()
Returns the vertices (singular points) of the polygon |
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. |
MultiPolygon2D |
transform(AffineTransform2D trans)
Transforms the shape by an affine transform. |
CirculinearDomain2D |
transform(CircleInversion2D inv)
Transforms the shape by a circle inversion. |
Methods inherited from class java.lang.Object |
---|
finalize, 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(Collection<LinearRing2D> lines)
Method Detail |
---|
public void addPolygon(SimplePolygon2D polygon)
public Collection<SimplePolygon2D> getPolygons()
@Deprecated public void addPolyline(LinearRing2D ring)
public void addRing(LinearRing2D ring)
public Collection<LinearRing2D> getRings()
Polygon2D
getRings
in interface Polygon2D
public CirculinearDomain2D transform(CircleInversion2D inv)
CirculinearShape2D
transform
in interface CirculinearDomain2D
transform
in interface CirculinearShape2D
inv
- the circle inversion
public CirculinearDomain2D getBuffer(double dist)
CirculinearShape2D
getBuffer
in interface CirculinearShape2D
dist
- the maximal distance between a point of the buffer and the
shape
public CirculinearBoundarySet2D<LinearRing2D> getBoundary()
Domain2D
The returned curve is oriented, with an interior and an exterior.
getBoundary
in interface CirculinearDomain2D
getBoundary
in interface Domain2D
getBoundary
in interface Polygon2D
public Polygon2D complement()
Domain2D
complement
in interface Domain2D
complement
in interface Polygon2D
public Collection<LineSegment2D> getEdges()
Polygon2D
getEdges
in interface Polygon2D
public int getEdgeNumber()
Polygon2D
getEdgeNumber
in interface Polygon2D
public Collection<Point2D> getVertices()
Polygon2D
getVertices
in interface Polygon2D
public Point2D getVertex(int i)
getVertex
in interface Polygon2D
i
- index of the vertex, between 0 and the number of verticespublic int getVertexNumber()
Polygon2D
getVertexNumber
in interface Polygon2D
public Box2D getBoundingBox()
Shape2D
getBoundingBox
in interface Shape2D
public MultiPolygon2D clip(Box2D box)
clip
in interface Domain2D
clip
in interface Shape2D
box
- the clipping box
public double getDistance(Point2D p)
Shape2D
getDistance
in interface Shape2D
public double getDistance(double x, double y)
Shape2D
getDistance
in interface Shape2D
public boolean isBounded()
Shape2D
isBounded
in interface Shape2D
public boolean isEmpty()
isEmpty
in interface Shape2D
public MultiPolygon2D transform(AffineTransform2D trans)
Shape2D
transform
in interface Domain2D
transform
in interface Polygon2D
transform
in interface Shape2D
trans
- an affine transform
public boolean contains(Point2D point)
Shape2D
contains
in interface Shape2D
public boolean contains(double x, double y)
Shape2D
contains
in interface Shape2D
public void draw(Graphics2D g2)
Domain2D
draw
in interface Domain2D
draw
in interface Shape2D
g2
- the Graphics to draw onpublic void fill(Graphics2D g)
Domain2D
fill
in interface Domain2D
g
- the Graphics to fill onpublic boolean equals(Object obj)
equals
in class Object
public MultiPolygon2D clone()
clone
in class Object
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |