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

Method createShape

core/src/processing/opengl/PShapeOpenGL.java:527–551  ·  view source on GitHub ↗
(PGraphicsOpenGL pg, PShape src)

Source from the content-addressed store, hash-verified

525
526
527 public static PShapeOpenGL createShape(PGraphicsOpenGL pg, PShape src) {
528 PShapeOpenGL dest = null;
529 if (src.getFamily() == GROUP) {
530 //dest = PGraphics3D.createShapeImpl(pg, GROUP);
531 dest = (PShapeOpenGL) pg.createShapeFamily(GROUP);
532 copyGroup(pg, src, dest);
533 } else if (src.getFamily() == PRIMITIVE) {
534 //dest = PGraphics3D.createShapeImpl(pg, src.getKind(), src.getParams());
535 dest = (PShapeOpenGL) pg.createShapePrimitive(src.getKind(), src.getParams());
536 PShape.copyPrimitive(src, dest);
537 } else if (src.getFamily() == GEOMETRY) {
538 //dest = PGraphics3D.createShapeImpl(pg, PShape.GEOMETRY);
539 dest = (PShapeOpenGL) pg.createShapeFamily(PShape.GEOMETRY);
540 PShape.copyGeometry(src, dest);
541 } else if (src.getFamily() == PATH) {
542 dest = (PShapeOpenGL) pg.createShapeFamily(PShape.PATH);
543 //dest = PGraphics3D.createShapeImpl(pg, PATH);
544 PShape.copyPath(src, dest);
545 }
546 dest.setName(src.getName());
547 dest.width = src.width;
548 dest.height = src.height;
549 dest.depth = src.depth;
550 return dest;
551 }
552
553
554 /*

Callers 4

loadShapeImplMethod · 0.95
copyGroupMethod · 0.95
loadShapeImplMethod · 0.95
getTessellationMethod · 0.45

Calls 11

copyGroupMethod · 0.95
copyPrimitiveMethod · 0.95
copyGeometryMethod · 0.95
copyPathMethod · 0.95
getFamilyMethod · 0.80
getKindMethod · 0.80
getParamsMethod · 0.80
createShapeFamilyMethod · 0.45
createShapePrimitiveMethod · 0.45
setNameMethod · 0.45
getNameMethod · 0.45

Tested by

no test coverage detected