Class Box- Box.h, Box.cc



 
Definition:
A Box is a rectangular area.  A box is specified by its upper left point, its width and height.
Typedefs:
None
Included:
#include "Point.h"



Variable Index
 
o int width
The width of this box.
o int height
The height of this box.
oPoint upper_left
The upper left position of this box.

Constructor Index
 
o Box()
Default constructor.
o Box(Point * init_point, int w, int h)
Sets the variable upper_left to 'init_point', width to 'w' and height to 'h'.
o Box(int x, int y, int w, int h)
Sets the variable upper_left to (x,y), width to 'w' and height to 'h'.

Method Index
 
o int getWidth()
Returns the variable width.
o int getHeight()
Returns the variable height.
o Point * getUpperLeft()
Returns the variable upper_left.
o int getUpperLeftX()
Returns the x value of upper_left.
o int getUpperLeftY()
Returns the y value of upper_left.
o int getPerimeter()
Returns the value of the perimeter of this box i.e. the bounding box length.
o int getHalfPerimeter()
Returns the value of half of the perimeter for this box.  Useful when determining the length of an "L-type" routing.