// a point class Point { float x=0, y=0, z=0; int pcolor=255; int[] rgb = new int[3]; boolean isRGB; Line on_line_1, on_line_2; Line on_lineZ_1, on_lineZ_2; Point[] children; // *** constructors *** Point() {} Point(float xc) { x = xc; } Point(float xc, float yc) { x = xc; y = yc; } Point( float xc, float yc, float zc ) { x = xc; y = yc; z = zc; } // *** accessors *** public void X(float xc) { x = xc; NotifyChildren(); } public void Y(float yc) { y = yc; NotifyChildren(); } public void Z(float zc) { z = zc; NotifyChildren(); } public void setColor(int c) { isRGB = false; pcolor = c; } public void setColor(int r, int g, int b) { isRGB = true; rgb[0] = r; rgb[1] = g; rgb[2] = b; } // *** methods *** public void drawPoint() { if (isRGB) { fill(rgb[0], rgb[1], rgb[2]); } else { fill(pcolor); } noStroke(); rect(x, y, 4, 4); rect(x, z, 4, 4); } public void onLines(Line l1, Line l2) { on_line_1 = l1; on_line_2 = l2; } public void onLinesZ(Line l1, Line l2) { on_lineZ_1 = l1; on_lineZ_2 = l2; } // event handlers void NotifyChildren() { if (children.length == 0) {return;} for (int i=0; i