Class Envelope

java.lang.Object
org.opentcs.data.model.Envelope
All Implemented Interfaces:
java.io.Serializable

public class Envelope
extends java.lang.Object
implements java.io.Serializable
A sequence of vertices that, when connected in their defined order, represent the area that may be occupied by an object.

Since an envelope represents a closed geometry, it is expected that the last vertex matches the first one.

Note that an envelope with less than four vertices is not reasonable, since it cannot span a two-dimensional plane. Such envelopes are therefore considered empty.

See Also:
Serialized Form
  • Constructor Summary

    Constructors 
    Constructor Description
    Envelope​(java.util.List<Couple> vertices)
    Creates a new instance.
  • Method Summary

    Modifier and Type Method Description
    boolean equals​(java.lang.Object obj)  
    java.util.List<Couple> getVertices()
    Returns the sequence of vertices the envelope consists of.
    int hashCode()  
    java.lang.String toString()  

    Methods inherited from class java.lang.Object

    clone, finalize, getClass, notify, notifyAll, wait, wait, wait
  • Constructor Details

    • Envelope

      public Envelope​(@Nonnull java.util.List<Couple> vertices)
      Creates a new instance.
      Parameters:
      vertices - The sequence of vertices the envelope consists of.
      Throws:
      java.lang.IllegalArgumentException - If the sequence of vertices is empty or if the last vertext in the sequence does not match the first one.
  • Method Details

    • getVertices

      public java.util.List<Couple> getVertices()
      Returns the sequence of vertices the envelope consists of.
      Returns:
      The sequence of vertices the envelope consists of.
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class java.lang.Object
    • equals

      public boolean equals​(java.lang.Object obj)
      Overrides:
      equals in class java.lang.Object
    • toString

      public java.lang.String toString()
      Overrides:
      toString in class java.lang.Object