Добавил:
Studfiles2
Опубликованный материал нарушает ваши авторские права? Сообщите нам.
Вуз:
Предмет:
Файл:Аппроксимация выпуклой оболочки / SOURCE / UNIT3
.PAS unit unit3;
interface
uses wintypes, classes;
type
TColor=Longint;
TInputPoint=record
x:longint;
y:longint;
cl:TColor;
num:integer;
end;
TPointList=class(Tlist)
protected
function GetPoint(index:integer):TInputPoint;
Procedure SetColor(index:integer; const Value:TColor);
public
property Points[index:integer]:TInputPoint read GetPoint;
property PointsColor[index:integer]:TColor write SetColor;
end;
Implementation
function TPointList.GetPoint(index:integer):TInputPoint;
begin
if index>count-1 then index:=index-count;
result:= TInputPoint(items[index]^);
end;
Procedure TPointList.SetColor(index:integer; const Value:TColor);
begin
TInputPoint(items[index]^).cl:=Value;
end;
end.
interface
uses wintypes, classes;
type
TColor=Longint;
TInputPoint=record
x:longint;
y:longint;
cl:TColor;
num:integer;
end;
TPointList=class(Tlist)
protected
function GetPoint(index:integer):TInputPoint;
Procedure SetColor(index:integer; const Value:TColor);
public
property Points[index:integer]:TInputPoint read GetPoint;
property PointsColor[index:integer]:TColor write SetColor;
end;
Implementation
function TPointList.GetPoint(index:integer):TInputPoint;
begin
if index>count-1 then index:=index-count;
result:= TInputPoint(items[index]^);
end;
Procedure TPointList.SetColor(index:integer; const Value:TColor);
begin
TInputPoint(items[index]^).cl:=Value;
end;
end.