File: SVInterfaceTypes.mesa
Last edited by: Eric Bier on September 23, 1987 10:54:59 pm PDT
Copyright © 1984 by Xerox Corporation. All rights reserved.
Contents: Types for the Gargoyle3d interface.
DIRECTORY
AtomButtonsTypes, BufferedRefresh, BufferedRefreshTypes, Containers, FunctionCache, Imager, ImagerBackdoor, ImagerFont, IO, Rope, SlackProcess, SV2d, SV3d, SVBasicTypes, SVCatScan, SVModelTypes, SVSceneTypes, SVStoragePools, ViewerClasses;
SVInterfaceTypes: CEDAR DEFINITIONS =
BEGIN
BoundBox: TYPE = SVBasicTypes.BoundBox;
Camera: TYPE = SVModelTypes.Camera;
CatScan: TYPE = SVCatScan.CatScan;
Color: TYPE = Imager.Color;
CoordSystem: TYPE = SVModelTypes.CoordSystem;
CSGTree: TYPE = SVSceneTypes.CSGTree;
EnumTypeRef: TYPE = AtomButtonsTypes.EnumTypeRef;
FeatureData: TYPE = SVSceneTypes.FeatureData;
FeedbackData: TYPE = AtomButtonsTypes.FeedbackData;
GraphicsState: TYPE = AtomButtonsTypes.GraphicsState;
Line3d: TYPE = SV3d.Line3d;
Matrix4by4: TYPE = SV3d.Matrix4by4;
Path: TYPE = SV2d.Path;
Point2d: TYPE = SV2d.Point2d;
Point3d: TYPE = SV3d.Point3d;
PointSetOp: TYPE = SVSceneTypes.PointSetOp;
Primitive: TYPE = SVSceneTypes.Primitive;
Scene: TYPE = SVSceneTypes.Scene;
SelectMode: TYPE = SVSceneTypes.SelectMode;
Slice: TYPE = SVSceneTypes.Slice;
SliceDescriptor: TYPE = SVSceneTypes.SliceDescriptor;
SortedButtonHandle: TYPE = AtomButtonsTypes.SortedButtonHandle;
Sphere: TYPE = SV3d.Sphere;
StoragePool: TYPE = SVStoragePools.StoragePool;
StrokeEnd: TYPE = Imager.StrokeEnd;
StrokeJoint: TYPE = Imager.StrokeJoint;
TwoState: TYPE = AtomButtonsTypes.TwoState;
Vector3d: TYPE = SV3d.Vector3d;
Viewer: TYPE = ViewerClasses.Viewer;
SVData
SVData: TYPE = REF SVDataObj;
SVDataObj: TYPE = RECORD [
outer: Viewer ← NIL,
actionArea: Viewer ← NIL,
feedback: FeedbackData,
height: CARDINAL ← 0,
yBounded: LIST OF Viewer ← NIL, -- used in SVViewerToolImpl for viewer resizing.
xBounded: LIST OF Viewer ← NIL,
originalWDir: Rope.ROPE,
currentWDir: Rope.ROPE,
mouseMode, state: ATOM,
scene: Scene, -- the collection of 3d objects we are looking at
camera: Camera, -- our point of view
drag: DragData,
refresh: RefreshData,
measure: MeasureData,
hitTest: Filters,
select: SelectData,
debug: DebugData,
defaults: DefaultData,
slackHandle: SlackProcess.SlackHandle,
aborted: PACKED ARRAY AbortFlags OF BOOLALL[FALSE],
gravityPool: REF ANY,
Unique to Gargoyle3d
textSection: ViewerTextData,
editToolData: EditToolData,
sceneStyleIndex: NAT, -- corresponds to camera.style
baseCS: CoordSystem, -- ****
mode: InteractionMode,
showCoordSys: BOOL
];
DefaultData: TYPE = REF DefaultDataObj;
DefaultDataObj: TYPE = RECORD [
strokeWidth: REAL ← 2.0,
strokeJoint: StrokeJoint ← round,
strokeEnd: StrokeEnd ← round,
strokeColor: Imager.Color ← NIL,-- no stroke color
fillColor: Artwork ← NIL -- no fill
];
DisplayContextProc: TYPE = PROC [Imager.Context];
RefreshData: TYPE = RECORD [
suppressRefresh: BOOLFALSE,
paintAction: ATOM,
paintProc: DisplayContextProc,
showColors: AtomButtonsTypes.TwoState,
screenStyle: AtomButtonsTypes.EnumTypeRef,
sandwich: BufferedRefreshTypes.Sandwich,
lastCW, lastCH: INTEGER ← 0,
lineCache: FunctionCache.Cache, -- remembers which lines have been drawn in Foreground
dragInProgress: BOOLFALSE,
caretIsMoving: BOOLFALSE,
overlayList: LIST OF SliceDescriptor,
orderedOverlayList: LIST OF SliceDescriptor, -- NIL => must rebuild ordered list
addedObject: REF ANYNIL, -- used to implement GGRefresh.FinishedAdding
slice: Slice,
spotPoint: Point2d, -- in CAMERA coords. For TestGravity.
hitPoint: Point3d, -- in WORLD coords. For TestGravity.
startBoundBox: BoundBox ← NIL,
currentY, minX, minY, maxX, maxY: REAL -- RayCastProgress indicators
];
MeasureData: TYPE = RECORD [
caret0: Point3d,
caret1: Point3d,
caret2Value: Point3d,
caret2: Viewer,
slopeViewValue: REAL,
slopeView: Viewer,
azimuthViewValue: REAL,
azimuthView: Viewer,
radiusViewValue: REAL,
radiusView: Viewer
];
DragData: TYPE = RECORD [
assembly: Slice ← NIL, -- The corresponding assembly (if any).
startPoint: Point3d, -- in WORLD coords
currentPoint: Point2d, -- in CAMERA coords
savedCaret: Skitter,
blockInProgress: SliceDescriptor, -- needed by Start/During/End Box procs to pass along new box
transform: Matrix4by4, -- in WORLD coords
selectState: SelectMode ← joint, -- what are we in the process of selecting?
extendMode: SelectMode ← joint, -- what are we extending to?
planeDepth: REAL, -- in Target coordinates
cameraVector: Vector3d,
target: Slice ← NIL,
startSkitter: Matrix4by4 -- in WORLD coords
];
GravityType: TYPE = {pointsPreferred, linesPreferred, facesPreferred};
Filters: TYPE = REF FiltersObj;
FiltersObj: TYPE = RECORD [
t: REAL ← 25.0, -- see GGGravity.Map
triggerBag: TriggerBag,
oldTriggerBag: TriggerBag,
alignBag: AlignBag,
oldAlignBag: AlignBag,
sceneBag: TriggerBag,
oldSceneBag: TriggerBag,
hitCount: NAT ← 0,
gravityType: GravityType,
gravityTypeMenu: EnumTypeRef, -- initialized in SVWindowImpl
gravityExtentButton: GraphicsState,
gravButton: TwoState,
midpointButton: TwoState,
heuristicsButton: TwoState,
slopeHandle: SortedButtonHandle,
slopeCount: NAT ← 0,
azimuthHandle: SortedButtonHandle,
azimuthCount: NAT ← 0,
slopeLineHandle: SortedButtonHandle,
slopeLineCount: NAT ← 0,
slopePlaneHandle: SortedButtonHandle,
slopePlaneCount: NAT ← 0,
radiusHandle: SortedButtonHandle,
radiusCount: NAT ← 0,
scaleUnit: REAL ← 72.0, -- value of one scale unit, in screen dots. Initially set to 72.0 (1 inch)
horizontalDegrees: REAL -- slope considered horizontal. Initialized to 0 degrees (screen horizontal)
];
DebugData: TYPE = RECORD [
typescript: Viewer,
lastMessage: Rope.ROPENIL,
logFileName: Rope.ROPE,
logStream: IO.STREAM
];
GravityExtentData: TYPE = REF GravityExtentDataObj;
GravityExtentDataObj: TYPE = RECORD [
extent: REAL
];
AbortFlags: TYPE = {refresh, playback, gravitytest, bags, spare2, spare3};
SelectData: TYPE = RECORD [
cycler: FeatureCycler
];
ViewerTextData: TYPE = RECORD [
activateLabel: Viewer ← NIL,
viewStyle: Viewer ← NIL,
xyz: Viewer ← NIL,
showCoords: Viewer ← NIL,
selected: Viewer ← NIL,
isSelected: BOOL
];
InteractionMode: TYPE = {select, cast};
DCProc: TYPE = PROC [Imager.Context];
Hit Testing
TriggerBag: TYPE = REF TriggerBagObj;
TriggerBagObj: TYPE = RECORD [
tree: CSGTree,
ignoreMoving: BOOL, -- should the current tree ignore moving objects?
scene: Scene,
slices: LIST OF FeatureData,
anchor: FeatureData
];
AlignBag: TYPE = REF AlignBagObj;
AlignBagObj: TYPE = RECORD [
slopeLines: LIST OF FeatureData,
slopePlanes: LIST OF FeatureData,
spheres: LIST OF FeatureData,
anchor: FeatureData
];
AlignmentPoint: TYPE = REF AlignmentPointObj;
AlignmentPointObj: TYPE = RECORD [
point: Point3d,
tangent: BOOL, -- is this a point of tangency? (for Describe purposes)
curve1: FeatureData,
curve2: FeatureData
];
AlignmentLine: TYPE = REF AlignmentLineObj;
AlignmentLineObj: TYPE = RECORD [
line: Line3d,
azimuth: REAL,
slope: REAL,
triggerPoints: LIST OF Point3d ← NIL
];
AlignmentSphere: TYPE = REF AlignmentSphereObj;
AlignmentSphereObj: TYPE = RECORD [
sphere: Sphere,
triggerPoints: LIST OF Point3d ← NIL
];
GoodPoint: TYPE = REF GoodPointObj;
GoodPointObj: TYPE = RECORD [
dist: REAL,
point: Point3d,
normal: Vector3d,
featureData: FeatureData, -- this point
hitData: REF ANY, -- a description of this point
dimension: [0..2] -- is this a hit on a point, line, or face?
];
NearVertexEdgeAndFaces: TYPE = REF NearVertexEdgeAndFacesObj;
NearVertexEdgeAndFacesObj: TYPE = RECORD [
things: SEQUENCE len: NAT OF GoodPoint];
FeatureCycler: TYPE = REF FeatureCyclerObj;
FeatureCyclerObj: TYPE = RECORD [
nearVEF: NearVertexEdgeAndFaces,
count: NAT,
index: INTEGER,
cameraPt: Point2d,
camera: Camera
];
The EditTool
EditToolData: TYPE = REF EditToolDataObj;
EditToolDataObj: TYPE = RECORD [
outer: Containers.Container ← NIL,
height: CARDINAL ← 0,
printFont: ImagerFont.Font,
screenFont: ImagerFont.Font,
skitter: Skitter,
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,
currentSVData: SVData,
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: BOOLFALSE];
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 = SVSceneTypes.SkitterObj;
Selection: TYPE = REF SelectionObj;
SelectionObj: TYPE = RECORD [
coincident: Slice, -- the hook jack, floater jack, or sitting-in for coordSys referents.
indirect: Slice, -- the assembly we claim to be sitting on if we are a hook, NIL otherwise.
svData: SVData,
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,
catScan: CatScan,
mode: ScratchpadMode,
index: NAT,
scratchViewerData: ScratchViewerData,
proc: ImagerProc,
imager: Imager.Context];
ImagerProc: TYPE = PROC [dc: Imager.Context];
ScratchpadMode: TYPE = {off, pointAt, drawLin, drawRevo, drawCatScan};
END.