CDSetDisplayTresholdsImpl.mesa (a ChipNDale module)
Copyright © 1986, 1987 by Xerox Corporation. All rights reserved.
Created by Christian October 28, 1986 10:47:15 am PST
Last edited by: Christian Jacobi, February 13, 1987 1:17:03 pm PST
DIRECTORY
CD,
CDBottomUp,
CDCells,
CDCommandOps,
CDOps,
CDSequencer,
TerminalIO;
CDSetDisplayTresholdsImpl: CEDAR PROGRAM
IMPORTS CDBottomUp, CDCells, CDCommandOps, CDOps, TerminalIO =
BEGIN
SetTreshold: PUBLIC PROC [design: CD.Design, root: CD.Object] = {
[] ← CDBottomUp.StartRecurse[setTresholdClass, root, design];
};
DoSetTreshold: CDBottomUp.DoProc = {
IF CDCells.IsCell[ob] THEN
CDCells.SetSimplificationTreshhold[ob, -1];
};
ResetDisplayTresholdsComm: PROC [comm: CDSequencer.Command] = {
inst: CD.Instance ← CDOps.TheInstance[comm.design, "recompute display treshold hierarchycally\n"];
IF inst#NIL THEN {
SetTreshold[comm.design, inst.ob];
TerminalIO.PutRope["--done\n"]
}
};
setTresholdClass: CDBottomUp.Class ← CDBottomUp.Register[DoSetTreshold, NIL, $CDSetDisplayTresholds, $CDSetDisplayTresholds];
--use the CDBottomUp mechanism because we want to deal every object just once but
--some silly user didn't include the objects in the directory.
CDCommandOps.RegisterWithMenu[menu: $ProgramMenu, entry: "reset display tresholds", proc: ResetDisplayTresholdsComm, key: $CDSetDisplayTresholds];
END.