From da5b0a17f064e372c830b3000db772f23f6afb78 Mon Sep 17 00:00:00 2001 From: hasufell Date: Fri, 14 Nov 2014 21:29:10 +0100 Subject: [PATCH] DIAG: clean up squares function --- Graphics/Diagram/Plotter.hs | 14 +++++--------- 1 file changed, 5 insertions(+), 9 deletions(-) diff --git a/Graphics/Diagram/Plotter.hs b/Graphics/Diagram/Plotter.hs index 295b555..3da4320 100644 --- a/Graphics/Diagram/Plotter.hs +++ b/Graphics/Diagram/Plotter.hs @@ -170,21 +170,17 @@ convexHStepsLs = GifDiag chs (strokeTrail . fromVertices $ vt') # moveTo (head vt') # lc col --- FIXME: hardcoded dimensions +-- |Create a diagram that shows all squares of the RangeSearch algorithm +-- from the quad tree. squares :: Diag squares = Diag f where f p (Object []) = mempty f p (Object vt) = mconcat - $ (\((xmin, xmax), (ymin, ymax)) -> rect (xmax - xmin) (ymax - ymin) # - moveTo (p2 ( - ((xmax + xmin) / 2), - ((ymax + ymin) / 2) - ) - ) # - lw ultraThin) - <$> (quadTreeSquares ((0,500), (0,500)) . quadTree vtf $ (dX p, dY p)) + $ (\((xmin, xmax), (ymin, ymax)) -> rect (xmax - xmin) (ymax - ymin) + # moveTo (p2 ((xmax + xmin) / 2, (ymax + ymin) / 2)) # lw ultraThin) + <$> (quadTreeSquares (dX p, dY p) . quadTree vtf $ (dX p, dY p)) where vtf = filterValidPT p vt f _ _ = mempty