File: SVModelTypes.mesa
Created on July 29, 1984 2:14:29 pm PDT
Copyright © 1984 by Xerox Corporation. All rights reserved.
Last edited by Bier on August 1, 1985 0:18:34 am PDT
DIRECTORY
AIS,
Imager,
Rope,
SV2d,
SV3d;
SVModelTypes: DEFINITIONS =
BEGIN
Color: TYPE = Imager.Color;
Matrix3by3: TYPE = SV2d.Matrix3by3;
Matrix4by4: TYPE = SV3d.Matrix4by4;
Plane: TYPE = SV3d.Plane;
Point2d: TYPE = SV2d.Point2d;
Point3d: TYPE = SV3d.Point3d;
Polygon: TYPE = SV2d.Polygon;
Vector: TYPE = SV3d.Vector;
Coordinate Systems
CoordSystem2d: TYPE = REF CoordSystem2dObj;
CoordSystem2dObj:
TYPE =
RECORD [
mat: Matrix3by3,
localWRTPad: Matrix3by3,
padWRTLocal: Matrix3by3,
withRespectTo: CoordSystem2d];
CoordSystem: TYPE = REF CoordSysObj;
CoordSysObj:
TYPE =
RECORD [
name: Rope.ROPE,
scalarsOnly: BOOL,
scalars: Vector,
mat: Matrix4by4,
wrtCamera: Matrix4by4,
wrtWorld: Matrix4by4,
cameraWRTlocal: Matrix4by4,
worldWRTlocal: Matrix4by4,
parent: CoordSystem,
children: CoordSysList,
dirty: BOOL ← TRUE];
CoordSysList: TYPE = LIST OF CoordSystem;
Artwork Types
OMap: TYPE = {orthogonal, radial, tubeO};
SMap: TYPE = {unfoldedBox, tubeS};
Material: TYPE = {plastic, chalk}; -- remember to update MaterialToRope and RopeToMaterial if you change this list
ArtworkClass: TYPE = {justColor, simpleSurface, spaceFunction};
Artwork: TYPE = REF ArtworkObj;
ArtworkObj:
TYPE =
RECORD [
class: ArtworkClass,
coordSys: CoordSystem,
material: Material,
surface: REF ANY, -- an SVMappings.<REF surface>
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];
Mapping Types
PRect: TYPE = REF PRectObj;
PRectObj: TYPE = RECORD [xmin, ymin, xmax, ymax: REAL];
PDisk: TYPE = REF PDiskObj;
PDiskObj: TYPE = RECORD [r: REAL, origin: Point2d];
Tube: TYPE = REF TubeObj;
TubeObj: TYPE = RECORD [R: REAL, H: REAL, tubePoly: Polygon];
Disk: TYPE = REF DiskObj;
DiskObj: TYPE = RECORD [R: REAL, halfH: REAL];
Box: TYPE = REF BoxObj;
BoxObj: TYPE = RECORD [x, halfX, y, halfY, threeHalvesY, z, halfZ: REAL, faces: ARRAY [1..6] OF Polygon];
TubeLine: TYPE = REF TubeLineObj;
TubeLineObj:
TYPE =
RECORD [
p1, p2: Point2d];
(theta, h) pairs. Theta in degrees.
SpaceFunction: TYPE = REF SpaceFunctionObj;
SpaceFunctionObj: TYPE = RECORD [scalars: Point3d];
Shading Types
LightSourceType: TYPE = {point, ambient};
LightSource: TYPE = REF LightSourceObj;
LightSourceObj:
TYPE =
RECORD [
name: Rope.ROPE,
position: Point3d ← [0,0,0], -- position in WORLD.
color: Color,
type: LightSourceType ← ambient];
LightSourceList: TYPE = LIST OF LightSource;
Bounding Volume Types
BoundHedron: TYPE = REF BoundHedronObj;
BoundHedronObj:
TYPE =
RECORD [
len: NAT,
seq: SEQUENCE maxVerts: NAT OF Point3d];
BoundBox: TYPE = REF BoundBoxObj;
BoundBoxObj:
TYPE =
RECORD [
minVert: Point3d, -- min x, y and z makes this lower-left-deep
maxVert: Point3d]; -- max x, y and z makes this upper-right-shallow
BoundSphere: TYPE = REF BoundSphereObj;
BoundSphereObj:
TYPE =
RECORD [
center: Point3d, -- in Camera coordinates
radius: REAL,
radiusSquared: REAL];
Camera Type
DrawStyle: TYPE = {wire, shaded, rayCast, normals}; -- if you change this, remember to update DrawStyleToRope and RopeToDrawStyle in CSGGraphics.
Projection:
TYPE = {perspective, orthogonal};
If you change this, remember to update ProjectionToRope and RopeToProjection in CSGGraphics.
Camera: TYPE = REF CameraObj;
CameraObj:
TYPE =
RECORD [
viewName: Rope.ROPE,
coordSys: CoordSystem,
screenCS: CoordSystem,
resolution: REAL,
focalLength: REAL,
projection: Projection,
frame: FrameBox,
clippingPlanes: LIST OF Plane,
visibleAssemblies: LIST OF Rope.ROPE,
style: DrawStyle,
colorFilm: BOOL,
quality: QualityMode,
abort: BOOL ← FALSE,
useBoundBoxes: BOOL ← TRUE,
useBoundSpheresForShadows: BOOL ← TRUE,
lastPoint: Point3d ← [0,0,0]];
QualityMode:
TYPE = {fast, quality};
FrameBox: TYPE = REF FrameBoxObj;
FrameBoxObj:
TYPE =
RECORD [
downLeft: Point2d,
upRight: Point2d,
fullScreen: BOOL]; -- these points are in CAMERA coordinates
END.