Klasse BoundingBox

java.lang.Object
org.opentcs.data.model.BoundingBox
Alle implementierten Schnittstellen:
Serializable

public class BoundingBox extends Object implements Serializable
A bounding box that can be used, for example, to describe an object's physical dimensions.

A bounding box is characterised by a reference point that is located in the center of the bounding box's base (i.e. at height 0). Therefore, the length and width of the bounding box are symmetrical in relation to the reference point and the height is measured from the base of the bounding box. Additionally, an offset to the reference point describes the position of the bounding box in relation to another point. This is useful when describing the bounding box of an object whose reference point is not at its geometric center. The coordinates of the reference offset refer to a coordinate system whose origin is located at the bounding box's reference point and whose axes run along the longitudinal and transverse axes of the bounding box (i.e. the x-coordinate of the reference offset runs along the length and the y-coordinate along the width of the bounding box).

Siehe auch:
  • Konstruktordetails

    • BoundingBox

      public BoundingBox(long length, long width, long height)
      Creates a new instance with a (0, 0) reference offset.
      Parameter:
      length - The bounding box's length.
      width - The bounding box's width.
      height - The bounding box's height.
  • Methodendetails

    • getLength

      public long getLength()
      Returns the bounding box's length.
      Gibt zurück:
      The bounding box's length.
    • withLength

      public BoundingBox withLength(long length)
      Creates a copy of this object, with the given length.
      Parameter:
      length - The value to be set in the copy.
      Gibt zurück:
      A copy of this object, differing in the given value.
    • getWidth

      public long getWidth()
      Returns the bounding box's width.
      Gibt zurück:
      The bounding box's width.
    • withWidth

      public BoundingBox withWidth(long width)
      Creates a copy of this object, with the given width.
      Parameter:
      width - The value to be set in the copy.
      Gibt zurück:
      A copy of this object, differing in the given value.
    • getHeight

      public long getHeight()
      Returns the bounding box's height.
      Gibt zurück:
      The bounding box's height.
    • withHeight

      public BoundingBox withHeight(long height)
      Creates a copy of this object, with the given height.
      Parameter:
      height - The value to be set in the copy.
      Gibt zurück:
      A copy of this object, differing in the given value.
    • getReferenceOffset

      public Couple getReferenceOffset()
      Returns the bounding box's reference offset.
      Gibt zurück:
      The bounding box's reference offset.
    • withReferenceOffset

      public BoundingBox withReferenceOffset(Couple referenceOffset)
      Creates a copy of this object, with the given reference offset.
      Parameter:
      referenceOffset - The value to be set in the copy.
      Gibt zurück:
      A copy of this object, differing in the given value.
    • equals

      public final boolean equals(Object o)
      Setzt außer Kraft:
      equals in Klasse Object
    • hashCode

      public int hashCode()
      Setzt außer Kraft:
      hashCode in Klasse Object
    • toString

      public String toString()
      Setzt außer Kraft:
      toString in Klasse Object