propane 3.10.0-java → 3.11.0-java
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.mvn/wrapper/maven-wrapper.properties +1 -1
- data/CHANGELOG.md +2 -0
- data/README.md +7 -7
- data/lib/propane/app.rb +2 -5
- data/lib/propane/helper_methods.rb +6 -6
- data/lib/propane/version.rb +1 -1
- data/lib/{propane-3.10.0.jar → propane-3.11.0.jar} +0 -0
- data/pom.rb +6 -6
- data/pom.xml +6 -6
- data/propane.gemspec +3 -3
- data/src/main/java/monkstone/noise/OpenSimplex2F.java +838 -737
- data/src/main/java/monkstone/vecmath/vec2/Vec2.java +8 -13
- data/src/main/java/monkstone/vecmath/vec3/Vec3.java +14 -28
- data/src/main/java/processing/awt/PImageAWT.java +6 -4
- data/src/main/java/processing/core/PApplet.java +71 -59
- data/src/main/java/processing/core/PImage.java +14 -14
- data/src/main/java/processing/opengl/PGraphicsOpenGL.java +13 -13
- data/src/main/java/processing/opengl/PShader.java +1 -6
- data/src/main/java/processing/opengl/PSurfaceJOGL.java +6 -6
- data/{lib/java/processing/opengl → src/main/resources}/cursors/arrow.png +0 -0
- data/{lib/java/processing/opengl → src/main/resources}/cursors/cross.png +0 -0
- data/{lib/java/processing/opengl → src/main/resources}/cursors/hand.png +0 -0
- data/{lib/java/processing/opengl → src/main/resources}/cursors/license.txt +0 -0
- data/{lib/java/processing/opengl → src/main/resources}/cursors/move.png +0 -0
- data/{lib/java/processing/opengl → src/main/resources}/cursors/text.png +0 -0
- data/{lib/java/processing/opengl → src/main/resources}/cursors/wait.png +0 -0
- data/{lib/java/processing/opengl → src/main/resources}/shaders/ColorFrag.glsl +0 -0
- data/{lib/java/processing/opengl → src/main/resources}/shaders/ColorVert.glsl +0 -0
- data/{lib/java/processing/opengl → src/main/resources}/shaders/LightFrag.glsl +0 -0
- data/{lib/java/processing/opengl → src/main/resources}/shaders/LightVert.glsl +0 -0
- data/{lib/java/processing/opengl → src/main/resources}/shaders/LineFrag.glsl +0 -0
- data/{lib/java/processing/opengl → src/main/resources}/shaders/LineVert.glsl +0 -0
- data/{lib/java/processing/opengl → src/main/resources}/shaders/MaskFrag.glsl +0 -0
- data/{lib/java/processing/opengl → src/main/resources}/shaders/PointFrag.glsl +0 -0
- data/{lib/java/processing/opengl → src/main/resources}/shaders/PointVert.glsl +0 -0
- data/{lib/java/processing/opengl → src/main/resources}/shaders/TexFrag.glsl +0 -0
- data/{lib/java/processing/opengl → src/main/resources}/shaders/TexLightFrag.glsl +0 -0
- data/{lib/java/processing/opengl → src/main/resources}/shaders/TexLightVert.glsl +0 -0
- data/{lib/java/processing/opengl → src/main/resources}/shaders/TexVert.glsl +0 -0
- data/test/test_helper.rb +1 -0
- data/vendors/Rakefile +1 -1
- metadata +29 -155
- data/lib/java/japplemenubar/JAppleMenuBar.java +0 -88
- data/lib/java/japplemenubar/libjAppleMenuBar.jnilib +0 -0
- data/lib/java/monkstone/ColorUtil.java +0 -127
- data/lib/java/monkstone/MathToolModule.java +0 -287
- data/lib/java/monkstone/PropaneLibrary.java +0 -46
- data/lib/java/monkstone/core/LibraryProxy.java +0 -136
- data/lib/java/monkstone/fastmath/DegLutTables.java +0 -111
- data/lib/java/monkstone/fastmath/Deglut.java +0 -71
- data/lib/java/monkstone/fastmath/package-info.java +0 -6
- data/lib/java/monkstone/filechooser/Chooser.java +0 -39
- data/lib/java/monkstone/noise/FastTerrain.java +0 -874
- data/lib/java/monkstone/noise/Noise.java +0 -90
- data/lib/java/monkstone/noise/NoiseGenerator.java +0 -75
- data/lib/java/monkstone/noise/NoiseMode.java +0 -28
- data/lib/java/monkstone/noise/OpenSimplex2F.java +0 -881
- data/lib/java/monkstone/noise/OpenSimplex2S.java +0 -1106
- data/lib/java/monkstone/noise/SmoothTerrain.java +0 -1099
- data/lib/java/monkstone/slider/CustomHorizontalSlider.java +0 -164
- data/lib/java/monkstone/slider/CustomVerticalSlider.java +0 -178
- data/lib/java/monkstone/slider/SimpleHorizontalSlider.java +0 -145
- data/lib/java/monkstone/slider/SimpleSlider.java +0 -166
- data/lib/java/monkstone/slider/SimpleVerticalSlider.java +0 -157
- data/lib/java/monkstone/slider/Slider.java +0 -61
- data/lib/java/monkstone/slider/SliderBar.java +0 -245
- data/lib/java/monkstone/slider/SliderGroup.java +0 -56
- data/lib/java/monkstone/slider/WheelHandler.java +0 -35
- data/lib/java/monkstone/vecmath/GfxRender.java +0 -86
- data/lib/java/monkstone/vecmath/JRender.java +0 -56
- data/lib/java/monkstone/vecmath/ShapeRender.java +0 -87
- data/lib/java/monkstone/vecmath/package-info.java +0 -20
- data/lib/java/monkstone/vecmath/vec2/Vec2.java +0 -802
- data/lib/java/monkstone/vecmath/vec2/package-info.java +0 -6
- data/lib/java/monkstone/vecmath/vec3/Vec3.java +0 -727
- data/lib/java/monkstone/vecmath/vec3/package-info.java +0 -6
- data/lib/java/monkstone/videoevent/CaptureEvent.java +0 -27
- data/lib/java/monkstone/videoevent/MovieEvent.java +0 -32
- data/lib/java/monkstone/videoevent/package-info.java +0 -20
- data/lib/java/processing/awt/PGraphicsJava2D.java +0 -3040
- data/lib/java/processing/awt/PImageAWT.java +0 -377
- data/lib/java/processing/awt/PShapeJava2D.java +0 -387
- data/lib/java/processing/awt/PSurfaceAWT.java +0 -1581
- data/lib/java/processing/awt/ShimAWT.java +0 -581
- data/lib/java/processing/core/PApplet.java +0 -15156
- data/lib/java/processing/core/PConstants.java +0 -523
- data/lib/java/processing/core/PFont.java +0 -1126
- data/lib/java/processing/core/PGraphics.java +0 -8600
- data/lib/java/processing/core/PImage.java +0 -3377
- data/lib/java/processing/core/PMatrix.java +0 -208
- data/lib/java/processing/core/PMatrix2D.java +0 -562
- data/lib/java/processing/core/PMatrix3D.java +0 -890
- data/lib/java/processing/core/PShape.java +0 -3561
- data/lib/java/processing/core/PShapeOBJ.java +0 -483
- data/lib/java/processing/core/PShapeSVG.java +0 -2016
- data/lib/java/processing/core/PStyle.java +0 -63
- data/lib/java/processing/core/PSurface.java +0 -198
- data/lib/java/processing/core/PSurfaceNone.java +0 -431
- data/lib/java/processing/core/PVector.java +0 -1066
- data/lib/java/processing/core/ThinkDifferent.java +0 -115
- data/lib/java/processing/data/DoubleDict.java +0 -850
- data/lib/java/processing/data/DoubleList.java +0 -928
- data/lib/java/processing/data/FloatDict.java +0 -847
- data/lib/java/processing/data/FloatList.java +0 -936
- data/lib/java/processing/data/IntDict.java +0 -807
- data/lib/java/processing/data/IntList.java +0 -936
- data/lib/java/processing/data/JSONArray.java +0 -1260
- data/lib/java/processing/data/JSONObject.java +0 -2282
- data/lib/java/processing/data/JSONTokener.java +0 -435
- data/lib/java/processing/data/LongDict.java +0 -802
- data/lib/java/processing/data/LongList.java +0 -937
- data/lib/java/processing/data/Sort.java +0 -46
- data/lib/java/processing/data/StringDict.java +0 -613
- data/lib/java/processing/data/StringList.java +0 -800
- data/lib/java/processing/data/Table.java +0 -4936
- data/lib/java/processing/data/TableRow.java +0 -198
- data/lib/java/processing/data/XML.java +0 -1156
- data/lib/java/processing/dxf/RawDXF.java +0 -404
- data/lib/java/processing/event/Event.java +0 -125
- data/lib/java/processing/event/KeyEvent.java +0 -70
- data/lib/java/processing/event/MouseEvent.java +0 -114
- data/lib/java/processing/event/TouchEvent.java +0 -57
- data/lib/java/processing/javafx/PGraphicsFX2D.java +0 -32
- data/lib/java/processing/javafx/PSurfaceFX.java +0 -173
- data/lib/java/processing/net/Client.java +0 -744
- data/lib/java/processing/net/Server.java +0 -388
- data/lib/java/processing/opengl/FontTexture.java +0 -378
- data/lib/java/processing/opengl/FrameBuffer.java +0 -513
- data/lib/java/processing/opengl/LinePath.java +0 -627
- data/lib/java/processing/opengl/LineStroker.java +0 -681
- data/lib/java/processing/opengl/PGL.java +0 -3483
- data/lib/java/processing/opengl/PGraphics2D.java +0 -615
- data/lib/java/processing/opengl/PGraphics3D.java +0 -281
- data/lib/java/processing/opengl/PGraphicsOpenGL.java +0 -13753
- data/lib/java/processing/opengl/PJOGL.java +0 -2008
- data/lib/java/processing/opengl/PShader.java +0 -1484
- data/lib/java/processing/opengl/PShapeOpenGL.java +0 -5269
- data/lib/java/processing/opengl/PSurfaceJOGL.java +0 -1385
- data/lib/java/processing/opengl/Texture.java +0 -1696
- data/lib/java/processing/opengl/VertexBuffer.java +0 -88
- data/lib/java/processing/pdf/PGraphicsPDF.java +0 -581
- data/lib/java/processing/svg/PGraphicsSVG.java +0 -378
- data/src/main/java/processing/opengl/cursors/arrow.png +0 -0
- data/src/main/java/processing/opengl/cursors/cross.png +0 -0
- data/src/main/java/processing/opengl/cursors/hand.png +0 -0
- data/src/main/java/processing/opengl/cursors/license.txt +0 -27
- data/src/main/java/processing/opengl/cursors/move.png +0 -0
- data/src/main/java/processing/opengl/cursors/text.png +0 -0
- data/src/main/java/processing/opengl/cursors/wait.png +0 -0
- data/src/main/java/processing/opengl/shaders/ColorFrag.glsl +0 -32
- data/src/main/java/processing/opengl/shaders/ColorVert.glsl +0 -34
- data/src/main/java/processing/opengl/shaders/LightFrag.glsl +0 -33
- data/src/main/java/processing/opengl/shaders/LightVert.glsl +0 -151
- data/src/main/java/processing/opengl/shaders/LineFrag.glsl +0 -32
- data/src/main/java/processing/opengl/shaders/LineVert.glsl +0 -100
- data/src/main/java/processing/opengl/shaders/MaskFrag.glsl +0 -40
- data/src/main/java/processing/opengl/shaders/PointFrag.glsl +0 -32
- data/src/main/java/processing/opengl/shaders/PointVert.glsl +0 -56
- data/src/main/java/processing/opengl/shaders/TexFrag.glsl +0 -37
- data/src/main/java/processing/opengl/shaders/TexLightFrag.glsl +0 -37
- data/src/main/java/processing/opengl/shaders/TexLightVert.glsl +0 -157
- data/src/main/java/processing/opengl/shaders/TexVert.glsl +0 -38
@@ -1,615 +0,0 @@
|
|
1
|
-
/* -*- mode: java; c-basic-offset: 2; indent-tabs-mode: nil -*- */
|
2
|
-
|
3
|
-
/*
|
4
|
-
Part of the Processing project - http://processing.org
|
5
|
-
|
6
|
-
Copyright (c) 2012-15 The Processing Foundation
|
7
|
-
Copyright (c) 2004-12 Ben Fry and Casey Reas
|
8
|
-
Copyright (c) 2001-04 Massachusetts Institute of Technology
|
9
|
-
|
10
|
-
This library is free software; you can redistribute it and/or
|
11
|
-
modify it under the terms of the GNU Lesser General Public
|
12
|
-
License as published by the Free Software Foundation, version 2.1.
|
13
|
-
|
14
|
-
This library is distributed in the hope that it will be useful,
|
15
|
-
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
16
|
-
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
17
|
-
Lesser General Public License for more details.
|
18
|
-
|
19
|
-
You should have received a copy of the GNU Lesser General
|
20
|
-
Public License along with this library; if not, write to the
|
21
|
-
Free Software Foundation, Inc., 59 Temple Place, Suite 330,
|
22
|
-
Boston, MA 02111-1307 USA
|
23
|
-
*/
|
24
|
-
|
25
|
-
package processing.opengl;
|
26
|
-
|
27
|
-
import processing.core.PGraphics;
|
28
|
-
import processing.core.PMatrix3D;
|
29
|
-
import processing.core.PShape;
|
30
|
-
import processing.core.PShapeSVG;
|
31
|
-
|
32
|
-
|
33
|
-
public class PGraphics2D extends PGraphicsOpenGL {
|
34
|
-
|
35
|
-
public PGraphics2D() {
|
36
|
-
super();
|
37
|
-
}
|
38
|
-
|
39
|
-
|
40
|
-
//////////////////////////////////////////////////////////////
|
41
|
-
|
42
|
-
// RENDERER SUPPORT QUERIES
|
43
|
-
|
44
|
-
|
45
|
-
@Override
|
46
|
-
public boolean is2D() {
|
47
|
-
return true;
|
48
|
-
}
|
49
|
-
|
50
|
-
|
51
|
-
@Override
|
52
|
-
public boolean is3D() {
|
53
|
-
return false;
|
54
|
-
}
|
55
|
-
|
56
|
-
|
57
|
-
//////////////////////////////////////////////////////////////
|
58
|
-
|
59
|
-
// HINTS
|
60
|
-
|
61
|
-
|
62
|
-
@Override
|
63
|
-
public void hint(int which) {
|
64
|
-
if (which == ENABLE_STROKE_PERSPECTIVE) {
|
65
|
-
showWarning("Strokes cannot be perspective-corrected in 2D.");
|
66
|
-
return;
|
67
|
-
}
|
68
|
-
super.hint(which);
|
69
|
-
}
|
70
|
-
|
71
|
-
|
72
|
-
//////////////////////////////////////////////////////////////
|
73
|
-
|
74
|
-
// PROJECTION
|
75
|
-
|
76
|
-
|
77
|
-
@Override
|
78
|
-
public void ortho() {
|
79
|
-
showMethodWarning("ortho");
|
80
|
-
}
|
81
|
-
|
82
|
-
|
83
|
-
@Override
|
84
|
-
public void ortho(float left, float right,
|
85
|
-
float bottom, float top) {
|
86
|
-
showMethodWarning("ortho");
|
87
|
-
}
|
88
|
-
|
89
|
-
|
90
|
-
@Override
|
91
|
-
public void ortho(float left, float right,
|
92
|
-
float bottom, float top,
|
93
|
-
float near, float far) {
|
94
|
-
showMethodWarning("ortho");
|
95
|
-
}
|
96
|
-
|
97
|
-
|
98
|
-
@Override
|
99
|
-
public void perspective() {
|
100
|
-
showMethodWarning("perspective");
|
101
|
-
}
|
102
|
-
|
103
|
-
|
104
|
-
@Override
|
105
|
-
public void perspective(float fov, float aspect, float zNear, float zFar) {
|
106
|
-
showMethodWarning("perspective");
|
107
|
-
}
|
108
|
-
|
109
|
-
|
110
|
-
@Override
|
111
|
-
public void frustum(float left, float right, float bottom, float top,
|
112
|
-
float znear, float zfar) {
|
113
|
-
showMethodWarning("frustum");
|
114
|
-
}
|
115
|
-
|
116
|
-
|
117
|
-
@Override
|
118
|
-
protected void defaultPerspective() {
|
119
|
-
super.ortho(0, width, -height, 0, -1, +1);
|
120
|
-
}
|
121
|
-
|
122
|
-
|
123
|
-
//////////////////////////////////////////////////////////////
|
124
|
-
|
125
|
-
// CAMERA
|
126
|
-
|
127
|
-
|
128
|
-
@Override
|
129
|
-
public void beginCamera() {
|
130
|
-
showMethodWarning("beginCamera");
|
131
|
-
}
|
132
|
-
|
133
|
-
|
134
|
-
@Override
|
135
|
-
public void endCamera() {
|
136
|
-
showMethodWarning("endCamera");
|
137
|
-
}
|
138
|
-
|
139
|
-
|
140
|
-
@Override
|
141
|
-
public void camera() {
|
142
|
-
showMethodWarning("camera");
|
143
|
-
}
|
144
|
-
|
145
|
-
|
146
|
-
@Override
|
147
|
-
public void camera(float eyeX, float eyeY, float eyeZ,
|
148
|
-
float centerX, float centerY, float centerZ,
|
149
|
-
float upX, float upY, float upZ) {
|
150
|
-
showMethodWarning("camera");
|
151
|
-
}
|
152
|
-
|
153
|
-
|
154
|
-
@Override
|
155
|
-
protected void defaultCamera() {
|
156
|
-
eyeDist = 1;
|
157
|
-
resetMatrix();
|
158
|
-
}
|
159
|
-
|
160
|
-
|
161
|
-
//////////////////////////////////////////////////////////////
|
162
|
-
|
163
|
-
// MATRIX MORE!
|
164
|
-
|
165
|
-
|
166
|
-
@Override
|
167
|
-
protected void begin2D() {
|
168
|
-
pushProjection();
|
169
|
-
defaultPerspective();
|
170
|
-
pushMatrix();
|
171
|
-
defaultCamera();
|
172
|
-
}
|
173
|
-
|
174
|
-
|
175
|
-
@Override
|
176
|
-
protected void end2D() {
|
177
|
-
popMatrix();
|
178
|
-
popProjection();
|
179
|
-
}
|
180
|
-
|
181
|
-
|
182
|
-
//////////////////////////////////////////////////////////////
|
183
|
-
|
184
|
-
// SHAPE
|
185
|
-
|
186
|
-
|
187
|
-
@Override
|
188
|
-
public void shape(PShape shape) {
|
189
|
-
if (shape.is2D()) {
|
190
|
-
super.shape(shape);
|
191
|
-
} else {
|
192
|
-
showWarning("The shape object is not 2D, cannot be displayed with " +
|
193
|
-
"this renderer");
|
194
|
-
}
|
195
|
-
}
|
196
|
-
|
197
|
-
|
198
|
-
@Override
|
199
|
-
public void shape(PShape shape, float x, float y) {
|
200
|
-
if (shape.is2D()) {
|
201
|
-
super.shape(shape, x, y);
|
202
|
-
} else {
|
203
|
-
showWarning("The shape object is not 2D, cannot be displayed with " +
|
204
|
-
"this renderer");
|
205
|
-
}
|
206
|
-
}
|
207
|
-
|
208
|
-
|
209
|
-
@Override
|
210
|
-
public void shape(PShape shape, float a, float b, float c, float d) {
|
211
|
-
if (shape.is2D()) {
|
212
|
-
super.shape(shape, a, b, c, d);
|
213
|
-
} else {
|
214
|
-
showWarning("The shape object is not 2D, cannot be displayed with " +
|
215
|
-
"this renderer");
|
216
|
-
}
|
217
|
-
}
|
218
|
-
|
219
|
-
|
220
|
-
@Override
|
221
|
-
public void shape(PShape shape, float x, float y, float z) {
|
222
|
-
showDepthWarningXYZ("shape");
|
223
|
-
}
|
224
|
-
|
225
|
-
|
226
|
-
@Override
|
227
|
-
public void shape(PShape shape, float x, float y, float z,
|
228
|
-
float c, float d, float e) {
|
229
|
-
showDepthWarningXYZ("shape");
|
230
|
-
}
|
231
|
-
|
232
|
-
|
233
|
-
|
234
|
-
//////////////////////////////////////////////////////////////
|
235
|
-
|
236
|
-
// SHAPE I/O
|
237
|
-
|
238
|
-
|
239
|
-
static protected boolean isSupportedExtension(String extension) {
|
240
|
-
return extension.equals("svg") || extension.equals("svgz");
|
241
|
-
}
|
242
|
-
|
243
|
-
|
244
|
-
static protected PShape loadShapeImpl(PGraphics pg,
|
245
|
-
String filename, String extension) {
|
246
|
-
if (extension.equals("svg") || extension.equals("svgz")) {
|
247
|
-
PShapeSVG svg = new PShapeSVG(pg.parent.loadXML(filename));
|
248
|
-
return PShapeOpenGL.createShape((PGraphicsOpenGL) pg, svg);
|
249
|
-
}
|
250
|
-
return null;
|
251
|
-
}
|
252
|
-
|
253
|
-
|
254
|
-
//////////////////////////////////////////////////////////////
|
255
|
-
|
256
|
-
// SCREEN TRANSFORMS
|
257
|
-
|
258
|
-
|
259
|
-
@Override
|
260
|
-
public float modelX(float x, float y, float z) {
|
261
|
-
showDepthWarning("modelX");
|
262
|
-
return 0;
|
263
|
-
}
|
264
|
-
|
265
|
-
|
266
|
-
@Override
|
267
|
-
public float modelY(float x, float y, float z) {
|
268
|
-
showDepthWarning("modelY");
|
269
|
-
return 0;
|
270
|
-
}
|
271
|
-
|
272
|
-
|
273
|
-
@Override
|
274
|
-
public float modelZ(float x, float y, float z) {
|
275
|
-
showDepthWarning("modelZ");
|
276
|
-
return 0;
|
277
|
-
}
|
278
|
-
|
279
|
-
|
280
|
-
//////////////////////////////////////////////////////////////
|
281
|
-
|
282
|
-
// SHAPE CREATION
|
283
|
-
|
284
|
-
|
285
|
-
// @Override
|
286
|
-
// protected PShape createShapeFamily(int type) {
|
287
|
-
// return new PShapeOpenGL(this, type);
|
288
|
-
// }
|
289
|
-
//
|
290
|
-
//
|
291
|
-
// @Override
|
292
|
-
// protected PShape createShapePrimitive(int kind, float... p) {
|
293
|
-
// return new PShapeOpenGL(this, kind, p);
|
294
|
-
// }
|
295
|
-
|
296
|
-
|
297
|
-
/*
|
298
|
-
@Override
|
299
|
-
public PShape createShape(PShape source) {
|
300
|
-
return PShapeOpenGL.createShape2D(this, source);
|
301
|
-
}
|
302
|
-
|
303
|
-
|
304
|
-
@Override
|
305
|
-
public PShape createShape() {
|
306
|
-
return createShape(PShape.GEOMETRY);
|
307
|
-
}
|
308
|
-
|
309
|
-
|
310
|
-
@Override
|
311
|
-
public PShape createShape(int type) {
|
312
|
-
return createShapeImpl(this, type);
|
313
|
-
}
|
314
|
-
|
315
|
-
|
316
|
-
@Override
|
317
|
-
public PShape createShape(int kind, float... p) {
|
318
|
-
return createShapeImpl(this, kind, p);
|
319
|
-
}
|
320
|
-
|
321
|
-
|
322
|
-
static protected PShapeOpenGL createShapeImpl(PGraphicsOpenGL pg, int type) {
|
323
|
-
PShapeOpenGL shape = null;
|
324
|
-
if (type == PConstants.GROUP) {
|
325
|
-
shape = new PShapeOpenGL(pg, PConstants.GROUP);
|
326
|
-
} else if (type == PShape.PATH) {
|
327
|
-
shape = new PShapeOpenGL(pg, PShape.PATH);
|
328
|
-
} else if (type == PShape.GEOMETRY) {
|
329
|
-
shape = new PShapeOpenGL(pg, PShape.GEOMETRY);
|
330
|
-
}
|
331
|
-
shape.set3D(false);
|
332
|
-
return shape;
|
333
|
-
}
|
334
|
-
|
335
|
-
|
336
|
-
static protected PShapeOpenGL createShapeImpl(PGraphicsOpenGL pg,
|
337
|
-
int kind, float... p) {
|
338
|
-
PShapeOpenGL shape = null;
|
339
|
-
int len = p.length;
|
340
|
-
|
341
|
-
if (kind == POINT) {
|
342
|
-
if (len != 2) {
|
343
|
-
showWarning("Wrong number of parameters");
|
344
|
-
return null;
|
345
|
-
}
|
346
|
-
shape = new PShapeOpenGL(pg, PShape.PRIMITIVE);
|
347
|
-
shape.setKind(POINT);
|
348
|
-
} else if (kind == LINE) {
|
349
|
-
if (len != 4) {
|
350
|
-
showWarning("Wrong number of parameters");
|
351
|
-
return null;
|
352
|
-
}
|
353
|
-
shape = new PShapeOpenGL(pg, PShape.PRIMITIVE);
|
354
|
-
shape.setKind(LINE);
|
355
|
-
} else if (kind == TRIANGLE) {
|
356
|
-
if (len != 6) {
|
357
|
-
showWarning("Wrong number of parameters");
|
358
|
-
return null;
|
359
|
-
}
|
360
|
-
shape = new PShapeOpenGL(pg, PShape.PRIMITIVE);
|
361
|
-
shape.setKind(TRIANGLE);
|
362
|
-
} else if (kind == QUAD) {
|
363
|
-
if (len != 8) {
|
364
|
-
showWarning("Wrong number of parameters");
|
365
|
-
return null;
|
366
|
-
}
|
367
|
-
shape = new PShapeOpenGL(pg, PShape.PRIMITIVE);
|
368
|
-
shape.setKind(QUAD);
|
369
|
-
} else if (kind == RECT) {
|
370
|
-
if (len != 4 && len != 5 && len != 8 && len != 9) {
|
371
|
-
showWarning("Wrong number of parameters");
|
372
|
-
return null;
|
373
|
-
}
|
374
|
-
shape = new PShapeOpenGL(pg, PShape.PRIMITIVE);
|
375
|
-
shape.setKind(RECT);
|
376
|
-
} else if (kind == ELLIPSE) {
|
377
|
-
if (len != 4 && len != 5) {
|
378
|
-
showWarning("Wrong number of parameters");
|
379
|
-
return null;
|
380
|
-
}
|
381
|
-
shape = new PShapeOpenGL(pg, PShape.PRIMITIVE);
|
382
|
-
shape.setKind(ELLIPSE);
|
383
|
-
} else if (kind == ARC) {
|
384
|
-
if (len != 6 && len != 7) {
|
385
|
-
showWarning("Wrong number of parameters");
|
386
|
-
return null;
|
387
|
-
}
|
388
|
-
shape = new PShapeOpenGL(pg, PShape.PRIMITIVE);
|
389
|
-
shape.setKind(ARC);
|
390
|
-
} else if (kind == BOX) {
|
391
|
-
showWarning("Primitive not supported in 2D");
|
392
|
-
} else if (kind == SPHERE) {
|
393
|
-
showWarning("Primitive not supported in 2D");
|
394
|
-
} else {
|
395
|
-
showWarning("Unrecognized primitive type");
|
396
|
-
}
|
397
|
-
|
398
|
-
if (shape != null) {
|
399
|
-
shape.setParams(p);
|
400
|
-
}
|
401
|
-
|
402
|
-
shape.set3D(false);
|
403
|
-
return shape;
|
404
|
-
}
|
405
|
-
*/
|
406
|
-
|
407
|
-
|
408
|
-
//////////////////////////////////////////////////////////////
|
409
|
-
|
410
|
-
// BEZIER VERTICES
|
411
|
-
|
412
|
-
|
413
|
-
@Override
|
414
|
-
public void bezierVertex(float x2, float y2, float z2,
|
415
|
-
float x3, float y3, float z3,
|
416
|
-
float x4, float y4, float z4) {
|
417
|
-
showDepthWarningXYZ("bezierVertex");
|
418
|
-
}
|
419
|
-
|
420
|
-
|
421
|
-
//////////////////////////////////////////////////////////////
|
422
|
-
|
423
|
-
// QUADRATIC BEZIER VERTICES
|
424
|
-
|
425
|
-
|
426
|
-
@Override
|
427
|
-
public void quadraticVertex(float x2, float y2, float z2,
|
428
|
-
float x4, float y4, float z4) {
|
429
|
-
showDepthWarningXYZ("quadVertex");
|
430
|
-
}
|
431
|
-
|
432
|
-
|
433
|
-
//////////////////////////////////////////////////////////////
|
434
|
-
|
435
|
-
// CURVE VERTICES
|
436
|
-
|
437
|
-
|
438
|
-
@Override
|
439
|
-
public void curveVertex(float x, float y, float z) {
|
440
|
-
showDepthWarningXYZ("curveVertex");
|
441
|
-
}
|
442
|
-
|
443
|
-
|
444
|
-
//////////////////////////////////////////////////////////////
|
445
|
-
|
446
|
-
// BOX
|
447
|
-
|
448
|
-
|
449
|
-
@Override
|
450
|
-
public void box(float w, float h, float d) {
|
451
|
-
showMethodWarning("box");
|
452
|
-
}
|
453
|
-
|
454
|
-
|
455
|
-
//////////////////////////////////////////////////////////////
|
456
|
-
|
457
|
-
// SPHERE
|
458
|
-
|
459
|
-
|
460
|
-
@Override
|
461
|
-
public void sphere(float r) {
|
462
|
-
showMethodWarning("sphere");
|
463
|
-
}
|
464
|
-
|
465
|
-
|
466
|
-
//////////////////////////////////////////////////////////////
|
467
|
-
|
468
|
-
// VERTEX SHAPES
|
469
|
-
|
470
|
-
|
471
|
-
@Override
|
472
|
-
public void vertex(float x, float y, float z) {
|
473
|
-
showDepthWarningXYZ("vertex");
|
474
|
-
}
|
475
|
-
|
476
|
-
@Override
|
477
|
-
public void vertex(float x, float y, float z, float u, float v) {
|
478
|
-
showDepthWarningXYZ("vertex");
|
479
|
-
}
|
480
|
-
|
481
|
-
//////////////////////////////////////////////////////////////
|
482
|
-
|
483
|
-
// MATRIX TRANSFORMATIONS
|
484
|
-
|
485
|
-
@Override
|
486
|
-
public void translate(float tx, float ty, float tz) {
|
487
|
-
showDepthWarningXYZ("translate");
|
488
|
-
}
|
489
|
-
|
490
|
-
@Override
|
491
|
-
public void rotateX(float angle) {
|
492
|
-
showDepthWarning("rotateX");
|
493
|
-
}
|
494
|
-
|
495
|
-
@Override
|
496
|
-
public void rotateY(float angle) {
|
497
|
-
showDepthWarning("rotateY");
|
498
|
-
}
|
499
|
-
|
500
|
-
@Override
|
501
|
-
public void rotateZ(float angle) {
|
502
|
-
showDepthWarning("rotateZ");
|
503
|
-
}
|
504
|
-
|
505
|
-
@Override
|
506
|
-
public void rotate(float angle, float vx, float vy, float vz) {
|
507
|
-
showVariationWarning("rotate");
|
508
|
-
}
|
509
|
-
|
510
|
-
@Override
|
511
|
-
public void applyMatrix(PMatrix3D source) {
|
512
|
-
showVariationWarning("applyMatrix");
|
513
|
-
}
|
514
|
-
|
515
|
-
@Override
|
516
|
-
public void applyMatrix(float n00, float n01, float n02, float n03,
|
517
|
-
float n10, float n11, float n12, float n13,
|
518
|
-
float n20, float n21, float n22, float n23,
|
519
|
-
float n30, float n31, float n32, float n33) {
|
520
|
-
showVariationWarning("applyMatrix");
|
521
|
-
}
|
522
|
-
|
523
|
-
@Override
|
524
|
-
public void scale(float sx, float sy, float sz) {
|
525
|
-
showDepthWarningXYZ("scale");
|
526
|
-
}
|
527
|
-
|
528
|
-
//////////////////////////////////////////////////////////////
|
529
|
-
|
530
|
-
// SCREEN AND MODEL COORDS
|
531
|
-
|
532
|
-
@Override
|
533
|
-
public float screenX(float x, float y, float z) {
|
534
|
-
showDepthWarningXYZ("screenX");
|
535
|
-
return 0;
|
536
|
-
}
|
537
|
-
|
538
|
-
@Override
|
539
|
-
public float screenY(float x, float y, float z) {
|
540
|
-
showDepthWarningXYZ("screenY");
|
541
|
-
return 0;
|
542
|
-
}
|
543
|
-
|
544
|
-
@Override
|
545
|
-
public float screenZ(float x, float y, float z) {
|
546
|
-
showDepthWarningXYZ("screenZ");
|
547
|
-
return 0;
|
548
|
-
}
|
549
|
-
|
550
|
-
@Override
|
551
|
-
public PMatrix3D getMatrix(PMatrix3D target) {
|
552
|
-
showVariationWarning("getMatrix");
|
553
|
-
return target;
|
554
|
-
}
|
555
|
-
|
556
|
-
@Override
|
557
|
-
public void setMatrix(PMatrix3D source) {
|
558
|
-
showVariationWarning("setMatrix");
|
559
|
-
}
|
560
|
-
|
561
|
-
//////////////////////////////////////////////////////////////
|
562
|
-
|
563
|
-
// LIGHTS
|
564
|
-
|
565
|
-
@Override
|
566
|
-
public void lights() {
|
567
|
-
showMethodWarning("lights");
|
568
|
-
}
|
569
|
-
|
570
|
-
@Override
|
571
|
-
public void noLights() {
|
572
|
-
showMethodWarning("noLights");
|
573
|
-
}
|
574
|
-
|
575
|
-
@Override
|
576
|
-
public void ambientLight(float red, float green, float blue) {
|
577
|
-
showMethodWarning("ambientLight");
|
578
|
-
}
|
579
|
-
|
580
|
-
@Override
|
581
|
-
public void ambientLight(float red, float green, float blue,
|
582
|
-
float x, float y, float z) {
|
583
|
-
showMethodWarning("ambientLight");
|
584
|
-
}
|
585
|
-
|
586
|
-
@Override
|
587
|
-
public void directionalLight(float red, float green, float blue,
|
588
|
-
float nx, float ny, float nz) {
|
589
|
-
showMethodWarning("directionalLight");
|
590
|
-
}
|
591
|
-
|
592
|
-
@Override
|
593
|
-
public void pointLight(float red, float green, float blue,
|
594
|
-
float x, float y, float z) {
|
595
|
-
showMethodWarning("pointLight");
|
596
|
-
}
|
597
|
-
|
598
|
-
@Override
|
599
|
-
public void spotLight(float red, float green, float blue,
|
600
|
-
float x, float y, float z,
|
601
|
-
float nx, float ny, float nz,
|
602
|
-
float angle, float concentration) {
|
603
|
-
showMethodWarning("spotLight");
|
604
|
-
}
|
605
|
-
|
606
|
-
@Override
|
607
|
-
public void lightFalloff(float constant, float linear, float quadratic) {
|
608
|
-
showMethodWarning("lightFalloff");
|
609
|
-
}
|
610
|
-
|
611
|
-
@Override
|
612
|
-
public void lightSpecular(float v1, float v2, float v3) {
|
613
|
-
showMethodWarning("lightSpecular");
|
614
|
-
}
|
615
|
-
}
|