From bb0b0a951b4de4c6283ad27a79d800aa328e49e0 Mon Sep 17 00:00:00 2001 From: hasufell Date: Wed, 8 Oct 2014 16:35:19 +0200 Subject: [PATCH] Allow choosing convex hull algorithm This is still a no-op. --- Gtk.hs | 16 ++++++++++------ gtk2.glade | 3 ++- 2 files changed, 12 insertions(+), 7 deletions(-) diff --git a/Gtk.hs b/Gtk.hs index dff123b..f86b2d3 100644 --- a/Gtk.hs +++ b/Gtk.hs @@ -187,10 +187,11 @@ drawDiag' fp mygui = dw <- widgetGetDrawWindow (da mygui) adjustment <- rangeGetAdjustment (hs mygui) scaleVal <- adjustmentGetValue adjustment - xlD' <- entryGetText (xl mygui) - xuD' <- entryGetText (xu mygui) - ylD' <- entryGetText (yl mygui) - yuD' <- entryGetText (yu mygui) + xlD' <- entryGetText (xl mygui) + xuD' <- entryGetText (xu mygui) + ylD' <- entryGetText (yl mygui) + yuD' <- entryGetText (yu mygui) + alg' <- comboBoxGetActive (cB mygui) -- clear drawing area clearDiag mygui @@ -205,7 +206,8 @@ drawDiag' fp mygui = (CairoOptions "" (Width 600) SVG False) (diagS (def{t = scaleVal, dX = xD', - dY = yD'}) + dY = yD', + alg = alg'}) mesh) renderWithDrawable dw r return 0 @@ -228,6 +230,7 @@ saveDiag' fp mygui = xuD' <- entryGetText (xu mygui) ylD' <- entryGetText (yl mygui) yuD' <- entryGetText (yu mygui) + alg' <- comboBoxGetActive (cB mygui) let xD = (,) <$> readMaybe xlD' <*> readMaybe xuD' :: Maybe (Double, Double) @@ -238,7 +241,8 @@ saveDiag' fp mygui = renderCairo "out.svg" (Width 600) (diagS (def{t = scaleVal, dX = xD', - dY = yD'}) + dY = yD', + alg = alg'}) mesh) return 0 _ -> return 1 diff --git a/gtk2.glade b/gtk2.glade index 30a04d1..47ea24f 100644 --- a/gtk2.glade +++ b/gtk2.glade @@ -702,7 +702,8 @@ Malte Flender <malte.flender@fh-bielefeld.de> True False - Show points + Show points +Show convex hull False