-- September 14, 1982 4:38 pm -- JunoStorage.mesa, coded June 81 by Greg Nelson. -- Definitions of record types and types of allocation and deallocation procedures. DIRECTORY Rope, Graphics; JunoStorage: DEFINITIONS = BEGIN PointPtr: TYPE = REF Point; Point: TYPE = RECORD[ x: REAL _ 0, -- x and y are screen coordinates of point y: REAL _ 0, xheader: INTEGER _ 0, yheader: INTEGER _ 0, oldx: REAL _ 0, -- delx and dely are components of the oldy: REAL _ 0, -- gradient; used only by Newton's alg. moveHasBeenPlotted: BOOL _ FALSE, -- used at end of junosolverimplB fixed: BOOLEAN _ FALSE, -- p.fixed => p cannot be moved. tempfixed: BOOLEAN _ FALSE, visible: BOOLEAN _ TRUE, -- false for control points of strings -- command: PROCEDURE _ NIL, Non-NIL => point is command button. -- pen: REF TEXT, string to be plotted at this point wn: INTEGER _ 0, -- winding number; used only in TrackLoop copy: PointPtr _ NIL, -- used by CopyCmd. slink: PointPtr _ NIL, -- link for list of selectees. name: REF _ NIL, link: PointPtr]; -- link for list of all points SaveStateRec: TYPE = RECORD[ savePointLpad: PointPtr _ NIL, saveEdgeLpad: EdgePtr _ NIL, saveArcLpad: ArcPtr _ NIL, saveLineLpad: LinPtr _ NIL, saveCongLpad: CongPtr _ NIL, saveHorLpad: HorPtr _ NIL, saveVerLpad: VerPtr _ NIL, saveStringLpad: StringPtr _ NIL, saveCCLpad: CCPtr _ NIL]; EdgePtr: TYPE = REF Edge; Edge: TYPE = RECORD[ b1: PointPtr _ NIL, -- b1 and b2 are the endpoints of the edge. b2: PointPtr _ NIL, -- pen: REF TEXT, string to be plotted at each point of the edge. -- slink:EdgePtr _ NIL, link for list of selected edges. link: EdgePtr]; -- link for list of all edges ArcPtr: TYPE = REF Arc; Arc: TYPE = RECORD[ -- there is one Arc record for each spline b1: PointPtr _ NIL, -- It is a Bezier spline defined by the b2: PointPtr _ NIL, -- points b1, b2, b3, and b4. b3: PointPtr _ NIL, b4: PointPtr _ NIL, -- pen: REF TEXT, string to be plotted at each point of the arc. -- slink:ArcPtr _ NIL, link for list of selected arcs. link: ArcPtr]; -- link for list of all arcs. LinPtr: TYPE = REF LineConstraint; LineConstraint: TYPE = RECORD[ -- There is one LineConstraint record i: PointPtr _ NIL, -- for each collinearity constraint; the j: PointPtr _ NIL, -- record constrains points i, j, and k k: PointPtr _ NIL, -- to be collinear. l: PointPtr _ NIL, link: LinPtr]; -- link for list of all line constraints. CongPtr: TYPE = REF CongruenceConstraint; CongruenceConstraint: TYPE = RECORD[ -- A CongruenceConstraint record constrains i: PointPtr _ NIL, -- points i, j, k, and l to satisfy j: PointPtr _ NIL, -- Distance(i,j) = Distance(k,l). k: PointPtr _ NIL, l: PointPtr _ NIL, -- link for list of all CongruenceConstraints: link: CongPtr]; HorPtr: TYPE = REF HorizontalConstraint; HorizontalConstraint: TYPE = RECORD[ i: PointPtr _ NIL, j: PointPtr _ NIL, link: HorPtr]; VerPtr: TYPE = REF VerticalConstraint; VerticalConstraint: TYPE = RECORD[ i: PointPtr _ NIL, j: PointPtr _ NIL, link: VerPtr]; StringPtr: TYPE = REF String; String: TYPE = RECORD[ b3 : PointPtr _ NIL, b4 : PointPtr _ NIL, stringText : Rope.ROPE _ NIL, stringFont : Graphics.FontRef _ NIL, fontName: Rope.ROPE _ NIL, fontSize: INT _ 0, bold: BOOL _ FALSE, italic: BOOL _ FALSE, height, width, depth : REAL _ 0.0, link : StringPtr]; CCPtr: TYPE = REF CCConstraint; CCConstraint: TYPE = RECORD[i: PointPtr _ NIL, j:PointPtr _ NIL, k: PointPtr _ NIL, link: CCPtr]; HasDef: PUBLIC PROC [name: REF ANY, defList: LIST OF REF ANY] RETURNS [BOOL]; GetBody: PUBLIC PROC [name: REF ANY] RETURNS [REF ANY]; GetLocals: PUBLIC PROC [name: REF ANY] RETURNS [REF ANY]; AddDef: PUBLIC PROC [name, locals, body: REF ANY]; -- adds to lambdaAlist the definition of name lambdaAlist: PUBLIC LIST OF REF ANY; constructionList: PUBLIC LIST OF ApplyRecord; AddX: PUBLIC PROC [f: REF ANY, args:LIST OF PointPtr]; -- adds (f, args) to constructionList, which is a list of ApplyRecords ApplyRecord: TYPE = RECORD [f: REF ANY, args: LIST OF PointPtr]; Basis: TYPE = REF BasisRec; BasisRec: TYPE = RECORD[head:TangentVector _ NIL, tail:Basis]; TangentVector: TYPE = REF TvRec; TvRec: TYPE = RECORD[head:PointPtr _ NIL, x, y: REAL _ 0, tail:TangentVector]; PushState: PUBLIC PROCEDURE; PopState: PUBLIC PROCEDURE; NewPoint: PROCEDURE RETURNS [r: PointPtr]; GcPoint: PROCEDURE[p:PointPtr]; NewEdge: PROCEDURE RETURNS [r: EdgePtr]; GcEdge: PROCEDURE[p:EdgePtr]; NewArc: PROCEDURE RETURNS [r: ArcPtr]; GcArc: PROCEDURE[p:ArcPtr]; NewLine: PROCEDURE RETURNS [r: LinPtr]; GcLine: PROCEDURE[p:LinPtr]; NewString: PROCEDURE RETURNS [r: StringPtr]; GcString: PROCEDURE[p: StringPtr]; NewCong: PROCEDURE RETURNS [r: CongPtr]; GcCong: PROCEDURE[p:CongPtr]; NewHor: PROCEDURE RETURNS [r: HorPtr]; GcHor: PROCEDURE[p:HorPtr]; NewVer: PROCEDURE RETURNS [r: VerPtr]; GcVer: PROCEDURE[p:VerPtr]; NewCC: PROC RETURNS [r: CCPtr]; GcCC: PROC[p: CCPtr]; NewBasis: PROC RETURNS [Basis]; GcBasis: PROC[Basis]; NewTv: PROC RETURNS [TangentVector]; GcTv: PROC[TangentVector]; AddHor: PROC[a,b:PointPtr]; AddVer: PROC[a,b:PointPtr]; AddCong: PROC[a,b,c,d:PointPtr]; AddLin: PROC[a,b,c,d:PointPtr]; AddPoint: PROC [x,y:REAL] RETURNS [PointPtr]; FindPoint: PROC [x,y:REAL] RETURNS [PointPtr]; AddEdge: PROC[a,b:PointPtr]; AddArc: PROC[a,b,c,d:PointPtr]; AddString: PROC [c,d: PointPtr, h, w, dep : REAL, stringText: Rope.ROPE, stringFont: Graphics.FontRef, fontName: Rope.ROPE, fontSize: INT, bold, italic: BOOL]; AddCC: PROC [a, b, c: PointPtr]; InitJunoStorage: PROC; ResetJunoStorage: PROC; -- reclaims all records. pointLpad, pointRpad: PointPtr; -- The lists of points, edges, arcs edgeLpad, edgeRpad: EdgePtr; -- line constraints, and cong. constraints arcLpad, arcRpad: ArcPtr; -- are padded on both sides. lineLpad, lineRpad: LinPtr; congLpad, congRpad: CongPtr; stringLpad, stringRpad: StringPtr; horLpad, horRpad: HorPtr; verLpad, verRpad: VerPtr; ccLpad, ccRpad: CCPtr; END.