]> gitweb.michael.orlitzky.com - spline3.git/commitdiff
Whitespace and import cleanup in Cube.
authorMichael Orlitzky <michael@orlitzky.com>
Thu, 16 Apr 2015 01:13:28 +0000 (21:13 -0400)
committerMichael Orlitzky <michael@orlitzky.com>
Thu, 16 Apr 2015 01:13:28 +0000 (21:13 -0400)
src/Cube.hs

index 7fce9754b539c37f1a34386caea1212fe181ae0e..6e33423d2da3a828257b21ab85055db58b681af8 100644 (file)
@@ -3,11 +3,10 @@ module Cube (
   cube_properties,
   find_containing_tetrahedron,
   tetrahedra,
   cube_properties,
   find_containing_tetrahedron,
   tetrahedra,
-  tetrahedron
-  )
+  tetrahedron )
 where
 
 where
 
-import Data.Maybe (fromJust)
+import Data.Maybe ( fromJust )
 import qualified Data.Vector as V (
   Vector,
   findIndex,
 import qualified Data.Vector as V (
   Vector,
   findIndex,
@@ -15,21 +14,26 @@ import qualified Data.Vector as V (
   minimum,
   singleton,
   snoc,
   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,
 
 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
     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
         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
             front_right_down_tetrahedra cube
 
-      else -- bottom half
-
+      | otherwise = -- back half
         if left_half then
           if top_half then
             back_left_top_tetrahedra cube
         if left_half then
           if top_half then
             back_left_top_tetrahedra cube