DIRECTORY GGBasicTypes, GGBoundBox, GGDescribe, GGError, GGInterfaceTypes, GGModelTypes, GGOutline, GGObjects, GGParseIn, GGParseOut, GGSelect, GGSegmentTypes, GGSequence, GGShapes, GGTraj, GGUtility, GGVector, Imager, ImagerColor, ImagerPath, ImagerTransformation, IO, Rope, Rosary, ViewerClasses; GGOutlineImplA: CEDAR PROGRAM IMPORTS GGBoundBox, GGDescribe, GGError, GGObjects, GGOutline, GGParseIn, GGParseOut, GGSequence, GGShapes, GGTraj, GGUtility, GGVector, Imager, ImagerColor, ImagerPath, ImagerTransformation, IO, Rosary EXPORTS GGOutline = BEGIN OPEN GGOutline; BitVector: TYPE = GGBasicTypes.BitVector; BoundBox: TYPE = GGBasicTypes.BoundBox; CameraData: TYPE = GGModelTypes.CameraData; Circle: TYPE = GGBasicTypes.Circle; Color: TYPE = Imager.Color; ControlPointGenerator: TYPE = GGModelTypes.ControlPointGenerator; FeatureData: TYPE = GGInterfaceTypes.FeatureData; GargoyleData: TYPE = GGInterfaceTypes.GargoyleData; Joint: TYPE = GGSegmentTypes.Joint; JointGenerator: TYPE = GGModelTypes.JointGenerator; Line: TYPE = GGBasicTypes.Line; ObjectBag: TYPE = GGInterfaceTypes.ObjectBag; Outline: TYPE = REF OutlineObj; OutlineObj: TYPE = GGModelTypes.OutlineObj; OutlineClass: TYPE = REF OutlineClassObj; OutlineClassObj: TYPE = GGModelTypes.OutlineClassObj; OutlineDescriptor: TYPE = GGModelTypes.OutlineDescriptor; OutlineHitData: TYPE = REF OutlineHitDataObj; OutlineHitDataObj: TYPE = GGOutline.OutlineHitDataObj; OutlineParts: TYPE = REF OutlinePartsObj; OutlinePartsObj: TYPE = GGOutline.OutlinePartsObj; OutlineSequence: TYPE = GGSelect.OutlineSequence; OutlineSequenceGenerator: TYPE = GGSelect.OutlineSequenceGenerator; Point: TYPE = GGBasicTypes.Point; PointGenerator: TYPE = GGModelTypes.PointGenerator; PointPairGenerator: TYPE = GGModelTypes.PointPairGenerator; Scene: TYPE = GGModelTypes.Scene; Segment: TYPE = GGSegmentTypes.Segment; SegmentGenerator: TYPE = GGModelTypes.SegmentGenerator; SelectMode: TYPE = GGModelTypes.SelectMode; SelectionClass: TYPE = GGSegmentTypes.SelectionClass; Sequence: TYPE = GGModelTypes.Sequence; SequenceOfReal: TYPE = GGBasicTypes.SequenceOfReal; SliceClass: TYPE = REF SliceClassObj; SliceClassObj: TYPE = GGModelTypes.SliceClassObj; SliceDescriptor: TYPE = GGModelTypes.SliceDescriptor; SliceParts: TYPE = GGModelTypes.SliceParts; StrokeEnd: TYPE = Imager.StrokeEnd; Traj: TYPE = REF TrajObj; TrajEnd: TYPE = GGModelTypes.TrajEnd; TrajGenerator: TYPE = REF TrajGeneratorObj; TrajGeneratorObj: TYPE = GGModelTypes.TrajGeneratorObj; TrajObj: TYPE = GGModelTypes.TrajObj; TrajPartType: TYPE = GGModelTypes.TrajPartType; TriggerBag: TYPE = GGInterfaceTypes.TriggerBag; Vector: TYPE = GGBasicTypes.Vector; Viewer: TYPE = ViewerClasses.Viewer; OutlineDescribeProc: TYPE = GGModelTypes.OutlineDescribeProc; OutlineFileoutProc: TYPE = GGModelTypes.OutlineFileoutProc; OutlineFileinProc: TYPE = GGModelTypes.OutlineFileinProc; OutlineUnionPartsProc: TYPE = GGModelTypes.OutlineUnionPartsProc; OutlineDifferencePartsProc: TYPE = GGModelTypes.OutlineDifferencePartsProc; OutlineFixedPartsProc: TYPE = GGModelTypes.OutlineFixedPartsProc; OutlineAugmentPartsProc: TYPE = GGModelTypes.OutlineAugmentPartsProc; OutlinePointsInDescriptorProc: TYPE = GGModelTypes.OutlinePointsInDescriptorProc; OutlinePointPairsInDescriptorProc: TYPE = GGModelTypes.OutlinePointPairsInDescriptorProc; OutlineNextPointProc: TYPE = GGModelTypes.OutlineNextPointProc; OutlineNextPointPairProc: TYPE = GGModelTypes.OutlineNextPointPairProc; OutlineClosestPointProc: TYPE = GGModelTypes.OutlineClosestPointProc; OutlineClosestPointAndTangentProc: TYPE = GGModelTypes.OutlineClosestPointAndTangentProc; OutlineClosestSegmentProc: TYPE = GGModelTypes.OutlineClosestSegmentProc; OutlineSetArrowsProc: TYPE = GGModelTypes.OutlineSetArrowsProc; OutlineGetArrowsProc: TYPE = GGModelTypes.OutlineGetArrowsProc; NotYetImplemented: PUBLIC ERROR = CODE; Problem: PUBLIC SIGNAL [msg: Rope.ROPE] = GGError.Problem; NoOpFileout: PUBLIC OutlineFileoutProc = { SIGNAL Problem [msg: "All slice classes must have this proc."]; }; NoOpFilein: PUBLIC OutlineFileinProc = { SIGNAL Problem [msg: "All slice classes must have this proc."]; }; NoOpFixedParts: PUBLIC OutlineFixedPartsProc = { SIGNAL Problem [msg: "All slice classes must have this proc."]; }; NoOpPointsInDescriptor: PUBLIC PROC [sliceD: OutlineDescriptor] RETURNS [pointGen: PointGenerator] = { pointGen _ NIL; }; NoOpPointPairsInDescriptor: PUBLIC PROC [sliceD: OutlineDescriptor] RETURNS [pointPairGen: PointPairGenerator] = { pointPairGen _ NIL; }; NoOpNextPoint: PUBLIC PROC [pointGen: PointGenerator] RETURNS [pointAndDone: GGModelTypes.PointAndDone] = { pointAndDone.done _ TRUE; }; NoOpNextPointPair: PUBLIC PROC [pointPairGen: PointPairGenerator] RETURNS [pointPairAndDone: GGModelTypes.PointPairAndDone] = { pointPairAndDone.done _ TRUE; }; NoOpClosestPoint: PUBLIC OutlineClosestPointProc = { SIGNAL Problem [msg: "All slice classes must have this proc."]; }; NoOpClosestPointAndTangent: PUBLIC OutlineClosestPointAndTangentProc = { SIGNAL Problem [msg: "All slice classes must have this proc."]; }; NoOpClosestSegment: PUBLIC OutlineClosestSegmentProc = { SIGNAL Problem [msg: "All slice classes must have this proc."]; }; NoOpSetArrows: PUBLIC OutlineSetArrowsProc = { SIGNAL Problem [msg: "All slice classes must have this proc."]; }; NoOpGetArrows: PUBLIC OutlineGetArrowsProc = { SIGNAL Problem [msg: "All slice classes must have this proc."]; }; FetchSliceClass: PUBLIC PROC [name: ATOM] RETURNS [class: OutlineClass] = { class _ globalOutlineClass; }; MakeOutlineClass: PROC [] RETURNS [class: OutlineClass] = { class _ NEW[OutlineClassObj _ [ type: $Outline, getBoundBox: OutlineBoundBox, getTightBox: OutlineTightBox, copy: OutlineCopy, drawParts: OutlineDrawParts, drawTransform: OutlineDrawTransform, drawSelectionFeedback: OutlineDrawSelectionFeedback, drawAttractorFeedback: OutlineDrawAttractorFeedback, transform: OutlineTransform, describe: OutlineDescribe, fileout: OutlineFileout, filein: OutlineFilein, emptyParts: OutlineEmptyParts, newParts: OutlineNewParts, unionParts: OutlineUnionParts, differenceParts: OutlineDifferenceParts, movingParts: OutlineMovingParts, fixedParts: OutlineFixedParts, augmentParts: OutlineAugmentParts, setSelectedFields: OutlineSetSelectedFields, pointsInDescriptor: OutlinePointsInDescriptor, pointPairsInDescriptor: OutlinePointPairsInDescriptor, nextPoint: OutlineNextPoint, nextPointPair: OutlineNextPointPair, closestPoint: OutlineClosestPoint, closestPointAndTangent: NoOpClosestPointAndTangent, closestSegment: OutlineClosestSegment, lineIntersection: OutlineLineIntersection, circleIntersection: OutlineCircleIntersection, hitDataAsSimpleCurve: OutlineHitDataAsSimpleCurve, setStrokeWidth: OutlineSetStrokeWidth, getStrokeWidth: OutlineGetStrokeWidth, setStrokeColor: OutlineSetStrokeColor, getStrokeColor: OutlineGetStrokeColor, setFillColor: OutlineSetFillColor, getFillColor: OutlineGetFillColor, setArrows: NoOpSetArrows, getArrows: NoOpGetArrows, setDashed: OutlineSetDashed, getDashed: OutlineGetDashed ]]; }; FetchOutlineClass: PROC [] RETURNS [class: OutlineClass] = { class _ globalOutlineClass; }; CreateOutline: PUBLIC PROC [traj: Traj, lineEnds: Imager.StrokeEnd _ square, fillColor: Imager.Color _ Imager.black] RETURNS [outline: Outline] = { boundBox: BoundBox _ GGBoundBox.CopyBoundBox[traj.boundBox]; outline _ NEW[OutlineObj _ [ class: FetchOutlineClass[], fillColor: fillColor, lineEnds: lineEnds, children: LIST[traj], parent: NIL, boundBox: boundBox]]; traj.parent _ outline; IF traj.role = hole THEN traj.role _ fence; }; OutlineBoundBox: PROC [slice: Outline, parts: SliceParts] RETURNS [box: BoundBox] = { IF parts = NIL THEN box _ slice.boundBox ELSE { outlineParts: OutlineParts _ NARROW[parts]; boxList: LIST OF BoundBox _ NIL; thisBox: BoundBox; FOR list: LIST OF Sequence _ outlineParts.seqs, list.rest UNTIL list = NIL DO IF list.first # NIL THEN { thisBox _ GGSequence.ComputeBoundBox[list.first]; boxList _ CONS[thisBox, boxList]; }; ENDLOOP; box _ GGBoundBox.BoundBoxOfBoxes[boxList]; }; }; OutlineTightBox: PROC [slice: Outline, parts: SliceParts] RETURNS [box: BoundBox] = { outlineParts: OutlineParts; boxList: LIST OF BoundBox _ NIL; thisBox: BoundBox; IF parts = NIL THEN parts _ slice.class.newParts[slice, NIL, slice]; outlineParts _ NARROW[parts]; FOR list: LIST OF Sequence _ outlineParts.seqs, list.rest UNTIL list = NIL DO IF list.first # NIL THEN { thisBox _ GGSequence.ComputeTightBox[list.first]; boxList _ CONS[thisBox, boxList]; }; ENDLOOP; box _ GGBoundBox.BoundBoxOfBoxes[boxList]; }; UpdateOutlineBoundBox: PUBLIC PROC [slice: Outline] = { outlineBoxes: LIST OF BoundBox _ NIL; trajGen: TrajGenerator; IF slice=NIL THEN RETURN; trajGen _ TrajsInOutline[slice]; FOR traj: Traj _ GGObjects.NextTraj[trajGen], GGObjects.NextTraj[trajGen] UNTIL traj = NIL DO outlineBoxes _ CONS[traj.boundBox, outlineBoxes]; ENDLOOP; UpdateBoundBoxFromList[slice.boundBox, outlineBoxes]; }; UpdateBoundBoxFromList: PROC [bBox: BoundBox, list: LIST OF BoundBox] = { IF list = NIL THEN ERROR; bBox.loX _ list.first.loX; bBox.hiX _ list.first.hiX; bBox.loY _ list.first.loY; bBox.hiY _ list.first.hiY; FOR bBoxList: LIST OF BoundBox _ list.rest, bBoxList.rest UNTIL bBoxList = NIL DO bBox.loX _ MIN[bBox.loX, bBoxList.first.loX]; bBox.hiX _ MAX[bBox.hiX, bBoxList.first.hiX]; bBox.loY _ MIN[bBox.loY, bBoxList.first.loY]; bBox.hiY _ MAX[bBox.hiY, bBoxList.first.hiY]; ENDLOOP; }; OutlineCopy: PROC [slice: Outline] RETURNS [copy: Outline] = { holeGen: TrajGenerator; newTraj, fence: Traj; fence _ FenceOfOutline[slice]; newTraj _ GGTraj.CopyTraj[fence]; copy _ CreateOutline[newTraj, slice.lineEnds, slice.fillColor]; holeGen _ HolesOfOutline[slice]; FOR hole: Traj _ GGObjects.NextTraj[holeGen], GGObjects.NextTraj[holeGen] UNTIL hole = NIL DO newTraj _ GGTraj.CopyTraj[hole]; copy.children _ AppendTrajList[copy.children, LIST[newTraj]]; newTraj.parent _ copy; ENDLOOP; }; OutlineDrawParts: PROC [slice: Outline, parts: SliceParts, dc: Imager.Context, camera: CameraData, quick: BOOL] = { IF parts # NIL THEN ERROR Problem[msg: "outline parts are not yet implemented"]; DrawOutline[dc, slice]; }; OutlineDrawTransform: PROC [slice: Outline, parts: SliceParts, dc: Imager.Context, camera: CameraData, transform: ImagerTransformation.Transformation] = { sliceParts: OutlineParts _ NARROW[parts]; BuildOutline: Imager.PathProc = { BuildPath: Imager.PathProc = { seg: Segment; firstPoint: Point _ GGTraj.FetchJointPos[traj, 0]; moveTo[ [firstPoint.x, firstPoint.y] ]; FOR i: INT IN [0..GGTraj.HiSegment[traj]] DO seg _ GGTraj.FetchSegment[traj, i]; seg.class.buildPath[seg, lineTo, curveTo, conicTo, arcTo]; ENDLOOP; }; BuildPathTransformSeq: Imager.PathProc = { seg: Segment; firstPoint: Point _ GGTraj.FetchJointPos[traj, 0]; IF thisSeq.segments[0] OR thisSeq.joints[0] THEN firstPoint _ ImagerTransformation.Transform[transform, firstPoint]; moveTo[ [firstPoint.x, firstPoint.y] ]; FOR i: INT IN [0..GGTraj.HiSegment[traj]] DO seg _ GGTraj.FetchSegment[traj, i]; seg.class.buildPathTransform[seg, transform, thisSeq.segments[i], thisSeq.joints[i], thisSeq.joints[(i+1) MOD thisSeq.traj.segCount], thisSeq.controlPoints[i], lineTo, curveTo, conicTo, arcTo]; ENDLOOP; }; imagerHole: ImagerPath.Trajectory; cc, holeCC: BOOL; traj _ fence; thisSeq _ FindSequenceInList[traj, sliceParts.seqs]; IF thisSeq # NIL THEN { BuildPathTransformSeq[moveTo, lineTo, curveTo, conicTo, arcTo]; cc _ GGTraj.IsClockwiseTrajTransformSeq[thisSeq, transform]; } ELSE { BuildPath[moveTo, lineTo, curveTo, conicTo, arcTo]; cc _ GGTraj.IsClockwiseTraj[traj]; }; FOR holeList: LIST OF Traj _ slice.children.rest, holeList.rest UNTIL holeList = NIL DO traj _ holeList.first; thisSeq _ FindSequenceInList[traj, sliceParts.seqs]; IF thisSeq # NIL THEN { imagerHole _ ImagerPath.TrajectoryListFromPath[BuildPathTransformSeq].first; holeCC _ GGTraj.IsClockwiseTrajTransformSeq[thisSeq, transform]; } ELSE { imagerHole _ ImagerPath.TrajectoryListFromPath[BuildPath].first; holeCC _ GGTraj.IsClockwiseTraj[traj]; }; IF cc=holeCC THEN ImagerPath.MapTrajectoryBackward[imagerHole, moveTo, lineTo, curveTo, conicTo, arcTo] ELSE ImagerPath.MapTrajectory[imagerHole, moveTo, lineTo, curveTo, conicTo, arcTo]; ENDLOOP; }; traj: Traj; thisSeq: Sequence; fence: Traj _ slice.children.first; IF fence.role = fence AND slice.fillColor#NIL THEN { transformedColor: Color; WITH slice.fillColor SELECT FROM cc: ImagerColor.ConstantColor => { Imager.SetColor[dc, cc]; }; sc: ImagerColor.SampledColor => { IF OutlineCompleteParts[slice, parts] THEN { transformedColor _ ImagerColor.MakeSampledColor[pa: sc.pa, um: ImagerTransformation.Concat[sc.um, transform], colorOperator: sc.colorOperator]; Imager.SetColor[dc, transformedColor]; }; }; ENDCASE => ERROR; Imager.MaskFill[dc, BuildOutline]; }; thisSeq _ FindSequenceInList[fence, sliceParts.seqs]; IF thisSeq # NIL THEN GGTraj.DrawTrajTransformSeq[dc, thisSeq, transform] ELSE GGTraj.DrawTraj[dc, fence]; FOR holeList: LIST OF Traj _ slice.children.rest, holeList.rest UNTIL holeList = NIL DO thisSeq _ FindSequenceInList[holeList.first, sliceParts.seqs]; IF thisSeq # NIL THEN GGTraj.DrawTrajTransformSeq[dc, thisSeq, transform] ELSE GGTraj.DrawTraj[dc, holeList.first]; ENDLOOP; }; OutlineDrawSelectionFeedback: PROC [slice: Outline, selectedParts: SliceParts, hotParts: SliceParts, dc: Imager.Context, camera: CameraData, dragInProgress, caretIsMoving, hideHot, quick: BOOL] = { normalOutlineParts, hotOutlineParts: OutlineParts; normalList, hotList: LIST OF Sequence; normalOutlineParts _ NARROW[selectedParts]; hotOutlineParts _ NARROW[hotParts]; IF caretIsMoving OR dragInProgress THEN RETURN; IF selectedParts = NIL AND hotParts = NIL THEN RETURN; IF selectedParts # NIL AND hotParts # NIL THEN { hotList _ hotOutlineParts.seqs; FOR normalList _ normalOutlineParts.seqs, normalList.rest UNTIL normalList = NIL DO IF normalList.first # NIL THEN GGTraj.DrawSelectionFeedback[normalList.first.traj, normalList.first, hotList.first, dc, camera, dragInProgress, caretIsMoving, hideHot, quick] ELSE IF hotList.first # NIL THEN GGTraj.DrawSelectionFeedback[hotList.first.traj, normalList.first, hotList.first, dc, camera, dragInProgress, caretIsMoving, hideHot, quick]; hotList _ hotList.rest; ENDLOOP; } ELSE IF selectedParts # NIL THEN { FOR normalList _ normalOutlineParts.seqs, normalList.rest UNTIL normalList = NIL DO IF normalList.first # NIL THEN GGTraj.DrawSelectionFeedback[normalList.first.traj, normalList.first, NIL, dc, camera, dragInProgress, caretIsMoving, hideHot, quick]; ENDLOOP; } ELSE { FOR hotList _ hotOutlineParts.seqs, hotList.rest UNTIL hotList = NIL DO IF hotList.first # NIL THEN GGTraj.DrawSelectionFeedback[hotList.first.traj, NIL, hotList.first, dc, camera, dragInProgress, caretIsMoving, hideHot, quick]; ENDLOOP; }; }; OutlineDrawAttractorFeedback: PUBLIC PROC [sliceD: OutlineDescriptor, selectedParts: SliceParts, dragInProgress: BOOL, dc: Imager.Context, camera: CameraData] = { success: BOOL; partType: TrajPartType; traj: Traj; seg: Segment; jointNum: NAT; [success, partType, traj, ----, jointNum, ----, ----, seg] _ UnpackSimpleDescriptorOld[sliceD]; SELECT partType FROM joint => { IF jointNum > 0 THEN DrawCpsAndJoints[dc, GGTraj.FetchSegment[traj, jointNum-1]]; IF jointNum < traj.segCount THEN DrawCpsAndJoints[dc, GGTraj.FetchSegment[traj, jointNum]]; }; segment, controlPoint => DrawCpsAndJoints[dc, seg]; ENDCASE; -- none }; DrawOutline: PROC [dc: Imager.Context, outline: Outline] = { BuildOutline: Imager.PathProc = { BuildPath: Imager.PathProc = { BuildTrajPath[traj, moveTo, lineTo, curveTo, conicTo, arcTo]; }; imagerHole: ImagerPath.Trajectory; cc: BOOL; traj _ fence; cc _ GGTraj.IsClockwiseTraj[traj]; BuildTrajPath[traj, moveTo, lineTo, curveTo, conicTo, arcTo]; FOR holeList: LIST OF Traj _ outline.children.rest, holeList.rest UNTIL holeList = NIL DO traj _ holeList.first; imagerHole _ ImagerPath.TrajectoryListFromPath[BuildPath].first; IF cc=GGTraj.IsClockwiseTraj[traj] THEN ImagerPath.MapTrajectoryBackward[imagerHole, moveTo, lineTo, curveTo, conicTo, arcTo] ELSE ImagerPath.MapTrajectory[imagerHole, moveTo, lineTo, curveTo, conicTo, arcTo]; ENDLOOP; }; fence, traj: Traj; fence _ outline.children.first; IF fence.role = fence AND outline.fillColor#NIL THEN { Imager.SetColor[dc, outline.fillColor]; Imager.MaskFill[dc, BuildOutline]; }; GGTraj.DrawTraj[dc, fence]; FOR holeList: LIST OF Traj _ outline.children.rest, holeList.rest UNTIL holeList = NIL DO GGTraj.DrawTraj[dc, holeList.first]; ENDLOOP; }; FindSequenceInList: PROC [traj: Traj, seqList: LIST OF Sequence] RETURNS [seq: Sequence] = { FOR list: LIST OF Sequence _ seqList, list.rest UNTIL list = NIL DO IF list.first # NIL AND list.first.traj = traj THEN RETURN[list.first]; ENDLOOP; RETURN[NIL]; }; BuildTrajPath: PROC [traj: Traj, moveTo: ImagerPath.MoveToProc, lineTo: ImagerPath.LineToProc, curveTo: ImagerPath.CurveToProc, conicTo: ImagerPath.ConicToProc, arcTo: ImagerPath.ArcToProc] = { DoBuildTrajPath: Imager.PathProc = { seg: Segment; firstPoint: Point _ GGTraj.FetchJointPos[traj, 0]; moveTo[ [firstPoint.x, firstPoint.y] ]; FOR i: INT IN [0..GGTraj.HiSegment[traj]] DO seg _ GGTraj.FetchSegment[traj, i]; seg.class.buildPath[seg, lineTo, curveTo, conicTo, arcTo]; ENDLOOP; }; DoBuildTrajPath[moveTo, lineTo, curveTo, conicTo, arcTo]; }; DrawCpsAndJoints: PROC [dc: Imager.Context, seg: Segment] = { point: Point; GGShapes.DrawJoint[dc, seg.lo]; GGShapes.DrawJoint[dc, seg.hi]; FOR j:INT IN [0..seg.class.controlPointCount[seg]) DO point _ seg.class.controlPointGet[seg, j]; GGShapes.DrawCP[dc, point]; ENDLOOP; }; OutlineTransform: PUBLIC PROC [slice: Outline, parts: SliceParts, transform: ImagerTransformation.Transformation] = { outlineParts: OutlineParts _ NARROW[parts]; transformedColor: Color; FOR list: LIST OF Sequence _ outlineParts.seqs, list.rest UNTIL list = NIL DO IF list.first # NIL THEN GGTraj.TransformSequence[list.first, transform]; ENDLOOP; UpdateOutlineBoundBox[slice]; IF slice.fillColor # NIL THEN { WITH slice.fillColor SELECT FROM cc: ImagerColor.ConstantColor => {}; sc: ImagerColor.SampledColor => { IF OutlineCompleteParts[slice, parts] THEN { transformedColor _ ImagerColor.MakeSampledColor[pa: sc.pa, um: ImagerTransformation.Concat[sc.um, transform], colorOperator: sc.colorOperator]; slice.fillColor _ transformedColor; }; }; ENDCASE => ERROR; }; }; OneSequenceOnly: PROC [realParts: OutlineParts] RETURNS [theSeq: Sequence] = { theSeq _ NIL; FOR list: LIST OF Sequence _ realParts.seqs, list.rest UNTIL list = NIL DO IF list.first # NIL THEN { IF theSeq # NIL THEN RETURN[NIL] ELSE theSeq _ list.first; }; ENDLOOP; }; OutlineDescribe: PROC [slice: Outline, parts: SliceParts] RETURNS [rope: Rope.ROPE] = { realParts: OutlineParts _ NARROW[parts]; theSeq: Sequence; IF (theSeq _ OneSequenceOnly[realParts]) # NIL THEN { rope _ DescribeSequence[theSeq]; } ELSE { FOR list: LIST OF Sequence _ realParts.seqs, list.rest UNTIL list = NIL DO IF list.first # NIL THEN RETURN["several parts of a multi-trajectory outline"]; ENDLOOP; rope _ "No outline parts to speak of."; }; }; DescribeSequence: PROC [seq: Sequence] RETURNS [rope: Rope.ROPE] = { segNum, cpNum: NAT; segCount: NAT _ seq.segCount; jointCount: NAT _ seq.jointCount; cpCount: NAT _ seq.controlPointCount; SELECT TRUE FROM segCount=1 => { -- single segment selected. Describe it segGen: SegmentGenerator _ GGSequence.SegmentsInSequence[seq]; rope _ GGDescribe.DescribeSegment[seq.traj, GGSequence.NextSegmentAndIndex[segGen].index]; }; segCount=0 AND cpCount=1 => { -- single CP selected. Describe it cpGen: ControlPointGenerator _ GGSequence.ControlPointsInSequence[seq]; [segNum, cpNum] _ GGSequence.NextSegNumAndCPNum[cpGen]; rope _ GGDescribe.DescribeControlPoint[seq.traj, segNum, cpNum]; }; segCount=0 AND cpCount=0 AND jointCount=1 => { -- single joint selected. Describe it jointGen: JointGenerator _ GGSequence.JointsInSequence[seq]; rope _ GGDescribe.DescribeJoint[seq.traj, GGSequence.NextJoint[jointGen]]; }; ENDCASE => rope _ GGDescribe.DescribeSequence[seq]; }; OutlineFileout: PROC [slice: Outline, f: IO.STREAM] = { count: NAT; f.PutF["Outline:\n"]; f.PutF["fillColor: "]; GGParseOut.WriteColor[f, slice.fillColor]; f.PutF[" strokeEnd: "]; GGParseOut.WriteStrokeEnd[f, slice.lineEnds]; f.PutChar[IO.CR]; count _ 0; FOR trajList: LIST OF Traj _ slice.children, trajList.rest UNTIL trajList = NIL DO count _ count + 1; ENDLOOP; f.PutF["Trajectories: [%g]\n", [integer[count]]]; FOR trajList: LIST OF Traj _ slice.children, trajList.rest UNTIL trajList = NIL DO GGTraj.Fileout[f, trajList.first]; ENDLOOP; f.PutChar[IO.CR]; }; OutlineFilein: PROC [f: IO.STREAM, version: REAL, feedback: Viewer] RETURNS [slice: Outline] = { fillColor: Color; strokeEnd: StrokeEnd; count: NAT; fence, hole: Traj; hasCircle: BOOL _ FALSE; GGParseIn.ReadBlankAndRope[f, "fillColor:"]; fillColor _ GGParseIn.ReadColor[f, version]; GGParseIn.ReadBlankAndRope[f, "strokeEnd:"]; strokeEnd _ GGParseIn.ReadStrokeEnd[f]; GGParseIn.ReadBlankAndRope[f, "Trajectories:"]; GGParseIn.ReadBlankAndRope[f, "["]; count _ GGParseIn.ReadBlankAndNAT[f]; GGParseIn.ReadBlankAndRope[f, "]"]; [fence, hasCircle] _ GGTraj.Filein[f, version]; IF hasCircle THEN fillColor _ NIL; -- needed for the transition from circle/disc class slice _ GGOutline.CreateOutline[fence, strokeEnd, fillColor]; FOR i: NAT IN [1..count-1] DO [hole, ----] _ GGTraj.Filein[f, version]; slice _ GGOutline.AddHole[slice, hole]; ENDLOOP; }; OutlineMovingParts: PROC [slice: Outline, parts: SliceParts] RETURNS [moving: SliceParts] = { outlineParts: OutlineParts _ NARROW[parts]; moveParts: OutlineParts; ptr: LIST OF Sequence; movingSeq: Sequence; moving _ moveParts _ NEW[OutlinePartsObj]; [moveParts.seqs, ptr] _ GGUtility.StartSequenceList[]; FOR list: LIST OF Sequence _ outlineParts.seqs, list.rest UNTIL list = NIL DO IF list.first = NIL THEN { [moveParts.seqs, ptr] _ GGUtility.AddSequence[NIL, moveParts.seqs, ptr] } ELSE { movingSeq _ MovingSequence[list.first]; [moveParts.seqs, ptr] _ GGUtility.AddSequence[movingSeq, moveParts.seqs, ptr]; }; ENDLOOP; }; OutlineFixedParts: PROC [slice: Outline, parts: SliceParts, selectedList: LIST OF REF ANY] RETURNS [fixed: SliceParts] = { realParts: OutlineParts; seq: Sequence; fixed _ realParts _ NARROW[parts]; FOR list: LIST OF Sequence _ realParts.seqs, list.rest UNTIL list = NIL DO seq _ list.first; IF seq # NIL THEN { GGSequence.TrimSelectedControlPointSegments[seq, selectedList]; GGSequence.TrimSelectedJointSegments[seq, selectedList]; GGSequence.TrimSelectedParts[seq, selectedList]; }; ENDLOOP; }; MovingSequence: PROC [seq: Sequence] RETURNS [movingSeq: Sequence] = { completeSeq: Sequence _ GGSequence.CreateComplete[seq.traj]; stationarySeq: Sequence _ GGSequence.Copy[completeSeq]; GGSequence.DDifference[stationarySeq, seq]; -- remove everything that is directly moving GGSequence.TrimControlPointSegments[stationarySeq, FALSE]; -- remove all segments with a directly moving control point. GGSequence.TrimJointSegments[stationarySeq, FALSE]; -- remove all segments with a directly moving joint movingSeq _ GGSequence.Difference[completeSeq, stationarySeq]; -- Difference calculates the moving parts }; OutlineEmptyParts: PROC [slice: Outline, parts: SliceParts] RETURNS [BOOL] = { realParts: OutlineParts _ NARROW[parts]; FOR list: LIST OF Sequence _ realParts.seqs, list.rest UNTIL list = NIL DO IF list.first # NIL AND NOT GGSequence.IsEmpty[list.first] THEN RETURN[FALSE]; ENDLOOP; RETURN[TRUE]; }; OutlineCompleteParts: PROC [slice: Outline, parts: SliceParts] RETURNS [BOOL] = { realParts: OutlineParts _ NARROW[parts]; FOR list: LIST OF Sequence _ realParts.seqs, list.rest UNTIL list = NIL DO IF list.first = NIL THEN RETURN[FALSE]; IF NOT GGSequence.IsComplete[list.first] THEN RETURN[FALSE]; ENDLOOP; RETURN[TRUE]; }; NearestJointToHitSpot: PUBLIC PROC [caretPt: Point, traj: Traj, hitJointNum: INT, hitSegNum: INT, hitType: HitType] RETURNS [jointNum: NAT] = { nextNum: NAT; p1, p2: Point; d1, d2: REAL; SELECT hitType FROM joint => { jointNum _ hitJointNum; }; segment, controlPoint => { nextNum _ GGTraj.FollowingJoint[traj, hitSegNum]; p1 _ GGTraj.FetchJointPos[traj, hitSegNum]; p2 _ GGTraj.FetchJointPos[traj, nextNum]; d1 _ GGVector.DistanceSquared[p1, caretPt]; d2 _ GGVector.DistanceSquared[p2, caretPt]; IF d1 <= d2 THEN jointNum _ hitSegNum ELSE jointNum _ nextNum; }; ENDCASE => ERROR Problem[msg: "not yet implemented"]; }; -- end of NearestJointToHitSpot OutlineNewParts: PROC [slice: Outline, hitData: REF ANY, mode: SelectMode] RETURNS [parts: SliceParts] = { realParts: OutlineParts; ptr: LIST OF Sequence; trajGen: GGModelTypes.TrajGenerator; parts _ realParts _ NEW[OutlinePartsObj]; [realParts.seqs, ptr] _ GGUtility.StartSequenceList[]; SELECT mode FROM none => { outlineHitData: OutlineHitData _ NARROW[hitData]; SELECT outlineHitData.hitType FROM joint, controlPoint => parts _ OutlineNewParts[slice, hitData, joint]; segment => parts _ OutlineNewParts[slice, hitData, segment]; ENDCASE => ERROR; }; slice => { completeSeq: Sequence; trajGen _ TrajsInOutline[slice]; FOR traj: Traj _ GGObjects.NextTraj[trajGen], GGObjects.NextTraj[trajGen] UNTIL traj = NIL DO completeSeq _ GGSequence.CreateComplete[traj]; [realParts.seqs, ptr] _ GGUtility.AddSequence[completeSeq, realParts.seqs, ptr]; ENDLOOP; }; joint => { outlineHitData: OutlineHitData _ NARROW[hitData]; SELECT outlineHitData.hitType FROM joint => { -- hit a joint traj: Traj _ outlineHitData.traj; jointNum: NAT _ outlineHitData.jointNum; seq: Sequence _ GGSequence.CreateJointToJoint[traj, jointNum, jointNum]; parts _ PartsFromSequence[slice, seq]; }; segment => { -- we are in the middle of a segment. Select nearest joint or cp success: BOOL; segNum: NAT; cpNum, jointNum: NAT; jointPoint, cpPoint, caretPt: Point; traj: Traj; seg: Segment; seq: Sequence; traj _ outlineHitData.traj; segNum _ outlineHitData.segNum; seg _ GGTraj.FetchSegment[traj, segNum]; caretPt _ outlineHitData.hitPoint; jointNum _ NearestJointToHitSpot[caretPt, traj, -1, segNum, segment]; jointPoint _ GGTraj.FetchJointPos[traj, jointNum]; [cpPoint, cpNum, success] _ seg.class.closestControlPoint[seg, caretPt, GGUtility.plusInfinity]; IF NOT success THEN seq _ GGSequence.CreateJointToJoint[traj, jointNum, jointNum] ELSE { cpDist: REAL _ GGVector.DistanceSquared[cpPoint, caretPt]; jointDist: REAL _ GGVector.DistanceSquared[jointPoint, caretPt]; seq _ IF cpDist < jointDist THEN GGSequence.CreateFromControlPoint[traj, segNum, cpNum] ELSE GGSequence.CreateJointToJoint[traj, jointNum, jointNum]; }; parts _ PartsFromSequence[slice, seq]; }; controlPoint => { traj: Traj; segNum, cpNum: NAT; controlPointSeq: Sequence; traj _ outlineHitData.traj; segNum _ outlineHitData.segNum; cpNum _ outlineHitData.cpNum; controlPointSeq _ GGSequence.CreateFromControlPoint[traj, segNum, cpNum]; parts _ PartsFromSequence[slice, controlPointSeq]; }; ENDCASE => ERROR; }; segment => { outlineHitData: OutlineHitData _ NARROW[hitData]; SELECT outlineHitData.hitType FROM joint => { parts _ CreateEmptyParts[slice]; }; segment, controlPoint => { seq: Sequence; seq _ GGSequence.CreateFromSegment[outlineHitData.traj, outlineHitData.segNum]; parts _ PartsFromSequence[slice, seq]; }; ENDCASE => ERROR; }; traj => { outlineHitData: OutlineHitData _ NARROW[hitData]; traj: Traj _ outlineHitData.traj; seq: Sequence _ GGSequence.CreateComplete[traj]; parts _ PartsFromSequence[slice, seq]; }; topLevel => { parts _ slice.class.newParts[slice, NIL, slice]; }; ENDCASE => ERROR; }; CreateEmptyParts: PROC [slice: Outline] RETURNS [empty: SliceParts] = { realParts: OutlineParts; empty _ realParts _ NEW[OutlinePartsObj]; realParts.seqs _ NIL; FOR list: LIST OF Traj _ slice.children, list.rest UNTIL list = NIL DO realParts.seqs _ CONS[NIL, realParts.seqs]; ENDLOOP; }; OutlineUnionParts: PROC [slice: Outline, partsA: SliceParts, partsB: SliceParts] RETURNS [aPlusB: SliceParts] = { realPartsA: OutlineParts _ NARROW[partsA]; realPartsB: OutlineParts _ NARROW[partsB]; union: OutlineParts; listA: LIST OF Sequence _ realPartsA.seqs; listB: LIST OF Sequence _ realPartsB.seqs; ptr: LIST OF Sequence; aPlusB _ union _ NEW[OutlinePartsObj]; [union.seqs, ptr] _ GGUtility.StartSequenceList[]; UNTIL listA = NIL DO IF listA.first = NIL THEN [union.seqs, ptr] _ GGUtility.AddSequence[listB.first, union.seqs, ptr] ELSE IF listB.first = NIL THEN [union.seqs, ptr] _ GGUtility.AddSequence[listA.first, union.seqs, ptr] ELSE { newSeq: Sequence _ GGSequence.Union[listA.first, listB.first]; [union.seqs, ptr] _ GGUtility.AddSequence[newSeq, union.seqs, ptr]; }; listA _ listA.rest; listB _ listB.rest; ENDLOOP; }; OutlineDifferenceParts: PROC [slice: Outline, partsA: SliceParts, partsB: SliceParts] RETURNS [aMinusB: SliceParts] = { realPartsA: OutlineParts _ NARROW[partsA]; realPartsB: OutlineParts _ NARROW[partsB]; diff: OutlineParts; listA: LIST OF Sequence _ realPartsA.seqs; listB: LIST OF Sequence _ realPartsB.seqs; ptr: LIST OF Sequence; aMinusB _ diff _ NEW[OutlinePartsObj]; [diff.seqs, ptr] _ GGUtility.StartSequenceList[]; UNTIL listA = NIL DO IF listA.first = NIL THEN [diff.seqs, ptr] _ GGUtility.AddSequence[NIL, diff.seqs, ptr] ELSE IF listB.first = NIL THEN [diff.seqs, ptr] _ GGUtility.AddSequence[listA.first, diff.seqs, ptr] ELSE { newSeq: Sequence _ GGSequence.Difference[listA.first, listB.first]; [diff.seqs, ptr] _ GGUtility.AddSequence[newSeq, diff.seqs, ptr]; }; listA _ listA.rest; listB _ listB.rest; ENDLOOP; }; OutlineAugmentParts: PROC [slice: Outline, parts: SliceParts, selectClass: SelectionClass] RETURNS [more: SliceParts] = { sliceParts: OutlineParts _ NARROW[parts]; FOR list: LIST OF Sequence _ sliceParts.seqs, list.rest UNTIL list = NIL DO IF list.first # NIL THEN SequenceAugmentParts[list.first, selectClass]; ENDLOOP; more _ parts; }; SequenceAugmentParts: PROC [seq: Sequence, selectClass: SelectionClass] = { IF selectClass = normal THEN { GGSequence.FillInJoints[seq]; GGSequence.FillInControlPoints[seq]; } ELSE { GGSequence.FillInControlPoints[seq]; }; }; OutlineSetSelectedFields: PROC [sliceD: OutlineDescriptor, selected: BOOL, selectClass: SelectionClass] = { sliceParts: OutlineParts _ NARROW[sliceD.parts]; FOR list: LIST OF Sequence _ sliceParts.seqs, list.rest UNTIL list = NIL DO IF list.first # NIL THEN SequenceSetSelectedFields[list.first, selected, selectClass]; ENDLOOP; }; SequenceSetSelectedFields: PROC [seq: Sequence, selected: BOOL, selectClass: SelectionClass] = { joint: Joint; jointGen: JointGenerator; segGen: SegmentGenerator; SetTrajPartField[seq.traj, selected, selectClass]; jointGen _ GGSequence.JointsInSequence[seq]; FOR jointNum: INT _ GGSequence.NextJoint[jointGen], GGSequence.NextJoint[jointGen] UNTIL jointNum = -1 DO joint _ NARROW[Rosary.Fetch[seq.traj.joints, jointNum]]; SetJointField[joint, selected, selectClass]; ENDLOOP; segGen _ GGSequence.SegmentsInSequence[seq]; FOR seg: Segment _ GGSequence.NextSegment[segGen], GGSequence.NextSegment[segGen] UNTIL seg = NIL DO SetSegmentField[seg, selected, selectClass]; ENDLOOP; }; SetTrajPartField: PROC [traj: Traj, selected: BOOL, selectClass: SelectionClass] = { SELECT selectClass FROM normal => traj.selectedInPart.normal _ selected; hot => traj.selectedInPart.hot _ selected; active => traj.selectedInPart.active _ selected; ENDCASE; }; SetJointField: PUBLIC PROC [joint: Joint, selected: BOOL, selectClass: SelectionClass] = { SELECT selectClass FROM normal => joint.TselectedInFull.normal _ selected; hot => joint.TselectedInFull.hot _ selected; active => joint.TselectedInFull.active _ selected; ENDCASE; }; SetSegmentField: PUBLIC PROC [seg: Segment, selected: BOOL, selectClass: SelectionClass] = { SELECT selectClass FROM normal => seg.TselectedInFull.normal _ selected; hot => seg.TselectedInFull.hot _ selected; active => seg.TselectedInFull.active _ selected; ENDCASE; }; SetControlPointField: PUBLIC PROC [seg: Segment, cpNum: NAT, selected: BOOL, selectClass: SelectionClass] = { seg.class.controlPointFieldSet[seg, cpNum, selected, selectClass]; }; GetControlPointField: PUBLIC PROC [seg: Segment, cpNum: NAT, selectClass: SelectionClass] RETURNS [selected: BOOL] = { selected _ seg.class.controlPointFieldGet[seg, cpNum, selectClass]; }; GetJointField: PUBLIC PROC [joint: Joint, selectClass: SelectionClass] RETURNS [selected: BOOL] = { SELECT selectClass FROM normal => selected _ joint.TselectedInFull.normal; hot => selected _ joint.TselectedInFull.hot; active => selected _ joint.TselectedInFull.active; ENDCASE; }; GetSegmentField: PUBLIC PROC [seg: Segment, selectClass: SelectionClass] RETURNS [selected: BOOL] = { SELECT selectClass FROM normal => selected _ seg.TselectedInFull.normal; hot => selected _ seg.TselectedInFull.hot; active => selected _ seg.TselectedInFull.active; ENDCASE; }; PointGeneratorData: TYPE = REF PointGeneratorDataObj; PointGeneratorDataObj: TYPE = RECORD [ seqPtr: LIST OF Sequence, pointGen: GGModelTypes.PointGenerator -- the point generator for the first sequence of seqPtr ]; PointPairGeneratorData: TYPE = REF PointPairGeneratorDataObj; PointPairGeneratorDataObj: TYPE = RECORD [ seqPtr: LIST OF Sequence, pointGen: GGModelTypes.PointPairGenerator -- the pair generator for first sequence of seqPtr ]; OutlinePointsInDescriptor: PUBLIC PROC [sliceD: OutlineDescriptor] RETURNS [pointGen: GGModelTypes.OutlinePointGenerator] = { realParts: OutlineParts _ NARROW[sliceD.parts]; seqPtr: LIST OF Sequence _ realParts.seqs; trajPointGen: GGModelTypes.PointGenerator; pointGenData: PointGeneratorData; trajPointGen _ IF seqPtr.first = NIL THEN NIL ELSE GGTraj.PointsInDescriptor[seqPtr.first]; pointGenData _ NEW[PointGeneratorDataObj _ [seqPtr: seqPtr, pointGen: trajPointGen]]; pointGen _ NEW[GGModelTypes.OutlinePointGeneratorObj _ [sliceD, 0, 0, pointGenData]]; }; OutlinePointPairsInDescriptor: PUBLIC PROC [sliceD: OutlineDescriptor] RETURNS [pointPairGen: GGModelTypes.OutlinePointPairGenerator] = { realParts: OutlineParts _ NARROW[sliceD.parts]; seqPtr: LIST OF Sequence _ realParts.seqs; trajPointGen: GGModelTypes.PointPairGenerator; pointGenData: PointPairGeneratorData; trajPointGen _ IF seqPtr.first = NIL THEN NIL ELSE GGTraj.PointPairsInDescriptor[seqPtr.first]; pointGenData _ NEW[PointPairGeneratorDataObj _ [seqPtr: seqPtr, pointGen: trajPointGen]]; pointPairGen _ NEW[GGModelTypes.OutlinePointPairGeneratorObj _ [sliceD, 0, 0, pointGenData]]; }; OutlineNextPoint: PUBLIC PROC [pointGen: GGModelTypes.OutlinePointGenerator] RETURNS [pointAndDone: GGModelTypes.PointAndDone] = { pgd: PointGeneratorData _ NARROW[pointGen.classSpecific]; seqPtr: LIST OF Sequence _ pgd.seqPtr; IF seqPtr = NIL THEN RETURN[[[0,0], TRUE]]; WHILE TRUE DO IF seqPtr.first # NIL THEN { pointAndDone _ GGTraj.NextPoint[pgd.pointGen]; IF NOT pointAndDone.done THEN { pgd.seqPtr _ seqPtr; RETURN; }; seqPtr _ seqPtr.rest; -- on to the next sequence }; UNTIL seqPtr = NIL OR seqPtr.first # NIL DO seqPtr _ seqPtr.rest ENDLOOP; IF seqPtr = NIL THEN RETURN[[[0,0], TRUE]]; pgd.pointGen _ GGTraj.PointsInDescriptor[seqPtr.first]; ENDLOOP; }; OutlineNextPointPair: PUBLIC PROC [pointPairGen: GGModelTypes.OutlinePointPairGenerator] RETURNS [pointPairAndDone: GGModelTypes.PointPairAndDone] = { pgd: PointPairGeneratorData _ NARROW[pointPairGen.classSpecific]; seqPtr: LIST OF Sequence _ pgd.seqPtr; IF seqPtr = NIL THEN RETURN[[[0,0], [0,0], TRUE]]; WHILE TRUE DO IF seqPtr.first # NIL THEN { pointPairAndDone _ GGTraj.NextPointPair[pgd.pointGen]; IF NOT pointPairAndDone.done THEN { pgd.seqPtr _ seqPtr; RETURN; }; seqPtr _ seqPtr.rest; -- on to the next sequence }; UNTIL seqPtr = NIL OR seqPtr.first # NIL DO seqPtr _ seqPtr.rest ENDLOOP; IF seqPtr = NIL THEN RETURN[[[0,0], [0,0], TRUE]]; pgd.pointGen _ GGTraj.PointPairsInDescriptor[seqPtr.first]; ENDLOOP; }; GoodPointType: TYPE = {joint, intersectionPoint, midpoint, controlPoint, slice, none}; OutlineClosestPoint: PROC [sliceD: OutlineDescriptor, testPoint: Point, tolerance: REAL] RETURNS [bestPoint: Point, bestDist: REAL, hitData: REF ANY, success: BOOL] = { parts: OutlineParts _ NARROW[sliceD.parts]; thisDist: REAL; thisSegNum, bestSegNum, thisCP, bestCP, thisJointNum, bestJointNum: NAT; thisPoint: Point; thisSuccess: BOOL; bestTraj: Traj; bestType: GoodPointType _ none; outlineHitData: OutlineHitData; success _ FALSE; bestDist _ GGUtility.plusInfinity; FOR list: LIST OF Sequence _ parts.seqs, list.rest UNTIL list = NIL DO [thisDist, thisSegNum, thisCP, thisPoint, thisSuccess] _ GGTraj.NearestControlPoint[testPoint, list.first, tolerance]; IF thisSuccess AND thisDist < bestDist THEN { bestType _ controlPoint; bestPoint _ thisPoint; bestDist _ thisDist; bestTraj _ list.first.traj; bestSegNum _ thisSegNum; bestCP _ thisCP; success _ TRUE; }; ENDLOOP; FOR list: LIST OF Sequence _ parts.seqs, list.rest UNTIL list = NIL DO [thisDist, thisJointNum, thisPoint, thisSuccess] _ GGTraj.NearestJoint[testPoint, list.first, tolerance]; IF thisSuccess AND thisDist < bestDist THEN { bestType _ joint; bestPoint _ thisPoint; bestDist _ thisDist; bestTraj _ list.first.traj; bestJointNum _ thisJointNum; success _ TRUE; }; ENDLOOP; IF success THEN { SELECT bestType FROM controlPoint => { hitData _ outlineHitData _ NEW[OutlineHitDataObj _ [ bestTraj, controlPoint, bestSegNum, bestCP, -1, bestPoint]]; }; joint => { hitData _ outlineHitData _ NEW[OutlineHitDataObj _ [ bestTraj, joint, -1, -1, bestJointNum, bestPoint]]; }; ENDCASE => ERROR; }; }; OutlineClosestSegment: PUBLIC PROC [sliceD: OutlineDescriptor, testPoint: Point, tolerance: REAL] RETURNS [bestPoint: Point, bestDist: REAL, hitData: REF ANY, success: BOOL] = { parts: OutlineParts _ NARROW[sliceD.parts]; thisDist: REAL; thisSegNum, bestSegNum: NAT; thisPoint: Point; thisSuccess: BOOL; bestTraj: Traj; outlineHitData: OutlineHitData; success _ FALSE; bestDist _ GGUtility.plusInfinity; FOR list: LIST OF Sequence _ parts.seqs, list.rest UNTIL list = NIL DO [thisDist, thisSegNum, thisPoint, thisSuccess] _ GGTraj.NearestSegment[testPoint, list.first, tolerance]; IF thisSuccess AND thisDist < bestDist THEN { bestPoint _ thisPoint; bestDist _ thisDist; bestTraj _ list.first.traj; bestSegNum _ thisSegNum; success _ TRUE; }; ENDLOOP; IF success THEN { hitData _ outlineHitData _ NEW[OutlineHitDataObj _ [ bestTraj, segment, bestSegNum, -1, -1, bestPoint]]; }; }; OutlineLineIntersection: PUBLIC PROC [sliceD: OutlineDescriptor, line: Line] RETURNS [points: LIST OF Point, pointCount: NAT] = { segGen: GGModelTypes.SegmentGenerator; thesePoints: LIST OF Point; thisCount: NAT; seq: Sequence; parts: OutlineParts _ NARROW[sliceD.parts]; points _ NIL; pointCount _ 0; FOR list: LIST OF Sequence _ parts.seqs, list.rest UNTIL list = NIL DO seq _ list.first; IF seq = NIL THEN LOOP; segGen _ GGSequence.SegmentsInSequence[seq]; FOR seg: Segment _ GGSequence.NextSegment[segGen], GGSequence.NextSegment[segGen] UNTIL seg = NIL DO [thesePoints, thisCount] _ seg.class.lineIntersection[seg, line]; FOR list: LIST OF Point _ thesePoints, list.rest UNTIL list = NIL DO points _ CONS[list.first, points]; ENDLOOP; pointCount _ pointCount + thisCount; ENDLOOP; ENDLOOP; }; OutlineCircleIntersection: PROC [sliceD: OutlineDescriptor, circle: Circle] RETURNS [points: LIST OF Point, pointCount: NAT] = { segGen: GGModelTypes.SegmentGenerator; thesePoints: LIST OF Point; thisCount: NAT; seq: Sequence; parts: OutlineParts _ NARROW[sliceD.parts]; points _ NIL; pointCount _ 0; FOR list: LIST OF Sequence _ parts.seqs, list.rest UNTIL list = NIL DO seq _ list.first; IF seq = NIL THEN LOOP; segGen _ GGSequence.SegmentsInSequence[seq]; FOR seg: Segment _ GGSequence.NextSegment[segGen], GGSequence.NextSegment[segGen] UNTIL seg = NIL DO [thesePoints, thisCount] _ seg.class.circleIntersection[seg, circle]; FOR list: LIST OF Point _ thesePoints, list.rest UNTIL list = NIL DO points _ CONS[list.first, points]; ENDLOOP; ENDLOOP; pointCount _ pointCount + thisCount; ENDLOOP; }; OutlineHitDataAsSimpleCurve: PROC [slice: Outline, hitData: REF ANY] RETURNS [simpleCurve: REF ANY] = { outlineHitData: OutlineHitData _ NARROW[hitData]; traj: Traj _ outlineHitData.traj; SELECT outlineHitData.hitType FROM joint, controlPoint => RETURN[NIL]; segment => { segNum: INT _ outlineHitData.segNum; seg: Segment _ GGTraj.FetchSegment[traj, segNum]; simpleCurve _ seg.class.asSimpleCurve[seg, outlineHitData.hitPoint]; }; ENDCASE => ERROR; }; OutlineSetStrokeWidth: PROC [slice: Outline, parts: SliceParts, strokeWidth: REAL] = { realParts: OutlineParts _ NARROW[parts]; FOR list: LIST OF Sequence _ realParts.seqs, list.rest UNTIL list = NIL DO IF list.first # NIL THEN GGSequence.SetStrokeWidth[list.first, strokeWidth]; ENDLOOP; }; OutlineGetStrokeWidth: PROC [slice: Outline, parts: SliceParts] RETURNS [strokeWidth: REAL] = { realParts: OutlineParts _ NARROW[parts]; FOR list: LIST OF Sequence _ realParts.seqs, list.rest UNTIL list = NIL DO IF list.first # NIL THEN RETURN[GGSequence.GetStrokeWidth[list.first]]; ENDLOOP; ERROR Problem[msg: "No segments to get a stroke width from"]; }; OutlineSetStrokeColor: PROC [slice: Outline, parts: SliceParts, color: Imager.Color] = { realParts: OutlineParts _ NARROW[parts]; FOR list: LIST OF Sequence _ realParts.seqs, list.rest UNTIL list = NIL DO IF list.first # NIL THEN SequenceSetStrokeColor[list.first, color]; ENDLOOP; }; OutlineSetDashed: PUBLIC PROC [slice: Outline, parts: SliceParts, dashed: BOOL, pattern: SequenceOfReal _ NIL, offset: REAL _ 0.0, length: REAL _ -1.0] = { realParts: OutlineParts _ NARROW[parts]; FOR list: LIST OF Sequence _ realParts.seqs, list.rest UNTIL list = NIL DO IF list.first # NIL THEN SequenceSetDashed[list.first, dashed, pattern, offset, length]; ENDLOOP; }; SequenceSetStrokeColor: PROC [seq: Sequence, color: Imager.Color] = { segGen: SegmentGenerator; segGen _ GGSequence.SegmentsInSequence[seq]; FOR seg: Segment _ GGSequence.NextSegment[segGen], GGSequence.NextSegment[segGen] UNTIL seg = NIL DO seg.color _ color; ENDLOOP; }; SequenceSetDashed: PROC [seq: Sequence, dashed: BOOL, pattern: SequenceOfReal _ NIL, offset: REAL _ 0.0, length: REAL _ -1.0] = { segGen: SegmentGenerator; segGen _ GGSequence.SegmentsInSequence[seq]; FOR seg: Segment _ GGSequence.NextSegment[segGen], GGSequence.NextSegment[segGen] UNTIL seg = NIL DO seg.dashed _ dashed; seg.pattern _ pattern; seg.offset _ offset; seg.length _ length; ENDLOOP; }; OutlineGetStrokeColor: PROC [slice: Outline, parts: SliceParts] RETURNS [color: Imager.Color] = { realParts: OutlineParts _ NARROW[parts]; FOR list: LIST OF Sequence _ realParts.seqs, list.rest UNTIL list = NIL DO IF list.first # NIL THEN RETURN[SequenceGetStrokeColor[list.first]]; ENDLOOP; ERROR Problem[msg: "No segments to get a stroke width from"]; }; SequenceGetStrokeColor: PROC [seq: Sequence] RETURNS [color: Imager.Color] = { segGen: SegmentGenerator _ GGSequence.SegmentsInSequence[seq]; seg: Segment _ GGSequence.NextSegment[segGen]; IF seg#NIL THEN color _ seg.color; }; OutlineGetDashed: PROC [slice: Outline, parts: SliceParts] RETURNS [dashed: BOOL, pattern: SequenceOfReal, offset, length: REAL] = { realParts: OutlineParts _ NARROW[parts]; FOR list: LIST OF Sequence _ realParts.seqs, list.rest UNTIL list = NIL DO IF list.first # NIL THEN { [dashed, pattern, offset, length] _ SequenceGetDashed[list.first]; RETURN; }; ENDLOOP; ERROR Problem[msg: "No segments to get a dash pattern from"]; }; SequenceGetDashed: PROC [seq: Sequence] RETURNS [dashed: BOOL, pattern: SequenceOfReal, offset, length: REAL] = { segGen: SegmentGenerator _ GGSequence.SegmentsInSequence[seq]; seg: Segment _ GGSequence.NextSegment[segGen]; IF seg#NIL THEN { dashed _ seg.dashed; pattern _ seg.pattern; offset _ seg.offset; length _ seg.length; } ELSE ERROR Problem[msg: "No segments to get a dash pattern from"]; }; OutlineSetFillColor: PROC [slice: Outline, color: Imager.Color] = { slice.fillColor _ color }; OutlineGetFillColor: PROC [slice: Outline] RETURNS [color: Imager.Color] = { color _ slice.fillColor; }; AppendTrajList: PUBLIC PROC [list1, list2: LIST OF Traj] RETURNS [result: LIST OF Traj] = { pos: LIST OF Traj; newCell: LIST OF Traj; IF list1 = NIL THEN RETURN[list2]; result _ CONS[list1.first, NIL]; pos _ result; FOR l: LIST OF Traj _ list1.rest, l.rest UNTIL l = NIL DO newCell _ CONS[l.first, NIL]; pos.rest _ newCell; pos _ newCell; ENDLOOP; pos.rest _ list2; }; globalOutlineClass: OutlineClass; Init: PROC [] = { globalOutlineClass _ MakeOutlineClass[]; }; Init[]; END. 0GGOutlineImplA.mesa Copyright c 1986 by Xerox Corporation. All rights reserved. Last edited by Bier on June 2, 1986 5:10:01 pm PDT Contents: Procedures to implement the Outline Slice Class in Gargoyle. Outlines consist of Trajectories which in turn consist of Segments. Outline is the most important slice class. NoOp Class Routines Style The Outline Class Drawing Transforming Textual Description Parts Hit Testing Style Fundamentals Computes it from traj boxes. Drawing GGModelTypes.OutlineDrawPartsProc PathProc: TYPE ~ PROC[moveTo: MoveToProc, lineTo: LineToProc, curveTo: CurveToProc, conicTo: ConicToProc, arcTo: ArcToProc]; Fill in the outline if necessary. Draw the strokes. Drawing Utilities Fill the outline if necessary. Someday this will be a call to path.class.buildPath[traj, moveTo, lineTo, curveTo, conicTo, arcTo]; path.class.buildPath[traj, moveTo, lineTo, curveTo, conicTo, arcTo]; Draw the strokes. Will be path.class.drawBorder[fence, dc, gargoyleData]; Will be path.class.drawBorder[holeList.first, dc, gargoyleData]; Transforming Textual Description Parts Trim away the moving parts. exclude segments with moving cps exclude segments with moving joints exclude all directly moving parts Segments with selected control points are not stationary If selectClass = normal, then for each segment mentioned in parts, place it, its adjacent joints, and its control points in more. If selectClass # normal then just place each segment and its control points in more. Selected sequences must satisfy the requirement that if a segment is selected its joints and control points are as well. Set the selected fields of all of the joints and segments mentioned in sliceD. Joint Fields. Segment Fields. Hit Testing Finds the intersection of the line with those slice parts mentioned in sliceD. simpleCurve will be of type Edge, Arc, etc. There will be Conic and Bezier types as well. Style Sets the stroke width of the named parts of slice to be strokeWidth. Get the stroke width of the first segment you come to. Sets the stroke color of the named parts of slice to be color. Get the stroke color of the named parts of slice. Get the dash pattern of the named parts of slice. Sets the fill color of the slice to be color. Get the fill color of the slice. Utility Routines Non-destructive (copies the first list). Ê0s˜J˜Icodešœ™Kšœ Ïmœ1™K˜Kšœ˜Kšœ˜Kšœ!˜!Kšœ?˜?Kšœ ˜ šžœGžœžœž˜]Kšœ ˜ Kšœ.žœ ˜=Kšœ˜Kšžœ˜—K˜K˜—K™Kšœ™K˜šŸœžœTžœ˜sKšœ!™!Kšžœ žœžœžœ7˜PKšœ˜K˜K˜—šŸœžœ€˜šKšœžœ˜)šÐbn œ˜!Kšœ žœžœh™}š¡ œ˜K˜ Kšœ2˜2Kšœ'˜'šžœžœžœž˜,Kšœ#˜#Kšœ:˜:—Kšžœ˜K˜—š¡œ˜*K˜ Kšœ2˜2KšžœžœžœD˜tKšœ'˜'šžœžœžœž˜,Kšœ#˜#KšœjžœT˜ÁKšžœ˜—K˜—K˜Kšœ"˜"Kšœ žœ˜Kšœ ˜ K˜Kšœ4˜4šžœ žœžœ˜Kšœ?˜?Kšœ=˜=K˜—šžœ˜Kšœ3˜3Kšœ#˜#K˜—š žœ žœžœ+žœ žœž˜WKšœ˜Kšœ4˜4šžœ žœžœ˜KšœL˜LKšœ@˜@K˜—šžœ˜Kšœ@˜@Kšœ&˜&K˜—Kšžœ žœV˜gKšžœO˜SKšžœ˜—K˜—K˜Kšœ ˜ K˜šœ#˜#Kš !™!—šžœžœžœžœ˜4Kšœ˜šžœžœž˜ šœ"˜"Kšœ˜Kšœ˜—šœ!˜!šžœ$žœ˜,Kšœ˜Kšœ&˜&K˜—K˜—Kšžœžœ˜—K˜"K˜Kš ™—Kšœ5˜5Kšžœ žœžœ5žœ˜jš žœ žœžœ+žœ žœž˜WKšœ>˜>Kšžœ žœžœ5žœ%˜sKšžœ˜—K˜K˜K˜—šŸœžœšžœ˜ÅK˜2Kšœžœžœ ˜&Kšœžœ˜+Kšœžœ ˜#Kšžœžœžœžœ˜/Kš žœžœžœ žœžœžœ˜6š žœžœžœ žœžœ˜0Kšœ˜šžœ7žœžœž˜SKšžœžœžœ˜®KšžœžœžœžœŽ˜®Kšœ˜Kšžœ˜—K˜—šžœžœžœžœ˜"šžœ7žœžœž˜SKšžœžœžœGžœ=˜¥Kšžœ˜—K˜—šžœ˜šžœ.žœ žœž˜GKšžœžœžœ2žœL˜œKšžœ˜—K˜—K˜K˜K˜—š¡œžœžœHžœ-˜¢Jšœ žœ˜Jšœ˜Jšœ ˜ Jšœ ˜ Jšœ žœ˜JšœÏcœA˜_šžœ ž˜šœ ˜ Jšžœžœ=˜QJšžœžœ;˜[J˜—Jšœ4˜4Jšžœ¢˜—K˜—K™K™K˜šŸ œžœ+˜˜>šœ œ ˜+Kšœ.˜.—K˜—šœ žœ¢"˜@KšœG˜GKšœ7˜7Kšœ œ˜@K˜—šœ žœ žœ¢%˜TKšœ<˜˜Qšžœ˜Kšœžœ.˜:Kšœ žœ1˜@Kšœžœžœ7˜WKšžœ9˜=K˜—Kšœ&˜&K˜—˜Kšœ ˜ Kšœžœ˜Kšœ˜Kšœ˜Kšœ˜Kšœ˜KšœI˜IKšœ2˜2K˜—Kšžœžœ˜—J˜—˜ Jšœ!žœ ˜1šžœž˜"šœ ˜ Kšœ ˜ K˜—šœ˜Kšœ˜KšœO˜OKšœ&˜&K˜—Kšžœžœ˜—J˜—˜ Jšœ!žœ ˜1Jšœ!˜!Jšœ0˜0Jšœ&˜&J˜—˜ Jšœ$žœ ˜0J˜—Jšžœžœ˜—K˜K˜—šŸœžœžœ˜GK˜Kšœžœ˜)Kšœžœ˜š žœžœžœ"žœžœž˜FKšœžœžœ˜+Kšžœ˜—Kšœ˜K˜—šŸœžœ:žœ˜qKšœžœ ˜*Kšœžœ ˜*Kšœ˜Kšœžœžœ˜*Kšœžœžœ˜*Kšœžœžœ ˜Kšœžœ˜&Kšœ2˜2šžœ žœž˜KšžœžœžœH˜aKšžœžœžœžœH˜fšžœ˜Kšœ>˜>KšœC˜CK˜—Kšœ˜K˜Kšžœ˜—K˜K˜—šŸœžœ:žœ˜wKšœžœ ˜*Kšœžœ ˜*Kšœ˜Kšœžœžœ˜*Kšœžœžœ˜*Kšœžœžœ ˜Kšœžœ˜&Kšœ1˜1šžœ žœž˜Kšžœžœžœ*žœ˜WKšžœžœžœžœF˜dšžœ˜KšœC˜CKšœA˜AK˜—Kšœ˜K˜Kšžœ˜—K˜K˜—šŸœžœBžœ˜yKšœ×™×Kšœžœ˜)š žœžœžœ'žœžœž˜KKšžœžœžœ/˜GKšžœ˜—Kšœ ˜ K˜K˜—šŸœžœ1˜KK™xšžœžœ˜Kšœ˜Kšœ$˜$K˜—šžœ˜Kšœ$˜$K˜—K˜K™—šŸœžœ'žœ"˜kKšœN™NKšœžœ˜0š žœžœžœ'žœžœž˜KKšžœžœžœ>˜VKšžœ˜—K˜K˜—šŸœžœžœ"˜`K˜ K˜K˜Kšœ2˜2šœ,˜,Kšœ ™ —šžœ žœBžœž˜iKšœžœ*˜8Kšœ,˜,Kšžœ˜Kšœ™—Kšœ,˜,šžœOžœžœž˜dKšœ,˜,Kšžœ˜—K˜K˜—šŸœžœžœ#˜Ušžœ ž˜Kšœ0˜0Kšœ*˜*Kšœ0˜0Kšžœ˜—K˜K˜—šŸ œž œžœ#˜[šžœ ž˜Kšœ2˜2Kšœ,˜,Kšœ2˜2Kšžœ˜—K˜K˜K˜—šŸœž œžœ#˜]šžœ ž˜Kšœ0˜0Kšœ*˜*Kšœ0˜0Kšžœ˜—K˜K˜—šŸœž œžœ žœ#˜nKšœB˜BK˜K˜—š Ÿœž œžœžœ žœ˜wKšœC˜CK˜K˜—šŸ œž œ-žœ žœ˜cšžœ ž˜Kšœ2˜2Kšœ,˜,Kšœ2˜2Kšžœ˜—K˜K˜—šŸœž œ-žœ žœ˜ešžœ ž˜Kšœ0˜0Kšœ*˜*Kšœ0˜0Kšžœ˜—K˜—K˜K™ K™Kšœžœžœ˜5šœžœžœ˜&Kšœžœžœ ˜Kšœ]˜]Kšœ˜K˜—Kšœžœžœ˜=šœžœžœ˜*Kšœžœžœ ˜Kšœ\˜\Kšœ˜K˜—š¡œžœžœžœ3˜}Kšœžœ˜/Kšœžœžœ˜*Kšœ*˜*Kšœ!˜!Kš œžœžœžœžœžœ)˜[KšœžœC˜UKšœ žœG˜UK˜K˜—š¡œžœžœžœ;˜‰Kšœžœ˜/Kšœžœžœ˜*Kšœ.˜.Kšœ%˜%Kš œžœžœžœžœžœ-˜_KšœžœG˜YKšœžœK˜]K˜K˜—š¡œžœžœ0žœ.˜‚Kšœžœ˜9Kšœžœžœ˜&Kš žœ žœžœžœ žœ˜+šžœžœž˜ šžœžœžœ˜Kšœ.˜.šžœžœžœž˜Kšœ˜Kšžœ˜K˜—Kšœ¢˜0K˜—Kš žœ žœžœžœžœžœ˜IKš žœ žœžœžœ žœ˜+Kšœ7˜7Kšžœ˜—K˜K˜—š¡œžœžœ8žœ6˜–Kšœžœ˜AKšœžœžœ˜&Kš žœ žœžœžœžœ˜2šžœžœž˜ šžœžœžœ˜Kšœ6˜6šžœžœžœž˜#Kšœ˜Kšžœ˜K˜—Kšœ¢˜0K˜—Kš žœ žœžœžœžœžœ˜IKš žœ žœžœžœžœ˜2Kšœ;˜;Kšžœ˜—K˜—K˜KšœžœC˜Vš œžœ:žœžœžœ žœžœ žœ˜¨Kšœžœ˜+Kšœ žœ˜KšœDžœ˜HKšœ˜Kšœ žœ˜K˜Kšœ˜Kšœ˜K˜Kšœ žœ˜Kšœ"˜"š žœžœžœ"žœžœž˜FJšœv˜všžœ žœžœ˜-Jšœ˜Jšœ˜Jšœ˜Jšœ˜Jšœ˜Jšœ˜Jšœ žœ˜J˜—Jšžœ˜—š žœžœžœ"žœžœž˜FJšœi˜išžœ žœžœ˜-Jšœ˜Jšœ˜Jšœ˜Jšœ˜Jšœ˜Jšœ žœ˜J˜—Jšžœ˜—šžœ žœ˜Jšžœ ž˜šœ˜šœžœ˜4Jšœ<˜<—J˜—˜ šœžœ˜4Jšœ3˜3—J˜—Jšžœžœ˜J˜—K˜K˜—šŸœžœžœ:žœžœžœ žœžœ žœ˜±Kšœžœ˜+Kšœ žœ˜Kšœžœ˜Kšœ˜Kšœ žœ˜K˜Kšœ˜K˜Kšœ žœ˜Kšœ"˜"š žœžœžœ"žœžœž˜FJšœi˜išžœ žœžœ˜-Jšœ˜Jšœ˜Jšœ˜Jšœ˜Jšœ žœ˜J˜—Jšžœ˜—šžœ žœ˜šœžœ˜4Jšœ3˜3—J˜—K˜—K™šŸœžœžœ)žœ žœžœžœ˜KšœN™NJšœ&˜&Kšœ žœžœ˜Kšœ žœ˜Kšœ˜Kšœžœ˜+K˜Jšœ žœ˜ Jšœ˜š žœžœžœ"žœžœž˜FJšœ˜Jšžœžœžœžœ˜Jšœ,˜,šžœOžœžœž˜dJšœA˜Aš žœžœžœ žœžœž˜DJšœ žœ˜"Jšžœ˜—Jšœ$˜$Jšžœ˜—J˜Jšžœ˜—K˜K˜—š ¡œžœ-žœ žœžœžœ˜€Jšœ&˜&Kšœ žœžœ˜Kšœ žœ˜Kšœ˜Kšœžœ˜+K˜Jšœ žœ˜ Jšœ˜š žœžœžœ"žœžœž˜FJšœ˜Jšžœžœžœžœ˜Jšœ,˜,šžœOžœžœž˜dJšœE˜Eš žœžœžœ žœžœž˜DJšœ žœ˜"Jšžœ˜—Jšžœ˜—Jšœ$˜$Jšžœ˜—K˜K˜—š¡œžœžœžœžœžœžœ˜gKšœZ™ZKšœ!žœ ˜1Kšœ"˜"šžœž˜"Kšœžœžœ˜#šœ ˜ Kšœžœ˜$Kšœ1˜1KšœD˜DK˜—Kšžœžœ˜—K˜—K˜K™K˜š¡œžœ2žœ˜VKšœD™DKšœžœ˜(š žœžœžœ&žœžœž˜JJšžœžœžœ4˜LJšžœ˜—K˜K˜—š¡œžœ%žœžœ˜_Kšœ6™6Kšœžœ˜(š žœžœžœ&žœžœž˜JJšžœžœžœžœ(˜GJšžœ˜—Jšžœ8˜=K˜K˜—š¡œžœ=˜XKšœ>™>Kšœžœ˜(š žœžœžœ&žœžœž˜JJšžœžœžœ+˜CJšžœ˜—K˜K˜—š œžœžœ-žœžœ žœžœ ˜›Kšœžœ˜(š žœžœžœ&žœžœž˜JJšžœžœžœ@˜XJšžœ˜—K˜—K˜šŸœžœ*˜FK˜Kšœ,˜,šžœOžœžœž˜dKšœ˜Kšžœ˜—K˜K˜—š Ÿœžœžœžœ žœžœ ˜‚K˜Kšœ,˜,šžœOžœžœž˜dKšœ˜Kšœ˜Kšœ˜Kšœ˜Kšžœ˜—K˜K˜—š¡œžœ%žœ˜aKšœ1™1Kšœžœ˜(š žœžœžœ&žœžœž˜JJšžœžœžœžœ%˜DJšžœ˜—Jšžœ8˜=K˜K˜—šŸœžœžœ˜OKšœ>˜>Kšœ.˜.Kšžœžœžœ˜"K˜K˜—š Ÿœžœ%žœ žœ+žœ˜„Kšœ1™1Kšœžœ˜(š žœžœžœ&žœžœž˜Jšžœžœžœ˜JšœB˜BJšžœ˜Jšœ˜—Jšžœ˜—Jšžœ8˜=K˜K˜—š Ÿœžœžœ žœ+žœ˜rKšœ>˜>Kšœ.˜.šžœžœžœ˜Kšœ˜Kšœ˜Kšœ˜Kšœ˜K˜—Jšž œ8˜BK˜K˜—šŸ¡ œžœ*˜CKšœ-™-Kšœ˜K˜—š¡œžœžœ˜LKšœ ™ Kšœ˜K˜—K˜K™šŸœž œžœžœžœ žœžœ ˜[Kšœžœžœ˜Kšœ žœžœ˜K™(Kšžœ žœžœžœ˜"Kšœ žœžœ˜ Kšœ ˜ š žœžœžœžœžœž˜9Kšœ žœ žœ˜Kšœ˜Kšœ˜Kšžœ˜—Kšœ˜K˜—K˜K˜!šŸœžœ˜K˜(K˜—K˜K˜K˜Kšžœ˜J˜—…—®çµ