ATPABounds

From SCAR Divi Manual
Revision as of 03:50, 23 October 2011 by Freddy (talk | contribs) (Created page with "==Definition== <source lang="scar" lines="false"> function ATPABounds(const ATPA: T2DPointArray): TBox; </source> ==Availability== SCAR Divi 3.28 > Current ==Description== This...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

Definition

function ATPABounds(const ATPA: T2DPointArray): TBox;

Availability

SCAR Divi 3.28 > Current

Description

This function calculates the bounds of a given T2DPointArray ATPA by searching the most outer coordinates of a box which can contain all of the points and returns that box as a TBox.

Example

var
  ATPA: T2DPointArray;
  Box: TBox;

begin
  SetLength(ATPA, 3);
  ATPA[0] := [];
  ATPA[1] := [Point(1, 1), Point(2, 2)];
  ATPA[2] := [Point(5, 10)];
  Box := ATPABounds(ATPA);
  WriteLn('Box(' + IntToStr(Box.x1) + ',' + IntToStr(Box.y1) + ',' +
    IntToStr(Box.x2) + ',' + IntToStr(Box.y2) + ')');
end.

Output:

Box(1,1,5,10)

See Also