From b57bbdb476cbaff70b2afc17d76dd77e1f69d14e Mon Sep 17 00:00:00 2001 From: codeanticode Date: Sun, 11 Dec 2011 14:16:20 +0000 Subject: [PATCH] breakShape() replaced by beginContour()/endCountour() --- .../processing/opengl/PGraphicsOpenGL.java | 19 ++++++++++++++++-- .../src/processing/opengl/PShape3D.java | 20 +++++++++++++++++-- 2 files changed, 35 insertions(+), 4 deletions(-) diff --git a/java/libraries/opengl/src/processing/opengl/PGraphicsOpenGL.java b/java/libraries/opengl/src/processing/opengl/PGraphicsOpenGL.java index a2e0973e5..cf19e9f64 100644 --- a/java/libraries/opengl/src/processing/opengl/PGraphicsOpenGL.java +++ b/java/libraries/opengl/src/processing/opengl/PGraphicsOpenGL.java @@ -460,7 +460,8 @@ public class PGraphicsOpenGL extends PGraphics { protected float[] currentTexcoord = { 0, 0 }; protected float[] currentStroke = { 0, 0, 0, 1, 1 }; - protected boolean breakShape; + protected boolean openContour = false; + protected boolean breakShape = false; public static int flushMode = FLUSH_WHEN_FULL; // public static int flushMode = FLUSH_AFTER_SHAPE; @@ -1882,7 +1883,21 @@ public class PGraphicsOpenGL extends PGraphics { } - public void breakShape() { + public void beginContour() { + if (openContour) { + showWarning("P3D: Already called beginContour()."); + return; + } + openContour = true; + } + + + public void endContour() { + if (!openContour) { + showWarning("P3D: Need to call beginContour() first."); + return; + } + openContour = false; breakShape = true; } diff --git a/java/libraries/opengl/src/processing/opengl/PShape3D.java b/java/libraries/opengl/src/processing/opengl/PShape3D.java index 52f977824..a6d693fa7 100644 --- a/java/libraries/opengl/src/processing/opengl/PShape3D.java +++ b/java/libraries/opengl/src/processing/opengl/PShape3D.java @@ -118,10 +118,12 @@ public class PShape3D extends PShape { // Drawing/rendering state protected boolean modified; - protected boolean breakShape; protected boolean isSolid; protected boolean isClosed; + protected boolean openContour = false; + protected boolean breakShape = false; + protected boolean hasFill; protected boolean hasLines; protected boolean hasPoints; @@ -297,7 +299,21 @@ public class PShape3D extends PShape { } - public void breakShape() { + public void beginContour() { + if (openContour) { + PGraphics.showWarning("P3D: Already called beginContour()."); + return; + } + openContour = true; + } + + + public void endContour() { + if (!openContour) { + PGraphics.showWarning("P3D: Need to call beginContour() first."); + return; + } + openContour = false; breakShape = true; }