DIRECTORY IO, TerminalIO, Rope, Commander, Menus, Labels , IP, IPCTG, IPCoTab, IPOrient, IPToolBox, IPBasicOps, IPTopOps, IPTop, IPMVEditOps; IPMVEditOpsImpl: CEDAR PROGRAM IMPORTS IO, IPCoTab, IPOrient, IPToolBox, IPBasicOps, IPCTG, IPTopOps, Rope, TerminalIO EXPORTS IPMVEditOps = BEGIN OPEN Top: IPTop, CT: IPCoTab, CTG: IPCTG; DefaultBrkOtherIfX: BOOL _ FALSE; DefaultOrientation: CTG.ChType _ hor; MenuHit: PUBLIC PROC [top: Top.Ref, command: ATOM, mouse: Menus.MouseButton, shift, control: BOOL] RETURNS [reGeom, refreshFlag: BOOL _ TRUE] ={ SELECT command FROM $BrkX =>{argStream: IO.STREAM _ IO.RIS[TerminalIO.RequestRope["BreakCross: \n"]]; refCh: CTG.Channel _ top.ctg.GetChannel[argStream.GetID]; toBreakCh: CTG.Channel _ top.ctg.GetChannel[argStream.GetID]; TerminalIO.PutRope["Breaking Cross..."]; [] _ IPTopOps.BreakCross[top, refCh, toBreakCh, TRUE];}; $FomX =>{argStream: IO.STREAM _ IO.RIS[TerminalIO.RequestRope["FormCross: \n"]]; ch1: CTG.Channel _ top.ctg.GetChannel[argStream.GetID]; ch2: CTG.Channel _ top.ctg.GetChannel[argStream.GetID]; TerminalIO.PutRope["Form Cross..."]; [] _ IPTopOps.FormCross[top, ch1, ch2, TRUE];}; $RemZ =>{argStream: IO.STREAM _ IO.RIS[TerminalIO.RequestRope["RemoveZ: \n"]]; zSpine: CTG.Channel _ top.ctg.GetChannel[argStream.GetID]; TerminalIO.PutRope["Remove Z..."]; [] _ IPTopOps.RemoveZ[top, zSpine, TRUE];}; $FomZ =>{argStream: IO.STREAM _ IO.RIS[TerminalIO.RequestRope["FormZ: \n"]]; comp1: CTG.Component _ top.coTab.GetComponent[argStream.GetID]; comp2: CTG.Component _ top.coTab.GetComponent[argStream.GetID]; zType: CTG.Side _ IF Rope.Equal[argStream.GetID, "neg", FALSE] THEN neg ELSE pos; TerminalIO.PutRope["Form Z..."]; [] _ IPTopOps.FormZ[top, comp1, comp2, zType, TRUE];}; $LtoT =>{argStream: IO.STREAM _ IO.RIS[TerminalIO.RequestRope["LtoT: \n"]]; ch: CTG.Channel _ top.ctg.GetChannel[argStream.GetID]; whichEnd: CTG.Side _ IF Rope.Equal[argStream.GetID, "neg", FALSE] THEN neg ELSE pos; TerminalIO.PutRope["Changing L to T..."]; [] _ IPTopOps.LtoT[top, ch, whichEnd, TRUE];}; $TtoL =>{argStream: IO.STREAM _ IO.RIS[TerminalIO.RequestRope["TtoL: \n"]]; co: CT.Component _ top.coTab.GetComponent[argStream.GetID]; ch: CTG.Channel _ top.ctg.GetChannel[argStream.GetID]; lType: CTG.Side _ IF Rope.Equal[argStream.GetID, "neg", FALSE] THEN neg ELSE pos; TerminalIO.PutRope["Changing T to L..."]; [] _ IPTopOps.TtoL[top, co, ch, lType, TRUE];}; $FlxKne =>{argStream: IO.STREAM _ IO.RIS[TerminalIO.RequestRope["FlexKnee: \n"]]; leg: CTG.Channel _ top.ctg.GetChannel[argStream.GetID]; floor: CTG.Channel _ top.ctg.GetChannel[argStream.GetID]; whichEnd: CTG.Side _ IF Rope.Equal[argStream.GetID, "neg", FALSE] THEN neg ELSE pos; TerminalIO.PutRope["Forming Knee ..."]; [] _ IPTopOps.FlexKnee[top, leg, floor, whichEnd, TRUE];}; $ExtKne =>{argStream: IO.STREAM _ IO.RIS[TerminalIO.RequestRope["ExtendKnee: \n"]]; shin: CTG.Channel _ top.ctg.GetChannel[argStream.GetID]; TerminalIO.PutRope["Extending Knee..."]; [] _ IPTopOps.ExtendKnee[top, shin, TRUE];}; $FlipT =>{argStream: IO.STREAM _ IO.RIS[TerminalIO.RequestRope["FlipT: \n"]]; chToBend: CTG.Channel _ top.ctg.GetChannel[argStream.GetID]; attachTo: CTG.Channel _ top.ctg.GetChannel[argStream.GetID]; whichEnd: CTG.Side _ IF Rope.Equal[argStream.GetID, "neg", FALSE] THEN neg ELSE pos; TerminalIO.PutRope["FlippingT..."]; [] _ IPTopOps.FlipT[top, chToBend, attachTo, whichEnd, TRUE];}; $Mrr => {argStream: IO.STREAM _ IO.RIS[TerminalIO.RequestRope["Mirror: \n"]]; comp: CT.Component _ top.coTab.GetComponent[argStream.GetID]; mirrorOrient: CTG.ChType; IF Rope.Equal[IO.GetID[argStream! IO.EndOfStream => {mirrorOrient _ IPBasicOps.OTFlip[DefaultOrientation]; CONTINUE}], "hor", FALSE] THEN mirrorOrient _ hor ELSE mirrorOrient _ ver; TerminalIO.PutRope[Rope.Cat["Mirroring ", CT.GetName[comp], "..."]]; [] _ IPTopOps.Mirror[top, comp, mirrorOrient, TRUE];}; $Rot => {argStream: IO.STREAM _ IO.RIS[TerminalIO.RequestRope["Rotate: \n"]]; comp: CT.Component _ top.coTab.GetComponent[argStream.GetID]; numberOfRot: INT; numberOfRot _ IO.GetInt[argStream ! IO.EndOfStream => {numberOfRot _ 1; CONTINUE}]; TerminalIO.PutRope[Rope.Cat["Rotating ", CT.GetName[comp], "...."]]; [] _ IPTopOps.Rotate[top, comp, numberOfRot, TRUE];}; $Ornt => {argStream: IO.STREAM _ IO.RIS[TerminalIO.RequestRope["Orient: \n"]]; comp: CT.Component _ top.coTab.GetComponent[argStream.GetID]; opCode: IP.Orientation _ IPOrient.CDIntToOrien[argStream.GetInt]; TerminalIO.PutRope[Rope.Cat["Orienting ", CT.GetName[comp], "..."]]; [] _ IPTopOps.Orient[top, comp, opCode, TRUE];}; $SetCo => {argStream: IO.STREAM _ IO.RIS[TerminalIO.RequestRope["SetComponent: \n"]]; comp: CT.Component _ top.coTab.GetComponent[IO.GetTokenRope[argStream, IO.IDProc].token]; active: BOOL; atX, atY: INT; atX _ IO.GetInt[argStream ! IO.EndOfStream => {atX _ 1; CONTINUE}]; atY _ IO.GetInt[argStream ! IO.EndOfStream => {atY _ 1; CONTINUE}]; active _ IO.GetBool[argStream ! IO.EndOfStream => {active _ TRUE; CONTINUE}]; TerminalIO.PutRope[Rope.Cat["Setting Componet ", CT.GetName[comp], "..."]]; [] _ IPTopOps.SetComponent[top, comp, active, [atX, atY], TRUE]; reGeom _ FALSE; refreshFlag _ FALSE; }; $MovCo => {argStream: IO.STREAM _ IO.RIS[TerminalIO.RequestRope["Move Component: \n"]]; comp: CT.Component _ top.coTab.GetComponent[IO.GetTokenRope[argStream, IO.IDProc].token]; byX: INT _ argStream.GetInt; byY: INT _ argStream.GetInt; TerminalIO.PutRope[Rope.Cat["Moving Component ", CT.GetName[comp], "..."]]; [] _ IPTopOps.MoveComponent[top, comp, [byX, byY], TRUE]; reGeom _ FALSE; refreshFlag _ FALSE; }; $SwapCo => { argStream: IO.STREAM _ IO.RIS[TerminalIO.RequestRope["Swap Components: \n"]]; comp1: CT.Component _ top.coTab.GetComponent[IO.GetTokenRope[argStream, IO.IDProc].token]; comp2: CT.Component _ top.coTab.GetComponent[IO.GetTokenRope[argStream, IO.IDProc].token]; TerminalIO.PutRope[Rope.Cat["Swapping Components ", CT.GetName[comp1], " and ", CT.GetName[comp2], "..."]]; []_ IPTopOps.SwapComponents[top, comp1, comp2, TRUE]; }; $SpawnCo => { argStream: IO.STREAM _ IO.RIS[TerminalIO.RequestRope["Spawn Components: \n"]]; comp: CT.Component _ top.coTab.GetComponent[IO.GetTokenRope[argStream, IO.IDProc].token]; negChildName: Rope.ROPE _ IO.GetTokenRope[argStream, IO.IDProc].token; posChildName: Rope.ROPE _ IO.GetTokenRope[argStream, IO.IDProc].token; splitDirection: CTG.ChType; splitDirection _ IF Rope.Equal[IO.GetID[argStream ! IO.EndOfStream => {splitDirection _ ver; CONTINUE}], "hor", FALSE] THEN hor ELSE ver; TerminalIO.PutRope[Rope.Cat[Rope.Cat[CT.GetName[comp], " spawns into ", negChildName], Rope.Cat[" and ", posChildName, "..."]]]; []_ IPTopOps.SpawnComps[top, comp, negChildName, posChildName, comp.shape, comp.shape, splitDirection, TRUE, TRUE]; }; $SetCoShp => { argStream: IO.STREAM _ IO.RIS[TerminalIO.RequestRope["Set Component Shape: \n"]]; comp: CT.Component _ top.coTab.GetComponent[IO.GetTokenRope[argStream, IO.IDProc].token]; shape: IP.ShapeRep _ IPToolBox.GetShape[argStream]^; TerminalIO.PutRope[Rope.Cat["Setting ", CT.GetName[comp], " shape..."]]; []_ IPTopOps.SetCompShape[top, comp, shape, TRUE, TRUE]; }; $ClrCnr =>{argStream: IO.STREAM _ IO.RIS[TerminalIO.RequestRope["ClearNegCorners: ()\n"]]; co: CT.Component _ top.coTab.GetComponent[IO.GetTokenRope[argStream, IO.IDProc].token]; cornerType: NAT _ argStream.GetInt; chToUse: CTG.ChType; chToUse _ IF Rope.Equal[IO.GetID[argStream! IO.EndOfStream => {chToUse _ DefaultOrientation; CONTINUE}], "hor", FALSE] THEN hor ELSE ver; TerminalIO.PutRope[Rope.Cat["Clear Neg Corners...", (SELECT cornerType FROM 0 => "all", 1 => "sw", 2 => "se", 3 => "ne", 4 => "nw", ENDCASE => ERROR), "..."]]; SELECT cornerType FROM 0=> [] _ IPTopOps.ClearAllNegCorners[top, co, chToUse, DefaultBrkOtherIfX, TRUE]; 1 => [] _ IPTopOps.ClearNegCorner[top, co, sw, chToUse, DefaultBrkOtherIfX, TRUE]; 2 => [] _ IPTopOps.ClearNegCorner[top, co, se, chToUse, DefaultBrkOtherIfX, TRUE]; 3 => [] _ IPTopOps.ClearNegCorner[top, co, ne, chToUse, DefaultBrkOtherIfX, TRUE]; 4 => [] _ IPTopOps.ClearNegCorner[top, co, nw, chToUse, DefaultBrkOtherIfX, TRUE]; ENDCASE => ERROR;}; $Grw =>{argStream: IO.STREAM _ IO.RIS[TerminalIO.RequestRope["Grow: \n"]]; coName: Rope.ROPE _ IO.GetTokenRope[argStream, IO.IDProc].token; co: CT.Component _ top.coTab.GetComponent[coName]; chToSplit: CTG.Channel _ top.ctg.GetChannel[argStream.GetID]; negBnd: CTG.Channel _ top.ctg.GetChannel[argStream.GetID]; posBnd: CTG.Channel _ top.ctg.GetChannel[argStream.GetID]; TerminalIO.PutRope["Grow..."]; [] _ IPTopOps.Grow[top, co, chToSplit, negBnd, posBnd, TRUE]; }; $Grw1 =>{argStream: IO.STREAM _ IO.RIS[TerminalIO.RequestRope["Grow1: \n"]]; coName: Rope.ROPE _ IO.GetTokenRope[argStream, IO.IDProc].token; co: CT.Component _ top.coTab.GetComponent[coName]; host: CT.Component _ top.coTab.GetComponent[IO.GetTokenRope[argStream, IO.IDProc].token]; hostCorner: CT.CornerTypes _ (SELECT argStream.GetInt FROM 1 => sw, 2 => se, 3=> ne, ENDCASE => nw); TerminalIO.PutRope["Grow1..."]; [] _ IPTopOps.Grow1[top, co, host, hostCorner, TRUE];}; $Shr =>{argStream: IO.STREAM _ IO.RIS[TerminalIO.RequestRope["Shrink: ()\n"]]; co: CT.Component _ top.coTab.GetComponent[IO.GetTokenRope[argStream, IO.IDProc].token]; shrinkDirectionHint: CTG.ChType; TerminalIO.PutRope["Shrink..."]; IF Rope.Equal[IO.GetID[argStream! IO.EndOfStream => {shrinkDirectionHint _ DefaultOrientation; CONTINUE}], "hor", FALSE] THEN shrinkDirectionHint _ hor ELSE shrinkDirectionHint _ ver; [] _ IPTopOps.Shrink[top, co, shrinkDirectionHint, TRUE];}; $BrkXs =>{argStream: IO.STREAM _ IO.RIS[TerminalIO.RequestRope["BreakCrosses: \n"]]; refCh: CTG.Channel _ top.ctg.GetChannel[argStream.GetID]; chBnd1: CTG.Channel _ top.ctg.GetChannel[argStream.GetID]; chBnd2: CTG.Channel _ top.ctg.GetChannel[argStream.GetID]; TerminalIO.PutRope["Breaking Crosses..."]; [] _ IPTopOps.BreakCrosses[top, refCh, chBnd1, chBnd2, TRUE];}; ENDCASE => ERROR; };--MenuHit END. š--File: IPMVEditOpsImpl.mesa Last Edited by: CSChow, January 28, 1985 7:05:53 am PST Preas, August 1, 1986 9:02:30 pm PDT ##Some minor details##-- Κ ˜J™™7Icode™$—J˜šΟk ˜ Kšœ˜Kšœ ˜ Kšœ˜Jšœ ˜ J˜Jšœ˜Jšœ˜Jšœ˜J˜J˜ J˜ J˜ Jšœ ˜ Jšœ˜Jšœ ˜ —J˜J˜šœœ˜Jšœœ+œ˜XJšœ˜Iunitš œœ œ œœ˜/Lšœ™Jšœœœ˜!Jšœœ˜&L˜šΟnœœœœ,œœœœ˜šœ ˜š œœœœœœ)˜fJšœœ/˜9Jšœ œ/˜=Jšœ˜(Kšœ0œ˜8—š œœœœœœ˜[Jšœœ/˜7Jšœœ/˜7Jšœ˜$Jšœ'œ˜/—š œœœœœœ˜VJšœœ/˜:Jšœ˜"Kšœ#œ˜+—š œœœœœœ/˜lJšœœ5˜?Kšœœ5˜?Kš œœœ$œœœ˜QJšœ˜ Kšœ.œ˜6—š œœœœœœ&˜cJšœœ/˜6Kš œ œœ$œœœ˜UJšœ˜)Jšœ&œ˜.—š œœœœœœ*˜gJšœœ5˜;Jšœœ/˜6Kš œœœ$œœœ˜QJšœ˜)Jšœ'œ˜/—š œœœœœœ3˜rJšœœ/˜7Jšœœ/˜9Kš œ œœ$œœœ˜TJšœ˜'Jšœ2œ˜:—š œœœœœœ˜YJšœœ/˜8Jšœ˜(Jšœ$œ˜,—š œœœœœœ8˜vJšœ œ/˜