DEFINITION MODULE Polysys;

EXPORT QUALIFIED Polygon, PolygonOperation, CurOperation, ProcWith3IntParams,
                 Empty, Universal, ProcWith6IntParams, push, pop, putfilled,
                 SetDebugging, newsheet, edgeto, endsheet, operate, getbbox,
                 copytfmd, putpolygon, bloat, polyis, polyarea, PSPolygon,
                 PScan, Failed, SetBadSheetAction, checksheet;

CONST              Empty = -1;
               Universal = -2;

TYPE             Polygon;
        PolygonOperation = (Complain, Copy, Not, Neg, Pos, SelfAnd, SelfOr,
                            Dispose, And, Or, Accumulate);
      ProcWith3IntParams = PROCEDURE(INTEGER,INTEGER,INTEGER); 
      ProcWith6IntParams = PROCEDURE(INTEGER,INTEGER,INTEGER,
                                     INTEGER,INTEGER,INTEGER);
				     
VAR  CurOperation : PolygonOperation;
           Failed : BOOLEAN;

PROCEDURE SetDebugging(flag : BOOLEAN);
PROCEDURE newsheet(x, y : INTEGER);
PROCEDURE edgeto  (x, y : INTEGER);
PROCEDURE endsheet();
PROCEDURE checksheet();
PROCEDURE operate (operation : PolygonOperation);
PROCEDURE copytfmd(p : Polygon;
                   swapXandY, negX, negY : BOOLEAN;  tx, ty : INTEGER);
PROCEDURE putpolygon(DWvertex : ProcWith3IntParams);
PROCEDURE putfilled(DWtrapezoid : ProcWith6IntParams);
PROCEDURE bloat (amount : INTEGER);
PROCEDURE polyis(type : INTEGER) : BOOLEAN;
PROCEDURE polyarea() : INTEGER;
PROCEDURE getbbox(VAR llx, lly, urx, ury : INTEGER);
PROCEDURE push(p : Polygon);
PROCEDURE pop(VAR p : Polygon);
PROCEDURE PSPolygon(VAR p : Polygon);
PROCEDURE PScan(p : Polygon);
PROCEDURE SetBadSheetAction(opn : PolygonOperation);

END Polysys.
