TRectangle

TRectangle related methods

Type definition is found in shared/globals.simba


TRectangle.ToTPA

function TRectangle.ToTPA(): TPointArray; constref;

TPA from the rectangle.


TRectangle.Bounds

function TRectangle.Bounds(): TBox; constref;

Returns the minimum bounding box covering the rectangle


TRectangle.Radius

function TRectangle.Radius(): Double; constref;

Returns the radius of the shortest side, for the maximum see MaxRadius


TRectangle.MaxRadius

function TRectangle.MaxRadius(): Double; constref;

Returns the radius of the longest side, for minimum see Radius


TRectangle.Mean

function TRectangle.Mean(): TPoint; constref;

Middle of the rectangle

Note

by slacky


TRectangle.Rotate

function TRectangle.Rotate(Angle: Double): TRectangle; constref;

Returns a rotated copy of the rectangle


TRectangle.Contains

function TRectangle.Contains(Pt: TPoint): Boolean; constref;

Returns true if the point Pt is inside the rectangle. .. note:: by slacky


TRectangle.DirByLen

function TRectangle.DirByLen(Longest: Boolean=True): ESplitDirection; constref;

Returns the direction which is the longest or shortest.

Note

by slacky


TRectangle.Partition

function TRectangle.Partition(m,n:Int32; dir:ESplitDirection=rpTopLeft): TRectArray; constref;

Break the rectangle into smaller rectangles. Goes well along with DirByLen

Note

by slacky


TRectangle.OffsetFunc

function TRectangle.OffsetFunc(pt: TPoint): TRectangle; constref;

Offset the rectangle


TRectangle.Filter

function TRectangle.Filter(TestSet: TPointArray): TPointArray; constref;

Extract all the points from TestSet that fits within this rectangle.

Note

by slacky


TRectangle.Expand

function TRectangle.Expand(Inc: Int32): TRectangle; constref;

Increase or decrease the dimensions of the rectangle.

Note

by slacky


TRectangle.NearestEdge

function TRectangle.NearestEdge(P: TPoint): TPoint; constref;

Returns the closest edge point (think Rect.ToTPA.Connect) to the TPoint P.

Note

by slacky