View Javadoc

1   /**
2    * File: 	PointShape2D.java
3    * Project: javaGeom
4    * 
5    * Distributed under the LGPL License.
6    *
7    * Created: 6 feb. 09
8    */
9   package math.geom2d.point;
10  
11  import java.util.Collection;
12  
13  import math.geom2d.AffineTransform2D;
14  import math.geom2d.Box2D;
15  import math.geom2d.Point2D;
16  import math.geom2d.circulinear.CirculinearShape2D;
17  
18  
19  /**
20   * Interface for shapes composed of a finite set of points. Single points
21   * should also implements this interface. Implementations of this interface
22   * can contains duplicate points.
23   * @author dlegland
24   *
25   */
26  public interface PointShape2D extends CirculinearShape2D, Iterable<Point2D> {
27  
28      /**
29       * Returns the points in the shape as a collection.
30       * 
31       * @return the collection of points
32       */
33      public Collection<Point2D> getPoints();
34  
35      /**
36       * Returns the number of points in the set.
37       * 
38       * @return the number of points
39       */
40      public int getPointNumber();
41      
42      /**
43       * Transforms the point shape by an affine transform. 
44       * The result is an instance of PointShape2D.
45       */
46      public abstract PointShape2D transform(AffineTransform2D trans);
47  
48      /**
49       * When a PointShape2D is clipped, the result is still a PointShape2D.
50       */
51      public abstract PointShape2D clip(Box2D box);
52  }