org.osm2world.core.math
Class PolygonXYZ

Object
  extended by PolygonXYZ

public class PolygonXYZ
extends Object

a three-dimensional polygon


Constructor Summary
PolygonXYZ(List<VectorXYZ> vertexLoop)
           
 
Method Summary
 TriangleXYZ asTriangleXYZ()
          returns a triangle with the same vertices as this polygon.
 List<LineSegmentXYZ> getSegments()
           
 SimplePolygonXZ getSimpleXZPolygon()
          caller must check whether flattening will result in a simple planar polygon
 List<VectorXYZ> getVertexLoop()
          returns the polygon's vertices.
 List<VectorXYZ> getVertices()
          returns the polygon's vertices.
 PolygonXZ getXZPolygon()
           
 PolygonXYZ reverse()
          returns a reversed version of this polygon.
 int size()
          returns the number of vertices in this polygon.
 
Methods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

PolygonXYZ

public PolygonXYZ(List<VectorXYZ> vertexLoop)
Parameters:
vertexLoop - vertices defining the polygon; first and last vertex must be equal
Method Detail

getVertices

public List<VectorXYZ> getVertices()
returns the polygon's vertices. Unlike getVertexLoop(), there is no duplication of the first/last vertex.


getVertexLoop

public List<VectorXYZ> getVertexLoop()
returns the polygon's vertices. First and last vertex are equal.


size

public int size()
returns the number of vertices in this polygon. The duplicated first/last vertex is not counted twice, so the result is equivalent to getVertices().size().


getSegments

public List<LineSegmentXYZ> getSegments()

getXZPolygon

public PolygonXZ getXZPolygon()

getSimpleXZPolygon

public SimplePolygonXZ getSimpleXZPolygon()
caller must check whether flattening will result in a simple planar polygon


asTriangleXYZ

public TriangleXYZ asTriangleXYZ()
returns a triangle with the same vertices as this polygon. Requires that the polygon is triangular!


reverse

public PolygonXYZ reverse()
returns a reversed version of this polygon. It consists of the same vertices, but has the other direction.