diff --git a/dotscape b/dotscape index d4690eb..df370f4 100755 Binary files a/dotscape and b/dotscape differ diff --git a/functional-core/app-init.sml b/functional-core/app-init.sml index d269f75..0bc5b17 100644 --- a/functional-core/app-init.sml +++ b/functional-core/app-init.sml @@ -12,9 +12,6 @@ struct let val xClickPoints = ClickPoints.generate (wStart, wFinish) val yClickPoints = ClickPoints.generate (hStart, hFinish) - val graphLines = - GraphLines.generate - (windowWidth, windowHeight, xClickPoints, yClickPoints) in { triangles = [] , triangleStage = NO_TRIANGLE @@ -22,7 +19,6 @@ struct , windowHeight = windowHeight , xClickPoints = xClickPoints , yClickPoints = yClickPoints - , graphLines = graphLines , undo = [] , redo = [] , mouseX = 0.0 diff --git a/functional-core/app-type.sml b/functional-core/app-type.sml index 5292f58..bda5e45 100644 --- a/functional-core/app-type.sml +++ b/functional-core/app-type.sml @@ -22,7 +22,6 @@ sig , windowHeight: int , xClickPoints: Real32.real vector , yClickPoints: Real32.real vector - , graphLines: Real32.real vector , undo: (Real32.real * Real32.real) list , redo: (Real32.real * Real32.real) list , mouseX: Real32.real @@ -62,7 +61,6 @@ struct , windowHeight: int , xClickPoints: Real32.real vector , yClickPoints: Real32.real vector - , graphLines: Real32.real vector , undo: (Real32.real * Real32.real) list , redo: (Real32.real * Real32.real) list , mouseX: Real32.real diff --git a/functional-core/app-update.sml b/functional-core/app-update.sml index ef97964..2ac9ad4 100644 --- a/functional-core/app-update.sml +++ b/functional-core/app-update.sml @@ -69,7 +69,7 @@ struct let val model = AppWith.windowResize (model, width, height) val triangles = Triangles.toVector model - val graphLines = #graphLines model + val graphLines = GraphLines.generate model val drawMsg = RESIZE_TRIANGLES_BUTTONS_AND_GRAPH {triangles = triangles, graphLines = graphLines} diff --git a/functional-core/app-with.sml b/functional-core/app-with.sml index 65c5c77..b8484a6 100644 --- a/functional-core/app-with.sml +++ b/functional-core/app-with.sml @@ -55,7 +55,6 @@ struct , yClickPoints , windowWidth , windowHeight - , graphLines , undo , redo = _ , mouseX @@ -72,7 +71,6 @@ struct , yClickPoints = yClickPoints , windowWidth = windowWidth , windowHeight = windowHeight - , graphLines = graphLines , mouseX = mouseX , mouseY = mouseY } @@ -87,7 +85,6 @@ struct , yClickPoints , windowWidth , windowHeight - , graphLines , undo , redo = _ , mouseX @@ -106,7 +103,6 @@ struct , yClickPoints = yClickPoints , windowWidth = windowWidth , windowHeight = windowHeight - , graphLines = graphLines , mouseX = mouseX , mouseY = mouseY } @@ -121,7 +117,6 @@ struct , yClickPoints = _ , windowWidth = _ , windowHeight = _ - , graphLines = _ , triangles , triangleStage , undo @@ -132,13 +127,9 @@ struct val xClickPoints = ClickPoints.generate (wStart, wFinish) val yClickPoints = ClickPoints.generate (hStart, hFinish) - val graphLines = - GraphLines.generate - (windowWidth, windowHeight, xClickPoints, yClickPoints) in { xClickPoints = xClickPoints , yClickPoints = yClickPoints - , graphLines = graphLines , triangles = triangles , triangleStage = triangleStage , windowWidth = windowWidth @@ -184,7 +175,6 @@ struct , yClickPoints , windowWidth , windowHeight - , graphLines , undo , redo } = app @@ -197,7 +187,6 @@ struct , yClickPoints = yClickPoints , windowWidth = windowWidth , windowHeight = windowHeight - , graphLines = graphLines , undo = undo , redo = redo } @@ -213,7 +202,6 @@ struct , yClickPoints , windowWidth , windowHeight - , graphLines , undo , redo , mouseX @@ -235,7 +223,6 @@ struct , yClickPoints = yClickPoints , windowWidth = windowWidth , windowHeight = windowHeight - , graphLines = graphLines , mouseX = mouseX , mouseY = mouseY } @@ -251,7 +238,6 @@ struct , yClickPoints , windowWidth , windowHeight - , graphLines , undo , redo , mouseX @@ -272,7 +258,6 @@ struct , yClickPoints = yClickPoints , windowWidth = windowWidth , windowHeight = windowHeight - , graphLines = graphLines , mouseX = mouseX , mouseY = mouseY } diff --git a/functional-core/graph-lines.sml b/functional-core/graph-lines.sml index 510a63b..7c085df 100644 --- a/functional-core/graph-lines.sml +++ b/functional-core/graph-lines.sml @@ -1,7 +1,6 @@ signature GRAPH_LINES = sig - val generate: int * int * Real32.real vector * Real32.real vector - -> Real32.real vector + val generate: AppType.app_type -> Real32.real vector end structure GraphLines :> GRAPH_LINES = @@ -134,7 +133,7 @@ struct (pos + 1, yClickPoints, acc, halfHeight, xMin, xMax) end - fun generate (windowWidth, windowHeight, xClickPoints, yClickPoints) = + fun helpGenerate (windowWidth, windowHeight, xClickPoints, yClickPoints) = if windowWidth = windowHeight then helpGenGraphLinesSquare (~1.0, 1.0, []) else if windowWidth > windowHeight then @@ -180,4 +179,11 @@ struct in Vector.concat lines end + + fun generate (app: AppType.app_type) = + let + val {windowWidth, windowHeight, xClickPoints, yClickPoints, ...} = app + in + helpGenerate (windowWidth, windowHeight, xClickPoints, yClickPoints) + end end diff --git a/imperative-shell/shell.sml b/imperative-shell/shell.sml index 017925b..6045e24 100644 --- a/imperative-shell/shell.sml +++ b/imperative-shell/shell.sml @@ -19,12 +19,7 @@ struct AppInit.fromWindowWidthAndHeight (Constants.windowWidth, Constants.windowHeight) - val graphLines = - let - open AppType - in - #graphLines initialModel - end + val graphLines = GraphLines.generate initialModel val graphDrawObject = AppDraw.initGraphLines () val _ = AppDraw.uploadGraphLines (graphDrawObject, graphLines)