MakeTool:
PUBLIC PROC [
toolName: ROPE,
functions: LIST OF Function ← NIL,
clientDraw: DrawProc ← NIL,
clientData: REF ANY ← NIL,
extraControls: ControlList ← NIL,
extraButtons: ButtonList ← NIL]
RETURNS [t: Tool]
~ {
t ← NEW[ToolRep];
t.clientDraw ← clientDraw;
t.clientData ← clientData;
t.slice ← G3dControl.InitSlice[proc: SliceControl, data: t];
t.slice.phi.value ← 90.0;
FOR b: ButtonList ← extraButtons, b.rest WHILE b # NIL DO b.first.row ← 1; ENDLOOP;
extraButtons ← CONS[Controls.ClickButton["Help", Help, t, 0], extraButtons];
extraButtons ← CONS[Controls.ClickButton["IP Out", IPOut, t, 0], extraButtons];
extraButtons ← CONS[Controls.ClickButton["Display-Ops", DisplayOps, t, 0], extraButtons];
extraButtons ← CONS[Controls.TextButton["MoveSlice: ","-.03", CheckValue, t, 0], extraButtons];
extraButtons ← CONS[Controls.TextButton["H: ", "80 ", CheckValue, t, 0], extraButtons];
extraButtons ← CONS[Controls.TextButton["W: ", "80 ", CheckValue, t, 0], extraButtons];
extraButtons ← CONS[Controls.ClickButton["Name", NamePix, t, 0], extraButtons];
extraButtons ← CONS[Controls.ClickButton["STOP", Stop, t, 0], extraButtons];
extraButtons ← CONS[Controls.ClickButton["StartAndMove", StartAndMove, t, 0], extraButtons];
extraButtons ← CONS[Controls.ClickButton["Start", Start, t, 0], extraButtons];
extraButtons ← CONS[Controls.ClickButton["Mode: Slice", ToggleMode, t, 0], extraButtons];
extraControls ← CONS[t.slice.size, extraControls];
extraControls ← CONS[t.slice.theta, extraControls];
extraControls ← CONS[t.slice.phi, extraControls];
extraControls ← CONS[t.slice.z, extraControls];
extraControls ← CONS[t.slice.y, extraControls];
extraControls ← CONS[t.slice.x, extraControls];
FOR f: LIST OF Function ← functions, f.rest WHILE f # NIL DO AddPix[t, f.first]; ENDLOOP;
t.renderTool ← G3dTool.MakeTool[
name: toolName,
ops: [TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE],
extraButtons: extraButtons,
extraControls: extraControls,
controlSizes: [15, 200, 60, 20, 60, 150, 150],
arcBallSize: 80,
nViews: 3,
client: [mouse: Mouse3d, destroy: Destroy, draw: Draw, data: t],
noOpen: TRUE];
t.viewer2d ← Controls.OuterViewer[mouse: Mouse2d, clientData: t, destroy: Destroy];
t.renderTool.outer.icon ← icon;
t.typescript ← t.renderTool.typescript;
t.valueViewer ← ViewerOps.CreateViewer[
flavor: $ValueViewer, paint: FALSE, info: [data: t, scrollable: FALSE, wx: 510, wy: 16, ww: 80, wh: 80, border: FALSE, parent: t.renderTool.outer]];
ViewerOps.AddProp[t.valueViewer, $CreatedInOuterViewer, $True];
ViewerOps.OpenIcon[t.renderTool.outer];
};