From: John Benediktsson Date: Mon, 22 Jan 2018 16:53:15 +0000 (-0800) Subject: cartesian: move to it's proper ui.gadgets.cartesian place. X-Git-Url: https://gitweb.factorcode.org/gitweb.cgi?p=factor-unmaintained.git;a=commitdiff_plain;h=e0204a28996841e9b81455ee71bcb320491d2705 cartesian: move to it's proper ui.gadgets.cartesian place. --- diff --git a/cartesian/cartesian.factor b/cartesian/cartesian.factor deleted file mode 100644 index 730b0f5..0000000 --- a/cartesian/cartesian.factor +++ /dev/null @@ -1,42 +0,0 @@ - -USING: kernel combinators sequences opengl.gl - ui.render ui.gadgets ui.gadgets.slate - accessors ; - -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 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 ; - -! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! - -: 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* ; - -! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! - diff --git a/ui/gadgets/cartesian/cartesian.factor b/ui/gadgets/cartesian/cartesian.factor new file mode 100644 index 0000000..730b0f5 --- /dev/null +++ b/ui/gadgets/cartesian/cartesian.factor @@ -0,0 +1,42 @@ + +USING: kernel combinators sequences opengl.gl + ui.render ui.gadgets ui.gadgets.slate + accessors ; + +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 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 ; + +! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + +: 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* ; + +! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! +