-- AddAlignMarks.mesa
-- Last Edited by: Kimr, September 25, 1984 11:30:38 am PDT
DIRECTORY
AlignmentMarks,
CD,
CDCells,
CDDirectory,
CDSequencer,
Real,
Rope,
TerminalIO;
AddAlignMarks: CEDAR PROGRAM
IMPORTS CD, AlignmentMarks, CDCells, CDDirectory, CDSequencer, Real, TerminalIO =
BEGIN
design: CD.Design;
PlaceAlignMarks: CDDirectory.EachEntryAction =
-- PROC [name: Rope.ROPE, ob: CD.ObPtr] RETURNS [quit: BOOL�LSE];
BEGIN
cell: CD.CellPtr;
ap: CD.ApplicationPtr;
mark: AlignmentMarks.Mark;
IF ISTYPE[ob.specificRef, CD.CellPtr] THEN {
cell ← NARROW[ob.specificRef, CD.CellPtr];
FOR aplist: CD.ApplicationList ← cell.contents, aplist.rest WHILE aplist # NIL DO
ap ← aplist.first;
IF ISTYPE[ap.ob.specificRef, CD.RectPtr] THEN {
IF CD.LevelKey[ap.ob.level] = $pol THEN {
TerminalIO.WriteRope["found one\n "];
mark.pos ← [x: ap.location.x, y: ap.location.y+Real.RoundI[ap.ob.size.y/2]];
mark.name ← "left";
[] ← CDCells.IncludeApplication[design: design, cell: ob, aptr: AlignmentMarks.MakeMarkAptr[mark: mark]];
mark.pos ← [x: ap.location.x+ap.ob.size.x, y: ap.location.y+Real.RoundI[ap.ob.size.y/2]];
mark.name ← "right";
[] ← CDCells.IncludeApplication[design: design, cell: ob, aptr: AlignmentMarks.MakeMarkAptr[mark: mark]];
[] ← CDCells.RemoveApplication[design: design, cell: ob, aptr: ap, draw: FALSE];
};
};
ENDLOOP
}
ELSE
TerminalIO.WriteRope["directory object not a cell\n"];
END;
AddMarks: PROC[ comm: CDSequencer.Command] =
BEGIN
design ← comm.design;
TerminalIO.WriteRope["Adding marks to poly lines in cells \n"];
[] ← CDDirectory.Enumerate[design: design, action: PlaceAlignMarks];
TerminalIO.WriteRope["Done adding marks\n"];
END;
-- module initialization
CDSequencer.ImplementCommand[$MirrorS, AddMarks];
END.