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, RopeFromInt], 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], Real USING [InlineFix], Rope USING [Concat, Length, ROPE], Rules USING [Create, Rule], SurfaceIcons USING [SurfaceToolIcon], SurfaceViewer, ThreeDBasics USING [SetView], 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, Real, Rope, Rules, SurfaceIcons, SurfaceViewer, ThreeDBasics, UserProfile, Geometry3dVector, VFonts, ViewerOps, ViewerSpecs, ViewerTools ~ BEGIN SurfaceToolRef: TYPE ~ REF SurfaceToolRec; SurfaceToolRec: TYPE ~ RECORD [ outer: Containers.Container _ NIL, height: CARDINAL _ 0, buttonsLocked: BOOLEAN _ FALSE, sviewer: REF SurfaceViewer.SurfaceViewer, conversionState: ConversionState, positionAndOrientationState: PositionAndOrientationState, activeState: ActiveState, rayTracerState: RayTracerState]; MakeSurfaceTool: Commander.CommandProc ~ BEGIN surfaceTool: SurfaceToolRef _ NEW[SurfaceToolRec]; topMenu: Menus.Menu; openEntry, viewEntry, breakEntry: Menus.MenuEntry; topMenu _ Menus.CreateMenu[]; openEntry _ Menus.CreateEntry["Open", BugOpen, surfaceTool]; viewEntry _ Menus.CreateEntry["View", BugView, surfaceTool]; breakEntry _ Menus.CreateEntry["Break", BugBreak, surfaceTool]; Menus.AppendMenuEntry[topMenu, openEntry]; Menus.AppendMenuEntry[topMenu, viewEntry]; Menus.AppendMenuEntry[topMenu, breakEntry]; Menus.SetGuarded [openEntry, TRUE]; surfaceTool.outer _ Containers.Create[[ name: "Algebraic Surface Tool", icon: SurfaceIcons.SurfaceToolIcon[], iconic: TRUE, column: left, menu: topMenu, scrollable: FALSE]]; BuildPositionSubviewer[surfaceTool]; BuildActiveSubviewer[surfaceTool]; BuildRayTracerSubviewer[surfaceTool]; BuildConversionSubviewer[surfaceTool]; [] _ Rules.Create [[wx: 0, wy: 0, ww: 1, wh: surfaceTool.height, parent: surfaceTool.outer]]; [] _ Rules.Create [[wx: (toolWidth - 1), wy: 0, ww: 1, wh: surfaceTool.height, parent: surfaceTool.outer]]; ViewerOps.PaintViewer[surfaceTool.outer, all]; END; BugOpen: Menus.MenuProc ~ BEGIN surfaceTool: SurfaceToolRef _ NARROW[clientData]; surfaceTool.sviewer _ SurfaceViewer.CreateSurfaceViewer[]; MakeNewFrame[surfaceTool]; END; BugView: Menus.MenuProc ~ BEGIN surfaceTool: SurfaceToolRef _ NARROW[clientData]; MakeNewFrame[surfaceTool]; END; BugBreak: Menus.MenuProc ~ BEGIN surfaceTool: SurfaceToolRef _ NARROW[clientData]; SIGNAL SurfaceToolBreak; END; SurfaceToolBreak: SIGNAL = CODE; MakeNewFrame: PROC[surfaceTool: SurfaceToolRef] ~ BEGIN ThreeDBasics.SetView [ context: SurfaceViewer.GetThreeDContext[surfaceTool.sviewer], eyePoint: surfaceTool.positionAndOrientationState.position, ptOfInterest: Geometry3dVector.Add[surfaceTool.positionAndOrientationState.position, surfaceTool.positionAndOrientationState.forward], upDirection: surfaceTool.positionAndOrientationState.up]; SurfaceViewer.DrawFrame[surfaceTool.sviewer]; 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; verticalSpacingBetweenSubviewers: CARDINAL ~ 1; 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; PositionAndOrientationState: 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, forward: Geometry3dVector.Triple _ [1, 0, 0], up: Geometry3dVector.Triple _ [0, 0, 1], angularIncrement: REAL _ 15., forwardXLabel: Labels.Label _ NIL, forwardYLabel: Labels.Label _ NIL, forwardZLabel: Labels.Label _ NIL, upXLabel: Labels.Label _ NIL, upYLabel: Labels.Label _ NIL, upZLabel: Labels.Label _ NIL, angularIncrementLabel: Labels.Label _ NIL]; BuildPositionSubviewer: PROC [surfaceTool: SurfaceToolRef] ~ BEGIN baseX: CARDINAL ~ 20; baseY: CARDINAL ~ surfaceTool.height + verticalSpacingBetweenSubviewers; topRow: CARDINAL ~ baseY; subRow: CARDINAL ~ topRow + verticalHeight; -- + smallVerticalSpacing; firstDataRow: CARDINAL ~ subRow + smallVerticalSpacing; secondDataRow: CARDINAL ~ firstDataRow + verticalHeight + smallVerticalSpacing; thirdDataRow: CARDINAL ~ secondDataRow + verticalHeight + smallVerticalSpacing; fourthRow: CARDINAL ~ thirdDataRow + verticalHeight + smallVerticalSpacing; bottomRow: CARDINAL ~ fourthRow + verticalHeight + smallVerticalSpacing; plusColumn: CARDINAL ~ baseX; plusButtonWidth: CARDINAL ~ VFonts.StringWidth[" +X "]; forwButtonWidth: CARDINAL ~ VFonts.StringWidth[" Forw "]; minusColumn: CARDINAL ~ plusColumn + forwButtonWidth + smallHorizontalSpacing; minusButtonWidth: CARDINAL ~ VFonts.StringWidth[" -X "]; backButtonWidth: CARDINAL ~ VFonts.StringWidth[" Back "]; setColumn: CARDINAL ~ minusColumn + backButtonWidth + smallHorizontalSpacing; setButtonWidth: CARDINAL ~ VFonts.StringWidth[" Set S "]; xyzLabelColumn: CARDINAL ~ setColumn + setButtonWidth + smallHorizontalSpacing; xyzLabelWidth: CARDINAL ~ VFonts.StringWidth["Step:"]; dataViewerColumn: CARDINAL ~ xyzLabelColumn + xyzLabelWidth + smallHorizontalSpacing; breakLineColumn: CARDINAL ~ dataViewerColumn + dataViewerWidth + largeHorizontalSpacing; rotateOpsColumn: CARDINAL ~ breakLineColumn + largeHorizontalSpacing; rotateOpsWidth: CARDINAL ~ VFonts.StringWidth["Angle: "]; rotateLeftColumn: CARDINAL ~ rotateOpsColumn + rotateOpsWidth + smallHorizontalSpacing; rotateLeftWidth: CARDINAL ~ VFonts.StringWidth[" Left "]; rotateRightColumn: CARDINAL ~ rotateLeftColumn + dataViewerWidth + smallHorizontalSpacing; rotateRightWidth: CARDINAL ~ VFonts.StringWidth[" Down "]; orientationLabelColumn: CARDINAL ~ rotateRightColumn + rotateRightWidth + smallHorizontalSpacing; orientationLabelWidth: CARDINAL ~ VFonts.StringWidth["Fwd: "]; orientationXColumn: CARDINAL ~ orientationLabelColumn + orientationLabelWidth + smallHorizontalSpacing; orientationYColumn: CARDINAL ~ orientationXColumn + dataViewerWidth + smallHorizontalSpacing; orientationZColumn: CARDINAL ~ orientationYColumn + dataViewerWidth + smallHorizontalSpacing; positionTitle: Rope.ROPE ~ "Position"; positionTitleColumn: CARDINAL ~ (breakLineColumn - VFonts.StringWidth[positionTitle])/2; orientationTitle: Rope.ROPE ~ "Orientation"; orientationTitleColumn: CARDINAL ~ (toolWidth + breakLineColumn - VFonts.StringWidth[orientationTitle])/2; hrule1, hrule2, hrule3, hrule4: Rules.Rule; [] _ BuildLabel [positionTitle, surfaceTool.outer, positionTitleColumn, topRow, TRUE]; [] _ BuildLabel [orientationTitle, surfaceTool.outer, orientationTitleColumn, topRow, TRUE]; [] _ BuildButton [surfaceTool, "+X", plusColumn, firstDataRow, BugPlusX, TRUE, plusButtonWidth]; [] _ BuildButton [surfaceTool, "+Y", plusColumn, secondDataRow, BugPlusY, TRUE, plusButtonWidth]; [] _ BuildButton [surfaceTool, "+Z", plusColumn, thirdDataRow, BugPlusZ, TRUE, plusButtonWidth]; [] _ BuildButton [surfaceTool, "Forw", plusColumn, fourthRow, BugForward, TRUE, forwButtonWidth]; [] _ BuildButton [surfaceTool, "-X", minusColumn, firstDataRow, BugMinusX, TRUE, minusButtonWidth]; [] _ BuildButton [surfaceTool, "-Y", minusColumn, secondDataRow, BugMinusY, TRUE, minusButtonWidth]; [] _ BuildButton [surfaceTool, "-Z", minusColumn, thirdDataRow, BugMinusZ, TRUE, minusButtonWidth]; [] _ BuildButton [surfaceTool, "Back", minusColumn, fourthRow, BugBackward, TRUE, backButtonWidth]; [] _ BuildButton [surfaceTool, "Set X", setColumn, firstDataRow, BugNewX, TRUE, setButtonWidth]; [] _ BuildButton [surfaceTool, "Set Y", setColumn, secondDataRow, BugNewY, TRUE, setButtonWidth]; [] _ BuildButton [surfaceTool, "Set Z", setColumn, thirdDataRow, BugNewZ, TRUE, setButtonWidth]; [] _ BuildButton [surfaceTool, "Set S", setColumn, fourthRow, BugSetStep, TRUE, setButtonWidth]; [] _ BuildLabel ["x =", surfaceTool.outer, xyzLabelColumn, firstDataRow]; [] _ BuildLabel ["y =", surfaceTool.outer, xyzLabelColumn, secondDataRow]; [] _ BuildLabel ["z =", surfaceTool.outer, xyzLabelColumn, thirdDataRow]; [] _ BuildLabel ["Step:", surfaceTool.outer, xyzLabelColumn, fourthRow]; surfaceTool.positionAndOrientationState.xDataLabel _ BuildDataLabel [surfaceTool.outer, dataViewerColumn, firstDataRow]; surfaceTool.positionAndOrientationState.yDataLabel _ BuildDataLabel [surfaceTool.outer, dataViewerColumn, secondDataRow]; surfaceTool.positionAndOrientationState.zDataLabel _ BuildDataLabel [surfaceTool.outer, dataViewerColumn, thirdDataRow]; surfaceTool.positionAndOrientationState.incrementLabel _ BuildDataLabel [surfaceTool.outer, dataViewerColumn, fourthRow]; [] _ Labels.Create[[name: "Turn", wx: rotateOpsColumn, wy: firstDataRow, wh: verticalHeight, parent: surfaceTool.outer, border: FALSE]]; [] _ BuildButton[surfaceTool, "Left", rotateLeftColumn, firstDataRow, BugTurnLeft, TRUE, rotateLeftWidth]; [] _ BuildButton[surfaceTool, "Right", rotateRightColumn, firstDataRow, BugTurnRight, TRUE, rotateRightWidth]; [] _ Labels.Create[[name: "Roll", wx: rotateOpsColumn, wy: secondDataRow, wh: verticalHeight, parent: surfaceTool.outer, border: FALSE]]; [] _ BuildButton[surfaceTool, "Left", rotateLeftColumn, secondDataRow, BugRollLeft, TRUE, rotateLeftWidth]; [] _ BuildButton[surfaceTool, "Right", rotateRightColumn, secondDataRow, BugRollRight, TRUE, rotateRightWidth]; [] _ Labels.Create[[name: "Dive", wx: rotateOpsColumn, wy: thirdDataRow, wh: verticalHeight, parent: surfaceTool.outer, border: FALSE]]; [] _ BuildButton[surfaceTool, "Up", rotateLeftColumn, thirdDataRow, BugClimb, TRUE]; [] _ BuildButton[surfaceTool, "Down", rotateRightColumn, thirdDataRow, BugDive, TRUE, rotateRightWidth]; [] _ BuildLabel ["Angle:", surfaceTool.outer, rotateOpsColumn, fourthRow]; surfaceTool.positionAndOrientationState.angularIncrementLabel _ BuildDataLabel [surfaceTool.outer, rotateLeftColumn, fourthRow]; [] _ BuildButton [surfaceTool, "Set A", rotateRightColumn, fourthRow, BugSetAngularStep, TRUE, rotateRightWidth]; [] _ Labels.Create[[name: "Fwd:", wx: orientationLabelColumn, wy: firstDataRow, wh: verticalHeight, parent: surfaceTool.outer, border: FALSE]]; [] _ Labels.Create[[name: "Up:", wx: orientationLabelColumn, wy: secondDataRow, wh: verticalHeight, parent: surfaceTool.outer, border: FALSE]]; surfaceTool.positionAndOrientationState.forwardXLabel _ BuildDataLabel[surfaceTool.outer, orientationXColumn, firstDataRow]; surfaceTool.positionAndOrientationState.forwardYLabel _ BuildDataLabel[surfaceTool.outer, orientationYColumn, firstDataRow]; surfaceTool.positionAndOrientationState.forwardZLabel _ BuildDataLabel[surfaceTool.outer, orientationZColumn, firstDataRow]; surfaceTool.positionAndOrientationState.upXLabel _ BuildDataLabel[surfaceTool.outer, orientationXColumn, secondDataRow]; surfaceTool.positionAndOrientationState.upYLabel _ BuildDataLabel[surfaceTool.outer, orientationYColumn, secondDataRow]; surfaceTool.positionAndOrientationState.upZLabel _ BuildDataLabel[surfaceTool.outer, orientationZColumn, secondDataRow]; [] _ BuildButton[surfaceTool, "Fancy maneuvers", orientationXColumn, fourthRow, BugFancy, TRUE]; UpdatePositionAndOrientationData[surfaceTool]; [] _ Rules.Create [[wx: breakLineColumn, wy: subRow, ww: 1, wh: bottomRow - subRow, parent: surfaceTool.outer]]; hrule1 _ Rules.Create [[wx: 0, wy: topRow, wh: 1, parent: surfaceTool.outer]]; hrule2 _ Rules.Create [[wx: 0, wy: subRow, wh: 1, parent: surfaceTool.outer]]; hrule3 _ Rules.Create [[wx: 0, wy: bottomRow, wh: 1, parent: surfaceTool.outer]]; Containers.ChildXBound[surfaceTool.outer, hrule1]; Containers.ChildXBound[surfaceTool.outer, hrule2]; Containers.ChildXBound[surfaceTool.outer, hrule3]; [] _ Rules.Create [[wx: orientationLabelColumn, wy: thirdDataRow, ww: 1, wh: bottomRow - thirdDataRow, parent: surfaceTool.outer]]; hrule4 _ Rules.Create [[wx: orientationLabelColumn, wy: thirdDataRow, wh: 1, parent: surfaceTool.outer]]; Containers.ChildXBound[surfaceTool.outer, hrule4]; surfaceTool.height _ surfaceTool.height + bottomRow - baseY; END; UpdatePositionAndOrientationData: PROC[surfaceTool: SurfaceToolRef] ~ BEGIN Labels.Set[surfaceTool.positionAndOrientationState.xDataLabel, RopeFromReal[surfaceTool.positionAndOrientationState.position.x]]; Labels.Set[surfaceTool.positionAndOrientationState.yDataLabel, RopeFromReal[surfaceTool.positionAndOrientationState.position.y]]; Labels.Set[surfaceTool.positionAndOrientationState.zDataLabel, RopeFromReal[surfaceTool.positionAndOrientationState.position.z]]; Labels.Set[surfaceTool.positionAndOrientationState.incrementLabel, RopeFromReal[surfaceTool.positionAndOrientationState.increment]]; Labels.Set[surfaceTool.positionAndOrientationState.forwardXLabel, RopeFromReal[surfaceTool.positionAndOrientationState.forward.x]]; Labels.Set[surfaceTool.positionAndOrientationState.forwardYLabel, RopeFromReal[surfaceTool.positionAndOrientationState.forward.y]]; Labels.Set[surfaceTool.positionAndOrientationState.forwardZLabel, RopeFromReal[surfaceTool.positionAndOrientationState.forward.z]]; Labels.Set[surfaceTool.positionAndOrientationState.upXLabel, RopeFromReal[surfaceTool.positionAndOrientationState.up.x]]; Labels.Set[surfaceTool.positionAndOrientationState.upYLabel, RopeFromReal[surfaceTool.positionAndOrientationState.up.y]]; Labels.Set[surfaceTool.positionAndOrientationState.upZLabel, RopeFromReal[surfaceTool.positionAndOrientationState.up.z]]; Labels.Set[surfaceTool.positionAndOrientationState.angularIncrementLabel, Convert.RopeFromInt[Real.InlineFix[surfaceTool.positionAndOrientationState.angularIncrement]]]; END; BugPlusX: Buttons.ButtonProc ~ BEGIN surfaceTool: SurfaceToolRef _ NARROW[clientData]; surfaceTool.positionAndOrientationState.position.x _ surfaceTool.positionAndOrientationState.position.x + surfaceTool.positionAndOrientationState.increment; UpdatePositionAndOrientationData[surfaceTool]; END; BugPlusY: Buttons.ButtonProc ~ BEGIN surfaceTool: SurfaceToolRef _ NARROW[clientData]; surfaceTool.positionAndOrientationState.position.y _ surfaceTool.positionAndOrientationState.position.y + surfaceTool.positionAndOrientationState.increment; UpdatePositionAndOrientationData[surfaceTool]; END; BugPlusZ: Buttons.ButtonProc ~ BEGIN surfaceTool: SurfaceToolRef _ NARROW[clientData]; surfaceTool.positionAndOrientationState.position.z _ surfaceTool.positionAndOrientationState.position.z + surfaceTool.positionAndOrientationState.increment; UpdatePositionAndOrientationData[surfaceTool]; END; BugMinusX: Buttons.ButtonProc ~ BEGIN surfaceTool: SurfaceToolRef _ NARROW[clientData]; surfaceTool.positionAndOrientationState.position.x _ surfaceTool.positionAndOrientationState.position.x - surfaceTool.positionAndOrientationState.increment; UpdatePositionAndOrientationData[surfaceTool]; END; BugMinusY: Buttons.ButtonProc ~ BEGIN surfaceTool: SurfaceToolRef _ NARROW[clientData]; surfaceTool.positionAndOrientationState.position.y _ surfaceTool.positionAndOrientationState.position.y - surfaceTool.positionAndOrientationState.increment; UpdatePositionAndOrientationData[surfaceTool]; END; BugMinusZ: Buttons.ButtonProc ~ BEGIN surfaceTool: SurfaceToolRef _ NARROW[clientData]; surfaceTool.positionAndOrientationState.position.z _ surfaceTool.positionAndOrientationState.position.z - surfaceTool.positionAndOrientationState.increment; UpdatePositionAndOrientationData[surfaceTool]; END; BugNewX: Buttons.ButtonProc ~ BEGIN surfaceTool: SurfaceToolRef _ NARROW[clientData]; value: REAL _ GetRealSelection[surfaceTool.positionAndOrientationState.position.x]; surfaceTool.positionAndOrientationState.position.x _ value; UpdatePositionAndOrientationData[surfaceTool]; END; BugNewY: Buttons.ButtonProc ~ BEGIN surfaceTool: SurfaceToolRef _ NARROW[clientData]; value: REAL _ GetRealSelection[surfaceTool.positionAndOrientationState.position.y]; surfaceTool.positionAndOrientationState.position.y _ value; UpdatePositionAndOrientationData[surfaceTool]; END; BugNewZ: Buttons.ButtonProc ~ BEGIN surfaceTool: SurfaceToolRef _ NARROW[clientData]; value: REAL _ GetRealSelection[surfaceTool.positionAndOrientationState.position.z]; surfaceTool.positionAndOrientationState.position.z _ value; UpdatePositionAndOrientationData[surfaceTool]; END; BugSetStep: Buttons.ButtonProc ~ BEGIN surfaceTool: SurfaceToolRef _ NARROW[clientData]; value: REAL _ GetRealSelection[surfaceTool.positionAndOrientationState.increment]; surfaceTool.positionAndOrientationState.increment _ value; UpdatePositionAndOrientationData[surfaceTool]; END; BugTurnLeft: Buttons.ButtonProc ~ BEGIN surfaceTool: SurfaceToolRef _ NARROW[clientData]; axis: Geometry3dVector.Triple _ surfaceTool.positionAndOrientationState.up; rotationMatrix: Geometry3dMatrix.Matrix _ Geometry3dMatrix.MakePureRotate[axis, -(surfaceTool.positionAndOrientationState.angularIncrement)]; oldForward: Geometry3dVector.Triple _ surfaceTool.positionAndOrientationState.forward; newForward: Geometry3dVector.Triple _ Geometry3dMatrix.Transform[oldForward, rotationMatrix]; surfaceTool.positionAndOrientationState.forward _ newForward; UpdatePositionAndOrientationData[surfaceTool]; END; BugTurnRight: Buttons.ButtonProc ~ BEGIN surfaceTool: SurfaceToolRef _ NARROW[clientData]; axis: Geometry3dVector.Triple _ surfaceTool.positionAndOrientationState.up; rotationMatrix: Geometry3dMatrix.Matrix _ Geometry3dMatrix.MakePureRotate[axis, surfaceTool.positionAndOrientationState.angularIncrement]; oldForward: Geometry3dVector.Triple _ surfaceTool.positionAndOrientationState.forward; newForward: Geometry3dVector.Triple _ Geometry3dMatrix.Transform[oldForward, rotationMatrix]; surfaceTool.positionAndOrientationState.forward _ newForward; UpdatePositionAndOrientationData[surfaceTool]; END; BugRollLeft: Buttons.ButtonProc ~ BEGIN surfaceTool: SurfaceToolRef _ NARROW[clientData]; axis: Geometry3dVector.Triple _ surfaceTool.positionAndOrientationState.forward; rotationMatrix: Geometry3dMatrix.Matrix _ Geometry3dMatrix.MakePureRotate[axis, surfaceTool.positionAndOrientationState.angularIncrement]; oldUp: Geometry3dVector.Triple _ surfaceTool.positionAndOrientationState.up; newUp: Geometry3dVector.Triple _ Geometry3dMatrix.Transform[oldUp, rotationMatrix]; surfaceTool.positionAndOrientationState.up _ newUp; UpdatePositionAndOrientationData[surfaceTool]; END; BugRollRight: Buttons.ButtonProc ~ BEGIN surfaceTool: SurfaceToolRef _ NARROW[clientData]; axis: Geometry3dVector.Triple _ surfaceTool.positionAndOrientationState.forward; rotationMatrix: Geometry3dMatrix.Matrix _ Geometry3dMatrix.MakePureRotate[axis, -(surfaceTool.positionAndOrientationState.angularIncrement)]; oldUp: Geometry3dVector.Triple _ surfaceTool.positionAndOrientationState.up; newUp: Geometry3dVector.Triple _ Geometry3dMatrix.Transform[oldUp, rotationMatrix]; surfaceTool.positionAndOrientationState.up _ newUp; UpdatePositionAndOrientationData[surfaceTool]; END; BugClimb: Buttons.ButtonProc ~ BEGIN surfaceTool: SurfaceToolRef _ NARROW[clientData]; axis: Geometry3dVector.Triple _ Geometry3dVector.Cross[surfaceTool.positionAndOrientationState.forward, surfaceTool.positionAndOrientationState.up]; rotationMatrix: Geometry3dMatrix.Matrix _ Geometry3dMatrix.MakePureRotate[axis, -(surfaceTool.positionAndOrientationState.angularIncrement)]; oldUp: Geometry3dVector.Triple _ surfaceTool.positionAndOrientationState.up; oldForward: Geometry3dVector.Triple _ surfaceTool.positionAndOrientationState.forward; newUp: Geometry3dVector.Triple _ Geometry3dMatrix.Transform[oldUp, rotationMatrix]; newForward: Geometry3dVector.Triple _ Geometry3dMatrix.Transform[oldForward, rotationMatrix]; surfaceTool.positionAndOrientationState.up _ newUp; surfaceTool.positionAndOrientationState.forward _ newForward; UpdatePositionAndOrientationData[surfaceTool]; END; BugDive: Buttons.ButtonProc ~ BEGIN surfaceTool: SurfaceToolRef _ NARROW[clientData]; axis: Geometry3dVector.Triple _ Geometry3dVector.Cross[surfaceTool.positionAndOrientationState.forward, surfaceTool.positionAndOrientationState.up]; rotationMatrix: Geometry3dMatrix.Matrix _ Geometry3dMatrix.MakePureRotate[axis, surfaceTool.positionAndOrientationState.angularIncrement]; oldUp: Geometry3dVector.Triple _ surfaceTool.positionAndOrientationState.up; oldForward: Geometry3dVector.Triple _ surfaceTool.positionAndOrientationState.forward; newUp: Geometry3dVector.Triple _ Geometry3dMatrix.Transform[oldUp, rotationMatrix]; newForward: Geometry3dVector.Triple _ Geometry3dMatrix.Transform[oldForward, rotationMatrix]; surfaceTool.positionAndOrientationState.up _ newUp; surfaceTool.positionAndOrientationState.forward _ newForward; UpdatePositionAndOrientationData[surfaceTool]; END; BugSetAngularStep: Buttons.ButtonProc ~ BEGIN surfaceTool: SurfaceToolRef _ NARROW[clientData]; value: REAL _ GetRealSelection[surfaceTool.positionAndOrientationState.angularIncrement]; surfaceTool.positionAndOrientationState.angularIncrement _ value; UpdatePositionAndOrientationData[surfaceTool]; END; BugForward: Buttons.ButtonProc ~ BEGIN surfaceTool: SurfaceToolRef _ NARROW[clientData]; displacement: Geometry3dVector.Triple _ Geometry3dVector.Mul[surfaceTool.positionAndOrientationState.forward, surfaceTool.positionAndOrientationState.increment]; surfaceTool.positionAndOrientationState.position _ Geometry3dVector.Add[surfaceTool.positionAndOrientationState.position, displacement]; UpdatePositionAndOrientationData[surfaceTool]; END; BugBackward: Buttons.ButtonProc ~ BEGIN surfaceTool: SurfaceToolRef _ NARROW[clientData]; displacement: Geometry3dVector.Triple _ Geometry3dVector.Mul[surfaceTool.positionAndOrientationState.forward, surfaceTool.positionAndOrientationState.increment]; surfaceTool.positionAndOrientationState.position _ Geometry3dVector.Sub[surfaceTool.positionAndOrientationState.position, displacement]; UpdatePositionAndOrientationData[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.positionAndOrientationState.forward _ Geometry3dVector.Mul[surfaceTool.positionAndOrientationState.forward, -1]; 2 => { -- Go to originB surfaceTool.positionAndOrientationState.position _ [0, 0, 0]; }; 3 => { -- Look towards origin forward: Geometry3dVector.Triple _ Geometry3dVector.Negate[surfaceTool.positionAndOrientationState.position]; surfaceTool.positionAndOrientationState.forward _ Geometry3dVector.Normalize[forward]; surfaceTool.positionAndOrientationState.up _ Geometry3dVector.Ortho[forward, [1,0,0] ]; }; 4 => { -- Look toward origin from +x axis surfaceTool.positionAndOrientationState.position _ [10, 0, 0]; surfaceTool.positionAndOrientationState.forward _ [-1, 0, 0]; surfaceTool.positionAndOrientationState.up _ [0, 0, 1]; }; 5 => { -- Look toward origin from +y axis surfaceTool.positionAndOrientationState.position _ [0, 10, 0]; surfaceTool.positionAndOrientationState.forward _ [0, -1, 0]; surfaceTool.positionAndOrientationState.up _ [0, 0, 1]; }; 6 => { -- Look toward origin from +z axis surfaceTool.positionAndOrientationState.position _ [0, 0, 10]; surfaceTool.positionAndOrientationState.forward _ [0, 0, -1]; surfaceTool.positionAndOrientationState.up _ [0, 1, 0]; }; 7 => { -- Look toward origin from -x axis surfaceTool.positionAndOrientationState.position _ [-10, 0, 0]; surfaceTool.positionAndOrientationState.forward _ [1, 0, 0]; surfaceTool.positionAndOrientationState.up _ [0, 0, 1]; }; 8 => { -- Look toward origin from -y axis surfaceTool.positionAndOrientationState.position _ [0, -10, 0]; surfaceTool.positionAndOrientationState.forward _ [0, 1, 0]; surfaceTool.positionAndOrientationState.up _ [0, 0, 1]; }; 9 => { -- Look toward origin from -z axis surfaceTool.positionAndOrientationState.position _ [0, 0, -10]; surfaceTool.positionAndOrientationState.forward _ [0, 0, 1]; surfaceTool.positionAndOrientationState.up _ [0, 1, 0]; }; 10 => { -- Look in +x direction surfaceTool.positionAndOrientationState.forward _ [1, 0, 0]; surfaceTool.positionAndOrientationState.up _ [0, 0, 1]; }; 11 => { -- Look in +y direction surfaceTool.positionAndOrientationState.forward _ [0, 1, 0]; surfaceTool.positionAndOrientationState.up _ [0, 0, 1]; }; 12 => { -- Look in +z direction surfaceTool.positionAndOrientationState.forward _ [0, 0, 1]; surfaceTool.positionAndOrientationState.up _ [0, 1, 0]; }; ENDCASE => NULL; UpdatePositionAndOrientationData[surfaceTool]; UpdatePositionAndOrientationData[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 + verticalSpacingBetweenSubviewers; 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.sviewer]; 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.sviewer]; surfaceTool.activeState.surfaces[selectedSurface].isVisible _ FALSE; END ELSE BEGIN SurfaceViewer.UnHideSurface [surfaceTool.activeState.surfaces[selectedSurface].surfaceID, surfaceTool.sviewer]; 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, surfaceTool.sviewer ! 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, surfaceTool.sviewer]; 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, surfaceTool.sviewer]; 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, surfaceTool.sviewer]; 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, surfaceTool.sviewer]; 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, sviewer: surfaceTool.sviewer ]; 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 Add edges on the left and right -- so the viewer looks nice when turned into an IP file. 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 Position State Orientation State Formatting constants. Declare the rules that will be built. Build the title label. [] _ BuildLabel [title, surfaceTool.outer, titleColumn, topRow, TRUE]; Build the position buttons and labels. Build the Turn, Roll, and Dive labels and buttons. Build the angular increment button and label. Build the orientation vector labels and buttons. Build the Fancy Maneuvers button. Fill in the numbers. Draw the vertical rule. Draw the horizontal lines and constrain them to be the width of the tool. Draw the lower-right-hand-corner rules. Extend the tool's height. Update the position labels. Update the orientation labels. 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. Κ(¨˜Icode˜K˜™K™)K™KšΟb ™ —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šœ1˜1Kšœ žœ˜Kšœžœ˜Kšœžœ˜Kšœžœ˜Kšœžœ˜#—™Kšœ-˜-Kšœ(˜(Kšœžœ˜Kšœžœ˜"Kšœžœ˜"Kšœžœ˜"Kšœžœ˜Kšœžœ˜Kšœž˜Kšœ&žœ˜+—K˜—š œžœ!ž˜BK˜™Kšœžœ˜Kšœžœ9˜HKšœžœ ˜KšœžœΟc˜GKšœžœ!˜7Kšœžœ8˜OKšœžœ9˜OKšœ žœ8˜KKšœ žœ5˜HK˜Kšœ žœ ˜Kšœžœ˜7Kšœžœ ˜9Kšœ žœ9˜NKšœžœ˜8Kšœžœ ˜9Kšœ žœ:˜MKšœžœ!˜9Kšœžœ7˜OKšœžœ˜6Kšœžœ;˜UKšœžœ?˜XKšœžœ,˜EKšœžœ!˜9Kšœžœ=˜WKšœžœ ˜9Kšœžœ?˜ZKšœžœ ˜:KšœžœA˜aKšœžœ˜>KšœžœK˜gKšœžœA˜]KšœžœA˜]K˜Kšœžœ˜&Kšœžœ;˜XKšœžœ˜,KšœžœJ˜jK˜—™%K˜+K˜—™Kšœ@žœ™FKšœPžœ˜VKšœVžœ˜\K™—™&KšœIžœ˜`KšœJžœ˜aKšœIžœ˜`KšœJžœ˜aKšœKžœ˜cKšœLžœ˜dKšœKžœ˜cKšœLžœ˜cKšœJžœ˜`KšœKžœ˜aKšœJžœ˜`KšœJžœ˜`KšœI˜IKšœJ˜JKšœI˜IKšœH˜HKšœx˜xKšœy˜yKšœx˜xKšœy˜yK˜—™2Kšœ€žœ˜ˆKšœTžœ˜kKšœVžœ˜nKšœžœ˜‰KšœTžœ˜kKšœWžœ˜oKšœ€žœ˜ˆKšœNžœ˜TKšœPžœ˜hK˜—™-KšœJ˜JKšœ€˜€KšœYžœ˜qK™—™0Kšœ‡žœ˜Kšœ‡žœ˜Kšœ|˜|Kšœ|˜|Kšœ|˜|Kšœx˜xKšœx˜xKšœx˜xK™—™!KšœZžœ˜`K™—™Kšœ.˜.K™—™K˜pK˜—™KK˜NK˜NK˜QK˜2K˜2K˜2K˜—™'Kšœƒ˜ƒKšœi˜iKšœ2˜2K˜—™Kšœ<˜˜>Kšœ=˜=Kšœ7˜7K˜—šœ’"˜)Kšœ>˜>Kšœ=˜=Kšœ7˜7K˜—šœ’"˜)Kšœ>˜>Kšœ=˜=Kšœ7˜7K˜—šœ’"˜)Kšœ?˜?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šœn˜nKšœ=žœ˜CKšœ#˜#Kšžœ˜—Kšžœ˜K˜—š  œž˜'Kšœžœ ˜1Kšžœ˜K˜—š œž˜#Kšœžœ ˜1Kšžœ˜K˜—š œž˜#Kšœžœ ˜1Kšœžœ+˜?šžœ<žœž˜Hšžœ=žœž˜IKšœm˜mKšœ>žœ˜DKšž˜—šžœž˜ Kšœo˜oKšœ>žœ˜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˜——™%šœ8˜8Kšœ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šœ\˜\Kšžœ˜K˜—š  œž˜&Kšœžœ ˜1Kšœl˜lKšœ žœ˜šžœžœžœž˜,K˜$Kšžœ˜Kšžœ˜—šœ žœ ˜Kšœ˜Kšœ˜K˜—šžœžœž˜Kšœ žœ˜&Kšœ\˜\Kšžœ˜—Kšžœ˜K˜—š  œž˜(Kšœžœ ˜1Kšœl˜lKšœ žœ˜šžœžœžœž˜,K˜$Kšžœ˜Kšžœ˜—K˜šœ'™'K™šœžœ™K™K™K™K™K™—K™—šžœžœžœ ž˜/šžœ ž˜Kšœžœ˜"Kšœžœ*žœžœ˜SKšœžœ*žœžœ˜SKšœžœ*žœžœ˜SKšžœ˜—Kšžœ˜—Kšœ\˜\Kšžœ˜K˜—š  œž˜(Kšœžœ ˜1Kšœl˜lKšœ žœ˜šžœžœžœž˜,K˜$Kšžœ˜Kšžœ˜—šœ žœ ˜Kšœ˜Kšœ˜K˜—šžœžœž˜Kšœ žœ˜%Kšžœ˜—Kšœ\˜\Kšžœ˜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šžœ˜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šžœ˜—…—ΤΘ .