CRect Class
The CRect class encapsulates functionality for a rectangle object used in computing statistics, setting window boundaries, setting the image cursor for measurements, plots, etc. The rectangle properties include 4 numbers that define the coordinates of the rectangle edges. You also can use the CRect class to hold 4 arbitrary numbers which can be processed together using the class methods and operators.
Construction |
Object = NewRect() (global function with several overloads) Object = CRect:new() (class method with several overloads) |
Destruction |
Object:delete() |
These properties specify the rectangle coordinate limits of the CRect object. You can set them directly or by using several methods.
Global function that creates a new CRect object. |
|
Creates a new CRect object. Same as NewRect. |
|
Deletes the instance of the CRect object. |
The CRect class contains numerous math operators so you can use CRect objects in expressions, like R=(R1+R2)/2. These are described on the CRect Operators page.
In addition to using the properties by name, like R.xmin, the methods below allow you to set or get all the properties in one operation.
Returns the 4 properties corresponding to the min and max x values and the min and max y values of the rectangle. |
|
Sets the 4 properties for the x and y limits of the rectangle. |
Rounds all rectangle values up to the next higher integer value. |
|
Rounds all rectangle values down to the next lower integer value. |
|
Returns the height of the rectangle. |
|
Inflates a rectangle by pulling outward on all 4 sides. |
|
Returns a rectangle having the 4 inner dimensions of 2 overlapping rectangles. |
|
Normalizes the CRect so that the minimum is less than the maximum value in each direction. |
|
Offsets a rectangle's sides to move and/or resize it. |
|
Returns true if the specified point x,y is inside the rectangle. |
|
Returns true if the specified point x,y is inside the rectangle. |
|
Returns true if the specified rectangle is completely enclosed with the rectangle. |
|
Rounds the rectanble limits to the nearest integer value. |
|
Returns the width and height of the rectangle. |
|
Returns a rectangle having the 4 outer dimensions of 2 overlapping rectangles. |
|
Returns the width of the rectangle. |