home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Power Programming
/
powerprogramming1994.iso
/
progtool
/
surfmodl
/
surfm203.arc
/
SURFSRC.ARC
/
INLIMITS.INC
< prev
next >
Wrap
Text File
|
1987-01-05
|
897b
|
39 lines
function INLIMITS (X, Y, Surf: integer): boolean;
{ Check to see if point (X,Y) is within the limits of surface Surf. }
var Xmin, Xmax, Ymin, Ymax: integer;
Node: integer;
Vert: integer;
Xt, Yt: integer;
begin
{$ifdef BIGMEM}
with ptrd^ do with ptre^ do with ptrh^ do
begin
{$endif}
Xmin := 9999;
Xmax := -9999;
Ymin := 9999;
Ymax := -9999;
for Vert := 1 to Nvert[Surf] do begin
Node := konnec (Surf, Vert);
Xt := round (Xtran[Node]);
Yt := round (Ytran[Node]);
if (Xt < Xmin) then
Xmin := Xt;
if (Xt > Xmax) then
Xmax := Xt;
if (Yt < Ymin) then
Ymin := Yt;
if (Yt > Ymax) then
Ymax := Yt;
end;
if (X >= Xmin) and (X <= Xmax) and (Y >= Ymin) and (Y <= Ymax) then
Inlimits := TRUE
else
Inlimits := FALSE;
{$ifdef BIGMEM}
end; {with}
{$endif}
end; { function INLIMITS }