edu.umd.cfar.lamp.viper.geometry
Interface BoxInformation

All Superinterfaces:
java.lang.Cloneable
All Known Implementing Classes:
Attribute_bbox.Bbox, Attribute_obox.Obox, BoundingBox, OrientedBox

public interface BoxInformation
extends java.lang.Cloneable

An Oriented Box is a rectangle that is rotated about its bottom right corner. The BoxInformation class presents a unified interface to both BoundingBoxes and OrientedBoxes, as well as any other shape that fits the definition.


Method Summary
 java.lang.Object clone()
           
 boolean contains(Pnt point)
          Tests to see if the specified point is within this rectangle
 Pnt getCentroid()
          A rational approximation of the box's centroid.
 int getHeight()
          Gets the height of the box.
 Pnt getNearIntersection(Pnt q1)
          Get the point of intersection between the ray from the centroid of this box through q1 that is closest to q1.
 int getRotation()
          Gets the number of degrees the box is rotated counterclockwise about its origin.
 int getWidth()
          Gets the width of the box.
 int getX()
          Gets the x-coordinate of the box's origin.
 int getY()
          Gets the y-coordinate of the box's origin.
 

Method Detail

getX

public int getX()
Gets the x-coordinate of the box's origin.

Returns:
the x-coordinate of the box's origin.

getY

public int getY()
Gets the y-coordinate of the box's origin.

Returns:
the y-coordinate of the box's origin.

getWidth

public int getWidth()
Gets the width of the box.

Returns:
the width of the box.

getHeight

public int getHeight()
Gets the height of the box.

Returns:
the height of the box.

getRotation

public int getRotation()
Gets the number of degrees the box is rotated counterclockwise about its origin.

Returns:
the rotation, in degrees.

getCentroid

public Pnt getCentroid()
A rational approximation of the box's centroid.

Returns:
the center point of the box

contains

public boolean contains(Pnt point)
Tests to see if the specified point is within this rectangle

Parameters:
point - the point to test
Returns:
true iff the point is within this rectangle

getNearIntersection

public Pnt getNearIntersection(Pnt q1)
Get the point of intersection between the ray from the centroid of this box through q1 that is closest to q1.

Parameters:
q1 - A point that is not the centroid.
Returns:
A point on the perimeter of the box on the ray from the centroid through q1.

clone

public java.lang.Object clone()