aboutsummaryrefslogtreecommitdiff
path: root/doc/pddp/drawpolygon-help.pd
blob: f94c7de074ee3794049aa956d8606858f2ab773a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
#N struct drawpolygon-help-template float x float y float weasel float
dog float cat float vis;
#N canvas 0 0 555 619 10;
#X obj 0 595 cnv 15 552 21 empty \$0-pddp.cnv.footer empty 20 12 0
14 -228856 -66577 0;
#X obj 0 0 cnv 15 552 40 empty \$0-pddp.cnv.header drawpolygon 3 12
0 18 -204280 -1 0;
#X obj 0 152 cnv 3 550 3 empty \$0-pddp.cnv.inlets inlets 8 12 0 13
-228856 -1 0;
#N canvas 50 246 494 344 META 0;
#X text 12 105 PLATFORM windows macosx gnulinux;
#X text 12 145 LIBRARY internal;
#X text 12 185 WEBSITE http://crca.ucsd.edu/~msp/;
#X text 12 225 RELEASE_VERSION 0.41.4;
#X text 12 205 RELEASE_DATE 2009-06-12;
#X text 12 65 LICENSE SIBSD;
#X text 12 165 AUTHOR Miller Puckette;
#X text 12 245 HELP_PATCH_AUTHORS This help patch was updated for Pd
version 0.35 test 28 by Dave Sabine as part of a project called pddp
proposed by Krzysztof Czaja to build comprehensive documentation for
Pd. Jonathan Wilkes revised the patch to conform to the PDDP template
for Pd version 0.42.;
#X text 12 5 GENRE help;
#X text 12 45 KEYWORDS control data_structure;
#X text 12 85 DESCRIPTION display a polygon in a data structure instance
;
#X text 12 25 NAME drawpolygon;
#X text 12 125 INLET_0 float;
#X restore 500 597 pd META;
#X obj 0 227 cnv 3 550 3 empty \$0-pddp.cnv.outlets outlets 8 12 0
13 -228856 -1 0;
#X obj 0 255 cnv 3 550 3 empty \$0-pddp.cnv.argument arguments 8 12
0 13 -228856 -1 0;
#X obj 0 516 cnv 3 550 3 empty \$0-pddp.cnv.more_info more_info 8 12
0 13 -228856 -1 0;
#N canvas 102 422 428 169 Related_objects 0;
#X obj 1 1 cnv 15 425 20 empty \$0-pddp.cnv.subheading empty 3 12 0
14 -204280 -1 0;
#X obj 92 42 struct;
#X obj 142 42 drawpolygon;
#X obj 223 42 plot;
#X obj 17 42 drawsymbol;
#X obj 262 42 drawcurve;
#X text 7 78 Other Data Structure Objects;
#X obj 245 112 element;
#X obj 76 112 get;
#X obj 107 112 set;
#X obj 136 112 getsize;
#X obj 190 112 setsize;
#X obj 22 112 pointer;
#X text 7 1 [drawpolygon] Related Objects;
#X restore 101 597 pd Related_objects;
#X obj 78 161 cnv 17 3 55 empty \$0-pddp.cnv.let.0 0 5 9 0 16 -228856
-162280 0;
#X text 99 162 float;
#X text 168 159 - [drawnumber] has a single inlet to toggle visibility
of the number. A zero makes it invisible. Any nonzero value makes it
visible.;
#X text 98 231 (none);
#X text 179 80 <- subpatch to display the data structures;
#X obj 449 3 drawpolygon;
#X obj 420 20 pddp/pddplink http://wiki.puredata.info/en/drawpolygon
-text pdpedia: drawpolygon;
#N canvas 31 185 428 280 drawpolygon-help-data 0;
#X scalar drawpolygon-help-template 101 41 0 60 100 1 \;;
#X scalar drawpolygon-help-template 301 44 1 80 100 1 \;;
#X obj 1 1 cnv 15 425 20 empty empty empty 20 12 2 14 -204280 -195568
0;
#X text 21 156 Three field values are used to draw these polygons.
The field "weasel" is used for the y-value of the top of the triangle
and the y-value of the top two points of the red "v". Fields "dog"
and "cat" are the top left and right x-values for the red "v".;
#X text 6 1 Window to Display Data Structures;
#X text 21 111 Each scalar consists of a set of numbers \, one triangle
\, and one red "v". In editmode you can click on a polygon to get a
blue bounding box around the scalar.;
#X text 21 216 In runmode you can click on each of these regions of
the polygons to alter their appearance. You may also scroll the displayed
values with the mouse to change them.;
#X restore 28 82 pd drawpolygon-help-data;
#N canvas 116 47 428 563 drawpolygon-help-template 0;
#X obj 23 66 tgl 15 0 empty empty empty 0 -6 0 8 -262144 -1 -1 0 1
;
#N canvas 478 354 428 162 init 0;
#X obj 20 99 pointer;
#X obj 20 126 outlet;
#X obj 20 30 loadbang;
#X obj 20 51 t b b;
#X msg 20 77 traverse pd-drawpolygon-help-data \, next;
#X obj 0 1 cnv 15 425 20 empty \$0-pddp.cnv.subheading empty 3 12 0
14 -204280 -1 0;
#X text 6 1 [drawpolygon] Initialization subpatch;
#X connect 0 0 1 0;
#X connect 2 0 3 0;
#X connect 3 0 4 0;
#X connect 4 0 0 0;
#X restore 217 244 pd init;
#X obj 22 224 tgl 15 0 empty empty empty 17 7 0 10 -262144 -1 -1 0
1;
#X obj 1 1 cnv 15 425 20 empty \$0-pddp.cnv.subheading empty 3 12 0
14 -204280 -1 0;
#X text 19 400 This object defines the fields for this template. Their
values are initialized in the "init" subwindow. You can see them by
right-clicking on the object in the "data" window and selecting "properties."
;
#X text 7 1 [drawpolygon] subpatch;
#X obj 23 95 drawpolygon 0 4 0 40 40 40 20 weasel 0 40;
#X obj 22 367 struct drawpolygon-help-template float x float y float
weasel float dog float cat float vis;
#X text 42 65 "0" in inlet makes all instances of this polygon invisible
;
#X text 40 221 "0" in inlet makes a single instance of this polygon
invisible;
#X obj 22 268 set drawpolygon-help-template vis;
#X text 20 33 [drawpolygon] is used below to display a black triangle
and a red "v".;
#X obj 23 497 drawnumber weasel -60 0 0 weasel=;
#X obj 23 517 drawnumber dog -60 15 0 dog=;
#X obj 23 538 drawnumber cat -60 30 0 cat=;
#X obj 23 135 drawpolygon -v vis 900 3 dog weasel 80 40 cat weasel
;
#X text 19 453 For convenience \, the following [drawnumber] objects
display the values of each field used in the drawing instructions above:
;
#X text 19 154 The next [drawpolygon] object uses the -v flag. This
flag controls visilibility of the polygon for only one instance of
a data structure. "-v vis" means that the value of field "vis" determines
whether the red "v" polygon is visible or not.;
#X text 19 287 Using the [set] object \, we can turn visibility on
and off for an instance of this polygon by changing the value of the
field "vis". Notice when you click the toggle above \, visibility only
changes for the red "v" furthest to the right. Once you use the -v
flag \, however \, you can no longer use the inlet to [drawpolygon]
to set visibility globally.;
#X connect 0 0 6 0;
#X connect 1 0 10 1;
#X connect 2 0 10 0;
#X restore 28 109 pd drawpolygon-help-template;
#X text 98 471 Note: you cannot use the -n and -v flag together. When
using the -v flag \, the polygon is initially invisible by default.
;
#X text 99 519 When not in "edit" mode \, you can click on regions
of the polygon defined by template fields to stretch or alter the polygon's
shape.;
#X text 201 109 <- click this subpatch to see how [drawpolygon] is
used.;
#X text 11 23 display a polygon in a data structure instance;
#X text 168 200 - a list will be truncated to the first element.;
#X text 168 363 - RGB color (0=black \, 999=white \, 900=red \, 90=green
\, 9=blue \, 555=grey \, etc.);
#X text 168 390 - line width.;
#X text 168 414 - two or more (x \, y) pairs giving coordinates.;
#X text 80 275 0-3 flags;
#X text 168 275 - "-n" flag to make the polygon initially invisible.
;
#X text 168 294 - a "-v [variable]" flag to assign a variable to make
the polygon visible/invisible.;
#X text 168 323 - "-x" flag to inhibit selecting the object when the
shape is clicked on in "edit" mode.;
#X text 80 390 2) *;
#X text 80 364 1) *;
#X text 80 414 n) *;
#X text 98 442 * Any of these can be numbers (float) or field names
(symbol atom).;
#X text 98 200 list;
#X text 80 294 (symbol atoms);
#X obj 4 597 pddp/pddplink pddp/help.pd -text help;
#X obj 316 557 pddp/pddplink ../4.data.structures/09.scaling.pd -text
doc/4.data.structure/09.scaling.pd;
#X obj 316 572 pddp/pddplink ../4.data.structures/10.onoff.pd -text
doc/4.data.structures/10.onoff.pd;
#X obj 99 572 pddp/pddplink all_about_z_order.pd;
#X obj 99 557 pddp/pddplink scalar-help.pd;