<<>> <> <> <> DIRECTORY CedarProcess, Commander, Controls, Draw2d, G2dBasic, Imager, Rope, ViewerClasses; G2dImplicitTool: CEDAR DEFINITIONS ~ BEGIN <> CommandProc: TYPE ~ Commander.CommandProc; ForkableProc: TYPE ~ CedarProcess.ForkableProc; Process: TYPE ~ CedarProcess.Process; ButtonList: TYPE ~ Controls.ButtonList; Control: TYPE ~ Controls.Control; ControlList: TYPE ~ Controls.ControlList; OuterData: TYPE ~ Controls.OuterData; Typescript: TYPE ~ Controls.Typescript; DrawProc: TYPE ~ Draw2d.DrawProc; Zip: TYPE ~ Draw2d.Zip; Pair: TYPE ~ G2dBasic.Pair; PairSequence: TYPE ~ G2dBasic.PairSequence; ROPE: TYPE ~ Rope.ROPE; Viewer: TYPE ~ ViewerClasses.Viewer; <> ValueProc: TYPE ~ PROC [point: Pair, clientData: REF ANY ¬ NIL] RETURNS [value: REAL ¬ 0.0]; << Return the value at point (> 0 inside, < 0 outside surface).>> <<>> StartProc: TYPE ~ PROC [clientData: REF ANY ¬ NIL, frame, nFrames: NAT ¬ 0]; Tool: TYPE ~ REF ToolRep; ToolRep: TYPE ~ RECORD [ <> graphics: Viewer ¬ NIL, -- the graphics viewer outerData: OuterData ¬ NIL, -- for buttons, controls typescript: Typescript ¬ NIL, -- user typescript buttons: ButtonList ¬ NIL, -- buttons ipStrokeWidth: REAL ¬ 0.0, process: Process ¬ NIL, -- current, forked process <> scale: Control ¬ NIL, -- display scale moveX: Control ¬ NIL, -- x translation moveY: Control ¬ NIL, -- y translation <> threshold: REAL ¬ 0.0, -- f'= f-threshold size: REAL ¬ 0.02, -- size of tracking square <> curve: PairSequence ¬ NIL, -- the curve <> startProc: StartProc ¬ NIL, -- to find start point valueProc: ValueProc ¬ NIL, -- to evaluate space <> zip: Zip ¬ NIL, -- draw accelerator displayClient: BOOL ¬ TRUE, -- shown client draw or not <> currentFrame: NAT ¬ 0, -- current frame of animation firstFrame: NAT ¬ 0, -- first frame of animation lastFrame: NAT ¬ 0, -- last frame of animation saveIP: ROPE ¬ NIL, animateIP: ROPE ¬ NIL, <> clientDraw: DrawProc ¬ NIL, -- client supplied drawProc clientData: REF ANY ¬ NIL -- client data ]; <> MakeTool: PROC [ name: ROPE, -- name of the tool valueProc: ValueProc, -- to evaluate implicit function extraButtons: ButtonList ¬ NIL, -- in addition to the standard set extraControls: ControlList ¬ NIL, -- in addition to the standard set clientData: REF ANY ¬ NIL, -- data for the client clientDraw: DrawProc ¬ NIL, -- to draw the client's object startProc: StartProc ¬ NIL, -- to initialize client, if necessary scale: REAL ¬ 1.0, -- initial display scale move: Pair ¬ [0.0, 0.0], -- initial display translation toolSettings: ToolRep ¬ []] -- initial tool settings RETURNS [Tool]; <> <> <> ToolBusy: PROC [tool: Tool] RETURNS [BOOL]; <> <<>> MaybeFork: PROC [tool: Tool, proc: ForkableProc] RETURNS [forked: BOOL]; <> <<>> Stop: PROC [tool: Tool, reason: ROPE ¬ NIL, waitTilAborted: BOOL ¬ FALSE]; <> <<>> Repaint: PROC [tool: Tool, whatChanged: REF ANY ¬ NIL]; <> <> Register: PROC [ name: ROPE, -- name of option command: CommandProc, -- proc to be called doc: ROPE]; -- documentation of option <> <">> ToolOptions: PROC RETURNS [toolOptions: ROPE]; <> ExecuteOption: CommandProc; <> <<>> END.