<> <> <> DIRECTORY Imager USING [Box, Rectangle, VEC], ImagerColor USING [RGB], Rope USING [ROPE], TiogaOps USING [Ref], ViewerClasses USING [Viewer]; Graph: CEDAR DEFINITIONS = { <> NumberOfColors: INT = 16; LastEntityColor: INT = 12; NumberOfFonts: INT = 12; NullBox: Imager.Box = [0.0, 0.0, 0.0, 0.0]; NullRect: Imager.Rectangle = [0.0, 0.0, 0.0, 0.0]; NullVec: Imager.VEC = [0.0, 0.0]; UnitLineWidth: REAL = 1.0; <> Viewer: TYPE = ViewerClasses.Viewer; ROPE: TYPE = Rope.ROPE; ColorIndex: TYPE = INT[0..NumberOfColors); EntityColor: TYPE = ColorIndex[1..LastEntityColor]; FontIndex: TYPE = INT[0..NumberOfFonts); GraphColors: TYPE = REF GraphColorsArray; GraphColorsArray: TYPE = ARRAY ColorIndex OF ImagerColor.RGB; GraphFonts: TYPE = REF GraphFontsArray; GraphFontsArray: TYPE = ARRAY FontIndex OF GraphFont; GraphFont: TYPE = RECORD[ family: ROPE _ NIL, bold, italic: BOOL _ FALSE, vFontSize: INT _ 12, pFontScale: REAL _ 13.0 ]; <<>> <> Texts: TYPE = LIST OF Text; Text: TYPE = REF TextRec; TextRec: TYPE = RECORD[ text: ROPE _ NIL, place: Imager.VEC _ [0.0, 0.0], -- location relative to origion and size of curvebox fontIndex: FontIndex _ 0, colorIndex: ColorIndex _ 0, rotation: REAL _ 0.0, -- angle of rotation, ccw, in degrees. justifX: JustifX _ left, justifY: JustifY _ bottom, id: INT _ 0 -- must be unique among all texts. ]; JustifX: TYPE = {left, center, right}; JustifY: TYPE = {top, center, bottom}; <> EntityList: TYPE = LIST OF Entity; Entity: TYPE = REF EntityRec; EntityRec: TYPE = RECORD[ name: ROPE _ NIL, colorIndex: ColorIndex _ 0, mark: Mark _ none, width: REAL _ UnitLineWidth, oldValues: ValueList _ NIL, group: EntityGroup _ NIL, parent: NestedEntities _ NIL, id: INT _ 0, -- id must be unique among entities. <<** following field are readonly for client>> segments: SegmentDataList _ NIL -- ** readonly for client. nil iff entity not plotted. ]; ValueList: TYPE = LIST OF REAL; Mark: TYPE = {none, round, square, diamond, cross, dollar, percent}; -- SegmentDataList: TYPE = LIST OF SegmentData; SegmentData: TYPE = REF SegmentDataRec; SegmentDataRec: TYPE = RECORD [end, nx, ny, d0: REAL _ 0.0]; <> <> <> <> EntityGroup: TYPE = REF EntityGroupRec; EntityGroupRec: TYPE = RECORD [ x: Entity _ NIL, -- x is not in ys or children. ys: NestedEntitiesList _ NIL, id, length: INT _ 0, <> <> node: TiogaOps.Ref _ NIL -- ** readonly for client. ]; NestedEntitiesList: TYPE = LIST OF NestedEntities; NestedEntities: TYPE = REF NestedEntitiesRec; NestedEntitiesRec: TYPE = RECORD[ name: ROPE _ NIL, entityList: EntityList _ NIL, parent: NestedEntities _ NIL, children: NestedEntitiesList _ NIL ]; <> GRAPH: TYPE = REF GraphRec; GraphRec: TYPE = RECORD [ entityList: EntityList _ NIL, fileName: ROPE _ NIL, -- suggested file name to save the graph. <> texts: Texts _ NIL, caret: ARRAY CaretIndex OF CaretSpec _ ALL[NIL], showSlope: BOOL _ FALSE, target: ARRAY XY OF TargetSpec _ ALL[NIL], grids: ARRAY XY OF BOOL _ ALL[FALSE], -- true: on. division: ARRAY XY OF INT _ ALL[0], bounds: Imager.Box _ NullBox, -- [xmin, ymin, xmax, ymax] auto: ARRAY AutoType OF BOOL _ ALL[TRUE], -- true: on. color: GraphColors, font: GraphFonts ]; CaretIndex: TYPE = {primary, secondary, text}; CaretSpec: TYPE = REF CaretSpecRec; CaretSpecRec: TYPE = RECORD[ place: Imager.VEC _ NullVec, on: BOOL _ FALSE ]; <> <> XY: TYPE = {x, y}; TargetSpec: TYPE = REF TargetSpecRec; TargetSpecRec: TYPE = RECORD[ value: REAL _ 0.0, width: REAL _ UnitLineWidth, colorIndex: ColorIndex _ 13, on: BOOL _ FALSE ]; AutoType: TYPE = {divisions, bounds}; <<>> <> Warning, Error: SIGNAL[atom: ATOM, info: ROPE _ NIL]; <<>> <> defaultColors: GraphColors; defaultFonts: GraphFonts; }. CHANGE LOG. SChen, created at October 9, 1985 5:50:27 pm PDT.