[Gridflow-cvs] [svn] commit: r4557 - in /trunk: abstractions/doc_also.pd abstractions/doc_m.pd base/flow_objects2.c

gridflow-cvs at artengine.ca gridflow-cvs at artengine.ca
Sat Oct 31 21:00:20 EDT 2009


Author: matju
Date: Sat Oct 31 21:00:19 2009
New Revision: 4557

Log:
merged 'box_align_same_x' and 'box_align_same_y' as 'box_align'

Modified:
    trunk/abstractions/doc_also.pd
    trunk/abstractions/doc_m.pd
    trunk/base/flow_objects2.c

Modified: trunk/abstractions/doc_also.pd
==============================================================================
--- trunk/abstractions/doc_also.pd (original)
+++ trunk/abstractions/doc_also.pd Sat Oct 31 21:00:19 2009
@@ -1,4 +1,4 @@
-#N canvas 49 157 560 322 10;
+#N canvas 49 157 658 459 10;
 #X obj 0 0 cnv 15 92 17 empty \$0-rect See also: 35 9 1 9 -88239
 -262144 0;
 #X obj 409 156 gf/canvas_setpos 0;
@@ -11,8 +11,27 @@
 #X obj 409 96 metro 400;
 #X obj 212 49 doc_below o 1 10;
 #X obj 25 263 outlet dummy;
-#X obj 400 262 outlet to_child_nodes;
+#X obj 168 263 outlet to_child_nodes;
 #X obj 0 27 doc_layout s 92 20;
+#X obj 327 383 gf/lol 1;
+#X obj 327 175 loadbang;
+#X obj 327 249 metro 666;
+#X obj 327 232 tgl 15 0 empty empty empty 17 7 0 10 -262144 -1 -1 1
+1;
+#X obj 327 307 gf/canvas_edit_mode 1;
+#X obj 327 326 sel 0 1;
+#X msg 327 364 wire_hide;
+#X msg 346 345 wire_dotted 255 170 0 \, box_dotted 255 170 0;
+#X msg 327 213 1;
+#X obj 327 288 t b b;
+#X obj 442 212 gf/canvas_getpos 0;
+#X obj 327 194 delay 2222;
+#X obj 442 231 unpack f f;
+#X obj 442 269 pack f f;
+#X obj 442 250 + 100;
+#X obj 18 0 bng 15 250 50 0 empty empty empty 17 7 0 10 -262144 -1
+-1;
+#X msg 442 288 box_align y \$1 \$2 8;
 #X connect 2 0 6 0;
 #X connect 3 0 7 0;
 #X connect 4 0 5 0;
@@ -21,4 +40,22 @@
 #X connect 7 0 4 0;
 #X connect 8 0 11 1;
 #X connect 11 2 8 0;
+#X connect 13 0 23 0;
+#X connect 15 0 14 0;
+#X connect 16 0 17 0;
+#X connect 17 0 18 0;
+#X connect 17 1 19 0;
+#X connect 18 0 12 0;
+#X connect 19 0 12 0;
+#X connect 20 0 15 0;
+#X connect 21 0 16 0;
+#X connect 21 1 22 0;
+#X connect 22 0 24 0;
+#X connect 23 0 20 0;
+#X connect 24 0 26 0;
+#X connect 24 1 25 1;
+#X connect 25 0 28 0;
+#X connect 26 0 25 0;
+#X connect 27 0 21 0;
+#X connect 28 0 12 0;
 #X coords 0 -1 1 1 92 16 2 0 0;

Modified: trunk/abstractions/doc_m.pd
==============================================================================
--- trunk/abstractions/doc_m.pd (original)
+++ trunk/abstractions/doc_m.pd Sat Oct 31 21:00:19 2009
@@ -1,13 +1,12 @@
 #N canvas 334 149 836 502 10;
-#X obj 0 0 cnv 15 94 17 \$0-rect_s \$0-rect ~unspecified~ 4 9 1 9 -261615
--1 0;
+#X obj 0 0 cnv 15 94 17 \$0-rect_s \$0-rect grid 4 9 1 9 -261615 -1
+0;
 #X obj 9 176 gf/string_replace c c/;
 #X obj 9 195 gf/string_replace i i/;
 #X obj 9 214 gf/string_replace o o/;
 #X obj 9 233 pack s s;
 #X obj 346 20 doc_below ??? 0 -20;
 #X msg 9 252 name \$1/\$2 \, parent \$1;
-#X obj 635 127 doc_editmode 42 1;
 #X msg 346 1 97 \$2;
 #X obj 35 458 outlet dummy;
 #X obj 317 459 outlet to_comment;
@@ -25,7 +24,6 @@
 #X obj 317 278 t b b;
 #X obj 432 240 gf/canvas_getpos 0;
 #X msg 432 259 \$2;
-#X msg 432 278 box_align_same_x 200 \$1 8;
 #X obj 317 411 change -242;
 #X msg 317 430 height \$1;
 #X obj 317 392 max 20;
@@ -76,57 +74,85 @@
 #X msg 77 138 label \$1;
 #X obj 9 116 args id (type a ~unspecified~) *;
 #X obj 9 157 symbol \$1;
+#X obj 635 127 doc_editmode 0 1;
+#X obj 75 293 gf/canvas_count 1;
+#X obj 29 293 t b b;
+#X obj 29 276 bng 15 250 50 0 empty empty empty 17 7 0 10 -262144 -1
+-1;
+#X obj 29 312 f;
+#X obj 90 331 gf/canvas_filename 1;
+#X obj 90 312 loadbang;
+#X obj 29 412 s;
+#X msg 90 350 symbol pd-\$1;
+#X msg 29 393 obj \$2 200;
+#X text 96 392 we don't have our own object index;
+#X obj 93 372 +;
+#X obj 29 374 pack f f;
+#X msg 432 278 box_align x 200 \$1 8;
 #X connect 1 0 2 0;
 #X connect 2 0 3 0;
 #X connect 3 0 4 0;
 #X connect 3 0 5 1;
-#X connect 3 0 30 1;
+#X connect 3 0 28 1;
 #X connect 4 0 6 0;
-#X connect 5 0 33 0;
-#X connect 6 0 37 0;
-#X connect 8 0 5 0;
-#X connect 11 0 27 0;
-#X connect 12 0 19 0;
+#X connect 5 0 31 0;
+#X connect 6 0 35 0;
+#X connect 7 0 5 0;
+#X connect 10 0 25 0;
+#X connect 11 0 18 0;
+#X connect 11 0 19 0;
 #X connect 12 0 20 0;
-#X connect 13 0 21 0;
-#X connect 14 0 13 0;
+#X connect 13 0 12 0;
+#X connect 14 0 15 0;
 #X connect 15 0 16 0;
-#X connect 16 0 17 0;
-#X connect 16 1 18 0;
-#X connect 17 0 11 0;
-#X connect 18 0 11 0;
+#X connect 15 1 17 0;
+#X connect 16 0 10 0;
+#X connect 17 0 10 0;
+#X connect 19 0 13 0;
 #X connect 20 0 14 0;
-#X connect 21 0 15 0;
-#X connect 21 1 22 0;
-#X connect 22 0 23 0;
+#X connect 20 1 21 0;
+#X connect 21 0 22 0;
+#X connect 22 0 57 0;
 #X connect 23 0 24 0;
-#X connect 24 0 11 0;
-#X connect 25 0 26 0;
-#X connect 26 0 37 0;
-#X connect 27 0 25 0;
-#X connect 28 0 34 1;
-#X connect 29 0 28 1;
-#X connect 30 0 31 0;
-#X connect 31 0 29 1;
-#X connect 31 0 35 0;
-#X connect 32 0 30 0;
+#X connect 23 0 55 1;
+#X connect 24 0 35 0;
+#X connect 25 0 23 0;
+#X connect 26 0 32 1;
+#X connect 27 0 26 1;
+#X connect 28 0 29 0;
+#X connect 29 0 27 1;
+#X connect 29 0 33 0;
+#X connect 30 0 28 0;
+#X connect 31 0 32 0;
+#X connect 31 1 36 0;
+#X connect 32 0 35 1;
 #X connect 33 0 34 0;
-#X connect 33 1 38 0;
-#X connect 34 0 37 1;
-#X connect 35 0 36 0;
-#X connect 36 0 29 0;
-#X connect 37 2 8 0;
-#X connect 38 0 28 0;
-#X connect 38 1 29 0;
-#X connect 38 2 32 0;
-#X connect 38 3 40 0;
-#X connect 39 0 4 1;
-#X connect 39 0 40 1;
-#X connect 40 0 35 1;
-#X connect 42 0 44 0;
-#X connect 43 0 41 0;
-#X connect 44 0 45 0;
-#X connect 44 1 43 0;
-#X connect 44 1 39 0;
-#X connect 45 0 1 0;
+#X connect 34 0 27 0;
+#X connect 35 2 7 0;
+#X connect 35 2 55 0;
+#X connect 36 0 26 0;
+#X connect 36 1 27 0;
+#X connect 36 2 30 0;
+#X connect 36 3 38 0;
+#X connect 37 0 4 1;
+#X connect 37 0 38 1;
+#X connect 38 0 33 1;
+#X connect 40 0 42 0;
+#X connect 41 0 39 0;
+#X connect 42 0 43 0;
+#X connect 42 1 41 0;
+#X connect 42 1 37 0;
+#X connect 43 0 1 0;
+#X connect 45 0 48 1;
+#X connect 46 0 48 0;
+#X connect 46 1 45 0;
+#X connect 47 0 46 0;
+#X connect 48 0 56 0;
+#X connect 49 0 52 0;
+#X connect 50 0 49 0;
+#X connect 52 0 51 1;
+#X connect 53 0 51 0;
+#X connect 55 0 56 1;
+#X connect 56 0 53 0;
+#X connect 57 0 10 0;
 #X coords 0 -1 1 1 94 17 1 0 0;

Modified: trunk/base/flow_objects2.c
==============================================================================
--- trunk/base/flow_objects2.c (original)
+++ trunk/base/flow_objects2.c Sat Oct 31 21:00:19 2009
@@ -306,8 +306,7 @@
 	\decl 0 wire_dotted (int r, int g, int b);
 	\decl 0 wire_hide ();
 	\decl 0  box_dotted (int r, int g, int b);
-	\decl 0  box_align_same_x (int x, int y_start, int y_spacing);
-	\decl 0  box_align_same_y (int y, int x_start, int x_spacing);
+	\decl 0  box_align (t_symbol *s, int x_start, int y_start, int incr);
 };
 #define BEGIN \
 	t_outlet *ouch = ((t_object *)bself->mom)->te_outlet; \
@@ -355,14 +354,17 @@
 	return a->te_ypix < b->te_ypix;
 }
 #define foreach(ITER,COLL) for(typeof(COLL.begin()) ITER = COLL.begin(); ITER != (COLL).end(); ITER++)
-\def 0 box_align_same_x (int x, int y_start, int y_spacing) {
+\def 0 box_align (t_symbol *dir, int x_start, int y_start, int incr) {
+	int x=x_start, y=y_start;
+	bool horiz;
+	if (dir==&s_x) horiz=false; else
+	if (dir==&s_y) horiz=true;  else RAISE("$1 must be x or y");
 #ifndef DESIREDATA
 	std::vector<t_object *> v;
 	BEGIN
 	for (int i=0; i<n; i++) {ouch = ouch->next; if (!ouch) {RAISE("no such outlet");}}
 	wire_each(wire,ouch) v.push_back((t_object *)wire->to);
 	sort(v.begin(),v.end(),comment_sort_y_lt);
-	int y = y_start;
 	foreach(tt,v) {
 		t_object *t = *tt;
 		if (t->te_xpix!=x || t->te_ypix!=y) {
@@ -374,36 +376,11 @@
 		}
 		int x1,y1,x2,y2;
 		gobj_getrect((t_gobj *)t,can,&x1,&y1,&x2,&y2);
-		y += y2-y1+y_spacing;
-	}
-	outlet_float(bself->outlets[0],y-y_start);
-#else
-	post("doesn't work with DesireData");
-#endif
-}
-\def 0 box_align_same_y (int y, int x_start, int x_spacing) {
-#ifndef DESIREDATA
-	std::vector<t_object *> v;
-	BEGIN
-	for (int i=0; i<n; i++) {ouch = ouch->next; if (!ouch) {RAISE("no such outlet");}}
-	wire_each(wire,ouch) v.push_back((t_object *)wire->to);
-	sort(v.begin(),v.end(),comment_sort_y_lt);
-	int x = x_start;
-	foreach(tt,v) {
-		t_object *t = *tt;
-		if (!t) RAISE("WTF.");
-		if (t->te_xpix!=x || t->te_ypix!=y) {
-			gobj_vis((t_gobj *)t,can,0);
-			t->te_xpix=x;
-			t->te_ypix=y;
-			gobj_vis((t_gobj *)t,can,1);
-			canvas_fixlinesfor(can,t);
-		}
-		int x1,y1,x2,y2;
-		gobj_getrect((t_gobj *)t,can,&x1,&y1,&x2,&y2);
-		x += x2-x1+x_spacing;
-	}
-	outlet_float(bself->outlets[0],x-x_start);
+		if (horiz) x += x2-x1+incr;
+		else       y += y2-y1+incr;
+	}
+	if (horiz) outlet_float(bself->outlets[0],y-y_start);
+	else       outlet_float(bself->outlets[0],x-x_start);
 #else
 	post("doesn't work with DesireData");
 #endif



More information about the Gridflow-cvs mailing list