diff --git a/build.xml.template b/build.xml.template index d316c56..48716a7 100644 --- a/build.xml.template +++ b/build.xml.template @@ -11,7 +11,6 @@ - diff --git a/lib/mode/guava-17.0-sources.jar b/lib/mode/guava-17.0-sources.jar new file mode 100644 index 0000000..2dab524 Binary files /dev/null and b/lib/mode/guava-17.0-sources.jar differ diff --git a/lib/mode/guava-17.0.jar b/lib/mode/guava-17.0.jar new file mode 100644 index 0000000..661fc74 Binary files /dev/null and b/lib/mode/guava-17.0.jar differ diff --git a/lib/mode/renjin-script-engine-0.8.2194-jar-with-dependencies.jar b/lib/mode/renjin-script-engine-0.8.2364-jar-with-dependencies.jar similarity index 86% rename from lib/mode/renjin-script-engine-0.8.2194-jar-with-dependencies.jar rename to lib/mode/renjin-script-engine-0.8.2364-jar-with-dependencies.jar index 389b114..febb99e 100644 Binary files a/lib/mode/renjin-script-engine-0.8.2194-jar-with-dependencies.jar and b/lib/mode/renjin-script-engine-0.8.2364-jar-with-dependencies.jar differ diff --git a/scripts/utils/generator-util.sh b/scripts/utils/generator-util.sh index 976dd1b..67775fb 100644 --- a/scripts/utils/generator-util.sh +++ b/scripts/utils/generator-util.sh @@ -21,9 +21,7 @@ function generate-build-config { help exit 1 fi - # Static path - local renjin="lib/renjin-script-engine-0.8.2194-jar-with-dependencies.jar" - + cd ${root} cp build.xml.template build.xml # Interpret config template. diff --git a/src/rprocessing/RLangPApplet.java b/src/rprocessing/RLangPApplet.java index 521971f..258e78a 100644 --- a/src/rprocessing/RLangPApplet.java +++ b/src/rprocessing/RLangPApplet.java @@ -325,7 +325,6 @@ protected void wrapProcessingVariables() { this.renjinEngine.put("displayHeight", displayHeight); this.renjinEngine.put("focused", focused); this.renjinEngine.put("keyPressed", keyPressed); - this.renjinEngine.put("frameCount", (double) frameCount); this.renjinEngine.put("frameRate", frameRate); // TODO: Find some ways to push constants into R. } diff --git a/src/rprocessing/applet/BuiltinApplet.java b/src/rprocessing/applet/BuiltinApplet.java index ce80bae..52c8aaf 100644 --- a/src/rprocessing/applet/BuiltinApplet.java +++ b/src/rprocessing/applet/BuiltinApplet.java @@ -12,9 +12,7 @@ public class BuiltinApplet extends PApplet { /* - * Wrapper functions - * - * float is not implemented in R, so processing.r need to cast double to float. + * TODO: Check for the cast. */ public void size(double width, double height) { @@ -25,240 +23,7 @@ public void size(double width, double height, StringVector renderer) { super.size((int) width, (int) height, renderer.asString()); } - /* - * 2D Primitives - */ - - public void point(double x, double y) { - super.point((float) x, (float) y); - } - - public void line(double posAX, double posAY, double posBX, double posBY) { - super.line((float) posAX, (float) posAY, (float) posBX, (float) posBY); - } - - public void ellipse(double posX, double posY, double width, double height) { - super.ellipse((float) posX, (float) posY, (float) width, (float) height); - } - - public void arc(double posX, double posY, double width, double height, double start, double stop) { - super.arc((float) posX, (float) posY, (float) width, (float) height, (float) start, - (float) stop); - } - - public void quad(double posAX, double posAY, double posBX, double posBY, double posCX, - double posCY, double posDX, double posDY) { - super.quad((float) posAX, (float) posAY, (float) posBX, (float) posBY, (float) posCX, - (float) posCY, (float) posDX, (float) posDY); - } - - public void rect(double posAX, double posAY, double posBX, double posBY) { - super.rect((float) posAX, (float) posAY, (float) posBX, (float) posBY); - } - - public void rect(double posAX, double posAY, double posBX, double posBY, double redii) { - super.rect((float) posAX, (float) posAY, (float) posBX, (float) posBY, (float) redii); - } - - public void rect(double posAX, double posAY, double posBX, double posBY, double tl, double tr, - double br, double bl) { - super.rect((float) posAX, (float) posAY, (float) posBX, (float) posBY, (float) tl, (float) tr, - (float) br, (float) bl); - } - - public void triangle(double posAX, double posAY, double posBX, double posBY, double posCX, - double posCY) { - super.triangle((float) posAX, (float) posAY, (float) posBX, (float) posBY, (float) posCX, - (float) posCY); - } - - /* - * Curves - */ - - public void bezier(double posAX, double posAY, double posAZ, double posBX, double posBY, - double posBZ, double posCX, double posCY, double posCZ, double posDX, double posDY, - double posDZ) { - super.bezier((float) posAX, (float) posAY, (float) posAZ, (float) posBX, (float) posBY, - (float) posBZ, (float) posCX, (float) posCY, (float) posCZ, (float) posDX, (float) posDY, - (float) posDZ); - } - - public void bezier(double posAX, double posAY, double posBX, double posBY, double posCX, - double posCY, double posDX, double posDY) { - super.bezier((float) posAX, (float) posAY, (float) posBX, (float) posBY, (float) posCX, - (float) posCY, (float) posDX, (float) posDY); - } - - public double bezierPoint(double posAX, double posAY, double posBX, double posBY, double t) { - return super.bezierPoint((float) posAX, (float) posAY, (float) posBX, (float) posBY, (float) t); - } - - public double bezierTangent(double posAX, double posAY, double posBX, double posBY, double t) { - return super.bezierTangent((float) posAX, (float) posAY, (float) posBX, (float) posBY, - (float) t); - } - - public void curve(double posAX, double posAY, double posAZ, double posBX, double posBY, - double posBZ, double posCX, double posCY, double posCZ, double posDX, double posDY, - double posDZ) { - super.curve((float) posAX, (float) posAY, (float) posAZ, (float) posBX, (float) posBY, - (float) posBZ, (float) posCX, (float) posCY, (float) posCZ, (float) posDX, (float) posDY, - (float) posDZ); - } - - public void curve(double posAX, double posAY, double posBX, double posBY, double posCX, - double posCY, double posDX, double posDY) { - super.curve((float) posAX, (float) posAY, (float) posBX, (float) posBY, (float) posCX, - (float) posCY, (float) posDX, (float) posDY); - } - - public double curvePoint(double posAX, double posAY, double posBX, double posBY, double t) { - return super.curvePoint((float) posAX, (float) posAY, (float) posBX, (float) posBY, (float) t); - } - - public double curveTangent(double posAX, double posAY, double posBX, double posBY, double t) { - return super - .curveTangent((float) posAX, (float) posAY, (float) posBX, (float) posBY, (float) t); - } - - public void curveTightness(double tightness) { - super.curveTightness((float) tightness); - } - - /* - * Colors - */ - - public void backgroud(int rgb, double alpha) { - super.background(rgb, (float) alpha); - } - - public void background(double gray) { - super.background((float) gray); - } - - public void background(double gray, double alpha) { - super.background((float) gray, (float) alpha); - } - - public void background(double v1, double v2, double v3) { - super.background((float) v1, (float) v2, (float) v3); - } - - public void background(double v1, double v2, double v3, double alpha) { - super.background((float) v1, (float) v2, (float) v3, (float) alpha); - } - - public void colorMode(int mode, double max) { - super.colorMode(mode, (float) max); - } - - public void colorMode(int mode, double max1, double max2, double max3) { - super.colorMode(mode, (float) max1, (float) max2, (float) max3); - } - - public void colorMode(int mode, double max1, double max2, double max3, double maxA) { - super.colorMode(mode, (float) max1, (float) max2, (float) max3, (float) maxA); - } - - public void fill(int rgb, double alpha) { - super.fill(rgb, (float) alpha); - } - - public void fill(double gray) { - super.fill((float) gray); - } - - public void fill(double gray, double alpha) { - super.fill((float) gray, (float) alpha); - } - - public void fill(double v1, double v2, double v3) { - super.fill((float) v1, (float) v2, (float) v3); - } - - public void fill(double v1, double v2, double v3, double alpha) { - super.fill((float) v1, (float) v2, (float) v3, (float) alpha); - } - - public void stroke(int rgb, double alpha) { - super.stroke(rgb, (float) alpha); - } - - public void stroke(double gray) { - super.stroke((float) gray); - } - - public void stroke(double gray, double alpha) { - super.stroke((float) gray, (float) alpha); - } - - public void stroke(double v1, double v2, double v3) { - super.stroke((float) v1, (float) v2, (float) v3); - } - - public void stroke(double v1, double v2, double v3, double alpha) { - super.stroke((float) v1, (float) v2, (float) v3, (float) alpha); - } - - /* - * 3D - */ - - public void box(double size) { - super.box((float) size); - } - - public void box(double w, double h, double d) { - super.box((float) w, (float) h, (float) d); - } - - public void sphere(double size) { - super.sphere((float) size); - } - - // TODO: Blocked until pre-processor. - // See https://github.com/gaocegege/Processing.R/issues/9#issuecomment-299710866 - // public double alpha(int rgb) { - // return 0; - // } - - public void perspective(double fovy, double aspect, double zNear, double zFar) { - super.perspective((float) fovy, (float) aspect, (float) zNear, (float) zFar); - } - - public void frameRate(double fps) { - super.frameRate((float) fps); - } - public double frameCount() { return super.frameCount; } - - public void camera(double eyeX, double eyeY, double eyeZ, double centerX, double centerY, - double centerZ, double upX, double upY, double upZ) { - super.camera((float) eyeX, (float) eyeY, (float) eyeZ, (float) centerX, (float) centerY, - (float) centerZ, (float) upX, (float) upY, (float) upZ); - } - - public void rotateX(double angle) { - super.rotateX((float) angle); - } - - public void rotateY(double angle) { - super.rotateY((float) angle); - } - - public void translate(double x, double y, double z) { - super.translate((float) x, (float) y, (float) z); - } - - public double radians(double degrees) { - return super.radians((float) degrees); - } - - public void text(String c, double posX, double posY) { - super.text(c, (float) posX, (float) posY); - } }