com.kuka.nav.geometry
Class Polygon

java.lang.Object
  extended by com.kuka.geometry.SpatialForm
      extended by com.kuka.nav.geometry.SpatialForm2D
          extended by com.kuka.nav.geometry.Polygon

public class Polygon
extends SpatialForm2D

Implements a polygon as a spatial form. The polygon is defined by an ordered list of 2D points relative to a reference frame.


Constructor Summary
Polygon(List<Point2D> points)
          Creates a new polygon instance with a given list of 2D points.
 
Method Summary
 boolean approxEquals(SpatialForm2D other, double epsilon)
          Compares this form with another form and permits a degree of inaccuracy.
 boolean equals(Object obj)
           
 List<Point2D> getVertices()
           
 int hashCode()
           
 
Methods inherited from class com.kuka.nav.geometry.SpatialForm2D
getName, setName
 
Methods inherited from class com.kuka.geometry.SpatialForm
createFrame, getOwnerObject, getReferenceFrame, setOwnerObject, setReferenceFrame
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Polygon

public Polygon(List<Point2D> points)
Creates a new polygon instance with a given list of 2D points.

Parameters:
points - the polygon vertices
Method Detail

getVertices

public List<Point2D> getVertices()
Returns:
the vertices of this polygon

hashCode

public int hashCode()
Overrides:
hashCode in class SpatialForm2D

equals

public boolean equals(Object obj)
Overrides:
equals in class SpatialForm2D

approxEquals

public boolean approxEquals(SpatialForm2D other,
                            double epsilon)
Description copied from class: SpatialForm2D
Compares this form with another form and permits a degree of inaccuracy.

Specified by:
approxEquals in class SpatialForm2D
Parameters:
other - another form
epsilon - the maximum envelope that coordinates can differ to still be considered equal
Returns:
true if the other form is of the same shape type and its parameters are within the epsilon envelope of this one


Copyright © 2019. All rights reserved.