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,404 +0,0 @@
|
|
1
|
-
/* -*- mode: java; c-basic-offset: 2; indent-tabs-mode: nil -*- */
|
2
|
-
|
3
|
-
/*
|
4
|
-
* RawDXF - Code to write DXF files with beginRaw/endRaw
|
5
|
-
* An extension for the Processing project - http://processing.org
|
6
|
-
* <p/>
|
7
|
-
* This library is free software; you can redistribute it and/or
|
8
|
-
* modify it under the terms of the GNU Lesser General Public
|
9
|
-
* License as published by the Free Software Foundation; either
|
10
|
-
* version 2.1 of the License, or (at your option) any later version.
|
11
|
-
* <p/>
|
12
|
-
* This library is distributed in the hope that it will be useful,
|
13
|
-
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
14
|
-
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
15
|
-
* Lesser General Public License for more details.
|
16
|
-
* <p/>
|
17
|
-
* You should have received a copy of the GNU Lesser General
|
18
|
-
* Public License along with the Processing project; if not,
|
19
|
-
* write to the Free Software Foundation, Inc., 59 Temple Place,
|
20
|
-
* Suite 330, Boston, MA 02111-1307 USA
|
21
|
-
*/
|
22
|
-
|
23
|
-
package processing.dxf;
|
24
|
-
|
25
|
-
import java.io.File;
|
26
|
-
import java.io.IOException;
|
27
|
-
import java.io.FileWriter;
|
28
|
-
import java.io.PrintWriter;
|
29
|
-
import processing.core.PGraphics;
|
30
|
-
|
31
|
-
|
32
|
-
/**
|
33
|
-
* A simple library to write DXF files with Processing.
|
34
|
-
* Because this is used with beginRaw() and endRaw(), only individual
|
35
|
-
* triangles and (discontinuous) line segments will be written to the file.
|
36
|
-
* <p>
|
37
|
-
* Use something like a keyPressed() in PApplet to trigger it,
|
38
|
-
* to avoid writing a bazillion .dxf files.
|
39
|
-
* <p>
|
40
|
-
* Usually, the file will be saved to the sketch's folder.
|
41
|
-
* Use Sketch → Show Sketch Folder to see it from the PDE.
|
42
|
-
* <p>
|
43
|
-
* A simple example of how to use:
|
44
|
-
* <PRE>
|
45
|
-
* import processing.dxf.*;
|
46
|
-
*
|
47
|
-
* boolean record;
|
48
|
-
*
|
49
|
-
* void setup() {
|
50
|
-
* size(500, 500, P3D);
|
51
|
-
* }
|
52
|
-
*
|
53
|
-
* void keyPressed() {
|
54
|
-
* // use a key press so that it doesn't make a million files
|
55
|
-
* if (key == 'r') record = true;
|
56
|
-
* }
|
57
|
-
*
|
58
|
-
* void draw() {
|
59
|
-
* if (record) {
|
60
|
-
* beginRaw(DXF, "output.dxf");
|
61
|
-
* }
|
62
|
-
*
|
63
|
-
* // do all your drawing here
|
64
|
-
*
|
65
|
-
* if (record) {
|
66
|
-
* endRaw();
|
67
|
-
* record = false;
|
68
|
-
* }
|
69
|
-
* }
|
70
|
-
* </PRE>
|
71
|
-
* or to use it and be able to control the current layer:
|
72
|
-
* <PRE>
|
73
|
-
* import processing.dxf.*;
|
74
|
-
*
|
75
|
-
* boolean record;
|
76
|
-
* RawDXF dxf;
|
77
|
-
*
|
78
|
-
* void setup() {
|
79
|
-
* size(500, 500, P3D);
|
80
|
-
* }
|
81
|
-
*
|
82
|
-
* void keyPressed() {
|
83
|
-
* // use a key press so that it doesn't make a million files
|
84
|
-
* if (key == 'r') record = true;
|
85
|
-
* }
|
86
|
-
*
|
87
|
-
* void draw() {
|
88
|
-
* if (record) {
|
89
|
-
* dxf = (RawDXF) createGraphics(width, height, DXF, "output.dxf");
|
90
|
-
* beginRaw(dxf);
|
91
|
-
* }
|
92
|
-
*
|
93
|
-
* // do all your drawing here, and to set the layer, call:
|
94
|
-
* // if (record) {
|
95
|
-
* // dxf.setLayer(num);
|
96
|
-
* // }
|
97
|
-
* // where 'num' is an integer.
|
98
|
-
* // the default is zero, or you can set it to whatever.
|
99
|
-
*
|
100
|
-
* if (record) {
|
101
|
-
* endRaw();
|
102
|
-
* record = false;
|
103
|
-
* dxf = null;
|
104
|
-
* }
|
105
|
-
* }
|
106
|
-
* </PRE>
|
107
|
-
* Note that even though this class is a subclass of PGraphics, it only
|
108
|
-
* implements the parts of the API that are necessary for beginRaw/endRaw.
|
109
|
-
* <p>
|
110
|
-
* Based on the original DXF writer from Simon Greenwold, February 2004.
|
111
|
-
* Updated for Processing 0070 by Ben Fry in September 2004,
|
112
|
-
* and again for Processing beta in April 2005.
|
113
|
-
* Rewritten to support beginRaw/endRaw by Ben Fry in February 2006.
|
114
|
-
* Updated again for inclusion as a core library in March 2006.
|
115
|
-
* Constructor modifications in September 2008 as we approach 1.0.
|
116
|
-
*/
|
117
|
-
public class RawDXF extends PGraphics {
|
118
|
-
|
119
|
-
File file;
|
120
|
-
PrintWriter writer;
|
121
|
-
int currentLayer;
|
122
|
-
|
123
|
-
|
124
|
-
public RawDXF() { }
|
125
|
-
|
126
|
-
@Override
|
127
|
-
public void setPath(String path) {
|
128
|
-
this.path = path;
|
129
|
-
if (path != null) {
|
130
|
-
file = new File(path);
|
131
|
-
if (!file.isAbsolute()) file = null;
|
132
|
-
}
|
133
|
-
if (file == null) {
|
134
|
-
throw new RuntimeException("DXF export requires an absolute path " +
|
135
|
-
"for the location of the output file.");
|
136
|
-
}
|
137
|
-
}
|
138
|
-
|
139
|
-
|
140
|
-
// ..............................................................
|
141
|
-
|
142
|
-
|
143
|
-
protected void allocate() {
|
144
|
-
/*
|
145
|
-
for (int i = 0; i < MAX_TRI_LAYERS; i++) {
|
146
|
-
layerList[i] = NO_LAYER;
|
147
|
-
}
|
148
|
-
*/
|
149
|
-
setLayer(0);
|
150
|
-
}
|
151
|
-
|
152
|
-
|
153
|
-
@Override
|
154
|
-
public void dispose() {
|
155
|
-
writeFooter();
|
156
|
-
|
157
|
-
writer.flush();
|
158
|
-
writer.close();
|
159
|
-
writer = null;
|
160
|
-
}
|
161
|
-
|
162
|
-
@Override
|
163
|
-
public boolean displayable() {
|
164
|
-
return false; // just in case someone wants to use this on its own
|
165
|
-
}
|
166
|
-
|
167
|
-
@Override
|
168
|
-
public boolean is2D() {
|
169
|
-
return false;
|
170
|
-
}
|
171
|
-
|
172
|
-
|
173
|
-
@Override
|
174
|
-
public boolean is3D() {
|
175
|
-
return true;
|
176
|
-
}
|
177
|
-
// ..............................................................
|
178
|
-
|
179
|
-
@Override
|
180
|
-
public void beginDraw() {
|
181
|
-
// have to create file object here, because the name isn't yet
|
182
|
-
// available in allocate()
|
183
|
-
if (writer == null) {
|
184
|
-
try {
|
185
|
-
writer = new PrintWriter(new FileWriter(file));
|
186
|
-
} catch (IOException e) {
|
187
|
-
throw new RuntimeException(e); // java 1.4+
|
188
|
-
}
|
189
|
-
writeHeader();
|
190
|
-
}
|
191
|
-
}
|
192
|
-
|
193
|
-
@Override
|
194
|
-
public void endDraw() {
|
195
|
-
writer.flush();
|
196
|
-
}
|
197
|
-
|
198
|
-
|
199
|
-
// ..............................................................
|
200
|
-
|
201
|
-
|
202
|
-
/**
|
203
|
-
* Set the current layer being used in the DXF file.The default is zero.
|
204
|
-
* @param layer
|
205
|
-
*/
|
206
|
-
public void setLayer(int layer) {
|
207
|
-
currentLayer = layer;
|
208
|
-
}
|
209
|
-
|
210
|
-
|
211
|
-
// ..............................................................
|
212
|
-
|
213
|
-
|
214
|
-
private void writeHeader() {
|
215
|
-
writer.println("0");
|
216
|
-
writer.println("SECTION");
|
217
|
-
writer.println("2");
|
218
|
-
writer.println("ENTITIES");
|
219
|
-
}
|
220
|
-
|
221
|
-
|
222
|
-
private void writeFooter() {
|
223
|
-
writer.println("0");
|
224
|
-
writer.println("ENDSEC");
|
225
|
-
writer.println("0");
|
226
|
-
writer.println("EOF");
|
227
|
-
}
|
228
|
-
|
229
|
-
|
230
|
-
/**
|
231
|
-
* Write a command on one line (as a String), then start a new line
|
232
|
-
* and write out a formatted float.Available for anyone who wants to
|
233
|
-
insert additional commands into the DXF stream.
|
234
|
-
* @param cmd
|
235
|
-
* @param val
|
236
|
-
*/
|
237
|
-
public void write(String cmd, float val) {
|
238
|
-
writer.println(cmd);
|
239
|
-
// Don't number format, will cause trouble on systems that aren't en-US
|
240
|
-
// http://dev.processing.org/bugs/show_bug.cgi?id=495
|
241
|
-
writer.println(val);
|
242
|
-
}
|
243
|
-
|
244
|
-
|
245
|
-
/**
|
246
|
-
* Write a line to the dxf file.Available for anyone who wants to
|
247
|
-
insert additional commands into the DXF stream.
|
248
|
-
* @param what
|
249
|
-
*/
|
250
|
-
public void println(String what) {
|
251
|
-
writer.println(what);
|
252
|
-
}
|
253
|
-
|
254
|
-
|
255
|
-
protected void writeLine(int index1, int index2) {
|
256
|
-
writer.println("0");
|
257
|
-
writer.println("LINE");
|
258
|
-
|
259
|
-
// write out the layer
|
260
|
-
writer.println("8");
|
261
|
-
writer.println(String.valueOf(currentLayer));
|
262
|
-
|
263
|
-
write("10", vertices[index1][X]);
|
264
|
-
write("20", vertices[index1][Y]);
|
265
|
-
write("30", vertices[index1][Z]);
|
266
|
-
|
267
|
-
write("11", vertices[index2][X]);
|
268
|
-
write("21", vertices[index2][Y]);
|
269
|
-
write("31", vertices[index2][Z]);
|
270
|
-
}
|
271
|
-
|
272
|
-
|
273
|
-
/*
|
274
|
-
protected void writeLineStrip() {
|
275
|
-
writeLine();
|
276
|
-
// shift the last vertex to be the first vertex
|
277
|
-
System.arraycopy(vertices[1], 0, vertices[0], 0, vertices[1].length);
|
278
|
-
vertexCount = 1;
|
279
|
-
}
|
280
|
-
*/
|
281
|
-
|
282
|
-
protected void writeTriangle() {
|
283
|
-
writer.println("0");
|
284
|
-
writer.println("3DFACE");
|
285
|
-
|
286
|
-
// write out the layer
|
287
|
-
writer.println("8");
|
288
|
-
/*
|
289
|
-
if (i < MAX_TRI_LAYERS) {
|
290
|
-
if (layerList[i] >= 0) {
|
291
|
-
currentLayer = layerList[i];
|
292
|
-
}
|
293
|
-
}
|
294
|
-
*/
|
295
|
-
writer.println(String.valueOf(currentLayer));
|
296
|
-
|
297
|
-
write("10", vertices[0][X]);
|
298
|
-
write("20", vertices[0][Y]);
|
299
|
-
write("30", vertices[0][Z]);
|
300
|
-
|
301
|
-
write("11", vertices[1][X]);
|
302
|
-
write("21", vertices[1][Y]);
|
303
|
-
write("31", vertices[1][Z]);
|
304
|
-
|
305
|
-
write("12", vertices[2][X]);
|
306
|
-
write("22", vertices[2][Y]);
|
307
|
-
write("32", vertices[2][Z]);
|
308
|
-
|
309
|
-
// Without adding EPSILON, Rhino kinda freaks out.
|
310
|
-
// A face is actually a quad, not a triangle,
|
311
|
-
// so instead kinda fudging the final point here.
|
312
|
-
write("13", vertices[2][X] + EPSILON);
|
313
|
-
write("23", vertices[2][Y] + EPSILON);
|
314
|
-
write("33", vertices[2][Z] + EPSILON);
|
315
|
-
|
316
|
-
vertexCount = 0;
|
317
|
-
}
|
318
|
-
// ..............................................................
|
319
|
-
|
320
|
-
@Override
|
321
|
-
public void beginShape(int kind) {
|
322
|
-
shape = kind;
|
323
|
-
|
324
|
-
if ((shape != LINES) &&
|
325
|
-
(shape != TRIANGLES) &&
|
326
|
-
(shape != POLYGON)) {
|
327
|
-
String err =
|
328
|
-
"RawDXF can only be used with beginRaw(), " +
|
329
|
-
"because it only supports lines and triangles";
|
330
|
-
throw new RuntimeException(err);
|
331
|
-
}
|
332
|
-
|
333
|
-
if ((shape == POLYGON) && fill) {
|
334
|
-
throw new RuntimeException("DXF Export only supports non-filled shapes.");
|
335
|
-
}
|
336
|
-
|
337
|
-
vertexCount = 0;
|
338
|
-
}
|
339
|
-
|
340
|
-
@Override
|
341
|
-
public void vertex(float x, float y) {
|
342
|
-
vertex(x, y, 0);
|
343
|
-
}
|
344
|
-
|
345
|
-
@Override
|
346
|
-
public void vertex(float x, float y, float z) {
|
347
|
-
float vertex[] = vertices[vertexCount];
|
348
|
-
vertex[X] = x; // note: not mx, my, mz like PGraphics3
|
349
|
-
vertex[Y] = y;
|
350
|
-
vertex[Z] = z;
|
351
|
-
|
352
|
-
if (fill) {
|
353
|
-
vertex[R] = fillR;
|
354
|
-
vertex[G] = fillG;
|
355
|
-
vertex[B] = fillB;
|
356
|
-
vertex[A] = fillA;
|
357
|
-
}
|
358
|
-
|
359
|
-
if (stroke) {
|
360
|
-
vertex[SR] = strokeR;
|
361
|
-
vertex[SG] = strokeG;
|
362
|
-
vertex[SB] = strokeB;
|
363
|
-
vertex[SA] = strokeA;
|
364
|
-
vertex[SW] = strokeWeight;
|
365
|
-
}
|
366
|
-
|
367
|
-
if (textureImage != null) { // for the future?
|
368
|
-
vertex[U] = textureU;
|
369
|
-
vertex[V] = textureV;
|
370
|
-
}
|
371
|
-
vertexCount++;
|
372
|
-
|
373
|
-
if ((shape == LINES) && (vertexCount == 2)) {
|
374
|
-
writeLine(0, 1);
|
375
|
-
vertexCount = 0;
|
376
|
-
|
377
|
-
/*
|
378
|
-
} else if ((shape == LINE_STRIP) && (vertexCount == 2)) {
|
379
|
-
writeLineStrip();
|
380
|
-
*/
|
381
|
-
|
382
|
-
} else if ((shape == TRIANGLES) && (vertexCount == 3)) {
|
383
|
-
writeTriangle();
|
384
|
-
}
|
385
|
-
}
|
386
|
-
|
387
|
-
@Override
|
388
|
-
public void endShape(int mode) {
|
389
|
-
if (shape == POLYGON) {
|
390
|
-
for (int i = 0; i < vertexCount - 1; i++) {
|
391
|
-
writeLine(i, i+1);
|
392
|
-
}
|
393
|
-
if (mode == CLOSE) {
|
394
|
-
writeLine(vertexCount - 1, 0);
|
395
|
-
}
|
396
|
-
}
|
397
|
-
/*
|
398
|
-
if ((vertexCount != 0) &&
|
399
|
-
((shape != LINE_STRIP) && (vertexCount != 1))) {
|
400
|
-
System.err.println("Extra vertex boogers found.");
|
401
|
-
}
|
402
|
-
*/
|
403
|
-
}
|
404
|
-
}
|
@@ -1,125 +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 The Processing Foundation
|
7
|
-
|
8
|
-
This library is free software; you can redistribute it and/or
|
9
|
-
modify it under the terms of the GNU Lesser General Public
|
10
|
-
License as published by the Free Software Foundation, version 2.1.
|
11
|
-
|
12
|
-
This library is distributed in the hope that it will be useful,
|
13
|
-
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
14
|
-
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
15
|
-
Lesser General Public License for more details.
|
16
|
-
|
17
|
-
You should have received a copy of the GNU Lesser General
|
18
|
-
Public License along with this library; if not, write to the
|
19
|
-
Free Software Foundation, Inc., 59 Temple Place, Suite 330,
|
20
|
-
Boston, MA 02111-1307 USA
|
21
|
-
*/
|
22
|
-
|
23
|
-
package processing.event;
|
24
|
-
|
25
|
-
|
26
|
-
public class Event {
|
27
|
-
protected Object nativeObject;
|
28
|
-
|
29
|
-
protected long millis;
|
30
|
-
protected int action;
|
31
|
-
|
32
|
-
// These correspond to the java.awt.Event modifiers (not to be confused with
|
33
|
-
// the newer getModifiersEx), though they're not guaranteed to in the future.
|
34
|
-
static public final int SHIFT = 1 << 0;
|
35
|
-
static public final int CTRL = 1 << 1;
|
36
|
-
static public final int META = 1 << 2;
|
37
|
-
static public final int ALT = 1 << 3;
|
38
|
-
protected int modifiers;
|
39
|
-
|
40
|
-
// Types of events. As with all constants in Processing, brevity's preferred.
|
41
|
-
static public final int KEY = 1;
|
42
|
-
static public final int MOUSE = 2;
|
43
|
-
static public final int TOUCH = 3;
|
44
|
-
protected int flavor;
|
45
|
-
|
46
|
-
|
47
|
-
public Event(Object nativeObject, long millis, int action, int modifiers) {
|
48
|
-
this.nativeObject = nativeObject;
|
49
|
-
this.millis = millis;
|
50
|
-
this.action = action;
|
51
|
-
this.modifiers = modifiers;
|
52
|
-
}
|
53
|
-
|
54
|
-
|
55
|
-
public int getFlavor() {
|
56
|
-
return flavor;
|
57
|
-
}
|
58
|
-
|
59
|
-
|
60
|
-
/**
|
61
|
-
* Get the platform-native event object. This might be the java.awt event
|
62
|
-
* on the desktop, though if you're using OpenGL on the desktop it'll be a
|
63
|
-
* NEWT event that JOGL uses. Android events are something else altogether.
|
64
|
-
* Bottom line, use this only if you know what you're doing, and don't make
|
65
|
-
* assumptions about the class type.
|
66
|
-
*/
|
67
|
-
public Object getNative() {
|
68
|
-
return nativeObject;
|
69
|
-
}
|
70
|
-
|
71
|
-
|
72
|
-
// public void setNative(Object nativeObject) {
|
73
|
-
// this.nativeObject = nativeObject;
|
74
|
-
// }
|
75
|
-
|
76
|
-
|
77
|
-
public long getMillis() {
|
78
|
-
return millis;
|
79
|
-
}
|
80
|
-
|
81
|
-
|
82
|
-
// public void setMillis(long millis) {
|
83
|
-
// this.millis = millis;
|
84
|
-
// }
|
85
|
-
|
86
|
-
|
87
|
-
public int getAction() {
|
88
|
-
return action;
|
89
|
-
}
|
90
|
-
|
91
|
-
|
92
|
-
// public void setAction(int action) {
|
93
|
-
// this.action = action;
|
94
|
-
// }
|
95
|
-
|
96
|
-
|
97
|
-
public int getModifiers() {
|
98
|
-
return modifiers;
|
99
|
-
}
|
100
|
-
|
101
|
-
|
102
|
-
// public void setModifiers(int modifiers) {
|
103
|
-
// this.modifiers = modifiers;
|
104
|
-
// }
|
105
|
-
|
106
|
-
|
107
|
-
public boolean isShiftDown() {
|
108
|
-
return (modifiers & SHIFT) != 0;
|
109
|
-
}
|
110
|
-
|
111
|
-
|
112
|
-
public boolean isControlDown() {
|
113
|
-
return (modifiers & CTRL) != 0;
|
114
|
-
}
|
115
|
-
|
116
|
-
|
117
|
-
public boolean isMetaDown() {
|
118
|
-
return (modifiers & META) != 0;
|
119
|
-
}
|
120
|
-
|
121
|
-
|
122
|
-
public boolean isAltDown() {
|
123
|
-
return (modifiers & ALT) != 0;
|
124
|
-
}
|
125
|
-
}
|
@@ -1,70 +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 The Processing Foundation
|
7
|
-
|
8
|
-
This library is free software; you can redistribute it and/or
|
9
|
-
modify it under the terms of the GNU Lesser General Public
|
10
|
-
License as published by the Free Software Foundation, version 2.1.
|
11
|
-
|
12
|
-
This library is distributed in the hope that it will be useful,
|
13
|
-
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
14
|
-
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
15
|
-
Lesser General Public License for more details.
|
16
|
-
|
17
|
-
You should have received a copy of the GNU Lesser General
|
18
|
-
Public License along with this library; if not, write to the
|
19
|
-
Free Software Foundation, Inc., 59 Temple Place, Suite 330,
|
20
|
-
Boston, MA 02111-1307 USA
|
21
|
-
*/
|
22
|
-
|
23
|
-
package processing.event;
|
24
|
-
|
25
|
-
|
26
|
-
public class KeyEvent extends Event {
|
27
|
-
static public final int PRESS = 1;
|
28
|
-
static public final int RELEASE = 2;
|
29
|
-
static public final int TYPE = 3;
|
30
|
-
|
31
|
-
char key;
|
32
|
-
int keyCode;
|
33
|
-
|
34
|
-
boolean isAutoRepeat;
|
35
|
-
|
36
|
-
|
37
|
-
public KeyEvent(Object nativeObject,
|
38
|
-
long millis, int action, int modifiers,
|
39
|
-
char key, int keyCode) {
|
40
|
-
super(nativeObject, millis, action, modifiers);
|
41
|
-
this.flavor = KEY;
|
42
|
-
this.key = key;
|
43
|
-
this.keyCode = keyCode;
|
44
|
-
}
|
45
|
-
|
46
|
-
public KeyEvent(Object nativeObject,
|
47
|
-
long millis, int action, int modifiers,
|
48
|
-
char key, int keyCode, boolean isAutoRepeat) {
|
49
|
-
super(nativeObject, millis, action, modifiers);
|
50
|
-
this.flavor = KEY;
|
51
|
-
this.key = key;
|
52
|
-
this.keyCode = keyCode;
|
53
|
-
this.isAutoRepeat = isAutoRepeat;
|
54
|
-
}
|
55
|
-
|
56
|
-
|
57
|
-
public char getKey() {
|
58
|
-
return key;
|
59
|
-
}
|
60
|
-
|
61
|
-
|
62
|
-
public int getKeyCode() {
|
63
|
-
return keyCode;
|
64
|
-
}
|
65
|
-
|
66
|
-
|
67
|
-
public boolean isAutoRepeat() {
|
68
|
-
return isAutoRepeat;
|
69
|
-
}
|
70
|
-
}
|
@@ -1,114 +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 The Processing Foundation
|
7
|
-
|
8
|
-
This library is free software; you can redistribute it and/or
|
9
|
-
modify it under the terms of the GNU Lesser General Public
|
10
|
-
License as published by the Free Software Foundation, version 2.1.
|
11
|
-
|
12
|
-
This library is distributed in the hope that it will be useful,
|
13
|
-
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
14
|
-
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
15
|
-
Lesser General Public License for more details.
|
16
|
-
|
17
|
-
You should have received a copy of the GNU Lesser General
|
18
|
-
Public License along with this library; if not, write to the
|
19
|
-
Free Software Foundation, Inc., 59 Temple Place, Suite 330,
|
20
|
-
Boston, MA 02111-1307 USA
|
21
|
-
*/
|
22
|
-
|
23
|
-
package processing.event;
|
24
|
-
|
25
|
-
//import processing.core.PConstants;
|
26
|
-
|
27
|
-
|
28
|
-
public class MouseEvent extends Event {
|
29
|
-
static public final int PRESS = 1;
|
30
|
-
static public final int RELEASE = 2;
|
31
|
-
static public final int CLICK = 3;
|
32
|
-
static public final int DRAG = 4;
|
33
|
-
static public final int MOVE = 5;
|
34
|
-
static public final int ENTER = 6;
|
35
|
-
static public final int EXIT = 7;
|
36
|
-
static public final int WHEEL = 8;
|
37
|
-
|
38
|
-
protected int x, y;
|
39
|
-
protected int button;
|
40
|
-
protected int count;
|
41
|
-
|
42
|
-
|
43
|
-
public MouseEvent(Object nativeObject,
|
44
|
-
long millis, int action, int modifiers,
|
45
|
-
int x, int y, int button, int count) {
|
46
|
-
super(nativeObject, millis, action, modifiers);
|
47
|
-
this.flavor = MOUSE;
|
48
|
-
this.x = x;
|
49
|
-
this.y = y;
|
50
|
-
this.button = button;
|
51
|
-
this.count = count;
|
52
|
-
}
|
53
|
-
|
54
|
-
|
55
|
-
public int getX() {
|
56
|
-
return x;
|
57
|
-
}
|
58
|
-
|
59
|
-
|
60
|
-
public int getY() {
|
61
|
-
return y;
|
62
|
-
}
|
63
|
-
|
64
|
-
|
65
|
-
/** Which button was pressed, either LEFT, CENTER, or RIGHT.
|
66
|
-
* @return */
|
67
|
-
public int getButton() {
|
68
|
-
return button;
|
69
|
-
}
|
70
|
-
|
71
|
-
|
72
|
-
/**
|
73
|
-
* Number of clicks for mouse button events, or the number of steps (positive
|
74
|
-
* or negative depending on direction) for a mouse wheel event.Wheel events follow Java (see <a href="http://docs.oracle.com/javase/6/docs/api/java/awt/event/MouseWheelEvent.html#getWheelRotation()">here</a>), so
|
75
|
-
getAmount() will return "negative values if the mouse wheel was rotated
|
76
|
-
up or away from the user" and positive values in the other direction.
|
77
|
-
* On Mac OS X, this will be reversed when "natural" scrolling is enabled
|
78
|
-
in System Preferences &rarr Mouse.
|
79
|
-
* @return
|
80
|
-
*/
|
81
|
-
public int getCount() {
|
82
|
-
return count;
|
83
|
-
}
|
84
|
-
|
85
|
-
|
86
|
-
private String actionString() {
|
87
|
-
switch (action) {
|
88
|
-
default:
|
89
|
-
return "UNKNOWN";
|
90
|
-
case CLICK:
|
91
|
-
return "CLICK";
|
92
|
-
case DRAG:
|
93
|
-
return "DRAG";
|
94
|
-
case ENTER:
|
95
|
-
return "ENTER";
|
96
|
-
case EXIT:
|
97
|
-
return "EXIT";
|
98
|
-
case MOVE:
|
99
|
-
return "MOVE";
|
100
|
-
case PRESS:
|
101
|
-
return "PRESS";
|
102
|
-
case RELEASE:
|
103
|
-
return "RELEASE";
|
104
|
-
case WHEEL:
|
105
|
-
return "WHEEL";
|
106
|
-
}
|
107
|
-
}
|
108
|
-
|
109
|
-
@Override
|
110
|
-
public String toString() {
|
111
|
-
return String.format("<MouseEvent %s@%d,%d count:%d button:%d>",
|
112
|
-
actionString(), x, y, count, button);
|
113
|
-
}
|
114
|
-
}
|