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], Geometry3dMatrix USING [MakePureRotate, Matrix, Transform], Geometry3dVector USING [Add, Cross, Mul, Negate, Normalize, Ortho, Sub, Triple], Icons USING [IconFlavor], IO USING [real, PutFR], Labels USING [Create, Label, Set], Menus USING [AppendMenuEntry, CreateEntry, CreateMenu, Menu, MenuEntry, MenuProc, SetGuarded], MessageWindow USING [Append, Blink], MultiPolynomial USING [RopeFromRef], Rope USING [Concat, Length, ROPE], Rules USING [Create, Rule], SurfaceIcons USING [SurfaceToolIcon], SurfaceViewer, UserProfile USING [Number, Token], 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, Geometry3dMatrix, Menus, MessageWindow, MultiPolynomial, Rope, Rules, SurfaceIcons, SurfaceViewer, UserProfile, Geometry3dVector, 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: Geometry3dVector.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: Geometry3dVector.Triple _ [1, 0, 0], up: Geometry3dVector.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: Geometry3dVector.Triple _ surfaceTool.orientationState.up; rotationMatrix: Geometry3dMatrix.Matrix _ Geometry3dMatrix.MakePureRotate[axis, -15]; oldForward: Geometry3dVector.Triple _ surfaceTool.orientationState.forward; newForward: Geometry3dVector.Triple _ Geometry3dMatrix.Transform[oldForward, rotationMatrix]; surfaceTool.orientationState.forward _ newForward; UpdateOrientationData[surfaceTool]; END; BugTurnRight: Buttons.ButtonProc ~ BEGIN surfaceTool: SurfaceToolRef _ NARROW[clientData]; axis: Geometry3dVector.Triple _ surfaceTool.orientationState.up; rotationMatrix: Geometry3dMatrix.Matrix _ Geometry3dMatrix.MakePureRotate[axis, 15]; oldForward: Geometry3dVector.Triple _ surfaceTool.orientationState.forward; newForward: Geometry3dVector.Triple _ Geometry3dMatrix.Transform[oldForward, rotationMatrix]; surfaceTool.orientationState.forward _ newForward; UpdateOrientationData[surfaceTool]; END; BugRollLeft: Buttons.ButtonProc ~ BEGIN surfaceTool: SurfaceToolRef _ NARROW[clientData]; axis: Geometry3dVector.Triple _ surfaceTool.orientationState.forward; rotationMatrix: Geometry3dMatrix.Matrix _ Geometry3dMatrix.MakePureRotate[axis, 15]; oldUp: Geometry3dVector.Triple _ surfaceTool.orientationState.up; newUp: Geometry3dVector.Triple _ Geometry3dMatrix.Transform[oldUp, rotationMatrix]; surfaceTool.orientationState.up _ newUp; UpdateOrientationData[surfaceTool]; END; BugRollRight: Buttons.ButtonProc ~ BEGIN surfaceTool: SurfaceToolRef _ NARROW[clientData]; axis: Geometry3dVector.Triple _ surfaceTool.orientationState.forward; rotationMatrix: Geometry3dMatrix.Matrix _ Geometry3dMatrix.MakePureRotate[axis, -15]; oldUp: Geometry3dVector.Triple _ surfaceTool.orientationState.up; newUp: Geometry3dVector.Triple _ Geometry3dMatrix.Transform[oldUp, rotationMatrix]; surfaceTool.orientationState.up _ newUp; UpdateOrientationData[surfaceTool]; END; BugClimb: Buttons.ButtonProc ~ BEGIN surfaceTool: SurfaceToolRef _ NARROW[clientData]; axis: Geometry3dVector.Triple _ Geometry3dVector.Cross[surfaceTool.orientationState.forward, surfaceTool.orientationState.up]; rotationMatrix: Geometry3dMatrix.Matrix _ Geometry3dMatrix.MakePureRotate[axis, -15]; oldUp: Geometry3dVector.Triple _ surfaceTool.orientationState.up; oldForward: Geometry3dVector.Triple _ surfaceTool.orientationState.forward; newUp: Geometry3dVector.Triple _ Geometry3dMatrix.Transform[oldUp, rotationMatrix]; newForward: Geometry3dVector.Triple _ Geometry3dMatrix.Transform[oldForward, rotationMatrix]; surfaceTool.orientationState.up _ newUp; surfaceTool.orientationState.forward _ newForward; UpdateOrientationData[surfaceTool]; END; BugDive: Buttons.ButtonProc ~ BEGIN surfaceTool: SurfaceToolRef _ NARROW[clientData]; axis: Geometry3dVector.Triple _ Geometry3dVector.Cross[surfaceTool.orientationState.forward, surfaceTool.orientationState.up]; rotationMatrix: Geometry3dMatrix.Matrix _ Geometry3dMatrix.MakePureRotate[axis, 15]; oldUp: Geometry3dVector.Triple _ surfaceTool.orientationState.up; oldForward: Geometry3dVector.Triple _ surfaceTool.orientationState.forward; newUp: Geometry3dVector.Triple _ Geometry3dMatrix.Transform[oldUp, rotationMatrix]; newForward: Geometry3dVector.Triple _ Geometry3dMatrix.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 _ Geometry3dVector.Add[surfaceTool.positionState.position, surfaceTool.orientationState.forward]; UpdatePositionData[surfaceTool]; UpdateOrientationData[surfaceTool]; END; BugBackward: Buttons.ButtonProc ~ BEGIN surfaceTool: SurfaceToolRef _ NARROW[clientData]; surfaceTool.positionState.position _ Geometry3dVector.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 _ 0; SELECT selection FROM -1 => NULL; -- Timeout 0 => NULL; -- No selection 1 => -- Turn around surfaceTool.orientationState.forward _ Geometry3dVector.Mul[surfaceTool.orientationState.forward, -1]; 2 => { -- Go to originB surfaceTool.positionState.position _ [0, 0, 0]; }; 3 => { -- Look towards origin forward: Geometry3dVector.Triple _ Geometry3dVector.Negate[surfaceTool.positionState.position]; surfaceTool.orientationState.forward _ Geometry3dVector.Normalize[forward]; surfaceTool.orientationState.up _ Geometry3dVector.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 _ 1; 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 REPLACE THE CALLS TO POP-UP-MENU PopUpMenu USING [RequestSelection], 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. selection: INT _ PopUpMenu.RequestSelection[ label: "Fancy maneuvers", choice: options]; 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. selection _ PopUpMenu.RequestSelection[ label: "Options for Reveal", choice: LIST [ "Reveal all cells", "Reveal all 0-cells", "Reveal all 1-cells", "Reveal all 2-cells" ] ]; 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. Κ(w˜Icode˜K˜™K™)K™KšΟb ™ —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šœ1˜1Kšœ žœ˜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šœžœ˜"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šžœ˜—…—Ι +