math.geom2d.polygon
Interface Polygon2D

Package class diagram package Polygon2D
All Superinterfaces:
CirculinearDomain2D, CirculinearShape2D, Domain2D, Serializable, Shape2D
All Known Implementing Classes:
HRectangle2D, MultiPolygon2D, Rectangle2D, SimplePolygon2D

public interface Polygon2D
extends CirculinearDomain2D

Represent any class made of a finite set of simply connected edges. This include simple polygons, multiple polygons, or more specialized shapes like rectangles, squares...


Field Summary
 
Fields inherited from interface math.geom2d.Shape2D
ACCURACY
 
Method Summary
 Polygon2D complement()
          Returns the complementary polygon.
 CirculinearBoundarySet2D<? extends LinearRing2D> getBoundary()
          Returns the boundary of the set.
 int getEdgeNumber()
          Returns the number of edges of the polygon
 Collection<? extends LineSegment2D> getEdges()
          Return the edges as line segments of the polygon
 Collection<? extends 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
 Polygon2D transform(AffineTransform2D trans)
          Returns the new Polygon created by an affine transform of this polygon.
 
Methods inherited from interface math.geom2d.circulinear.CirculinearDomain2D
transform
 
Methods inherited from interface math.geom2d.circulinear.CirculinearShape2D
getBuffer
 
Methods inherited from interface math.geom2d.domain.Domain2D
clip, draw, fill
 
Methods inherited from interface math.geom2d.Shape2D
contains, contains, getBoundingBox, getDistance, getDistance, isBounded, isEmpty
 

Method Detail

getVertices

Collection<Point2D> getVertices()
Returns the vertices (singular points) of the polygon


getVertex

Point2D getVertex(int i)
Returns the i-th vertex of the polygon.

Parameters:
i - index of the vertex, between 0 and the number of vertices

getVertexNumber

int getVertexNumber()
Returns the number of vertices of the polygon

Since:
0.6.3

getEdges

Collection<? extends LineSegment2D> getEdges()
Return the edges as line segments of the polygon


getEdgeNumber

int getEdgeNumber()
Returns the number of edges of the polygon


getRings

Collection<? extends LinearRing2D> getRings()
Returns the set of rings comprising the boundary of this polygon.

Returns:
the set of boundary rings.

getBoundary

CirculinearBoundarySet2D<? extends LinearRing2D> getBoundary()
Description copied from interface: Domain2D
Returns the boundary of the set. This boundary is either a continuous non intersecting curve (connected domain), or a set of non intersecting continuous curve (one continuous non-intersection for each connected part of the domain).

The returned curve is oriented, with an interior and an exterior.

Specified by:
getBoundary in interface CirculinearDomain2D
Specified by:
getBoundary in interface Domain2D
Returns:
the boundary of the domain

transform

Polygon2D transform(AffineTransform2D trans)
Returns the new Polygon created by an affine transform of this polygon.

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

complement

Polygon2D complement()
Returns the complementary polygon.

Specified by:
complement in interface Domain2D
Returns:
the polygon complementary to this


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