BuildLightSourceSection:
PUBLIC
PROC [editToolData: EditToolData] = {
This section implements a set of buttons, text windows, and options listers in this format:
AddLight! DeleteLight! EditLight!
lightName: <rope> position: <BOOL> color: <red, green, blue>
addLightButton, deleteLightButton, editLightButton: Buttons.Button;
lightNamePrompt, positionPrompt, colorPrompt: Buttons.Button;
setAmbientButton, getAmbientButton: Buttons.Button;
addLightButton ← Buttons.Create[
info: [name: "AddLight!",
wy: editToolData.height, wh: entryHeight,
parent: editToolData.outer, border: FALSE],
proc: SVEditUserB.AddLight,
clientData: editToolData
];
deleteLightButton ← Buttons.Create[
info: [name: "DeleteLight!",
wx: addLightButton.wx + addLightButton.ww + entryHSpace,
wy: editToolData.height, wh: entryHeight,
parent: editToolData.outer, border: FALSE],
proc: SVEditUserB.DeleteLight,
clientData: editToolData
];
editLightButton ← Buttons.Create[
info: [name: "EditLight!",
wx: deleteLightButton.wx + deleteLightButton.ww + entryHSpace,
wy: editToolData.height, wh: entryHeight,
parent: editToolData.outer, border: FALSE],
proc: SVEditUserB.EditLight,
clientData: editToolData
];
editToolData.height ← editToolData.height + entryVSpace + entryHeight;
lightNamePrompt ← Buttons.Create[
info: [name: "light name:",
wy: editToolData.height, wh: entryHeight,
parent: editToolData.outer, border: FALSE],
proc: SVEditUser.LightNamePrompt,
clientData: editToolData
];
editToolData.lightSection.name ← ViewerTools.MakeNewTextViewer[[
parent: editToolData.outer,
wx: lightNamePrompt.wx + lightNamePrompt.ww + entryHSpace,
wy: editToolData.height,
ww: VFonts.StringWidth["MysteriousLight "],
wh: entryHeight,
data: "WhiteLight",
scrollable: FALSE, border: FALSE]];
positionPrompt ← Buttons.Create[
info: [name: "position:",
wx: editToolData.lightSection.name.wx +
editToolData.lightSection.name.ww + entryHSpace,
wy: editToolData.height, wh: entryHeight,
parent: editToolData.outer, border: FALSE],
proc: SVEditUser.LightPositionPrompt,
clientData: editToolData
];
editToolData.lightSection.position ← ViewerTools.MakeNewTextViewer[[
parent: editToolData.outer,
wx: positionPrompt.wx + positionPrompt.ww + entryHSpace,
wy: editToolData.height,
ww: numberSize3,
wh: entryHeight,
data: "600, 600, 600",
scrollable: FALSE, border: FALSE]];
editToolData.height ← editToolData.height + entryVSpace + entryHeight;
colorPrompt ← Buttons.Create[
info: [name: "color:",
wy: editToolData.height, wh: entryHeight,
parent: editToolData.outer, border: FALSE],
proc: SVEditUser.LightColorPrompt,
clientData: editToolData
];
editToolData.lightSection.color ← ViewerTools.MakeNewTextViewer[[
parent: editToolData.outer,
wx: colorPrompt.wx + colorPrompt.ww + entryHSpace,
wy: editToolData.height,
ww: numberSize3,
wh: entryHeight,
data: "0.75, 0.75, 0.75",
scrollable: FALSE, border: FALSE]];
setAmbientButton ← Buttons.Create[
info: [name: "SetAmbient!",
wx: editToolData.lightSection.color.wx +
editToolData.lightSection.color.ww + entryHSpace,
wy: editToolData.height, wh: entryHeight,
parent: editToolData.outer, border: FALSE],
proc: SVEditUserB.SetAmbient,
clientData: editToolData
];
getAmbientButton ← Buttons.Create[
info: [name: "GetAmbient!",
wx: setAmbientButton.wx + setAmbientButton.ww + entryHSpace,
wy: editToolData.height, wh: entryHeight,
parent: editToolData.outer, border: FALSE],
proc: SVEditUserB.GetAmbient,
clientData: editToolData
];
editToolData.height ← editToolData.height + entryVSpace + entryHeight;
};
BuildShadowSection:
PUBLIC
PROC [editToolData: EditToolData] = {
This section implements a set of buttons in this format:
Shadows: FALSE Set!
shadowPrompt, setShadows: Buttons.Button;
Shadows: FALSE Set!
shadowPrompt ← Buttons.Create[
info: [name: "Shadows:",
wy: editToolData.height, wh: entryHeight,
parent: editToolData.outer, border: FALSE],
proc: SVEditUser.ShadowsPrompt,
clientData: editToolData
];
editToolData.shadowSection.shadowLabel ← Labels.Create[
info: [name: "FALSE",
wx: shadowPrompt.wx + shadowPrompt.ww + entryHSpace,
wy: editToolData.height, wh: entryHeight,
parent: editToolData.outer, border: FALSE]];
editToolData.shadowSection.shadowValue ← FALSE;
setShadows ← Buttons.Create[
info: [name: "Set!",
wx: editToolData.shadowSection.shadowLabel.wx + editToolData.shadowSection.shadowLabel.ww + entryHSpace,
wy: editToolData.height, wh: entryHeight,
parent: editToolData.outer, border: FALSE],
proc: SVEditUser.SetShadows,
clientData: editToolData
];
editToolData.height ← editToolData.height + entryVSpace + entryHeight;
};
boldFont: VFonts.Font ← VFonts.EstablishFont[family: "Helvetica", size: 10, bold: TRUE,
italic: FALSE, defaultOnFailure: TRUE];
BuildTransformSection1:
PUBLIC
PROC [editToolData: EditToolData] = {
This section implements a set of buttons, text windows, and options listers in this format:
SCALE PRIMITIVE X,Y,Z: <x,y,z>
EVENSCALEs scalar: <real>
scaleButton, scaleXYZPrompt: Buttons.Button;
evenScaleButton, evenScaleXYZPrompt: Buttons.Button;
SCALEX,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,
font: boldFont
];
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: numberSize3,
wh: entryHeight,
data: "2, 2, 2",
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,
font: boldFont
];
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: numberSize,
wh: entryHeight,
data: "2",
scrollable: FALSE, border: FALSE]];
editToolData.height ← editToolData.height + entryVSpace + entryHeight;
};
BuildTransformSection2:
PUBLIC
PROC [editToolData: EditToolData] = {
TRANSLATE X,Y,Z,:<x,y,z>
ROTX ROTY ROTZ DEGREES: <degrees>
NormalizeRot! Normalize! Align! Abut! AbutX! AbutY! AbutZ!
translateButton, transXYZPrompt: Buttons.Button;
rotxButton, rotyButton, rotzButton, degreesPrompt: Buttons.Button;
normRot, norm, align, abut, abutX, abutY, abutZ: Buttons.Button;
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,
font: boldFont
];
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: numberSize3,
wh: entryHeight,
data: "0, 200, 0",
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,
font: boldFont
];
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,
font: boldFont
];
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,
font: boldFont
];
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: numberSize,
wh: entryHeight,
data: "90",
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