DIRECTORY Buttons USING [Button, ButtonProc, Create, SetDisplayStyle], CADIO USING [Error, ReadInfoFile, ReadVAXCadFiles, SelectCell, WriteInfoFile], CADTypes USING [Scad, VisibleMask], Commander USING [CommandProc, Register], Containers USING [ChildXBound, Container, Create], Convert USING [AtomFromRope, Error, IntFromRope, RealFromRope], Icons USING [IconFlavor], IO USING [real, PutFR], Labels USING [Create, Label, Set], Matrix3d USING [MakePureRotate, Matrix, Transform], Menus USING [AppendMenuEntry, CreateEntry, CreateMenu, Menu, MenuEntry, MenuProc, SetGuarded], MessageWindow USING [Append, Blink], MultiPolynomial USING [RopeFromRef], PopUpMenu USING [RequestSelection], Rope USING [Concat, Length, ROPE], Rules USING [Create, Rule], SurfaceIcons USING [SurfaceToolIcon], SurfaceViewer, UserProfile USING [Number, Token], Vector3d, VFonts USING [CharWidth, EstablishFont, StringWidth], ViewerClasses USING [Viewer], ViewerOps USING [PaintViewer], ViewerSpecs USING [openLeftWidth], ViewerTools USING [GetContents, GetSelectionContents, MakeNewTextViewer, SetContents, SetSelection]; SurfaceToolImpl: CEDAR PROGRAM IMPORTS Buttons, CADIO, Commander, Containers, Convert, IO, Labels, Matrix3d, Menus, MessageWindow, MultiPolynomial, PopUpMenu, Rope, Rules, SurfaceIcons, SurfaceViewer, UserProfile, Vector3d, VFonts, ViewerOps, ViewerSpecs, ViewerTools ~ BEGIN SurfaceToolRef: TYPE ~ REF SurfaceToolRec; SurfaceToolRec: TYPE ~ RECORD [ outer: Containers.Container _ NIL, height: CARDINAL _ 0, buttonsLocked: BOOLEAN _ FALSE, coordinates: CoordinateState, conversionState: ConversionState, positionState: PositionState, orientationState: OrientationState, activeState: ActiveState, rayTracerState: RayTracerState]; MakeSurfaceTool: Commander.CommandProc ~ BEGIN surfaceTool: SurfaceToolRef _ NEW[SurfaceToolRec]; topMenu: Menus.Menu; openEntry, viewEntry: Menus.MenuEntry; topMenu _ Menus.CreateMenu[]; openEntry _ Menus.CreateEntry["Open", BugOpen, surfaceTool]; viewEntry _ Menus.CreateEntry["View", BugView, surfaceTool]; Menus.AppendMenuEntry[topMenu, openEntry]; Menus.AppendMenuEntry[topMenu, viewEntry]; Menus.SetGuarded [openEntry, TRUE]; surfaceTool.outer _ Containers.Create[[ name: "Algebraic Surface Explorer", icon: SurfaceIcons.SurfaceToolIcon[], iconic: TRUE, column: left, menu: topMenu, scrollable: FALSE]]; BuildPositionSubviewer[surfaceTool]; BuildActiveSubviewer[surfaceTool]; BuildRayTracerSubviewer[surfaceTool]; BuildConversionSubviewer[surfaceTool]; ViewerOps.PaintViewer[surfaceTool.outer, all]; END; BugOpen: Menus.MenuProc ~ BEGIN surfaceTool: SurfaceToolRef _ NARROW[clientData]; SurfaceViewer.CreateSurfaceViewer[]; MakeNewFrame[surfaceTool]; END; BugView: Menus.MenuProc ~ BEGIN surfaceTool: SurfaceToolRef _ NARROW[clientData]; MakeNewFrame[surfaceTool]; END; MakeNewFrame: PROC[surfaceTool: SurfaceToolRef] ~ BEGIN SurfaceViewer.ChangePosition[[ x: surfaceTool.positionState.position.x, y: surfaceTool.positionState.position.y, z: surfaceTool.positionState.position.z]]; SurfaceViewer.ChangeOrientation[ newForward: surfaceTool.orientationState.forward, newUp: surfaceTool.orientationState.up]; SurfaceViewer.DrawFrame[]; END; smallHorizontalSpacing: CARDINAL ~ 10; largeHorizontalSpacing: CARDINAL ~ 20; smallVerticalSpacing: CARDINAL ~ 8; largeVerticalSpacing: CARDINAL ~ 16; smallButtonWidth: CARDINAL ~ 3 * VFonts.CharWidth['+]; dataButtonWidth: CARDINAL ~ 5 * VFonts.CharWidth['=]; dataViewerWidth: CARDINAL ~ 6*VFonts.CharWidth['0]; fileViewerWidth: CARDINAL ~ 30*VFonts.CharWidth['N]; verticalHeight: CARDINAL ~ 15; textViewerHeight: CARDINAL ~ verticalHeight + 6; toolWidth: CARDINAL ~ ViewerSpecs.openLeftWidth; ConversionState: TYPE ~ RECORD [ sourceDir: ViewerClasses.Viewer _ NIL, cadFile: ViewerClasses.Viewer _ NIL, csFile: ViewerClasses.Viewer _ NIL, destDir: ViewerClasses.Viewer _ NIL, destFile: ViewerClasses.Viewer _ NIL ]; BuildConversionSubviewer: PROC [surfaceTool: SurfaceToolRef] ~ BEGIN baseX: CARDINAL ~ 20; baseY: CARDINAL ~ surfaceTool.height; title: Rope.ROPE ~ "File Conversion"; titleRow: CARDINAL ~ baseY; titleColumn: CARDINAL ~ (toolWidth - VFonts.StringWidth[title])/2; buttonWidth: CARDINAL ~ VFonts.StringWidth["CAD: "]; viewerWidth: CARDINAL ~ (toolWidth/2) - baseX - buttonWidth; sourceButtonColumn: CARDINAL ~ baseX; sourceViewerColumn: CARDINAL ~ sourceButtonColumn + buttonWidth; destButtonColumn: CARDINAL ~ toolWidth / 2; destViewerColumn: CARDINAL ~ destButtonColumn + buttonWidth; doItWidth: CARDINAL ~ VFonts.StringWidth[" Do It "]; doItColumn: CARDINAL ~ toolWidth - doItWidth - smallHorizontalSpacing; doItRow: CARDINAL ~ titleRow + smallVerticalSpacing; subtitleRow: CARDINAL ~ titleRow + verticalHeight + smallVerticalSpacing; directoryRow: CARDINAL ~ subtitleRow + verticalHeight + smallVerticalSpacing; fileRow: CARDINAL ~ directoryRow + verticalHeight + smallVerticalSpacing; secondFileRow: CARDINAL ~ fileRow + verticalHeight + smallVerticalSpacing; bottomRow: CARDINAL ~ secondFileRow + verticalHeight + smallVerticalSpacing; theBottomLine: Rules.Rule; [] _ BuildLabel [title, surfaceTool.outer, titleColumn, titleRow, TRUE]; [] _ BuildLabel ["Source files (CAD and Covering Set)", surfaceTool.outer, sourceButtonColumn, subtitleRow]; [] _ BuildLabel ["Destination file (Algebraic surface)", surfaceTool.outer, destButtonColumn, subtitleRow]; [] _ BuildButton [surfaceTool, "Dir:", sourceButtonColumn, directoryRow, BugSourceDir, FALSE, buttonWidth]; [] _ BuildButton [surfaceTool, "CAD:", sourceButtonColumn, fileRow, BugCadFile, FALSE, buttonWidth]; [] _ BuildButton [surfaceTool, "CS:", sourceButtonColumn, secondFileRow, BugCSFile, FALSE, buttonWidth]; [] _ BuildButton [surfaceTool, "Dir:", destButtonColumn, directoryRow, BugDestDir, FALSE, buttonWidth]; [] _ BuildButton [surfaceTool, "File:", destButtonColumn, fileRow, BugDestFile, FALSE, buttonWidth]; [] _ BuildButton [surfaceTool, "Do It", doItColumn, doItRow, BugConvert, TRUE, doItWidth]; surfaceTool.conversionState.sourceDir _ BuildTextViewer [surfaceTool.outer, sourceViewerColumn, directoryRow, viewerWidth]; surfaceTool.conversionState.cadFile _ BuildTextViewer [surfaceTool.outer, sourceViewerColumn, fileRow, viewerWidth]; surfaceTool.conversionState.csFile _ BuildTextViewer [surfaceTool.outer, sourceViewerColumn, secondFileRow, viewerWidth]; surfaceTool.conversionState.destDir _ BuildTextViewer [surfaceTool.outer, destViewerColumn, directoryRow, viewerWidth]; surfaceTool.conversionState.destFile _ BuildTextViewer [surfaceTool.outer, destViewerColumn, fileRow, viewerWidth]; ViewerTools.SetContents[surfaceTool.conversionState.sourceDir, UserProfile.Token["AlgebraicSurfaces.SourceDir"]]; ViewerTools.SetContents[surfaceTool.conversionState.destDir, UserProfile.Token["AlgebraicSurfaces.DestDir"]]; theBottomLine _ Rules.Create [[ wx: 0, wy: bottomRow, wh: 1, parent: surfaceTool.outer]]; Containers.ChildXBound[surfaceTool.outer, theBottomLine]; surfaceTool.height _ surfaceTool.height + bottomRow - baseY; END; BugSourceDir: Buttons.ButtonProc ~ BEGIN surfaceTool: SurfaceToolRef _ NARROW[clientData]; ViewerTools.SetSelection[surfaceTool.conversionState.sourceDir]; END; BugCadFile: Buttons.ButtonProc ~ BEGIN surfaceTool: SurfaceToolRef _ NARROW[clientData]; ViewerTools.SetSelection[surfaceTool.conversionState.cadFile]; END; BugCSFile: Buttons.ButtonProc ~ BEGIN surfaceTool: SurfaceToolRef _ NARROW[clientData]; ViewerTools.SetSelection[surfaceTool.conversionState.csFile]; END; BugDestDir: Buttons.ButtonProc ~ BEGIN surfaceTool: SurfaceToolRef _ NARROW[clientData]; ViewerTools.SetSelection[surfaceTool.conversionState.destDir]; END; BugDestFile: Buttons.ButtonProc ~ BEGIN surfaceTool: SurfaceToolRef _ NARROW[clientData]; ViewerTools.SetSelection[surfaceTool.conversionState.destFile]; END; BugConvert: Buttons.ButtonProc ~ BEGIN surfaceTool: SurfaceToolRef _ NARROW[clientData]; sourceDir: Rope.ROPE _ ViewerTools.GetContents[surfaceTool.conversionState.sourceDir]; cadFile: Rope.ROPE _ ViewerTools.GetContents[surfaceTool.conversionState.cadFile]; csFile: Rope.ROPE _ ViewerTools.GetContents[surfaceTool.conversionState.csFile]; destDir: Rope.ROPE _ ViewerTools.GetContents[surfaceTool.conversionState.destDir]; destFile: Rope.ROPE _ ViewerTools.GetContents[surfaceTool.conversionState.destFile]; cadSource: Rope.ROPE _ Rope.Concat[sourceDir, cadFile]; csSource: Rope.ROPE _ Rope.Concat[sourceDir, csFile]; dest: Rope.ROPE _ Rope.Concat[destDir, destFile]; cad: CADTypes.Scad _ CADIO.ReadVAXCadFiles[cadSource, csSource]; CADIO.WriteInfoFile[dest, cad]; END; PositionState: TYPE ~ RECORD [ position: Vector3d.Triple _ [-6, 0, 0.2], increment: REAL _ 0.1, xDataLabel: Labels.Label _ NIL, yDataLabel: Labels.Label _ NIL, zDataLabel: Labels.Label _ NIL, incrementLabel: Labels.Label _ NIL]; OrientationState: TYPE ~ RECORD [ forward: Vector3d.Triple _ [1, 0, 0], up: Vector3d.Triple _ [0, 0, 1], forwardXLabel: Labels.Label _ NIL, forwardYLabel: Labels.Label _ NIL, forwardZLabel: Labels.Label _ NIL, upXLabel: Labels.Label _ NIL, upYLabel: Labels.Label _ NIL, upZLabel: Labels.Label _ NIL]; CoordinateState: TYPE ~ RECORD [ xVar: ATOM, yVar: ATOM, zVar: ATOM]; BuildPositionSubviewer: PROC [surfaceTool: SurfaceToolRef] ~ BEGIN baseX: CARDINAL ~ 20; baseY: CARDINAL ~ surfaceTool.height; locationBlockX: CARDINAL ~ 20; locationBlockY: CARDINAL ~ baseY; locationTitleRow: CARDINAL ~ locationBlockY; locationLongRuleRow: CARDINAL ~ locationSubtitleRow; locationSubtitleRow: CARDINAL ~ locationTitleRow + verticalHeight + smallVerticalSpacing; firstDataRow: CARDINAL ~ locationSubtitleRow + verticalHeight + smallVerticalSpacing; secondDataRow: CARDINAL ~ firstDataRow + verticalHeight + smallVerticalSpacing; thirdDataRow: CARDINAL ~ secondDataRow + verticalHeight + smallVerticalSpacing; fourthRow: CARDINAL ~ thirdDataRow + verticalHeight + smallVerticalSpacing; bottomRow: CARDINAL ~ fourthRow + verticalHeight + smallVerticalSpacing; positionBlockX: CARDINAL ~ locationBlockX; positionBlockY: CARDINAL ~ locationBlockY; positionTitle: Rope.ROPE ~ "Position"; positionTitleRow: CARDINAL ~ locationTitleRow; positionTitleColumn: CARDINAL ~ (positionEndColumn + positionBlockX - VFonts.StringWidth[positionTitle])/2; positionPlusColumn: CARDINAL ~ positionBlockX; positionMinusColumn: CARDINAL ~ positionBlockX + smallButtonWidth + smallHorizontalSpacing; positionNewColumn: CARDINAL ~ positionMinusColumn + smallButtonWidth + smallHorizontalSpacing; positionDataColumn: CARDINAL ~ positionNewColumn + dataButtonWidth; positionEndColumn: CARDINAL ~ positionDataColumn + dataViewerWidth; orientationBlockX: CARDINAL ~ positionEndColumn + smallHorizontalSpacing; orientationBlockY: CARDINAL ~ locationBlockY; orientationTitle: Rope.ROPE ~ "Orientation"; orientationTitleRow: CARDINAL ~ locationTitleRow; orientationTitleColumn: CARDINAL ~ (orientationEndColumn + orientationBlockX - VFonts.StringWidth[orientationTitle])/2; orientationLabelsColumn: CARDINAL ~ orientationBlockX; orientationLeftColumn: CARDINAL ~ orientationLabelsColumn + 40; orientationRightColumn: CARDINAL ~ orientationLeftColumn + 40; orientationEndOfLabelsColumn: CARDINAL ~ orientationRightColumn + 40 + largeHorizontalSpacing; orientationForwardTitle: Rope.ROPE ~ "Forward vector"; orientationForwardButtonColumn: CARDINAL ~ orientationEndOfLabelsColumn + largeHorizontalSpacing; orientationForwardVectorColumn: CARDINAL ~ orientationForwardButtonColumn + smallButtonWidth + smallHorizontalSpacing; orientationEndOfForwardColumn: CARDINAL ~ orientationForwardVectorColumn + dataViewerWidth + largeHorizontalSpacing; orientationForwardTitleColumn: CARDINAL ~ (orientationEndOfForwardColumn + orientationEndOfLabelsColumn - VFonts.StringWidth[orientationForwardTitle])/2; orientationUpTitle: Rope.ROPE ~ "Up vector"; orientationUpButtonColumn: CARDINAL ~ orientationEndOfForwardColumn + largeHorizontalSpacing; orientationUpVectorColumn: CARDINAL ~ orientationUpButtonColumn + smallButtonWidth + smallHorizontalSpacing; orientationEndOfUpColumn: CARDINAL ~ orientationUpVectorColumn + dataViewerWidth + largeHorizontalSpacing; orientationUpTitleColumn: CARDINAL ~ (orientationEndOfUpColumn + orientationEndOfForwardColumn - VFonts.StringWidth[orientationUpTitle])/2; orientationEndColumn: CARDINAL ~ orientationEndOfUpColumn; orientationVectorTitleRow: CARDINAL ~ locationSubtitleRow; bottomButtonWidth: CARDINAL ~ VFonts.StringWidth[" Backward "]; firstBottomButtonColumn: CARDINAL ~ locationBlockX; secondBottomButtonColumn: CARDINAL ~ firstBottomButtonColumn + bottomButtonWidth; thirdBottomButtonColumn: CARDINAL ~ secondBottomButtonColumn + bottomButtonWidth; breakLine, horizontalLine, theBottomLine: Rules.Rule; forwardVectorTitle: Rope.ROPE ~ "Forward vector"; upVectorTitle: Rope.ROPE ~ "Up vector"; [] _ BuildLabel [positionTitle, surfaceTool.outer, positionTitleColumn, positionTitleRow, TRUE]; [] _ BuildButton [surfaceTool, "+X", positionPlusColumn, firstDataRow, BugPlusX, TRUE, smallButtonWidth]; [] _ BuildButton [surfaceTool, "+Y", positionPlusColumn, secondDataRow, BugPlusY, TRUE, smallButtonWidth]; [] _ BuildButton [surfaceTool, "+Z", positionPlusColumn, thirdDataRow, BugPlusZ, TRUE, smallButtonWidth]; [] _ BuildButton [surfaceTool, "-X", positionMinusColumn, firstDataRow, BugMinusX, TRUE, smallButtonWidth]; [] _ BuildButton [surfaceTool, "-Y", positionMinusColumn, secondDataRow, BugMinusY, TRUE, smallButtonWidth]; [] _ BuildButton [surfaceTool, "-Z", positionMinusColumn, thirdDataRow, BugMinusZ, TRUE, smallButtonWidth]; [] _ BuildButton [surfaceTool, "x = ", positionNewColumn, firstDataRow, BugNewX, FALSE, smallButtonWidth]; [] _ BuildButton [surfaceTool, "y = ", positionNewColumn, secondDataRow, BugNewY, FALSE, smallButtonWidth]; [] _ BuildButton [surfaceTool, "z = ", positionNewColumn, thirdDataRow, BugNewZ, FALSE, smallButtonWidth]; surfaceTool.positionState.xDataLabel _ BuildDataLabel [surfaceTool.outer, positionDataColumn, firstDataRow]; surfaceTool.positionState.yDataLabel _ BuildDataLabel [surfaceTool.outer, positionDataColumn, secondDataRow]; surfaceTool.positionState.zDataLabel _ BuildDataLabel [surfaceTool.outer, positionDataColumn, thirdDataRow]; UpdatePositionData[surfaceTool]; [] _ Labels.Create[[name: "Turn", wx: orientationLabelsColumn, wy: firstDataRow, wh: verticalHeight, parent: surfaceTool.outer, border: FALSE]]; [] _ BuildButton[surfaceTool, "Left", orientationLeftColumn, firstDataRow, BugTurnLeft, TRUE]; [] _ BuildButton[surfaceTool, "Right", orientationRightColumn, firstDataRow, BugTurnRight, TRUE]; [] _ Labels.Create[[name: "Roll", wx: orientationLabelsColumn, wy: secondDataRow, wh: verticalHeight, parent: surfaceTool.outer, border: FALSE]]; [] _ BuildButton[surfaceTool, "Left", orientationLeftColumn, secondDataRow, BugRollLeft, TRUE]; [] _ BuildButton[surfaceTool, "Right", orientationRightColumn, secondDataRow, BugRollRight, TRUE]; [] _ Labels.Create[[name: "Dive", wx: orientationLabelsColumn, wy: thirdDataRow, wh: verticalHeight, parent: surfaceTool.outer, border: FALSE]]; [] _ BuildButton[surfaceTool, "Up", orientationLeftColumn, thirdDataRow, BugClimb, TRUE]; [] _ BuildButton[surfaceTool, "Down", orientationRightColumn, thirdDataRow, BugDive, TRUE]; [] _ BuildLabel[orientationForwardTitle, surfaceTool.outer, orientationForwardTitleColumn, orientationVectorTitleRow]; [] _ BuildButton[surfaceTool, "x = ", orientationForwardButtonColumn, firstDataRow, BugForwardX, FALSE, smallButtonWidth]; [] _ BuildButton[surfaceTool, "y = ", orientationForwardButtonColumn, secondDataRow, BugForwardY, FALSE, smallButtonWidth]; [] _ BuildButton[surfaceTool, "z = ", orientationForwardButtonColumn, thirdDataRow, BugForwardZ, FALSE, smallButtonWidth]; surfaceTool.orientationState.forwardXLabel _ BuildDataLabel[surfaceTool.outer, orientationForwardVectorColumn, firstDataRow]; surfaceTool.orientationState.forwardYLabel _ BuildDataLabel[surfaceTool.outer, orientationForwardVectorColumn, secondDataRow]; surfaceTool.orientationState.forwardZLabel _ BuildDataLabel[surfaceTool.outer, orientationForwardVectorColumn, thirdDataRow]; [] _ BuildLabel[orientationUpTitle, surfaceTool.outer, orientationUpTitleColumn, orientationVectorTitleRow]; [] _ BuildButton[surfaceTool, "x = ", orientationUpButtonColumn, firstDataRow, BugUpX, FALSE, smallButtonWidth]; [] _ BuildButton[surfaceTool, "y = ", orientationUpButtonColumn, secondDataRow, BugUpY, FALSE, smallButtonWidth]; [] _ BuildButton[surfaceTool, "z = ", orientationUpButtonColumn, thirdDataRow, BugUpZ, FALSE, smallButtonWidth]; surfaceTool.orientationState.upXLabel _ BuildDataLabel[surfaceTool.outer, orientationUpVectorColumn, firstDataRow]; surfaceTool.orientationState.upYLabel _ BuildDataLabel[surfaceTool.outer, orientationUpVectorColumn, secondDataRow]; surfaceTool.orientationState.upZLabel _ BuildDataLabel[surfaceTool.outer, orientationUpVectorColumn, thirdDataRow]; [] _ BuildButton[surfaceTool, "Forward", firstBottomButtonColumn, fourthRow, BugForward, TRUE]; [] _ BuildButton[surfaceTool, "Backward", secondBottomButtonColumn, fourthRow, BugBackward, TRUE]; [] _ BuildButton[surfaceTool, "Fancy maneuvers", thirdBottomButtonColumn, fourthRow, BugFancy, TRUE]; UpdateOrientationData[surfaceTool]; breakLine _ Rules.Create [[ wx: orientationEndOfLabelsColumn, wy: orientationVectorTitleRow, ww: 1, wh: bottomRow - orientationVectorTitleRow, parent: surfaceTool.outer]]; breakLine _ Rules.Create [[ wx: orientationEndOfForwardColumn, wy: orientationVectorTitleRow, ww: 1, wh: bottomRow - orientationVectorTitleRow, parent: surfaceTool.outer]]; horizontalLine _ Rules.Create [[ wx: 0, wy: orientationVectorTitleRow, wh: 1, parent: surfaceTool.outer]]; Containers.ChildXBound[surfaceTool.outer, horizontalLine]; theBottomLine _ Rules.Create [[ wx: 0, wy: bottomRow, wh: 1, parent: surfaceTool.outer]]; Containers.ChildXBound[surfaceTool.outer, theBottomLine]; surfaceTool.height _ surfaceTool.height + bottomRow - baseY; END; UpdatePositionData: PROC[surfaceTool: SurfaceToolRef] ~ BEGIN Labels.Set[surfaceTool.positionState.xDataLabel, RopeFromReal[surfaceTool.positionState.position.x]]; Labels.Set[surfaceTool.positionState.yDataLabel, RopeFromReal[surfaceTool.positionState.position.y]]; Labels.Set[surfaceTool.positionState.zDataLabel, RopeFromReal[surfaceTool.positionState.position.z]]; END; UpdateOrientationData: PROC[surfaceTool: SurfaceToolRef] ~ BEGIN Labels.Set[surfaceTool.orientationState.forwardXLabel, RopeFromReal[surfaceTool.orientationState.forward.x]]; Labels.Set[surfaceTool.orientationState.forwardYLabel, RopeFromReal[surfaceTool.orientationState.forward.y]]; Labels.Set[surfaceTool.orientationState.forwardZLabel, RopeFromReal[surfaceTool.orientationState.forward.z]]; Labels.Set[surfaceTool.orientationState.upXLabel, RopeFromReal[surfaceTool.orientationState.up.x]]; Labels.Set[surfaceTool.orientationState.upYLabel, RopeFromReal[surfaceTool.orientationState.up.y]]; Labels.Set[surfaceTool.orientationState.upZLabel, RopeFromReal[surfaceTool.orientationState.up.z]]; END; BugPlusX: Buttons.ButtonProc ~ BEGIN surfaceTool: SurfaceToolRef _ NARROW[clientData]; surfaceTool.positionState.position.x _ surfaceTool.positionState.position.x + surfaceTool.positionState.increment; UpdatePositionData[surfaceTool]; END; BugPlusY: Buttons.ButtonProc ~ BEGIN surfaceTool: SurfaceToolRef _ NARROW[clientData]; surfaceTool.positionState.position.y _ surfaceTool.positionState.position.y + surfaceTool.positionState.increment; UpdatePositionData[surfaceTool]; END; BugPlusZ: Buttons.ButtonProc ~ BEGIN surfaceTool: SurfaceToolRef _ NARROW[clientData]; surfaceTool.positionState.position.z _ surfaceTool.positionState.position.z + surfaceTool.positionState.increment; UpdatePositionData[surfaceTool]; END; BugMinusX: Buttons.ButtonProc ~ BEGIN surfaceTool: SurfaceToolRef _ NARROW[clientData]; surfaceTool.positionState.position.x _ surfaceTool.positionState.position.x - surfaceTool.positionState.increment; UpdatePositionData[surfaceTool]; END; BugMinusY: Buttons.ButtonProc ~ BEGIN surfaceTool: SurfaceToolRef _ NARROW[clientData]; surfaceTool.positionState.position.y _ surfaceTool.positionState.position.y - surfaceTool.positionState.increment; UpdatePositionData[surfaceTool]; END; BugMinusZ: Buttons.ButtonProc ~ BEGIN surfaceTool: SurfaceToolRef _ NARROW[clientData]; surfaceTool.positionState.position.z _ surfaceTool.positionState.position.z - surfaceTool.positionState.increment; UpdatePositionData[surfaceTool]; END; BugNewX: Buttons.ButtonProc ~ BEGIN surfaceTool: SurfaceToolRef _ NARROW[clientData]; value: REAL _ GetRealSelection[surfaceTool.positionState.position.x]; surfaceTool.positionState.position.x _ value; UpdatePositionData[surfaceTool]; END; BugNewY: Buttons.ButtonProc ~ BEGIN surfaceTool: SurfaceToolRef _ NARROW[clientData]; value: REAL _ GetRealSelection[surfaceTool.positionState.position.y]; surfaceTool.positionState.position.y _ value; UpdatePositionData[surfaceTool]; END; BugNewZ: Buttons.ButtonProc ~ BEGIN surfaceTool: SurfaceToolRef _ NARROW[clientData]; value: REAL _ GetRealSelection[surfaceTool.positionState.position.z]; surfaceTool.positionState.position.z _ value; UpdatePositionData[surfaceTool]; END; BugTurnLeft: Buttons.ButtonProc ~ BEGIN surfaceTool: SurfaceToolRef _ NARROW[clientData]; axis: Vector3d.Triple _ surfaceTool.orientationState.up; rotationMatrix: Matrix3d.Matrix _ Matrix3d.MakePureRotate[axis, -15]; oldForward: Vector3d.Triple _ surfaceTool.orientationState.forward; newForward: Vector3d.Triple _ Matrix3d.Transform[oldForward, rotationMatrix]; surfaceTool.orientationState.forward _ newForward; UpdateOrientationData[surfaceTool]; END; BugTurnRight: Buttons.ButtonProc ~ BEGIN surfaceTool: SurfaceToolRef _ NARROW[clientData]; axis: Vector3d.Triple _ surfaceTool.orientationState.up; rotationMatrix: Matrix3d.Matrix _ Matrix3d.MakePureRotate[axis, 15]; oldForward: Vector3d.Triple _ surfaceTool.orientationState.forward; newForward: Vector3d.Triple _ Matrix3d.Transform[oldForward, rotationMatrix]; surfaceTool.orientationState.forward _ newForward; UpdateOrientationData[surfaceTool]; END; BugRollLeft: Buttons.ButtonProc ~ BEGIN surfaceTool: SurfaceToolRef _ NARROW[clientData]; axis: Vector3d.Triple _ surfaceTool.orientationState.forward; rotationMatrix: Matrix3d.Matrix _ Matrix3d.MakePureRotate[axis, 15]; oldUp: Vector3d.Triple _ surfaceTool.orientationState.up; newUp: Vector3d.Triple _ Matrix3d.Transform[oldUp, rotationMatrix]; surfaceTool.orientationState.up _ newUp; UpdateOrientationData[surfaceTool]; END; BugRollRight: Buttons.ButtonProc ~ BEGIN surfaceTool: SurfaceToolRef _ NARROW[clientData]; axis: Vector3d.Triple _ surfaceTool.orientationState.forward; rotationMatrix: Matrix3d.Matrix _ Matrix3d.MakePureRotate[axis, -15]; oldUp: Vector3d.Triple _ surfaceTool.orientationState.up; newUp: Vector3d.Triple _ Matrix3d.Transform[oldUp, rotationMatrix]; surfaceTool.orientationState.up _ newUp; UpdateOrientationData[surfaceTool]; END; BugClimb: Buttons.ButtonProc ~ BEGIN surfaceTool: SurfaceToolRef _ NARROW[clientData]; axis: Vector3d.Triple _ Vector3d.Cross[surfaceTool.orientationState.forward, surfaceTool.orientationState.up]; rotationMatrix: Matrix3d.Matrix _ Matrix3d.MakePureRotate[axis, -15]; oldUp: Vector3d.Triple _ surfaceTool.orientationState.up; oldForward: Vector3d.Triple _ surfaceTool.orientationState.forward; newUp: Vector3d.Triple _ Matrix3d.Transform[oldUp, rotationMatrix]; newForward: Vector3d.Triple _ Matrix3d.Transform[oldForward, rotationMatrix]; surfaceTool.orientationState.up _ newUp; surfaceTool.orientationState.forward _ newForward; UpdateOrientationData[surfaceTool]; END; BugDive: Buttons.ButtonProc ~ BEGIN surfaceTool: SurfaceToolRef _ NARROW[clientData]; axis: Vector3d.Triple _ Vector3d.Cross[surfaceTool.orientationState.forward, surfaceTool.orientationState.up]; rotationMatrix: Matrix3d.Matrix _ Matrix3d.MakePureRotate[axis, 15]; oldUp: Vector3d.Triple _ surfaceTool.orientationState.up; oldForward: Vector3d.Triple _ surfaceTool.orientationState.forward; newUp: Vector3d.Triple _ Matrix3d.Transform[oldUp, rotationMatrix]; newForward: Vector3d.Triple _ Matrix3d.Transform[oldForward, rotationMatrix]; surfaceTool.orientationState.up _ newUp; surfaceTool.orientationState.forward _ newForward; UpdateOrientationData[surfaceTool]; END; BugForwardX: Buttons.ButtonProc ~ BEGIN END; BugForwardY: Buttons.ButtonProc ~ BEGIN END; BugForwardZ: Buttons.ButtonProc ~ BEGIN END; BugUpX: Buttons.ButtonProc ~ BEGIN END; BugUpY: Buttons.ButtonProc ~ BEGIN END; BugUpZ: Buttons.ButtonProc ~ BEGIN END; BugForward: Buttons.ButtonProc ~ BEGIN surfaceTool: SurfaceToolRef _ NARROW[clientData]; surfaceTool.positionState.position _ Vector3d.Add[surfaceTool.positionState.position, surfaceTool.orientationState.forward]; UpdatePositionData[surfaceTool]; UpdateOrientationData[surfaceTool]; END; BugBackward: Buttons.ButtonProc ~ BEGIN surfaceTool: SurfaceToolRef _ NARROW[clientData]; surfaceTool.positionState.position _ Vector3d.Sub[surfaceTool.positionState.position, surfaceTool.orientationState.forward]; UpdatePositionData[surfaceTool]; UpdateOrientationData[surfaceTool]; END; BugFancy: Buttons.ButtonProc ~ BEGIN surfaceTool: SurfaceToolRef _ NARROW[clientData]; options: LIST OF Rope.ROPE _ LIST[ "Turn around", "Go to origin", "Look towards origin", "Look towards origin from +x axis", "Look towards origin from +y axis", "Look towards origin from +z axis", "Look towards origin from -x axis", "Look towards origin from -y axis", "Look towards origin from -z axis", "Look in +x direction", "Look in +y direction", "Look in +z direction" ]; selection: INT _ PopUpMenu.RequestSelection[ label: "Fancy maneuvers", choice: options]; SELECT selection FROM -1 => NULL; -- Timeout 0 => NULL; -- No selection 1 => -- Turn around surfaceTool.orientationState.forward _ Vector3d.Mul[surfaceTool.orientationState.forward, -1]; 2 => { -- Go to originB surfaceTool.positionState.position _ [0, 0, 0]; }; 3 => { -- Look towards origin forward: Vector3d.Triple _ Vector3d.Neg[surfaceTool.positionState.position]; surfaceTool.orientationState.forward _ Vector3d.Normalize[forward]; surfaceTool.orientationState.up _ Vector3d.Ortho[forward, [1,0,0] ]; }; 4 => { -- Look toward origin from +x axis surfaceTool.positionState.position _ [10, 0, 0]; surfaceTool.orientationState.forward _ [-1, 0, 0]; surfaceTool.orientationState.up _ [0, 0, 1]; }; 5 => { -- Look toward origin from +y axis surfaceTool.positionState.position _ [0, 10, 0]; surfaceTool.orientationState.forward _ [0, -1, 0]; surfaceTool.orientationState.up _ [0, 0, 1]; }; 6 => { -- Look toward origin from +z axis surfaceTool.positionState.position _ [0, 0, 10]; surfaceTool.orientationState.forward _ [0, 0, -1]; surfaceTool.orientationState.up _ [0, 1, 0]; }; 7 => { -- Look toward origin from -x axis surfaceTool.positionState.position _ [-10, 0, 0]; surfaceTool.orientationState.forward _ [1, 0, 0]; surfaceTool.orientationState.up _ [0, 0, 1]; }; 8 => { -- Look toward origin from -y axis surfaceTool.positionState.position _ [0, -10, 0]; surfaceTool.orientationState.forward _ [0, 1, 0]; surfaceTool.orientationState.up _ [0, 0, 1]; }; 9 => { -- Look toward origin from -z axis surfaceTool.positionState.position _ [0, 0, -10]; surfaceTool.orientationState.forward _ [0, 0, 1]; surfaceTool.orientationState.up _ [0, 1, 0]; }; 10 => { -- Look in +x direction surfaceTool.orientationState.forward _ [1, 0, 0]; surfaceTool.orientationState.up _ [0, 0, 1]; }; 11 => { -- Look in +y direction surfaceTool.orientationState.forward _ [0, 1, 0]; surfaceTool.orientationState.up _ [0, 0, 1]; }; 12 => { -- Look in +z direction surfaceTool.orientationState.forward _ [0, 0, 1]; surfaceTool.orientationState.up _ [0, 1, 0]; }; ENDCASE => NULL; UpdatePositionData[surfaceTool]; UpdateOrientationData[surfaceTool]; END; ActiveState: TYPE ~ RECORD [ surfaces: REF ActiveSurfaceSequence, selectedSurface: NAT _ 0, -- 0=none dir: ViewerClasses.Viewer _ NIL, filename: ViewerClasses.Viewer _ NIL ]; ActiveSurfaceRec: TYPE ~ RECORD [ button: Buttons.Button _ NIL, viewer: ViewerClasses.Viewer _ NIL, visibleLabel: Labels.Label _ NIL, surfaceID: NAT, isLoaded: BOOLEAN _ FALSE, cad: CADTypes.Scad, mask: REF CADTypes.VisibleMask, isVisible: BOOLEAN _ TRUE ]; ActiveSurfaceSequence: TYPE ~ RECORD [ activeSurfaceRecs: SEQUENCE length: NAT OF ActiveSurfaceRec]; BuildActiveSubviewer: PROC [surfaceTool: SurfaceToolRef] ~ BEGIN baseX: CARDINAL ~ 20; baseY: CARDINAL ~ surfaceTool.height; activeBlockX: CARDINAL ~ 20; activeBlockY: CARDINAL ~ baseY; activeTitle: Rope.ROPE ~ "Active Surfaces"; activeTitleRow: CARDINAL ~ activeBlockY; activeTitleColumn: CARDINAL ~ (toolWidth - VFonts.StringWidth[activeTitle])/2; activeLetterColumn: CARDINAL ~ activeBlockX; activeLetterButtonWidth: CARDINAL ~ VFonts.StringWidth[" B "]; activeNameColumn: CARDINAL ~ activeLetterColumn + activeLetterButtonWidth + smallHorizontalSpacing; activeNameViewerWidth: CARDINAL ~ (toolWidth/2) - activeNameColumn; activeVisibleColumn: CARDINAL ~ activeNameColumn + activeNameViewerWidth + smallHorizontalSpacing; activeVisibleLabelWidth: CARDINAL ~ 20; activeFirstButtonColumn: CARDINAL ~ activeVisibleColumn + activeVisibleLabelWidth + smallHorizontalSpacing; activeFirstButtonWidth: CARDINAL ~ VFonts.StringWidth[" Set color "]; activeSecondButtonColumn: CARDINAL ~ activeFirstButtonColumn + activeFirstButtonWidth + smallHorizontalSpacing; activeSecondButtonWidth: CARDINAL ~ VFonts.StringWidth[" Show/Don't show "]; activeIOLabelColumn: CARDINAL ~ activeBlockX; cellLabelColumn: CARDINAL ~ activeBlockX; cellButtonSpacing: CARDINAL ~ VFonts.StringWidth[" Reveal One "]; cellFirstButtonColumn: CARDINAL ~ cellLabelColumn + cellButtonSpacing; cellSecondButtonColumn: CARDINAL ~ cellFirstButtonColumn + cellButtonSpacing; cellThirdButtonColumn: CARDINAL ~ cellSecondButtonColumn + cellButtonSpacing; cellFourthButtonColumn: CARDINAL ~ cellThirdButtonColumn + cellButtonSpacing; cellFifthButtonColumn: CARDINAL ~ cellFourthButtonColumn + cellButtonSpacing; activeIOLabelWidth: CARDINAL ~ VFonts.StringWidth[" Working dir: "]; activeIOViewerColumn: CARDINAL ~ activeIOLabelColumn + activeIOLabelWidth + smallHorizontalSpacing; activeIOViewerWidth: CARDINAL ~ (toolWidth/2); activeIOButtonColumn: CARDINAL ~ activeIOViewerColumn + activeIOViewerWidth + smallHorizontalSpacing; activeIOButtonWidth: CARDINAL ~ VFonts.StringWidth[" Store "]; activeARow: CARDINAL ~ activeTitleRow + verticalHeight + smallVerticalSpacing; activeBRow: CARDINAL ~ activeARow + verticalHeight + smallVerticalSpacing; activeCRow: CARDINAL ~ activeBRow + verticalHeight + smallVerticalSpacing; activeDirRow: CARDINAL ~ activeCRow + verticalHeight + 2 * smallVerticalSpacing; activeFileRow: CARDINAL ~ activeDirRow + verticalHeight + smallVerticalSpacing; cellRow: CARDINAL ~ activeFileRow + verticalHeight + 2 * smallVerticalSpacing; bottomRow: CARDINAL ~ cellRow + verticalHeight + smallVerticalSpacing; theBottomLine: Rules.Rule; surfaceTool.activeState.surfaces _ NEW[ActiveSurfaceSequence[3]]; [] _ BuildLabel [activeTitle, surfaceTool.outer, activeTitleColumn, activeTitleRow, TRUE]; surfaceTool.activeState.surfaces[0].button _ BuildButton [surfaceTool, "A", activeLetterColumn, activeARow, BugA, TRUE, activeLetterButtonWidth]; surfaceTool.activeState.surfaces[1].button _ BuildButton [surfaceTool, "B", activeLetterColumn, activeBRow, BugB, TRUE, activeLetterButtonWidth]; surfaceTool.activeState.surfaces[2].button _ BuildButton [surfaceTool, "C", activeLetterColumn, activeCRow, BugC, TRUE, activeLetterButtonWidth]; surfaceTool.activeState.surfaces[0].viewer _ BuildTextViewer [surfaceTool.outer, activeNameColumn, activeARow, activeNameViewerWidth]; surfaceTool.activeState.surfaces[1].viewer _ BuildTextViewer [surfaceTool.outer, activeNameColumn, activeBRow, activeNameViewerWidth]; surfaceTool.activeState.surfaces[2].viewer _ BuildTextViewer [surfaceTool.outer, activeNameColumn, activeCRow, activeNameViewerWidth]; surfaceTool.activeState.surfaces[0].visibleLabel _ BuildLabel ["N", surfaceTool.outer, activeVisibleColumn, activeARow, FALSE]; surfaceTool.activeState.surfaces[1].visibleLabel _ BuildLabel ["N", surfaceTool.outer, activeVisibleColumn, activeBRow, FALSE]; surfaceTool.activeState.surfaces[2].visibleLabel _ BuildLabel ["N", surfaceTool.outer, activeVisibleColumn, activeCRow, FALSE]; [] _ BuildButton [surfaceTool, "Rename", activeFirstButtonColumn, activeARow, BugRename, TRUE, activeFirstButtonWidth]; [] _ BuildButton [surfaceTool, "Delete", activeFirstButtonColumn, activeBRow, BugDelete, TRUE, activeFirstButtonWidth]; [] _ BuildButton [surfaceTool, "Set color", activeFirstButtonColumn, activeCRow, BugSetColor, TRUE, activeFirstButtonWidth]; [] _ BuildButton [surfaceTool, "Name/Formula", activeSecondButtonColumn, activeARow, BugName, TRUE, activeSecondButtonWidth]; [] _ BuildButton [surfaceTool, "Show/Don't Show", activeSecondButtonColumn, activeBRow, BugShow, TRUE, activeSecondButtonWidth]; [] _ BuildButton [surfaceTool, "Get color", activeSecondButtonColumn, activeCRow, BugGetColor, TRUE, activeSecondButtonWidth]; [] _ BuildButton [surfaceTool, "Working dir:", activeIOLabelColumn, activeDirRow, BugDir, FALSE, activeIOLabelWidth]; [] _ BuildButton [surfaceTool, "File name:", activeIOLabelColumn, activeFileRow, BugFile, FALSE, activeIOLabelWidth]; surfaceTool.activeState.dir _ BuildTextViewer [surfaceTool.outer, activeIOViewerColumn, activeDirRow, activeIOViewerWidth]; surfaceTool.activeState.filename _ BuildTextViewer [surfaceTool.outer, activeIOViewerColumn, activeFileRow, activeIOViewerWidth]; ViewerTools.SetContents[surfaceTool.activeState.dir, UserProfile.Token["AlgebraicSurfaces.ActiveDir"]]; [] _ BuildButton [surfaceTool, "Load", activeIOButtonColumn, activeDirRow, BugLoadSurface, TRUE, activeIOButtonWidth]; [] _ BuildButton [surfaceTool, "Store", activeIOButtonColumn, activeFileRow, BugStore, TRUE, activeIOButtonWidth]; [] _ BuildLabel ["Cell Ops:", surfaceTool.outer, cellLabelColumn, cellRow, TRUE]; [] _ BuildButton [surfaceTool, "Hide All", cellFirstButtonColumn, cellRow, BugHideAll, TRUE]; [] _ BuildButton [surfaceTool, "Hide One", cellSecondButtonColumn, cellRow, BugHideOne, TRUE]; [] _ BuildButton [surfaceTool, "Reveal All", cellThirdButtonColumn, cellRow, BugRevealAll, TRUE]; [] _ BuildButton [surfaceTool, "Reveal One", cellFourthButtonColumn, cellRow, BugRevealOne, TRUE]; [] _ BuildButton [surfaceTool, "List All", cellFifthButtonColumn, cellRow, BugListAll, TRUE]; theBottomLine _ Rules.Create [[ wx: 0, wy: bottomRow, wh: 1, parent: surfaceTool.outer]]; Containers.ChildXBound[surfaceTool.outer, theBottomLine]; surfaceTool.height _ surfaceTool.height + bottomRow - baseY; END; BugA: Buttons.ButtonProc ~ BEGIN surfaceTool: SurfaceToolRef _ NARROW[clientData]; IF surfaceTool.activeState.surfaces[0].isLoaded THEN BEGIN surfaceTool.activeState.selectedSurface _ 0; ViewerTools.SetSelection[surfaceTool.activeState.surfaces[0].viewer]; RepaintLetterButtons[surfaceTool]; END; END; BugB: Buttons.ButtonProc ~ BEGIN surfaceTool: SurfaceToolRef _ NARROW[clientData]; IF surfaceTool.activeState.surfaces[1].isLoaded THEN BEGIN surfaceTool.activeState.selectedSurface _ 1; ViewerTools.SetSelection[surfaceTool.activeState.surfaces[1].viewer]; RepaintLetterButtons[surfaceTool]; END; END; BugC: Buttons.ButtonProc ~ BEGIN surfaceTool: SurfaceToolRef _ NARROW[clientData]; IF surfaceTool.activeState.surfaces[2].isLoaded THEN BEGIN surfaceTool.activeState.selectedSurface _ 2; ViewerTools.SetSelection[surfaceTool.activeState.surfaces[2].viewer]; RepaintLetterButtons[surfaceTool]; END; END; RepaintLetterButtons: PROC [surfaceTool: SurfaceToolRef] ~ BEGIN RepaintLetterButtonsError: ERROR = CODE; Buttons.SetDisplayStyle [surfaceTool.activeState.surfaces[0].button, $BlackOnWhite]; Buttons.SetDisplayStyle [surfaceTool.activeState.surfaces[1].button, $BlackOnWhite]; Buttons.SetDisplayStyle [surfaceTool.activeState.surfaces[2].button, $BlackOnWhite]; SELECT surfaceTool.activeState.selectedSurface FROM 0 => Buttons.SetDisplayStyle [surfaceTool.activeState.surfaces[0].button, $WhiteOnBlack]; 1 => Buttons.SetDisplayStyle [surfaceTool.activeState.surfaces[1].button, $WhiteOnBlack]; 2 => Buttons.SetDisplayStyle [surfaceTool.activeState.surfaces[2].button, $WhiteOnBlack]; ENDCASE => ERROR RepaintLetterButtonsError; END; RedrawEquationViewers: PROC [surfaceTool: SurfaceToolRef] ~ BEGIN FOR i: NAT IN [0..3) DO IF surfaceTool.activeState.surfaces[i].isLoaded THEN BEGIN ViewerTools.SetContents[surfaceTool.activeState.surfaces[i].viewer, MultiPolynomial.RopeFromRef[surfaceTool.activeState.surfaces[i].cad.surface]]; Labels.Set[ surfaceTool.activeState.surfaces[i].visibleLabel, IF surfaceTool.activeState.surfaces[i].isVisible THEN "Y" ELSE "N"]; END ELSE BEGIN ViewerTools.SetContents[surfaceTool.activeState.surfaces[i].viewer, ""]; Labels.Set[surfaceTool.activeState.surfaces[i].visibleLabel, "-"]; END; ENDLOOP; END; BugRename: Buttons.ButtonProc ~ BEGIN surfaceTool: SurfaceToolRef _ NARROW[clientData]; END; BugDelete: Buttons.ButtonProc ~ BEGIN surfaceTool: SurfaceToolRef _ NARROW[clientData]; selectedSurface: NAT _ surfaceTool.activeState.selectedSurface; IF surfaceTool.activeState.surfaces[selectedSurface].isLoaded THEN BEGIN SurfaceViewer.DeleteSurface[surfaceTool.activeState.surfaces[selectedSurface].surfaceID]; surfaceTool.activeState.surfaces[selectedSurface].isLoaded _ FALSE; RedrawEquationViewers[surfaceTool]; END; END; BugSetColor: Buttons.ButtonProc ~ BEGIN surfaceTool: SurfaceToolRef _ NARROW[clientData]; END; BugName: Buttons.ButtonProc ~ BEGIN surfaceTool: SurfaceToolRef _ NARROW[clientData]; END; BugShow: Buttons.ButtonProc ~ BEGIN surfaceTool: SurfaceToolRef _ NARROW[clientData]; selectedSurface: NAT _ surfaceTool.activeState.selectedSurface; IF surfaceTool.activeState.surfaces[selectedSurface].isLoaded THEN BEGIN IF surfaceTool.activeState.surfaces[selectedSurface].isVisible THEN BEGIN SurfaceViewer.HideSurface [surfaceTool.activeState.surfaces[selectedSurface].surfaceID]; surfaceTool.activeState.surfaces[selectedSurface].isVisible _ FALSE; END ELSE BEGIN SurfaceViewer.UnHideSurface [surfaceTool.activeState.surfaces[selectedSurface].surfaceID]; surfaceTool.activeState.surfaces[selectedSurface].isVisible _ TRUE; END; RedrawEquationViewers[surfaceTool]; MakeNewFrame[surfaceTool]; END; END; BugGetColor: Buttons.ButtonProc ~ BEGIN surfaceTool: SurfaceToolRef _ NARROW[clientData]; END; BugDir: Buttons.ButtonProc ~ BEGIN surfaceTool: SurfaceToolRef _ NARROW[clientData]; ViewerTools.SetSelection[surfaceTool.activeState.dir]; END; BugFile: Buttons.ButtonProc ~ BEGIN surfaceTool: SurfaceToolRef _ NARROW[clientData]; ViewerTools.SetSelection[surfaceTool.activeState.filename]; END; BugLoadSurface: Buttons.ButtonProc ~ BEGIN dir, file: Rope.ROPE; scad: CADTypes.Scad; id: NAT; slot: NAT; abort: BOOLEAN _ FALSE; surfaceTool: SurfaceToolRef _ NARROW[clientData]; IF surfaceTool.activeState.surfaces[0].isLoaded = FALSE THEN slot _ 0 ELSE IF surfaceTool.activeState.surfaces[1].isLoaded = FALSE THEN slot _ 1 ELSE IF surfaceTool.activeState.surfaces[2].isLoaded = FALSE THEN slot _ 2 ELSE {FlashMessage["No more slots available."]; RETURN}; dir _ ViewerTools.GetContents[surfaceTool.activeState.dir]; file _ ViewerTools.GetContents[surfaceTool.activeState.filename]; scad _ CADIO.ReadInfoFile[Rope.Concat[dir, file] ! CADIO.Error => {FlashMessage["Error in Info file."]; abort _ TRUE; CONTINUE} ]; IF abort THEN RETURN; id _ SurfaceViewer.LoadSurface[scad ! SurfaceViewer.Error => {FlashMessage["SurfaceViewer raised error."]; abort _ TRUE; CONTINUE} ]; IF abort THEN RETURN; surfaceTool.activeState.surfaces[slot].surfaceID _ id; surfaceTool.activeState.surfaces[slot].isLoaded _ TRUE; surfaceTool.activeState.surfaces[slot].cad _ scad; surfaceTool.activeState.surfaces[slot].isVisible _ TRUE; surfaceTool.activeState.surfaces[slot].mask _ NEW[CADTypes.VisibleMask[scad.cells.nCells]]; FOR i: NAT IN [0..scad.cells.nCells) DO surfaceTool.activeState.surfaces[slot].mask[i] _ TRUE; ENDLOOP; surfaceTool.activeState.selectedSurface _ slot; RepaintLetterButtons[surfaceTool]; RedrawEquationViewers[surfaceTool]; END; BugStore: Buttons.ButtonProc ~ BEGIN surfaceTool: SurfaceToolRef _ NARROW[clientData]; END; BugHideAll: Buttons.ButtonProc ~ BEGIN surfaceTool: SurfaceToolRef _ NARROW[clientData]; activeSurface: ActiveSurfaceRec _ surfaceTool.activeState.surfaces[surfaceTool.activeState.selectedSurface]; IF activeSurface.isLoaded = FALSE THEN BEGIN FlashMessage["No selected surface"]; RETURN; END; FOR i: NAT IN [0..activeSurface.mask.length) DO activeSurface.mask[i] _ FALSE; ENDLOOP; SurfaceViewer.MaskSurface[activeSurface.surfaceID, activeSurface.mask]; END; BugHideOne: Buttons.ButtonProc ~ BEGIN surfaceTool: SurfaceToolRef _ NARROW[clientData]; activeSurface: ActiveSurfaceRec _ surfaceTool.activeState.surfaces[surfaceTool.activeState.selectedSurface]; cellIndex: NAT; IF activeSurface.isLoaded = FALSE THEN BEGIN FlashMessage["No selected surface"]; RETURN; END; cellIndex _ CADIO.SelectCell[ activeSurface.cad, activeSurface.mask, "Select cell to hide"]; IF cellIndex # -1 THEN BEGIN activeSurface.mask[cellIndex] _ FALSE; SurfaceViewer.MaskSurface[activeSurface.surfaceID, activeSurface.mask]; END; END; BugRevealAll: Buttons.ButtonProc ~ BEGIN surfaceTool: SurfaceToolRef _ NARROW[clientData]; activeSurface: ActiveSurfaceRec _ surfaceTool.activeState.surfaces[surfaceTool.activeState.selectedSurface]; selection: INT; IF activeSurface.isLoaded = FALSE THEN BEGIN FlashMessage["No selected surface"]; RETURN; END; selection _ PopUpMenu.RequestSelection[ label: "Options for Reveal", choice: LIST [ "Reveal all cells", "Reveal all 0-cells", "Reveal all 1-cells", "Reveal all 2-cells" ] ]; FOR i: NAT IN [0..activeSurface.mask.length) DO SELECT selection FROM 1 => activeSurface.mask[i] _ TRUE; 2 => IF activeSurface.cad.cells[i].dimension = 0 THEN activeSurface.mask[i] _ TRUE; 3 => IF activeSurface.cad.cells[i].dimension = 1 THEN activeSurface.mask[i] _ TRUE; 4 => IF activeSurface.cad.cells[i].dimension = 2 THEN activeSurface.mask[i] _ TRUE; ENDCASE; ENDLOOP; SurfaceViewer.MaskSurface[activeSurface.surfaceID, activeSurface.mask]; END; BugRevealOne: Buttons.ButtonProc ~ BEGIN surfaceTool: SurfaceToolRef _ NARROW[clientData]; activeSurface: ActiveSurfaceRec _ surfaceTool.activeState.surfaces[surfaceTool.activeState.selectedSurface]; cellIndex: INT; IF activeSurface.isLoaded = FALSE THEN BEGIN FlashMessage["No selected surface"]; RETURN; END; cellIndex _ CADIO.SelectCell[ activeSurface.cad, activeSurface.mask, "Select cell to reveal"]; IF cellIndex # -1 THEN BEGIN activeSurface.mask[cellIndex] _ TRUE; END; SurfaceViewer.MaskSurface[activeSurface.surfaceID, activeSurface.mask]; END; BugListAll: Buttons.ButtonProc ~ BEGIN surfaceTool: SurfaceToolRef _ NARROW[clientData]; slot: NAT _ surfaceTool.activeState.selectedSurface; IF surfaceTool.activeState.surfaces[slot].isLoaded = FALSE THEN BEGIN FlashMessage["No selected surface"]; RETURN; END; [] _ CADIO.SelectCell[ surfaceTool.activeState.surfaces[slot].cad, surfaceTool.activeState.surfaces[slot].mask, "Cells"]; END; RayTracerState: TYPE ~ RECORD [ variableX: ViewerClasses.Viewer _ NIL, variableY: ViewerClasses.Viewer _ NIL, variableZ: ViewerClasses.Viewer _ NIL, widthInPixels: ViewerClasses.Viewer _ NIL, heightInPixels: ViewerClasses.Viewer _ NIL, dir: ViewerClasses.Viewer _ NIL, filename: ViewerClasses.Viewer _ NIL ]; BuildRayTracerSubviewer: PROC [surfaceTool: SurfaceToolRef] ~ BEGIN baseX: CARDINAL ~ 20; baseY: CARDINAL ~ surfaceTool.height; title: Rope.ROPE ~ "Ray Tracer"; titleRow: CARDINAL ~ baseY; titleColumn: CARDINAL ~ (toolWidth - VFonts.StringWidth[title])/2; leftLabelColumn: CARDINAL ~ baseX; varLabel: Rope.ROPE ~ "Variables: "; sizeLabel: Rope.ROPE ~ "Size: "; varViewerWidth: CARDINAL ~ VFonts.StringWidth[" Z "]; widthViewerWidth: CARDINAL ~ VFonts.StringWidth[" 256 "]; xViewerColumn: CARDINAL ~ leftLabelColumn + VFonts.StringWidth[varLabel]; yViewerColumn: CARDINAL ~ xViewerColumn + varViewerWidth; zViewerColumn: CARDINAL ~ yViewerColumn + varViewerWidth; widthViewerColumn: CARDINAL ~ leftLabelColumn + VFonts.StringWidth[varLabel]; byLabelColumn: CARDINAL ~ widthViewerColumn + widthViewerWidth; heightViewerColumn: CARDINAL ~ byLabelColumn + widthViewerWidth + smallHorizontalSpacing; rightLabelColumn: CARDINAL ~ toolWidth/2; rightLabelWidth: CARDINAL ~ VFonts.StringWidth["Filename: "]; rightViewerWidth: CARDINAL ~ (toolWidth/2) - rightLabelWidth; rightViewerColumn: CARDINAL ~ rightLabelColumn + rightLabelWidth + smallHorizontalSpacing; doItWidth: CARDINAL ~ VFonts.StringWidth[" Do It "]; doItColumn: CARDINAL ~ toolWidth - doItWidth - smallHorizontalSpacing; doItRow: CARDINAL ~ titleRow + smallVerticalSpacing; firstRow: CARDINAL ~ titleRow + verticalHeight + smallVerticalSpacing; secondRow: CARDINAL ~ firstRow + verticalHeight + smallVerticalSpacing; bottomRow: CARDINAL ~ secondRow + verticalHeight + smallVerticalSpacing; theBottomLine: Rules.Rule; [] _ BuildLabel [title, surfaceTool.outer, titleColumn, titleRow, TRUE]; [] _ BuildLabel [varLabel, surfaceTool.outer, leftLabelColumn, firstRow, FALSE]; [] _ BuildLabel [sizeLabel, surfaceTool.outer, leftLabelColumn, secondRow, FALSE]; surfaceTool.rayTracerState.variableX _ BuildTextViewer [surfaceTool.outer, xViewerColumn, firstRow, varViewerWidth]; surfaceTool.rayTracerState.variableY _ BuildTextViewer [surfaceTool.outer, yViewerColumn, firstRow, varViewerWidth]; surfaceTool.rayTracerState.variableZ _ BuildTextViewer [surfaceTool.outer, zViewerColumn, firstRow, varViewerWidth]; surfaceTool.rayTracerState.widthInPixels _ BuildTextViewer [surfaceTool.outer, widthViewerColumn, secondRow, widthViewerWidth]; [] _ BuildLabel ["by", surfaceTool.outer, byLabelColumn, secondRow, FALSE]; surfaceTool.rayTracerState.heightInPixels _ BuildTextViewer [surfaceTool.outer, heightViewerColumn, secondRow, widthViewerWidth]; [] _ BuildLabel ["Dir: ", surfaceTool.outer, rightLabelColumn, firstRow, FALSE]; [] _ BuildLabel ["Filename: ", surfaceTool.outer, rightLabelColumn, secondRow, FALSE]; surfaceTool.rayTracerState.dir _ BuildTextViewer [surfaceTool.outer, rightViewerColumn, firstRow, rightViewerWidth]; surfaceTool.rayTracerState.filename _ BuildTextViewer [surfaceTool.outer, rightViewerColumn, secondRow, rightViewerWidth]; [] _ BuildButton [surfaceTool, "Do It", doItColumn, doItRow, BugRayTrace, TRUE, doItWidth]; ViewerTools.SetContents[surfaceTool.rayTracerState.variableX, "x"]; ViewerTools.SetContents[surfaceTool.rayTracerState.variableY, "y"]; ViewerTools.SetContents[surfaceTool.rayTracerState.variableZ, "z"]; ViewerTools.SetContents[surfaceTool.rayTracerState.widthInPixels, "100"]; ViewerTools.SetContents[surfaceTool.rayTracerState.heightInPixels, "100"]; ViewerTools.SetContents[surfaceTool.rayTracerState.dir, UserProfile.Token["AlgebraicSurfaces.ImageDir"]]; theBottomLine _ Rules.Create [[ wx: 0, wy: bottomRow, wh: 1, parent: surfaceTool.outer]]; Containers.ChildXBound[surfaceTool.outer, theBottomLine]; surfaceTool.height _ surfaceTool.height + bottomRow - baseY; END; BugRayTrace: Buttons.ButtonProc ~ BEGIN surfaceTool: SurfaceToolRef _ NARROW[clientData]; varXRope: Rope.ROPE _ ViewerTools.GetContents[surfaceTool.rayTracerState.variableX]; varYRope: Rope.ROPE _ ViewerTools.GetContents[surfaceTool.rayTracerState.variableY]; varZRope: Rope.ROPE _ ViewerTools.GetContents[surfaceTool.rayTracerState.variableZ]; widthRope: Rope.ROPE _ ViewerTools.GetContents[surfaceTool.rayTracerState.widthInPixels]; heightRope: Rope.ROPE _ ViewerTools.GetContents[surfaceTool.rayTracerState.heightInPixels]; dir: Rope.ROPE _ ViewerTools.GetContents[surfaceTool.rayTracerState.dir]; filename: Rope.ROPE _ ViewerTools.GetContents[surfaceTool.rayTracerState.filename]; varX, varY, varZ: ATOM; width, height: CARDINAL; trouble: BOOLEAN _ FALSE; IF Rope.Length[varXRope] # 1 OR Rope.Length[varYRope] # 1 OR Rope.Length[varZRope] # 1 THEN trouble _ TRUE; varX _ Convert.AtomFromRope[varXRope ! Convert.Error => {trouble _ TRUE; CONTINUE}]; varY _ Convert.AtomFromRope[varYRope ! Convert.Error => {trouble _ TRUE; CONTINUE}]; varZ _ Convert.AtomFromRope[varZRope ! Convert.Error => {trouble _ TRUE; CONTINUE}]; width _ Convert.IntFromRope[widthRope ! Convert.Error => {trouble _ TRUE; CONTINUE}]; height _ Convert.IntFromRope[heightRope ! Convert.Error => {trouble _ TRUE; CONTINUE}]; IF width < 10 OR width > 255 OR height < 10 OR height > 255 THEN trouble _ TRUE; IF trouble THEN {FlashMessage["Bad parameters; try again."]; RETURN}; SurfaceViewer.InvokeRayTracer [ variables: [varX, varY, varZ], filename: Rope.Concat[dir, filename], pixelsU: height, pixelsV: width ]; END; BuildButton: PROC [surfaceTool: SurfaceToolRef, name: Rope.ROPE, column, row: CARDINAL, procedure: Buttons.ButtonProc, border: BOOLEAN, width: CARDINAL _ 0] RETURNS [button: Buttons.Button] ~ BEGIN IF width = 0 THEN button _ Buttons.Create[ info: [ name: name, wx: column, wy: row, wh: verticalHeight, parent: surfaceTool.outer, border: border], proc: procedure, clientData: surfaceTool] ELSE button _ Buttons.Create[ info: [ name: name, wx: column, wy: row, wh: verticalHeight, ww: width, parent: surfaceTool.outer, border: border], proc: procedure, clientData: surfaceTool] END; BuildDataLabel: PROC [parent: Containers.Container, column, row: CARDINAL] RETURNS [label: Labels.Label] ~ BEGIN label _ Labels.Create[[ name: "initializedwithanextremelylongishstring", wx: column, wy: row, wh: verticalHeight, ww: dataViewerWidth, parent: parent, border: FALSE]]; END; BuildLabel: PROC [text: Rope.ROPE, parent: Containers.Container, column, row: CARDINAL, bold: BOOLEAN _ FALSE] RETURNS [label: Labels.Label] ~ BEGIN fontFamily: Rope.ROPE = UserProfile.Token["DFTool.FontFamily", "Tioga"]; fontSize: NAT = UserProfile.Number["DFTool.FontSize", 10]; label _ Labels.Create[ info: [ name: text, wx: column, wy: row, wh: verticalHeight, parent: parent, border: FALSE], font: VFonts.EstablishFont[family: fontFamily, size: fontSize, bold: bold] ]; END; BuildTextViewer: PROC [parent: ViewerClasses.Viewer, column, row: CARDINAL, width: CARDINAL _ fileViewerWidth] RETURNS [ViewerClasses.Viewer] ~ BEGIN RETURN [ViewerTools.MakeNewTextViewer[info: [ parent: parent, wx: column, wy: row, wh: textViewerHeight, ww: width, border: FALSE, scrollable: TRUE]]]; END; RopeFromReal: PROC [from: REAL] RETURNS [result: Rope.ROPE] ~ BEGIN result _ IO.PutFR["%f", IO.real[from]]; END; GetRealSelection: PROC [oldValue: REAL] RETURNS [value: REAL] ~ BEGIN selection: Rope.ROPE _ ViewerTools.GetSelectionContents[]; valid: BOOLEAN _ TRUE; selectedValue: REAL; selectedValue _ Convert.RealFromRope[selection ! Convert.Error => {valid _ FALSE; CONTINUE}; ]; IF valid THEN value _ selectedValue ELSE value _ oldValue; END; LockButtons: PROC [surfaceTool: SurfaceToolRef] ~ BEGIN surfaceTool.buttonsLocked _ TRUE; END; UnlockButtons: PROC [surfaceTool: SurfaceToolRef] ~ BEGIN surfaceTool.buttonsLocked _ FALSE; END; FlashMessage: PROC [message: Rope.ROPE] ~ BEGIN MessageWindow.Append[message, TRUE]; MessageWindow.Blink[]; END; Commander.Register[key: "SurfaceTool", proc: MakeSurfaceTool]; END. ΘSurfaceToolImpl.mesa James Rauen, July 3, 1986 10:27:31 pm PDT July 14, 1986 5:20:47 pm PDT Type declarations Declarations Build the top menu Create the tool Add the subviewers Paint it SurfaceTool button procedures Updates everything in the SurfaceViewer context, then draws a frame. Window formatting constants Conversion subviewer Formatting constants. Declare the rules and buttons that will be built. Build the title. Build the labels. Build the buttons. Build the text viewers. Fill in their defaults from the user profile. Draw the bottom line and constrain it to be the width of the tool. Extend the tool's height. Conversion subviewer button procedures Position/Orientation subviewer Formatting constants. Declare the rules and buttons that will be built. Orientation subtitles Build the position title. Build the position buttons and labels. Fill in the numbers. Build the orientation title. [] _ BuildLabel [orientationTitle, surfaceTool.outer, orientationTitleColumn, orientationTitleRow, TRUE]; Build the Turn, Roll, and Dive labels and buttons. Build the forward orientation vector labels and buttons. Build the up orientation vector labels and buttons. Build the bottom row of buttons. Fill in the numbers. Draw the lines between the different orientation areas. Draw the horizontal lines and constrain them to be the width of the tool. Draw the bottom line and constrain it to be the width of the tool. Extend the tool's height. Update the x, y, and z data displays. Updates the orientation data displays. Rotation axis is side-to-side, perpendicular to both the forward and the up vectors. Rotation axis is side-to-side, perpendicular to both the forward and the up vectors. Active surfaces subviewer Formatting constants. Declare the rules and buttons that will be built. Instantiate the activeState. Build the title. Build the letter buttons. Build the name/equation viewers. Build the visible labels. Build some buttons. Build the directory and file buttons. Build the directory and file viewers. Build the load and store buttons. Build the cell operation labels and buttons. Draw the bottom line and constrain it to be the width of the tool. Extend the tool's height. Declarations Get a handle on the surface tool. Decide which slot to use. Read in the info file. Add it to the surface viewer context. Add it to the surface tool's active state. Ray tracer subviewer Formatting constants Declare the rules and buttons that will be built. Build the title. Build the left-hand labels and viewers. Build the right-hand labels and viewers. Build the Do It button. Fill in the defaults. Draw the bottom line and constrain it to be the width of the tool. Extend the tool's height. Get the contents of the various viewers. Convert them from ropes, flagging trouble if there is any. Generate the image. Useful constructors. Builds a button which, when bugged, calls procedure. The button is labeled with name. If border is TRUE, the button has a border. If width is defaulted, the button's width will be sized to fit it. Builds a label which will be used to display a real number. Initially, the label contains the string "initialized". Build a label which will be used to display text. ww: dataViewerWidth, Private conversion of real numbers into displayable ropes.. Converts whatever is selected into a real number. If converting the selection to a real causes an error, an error message is flashed in the message window and oldValue is returned. Other internal procedures. Κ'ή˜Icode˜K˜™K™)K™—K˜šΟk ˜ Kšœœ/˜˜>Kšœ˜K˜—š  œ˜%Kšœœ ˜1Kšœ=˜=Kšœ˜K˜—š  œ˜&Kšœœ ˜1Kšœ>˜>Kšœ˜K˜—š  œ˜'Kšœœ ˜1Kšœ?˜?Kšœ˜——˜š  œ˜&Kšœœ ˜1KšœœB˜VKšœœ@˜RKšœ œ?˜PKšœœ@˜RKšœœA˜TKšœœ#˜7Kšœœ"˜5Kšœ œ"˜1Kšœœ&˜@Kšœ˜Kšœ˜K˜———K™š‘™K™šœœœ˜K˜)Kšœ œ˜Kšœœ˜Kšœœ˜Kšœœ˜Kšœœ˜$K˜—šœœœ˜!K˜%K˜ Kšœœ˜"Kšœœ˜"Kšœœ˜"Kšœœ˜Kšœœ˜Kšœœ˜K˜—šœœœ˜ Kšœœ˜ Kšœœ˜ Kšœœ˜ K˜—š œœ!˜BK˜™Kšœœ˜Kšœœ˜%Kšœœ˜Kšœœ ˜!Kšœœ˜,Kšœœ˜4Kšœœ<˜YKšœœ?˜UKšœœ8˜OKšœœ9˜OKšœ œ8˜KKšœ œ5˜HKšœœ˜*Kšœœ˜*Kšœœ˜&Kšœœ˜.KšœœN˜kKšœœ˜.Kšœœ>˜[KšœœC˜^Kšœœ'˜CKšœœ(˜CKšœœ.˜IKšœœ˜-Kšœœ˜,Kšœœ˜1KšœœW˜wK˜Kšœœ˜6Kšœœ ˜?Kšœœ˜>Kšœœ8˜^K˜Kšœœ˜6Kšœ œ9˜aKšœ œN˜vKšœœM˜tKšœœr˜™K˜Kšœœ˜,Kšœœ:˜]KšœœI˜lKšœœH˜jKšœœi˜‹Kšœœ˜:K˜Kšœœ˜:K˜K˜?Kšœœ˜3Kšœœ/˜QKšœœ0˜QK˜—™1K˜5K˜—™Kšœœ˜1Kšœœ˜'K˜—™KšœZœ˜`K˜—™&KšœQœ˜iKšœRœ˜jKšœQœ˜iKšœSœ˜kKšœTœ˜lKšœSœ˜kKšœQœ˜jKšœRœ˜kKšœQœ˜jK˜lK˜mK˜lK˜—™K˜ K˜—™Kšœcœ™iK˜—™2Kšœˆœ˜KšœYœ˜_Kšœ[œ˜aKšœ‰œ˜‘KšœZœ˜`Kšœ\œ˜bKšœˆœ˜KšœTœ˜ZKšœUœ˜[K˜—™8Kšœv˜vKšœaœ˜zKšœbœ˜{Kšœaœ˜zK˜}K˜~K˜}K˜—™3Kšœl˜lKšœWœ˜pKšœXœ˜qKšœWœ˜pK˜sK˜tK˜sK˜—™ KšœYœ˜_Kšœ\œ˜bKšœ_œ˜eK˜—™K˜#K˜—™7˜K˜!K˜K˜K˜*K˜—˜K˜"K˜K˜K˜*K˜—K˜—™I˜ K˜K˜K˜K˜—K˜:—K™™D˜K˜K˜K˜K˜—K˜9K˜—™Kšœ<˜KšœœI˜cKšœœ$˜CKšœœE˜bKšœœ˜'KšœœJ˜kKšœœ%˜EKšœœM˜oKšœœ+˜LKšœœ˜-Kšœœ˜)Kšœœ&˜AKšœœ'˜FKšœœ-˜MKšœœ.˜MKšœœ-˜MKšœœ.˜MKšœœ(˜DKšœœE˜cKšœœ˜.KšœœG˜eKšœœ!˜>Kšœ œ:˜NKšœ œ6˜JKšœ œ6˜JKšœœ:˜PKšœœ8˜OKšœ œ=˜NKšœ œ3˜FK˜—™1K˜K˜—™Kšœ#œ˜A—K˜™KšœTœ˜ZK˜—™Kšœrœ˜‘Kšœrœ˜‘Kšœrœ˜‘K˜—™ Kšœ†˜†Kšœ†˜†Kšœ†˜†K˜—™Kšœxœ˜Kšœxœ˜Kšœxœ˜K˜—™KšœYœ˜wKšœYœ˜wKšœ^œ˜|Kšœ^œ˜}Kšœaœ˜€Kšœ_œ˜~K˜—™%KšœZœ˜uKšœZœ˜uK™—™%Kšœ{˜{šœ˜Kšœg˜g—K˜—™!Kšœ[œ˜vKšœWœ˜rK˜—™,KšœKœ˜QKšœWœ˜]KšœXœ˜^Kšœ[œ˜aKšœ\œ˜bKšœWœ˜]K˜—™D˜K˜K˜K˜K˜—K˜9K˜—™Kšœ<˜<—K˜šœ˜K˜——š œ˜ Kšœœ ˜1šœ.œ˜:Kšœ,˜,KšœE˜EK˜"Kšœ˜—Kšœ˜K˜—š œ˜ Kšœœ ˜1šœ.œ˜:Kšœ,˜,KšœE˜EK˜"Kšœ˜—Kšœ˜K˜—š œ˜ Kšœœ ˜1šœ.œ˜:Kšœ,˜,KšœE˜EK˜"Kšœ˜—Kšœ˜K˜—š œœ!˜@Kš œœœ˜(KšœT˜TKšœT˜TKšœT˜Tšœ)˜3KšœY˜YKšœY˜YKšœY˜YKšœœ˜+—Kšœ˜K˜—š œœ!˜Ašœœœ˜šœ.œ˜:Kšœ’˜’šœ ˜ Kšœ1˜1Kšœ/œœ˜D—Kš˜—šœ˜ KšœH˜HKšœB˜BKšœ˜—Kšœ˜—Kšœ˜K˜K˜—š  œ˜%Kšœœ ˜1Kšœ˜K˜—š  œ˜%Kšœœ ˜1Kšœœ+˜?šœ<œ˜HKšœY˜YKšœ=œ˜CKšœ#˜#Kšœ˜—Kšœ˜K˜—š  œ˜'Kšœœ ˜1Kšœ˜K˜—š œ˜#Kšœœ ˜1Kšœ˜K˜—š œ˜#Kšœœ ˜1Kšœœ+˜?šœ<œ˜Hšœ=œ˜IKšœX˜XKšœ>œ˜DKš˜—šœ˜ KšœZ˜ZKšœ>œ˜CKšœ˜—Kšœ#˜#Jšœ˜Kšœ˜—Kšœ˜K˜—š  œ˜'Kšœœ ˜1Kšœ˜K˜—š œ˜"Kšœœ ˜1Kšœ6˜6Kšœ˜K˜—š œ˜#Kšœœ ˜1Kšœ;˜;Kšœ˜K˜—š œ˜*K˜™ Kšœœ˜K˜Kšœœ˜Kšœœ˜ Kšœœœ˜K˜—™!Kšœœ ˜1K˜—™Kšœ0œœ ˜EKšœœ0œœ ˜JKšœœ0œœ ˜JKšœ,œ˜8K˜—™Kšœ;˜;KšœA˜Ašœœ$˜0Kšœœ8œœ˜NK˜—šœœœ˜K˜——™%šœ#˜#KšœOœœ˜^K˜—šœœœ˜K˜——™*Kšœ6˜6Kšœ2œ˜7Kšœ2˜2Kšœ3œ˜8Kšœ.œ*˜[šœœœ˜'Kšœ1œ˜6Kšœ˜—Kšœ/˜/K˜"J˜#K˜—Kšœ˜K˜—š œ˜$Kšœœ ˜1Kšœ˜K˜—š  œ˜&Kšœœ ˜1Kšœl˜lšœœœ˜,K˜$Kšœ˜Kšœ˜—šœœœ ˜/Kšœœ˜Kšœ˜—KšœG˜GKšœ˜K˜—š  œ˜&Kšœœ ˜1Kšœl˜lKšœ œ˜šœœœ˜,K˜$Kšœ˜Kšœ˜—šœ œ ˜Kšœ˜Kšœ˜K˜—šœœ˜Kšœ œ˜&KšœG˜GKšœ˜—Kšœ˜K˜—š  œ˜(Kšœœ ˜1Kšœl˜lKšœ œ˜šœœœ˜,K˜$Kšœ˜Kšœ˜—šœ'˜'K˜šœœ˜K˜K˜K˜K˜K˜—K˜—šœœœ ˜/šœ ˜Kšœœ˜"Kšœœ*œœ˜SKšœœ*œœ˜SKšœœ*œœ˜SKšœ˜—Kšœ˜—KšœG˜GKšœ˜K˜—š  œ˜(Kšœœ ˜1Kšœl˜lKšœ œ˜šœœœ˜,K˜$Kšœ˜Kšœ˜—šœ œ ˜Kšœ˜Kšœ˜K˜—šœœ˜Kšœ œ˜%Kšœ˜—KšœG˜GKšœ˜K˜—š  œ˜&Kšœœ ˜1Kšœœ+˜4šœ3œœ˜EK˜$Kšœ˜Kšœ˜—šœœ ˜Kšœ+˜+Kšœ,˜,K˜ —Kšœ˜K˜——K˜š‘™J™˜J˜&J˜&J˜&J˜*J˜+J˜ J˜$J˜J˜—š œœ!˜CJ˜™Kšœœ˜Kšœœ˜%Kšœ œ˜ Kšœ œ ˜Kšœ œ-˜BKšœœ ˜"Kšœœ˜$Kšœœ ˜ Kšœœ!˜9Kšœœ#˜=Kšœœ2˜IKšœœ"˜9Kšœœ"˜9Kšœœ2˜MKšœœ(˜?Kšœœ=˜YKšœœ˜)Kšœœ$˜=Kšœœ#˜=Kšœœ?˜ZKšœ œ!˜4Kšœ œ2˜FKšœ œ#˜4Kšœ œ4˜FKšœ œ4˜GKšœ œ5˜HJ™—™1K˜K˜—™KšœBœ˜HK˜—™'KšœIœ˜PKšœKœ˜RKšœt˜tKšœt˜tKšœt˜tKšœ˜KšœDœ˜KKšœ˜K˜—™(KšœIœ˜PKšœOœ˜VKšœt˜tKšœz˜zK˜—™KšœJœ ˜[K˜—™KšœC˜CKšœC˜CKšœC˜CKšœI˜IKšœJ˜JKšœi˜iK˜—™D˜K˜K˜K˜K˜—K˜9K˜—™Kšœ<˜<—K˜Kšœ˜K˜—š  œ˜'Kšœœ ˜1K˜K˜™(KšœœA˜TKšœœA˜TKšœœA˜TKšœœE˜YKšœœF˜[Kšœ œ;˜IKšœœ@˜SK˜—™:Kšœœ˜Kšœœ˜Kšœ œœ˜Kš œœœœ œ˜kšœ$˜$Kšœœœ˜/—šœ$˜$Kšœœœ˜/—šœ$˜$Kšœœœ˜/—šœ%˜%Kšœœœ˜/—šœ(˜(Kšœœœ˜/—Kš œ œ œ œœ œ˜PKšœ œ.œ˜EK˜—™˜Kšœ˜K˜%K˜K˜K˜—K˜—Kšœ˜K˜J™——J™š‘™K™š  œœ*œœ)œ œœ˜ΕKšœΗ™Ηšœ ˜˜šœ˜Kšœ ˜ Kšœ ˜ Kšœ˜Kšœ˜Kšœ˜Kšœ˜—K˜K˜——š˜˜šœ˜Kšœ ˜ Kšœ ˜ Kšœ˜Kšœ˜Kšœ ˜ Kšœ˜Kšœ˜—K˜K˜——Kšœ˜K˜—š  œœ-œœ˜pK™t˜K˜0K˜ K˜K˜K˜K˜Kšœœ˜—Kšœ˜K˜—š  œœ œ-œœœœ˜”K˜K™1Kšœœ3˜HKšœ œ-˜:˜˜K˜ K˜ K˜K˜K™K˜Kšœœ˜—K˜M—Kšœ˜K˜—š  œœ-œ œœ˜•šœ'˜-K˜K˜ K˜Kšœ˜Kšœ ˜ Kšœœ˜Kšœ œ˜—šœ˜K˜—K™—š   œœœœœ˜CK˜Kšœ;™;Kšœ œ œ ˜'Kšœ˜K˜—š  œœ œœ œ˜EK˜K™΅Kšœœ&˜:Kšœœœ˜Kšœœ˜šœ.˜.Kšœœœ˜-Kšœ˜—Kšœœœ˜:Kšœ˜K˜——J™š‘™J™š  œœ!˜7Jšœœ˜!Jšœ˜J˜—š  œœ!˜9Jšœœ˜"Jšœ˜J˜—š  œœœ˜/Jšœœ˜$J˜Jšœ˜——K˜K˜K˜˜>K˜—K˜K˜—Kšœ˜—…—Θ’ώH