[ Home | About | Tech Info & Data | Publications | References ] [ Site by Jeffrey Hall | Research funded by NSF ]
The Rect class implements defintion of and operations on rectangular areas. Most of the methods are quite compact and simple, and are simply meant to provide a common bit of code for frequently used operations.
2008 July 17 - Documentation written.
Coord topLeft
Coord bottomRight
Calls Rect::height, Rect::width
Return float area
Returns the area of the rectangle.
Calls Rect::height, Rect::width, Coord::get
Return float[ 2 ] center
Returns the center of the rectangle as an (x, y) pair of floats.
argument float x
argument float y
Calls Rect::center, Rect::shift_to
Shifts the center of the rectangle to (x, y), preserving its dimensions.
Calls Rect::center
Return bool TRUE, FALSE
Returns TRUE if the rectangle is centered at [0,0], FALSE otherwise.
Calls Root::cleanup
Destructor. Destroys the Coord data members. Never call this procedure directly; it is invoked by IDL's Obj_Destroy function.
Structure definition. Specifies the contents of the IDL structure instantiated by the Rect class. Used by Obj_New; do not invoke directly.
Calls Rect::height, Rect::width
Return float diagonal
Returns the length of the rectangle's diagonal.
argument Rect rect
Calls Rect::get_top_left, Rect::get_bottom_right, Rect::set
Sets the coordinates of the rectangle equal to those of the Rect passed in the argument.
Calls Rect::get_bottom_right, Rect::get_top_left
Return float[ 2 ] [bottom, left]
Returns the bottom and left coordinates of the rectangle as an array of two floats.
Calls Rect::get
Return Coord bottomRight
Returns the bottom right coordinate of the rectangle.
Calls Rect::get_bottom_right, Rect::get_top_left
Return float[ 2 ] [top, right]
Returns the bottom and top coordinates of the rectangle as an array of two floats.
Calls Rect::get_bottom_right, Rect::get_top_left
Return float[ 2 ] [left, right]
Returns the left and right doordinates of the rectangle.
Calls Rect::get
Return Coord topLeft
Returns the top left coordinate of the rectangle.
Calls Rect::get_bottom_right, Rect::get_top_left
Return float[ 2 ] [top, right]
Returns the top and right coordinates of the rectangle as an array of two floats.
Calls Rect::get_bottom_left, Coord::diff
Return float height
Returns the height of the rectangle.
argument float top
argument float left
argument float bottom
argument float right
Return bool TRUE
Constructor. The arguments specify the values of the rectangle sides. Never call this function directly; it is invoked by IDL's Obj_New function.
Calls Coord::is_valid
Return long valid
Each OIL class has an is_valid function that performs class-specific tests on its data members. If all members are found to be valid, however validity is defined for that class, this funtion returns 1. Otherwise, a negative number is returned that contains a bitwise combination of all errors detected. In the case of Rect, the error codes are: -1 (if Obj_Valid called on the Rect is NULL) or -2 (if either of the Coord objects are invalid.
argument float top
argument float left
argument float bottom
argument float right
Calls Coord::set
Sets the dimensions of the rectangle.
keyword float top
keyword float left
keyword float bottom
keyword float right
Calls Coord::set, Coord::get
Sets any the value of any one or any combination of the sides of the rectangle via the keywords.
argument float xAmount
argument float yAmount
Calls Coord::set, Coord::get
Sets the dimensions of the rectangle.
Calls Rect::get_top_left, Coord::diff
Return float width
Returns the width of the rectangle.
obj = Obj_New( 'Rect', 512, 0, 0, 512 )
Obj_Destroy( obj )