|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object math.geom2d.point.PointArray2D
public class PointArray2D
Represent the union of a finite number of Point2D.
Field Summary | |
---|---|
protected ArrayList<Point2D> |
points
The inner collection of points composing the set. |
Fields inherited from interface math.geom2d.Shape2D |
---|
ACCURACY |
Constructor Summary | |
---|---|
PointArray2D()
Creates a new PointArray2D without any points. |
|
PointArray2D(Collection<? extends Point2D> points)
Points must be a collection of java.awt.Point. |
|
PointArray2D(int n)
Creates a new empty PointArray2D, but preallocates the memory for storing a given amount of points. |
|
PointArray2D(Point2D[] points)
Instances of Point2D are directly added, other Point are converted to Point2D with the same location. |
Method Summary | |
---|---|
void |
addPoint(Point2D point)
Add a new point to the set of point. |
void |
addPoints(Collection<? extends Point2D> points)
Add a series of points |
void |
addPoints(Point2D[] points)
Add a series of points |
void |
clearPoints()
remove all points of the set. |
PointArray2D |
clip(Box2D box)
Returns a new point set containing only points located within the box. |
PointArray2D |
clone()
|
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. |
static PointSet2D |
create(Collection<? extends Point2D> points)
|
static PointSet2D |
create(int size)
|
static PointSet2D |
create(Point2D[] points)
|
void |
draw(Graphics2D g2)
Draws the point set on the specified Graphics2D, using default radius equal to 1. |
void |
draw(Graphics2D g2,
double r)
Draws the point set on the specified Graphics2D, by filling a disc with a given radius. |
boolean |
equals(Object obj)
|
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)
Return distance to the closest point of the collection |
int |
getPointNumber()
Returns the number of points in the set. |
Collection<Point2D> |
getPoints()
return an iterator on the internal point collection. |
boolean |
isBounded()
always return true. |
boolean |
isEmpty()
Returns true if the shape does not contain any point. |
Iterator<Point2D> |
iterator()
|
PointArray2D |
transform(AffineTransform2D trans)
Transforms the point set by returning a new point set containing each transformed point. |
PointArray2D |
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 |
Field Detail |
---|
protected ArrayList<Point2D> points
Constructor Detail |
---|
public PointArray2D()
public PointArray2D(int n)
n
- the expected number of points in the PointArray2D.public PointArray2D(Point2D[] points)
public PointArray2D(Collection<? extends Point2D> points)
points
- Method Detail |
---|
public static final PointSet2D create(Collection<? extends Point2D> points)
public static final PointSet2D create(Point2D[] points)
public static final PointSet2D create(int size)
public void addPoint(Point2D point)
addPoint
in interface PointSet2D
point
- public void addPoints(Point2D[] points)
points
- an array of pointspublic void addPoints(Collection<? extends Point2D> points)
PointSet2D
addPoints
in interface PointSet2D
points
- an array of pointspublic Collection<Point2D> getPoints()
getPoints
in interface PointSet2D
getPoints
in interface PointShape2D
public void clearPoints()
public int getPointNumber()
getPointNumber
in interface PointSet2D
getPointNumber
in interface PointShape2D
public CirculinearDomain2D getBuffer(double dist)
CirculinearShape2D
getBuffer
in interface CirculinearShape2D
dist
- the maximal distance between a point of the buffer and the
shape
public PointArray2D transform(CircleInversion2D inv)
CirculinearShape2D
transform
in interface CirculinearShape2D
inv
- the circle inversion
public double getDistance(Point2D p)
getDistance
in interface Shape2D
public double getDistance(double x, double y)
Shape2D
getDistance
in interface Shape2D
public boolean isBounded()
isBounded
in interface Shape2D
public boolean isEmpty()
Shape2D
isEmpty
in interface Shape2D
public PointArray2D clip(Box2D box)
PointSet2D
clip
in interface PointSet2D
clip
in interface PointShape2D
clip
in interface Shape2D
box
- the clipping box
public Box2D getBoundingBox()
Shape2D
getBoundingBox
in interface Shape2D
public PointArray2D transform(AffineTransform2D trans)
PointSet2D
transform
in interface PointSet2D
transform
in interface PointShape2D
transform
in interface Shape2D
trans
- an affine transform
public boolean contains(double x, double y)
Shape2D
contains
in interface Shape2D
public boolean contains(Point2D point)
Shape2D
contains
in interface Shape2D
public void draw(Graphics2D g2)
draw
in interface Shape2D
g2
- the graphics to draw the point setpublic void draw(Graphics2D g2, double r)
g2
- the graphics to draw the point setpublic Iterator<Point2D> iterator()
iterator
in interface Iterable<Point2D>
public boolean equals(Object obj)
equals
in class Object
public PointArray2D clone()
clone
in class Object
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |