DIRECTORY Imager USING [Context, Color], Cubic USING [Bezier], Complex USING [VEC], FitBasic USING [Handle, SampleHandle], IO USING [STREAM]; FitIO: CEDAR DEFINITIONS = { Handle: TYPE = FitBasic.Handle; Context: TYPE = REF ContextRec; ContextRec: TYPE = RECORD[ imager: Imager.Context, magnify: REAL, position: Complex.VEC, feedback: Feedback, logActions: BOOLEAN ¬ TRUE, log: IO.STREAM ]; Feedback: TYPE = REF FeedbackRec; FeedbackRec: TYPE=RECORD [ color: Imager.Color, sampleSize: REAL ¬ 1, jointSize: REAL ¬ 2, nodeLength: REAL ¬ 2, nodeLineWidth: REAL ¬ 0, lineWidth: REAL ¬ 0 --for DrawSamples and DrawContour ]; TTY: PROC[ctx: Context] RETURNS[IO.STREAM] = INLINE {RETURN[ctx.log]}; SetFeedback: PROC[ctx: Context, feedback: Feedback]; DrawSamples: PROC [ctx: Context, handle: Handle, all: BOOLEAN ¬ FALSE, fill: BOOLEAN ¬ FALSE]; MarkSamples: PROC [ctx: Context, handle: Handle, all: BOOLEAN ¬ FALSE]; MarkNodes: PROC [ctx: Context, handle: Handle, all: BOOLEAN ¬ FALSE]; MarkJoints: PROC [ctx: Context, handle: Handle, all: BOOLEAN ¬ FALSE]; --joints between the cubic pieces DrawContour: PROC [ctx: Context, handle: Handle, all: BOOLEAN ¬ FALSE, fill: BOOLEAN ¬ FALSE]; MarkNode: PROC[ctx: Context, s: FitBasic.SampleHandle]; MarkSample: PROC[ctx: Context, s: FitBasic.SampleHandle]; MarkJoint: PROC[ctx: Context, pt: Complex.VEC]; DrawCubic: PROC[ctx: Context, cubic: Cubic.Bezier]; NoLog: SIGNAL; StartLog: PROC [ctx: Context, stream: IO.STREAM ¬ NIL]; StopLog: PROC[ctx: Context, close: BOOLEAN ¬ TRUE]; MagnifyData: PROC[ctx: Context, scale: REAL] = INLINE {ctx.magnify ¬ scale}; PositionData: PROC[ctx: Context, trans: Complex.VEC] = INLINE {ctx.position ¬ trans}; MagnifyPoint: PROC [ctx: Context, p: Complex.VEC] RETURNS[Complex.VEC]; --magnify and position UnMagnifyPoint: PROC [ctx: Context, p: Complex.VEC] RETURNS[Complex.VEC]; --undo magnify and position }.  FitIO.mesa Copyright Σ 1985, 1992 by Xerox Corporation. All rights reserved. Maureen Stone November 29, 1984 10:59:45 am PST Doug Wyatt, September 5, 1985 1:56:13 pm PDT Marks: For samples and joints the mark is a dot For nodes the mark is a line normal to the tangent direction or an X if the tangent is (0,0) For sizes, 0 is as small as possible for current device Samples, Nodes and Contours: Samples are the list of input datapoints. Contours are the computed curves. The handle contains a list of Sample, Contour pairs. The all flag controls whether you want to apply the procedure to the current pair or all the pairs. Some samples are also marked as nodes, or potential knots for the spline fitting calculations Logs: Data is stored by logging the actions used to draw it. Format is suitable for driving JaM interface and includes the semantics of marks, not their feedback. SetFeedBack command is recorded. Magnify and Position apply to logs Procedures may automatically log actions treat samples as vertices of a polygon or a broken line procedures used by MarkSamples and MarkNodes procedure used by MarkJoints and DrawContour IF stream=NIL uses previous stream. Otherwise, closes previous stream (if any) and sets current output stream to stream. If there is no previous stream SIGNALS NoLog IF close=FALSE just disables logging. Views of the data: It may be interesting to view the data at a different size or position. However, transforming the Imager Context would affect the mark and linewidth sizes. For many cases the right thing to do is actually modify the data using the procedures in FitState. These are the procedures for when it is inconvenient to change the data. scales the view of the data but not the marks, linewidth or distance from data to the origin This is an absolute number with respect to the data. Reset the magnify by MagnifyData[1]; Positions the data with respect to the origin of the context. This is an absolute with respect to the Imager client coordinates. Reset by PositionData[0,0]; Κ€•NewlineDelimiter –(cedarcode) style™codešœ ™ Kšœ Οeœ6™BKšœ/™/K™,—K˜šΟk ˜ Kšœžœ˜Kšœžœ ˜Kšœžœžœ˜Kšœ žœ˜&Kšžœžœžœ˜—K˜KšΠblœžœ˜K˜Kšœžœ˜Kšœ ž œ ˜šœ žœžœ˜Kšœ˜Kšœ žœ˜Kšœžœ˜K˜Kšœ žœžœ˜Kšœžœž˜Kšœ˜K˜—Kšœ žœžœ ˜!šœ žœžœ˜K˜Kšœ žœ˜Kšœ žœ˜Kšœ žœ˜Kšœžœ˜Kšœ žœžΟc!˜5K˜K˜—KšΠbkœžœžœžœžœžœžœ ˜FK˜K™™K™(K™\Kš 7™7—™K™LK™™K™]—™K™6K™ͺK™—Kšœ(™(KšΟn œžœ#˜4š ’ œžœ%žœžœžœžœ˜^Kš 7™7—Kš’ œžœ%žœžœ˜GKš’ œžœ%žœžœ˜EKš ’ œžœ%žœžœ !˜hKš ’ œžœ%žœžœžœžœ˜^Kšœ,™,Kš’œžœ+˜9Kš’ œžœ)˜9Kšœ,™,Kš’ œžœžœ’˜/Kš’ œžœ$˜3Kšœžœ˜š ’œžœžœžœžœ˜7Kšžœžœœ™©—š’œžœžœžœ˜3K™%—K˜™K™Κ—š’ œžœžœžœ˜LKš \™\K™Z—š’ œžœžœžœ˜UKš =™=K™BK™—Kš ’ œžœžœžœ žœ ˜_Kš ’œžœžœžœ žœ ˜fKšž˜—…—d