File: SVSceneTypes.mesa
Created July 29, 1984 3:52:37 pm PDT
Copyright © 1984 by Xerox Corporation. All rights reserved.
Last edited by Bier on July 31, 1985 10:24:04 pm PDT
DIRECTORY
Imager,
IO,
Rope,
SV2d,
SV3d,
SVModelTypes,
SVRayTypes;
SVSceneTypes: DEFINITIONS =
BEGIN
Artwork: TYPE = SVModelTypes.Artwork;
BoundHedron: TYPE = SVModelTypes.BoundHedron;
Camera: TYPE = SVModelTypes.Camera;
Color: TYPE = Imager.Color;
CoordSystem: TYPE = SVModelTypes.CoordSystem;
FrameBox: TYPE = SVModelTypes.FrameBox;
LightSourceList: TYPE = SVModelTypes.LightSourceList;
Plane: TYPE = SV3d.Plane;
Point3d: TYPE = SV3d.Point3d;
PointSetOp: TYPE = SVRayTypes.PointSetOp;
PolyDatabase: TYPE = SV3d.PolyDatabase;
Primitive: TYPE = SVRayTypes.Primitive;
Projection: TYPE = SVModelTypes.Projection;
Vector: TYPE = SV3d.Vector;
Database: TYPE = REF DatabaseObj;
DatabaseObj: TYPE = RECORD [
scenes: LIST OF Scene];
Scene: TYPE = REF SceneObj;
SceneObj: TYPE = RECORD [
name: Rope.ROPE,
coordSysRoot: CoordSystem, -- WORLD coordinates
lightSources: LightSourceList,
masterObjects: MasterObjectList,
assembly: Assembly,
cameras: FileCameraList,
cameraOrder: LIST OF Rope.ROPE,
backgroundColor: Color,
shadows: BOOL,
dirty: BOOL];
The assembly mentioned above is known throughout the system as "sceneAssembly". Translation, scaling and rotation of this assembly effects the entire scene.
Assembly: TYPE = REF AssemblyObj;
AssemblyObj: TYPE = RECORD [
name: Rope.ROPE,
coordSys: CoordSystem,
artwork: Artwork,
showAs: ShowAsType ← normal,
isTool: BOOLFALSE,
toolMasterObject: MasterObject ← NIL,
shape: REF ANY, -- a Shape or an assembly list
sittingOn: Rope.ROPENIL -- If this assembly is sitting on the surface of another assembly, this is a way to record whose surface it is sitting on.
];
ShowAsType: TYPE = {invisible, normal, tool, both};
Shape: TYPE = REF ShapeObj;
ShapeObj: TYPE = RECORD [
coordSys: CoordSystem,
mo: MasterObject];
ToolData: TYPE = REF ToolDataObj;
ToolDataObj: TYPE = RECORD [
block: FrameBlock,
infinite: BOOL,
plane: NAT,
clientData: REF ANY -- currently used for Slice objects
];
FrameBlock: TYPE = REF FrameBlockObj;
FrameBlockObj: TYPE = RECORD [
loX, hiX, loY, hiY, loZ, hiZ: REAL];
AssemblyList: TYPE = REF AssemblyListObj;
AssemblyListObj: TYPE = RECORD [
 list: LIST OF Assembly,
 pointSetOp: PointSetOp];
FileCamera: TYPE = REF FileCameraObj;
FileCameraObj: TYPE = RECORD [
name: Rope.ROPE,
origin: Point3d,
focusPoint: Point3d,
slant: REAL, -- the slant of the camera counter-clockwise from horizontal in degrees.
resolution: REAL,
focalLength: REAL,
projection: Projection,
frame: FrameBox,
clippingPlanes: LIST OF Plane,
visibleAssemblies: LIST OF Rope.ROPE];
FileCameraList: TYPE = LIST OF FileCamera;
Master Object Class Types
MasterObjectClass: TYPE = REF MasterObjectClassObj;
MasterObjectClassObj: TYPE = RECORD [
name: Rope.ROPE,
filein: FileinProc,
fileout: FileoutProc,
fileoutPoly: FileoutPolyProc,
rayCast: RayCastProc,
rayCastNoBBoxes: RayCastNoBBoxesProc,
rayCastBoundingSpheres: RayCastBoundingSpheresProc,
getHedron: BoundHedronProc,
preprocess: PreprocessProc,
lineDraw: LineDrawProc,
normalsDraw: NormalsDrawProc,
countSurf: CountPlanarSurfacesProc,
getSurf: GetPlanarSurfacesProc,
drawSurf: DrawPlanarSurfaceProc,
drawSubBoxes: DrawSubBoxesProc,
drawSubSpheres: DrawSubSpheresProc];
MasterObjectClassList: TYPE = LIST OF MasterObjectClass;
Master Object Types
MasterObject: TYPE = REF MasterObjectRec;
MasterObjectRec: TYPE = RECORD [
name: Rope.ROPE,
class: MasterObjectClass,
mainBody: REF ANYNIL, -- information independent of imaging style
lineBody: REF ANY,
shadeBody: REF ANY,
rayCastBody: REF ANY
];
MasterObjectList: TYPE = LIST OF MasterObject;
FileoutProc: TYPE = PROC [f: IO.STREAM, mo: MasterObject];
FileinProc: TYPE = PROC [f: IO.STREAM, name: Rope.ROPE] RETURNS [mo: MasterObject];
FileoutPolyProc: TYPE = PROC [f: IO.STREAM, mo: MasterObject];
RayCastProc: TYPE = SVRayTypes.RayCastProc;
RayCastNoBBoxesProc: TYPE = SVRayTypes.RayCastNoBBoxesProc;
RayCastBoundingSpheresProc: TYPE = SVRayTypes.RayCastBoundingSpheresProc;
BoundHedronProc: TYPE = PROC [mo: MasterObject] RETURNS [hedron: BoundHedron];
PreprocessProc: TYPE = PROC [prim: Primitive, camera: Camera];
LineDrawProc: TYPE = PROC[dc: Imager.Context, data: REF ANY, camera: Camera, localCS: CoordSystem];
NormalsDrawProc: TYPE = PROC[dc: Imager.Context, data: REF ANY, camera: Camera, localCS: CoordSystem];
CountPlanarSurfacesProc: TYPE = PROC [masterObject: MasterObject] RETURNS [len: NAT];
GetPlanarSurfacesProc: TYPE = PROC [assembly: Assembly, camera: CoordSystem] RETURNS [PlanarSurfaceList];
PlanarSurface: TYPE = REF PlanarSurfaceObj;
PlanarSurfaceObj: TYPE = RECORD [
whichSurface: REF ANY,
each object type will have its own way of describing its surfaces
assembly: Assembly,
mo: MasterObject,
normal: Vector,
depth: REAL]; -- in camera coords which the master object calculates (for now)
The normal is a surface normal given in local coordinates by each assembly. It is converted to camera coordinates before it is passed back to master object class code for drawing.
PlanarSurfaceList: TYPE = LIST OF PlanarSurface;
DrawPlanarSurfaceProc: TYPE = PROC [dc: Imager.Context, ps: PlanarSurface, lightSources: LightSourceList, camera: Camera];
DrawSubBoxesProc: TYPE = PROC [dc: Imager.Context, prim: Primitive, screenCS: CoordSystem];
DrawSubSpheresProc: TYPE = PROC [dc: Imager.Context, prim: Primitive, camera: Camera];
END.