File: SVInterfaceTypes.mesa
Last edited by: Eric Bier on August 5, 1985 1:17:15 pm PDT
Copyright © 1984 by Xerox Corporation. All rights reserved.
Contents: Defining these types in the modules which use them just doesn't seem to work. Compilation dependencies reign. Many objects wish to contain pointers to these records, which in turn wish to contain objects of that type. Let's try putting them all in one place.
DIRECTORY
BitMap3d,
Containers,
Imager,
ImagerFont,
Rope,
SV2d,
SV3d,
SVModelTypes,
SVRayTypes,
SVSceneTypes,
SVSlices,
ViewerClasses;
SVInterfaceTypes: DEFINITIONS =
BEGIN
Assembly: TYPE = SVSceneTypes.Assembly;
Camera: TYPE = SVModelTypes.Camera;
Color: TYPE = Imager.Color;
CoordSystem: TYPE = SVModelTypes.CoordSystem;
CSGTree: TYPE = SVRayTypes.CSGTree;
Matrix4by4: TYPE = SV3d.Matrix4by4;
Path: TYPE = SV2d.Path;
Point2d: TYPE = SV2d.Point2d;
Point3d: TYPE = SV3d.Point3d;
PointSetOp: TYPE = SVRayTypes.PointSetOp;
Primitive: TYPE = SVRayTypes.Primitive;
Scene: TYPE = SVSceneTypes.Scene;
Slice: TYPE = SVSlices.Slice;
Vector: TYPE = SV3d.Vector;
Viewer: TYPE = ViewerClasses.Viewer;
Solid Viewers
SolidContainer: TYPE = Viewer;
ViewerToolData:
TYPE =
REF ViewerToolDataObj;
Allocated in SVViewerImpl.CreateViewerTool
ViewerToolDataObj:
TYPE =
RECORD [
outer: SolidContainer ← NIL,
height: CARDINAL ← 0,
textSection: ViewerTextData,
viewerPicture: Viewer ← NIL,
editToolData: EditToolData,
yBounded: LIST OF Viewer ← NIL, -- used in SVViewerToolImpl for viewer resizing.
xBounded: LIST OF Viewer ← NIL,
proc: PROC [dc: Imager.Context],
scene: Scene, -- the collection of 3d objects we are looking at
tree: CSGTree, -- for efficiency we will occasional cache the (viewpoint dependent) ray tracing tree
treeOutOfDate: BOOL ← TRUE, -- the cached tree no longer represents this view accurately.
dragAssembly: Assembly ← NIL, -- The corresponding assembly (if any).
dragPlaneDepth: REAL, -- in Target coordinates
dragCameraVector: Vector,
dragTarget: Assembly ← NIL,
camera: Camera, -- our point of view
sceneStyleIndex: NAT, -- corresponds to camera.style
baseCS: CoordSystem, -- ****
mode: InteractionMode,
showCoordSys: BOOL,
doubleBuffer: BOOL,
altDC: BitMap3d.AlternateDisplayContext, -- for double buffering entire scenes
xorDC: BitMap3d.AlternateDisplayContext -- for buffering shapes to be xor'ed into a picture
];
ViewerTextData:
TYPE =
RECORD [
activateLabel: Viewer ← NIL,
viewStyle: Viewer ← NIL,
ais: Viewer ← NIL,
text: Viewer ← NIL,
xyz: Viewer ← NIL,
focalLength: Viewer ← NIL,
projection: Viewer ← NIL,
selected: Viewer ← NIL,
isSelected: BOOL
];
InteractionMode: TYPE = {select, cast};
DCProc: TYPE = PROC [Imager.Context];
The EditTool
EditToolData: TYPE = REF EditToolDataObj;
EditToolDataObj:
TYPE =
RECORD [
outer: Containers.Container ← NIL,
height: CARDINAL ← 0,
font: ImagerFont.Font,
sceneSection: CurrentSceneSectionData,
sphereSection: SphereSectionData,
blockSection: BlockSectionData,
cylinderSection: CylinderSectionData,
coneSection: ConeSectionData,
torusSection: TorusSectionData,
linSection: LinSectionData,
transformSection: TransformSectionData,
cameraSection: CameraSectionData,
cameraOrderSection: CameraOrderSectionData,
shadowSection: ShadowSectionData,
artworkSection: ArtworkSectionData,
artworkTransformSection: ArtworkTransformSectionData,
lightSection: LightSectionData,
utilitySection: UtilitySectionData,
scratchpad: Viewer,
artworkTool: Viewer,
messages: Viewer,
allViewers: LIST OF ViewerCell,
currentViewerToolData: ViewerToolData, -- to ward off compilation dependencies,
originalWorkingDirectory: Rope.ROPE
];
ViewerCell: TYPE = REF ViewerCellObj;
ViewerCellObj:
TYPE =
RECORD [
scene: Scene,
viewersOnScene: Viewer]; -- viewersOnScene is a list of viewers since each viewer has a link to the next one.
CurrentSceneSectionData:
TYPE =
RECORD [
defaultScene: Scene,
currentScene: Scene ← NIL,
sceneName: Viewer ← NIL,
current: Viewer ← NIL,
text1: Viewer ← NIL,
text2: Viewer ← NIL,
source: Viewer ← NIL,
target: Viewer ← NIL,
new: Viewer ← NIL,
parent: Viewer ← NIL,
plane: Viewer ← NIL,
opLabel: Viewer ← NIL,
op: PointSetOp];
SphereSectionData:
TYPE =
RECORD [
radius: Viewer ← NIL];
BlockSectionData:
TYPE =
RECORD [
xyz: Viewer ← NIL];
CylinderSectionData:
TYPE =
RECORD [
radius: Viewer ← NIL,
height: Viewer ← NIL];
ConeSectionData:
TYPE =
RECORD [
radius: Viewer ← NIL,
height: Viewer ← NIL];
TorusSectionData:
TYPE =
RECORD [
bigRadius: Viewer ← NIL,
sectionRadius: Viewer ← NIL];
LinSectionData:
TYPE =
RECORD [
depth: Viewer ← NIL];
TransformSectionData:
TYPE =
RECORD [
degrees: Viewer ← NIL,
transXYZ: Viewer ← NIL,
scaleXYZ: Viewer ← NIL,
scalar: Viewer ← NIL];
CameraSectionData:
TYPE =
RECORD [
name: Viewer ← NIL,
origin: Viewer ← NIL,
focusPoint: Viewer ← NIL,
slant: Viewer ← NIL,
resolution: Viewer ← NIL,
focalLength: Viewer ← NIL,
projection: Viewer ← NIL,
projectionValue: NAT ← 1,
frame: Viewer ← NIL,
clippingPlanes: Viewer ← NIL,
visibleAssemblies: Viewer ← NIL];
CameraOrderSectionData:
TYPE =
RECORD [
order: Viewer ← NIL];
ShadowSectionData:
TYPE =
RECORD [
shadowLabel: Viewer ← NIL,
shadowValue: BOOL ← FALSE];
ArtworkSectionData:
TYPE =
RECORD [
tubeHeight: Viewer ← NIL,
tubeRadius: Viewer ← NIL,
boxXYZ: Viewer ← NIL,
picName: Viewer ← NIL,
material: Viewer ← NIL,
materialValue: NAT ← 1,
resolution: Viewer ← NIL,
isColor: Viewer ← NIL,
rgb: Viewer ← NIL,
oMapLabel: Viewer ← NIL];
ArtworkTransformSectionData:
TYPE =
RECORD [
degrees: Viewer ← NIL];
LightSectionData:
TYPE =
RECORD [
name: Viewer ← NIL,
position: Viewer ← NIL,
color: Viewer ← NIL];
UtilitySectionData:
TYPE =
RECORD [
stuffNum: Viewer ← NIL];
Selections
Skitter: TYPE = REF SkitterObj;
SkitterObj:
TYPE =
RECORD [
alive: BOOL,
cameraPoint: Point2d,
assembly: Assembly,
primitive: Primitive,
skitterWORLD: Matrix4by4,
viewerToolData: ViewerToolData,
mode: SkitterMode];
SkitterMode: TYPE = {surface, tightrope, coordframe};
SearchDepth: TYPE = {first, lastOfFirst, last, lastOfLevel1};
Selection: TYPE = REF SelectionObj;
SelectionObj:
TYPE =
RECORD [
coincident: Assembly, -- the hook jack, floater jack, or sitting-in for coordSys referents.
indirect: Assembly, -- the assembly we claim to be sitting on if we are a hook, NIL otherwise.
viewerToolData: ViewerToolData,
referentType: ReferentType,
selectionType: SelectionType];
ReferentType: TYPE = {hook, coordSys};
SelectionType: TYPE = {target, movee, plane};
SelectionGenerator: TYPE = REF SelectionGeneratorObj;
SelectionGeneratorObj:
TYPE =
RECORD [
currentPtr: LIST OF Selection
];
Artwork Tool
Artwork: TYPE = SVModelTypes.Artwork;
ArtworkToolData: TYPE = REF ArtworkToolDataObj;
ArtworkToolDataObj:
TYPE =
RECORD [
outer: Containers.Container ← NIL,
editToolData: EditToolData,
height: CARDINAL ← 0,
picture: Viewer ← NIL,
textSection: TextSectionData,
origin: Point2d,
scalar: REAL,
proc: PROC [dc: Imager.Context],
artwork: Artwork,
paintColor: Color];
TextSectionData:
TYPE =
RECORD [
scalar: Viewer ← NIL,
color: Viewer ← NIL
];
Scratchpads
ScratchViewerData: TYPE = REF ScratchViewerDataObj;
ScratchViewerDataObj:
TYPE =
RECORD [
outer: Containers.Container ← NIL, -- handle for the enclosing container
height: CARDINAL ← 0,
textSection: ScratchTextSectionData,
scratchpad: ViewerClasses.Viewer ← NIL,
editToolData: EditToolData
];
ScratchTextSectionData: TYPE = REF TextSectionDataObj;
TextSectionDataObj:
TYPE =
RECORD [
degrees: ViewerClasses.Viewer ← NIL];
ScratchpadData: TYPE = REF ScratchpadDataObj;
ScratchpadDataObj:
TYPE =
RECORD [
origin: Point2d,
path: Path,
slice: Slice,
mode: ScratchpadMode,
index: NAT,
scratchViewerData: ScratchViewerData,
proc: ImagerProc,
imager: Imager.Context];
ImagerProc: TYPE = PROC [dc: Imager.Context];
ScratchpadMode: TYPE = {off, pointAt, drawLin, drawRevo, drawSlice};
END.