-- File: SVEditToolMenusImplA.mesa
-- Last edited by Bier on December 18, 1982 1:51 am
-- Author: Eric Bier on January 12, 1983 3:34 pm
-- Contents: Procedures which build sections of the EditTool

DIRECTORY
 Buttons,
 Containers,
 Labels,
 Rope,
 Rules,
 ViewerTools,
 VFonts,
 SVEditToolMenus,
 SVEditUser,
 SVEditUserB;

SVEditToolMenusImplA: PROGRAM
IMPORTS Buttons, Containers, Labels, Rules, SVEditUser, SVEditUserB, VFonts, ViewerTools
EXPORTS SVEditToolMenus =
BEGIN

EditToolData: TYPE = SVEditUser.EditToolData;

-- declare the standard distances between menu lines.
entryHeight: CARDINAL = SVEditToolMenus.entryHeight;
entryVSpace: CARDINAL = SVEditToolMenus.entryVSpace;
entryHSpace: CARDINAL = SVEditToolMenus.entryHSpace;
column0: CARDINAL = SVEditToolMenus.column0;
column1: CARDINAL = SVEditToolMenus.column1;
column2: CARDINAL = SVEditToolMenus.column2;
column3: CARDINAL = SVEditToolMenus.column3;

BuildCurrentSceneSection: PUBLIC PROC [editToolData: EditToolData] = {
-- This section implements a set of buttons, text windows, and options listers in this format:
-- CURRENTSCENE: <SCENENAME> NEW VIEWER NEW OUTPUT
-- ASSEMBLYNAME: <obname> WITHRESPECTTO: <coordsystem>
-- FIRST!  DELETE!  EDIT!
-- SET PointSetOp <op> ColorMap! BWMap!

 scenePrompt, newViewer, newOutput: Buttons.Button;
 assemblyNamePrompt, wrtPrompt: Buttons.Button;
 firstButton, drawCSButton, deleteButton, editButton: Buttons.Button;
 setOpButton, selectOpButton, colorMapButton, bwMapButton: Buttons.Button;
 initialSceneRope: Rope.ROPE ← "DefaultScene";
 initialAssemblyNameRope: Rope.ROPE ← "NoName";
 initialWRTRope: Rope.ROPE ← "sceneAssembly";
 initialOpRope: Rope.ROPE ← "union";

 editToolData.height ← editToolData.height + entryVSpace; -- space down from the top of the viewer

-- CURRENTSCENE: <SCENENAME> NEW VIEWER NEW OUTPUT

 scenePrompt ← Buttons.Create[
  info: [name: "Scene:", wy: editToolData.height, wh: entryHeight,
     parent: editToolData.outer, border: FALSE],
  proc: SVEditUser.ScenePrompt,
  clientData: editToolData
  ];
  
 editToolData.sceneSection.sceneName ← ViewerTools.MakeNewTextViewer[[
  parent: editToolData.outer,
  wx: scenePrompt.wx + scenePrompt.ww + entryHSpace,
  wy: editToolData.height,
  ww: VFonts.StringWidth["DogWithCat.pic"],
  wh: entryHeight,
  data: initialSceneRope,
  scrollable: FALSE, border: FALSE]];
  
 newViewer ← Buttons.Create[
  info: [name: "New Viewer",
     wx: scenePrompt.wx + column2,
      wy: editToolData.height, wh: entryHeight,
     parent: editToolData.outer, border: TRUE],
  proc: SVEditUser.NewViewer,
  clientData: editToolData
  ];
  
 newOutput ← Buttons.Create[
  info: [name: "New Output",
     wx: scenePrompt.wx + column3,
     wy: editToolData.height, wh: entryHeight,
     parent: editToolData.outer, border: TRUE],
  proc: SVEditUser.NewOutput,
  clientData: editToolData
  ];
  
 editToolData.height ← editToolData.height + entryVSpace + entryHeight;

-- ASSEMBLYNAME: <obname> WITHRESPECTTO: <coordsystem>

 assemblyNamePrompt ← Buttons.Create[
  info: [name: "Assembly:",
     wy: editToolData.height, wh: entryHeight,
     parent: editToolData.outer, border: FALSE],
  proc: SVEditUser.AssemblyNamePrompt,
  clientData: editToolData
  ];
  
 editToolData.sceneSection.assemblyName ← ViewerTools.MakeNewTextViewer[[
  parent: editToolData.outer,
  wx: assemblyNamePrompt.wx + assemblyNamePrompt.ww + entryHSpace,
  wy: editToolData.height,
  ww: VFonts.StringWidth[">>>>DogWithBigNose"],
  wh: entryHeight,
  data: initialAssemblyNameRope,
  scrollable: FALSE, border: FALSE]];
  
 wrtPrompt ← Buttons.Create[
  info: [name: "With Respect To:",
     wx: assemblyNamePrompt.wx + column2 + VFonts.StringWidth[">>>>"],
     wy: editToolData.height, wh: entryHeight,
     parent: editToolData.outer, border: FALSE],
  proc: SVEditUser.WithRespectToPrompt,
  clientData: editToolData
  ];
  
 editToolData.sceneSection.wrt ← ViewerTools.MakeNewTextViewer[[
  parent: editToolData.outer,
  wx: wrtPrompt.wx + wrtPrompt.ww + entryHSpace,
  wy: editToolData.height,
  ww: VFonts.StringWidth["TipOfDogsBigNose"],
  wh: entryHeight,
  data: initialWRTRope,
  scrollable: FALSE, border: FALSE]];
  
 editToolData.height ← editToolData.height + entryVSpace + entryHeight;

-- FIRST!  DrawCS! DELETE!  EDIT!

 firstButton ← Buttons.Create[
  info: [name: "First!",
     wy: editToolData.height, wh: entryHeight,
     parent: editToolData.outer, border: FALSE],
  proc: SVEditUser.First,
  clientData: editToolData
  ];
  
 drawCSButton ← Buttons.Create[
  info: [name: "DrawCS!",
     wx: firstButton.wx + firstButton.ww + entryHSpace,
     wy: editToolData.height, wh: entryHeight,
     parent: editToolData.outer, border: FALSE],
  proc: SVEditUser.DrawCS,
  clientData: editToolData
  ];

 deleteButton ← Buttons.Create[
  info: [name: "Delete Assembly!",
     wx: firstButton.wx + column2,
     wy: editToolData.height, wh: entryHeight,
     parent: editToolData.outer, border: FALSE],
  proc: SVEditUser.Delete,
  clientData: editToolData
  ];
  
 editButton ← Buttons.Create[
  info: [name: "Edit!",
     wx: firstButton.wx + column3,
     wy: editToolData.height, wh: entryHeight,
     parent: editToolData.outer, border: FALSE],
  proc: SVEditUser.Edit,
  clientData: editToolData
  ];
  
 editToolData.height ← editToolData.height + entryVSpace + entryHeight;

  -- SET PointSetOp Op: <op> ColorMap!

 setOpButton ← Buttons.Create[
  info: [name: "Set Pointset Operation!",
     wy: editToolData.height, wh: entryHeight,
     parent: editToolData.outer, border: FALSE],
  proc: SVEditUser.SetOp,
  clientData: editToolData
  ];
  
 selectOpButton ← Buttons.Create[
  info: [name: "Op:",
     wx: setOpButton.wx + column2,
     wy: editToolData.height, wh: entryHeight,
     parent: editToolData.outer, border: FALSE],
  proc: SVEditUser.SelectOp,
  clientData: editToolData
  ];

  
 editToolData.sceneSection.opLabel ← Labels.Create[
  info: [name: initialOpRope,
    wx: selectOpButton.wx + selectOpButton.ww + entryHSpace,
    wy: editToolData.height, wh: entryHeight,
    parent: editToolData.outer, border: FALSE]];
   
 colorMapButton ← Buttons.Create[
  info: [name: "ColorMap!",
     wx: setOpButton.wx + column3,
     wy: editToolData.height, wh: entryHeight,
     parent: editToolData.outer, border: FALSE],
  proc: SVEditUser.SetColorMap,
  clientData: editToolData
  ];
  
 bwMapButton ← Buttons.Create[
  info: [name: "BWMap!",
     wx: colorMapButton.wx + colorMapButton.ww + entryHSpace,
     wy: editToolData.height, wh: entryHeight,
     parent: editToolData.outer, border: FALSE],
  proc: SVEditUser.BWMap,
  clientData: editToolData
  ];


 editToolData.height ← editToolData.height + entryVSpace + entryHeight;

 }; -- end of BuildCurrentSceneSection


BuildCompositeSection: PUBLIC PROC [editToolData: EditToolData] = {
-- This section implements a set of buttons, text windows, and options listers in this format:
-- ADDCOMPOSITE!

 addComp: Buttons.Button;

 addComp ← Buttons.Create[
  info: [name: "Add Composite!", wy: editToolData.height, wh: entryHeight,
     parent: editToolData.outer, border: FALSE],
  proc: SVEditUser.AddComposite,
  clientData: editToolData
  ];
  
 editToolData.height ← editToolData.height + entryVSpace + entryHeight;
 };

BuildSphereSection: PUBLIC PROC [editToolData: EditToolData] = {
-- This section implements a set of buttons, text windows, and options listers in this format:
-- ADDSPHERE RADIUS: <radius>

 addSphere, radiusPrompt: Buttons.Button;
 initialRadiusRope: Rope.ROPE ← "100";

 addSphere ← Buttons.Create[
  info: [name: "Add Sphere!", wy: editToolData.height, wh: entryHeight,
     parent: editToolData.outer, border: FALSE],
  proc: SVEditUser.AddSphere,
  clientData: editToolData
  ];
  
 radiusPrompt ← Buttons.Create[
  info: [name: "radius:",
     wx: addSphere.wx + column2,
     wy: editToolData.height, wh: entryHeight,
     parent: editToolData.outer, border: FALSE],
  proc: SVEditUser.SphereRadiusPrompt,
  clientData: editToolData
  ];
  
 editToolData.sphereSection.radius ← ViewerTools.MakeNewTextViewer[[
  parent: editToolData.outer,
  wx: radiusPrompt.wx + radiusPrompt.ww + entryHSpace,
  wy: editToolData.height,
  ww: VFonts.StringWidth["188.88"],
  wh: entryHeight,
  data: initialRadiusRope, -- "100"
  scrollable: FALSE, border: FALSE]];
  
 editToolData.height ← editToolData.height + entryVSpace + entryHeight;
  
 }; -- end of BuildSphereSection



BuildBlockSection: PUBLIC PROC [editToolData: EditToolData] = {
-- This section implements a set of buttons, text windows, and options listers in this format:
-- ADDBLOCK x, y, z: <x, y, z>

 addBlock, xyzPrompt: Buttons.Button;
 initialXYZRope: Rope.ROPE ← "30, 30, 30";

 addBlock ← Buttons.Create[
  info: [name: "Add Block!", wy: editToolData.height, wh: entryHeight,
     parent: editToolData.outer, border: FALSE],
  proc: SVEditUser.AddBlock,
  clientData: editToolData
  ];
  
 xyzPrompt ← Buttons.Create[
  info: [name: "x, y, z:",
     wx: addBlock.wx + column2,
     wy: editToolData.height, wh: entryHeight,
     parent: editToolData.outer, border: FALSE],
  proc: SVEditUser.BlockXYZPrompt,
  clientData: editToolData
  ];
  
 editToolData.blockSection.xyz ← ViewerTools.MakeNewTextViewer[[
  parent: editToolData.outer,
  wx: xyzPrompt.wx + xyzPrompt.ww + entryHSpace,
  wy: editToolData.height,
  ww: VFonts.StringWidth["<<<<188.88, 188.88, 188.88"],
  wh: entryHeight,
  data: initialXYZRope,
  scrollable: FALSE, border: FALSE]];
  
 editToolData.height ← editToolData.height + entryVSpace + entryHeight;
  
 }; -- end of BuildBlockSection


BuildCylinderSection: PUBLIC PROC [editToolData: EditToolData] = {
-- This section implements a set of buttons, text windows, and options listers in this format:
-- ADDCYLINDER RADIUS: <radius> HEIGHT: <height>

 addCyl, radiusPrompt, heightPrompt: Buttons.Button;
 initialRadiusRope: Rope.ROPE ← "100";
 initialHeightRope: Rope.ROPE ← "200";

 addCyl ← Buttons.Create[
  info: [name: "Add Cylinder!", wy: editToolData.height, wh: entryHeight,
     parent: editToolData.outer, border: FALSE],
  proc: SVEditUser.AddCyl,
  clientData: editToolData
  ];
  
 radiusPrompt ← Buttons.Create[
  info: [name: "radius:",
     wx: addCyl.wx + column2,
     wy: editToolData.height, wh: entryHeight,
     parent: editToolData.outer, border: FALSE],
  proc: SVEditUser.CylinderRadiusPrompt,
  clientData: editToolData
  ];
  
 editToolData.cylinderSection.radius ← ViewerTools.MakeNewTextViewer[[
  parent: editToolData.outer,
  wx: radiusPrompt.wx + radiusPrompt.ww + entryHSpace,
  wy: editToolData.height,
  ww: VFonts.StringWidth["188.88"],
  wh: entryHeight,
  data: initialRadiusRope, -- "100"
  scrollable: FALSE, border: FALSE]];
  
 heightPrompt ← Buttons.Create[
  info: [name: "height:",
     wx: addCyl.wx + column3,
     wy: editToolData.height, wh: entryHeight,
     parent: editToolData.outer, border: FALSE],
  proc: SVEditUser.CylinderHeightPrompt,
  clientData: editToolData
  ];
  
 editToolData.cylinderSection.height ← ViewerTools.MakeNewTextViewer[[
  parent: editToolData.outer,
  wx: heightPrompt.wx + heightPrompt.ww + entryHSpace,
  wy: editToolData.height,
  ww: VFonts.StringWidth["188.88"],
  wh: entryHeight,
  data: initialHeightRope, -- "100"
  scrollable: FALSE, border: FALSE]];
  
 editToolData.height ← editToolData.height + entryVSpace + entryHeight;
  
}; -- end of BuildCylinderSection

BuildConeSection: PUBLIC PROC [editToolData: EditToolData] = {
-- This section implements a set of buttons, text windows, and options listers in this format:
-- ADDCONE RADIUS: <radius> HEIGHT: <height>

 addCone, radiusPrompt, heightPrompt: Buttons.Button;
 initialRadiusRope: Rope.ROPE ← "100";
 initialHeightRope: Rope.ROPE ← "200";

 addCone ← Buttons.Create[
  info: [name: "Add Cone!", wy: editToolData.height, wh: entryHeight,
     parent: editToolData.outer, border: FALSE],
  proc: SVEditUser.AddCone,
  clientData: editToolData
  ];
  
 radiusPrompt ← Buttons.Create[
  info: [name: "radius:",
     wx: addCone.wx + column2,
     wy: editToolData.height, wh: entryHeight,
     parent: editToolData.outer, border: FALSE],
  proc: SVEditUser.ConeRadiusPrompt,
  clientData: editToolData
  ];
  
 editToolData.coneSection.radius ← ViewerTools.MakeNewTextViewer[[
  parent: editToolData.outer,
  wx: radiusPrompt.wx + radiusPrompt.ww + entryHSpace,
  wy: editToolData.height,
  ww: VFonts.StringWidth["188.88"],
  wh: entryHeight,
  data: initialRadiusRope, -- "100"
  scrollable: FALSE, border: FALSE]];
  
 heightPrompt ← Buttons.Create[
  info: [name: "height:",
     wx: addCone.wx + column3,
     wy: editToolData.height, wh: entryHeight,
     parent: editToolData.outer, border: FALSE],
  proc: SVEditUser.ConeHeightPrompt,
  clientData: editToolData
  ];
  
 editToolData.coneSection.height ← ViewerTools.MakeNewTextViewer[[
  parent: editToolData.outer,
  wx: heightPrompt.wx + heightPrompt.ww + entryHSpace,
  wy: editToolData.height,
  ww: VFonts.StringWidth["188.88"],
  wh: entryHeight,
  data: initialHeightRope, -- "100"
  scrollable: FALSE, border: FALSE]];
  
 editToolData.height ← editToolData.height + entryVSpace + entryHeight;
  
}; -- end of BuildConeSection

BuildTorusSection: PUBLIC PROC [editToolData: EditToolData] = {
-- This section implements a set of buttons, text windows, and options listers in this format:
-- ADDTorus  big radius: <real> section radius: <real>

 addTorus, bigRadiusPrompt, sectionPrompt: Buttons.Button;
 initialBigRadius: Rope.ROPE ← "100";
 initialSectionRadius: Rope.ROPE ← "50";

 addTorus ← Buttons.Create[
  info: [name: "Add Torus!", wy: editToolData.height, wh: entryHeight,
     parent: editToolData.outer, border: FALSE],
  proc: SVEditUser.AddTorus,
  clientData: editToolData
  ];

 bigRadiusPrompt ← Buttons.Create[
  info: [name: "big radius:",
     wx: addTorus.wx + column2,
     wy: editToolData.height, wh: entryHeight,
     parent: editToolData.outer, border: FALSE],
  proc: SVEditUser.BigRadiusPrompt,
  clientData: editToolData
  ];
  
 editToolData.torusSection.bigRadius ← ViewerTools.MakeNewTextViewer[[
  parent: editToolData.outer,
  wx: bigRadiusPrompt.wx + bigRadiusPrompt.ww + entryHSpace,
  wy: editToolData.height,
  ww: VFonts.StringWidth["188.88 "],
  wh: entryHeight,
  data: initialBigRadius,
  scrollable: FALSE, border: FALSE]];
  
 sectionPrompt ← Buttons.Create[
  info: [name: "section radius:",
     wx: addTorus.wx + column3,
     wy: editToolData.height, wh: entryHeight,
     parent: editToolData.outer, border: FALSE],
  proc: SVEditUser.SectionRadiusPrompt,
  clientData: editToolData
  ];
  
 editToolData.torusSection.sectionRadius ← ViewerTools.MakeNewTextViewer[[
  parent: editToolData.outer,
  wx: sectionPrompt.wx + sectionPrompt.ww + entryHSpace,
  wy: editToolData.height,
  ww: VFonts.StringWidth["188.88 "],
  wh: entryHeight,
  data: initialSectionRadius,
  scrollable: FALSE, border: FALSE]];
  
 editToolData.height ← editToolData.height + entryVSpace + entryHeight;

 }; -- end of BuildTorusSection



BuildLinearSweepSection: PUBLIC PROC [editToolData: EditToolData] = {
-- This section implements a set of buttons, text windows, and options listers in this format:
-- ADDLINEAR  depth: <depth>

 addLinear, depthPrompt: Buttons.Button;
 initialDepthRope: Rope.ROPE ← "100";

 addLinear ← Buttons.Create[
  info: [name: "Add Linear Sweep!", wy: editToolData.height, wh: entryHeight,
     parent: editToolData.outer, border: FALSE],
  proc: SVEditUser.AddLinear,
  clientData: editToolData
  ];
  
 depthPrompt ← Buttons.Create[
  info: [name: "depth:",
     wx: addLinear.wx + column2,
     wy: editToolData.height, wh: entryHeight,
     parent: editToolData.outer, border: FALSE],
  proc: SVEditUser.LinDepthPrompt,
  clientData: editToolData
  ];

 editToolData.linSection.depth ← ViewerTools.MakeNewTextViewer[[
  parent: editToolData.outer,
  wx: depthPrompt.wx + depthPrompt.ww + entryHSpace,
  wy: editToolData.height,
  ww: VFonts.StringWidth["188.88 "],
  wh: entryHeight,
  data: initialDepthRope, -- "100"
  scrollable: FALSE, border: FALSE]];
  
 editToolData.height ← editToolData.height + entryVSpace + entryHeight;

}; -- end of BuildLinearSweepSection

BuildRevoluteSweepSection: PUBLIC PROC [editToolData: EditToolData] = {
-- This section implements a set of buttons, text windows, and options listers in this format:
-- ADDREVOLUTE

 addRevo: Buttons.Button;

 addRevo ← Buttons.Create[
  info: [name: "Add Revolute Sweep!", wy: editToolData.height, wh: entryHeight,
     parent: editToolData.outer, border: FALSE],
  proc: SVEditUser.AddRevo,
  clientData: editToolData
  ];
  
 editToolData.height ← editToolData.height + entryVSpace + entryHeight;
  
}; -- end of BuildRevoluteSweepSection

BuildCopySection: PUBLIC PROC [editToolData: EditToolData] = {
-- This section implements a set of buttons, text windows, and options listers in this format:
-- COPY! PREFIX: <ie 2> COPYFROM: <assemblyName>

 copyButton, prefixPrompt, copyFromPrompt: Buttons.Button;
 initialPrefixRope: Rope.ROPE ← "2";
 initialAssemblyNameRope: Rope.ROPE ← "sceneAssembly";

 copyButton ← Buttons.Create[
  info: [name: "Copy!", wy: editToolData.height, wh: entryHeight,
     parent: editToolData.outer, border: FALSE],
  proc: SVEditUser.Copy,
  clientData: editToolData
  ];
  
 prefixPrompt 𡤋uttons.Create[
  info: [name: "prefix:",
     wx: copyButton.wx + column1,
     wy: editToolData.height, wh: entryHeight,
     parent: editToolData.outer, border: FALSE],
  proc: SVEditUser.PrefixPrompt,
  clientData: editToolData
  ];
  
 editToolData.copySection.prefix ← ViewerTools.MakeNewTextViewer[[
  parent: editToolData.outer,
  wx: prefixPrompt.wx + prefixPrompt.ww + entryHSpace,
  wy: editToolData.height,
  ww: VFonts.StringWidth["222"],
  wh: entryHeight,
  data: initialPrefixRope,
  scrollable: FALSE, border: FALSE]];
  
 copyFromPrompt ← Buttons.Create[
  info: [name: "copy from:",
     wx: copyButton.wx + column2,
     wy: editToolData.height, wh: entryHeight,
     parent: editToolData.outer, border: FALSE],
  proc: SVEditUser.CopyFromPrompt,
  clientData: editToolData
  ];
  
 editToolData.copySection.assemblyName ← ViewerTools.MakeNewTextViewer[[
  parent: editToolData.outer,
  wx: copyFromPrompt.wx + copyFromPrompt.ww + entryHSpace,
  wy: editToolData.height,
  ww: VFonts.StringWidth["<<<<sceneAssembly "],
  wh: entryHeight,
  data: initialAssemblyNameRope,
  scrollable: FALSE, border: FALSE]];
  
 editToolData.height ← editToolData.height + entryVSpace + entryHeight;

 }; -- end of BuildCopySection
  

BuildTransformSection: PUBLIC PROC [editToolData: EditToolData] = {
-- This section implements a set of buttons, text windows, and options listers in this format:
-- SCALEPRIMITIVE  X,Y,Z: <x,y,z>
 -- EVENSCALE    scalar: <real>
-- TRANSLATE X,Y,Z,: <x,y,z>
-- ROTX ROTY ROTZ  DEGREES: <degrees>
-- NormalizeRot! Normalize! Align! Abut! AbutX! AbutY! AbutZ!

 scaleButton, scaleXYZPrompt: Buttons.Button;
 evenScaleButton, evenScaleXYZPrompt: Buttons.Button;
 translateButton, transXYZPrompt: Buttons.Button;
 rotxButton, rotyButton, rotzButton, degreesPrompt: Buttons.Button;
 normRot, norm, align, abut, abutX, abutY, abutZ: Buttons.Button;
 initialScaleXYZRope: Rope.ROPE ← "2, 2, 2";
 initialEvenScaleXYZRope: Rope.ROPE ← "2";
 initialTranslateXYZRope: Rope.ROPE ← "0, 200, 0";
 initialDegreesRope: Rope.ROPE ← "20";

-- SCALE  X,Y,Z: <x,y,z>

 scaleButton ← Buttons.Create[
  info: [name: "ScalePrimitive!", wy: editToolData.height, wh: entryHeight,
     parent: editToolData.outer, border: FALSE],
  proc: SVEditUser.ScalePrimitive,
  clientData: editToolData
  ];
  
 scaleXYZPrompt ← Buttons.Create[
  info: [name: "X, Y, Z:",
     wx: scaleButton.wx + column2,
     wy: editToolData.height, wh: entryHeight,
     parent: editToolData.outer, border: FALSE],
  proc: SVEditUser.ScaleXYZPrompt,
  clientData: editToolData
  ];

 editToolData.transformSection.scaleXYZ ← ViewerTools.MakeNewTextViewer[[
  parent: editToolData.outer,
  wx: scaleXYZPrompt.wx + scaleXYZPrompt.ww + entryHSpace,
  wy: editToolData.height,
  ww: VFonts.StringWidth["<<<188.88888, 188.88888, 188.88888"],
  wh: entryHeight,
  data: initialScaleXYZRope, -- "100"
  scrollable: FALSE, border: FALSE]];
  
 editToolData.height ← editToolData.height + entryVSpace + entryHeight;

-- EVENSCALE    X,Y,Z: <x,y,z>

 evenScaleButton ← Buttons.Create[
  info: [name: "EvenScale!", wy: editToolData.height, wh: entryHeight,
     parent: editToolData.outer, border: FALSE],
  proc: SVEditUser.EvenScale,
  clientData: editToolData
  ];
  
 evenScaleXYZPrompt ← Buttons.Create[
  info: [name: "scalar:",
     wx: scaleButton.wx + column2,
     wy: editToolData.height, wh: entryHeight,
     parent: editToolData.outer, border: FALSE],
  proc: SVEditUser.EvenScaleXYZPrompt,
  clientData: editToolData
  ];

 editToolData.transformSection.scalar ← ViewerTools.MakeNewTextViewer[[
  parent: editToolData.outer,
  wx: evenScaleXYZPrompt.wx + evenScaleXYZPrompt.ww + entryHSpace,
  wy: editToolData.height,
  ww: VFonts.StringWidth["188.88 "],
  wh: entryHeight,
  data: initialEvenScaleXYZRope, -- "2"
  scrollable: FALSE, border: FALSE]];
  
 editToolData.height ← editToolData.height + entryVSpace + entryHeight;



-- TRANSLATE X,Y,Z,: <x,y,z>

 translateButton ← Buttons.Create[
  info: [name: "Translate!",
      wy: editToolData.height, wh: entryHeight,
     parent: editToolData.outer, border: FALSE],
  proc: SVEditUser.Trans,
  clientData: editToolData
  ];
  
 transXYZPrompt ← Buttons.Create[
  info: [name: "X, Y, Z:",
     wx: translateButton.wx + column2,
     wy: editToolData.height, wh: entryHeight,
     parent: editToolData.outer, border: FALSE],
  proc: SVEditUser.TranslateXYZPrompt,
  clientData: editToolData
  ];
  
 editToolData.transformSection.transXYZ ← ViewerTools.MakeNewTextViewer[[
  parent: editToolData.outer,
  wx: transXYZPrompt.wx + transXYZPrompt.ww + entryHSpace,
  wy: editToolData.height,
  ww: VFonts.StringWidth["188.88, 188.88, 188.88"],
  wh: entryHeight,
  data: initialTranslateXYZRope, -- "100"
  scrollable: FALSE, border: FALSE]];
  
 editToolData.height ← editToolData.height + entryVSpace + entryHeight;

  
-- ROTX ROTY ROTZ  DEGREES: <degrees>

 rotxButton ← Buttons.Create[
  info: [name: "RotX!",
     wy: editToolData.height, wh: entryHeight,
     parent: editToolData.outer, border: FALSE],
  proc: SVEditUser.RotX,
  clientData: editToolData
  ];
  
 rotyButton ← Buttons.Create[
  info: [name: "RotY!",
     wx: rotxButton.wx + rotxButton.ww + entryHSpace,
     wy: editToolData.height, wh: entryHeight,
     parent: editToolData.outer, border: FALSE],
  proc: SVEditUser.RotY,
  clientData: editToolData
  ];
  
 rotzButton ← Buttons.Create[
  info: [name: "RotZ!",
     wx: rotyButton.wx + rotyButton.ww + entryHSpace,
     wy: editToolData.height, wh: entryHeight,
     parent: editToolData.outer, border: FALSE],
  proc: SVEditUser.RotZ,
  clientData: editToolData
  ];
  
 degreesPrompt ← Buttons.Create[
  info: [name: "degrees:",
     wx: rotxButton.wx + column2,
     wy: editToolData.height, wh: entryHeight,
     parent: editToolData.outer, border: FALSE],
  proc: SVEditUser.DegreesPrompt,
  clientData: editToolData
  ];
  
 editToolData.transformSection.degrees ← ViewerTools.MakeNewTextViewer[[
  parent: editToolData.outer,
  wx: degreesPrompt.wx + degreesPrompt.ww + entryHSpace,
  wy: editToolData.height,
  ww: VFonts.StringWidth["188.88, 188.88, 188.88"],
  wh: entryHeight,
  data: initialDegreesRope, -- "20"
  scrollable: FALSE, border: FALSE]];
  
 editToolData.height ← editToolData.height + entryVSpace + entryHeight;

 normRot ← Buttons.Create[
  info: [name: "NormalizeRot!",
     wy: editToolData.height, wh: entryHeight,
     parent: editToolData.outer, border: FALSE],
  proc: SVEditUserB.NormalizeRot,
  clientData: editToolData
  ];
  
 norm ← Buttons.Create[
  info: [name: "Normalize!",
     wx: normRot.wx + normRot.ww + entryHSpace,
     wy: editToolData.height, wh: entryHeight,
     parent: editToolData.outer, border: FALSE],
  proc: SVEditUserB.Normalize,
  clientData: editToolData
  ];
  
 align ← Buttons.Create[
  info: [name: "Align!",
     wx: norm.wx + norm.ww + entryHSpace,
     wy: editToolData.height, wh: entryHeight,
     parent: editToolData.outer, border: FALSE],
  proc: SVEditUserB.Align,
  clientData: editToolData
  ];
  
 abut ← Buttons.Create[
  info: [name: "Abut!",
     wx: align.wx + align.ww + entryHSpace,
     wy: editToolData.height, wh: entryHeight,
     parent: editToolData.outer, border: FALSE],
  proc: SVEditUserB.Abut,
  clientData: editToolData
  ];
  
 abutX ← Buttons.Create[
  info: [name: "AbutX!",
     wx: abut.wx + abut.ww + entryHSpace,
     wy: editToolData.height, wh: entryHeight,
     parent: editToolData.outer, border: FALSE],
  proc: SVEditUserB.AbutX,
  clientData: editToolData
  ];
  
 abutY ← Buttons.Create[
  info: [name: "AbutY!",
     wx: abutX.wx + abutX.ww + entryHSpace,
     wy: editToolData.height, wh: entryHeight,
     parent: editToolData.outer, border: FALSE],
  proc: SVEditUserB.AbutY,
  clientData: editToolData
  ];
  
 abutZ ← Buttons.Create[
  info: [name: "AbutZ!",
     wx: abutY.wx + abutY.ww + entryHSpace,
     wy: editToolData.height, wh: entryHeight,
     parent: editToolData.outer, border: FALSE],
  proc: SVEditUserB.AbutZ,
  clientData: editToolData
  ];
  
  
 editToolData.height ← editToolData.height + entryVSpace + entryHeight;
  
}; -- end of BuildTransfromSection

BuildListingSection: PUBLIC PROC [editToolData: EditToolData] = {
-- This section implements a set of buttons in this format:
-- LISTSCENES LISTASSEMBLIES LISTCS LISTLIGHTS LISTMOs ListViewers

 scenesButton, assembliesButton, coordsysButton, lightsButton, moButton, viewersButton: Buttons.Button;
  
 scenesButton ← Buttons.Create[
  info: [name: "ListScenes!", wy: editToolData.height, wh: entryHeight,
     parent: editToolData.outer, border: FALSE],
  proc: SVEditUserB.ListScenes,
  clientData: editToolData
  ];
  
 assembliesButton ← Buttons.Create[
  info: [name: "ListAssemblies!",
     wx: scenesButton.wx + scenesButton.ww + entryHSpace,
     wy: editToolData.height, wh: entryHeight,
     parent: editToolData.outer, border: FALSE],
  proc: SVEditUserB.ListAssemblies,
  clientData: editToolData
  ];
  
 coordsysButton ← Buttons.Create[
  info: [name: "ListCS!",
     wx: assembliesButton.wx + assembliesButton.ww + entryHSpace,
     wy: editToolData.height, wh: entryHeight,
     parent: editToolData.outer, border: FALSE],
  proc: SVEditUserB.ListCoordSystems,
  clientData: editToolData
  ];
  
 lightsButton ← Buttons.Create[
  info: [name: "ListLights!",
     wx: coordsysButton.wx + coordsysButton.ww + entryHSpace,
     wy: editToolData.height, wh: entryHeight,
     parent: editToolData.outer, border: FALSE],
  proc: SVEditUserB.ListLights,
  clientData: editToolData
  ];
  
 moButton ← Buttons.Create[
  info: [name: "ListMOs!",
     wx: lightsButton.wx + lightsButton.ww + entryHSpace,
     wy: editToolData.height, wh: entryHeight,
     parent: editToolData.outer, border: FALSE],
  proc: SVEditUserB.ListMasterObjects,
  clientData: editToolData
  ];
  
 viewersButton ← Buttons.Create[
  info: [name: "ListViews!",
     wx: moButton.wx + moButton.ww + entryHSpace,
     wy: editToolData.height, wh: entryHeight,
     parent: editToolData.outer, border: FALSE],
  proc: SVEditUserB.ListViewers,
  clientData: editToolData
  ];
  
 editToolData.height ← editToolData.height + entryVSpace + entryHeight;

}; -- end of BuildListingSection

AddARule: PUBLIC PROC [editToolData: EditToolData] = {
 rule: Rules.Rule;

 rule ← Rules.Create[[
  parent: editToolData.outer,
  wy: editToolData.height,
  ww: editToolData.outer.cw,
  wh: 2
  ]];
 Containers.ChildXBound[editToolData.outer, rule];
 editToolData.height ← editToolData.height + rule.wh + entryVSpace;
 }; -- end of AddARule

END.