picrate 0.5.0-java → 0.6.0-java
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/.mvn/wrapper/maven-wrapper.properties +1 -1
- data/CHANGELOG.md +3 -1
- data/README.md +1 -1
- data/Rakefile +8 -6
- data/docs/_editors/geany.md +5 -4
- data/docs/_editors/vim.md +6 -0
- data/docs/_includes/head.html +1 -0
- data/docs/_libraries/control_panel.md +2 -2
- data/docs/_libraries/gl_video.md +21 -0
- data/docs/_posts/2018-05-06-getting_started.md +10 -9
- data/docs/_posts/2018-05-06-install_jruby.md +19 -2
- data/docs/_posts/2018-06-26-auto_install_picrate.md +19 -4
- data/docs/_posts/2018-11-18-building-gem.md +18 -0
- data/docs/_posts/2018-11-27-getting_started_geany.md +38 -0
- data/docs/about.md +21 -10
- data/docs/assets/android-chrome-192x192.png +0 -0
- data/docs/assets/android-chrome-512x512.png +0 -0
- data/docs/assets/favicon.ico +0 -0
- data/docs/assets/geany.png +0 -0
- data/docs/assets/jwishy_picrate.png +0 -0
- data/docs/assets/picrate.svg +251 -0
- data/docs/index.html +8 -14
- data/lib/picrate/runner.rb +6 -2
- data/lib/picrate/version.rb +1 -1
- data/library/boids/boids.rb +10 -13
- data/mvnw +234 -0
- data/picrate.gemspec +2 -1
- data/pom.rb +1 -1
- data/pom.xml +1 -1
- data/src/main/java/japplemenubar/JAppleMenuBar.java +10 -2
- data/src/main/java/monkstone/ColorUtil.java +11 -1
- data/src/main/java/monkstone/MathToolModule.java +1 -0
- data/src/main/java/monkstone/PicrateLibrary.java +1 -0
- data/src/main/java/monkstone/fastmath/Deglut.java +1 -0
- data/src/main/java/monkstone/noise/SimplexNoise.java +3 -3
- data/src/main/java/monkstone/slider/CustomHorizontalSlider.java +1 -1
- data/src/main/java/monkstone/slider/CustomVerticalSlider.java +1 -1
- data/src/main/java/monkstone/slider/SimpleHorizontalSlider.java +1 -1
- data/src/main/java/monkstone/slider/SimpleSlider.java +8 -8
- data/src/main/java/monkstone/slider/SimpleVerticalSlider.java +1 -1
- data/src/main/java/monkstone/slider/Slider.java +3 -3
- data/src/main/java/monkstone/slider/SliderBar.java +1 -1
- data/src/main/java/monkstone/slider/SliderGroup.java +1 -1
- data/src/main/java/monkstone/vecmath/AppRender.java +1 -0
- data/src/main/java/monkstone/vecmath/JRender.java +1 -0
- data/src/main/java/monkstone/vecmath/ShapeRender.java +1 -0
- data/src/main/java/monkstone/vecmath/vec2/Vec2.java +8 -0
- data/src/main/java/monkstone/vecmath/vec3/Vec3.java +1 -0
- data/src/main/java/processing/awt/PGraphicsJava2D.java +85 -16
- data/src/main/java/processing/awt/PSurfaceAWT.java +1 -1
- data/src/main/java/processing/core/PApplet.java +18 -12
- data/src/main/java/processing/core/PShape.java +1182 -305
- data/src/main/java/processing/core/PStyle.java +1 -1
- data/src/main/java/processing/core/PSurface.java +1 -1
- data/src/main/java/processing/data/FloatDict.java +196 -54
- data/src/main/java/processing/data/FloatList.java +167 -54
- data/src/main/java/processing/data/IntDict.java +211 -56
- data/src/main/java/processing/data/IntList.java +185 -52
- data/src/main/java/processing/data/JSONArray.java +69 -20
- data/src/main/java/processing/data/JSONObject.java +53 -12
- data/src/main/java/processing/data/Sort.java +40 -10
- data/src/main/java/processing/data/StringDict.java +159 -49
- data/src/main/java/processing/data/StringList.java +147 -42
- data/src/main/java/processing/data/Table.java +778 -223
- data/src/main/java/processing/data/TableRow.java +26 -2
- data/src/main/java/processing/data/XML.java +190 -50
- data/src/main/java/processing/event/Event.java +93 -0
- data/src/main/java/processing/event/KeyEvent.java +55 -13
- data/src/main/java/processing/event/MouseEvent.java +77 -1
- data/src/main/java/processing/event/TouchEvent.java +14 -1
- data/src/main/java/processing/javafx/PGraphicsFX2D.java +8 -0
- data/src/main/java/processing/opengl/FrameBuffer.java +228 -66
- data/src/main/java/processing/opengl/LinePath.java +131 -27
- data/src/main/java/processing/opengl/LineStroker.java +30 -5
- data/src/main/java/processing/opengl/PGL.java +4066 -865
- data/src/main/java/processing/opengl/PGraphics2D.java +38 -10
- data/src/main/java/processing/opengl/PGraphics3D.java +38 -6
- data/src/main/java/processing/opengl/PGraphicsOpenGL.java +1980 -474
- data/src/main/java/processing/opengl/PJOGL.java +1460 -248
- data/src/main/java/processing/opengl/PShader.java +904 -217
- data/src/main/java/processing/opengl/PShapeOpenGL.java +1811 -487
- data/src/main/java/processing/opengl/PSurfaceJOGL.java +278 -71
- data/src/main/java/processing/opengl/Texture.java +610 -135
- data/src/main/java/processing/opengl/VertexBuffer.java +45 -9
- data/src/main/resources/icon/icon-1024.png +0 -0
- data/src/main/resources/icon/icon-128.png +0 -0
- data/src/main/resources/icon/icon-16.png +0 -0
- data/src/main/resources/icon/icon-256.png +0 -0
- data/src/main/resources/icon/icon-32.png +0 -0
- data/src/main/resources/icon/icon-48.png +0 -0
- data/src/main/resources/icon/icon-512.png +0 -0
- data/src/main/resources/icon/icon-64.png +0 -0
- data/vendors/Rakefile +1 -1
- metadata +13 -6
- data/docs/assets/circle_collisions.png +0 -0
- data/docs/favicon.ico +0 -0
|
@@ -3637,15 +3637,15 @@ public class PApplet implements PConstants {
|
|
|
3637
3637
|
|
|
3638
3638
|
/**
|
|
3639
3639
|
* Alternative version of exec() that retrieves stdout and stderr into the
|
|
3640
|
-
* StringList objects provided.
|
|
3641
|
-
|
|
3642
|
-
|
|
3643
|
-
|
|
3644
|
-
|
|
3645
|
-
*
|
|
3646
|
-
* @param
|
|
3647
|
-
* @param
|
|
3648
|
-
* @param
|
|
3640
|
+
* StringList objects provided.This is a convenience function that handles
|
|
3641
|
+
simple exec() calls.If the results will be more than a couple lines, you
|
|
3642
|
+
shouldn't use this function, you should use a more elaborate method that
|
|
3643
|
+
makes use of proper threading (to drain the shell output) and error
|
|
3644
|
+
handling to address the many things that can go wrong within this method.
|
|
3645
|
+
*
|
|
3646
|
+
* @param arg0
|
|
3647
|
+
* @param arg1
|
|
3648
|
+
* @param arg2
|
|
3649
3649
|
* @return the result returned from the application, or -1 if an Exception
|
|
3650
3650
|
* occurs before the application is able to return a result.
|
|
3651
3651
|
*/
|
|
@@ -3674,6 +3674,9 @@ public class PApplet implements PConstants {
|
|
|
3674
3674
|
|
|
3675
3675
|
/**
|
|
3676
3676
|
* Same as exec() above, but prefixes the call with a shell.
|
|
3677
|
+
* @param arg0
|
|
3678
|
+
* @param arg1
|
|
3679
|
+
* @param arg2
|
|
3677
3680
|
* @param stdout
|
|
3678
3681
|
* @param stderr
|
|
3679
3682
|
* @param args
|
|
@@ -7079,8 +7082,8 @@ public class PApplet implements PConstants {
|
|
|
7079
7082
|
|
|
7080
7083
|
/**
|
|
7081
7084
|
*
|
|
7082
|
-
* @param
|
|
7083
|
-
* @param
|
|
7085
|
+
* @param arg0
|
|
7086
|
+
* @param arg1
|
|
7084
7087
|
* @return
|
|
7085
7088
|
*/
|
|
7086
7089
|
public String[] listPaths(String path, String... options) {
|
|
@@ -7106,7 +7109,9 @@ public class PApplet implements PConstants {
|
|
|
7106
7109
|
|
|
7107
7110
|
/**
|
|
7108
7111
|
*
|
|
7112
|
+
* @param arg0
|
|
7109
7113
|
* @param path
|
|
7114
|
+
* @param arg1
|
|
7110
7115
|
* @param options
|
|
7111
7116
|
* @return
|
|
7112
7117
|
*/
|
|
@@ -7128,8 +7133,9 @@ public class PApplet implements PConstants {
|
|
|
7128
7133
|
|
|
7129
7134
|
/**
|
|
7130
7135
|
*
|
|
7136
|
+
* @param arg0
|
|
7131
7137
|
* @param base
|
|
7132
|
-
* @param
|
|
7138
|
+
* @param arg1
|
|
7133
7139
|
* @return
|
|
7134
7140
|
*/
|
|
7135
7141
|
static public File[] listFiles(File base, String... options) {
|
|
@@ -78,8 +78,16 @@ import processing.core.PApplet;
|
|
|
78
78
|
* @instanceName sh any variable of type PShape
|
|
79
79
|
*/
|
|
80
80
|
public class PShape implements PConstants {
|
|
81
|
-
|
|
82
|
-
|
|
81
|
+
|
|
82
|
+
/**
|
|
83
|
+
*
|
|
84
|
+
*/
|
|
85
|
+
protected String name;
|
|
86
|
+
|
|
87
|
+
/**
|
|
88
|
+
*
|
|
89
|
+
*/
|
|
90
|
+
protected Map<String,PShape> nameTable;
|
|
83
91
|
|
|
84
92
|
// /** Generic, only draws its child objects. */
|
|
85
93
|
// static public final int GROUP = 0;
|
|
@@ -100,29 +108,53 @@ public class PShape implements PConstants {
|
|
|
100
108
|
/** ELLIPSE, LINE, QUAD; TRIANGLE_FAN, QUAD_STRIP; etc. */
|
|
101
109
|
protected int kind;
|
|
102
110
|
|
|
103
|
-
|
|
111
|
+
/**
|
|
112
|
+
*
|
|
113
|
+
*/
|
|
114
|
+
protected PMatrix matrix;
|
|
104
115
|
|
|
105
|
-
|
|
116
|
+
/**
|
|
117
|
+
*
|
|
118
|
+
*/
|
|
119
|
+
protected int textureMode;
|
|
106
120
|
|
|
107
121
|
/** Texture or image data associated with this shape. */
|
|
108
122
|
protected PImage image;
|
|
109
123
|
|
|
110
|
-
|
|
124
|
+
/**
|
|
125
|
+
*
|
|
126
|
+
*/
|
|
127
|
+
public static final String OUTSIDE_BEGIN_END_ERROR =
|
|
111
128
|
"%1$s can only be called between beginShape() and endShape()";
|
|
112
129
|
|
|
113
|
-
|
|
130
|
+
/**
|
|
131
|
+
*
|
|
132
|
+
*/
|
|
133
|
+
public static final String INSIDE_BEGIN_END_ERROR =
|
|
114
134
|
"%1$s can only be called outside beginShape() and endShape()";
|
|
115
135
|
|
|
116
|
-
|
|
136
|
+
/**
|
|
137
|
+
*
|
|
138
|
+
*/
|
|
139
|
+
public static final String NO_SUCH_VERTEX_ERROR =
|
|
117
140
|
"%1$s vertex index does not exist";
|
|
118
141
|
|
|
119
|
-
|
|
142
|
+
/**
|
|
143
|
+
*
|
|
144
|
+
*/
|
|
145
|
+
static public final String NO_VERTICES_ERROR =
|
|
120
146
|
"getVertexCount() only works with PATH or GEOMETRY shapes";
|
|
121
147
|
|
|
122
|
-
|
|
148
|
+
/**
|
|
149
|
+
*
|
|
150
|
+
*/
|
|
151
|
+
public static final String NOT_A_SIMPLE_VERTEX =
|
|
123
152
|
"%1$s can not be called on quadratic or bezier vertices";
|
|
124
153
|
|
|
125
|
-
|
|
154
|
+
/**
|
|
155
|
+
*
|
|
156
|
+
*/
|
|
157
|
+
static public final String PER_VERTEX_UNSUPPORTED =
|
|
126
158
|
"This renderer does not support %1$s for individual vertices";
|
|
127
159
|
|
|
128
160
|
/**
|
|
@@ -150,39 +182,117 @@ public class PShape implements PConstants {
|
|
|
150
182
|
*/
|
|
151
183
|
public float height;
|
|
152
184
|
|
|
153
|
-
|
|
185
|
+
/**
|
|
186
|
+
*
|
|
187
|
+
*/
|
|
188
|
+
public float depth;
|
|
154
189
|
|
|
155
190
|
PGraphics g;
|
|
156
191
|
|
|
157
192
|
// set to false if the object is hidden in the layers palette
|
|
193
|
+
|
|
194
|
+
/**
|
|
195
|
+
*
|
|
196
|
+
*/
|
|
158
197
|
protected boolean visible = true;
|
|
159
198
|
|
|
160
199
|
/** Retained shape being created with beginShape/endShape */
|
|
161
200
|
protected boolean openShape = false;
|
|
162
201
|
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
202
|
+
/**
|
|
203
|
+
*
|
|
204
|
+
*/
|
|
205
|
+
protected boolean openContour = false;
|
|
206
|
+
|
|
207
|
+
/**
|
|
208
|
+
*
|
|
209
|
+
*/
|
|
210
|
+
protected boolean stroke;
|
|
211
|
+
|
|
212
|
+
/**
|
|
213
|
+
*
|
|
214
|
+
*/
|
|
215
|
+
protected int strokeColor;
|
|
216
|
+
|
|
217
|
+
/**
|
|
218
|
+
*
|
|
219
|
+
*/
|
|
220
|
+
protected float strokeWeight; // default is 1
|
|
221
|
+
|
|
222
|
+
/**
|
|
223
|
+
*
|
|
224
|
+
*/
|
|
225
|
+
protected int strokeCap;
|
|
226
|
+
|
|
227
|
+
/**
|
|
228
|
+
*
|
|
229
|
+
*/
|
|
230
|
+
protected int strokeJoin;
|
|
231
|
+
|
|
232
|
+
/**
|
|
233
|
+
*
|
|
234
|
+
*/
|
|
235
|
+
protected boolean fill;
|
|
236
|
+
|
|
237
|
+
/**
|
|
238
|
+
*
|
|
239
|
+
*/
|
|
240
|
+
protected int fillColor;
|
|
241
|
+
|
|
242
|
+
/**
|
|
243
|
+
*
|
|
244
|
+
*/
|
|
245
|
+
protected boolean tint;
|
|
246
|
+
|
|
247
|
+
/**
|
|
248
|
+
*
|
|
249
|
+
*/
|
|
250
|
+
protected int tintColor;
|
|
251
|
+
|
|
252
|
+
/**
|
|
253
|
+
*
|
|
254
|
+
*/
|
|
255
|
+
protected int ambientColor;
|
|
256
|
+
|
|
257
|
+
/**
|
|
258
|
+
*
|
|
259
|
+
*/
|
|
260
|
+
protected boolean setAmbient;
|
|
261
|
+
|
|
262
|
+
/**
|
|
263
|
+
*
|
|
264
|
+
*/
|
|
265
|
+
protected int specularColor;
|
|
266
|
+
|
|
267
|
+
/**
|
|
268
|
+
*
|
|
269
|
+
*/
|
|
270
|
+
protected int emissiveColor;
|
|
271
|
+
|
|
272
|
+
/**
|
|
273
|
+
*
|
|
274
|
+
*/
|
|
275
|
+
protected float shininess;
|
|
276
|
+
|
|
277
|
+
/**
|
|
278
|
+
*
|
|
279
|
+
*/
|
|
280
|
+
protected int sphereDetailU,
|
|
281
|
+
|
|
282
|
+
/**
|
|
283
|
+
*
|
|
284
|
+
*/
|
|
285
|
+
sphereDetailV;
|
|
286
|
+
|
|
287
|
+
/**
|
|
288
|
+
*
|
|
289
|
+
*/
|
|
290
|
+
protected int rectMode;
|
|
291
|
+
|
|
292
|
+
/**
|
|
293
|
+
*
|
|
294
|
+
*/
|
|
295
|
+
protected int ellipseMode;
|
|
186
296
|
|
|
187
297
|
/** Temporary toggle for whether styles should be honored. */
|
|
188
298
|
protected boolean style = true;
|
|
@@ -190,7 +300,10 @@ public class PShape implements PConstants {
|
|
|
190
300
|
/** For primitive shapes in particular, params like x/y/w/h or x1/y1/x2/y2. */
|
|
191
301
|
protected float[] params;
|
|
192
302
|
|
|
193
|
-
|
|
303
|
+
/**
|
|
304
|
+
*
|
|
305
|
+
*/
|
|
306
|
+
protected int vertexCount;
|
|
194
307
|
/**
|
|
195
308
|
* When drawing POLYGON shapes, the second param is an array of length
|
|
196
309
|
* VERTEX_FIELD_COUNT. When drawing PATH shapes, the second param has only
|
|
@@ -198,24 +311,80 @@ public class PShape implements PConstants {
|
|
|
198
311
|
*/
|
|
199
312
|
protected float[][] vertices;
|
|
200
313
|
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
314
|
+
/**
|
|
315
|
+
*
|
|
316
|
+
*/
|
|
317
|
+
protected PShape parent;
|
|
318
|
+
|
|
319
|
+
/**
|
|
320
|
+
*
|
|
321
|
+
*/
|
|
322
|
+
protected int childCount;
|
|
323
|
+
|
|
324
|
+
/**
|
|
325
|
+
*
|
|
326
|
+
*/
|
|
327
|
+
protected PShape[] children;
|
|
204
328
|
|
|
205
329
|
|
|
206
330
|
/** Array of VERTEX, BEZIER_VERTEX, and CURVE_VERTEX calls. */
|
|
207
331
|
protected int vertexCodeCount;
|
|
208
|
-
|
|
332
|
+
|
|
333
|
+
/**
|
|
334
|
+
*
|
|
335
|
+
*/
|
|
336
|
+
protected int[] vertexCodes;
|
|
209
337
|
/** True if this is a closed path. */
|
|
210
338
|
protected boolean close;
|
|
211
339
|
|
|
212
340
|
// ........................................................
|
|
213
341
|
|
|
214
342
|
// internal color for setting/calculating
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
343
|
+
|
|
344
|
+
/**
|
|
345
|
+
*
|
|
346
|
+
*/
|
|
347
|
+
protected float calcR,
|
|
348
|
+
|
|
349
|
+
/**
|
|
350
|
+
*
|
|
351
|
+
*/
|
|
352
|
+
calcG,
|
|
353
|
+
|
|
354
|
+
/**
|
|
355
|
+
*
|
|
356
|
+
*/
|
|
357
|
+
calcB, calcA;
|
|
358
|
+
|
|
359
|
+
/**
|
|
360
|
+
*
|
|
361
|
+
*/
|
|
362
|
+
protected int calcRi,
|
|
363
|
+
|
|
364
|
+
/**
|
|
365
|
+
*
|
|
366
|
+
*/
|
|
367
|
+
calcGi,
|
|
368
|
+
|
|
369
|
+
/**
|
|
370
|
+
*
|
|
371
|
+
*/
|
|
372
|
+
calcBi,
|
|
373
|
+
|
|
374
|
+
/**
|
|
375
|
+
*
|
|
376
|
+
*/
|
|
377
|
+
calcAi;
|
|
378
|
+
|
|
379
|
+
/**
|
|
380
|
+
*
|
|
381
|
+
*/
|
|
382
|
+
protected int calcColor;
|
|
383
|
+
|
|
384
|
+
/**
|
|
385
|
+
*
|
|
386
|
+
*/
|
|
387
|
+
protected boolean calcAlpha;
|
|
219
388
|
|
|
220
389
|
/** The current colorMode */
|
|
221
390
|
public int colorMode; // = RGB;
|
|
@@ -241,7 +410,10 @@ public class PShape implements PConstants {
|
|
|
241
410
|
/** True if contains 3D data */
|
|
242
411
|
protected boolean is3D = false;
|
|
243
412
|
|
|
244
|
-
|
|
413
|
+
/**
|
|
414
|
+
*
|
|
415
|
+
*/
|
|
416
|
+
protected boolean perVertexStyles = false;
|
|
245
417
|
|
|
246
418
|
// should this be called vertices (consistent with PGraphics internals)
|
|
247
419
|
// or does that hurt flexibility?
|
|
@@ -288,6 +460,7 @@ public class PShape implements PConstants {
|
|
|
288
460
|
|
|
289
461
|
|
|
290
462
|
/**
|
|
463
|
+
* @param family
|
|
291
464
|
* @nowebref
|
|
292
465
|
*/
|
|
293
466
|
public PShape(int family) {
|
|
@@ -296,6 +469,8 @@ public class PShape implements PConstants {
|
|
|
296
469
|
|
|
297
470
|
|
|
298
471
|
/**
|
|
472
|
+
* @param g
|
|
473
|
+
* @param family
|
|
299
474
|
* @nowebref
|
|
300
475
|
*/
|
|
301
476
|
public PShape(PGraphics g, int family) {
|
|
@@ -357,30 +532,47 @@ public class PShape implements PConstants {
|
|
|
357
532
|
}
|
|
358
533
|
}
|
|
359
534
|
|
|
360
|
-
|
|
361
|
-
|
|
535
|
+
/**
|
|
536
|
+
*
|
|
537
|
+
* @param g
|
|
538
|
+
* @param kind
|
|
539
|
+
* @param params
|
|
540
|
+
*/
|
|
541
|
+
public PShape(PGraphics g, int kind, float... params) {
|
|
362
542
|
this(g, PRIMITIVE);
|
|
363
543
|
setKind(kind);
|
|
364
544
|
setParams(params);
|
|
365
545
|
}
|
|
366
546
|
|
|
367
|
-
|
|
368
|
-
|
|
547
|
+
/**
|
|
548
|
+
*
|
|
549
|
+
* @param family
|
|
550
|
+
*/
|
|
551
|
+
public void setFamily(int family) {
|
|
369
552
|
this.family = family;
|
|
370
553
|
}
|
|
371
554
|
|
|
372
|
-
|
|
373
|
-
|
|
555
|
+
/**
|
|
556
|
+
*
|
|
557
|
+
* @param kind
|
|
558
|
+
*/
|
|
559
|
+
public void setKind(int kind) {
|
|
374
560
|
this.kind = kind;
|
|
375
561
|
}
|
|
376
562
|
|
|
377
|
-
|
|
378
|
-
|
|
563
|
+
/**
|
|
564
|
+
*
|
|
565
|
+
* @param name
|
|
566
|
+
*/
|
|
567
|
+
public void setName(String name) {
|
|
379
568
|
this.name = name;
|
|
380
569
|
}
|
|
381
570
|
|
|
382
|
-
|
|
383
|
-
|
|
571
|
+
/**
|
|
572
|
+
*
|
|
573
|
+
* @return
|
|
574
|
+
*/
|
|
575
|
+
public String getName() {
|
|
384
576
|
return name;
|
|
385
577
|
}
|
|
386
578
|
|
|
@@ -388,13 +580,13 @@ public class PShape implements PConstants {
|
|
|
388
580
|
* ( begin auto-generated from PShape_isVisible.xml )
|
|
389
581
|
*
|
|
390
582
|
* Returns a boolean value "true" if the image is set to be visible,
|
|
391
|
-
* "false" if not.
|
|
392
|
-
* <br/> <br/>
|
|
583
|
+
* "false" if not.This is modified with the <b>setVisible()</b> parameter.<br/> <br/>
|
|
393
584
|
* The visibility of a shape is usually controlled by whatever program
|
|
394
585
|
* created the SVG file. For instance, this parameter is controlled by
|
|
395
586
|
* showing or hiding the shape in the layers palette in Adobe Illustrator.
|
|
396
587
|
*
|
|
397
588
|
* ( end auto-generated )
|
|
589
|
+
* @return
|
|
398
590
|
* @webref pshape:method
|
|
399
591
|
* @usage web_application
|
|
400
592
|
* @brief Returns a boolean value "true" if the image is set to be visible, "false" if not
|
|
@@ -490,6 +682,7 @@ public class PShape implements PConstants {
|
|
|
490
682
|
|
|
491
683
|
/**
|
|
492
684
|
* Get the width of the drawing area (not necessarily the shape boundary).
|
|
685
|
+
* @return
|
|
493
686
|
*/
|
|
494
687
|
public float getWidth() {
|
|
495
688
|
//checkBounds();
|
|
@@ -499,6 +692,7 @@ public class PShape implements PConstants {
|
|
|
499
692
|
|
|
500
693
|
/**
|
|
501
694
|
* Get the height of the drawing area (not necessarily the shape boundary).
|
|
695
|
+
* @return
|
|
502
696
|
*/
|
|
503
697
|
public float getHeight() {
|
|
504
698
|
//checkBounds();
|
|
@@ -507,8 +701,9 @@ public class PShape implements PConstants {
|
|
|
507
701
|
|
|
508
702
|
|
|
509
703
|
/**
|
|
510
|
-
* Get the depth of the shape area (not necessarily the shape boundary).
|
|
511
|
-
|
|
704
|
+
* Get the depth of the shape area (not necessarily the shape boundary).Only makes sense for 3D PShape subclasses,
|
|
705
|
+
such as PShape3D.
|
|
706
|
+
* @return
|
|
512
707
|
*/
|
|
513
708
|
public float getDepth() {
|
|
514
709
|
//checkBounds();
|
|
@@ -547,7 +742,8 @@ public class PShape implements PConstants {
|
|
|
547
742
|
|
|
548
743
|
|
|
549
744
|
/**
|
|
550
|
-
* Return true if this shape is 2D.
|
|
745
|
+
* Return true if this shape is 2D.Defaults to true.
|
|
746
|
+
* @return
|
|
551
747
|
*/
|
|
552
748
|
public boolean is2D() {
|
|
553
749
|
return !is3D;
|
|
@@ -555,14 +751,18 @@ public class PShape implements PConstants {
|
|
|
555
751
|
|
|
556
752
|
|
|
557
753
|
/**
|
|
558
|
-
* Return true if this shape is 3D.
|
|
754
|
+
* Return true if this shape is 3D.Defaults to false.
|
|
755
|
+
* @return
|
|
559
756
|
*/
|
|
560
757
|
public boolean is3D() {
|
|
561
758
|
return is3D;
|
|
562
759
|
}
|
|
563
760
|
|
|
564
|
-
|
|
565
|
-
|
|
761
|
+
/**
|
|
762
|
+
*
|
|
763
|
+
* @param val
|
|
764
|
+
*/
|
|
765
|
+
public void set3D(boolean val) {
|
|
566
766
|
is3D = val;
|
|
567
767
|
}
|
|
568
768
|
|
|
@@ -582,6 +782,11 @@ public class PShape implements PConstants {
|
|
|
582
782
|
|
|
583
783
|
// Drawing methods
|
|
584
784
|
|
|
785
|
+
/**
|
|
786
|
+
*
|
|
787
|
+
* @param mode
|
|
788
|
+
*/
|
|
789
|
+
|
|
585
790
|
public void textureMode(int mode) {
|
|
586
791
|
if (!openShape) {
|
|
587
792
|
PGraphics.showWarning(OUTSIDE_BEGIN_END_ERROR, "textureMode()");
|
|
@@ -591,7 +796,11 @@ public class PShape implements PConstants {
|
|
|
591
796
|
textureMode = mode;
|
|
592
797
|
}
|
|
593
798
|
|
|
594
|
-
|
|
799
|
+
/**
|
|
800
|
+
*
|
|
801
|
+
* @param tex
|
|
802
|
+
*/
|
|
803
|
+
public void texture(PImage tex) {
|
|
595
804
|
if (!openShape) {
|
|
596
805
|
PGraphics.showWarning(OUTSIDE_BEGIN_END_ERROR, "texture()");
|
|
597
806
|
return;
|
|
@@ -600,7 +809,10 @@ public class PShape implements PConstants {
|
|
|
600
809
|
image = tex;
|
|
601
810
|
}
|
|
602
811
|
|
|
603
|
-
|
|
812
|
+
/**
|
|
813
|
+
*
|
|
814
|
+
*/
|
|
815
|
+
public void noTexture() {
|
|
604
816
|
if (!openShape) {
|
|
605
817
|
PGraphics.showWarning(OUTSIDE_BEGIN_END_ERROR, "noTexture()");
|
|
606
818
|
return;
|
|
@@ -611,6 +823,11 @@ public class PShape implements PConstants {
|
|
|
611
823
|
|
|
612
824
|
|
|
613
825
|
// TODO unapproved
|
|
826
|
+
|
|
827
|
+
/**
|
|
828
|
+
*
|
|
829
|
+
* @param solid
|
|
830
|
+
*/
|
|
614
831
|
protected void solid(boolean solid) {
|
|
615
832
|
}
|
|
616
833
|
|
|
@@ -639,8 +856,10 @@ public class PShape implements PConstants {
|
|
|
639
856
|
beginContourImpl();
|
|
640
857
|
}
|
|
641
858
|
|
|
642
|
-
|
|
643
|
-
|
|
859
|
+
/**
|
|
860
|
+
*
|
|
861
|
+
*/
|
|
862
|
+
protected void beginContourImpl() {
|
|
644
863
|
if (vertexCodes == null) {
|
|
645
864
|
vertexCodes = new int[10];
|
|
646
865
|
} else if (vertexCodes.length == vertexCodeCount) {
|
|
@@ -674,12 +893,18 @@ public class PShape implements PConstants {
|
|
|
674
893
|
openContour = false;
|
|
675
894
|
}
|
|
676
895
|
|
|
677
|
-
|
|
678
|
-
|
|
896
|
+
/**
|
|
897
|
+
*
|
|
898
|
+
*/
|
|
899
|
+
protected void endContourImpl() {
|
|
679
900
|
}
|
|
680
901
|
|
|
681
|
-
|
|
682
|
-
|
|
902
|
+
/**
|
|
903
|
+
*
|
|
904
|
+
* @param x
|
|
905
|
+
* @param y
|
|
906
|
+
*/
|
|
907
|
+
public void vertex(float x, float y) {
|
|
683
908
|
if (vertices == null) {
|
|
684
909
|
vertices = new float[10][2];
|
|
685
910
|
} else if (vertices.length == vertexCount) {
|
|
@@ -702,44 +927,96 @@ public class PShape implements PConstants {
|
|
|
702
927
|
}
|
|
703
928
|
}
|
|
704
929
|
|
|
705
|
-
|
|
706
|
-
|
|
930
|
+
/**
|
|
931
|
+
*
|
|
932
|
+
* @param x
|
|
933
|
+
* @param y
|
|
934
|
+
* @param u
|
|
935
|
+
* @param v
|
|
936
|
+
*/
|
|
937
|
+
public void vertex(float x, float y, float u, float v) {
|
|
707
938
|
}
|
|
708
939
|
|
|
709
|
-
|
|
710
|
-
|
|
940
|
+
/**
|
|
941
|
+
*
|
|
942
|
+
* @param x
|
|
943
|
+
* @param y
|
|
944
|
+
* @param z
|
|
945
|
+
*/
|
|
946
|
+
public void vertex(float x, float y, float z) {
|
|
711
947
|
vertex(x, y); // maybe? maybe not?
|
|
712
948
|
}
|
|
713
949
|
|
|
714
|
-
|
|
715
|
-
|
|
950
|
+
/**
|
|
951
|
+
*
|
|
952
|
+
* @param x
|
|
953
|
+
* @param y
|
|
954
|
+
* @param z
|
|
955
|
+
* @param u
|
|
956
|
+
* @param v
|
|
957
|
+
*/
|
|
958
|
+
public void vertex(float x, float y, float z, float u, float v) {
|
|
716
959
|
}
|
|
717
960
|
|
|
718
|
-
|
|
719
|
-
|
|
961
|
+
/**
|
|
962
|
+
*
|
|
963
|
+
* @param nx
|
|
964
|
+
* @param ny
|
|
965
|
+
* @param nz
|
|
966
|
+
*/
|
|
967
|
+
public void normal(float nx, float ny, float nz) {
|
|
720
968
|
}
|
|
721
969
|
|
|
722
|
-
|
|
723
|
-
|
|
970
|
+
/**
|
|
971
|
+
*
|
|
972
|
+
* @param name
|
|
973
|
+
* @param x
|
|
974
|
+
* @param y
|
|
975
|
+
* @param z
|
|
976
|
+
*/
|
|
977
|
+
public void attribPosition(String name, float x, float y, float z) {
|
|
724
978
|
}
|
|
725
979
|
|
|
726
|
-
|
|
980
|
+
/**
|
|
981
|
+
*
|
|
982
|
+
* @param name
|
|
983
|
+
* @param nx
|
|
984
|
+
* @param ny
|
|
985
|
+
* @param nz
|
|
986
|
+
*/
|
|
987
|
+
public void attribNormal(String name, float nx, float ny, float nz) {
|
|
727
988
|
}
|
|
728
989
|
|
|
729
|
-
|
|
730
|
-
|
|
990
|
+
/**
|
|
991
|
+
*
|
|
992
|
+
* @param name
|
|
993
|
+
* @param color
|
|
994
|
+
*/
|
|
995
|
+
public void attribColor(String name, int color) {
|
|
731
996
|
}
|
|
732
997
|
|
|
733
|
-
|
|
734
|
-
|
|
998
|
+
/**
|
|
999
|
+
*
|
|
1000
|
+
* @param name
|
|
1001
|
+
* @param values
|
|
1002
|
+
*/
|
|
1003
|
+
public void attrib(String name, float... values) {
|
|
735
1004
|
}
|
|
736
1005
|
|
|
737
|
-
|
|
738
|
-
|
|
1006
|
+
/**
|
|
1007
|
+
*
|
|
1008
|
+
* @param name
|
|
1009
|
+
* @param values
|
|
1010
|
+
*/
|
|
1011
|
+
public void attrib(String name, int... values) {
|
|
739
1012
|
}
|
|
740
1013
|
|
|
741
|
-
|
|
742
|
-
|
|
1014
|
+
/**
|
|
1015
|
+
*
|
|
1016
|
+
* @param name
|
|
1017
|
+
* @param values
|
|
1018
|
+
*/
|
|
1019
|
+
public void attrib(String name, boolean... values) {
|
|
743
1020
|
}
|
|
744
1021
|
|
|
745
1022
|
|
|
@@ -752,8 +1029,11 @@ public class PShape implements PConstants {
|
|
|
752
1029
|
beginShape(POLYGON);
|
|
753
1030
|
}
|
|
754
1031
|
|
|
755
|
-
|
|
756
|
-
|
|
1032
|
+
/**
|
|
1033
|
+
*
|
|
1034
|
+
* @param kind
|
|
1035
|
+
*/
|
|
1036
|
+
public void beginShape(int kind) {
|
|
757
1037
|
this.kind = kind;
|
|
758
1038
|
openShape = true;
|
|
759
1039
|
}
|
|
@@ -767,8 +1047,11 @@ public class PShape implements PConstants {
|
|
|
767
1047
|
endShape(OPEN);
|
|
768
1048
|
}
|
|
769
1049
|
|
|
770
|
-
|
|
771
|
-
|
|
1050
|
+
/**
|
|
1051
|
+
*
|
|
1052
|
+
* @param mode
|
|
1053
|
+
*/
|
|
1054
|
+
public void endShape(int mode) {
|
|
772
1055
|
if (family == GROUP) {
|
|
773
1056
|
PGraphics.showWarning("Cannot end GROUP shape");
|
|
774
1057
|
return;
|
|
@@ -790,6 +1073,11 @@ public class PShape implements PConstants {
|
|
|
790
1073
|
|
|
791
1074
|
// STROKE CAP/JOIN/WEIGHT
|
|
792
1075
|
|
|
1076
|
+
/**
|
|
1077
|
+
*
|
|
1078
|
+
* @param weight
|
|
1079
|
+
*/
|
|
1080
|
+
|
|
793
1081
|
|
|
794
1082
|
public void strokeWeight(float weight) {
|
|
795
1083
|
if (!openShape) {
|
|
@@ -800,7 +1088,11 @@ public class PShape implements PConstants {
|
|
|
800
1088
|
strokeWeight = weight;
|
|
801
1089
|
}
|
|
802
1090
|
|
|
803
|
-
|
|
1091
|
+
/**
|
|
1092
|
+
*
|
|
1093
|
+
* @param join
|
|
1094
|
+
*/
|
|
1095
|
+
public void strokeJoin(int join) {
|
|
804
1096
|
if (!openShape) {
|
|
805
1097
|
PGraphics.showWarning(OUTSIDE_BEGIN_END_ERROR, "strokeJoin()");
|
|
806
1098
|
return;
|
|
@@ -809,7 +1101,11 @@ public class PShape implements PConstants {
|
|
|
809
1101
|
strokeJoin = join;
|
|
810
1102
|
}
|
|
811
1103
|
|
|
812
|
-
|
|
1104
|
+
/**
|
|
1105
|
+
*
|
|
1106
|
+
* @param cap
|
|
1107
|
+
*/
|
|
1108
|
+
public void strokeCap(int cap) {
|
|
813
1109
|
if (!openShape) {
|
|
814
1110
|
PGraphics.showWarning(OUTSIDE_BEGIN_END_ERROR, "strokeCap()");
|
|
815
1111
|
return;
|
|
@@ -823,6 +1119,10 @@ public class PShape implements PConstants {
|
|
|
823
1119
|
|
|
824
1120
|
// FILL COLOR
|
|
825
1121
|
|
|
1122
|
+
/**
|
|
1123
|
+
*
|
|
1124
|
+
*/
|
|
1125
|
+
|
|
826
1126
|
|
|
827
1127
|
public void noFill() {
|
|
828
1128
|
if (!openShape) {
|
|
@@ -838,8 +1138,11 @@ public class PShape implements PConstants {
|
|
|
838
1138
|
}
|
|
839
1139
|
}
|
|
840
1140
|
|
|
841
|
-
|
|
842
|
-
|
|
1141
|
+
/**
|
|
1142
|
+
*
|
|
1143
|
+
* @param rgb
|
|
1144
|
+
*/
|
|
1145
|
+
public void fill(int rgb) {
|
|
843
1146
|
if (!openShape) {
|
|
844
1147
|
PGraphics.showWarning(OUTSIDE_BEGIN_END_ERROR, "fill()");
|
|
845
1148
|
return;
|
|
@@ -854,8 +1157,12 @@ public class PShape implements PConstants {
|
|
|
854
1157
|
}
|
|
855
1158
|
}
|
|
856
1159
|
|
|
857
|
-
|
|
858
|
-
|
|
1160
|
+
/**
|
|
1161
|
+
*
|
|
1162
|
+
* @param rgb
|
|
1163
|
+
* @param alpha
|
|
1164
|
+
*/
|
|
1165
|
+
public void fill(int rgb, float alpha) {
|
|
859
1166
|
if (!openShape) {
|
|
860
1167
|
PGraphics.showWarning(OUTSIDE_BEGIN_END_ERROR, "fill()");
|
|
861
1168
|
return;
|
|
@@ -870,8 +1177,11 @@ public class PShape implements PConstants {
|
|
|
870
1177
|
}
|
|
871
1178
|
}
|
|
872
1179
|
|
|
873
|
-
|
|
874
|
-
|
|
1180
|
+
/**
|
|
1181
|
+
*
|
|
1182
|
+
* @param gray
|
|
1183
|
+
*/
|
|
1184
|
+
public void fill(float gray) {
|
|
875
1185
|
if (!openShape) {
|
|
876
1186
|
PGraphics.showWarning(OUTSIDE_BEGIN_END_ERROR, "fill()");
|
|
877
1187
|
return;
|
|
@@ -886,8 +1196,12 @@ public class PShape implements PConstants {
|
|
|
886
1196
|
}
|
|
887
1197
|
}
|
|
888
1198
|
|
|
889
|
-
|
|
890
|
-
|
|
1199
|
+
/**
|
|
1200
|
+
*
|
|
1201
|
+
* @param gray
|
|
1202
|
+
* @param alpha
|
|
1203
|
+
*/
|
|
1204
|
+
public void fill(float gray, float alpha) {
|
|
891
1205
|
if (!openShape) {
|
|
892
1206
|
PGraphics.showWarning(OUTSIDE_BEGIN_END_ERROR, "fill()");
|
|
893
1207
|
return;
|
|
@@ -907,8 +1221,13 @@ public class PShape implements PConstants {
|
|
|
907
1221
|
}
|
|
908
1222
|
}
|
|
909
1223
|
|
|
910
|
-
|
|
911
|
-
|
|
1224
|
+
/**
|
|
1225
|
+
*
|
|
1226
|
+
* @param x
|
|
1227
|
+
* @param y
|
|
1228
|
+
* @param z
|
|
1229
|
+
*/
|
|
1230
|
+
public void fill(float x, float y, float z) {
|
|
912
1231
|
if (!openShape) {
|
|
913
1232
|
PGraphics.showWarning(OUTSIDE_BEGIN_END_ERROR, "fill()");
|
|
914
1233
|
return;
|
|
@@ -923,8 +1242,14 @@ public class PShape implements PConstants {
|
|
|
923
1242
|
}
|
|
924
1243
|
}
|
|
925
1244
|
|
|
926
|
-
|
|
927
|
-
|
|
1245
|
+
/**
|
|
1246
|
+
*
|
|
1247
|
+
* @param x
|
|
1248
|
+
* @param y
|
|
1249
|
+
* @param z
|
|
1250
|
+
* @param a
|
|
1251
|
+
*/
|
|
1252
|
+
public void fill(float x, float y, float z, float a) {
|
|
928
1253
|
if (!openShape) {
|
|
929
1254
|
PGraphics.showWarning(OUTSIDE_BEGIN_END_ERROR, "fill()");
|
|
930
1255
|
return;
|
|
@@ -944,6 +1269,10 @@ public class PShape implements PConstants {
|
|
|
944
1269
|
|
|
945
1270
|
// STROKE COLOR
|
|
946
1271
|
|
|
1272
|
+
/**
|
|
1273
|
+
*
|
|
1274
|
+
*/
|
|
1275
|
+
|
|
947
1276
|
|
|
948
1277
|
public void noStroke() {
|
|
949
1278
|
if (!openShape) {
|
|
@@ -954,8 +1283,11 @@ public class PShape implements PConstants {
|
|
|
954
1283
|
stroke = false;
|
|
955
1284
|
}
|
|
956
1285
|
|
|
957
|
-
|
|
958
|
-
|
|
1286
|
+
/**
|
|
1287
|
+
*
|
|
1288
|
+
* @param rgb
|
|
1289
|
+
*/
|
|
1290
|
+
public void stroke(int rgb) {
|
|
959
1291
|
if (!openShape) {
|
|
960
1292
|
PGraphics.showWarning(OUTSIDE_BEGIN_END_ERROR, "stroke()");
|
|
961
1293
|
return;
|
|
@@ -966,8 +1298,12 @@ public class PShape implements PConstants {
|
|
|
966
1298
|
strokeColor = calcColor;
|
|
967
1299
|
}
|
|
968
1300
|
|
|
969
|
-
|
|
970
|
-
|
|
1301
|
+
/**
|
|
1302
|
+
*
|
|
1303
|
+
* @param rgb
|
|
1304
|
+
* @param alpha
|
|
1305
|
+
*/
|
|
1306
|
+
public void stroke(int rgb, float alpha) {
|
|
971
1307
|
if (!openShape) {
|
|
972
1308
|
PGraphics.showWarning(OUTSIDE_BEGIN_END_ERROR, "stroke()");
|
|
973
1309
|
return;
|
|
@@ -978,8 +1314,11 @@ public class PShape implements PConstants {
|
|
|
978
1314
|
strokeColor = calcColor;
|
|
979
1315
|
}
|
|
980
1316
|
|
|
981
|
-
|
|
982
|
-
|
|
1317
|
+
/**
|
|
1318
|
+
*
|
|
1319
|
+
* @param gray
|
|
1320
|
+
*/
|
|
1321
|
+
public void stroke(float gray) {
|
|
983
1322
|
if (!openShape) {
|
|
984
1323
|
PGraphics.showWarning(OUTSIDE_BEGIN_END_ERROR, "stroke()");
|
|
985
1324
|
return;
|
|
@@ -990,8 +1329,12 @@ public class PShape implements PConstants {
|
|
|
990
1329
|
strokeColor = calcColor;
|
|
991
1330
|
}
|
|
992
1331
|
|
|
993
|
-
|
|
994
|
-
|
|
1332
|
+
/**
|
|
1333
|
+
*
|
|
1334
|
+
* @param gray
|
|
1335
|
+
* @param alpha
|
|
1336
|
+
*/
|
|
1337
|
+
public void stroke(float gray, float alpha) {
|
|
995
1338
|
if (!openShape) {
|
|
996
1339
|
PGraphics.showWarning(OUTSIDE_BEGIN_END_ERROR, "stroke()");
|
|
997
1340
|
return;
|
|
@@ -1002,8 +1345,13 @@ public class PShape implements PConstants {
|
|
|
1002
1345
|
strokeColor = calcColor;
|
|
1003
1346
|
}
|
|
1004
1347
|
|
|
1005
|
-
|
|
1006
|
-
|
|
1348
|
+
/**
|
|
1349
|
+
*
|
|
1350
|
+
* @param x
|
|
1351
|
+
* @param y
|
|
1352
|
+
* @param z
|
|
1353
|
+
*/
|
|
1354
|
+
public void stroke(float x, float y, float z) {
|
|
1007
1355
|
if (!openShape) {
|
|
1008
1356
|
PGraphics.showWarning(OUTSIDE_BEGIN_END_ERROR, "stroke()");
|
|
1009
1357
|
return;
|
|
@@ -1014,8 +1362,14 @@ public class PShape implements PConstants {
|
|
|
1014
1362
|
strokeColor = calcColor;
|
|
1015
1363
|
}
|
|
1016
1364
|
|
|
1017
|
-
|
|
1018
|
-
|
|
1365
|
+
/**
|
|
1366
|
+
*
|
|
1367
|
+
* @param x
|
|
1368
|
+
* @param y
|
|
1369
|
+
* @param z
|
|
1370
|
+
* @param alpha
|
|
1371
|
+
*/
|
|
1372
|
+
public void stroke(float x, float y, float z, float alpha) {
|
|
1019
1373
|
if (!openShape) {
|
|
1020
1374
|
PGraphics.showWarning(OUTSIDE_BEGIN_END_ERROR, "stroke()");
|
|
1021
1375
|
return;
|
|
@@ -1031,6 +1385,10 @@ public class PShape implements PConstants {
|
|
|
1031
1385
|
|
|
1032
1386
|
// TINT COLOR
|
|
1033
1387
|
|
|
1388
|
+
/**
|
|
1389
|
+
*
|
|
1390
|
+
*/
|
|
1391
|
+
|
|
1034
1392
|
|
|
1035
1393
|
public void noTint() {
|
|
1036
1394
|
if (!openShape) {
|
|
@@ -1041,8 +1399,11 @@ public class PShape implements PConstants {
|
|
|
1041
1399
|
tint = false;
|
|
1042
1400
|
}
|
|
1043
1401
|
|
|
1044
|
-
|
|
1045
|
-
|
|
1402
|
+
/**
|
|
1403
|
+
*
|
|
1404
|
+
* @param rgb
|
|
1405
|
+
*/
|
|
1406
|
+
public void tint(int rgb) {
|
|
1046
1407
|
if (!openShape) {
|
|
1047
1408
|
PGraphics.showWarning(OUTSIDE_BEGIN_END_ERROR, "tint()");
|
|
1048
1409
|
return;
|
|
@@ -1053,8 +1414,12 @@ public class PShape implements PConstants {
|
|
|
1053
1414
|
tintColor = calcColor;
|
|
1054
1415
|
}
|
|
1055
1416
|
|
|
1056
|
-
|
|
1057
|
-
|
|
1417
|
+
/**
|
|
1418
|
+
*
|
|
1419
|
+
* @param rgb
|
|
1420
|
+
* @param alpha
|
|
1421
|
+
*/
|
|
1422
|
+
public void tint(int rgb, float alpha) {
|
|
1058
1423
|
if (!openShape) {
|
|
1059
1424
|
PGraphics.showWarning(OUTSIDE_BEGIN_END_ERROR, "tint()");
|
|
1060
1425
|
return;
|
|
@@ -1065,8 +1430,11 @@ public class PShape implements PConstants {
|
|
|
1065
1430
|
tintColor = calcColor;
|
|
1066
1431
|
}
|
|
1067
1432
|
|
|
1068
|
-
|
|
1069
|
-
|
|
1433
|
+
/**
|
|
1434
|
+
*
|
|
1435
|
+
* @param gray
|
|
1436
|
+
*/
|
|
1437
|
+
public void tint(float gray) {
|
|
1070
1438
|
if (!openShape) {
|
|
1071
1439
|
PGraphics.showWarning(OUTSIDE_BEGIN_END_ERROR, "tint()");
|
|
1072
1440
|
return;
|
|
@@ -1077,8 +1445,12 @@ public class PShape implements PConstants {
|
|
|
1077
1445
|
tintColor = calcColor;
|
|
1078
1446
|
}
|
|
1079
1447
|
|
|
1080
|
-
|
|
1081
|
-
|
|
1448
|
+
/**
|
|
1449
|
+
*
|
|
1450
|
+
* @param gray
|
|
1451
|
+
* @param alpha
|
|
1452
|
+
*/
|
|
1453
|
+
public void tint(float gray, float alpha) {
|
|
1082
1454
|
if (!openShape) {
|
|
1083
1455
|
PGraphics.showWarning(OUTSIDE_BEGIN_END_ERROR, "tint()");
|
|
1084
1456
|
return;
|
|
@@ -1089,8 +1461,13 @@ public class PShape implements PConstants {
|
|
|
1089
1461
|
tintColor = calcColor;
|
|
1090
1462
|
}
|
|
1091
1463
|
|
|
1092
|
-
|
|
1093
|
-
|
|
1464
|
+
/**
|
|
1465
|
+
*
|
|
1466
|
+
* @param x
|
|
1467
|
+
* @param y
|
|
1468
|
+
* @param z
|
|
1469
|
+
*/
|
|
1470
|
+
public void tint(float x, float y, float z) {
|
|
1094
1471
|
if (!openShape) {
|
|
1095
1472
|
PGraphics.showWarning(OUTSIDE_BEGIN_END_ERROR, "tint()");
|
|
1096
1473
|
return;
|
|
@@ -1101,8 +1478,14 @@ public class PShape implements PConstants {
|
|
|
1101
1478
|
tintColor = calcColor;
|
|
1102
1479
|
}
|
|
1103
1480
|
|
|
1104
|
-
|
|
1105
|
-
|
|
1481
|
+
/**
|
|
1482
|
+
*
|
|
1483
|
+
* @param x
|
|
1484
|
+
* @param y
|
|
1485
|
+
* @param z
|
|
1486
|
+
* @param alpha
|
|
1487
|
+
*/
|
|
1488
|
+
public void tint(float x, float y, float z, float alpha) {
|
|
1106
1489
|
if (!openShape) {
|
|
1107
1490
|
PGraphics.showWarning(OUTSIDE_BEGIN_END_ERROR, "tint()");
|
|
1108
1491
|
return;
|
|
@@ -1118,6 +1501,11 @@ public class PShape implements PConstants {
|
|
|
1118
1501
|
|
|
1119
1502
|
// Ambient set/update
|
|
1120
1503
|
|
|
1504
|
+
/**
|
|
1505
|
+
*
|
|
1506
|
+
* @param rgb
|
|
1507
|
+
*/
|
|
1508
|
+
|
|
1121
1509
|
public void ambient(int rgb) {
|
|
1122
1510
|
if (!openShape) {
|
|
1123
1511
|
PGraphics.showWarning(OUTSIDE_BEGIN_END_ERROR, "ambient()");
|
|
@@ -1129,8 +1517,11 @@ public class PShape implements PConstants {
|
|
|
1129
1517
|
ambientColor = calcColor;
|
|
1130
1518
|
}
|
|
1131
1519
|
|
|
1132
|
-
|
|
1133
|
-
|
|
1520
|
+
/**
|
|
1521
|
+
*
|
|
1522
|
+
* @param gray
|
|
1523
|
+
*/
|
|
1524
|
+
public void ambient(float gray) {
|
|
1134
1525
|
if (!openShape) {
|
|
1135
1526
|
PGraphics.showWarning(OUTSIDE_BEGIN_END_ERROR, "ambient()");
|
|
1136
1527
|
return;
|
|
@@ -1141,8 +1532,13 @@ public class PShape implements PConstants {
|
|
|
1141
1532
|
ambientColor = calcColor;
|
|
1142
1533
|
}
|
|
1143
1534
|
|
|
1144
|
-
|
|
1145
|
-
|
|
1535
|
+
/**
|
|
1536
|
+
*
|
|
1537
|
+
* @param x
|
|
1538
|
+
* @param y
|
|
1539
|
+
* @param z
|
|
1540
|
+
*/
|
|
1541
|
+
public void ambient(float x, float y, float z) {
|
|
1146
1542
|
if (!openShape) {
|
|
1147
1543
|
PGraphics.showWarning(OUTSIDE_BEGIN_END_ERROR, "ambient()");
|
|
1148
1544
|
return;
|
|
@@ -1158,6 +1554,11 @@ public class PShape implements PConstants {
|
|
|
1158
1554
|
|
|
1159
1555
|
// Specular set/update
|
|
1160
1556
|
|
|
1557
|
+
/**
|
|
1558
|
+
*
|
|
1559
|
+
* @param rgb
|
|
1560
|
+
*/
|
|
1561
|
+
|
|
1161
1562
|
public void specular(int rgb) {
|
|
1162
1563
|
if (!openShape) {
|
|
1163
1564
|
PGraphics.showWarning(OUTSIDE_BEGIN_END_ERROR, "specular()");
|
|
@@ -1168,8 +1569,11 @@ public class PShape implements PConstants {
|
|
|
1168
1569
|
specularColor = calcColor;
|
|
1169
1570
|
}
|
|
1170
1571
|
|
|
1171
|
-
|
|
1172
|
-
|
|
1572
|
+
/**
|
|
1573
|
+
*
|
|
1574
|
+
* @param gray
|
|
1575
|
+
*/
|
|
1576
|
+
public void specular(float gray) {
|
|
1173
1577
|
if (!openShape) {
|
|
1174
1578
|
PGraphics.showWarning(OUTSIDE_BEGIN_END_ERROR, "specular()");
|
|
1175
1579
|
return;
|
|
@@ -1179,8 +1583,13 @@ public class PShape implements PConstants {
|
|
|
1179
1583
|
specularColor = calcColor;
|
|
1180
1584
|
}
|
|
1181
1585
|
|
|
1182
|
-
|
|
1183
|
-
|
|
1586
|
+
/**
|
|
1587
|
+
*
|
|
1588
|
+
* @param x
|
|
1589
|
+
* @param y
|
|
1590
|
+
* @param z
|
|
1591
|
+
*/
|
|
1592
|
+
public void specular(float x, float y, float z) {
|
|
1184
1593
|
if (!openShape) {
|
|
1185
1594
|
PGraphics.showWarning(OUTSIDE_BEGIN_END_ERROR, "specular()");
|
|
1186
1595
|
return;
|
|
@@ -1195,6 +1604,11 @@ public class PShape implements PConstants {
|
|
|
1195
1604
|
|
|
1196
1605
|
// Emissive set/update
|
|
1197
1606
|
|
|
1607
|
+
/**
|
|
1608
|
+
*
|
|
1609
|
+
* @param rgb
|
|
1610
|
+
*/
|
|
1611
|
+
|
|
1198
1612
|
public void emissive(int rgb) {
|
|
1199
1613
|
if (!openShape) {
|
|
1200
1614
|
PGraphics.showWarning(OUTSIDE_BEGIN_END_ERROR, "emissive()");
|
|
@@ -1205,8 +1619,11 @@ public class PShape implements PConstants {
|
|
|
1205
1619
|
emissiveColor = calcColor;
|
|
1206
1620
|
}
|
|
1207
1621
|
|
|
1208
|
-
|
|
1209
|
-
|
|
1622
|
+
/**
|
|
1623
|
+
*
|
|
1624
|
+
* @param gray
|
|
1625
|
+
*/
|
|
1626
|
+
public void emissive(float gray) {
|
|
1210
1627
|
if (!openShape) {
|
|
1211
1628
|
PGraphics.showWarning(OUTSIDE_BEGIN_END_ERROR, "emissive()");
|
|
1212
1629
|
return;
|
|
@@ -1216,8 +1633,13 @@ public class PShape implements PConstants {
|
|
|
1216
1633
|
emissiveColor = calcColor;
|
|
1217
1634
|
}
|
|
1218
1635
|
|
|
1219
|
-
|
|
1220
|
-
|
|
1636
|
+
/**
|
|
1637
|
+
*
|
|
1638
|
+
* @param x
|
|
1639
|
+
* @param y
|
|
1640
|
+
* @param z
|
|
1641
|
+
*/
|
|
1642
|
+
public void emissive(float x, float y, float z) {
|
|
1221
1643
|
if (!openShape) {
|
|
1222
1644
|
PGraphics.showWarning(OUTSIDE_BEGIN_END_ERROR, "emissive()");
|
|
1223
1645
|
return;
|
|
@@ -1232,6 +1654,11 @@ public class PShape implements PConstants {
|
|
|
1232
1654
|
|
|
1233
1655
|
// Shininess set/update
|
|
1234
1656
|
|
|
1657
|
+
/**
|
|
1658
|
+
*
|
|
1659
|
+
* @param shine
|
|
1660
|
+
*/
|
|
1661
|
+
|
|
1235
1662
|
public void shininess(float shine) {
|
|
1236
1663
|
if (!openShape) {
|
|
1237
1664
|
PGraphics.showWarning(OUTSIDE_BEGIN_END_ERROR, "shininess()");
|
|
@@ -1247,12 +1674,23 @@ public class PShape implements PConstants {
|
|
|
1247
1674
|
|
|
1248
1675
|
// Bezier curves
|
|
1249
1676
|
|
|
1250
|
-
|
|
1251
|
-
|
|
1252
|
-
|
|
1253
|
-
|
|
1254
|
-
|
|
1255
|
-
|
|
1677
|
+
/**
|
|
1678
|
+
*
|
|
1679
|
+
* @param detail
|
|
1680
|
+
*/
|
|
1681
|
+
public void bezierDetail(int detail) {
|
|
1682
|
+
}
|
|
1683
|
+
|
|
1684
|
+
/**
|
|
1685
|
+
*
|
|
1686
|
+
* @param x2
|
|
1687
|
+
* @param y2
|
|
1688
|
+
* @param x3
|
|
1689
|
+
* @param y3
|
|
1690
|
+
* @param x4
|
|
1691
|
+
* @param y4
|
|
1692
|
+
*/
|
|
1693
|
+
public void bezierVertex(float x2, float y2,
|
|
1256
1694
|
float x3, float y3,
|
|
1257
1695
|
float x4, float y4) {
|
|
1258
1696
|
if (vertices == null) {
|
|
@@ -1278,14 +1716,31 @@ public class PShape implements PConstants {
|
|
|
1278
1716
|
}
|
|
1279
1717
|
}
|
|
1280
1718
|
|
|
1281
|
-
|
|
1282
|
-
|
|
1719
|
+
/**
|
|
1720
|
+
*
|
|
1721
|
+
* @param x2
|
|
1722
|
+
* @param y2
|
|
1723
|
+
* @param z2
|
|
1724
|
+
* @param x3
|
|
1725
|
+
* @param y3
|
|
1726
|
+
* @param z3
|
|
1727
|
+
* @param x4
|
|
1728
|
+
* @param y4
|
|
1729
|
+
* @param z4
|
|
1730
|
+
*/
|
|
1731
|
+
public void bezierVertex(float x2, float y2, float z2,
|
|
1283
1732
|
float x3, float y3, float z3,
|
|
1284
1733
|
float x4, float y4, float z4) {
|
|
1285
1734
|
}
|
|
1286
1735
|
|
|
1287
|
-
|
|
1288
|
-
|
|
1736
|
+
/**
|
|
1737
|
+
*
|
|
1738
|
+
* @param cx
|
|
1739
|
+
* @param cy
|
|
1740
|
+
* @param x3
|
|
1741
|
+
* @param y3
|
|
1742
|
+
*/
|
|
1743
|
+
public void quadraticVertex(float cx, float cy,
|
|
1289
1744
|
float x3, float y3) {
|
|
1290
1745
|
if (vertices == null) {
|
|
1291
1746
|
vertices = new float[10][];
|
|
@@ -1309,8 +1764,16 @@ public class PShape implements PConstants {
|
|
|
1309
1764
|
}
|
|
1310
1765
|
}
|
|
1311
1766
|
|
|
1312
|
-
|
|
1313
|
-
|
|
1767
|
+
/**
|
|
1768
|
+
*
|
|
1769
|
+
* @param cx
|
|
1770
|
+
* @param cy
|
|
1771
|
+
* @param cz
|
|
1772
|
+
* @param x3
|
|
1773
|
+
* @param y3
|
|
1774
|
+
* @param z3
|
|
1775
|
+
*/
|
|
1776
|
+
public void quadraticVertex(float cx, float cy, float cz,
|
|
1314
1777
|
float x3, float y3, float z3) {
|
|
1315
1778
|
}
|
|
1316
1779
|
|
|
@@ -1321,16 +1784,36 @@ public class PShape implements PConstants {
|
|
|
1321
1784
|
|
|
1322
1785
|
// Catmull-Rom curves
|
|
1323
1786
|
|
|
1787
|
+
/**
|
|
1788
|
+
*
|
|
1789
|
+
* @param detail
|
|
1790
|
+
*/
|
|
1791
|
+
|
|
1324
1792
|
public void curveDetail(int detail) {
|
|
1325
1793
|
}
|
|
1326
1794
|
|
|
1327
|
-
|
|
1795
|
+
/**
|
|
1796
|
+
*
|
|
1797
|
+
* @param tightness
|
|
1798
|
+
*/
|
|
1799
|
+
public void curveTightness(float tightness) {
|
|
1328
1800
|
}
|
|
1329
1801
|
|
|
1330
|
-
|
|
1802
|
+
/**
|
|
1803
|
+
*
|
|
1804
|
+
* @param x
|
|
1805
|
+
* @param y
|
|
1806
|
+
*/
|
|
1807
|
+
public void curveVertex(float x, float y) {
|
|
1331
1808
|
}
|
|
1332
1809
|
|
|
1333
|
-
|
|
1810
|
+
/**
|
|
1811
|
+
*
|
|
1812
|
+
* @param x
|
|
1813
|
+
* @param y
|
|
1814
|
+
* @param z
|
|
1815
|
+
*/
|
|
1816
|
+
public void curveVertex(float x, float y, float z) {
|
|
1334
1817
|
}
|
|
1335
1818
|
|
|
1336
1819
|
|
|
@@ -1353,6 +1836,12 @@ public class PShape implements PConstants {
|
|
|
1353
1836
|
int shapeModeSaved;
|
|
1354
1837
|
*/
|
|
1355
1838
|
|
|
1839
|
+
/**
|
|
1840
|
+
*
|
|
1841
|
+
* @param g
|
|
1842
|
+
*/
|
|
1843
|
+
|
|
1844
|
+
|
|
1356
1845
|
|
|
1357
1846
|
protected void pre(PGraphics g) {
|
|
1358
1847
|
if (matrix != null) {
|
|
@@ -1380,8 +1869,11 @@ public class PShape implements PConstants {
|
|
|
1380
1869
|
}
|
|
1381
1870
|
}
|
|
1382
1871
|
|
|
1383
|
-
|
|
1384
|
-
|
|
1872
|
+
/**
|
|
1873
|
+
*
|
|
1874
|
+
* @param g
|
|
1875
|
+
*/
|
|
1876
|
+
protected void styles(PGraphics g) {
|
|
1385
1877
|
// should not be necessary because using only the int version of color
|
|
1386
1878
|
//parent.colorMode(PConstants.RGB, 255);
|
|
1387
1879
|
|
|
@@ -1402,8 +1894,11 @@ public class PShape implements PConstants {
|
|
|
1402
1894
|
}
|
|
1403
1895
|
}
|
|
1404
1896
|
|
|
1405
|
-
|
|
1406
|
-
|
|
1897
|
+
/**
|
|
1898
|
+
*
|
|
1899
|
+
* @param g
|
|
1900
|
+
*/
|
|
1901
|
+
protected void post(PGraphics g) {
|
|
1407
1902
|
// for (int i = 0; i < childCount; i++) {
|
|
1408
1903
|
// children[i].draw(g);
|
|
1409
1904
|
// }
|
|
@@ -1438,6 +1933,13 @@ public class PShape implements PConstants {
|
|
|
1438
1933
|
|
|
1439
1934
|
|
|
1440
1935
|
// TODO unapproved
|
|
1936
|
+
|
|
1937
|
+
/**
|
|
1938
|
+
*
|
|
1939
|
+
* @param parent
|
|
1940
|
+
* @param src
|
|
1941
|
+
* @return
|
|
1942
|
+
*/
|
|
1441
1943
|
static protected PShape createShape(PApplet parent, PShape src) {
|
|
1442
1944
|
PShape dest = null;
|
|
1443
1945
|
if (src.family == GROUP) {
|
|
@@ -1459,6 +1961,13 @@ public class PShape implements PConstants {
|
|
|
1459
1961
|
|
|
1460
1962
|
|
|
1461
1963
|
// TODO unapproved
|
|
1964
|
+
|
|
1965
|
+
/**
|
|
1966
|
+
*
|
|
1967
|
+
* @param parent
|
|
1968
|
+
* @param src
|
|
1969
|
+
* @param dest
|
|
1970
|
+
*/
|
|
1462
1971
|
static protected void copyGroup(PApplet parent, PShape src, PShape dest) {
|
|
1463
1972
|
copyMatrix(src, dest);
|
|
1464
1973
|
copyStyles(src, dest);
|
|
@@ -1471,6 +1980,12 @@ public class PShape implements PConstants {
|
|
|
1471
1980
|
|
|
1472
1981
|
|
|
1473
1982
|
// TODO unapproved
|
|
1983
|
+
|
|
1984
|
+
/**
|
|
1985
|
+
*
|
|
1986
|
+
* @param src
|
|
1987
|
+
* @param dest
|
|
1988
|
+
*/
|
|
1474
1989
|
static protected void copyPrimitive(PShape src, PShape dest) {
|
|
1475
1990
|
copyMatrix(src, dest);
|
|
1476
1991
|
copyStyles(src, dest);
|
|
@@ -1479,6 +1994,12 @@ public class PShape implements PConstants {
|
|
|
1479
1994
|
|
|
1480
1995
|
|
|
1481
1996
|
// TODO unapproved
|
|
1997
|
+
|
|
1998
|
+
/**
|
|
1999
|
+
*
|
|
2000
|
+
* @param src
|
|
2001
|
+
* @param dest
|
|
2002
|
+
*/
|
|
1482
2003
|
static protected void copyGeometry(PShape src, PShape dest) {
|
|
1483
2004
|
dest.beginShape(src.getKind());
|
|
1484
2005
|
|
|
@@ -1528,6 +2049,12 @@ public class PShape implements PConstants {
|
|
|
1528
2049
|
|
|
1529
2050
|
|
|
1530
2051
|
// TODO unapproved
|
|
2052
|
+
|
|
2053
|
+
/**
|
|
2054
|
+
*
|
|
2055
|
+
* @param src
|
|
2056
|
+
* @param dest
|
|
2057
|
+
*/
|
|
1531
2058
|
static protected void copyPath(PShape src, PShape dest) {
|
|
1532
2059
|
copyMatrix(src, dest);
|
|
1533
2060
|
copyStyles(src, dest);
|
|
@@ -1538,6 +2065,12 @@ public class PShape implements PConstants {
|
|
|
1538
2065
|
|
|
1539
2066
|
|
|
1540
2067
|
// TODO unapproved
|
|
2068
|
+
|
|
2069
|
+
/**
|
|
2070
|
+
*
|
|
2071
|
+
* @param src
|
|
2072
|
+
* @param dest
|
|
2073
|
+
*/
|
|
1541
2074
|
static protected void copyMatrix(PShape src, PShape dest) {
|
|
1542
2075
|
if (src.matrix != null) {
|
|
1543
2076
|
dest.applyMatrix(src.matrix);
|
|
@@ -1546,6 +2079,12 @@ public class PShape implements PConstants {
|
|
|
1546
2079
|
|
|
1547
2080
|
|
|
1548
2081
|
// TODO unapproved
|
|
2082
|
+
|
|
2083
|
+
/**
|
|
2084
|
+
*
|
|
2085
|
+
* @param src
|
|
2086
|
+
* @param dest
|
|
2087
|
+
*/
|
|
1549
2088
|
static protected void copyStyles(PShape src, PShape dest) {
|
|
1550
2089
|
dest.ellipseMode = src.ellipseMode;
|
|
1551
2090
|
dest.rectMode = src.rectMode;
|
|
@@ -1570,6 +2109,12 @@ public class PShape implements PConstants {
|
|
|
1570
2109
|
|
|
1571
2110
|
|
|
1572
2111
|
// TODO unapproved
|
|
2112
|
+
|
|
2113
|
+
/**
|
|
2114
|
+
*
|
|
2115
|
+
* @param src
|
|
2116
|
+
* @param dest
|
|
2117
|
+
*/
|
|
1573
2118
|
static protected void copyImage(PShape src, PShape dest) {
|
|
1574
2119
|
if (src.image != null) {
|
|
1575
2120
|
dest.texture(src.image);
|
|
@@ -1585,6 +2130,7 @@ public class PShape implements PConstants {
|
|
|
1585
2130
|
* Called by the following (the shape() command adds the g)
|
|
1586
2131
|
* PShape s = loadShape("blah.svg");
|
|
1587
2132
|
* shape(s);
|
|
2133
|
+
* @param g
|
|
1588
2134
|
*/
|
|
1589
2135
|
public void draw(PGraphics g) {
|
|
1590
2136
|
if (visible) {
|
|
@@ -1597,6 +2143,7 @@ public class PShape implements PConstants {
|
|
|
1597
2143
|
|
|
1598
2144
|
/**
|
|
1599
2145
|
* Draws the SVG document.
|
|
2146
|
+
* @param g
|
|
1600
2147
|
*/
|
|
1601
2148
|
protected void drawImpl(PGraphics g) {
|
|
1602
2149
|
if (family == GROUP) {
|
|
@@ -1612,15 +2159,21 @@ public class PShape implements PConstants {
|
|
|
1612
2159
|
}
|
|
1613
2160
|
}
|
|
1614
2161
|
|
|
1615
|
-
|
|
1616
|
-
|
|
2162
|
+
/**
|
|
2163
|
+
*
|
|
2164
|
+
* @param g
|
|
2165
|
+
*/
|
|
2166
|
+
protected void drawGroup(PGraphics g) {
|
|
1617
2167
|
for (int i = 0; i < childCount; i++) {
|
|
1618
2168
|
children[i].draw(g);
|
|
1619
2169
|
}
|
|
1620
2170
|
}
|
|
1621
2171
|
|
|
1622
|
-
|
|
1623
|
-
|
|
2172
|
+
/**
|
|
2173
|
+
*
|
|
2174
|
+
* @param g
|
|
2175
|
+
*/
|
|
2176
|
+
protected void drawPrimitive(PGraphics g) {
|
|
1624
2177
|
if (kind == POINT) {
|
|
1625
2178
|
g.point(params[0], params[1]);
|
|
1626
2179
|
|
|
@@ -1702,8 +2255,11 @@ public class PShape implements PConstants {
|
|
|
1702
2255
|
}
|
|
1703
2256
|
}
|
|
1704
2257
|
|
|
1705
|
-
|
|
1706
|
-
|
|
2258
|
+
/**
|
|
2259
|
+
*
|
|
2260
|
+
* @param g
|
|
2261
|
+
*/
|
|
2262
|
+
protected void drawGeometry(PGraphics g) {
|
|
1707
2263
|
// get cache object using g.
|
|
1708
2264
|
g.beginShape(kind);
|
|
1709
2265
|
if (style) {
|
|
@@ -1778,6 +2334,12 @@ public class PShape implements PConstants {
|
|
|
1778
2334
|
}
|
|
1779
2335
|
*/
|
|
1780
2336
|
|
|
2337
|
+
/**
|
|
2338
|
+
*
|
|
2339
|
+
* @param g
|
|
2340
|
+
*/
|
|
2341
|
+
|
|
2342
|
+
|
|
1781
2343
|
protected void drawPath(PGraphics g) {
|
|
1782
2344
|
// Paths might be empty (go figure)
|
|
1783
2345
|
// http://dev.processing.org/bugs/show_bug.cgi?id=982
|
|
@@ -1882,12 +2444,18 @@ public class PShape implements PConstants {
|
|
|
1882
2444
|
|
|
1883
2445
|
// . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
|
|
1884
2446
|
|
|
2447
|
+
/**
|
|
2448
|
+
*
|
|
2449
|
+
* @return
|
|
2450
|
+
*/
|
|
2451
|
+
|
|
1885
2452
|
|
|
1886
2453
|
public PShape getParent() {
|
|
1887
2454
|
return parent;
|
|
1888
2455
|
}
|
|
1889
2456
|
|
|
1890
2457
|
/**
|
|
2458
|
+
* @return
|
|
1891
2459
|
* @webref
|
|
1892
2460
|
* @brief Returns the number of children
|
|
1893
2461
|
*/
|
|
@@ -1904,8 +2472,11 @@ public class PShape implements PConstants {
|
|
|
1904
2472
|
}
|
|
1905
2473
|
}
|
|
1906
2474
|
|
|
1907
|
-
|
|
1908
|
-
|
|
2475
|
+
/**
|
|
2476
|
+
*
|
|
2477
|
+
* @return
|
|
2478
|
+
*/
|
|
2479
|
+
public PShape[] getChildren() {
|
|
1909
2480
|
crop();
|
|
1910
2481
|
return children;
|
|
1911
2482
|
}
|
|
@@ -1913,11 +2484,12 @@ public class PShape implements PConstants {
|
|
|
1913
2484
|
/**
|
|
1914
2485
|
* ( begin auto-generated from PShape_getChild.xml )
|
|
1915
2486
|
*
|
|
1916
|
-
* Extracts a child shape from a parent shape.
|
|
1917
|
-
|
|
1918
|
-
|
|
2487
|
+
* Extracts a child shape from a parent shape.Specify the name of the
|
|
2488
|
+
shape with the <b>target</b> parameter. The shape is returned as a
|
|
2489
|
+
<b>PShape</b> object, or <b>null</b> is returned if there is an error.
|
|
1919
2490
|
*
|
|
1920
2491
|
* ( end auto-generated )
|
|
2492
|
+
* @return
|
|
1921
2493
|
* @webref pshape:method
|
|
1922
2494
|
* @usage web_application
|
|
1923
2495
|
* @brief Returns a child element of a shape as a PShape object
|
|
@@ -1931,6 +2503,7 @@ public class PShape implements PConstants {
|
|
|
1931
2503
|
|
|
1932
2504
|
/**
|
|
1933
2505
|
* @param target the name of the shape to get
|
|
2506
|
+
* @return
|
|
1934
2507
|
*/
|
|
1935
2508
|
public PShape getChild(String target) {
|
|
1936
2509
|
if (name != null && name.equals(target)) {
|
|
@@ -1951,6 +2524,8 @@ public class PShape implements PConstants {
|
|
|
1951
2524
|
/**
|
|
1952
2525
|
* Same as getChild(name), except that it first walks all the way up the
|
|
1953
2526
|
* hierarchy to the eldest grandparent, so that children can be found anywhere.
|
|
2527
|
+
* @param target
|
|
2528
|
+
* @return
|
|
1954
2529
|
*/
|
|
1955
2530
|
public PShape findChild(String target) {
|
|
1956
2531
|
if (parent == null) {
|
|
@@ -1987,6 +2562,7 @@ public class PShape implements PConstants {
|
|
|
1987
2562
|
|
|
1988
2563
|
// adds child who exactly at position idx in the array of children.
|
|
1989
2564
|
/**
|
|
2565
|
+
* @param who
|
|
1990
2566
|
* @param idx the layer position in which to insert the new child
|
|
1991
2567
|
*/
|
|
1992
2568
|
public void addChild(PShape who, int idx) {
|
|
@@ -2014,6 +2590,7 @@ public class PShape implements PConstants {
|
|
|
2014
2590
|
|
|
2015
2591
|
/**
|
|
2016
2592
|
* Remove the child shape with index idx.
|
|
2593
|
+
* @param idx
|
|
2017
2594
|
*/
|
|
2018
2595
|
public void removeChild(int idx) {
|
|
2019
2596
|
if (idx < childCount) {
|
|
@@ -2034,6 +2611,8 @@ public class PShape implements PConstants {
|
|
|
2034
2611
|
|
|
2035
2612
|
/**
|
|
2036
2613
|
* Add a shape to the name lookup table.
|
|
2614
|
+
* @param nom
|
|
2615
|
+
* @param shape
|
|
2037
2616
|
*/
|
|
2038
2617
|
public void addName(String nom, PShape shape) {
|
|
2039
2618
|
if (parent != null) {
|
|
@@ -2049,6 +2628,8 @@ public class PShape implements PConstants {
|
|
|
2049
2628
|
|
|
2050
2629
|
/**
|
|
2051
2630
|
* Returns the index of child who.
|
|
2631
|
+
* @param who
|
|
2632
|
+
* @return
|
|
2052
2633
|
*/
|
|
2053
2634
|
public int getChildIndex(PShape who) {
|
|
2054
2635
|
for (int i = 0; i < childCount; i++) {
|
|
@@ -2059,8 +2640,11 @@ public class PShape implements PConstants {
|
|
|
2059
2640
|
return -1;
|
|
2060
2641
|
}
|
|
2061
2642
|
|
|
2062
|
-
|
|
2063
|
-
|
|
2643
|
+
/**
|
|
2644
|
+
*
|
|
2645
|
+
* @return
|
|
2646
|
+
*/
|
|
2647
|
+
public PShape getTessellation() {
|
|
2064
2648
|
return null;
|
|
2065
2649
|
}
|
|
2066
2650
|
|
|
@@ -2068,23 +2652,34 @@ public class PShape implements PConstants {
|
|
|
2068
2652
|
// . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
|
|
2069
2653
|
|
|
2070
2654
|
|
|
2071
|
-
/** The shape type, one of GROUP, PRIMITIVE, PATH, or GEOMETRY.
|
|
2655
|
+
/** The shape type, one of GROUP, PRIMITIVE, PATH, or GEOMETRY.
|
|
2656
|
+
* @return */
|
|
2072
2657
|
public int getFamily() {
|
|
2073
2658
|
return family;
|
|
2074
2659
|
}
|
|
2075
2660
|
|
|
2076
|
-
|
|
2077
|
-
|
|
2661
|
+
/**
|
|
2662
|
+
*
|
|
2663
|
+
* @return
|
|
2664
|
+
*/
|
|
2665
|
+
public int getKind() {
|
|
2078
2666
|
return kind;
|
|
2079
2667
|
}
|
|
2080
2668
|
|
|
2081
|
-
|
|
2082
|
-
|
|
2669
|
+
/**
|
|
2670
|
+
*
|
|
2671
|
+
* @return
|
|
2672
|
+
*/
|
|
2673
|
+
public float[] getParams() {
|
|
2083
2674
|
return getParams(null);
|
|
2084
2675
|
}
|
|
2085
2676
|
|
|
2086
|
-
|
|
2087
|
-
|
|
2677
|
+
/**
|
|
2678
|
+
*
|
|
2679
|
+
* @param target
|
|
2680
|
+
* @return
|
|
2681
|
+
*/
|
|
2682
|
+
public float[] getParams(float[] target) {
|
|
2088
2683
|
if (target == null || target.length != params.length) {
|
|
2089
2684
|
target = new float[params.length];
|
|
2090
2685
|
}
|
|
@@ -2092,13 +2687,20 @@ public class PShape implements PConstants {
|
|
|
2092
2687
|
return target;
|
|
2093
2688
|
}
|
|
2094
2689
|
|
|
2095
|
-
|
|
2096
|
-
|
|
2690
|
+
/**
|
|
2691
|
+
*
|
|
2692
|
+
* @param index
|
|
2693
|
+
* @return
|
|
2694
|
+
*/
|
|
2695
|
+
public float getParam(int index) {
|
|
2097
2696
|
return params[index];
|
|
2098
2697
|
}
|
|
2099
2698
|
|
|
2100
|
-
|
|
2101
|
-
|
|
2699
|
+
/**
|
|
2700
|
+
*
|
|
2701
|
+
* @param source
|
|
2702
|
+
*/
|
|
2703
|
+
protected void setParams(float[] source) {
|
|
2102
2704
|
if (params == null) {
|
|
2103
2705
|
params = new float[source.length];
|
|
2104
2706
|
}
|
|
@@ -2109,13 +2711,23 @@ public class PShape implements PConstants {
|
|
|
2109
2711
|
PApplet.arrayCopy(source, params);
|
|
2110
2712
|
}
|
|
2111
2713
|
|
|
2112
|
-
|
|
2113
|
-
|
|
2714
|
+
/**
|
|
2715
|
+
*
|
|
2716
|
+
* @param vcount
|
|
2717
|
+
* @param verts
|
|
2718
|
+
*/
|
|
2719
|
+
public void setPath(int vcount, float[][] verts) {
|
|
2114
2720
|
setPath(vcount, verts, 0, null);
|
|
2115
2721
|
}
|
|
2116
2722
|
|
|
2117
|
-
|
|
2118
|
-
|
|
2723
|
+
/**
|
|
2724
|
+
*
|
|
2725
|
+
* @param vcount
|
|
2726
|
+
* @param verts
|
|
2727
|
+
* @param ccount
|
|
2728
|
+
* @param codes
|
|
2729
|
+
*/
|
|
2730
|
+
protected void setPath(int vcount, float[][] verts, int ccount, int[] codes) {
|
|
2119
2731
|
if (verts == null || verts.length < vcount) return;
|
|
2120
2732
|
if (0 < ccount && (codes == null || codes.length < ccount)) return;
|
|
2121
2733
|
|
|
@@ -2134,6 +2746,7 @@ public class PShape implements PConstants {
|
|
|
2134
2746
|
}
|
|
2135
2747
|
|
|
2136
2748
|
/**
|
|
2749
|
+
* @return
|
|
2137
2750
|
* @webref pshape:method
|
|
2138
2751
|
* @brief Returns the total number of vertices as an int
|
|
2139
2752
|
* @see PShape#getVertex(int)
|
|
@@ -2148,6 +2761,7 @@ public class PShape implements PConstants {
|
|
|
2148
2761
|
|
|
2149
2762
|
|
|
2150
2763
|
/**
|
|
2764
|
+
* @return
|
|
2151
2765
|
* @webref pshape:method
|
|
2152
2766
|
* @brief Returns the vertex at the index position
|
|
2153
2767
|
* @param index the location of the vertex
|
|
@@ -2160,7 +2774,9 @@ public class PShape implements PConstants {
|
|
|
2160
2774
|
|
|
2161
2775
|
|
|
2162
2776
|
/**
|
|
2777
|
+
* @param index
|
|
2163
2778
|
* @param vec PVector to assign the data to
|
|
2779
|
+
* @return
|
|
2164
2780
|
*/
|
|
2165
2781
|
public PVector getVertex(int index, PVector vec) {
|
|
2166
2782
|
if (vec == null) {
|
|
@@ -2177,18 +2793,30 @@ public class PShape implements PConstants {
|
|
|
2177
2793
|
return vec;
|
|
2178
2794
|
}
|
|
2179
2795
|
|
|
2180
|
-
|
|
2181
|
-
|
|
2796
|
+
/**
|
|
2797
|
+
*
|
|
2798
|
+
* @param index
|
|
2799
|
+
* @return
|
|
2800
|
+
*/
|
|
2801
|
+
public float getVertexX(int index) {
|
|
2182
2802
|
return vertices[index][X];
|
|
2183
2803
|
}
|
|
2184
2804
|
|
|
2185
|
-
|
|
2186
|
-
|
|
2805
|
+
/**
|
|
2806
|
+
*
|
|
2807
|
+
* @param index
|
|
2808
|
+
* @return
|
|
2809
|
+
*/
|
|
2810
|
+
public float getVertexY(int index) {
|
|
2187
2811
|
return vertices[index][Y];
|
|
2188
2812
|
}
|
|
2189
2813
|
|
|
2190
|
-
|
|
2191
|
-
|
|
2814
|
+
/**
|
|
2815
|
+
*
|
|
2816
|
+
* @param index
|
|
2817
|
+
* @return
|
|
2818
|
+
*/
|
|
2819
|
+
public float getVertexZ(int index) {
|
|
2192
2820
|
return vertices[index][Z];
|
|
2193
2821
|
}
|
|
2194
2822
|
|
|
@@ -2214,7 +2842,10 @@ public class PShape implements PConstants {
|
|
|
2214
2842
|
|
|
2215
2843
|
|
|
2216
2844
|
/**
|
|
2845
|
+
* @param index
|
|
2846
|
+
* @param x
|
|
2217
2847
|
* @param z the z value for the vertex
|
|
2848
|
+
* @param y
|
|
2218
2849
|
*/
|
|
2219
2850
|
public void setVertex(int index, float x, float y, float z) {
|
|
2220
2851
|
if (openShape) {
|
|
@@ -2229,6 +2860,7 @@ public class PShape implements PConstants {
|
|
|
2229
2860
|
|
|
2230
2861
|
|
|
2231
2862
|
/**
|
|
2863
|
+
* @param index
|
|
2232
2864
|
* @param vec the PVector to define the x, y, z coordinates
|
|
2233
2865
|
*/
|
|
2234
2866
|
public void setVertex(int index, PVector vec) {
|
|
@@ -2247,13 +2879,22 @@ public class PShape implements PConstants {
|
|
|
2247
2879
|
}
|
|
2248
2880
|
}
|
|
2249
2881
|
|
|
2250
|
-
|
|
2251
|
-
|
|
2882
|
+
/**
|
|
2883
|
+
*
|
|
2884
|
+
* @param index
|
|
2885
|
+
* @return
|
|
2886
|
+
*/
|
|
2887
|
+
public PVector getNormal(int index) {
|
|
2252
2888
|
return getNormal(index, null);
|
|
2253
2889
|
}
|
|
2254
2890
|
|
|
2255
|
-
|
|
2256
|
-
|
|
2891
|
+
/**
|
|
2892
|
+
*
|
|
2893
|
+
* @param index
|
|
2894
|
+
* @param vec
|
|
2895
|
+
* @return
|
|
2896
|
+
*/
|
|
2897
|
+
public PVector getNormal(int index, PVector vec) {
|
|
2257
2898
|
if (vec == null) {
|
|
2258
2899
|
vec = new PVector();
|
|
2259
2900
|
}
|
|
@@ -2263,23 +2904,41 @@ public class PShape implements PConstants {
|
|
|
2263
2904
|
return vec;
|
|
2264
2905
|
}
|
|
2265
2906
|
|
|
2266
|
-
|
|
2267
|
-
|
|
2907
|
+
/**
|
|
2908
|
+
*
|
|
2909
|
+
* @param index
|
|
2910
|
+
* @return
|
|
2911
|
+
*/
|
|
2912
|
+
public float getNormalX(int index) {
|
|
2268
2913
|
return vertices[index][PGraphics.NX];
|
|
2269
2914
|
}
|
|
2270
2915
|
|
|
2271
|
-
|
|
2272
|
-
|
|
2916
|
+
/**
|
|
2917
|
+
*
|
|
2918
|
+
* @param index
|
|
2919
|
+
* @return
|
|
2920
|
+
*/
|
|
2921
|
+
public float getNormalY(int index) {
|
|
2273
2922
|
return vertices[index][PGraphics.NY];
|
|
2274
2923
|
}
|
|
2275
2924
|
|
|
2276
|
-
|
|
2277
|
-
|
|
2925
|
+
/**
|
|
2926
|
+
*
|
|
2927
|
+
* @param index
|
|
2928
|
+
* @return
|
|
2929
|
+
*/
|
|
2930
|
+
public float getNormalZ(int index) {
|
|
2278
2931
|
return vertices[index][PGraphics.NZ];
|
|
2279
2932
|
}
|
|
2280
2933
|
|
|
2281
|
-
|
|
2282
|
-
|
|
2934
|
+
/**
|
|
2935
|
+
*
|
|
2936
|
+
* @param index
|
|
2937
|
+
* @param nx
|
|
2938
|
+
* @param ny
|
|
2939
|
+
* @param nz
|
|
2940
|
+
*/
|
|
2941
|
+
public void setNormal(int index, float nx, float ny, float nz) {
|
|
2283
2942
|
if (openShape) {
|
|
2284
2943
|
PGraphics.showWarning(INSIDE_BEGIN_END_ERROR, "setNormal()");
|
|
2285
2944
|
return;
|
|
@@ -2290,31 +2949,58 @@ public class PShape implements PConstants {
|
|
|
2290
2949
|
vertices[index][PGraphics.NZ] = nz;
|
|
2291
2950
|
}
|
|
2292
2951
|
|
|
2293
|
-
|
|
2294
|
-
|
|
2295
|
-
|
|
2952
|
+
/**
|
|
2953
|
+
*
|
|
2954
|
+
* @param name
|
|
2955
|
+
* @param index
|
|
2956
|
+
* @param values
|
|
2957
|
+
*/
|
|
2958
|
+
public void setAttrib(String name, int index, float... values) {
|
|
2296
2959
|
}
|
|
2297
2960
|
|
|
2298
|
-
|
|
2299
|
-
|
|
2961
|
+
/**
|
|
2962
|
+
*
|
|
2963
|
+
* @param name
|
|
2964
|
+
* @param index
|
|
2965
|
+
* @param values
|
|
2966
|
+
*/
|
|
2967
|
+
public void setAttrib(String name, int index, int... values) {
|
|
2300
2968
|
}
|
|
2301
2969
|
|
|
2302
|
-
|
|
2303
|
-
|
|
2970
|
+
/**
|
|
2971
|
+
*
|
|
2972
|
+
* @param name
|
|
2973
|
+
* @param index
|
|
2974
|
+
* @param values
|
|
2975
|
+
*/
|
|
2976
|
+
public void setAttrib(String name, int index, boolean... values) {
|
|
2304
2977
|
}
|
|
2305
2978
|
|
|
2306
|
-
|
|
2307
|
-
|
|
2979
|
+
/**
|
|
2980
|
+
*
|
|
2981
|
+
* @param index
|
|
2982
|
+
* @return
|
|
2983
|
+
*/
|
|
2984
|
+
public float getTextureU(int index) {
|
|
2308
2985
|
return vertices[index][PGraphics.U];
|
|
2309
2986
|
}
|
|
2310
2987
|
|
|
2311
|
-
|
|
2312
|
-
|
|
2988
|
+
/**
|
|
2989
|
+
*
|
|
2990
|
+
* @param index
|
|
2991
|
+
* @return
|
|
2992
|
+
*/
|
|
2993
|
+
public float getTextureV(int index) {
|
|
2313
2994
|
return vertices[index][PGraphics.V];
|
|
2314
2995
|
}
|
|
2315
2996
|
|
|
2316
|
-
|
|
2317
|
-
|
|
2997
|
+
/**
|
|
2998
|
+
*
|
|
2999
|
+
* @param index
|
|
3000
|
+
* @param u
|
|
3001
|
+
* @param v
|
|
3002
|
+
*/
|
|
3003
|
+
public void setTextureUV(int index, float u, float v) {
|
|
2318
3004
|
if (openShape) {
|
|
2319
3005
|
PGraphics.showWarning(INSIDE_BEGIN_END_ERROR, "setTextureUV()");
|
|
2320
3006
|
return;
|
|
@@ -2332,8 +3018,11 @@ public class PShape implements PConstants {
|
|
|
2332
3018
|
vertices[index][PGraphics.V] = v;
|
|
2333
3019
|
}
|
|
2334
3020
|
|
|
2335
|
-
|
|
2336
|
-
|
|
3021
|
+
/**
|
|
3022
|
+
*
|
|
3023
|
+
* @param mode
|
|
3024
|
+
*/
|
|
3025
|
+
public void setTextureMode(int mode) {
|
|
2337
3026
|
if (openShape) {
|
|
2338
3027
|
PGraphics.showWarning(INSIDE_BEGIN_END_ERROR, "setTextureMode()");
|
|
2339
3028
|
return;
|
|
@@ -2342,8 +3031,11 @@ public class PShape implements PConstants {
|
|
|
2342
3031
|
textureMode = mode;
|
|
2343
3032
|
}
|
|
2344
3033
|
|
|
2345
|
-
|
|
2346
|
-
|
|
3034
|
+
/**
|
|
3035
|
+
*
|
|
3036
|
+
* @param tex
|
|
3037
|
+
*/
|
|
3038
|
+
public void setTexture(PImage tex) {
|
|
2347
3039
|
if (openShape) {
|
|
2348
3040
|
PGraphics.showWarning(INSIDE_BEGIN_END_ERROR, "setTexture()");
|
|
2349
3041
|
return;
|
|
@@ -2352,8 +3044,12 @@ public class PShape implements PConstants {
|
|
|
2352
3044
|
image = tex;
|
|
2353
3045
|
}
|
|
2354
3046
|
|
|
2355
|
-
|
|
2356
|
-
|
|
3047
|
+
/**
|
|
3048
|
+
*
|
|
3049
|
+
* @param index
|
|
3050
|
+
* @return
|
|
3051
|
+
*/
|
|
3052
|
+
public int getFill(int index) {
|
|
2357
3053
|
// make sure we allocated the vertices array and that vertex exists
|
|
2358
3054
|
if (vertices == null ||
|
|
2359
3055
|
index >= vertices.length) {
|
|
@@ -2373,6 +3069,7 @@ public class PShape implements PConstants {
|
|
|
2373
3069
|
}
|
|
2374
3070
|
|
|
2375
3071
|
/**
|
|
3072
|
+
* @param fill
|
|
2376
3073
|
* @nowebref
|
|
2377
3074
|
*/
|
|
2378
3075
|
public void setFill(boolean fill) {
|
|
@@ -2418,6 +3115,8 @@ public class PShape implements PConstants {
|
|
|
2418
3115
|
}
|
|
2419
3116
|
|
|
2420
3117
|
/**
|
|
3118
|
+
* @param index
|
|
3119
|
+
* @param fill
|
|
2421
3120
|
* @nowebref
|
|
2422
3121
|
*/
|
|
2423
3122
|
public void setFill(int index, int fill) {
|
|
@@ -2445,8 +3144,12 @@ public class PShape implements PConstants {
|
|
|
2445
3144
|
}
|
|
2446
3145
|
}
|
|
2447
3146
|
|
|
2448
|
-
|
|
2449
|
-
|
|
3147
|
+
/**
|
|
3148
|
+
*
|
|
3149
|
+
* @param index
|
|
3150
|
+
* @return
|
|
3151
|
+
*/
|
|
3152
|
+
public int getTint(int index) {
|
|
2450
3153
|
// make sure we allocated the vertices array and that vertex exists
|
|
2451
3154
|
if (vertices == null || index >= vertices.length) {
|
|
2452
3155
|
PGraphics.showWarning(NO_SUCH_VERTEX_ERROR + " (" + index + ")", "getTint()");
|
|
@@ -2464,8 +3167,11 @@ public class PShape implements PConstants {
|
|
|
2464
3167
|
}
|
|
2465
3168
|
}
|
|
2466
3169
|
|
|
2467
|
-
|
|
2468
|
-
|
|
3170
|
+
/**
|
|
3171
|
+
*
|
|
3172
|
+
* @param tint
|
|
3173
|
+
*/
|
|
3174
|
+
public void setTint(boolean tint) {
|
|
2469
3175
|
if (openShape) {
|
|
2470
3176
|
PGraphics.showWarning(INSIDE_BEGIN_END_ERROR, "setTint()");
|
|
2471
3177
|
return;
|
|
@@ -2474,8 +3180,11 @@ public class PShape implements PConstants {
|
|
|
2474
3180
|
this.tint = tint;
|
|
2475
3181
|
}
|
|
2476
3182
|
|
|
2477
|
-
|
|
2478
|
-
|
|
3183
|
+
/**
|
|
3184
|
+
*
|
|
3185
|
+
* @param fill
|
|
3186
|
+
*/
|
|
3187
|
+
public void setTint(int fill) {
|
|
2479
3188
|
if (openShape) {
|
|
2480
3189
|
PGraphics.showWarning(INSIDE_BEGIN_END_ERROR, "setTint()");
|
|
2481
3190
|
return;
|
|
@@ -2490,8 +3199,12 @@ public class PShape implements PConstants {
|
|
|
2490
3199
|
}
|
|
2491
3200
|
}
|
|
2492
3201
|
|
|
2493
|
-
|
|
2494
|
-
|
|
3202
|
+
/**
|
|
3203
|
+
*
|
|
3204
|
+
* @param index
|
|
3205
|
+
* @param tint
|
|
3206
|
+
*/
|
|
3207
|
+
public void setTint(int index, int tint) {
|
|
2495
3208
|
if (openShape) {
|
|
2496
3209
|
PGraphics.showWarning(INSIDE_BEGIN_END_ERROR, "setTint()");
|
|
2497
3210
|
return;
|
|
@@ -2512,8 +3225,12 @@ public class PShape implements PConstants {
|
|
|
2512
3225
|
}
|
|
2513
3226
|
}
|
|
2514
3227
|
|
|
2515
|
-
|
|
2516
|
-
|
|
3228
|
+
/**
|
|
3229
|
+
*
|
|
3230
|
+
* @param index
|
|
3231
|
+
* @return
|
|
3232
|
+
*/
|
|
3233
|
+
public int getStroke(int index) {
|
|
2517
3234
|
// make sure we allocated the vertices array and that vertex exists
|
|
2518
3235
|
if (vertices == null ||
|
|
2519
3236
|
index >= vertices.length) {
|
|
@@ -2529,6 +3246,7 @@ public class PShape implements PConstants {
|
|
|
2529
3246
|
}
|
|
2530
3247
|
|
|
2531
3248
|
/**
|
|
3249
|
+
* @param stroke
|
|
2532
3250
|
* @nowebref
|
|
2533
3251
|
*/
|
|
2534
3252
|
public void setStroke(boolean stroke) {
|
|
@@ -2574,6 +3292,8 @@ public class PShape implements PConstants {
|
|
|
2574
3292
|
}
|
|
2575
3293
|
|
|
2576
3294
|
/**
|
|
3295
|
+
* @param index
|
|
3296
|
+
* @param stroke
|
|
2577
3297
|
* @nowebref
|
|
2578
3298
|
*/
|
|
2579
3299
|
public void setStroke(int index, int stroke) {
|
|
@@ -2599,8 +3319,12 @@ public class PShape implements PConstants {
|
|
|
2599
3319
|
vertices[index][PGraphics.SB] = ((stroke >> 0) & 0xFF) / 255.0f;
|
|
2600
3320
|
}
|
|
2601
3321
|
|
|
2602
|
-
|
|
2603
|
-
|
|
3322
|
+
/**
|
|
3323
|
+
*
|
|
3324
|
+
* @param index
|
|
3325
|
+
* @return
|
|
3326
|
+
*/
|
|
3327
|
+
public float getStrokeWeight(int index) {
|
|
2604
3328
|
// make sure we allocated the vertices array and that vertex exists
|
|
2605
3329
|
if (vertices == null || index >= vertices.length) {
|
|
2606
3330
|
PGraphics.showWarning(NO_SUCH_VERTEX_ERROR + " (" + index + ")", "getStrokeWeight()");
|
|
@@ -2610,8 +3334,11 @@ public class PShape implements PConstants {
|
|
|
2610
3334
|
return vertices[index][PGraphics.SW];
|
|
2611
3335
|
}
|
|
2612
3336
|
|
|
2613
|
-
|
|
2614
|
-
|
|
3337
|
+
/**
|
|
3338
|
+
*
|
|
3339
|
+
* @param weight
|
|
3340
|
+
*/
|
|
3341
|
+
public void setStrokeWeight(float weight) {
|
|
2615
3342
|
if (openShape) {
|
|
2616
3343
|
PGraphics.showWarning(INSIDE_BEGIN_END_ERROR, "setStrokeWeight()");
|
|
2617
3344
|
return;
|
|
@@ -2626,8 +3353,12 @@ public class PShape implements PConstants {
|
|
|
2626
3353
|
}
|
|
2627
3354
|
}
|
|
2628
3355
|
|
|
2629
|
-
|
|
2630
|
-
|
|
3356
|
+
/**
|
|
3357
|
+
*
|
|
3358
|
+
* @param index
|
|
3359
|
+
* @param weight
|
|
3360
|
+
*/
|
|
3361
|
+
public void setStrokeWeight(int index, float weight) {
|
|
2631
3362
|
if (openShape) {
|
|
2632
3363
|
PGraphics.showWarning(INSIDE_BEGIN_END_ERROR, "setStrokeWeight()");
|
|
2633
3364
|
return;
|
|
@@ -2647,8 +3378,11 @@ public class PShape implements PConstants {
|
|
|
2647
3378
|
vertices[index][PGraphics.SW] = weight;
|
|
2648
3379
|
}
|
|
2649
3380
|
|
|
2650
|
-
|
|
2651
|
-
|
|
3381
|
+
/**
|
|
3382
|
+
*
|
|
3383
|
+
* @param join
|
|
3384
|
+
*/
|
|
3385
|
+
public void setStrokeJoin(int join) {
|
|
2652
3386
|
if (openShape) {
|
|
2653
3387
|
PGraphics.showWarning(INSIDE_BEGIN_END_ERROR, "setStrokeJoin()");
|
|
2654
3388
|
return;
|
|
@@ -2657,8 +3391,11 @@ public class PShape implements PConstants {
|
|
|
2657
3391
|
strokeJoin = join;
|
|
2658
3392
|
}
|
|
2659
3393
|
|
|
2660
|
-
|
|
2661
|
-
|
|
3394
|
+
/**
|
|
3395
|
+
*
|
|
3396
|
+
* @param cap
|
|
3397
|
+
*/
|
|
3398
|
+
public void setStrokeCap(int cap) {
|
|
2662
3399
|
if (openShape) {
|
|
2663
3400
|
PGraphics.showWarning(INSIDE_BEGIN_END_ERROR, "setStrokeCap()");
|
|
2664
3401
|
return;
|
|
@@ -2667,8 +3404,12 @@ public class PShape implements PConstants {
|
|
|
2667
3404
|
strokeCap = cap;
|
|
2668
3405
|
}
|
|
2669
3406
|
|
|
2670
|
-
|
|
2671
|
-
|
|
3407
|
+
/**
|
|
3408
|
+
*
|
|
3409
|
+
* @param index
|
|
3410
|
+
* @return
|
|
3411
|
+
*/
|
|
3412
|
+
public int getAmbient(int index) {
|
|
2672
3413
|
// make sure we allocated the vertices array and that vertex exists
|
|
2673
3414
|
if (vertices == null || index >= vertices.length) {
|
|
2674
3415
|
PGraphics.showWarning(NO_SUCH_VERTEX_ERROR + " (" + index + ")", "getAmbient()");
|
|
@@ -2681,8 +3422,11 @@ public class PShape implements PConstants {
|
|
|
2681
3422
|
return 0xff000000 | (r << 16) | (g << 8) | b;
|
|
2682
3423
|
}
|
|
2683
3424
|
|
|
2684
|
-
|
|
2685
|
-
|
|
3425
|
+
/**
|
|
3426
|
+
*
|
|
3427
|
+
* @param ambient
|
|
3428
|
+
*/
|
|
3429
|
+
public void setAmbient(int ambient) {
|
|
2686
3430
|
if (openShape) {
|
|
2687
3431
|
PGraphics.showWarning(INSIDE_BEGIN_END_ERROR, "setAmbient()");
|
|
2688
3432
|
return;
|
|
@@ -2697,8 +3441,12 @@ public class PShape implements PConstants {
|
|
|
2697
3441
|
}
|
|
2698
3442
|
}
|
|
2699
3443
|
|
|
2700
|
-
|
|
2701
|
-
|
|
3444
|
+
/**
|
|
3445
|
+
*
|
|
3446
|
+
* @param index
|
|
3447
|
+
* @param ambient
|
|
3448
|
+
*/
|
|
3449
|
+
public void setAmbient(int index, int ambient) {
|
|
2702
3450
|
if (openShape) {
|
|
2703
3451
|
PGraphics.showWarning(INSIDE_BEGIN_END_ERROR, "setAmbient()");
|
|
2704
3452
|
return;
|
|
@@ -2715,8 +3463,12 @@ public class PShape implements PConstants {
|
|
|
2715
3463
|
vertices[index][PGraphics.AB] = ((ambient >> 0) & 0xFF) / 255.0f;
|
|
2716
3464
|
}
|
|
2717
3465
|
|
|
2718
|
-
|
|
2719
|
-
|
|
3466
|
+
/**
|
|
3467
|
+
*
|
|
3468
|
+
* @param index
|
|
3469
|
+
* @return
|
|
3470
|
+
*/
|
|
3471
|
+
public int getSpecular(int index) {
|
|
2720
3472
|
// make sure we allocated the vertices array and that vertex exists
|
|
2721
3473
|
if (vertices == null || index >= vertices.length) {
|
|
2722
3474
|
PGraphics.showWarning(NO_SUCH_VERTEX_ERROR + " (" + index + ")", "getSpecular()");
|
|
@@ -2729,8 +3481,11 @@ public class PShape implements PConstants {
|
|
|
2729
3481
|
return 0xff000000 | (r << 16) | (g << 8) | b;
|
|
2730
3482
|
}
|
|
2731
3483
|
|
|
2732
|
-
|
|
2733
|
-
|
|
3484
|
+
/**
|
|
3485
|
+
*
|
|
3486
|
+
* @param specular
|
|
3487
|
+
*/
|
|
3488
|
+
public void setSpecular(int specular) {
|
|
2734
3489
|
if (openShape) {
|
|
2735
3490
|
PGraphics.showWarning(INSIDE_BEGIN_END_ERROR, "setSpecular()");
|
|
2736
3491
|
return;
|
|
@@ -2745,8 +3500,12 @@ public class PShape implements PConstants {
|
|
|
2745
3500
|
}
|
|
2746
3501
|
}
|
|
2747
3502
|
|
|
2748
|
-
|
|
2749
|
-
|
|
3503
|
+
/**
|
|
3504
|
+
*
|
|
3505
|
+
* @param index
|
|
3506
|
+
* @param specular
|
|
3507
|
+
*/
|
|
3508
|
+
public void setSpecular(int index, int specular) {
|
|
2750
3509
|
if (openShape) {
|
|
2751
3510
|
PGraphics.showWarning(INSIDE_BEGIN_END_ERROR, "setSpecular()");
|
|
2752
3511
|
return;
|
|
@@ -2763,8 +3522,12 @@ public class PShape implements PConstants {
|
|
|
2763
3522
|
vertices[index][PGraphics.SPB] = ((specular >> 0) & 0xFF) / 255.0f;
|
|
2764
3523
|
}
|
|
2765
3524
|
|
|
2766
|
-
|
|
2767
|
-
|
|
3525
|
+
/**
|
|
3526
|
+
*
|
|
3527
|
+
* @param index
|
|
3528
|
+
* @return
|
|
3529
|
+
*/
|
|
3530
|
+
public int getEmissive(int index) {
|
|
2768
3531
|
// make sure we allocated the vertices array and that vertex exists
|
|
2769
3532
|
if (vertices == null || index >= vertices.length) {
|
|
2770
3533
|
PGraphics.showWarning(NO_SUCH_VERTEX_ERROR + " (" + index + ")", "getEmissive()");
|
|
@@ -2777,8 +3540,11 @@ public class PShape implements PConstants {
|
|
|
2777
3540
|
return 0xff000000 | (r << 16) | (g << 8) | b;
|
|
2778
3541
|
}
|
|
2779
3542
|
|
|
2780
|
-
|
|
2781
|
-
|
|
3543
|
+
/**
|
|
3544
|
+
*
|
|
3545
|
+
* @param emissive
|
|
3546
|
+
*/
|
|
3547
|
+
public void setEmissive(int emissive) {
|
|
2782
3548
|
if (openShape) {
|
|
2783
3549
|
PGraphics.showWarning(INSIDE_BEGIN_END_ERROR, "setEmissive()");
|
|
2784
3550
|
return;
|
|
@@ -2793,8 +3559,12 @@ public class PShape implements PConstants {
|
|
|
2793
3559
|
}
|
|
2794
3560
|
}
|
|
2795
3561
|
|
|
2796
|
-
|
|
2797
|
-
|
|
3562
|
+
/**
|
|
3563
|
+
*
|
|
3564
|
+
* @param index
|
|
3565
|
+
* @param emissive
|
|
3566
|
+
*/
|
|
3567
|
+
public void setEmissive(int index, int emissive) {
|
|
2798
3568
|
if (openShape) {
|
|
2799
3569
|
PGraphics.showWarning(INSIDE_BEGIN_END_ERROR, "setEmissive()");
|
|
2800
3570
|
return;
|
|
@@ -2812,8 +3582,12 @@ public class PShape implements PConstants {
|
|
|
2812
3582
|
vertices[index][PGraphics.EB] = ((emissive >> 0) & 0xFF) / 255.0f;
|
|
2813
3583
|
}
|
|
2814
3584
|
|
|
2815
|
-
|
|
2816
|
-
|
|
3585
|
+
/**
|
|
3586
|
+
*
|
|
3587
|
+
* @param index
|
|
3588
|
+
* @return
|
|
3589
|
+
*/
|
|
3590
|
+
public float getShininess(int index) {
|
|
2817
3591
|
// make sure we allocated the vertices array and that vertex exists
|
|
2818
3592
|
if (vertices == null ||
|
|
2819
3593
|
index >= vertices.length) {
|
|
@@ -2824,8 +3598,11 @@ public class PShape implements PConstants {
|
|
|
2824
3598
|
return vertices[index][PGraphics.SHINE];
|
|
2825
3599
|
}
|
|
2826
3600
|
|
|
2827
|
-
|
|
2828
|
-
|
|
3601
|
+
/**
|
|
3602
|
+
*
|
|
3603
|
+
* @param shine
|
|
3604
|
+
*/
|
|
3605
|
+
public void setShininess(float shine) {
|
|
2829
3606
|
if (openShape) {
|
|
2830
3607
|
PGraphics.showWarning(INSIDE_BEGIN_END_ERROR, "setShininess()");
|
|
2831
3608
|
return;
|
|
@@ -2840,8 +3617,12 @@ public class PShape implements PConstants {
|
|
|
2840
3617
|
}
|
|
2841
3618
|
}
|
|
2842
3619
|
|
|
2843
|
-
|
|
2844
|
-
|
|
3620
|
+
/**
|
|
3621
|
+
*
|
|
3622
|
+
* @param index
|
|
3623
|
+
* @param shine
|
|
3624
|
+
*/
|
|
3625
|
+
public void setShininess(int index, float shine) {
|
|
2845
3626
|
if (openShape) {
|
|
2846
3627
|
PGraphics.showWarning(INSIDE_BEGIN_END_ERROR, "setShininess()");
|
|
2847
3628
|
return;
|
|
@@ -2858,8 +3639,11 @@ public class PShape implements PConstants {
|
|
|
2858
3639
|
vertices[index][PGraphics.SHINE] = shine;
|
|
2859
3640
|
}
|
|
2860
3641
|
|
|
2861
|
-
|
|
2862
|
-
|
|
3642
|
+
/**
|
|
3643
|
+
*
|
|
3644
|
+
* @return
|
|
3645
|
+
*/
|
|
3646
|
+
public int[] getVertexCodes() {
|
|
2863
3647
|
if (vertexCodes == null) {
|
|
2864
3648
|
return null;
|
|
2865
3649
|
}
|
|
@@ -2869,21 +3653,29 @@ public class PShape implements PConstants {
|
|
|
2869
3653
|
return vertexCodes;
|
|
2870
3654
|
}
|
|
2871
3655
|
|
|
2872
|
-
|
|
2873
|
-
|
|
3656
|
+
/**
|
|
3657
|
+
*
|
|
3658
|
+
* @return
|
|
3659
|
+
*/
|
|
3660
|
+
public int getVertexCodeCount() {
|
|
2874
3661
|
return vertexCodeCount;
|
|
2875
3662
|
}
|
|
2876
3663
|
|
|
2877
3664
|
|
|
2878
3665
|
/**
|
|
2879
3666
|
* One of VERTEX, BEZIER_VERTEX, CURVE_VERTEX, or BREAK.
|
|
3667
|
+
* @param index
|
|
3668
|
+
* @return
|
|
2880
3669
|
*/
|
|
2881
3670
|
public int getVertexCode(int index) {
|
|
2882
3671
|
return vertexCodes[index];
|
|
2883
3672
|
}
|
|
2884
3673
|
|
|
2885
|
-
|
|
2886
|
-
|
|
3674
|
+
/**
|
|
3675
|
+
*
|
|
3676
|
+
* @return
|
|
3677
|
+
*/
|
|
3678
|
+
public boolean isClosed() {
|
|
2887
3679
|
return close;
|
|
2888
3680
|
}
|
|
2889
3681
|
|
|
@@ -2892,8 +3684,11 @@ public class PShape implements PConstants {
|
|
|
2892
3684
|
|
|
2893
3685
|
|
|
2894
3686
|
/**
|
|
2895
|
-
* Return true if this x, y coordinate is part of this shape.
|
|
2896
|
-
|
|
3687
|
+
* Return true if this x, y coordinate is part of this shape.Only works
|
|
3688
|
+
with PATH shapes or GROUP shapes that contain other GROUPs or PATHs.
|
|
3689
|
+
* @param x
|
|
3690
|
+
* @param y
|
|
3691
|
+
* @return
|
|
2897
3692
|
*/
|
|
2898
3693
|
public boolean contains(float x, float y) {
|
|
2899
3694
|
if (family == PATH) {
|
|
@@ -2974,6 +3769,8 @@ public class PShape implements PConstants {
|
|
|
2974
3769
|
}
|
|
2975
3770
|
|
|
2976
3771
|
/**
|
|
3772
|
+
* @param x
|
|
3773
|
+
* @param y
|
|
2977
3774
|
* @param z forward/back translation
|
|
2978
3775
|
*/
|
|
2979
3776
|
public void translate(float x, float y, float z) {
|
|
@@ -3115,6 +3912,10 @@ public class PShape implements PConstants {
|
|
|
3115
3912
|
}
|
|
3116
3913
|
|
|
3117
3914
|
/**
|
|
3915
|
+
* @param angle
|
|
3916
|
+
* @param v2
|
|
3917
|
+
* @param v0
|
|
3918
|
+
* @param v1
|
|
3118
3919
|
* @nowebref
|
|
3119
3920
|
*/
|
|
3120
3921
|
public void rotate(float angle, float v0, float v1, float v2) {
|
|
@@ -3162,8 +3963,12 @@ public class PShape implements PConstants {
|
|
|
3162
3963
|
matrix.scale(s);
|
|
3163
3964
|
}
|
|
3164
3965
|
|
|
3165
|
-
|
|
3166
|
-
|
|
3966
|
+
/**
|
|
3967
|
+
*
|
|
3968
|
+
* @param x
|
|
3969
|
+
* @param y
|
|
3970
|
+
*/
|
|
3971
|
+
public void scale(float x, float y) {
|
|
3167
3972
|
checkMatrix(2);
|
|
3168
3973
|
matrix.scale(x, y);
|
|
3169
3974
|
}
|
|
@@ -3200,8 +4005,11 @@ public class PShape implements PConstants {
|
|
|
3200
4005
|
matrix.reset();
|
|
3201
4006
|
}
|
|
3202
4007
|
|
|
3203
|
-
|
|
3204
|
-
|
|
4008
|
+
/**
|
|
4009
|
+
*
|
|
4010
|
+
* @param source
|
|
4011
|
+
*/
|
|
4012
|
+
public void applyMatrix(PMatrix source) {
|
|
3205
4013
|
if (source instanceof PMatrix2D) {
|
|
3206
4014
|
applyMatrix((PMatrix2D) source);
|
|
3207
4015
|
} else if (source instanceof PMatrix3D) {
|
|
@@ -3209,32 +4017,64 @@ public class PShape implements PConstants {
|
|
|
3209
4017
|
}
|
|
3210
4018
|
}
|
|
3211
4019
|
|
|
3212
|
-
|
|
3213
|
-
|
|
4020
|
+
/**
|
|
4021
|
+
*
|
|
4022
|
+
* @param source
|
|
4023
|
+
*/
|
|
4024
|
+
public void applyMatrix(PMatrix2D source) {
|
|
3214
4025
|
applyMatrix(source.m00, source.m01, 0, source.m02,
|
|
3215
4026
|
source.m10, source.m11, 0, source.m12,
|
|
3216
4027
|
0, 0, 1, 0,
|
|
3217
4028
|
0, 0, 0, 1);
|
|
3218
4029
|
}
|
|
3219
4030
|
|
|
3220
|
-
|
|
3221
|
-
|
|
4031
|
+
/**
|
|
4032
|
+
*
|
|
4033
|
+
* @param n00
|
|
4034
|
+
* @param n01
|
|
4035
|
+
* @param n02
|
|
4036
|
+
* @param n10
|
|
4037
|
+
* @param n11
|
|
4038
|
+
* @param n12
|
|
4039
|
+
*/
|
|
4040
|
+
public void applyMatrix(float n00, float n01, float n02,
|
|
3222
4041
|
float n10, float n11, float n12) {
|
|
3223
4042
|
checkMatrix(2);
|
|
3224
4043
|
matrix.apply(n00, n01, n02,
|
|
3225
4044
|
n10, n11, n12);
|
|
3226
4045
|
}
|
|
3227
4046
|
|
|
3228
|
-
|
|
3229
|
-
|
|
4047
|
+
/**
|
|
4048
|
+
*
|
|
4049
|
+
* @param source
|
|
4050
|
+
*/
|
|
4051
|
+
public void applyMatrix(PMatrix3D source) {
|
|
3230
4052
|
applyMatrix(source.m00, source.m01, source.m02, source.m03,
|
|
3231
4053
|
source.m10, source.m11, source.m12, source.m13,
|
|
3232
4054
|
source.m20, source.m21, source.m22, source.m23,
|
|
3233
4055
|
source.m30, source.m31, source.m32, source.m33);
|
|
3234
4056
|
}
|
|
3235
4057
|
|
|
3236
|
-
|
|
3237
|
-
|
|
4058
|
+
/**
|
|
4059
|
+
*
|
|
4060
|
+
* @param n00
|
|
4061
|
+
* @param n01
|
|
4062
|
+
* @param n02
|
|
4063
|
+
* @param n03
|
|
4064
|
+
* @param n10
|
|
4065
|
+
* @param n11
|
|
4066
|
+
* @param n12
|
|
4067
|
+
* @param n13
|
|
4068
|
+
* @param n20
|
|
4069
|
+
* @param n21
|
|
4070
|
+
* @param n22
|
|
4071
|
+
* @param n23
|
|
4072
|
+
* @param n30
|
|
4073
|
+
* @param n31
|
|
4074
|
+
* @param n32
|
|
4075
|
+
* @param n33
|
|
4076
|
+
*/
|
|
4077
|
+
public void applyMatrix(float n00, float n01, float n02, float n03,
|
|
3238
4078
|
float n10, float n11, float n12, float n13,
|
|
3239
4079
|
float n20, float n21, float n22, float n23,
|
|
3240
4080
|
float n30, float n31, float n32, float n33) {
|
|
@@ -3252,6 +4092,7 @@ public class PShape implements PConstants {
|
|
|
3252
4092
|
/**
|
|
3253
4093
|
* Make sure that the shape's matrix is 1) not null, and 2) has a matrix
|
|
3254
4094
|
* that can handle <em>at least</em> the specified number of dimensions.
|
|
4095
|
+
* @param dimensions
|
|
3255
4096
|
*/
|
|
3256
4097
|
protected void checkMatrix(int dimensions) {
|
|
3257
4098
|
if (matrix == null) {
|
|
@@ -3284,6 +4125,7 @@ public class PShape implements PConstants {
|
|
|
3284
4125
|
|
|
3285
4126
|
/**
|
|
3286
4127
|
* Set the pivot point for all transformations.
|
|
4128
|
+
* @param mode
|
|
3287
4129
|
*/
|
|
3288
4130
|
// public void pivot(float x, float y) {
|
|
3289
4131
|
// px = x;
|
|
@@ -3299,6 +4141,7 @@ public class PShape implements PConstants {
|
|
|
3299
4141
|
}
|
|
3300
4142
|
|
|
3301
4143
|
/**
|
|
4144
|
+
* @param mode
|
|
3302
4145
|
* @param max range for all color elements
|
|
3303
4146
|
*/
|
|
3304
4147
|
public void colorMode(int mode, float max) {
|
|
@@ -3307,6 +4150,7 @@ public class PShape implements PConstants {
|
|
|
3307
4150
|
|
|
3308
4151
|
|
|
3309
4152
|
/**
|
|
4153
|
+
* @param mode
|
|
3310
4154
|
* @param maxX range for the red or hue depending on the current color mode
|
|
3311
4155
|
* @param maxY range for the green or saturation depending on the current color mode
|
|
3312
4156
|
* @param maxZ range for the blue or brightness depending on the current color mode
|
|
@@ -3316,7 +4160,11 @@ public class PShape implements PConstants {
|
|
|
3316
4160
|
}
|
|
3317
4161
|
|
|
3318
4162
|
/**
|
|
4163
|
+
* @param mode
|
|
3319
4164
|
* @param maxA range for the alpha
|
|
4165
|
+
* @param maxX
|
|
4166
|
+
* @param maxZ
|
|
4167
|
+
* @param maxY
|
|
3320
4168
|
*/
|
|
3321
4169
|
public void colorMode(int mode,
|
|
3322
4170
|
float maxX, float maxY, float maxZ, float maxA) {
|
|
@@ -3338,8 +4186,11 @@ public class PShape implements PConstants {
|
|
|
3338
4186
|
(colorModeY == 255) && (colorModeZ == 255);
|
|
3339
4187
|
}
|
|
3340
4188
|
|
|
3341
|
-
|
|
3342
|
-
|
|
4189
|
+
/**
|
|
4190
|
+
*
|
|
4191
|
+
* @param rgb
|
|
4192
|
+
*/
|
|
4193
|
+
protected void colorCalc(int rgb) {
|
|
3343
4194
|
if (((rgb & 0xff000000) == 0) && (rgb <= colorModeX)) {
|
|
3344
4195
|
colorCalc((float) rgb);
|
|
3345
4196
|
|
|
@@ -3348,8 +4199,12 @@ public class PShape implements PConstants {
|
|
|
3348
4199
|
}
|
|
3349
4200
|
}
|
|
3350
4201
|
|
|
3351
|
-
|
|
3352
|
-
|
|
4202
|
+
/**
|
|
4203
|
+
*
|
|
4204
|
+
* @param rgb
|
|
4205
|
+
* @param alpha
|
|
4206
|
+
*/
|
|
4207
|
+
protected void colorCalc(int rgb, float alpha) {
|
|
3353
4208
|
if (((rgb & 0xff000000) == 0) && (rgb <= colorModeX)) { // see above
|
|
3354
4209
|
colorCalc((float) rgb, alpha);
|
|
3355
4210
|
|
|
@@ -3358,13 +4213,20 @@ public class PShape implements PConstants {
|
|
|
3358
4213
|
}
|
|
3359
4214
|
}
|
|
3360
4215
|
|
|
3361
|
-
|
|
3362
|
-
|
|
4216
|
+
/**
|
|
4217
|
+
*
|
|
4218
|
+
* @param gray
|
|
4219
|
+
*/
|
|
4220
|
+
protected void colorCalc(float gray) {
|
|
3363
4221
|
colorCalc(gray, colorModeA);
|
|
3364
4222
|
}
|
|
3365
4223
|
|
|
3366
|
-
|
|
3367
|
-
|
|
4224
|
+
/**
|
|
4225
|
+
*
|
|
4226
|
+
* @param gray
|
|
4227
|
+
* @param alpha
|
|
4228
|
+
*/
|
|
4229
|
+
protected void colorCalc(float gray, float alpha) {
|
|
3368
4230
|
if (gray > colorModeX) gray = colorModeX;
|
|
3369
4231
|
if (alpha > colorModeA) alpha = colorModeA;
|
|
3370
4232
|
|
|
@@ -3382,13 +4244,24 @@ public class PShape implements PConstants {
|
|
|
3382
4244
|
calcAlpha = (calcAi != 255);
|
|
3383
4245
|
}
|
|
3384
4246
|
|
|
3385
|
-
|
|
3386
|
-
|
|
4247
|
+
/**
|
|
4248
|
+
*
|
|
4249
|
+
* @param x
|
|
4250
|
+
* @param y
|
|
4251
|
+
* @param z
|
|
4252
|
+
*/
|
|
4253
|
+
protected void colorCalc(float x, float y, float z) {
|
|
3387
4254
|
colorCalc(x, y, z, colorModeA);
|
|
3388
4255
|
}
|
|
3389
4256
|
|
|
3390
|
-
|
|
3391
|
-
|
|
4257
|
+
/**
|
|
4258
|
+
*
|
|
4259
|
+
* @param x
|
|
4260
|
+
* @param y
|
|
4261
|
+
* @param z
|
|
4262
|
+
* @param a
|
|
4263
|
+
*/
|
|
4264
|
+
protected void colorCalc(float x, float y, float z, float a) {
|
|
3392
4265
|
if (x > colorModeX) x = colorModeX;
|
|
3393
4266
|
if (y > colorModeY) y = colorModeY;
|
|
3394
4267
|
if (z > colorModeZ) z = colorModeZ;
|
|
@@ -3445,8 +4318,12 @@ public class PShape implements PConstants {
|
|
|
3445
4318
|
calcAlpha = (calcAi != 255);
|
|
3446
4319
|
}
|
|
3447
4320
|
|
|
3448
|
-
|
|
3449
|
-
|
|
4321
|
+
/**
|
|
4322
|
+
*
|
|
4323
|
+
* @param argb
|
|
4324
|
+
* @param alpha
|
|
4325
|
+
*/
|
|
4326
|
+
protected void colorCalcARGB(int argb, float alpha) {
|
|
3450
4327
|
if (alpha == colorModeA) {
|
|
3451
4328
|
calcAi = (argb >> 24) & 0xff;
|
|
3452
4329
|
calcColor = argb;
|