<<>> <> <> <> <> DIRECTORY G2dBasic, G2dVector, Imager, ImagerSample, IO, Rope, ViewerClasses; G2dContour: CEDAR DEFINITIONS IMPORTS Imager ~ BEGIN Error: ERROR [code: ATOM, reason: ROPE]; <> <> <> Contour: TYPE ~ REF ContourRep; ContourRep: TYPE ~ RECORD [ t: REAL ¬ 0.0, -- curve parameter, if known closed: BOOL ¬ FALSE, -- if true, last point connects to 1st circle: BOOL ¬ TRUE, -- if true, normals = points pairs: PairSequence ¬ NIL, -- 2d points on contour normals: PairSequence ¬ NIL, -- 2d normals of contour points percents: RealSequence ¬ NIL, -- % along contour for each point clientData: REF ¬ NIL ]; ContourSequence: TYPE ~ REF ContourSequenceRep; ContourSequenceRep: TYPE ~ RECORD [ length: CARDINAL ¬ 0, element: SEQUENCE maxLength: CARDINAL OF Contour ]; Span: TYPE ~ RECORD [y, x0, x1: INTEGER]; SpanSequence: TYPE ~ REF SpanSequenceRep; SpanSequenceRep: TYPE ~ RECORD [ length: CARDINAL ¬ 0, element: SEQUENCE maxLength: CARDINAL OF Span ]; RealIndex: TYPE ~ RECORD [n: NAT ¬ 0, alpha: REAL ¬ 0.0]; <> ROPE: TYPE ~ Rope.ROPE; STREAM: TYPE ~ IO.STREAM; Viewer: TYPE ~ ViewerClasses.Viewer; Context: TYPE ~ Imager.Context; SampleMap: TYPE ~ ImagerSample.SampleMap; Rectangle: TYPE ~ Imager.Rectangle; Color: TYPE ~ Imager.Color; Border: TYPE ~ G2dBasic.Border; Pair: TYPE ~ G2dBasic.Pair; -- RECORD [x, y: REAL] PairSequence: TYPE ~ G2dBasic.PairSequence; PairSequenceRep: TYPE ~ G2dBasic.PairSequenceRep; IntegerPair: TYPE ~ G2dBasic.IntegerPair; -- RECORD [x, y: INTEGER] IntegerPairSequence: TYPE ~ G2dBasic.IntegerPairSequence; IntegerPairSequenceRep: TYPE ~ G2dBasic.IntegerPairSequenceRep; NatPair: TYPE ~ G2dBasic.NatPair; -- RECORD [x, y: Nat] NatPairSequence: TYPE ~ G2dBasic.NatPairSequence; NatPairSequenceRep: TYPE ~ G2dBasic.NatPairSequenceRep; RealSequence: TYPE ~ G2dBasic.RealSequence; RealSequenceRep: TYPE ~ G2dBasic.RealSequenceRep; <> FromPairs: PROC [pairs: PairSequence, closed: BOOL ¬ FALSE, t: REAL ¬ 0.0] RETURNS [Contour]; <> FromIntegerPairs: PROC [ integerPairs: IntegerPairSequence, closed: BOOL ¬ FALSE, t: REAL ¬ 0.0] RETURNS [Contour]; <> <> IntegerPairsFromPairs: PROC [pairs: PairSequence] RETURNS [IntegerPairSequence]; <> <<>> PairsFromIntegerPairs: PROC [integerPairs: IntegerPairSequence] RETURNS [PairSequence]; <> <<>> ShiftPairs: PROC [pairs: PairSequence, shift: INTEGER]; <> <<>> Scale: PROC [contour: Contour, scale: Pair] RETURNS [Contour]; <> <<>> Offset: PROC [contour: Contour, offset: Pair] RETURNS [Contour]; <> <<>> Center: PROC [contour: Contour] RETURNS [Contour]; <> <<>> Orient: PROC [contour: Contour] RETURNS [Contour]; <> <> ContourOK: PUBLIC PROC [contour: Contour] RETURNS [BOOL]; <> <<>> MinMax: PROC [contour: Contour] RETURNS [min, max: Pair]; <> <<>> Centroid: PROC [contour: Contour] RETURNS [Pair]; <> <<>> Area: PROC [contour: Contour] RETURNS [REAL]; <> <> SmoothPairs: PROC [src: PairSequence, dst: PairSequence ¬ NIL] RETURNS [PairSequence]; <> <<>> Smooth: PROC [contour: Contour] RETURNS [Contour]; <> <<>> Thin: PROC [contour: Contour, epsilon: REAL ¬ 3.0] RETURNS [Contour]; <> <> ResampleNats: PROC [src: NatPairSequence, dstnum: NAT, dst: PairSequence ¬ NIL] RETURNS [PairSequence]; <> <> ResamplePairs: PROC [src: PairSequence, dstnum: NAT, dst: PairSequence ¬ NIL] RETURNS [PairSequence]; <> <> <<>> Interpolate: PROC [contour0, contour1: Contour, alpha: REAL] RETURNS [Contour]; <> <<>> Sample: PROC [contour: Contour, nPairs: INTEGER] RETURNS [Contour]; <> <<>> Similar: PROC [contour0, contour1: Contour] RETURNS [REAL]; < dissimilar, 1 => similar.>> <> InsideContour: PROC [p: Pair, pairs: PairSequence] RETURNS [Border]; <> <> CirclePairs: PROC [nPairs: INTEGER] RETURNS [PairSequence]; <> <<>> Circle: PROC [nPairs: INTEGER] RETURNS [Contour]; <> <> Normals: PROC [contour: Contour] RETURNS [PairSequence]; <> <> Percents: PROC [contour: Contour] RETURNS [RealSequence]; <> <<>> AtPercent: PROC [contour: Contour, percent: REAL] RETURNS [RealIndex]; <> PercentPair: PROC [contour: Contour, percent: REAL] RETURNS [Pair]; <> <<>> PercentNormal: PROC [contour: Contour, percent: REAL] RETURNS [Pair]; <> <> Spans: PROC [contour: Contour, rectangle: Rectangle] RETURNS [SpanSequence]; <> <<>> FillSpans: PROC [map: SampleMap, spans: SpanSequence, color: CARDINAL]; <> <> Fill: PROC [context: Context, contour: Contour, color: Color ¬ Imager.black]; <> <<>> Outline: PROC [context: Context, contour: Contour, color: Color ¬ Imager.black]; <> <<>> OutlineMap: PROC [map: SampleMap, contour: Contour, color: CARDINAL ¬ 0]; <> <<>> FillMap: PROC [map: SampleMap, contour: Contour, color: CARDINAL]; <> <> Copy: PROC [contour: Contour] RETURNS [Contour]; <> <<>> CopySequence: PROC [contour: ContourSequence] RETURNS [ContourSequence]; <> <> Paint: PUBLIC PROC [contour: Contour, context: Context, paintNormals: BOOL ¬ FALSE]; <> <> Write: PROC [stream: STREAM, contour: Contour]; <> <<>> Read: PROC [stream: STREAM] RETURNS [Contour]; <> <<>> END.