File: SVArtwork.mesa
Author: Eric Bier on December 22, 1982 1:58 am
Copyright © 1984 by Xerox Corporation. All rights reserved.
Last edited by Bier on July 31, 1985 11:40:35 pm PDT
Contents: Procedures for mapping from simple surfaces to arbitrary surfaces and back again
DIRECTORY
AIS,
Imager,
IO,
Matrix3d,
Rope,
SV2d,
SV3d,
SVMatrix2d,
SVModelTypes;
SVArtwork: DEFINITIONS
IMPORTS SVMatrix2d =
BEGIN
Artwork: TYPE = SVModelTypes.Artwork;
Color: TYPE = Imager.Color;
CoordSystem2d: TYPE = SVModelTypes.CoordSystem2d;
CoordSystem: TYPE = SVModelTypes.CoordSystem;
Material: TYPE = SVModelTypes.Material;
Matrix3by3: TYPE = SV2d.Matrix3by3;
OMap: TYPE = SVModelTypes.OMap;
SMap: TYPE = SVModelTypes.SMap;
Point2d: TYPE = SV2d.Point2d;
Point3d: TYPE = SV3d.Point3d;
Vector: TYPE = SV3d.Vector;
CreateFileArtwork: PROC [coordSys: CoordSystem, 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];
mat is the 2d transform matrix between the pad and the ais file.
FileNotFound: ERROR;
Create3DArtwork: PROC [coordSys: CoordSystem, material: Material, data: REF ANY] RETURNS [artwork: Artwork];
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];
FindColorAtSpacePoint: PROC [artwork: Artwork, point3d: Point3d, normal: Vector] RETURNS [color: Color];
DrawArtwork: PROC [dc: Imager.Context, artwork: Artwork, origin: Point2d, scalar: REAL];
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.
MaterialToRope: PROC [material: Material] RETURNS [materialName: Rope.ROPE];
ie returns "plastic" given plastic, "chalk" given chalk
RopeToMaterial: PROC [materialName: Rope.ROPE] RETURNS [material: Material, success: BOOL];
Does the inverse of MaterialToRope.
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.