Difference between revisions of "TPAFilterTriangle"

From SCAR Divi Manual
Jump to: navigation, search
 
Line 8: Line 8:
  
 
===Notes===
 
===Notes===
*Before 3.37.01 the function didn't resize the filtered array
+
*Before 3.37.01 the function didn't resize the filtered array.
  
 
==Description==
 
==Description==

Latest revision as of 18:50, 25 November 2012

Definition

procedure TPAFilterTriangle(var TPA: TPointArray; const X1, Y1, X2, Y2, X3, Y3: Integer);

Availability

SCAR Divi 3.35 > Current

Notes

  • Before 3.37.01 the function didn't resize the filtered array.

Description

Filters points from a given TPointArray TPA by removing all points that are inside of the given triangle area. (X1, Y1), (X2, Y2) and (X3, Y3) define the corner points of the triangle.

Example

var
  TPA: TPointArray;

begin
  TPA := [Point(0, 0), Point(2, 2), Point(2, 3), Point(5, 10)];
  WriteLn(TPAToStr(TPA));
  TPAFilterTriangle(TPA, 1, 1, 1, 4, 3, 4);
  WriteLn('Filtered: ' + TPAToStr(TPA));
end.

Output:

(0,0);(2,2);(2,3);(5,10)
Filtered: (0,0);(2,2);(5,10)

See Also