PiecewiseLinearGraph.mesa
Copyright Ó 1991 by Xerox Corporation. All rights reserved.
Spreitze, January 25, 1991 11:59 am PST
DIRECTORY ImagerBox, Vector2, ViewerClasses;
PiecewiseLinearGraph: CEDAR DEFINITIONS ~ {
VEC: TYPE ~ Vector2.VEC;
Box: TYPE ~ ImagerBox.Box;
Viewer: TYPE ~ ViewerClasses.Viewer;
Function: TYPE ~ RECORD [data: REF ANY, class: FunctionClass];
FunctionClass: TYPE ~ REF FunctionClassPrivate;
FunctionClassPrivate: TYPE ~ RECORD [
Mutable: PROC [Function] RETURNS [BOOL],
Bounds: PROC [Function] RETURNS [Box],
Scan: PROC [
fn: Function,
xmin, xmax: REAL,
exact: BOOL, --FALSE => only accurate enough for drawing
Consume: PROC [VEC] RETURNS [BOOL] --return TRUE to stop the Scan
] RETURNS [stopped: BOOL, at: VEC],
Enumerates, in order of increasing x, the joints in and bracketing the given interval.
Eval: PROC [fn: Function, x: REAL] RETURNS [REAL]
];
View: PROC [fn: Function, viewerInit: ViewerClasses.ViewerRec, paint: BOOLTRUE] RETURNS [Viewer];
plgMenu: READONLY ViewerClasses.Menu;
Interpolate: PROC [fn: Function, x: REAL] RETURNS [REAL];
A generic implementation of Eval.
}.