math.geom2d.point
Interface PointSet2D

Package class diagram package PointSet2D
All Superinterfaces:
CirculinearShape2D, Iterable<Point2D>, PointShape2D, Serializable, Shape2D
All Known Implementing Classes:
PointArray2D

public interface PointSet2D
extends PointShape2D, Iterable<Point2D>

A set of points. All points within the set are instances of Point2D. The most direct implementation of PointSet2D is PointArray2D.

Author:
dlegland

Field Summary
 
Fields inherited from interface math.geom2d.Shape2D
ACCURACY
 
Method Summary
 void addPoint(Point2D point)
          Adds a new point to the point set.
 void addPoints(Collection<? extends Point2D> points)
          Add a series of points
 PointSet2D clip(Box2D box)
          Returns a new point set containing only points located within the box.
 int getPointNumber()
          Returns the number of points in the set.
 Collection<Point2D> getPoints()
          Returns an iterator on the internal point collection.
 PointSet2D transform(AffineTransform2D trans)
          Transforms the point set by returning a new point set containing each transformed point.
 
Methods inherited from interface math.geom2d.circulinear.CirculinearShape2D
getBuffer, transform
 
Methods inherited from interface math.geom2d.Shape2D
contains, contains, draw, getBoundingBox, getDistance, getDistance, isBounded, isEmpty
 
Methods inherited from interface java.lang.Iterable
iterator
 

Method Detail

addPoint

void addPoint(Point2D point)
Adds a new point to the point set. If point is not an instance of Point2D, a Point2D with same location is added instead of point.

Parameters:
point - the initial point in the set

addPoints

void addPoints(Collection<? extends Point2D> points)
Add a series of points

Parameters:
points - an array of points

getPoints

Collection<Point2D> getPoints()
Returns an iterator on the internal point collection.

Specified by:
getPoints in interface PointShape2D
Returns:
the collection of points

getPointNumber

int getPointNumber()
Returns the number of points in the set.

Specified by:
getPointNumber in interface PointShape2D
Returns:
the number of points

transform

PointSet2D transform(AffineTransform2D trans)
Transforms the point set by returning a new point set containing each transformed point.

Specified by:
transform in interface PointShape2D
Specified by:
transform in interface Shape2D
Parameters:
trans - an affine transform
Returns:
the transformed shape

clip

PointSet2D clip(Box2D box)
Returns a new point set containing only points located within the box.

Specified by:
clip in interface PointShape2D
Specified by:
clip in interface Shape2D
Parameters:
box - the clipping box
Returns:
the clipped shape


Copyright © 2012 AMIS research group, Faculty of Mathematics and Physics, Charles University in Prague, Czech Republic. All Rights Reserved.