Class Polygon

java.lang.Object
jaba.Hull.Polygon
Direct Known Subclasses:
Triangle

public class Polygon extends Object
A class representing a polygon
Version:
1.1
Author:
Chris Pudney cpudney@alphapharm.pharm.uwa.edu.au
  • Constructor Details

    • Polygon

      public Polygon()
      Construct a polygon with no vertices.
    • Polygon

      public Polygon(Vector<Vertex> v)
      Construct a polygon given a list of vertices.
      Parameters:
      v - the list of vertices
  • Method Details

    • reverse

      public void reverse()
      Reverse the order of the vertices that define a contour
    • getVertices

      public Vector<Vertex> getVertices()
      Get the vertices of a polygon.
      Returns:
      Returns a vector p
    • nextVertex

      public Vertex nextVertex(Vertex v)
      Returns the next vertex of a polygon
      Parameters:
      v - the vertex
      Returns:
      the vertex following v, or null if v is not a vertex of the polygon
    • toString

      public String toString()
      Returns a string describing a polygon.
      Overrides:
      toString in class Object