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]; NewInstance: PROC [ob: CD.Object, location: CD.Position_[0,0], orientation: CD.Orientation_0, selected: BOOL _ FALSE, properties: CD.PropList_NIL] RETURNS [CD.Instance]; Transform: PROC [inst: CD.Instance, cellRect: CD.Rect, transformation: CD.Orientation]; Translate: PROC [inst: CD.Instance, offset: CD.Position] = INLINE {inst.location _ CDBasics.AddPoints[inst.location, offset]}; 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]; TransformList: PROC[il: CD.InstanceList, cellRect: CD.Rect, transformation: CD.Orientation]; TranslateList: PROC[il: CD.InstanceList, offset: CD.Position]; DeSelectList: PROC [list: CD.InstanceList]; AppendToList: PROC [inst, to: CD.InstanceList] RETURNS [CD.InstanceList]; SplitPointed: PROC [from: CD.InstanceList, pos: CD.Position] RETURNS [pointed, others: CD.InstanceList]; SplitSelected: PROC [from: CD.InstanceList] RETURNS [selected, others: CD.InstanceList]; OnlySelected: PROC[il: CD.InstanceList] RETURNS [selected: CD.InstanceList]; CopyList: PROC[il: CD.InstanceList] RETURNS [CD.InstanceList]; ComposedCopy: PROC[il: CD.InstanceList, cellPos, cellSize: CD.Position, cellOrient: CD.Orientation] RETURNS [CD.InstanceList]; DeComposedCopy: PROC[il: CD.InstanceList, cellPos, cellSize: CD.Position, cellOrient: CD.Orientation] RETURNS [CD.InstanceList]; END. bCDInstances.mesa (A ChipNDale module) Copyright c 1983, 1985 by Xerox Corporation. All rights reserved. by Christian Jacobi, May 12, 1983 12:22 pm last edited by Christian Jacobi, September 19, 1985 6:32:40 pm PDT --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 around one instance --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 --creates a new instance, does neither draw nor include it into any world --modifies location such that interest-rect is at original location --performs "transformation" to "inst"; the transformation occurs to the rect "cellRect". --"cellRect" and "inst" in the same coordinate system --transformation group NOT abelsch --translates inst^ by offset; inst, offset in same coordinate system --procedures inspecting an instance list --real coordinates --uses outer area's --real coordinates --uses interest area's --returns a reference to an instance at location pos (or NIL if there is none) --uses interest area's --procedures which modify the instances referenced by a list --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 modify the instances --copyes the pointed instance references from "from" to "pointed" --finds maximal 1 pointed instance --copyes the non-pointed instance references from "from" to "others" --does not make copies of the real instances --copyes the selected instance references from "from" to "selected" --copyes the non-selected instance references from "from" 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 list with new 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šœB™BK˜—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šœ žœžœ˜;Kš œ žœžœž œžœžœžœ ˜LKšœI™IKšœC™CK˜—š  œžœžœ ˜$Kšœ žœžœ˜3KšœX™XKšœ5™5Kšœ"™"K˜—š  œžœžœžœ ˜:KšœD™DKšžœ=˜CK˜—K˜Kšœ(™(K˜š   œžœžœžœžœ˜EKšžœžœ˜Kšœ™K™K™—š   œžœžœžœžœ˜EKšžœžœ˜Kšœ™K™—K™š  œžœžœžœžœžœžœžœ ˜iKšœN™NK™K˜—K˜Kšœ<™K˜—š  œžœžœ˜+K˜—š   œžœ žœžœžœ˜IKšœ$™$KšœU™UKšœ*™*K˜—K™KšœJ™JK˜š   œžœžœžœ žœžœ˜hKšœA™AKšœ"™"KšœD™DKšœ,™,K™—š   œžœžœžœžœ˜XKšœC™CKšœE™EKšœ&™&K™—š   œžœžœžœ žœ˜LKšœ%™%K˜—K˜KšœA™AK˜š  œžœžœžœžœ˜>Kšœ'™'K˜—š  œžœžœ˜(Kš œžœžœžœžœ˜VKšœT™TKšœ;™;Kšœ&™&K˜—š œžœžœ˜*Kš œžœžœžœžœ˜VKšœM™MKšœ™Kšœ*™*Kšœ&™&K˜—Kšžœ˜—…—\‘