DIRECTORY AIS, Graphics, GraphicsColor, IO, Matrix3d, Rope, SV2d, SVCoordSys2d, SVMatrix2d, SVVector3d; SVArtwork: DEFINITIONS IMPORTS SVMatrix2d = BEGIN Color: TYPE = GraphicsColor.Color; CoordSystem2d: TYPE = SVCoordSys2d.CoordSystem2d; OMap: TYPE = {orthogonal, radial, tubeO}; SMap: TYPE = {unfoldedBox, tubeS}; Artwork: TYPE = REF ArtworkObj; ArtworkObj: TYPE = RECORD [ material: Material, surface: REF ANY, -- an SVMappings. oMap: OMap, -- the simple surface to object mapping sMap: SMap, -- the artwork to simple surface mapping source: Rope.ROPE, color: Color, isColorFile: BOOL, resolution: REAL, halfWidth, halfHeight: REAL,-- in inches halfWidthDots, halfHeightDots: REAL, -- in samples centerWRTLowerLeft: Point2d, -- in screen dots artWRTPad: CoordSystem2d, redfile: AIS.FRef, greenfile: AIS.FRef, bluefile: AIS.FRef, blackfile: AIS.FRef, redWindow: AIS.WRef, greenWindow: AIS.WRef, blueWindow: AIS.WRef, blackWindow: AIS.WRef, open: BOOL]; Material: TYPE = {plastic, chalk}; -- remember to update MaterialToRope and RopeToMaterial if you change this list Matrix3by3: TYPE = SVMatrix2d.Matrix3by3; Point2d: TYPE = SV2d.Point2d; Point3d: TYPE = Matrix3d.Point3d; Vector: TYPE = SVVector3d.Vector; CreateFileArtwork: PROC [material: Material, surface: REF ANY, oMap: OMap, sMap: SMap, filename: Rope.ROPE, isColor: BOOL, background: Color, resolution: REAL _ 72.0, mat: Matrix3by3 _ SVMatrix2d.Identity[]] RETURNS [artwork: Artwork]; FileNotFound: ERROR; CreateColorArtwork: PROC [color: Color, material: Material] RETURNS [artwork: Artwork]; Copy: PROC [artwork: Artwork] RETURNS [copy: Artwork]; OpenArtwork: PROC [artwork: Artwork]; CloseArtwork: PROC [artwork: Artwork]; FindImageColorAtPoint: PROC [artwork: Artwork, imagePoint: Point2d] RETURNS [color: Color]; FindColorAtSurfacePoint: PROC [artwork: Artwork, point3d: Point3d, normal: Vector] RETURNS [color: Color]; DrawArtwork: PROC [dc: Graphics.Context, artwork: Artwork, origin: Point2d, scalar: REAL]; MaterialToRope: PROC [material: Material] RETURNS [materialName: Rope.ROPE]; RopeToMaterial: PROC [materialName: Rope.ROPE] RETURNS [material: Material, success: BOOL]; OMapToRope: PROC [oMap: OMap] RETURNS [mapName: Rope.ROPE]; RopeToOMap: PROC [mapName: Rope.ROPE] RETURNS [oMap: OMap, success: BOOL]; SMapToRope: PROC [sMap: SMap] RETURNS [mapName: Rope.ROPE]; RopeToSMap: PROC [mapName: Rope.ROPE] RETURNS [sMap: SMap, success: BOOL]; END. 4File: SVArtwork.mesa Author: Eric Bier on December 22, 1982 1:58 am Last edited by Bier on July 6, 1983 4:05 pm Contents: Procedures for mapping from simple surfaces to arbitrary surfaces and back again mat is the 2d transform matrix between the pad and the ais file. origin is the origin of the pad in screen coordinates. The picture will be scaled by scalar about this origin Some convenience functions to aid user-readable representations and user interfaces. ie returns "plastic" given plastic, "chalk" given chalk Does the inverse of MaterialToRope. Κ˜Iheadšœ™Jšœ.™.Jšœ+™+JšœZ™ZJ˜šΟk ˜ Jšœ˜Jšœ ˜ Jšœ˜Jšœ˜Jšœ ˜ Jšœ˜Jšœ˜Jšœ ˜ Jšœ ˜ Jšœ ˜ —J˜Jšœ  ˜Jšœ ˜Jš˜˜Jšœœ˜"Jšœœ˜1J˜Jšœœ˜)Jšœœ˜"J˜Jšœ œœ ˜šœ œœ˜Jšœ˜Jšœ œœΟc˜0Jšœ ž'˜4Jšœ ž(˜5Jšœ œ˜Jšœ ˜ Jšœ œ˜Jšœ œ˜Jšœœž ˜(Jšœœž ˜2Jšœž˜/Jšœ˜Jšœ œ˜Jšœ œ˜Jšœ œ˜Jšœ œ˜Jšœ œ˜Jšœ œ˜Jšœ œ˜Jšœ œ˜Jšœœ˜ —J˜Jšœ œžO˜rJ˜Jšœ œ˜)Jšœ œ˜Jšœ œ˜!Jšœœ˜!J˜šΟnœœœœ)œ œ!œ2œ˜λJšœA™A—Jšœœ˜J˜JšŸœœ$œ˜WJšŸœœœ˜6J˜JšŸ œœ˜%JšŸ œœ˜&JšŸœœ)œ˜[JšŸœœ6œ˜jšŸ œœCœ˜ZJšœn™n—J˜JšœT™TJ˜šŸœœœœ˜LJšœ7™7—š Ÿœœœœœ˜[Jšœ#™#—JšŸ œœœœ˜;Jš Ÿ œœœœœ˜JJšŸ œœœœ˜;Jš Ÿ œœœœœ˜JJ˜—J˜Jšœ˜—…— ”X