File: SVViewerUser.mesa
Last edited by Bier on January 15, 1985 0:01:17 am PST
Copyright © 1984 by Xerox Corporation. All rights reserved.
Author: Eric Bier in October, 1982 (?)
Contents: Code to respond to button presses made in an SVViewer
DIRECTORY
BitMap3d,
CastRays,
Containers,
Graphics,
Menus,
Rope,
SV2d,
SV3d,
SVInterfaceTypes,
SVModelTypes,
SVRayTypes,
SVSceneTypes,
SVSlices,
ViewerClasses;
SVViewerUser: CEDAR DEFINITIONS =
BEGIN
IMPORTED TYPES
Assembly: TYPE = SVSceneTypes.Assembly;
Camera: TYPE = SVModelTypes.Camera;
CoordSystem: TYPE = SVModelTypes.CoordSystem;
CSGTree: TYPE = SVRayTypes.CSGTree;
DCProc: TYPE = SVInterfaceTypes.DCProc;
MouseButton: TYPE = Menus.MouseButton;
Point2d: TYPE = SV2d.Point2d;
Point3d: TYPE = SV3d.Point3d;
Primitive: TYPE = SVRayTypes.Primitive;
Scene: TYPE = SVSceneTypes.Scene;
Selection: TYPE = SVInterfaceTypes.Selection;
SelectionType: TYPE = SVInterfaceTypes.SelectionType;
Slice: TYPE = SVSlices.Slice;
Vector: TYPE = SV3d.Vector;
Viewer: TYPE = ViewerClasses.Viewer;
ViewerToolData: TYPE = SVInterfaceTypes.ViewerToolData;
in SVViewerUserImplA
TEXT VIEWER PARSING CODE (deserves its own module)
ReadTwoReals: PROC [textViewer: Viewer] RETURNS [x, y: REAL];
MISCELLANEOUS
Painter: PROC [proc: DCProc, viewerToolData: ViewerToolData ← NIL];
UpdateHeader: PROC [pictureFile: Rope.ROPE, viewerToolData: ViewerToolData];
Header should now display pictureFile as the file name.
NewVersion: PROC [viewer: Viewer]; -- called by SVEditUserImplA
SceneOldVersion: PROC [viewerToolData: ViewerToolData]; -- called internally
OldVersion: PUBLIC PROC [viewer: Viewer]; -- called by SVEditUserImplA
DRAW SOMETHING IN A SOLID VIEWER (Fetches a display context first)
EraseAndDrawScene: PROC [viewerToolData: ViewerToolData]; -- like DrawSceneButton but erases the screen before drawing.
DrawOneCSInViewer: PROC [viewerToolData: ViewerToolData, cs: CoordSystem];
ComplementAssembly: PROC [viewerToolData: ViewerToolData, assem: Assembly];
DRAW A SET OF ITEMS INTO A GIVEN DISPLAY CONTEXT
DrawAssemblyXOR: PROC [dc: Graphics.Context, viewerToolData: ViewerToolData, assembly: Assembly];
DrawAssembly: PROC [dc: Graphics.Context, viewerToolData: ViewerToolData, assembly: Assembly];
Draw the given assembly into the given context in an XOR fashion. Uses a bitmap to avoid XOR some points more than once. Someday, it should use a pixel map instead.
DrawSceneEtc: PROC [dc: Graphics.Context, viewerToolData: ViewerToolData, hardcopy: BOOL ← FALSE];
May also draw coordinate systems, drawing planes, etc depending on the current selected modes.
EraseAndDrawSceneEtc: PROC [dc: Graphics.Context, viewerToolData: ViewerToolData];
Exactly like DrawSceneEtc, except, it clears the screen white before drawing. With double buffering, there is no difference.
DrawAllCS: PROC [dc: Graphics.Context, viewerToolData: ViewerToolData];
DrawOneCS: PROC [dc: Graphics.Context, viewerToolData: ViewerToolData, cs: CoordSystem];
MENU PROCS
in SVViewerUserImplA
PlaceOrigin: PROC [viewer: Viewer];
ResizeBitMaps: PROC [viewer: Viewer];
in SVViewerUserImplA
DrawSceneInternal: PROC [parent: REF ANY, clientData: REF ANY, mouseButton: MouseButton, shift, control: BOOL]; -- like DrawScene but erases the screen before drawing.
DrawSceneButton: PROC [parent: REF ANY, clientData: REF ANY, mouseButton: MouseButton, shift, control: BOOL];
Reset: PROC [parent: REF ANY, clientData: REF ANY, mouseButton: MouseButton, shift, control: BOOL];
ConfirmReset: PROC [parent: REF ANY, clientData: REF ANY, mouseButton: MouseButton, shift, control: BOOL];
Save: PROC [parent: REF ANY, clientData: REF ANY, mouseButton: MouseButton, shift, control: BOOL];
ConfirmSave: PROC [parent: REF ANY, clientData: REF ANY, mouseButton: MouseButton, shift, control: BOOL];
Get: PROC [parent: REF ANY, clientData: REF ANY, mouseButton: MouseButton, shift, control: BOOL];
ConfirmGet: PROC [parent: REF ANY, clientData: REF ANY, mouseButton: MouseButton, shift, control: BOOL];
Store: PROC [parent: REF ANY, clientData: REF ANY, mouseButton: MouseButton, shift, control: BOOL];
ConfirmStore: PROC [parent: REF ANY, clientData: REF ANY, mouseButton: MouseButton, shift, control: BOOL];
Split: PROC [parent: REF ANY, clientData: REF ANY, mouseButton: MouseButton, shift, control: BOOL];
in SVViewerUserImplA
Erase: PROC [parent: REF ANY, clientData: REF ANY, mouseButton: MouseButton, shift, control: BOOL];
Empty: PROC [parent: REF ANY, clientData: REF ANY, mouseButton: MouseButton, shift, control: BOOL];
ConfirmEmpty: PROC [parent: REF ANY, clientData: REF ANY, mouseButton: MouseButton, shift, control: BOOL];
RayCast: PROC [parent: REF ANY, clientData: REF ANY, mouseButton: MouseButton, shift, control: BOOL];
ConfirmRayCast: PROC [parent: REF ANY, clientData: REF ANY, mouseButton: MouseButton, shift, control: BOOL];
Stop: 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 SVViewerUserImplA.mesa
DrawBoundBoxes: PROC [parent: REF ANY, clientData: REF ANY, mouseButton: MouseButton, shift, control: BOOL];
DrawBoundSpheres: PROC [parent: REF ANY, clientData: REF ANY, mouseButton: MouseButton, shift, control: BOOL];
DrawCoordSystems: PROC [parent: REF ANY, clientData: REF ANY, mouseButton: MouseButton, shift, control: BOOL];
In SVViewerUserImplB.mesa
Press: PROC [parent: REF ANY, clientData: REF ANY, mouseButton: MouseButton, shift, control: BOOL];
PressAIS: PROC [parent: REF ANY, clientData: REF ANY, mouseButton: MouseButton, shift, control: BOOL];
PressBWAIS: PROC [parent: REF ANY, clientData: REF ANY, mouseButton: MouseButton, shift, control: BOOL];
StorePoly: PROC [parent: REF ANY, clientData: REF ANY, mouseButton: MouseButton, shift, control: BOOL];
In SVViewerUserImplB
DrawPt: PROC [parent: REF ANY, clientData: REF ANY, mouseButton: MouseButton, shift, control: BOOL];
DrawColor: PROC [parent: REF ANY, clientData: REF ANY, mouseButton: MouseButton, shift, control: BOOL];
DrawBlackAndWhite: PROC [parent: REF ANY, clientData: REF ANY, mouseButton: MouseButton, shift, control: BOOL];
in SVViewerUserImplB
CrossHairs: PROC [parent: REF ANY, clientData: REF ANY, mouseButton: MouseButton, shift, control: BOOL];
DrawDither: PROC [parent: REF ANY, clientData: REF ANY, mouseButton: MouseButton, shift, control: BOOL];
Dither: PROC [parent: REF ANY, clientData: REF ANY, mouseButton: MouseButton, shift, control: BOOL];
SetFocalLength: PROC [parent: REF ANY, clientData: REF ANY, mouseButton: MouseButton, shift, control: BOOL];
PROMPTS
AISPrompt: PROC [parent: REF ANY, clientData: REF ANY, mouseButton: MouseButton, shift, control: BOOL];
StylePrompt: PROC [parent: REF ANY, clientData: REF ANY, mouseButton: MouseButton, shift, control: BOOL];
XYZPrompt: 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];
TextPrompt: PROC [parent: REF ANY, clientData: REF ANY, mouseButton: MouseButton, shift, control: BOOL];
ON/OFF SWITCHES
DoubleBuffer: PROC [parent: REF ANY, clientData: REF ANY, mouseButton: MouseButton, shift, control: BOOL];
ShowCoordsMode: PROC [parent: REF ANY, clientData: REF ANY, mouseButton: MouseButton, shift, control: BOOL];
UTILITIES
In SVViewerUserImplB.mesa
Selected: PROC [parent: REF ANY, clientData: REF ANY, mouseButton: MouseButton, shift, control: BOOL];
Deselected: PROC [viewerToolData: ViewerToolData];
KillSelectionsButton: PROC [parent: REF ANY, clientData: REF ANY, mouseButton: MouseButton, shift, control: BOOL];
DeleteJacksButton: PROC [parent: REF ANY, clientData: REF ANY, mouseButton: MouseButton, shift, control: BOOL];
INPUT NOTIFY PROCS
in SVViewerUserImplB
SingleRay: PROC [viewerToolData: ViewerToolData, cameraPoint: Point2d];
PointAt: PROC [viewerToolData: ViewerToolData, cameraPoint: Point2d];
DrawSlice: PROC [viewerToolData: ViewerToolData, slice: Slice];
RayCastProgress: CastRays.NotifyOfProgressProc;
END.