]> gitweb.factorcode.org Git - factor.git/blobdiff - extra/ui/gadgets/cartesian/cartesian.factor
ui.gadgets.cartesian: cleanup
[factor.git] / extra / ui / gadgets / cartesian / cartesian.factor
index 730b0f5b4417266e6ced4de34a18089a583b6dd7..f14c96fd3223005de15591ff71af4cc7bd6699c2 100644 (file)
@@ -1,42 +1,31 @@
 
-USING: kernel combinators sequences opengl.gl
-       ui.render ui.gadgets ui.gadgets.slate
-       accessors ;
+USING: accessors combinators kernel opengl.gl sequences
+ui.gadgets.slate ;
 
 IN: ui.gadgets.cartesian
 
-! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
-
 TUPLE: cartesian < slate x-min x-max y-min y-max z-min z-max perspective ;
 
 : init-cartesian ( cartesian -- cartesian )
-  init-slate
-  -10 >>x-min
-   10 >>x-max
-  -10 >>y-min
-   10 >>y-max
-   -1 >>z-min
-    1 >>z-max ;
-
-: <cartesian> ( -- cartesian ) cartesian new init-cartesian ;
-
-! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
-
-M: cartesian establish-coordinate-system ( cartesian -- cartesian )
-   dup
-   {
-     [ x-min>> ] [ x-max>> ]
-     [ y-min>> ] [ y-max>> ]
-     [ z-min>> ] [ z-max>> ]
-   }
-   cleave
-   glOrtho ;
-
-! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
+    init-slate
+    -10 >>x-min
+     10 >>x-max
+    -10 >>y-min
+     10 >>y-max
+     -1 >>z-min
+      1 >>z-max ;
+
+: <cartesian> ( -- cartesian )
+    cartesian new init-cartesian ;
+
+M: cartesian establish-coordinate-system
+    dup {
+        [ x-min>> ] [ x-max>> ]
+        [ y-min>> ] [ y-max>> ]
+        [ z-min>> ] [ z-max>> ]
+    } cleave glOrtho ;
 
 : x-range ( cartesian range -- cartesian ) first2 [ >>x-min ] [ >>x-max ] bi* ;
 : y-range ( cartesian range -- cartesian ) first2 [ >>y-min ] [ >>y-max ] bi* ;
 : z-range ( cartesian range -- cartesian ) first2 [ >>z-min ] [ >>z-max ] bi* ;
 
-! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
-