DIRECTORY CD, CDBasics, CDOrient; CDInstances: CEDAR DEFINITIONS IMPORTS CDBasics, CDOrient = BEGIN PointToO: PROC [pos: CD.Position, inst: CD.Instance] RETURNS [BOOL] = INLINE {RETURN [CDBasics.InsidePos[pos, InstRectO[inst]]]}; PointToI: PROC [pos: CD.Position, inst: CD.Instance] RETURNS [BOOL]; HitInstance: PROC[inst: CD.Instance, hitRect: CD.Rect] RETURNS [BOOL]; InstRectO: PROC [inst: CD.Instance] RETURNS [CD.Rect] = INLINE {RETURN [CDOrient.RectAt[inst.location, inst.ob.size, inst.orientation]]}; InstRectI: PROC [inst: CD.Instance] RETURNS [CD.Rect]; BoundingRectO: PROC[list: CD.InstanceList, selectedOnly: BOOL_FALSE] RETURNS [CD.Rect]; BoundingRectI: PROC[list: CD.InstanceList, selectedOnly: BOOL_FALSE] RETURNS [CD.Rect]; InstanceAt: PROC [il: CD.InstanceList, pos: CD.Position, selectedOnly: BOOL_FALSE] RETURNS [CD.Instance]; Translate: PROC [inst: CD.Instance, offset: CD.Position] = INLINE {inst.location _ CDBasics.AddPoints[inst.location, offset]}; TranslateList: PROC[il: CD.InstanceList, offset: CD.Position]; DeSelectList: PROC [list: CD.InstanceList]; AppendToList: PROC [inst, to: CD.InstanceList] RETURNS [CD.InstanceList]; SplitSelected: PROC [il: CD.InstanceList] RETURNS [selected, others: CD.InstanceList]; OnlySelected: PROC[il: CD.InstanceList] RETURNS [selected: CD.InstanceList]; NewInst: PROC [ob: CD.Object, location: CD.Position_[0,0], orientation: CD.Orientation_0, selected: BOOL _ FALSE, properties: CD.PropList_NIL] RETURNS [CD.Instance]; NewInstI: PROC [ob: CD.Object, location: CD.Position_[0,0], orientation: CD.Orientation_0, selected: BOOL _ FALSE, properties: CD.PropList_NIL] RETURNS [CD.Instance]; Copy: PROC [inst: CD.Instance] RETURNS [CD.Instance]; Composed: PROC[inst: CD.Instance, cellPos, cellSize: CD.Position, cellOrient: CD.Orientation] RETURNS [CD.Instance]; DeComposed: PROC[inst: CD.Instance, cellPos, cellSize: CD.Position, cellOrient: CD.Orientation] RETURNS [CD.Instance]; CopyList: PROC[il: CD.InstanceList] RETURNS [CD.InstanceList]; ComposedList: PROC[il: CD.InstanceList, cellPos, cellSize: CD.Position, cellOrient: CD.Orientation] RETURNS [CD.InstanceList]; DeComposedList: PROC[il: CD.InstanceList, cellPos, cellSize: CD.Position, cellOrient: CD.Orientation] RETURNS [CD.InstanceList]; END. ,CDInstances.mesa (A ChipNDale module) Copyright c 1983, 1986 by Xerox Corporation. All rights reserved. by Christian Jacobi, May 12, 1983 12:22 pm last edited by Christian Jacobi, March 14, 1986 2:13:10 pm PST --Procedures with vanilla stuff around instances --Contents --be careful, InstanceList's are lists of pointers, distinguish between: --procedures which modify the instance list, from procedures which don't --procedures which modify the instances pointed to, from procedures which don't --procedures which modify an instance list, from procedures which modify the instances --procedures inspecting an instance or a list --returns "pos points to the inst", using its virtual coordinates --returns "pos points to the instance", using its virtual coordinates --returns "hitRect points to the instance" --interest rect --real coordinates --uses outer area's --real coordinates --uses interest area's --returns a an instance at location pos (or NIL if there is none) --uses interest area's --procedures which modify the instance or list in place --translates inst^ by offset; inst, offset in same coordinate system --composes the lists "inst" and "to" --the original list "to" might be destroyed and must be replaced by the returned list --the original list "inst" is not touched --procedures which handle the instance list but don't make new the instances --copyes the selected instance refs from "il" to "selected" --copyes the non-selected instance refs from "il" to "others" --returns new lists but same instances --returns new list but same instances --procedures which create a new instance list, with new instances --creates a new instance, does neither draw nor include it into any world --creates a new instance, does neither draw nor include it into any world --modifies location such that interest-rect is at original location --makes a copy --makes a composed copy --makes a decomposed copy --creates a new list with new, copied instances --makes a copy of "il" with world coordinates assumed that "il" has cell coordinates --cellSize in cell coordinates, cellPos in world cordinates --the new list points to new instances --makes a copy of "il" with cell coordinates assumed il has world coordinates --cellSize in cell coordinates --cellPos, cellOrient in world coordinates --the new list points to new instances Κ˜codešœ(™(Kšœ Οmœ7™BKšœ+™+Kšœ>™>K˜—Kšœ0™0K˜šΟk ˜ Kšžœ˜Kšœ ˜ K˜ —K˜šΠbl œžœž œ˜Kšžœ˜—Kšž˜K˜šœ ™ KšœH™HKšœH™HKšœO™OKšœV™VK˜—K˜Kšœ-™-K˜š Οnœžœžœžœ žœžœ˜FKšœA™AKšžœžœ-˜;K˜—š  œžœžœžœ žœžœ˜DKšœE™E—K˜š   œžœžœžœžœžœ˜FKšœ+™+—K˜š   œžœžœ žœžœ˜7KšžœžœC˜QK˜—š   œžœžœ žœžœ˜6Kšœ™K˜—K˜š  œžœžœžœžœžœžœ˜WKšœ™K™K™—š  œžœžœžœžœžœžœ˜WKšœ™K™—K™K˜š  œžœžœžœžœžœžœžœ ˜iKšœA™AK™K˜—K˜Kšœ7™7K˜š  œžœžœžœ ˜:KšœD™DKšžœ=˜CK˜—š  œžœžœžœ ˜>K˜—š  œžœžœ˜+K˜—š   œžœ žœžœžœ˜IKšœ$™$KšœU™UKšœ*™*K˜—K™KšœL™LK˜š   œžœžœžœžœ˜VKšœ;™;Kšœ=™=Kšœ&™&K™—š   œžœžœžœ žœ˜LKšœ%™%K˜—K™KšœA™AK˜š œžœžœ ˜Kšœ žœžœ˜;Kš œ žœžœžœ žœžœžœ ˜LKšœI™IK˜—š œžœžœ ˜Kšœ žœžœ˜;Kš œ žœžœžœ žœžœžœ ˜LKšœI™IKšœC™CK˜—š  œžœžœ žœžœ ˜5Kšœ™K˜—š œžœžœžœžœžœžœ ˜tKšœ™K˜—š  œžœžœžœžœžœžœ ˜vKšœ™K˜—š  œžœžœžœžœ˜>Kšœ/™/K˜—š  œžœžœ˜(Kš œžœžœžœžœ˜VKšœT™TKšœ;™;Kšœ&™&K˜—š œžœžœ˜*Kš œžœžœžœžœ˜VKšœM™MKšœ™Kšœ*™*Kšœ&™&K˜—Kšžœ˜—…— 3