From: Michael Orlitzky Date: Thu, 16 Apr 2015 01:13:28 +0000 (-0400) Subject: Whitespace and import cleanup in Cube. X-Git-Tag: 0.0.1~18 X-Git-Url: https://gitweb.michael.orlitzky.com/?a=commitdiff_plain;h=7cee33b2fa4789525a12685923edf1f38924a7f4;p=spline3.git Whitespace and import cleanup in Cube. --- diff --git a/src/Cube.hs b/src/Cube.hs index 7fce975..6e33423 100644 --- a/src/Cube.hs +++ b/src/Cube.hs @@ -3,11 +3,10 @@ module Cube ( cube_properties, find_containing_tetrahedron, tetrahedra, - tetrahedron - ) + tetrahedron ) where -import Data.Maybe (fromJust) +import Data.Maybe ( fromJust ) import qualified Data.Vector as V ( Vector, findIndex, @@ -15,21 +14,26 @@ import qualified Data.Vector as V ( minimum, singleton, snoc, - unsafeIndex - ) - -import Prelude hiding (LT) -import Test.Framework (Test, testGroup) -import Test.Framework.Providers.QuickCheck2 (testProperty) -import Test.QuickCheck (Arbitrary(..), Gen, Positive(..), choose) - -import Cardinal -import Comparisons ((~=), (~~=)) -import qualified Face (Face(..), center) -import FunctionValues (FunctionValues, eval, rotate) -import Misc (all_equal, disjoint) -import Point (Point(..), dot) -import Tetrahedron (Tetrahedron(..), barycenter, c, volume) + unsafeIndex) +import Prelude hiding ( LT ) +import Test.Framework ( Test, testGroup ) +import Test.Framework.Providers.QuickCheck2 ( testProperty ) +import Test.QuickCheck ( Arbitrary(..), Gen, Positive(..), choose ) + +import Cardinal ( + Cardinal(..), + ccwx, + ccwy, + ccwz, + cwx, + cwy, + cwz ) +import Comparisons ( (~=), (~~=) ) +import qualified Face ( Face(..), center ) +import FunctionValues ( FunctionValues, eval, rotate ) +import Misc ( all_equal, disjoint ) +import Point ( Point(..), dot ) +import Tetrahedron ( Tetrahedron(..), barycenter, c, volume ) data Cube = Cube { i :: !Int, j :: !Int, @@ -604,9 +608,8 @@ find_containing_tetrahedron cube p = left_half = in_left_half cube p candidates :: V.Vector Tetrahedron - candidates = - if front_half then - + candidates + | front_half = if left_half then if top_half then front_left_top_tetrahedra cube @@ -618,8 +621,7 @@ find_containing_tetrahedron cube p = else front_right_down_tetrahedra cube - else -- bottom half - + | otherwise = -- back half if left_half then if top_half then back_left_top_tetrahedra cube