Graphics Reference
In-Depth Information
{ Now close the output }
if numout > 0 then
begin
outpts[numout] := outpts[0];
Inc (numout);
end
end ; { M_Clip }
boolean function SegMetWindow ( integer cflag)
return ( (cflag and SEGM) π 0 );
boolean function Clipped ( integer cflag)
{ Actually, this function should return true only if the first point is clipped;
otherwise we generate redundant points. }
return ( (cflag and CLIP) π 0 );
boolean function TwoBitCase ( integer cflag)
return ( (cflag and TWOBITS) π 0 );
procedure TwoBitEndPoint ()
{ The line has been rejected and we have a 2-bit endpoint. }
if (startC and endC and (TWOBITS - 1)) = 0 then
begin
{ The points have no region bits in common. We need to generate
an extra turning point - which one is specified by Cra table. }
if TwoBitCase (startC)
then BothAreTwoBits ()
{ defines aC for this case }
else aC := endC + Tcc[startC];
{ 1-bit start point, 2-bit endpoint }
outpts[numout] := clipRegion[Cra[aC and not (TWOBITS)]];
Inc (numout);
end ; { TwoBitEndPoint }
procedure BothAreTwoBits ()
{ Determines what aC should be by doing midpoint subdivision. }
begin
boolean notdone;
pnt2d Pt1, Pt2, aPt;
notdone := true ;
Pt1 := startPt;
Pt2 := endPt;
Algorithm 3.3.4.2. Continued
Search WWH ::




Custom Search