uavsim.datatypes
Class Box

java.lang.Object
  extended by uavsim.datatypes.Box

public class Box
extends java.lang.Object

Defines a box with an anchor at its center and a size, both in arbitrary units.

Author:
Dan Tappan [23.06.11]

Field Summary
private  CoordinateCartesianAbsolute _center
          the anchor position at the center
private  Size _size
          the size
 
Constructor Summary
Box(CoordinateCartesianAbsolute center, Size size)
          Creates a box descriptor.
 
Method Summary
 CoordinateCartesianAbsolute getBoundingBoxBottomRight()
          Determines the bottom-right corner of the box.
 CoordinateCartesianAbsolute getBoundingBoxTopLeft()
          Determines the top-left corner of the box.
 CoordinateCartesianAbsolute getCenter()
          Gets the anchor position at the center of the box.
 Size getSize()
          Gets the size.
 boolean isContained(CoordinateCartesianAbsolute point)
          Determines whether a point is contained within the box.
 java.lang.String toString()
          
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

_center

private final CoordinateCartesianAbsolute _center
the anchor position at the center


_size

private final Size _size
the size

Constructor Detail

Box

public Box(CoordinateCartesianAbsolute center,
           Size size)
Creates a box descriptor.

Parameters:
center - - the anchor position
size - - the size
Method Detail

getBoundingBoxBottomRight

public CoordinateCartesianAbsolute getBoundingBoxBottomRight()
Determines the bottom-right corner of the box.

Returns:
the coordinate

getBoundingBoxTopLeft

public CoordinateCartesianAbsolute getBoundingBoxTopLeft()
Determines the top-left corner of the box.

Returns:
the coordinate

getCenter

public CoordinateCartesianAbsolute getCenter()
Gets the anchor position at the center of the box.

Returns:
the position

getSize

public Size getSize()
Gets the size.

Returns:
the size

isContained

public boolean isContained(CoordinateCartesianAbsolute point)
Determines whether a point is contained within the box.

Parameters:
point - - the point
Returns:
the result

toString

public java.lang.String toString()

Overrides:
toString in class java.lang.Object