<> <> <> <> <> <> DIRECTORY Atom, CD, CDApplications, CDCallSpecific, CDViewer, CDExtras, CDInline, CDOps, CDProperties, CDSequencer, CornerStitching, FS, Graphics, GraphicsOps, List, Menus, IO, PDFileFormat, PDFileWriter, Process, Real, Rope, TerminalIO, VFonts, ViewerClasses, ViewerSpecs; CDColorVersatecImpl: CEDAR MONITOR IMPORTS Atom, CD, -- CDCallSpecific,-- CDViewer, CDInline, CDOps, CDProperties, CDSequencer, CornerStitching, IO, Menus, PDFileWriter, Process, Real, TerminalIO, VFonts EXPORTS = BEGIN Ink: TYPE = PDFileFormat.Toner; -- {black, cyan, magenta, yellow}; ColorLoad: TYPE = ARRAY Ink OF PDFileWriter.LoadReference; <<-- a color associated with a level is a collection of textures associated with inks>> TexVector: TYPE = ARRAY Ink OF CARDINAL; <<-- used to generate LoadReferences through indexes, there are four textures to a color >> <<>> whiteLoadRef: PDFileWriter.LoadReference _ LAST[PDFileWriter.LoadReference]; <<-- used to identify tiles without toner>> localFile: Rope.ROPE _ "///temp/plot0.pd"; versatec: PDFileFormat.DeviceCode _ last; -- ??? sRes, fRes: CARDINAL _ 200; -- pixels per inch pdState: PDFileWriter.PDState; pdx, pdy : CARDINAL _ 0; -- origin of band in pixel coords cdx, cdy, -- origin of band in chipndale coords xoffset, yoffset : INT _ 0; -- offset in transforming bet coord systems plotScale: REAL; -- scale factor between systems, is negative for y <> <<>> numStipples: CARDINAL = 27; <<-- number of stipple patterns defined by MakeLoadref >> texValue: REF ARRAY [0..100] OF PDFileWriter.LoadReference _ NEW[ARRAY [0..100] OF PDFileWriter.LoadReference] ; <<-- used to make sure that a given texture is only put into the load once>> ColorRef: TYPE = REF ColorLoad_NIL; maxScanLineWidth: CARDINAL = 8000; <> <<>> scanLineWidth: CARDINAL _ maxScanLineWidth; imageSSize: REAL _ 0; imageFSize: CARDINAL _ maxScanLineWidth; bandSSize: CARDINAL _ 64; debugging: BOOL _ FALSE; numBands, numRectangles: INT _ 0; PlotStateRef: TYPE = REF PlotState; PlotState: TYPE = RECORD [ text: REF CornerStitching.Tesselation _ NIL, tes: ARRAY CD.Level OF REF CornerStitching.Tesselation _ ALL[NIL], -- enumerates all the rectangles in a given level scale: REAL _ 1.0, -- pixels per CD.DesignNumber totalPlotClip, bandClip: CD.DesignRect _ [0,0,0,0], <> colorLoads: REF ARRAY CD.Level OF ColorRef ]; currentFlavor: ViewerClasses.ViewerFlavor = $ChipndaleVersatecPlot; Init: ENTRY PROC ~ { menu: Menus.Menu = Menus.CreateMenu[]; Menus.AppendMenuEntry[menu: menu, entry: Menus.CreateEntry[name: "AbortPlot", proc: AbortProc, guarded: TRUE]]; CDSequencer.ImplementCommand[a~$VPlotLocal, p~PlotDesignToLocalFile]; <<>> CDSequencer.ImplementCommand[a~$VersatecColorPlot, p~PlotDesignToAny]; CDSequencer.ImplementCommand[a~$VPlot, p~PlotDesignToAny]; signalFont _ VFonts.GraphicsFont[VFonts.EstablishFont[family: "Helvetica", size: 18, bold: TRUE]]; TerminalIO.WriteRope["ChipNDale COLOR Versatec plotter loaded\n"]; }; NewPlotName: PROC [index: INTEGER] RETURNS [name: Rope.ROPE] = BEGIN name _ IO.PutFR[ "///temp/plot%d.pd", IO.int[index+1]]; END; PlotDesignToAny: ENTRY PROC [ c: CDSequencer.Command ] = BEGIN ENABLE UNWIND => NULL; n: CARDINAL _ 0; TerminalIO.WriteRope["Color plot\n"]; <<>> <> <> <> <<];>> <