Inst:
PUBLIC
PROC [design:
CD.Design, obj:
CD.ObPtr, conds:
LIST
OF Rope.
ROPE, removeNamed:
BOOL ←
TRUE]
RETURNS [newObj:
CD.ObPtr] =
BEGIN
location: CD.Position;
Copies the application, and inserts it in the applications of newObj, at the position location (in IR coordonnates).
Insert:
PROC [appl:
CD.ApplicationPtr] =
BEGIN
newAppl: CD.ApplicationPtr ← PWBasics.IncludeApplication[newObj, appl.ob, location, appl.orientation];
newAppl.properties ← CDProperties.CopyProps[appl.properties];
END;
-- Get the cell with everything in it
newObj ← CDCells.CreateEmptyCell[];
-- Check every application for the property $PWCond.
FOR appls:
CD.ApplicationList ←
NARROW [obj.specificRef,
CD.CellPtr].contents, appls.rest
WHILE appls #
NIL
DO
ref: REF ← CDProperties.GetPropFromApplication[appls.first, $PWCond];
location ← PWBasics.GetLocation[appls.first, obj]; -- a utiliser!!!!
IF ref = NIL THEN Insert[appls.first]
ELSE
WITH ref
SELECT
FROM
prop: Rope.
ROPE =>
BEGIN -- it is a conditionnal object; see if it is listed
listed: BOOL ← FALSE;
FOR list:
LIST
OF Rope.
ROPE ← conds, list.rest
WHILE list #
NIL
DO
IF Rope.Equal[list.first, prop] THEN listed ← TRUE;
ENDLOOP;
We remove an object if it is listed and removeNamed=TRUE or if removeNamed=FALSE and it is not listed
IF listed # removeNamed THEN Insert[appls.first];
END;
ENDCASE => Insert[appls.first];
ENDLOOP;
PWBasics.RepositionCell[design, newObj];
CDCells.SetInterestRect[newObj, CD.InterestRect[obj]];
PWBasics.AppendProps[newObj, obj];
END;