Graph: Commander.CommandProc ~ {
g: GraphData ¬ NEW[GraphDataRep];
g.camera ¬ G3dControl.InitCameraControl[proc: CameraControl, clientData: g];
Controls.SetSliderDialValue[g.camera.par.zMov, -0.5];
g.a ¬ Controls.NewControl["A", , g, , , , Controller];
g.xMin ¬ Controls.NewControl["Xmin", , g, -1.0, 1.0, 0.0, Controller];
g.yMin ¬ Controls.NewControl["Ymin", , g, -1.0, 1.0, 0.0, Controller];
g.xMax ¬ Controls.NewControl["Xmax", , g, -1.0, 1.0, 1.0, Controller];
g.yMax ¬ Controls.NewControl["Ymax", , g, -1.0, 1.0, 1.0, Controller];
g.zScale ¬ Controls.NewControl["Zscale", , g, -5.0, 5.0, 1.0, Controller];
g.grain ¬ Controls.NewControl["Grain", , g, 0.05, 1.0, 0.1, Controller];
ComputeValues[g];
g.outerData ¬ Controls.OuterViewer[
name: "3dGraph Gauss",
buttons:
LIST[
Controls.ClickButton["Interpress-Out", InterpressOut, g],
Controls.ClickButton["Function", FunctionSelect, g],
Controls.ClickButton["Axes-On", ToggleAxes, g]
],
controls:
LIST[
g.camera.proxySelect,
g.camera.proxy.xMov, g.camera.proxy.yMov, g.camera.proxy.zMov,
g.camera.proxy.xRot, g.camera.proxy.yRot, g.camera.proxy.zRot,
g.xMin, g.xMax, g.yMin, g.yMax, g.zScale, g.grain],
controlSizes: [17, 200, 60, 20, 60, 150, 150],
graphicsHeight: 300,
drawProc: DrawProc,
typescriptHeight: 18,
biScrollable: TRUE,
clientData: g];
g.outer ¬ g.outerData.parent;
g.graphics ¬ g.outerData.graphics;
};
Controller: Controls.ControlProc ~ {
g: GraphData ¬ NARROW[control.clientData];
Set: PROC [control: Control, value: REAL] ~ {Controls.SetSliderDialValue[control, value]};
SELECT control
FROM
g.xMin => IF g.xMin.value > g.xMax.value THEN Set[g.xMax, g.xMin.value];
g.yMin => IF g.yMin.value > g.yMax.value THEN Set[g.yMax, g.yMin.value];
g.xMax => IF g.xMax.value < g.xMin.value THEN Set[g.xMin, g.xMax.value];
g.yMax => IF g.xMax.value < g.xMin.value THEN Set[g.yMin, g.yMax.value];
ENDCASE;
Set[g.grain, MAX[g.grain.value, (g.xMax.value-g.xMin.value)/(arraySize-1), (g.yMax.value-g.yMin.value)/(arraySize-1)]];
IF control.whatChanged = $TypedIn
OR control.mouse.button = right
THEN Repaint[g, $Controller];
};