File: SVEditUser.mesa
Author: Eric Bier in October 1982
Last edited by Bier on August 18, 1983 5:21 pm
Contents: All of the procedures called by SVEditTool when menus and buttons are pressed.
(continued in SVEditUserB.mesa)
DIRECTORY
BitMap3d,
Containers,
CoordSys,
CSG,
DisplayList3d,
Graphics,
GraphicsColor,
IO,
Matrix3d,
Menus,
Rope,
SV2d,
SVViewerUser,
SweepGeometry,
ViewerClasses;
SVEditUser: CEDAR DEFINITIONS =
BEGIN
Assembly: TYPE = DisplayList3d.Assembly;
Camera: TYPE = DisplayList3d.Camera;
Color: TYPE = GraphicsColor.Color;
CoordSystem: TYPE = REF CoordSysObj;
CoordSysObj: TYPE = CoordSys.CoordSysObj;
DCProc: TYPE = SVViewerUser.DCProc;
Matrix4by4: TYPE = Matrix3d.Matrix4by4;
MouseButton: TYPE = Menus.MouseButton;
Point2d: TYPE = SV2d.Point2d;
Point3d: TYPE = Matrix3d.Point3d;
PointSetOp: TYPE = CSG.PointSetOp;
Primitive: TYPE = CSG.Primitive;
Scene: TYPE = DisplayList3d.Scene;
Viewer: TYPE = ViewerClasses.Viewer;
ViewerToolData: TYPE = SVViewerUser.ViewerToolData;
ViewerProc: TYPE = PROC [Graphics.Context, ViewerToolData];
Selection: TYPE = REF SelectionObj;
SelectionObj: TYPE = RECORD [
cameraPoint: Point2d,
assembly: Assembly,
primitive: Primitive,
coordSys: CoordSystem,
viewerToolData: ViewerToolData];
Each viewer will store its local state in:
EditToolData: TYPE = REF EditToolDataObj;
EditToolDataObj: TYPE = RECORD [
outer: Containers.Container ← NIL,-- handle for the enclosing container
height: CARDINAL ← 0,
sceneSection: CurrentSceneSectionData,
sphereSection: SphereSectionData,
blockSection: BlockSectionData,
cylinderSection: CylinderSectionData,
coneSection: ConeSectionData,
torusSection: TorusSectionData,
linSection: LinSectionData,
copySection: CopySectionData,
renameSection: RenameSectionData,
transformSection: TransformSectionData,
cameraSection: CameraSectionData,
cameraOrderSection: CameraOrderSectionData,
shadowSection: ShadowSectionData,
artworkSection: ArtworkSectionData,
artworkTransformSection: ArtworkTransformSectionData,
lightSection: LightSectionData,
utilitySection: UtilitySectionData,
scratchpad: Viewer,
artworkTool: Viewer,
allViewers: LIST OF ViewerCell,
currentViewerToolData: ViewerToolData -- to ward off compilation dependencies
];
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: ViewerClasses.Viewer ← NIL,
assemblyName: ViewerClasses.Viewer ← NIL,
wrt: ViewerClasses.Viewer ← NIL,
opLabel: ViewerClasses.Viewer ← NIL,
op: PointSetOp];
SphereSectionData: TYPE = RECORD [
radius: ViewerClasses.Viewer ← NIL];
BlockSectionData: TYPE = RECORD [
xyz: ViewerClasses.Viewer ← NIL];
CylinderSectionData: TYPE = RECORD [
radius: ViewerClasses.Viewer ← NIL,
height: ViewerClasses.Viewer ← NIL];
ConeSectionData: TYPE = RECORD [
radius: ViewerClasses.Viewer ← NIL,
height: ViewerClasses.Viewer ← NIL];
TorusSectionData: TYPE = RECORD [
bigRadius: ViewerClasses.Viewer ← NIL,
sectionRadius: ViewerClasses.Viewer ← NIL];
LinSectionData: TYPE = RECORD [
depth: ViewerClasses.Viewer ← NIL];
CopySectionData: TYPE = RECORD [
prefix: ViewerClasses.Viewer ← NIL,
assemblyName: ViewerClasses.Viewer ← NIL];
RenameSectionData: TYPE = RECORD [
newName: ViewerClasses.Viewer ← NIL];
TransformSectionData: TYPE = RECORD [
degrees: ViewerClasses.Viewer ← NIL,
transXYZ: ViewerClasses.Viewer ← NIL,
scaleXYZ: ViewerClasses.Viewer ← NIL,
scalar: ViewerClasses.Viewer ← NIL];
CameraSectionData: TYPE = RECORD [
name: ViewerClasses.Viewer ← NIL,
origin: ViewerClasses.Viewer ← NIL,
focusPoint: ViewerClasses.Viewer ← NIL,
slant: ViewerClasses.Viewer ← NIL,
resolution: ViewerClasses.Viewer ← NIL,
focalLength: ViewerClasses.Viewer ← NIL,
frame: ViewerClasses.Viewer ← NIL,
clippingPlanes: ViewerClasses.Viewer ← NIL,
visibleAssemblies: ViewerClasses.Viewer ← NIL];
CameraOrderSectionData: TYPE = RECORD [
order: ViewerClasses.Viewer ← NIL];
ShadowSectionData: TYPE = RECORD [
shadowLabel: ViewerClasses.Viewer ← NIL,
shadowValue: BOOLFALSE];
ArtworkSectionData: TYPE = RECORD [
tubeHeight: ViewerClasses.Viewer ← NIL,
tubeRadius: ViewerClasses.Viewer ← NIL,
boxXYZ: ViewerClasses.Viewer ← NIL,
picName: ViewerClasses.Viewer ← NIL,
material: ViewerClasses.Viewer ← NIL,
materialValue: NAT,
resolution: ViewerClasses.Viewer ← NIL,
isColor: ViewerClasses.Viewer ← NIL,
rgb: ViewerClasses.Viewer ← NIL,
oMapLabel: ViewerClasses.Viewer ← NIL];
ArtworkTransformSectionData: TYPE = RECORD [
degrees: ViewerClasses.Viewer ← NIL];
LightSectionData: TYPE = RECORD [
name: ViewerClasses.Viewer ← NIL,
position: ViewerClasses.Viewer ← NIL,
color: ViewerClasses.Viewer ← NIL];
UtilitySectionData: TYPE = RECORD [
stuffNum: ViewerClasses.Viewer ← NIL];
globalMatCount: NAT = 2;
globalMatArray: ARRAY[1..globalMatCount] OF Rope.ROPE; -- implemented in SVEditUserImplB
Interactive Editting Communication
In SVEditUserImplA
DrawAnySelections: PROC [dc: Graphics.Context, viewerToolData: ViewerToolData];
If the primary or secondary selection is in viewerToolData.outer then draw the coordinate system of this selection. Tell the selection about the current positions of CAMERA and WORLD before drawing it (We will assume, for now, that the assembly it refers to is already updated).
SetPrimarySelection: PROC [cameraPoint: Point2d, assembly: Assembly, primitive: Primitive, worldMat: Matrix4by4, viewerToolData: ViewerToolData] RETURNS [selection: Selection];
SetSecondarySelection: PROC [cameraPoint: Point2d, assembly: Assembly, primitive: Primitive, worldMat: Matrix4by4, viewerToolData: ViewerToolData] RETURNS [selection: Selection];
SetFinalPrimary: PROC [cameraPoint: Point2d, assembly: Assembly, primitive: Primitive, worldMat: Matrix4by4, viewerToolData: ViewerToolData] RETURNS [selection: Selection];
SetFinalSecondary: PROC [cameraPoint: Point2d, assembly: Assembly, primitive: Primitive, worldMat: Matrix4by4, viewerToolData: ViewerToolData] RETURNS [selection: Selection];
GetPrimarySelection: PROC RETURNS [selection: Selection];
GetSecondarySelection: PROC RETURNS [selection: Selection];
GetFinalPrimary: PROC RETURNS [selection: Selection];
GetFinalSecondary: PROC RETURNS [selection: Selection];
ExtendSecondary: PROC;
NotifyOfExtendedSelection: PROC [viewerToolData: ViewerToolData, oldSelection: Selection, newSelection: Selection];
Interwindow Communication
In SVEditUserImplA
Painter: PROC [proc: ViewerProc, editToolData: EditToolData, scene: Scene];
GetOutHandle: PROC RETURNS [outHandle: IO.STREAM];
LoadScene: PROC [viewerToolData: ViewerToolData, picName: Rope.ROPE] RETURNS [scene: Scene, success: BOOL];
SaveScene: PROC [viewerToolData: ViewerToolData, picName: Rope.ROPE] RETURNS [success: BOOL];
StoreScene: PROC [viewerToolData: ViewerToolData, scene: Scene, picName: Rope.ROPE] RETURNS [success: BOOL];
NotifyOfEmpty: PROC [viewerToolData: ViewerToolData, from: Scene, to: Scene];
NotifyDestroy: PROC [viewer: Viewer];
SceneNewVersion: PROC [viewerToolData: ViewerToolData, scene: Scene];-- loops through split viewers updating headers
UpdateAllHeaders: PROC [viewerToolData: ViewerToolData, scene: Scene];-- loops through split viewers updating headers
SceneOldVersion: PROC [viewerToolData: ViewerToolData, scene: Scene];-- loops through split viewers updating headers
NewSelectedViewer: PROC [viewerToolData: ViewerToolData];
If this viewer is not the current selected viewer, tell the edittool about the current contents of this viewer and select it.
ReSelectViewer: PROC [viewerToolData: ViewerToolData];
Tell the edittool about the current contents of this viewer and select it.
SetAssembly: PROC [assembly: Assembly, editToolData: EditToolData];
Split: PROC [viewerToolData: ViewerToolData, scene: Scene];
SVEditUserImpl Communication
GetCoordSys: PROC [viewer: Viewer, scene: Scene] RETURNS [cs: CoordSystem, success: BOOL];
GetAssembly: PROC [viewer: Viewer, scene: Scene] RETURNS [as: Assembly, success: BOOL];
FindAssemblyFromName: PROC [name: Rope.ROPE, scene: Scene] RETURNS [assembly: Assembly, superAssembly: Assembly, found: BOOL];
GetSuper: PROC [editToolData: EditToolData] RETURNS [super: Assembly, success: BOOL];
GetPoint3d: PROC [textViewer: Viewer] RETURNS [pt: Point3d];
DrawSceneInternal: PROC [parent: REF ANY, clientData: REF ANY, mouseButton: MouseButton,
shift, control: BOOL];
FindSceneInAllViewers: PROC [scene: Scene, allViewers: LIST OF ViewerCell] RETURNS [viewerCell: ViewerCell, success: BOOL];
AddSceneToAllViewers: PROC [scene: Scene, allViewers: LIST OF ViewerCell] RETURNS [viewerCell: ViewerCell, newAllViewers: LIST OF ViewerCell];
FindViewerInAllViewers: PROC [viewer: Viewer, allViewers: LIST OF ViewerCell] RETURNS [viewerCell: ViewerCell, before, listCell, after: Viewer, success: BOOL];
FindViewerInViewerCell: PROC [viewer: Viewer, viewerCell: ViewerCell] RETURNS [before, listCell, after: Viewer, success: BOOL];
DeleteViewerFromAllViewers: PROC [viewerCell: ViewerCell, before, listCell, after: Viewer];
AddViewerToViewerCell: PROC [viewer: Viewer, viewerCell: ViewerCell];
Prompts for text windows
In SVEditUserImplA
ScenePrompt: PROC [parent: REF ANY, clientData: REF ANY, mouseButton: MouseButton, shift, control: BOOL];
AssemblyNamePrompt: PROC [parent: REF ANY, clientData: REF ANY, mouseButton: MouseButton, shift, control: BOOL];
WithRespectToPrompt: PROC [parent: REF ANY, clientData: REF ANY, mouseButton: MouseButton, shift, control: BOOL];
RGBPrompt: PROC [parent: REF ANY, clientData: REF ANY, mouseButton: MouseButton, shift, control: BOOL];
SphereRadiusPrompt: PROC [parent: REF ANY, clientData: REF ANY, mouseButton: MouseButton,
shift, control: BOOL];
BlockXYZPrompt: PROC [parent: REF ANY, clientData: REF ANY, mouseButton: MouseButton, shift, control: BOOL];
CylinderRadiusPrompt: PROC [parent: REF ANY, clientData: REF ANY, mouseButton: MouseButton, shift, control: BOOL];
CylinderHeightPrompt: PROC [parent: REF ANY, clientData: REF ANY, mouseButton: MouseButton, shift, control: BOOL];
ConeRadiusPrompt: PROC [parent: REF ANY, clientData: REF ANY, mouseButton: MouseButton, shift, control: BOOL];
ConeHeightPrompt: PROC [parent: REF ANY, clientData: REF ANY, mouseButton: MouseButton, shift, control: BOOL];
BigRadiusPrompt: PROC [parent: REF ANY, clientData: REF ANY, mouseButton: MouseButton, shift, control: BOOL];
SectionRadiusPrompt: PROC [parent: REF ANY, clientData: REF ANY, mouseButton: MouseButton,
shift, control: BOOL];
LinDepthPrompt: PROC [parent: REF ANY, clientData: REF ANY, mouseButton: MouseButton, shift, control: BOOL];
StuffPrompt: PROC [parent: REF ANY, clientData: REF ANY, mouseButton: MouseButton, shift, control: BOOL];
DegreesPrompt: PROC [parent: REF ANY, clientData: REF ANY, mouseButton: MouseButton, shift, control: BOOL];
TranslateXYZPrompt: PROC [parent: REF ANY, clientData: REF ANY, mouseButton: MouseButton, shift, control: BOOL];
ScaleXYZPrompt: PROC [parent: REF ANY, clientData: REF ANY, mouseButton: MouseButton, shift, control: BOOL];
EvenScaleXYZPrompt: PROC [parent: REF ANY, clientData: REF ANY, mouseButton: MouseButton, shift, control: BOOL];
CameraNamePrompt: PROC [parent: REF ANY, clientData: REF ANY, mouseButton: MouseButton, shift, control: BOOL];
FocusPrompt: PROC [parent: REF ANY, clientData: REF ANY, mouseButton: MouseButton, shift, control: BOOL];
ScanResolutionPrompt: PROC [parent: REF ANY, clientData: REF ANY, mouseButton: MouseButton, shift, control: BOOL];
CameraOriginPrompt: PROC [parent: REF ANY, clientData: REF ANY, mouseButton: MouseButton, shift, control: BOOL];
SlantPrompt: PROC [parent: REF ANY, clientData: REF ANY, mouseButton: MouseButton, shift, control: BOOL];
FocalLengthPrompt: PROC [parent: REF ANY, clientData: REF ANY, mouseButton: MouseButton, shift, control: BOOL];
FramePrompt: PROC [parent: REF ANY, clientData: REF ANY, mouseButton: MouseButton, shift, control: BOOL];
ClippingPlanePrompt: PROC [parent: REF ANY, clientData: REF ANY, mouseButton: MouseButton, shift, control: BOOL];
VisibleAssemblyPrompt: PROC [parent: REF ANY, clientData: REF ANY, mouseButton: MouseButton, shift, control: BOOL];
CameraOrderPrompt: PROC [parent: REF ANY, clientData: REF ANY, mouseButton: MouseButton, shift, control: BOOL];
PrefixPrompt: PROC [parent: REF ANY, clientData: REF ANY, mouseButton: MouseButton,
shift, control: BOOL];
CopyFromPrompt: PROC [parent: REF ANY, clientData: REF ANY, mouseButton: MouseButton, shift, control: BOOL];
NewNamePrompt: PROC [parent: REF ANY, clientData: REF ANY, mouseButton: MouseButton, shift, control: BOOL];
ResolutionPrompt: PROC [parent: REF ANY, clientData: REF ANY, mouseButton: MouseButton, shift, control: BOOL];
TubeHeightPrompt: PROC [parent: REF ANY, clientData: REF ANY, mouseButton: MouseButton,
shift, control: BOOL];
TubeRadiusPrompt: PROC [parent: REF ANY, clientData: REF ANY, mouseButton: MouseButton, shift, control: BOOL];
BoxXYZPrompt: PROC [parent: REF ANY, clientData: REF ANY, mouseButton: MouseButton, shift, control: BOOL];
ArtworkNamePrompt: PROC [parent: REF ANY, clientData: REF ANY, mouseButton: MouseButton, shift, control: BOOL];
ArtworkDegreesPrompt: PROC [parent: REF ANY, clientData: REF ANY, mouseButton: MouseButton, shift, control: BOOL];
LightNamePrompt: PROC [parent: REF ANY, clientData: REF ANY, mouseButton: MouseButton, shift, control: BOOL];
LightPositionPrompt: PROC [parent: REF ANY, clientData: REF ANY, mouseButton: MouseButton, shift, control: BOOL];
LightColorPrompt: PROC [parent: REF ANY, clientData: REF ANY, mouseButton: MouseButton,
shift, control: BOOL];
Prompts for text windows which take the data when you press them (SVEditUserImplD)
SetShadows: PROC [parent: REF ANY, clientData: REF ANY, mouseButton: MouseButton, shift, control: BOOL];
Prompts which cycle through possibilities (SVEditUserImplC)
SelectOp: PROC [parent: REF ANY, clientData: REF ANY, mouseButton: MouseButton, shift, control: BOOL];
IsColor: PROC [parent: REF ANY, clientData: REF ANY, mouseButton: MouseButton, shift, control: BOOL];
SVEditUserImplD
MaterialCycle: PROC [parent: REF ANY, clientData: REF ANY, mouseButton: MouseButton, shift, control: BOOL];
BoxOCycle: PROC [parent: REF ANY, clientData: REF ANY, mouseButton: MouseButton, shift, control: BOOL];
ShadowsPrompt: PROC [parent: REF ANY, clientData: REF ANY, mouseButton: MouseButton, shift, control: BOOL];
Command Buttons (SVEditUserImplA.mesa)
NewViewer: PROC [parent: REF ANY, clientData: REF ANY, mouseButton: MouseButton, shift, control: BOOL];
NewOutput: PROC [parent: REF ANY, clientData: REF ANY, mouseButton: MouseButton, shift, control: BOOL];
Command Buttons (SVEditUserImplC.mesa)
First: PROC [parent: REF ANY, clientData: REF ANY, mouseButton: MouseButton, shift, control: BOOL];
DrawCS: PROC [parent: REF ANY, clientData: REF ANY, mouseButton: MouseButton, shift, control: BOOL];
Delete: PROC [parent: REF ANY, clientData: REF ANY, mouseButton: MouseButton, shift, control: BOOL];
SetColor: PROC [parent: REF ANY, clientData: REF ANY, mouseButton: MouseButton, shift, control: BOOL];
SetOp: PROC [parent: REF ANY, clientData: REF ANY, mouseButton: MouseButton, shift, control: BOOL];
SetColorMap: PROC [parent: REF ANY, clientData: REF ANY, mouseButton: MouseButton, shift, control: BOOL];
BWMap: PROC [parent: REF ANY, clientData: REF ANY, mouseButton: MouseButton, shift, control: BOOL];
RotX: PROC [parent: REF ANY, clientData: REF ANY, mouseButton: MouseButton, shift, control: BOOL];
RotY: PROC [parent: REF ANY, clientData: REF ANY, mouseButton: MouseButton, shift, control: BOOL];
RotZ: PROC [parent: REF ANY, clientData: REF ANY, mouseButton: MouseButton, shift, control: BOOL];
Trans: PROC [parent: REF ANY, clientData: REF ANY, mouseButton: MouseButton, shift, control: BOOL];
ScalePrimitive: PROC [parent: REF ANY, clientData: REF ANY, mouseButton: MouseButton, shift, control: BOOL];
EvenScale: PROC [parent: REF ANY, clientData: REF ANY, mouseButton: MouseButton, shift, control: BOOL];
Edit: PROC [parent: REF ANY, clientData: REF ANY, mouseButton: MouseButton, shift, control: BOOL];
AddComposite: PROC [parent: REF ANY, clientData: REF ANY, mouseButton: MouseButton, shift, control: BOOL];
ARay: PROC [parent: REF ANY, clientData: REF ANY, mouseButton: MouseButton, shift, control: BOOL];
In SVEditUserImplB
AddHalfSpace: PROC [parent: REF ANY, clientData: REF ANY, mouseButton: MouseButton, shift, control: BOOL];
AddSphere: PROC [parent: REF ANY, clientData: REF ANY, mouseButton: MouseButton, shift, control: BOOL];
AddBlock: PROC [parent: REF ANY, clientData: REF ANY, mouseButton: MouseButton, shift, control: BOOL];
AddCyl: PROC [parent: REF ANY, clientData: REF ANY, mouseButton: MouseButton, shift, control: BOOL];
AddCone: PROC [parent: REF ANY, clientData: REF ANY, mouseButton: MouseButton, shift, control: BOOL];
AddTorus: PROC [parent: REF ANY, clientData: REF ANY, mouseButton: MouseButton, shift, control: BOOL];
AddRevo: PROC [parent: REF ANY, clientData: REF ANY, mouseButton: MouseButton, shift, control: BOOL];
AddLinear: PROC [parent: REF ANY, clientData: REF ANY, mouseButton: MouseButton, shift, control: BOOL];
DeleteObject: PROC [parent: REF ANY, clientData: REF ANY, mouseButton: MouseButton, shift, control: BOOL];
Copy: PROC [parent: REF ANY, clientData: REF ANY, mouseButton: MouseButton, shift, control: BOOL];
Rename: PROC [parent: REF ANY, clientData: REF ANY, mouseButton: MouseButton, shift, control: BOOL];
Move: PROC [parent: REF ANY, clientData: REF ANY, mouseButton: MouseButton, shift, control: BOOL];
END.