MCPcopy Index your code
hub / github.com/benfry/processing4 / addChild

Method addChild

core/src/processing/opengl/PShapeOpenGL.java:419–457  ·  view source on GitHub ↗
(PShape who)

Source from the content-addressed store, hash-verified

417
418
419 @Override
420 public void addChild(PShape who) {
421 if (who instanceof PShapeOpenGL) {
422 if (family == GROUP) {
423 PShapeOpenGL c3d = (PShapeOpenGL)who;
424
425 super.addChild(c3d);
426 c3d.updateRoot(root);
427 markForTessellation();
428
429 if (c3d.family == GROUP) {
430 if (c3d.textures != null) {
431 for (PImage tex: c3d.textures) {
432 addTexture(tex);
433 }
434 } else {
435 untexChild(true);
436 }
437 if (c3d.strokedTexture) {
438 strokedTexture(true);
439 }
440 } else {
441 if (c3d.image != null) {
442 addTexture(c3d.image);
443 if (c3d.stroke) {
444 strokedTexture(true);
445 }
446 } else {
447 untexChild(true);
448 }
449 }
450
451 } else {
452 PGraphics.showWarning("Cannot add child shape to non-group shape.");
453 }
454 } else {
455 PGraphics.showWarning("Shape must be OpenGL to be added to the group.");
456 }
457 }
458
459
460 @Override

Callers 1

copyGroupMethod · 0.45

Calls 6

updateRootMethod · 0.95
markForTessellationMethod · 0.95
addTextureMethod · 0.95
untexChildMethod · 0.95
strokedTextureMethod · 0.95
showWarningMethod · 0.95

Tested by

no test coverage detected