From d9b4402ae212da65776d172d8990ce52fb7d003f Mon Sep 17 00:00:00 2001 From: Eduardo Cavazos Date: Mon, 1 Dec 2008 13:16:30 -0600 Subject: [PATCH] boids.ui: removed --- extra/boids/ui/ui.factor | 176 --------------------------------------- 1 file changed, 176 deletions(-) delete mode 100755 extra/boids/ui/ui.factor diff --git a/extra/boids/ui/ui.factor b/extra/boids/ui/ui.factor deleted file mode 100755 index ddb25ccd8d..0000000000 --- a/extra/boids/ui/ui.factor +++ /dev/null @@ -1,176 +0,0 @@ - -USING: combinators.short-circuit kernel namespaces - math - math.trig - math.functions - math.vectors - math.parser - hashtables sequences threads - colors - opengl - opengl.gl - ui - ui.gadgets - ui.gadgets.handler - ui.gadgets.slate - ui.gadgets.theme - ui.gadgets.frames - ui.gadgets.labels - ui.gadgets.buttons - ui.gadgets.packs - ui.gadgets.grids - ui.gestures - assocs.lib vars rewrite-closures boids accessors - math.geometry.rect - newfx - processing.shapes ; - -IN: boids.ui - -! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! -! draw-boid -! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! - -: draw-boid ( boid -- ) - glPushMatrix - dup pos>> gl-translate-2d - vel>> first2 rect> arg rad>deg 0 0 1 glRotated - { { 0 5 } { 0 -5 } { 20 0 } } triangle - fill-mode - glPopMatrix ; - -: draw-boids ( -- ) boids> [ draw-boid ] each ; - -: boid-color ( -- color ) T{ rgba f 1.0 0 0 0.3 } ; - -: display ( -- ) - boid-color >fill-color - draw-boids ; - -! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! - -VAR: slate - -VAR: loop - -: run ( -- ) - slate> rect-dim >world-size - iterate-boids - slate> relayout-1 - yield - loop> [ run ] when ; - -: button* ( string quot -- button ) closed-quot ; - -: toggle-loop ( -- ) loop> [ loop off ] [ loop on [ run ] in-thread ] if ; - -VARS: population-label cohesion-label alignment-label separation-label ; - -! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! - -: update-population-label ( -- ) - "Population: " boids> length number>string append - 20 32 pad-right population-label> set-label-string ; - -: add-10-boids ( -- ) - boids> 10 random-boids append >boids update-population-label ; - -: sub-10-boids ( -- ) - boids> 10 tail >boids update-population-label ; - -! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! - -: truncate-value ( n -- n ) 10 * round 10 / ; - -: update-cohesion-label ( -- ) - "Cohesion: " cohesion-weight> truncate-value number>string append - 20 32 pad-right cohesion-label> set-label-string ; - -: update-alignment-label ( -- ) - "Alignment: " alignment-weight> truncate-value number>string append - 20 32 pad-right alignment-label> set-label-string ; - -: update-separation-label ( -- ) - "Separation: " separation-weight> truncate-value number>string append - 20 32 pad-right separation-label> set-label-string ; - -: inc-cohesion-weight ( -- ) cohesion-weight inc* update-cohesion-label ; -: dec-cohesion-weight ( -- ) cohesion-weight dec* update-cohesion-label ; - -: inc-alignment-weight ( -- ) alignment-weight inc* update-alignment-label ; -: dec-alignment-weight ( -- ) alignment-weight dec* update-alignment-label ; - -: inc-separation-weight ( -- ) separation-weight inc* update-separation-label ; -: dec-separation-weight ( -- ) separation-weight dec* update-separation-label ; - -: boids-window* ( -- ) - init-variables init-world-size init-boids loop on - - ""