DIAG: clean up squares function

This commit is contained in:
hasufell 2014-11-14 21:29:10 +01:00
parent ecf203c825
commit da5b0a17f0
No known key found for this signature in database
GPG Key ID: 220CD1C5BDEED020
1 changed files with 5 additions and 9 deletions

View File

@ -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