();
- glyphTexinfos = new TextureInfo[font.getGlyphCount()];
- addAllGlyphsToTexture();
- }
-
-
- public boolean addTexture() {
- int w, h;
- boolean resize;
-
- w = maxTexWidth;
- if (-1 < currentTex && textures[currentTex].glHeight < maxTexHeight) {
- // The height of the current texture is less than the maximum, this
- // means we can replace it with a larger texture.
- h = PApplet.min(2 * textures[currentTex].glHeight, maxTexHeight);
- resize = true;
- } else {
- h = PApplet.min(PGraphicsOpenGL.maxTextureSize, PGL.MAX_FONT_TEX_SIZE / 2,
- maxTexHeight / 4);
- resize = false;
- }
-
- Texture tex;
- if (is3D) {
- // Bilinear sampling ensures that the texture doesn't look pixelated
- // either when it is magnified or minified...
- tex = new Texture(parent, w, h,
- new Texture.Parameters(ARGB, Texture.BILINEAR, false));
- } else {
- // ...however, the effect of bilinear sampling is to add some blurriness
- // to the text in its original size. In 2D, we assume that text will be
- // shown at its original size, so linear sampling is chosen instead (which
- // only affects minimized text).
- tex = new Texture(parent, w, h,
- new Texture.Parameters(ARGB, Texture.LINEAR, false));
- }
-
- if (textures == null) {
- textures = new Texture[1];
- textures[0] = tex;
- images = new PImage[1];
- images[0] = pg.wrapTexture(tex);
- currentTex = 0;
- } else if (resize) {
- // Replacing old smaller texture with larger one.
- // But first we must copy the contents of the older
- // texture into the new one.
- Texture tex0 = textures[currentTex];
- tex.put(tex0);
- textures[currentTex] = tex;
-
- pg.setCache(images[currentTex], tex);
- images[currentTex].width = tex.width;
- images[currentTex].height = tex.height;
- } else {
- // Adding new texture to the list.
- Texture[] tempTex = textures;
- textures = new Texture[textures.length + 1];
- PApplet.arrayCopy(tempTex, textures, tempTex.length);
- textures[tempTex.length] = tex;
- currentTex = textures.length - 1;
-
- PImage[] tempImg = images;
- images = new PImage[textures.length];
- PApplet.arrayCopy(tempImg, images, tempImg.length);
- images[tempImg.length] = pg.wrapTexture(tex);
- }
- lastTex = currentTex;
-
- // Make sure that the current texture is bound.
- tex.bind();
-
- return resize;
- }
-
-
- public void begin() {
- setTexture(0);
- }
-
-
- public void end() {
- for (int i = 0; i < textures.length; i++) {
- pgl.disableTexturing(textures[i].glTarget);
- }
- }
-
-
- public void setTexture(int idx) {
- if (0 <= idx && idx < textures.length) {
- currentTex = idx;
- }
- }
-
-
- public PImage getTexture(int idx) {
- if (0 <= idx && idx < images.length) {
- return images[idx];
- }
- return null;
- }
-
-
- public PImage getCurrentTexture() {
- return getTexture(currentTex);
- }
-
-
- // Add all the current glyphs to opengl texture.
- public void addAllGlyphsToTexture() {
- // loop over current glyphs.
- for (int i = 0; i < font.getGlyphCount(); i++) {
- addToTexture(i, font.getGlyph(i));
- }
- }
-
-
- public void updateGlyphsTexCoords() {
- // loop over current glyphs.
- for (int i = 0; i < glyphTexinfos.length; i++) {
- TextureInfo tinfo = glyphTexinfos[i];
- if (tinfo != null && tinfo.texIndex == currentTex) {
- tinfo.updateUV();
- }
- }
- }
-
-
- public TextureInfo getTexInfo(PFont.Glyph glyph) {
- TextureInfo info = texinfoMap.get(glyph);
- return info;
- }
-
-
- public TextureInfo addToTexture(PFont.Glyph glyph) {
- int n = glyphTexinfos.length;
- if (n == 0) {
- glyphTexinfos = new TextureInfo[1];
- }
- addToTexture(n, glyph);
- return glyphTexinfos[n];
- }
-
-
- public boolean contextIsOutdated() {
- boolean outdated = false;
- for (int i = 0; i < textures.length; i++) {
- if (textures[i].contextIsOutdated()) {
- outdated = true;
- }
- }
- if (outdated) {
- for (int i = 0; i < textures.length; i++) {
- pg.removeTextureObject(textures[i].glName, textures[i].context);
- textures[i].glName = 0;
- }
- }
- return outdated;
- }
-
- // Adds this glyph to the opengl texture in PFont.
- protected void addToTexture(int idx, PFont.Glyph glyph) {
- // We add one pixel to avoid issues when sampling the font texture at
- // fractional screen positions. I.e.: the pixel on the screen only contains
- // half of the font rectangle, so it would sample half of the color from the
- // glyph area in the texture, and the other half from the contiguous pixel.
- // If the later contains a portion of the neighbor glyph and the former
- // doesn't, this would result in a shaded pixel when the correct output is
- // blank. This is a consequence of putting all the glyphs in a common
- // texture with bilinear sampling.
- int w = 1 + glyph.width + 1;
- int h = 1 + glyph.height + 1;
-
- // Converting the pixels array from the PImage into a valid RGBA array for
- // OpenGL.
- int[] rgba = new int[w * h];
- int t = 0;
- int p = 0;
- if (PGL.BIG_ENDIAN) {
- java.util.Arrays.fill(rgba, 0, w, 0xFFFFFF00); // Set the first row to blank pixels.
- t = w;
- for (int y = 0; y < glyph.height; y++) {
- rgba[t++] = 0xFFFFFF00; // Set the leftmost pixel in this row as blank
- for (int x = 0; x < glyph.width; x++) {
- rgba[t++] = 0xFFFFFF00 | glyph.image.pixels[p++];
- }
- rgba[t++] = 0xFFFFFF00; // Set the rightmost pixel in this row as blank
- }
- java.util.Arrays.fill(rgba, (h - 1) * w, h * w, 0xFFFFFF00); // Set the last row to blank pixels.
- } else {
- java.util.Arrays.fill(rgba, 0, w, 0x00FFFFFF); // Set the first row to blank pixels.
- t = w;
- for (int y = 0; y < glyph.height; y++) {
- rgba[t++] = 0x00FFFFFF; // Set the leftmost pixel in this row as blank
- for (int x = 0; x < glyph.width; x++) {
- rgba[t++] = (glyph.image.pixels[p++] << 24) | 0x00FFFFFF;
- }
- rgba[t++] = 0x00FFFFFF; // Set the rightmost pixel in this row as blank
- }
- java.util.Arrays.fill(rgba, (h - 1) * w, h * w, 0x00FFFFFF); // Set the last row to blank pixels.
- }
-
- // Is there room for this glyph in the current line?
- if (offsetX + w > textures[currentTex].glWidth) {
- // No room, go to the next line:
- offsetX = 0;
- offsetY += lineHeight;
- lineHeight = 0;
- }
- lineHeight = Math.max(lineHeight, h);
-
- boolean resized = false;
- if (offsetY + lineHeight > textures[currentTex].glHeight) {
- // We run out of space in the current texture, so we add a new texture:
- resized = addTexture();
- if (resized) {
- // Because the current texture has been resized, we need to
- // update the UV coordinates of all the glyphs associated to it:
- updateGlyphsTexCoords();
- } else {
- // A new texture has been created. Reseting texture coordinates
- // and line.
- offsetX = 0;
- offsetY = 0;
- lineHeight = 0;
- }
- }
-
- TextureInfo tinfo = new TextureInfo(currentTex, offsetX, offsetY,
- w, h, rgba);
- offsetX += w;
-
- if (idx == glyphTexinfos.length) {
- TextureInfo[] temp = new TextureInfo[glyphTexinfos.length + 1];
- System.arraycopy(glyphTexinfos, 0, temp, 0, glyphTexinfos.length);
- glyphTexinfos = temp;
- }
-
- glyphTexinfos[idx] = tinfo;
- texinfoMap.put(glyph, tinfo);
- }
-
-
- class TextureInfo {
- int texIndex;
- int width;
- int height;
- int[] crop;
- float u0, u1;
- float v0, v1;
- int[] pixels;
-
- TextureInfo(int tidx, int cropX, int cropY, int cropW, int cropH,
- int[] pix) {
- texIndex = tidx;
- crop = new int[4];
- // The region of the texture corresponding to the glyph is surrounded by a
- // 1-pixel wide border to avoid artifacts due to bilinear sampling. This
- // is why the additions and subtractions to the crop values.
- crop[0] = cropX + 1;
- crop[1] = cropY + 1 + cropH - 2;
- crop[2] = cropW - 2;
- crop[3] = -cropH + 2;
- pixels = pix;
- updateUV();
- updateTex();
- }
-
-
- void updateUV() {
- width = textures[texIndex].glWidth;
- height = textures[texIndex].glHeight;
- u0 = (float)crop[0] / (float)width;
- u1 = u0 + (float)crop[2] / (float)width;
- v0 = (float)(crop[1] + crop[3]) / (float)height;
- v1 = v0 - (float)crop[3] / (float)height;
- }
-
-
- void updateTex() {
- textures[texIndex].setNative(pixels, crop[0] - 1, crop[1] + crop[3] - 1,
- crop[2] + 2, -crop[3] + 2);
- }
- }
-}
\ No newline at end of file
diff --git a/android/core/src/processing/opengl/FrameBuffer.java b/android/core/src/processing/opengl/FrameBuffer.java
deleted file mode 100644
index fb49a171d0..0000000000
--- a/android/core/src/processing/opengl/FrameBuffer.java
+++ /dev/null
@@ -1,542 +0,0 @@
-/* -*- mode: java; c-basic-offset: 2; indent-tabs-mode: nil -*- */
-
-/*
- Part of the Processing project - http://processing.org
-
- Copyright (c) 2011-12 Ben Fry and Casey Reas
-
- This library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Lesser General Public
- License as published by the Free Software Foundation; either
- version 2.1 of the License, or (at your option) any later version.
-
- This library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License for more details.
-
- You should have received a copy of the GNU Lesser General
- Public License along with this library; if not, write to the
- Free Software Foundation, Inc., 59 Temple Place, Suite 330,
- Boston, MA 02111-1307 USA
-*/
-
-package processing.opengl;
-
-import processing.core.PApplet;
-import processing.core.PConstants;
-
-import java.nio.IntBuffer;
-
-/**
- * Encapsulates a Frame Buffer Object for offscreen rendering.
- * When created with onscreen == true, it represents the normal
- * framebuffer. Needed by the stack mechanism in OPENGL2 to return
- * to onscreen rendering after a sequence of pushFramebuffer calls.
- * It transparently handles the situations when the FBO extension is
- * not available.
- *
- * By Andres Colubri.
- */
-
-public class FrameBuffer implements PConstants {
- protected PApplet parent;
- protected PGraphicsOpenGL pg;
- protected PGL pgl;
- protected int context; // The context that created this framebuffer.
-
- public int glFbo;
- public int glDepth;
- public int glStencil;
- public int glDepthStencil;
- public int glMultisample;
- public int width;
- public int height;
-
- protected int depthBits;
- protected int stencilBits;
- protected boolean packedDepthStencil;
-
- protected boolean multisample;
- protected int nsamples;
-
- protected int numColorBuffers;
- protected Texture[] colorBufferTex;
-
- protected boolean screenFb;
- protected boolean noDepth;
-
- protected IntBuffer pixelBuffer;
-
- FrameBuffer(PApplet parent, int w, int h) {
- this(parent, w, h, 1, 1, 0, 0, false, false);
- }
-
- FrameBuffer(PApplet parent, int w, int h, boolean screen) {
- this(parent, w, h, 1, 1, 0, 0, false, screen);
- }
-
- FrameBuffer(PApplet parent) {
- this.parent = parent;
- pg = (PGraphicsOpenGL)parent.g;
- pgl = pg.pgl;
- context = pgl.createEmptyContext();
- }
-
- FrameBuffer(PApplet parent, int w, int h, int samples, int colorBuffers,
- int depthBits, int stencilBits, boolean packedDepthStencil,
- boolean screen) {
- this(parent);
-
- glFbo = 0;
- glDepth = 0;
- glStencil = 0;
- glDepthStencil = 0;
- glMultisample = 0;
-
- if (screen) {
- // If this framebuffer is used to represent a on-screen buffer,
- // then it doesn't make it sense for it to have multisampling,
- // color, depth or stencil buffers.
- depthBits = stencilBits = samples = colorBuffers = 0;
- }
-
- width = w;
- height = h;
-
- if (1 < samples) {
- multisample = true;
- nsamples = samples;
- } else {
- multisample = false;
- nsamples = 1;
- }
-
- numColorBuffers = colorBuffers;
- colorBufferTex = new Texture[numColorBuffers];
- for (int i = 0; i < numColorBuffers; i++) {
- colorBufferTex[i] = null;
- }
-
- if (depthBits < 1 && stencilBits < 1) {
- this.depthBits = 0;
- this.stencilBits = 0;
- this.packedDepthStencil = false;
- } else {
- if (packedDepthStencil) {
- // When combined depth/stencil format is required, the depth and stencil
- // bits are overriden and the 24/8 combination for a 32 bits surface is
- // used.
- this.depthBits = 24;
- this.stencilBits = 8;
- this.packedDepthStencil = true;
- } else {
- this.depthBits = depthBits;
- this.stencilBits = stencilBits;
- this.packedDepthStencil = false;
- }
- }
-
- screenFb = screen;
-
- allocate();
- noDepth = false;
-
- pixelBuffer = null;
- }
-
-
- @Override
- protected void finalize() throws Throwable {
- try {
- if (!screenFb) {
- if (glFbo != 0) {
- pg.finalizeFrameBufferObject(glFbo, context);
- }
- if (glDepth != 0) {
- pg.finalizeRenderBufferObject(glDepth, context);
- }
- if (glStencil != 0) {
- pg.finalizeRenderBufferObject(glStencil, context);
- }
- if (glMultisample != 0) {
- pg.finalizeRenderBufferObject(glMultisample, context);
- }
- if (glDepthStencil != 0) {
- pg.finalizeRenderBufferObject(glDepthStencil, context);
- }
- }
- } finally {
- super.finalize();
- }
- }
-
- public void clear() {
- pg.pushFramebuffer();
- pg.setFramebuffer(this);
- pgl.clearDepth(1);
- pgl.clearStencil(0);
- pgl.clearColor(0, 0, 0, 0);
- pgl.clear(PGL.DEPTH_BUFFER_BIT |
- PGL.STENCIL_BUFFER_BIT |
- PGL.COLOR_BUFFER_BIT);
- pg.popFramebuffer();
- }
-
- public void copy(FrameBuffer dest, FrameBuffer current) {
- pgl.bindFramebuffer(PGL.READ_FRAMEBUFFER, this.glFbo);
- pgl.bindFramebuffer(PGL.DRAW_FRAMEBUFFER, dest.glFbo);
- pgl.blitFramebuffer(0, 0, this.width, this.height,
- 0, 0, dest.width, dest.height,
- PGL.COLOR_BUFFER_BIT, PGL.NEAREST);
- pgl.bindFramebuffer(PGL.READ_FRAMEBUFFER, current.glFbo);
- pgl.bindFramebuffer(PGL.DRAW_FRAMEBUFFER, current.glFbo);
- }
-
- public void bind() {
- pgl.bindFramebuffer(PGL.FRAMEBUFFER, glFbo);
- }
-
- public void disableDepthTest() {
- noDepth = true;
- }
-
- public void finish() {
- if (noDepth) {
- // No need to clear depth buffer because depth testing was disabled.
- if (pg.getHint(ENABLE_DEPTH_TEST)) {
- pgl.enable(PGL.DEPTH_TEST);
- } else {
- pgl.disable(PGL.DEPTH_TEST);
- }
- }
- }
-
- public void readPixels() {
- if (pixelBuffer == null) createPixelBuffer();
- pixelBuffer.rewind();
- pgl.readPixels(0, 0, width, height, PGL.RGBA, PGL.UNSIGNED_BYTE,
- pixelBuffer);
- }
-
- public void getPixels(int[] pixels) {
- if (pixelBuffer != null) {
- pixelBuffer.get(pixels, 0, pixels.length);
- pixelBuffer.rewind();
- }
- }
-
- public IntBuffer getPixelBuffer() {
- return pixelBuffer;
- }
-
- public boolean hasDepthBuffer() {
- return 0 < depthBits;
- }
-
- public boolean hasStencilBuffer() {
- return 0 < stencilBits;
- }
-
- public void setFBO(int id) {
- if (screenFb) {
- glFbo = id;
- }
- }
-
- ///////////////////////////////////////////////////////////
-
- // Color buffer setters.
-
-
- public void setColorBuffer(Texture tex) {
- setColorBuffers(new Texture[] { tex }, 1);
- }
-
-
- public void setColorBuffers(Texture[] textures) {
- setColorBuffers(textures, textures.length);
- }
-
-
- public void setColorBuffers(Texture[] textures, int n) {
- if (screenFb) return;
-
- if (numColorBuffers != PApplet.min(n, textures.length)) {
- throw new RuntimeException("Wrong number of textures to set the color " +
- "buffers.");
- }
-
- for (int i = 0; i < numColorBuffers; i++) {
- colorBufferTex[i] = textures[i];
- }
-
- pg.pushFramebuffer();
- pg.setFramebuffer(this);
-
- // Making sure nothing is attached.
- for (int i = 0; i < numColorBuffers; i++) {
- pgl.framebufferTexture2D(PGL.FRAMEBUFFER, PGL.COLOR_ATTACHMENT0 + i,
- PGL.TEXTURE_2D, 0, 0);
- }
-
- for (int i = 0; i < numColorBuffers; i++) {
- pgl.framebufferTexture2D(PGL.FRAMEBUFFER, PGL.COLOR_ATTACHMENT0 + i,
- colorBufferTex[i].glTarget,
- colorBufferTex[i].glName, 0);
- }
-
- pgl.validateFramebuffer();
-
- pg.popFramebuffer();
- }
-
-
- public void swapColorBuffers() {
- for (int i = 0; i < numColorBuffers - 1; i++) {
- int i1 = (i + 1);
- Texture tmp = colorBufferTex[i];
- colorBufferTex[i] = colorBufferTex[i1];
- colorBufferTex[i1] = tmp;
- }
-
- pg.pushFramebuffer();
- pg.setFramebuffer(this);
- for (int i = 0; i < numColorBuffers; i++) {
- pgl.framebufferTexture2D(PGL.FRAMEBUFFER, PGL.COLOR_ATTACHMENT0 + i,
- colorBufferTex[i].glTarget,
- colorBufferTex[i].glName, 0);
- }
- pgl.validateFramebuffer();
-
- pg.popFramebuffer();
- }
-
-
- public int getDefaultReadBuffer() {
- if (screenFb) {
- return pgl.getDefaultReadBuffer();
- } else {
- return PGL.COLOR_ATTACHMENT0;
- }
- }
-
-
- public int getDefaultDrawBuffer() {
- if (screenFb) {
- return pgl.getDefaultDrawBuffer();
- } else {
- return PGL.COLOR_ATTACHMENT0;
- }
- }
-
-
- ///////////////////////////////////////////////////////////
-
- // Allocate/release framebuffer.
-
-
- protected void allocate() {
- release(); // Just in the case this object is being re-allocated.
-
- context = pgl.getCurrentContext();
-
- if (screenFb) {
- glFbo = 0;
- } else {
- //create the FBO object...
- glFbo = pg.createFrameBufferObject(context);
-
- // ... and then create the rest of the stuff.
- if (multisample) {
- createColorBufferMultisample();
- }
-
- if (packedDepthStencil) {
- createPackedDepthStencilBuffer();
- } else {
- if (0 < depthBits) {
- createDepthBuffer();
- }
- if (0 < stencilBits) {
- createStencilBuffer();
- }
- }
- }
- }
-
-
- protected void release() {
- if (screenFb) return;
-
- if (glFbo != 0) {
- pg.finalizeFrameBufferObject(glFbo, context);
- glFbo = 0;
- }
- if (glDepth != 0) {
- pg.finalizeRenderBufferObject(glDepth, context);
- glDepth = 0;
- }
- if (glStencil != 0) {
- pg.finalizeRenderBufferObject(glStencil, context);
- glStencil = 0;
- }
- if (glMultisample != 0) {
- pg.finalizeRenderBufferObject(glMultisample, context);
- glMultisample = 0;
- }
- if (glDepthStencil != 0) {
- pg.finalizeRenderBufferObject(glDepthStencil, context);
- glDepthStencil = 0;
- }
- }
-
-
- protected boolean contextIsOutdated() {
- if (screenFb) return false;
-
- boolean outdated = !pgl.contextIsCurrent(context);
- if (outdated) {
- pg.removeFrameBufferObject(glFbo, context);
- pg.removeRenderBufferObject(glDepth, context);
- pg.removeRenderBufferObject(glStencil, context);
- pg.removeRenderBufferObject(glDepthStencil, context);
- pg.removeRenderBufferObject(glMultisample, context);
-
- glFbo = 0;
- glDepth = 0;
- glStencil = 0;
- glDepthStencil = 0;
- glMultisample = 0;
-
- for (int i = 0; i < numColorBuffers; i++) {
- colorBufferTex[i] = null;
- }
- }
- return outdated;
- }
-
-
- protected void createColorBufferMultisample() {
- if (screenFb) return;
-
- pg.pushFramebuffer();
- pg.setFramebuffer(this);
-
- glMultisample = pg.createRenderBufferObject(context);
- pgl.bindRenderbuffer(PGL.RENDERBUFFER, glMultisample);
- pgl.renderbufferStorageMultisample(PGL.RENDERBUFFER, nsamples,
- PGL.RGBA8, width, height);
- pgl.framebufferRenderbuffer(PGL.FRAMEBUFFER, PGL.COLOR_ATTACHMENT0,
- PGL.RENDERBUFFER, glMultisample);
-
- pg.popFramebuffer();
- }
-
-
- protected void createPackedDepthStencilBuffer() {
- if (screenFb) return;
-
- if (width == 0 || height == 0) {
- throw new RuntimeException("PFramebuffer: size undefined.");
- }
-
- pg.pushFramebuffer();
- pg.setFramebuffer(this);
-
- glDepthStencil = pg.createRenderBufferObject(context);
- pgl.bindRenderbuffer(PGL.RENDERBUFFER, glDepthStencil);
-
- if (multisample) {
- pgl.renderbufferStorageMultisample(PGL.RENDERBUFFER, nsamples,
- PGL.DEPTH24_STENCIL8, width, height);
- } else {
- pgl.renderbufferStorage(PGL.RENDERBUFFER, PGL.DEPTH24_STENCIL8,
- width, height);
- }
-
- pgl.framebufferRenderbuffer(PGL.FRAMEBUFFER, PGL.DEPTH_ATTACHMENT,
- PGL.RENDERBUFFER, glDepthStencil);
- pgl.framebufferRenderbuffer(PGL.FRAMEBUFFER, PGL.STENCIL_ATTACHMENT,
- PGL.RENDERBUFFER, glDepthStencil);
-
- pg.popFramebuffer();
- }
-
-
- protected void createDepthBuffer() {
- if (screenFb) return;
-
- if (width == 0 || height == 0) {
- throw new RuntimeException("PFramebuffer: size undefined.");
- }
-
- pg.pushFramebuffer();
- pg.setFramebuffer(this);
-
- glDepth = pg.createRenderBufferObject(context);
- pgl.bindRenderbuffer(PGL.RENDERBUFFER, glDepth);
-
- int glConst = PGL.DEPTH_COMPONENT16;
- if (depthBits == 16) {
- glConst = PGL.DEPTH_COMPONENT16;
- } else if (depthBits == 24) {
- glConst = PGL.DEPTH_COMPONENT24;
- } else if (depthBits == 32) {
- glConst = PGL.DEPTH_COMPONENT32;
- }
-
- if (multisample) {
- pgl.renderbufferStorageMultisample(PGL.RENDERBUFFER, nsamples, glConst,
- width, height);
- } else {
- pgl.renderbufferStorage(PGL.RENDERBUFFER, glConst, width, height);
- }
-
- pgl.framebufferRenderbuffer(PGL.FRAMEBUFFER, PGL.DEPTH_ATTACHMENT,
- PGL.RENDERBUFFER, glDepth);
-
- pg.popFramebuffer();
- }
-
-
- protected void createStencilBuffer() {
- if (screenFb) return;
-
- if (width == 0 || height == 0) {
- throw new RuntimeException("PFramebuffer: size undefined.");
- }
-
- pg.pushFramebuffer();
- pg.setFramebuffer(this);
-
- glStencil = pg.createRenderBufferObject(context);
- pgl.bindRenderbuffer(PGL.RENDERBUFFER, glStencil);
-
- int glConst = PGL.STENCIL_INDEX1;
- if (stencilBits == 1) {
- glConst = PGL.STENCIL_INDEX1;
- } else if (stencilBits == 4) {
- glConst = PGL.STENCIL_INDEX4;
- } else if (stencilBits == 8) {
- glConst = PGL.STENCIL_INDEX8;
- }
- if (multisample) {
- pgl.renderbufferStorageMultisample(PGL.RENDERBUFFER, nsamples, glConst,
- width, height);
- } else {
- pgl.renderbufferStorage(PGL.RENDERBUFFER, glConst, width, height);
- }
-
- pgl.framebufferRenderbuffer(PGL.FRAMEBUFFER, PGL.STENCIL_ATTACHMENT,
- PGL.RENDERBUFFER, glStencil);
-
- pg.popFramebuffer();
- }
-
-
- protected void createPixelBuffer() {
- pixelBuffer = IntBuffer.allocate(width * height);
- pixelBuffer.rewind();
- }
-}
diff --git a/android/core/src/processing/opengl/LightVert.glsl b/android/core/src/processing/opengl/LightVert.glsl
deleted file mode 100644
index 6e5829fe27..0000000000
--- a/android/core/src/processing/opengl/LightVert.glsl
+++ /dev/null
@@ -1,141 +0,0 @@
-/*
- Part of the Processing project - http://processing.org
-
- Copyright (c) 2011-13 Ben Fry and Casey Reas
-
- This library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Lesser General Public
- License version 2.1 as published by the Free Software Foundation.
-
- This library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License for more details.
-
- You should have received a copy of the GNU Lesser General
- Public License along with this library; if not, write to the
- Free Software Foundation, Inc., 59 Temple Place, Suite 330,
- Boston, MA 02111-1307 USA
- */
-
-#define PROCESSING_LIGHT_SHADER
-
-uniform mat4 modelview;
-uniform mat4 transform;
-uniform mat3 normalMatrix;
-
-uniform int lightCount;
-uniform vec4 lightPosition[8];
-uniform vec3 lightNormal[8];
-uniform vec3 lightAmbient[8];
-uniform vec3 lightDiffuse[8];
-uniform vec3 lightSpecular[8];
-uniform vec3 lightFalloff[8];
-uniform vec2 lightSpot[8];
-
-attribute vec4 vertex;
-attribute vec4 color;
-attribute vec3 normal;
-
-attribute vec4 ambient;
-attribute vec4 specular;
-attribute vec4 emissive;
-attribute float shininess;
-
-varying vec4 vertColor;
-
-const float zero_float = 0.0;
-const float one_float = 1.0;
-const vec3 zero_vec3 = vec3(0);
-
-float falloffFactor(vec3 lightPos, vec3 vertPos, vec3 coeff) {
- vec3 lpv = lightPos - vertPos;
- vec3 dist = vec3(one_float);
- dist.z = dot(lpv, lpv);
- dist.y = sqrt(dist.z);
- return one_float / dot(dist, coeff);
-}
-
-float spotFactor(vec3 lightPos, vec3 vertPos, vec3 lightNorm, float minCos, float spotExp) {
- vec3 lpv = normalize(lightPos - vertPos);
- vec3 nln = -one_float * lightNorm;
- float spotCos = dot(nln, lpv);
- return spotCos <= minCos ? zero_float : pow(spotCos, spotExp);
-}
-
-float lambertFactor(vec3 lightDir, vec3 vecNormal) {
- return max(zero_float, dot(lightDir, vecNormal));
-}
-
-float blinnPhongFactor(vec3 lightDir, vec3 vertPos, vec3 vecNormal, float shine) {
- vec3 np = normalize(vertPos);
- vec3 ldp = normalize(lightDir - np);
- return pow(max(zero_float, dot(ldp, vecNormal)), shine);
-}
-
-void main() {
- // Vertex in clip coordinates
- gl_Position = transform * vertex;
-
- // Vertex in eye coordinates
- vec3 ecVertex = vec3(modelview * vertex);
-
- // Normal vector in eye coordinates
- vec3 ecNormal = normalize(normalMatrix * normal);
-
- if (dot(-one_float * ecVertex, ecNormal) < zero_float) {
- // If normal is away from camera, choose its opposite.
- // If we add backface culling, this will be backfacing
- ecNormal *= -one_float;
- }
-
- // Light calculations
- vec3 totalAmbient = vec3(0, 0, 0);
- vec3 totalDiffuse = vec3(0, 0, 0);
- vec3 totalSpecular = vec3(0, 0, 0);
- for (int i = 0; i < 8; i++) {
- if (lightCount == i) break;
-
- vec3 lightPos = lightPosition[i].xyz;
- bool isDir = zero_float < lightPosition[i].w;
- float spotCos = lightSpot[i].x;
- float spotExp = lightSpot[i].y;
-
- vec3 lightDir;
- float falloff;
- float spotf;
-
- if (isDir) {
- falloff = one_float;
- lightDir = -one_float * lightNormal[i];
- } else {
- falloff = falloffFactor(lightPos, ecVertex, lightFalloff[i]);
- lightDir = normalize(lightPos - ecVertex);
- }
-
- spotf = spotExp > zero_float ? spotFactor(lightPos, ecVertex, lightNormal[i],
- spotCos, spotExp)
- : one_float;
-
- if (any(greaterThan(lightAmbient[i], zero_vec3))) {
- totalAmbient += lightAmbient[i] * falloff;
- }
-
- if (any(greaterThan(lightDiffuse[i], zero_vec3))) {
- totalDiffuse += lightDiffuse[i] * falloff * spotf *
- lambertFactor(lightDir, ecNormal);
- }
-
- if (any(greaterThan(lightSpecular[i], zero_vec3))) {
- totalSpecular += lightSpecular[i] * falloff * spotf *
- blinnPhongFactor(lightDir, ecVertex, ecNormal, shininess);
- }
- }
-
- // Calculating final color as result of all lights (plus emissive term).
- // Transparency is determined exclusively by the diffuse component.
- vertColor = vec4(totalAmbient, 0) * ambient +
- vec4(totalDiffuse, 1) * color +
- vec4(totalSpecular, 0) * specular +
- vec4(emissive.rgb, 0);
-}
\ No newline at end of file
diff --git a/android/core/src/processing/opengl/LineFrag.glsl b/android/core/src/processing/opengl/LineFrag.glsl
deleted file mode 100644
index dc08a3fa20..0000000000
--- a/android/core/src/processing/opengl/LineFrag.glsl
+++ /dev/null
@@ -1,30 +0,0 @@
-/*
- Part of the Processing project - http://processing.org
-
- Copyright (c) 2011-13 Ben Fry and Casey Reas
-
- This library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Lesser General Public
- License version 2.1 as published by the Free Software Foundation.
-
- This library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License for more details.
-
- You should have received a copy of the GNU Lesser General
- Public License along with this library; if not, write to the
- Free Software Foundation, Inc., 59 Temple Place, Suite 330,
- Boston, MA 02111-1307 USA
- */
-
-#ifdef GL_ES
-precision mediump float;
-precision mediump int;
-#endif
-
-varying vec4 vertColor;
-
-void main() {
- gl_FragColor = vertColor;
-}
\ No newline at end of file
diff --git a/android/core/src/processing/opengl/LinePath.java b/android/core/src/processing/opengl/LinePath.java
deleted file mode 100644
index 49d8538129..0000000000
--- a/android/core/src/processing/opengl/LinePath.java
+++ /dev/null
@@ -1,568 +0,0 @@
-/* -*- mode: java; c-basic-offset: 2; indent-tabs-mode: nil -*- */
-
-/*
- * Copyright 2006 Sun Microsystems, Inc. All Rights Reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation. Sun designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Sun in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
- * CA 95054 USA or visit www.sun.com if you need additional information or
- * have any questions.
- */
-
-package processing.opengl;
-
-import processing.core.PMatrix2D;
-
-/**
- * The {@code LinePath} class allows to represent polygonal paths,
- * potentially composed by several disjoint polygonal segments.
- * It can be iterated by the {@link PathIterator} class including all
- * of its segment types and winding rules
- *
- */
-public class LinePath {
- /**
- * The winding rule constant for specifying an even-odd rule
- * for determining the interior of a path.
- * The even-odd rule specifies that a point lies inside the
- * path if a ray drawn in any direction from that point to
- * infinity is crossed by path segments an odd number of times.
- */
- public static final int WIND_EVEN_ODD = 0;
-
- /**
- * The winding rule constant for specifying a non-zero rule
- * for determining the interior of a path.
- * The non-zero rule specifies that a point lies inside the
- * path if a ray drawn in any direction from that point to
- * infinity is crossed by path segments a different number
- * of times in the counter-clockwise direction than the
- * clockwise direction.
- */
- public static final int WIND_NON_ZERO = 1;
-
- /**
- * Starts segment at a given position.
- */
- public static final byte SEG_MOVETO = 0;
-
- /**
- * Extends segment by adding a line to a given position.
- */
- public static final byte SEG_LINETO = 1;
-
- /**
- * Closes segment at current position.
- */
- public static final byte SEG_CLOSE = 2;
-
- /**
- * Joins path segments by extending their outside edges until they meet.
- */
- public final static int JOIN_MITER = 0;
-
- /**
- * Joins path segments by rounding off the corner at a radius of half the line
- * width.
- */
- public final static int JOIN_ROUND = 1;
-
- /**
- * Joins path segments by connecting the outer corners of their wide outlines
- * with a straight segment.
- */
- public final static int JOIN_BEVEL = 2;
-
- /**
- * Ends unclosed subpaths and dash segments with no added decoration.
- */
- public final static int CAP_BUTT = 0;
-
- /**
- * Ends unclosed subpaths and dash segments with a round decoration that has a
- * radius equal to half of the width of the pen.
- */
- public final static int CAP_ROUND = 1;
-
- /**
- * Ends unclosed subpaths and dash segments with a square projection that
- * extends beyond the end of the segment to a distance equal to half of the
- * line width.
- */
- public final static int CAP_SQUARE = 2;
-
- private static PMatrix2D identity = new PMatrix2D();
-
- private static float defaultMiterlimit = 10.0f;
-
- static final int INIT_SIZE = 20;
-
- static final int EXPAND_MAX = 500;
-
- protected byte[] pointTypes;
-
- protected float[] floatCoords;
-
- protected int numTypes;
-
- protected int numCoords;
-
- protected int windingRule;
-
-
- /**
- * Constructs a new empty single precision {@code LinePath} object with a
- * default winding rule of {@link #WIND_NON_ZERO}.
- */
- public LinePath() {
- this(WIND_NON_ZERO, INIT_SIZE);
- }
-
-
- /**
- * Constructs a new empty single precision {@code LinePath} object with the
- * specified winding rule to control operations that require the interior of
- * the path to be defined.
- *
- * @param rule
- * the winding rule
- * @see #WIND_EVEN_ODD
- * @see #WIND_NON_ZERO
- */
- public LinePath(int rule) {
- this(rule, INIT_SIZE);
- }
-
-
- /**
- * Constructs a new {@code LinePath} object from the given specified initial
- * values. This method is only intended for internal use and should not be
- * made public if the other constructors for this class are ever exposed.
- *
- * @param rule
- * the winding rule
- * @param initialTypes
- * the size to make the initial array to store the path segment types
- */
- public LinePath(int rule, int initialCapacity) {
- setWindingRule(rule);
- this.pointTypes = new byte[initialCapacity];
- floatCoords = new float[initialCapacity * 2];
- }
-
-
- void needRoom(boolean needMove, int newCoords) {
- if (needMove && numTypes == 0) {
- throw new RuntimeException("missing initial moveto "
- + "in path definition");
- }
- int size = pointTypes.length;
- if (numTypes >= size) {
- int grow = size;
- if (grow > EXPAND_MAX) {
- grow = EXPAND_MAX;
- }
- pointTypes = copyOf(pointTypes, size + grow);
- }
- size = floatCoords.length;
- if (numCoords + newCoords > size) {
- int grow = size;
- if (grow > EXPAND_MAX * 2) {
- grow = EXPAND_MAX * 2;
- }
- if (grow < newCoords) {
- grow = newCoords;
- }
- floatCoords = copyOf(floatCoords, size + grow);
- }
- }
-
-
- /**
- * Adds a point to the path by moving to the specified coordinates specified
- * in float precision.
- *
- * This method provides a single precision variant of the double precision
- * {@code moveTo()} method on the base {@code LinePath} class.
- *
- * @param x
- * the specified X coordinate
- * @param y
- * the specified Y coordinate
- * @see LinePath#moveTo
- */
- public final void moveTo(float x, float y) {
- if (numTypes > 0 && pointTypes[numTypes - 1] == SEG_MOVETO) {
- floatCoords[numCoords - 2] = x;
- floatCoords[numCoords - 1] = y;
- } else {
- needRoom(false, 2);
- pointTypes[numTypes++] = SEG_MOVETO;
- floatCoords[numCoords++] = x;
- floatCoords[numCoords++] = y;
- }
- }
-
-
- /**
- * Adds a point to the path by drawing a straight line from the current
- * coordinates to the new specified coordinates specified in float precision.
- *
- * This method provides a single precision variant of the double precision
- * {@code lineTo()} method on the base {@code LinePath} class.
- *
- * @param x
- * the specified X coordinate
- * @param y
- * the specified Y coordinate
- * @see LinePath#lineTo
- */
- public final void lineTo(float x, float y) {
- needRoom(true, 2);
- pointTypes[numTypes++] = SEG_LINETO;
- floatCoords[numCoords++] = x;
- floatCoords[numCoords++] = y;
- }
-
-
- /**
- * The iterator for this class is not multi-threaded safe, which means that
- * the {@code LinePath} class does not guarantee that modifications to the
- * geometry of this {@code LinePath} object do not affect any iterations of that
- * geometry that are already in process.
- */
- public PathIterator getPathIterator() {
- return new PathIterator(this);
- }
-
-
- /**
- * Closes the current subpath by drawing a straight line back to the
- * coordinates of the last {@code moveTo}. If the path is already closed then
- * this method has no effect.
- */
- public final void closePath() {
- if (numTypes == 0 || pointTypes[numTypes - 1] != SEG_CLOSE) {
- needRoom(false, 0);
- pointTypes[numTypes++] = SEG_CLOSE;
- }
- }
-
-
- /**
- * Returns the fill style winding rule.
- *
- * @return an integer representing the current winding rule.
- * @see #WIND_EVEN_ODD
- * @see #WIND_NON_ZERO
- * @see #setWindingRule
- */
- public final int getWindingRule() {
- return windingRule;
- }
-
-
- /**
- * Sets the winding rule for this path to the specified value.
- *
- * @param rule
- * an integer representing the specified winding rule
- * @exception IllegalArgumentException
- * if {@code rule} is not either {@link #WIND_EVEN_ODD} or
- * {@link #WIND_NON_ZERO}
- * @see #getWindingRule
- */
- public final void setWindingRule(int rule) {
- if (rule != WIND_EVEN_ODD && rule != WIND_NON_ZERO) {
- throw new IllegalArgumentException("winding rule must be "
- + "WIND_EVEN_ODD or " + "WIND_NON_ZERO");
- }
- windingRule = rule;
- }
-
-
- /**
- * Resets the path to empty. The append position is set back to the beginning
- * of the path and all coordinates and point types are forgotten.
- */
- public final void reset() {
- numTypes = numCoords = 0;
- }
-
-
- static public class PathIterator {
- float floatCoords[];
-
- int typeIdx;
-
- int pointIdx;
-
- LinePath path;
-
- static final int curvecoords[] = { 2, 2, 0 };
-
- PathIterator(LinePath p2df) {
- this.path = p2df;
- this.floatCoords = p2df.floatCoords;
- }
-
- public int currentSegment(float[] coords) {
- int type = path.pointTypes[typeIdx];
- int numCoords = curvecoords[type];
- if (numCoords > 0) {
- System.arraycopy(floatCoords, pointIdx, coords, 0, numCoords);
- }
- return type;
- }
-
- public int currentSegment(double[] coords) {
- int type = path.pointTypes[typeIdx];
- int numCoords = curvecoords[type];
- if (numCoords > 0) {
- for (int i = 0; i < numCoords; i++) {
- coords[i] = floatCoords[pointIdx + i];
- }
- }
- return type;
- }
-
- public int getWindingRule() {
- return path.getWindingRule();
- }
-
- public boolean isDone() {
- return (typeIdx >= path.numTypes);
- }
-
- public void next() {
- int type = path.pointTypes[typeIdx++];
- pointIdx += curvecoords[type];
- }
- }
-
-
- /////////////////////////////////////////////////////////////////////////////
- //
- // Stroked path methods
-
-
- static public LinePath createStrokedPath(LinePath src, float weight,
- int caps, int join) {
- return createStrokedPath(src, weight, caps, join, defaultMiterlimit, null);
- }
-
-
- static public LinePath createStrokedPath(LinePath src, float weight,
- int caps, int join, float miterlimit) {
- return createStrokedPath(src, weight, caps, join, miterlimit, null);
- }
-
-
- /**
- * Constructs a solid LinePath with the specified attributes.
- *
- * @param src
- * the original path to be stroked
- * @param weight
- * the weight of the stroked path
- * @param cap
- * the decoration of the ends of the segments in the path
- * @param join
- * the decoration applied where path segments meet
- * @param miterlimit
- * @param transform
- *
- */
- static public LinePath createStrokedPath(LinePath src, float weight,
- int caps, int join,
- float miterlimit, PMatrix2D transform) {
- final LinePath dest = new LinePath();
-
- strokeTo(src, weight, caps, join, miterlimit, transform, new LineStroker() {
- @Override
- public void moveTo(int x0, int y0) {
- dest.moveTo(S15_16ToFloat(x0), S15_16ToFloat(y0));
- }
-
- @Override
- public void lineJoin() {
- }
-
- @Override
- public void lineTo(int x1, int y1) {
- dest.lineTo(S15_16ToFloat(x1), S15_16ToFloat(y1));
- }
-
- @Override
- public void close() {
- dest.closePath();
- }
-
- @Override
- public void end() {
- }
- });
-
- return dest;
- }
-
-
- private static void strokeTo(LinePath src, float width, int caps, int join,
- float miterlimit, PMatrix2D transform,
- LineStroker lsink) {
- lsink = new LineStroker(lsink, FloatToS15_16(width), caps, join,
- FloatToS15_16(miterlimit),
- transform == null ? identity : transform);
-
- PathIterator pi = src.getPathIterator();
- pathTo(pi, lsink);
- }
-
-
- private static void pathTo(PathIterator pi, LineStroker lsink) {
- float coords[] = new float[2];
- while (!pi.isDone()) {
- switch (pi.currentSegment(coords)) {
- case SEG_MOVETO:
- lsink.moveTo(FloatToS15_16(coords[0]), FloatToS15_16(coords[1]));
- break;
- case SEG_LINETO:
- lsink.lineJoin();
- lsink.lineTo(FloatToS15_16(coords[0]), FloatToS15_16(coords[1]));
- break;
- case SEG_CLOSE:
- lsink.lineJoin();
- lsink.close();
- break;
- default:
- throw new InternalError("unknown flattened segment type");
- }
- pi.next();
- }
- lsink.end();
- }
-
-
- /////////////////////////////////////////////////////////////////////////////
- //
- // Utility methods
-
-
- public static float[] copyOf(float[] source, int length) {
- float[] target = new float[length];
- for (int i = 0; i < target.length; i++) {
- if (i > source.length - 1)
- target[i] = 0f;
- else
- target[i] = source[i];
- }
- return target;
- }
-
-
- public static byte[] copyOf(byte[] source, int length) {
- byte[] target = new byte[length];
- for (int i = 0; i < target.length; i++) {
- if (i > source.length - 1)
- target[i] = 0;
- else
- target[i] = source[i];
- }
- return target;
- }
-
-
- // From Ken Turkowski, _Fixed-Point Square Root_, In Graphics Gems V
- public static int isqrt(int x) {
- int fracbits = 16;
-
- int root = 0;
- int remHi = 0;
- int remLo = x;
- int count = 15 + fracbits / 2;
-
- do {
- remHi = (remHi << 2) | (remLo >>> 30); // N.B. - unsigned shift R
- remLo <<= 2;
- root <<= 1;
- int testdiv = (root << 1) + 1;
- if (remHi >= testdiv) {
- remHi -= testdiv;
- root++;
- }
- } while (count-- != 0);
-
- return root;
- }
-
-
- public static long lsqrt(long x) {
- int fracbits = 16;
-
- long root = 0;
- long remHi = 0;
- long remLo = x;
- int count = 31 + fracbits / 2;
-
- do {
- remHi = (remHi << 2) | (remLo >>> 62); // N.B. - unsigned shift R
- remLo <<= 2;
- root <<= 1;
- long testDiv = (root << 1) + 1;
- if (remHi >= testDiv) {
- remHi -= testDiv;
- root++;
- }
- } while (count-- != 0);
-
- return root;
- }
-
-
- public static double hypot(double x, double y) {
- return Math.sqrt(x * x + y * y);
- }
-
-
- public static int hypot(int x, int y) {
- return (int) ((lsqrt((long) x * x + (long) y * y) + 128) >> 8);
- }
-
-
- public static long hypot(long x, long y) {
- return (lsqrt(x * x + y * y) + 128) >> 8;
- }
-
-
- static int FloatToS15_16(float flt) {
- flt = flt * 65536f + 0.5f;
- if (flt <= -(65536f * 65536f)) {
- return Integer.MIN_VALUE;
- } else if (flt >= (65536f * 65536f)) {
- return Integer.MAX_VALUE;
- } else {
- return (int) Math.floor(flt);
- }
- }
-
-
- static float S15_16ToFloat(int fix) {
- return (fix / 65536f);
- }
-}
diff --git a/android/core/src/processing/opengl/LineStroker.java b/android/core/src/processing/opengl/LineStroker.java
deleted file mode 100644
index 3e770e9bb9..0000000000
--- a/android/core/src/processing/opengl/LineStroker.java
+++ /dev/null
@@ -1,697 +0,0 @@
-/* -*- mode: java; c-basic-offset: 2; indent-tabs-mode: nil -*- */
-
-/*
- * Copyright (c) 2007, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation. Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-package processing.opengl;
-
-import processing.core.PMatrix2D;
-
-public class LineStroker {
- private LineStroker output;
-// private int lineWidth;
- private int capStyle;
- private int joinStyle;
-// private int miterLimit;
- private int m00, m01;
- private int m10, m11;
- private int lineWidth2;
- private long scaledLineWidth2;
-
- // For any pen offset (pen_dx, pen_dy) that does not depend on
- // the line orientation, the pen should be transformed so that:
- //
- // pen_dx' = m00*pen_dx + m01*pen_dy
- // pen_dy' = m10*pen_dx + m11*pen_dy
- //
- // For a round pen, this means:
- //
- // pen_dx(r, theta) = r*cos(theta)
- // pen_dy(r, theta) = r*sin(theta)
- //
- // pen_dx'(r, theta) = r*(m00*cos(theta) + m01*sin(theta))
- // pen_dy'(r, theta) = r*(m10*cos(theta) + m11*sin(theta))
- private int numPenSegments;
- private int[] pen_dx;
- private int[] pen_dy;
-
- private boolean[] penIncluded;
- private int[] join;
- private int[] offset = new int[2];
- private int[] reverse = new int[100];
- private int[] miter = new int[2];
- private long miterLimitSq;
- private int prev;
- private int rindex;
- private boolean started;
- private boolean lineToOrigin;
- private boolean joinToOrigin;
-// private int sx0, sy0, sx1, sy1, x0, y0, x1, y1;
-// private int mx0, my0, mx1, my1, omx, omy;
-// private int lx0, ly0, lx1, ly1, lx0p, ly0p, px0, py0;
- private int sx0, sy0, sx1, sy1, x0, y0;
- private int mx0, my0, omx, omy;
- private int px0, py0;
- private double m00_2_m01_2;
- private double m10_2_m11_2;
- private double m00_m10_m01_m11;
-
- /**
- * Empty constructor. setOutput and setParameters
- * must be called prior to calling any other methods.
- */
- public LineStroker() {
- }
-
- /**
- * Constructs a LineStroker.
- *
- * @param output
- * an output LineStroker.
- * @param lineWidth
- * the desired line width in pixels, in S15.16 format.
- * @param capStyle
- * the desired end cap style, one of CAP_BUTT,
- * CAP_ROUND or CAP_SQUARE.
- * @param joinStyle
- * the desired line join style, one of JOIN_MITER,
- * JOIN_ROUND or JOIN_BEVEL.
- * @param miterLimit
- * the desired miter limit, in S15.16 format.
- * @param transform
- * a Transform4 object indicating the transform that has
- * been previously applied to all incoming coordinates. This is
- * required in order to produce consistently shaped end caps and
- * joins.
- */
- public LineStroker(LineStroker output, int lineWidth, int capStyle, int joinStyle,
- int miterLimit, PMatrix2D transform) {
- setOutput(output);
- setParameters(lineWidth, capStyle, joinStyle, miterLimit, transform);
- }
-
- /**
- * Sets the output LineStroker of this LineStroker.
- *
- * @param output
- * an output LineStroker.
- */
- public void setOutput(LineStroker output) {
- this.output = output;
- }
-
- /**
- * Sets the parameters of this LineStroker.
- *
- * @param lineWidth
- * the desired line width in pixels, in S15.16 format.
- * @param capStyle
- * the desired end cap style, one of CAP_BUTT,
- * CAP_ROUND or CAP_SQUARE.
- * @param joinStyle
- * the desired line join style, one of JOIN_MITER,
- * JOIN_ROUND or JOIN_BEVEL.
- * @param miterLimit
- * the desired miter limit, in S15.16 format.
- * @param transform
- * a Transform4 object indicating the transform that has
- * been previously applied to all incoming coordinates. This is
- * required in order to produce consistently shaped end caps and
- * joins.
- */
- public void setParameters(int lineWidth, int capStyle, int joinStyle,
- int miterLimit, PMatrix2D transform) {
- this.m00 = LinePath.FloatToS15_16(transform.m00);
- this.m01 = LinePath.FloatToS15_16(transform.m01);
- this.m10 = LinePath.FloatToS15_16(transform.m10);
- this.m11 = LinePath.FloatToS15_16(transform.m11);
-
-// this.lineWidth = lineWidth;
- this.lineWidth2 = lineWidth >> 1;
- this.scaledLineWidth2 = ((long) m00 * lineWidth2) >> 16;
- this.capStyle = capStyle;
- this.joinStyle = joinStyle;
-// this.miterLimit = miterLimit;
-
- this.m00_2_m01_2 = (double) m00 * m00 + (double) m01 * m01;
- this.m10_2_m11_2 = (double) m10 * m10 + (double) m11 * m11;
- this.m00_m10_m01_m11 = (double) m00 * m10 + (double) m01 * m11;
-
- double dm00 = m00 / 65536.0;
- double dm01 = m01 / 65536.0;
- double dm10 = m10 / 65536.0;
- double dm11 = m11 / 65536.0;
- double determinant = dm00 * dm11 - dm01 * dm10;
-
- if (joinStyle == LinePath.JOIN_MITER) {
- double limit = (miterLimit / 65536.0) * (lineWidth2 / 65536.0)
- * determinant;
- double limitSq = limit * limit;
- this.miterLimitSq = (long) (limitSq * 65536.0 * 65536.0);
- }
-
- this.numPenSegments = (int) (3.14159f * lineWidth / 65536.0f);
- if (pen_dx == null || pen_dx.length < numPenSegments) {
- this.pen_dx = new int[numPenSegments];
- this.pen_dy = new int[numPenSegments];
- this.penIncluded = new boolean[numPenSegments];
- this.join = new int[2 * numPenSegments];
- }
-
- for (int i = 0; i < numPenSegments; i++) {
- double r = lineWidth / 2.0;
- double theta = i * 2 * Math.PI / numPenSegments;
-
- double cos = Math.cos(theta);
- double sin = Math.sin(theta);
- pen_dx[i] = (int) (r * (dm00 * cos + dm01 * sin));
- pen_dy[i] = (int) (r * (dm10 * cos + dm11 * sin));
- }
-
- prev = LinePath.SEG_CLOSE;
- rindex = 0;
- started = false;
- lineToOrigin = false;
- }
-
- private void computeOffset(int x0, int y0, int x1, int y1, int[] m) {
- long lx = (long) x1 - (long) x0;
- long ly = (long) y1 - (long) y0;
-
- int dx, dy;
- if (m00 > 0 && m00 == m11 && m01 == 0 & m10 == 0) {
- long ilen = LinePath.hypot(lx, ly);
- if (ilen == 0) {
- dx = dy = 0;
- } else {
- dx = (int) ((ly * scaledLineWidth2) / ilen);
- dy = (int) (-(lx * scaledLineWidth2) / ilen);
- }
- } else {
- double dlx = x1 - x0;
- double dly = y1 - y0;
- double det = (double) m00 * m11 - (double) m01 * m10;
- int sdet = (det > 0) ? 1 : -1;
- double a = dly * m00 - dlx * m10;
- double b = dly * m01 - dlx * m11;
- double dh = LinePath.hypot(a, b);
- double div = sdet * lineWidth2 / (65536.0 * dh);
- double ddx = dly * m00_2_m01_2 - dlx * m00_m10_m01_m11;
- double ddy = dly * m00_m10_m01_m11 - dlx * m10_2_m11_2;
- dx = (int) (ddx * div);
- dy = (int) (ddy * div);
- }
-
- m[0] = dx;
- m[1] = dy;
- }
-
- private void ensureCapacity(int newrindex) {
- if (reverse.length < newrindex) {
- int[] tmp = new int[Math.max(newrindex, 6 * reverse.length / 5)];
- System.arraycopy(reverse, 0, tmp, 0, rindex);
- this.reverse = tmp;
- }
- }
-
- private boolean isCCW(int x0, int y0, int x1, int y1, int x2, int y2) {
- int dx0 = x1 - x0;
- int dy0 = y1 - y0;
- int dx1 = x2 - x1;
- int dy1 = y2 - y1;
- return (long) dx0 * dy1 < (long) dy0 * dx1;
- }
-
- private boolean side(int x, int y, int x0, int y0, int x1, int y1) {
- long lx = x;
- long ly = y;
- long lx0 = x0;
- long ly0 = y0;
- long lx1 = x1;
- long ly1 = y1;
-
- return (ly0 - ly1) * lx + (lx1 - lx0) * ly + (lx0 * ly1 - lx1 * ly0) > 0;
- }
-
- private int computeRoundJoin(int cx, int cy, int xa, int ya, int xb, int yb,
- int side, boolean flip, int[] join) {
- int px, py;
- int ncoords = 0;
-
- boolean centerSide;
- if (side == 0) {
- centerSide = side(cx, cy, xa, ya, xb, yb);
- } else {
- centerSide = (side == 1) ? true : false;
- }
- for (int i = 0; i < numPenSegments; i++) {
- px = cx + pen_dx[i];
- py = cy + pen_dy[i];
-
- boolean penSide = side(px, py, xa, ya, xb, yb);
- if (penSide != centerSide) {
- penIncluded[i] = true;
- } else {
- penIncluded[i] = false;
- }
- }
-
- int start = -1, end = -1;
- for (int i = 0; i < numPenSegments; i++) {
- if (penIncluded[i]
- && !penIncluded[(i + numPenSegments - 1) % numPenSegments]) {
- start = i;
- }
- if (penIncluded[i] && !penIncluded[(i + 1) % numPenSegments]) {
- end = i;
- }
- }
-
- if (end < start) {
- end += numPenSegments;
- }
-
- if (start != -1 && end != -1) {
- long dxa = cx + pen_dx[start] - xa;
- long dya = cy + pen_dy[start] - ya;
- long dxb = cx + pen_dx[start] - xb;
- long dyb = cy + pen_dy[start] - yb;
-
- boolean rev = (dxa * dxa + dya * dya > dxb * dxb + dyb * dyb);
- int i = rev ? end : start;
- int incr = rev ? -1 : 1;
- while (true) {
- int idx = i % numPenSegments;
- px = cx + pen_dx[idx];
- py = cy + pen_dy[idx];
- join[ncoords++] = px;
- join[ncoords++] = py;
- if (i == (rev ? start : end)) {
- break;
- }
- i += incr;
- }
- }
-
- return ncoords / 2;
- }
-
- private static final long ROUND_JOIN_THRESHOLD = 1000L;
-
- private static final long ROUND_JOIN_INTERNAL_THRESHOLD = 1000000000L;
-
- private void drawRoundJoin(int x, int y, int omx, int omy, int mx, int my,
- int side, boolean flip, boolean rev, long threshold) {
- if ((omx == 0 && omy == 0) || (mx == 0 && my == 0)) {
- return;
- }
-
- long domx = (long) omx - mx;
- long domy = (long) omy - my;
- long len = domx * domx + domy * domy;
- if (len < threshold) {
- return;
- }
-
- if (rev) {
- omx = -omx;
- omy = -omy;
- mx = -mx;
- my = -my;
- }
-
- int bx0 = x + omx;
- int by0 = y + omy;
- int bx1 = x + mx;
- int by1 = y + my;
-
- int npoints = computeRoundJoin(x, y, bx0, by0, bx1, by1, side, flip, join);
- for (int i = 0; i < npoints; i++) {
- emitLineTo(join[2 * i], join[2 * i + 1], rev);
- }
- }
-
- // Return the intersection point of the lines (ix0, iy0) -> (ix1, iy1)
- // and (ix0p, iy0p) -> (ix1p, iy1p) in m[0] and m[1]
- private void computeMiter(int ix0, int iy0, int ix1, int iy1, int ix0p,
- int iy0p, int ix1p, int iy1p, int[] m) {
- long x0 = ix0;
- long y0 = iy0;
- long x1 = ix1;
- long y1 = iy1;
-
- long x0p = ix0p;
- long y0p = iy0p;
- long x1p = ix1p;
- long y1p = iy1p;
-
- long x10 = x1 - x0;
- long y10 = y1 - y0;
- long x10p = x1p - x0p;
- long y10p = y1p - y0p;
-
- long den = (x10 * y10p - x10p * y10) >> 16;
- if (den == 0) {
- m[0] = ix0;
- m[1] = iy0;
- return;
- }
-
- long t = (x1p * (y0 - y0p) - x0 * y10p + x0p * (y1p - y0)) >> 16;
- m[0] = (int) (x0 + (t * x10) / den);
- m[1] = (int) (y0 + (t * y10) / den);
- }
-
- private void drawMiter(int px0, int py0, int x0, int y0, int x1, int y1,
- int omx, int omy, int mx, int my, boolean rev) {
- if (mx == omx && my == omy) {
- return;
- }
- if (px0 == x0 && py0 == y0) {
- return;
- }
- if (x0 == x1 && y0 == y1) {
- return;
- }
-
- if (rev) {
- omx = -omx;
- omy = -omy;
- mx = -mx;
- my = -my;
- }
-
- computeMiter(px0 + omx, py0 + omy, x0 + omx, y0 + omy, x0 + mx, y0 + my, x1
- + mx, y1 + my, miter);
-
- // Compute miter length in untransformed coordinates
- long dx = (long) miter[0] - x0;
- long dy = (long) miter[1] - y0;
- long a = (dy * m00 - dx * m10) >> 16;
- long b = (dy * m01 - dx * m11) >> 16;
- long lenSq = a * a + b * b;
-
- if (lenSq < miterLimitSq) {
- emitLineTo(miter[0], miter[1], rev);
- }
- }
-
- public void moveTo(int x0, int y0) {
- // System.out.println("LineStroker.moveTo(" + x0/65536.0 + ", " + y0/65536.0 + ")");
-
- if (lineToOrigin) {
- // not closing the path, do the previous lineTo
- lineToImpl(sx0, sy0, joinToOrigin);
- lineToOrigin = false;
- }
-
- if (prev == LinePath.SEG_LINETO) {
- finish();
- }
-
- this.sx0 = this.x0 = x0;
- this.sy0 = this.y0 = y0;
- this.rindex = 0;
- this.started = false;
- this.joinSegment = false;
- this.prev = LinePath.SEG_MOVETO;
- }
-
- boolean joinSegment = false;
-
- public void lineJoin() {
- // System.out.println("LineStroker.lineJoin()");
- this.joinSegment = true;
- }
-
- public void lineTo(int x1, int y1) {
- // System.out.println("LineStroker.lineTo(" + x1/65536.0 + ", " + y1/65536.0 + ")");
-
- if (lineToOrigin) {
- if (x1 == sx0 && y1 == sy0) {
- // staying in the starting point
- return;
- }
-
- // not closing the path, do the previous lineTo
- lineToImpl(sx0, sy0, joinToOrigin);
- lineToOrigin = false;
- } else if (x1 == x0 && y1 == y0) {
- return;
- } else if (x1 == sx0 && y1 == sy0) {
- lineToOrigin = true;
- joinToOrigin = joinSegment;
- joinSegment = false;
- return;
- }
-
- lineToImpl(x1, y1, joinSegment);
- joinSegment = false;
- }
-
- private void lineToImpl(int x1, int y1, boolean joinSegment) {
- computeOffset(x0, y0, x1, y1, offset);
- int mx = offset[0];
- int my = offset[1];
-
- if (!started) {
- emitMoveTo(x0 + mx, y0 + my);
- this.sx1 = x1;
- this.sy1 = y1;
- this.mx0 = mx;
- this.my0 = my;
- started = true;
- } else {
- boolean ccw = isCCW(px0, py0, x0, y0, x1, y1);
- if (joinSegment) {
- if (joinStyle == LinePath.JOIN_MITER) {
- drawMiter(px0, py0, x0, y0, x1, y1, omx, omy, mx, my, ccw);
- } else if (joinStyle == LinePath.JOIN_ROUND) {
- drawRoundJoin(x0, y0, omx, omy, mx, my, 0, false, ccw,
- ROUND_JOIN_THRESHOLD);
- }
- } else {
- // Draw internal joins as round
- drawRoundJoin(x0, y0, omx, omy, mx, my, 0, false, ccw,
- ROUND_JOIN_INTERNAL_THRESHOLD);
- }
-
- emitLineTo(x0, y0, !ccw);
- }
-
- emitLineTo(x0 + mx, y0 + my, false);
- emitLineTo(x1 + mx, y1 + my, false);
-
- emitLineTo(x0 - mx, y0 - my, true);
- emitLineTo(x1 - mx, y1 - my, true);
-
-// lx0 = x1 + mx;
-// ly0 = y1 + my;
-// lx0p = x1 - mx;
-// ly0p = y1 - my;
-// lx1 = x1;
-// ly1 = y1;
-
- this.omx = mx;
- this.omy = my;
- this.px0 = x0;
- this.py0 = y0;
- this.x0 = x1;
- this.y0 = y1;
- this.prev = LinePath.SEG_LINETO;
- }
-
- public void close() {
- // System.out.println("LineStroker.close()");
-
- if (lineToOrigin) {
- // ignore the previous lineTo
- lineToOrigin = false;
- }
-
- if (!started) {
- finish();
- return;
- }
-
- computeOffset(x0, y0, sx0, sy0, offset);
- int mx = offset[0];
- int my = offset[1];
-
- // Draw penultimate join
- boolean ccw = isCCW(px0, py0, x0, y0, sx0, sy0);
- if (joinSegment) {
- if (joinStyle == LinePath.JOIN_MITER) {
- drawMiter(px0, py0, x0, y0, sx0, sy0, omx, omy, mx, my, ccw);
- } else if (joinStyle == LinePath.JOIN_ROUND) {
- drawRoundJoin(x0, y0, omx, omy, mx, my, 0, false, ccw,
- ROUND_JOIN_THRESHOLD);
- }
- } else {
- // Draw internal joins as round
- drawRoundJoin(x0, y0, omx, omy, mx, my, 0, false, ccw,
- ROUND_JOIN_INTERNAL_THRESHOLD);
- }
-
- emitLineTo(x0 + mx, y0 + my);
- emitLineTo(sx0 + mx, sy0 + my);
-
- ccw = isCCW(x0, y0, sx0, sy0, sx1, sy1);
-
- // Draw final join on the outside
- if (!ccw) {
- if (joinStyle == LinePath.JOIN_MITER) {
- drawMiter(x0, y0, sx0, sy0, sx1, sy1, mx, my, mx0, my0, false);
- } else if (joinStyle == LinePath.JOIN_ROUND) {
- drawRoundJoin(sx0, sy0, mx, my, mx0, my0, 0, false, false,
- ROUND_JOIN_THRESHOLD);
- }
- }
-
- emitLineTo(sx0 + mx0, sy0 + my0);
- emitLineTo(sx0 - mx0, sy0 - my0); // same as reverse[0], reverse[1]
-
- // Draw final join on the inside
- if (ccw) {
- if (joinStyle == LinePath.JOIN_MITER) {
- drawMiter(x0, y0, sx0, sy0, sx1, sy1, -mx, -my, -mx0, -my0, false);
- } else if (joinStyle == LinePath.JOIN_ROUND) {
- drawRoundJoin(sx0, sy0, -mx, -my, -mx0, -my0, 0, true, false,
- ROUND_JOIN_THRESHOLD);
- }
- }
-
- emitLineTo(sx0 - mx, sy0 - my);
- emitLineTo(x0 - mx, y0 - my);
- for (int i = rindex - 2; i >= 0; i -= 2) {
- emitLineTo(reverse[i], reverse[i + 1]);
- }
-
- this.x0 = this.sx0;
- this.y0 = this.sy0;
- this.rindex = 0;
- this.started = false;
- this.joinSegment = false;
- this.prev = LinePath.SEG_CLOSE;
- emitClose();
- }
-
- public void end() {
- // System.out.println("LineStroker.end()");
-
- if (lineToOrigin) {
- // not closing the path, do the previous lineTo
- lineToImpl(sx0, sy0, joinToOrigin);
- lineToOrigin = false;
- }
-
- if (prev == LinePath.SEG_LINETO) {
- finish();
- }
-
- output.end();
- this.joinSegment = false;
- this.prev = LinePath.SEG_MOVETO;
- }
-
- long lineLength(long ldx, long ldy) {
- long ldet = ((long) m00 * m11 - (long) m01 * m10) >> 16;
- long la = (ldy * m00 - ldx * m10) / ldet;
- long lb = (ldy * m01 - ldx * m11) / ldet;
- long llen = (int) LinePath.hypot(la, lb);
- return llen;
- }
-
- private void finish() {
- if (capStyle == LinePath.CAP_ROUND) {
- drawRoundJoin(x0, y0, omx, omy, -omx, -omy, 1, false, false,
- ROUND_JOIN_THRESHOLD);
- } else if (capStyle == LinePath.CAP_SQUARE) {
- long ldx = px0 - x0;
- long ldy = py0 - y0;
- long llen = lineLength(ldx, ldy);
- if (0 < llen) {
- long s = (long) lineWidth2 * 65536 / llen;
-
- int capx = x0 - (int) (ldx * s >> 16);
- int capy = y0 - (int) (ldy * s >> 16);
-
- emitLineTo(capx + omx, capy + omy);
- emitLineTo(capx - omx, capy - omy);
- }
- }
-
- for (int i = rindex - 2; i >= 0; i -= 2) {
- emitLineTo(reverse[i], reverse[i + 1]);
- }
- this.rindex = 0;
-
- if (capStyle == LinePath.CAP_ROUND) {
- drawRoundJoin(sx0, sy0, -mx0, -my0, mx0, my0, 1, false, false,
- ROUND_JOIN_THRESHOLD);
- } else if (capStyle == LinePath.CAP_SQUARE) {
- long ldx = sx1 - sx0;
- long ldy = sy1 - sy0;
- long llen = lineLength(ldx, ldy);
- if (0 < llen) {
- long s = (long) lineWidth2 * 65536 / llen;
-
- int capx = sx0 - (int) (ldx * s >> 16);
- int capy = sy0 - (int) (ldy * s >> 16);
-
- emitLineTo(capx - mx0, capy - my0);
- emitLineTo(capx + mx0, capy + my0);
- }
- }
-
- emitClose();
- this.joinSegment = false;
- }
-
- private void emitMoveTo(int x0, int y0) {
- // System.out.println("LineStroker.emitMoveTo(" + x0/65536.0 + ", " + y0/65536.0 + ")");
- output.moveTo(x0, y0);
- }
-
- private void emitLineTo(int x1, int y1) {
- // System.out.println("LineStroker.emitLineTo(" + x0/65536.0 + ", " + y0/65536.0 + ")");
- output.lineTo(x1, y1);
- }
-
- private void emitLineTo(int x1, int y1, boolean rev) {
- if (rev) {
- ensureCapacity(rindex + 2);
- reverse[rindex++] = x1;
- reverse[rindex++] = y1;
- } else {
- emitLineTo(x1, y1);
- }
- }
-
- private void emitClose() {
- // System.out.println("LineStroker.emitClose()");
- output.close();
- }
-}
diff --git a/android/core/src/processing/opengl/LineVert.glsl b/android/core/src/processing/opengl/LineVert.glsl
deleted file mode 100644
index 6769dc8d85..0000000000
--- a/android/core/src/processing/opengl/LineVert.glsl
+++ /dev/null
@@ -1,85 +0,0 @@
-/*
- Part of the Processing project - http://processing.org
-
- Copyright (c) 2011-13 Ben Fry and Casey Reas
-
- This library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Lesser General Public
- License version 2.1 as published by the Free Software Foundation.
-
- This library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License for more details.
-
- You should have received a copy of the GNU Lesser General
- Public License along with this library; if not, write to the
- Free Software Foundation, Inc., 59 Temple Place, Suite 330,
- Boston, MA 02111-1307 USA
- */
-
-#define PROCESSING_LINE_SHADER
-
-uniform mat4 modelview;
-uniform mat4 projection;
-
-uniform vec4 viewport;
-uniform int perspective;
-uniform vec3 scale;
-
-attribute vec4 vertex;
-attribute vec4 color;
-attribute vec4 direction;
-
-varying vec4 vertColor;
-
-vec3 clipToWindow(vec4 clip, vec4 viewport) {
- vec3 post_div = clip.xyz / clip.w;
- vec2 xypos = (post_div.xy + vec2(1.0, 1.0)) * 0.5 * viewport.zw;
- return vec3(xypos, post_div.z * 0.5 + 0.5);
-}
-
-vec4 windowToClipVector(vec2 window, vec4 viewport, float clip_w) {
- vec2 xypos = (window / viewport.zw) * 2.0;
- return vec4(xypos, 0.0, 0.0) * clip_w;
-}
-
-void main() {
- vec4 posp = modelview * vertex;
-
- // Moving vertices slightly toward the camera
- // to avoid depth-fighting with the fill triangles.
- // Discussed here:
- // http://www.opengl.org/discussion_boards/ubbthreads.php?ubb=showflat&Number=252848
- posp.xyz = posp.xyz * scale;
- vec4 clipp = projection * posp;
- float thickness = direction.w;
-
- if (thickness != 0.0) {
- vec4 posq = posp + modelview * vec4(direction.xyz, 1);
- posq.xyz = posq.xyz * scale;
- vec4 clipq = projection * posq;
-
- vec3 window_p = clipToWindow(clipp, viewport);
- vec3 window_q = clipToWindow(clipq, viewport);
- vec3 tangent = window_q - window_p;
-
- vec2 perp = normalize(vec2(-tangent.y, tangent.x));
- vec2 offset = perp * thickness;
-
- if (0 < perspective) {
- // Perspective correction (lines will look thiner as they move away
- // from the view position).
- gl_Position.xy = clipp.xy + offset.xy;
- gl_Position.zw = clipp.zw;
- } else {
- // No perspective correction.
- vec4 offsetp = windowToClipVector(offset, viewport, clipp.w);
- gl_Position = clipp + offsetp;
- }
- } else {
- gl_Position = clipp;
- }
-
- vertColor = color;
-}
\ No newline at end of file
diff --git a/android/core/src/processing/opengl/MaskFrag.glsl b/android/core/src/processing/opengl/MaskFrag.glsl
deleted file mode 100644
index 07e5900092..0000000000
--- a/android/core/src/processing/opengl/MaskFrag.glsl
+++ /dev/null
@@ -1,33 +0,0 @@
-/*
- Part of the Processing project - http://processing.org
-
- Copyright (c) 2012-13 Ben Fry and Casey Reas
-
- This library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Lesser General Public
- License version 2.1 as published by the Free Software Foundation.
-
- This library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License for more details.
-
- You should have received a copy of the GNU Lesser General
- Public License along with this library; if not, write to the
- Free Software Foundation, Inc., 59 Temple Place, Suite 330,
- Boston, MA 02111-1307 USA
- */
-
-#define PROCESSING_TEXTURE_SHADER
-
-uniform sampler2D texture;
-uniform sampler2D mask;
-
-varying vec4 vertTexCoord;
-
-void main() {
- vec3 texColor = texture2D(texture, vertTexCoord.st).rgb;
- vec3 maskColor = texture2D(mask, vertTexCoord.st).rgb;
- float luminance = dot(maskColor, vec3(0.2126, 0.7152, 0.0722));
- gl_FragColor = vec4(texColor, luminance);
-}
\ No newline at end of file
diff --git a/android/core/src/processing/opengl/PGL.java b/android/core/src/processing/opengl/PGL.java
deleted file mode 100644
index 6d4064e593..0000000000
--- a/android/core/src/processing/opengl/PGL.java
+++ /dev/null
@@ -1,2842 +0,0 @@
-/* -*- mode: java; c-basic-offset: 2; indent-tabs-mode: nil -*- */
-
-/*
- Part of the Processing project - http://processing.org
-
- Copyright (c) 2011-12 Ben Fry and Casey Reas
-
- This library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Lesser General Public
- License version 2.1 as published by the Free Software Foundation.
-
- This library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License for more details.
-
- You should have received a copy of the GNU Lesser General
- Public License along with this library; if not, write to the
- Free Software Foundation, Inc., 59 Temple Place, Suite 330,
- Boston, MA 02111-1307 USA
- */
-
-package processing.opengl;
-
-import java.nio.Buffer;
-import java.nio.ByteBuffer;
-import java.nio.ByteOrder;
-import java.nio.FloatBuffer;
-import java.nio.IntBuffer;
-import java.nio.ShortBuffer;
-import java.util.Arrays;
-
-import processing.core.PApplet;
-import processing.opengl.tess.PGLU;
-import processing.opengl.tess.PGLUtessellator;
-import processing.opengl.tess.PGLUtessellatorCallbackAdapter;
-
-import javax.microedition.khronos.egl.EGL10;
-import javax.microedition.khronos.egl.EGLConfig;
-import javax.microedition.khronos.egl.EGLContext;
-import javax.microedition.khronos.egl.EGLDisplay;
-import javax.microedition.khronos.opengles.*;
-
-import android.opengl.GLES20;
-import android.opengl.GLSurfaceView.EGLConfigChooser;
-import android.opengl.GLSurfaceView.Renderer;
-import android.opengl.GLSurfaceView;
-import android.opengl.GLU;
-
-/**
- * Processing-OpenGL abstraction layer.
- *
- */
-public class PGL {
-
- ///////////////////////////////////////////////////////////
-
- // Parameters
-
- public static boolean FORCE_SCREEN_FBO = false;
- // The use of indirect buffers creates problems with glBufferSubData because
- // the buffer position is ignored:
- // http://stackoverflow.com/questions/3380489/glbuffersubdata-with-an-offset-into-buffer-without-causing-garbage
- // http://code.google.com/p/android/issues/detail?id=12245
- // This doesn't happen with direct buffers.
- public static final boolean USE_DIRECT_BUFFERS = true;
- public static final int MIN_DIRECT_BUFFER_SIZE = 1;
- public static final boolean SAVE_SURFACE_TO_PIXELS = false;
-
- /** Enables/disables mipmap use. **/
- protected static final boolean MIPMAPS_ENABLED = false;
-
- /** Initial sizes for arrays of input and tessellated data. */
- protected static final int DEFAULT_IN_VERTICES = 16;
- protected static final int DEFAULT_IN_EDGES = 32;
- protected static final int DEFAULT_IN_TEXTURES = 16;
- protected static final int DEFAULT_TESS_VERTICES = 16;
- protected static final int DEFAULT_TESS_INDICES = 32;
-
- /** Maximum lights by default is 8, the minimum defined by OpenGL. */
- protected static final int MAX_LIGHTS = 8;
-
- /** Maximum index value of a tessellated vertex. GLES restricts the vertex
- * indices to be of type unsigned short. Since Java only supports signed
- * shorts as primitive type we have 2^15 = 32768 as the maximum number of
- * vertices that can be referred to within a single VBO. */
- protected static final int MAX_VERTEX_INDEX = 32767;
- protected static final int MAX_VERTEX_INDEX1 = MAX_VERTEX_INDEX + 1;
-
- /** Count of tessellated fill, line or point vertices that will
- * trigger a flush in the immediate mode. It doesn't necessarily
- * be equal to MAX_VERTEX_INDEX1, since the number of vertices can
- * be effectively much large since the renderer uses offsets to
- * refer to vertices beyond the MAX_VERTEX_INDEX limit.
- */
- protected static final int FLUSH_VERTEX_COUNT = MAX_VERTEX_INDEX1;
-
- /** Maximum dimension of a texture used to hold font data. **/
- protected static final int MAX_FONT_TEX_SIZE = 512;
-
- /** Minimum stroke weight needed to apply the full path stroking
- * algorithm that properly generates caps and joing.
- */
- protected static final float MIN_CAPS_JOINS_WEIGHT = 2.f;
-
- /** Maximum length of linear paths to be stroked with the
- * full algorithm that generates accurate caps and joins.
- */
- protected static final int MAX_CAPS_JOINS_LENGTH = 1000;
-
- /** Minimum array size to use arrayCopy method(). **/
- protected static final int MIN_ARRAYCOPY_SIZE = 2;
-
- protected static final int SIZEOF_SHORT = Short.SIZE / 8;
- protected static final int SIZEOF_INT = Integer.SIZE / 8;
- protected static final int SIZEOF_FLOAT = Float.SIZE / 8;
- protected static final int SIZEOF_BYTE = Byte.SIZE / 8;
- protected static final int SIZEOF_INDEX = SIZEOF_SHORT;
- protected static final int INDEX_TYPE = GLES20.GL_UNSIGNED_SHORT;
-
- /** Error string from framebuffer errors **/
- protected static final String FRAMEBUFFER_ERROR_MESSAGE =
- "Framebuffer error (%1$s), rendering will probably not work as expected";
-
- /** Machine Epsilon for float precision. **/
- protected static float FLOAT_EPS = Float.MIN_VALUE;
- // Calculation of the Machine Epsilon for float precision. From:
- // http://en.wikipedia.org/wiki/Machine_epsilon#Approximation_using_Java
- static {
- float eps = 1.0f;
-
- do {
- eps /= 2.0f;
- } while ((float)(1.0 + (eps / 2.0)) != 1.0);
-
- FLOAT_EPS = eps;
- }
-
- /**
- * Set to true if the host system is big endian (PowerPC, MIPS, SPARC), false
- * if little endian (x86 Intel for Mac or PC).
- */
- protected static boolean BIG_ENDIAN =
- ByteOrder.nativeOrder() == ByteOrder.BIG_ENDIAN;
-
- protected static final String SHADER_PREPROCESSOR_DIRECTIVE =
- "#ifdef GL_ES\n" +
- "precision mediump float;\n" +
- "precision mediump int;\n" +
- "#endif\n";
-
- ///////////////////////////////////////////////////////////
-
- // OpenGL constants
-
- // The values for constants not defined in the GLES20 interface can be found
- // in this file:
- // http://code.metager.de/source/xref/android/4.0.3/development/tools/glesv2debugger/src/com/android/glesv2debugger/GLEnum.java
-
- public static final int FALSE = GLES20.GL_FALSE;
- public static final int TRUE = GLES20.GL_TRUE;
-
- public static final int LESS = GLES20.GL_LESS;
- public static final int LEQUAL = GLES20.GL_LEQUAL;
-
- public static final int CCW = GLES20.GL_CCW;
- public static final int CW = GLES20.GL_CW;
-
- public static final int CULL_FACE = GLES20.GL_CULL_FACE;
- public static final int FRONT = GLES20.GL_FRONT;
- public static final int BACK = GLES20.GL_BACK;
- public static final int FRONT_AND_BACK = GLES20.GL_FRONT_AND_BACK;
-
- public static final int VIEWPORT = GLES20.GL_VIEWPORT;
-
- public static final int SCISSOR_TEST = GLES20.GL_SCISSOR_TEST;
- public static final int DEPTH_TEST = GLES20.GL_DEPTH_TEST;
- public static final int DEPTH_WRITEMASK = GLES20.GL_DEPTH_WRITEMASK;
-
- public static final int COLOR_BUFFER_BIT = GLES20.GL_COLOR_BUFFER_BIT;
- public static final int DEPTH_BUFFER_BIT = GLES20.GL_DEPTH_BUFFER_BIT;
- public static final int STENCIL_BUFFER_BIT = GLES20.GL_STENCIL_BUFFER_BIT;
-
- public static final int FUNC_ADD = GLES20.GL_FUNC_ADD;
- public static final int FUNC_MIN = 0x8007;
- public static final int FUNC_MAX = 0x8008;
- public static final int FUNC_REVERSE_SUBTRACT =
- GLES20.GL_FUNC_REVERSE_SUBTRACT;
-
- public static final int TEXTURE_2D = GLES20.GL_TEXTURE_2D;
-
- public static final int TEXTURE_BINDING_2D = GLES20.GL_TEXTURE_BINDING_2D;
-
- public static final int RGB = GLES20.GL_RGB;
- public static final int RGBA = GLES20.GL_RGBA;
- public static final int ALPHA = GLES20.GL_ALPHA;
- public static final int UNSIGNED_INT = GLES20.GL_UNSIGNED_INT;
- public static final int UNSIGNED_BYTE = GLES20.GL_UNSIGNED_BYTE;
- public static final int UNSIGNED_SHORT = GLES20.GL_UNSIGNED_SHORT;
- public static final int FLOAT = GLES20.GL_FLOAT;
-
- public static final int NEAREST = GLES20.GL_NEAREST;
- public static final int LINEAR = GLES20.GL_LINEAR;
- public static final int LINEAR_MIPMAP_NEAREST =
- GLES20.GL_LINEAR_MIPMAP_NEAREST;
- public static final int LINEAR_MIPMAP_LINEAR =
- GLES20.GL_LINEAR_MIPMAP_LINEAR;
-
- public static final int TEXTURE_MAX_ANISOTROPY = 0x84FE;
- public static final int MAX_TEXTURE_MAX_ANISOTROPY = 0x84FF;
-
- public static final int CLAMP_TO_EDGE = GLES20.GL_CLAMP_TO_EDGE;
- public static final int REPEAT = GLES20.GL_REPEAT;
-
- public static final int RGBA8 = -1;
- public static final int DEPTH24_STENCIL8 = 0x88F0;
-
- public static final int DEPTH_COMPONENT = GLES20.GL_DEPTH_COMPONENT;
- public static final int DEPTH_COMPONENT16 = GLES20.GL_DEPTH_COMPONENT16;
- public static final int DEPTH_COMPONENT24 = 0x81A6;
- public static final int DEPTH_COMPONENT32 = 0x81A7;
-
- public static final int STENCIL_INDEX = GLES20.GL_STENCIL_INDEX;
- public static final int STENCIL_INDEX1 = 0x8D46;
- public static final int STENCIL_INDEX4 = 0x8D47;
- public static final int STENCIL_INDEX8 = GLES20.GL_STENCIL_INDEX8;
-
- public static final int ARRAY_BUFFER = GLES20.GL_ARRAY_BUFFER;
- public static final int ELEMENT_ARRAY_BUFFER = GLES20.GL_ELEMENT_ARRAY_BUFFER;
-
- public static final int SAMPLES = GLES20.GL_SAMPLES;
-
- public static final int FRAMEBUFFER_COMPLETE =
- GLES20.GL_FRAMEBUFFER_COMPLETE;
- public static final int FRAMEBUFFER_INCOMPLETE_ATTACHMENT =
- GLES20.GL_FRAMEBUFFER_INCOMPLETE_ATTACHMENT;
- public static final int FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT =
- GLES20.GL_FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT;
- public static final int FRAMEBUFFER_INCOMPLETE_DIMENSIONS =
- GLES20.GL_FRAMEBUFFER_INCOMPLETE_DIMENSIONS;
- public static final int FRAMEBUFFER_INCOMPLETE_FORMATS =
- 0x8CDA;
- public static final int FRAMEBUFFER_INCOMPLETE_DRAW_BUFFER = -1;
- public static final int FRAMEBUFFER_INCOMPLETE_READ_BUFFER = -1;
- public static final int FRAMEBUFFER_UNSUPPORTED =
- GLES20.GL_FRAMEBUFFER_UNSUPPORTED;
-
- public static final int STATIC_DRAW = GLES20.GL_STATIC_DRAW;
- public static final int DYNAMIC_DRAW = GLES20.GL_DYNAMIC_DRAW;
- public static final int STREAM_DRAW = GLES20.GL_STREAM_DRAW;
-
- public static final int READ_ONLY = -1;
- public static final int WRITE_ONLY = -1;
- public static final int READ_WRITE = -1;
-
- public static final int TRIANGLE_FAN = GLES20.GL_TRIANGLE_FAN;
- public static final int TRIANGLE_STRIP = GLES20.GL_TRIANGLE_STRIP;
- public static final int TRIANGLES = GLES20.GL_TRIANGLES;
-
- public static final int VENDOR = GLES20.GL_VENDOR;
- public static final int RENDERER = GLES20.GL_RENDERER;
- public static final int VERSION = GLES20.GL_VERSION;
- public static final int EXTENSIONS = GLES20.GL_EXTENSIONS;
- public static final int SHADING_LANGUAGE_VERSION =
- GLES20.GL_SHADING_LANGUAGE_VERSION;
-
- public static final int MAX_TEXTURE_SIZE = GLES20.GL_MAX_TEXTURE_SIZE;
- public static final int MAX_SAMPLES = -1;
- public static final int ALIASED_LINE_WIDTH_RANGE =
- GLES20.GL_ALIASED_LINE_WIDTH_RANGE;
- public static final int ALIASED_POINT_SIZE_RANGE =
- GLES20.GL_ALIASED_POINT_SIZE_RANGE;
- public static final int DEPTH_BITS = GLES20.GL_DEPTH_BITS;
- public static final int STENCIL_BITS = GLES20.GL_STENCIL_BITS;
-
- public static final int TESS_WINDING_NONZERO = PGLU.GLU_TESS_WINDING_NONZERO;
- public static final int TESS_WINDING_ODD = PGLU.GLU_TESS_WINDING_ODD;
-
- public static final int TEXTURE0 = GLES20.GL_TEXTURE0;
- public static final int TEXTURE1 = GLES20.GL_TEXTURE1;
- public static final int TEXTURE2 = GLES20.GL_TEXTURE2;
- public static final int TEXTURE3 = GLES20.GL_TEXTURE3;
- public static final int TEXTURE_MIN_FILTER = GLES20.GL_TEXTURE_MIN_FILTER;
- public static final int TEXTURE_MAG_FILTER = GLES20.GL_TEXTURE_MAG_FILTER;
- public static final int TEXTURE_WRAP_S = GLES20.GL_TEXTURE_WRAP_S;
- public static final int TEXTURE_WRAP_T = GLES20.GL_TEXTURE_WRAP_T;
-
- public static final int BLEND = GLES20.GL_BLEND;
- public static final int ONE = GLES20.GL_ONE;
- public static final int ZERO = GLES20.GL_ZERO;
- public static final int SRC_ALPHA = GLES20.GL_SRC_ALPHA;
- public static final int DST_ALPHA = GLES20.GL_DST_ALPHA;
- public static final int ONE_MINUS_SRC_ALPHA = GLES20.GL_ONE_MINUS_SRC_ALPHA;
- public static final int ONE_MINUS_DST_COLOR = GLES20.GL_ONE_MINUS_DST_COLOR;
- public static final int ONE_MINUS_SRC_COLOR = GLES20.GL_ONE_MINUS_SRC_COLOR;
- public static final int DST_COLOR = GLES20.GL_DST_COLOR;
- public static final int SRC_COLOR = GLES20.GL_SRC_COLOR;
-
- public static final int FRAMEBUFFER = GLES20.GL_FRAMEBUFFER;
- public static final int COLOR_ATTACHMENT0 = GLES20.GL_COLOR_ATTACHMENT0;
- public static final int COLOR_ATTACHMENT1 = -1;
- public static final int COLOR_ATTACHMENT2 = -1;
- public static final int COLOR_ATTACHMENT3 = -1;
- public static final int RENDERBUFFER = GLES20.GL_RENDERBUFFER;
- public static final int DEPTH_ATTACHMENT = GLES20.GL_DEPTH_ATTACHMENT;
- public static final int STENCIL_ATTACHMENT = GLES20.GL_STENCIL_ATTACHMENT;
- public static final int READ_FRAMEBUFFER = -1;
- public static final int DRAW_FRAMEBUFFER = -1;
-
- public static final int VERTEX_SHADER = GLES20.GL_VERTEX_SHADER;
- public static final int FRAGMENT_SHADER = GLES20.GL_FRAGMENT_SHADER;
- public static final int INFO_LOG_LENGTH = GLES20.GL_INFO_LOG_LENGTH;
- public static final int SHADER_SOURCE_LENGTH = GLES20.GL_SHADER_SOURCE_LENGTH;
- public static final int COMPILE_STATUS = GLES20.GL_COMPILE_STATUS;
- public static final int LINK_STATUS = GLES20.GL_LINK_STATUS;
- public static final int VALIDATE_STATUS = GLES20.GL_VALIDATE_STATUS;
-
- public static final int MULTISAMPLE = -1;
- public static final int POINT_SMOOTH = -1;
- public static final int LINE_SMOOTH = -1;
- public static final int POLYGON_SMOOTH = -1;
-
- // Some EGL constants needed to initialize an GLES2 context.
- protected static final int EGL_CONTEXT_CLIENT_VERSION = 0x3098;
- protected static final int EGL_OPENGL_ES2_BIT = 0x0004;
-
- /** Basic GLES 1.0 interface */
- public static GL10 gl;
-
- /** GLU interface **/
- public static PGLU glu;
-
- /** The current opengl context */
- public static EGLContext context;
-
- /** The PGraphics object using this interface */
- protected PGraphicsOpenGL pg;
-
- /** The renderer object driving the rendering loop,
- * analogous to the GLEventListener in JOGL */
- protected static AndroidRenderer renderer;
-
- /** OpenGL thread */
- protected static Thread glThread;
-
- /** Which texturing targets are enabled */
- protected static boolean[] texturingTargets = { false };
-
- /** Which textures are bound to each target */
- protected static int[] boundTextures = { 0 };
-
- ///////////////////////////////////////////////////////////
-
- // FBO layer
-
- protected static boolean fboLayerByDefault = FORCE_SCREEN_FBO;
- protected static boolean fboLayerCreated = false;
- protected static boolean fboLayerInUse = false;
- protected static boolean firstFrame = true;
- protected static int reqNumSamples;
- protected static int numSamples;
- protected static IntBuffer glColorFbo;
- protected static IntBuffer glMultiFbo;
- protected static IntBuffer glColorBuf;
- protected static IntBuffer glColorTex;
- protected static IntBuffer glDepthStencil;
- protected static IntBuffer glDepth;
- protected static IntBuffer glStencil;
- protected static int fboWidth, fboHeight;
- protected static int backTex, frontTex;
-
- ///////////////////////////////////////////////////////////
-
- // Texture rendering
-
- protected static boolean loadedTexShader = false;
- protected static int texShaderProgram;
- protected static int texVertShader;
- protected static int texFragShader;
- protected static EGLContext texShaderContext;
- protected static int texVertLoc;
- protected static int texTCoordLoc;
-
- protected static float[] texCoords = {
- // X, Y, U, V
- -1.0f, -1.0f, 0.0f, 0.0f,
- +1.0f, -1.0f, 1.0f, 0.0f,
- -1.0f, +1.0f, 0.0f, 1.0f,
- +1.0f, +1.0f, 1.0f, 1.0f
- };
- protected static FloatBuffer texData;
-
- protected static String texVertShaderSource =
- "attribute vec2 inVertex;" +
- "attribute vec2 inTexcoord;" +
- "varying vec2 vertTexcoord;" +
- "void main() {" +
- " gl_Position = vec4(inVertex, 0, 1);" +
- " vertTexcoord = inTexcoord;" +
- "}";
-
- protected static String texFragShaderSource =
- SHADER_PREPROCESSOR_DIRECTIVE +
- "uniform sampler2D textureSampler;" +
- "varying vec2 vertTexcoord;" +
- "void main() {" +
- " gl_FragColor = texture2D(textureSampler, vertTexcoord.st);" +
- "}";
-
- ///////////////////////////////////////////////////////////
-
- // Utilities
-
- protected ByteBuffer byteBuffer;
- protected IntBuffer intBuffer;
-
- protected IntBuffer colorBuffer;
- protected FloatBuffer depthBuffer;
- protected ByteBuffer stencilBuffer;
-
- ///////////////////////////////////////////////////////////
-
- // Intialization, finalization
-
-
- public PGL(PGraphicsOpenGL pg) {
- this.pg = pg;
- if (glu == null) {
- glu = new PGLU();
- }
- if (glColorTex == null) {
- glColorTex = allocateIntBuffer(2);
- glColorFbo = allocateIntBuffer(1);
- glMultiFbo = allocateIntBuffer(1);
- glColorBuf = allocateIntBuffer(1);
- glDepthStencil = allocateIntBuffer(1);
- glDepth = allocateIntBuffer(1);
- glStencil = allocateIntBuffer(1);
-
- fboLayerCreated = false;
- fboLayerInUse = false;
- firstFrame = false;
- }
-
- byteBuffer = allocateByteBuffer(1);
- intBuffer = allocateIntBuffer(1);
- }
-
-
- protected void setFrameRate(float framerate) {
- }
-
-
- protected void initSurface(int antialias) {
- reqNumSamples = qualityToSamples(antialias);
- fboLayerCreated = false;
- fboLayerInUse = false;
- firstFrame = true;
- }
-
-
- protected void deleteSurface() {
- if (glColorTex != null) {
- deleteTextures(2, glColorTex);
- deleteFramebuffers(1, glColorFbo);
- deleteFramebuffers(1, glMultiFbo);
- deleteRenderbuffers(1, glColorBuf);
- deleteRenderbuffers(1, glDepthStencil);
- deleteRenderbuffers(1, glDepth);
- deleteRenderbuffers(1, glStencil);
- }
- fboLayerCreated = false;
- fboLayerInUse = false;
- firstFrame = true;
- }
-
-
- protected void update() {
- if (!fboLayerCreated) {
- String ext = getString(EXTENSIONS);
- if (-1 < ext.indexOf("texture_non_power_of_two")) {
- fboWidth = pg.width;
- fboHeight = pg.height;
- } else {
- fboWidth = nextPowerOfTwo(pg.width);
- fboHeight = nextPowerOfTwo(pg.height);
- }
-
- getIntegerv(MAX_SAMPLES, intBuffer);
- if (-1 < ext.indexOf("_framebuffer_multisample") &&
- 1 < intBuffer.get(0)) {
- numSamples = reqNumSamples;
- } else {
- numSamples = 1;
- }
- boolean multisample = 1 < numSamples;
-
- boolean packed = ext.indexOf("packed_depth_stencil") != -1;
- int depthBits = getDepthBits();
- int stencilBits = getStencilBits();
-
- genTextures(2, glColorTex);
- for (int i = 0; i < 2; i++) {
- bindTexture(TEXTURE_2D, glColorTex.get(i));
- texParameteri(TEXTURE_2D, TEXTURE_MIN_FILTER, NEAREST);
- texParameteri(TEXTURE_2D, TEXTURE_MAG_FILTER, NEAREST);
- texParameteri(TEXTURE_2D, TEXTURE_WRAP_S, CLAMP_TO_EDGE);
- texParameteri(TEXTURE_2D, TEXTURE_WRAP_T, CLAMP_TO_EDGE);
- texImage2D(TEXTURE_2D, 0, RGBA, fboWidth, fboHeight, 0,
- RGBA, UNSIGNED_BYTE, null);
- initTexture(TEXTURE_2D, RGBA, fboWidth, fboHeight, pg.backgroundColor);
- }
- bindTexture(TEXTURE_2D, 0);
-
- backTex = 0;
- frontTex = 1;
-
- genFramebuffers(1, glColorFbo);
- bindFramebuffer(FRAMEBUFFER, glColorFbo.get(0));
- framebufferTexture2D(FRAMEBUFFER, COLOR_ATTACHMENT0, TEXTURE_2D,
- glColorTex.get(backTex), 0);
-
- if (multisample) {
- // Creating multisampled FBO
- genFramebuffers(1, glMultiFbo);
- bindFramebuffer(FRAMEBUFFER, glMultiFbo.get(0));
-
- // color render buffer...
- genRenderbuffers(1, glColorBuf);
- bindRenderbuffer(RENDERBUFFER, glColorBuf.get(0));
- renderbufferStorageMultisample(RENDERBUFFER, numSamples,
- RGBA8, fboWidth, fboHeight);
- framebufferRenderbuffer(FRAMEBUFFER, COLOR_ATTACHMENT0,
- RENDERBUFFER, glColorBuf.get(0));
- }
-
- // Creating depth and stencil buffers
- if (packed && depthBits == 24 && stencilBits == 8) {
- // packed depth+stencil buffer
- genRenderbuffers(1, glDepthStencil);
- bindRenderbuffer(RENDERBUFFER, glDepthStencil.get(0));
- if (multisample) {
- renderbufferStorageMultisample(RENDERBUFFER, numSamples,
- DEPTH24_STENCIL8, fboWidth, fboHeight);
- } else {
- renderbufferStorage(RENDERBUFFER, DEPTH24_STENCIL8,
- fboWidth, fboHeight);
- }
- framebufferRenderbuffer(FRAMEBUFFER, DEPTH_ATTACHMENT, RENDERBUFFER,
- glDepthStencil.get(0));
- framebufferRenderbuffer(FRAMEBUFFER, STENCIL_ATTACHMENT, RENDERBUFFER,
- glDepthStencil.get(0));
- } else {
- // separate depth and stencil buffers
- if (0 < depthBits) {
- int depthComponent = DEPTH_COMPONENT16;
- if (depthBits == 32) {
- depthComponent = DEPTH_COMPONENT32;
- } else if (depthBits == 24) {
- depthComponent = DEPTH_COMPONENT24;
- } else if (depthBits == 16) {
- depthComponent = DEPTH_COMPONENT16;
- }
-
- genRenderbuffers(1, glDepth);
- bindRenderbuffer(RENDERBUFFER, glDepth.get(0));
- if (multisample) {
- renderbufferStorageMultisample(RENDERBUFFER, numSamples,
- depthComponent, fboWidth, fboHeight);
- } else {
- renderbufferStorage(RENDERBUFFER, depthComponent,
- fboWidth, fboHeight);
- }
- framebufferRenderbuffer(FRAMEBUFFER, DEPTH_ATTACHMENT,
- RENDERBUFFER, glDepth.get(0));
- }
-
- if (0 < stencilBits) {
- int stencilIndex = STENCIL_INDEX1;
- if (stencilBits == 8) {
- stencilIndex = STENCIL_INDEX8;
- } else if (stencilBits == 4) {
- stencilIndex = STENCIL_INDEX4;
- } else if (stencilBits == 1) {
- stencilIndex = STENCIL_INDEX1;
- }
-
- genRenderbuffers(1, glStencil);
- bindRenderbuffer(RENDERBUFFER, glStencil.get(0));
- if (multisample) {
- renderbufferStorageMultisample(RENDERBUFFER, numSamples,
- stencilIndex, fboWidth, fboHeight);
- } else {
- renderbufferStorage(RENDERBUFFER, stencilIndex,
- fboWidth, fboHeight);
- }
- framebufferRenderbuffer(FRAMEBUFFER, STENCIL_ATTACHMENT,
- RENDERBUFFER, glStencil.get(0));
- }
- }
-
- validateFramebuffer();
-
- // Clear all buffers.
- clearDepth(1);
- clearStencil(0);
- int argb = pg.backgroundColor;
- float a = ((argb >> 24) & 0xff) / 255.0f;
- float r = ((argb >> 16) & 0xff) / 255.0f;
- float g = ((argb >> 8) & 0xff) / 255.0f;
- float b = ((argb) & 0xff) / 255.0f;
- clearColor(r, g, b, a);
- clear(DEPTH_BUFFER_BIT | STENCIL_BUFFER_BIT | COLOR_BUFFER_BIT);
-
- bindFramebuffer(FRAMEBUFFER, 0);
-
- fboLayerCreated = true;
- }
- }
-
-
- protected int getReadFramebuffer() {
- if (fboLayerInUse) {
- return glColorFbo.get(0);
- } else {
- return 0;
- }
- }
-
-
- protected int getDrawFramebuffer() {
- if (fboLayerInUse) {
- return glColorFbo.get(0);
- } else {
- return 0;
- }
- }
-
-
- protected int getDefaultDrawBuffer() {
- if (fboLayerInUse) {
- return COLOR_ATTACHMENT0;
- } else {
- return BACK;
- }
- }
-
-
- protected int getDefaultReadBuffer() {
- if (fboLayerInUse) {
- return COLOR_ATTACHMENT0;
- } else {
- return FRONT;
- }
- }
-
-
- protected boolean isFBOBacked() {
- return fboLayerInUse;
- }
-
-
- protected void needFBOLayer() {
- FORCE_SCREEN_FBO = true;
- }
-
-
- protected boolean isMultisampled() {
- return false;
- }
-
-
- protected int getDepthBits() {
- intBuffer.rewind();
- getIntegerv(DEPTH_BITS, intBuffer);
- return intBuffer.get(0);
- }
-
-
- protected int getStencilBits() {
- intBuffer.rewind();
- getIntegerv(STENCIL_BITS, intBuffer);
- return intBuffer.get(0);
- }
-
-
- protected boolean getDepthTest() {
- intBuffer.rewind();
- getBooleanv(DEPTH_TEST, intBuffer);
- return intBuffer.get(0) == 0 ? false : true;
- }
-
-
- protected boolean getDepthWriteMask() {
- intBuffer.rewind();
- getBooleanv(DEPTH_WRITEMASK, intBuffer);
- return intBuffer.get(0) == 0 ? false : true;
- }
-
-
- protected Texture wrapBackTexture() {
- Texture tex = new Texture(pg.parent);
- tex.init(pg.width, pg.height,
- glColorTex.get(backTex), TEXTURE_2D, RGBA,
- fboWidth, fboHeight, NEAREST, NEAREST,
- CLAMP_TO_EDGE, CLAMP_TO_EDGE);
- tex.invertedY(true);
- tex.colorBufferOf(pg);
- pg.setCache(pg, tex);
- return tex;
- }
-
-
- protected Texture wrapFrontTexture() {
- Texture tex = new Texture(pg.parent);
- tex.init(pg.width, pg.height,
- glColorTex.get(frontTex), TEXTURE_2D, RGBA,
- fboWidth, fboHeight, NEAREST, NEAREST,
- CLAMP_TO_EDGE, CLAMP_TO_EDGE);
- tex.invertedY(true);
- tex.colorBufferOf(pg);
- return tex;
- }
-
-
- int getBackTextureName() {
- return glColorTex.get(backTex);
- }
-
-
- int getFrontTextureName() {
- return glColorTex.get(frontTex);
- }
-
-
- protected void bindFrontTexture() {
- if (!texturingIsEnabled(TEXTURE_2D)) {
- enableTexturing(TEXTURE_2D);
- }
- bindTexture(TEXTURE_2D, glColorTex.get(frontTex));
- }
-
-
- protected void unbindFrontTexture() {
- if (textureIsBound(TEXTURE_2D, glColorTex.get(frontTex))) {
- // We don't want to unbind another texture
- // that might be bound instead of this one.
- if (!texturingIsEnabled(TEXTURE_2D)) {
- enableTexturing(TEXTURE_2D);
- bindTexture(TEXTURE_2D, 0);
- disableTexturing(TEXTURE_2D);
- } else {
- bindTexture(TEXTURE_2D, 0);
- }
- }
- }
-
-
- protected void syncBackTexture() {
- if (1 < numSamples) {
- bindFramebuffer(READ_FRAMEBUFFER, glMultiFbo.get(0));
- bindFramebuffer(DRAW_FRAMEBUFFER, glColorFbo.get(0));
- blitFramebuffer(0, 0, fboWidth, fboHeight,
- 0, 0, fboWidth, fboHeight,
- COLOR_BUFFER_BIT, NEAREST);
- }
- }
-
-
- protected int qualityToSamples(int quality) {
- if (quality <= 1) {
- return 1;
- } else {
- // Number of samples is always an even number:
- int n = 2 * (quality / 2);
- return n;
- }
- }
-
-
- ///////////////////////////////////////////////////////////
-
- // Frame rendering
-
-
- protected void beginDraw(boolean clear0) {
- if (fboLayerInUse(clear0)) {
- bindFramebuffer(FRAMEBUFFER, glColorFbo.get(0));
- framebufferTexture2D(FRAMEBUFFER, COLOR_ATTACHMENT0,
- TEXTURE_2D, glColorTex.get(backTex), 0);
-
- if (1 < numSamples) {
- bindFramebuffer(FRAMEBUFFER, glMultiFbo.get(0));
- }
-
- if (firstFrame) {
- // No need to draw back color buffer because we are in the first frame.
- int argb = pg.backgroundColor;
- float a = ((argb >> 24) & 0xff) / 255.0f;
- float r = ((argb >> 16) & 0xff) / 255.0f;
- float g = ((argb >> 8) & 0xff) / 255.0f;
- float b = ((argb) & 0xff) / 255.0f;
- clearColor(r, g, b, a);
- clear(COLOR_BUFFER_BIT);
- } else if (!clear0) {
- // Render previous back texture (now is the front) as background,
- // because no background() is being used ("incremental drawing")
- drawTexture(TEXTURE_2D, glColorTex.get(frontTex),
- fboWidth, fboHeight, 0, 0, pg.width, pg.height,
- 0, 0, pg.width, pg.height);
- }
-
- fboLayerInUse = true;
- } else {
- fboLayerInUse = false;
- }
-
- if (firstFrame) {
- firstFrame = false;
- }
-
- if (!fboLayerByDefault) {
- // The result of this assignment is the following: if the user requested
- // at some point the use of the FBO layer, but subsequently didn't do
- // request it again, then the rendering won't use the FBO layer if not
- // needed, since it is slower than simple onscreen rendering.
- FORCE_SCREEN_FBO = false;
- }
- }
-
-
- protected void endDraw(boolean clear) {
- if (fboLayerInUse) {
- syncBackTexture();
-
- // Draw the contents of the back texture to the screen framebuffer.
- bindFramebuffer(FRAMEBUFFER, 0);
-
- clearDepth(1);
- clearColor(0, 0, 0, 0);
- clear(COLOR_BUFFER_BIT | DEPTH_BUFFER_BIT);
-
- // Render current back texture to screen, without blending.
- disable(BLEND);
- drawTexture(TEXTURE_2D, glColorTex.get(backTex),
- fboWidth, fboHeight, 0, 0, pg.width, pg.height,
- 0, 0, pg.width, pg.height);
-
- // Swapping front and back textures.
- int temp = frontTex;
- frontTex = backTex;
- backTex = temp;
- }
- flush();
- }
-
-
- protected boolean canDraw() {
- return true;
- }
-
-
- protected void requestDraw() {
- pg.parent.andresNeedsBetterAPI();
- }
-
-
- protected boolean threadIsCurrent() {
- return Thread.currentThread() == glThread;
- }
-
-
- protected boolean fboLayerInUse(boolean clear0) {
- boolean cond = !clear0 || FORCE_SCREEN_FBO || 1 < numSamples;
- return cond && glColorFbo.get(0) != 0;
- }
-
-
- protected void beginGL() {
- }
-
-
- protected void endGL() {
- }
-
-
- ///////////////////////////////////////////////////////////
-
- // Caps query
-
-
- public String getString(int name) {
- return GLES20.glGetString(name);
- }
-
-
- public void getIntegerv(int name, IntBuffer values) {
- if (-1 < name) {
- GLES20.glGetIntegerv(name, values);
- } else {
- fillIntBuffer(values, 0, values.capacity(), 0);
- }
- }
-
-
- public void getFloatv(int name, FloatBuffer values) {
- if (-1 < name) {
- GLES20.glGetFloatv(name, values);
- } else {
- fillFloatBuffer(values, 0, values.capacity(), 0);
- }
- }
-
-
- public void getBooleanv(int name, IntBuffer values) {
- if (-1 < name) {
- GLES20.glGetBooleanv(name, values);
- } else {
- fillIntBuffer(values, 0, values.capacity(), 0);
- }
- }
-
-
- ///////////////////////////////////////////////////////////
-
- // Enable/disable caps
-
-
- public void enable(int cap) {
- if (-1 < cap) {
- GLES20.glEnable(cap);
- }
- }
-
-
- public void disable(int cap) {
- if (-1 < cap) {
- GLES20.glDisable(cap);
- }
- }
-
-
- ///////////////////////////////////////////////////////////
-
- // Render control
-
-
- public void flush() {
- GLES20.glFlush();
- }
-
-
- public void finish() {
- GLES20.glFinish();
- }
-
-
- ///////////////////////////////////////////////////////////
-
- // Error handling
-
-
- public int getError() {
- return GLES20.glGetError();
- }
-
-
- public String errorString(int err) {
- return GLU.gluErrorString(err);
- }
-
-
- ///////////////////////////////////////////////////////////
-
- // Rendering options
-
-
- public void frontFace(int mode) {
- GLES20.glFrontFace(mode);
- }
-
-
- public void cullFace(int mode) {
- GLES20.glCullFace(mode);
- }
-
-
- public void depthMask(boolean flag) {
- GLES20.glDepthMask(flag);
- }
-
-
- public void depthFunc(int func) {
- GLES20.glDepthFunc(func);
- }
-
-
- ///////////////////////////////////////////////////////////
-
- // Textures
-
-
- public void genTextures(int n, IntBuffer ids) {
- GLES20.glGenTextures(n, ids);
- }
-
-
- public void deleteTextures(int n, IntBuffer ids) {
- GLES20.glDeleteTextures(n, ids);
- }
-
-
- public void activeTexture(int unit) {
- GLES20.glActiveTexture(unit);
- }
-
-
- public void bindTexture(int target, int id) {
- GLES20.glBindTexture(target, id);
- if (target == TEXTURE_2D) {
- boundTextures[0] = id;
- }
- }
-
-
- public void texImage2D(int target, int level, int internalFormat,
- int width, int height, int border, int format,
- int type, Buffer data) {
- GLES20.glTexImage2D(target, level, internalFormat,
- width, height, border, format, type, data);
- }
-
-
- public void texSubImage2D(int target, int level, int xOffset, int yOffset,
- int width, int height, int format,
- int type, Buffer data) {
- GLES20.glTexSubImage2D(target, level, xOffset, yOffset,
- width, height, format, type, data);
- }
-
-
- public void texParameteri(int target, int param, int value) {
- GLES20.glTexParameteri(target, param, value);
- }
-
-
- public void texParameterf(int target, int param, float value) {
- GLES20.glTexParameterf(target, param, value);
- }
-
-
- public void getTexParameteriv(int target, int param, IntBuffer values) {
- GLES20.glGetTexParameteriv(target, param, values);
- }
-
-
- public void generateMipmap(int target) {
- GLES20.glGenerateMipmap(target);
- }
-
-
- ///////////////////////////////////////////////////////////
-
- // Vertex Buffers
-
-
- public void genBuffers(int n, IntBuffer ids) {
- GLES20.glGenBuffers(n, ids);
- }
-
-
- public void deleteBuffers(int n, IntBuffer ids) {
- GLES20.glDeleteBuffers(n, ids);
- }
-
-
- public void bindBuffer(int target, int id) {
- GLES20.glBindBuffer(target, id);
- }
-
-
- public void bufferData(int target, int size, Buffer data, int usage) {
- GLES20.glBufferData(target, size, data, usage);
- }
-
-
- public void bufferSubData(int target, int offset, int size, Buffer data) {
- GLES20.glBufferSubData(target, offset, size, data);
- }
-
-
- public void drawArrays(int mode, int first, int count) {
- GLES20.glDrawArrays(mode, first, count);
- }
-
-
- public void drawElements(int mode, int count, int type, int offset) {
- GLES20.glDrawElements(mode, count, type, offset);
- }
-
-
- public void enableVertexAttribArray(int loc) {
- GLES20.glEnableVertexAttribArray(loc);
- }
-
-
- public void disableVertexAttribArray(int loc) {
- GLES20.glDisableVertexAttribArray(loc);
- }
-
-
- public void vertexAttribPointer(int loc, int size, int type,
- boolean normalized, int stride, int offset) {
- GLES20.glVertexAttribPointer(loc, size, type, normalized, stride, offset);
- }
-
-
- public void vertexAttribPointer(int loc, int size, int type,
- boolean normalized, int stride, Buffer data) {
- GLES20.glVertexAttribPointer(loc, size, type, normalized, stride, data);
- }
-
-
- public ByteBuffer mapBuffer(int target, int access) {
- //return gl2f.glMapBuffer(GL.GL_ARRAY_BUFFER, GL2.GL_READ_WRITE);
- return null;
- }
-
-
- public ByteBuffer mapBufferRange(int target, int offset, int length,
- int access) {
- //return gl2x.glMapBufferRange(GL.GL_ARRAY_BUFFER, offset, length, GL2.GL_READ_WRITE);
- return null;
- }
-
-
- public void unmapBuffer(int target) {
- //gl2f.glUnmapBuffer(GL.GL_ARRAY_BUFFER);
- }
-
-
- ///////////////////////////////////////////////////////////
-
- // Framebuffers, renderbuffers
-
-
- public void genFramebuffers(int n, IntBuffer ids) {
- GLES20.glGenFramebuffers(n, ids);
- }
-
-
- public void deleteFramebuffers(int n, IntBuffer ids) {
- GLES20.glDeleteFramebuffers(n, ids);
- }
-
-
- public void bindFramebuffer(int target, int id) {
- GLES20.glBindFramebuffer(target, id);
- }
-
-
- public void genRenderbuffers(int n, IntBuffer ids) {
- GLES20.glGenRenderbuffers(n, ids);
- }
-
-
- public void deleteRenderbuffers(int n, IntBuffer ids) {
- GLES20.glDeleteRenderbuffers(n, ids);
- }
-
-
- public void blitFramebuffer(int srcX0, int srcY0, int srcX1, int srcY1,
- int dstX0, int dstY0, int dstX1, int dstY1,
- int mask, int filter) {
-// GLES20.glBlitFramebuffer(0, 0, srcW, srcH, 0, 0, destW, destH, GLES20.GL_COLOR_BUFFER_BIT, GLES20.GL_NEAREST);
- }
-
-
- public void framebufferTexture2D(int target, int attachment, int texTarget,
- int texId, int level) {
- GLES20.glFramebufferTexture2D(target, attachment, texTarget, texId, level);
- }
-
-
- public void bindRenderbuffer(int target, int id) {
- GLES20.glBindRenderbuffer(target, id);
- }
-
-
- public void renderbufferStorageMultisample(int target, int samples,
- int format, int width, int height){
-// GLES20.glRenderbufferStorageMultisample(GLES20.GL_RENDERBUFFER, samples, format, w, h);
- }
-
-
- public void renderbufferStorage(int target, int format,
- int width, int height) {
- GLES20.glRenderbufferStorage(target, format, width, height);
- }
-
-
- public void framebufferRenderbuffer(int target, int attachment,
- int rendbufTarget, int rendbufId) {
- GLES20.glFramebufferRenderbuffer(target, attachment, rendbufTarget,
- rendbufId);
- }
-
-
- public int checkFramebufferStatus(int target) {
- return GLES20.glCheckFramebufferStatus(target);
- }
-
-
- ///////////////////////////////////////////////////////////
-
- // Shaders
-
-
- public int createProgram() {
- return GLES20.glCreateProgram();
- }
-
-
- public void deleteProgram(int id) {
- GLES20.glDeleteProgram(id);
- }
-
-
- public int createShader(int type) {
- return GLES20.glCreateShader(type);
- }
-
-
- public void deleteShader(int id) {
- GLES20.glDeleteShader(id);
- }
-
-
- public void linkProgram(int prog) {
- GLES20.glLinkProgram(prog);
- }
-
-
- public void validateProgram(int prog) {
- GLES20.glValidateProgram(prog);
- }
-
-
- public void useProgram(int prog) {
- GLES20.glUseProgram(prog);
- }
-
-
- public int getAttribLocation(int prog, String name) {
- return GLES20.glGetAttribLocation(prog, name);
- }
-
-
- public int getUniformLocation(int prog, String name) {
- return GLES20.glGetUniformLocation(prog, name);
- }
-
-
- public void uniform1i(int loc, int value) {
- GLES20.glUniform1i(loc, value);
- }
-
-
- public void uniform2i(int loc, int value0, int value1) {
- GLES20.glUniform2i(loc, value0, value1);
- }
-
-
- public void uniform3i(int loc, int value0, int value1, int value2) {
- GLES20.glUniform3i(loc, value0, value1, value2);
- }
-
-
- public void uniform4i(int loc, int value0, int value1, int value2,
- int value3) {
- GLES20.glUniform4i(loc, value0, value1, value2, value3);
- }
-
-
- public void uniform1f(int loc, float value) {
- GLES20.glUniform1f(loc, value);
- }
-
-
- public void uniform2f(int loc, float value0, float value1) {
- GLES20.glUniform2f(loc, value0, value1);
- }
-
-
- public void uniform3f(int loc, float value0, float value1, float value2) {
- GLES20.glUniform3f(loc, value0, value1, value2);
- }
-
-
- public void uniform4f(int loc, float value0, float value1, float value2,
- float value3) {
- GLES20.glUniform4f(loc, value0, value1, value2, value3);
- }
-
-
- public void uniform1iv(int loc, int count, IntBuffer v) {
- GLES20.glUniform1iv(loc, count, v);
- }
-
-
- public void uniform2iv(int loc, int count, IntBuffer v) {
- GLES20.glUniform2iv(loc, count, v);
- }
-
-
- public void uniform3iv(int loc, int count, IntBuffer v) {
- GLES20.glUniform3iv(loc, count, v);
- }
-
-
- public void uniform4iv(int loc, int count, IntBuffer v) {
- GLES20.glUniform4iv(loc, count, v);
- }
-
-
- public void uniform1fv(int loc, int count, FloatBuffer v) {
- GLES20.glUniform1fv(loc, count, v);
- }
-
-
- public void uniform2fv(int loc, int count, FloatBuffer v) {
- GLES20.glUniform2fv(loc, count, v);
- }
-
-
- public void uniform3fv(int loc, int count, FloatBuffer v) {
- GLES20.glUniform3fv(loc, count, v);
- }
-
-
- public void uniform4fv(int loc, int count, FloatBuffer v) {
- GLES20.glUniform4fv(loc, count, v);
- }
-
-
- public void uniformMatrix2fv(int loc, int count, boolean transpose,
- FloatBuffer mat) {
- GLES20.glUniformMatrix2fv(loc, count, transpose, mat);
- }
-
-
- public void uniformMatrix3fv(int loc, int count, boolean transpose,
- FloatBuffer mat) {
- GLES20.glUniformMatrix3fv(loc, count, transpose, mat);
- }
-
-
- public void uniformMatrix4fv(int loc, int count, boolean transpose,
- FloatBuffer mat) {
- GLES20.glUniformMatrix4fv(loc, count, transpose, mat);
- }
-
-
- public void vertexAttrib1f(int loc, float value) {
- GLES20.glVertexAttrib1f(loc, value);
- }
-
-
- public void vertexAttrib2f(int loc, float value0, float value1) {
- GLES20.glVertexAttrib2f(loc, value0, value1);
- }
-
-
- public void vertexAttrib3f(int loc, float value0, float value1, float value2){
- GLES20.glVertexAttrib3f(loc, value0, value1, value2);
- }
-
-
- public void vertexAttrib4f(int loc, float value0, float value1, float value2,
- float value3) {
- GLES20.glVertexAttrib4f(loc, value0, value1, value2, value3);
- }
-
-
- public void vertexAttrib1fv(int loc, FloatBuffer v) {
- GLES20.glVertexAttrib1fv(loc, v);
- }
-
-
- public void vertexAttrib2fv(int loc, FloatBuffer v) {
- GLES20.glVertexAttrib2fv(loc, v);
- }
-
-
- public void vertexAttrib3fv(int loc, FloatBuffer v) {
- GLES20.glVertexAttrib3fv(loc, v);
- }
-
-
- public void vertexAttri4fv(int loc, FloatBuffer v) {
- GLES20.glVertexAttrib4fv(loc, v);
- }
-
-
- public void shaderSource(int id, String source) {
- GLES20.glShaderSource(id, source);
- }
-
-
- public void compileShader(int id) {
- GLES20.glCompileShader(id);
- }
-
-
- public void attachShader(int prog, int shader) {
- GLES20.glAttachShader(prog, shader);
- }
-
-
- public void getShaderiv(int shader, int pname, IntBuffer params) {
- GLES20.glGetShaderiv(shader, pname, params);
- }
-
-
- public String getShaderInfoLog(int shader) {
- return GLES20.glGetShaderInfoLog(shader);
- }
-
-
- public void getProgramiv(int prog, int pname, IntBuffer params) {
- GLES20.glGetProgramiv(prog, pname, params);
- }
-
-
- public String getProgramInfoLog(int prog) {
- return GLES20.glGetProgramInfoLog(prog);
- }
-
-
- ///////////////////////////////////////////////////////////
-
- // Viewport
-
-
- public void viewport(int x, int y, int width, int height) {
- GLES20.glViewport(x, y, width, height);
- }
-
-
- ///////////////////////////////////////////////////////////
-
- // Clipping (scissor test)
-
-
- public void scissor(int x, int y, int w, int h) {
- GLES20.glScissor(x, y, w, h);
- }
-
-
- ///////////////////////////////////////////////////////////
-
- // Blending
-
-
- public void blendEquation(int eq) {
- GLES20.glBlendEquation(eq);
- }
-
-
- public void blendFunc(int srcFactor, int dstFactor) {
- GLES20.glBlendFunc(srcFactor, dstFactor);
- }
-
-
- ///////////////////////////////////////////////////////////
-
- // Pixels
-
-
- public void readBuffer(int buf) {
-// GLES20.glReadBuffer(buf);
- }
-
-
- public void readPixels(int x, int y, int width, int height, int format,
- int type, Buffer buffer) {
- GLES20.glReadPixels(x, y, width, height, format, type, buffer);
- }
-
-
- public void drawBuffer(int buf) {
-// GLES20.glDrawBuffer(GLES20.GL_COLOR_ATTACHMENT0 + buf);
- }
-
-
- public void clearDepth(float d) {
- GLES20.glClearDepthf(d);
- }
-
-
- public void clearStencil(int s) {
- GLES20.glClearStencil(s);
- }
-
-
- public void colorMask(boolean wr, boolean wg, boolean wb, boolean wa) {
- GLES20.glColorMask(wr, wg, wb, wa);
- }
-
-
- public void clearColor(float r, float g, float b, float a) {
- GLES20.glClearColor(r, g, b, a);
- }
-
-
- public void clear(int mask) {
- GLES20.glClear(mask);
- }
-
-
- ///////////////////////////////////////////////////////////
-
- // Context interface
-
-
- protected int createEmptyContext() {
- return -1;
- }
-
-
- protected int getCurrentContext() {
- return context.hashCode();
- }
-
-
- ///////////////////////////////////////////////////////////
-
- // Tessellator interface
-
-
- protected Tessellator createTessellator(TessellatorCallback callback) {
- return new Tessellator(callback);
- }
-
-
- protected class Tessellator {
- protected PGLUtessellator tess;
- protected TessellatorCallback callback;
- protected GLUCallback gluCallback;
-
- public Tessellator(TessellatorCallback callback) {
- this.callback = callback;
- tess = PGLU.gluNewTess();
- gluCallback = new GLUCallback();
-
- PGLU.gluTessCallback(tess, PGLU.GLU_TESS_BEGIN, gluCallback);
- PGLU.gluTessCallback(tess, PGLU.GLU_TESS_END, gluCallback);
- PGLU.gluTessCallback(tess, PGLU.GLU_TESS_VERTEX, gluCallback);
- PGLU.gluTessCallback(tess, PGLU.GLU_TESS_COMBINE, gluCallback);
- PGLU.gluTessCallback(tess, PGLU.GLU_TESS_ERROR, gluCallback);
- }
-
- public void beginPolygon() {
- PGLU.gluTessBeginPolygon(tess, null);
- }
-
- public void endPolygon() {
- PGLU.gluTessEndPolygon(tess);
- }
-
- public void setWindingRule(int rule) {
- PGLU.gluTessProperty(tess, PGLU.GLU_TESS_WINDING_RULE, rule);
- }
-
- public void beginContour() {
- PGLU.gluTessBeginContour(tess);
- }
-
- public void endContour() {
- PGLU.gluTessEndContour(tess);
- }
-
- public void addVertex(double[] v) {
- PGLU.gluTessVertex(tess, v, 0, v);
- }
-
- protected class GLUCallback extends PGLUtessellatorCallbackAdapter {
- @Override
- public void begin(int type) {
- callback.begin(type);
- }
-
- @Override
- public void end() {
- callback.end();
- }
-
- @Override
- public void vertex(Object data) {
- callback.vertex(data);
- }
-
- @Override
- public void combine(double[] coords, Object[] data,
- float[] weight, Object[] outData) {
- callback.combine(coords, data, weight, outData);
- }
-
- @Override
- public void error(int errnum) {
- callback.error(errnum);
- }
- }
- }
-
-
- protected String tessError(int err) {
- return PGLU.gluErrorString(err);
- }
-
-
- protected interface TessellatorCallback {
- public void begin(int type);
- public void end();
- public void vertex(Object data);
- public void combine(double[] coords, Object[] data,
- float[] weight, Object[] outData);
- public void error(int errnum);
- }
-
-
- ///////////////////////////////////////////////////////////
-
- // Utility functions
-
-
- protected boolean contextIsCurrent(int other) {
- return other == -1 || other == context.hashCode();
- }
-
-
- protected void enableTexturing(int target) {
- if (target == TEXTURE_2D) {
- texturingTargets[0] = true;
- }
- }
-
-
- protected void disableTexturing(int target) {
- if (target == TEXTURE_2D) {
- texturingTargets[0] = false;
- }
- }
-
-
- protected boolean texturingIsEnabled(int target) {
- if (target == TEXTURE_2D) {
- return texturingTargets[0];
- } else {
- return false;
- }
- }
-
-
- protected boolean textureIsBound(int target, int id) {
- if (target == TEXTURE_2D) {
- return boundTextures[0] == id;
- } else {
- return false;
- }
- }
-
-
- protected void initTexture(int target, int format, int width, int height) {
- initTexture(target, format, width, height, 0);
- }
-
-
- protected void initTexture(int target, int format, int width, int height,
- int initColor) {
- // Doing in patches of 16x16 pixels to avoid creating a (potentially)
- // very large transient array which in certain situations (memory-
- // constrained android devices) might lead to an out-of-memory error.
- int[] glcolor = new int[16 * 16];
- Arrays.fill(glcolor, javaToNativeARGB(initColor));
- IntBuffer texels = PGL.allocateDirectIntBuffer(16 * 16);
- texels.put(glcolor);
- texels.rewind();
- for (int y = 0; y < height; y += 16) {
- int h = PApplet.min(16, height - y);
- for (int x = 0; x < width; x += 16) {
- int w = PApplet.min(16, width - x);
- texSubImage2D(target, 0, x, y, w, h, format, UNSIGNED_BYTE, texels);
- }
- }
- }
-
-
- protected void copyToTexture(int target, int format, int id, int x, int y,
- int w, int h, IntBuffer buffer) {
- activeTexture(TEXTURE0);
- boolean enabledTex = false;
- if (!texturingIsEnabled(target)) {
- enableTexturing(target);
- enabledTex = true;
- }
- bindTexture(target, id);
- texSubImage2D(target, 0, x, y, w, h, format, UNSIGNED_BYTE, buffer);
- bindTexture(target, 0);
- if (enabledTex) {
- disableTexturing(target);
- }
- }
-
-
- protected void drawTexture(int target, int id, int width, int height,
- int X0, int Y0, int X1, int Y1) {
- drawTexture(target, id, width, height, X0, Y0, X1, Y1, X0, Y0, X1, Y1);
- }
-
-
- protected void drawTexture(int target, int id, int width, int height,
- int texX0, int texY0, int texX1, int texY1,
- int scrX0, int scrY0, int scrX1, int scrY1) {
- if (!loadedTexShader ||
- texShaderContext.hashCode() != context.hashCode()) {
- texVertShader = createShader(VERTEX_SHADER, texVertShaderSource);
- texFragShader = createShader(FRAGMENT_SHADER, texFragShaderSource);
- if (0 < texVertShader && 0 < texFragShader) {
- texShaderProgram = createProgram(texVertShader, texFragShader);
- }
- if (0 < texShaderProgram) {
- texVertLoc = getAttribLocation(texShaderProgram, "inVertex");
- texTCoordLoc = getAttribLocation(texShaderProgram, "inTexcoord");
- }
- loadedTexShader = true;
- texShaderContext = context;
- }
-
- if (texData == null) {
- texData = allocateDirectFloatBuffer(texCoords.length);
- }
-
- if (0 < texShaderProgram) {
- // The texture overwrites anything drawn earlier.
- boolean depthTest = getDepthTest();
- disable(DEPTH_TEST);
-
- // When drawing the texture we don't write to the
- // depth mask, so the texture remains in the background
- // and can be occluded by anything drawn later, even if
- // if it is behind it.
- boolean depthMask = getDepthWriteMask();
- depthMask(false);
-
- useProgram(texShaderProgram);
-
- enableVertexAttribArray(texVertLoc);
- enableVertexAttribArray(texTCoordLoc);
-
- // Vertex coordinates of the textured quad are specified
- // in normalized screen space (-1, 1):
- // Corner 1
- texCoords[ 0] = 2 * (float)scrX0 / pg.width - 1;
- texCoords[ 1] = 2 * (float)scrY0 / pg.height - 1;
- texCoords[ 2] = (float)texX0 / width;
- texCoords[ 3] = (float)texY0 / height;
- // Corner 2
- texCoords[ 4] = 2 * (float)scrX1 / pg.width - 1;
- texCoords[ 5] = 2 * (float)scrY0 / pg.height - 1;
- texCoords[ 6] = (float)texX1 / width;
- texCoords[ 7] = (float)texY0 / height;
- // Corner 3
- texCoords[ 8] = 2 * (float)scrX0 / pg.width - 1;
- texCoords[ 9] = 2 * (float)scrY1 / pg.height - 1;
- texCoords[10] = (float)texX0 / width;
- texCoords[11] = (float)texY1 / height;
- // Corner 4
- texCoords[12] = 2 * (float)scrX1 / pg.width - 1;
- texCoords[13] = 2 * (float)scrY1 / pg.height - 1;
- texCoords[14] = (float)texX1 / width;
- texCoords[15] = (float)texY1 / height;
-
- texData.rewind();
- texData.put(texCoords);
-
- activeTexture(TEXTURE0);
- boolean enabledTex = false;
- if (!texturingIsEnabled(TEXTURE_2D)) {
- enableTexturing(TEXTURE_2D);
- enabledTex = true;
- }
- bindTexture(target, id);
-
- bindBuffer(ARRAY_BUFFER, 0); // Making sure that no VBO is bound at this point.
-
- texData.position(0);
- vertexAttribPointer(texVertLoc, 2, FLOAT, false, 4 * SIZEOF_FLOAT,
- texData);
- texData.position(2);
- vertexAttribPointer(texTCoordLoc, 2, FLOAT, false, 4 * SIZEOF_FLOAT,
- texData);
-
- drawArrays(TRIANGLE_STRIP, 0, 4);
-
- bindTexture(target, 0);
- if (enabledTex) {
- disableTexturing(TEXTURE_2D);
- }
-
- disableVertexAttribArray(texVertLoc);
- disableVertexAttribArray(texTCoordLoc);
-
- useProgram(0);
-
- if (depthTest) {
- enable(DEPTH_TEST);
- } else {
- disable(DEPTH_TEST);
- }
- depthMask(depthMask);
- }
- }
-
-
- protected int getColorValue(int scrX, int scrY) {
- if (colorBuffer == null) {
- colorBuffer = IntBuffer.allocate(1);
- }
- colorBuffer.rewind();
- readPixels(scrX, pg.height - scrY - 1, 1, 1, RGBA, UNSIGNED_BYTE,
- colorBuffer);
- return colorBuffer.get();
- }
-
-
- protected float getDepthValue(int scrX, int scrY) {
- // http://stackoverflow.com/questions/2596682/opengl-es-2-0-read-depth-buffer
- return 0;
- }
-
-
- protected byte getStencilValue(int scrX, int scrY) {
- return 0;
- }
-
-
- // bit shifting this might be more efficient
- protected static int nextPowerOfTwo(int val) {
- int ret = 1;
- while (ret < val) {
- ret <<= 1;
- }
- return ret;
- }
-
-
- /**
- * Converts input native OpenGL value (RGBA on big endian, ABGR on little
- * endian) to Java ARGB.
- */
- protected static int nativeToJavaARGB(int color) {
- if (BIG_ENDIAN) { // RGBA to ARGB
- return (color & 0xff000000) |
- ((color >> 8) & 0x00ffffff);
- } else { // ABGR to ARGB
- return (color & 0xff000000) |
- ((color << 16) & 0xff0000) |
- (color & 0xff00) |
- ((color >> 16) & 0xff);
- }
- }
-
-
- /**
- * Converts input array of native OpenGL values (RGBA on big endian, ABGR on
- * little endian) representing an image of width x height resolution to Java
- * ARGB. It also rearranges the elements in the array so that the image is
- * flipped vertically.
- */
- protected static void nativeToJavaARGB(int[] pixels, int width, int height) {
- int index = 0;
- int yindex = (height - 1) * width;
- for (int y = 0; y < height / 2; y++) {
- if (BIG_ENDIAN) { // RGBA to ARGB
- for (int x = 0; x < width; x++) {
- int temp = pixels[index];
- pixels[index] = (pixels[yindex] & 0xff000000) |
- ((pixels[yindex] >> 8) & 0x00ffffff);
- pixels[yindex] = (temp & 0xff000000) |
- ((temp >> 8) & 0x00ffffff);
- index++;
- yindex++;
- }
- } else { // ABGR to ARGB
- for (int x = 0; x < width; x++) {
- int temp = pixels[index];
- pixels[index] = (pixels[yindex] & 0xff000000) |
- ((pixels[yindex] << 16) & 0xff0000) |
- (pixels[yindex] & 0xff00) |
- ((pixels[yindex] >> 16) & 0xff);
- pixels[yindex] = (temp & 0xff000000) |
- ((temp << 16) & 0xff0000) |
- (temp & 0xff00) |
- ((temp >> 16) & 0xff);
- index++;
- yindex++;
- }
- }
- yindex -= width * 2;
- }
-
- // Flips image
- if ((height % 2) == 1) {
- index = (height / 2) * width;
- if (BIG_ENDIAN) { // RGBA to ARGB
- for (int x = 0; x < width; x++) {
- pixels[index] = (pixels[index] & 0xff000000) |
- ((pixels[index] >> 8) & 0x00ffffff);
- index++;
- }
- } else { // ABGR to ARGB
- for (int x = 0; x < width; x++) {
- pixels[index] = (pixels[index] & 0xff000000) |
- ((pixels[index] << 16) & 0xff0000) |
- (pixels[index] & 0xff00) |
- ((pixels[index] >> 16) & 0xff);
- index++;
- }
- }
- }
- }
-
-
- /**
- * Converts input native OpenGL value (RGBA on big endian, ABGR on little
- * endian) to Java RGB, so that the alpha component of the result is set
- * to opaque (255).
- */
- protected static int nativeToJavaRGB(int color) {
- if (BIG_ENDIAN) { // RGBA to ARGB
- return ((color << 8) & 0xffffff00) | 0xff;
- } else { // ABGR to ARGB
- return 0xff000000 | ((color << 16) & 0xff0000) |
- (color & 0xff00) |
- ((color >> 16) & 0xff);
- }
- }
-
-
- /**
- * Converts input array of native OpenGL values (RGBA on big endian, ABGR on
- * little endian) representing an image of width x height resolution to Java
- * RGB, so that the alpha component of all pixels is set to opaque (255). It
- * also rearranges the elements in the array so that the image is flipped
- * vertically.
- */
- protected static void nativeToJavaRGB(int[] pixels, int width, int height) {
- int index = 0;
- int yindex = (height - 1) * width;
- for (int y = 0; y < height / 2; y++) {
- if (BIG_ENDIAN) { // RGBA to ARGB
- for (int x = 0; x < width; x++) {
- int temp = pixels[index];
- pixels[index] = 0xff000000 | ((pixels[yindex] >> 8) & 0x00ffffff);
- pixels[yindex] = 0xff000000 | ((temp >> 8) & 0x00ffffff);
- index++;
- yindex++;
- }
- } else { // ABGR to ARGB
- for (int x = 0; x < width; x++) {
- int temp = pixels[index];
- pixels[index] = 0xff000000 | ((pixels[yindex] << 16) & 0xff0000) |
- (pixels[yindex] & 0xff00) |
- ((pixels[yindex] >> 16) & 0xff);
- pixels[yindex] = 0xff000000 | ((temp << 16) & 0xff0000) |
- (temp & 0xff00) |
- ((temp >> 16) & 0xff);
- index++;
- yindex++;
- }
- }
- yindex -= width * 2;
- }
-
- // Flips image
- if ((height % 2) == 1) {
- index = (height / 2) * width;
- if (BIG_ENDIAN) { // RGBA to ARGB
- for (int x = 0; x < width; x++) {
- pixels[index] = 0xff000000 | ((pixels[index] >> 8) & 0x00ffffff);
- index++;
- }
- } else { // ABGR to ARGB
- for (int x = 0; x < width; x++) {
- pixels[index] = 0xff000000 | ((pixels[index] << 16) & 0xff0000) |
- (pixels[index] & 0xff00) |
- ((pixels[index] >> 16) & 0xff);
- index++;
- }
- }
- }
- }
-
-
- /**
- * Converts input Java ARGB value to native OpenGL format (RGBA on big endian,
- * BGRA on little endian).
- */
- protected static int javaToNativeARGB(int color) {
- if (BIG_ENDIAN) { // ARGB to RGBA
- return ((color >> 24) & 0xff) |
- ((color << 8) & 0xffffff00);
- } else { // ARGB to ABGR
- return (color & 0xff000000) |
- ((color << 16) & 0xff0000) |
- (color & 0xff00) |
- ((color >> 16) & 0xff);
- }
- }
-
-
- /**
- * Converts input array of Java ARGB values representing an image of width x
- * height resolution to native OpenGL format (RGBA on big endian, BGRA on
- * little endian). It also rearranges the elements in the array so that the
- * image is flipped vertically.
- */
- protected static void javaToNativeARGB(int[] pixels, int width, int height) {
- int index = 0;
- int yindex = (height - 1) * width;
- for (int y = 0; y < height / 2; y++) {
- if (BIG_ENDIAN) { // ARGB to RGBA
- for (int x = 0; x < width; x++) {
- int temp = pixels[index];
- pixels[index] = ((pixels[yindex] >> 24) & 0xff) |
- ((pixels[yindex] << 8) & 0xffffff00);
- pixels[yindex] = ((temp >> 24) & 0xff) |
- ((temp << 8) & 0xffffff00);
- index++;
- yindex++;
- }
-
- } else { // ARGB to ABGR
- for (int x = 0; x < width; x++) {
- int temp = pixels[index];
- pixels[index] = (pixels[yindex] & 0xff000000) |
- ((pixels[yindex] << 16) & 0xff0000) |
- (pixels[yindex] & 0xff00) |
- ((pixels[yindex] >> 16) & 0xff);
- pixels[yindex] = (temp & 0xff000000) |
- ((temp << 16) & 0xff0000) |
- (temp & 0xff00) |
- ((temp >> 16) & 0xff);
- index++;
- yindex++;
- }
- }
- yindex -= width * 2;
- }
-
- // Flips image
- if ((height % 2) == 1) {
- index = (height / 2) * width;
- if (BIG_ENDIAN) { // ARGB to RGBA
- for (int x = 0; x < width; x++) {
- pixels[index] = ((pixels[index] >> 24) & 0xff) |
- ((pixels[index] << 8) & 0xffffff00);
- index++;
- }
- } else { // ARGB to ABGR
- for (int x = 0; x < width; x++) {
- pixels[index] = (pixels[index] & 0xff000000) |
- ((pixels[index] << 16) & 0xff0000) |
- (pixels[index] & 0xff00) |
- ((pixels[index] >> 16) & 0xff);
- index++;
- }
- }
- }
- }
-
-
- /**
- * Converts input Java ARGB value to native OpenGL format (RGBA on big endian,
- * BGRA on little endian), setting alpha component to opaque (255).
- */
- protected static int javaToNativeRGB(int color) {
- if (BIG_ENDIAN) { // ARGB to RGBA
- return ((color << 8) & 0xffffff00) | 0xff;
- } else { // ARGB to ABGR
- return 0xff000000 | ((color << 16) & 0xff0000) |
- (color & 0xff00) |
- ((color >> 16) & 0xff);
- }
- }
-
-
- /**
- * Converts input array of Java ARGB values representing an image of width x
- * height resolution to native OpenGL format (RGBA on big endian, BGRA on
- * little endian), while setting alpha component of all pixels to opaque
- * (255). It also rearranges the elements in the array so that the image is
- * flipped vertically.
- */
- protected static void javaToNativeRGB(int[] pixels, int width, int height) {
- int index = 0;
- int yindex = (height - 1) * width;
- for (int y = 0; y < height / 2; y++) {
- if (BIG_ENDIAN) { // ARGB to RGBA
- for (int x = 0; x < width; x++) {
- int temp = pixels[index];
- pixels[index] = ((pixels[yindex] << 8) & 0xffffff00) | 0xff;
- pixels[yindex] = ((temp << 8) & 0xffffff00) | 0xff;
- index++;
- yindex++;
- }
-
- } else {
- for (int x = 0; x < width; x++) { // ARGB to ABGR
- int temp = pixels[index];
- pixels[index] = 0xff000000 | ((pixels[yindex] << 16) & 0xff0000) |
- (pixels[yindex] & 0xff00) |
- ((pixels[yindex] >> 16) & 0xff);
- pixels[yindex] = 0xff000000 | ((temp << 16) & 0xff0000) |
- (temp & 0xff00) |
- ((temp >> 16) & 0xff);
- index++;
- yindex++;
- }
- }
- yindex -= width * 2;
- }
-
- // Flips image
- if ((height % 2) == 1) { // ARGB to RGBA
- index = (height / 2) * width;
- if (BIG_ENDIAN) {
- for (int x = 0; x < width; x++) {
- pixels[index] = ((pixels[index] << 8) & 0xffffff00) | 0xff;
- index++;
- }
- } else { // ARGB to ABGR
- for (int x = 0; x < width; x++) {
- pixels[index] = 0xff000000 | ((pixels[index] << 16) & 0xff0000) |
- (pixels[index] & 0xff00) |
- ((pixels[index] >> 16) & 0xff);
- index++;
- }
- }
- }
- }
-
-
- protected int createShader(int shaderType, String source) {
- int shader = createShader(shaderType);
- if (shader != 0) {
- shaderSource(shader, source);
- compileShader(shader);
- if (!compiled(shader)) {
- System.err.println("Could not compile shader " + shaderType + ":");
- System.err.println(getShaderInfoLog(shader));
- deleteShader(shader);
- shader = 0;
- }
- }
- return shader;
- }
-
-
- protected int createProgram(int vertexShader, int fragmentShader) {
- int program = createProgram();
- if (program != 0) {
- attachShader(program, vertexShader);
- attachShader(program, fragmentShader);
- linkProgram(program);
- if (!linked(program)) {
- System.err.println("Could not link program: ");
- System.err.println(getProgramInfoLog(program));
- deleteProgram(program);
- program = 0;
- }
- }
- return program;
- }
-
-
- protected boolean compiled(int shader) {
- intBuffer.rewind();
- getShaderiv(shader, COMPILE_STATUS, intBuffer);
- return intBuffer.get(0) == 0 ? false : true;
- }
-
-
- protected boolean linked(int program) {
- intBuffer.rewind();
- getProgramiv(program, LINK_STATUS, intBuffer);
- return intBuffer.get(0) == 0 ? false : true;
- }
-
-
- protected boolean validateFramebuffer() {
- int status = checkFramebufferStatus(FRAMEBUFFER);
- if (status == FRAMEBUFFER_COMPLETE) {
- return true;
- } else if (status == FRAMEBUFFER_INCOMPLETE_ATTACHMENT) {
- System.err.println(String.format(FRAMEBUFFER_ERROR_MESSAGE,
- "incomplete attachment"));
- } else if (status == FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT) {
- System.err.println(String.format(FRAMEBUFFER_ERROR_MESSAGE,
- "incomplete missing attachment"));
- } else if (status == FRAMEBUFFER_INCOMPLETE_DIMENSIONS) {
- System.err.println(String.format(FRAMEBUFFER_ERROR_MESSAGE,
- "incomplete dimensions"));
- } else if (status == FRAMEBUFFER_INCOMPLETE_FORMATS) {
- System.err.println(String.format(FRAMEBUFFER_ERROR_MESSAGE,
- "incomplete formats"));
- } else if (status == FRAMEBUFFER_UNSUPPORTED) {
- System.err.println(String.format(FRAMEBUFFER_ERROR_MESSAGE,
- "framebuffer unsupported"));
- } else {
- System.err.println(String.format(FRAMEBUFFER_ERROR_MESSAGE,
- "unknown error"));
- }
- return false;
- }
-
-
- protected int[] getGLVersion() {
- String version = getString(VERSION).trim();
- int[] res = {0, 0, 0};
- String[] parts = version.split(" ");
- for (int i = 0; i < parts.length; i++) {
- if (0 < parts[i].indexOf(".")) {
- String nums[] = parts[i].split("\\.");
- try {
- res[0] = Integer.parseInt(nums[0]);
- } catch (NumberFormatException e) { }
- if (1 < nums.length) {
- try {
- res[1] = Integer.parseInt(nums[1]);
- } catch (NumberFormatException e) { }
- }
- if (2 < nums.length) {
- try {
- res[2] = Integer.parseInt(nums[2]);
- } catch (NumberFormatException e) { }
- }
- break;
- }
- }
- return res;
- }
-
-
- protected static ByteBuffer allocateDirectByteBuffer(int size) {
- int bytes = PApplet.max(MIN_DIRECT_BUFFER_SIZE, size) * SIZEOF_BYTE;
- return ByteBuffer.allocateDirect(bytes).order(ByteOrder.nativeOrder());
- }
-
-
- protected static ByteBuffer allocateByteBuffer(int size) {
- if (USE_DIRECT_BUFFERS) {
- return allocateDirectByteBuffer(size);
- } else {
- return ByteBuffer.allocate(size);
- }
- }
-
-
- protected static ByteBuffer allocateByteBuffer(byte[] arr) {
- if (USE_DIRECT_BUFFERS) {
- return PGL.allocateDirectByteBuffer(arr.length);
- } else {
- return ByteBuffer.wrap(arr);
- }
- }
-
-
- protected static ByteBuffer updateByteBuffer(ByteBuffer buf, byte[] arr,
- boolean wrap) {
- if (USE_DIRECT_BUFFERS) {
- if (buf == null || buf.capacity() < arr.length) {
- buf = PGL.allocateDirectByteBuffer(arr.length);
- }
- buf.position(0);
- buf.put(arr);
- buf.rewind();
- } else {
- if (wrap) {
- buf = ByteBuffer.wrap(arr);
- } else {
- if (buf == null || buf.capacity() < arr.length) {
- buf = ByteBuffer.allocate(arr.length);
- }
- buf.position(0);
- buf.put(arr);
- buf.rewind();
- }
- }
- return buf;
- }
-
-
- protected static void updateByteBuffer(ByteBuffer buf, byte[] arr,
- int offset, int size) {
- if (USE_DIRECT_BUFFERS || (buf.hasArray() && buf.array() != arr)) {
- buf.position(offset);
- buf.put(arr, offset, size);
- buf.rewind();
- }
- }
-
-
- protected static void getByteArray(ByteBuffer buf, byte[] arr) {
- if (!buf.hasArray() || buf.array() != arr) {
- buf.position(0);
- buf.get(arr);
- buf.rewind();
- }
- }
-
-
- protected static void putByteArray(ByteBuffer buf, byte[] arr) {
- if (!buf.hasArray() || buf.array() != arr) {
- buf.position(0);
- buf.put(arr);
- buf.rewind();
- }
- }
-
-
- protected static void fillByteBuffer(ByteBuffer buf, int i0, int i1,
- byte val) {
- int n = i1 - i0;
- byte[] temp = new byte[n];
- Arrays.fill(temp, 0, n, val);
- buf.position(i0);
- buf.put(temp, 0, n);
- buf.rewind();
- }
-
-
- protected static ShortBuffer allocateDirectShortBuffer(int size) {
- int bytes = PApplet.max(MIN_DIRECT_BUFFER_SIZE, size) * SIZEOF_SHORT;
- return ByteBuffer.allocateDirect(bytes).order(ByteOrder.nativeOrder()).
- asShortBuffer();
- }
-
-
- protected static ShortBuffer allocateShortBuffer(int size) {
- if (USE_DIRECT_BUFFERS) {
- return allocateDirectShortBuffer(size);
- } else {
- return ShortBuffer.allocate(size);
- }
- }
-
-
- protected static ShortBuffer allocateShortBuffer(short[] arr) {
- if (USE_DIRECT_BUFFERS) {
- return PGL.allocateDirectShortBuffer(arr.length);
- } else {
- return ShortBuffer.wrap(arr);
- }
- }
-
-
- protected static ShortBuffer updateShortBuffer(ShortBuffer buf, short[] arr,
- boolean wrap) {
- if (USE_DIRECT_BUFFERS) {
- if (buf == null || buf.capacity() < arr.length) {
- buf = PGL.allocateDirectShortBuffer(arr.length);
- }
- buf.position(0);
- buf.put(arr);
- buf.rewind();
- } else {
- if (wrap) {
- buf = ShortBuffer.wrap(arr);
- } else {
- if (buf == null || buf.capacity() < arr.length) {
- buf = ShortBuffer.allocate(arr.length);
- }
- buf.position(0);
- buf.put(arr);
- buf.rewind();
- }
- }
- return buf;
- }
-
-
- protected static void updateShortBuffer(ShortBuffer buf, short[] arr,
- int offset, int size) {
- if (USE_DIRECT_BUFFERS || (buf.hasArray() && buf.array() != arr)) {
- buf.position(offset);
- buf.put(arr, offset, size);
- buf.rewind();
- }
- }
-
-
- protected static void getShortArray(ShortBuffer buf, short[] arr) {
- if (!buf.hasArray() || buf.array() != arr) {
- buf.position(0);
- buf.get(arr);
- buf.rewind();
- }
- }
-
-
- protected static void putShortArray(ShortBuffer buf, short[] arr) {
- if (!buf.hasArray() || buf.array() != arr) {
- buf.position(0);
- buf.put(arr);
- buf.rewind();
- }
- }
-
-
- protected static void fillShortBuffer(ShortBuffer buf, int i0, int i1,
- short val) {
- int n = i1 - i0;
- short[] temp = new short[n];
- Arrays.fill(temp, 0, n, val);
- buf.position(i0);
- buf.put(temp, 0, n);
- buf.rewind();
- }
-
-
- protected static IntBuffer allocateDirectIntBuffer(int size) {
- int bytes = PApplet.max(MIN_DIRECT_BUFFER_SIZE, size) * SIZEOF_INT;
- return ByteBuffer.allocateDirect(bytes).order(ByteOrder.nativeOrder()).
- asIntBuffer();
- }
-
-
- protected static IntBuffer allocateIntBuffer(int size) {
- if (USE_DIRECT_BUFFERS) {
- return allocateDirectIntBuffer(size);
- } else {
- return IntBuffer.allocate(size);
- }
- }
-
-
- protected static IntBuffer allocateIntBuffer(int[] arr) {
- if (USE_DIRECT_BUFFERS) {
- return PGL.allocateDirectIntBuffer(arr.length);
- } else {
- return IntBuffer.wrap(arr);
- }
- }
-
-
- protected static IntBuffer updateIntBuffer(IntBuffer buf, int[] arr,
- boolean wrap) {
- if (USE_DIRECT_BUFFERS) {
- if (buf == null || buf.capacity() < arr.length) {
- buf = PGL.allocateDirectIntBuffer(arr.length);
- }
- buf.position(0);
- buf.put(arr);
- buf.rewind();
- } else {
- if (wrap) {
- buf = IntBuffer.wrap(arr);
- } else {
- if (buf == null || buf.capacity() < arr.length) {
- buf = IntBuffer.allocate(arr.length);
- }
- buf.position(0);
- buf.put(arr);
- buf.rewind();
- }
- }
- return buf;
- }
-
-
- protected static void updateIntBuffer(IntBuffer buf, int[] arr,
- int offset, int size) {
- if (USE_DIRECT_BUFFERS || (buf.hasArray() && buf.array() != arr)) {
- buf.position(offset);
- buf.put(arr, offset, size);
- buf.rewind();
- }
- }
-
-
- protected static void getIntArray(IntBuffer buf, int[] arr) {
- if (!buf.hasArray() || buf.array() != arr) {
- buf.position(0);
- buf.get(arr);
- buf.rewind();
- }
- }
-
-
- protected static void putIntArray(IntBuffer buf, int[] arr) {
- if (!buf.hasArray() || buf.array() != arr) {
- buf.position(0);
- buf.put(arr);
- buf.rewind();
- }
- }
-
-
- protected static void fillIntBuffer(IntBuffer buf, int i0, int i1, int val) {
- int n = i1 - i0;
- int[] temp = new int[n];
- Arrays.fill(temp, 0, n, val);
- buf.position(i0);
- buf.put(temp, 0, n);
- buf.rewind();
- }
-
-
- protected static FloatBuffer allocateDirectFloatBuffer(int size) {
- int bytes = PApplet.max(MIN_DIRECT_BUFFER_SIZE, size) * SIZEOF_FLOAT;
- return ByteBuffer.allocateDirect(bytes).order(ByteOrder.nativeOrder()).
- asFloatBuffer();
- }
-
-
- protected static FloatBuffer allocateFloatBuffer(int size) {
- if (USE_DIRECT_BUFFERS) {
- return allocateDirectFloatBuffer(size);
- } else {
- return FloatBuffer.allocate(size);
- }
- }
-
-
- protected static FloatBuffer allocateFloatBuffer(float[] arr) {
- if (USE_DIRECT_BUFFERS) {
- return PGL.allocateDirectFloatBuffer(arr.length);
- } else {
- return FloatBuffer.wrap(arr);
- }
- }
-
-
- protected static FloatBuffer updateFloatBuffer(FloatBuffer buf, float[] arr,
- boolean wrap) {
- if (USE_DIRECT_BUFFERS) {
- if (buf == null || buf.capacity() < arr.length) {
- buf = PGL.allocateDirectFloatBuffer(arr.length);
- }
- buf.position(0);
- buf.put(arr);
- buf.rewind();
- } else {
- if (wrap) {
- buf = FloatBuffer.wrap(arr);
- } else {
- if (buf == null || buf.capacity() < arr.length) {
- buf = FloatBuffer.allocate(arr.length);
- }
- buf.position(0);
- buf.put(arr);
- buf.rewind();
- }
- }
- return buf;
- }
-
-
- protected static void updateFloatBuffer(FloatBuffer buf, float[] arr,
- int offset, int size) {
- if (USE_DIRECT_BUFFERS || (buf.hasArray() && buf.array() != arr)) {
- buf.position(offset);
- buf.put(arr, offset, size);
- buf.rewind();
- }
- }
-
-
- protected static void getFloatArray(FloatBuffer buf, float[] arr) {
- if (!buf.hasArray() || buf.array() != arr) {
- buf.position(0);
- buf.get(arr);
- buf.rewind();
- }
- }
-
-
- protected static void putFloatArray(FloatBuffer buf, float[] arr) {
- if (!buf.hasArray() || buf.array() != arr) {
- buf.position(0);
- buf.put(arr);
- buf.rewind();
- }
- }
-
-
- protected static void fillFloatBuffer(FloatBuffer buf, int i0, int i1,
- float val) {
- int n = i1 - i0;
- float[] temp = new float[n];
- Arrays.fill(temp, 0, n, val);
- buf.position(i0);
- buf.put(temp, 0, n);
- buf.rewind();
- }
-
-
- ///////////////////////////////////////////////////////////
-
- // Android specific stuff
-
-
- public AndroidRenderer getRenderer() {
- renderer = new AndroidRenderer();
- return renderer;
- }
-
-
- public AndroidContextFactory getContextFactory() {
- return new AndroidContextFactory();
- }
-
-
- public AndroidConfigChooser getConfigChooser(int r, int g, int b, int a,
- int d, int s) {
- return new AndroidConfigChooser(r, g, b, a, d, s);
- }
-
-
- protected class AndroidRenderer implements Renderer {
- public AndroidRenderer() {
- }
-
- public void onDrawFrame(GL10 igl) {
- gl = igl;
- glThread = Thread.currentThread();
- pg.parent.handleDraw();
- }
-
- public void onSurfaceChanged(GL10 igl, int iwidth, int iheight) {
- gl = igl;
-
- // Here is where we should initialize native libs...
- // lib.init(iwidth, iheight);
-
- pg.setSize(iwidth, iheight);
- }
-
- public void onSurfaceCreated(GL10 igl, EGLConfig config) {
- gl = igl;
- context = ((EGL10)EGLContext.getEGL()).eglGetCurrentContext();
- }
- }
-
-
- protected class AndroidContextFactory implements
- GLSurfaceView.EGLContextFactory {
- public EGLContext createContext(EGL10 egl, EGLDisplay display,
- EGLConfig eglConfig) {
- int[] attrib_list = { EGL_CONTEXT_CLIENT_VERSION, 2,
- EGL10.EGL_NONE };
- EGLContext context = egl.eglCreateContext(display, eglConfig,
- EGL10.EGL_NO_CONTEXT,
- attrib_list);
- return context;
- }
-
- public void destroyContext(EGL10 egl, EGLDisplay display,
- EGLContext context) {
- egl.eglDestroyContext(display, context);
- }
- }
-
-
- protected class AndroidConfigChooser implements EGLConfigChooser {
- // Desired size (in bits) for the rgba color, depth and stencil buffers.
- public int redTarget;
- public int greenTarget;
- public int blueTarget;
- public int alphaTarget;
- public int depthTarget;
- public int stencilTarget;
-
- // Actual rgba color, depth and stencil sizes (in bits) supported by the
- // device.
- public int redBits;
- public int greenBits;
- public int blueBits;
- public int alphaBits;
- public int depthBits;
- public int stencilBits;
- public int[] tempValue = new int[1];
-
- // The attributes we want in the frame buffer configuration for Processing.
- // For more details on other attributes, see:
- // http://www.khronos.org/opengles/documentation/opengles1_0/html/eglChooseConfig.html
- protected int[] configAttribsGL = { EGL10.EGL_RED_SIZE, 4,
- EGL10.EGL_GREEN_SIZE, 4,
- EGL10.EGL_BLUE_SIZE, 4,
- EGL10.EGL_RENDERABLE_TYPE,
- EGL_OPENGL_ES2_BIT,
- EGL10.EGL_NONE };
-
- public AndroidConfigChooser(int r, int g, int b, int a, int d, int s) {
- redTarget = r;
- greenTarget = g;
- blueTarget = b;
- alphaTarget = a;
- depthTarget = d;
- stencilTarget = s;
- }
-
- public EGLConfig chooseConfig(EGL10 egl, EGLDisplay display) {
-
- // Get the number of minimally matching EGL configurations
- int[] num_config = new int[1];
- egl.eglChooseConfig(display, configAttribsGL, null, 0, num_config);
-
- int numConfigs = num_config[0];
-
- if (numConfigs <= 0) {
- throw new IllegalArgumentException("No EGL configs match configSpec");
- }
-
- // Allocate then read the array of minimally matching EGL configs
- EGLConfig[] configs = new EGLConfig[numConfigs];
- egl.eglChooseConfig(display, configAttribsGL, configs, numConfigs,
- num_config);
-
- if (PApplet.DEBUG) {
- for (EGLConfig config : configs) {
- String configStr = "P3D - selected EGL config : "
- + printConfig(egl, display, config);
- System.out.println(configStr);
- }
- }
-
- // Now return the configuration that best matches the target one.
- return chooseBestConfig(egl, display, configs);
- }
-
- public EGLConfig chooseBestConfig(EGL10 egl, EGLDisplay display,
- EGLConfig[] configs) {
- EGLConfig bestConfig = null;
- float bestScore = 1000;
-
- for (EGLConfig config : configs) {
- int gl = findConfigAttrib(egl, display, config,
- EGL10.EGL_RENDERABLE_TYPE, 0);
- if (gl == EGL_OPENGL_ES2_BIT) {
- int d = findConfigAttrib(egl, display, config,
- EGL10.EGL_DEPTH_SIZE, 0);
- int s = findConfigAttrib(egl, display, config,
- EGL10.EGL_STENCIL_SIZE, 0);
-
- int r = findConfigAttrib(egl, display, config,
- EGL10.EGL_RED_SIZE, 0);
- int g = findConfigAttrib(egl, display, config,
- EGL10.EGL_GREEN_SIZE, 0);
- int b = findConfigAttrib(egl, display, config,
- EGL10.EGL_BLUE_SIZE, 0);
- int a = findConfigAttrib(egl, display, config,
- EGL10.EGL_ALPHA_SIZE, 0);
-
- float score = 0.20f * PApplet.abs(r - redTarget) +
- 0.20f * PApplet.abs(g - greenTarget) +
- 0.20f * PApplet.abs(b - blueTarget) +
- 0.15f * PApplet.abs(a - blueTarget) +
- 0.15f * PApplet.abs(d - depthTarget) +
- 0.10f * PApplet.abs(s - stencilTarget);
-
- if (score < bestScore) {
- // We look for the config closest to the target config.
- // Closeness is measured by the score function defined above:
- // we give more weight to the RGB components, followed by the
- // alpha, depth and finally stencil bits.
- bestConfig = config;
- bestScore = score;
-
- redBits = r;
- greenBits = g;
- blueBits = b;
- alphaBits = a;
- depthBits = d;
- stencilBits = s;
- }
- }
- }
-
- if (PApplet.DEBUG) {
- String configStr = "P3D - selected EGL config : "
- + printConfig(egl, display, bestConfig);
- System.out.println(configStr);
- }
- return bestConfig;
- }
-
- protected String printConfig(EGL10 egl, EGLDisplay display,
- EGLConfig config) {
- int r = findConfigAttrib(egl, display, config,
- EGL10.EGL_RED_SIZE, 0);
- int g = findConfigAttrib(egl, display, config,
- EGL10.EGL_GREEN_SIZE, 0);
- int b = findConfigAttrib(egl, display, config,
- EGL10.EGL_BLUE_SIZE, 0);
- int a = findConfigAttrib(egl, display, config,
- EGL10.EGL_ALPHA_SIZE, 0);
- int d = findConfigAttrib(egl, display, config,
- EGL10.EGL_DEPTH_SIZE, 0);
- int s = findConfigAttrib(egl, display, config,
- EGL10.EGL_STENCIL_SIZE, 0);
- int type = findConfigAttrib(egl, display, config,
- EGL10.EGL_RENDERABLE_TYPE, 0);
- int nat = findConfigAttrib(egl, display, config,
- EGL10.EGL_NATIVE_RENDERABLE, 0);
- int bufSize = findConfigAttrib(egl, display, config,
- EGL10.EGL_BUFFER_SIZE, 0);
- int bufSurf = findConfigAttrib(egl, display, config,
- EGL10.EGL_RENDER_BUFFER, 0);
-
- return String.format("EGLConfig rgba=%d%d%d%d depth=%d stencil=%d",
- r,g,b,a,d,s)
- + " type=" + type
- + " native=" + nat
- + " buffer size=" + bufSize
- + " buffer surface=" + bufSurf +
- String.format(" caveat=0x%04x",
- findConfigAttrib(egl, display, config,
- EGL10.EGL_CONFIG_CAVEAT, 0));
- }
-
- protected int findConfigAttrib(EGL10 egl, EGLDisplay display,
- EGLConfig config, int attribute, int defaultValue) {
- if (egl.eglGetConfigAttrib(display, config, attribute, tempValue)) {
- return tempValue[0];
- }
- return defaultValue;
- }
- }
-}
diff --git a/android/core/src/processing/opengl/PGraphics2D.java b/android/core/src/processing/opengl/PGraphics2D.java
deleted file mode 100644
index 21a5165547..0000000000
--- a/android/core/src/processing/opengl/PGraphics2D.java
+++ /dev/null
@@ -1,622 +0,0 @@
-/* -*- mode: java; c-basic-offset: 2; indent-tabs-mode: nil -*- */
-
-/*
- Part of the Processing project - http://processing.org
-
- Copyright (c) 2012 Ben Fry and Casey Reas
-
- This library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Lesser General Public
- License version 2.1 as published by the Free Software Foundation.
-
- This library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License for more details.
-
- You should have received a copy of the GNU Lesser General
- Public License along with this library; if not, write to the
- Free Software Foundation, Inc., 59 Temple Place, Suite 330,
- Boston, MA 02111-1307 USA
- */
-
-package processing.opengl;
-
-import java.io.InputStream;
-import java.util.zip.GZIPInputStream;
-
-import processing.core.PApplet;
-import processing.core.PConstants;
-import processing.core.PGraphics;
-import processing.core.PMatrix3D;
-import processing.core.PShape;
-import processing.core.PShapeSVG;
-import processing.data.XML;
-
-public class PGraphics2D extends PGraphicsOpenGL {
-
- public PGraphics2D() {
- super();
- }
-
-
- //////////////////////////////////////////////////////////////
-
- // RENDERER SUPPORT QUERIES
-
-
- @Override
- public boolean is2D() {
- return true;
- }
-
-
- @Override
- public boolean is3D() {
- return false;
- }
-
-
- //////////////////////////////////////////////////////////////
-
- // HINTS
-
-
- @Override
- public void hint(int which) {
- if (which == ENABLE_STROKE_PERSPECTIVE) {
- showWarning("Strokes cannot be perspective-corrected in 2D.");
- return;
- }
- super.hint(which);
- }
-
-
- //////////////////////////////////////////////////////////////
-
- // PROJECTION
-
-
- @Override
- public void ortho() {
- showMethodWarning("ortho");
- }
-
-
- @Override
- public void ortho(float left, float right,
- float bottom, float top) {
- showMethodWarning("ortho");
- }
-
-
- @Override
- public void ortho(float left, float right,
- float bottom, float top,
- float near, float far) {
- showMethodWarning("ortho");
- }
-
-
- @Override
- public void perspective() {
- showMethodWarning("perspective");
- }
-
-
- @Override
- public void perspective(float fov, float aspect, float zNear, float zFar) {
- showMethodWarning("perspective");
- }
-
-
- @Override
- public void frustum(float left, float right, float bottom, float top,
- float znear, float zfar) {
- showMethodWarning("frustum");
- }
-
-
- @Override
- protected void defaultPerspective() {
- super.ortho(0, width, 0, height, -1, +1);
- }
-
-
- //////////////////////////////////////////////////////////////
-
- // CAMERA
-
-
- @Override
- public void beginCamera() {
- showMethodWarning("beginCamera");
- }
-
-
- @Override
- public void endCamera() {
- showMethodWarning("endCamera");
- }
-
-
- @Override
- public void camera() {
- showMethodWarning("camera");
- }
-
-
- @Override
- public void camera(float eyeX, float eyeY, float eyeZ,
- float centerX, float centerY, float centerZ,
- float upX, float upY, float upZ) {
- showMethodWarning("camera");
- }
-
-
- @Override
- protected void defaultCamera() {
- super.camera(width/2, height/2);
- }
-
-
- //////////////////////////////////////////////////////////////
-
- // MATRIX MORE!
-
-
- @Override
- protected void begin2D() {
- pushProjection();
- defaultPerspective();
- pushMatrix();
- defaultCamera();
- }
-
-
- @Override
- protected void end2D() {
- popMatrix();
- popProjection();
- }
-
-
- //////////////////////////////////////////////////////////////
-
- // SHAPE
-
-
- @Override
- public void shape(PShape shape) {
- if (shape.is2D()) {
- super.shape(shape);
- } else {
- showWarning("The shape object is not 2D, cannot be displayed with " +
- "this renderer");
- }
- }
-
-
- @Override
- public void shape(PShape shape, float x, float y) {
- if (shape.is2D()) {
- super.shape(shape, x, y);
- } else {
- showWarning("The shape object is not 2D, cannot be displayed with " +
- "this renderer");
- }
- }
-
-
- @Override
- public void shape(PShape shape, float a, float b, float c, float d) {
- if (shape.is2D()) {
- super.shape(shape, a, b, c, d);
- } else {
- showWarning("The shape object is not 2D, cannot be displayed with " +
- "this renderer");
- }
- }
-
-
- @Override
- public void shape(PShape shape, float x, float y, float z) {
- showDepthWarningXYZ("shape");
- }
-
-
- @Override
- public void shape(PShape shape, float x, float y, float z,
- float c, float d, float e) {
- showDepthWarningXYZ("shape");
- }
-
-
- //////////////////////////////////////////////////////////////
-
- // SHAPE I/O
-
-
- static protected boolean isSupportedExtension(String extension) {
- return extension.equals("svg") || extension.equals("svgz");
- }
-
-
- static protected PShape loadShapeImpl(PGraphics pg, String filename,
- String extension) {
- PShapeSVG svg = null;
-
- if (extension.equals("svg")) {
- svg = new PShapeSVG(pg.parent.loadXML(filename));
-
- } else if (extension.equals("svgz")) {
- try {
- InputStream input =
- new GZIPInputStream(pg.parent.createInput(filename));
- XML xml = new XML(input);
- svg = new PShapeSVG(xml);
- } catch (Exception e) {
- e.printStackTrace();
- }
- }
-
- if (svg != null) {
- PShapeOpenGL p2d = PShapeOpenGL.createShape2D(pg.parent, svg);
- return p2d;
- } else {
- return null;
- }
- }
-
-
- //////////////////////////////////////////////////////////////
-
- // SHAPE CREATION
-
-
- @Override
- public PShape createShape(PShape source) {
- return PShapeOpenGL.createShape2D(parent, source);
- }
-
-
- @Override
- public PShape createShape() {
- return createShape(PShape.GEOMETRY);
- }
-
-
- @Override
- public PShape createShape(int type) {
- return createShapeImpl(parent, type);
- }
-
-
- @Override
- public PShape createShape(int kind, float... p) {
- return createShapeImpl(parent, kind, p);
- }
-
-
- static protected PShapeOpenGL createShapeImpl(PApplet parent, int type) {
- PShapeOpenGL shape = null;
- if (type == PConstants.GROUP) {
- shape = new PShapeOpenGL(parent, PConstants.GROUP);
- } else if (type == PShape.PATH) {
- shape = new PShapeOpenGL(parent, PShape.PATH);
- } else if (type == PShape.GEOMETRY) {
- shape = new PShapeOpenGL(parent, PShape.GEOMETRY);
- }
-
- /*
- if (type == POINTS) {
- shape = new PShapeOpenGL(parent, PShape.GEOMETRY);
- shape.setKind(POINTS);
- } else if (type == LINES) {
- shape = new PShapeOpenGL(parent, PShape.GEOMETRY);
- shape.setKind(LINES);
- } else if (type == TRIANGLE || type == TRIANGLES) {
- shape = new PShapeOpenGL(parent, PShape.GEOMETRY);
- shape.setKind(TRIANGLES);
- } else if (type == TRIANGLE_FAN) {
- shape = new PShapeOpenGL(parent, PShape.GEOMETRY);
- shape.setKind(TRIANGLE_FAN);
- } else if (type == TRIANGLE_STRIP) {
- shape = new PShapeOpenGL(parent, PShape.GEOMETRY);
- shape.setKind(TRIANGLE_STRIP);
- } else if (type == QUAD || type == QUADS) {
- shape = new PShapeOpenGL(parent, PShape.GEOMETRY);
- shape.setKind(QUADS);
- } else if (type == QUAD_STRIP) {
- shape = new PShapeOpenGL(parent, PShape.GEOMETRY);
- shape.setKind(QUAD_STRIP);
- } else if (type == POLYGON) {
- shape = new PShapeOpenGL(parent, PShape.GEOMETRY);
- shape.setKind(POLYGON);
- }
- */
-
- shape.is3D(false);
- return shape;
- }
-
-
- static protected PShapeOpenGL createShapeImpl(PApplet parent,
- int kind, float... p) {
- PShapeOpenGL shape = null;
- int len = p.length;
-
- if (kind == POINT) {
- if (len != 2) {
- showWarning("Wrong number of parameters");
- return null;
- }
- shape = new PShapeOpenGL(parent, PShape.PRIMITIVE);
- shape.setKind(POINT);
- } else if (kind == LINE) {
- if (len != 4) {
- showWarning("Wrong number of parameters");
- return null;
- }
- shape = new PShapeOpenGL(parent, PShape.PRIMITIVE);
- shape.setKind(LINE);
- } else if (kind == TRIANGLE) {
- if (len != 6) {
- showWarning("Wrong number of parameters");
- return null;
- }
- shape = new PShapeOpenGL(parent, PShape.PRIMITIVE);
- shape.setKind(TRIANGLE);
- } else if (kind == QUAD) {
- if (len != 8) {
- showWarning("Wrong number of parameters");
- return null;
- }
- shape = new PShapeOpenGL(parent, PShape.PRIMITIVE);
- shape.setKind(QUAD);
- } else if (kind == RECT) {
- if (len != 4 && len != 5 && len != 8) {
- showWarning("Wrong number of parameters");
- return null;
- }
- shape = new PShapeOpenGL(parent, PShape.PRIMITIVE);
- shape.setKind(RECT);
- } else if (kind == ELLIPSE) {
- if (len != 4) {
- showWarning("Wrong number of parameters");
- return null;
- }
- shape = new PShapeOpenGL(parent, PShape.PRIMITIVE);
- shape.setKind(ELLIPSE);
- } else if (kind == ARC) {
- if (len != 6 && len != 7) {
- showWarning("Wrong number of parameters");
- return null;
- }
- shape = new PShapeOpenGL(parent, PShape.PRIMITIVE);
- shape.setKind(ARC);
- } else if (kind == BOX) {
- showWarning("Primitive not supported in 2D");
- } else if (kind == SPHERE) {
- showWarning("Primitive not supported in 2D");
- } else {
- showWarning("Unrecognized primitive type");
- }
-
- if (shape != null) {
- shape.setParams(p);
- }
-
- shape.is3D(false);
- return shape;
- }
-
-
- //////////////////////////////////////////////////////////////
-
- // BEZIER VERTICES
-
-
- @Override
- public void bezierVertex(float x2, float y2, float z2,
- float x3, float y3, float z3,
- float x4, float y4, float z4) {
- showDepthWarningXYZ("bezierVertex");
- }
-
-
- //////////////////////////////////////////////////////////////
-
- // QUADRATIC BEZIER VERTICES
-
-
- @Override
- public void quadraticVertex(float x2, float y2, float z2,
- float x4, float y4, float z4) {
- showDepthWarningXYZ("quadVertex");
- }
-
-
- //////////////////////////////////////////////////////////////
-
- // CURVE VERTICES
-
-
- @Override
- public void curveVertex(float x, float y, float z) {
- showDepthWarningXYZ("curveVertex");
- }
-
-
- //////////////////////////////////////////////////////////////
-
- // BOX
-
-
- @Override
- public void box(float w, float h, float d) {
- showMethodWarning("box");
- }
-
-
- //////////////////////////////////////////////////////////////
-
- // SPHERE
-
-
- @Override
- public void sphere(float r) {
- showMethodWarning("sphere");
- }
-
-
- //////////////////////////////////////////////////////////////
-
- // VERTEX SHAPES
-
-
- @Override
- public void vertex(float x, float y, float z) {
- showDepthWarningXYZ("vertex");
- }
-
- @Override
- public void vertex(float x, float y, float z, float u, float v) {
- showDepthWarningXYZ("vertex");
- }
-
- //////////////////////////////////////////////////////////////
-
- // MATRIX TRANSFORMATIONS
-
- @Override
- public void translate(float tx, float ty, float tz) {
- showDepthWarningXYZ("translate");
- }
-
- @Override
- public void rotateX(float angle) {
- showDepthWarning("rotateX");
- }
-
- @Override
- public void rotateY(float angle) {
- showDepthWarning("rotateY");
- }
-
- @Override
- public void rotateZ(float angle) {
- showDepthWarning("rotateZ");
- }
-
- @Override
- public void rotate(float angle, float vx, float vy, float vz) {
- showVariationWarning("rotate");
- }
-
- @Override
- public void applyMatrix(PMatrix3D source) {
- showVariationWarning("applyMatrix");
- }
-
- @Override
- public void applyMatrix(float n00, float n01, float n02, float n03,
- float n10, float n11, float n12, float n13,
- float n20, float n21, float n22, float n23,
- float n30, float n31, float n32, float n33) {
- showVariationWarning("applyMatrix");
- }
-
- @Override
- public void scale(float sx, float sy, float sz) {
- showDepthWarningXYZ("scale");
- }
-
- //////////////////////////////////////////////////////////////
-
- // SCREEN AND MODEL COORDS
-
- @Override
- public float screenX(float x, float y, float z) {
- showDepthWarningXYZ("screenX");
- return 0;
- }
-
- @Override
- public float screenY(float x, float y, float z) {
- showDepthWarningXYZ("screenY");
- return 0;
- }
-
- @Override
- public float screenZ(float x, float y, float z) {
- showDepthWarningXYZ("screenZ");
- return 0;
- }
-
- @Override
- public PMatrix3D getMatrix(PMatrix3D target) {
- showVariationWarning("getMatrix");
- return target;
- }
-
- @Override
- public void setMatrix(PMatrix3D source) {
- showVariationWarning("setMatrix");
- }
-
- //////////////////////////////////////////////////////////////
-
- // LIGHTS
-
- @Override
- public void lights() {
- showMethodWarning("lights");
- }
-
- @Override
- public void noLights() {
- showMethodWarning("noLights");
- }
-
- @Override
- public void ambientLight(float red, float green, float blue) {
- showMethodWarning("ambientLight");
- }
-
- @Override
- public void ambientLight(float red, float green, float blue,
- float x, float y, float z) {
- showMethodWarning("ambientLight");
- }
-
- @Override
- public void directionalLight(float red, float green, float blue,
- float nx, float ny, float nz) {
- showMethodWarning("directionalLight");
- }
-
- @Override
- public void pointLight(float red, float green, float blue,
- float x, float y, float z) {
- showMethodWarning("pointLight");
- }
-
- @Override
- public void spotLight(float red, float green, float blue,
- float x, float y, float z,
- float nx, float ny, float nz,
- float angle, float concentration) {
- showMethodWarning("spotLight");
- }
-
- @Override
- public void lightFalloff(float constant, float linear, float quadratic) {
- showMethodWarning("lightFalloff");
- }
-
- @Override
- public void lightSpecular(float v1, float v2, float v3) {
- showMethodWarning("lightSpecular");
- }
-}
\ No newline at end of file
diff --git a/android/core/src/processing/opengl/PGraphics3D.java b/android/core/src/processing/opengl/PGraphics3D.java
deleted file mode 100644
index 0880651cc6..0000000000
--- a/android/core/src/processing/opengl/PGraphics3D.java
+++ /dev/null
@@ -1,294 +0,0 @@
-/* -*- mode: java; c-basic-offset: 2; indent-tabs-mode: nil -*- */
-
-/*
- Part of the Processing project - http://processing.org
-
- Copyright (c) 2012 Ben Fry and Casey Reas
-
- This library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Lesser General Public
- License version 2.1 as published by the Free Software Foundation.
-
- This library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License for more details.
-
- You should have received a copy of the GNU Lesser General
- Public License along with this library; if not, write to the
- Free Software Foundation, Inc., 59 Temple Place, Suite 330,
- Boston, MA 02111-1307 USA
- */
-
-package processing.opengl;
-
-import java.io.InputStream;
-import java.util.zip.GZIPInputStream;
-
-import processing.core.PApplet;
-import processing.core.PConstants;
-import processing.core.PGraphics;
-import processing.core.PShape;
-import processing.core.PShapeOBJ;
-
-public class PGraphics3D extends PGraphicsOpenGL {
-
- public PGraphics3D() {
- super();
- }
-
-
- //////////////////////////////////////////////////////////////
-
- // RENDERER SUPPORT QUERIES
-
-
- @Override
- public boolean is2D() {
- return false;
- }
-
-
- @Override
- public boolean is3D() {
- return true;
- }
-
-
- //////////////////////////////////////////////////////////////
-
- // PROJECTION
-
-
- @Override
- protected void defaultPerspective() {
- perspective();
- }
-
-
- //////////////////////////////////////////////////////////////
-
- // CAMERA
-
-
- @Override
- protected void defaultCamera() {
- camera();
- }
-
-
- //////////////////////////////////////////////////////////////
-
- // MATRIX MORE!
-
-
- @Override
- protected void begin2D() {
- pushProjection();
- ortho(0, width, 0, height, -1, +1);
- pushMatrix();
- camera(width/2, height/2);
- }
-
-
- @Override
- protected void end2D() {
- popMatrix();
- popProjection();
- }
-
-
- //////////////////////////////////////////////////////////////
-
- // SHAPE I/O
-
-
- static protected boolean isSupportedExtension(String extension) {
- return extension.equals("obj");
- }
-
-
- static protected PShape loadShapeImpl(PGraphics pg, String filename,
- String extension) {
- PShapeOBJ obj = null;
-
- if (extension.equals("obj")) {
- obj = new PShapeOBJ(pg.parent, filename);
-
- } else if (extension.equals("objz")) {
- try {
- InputStream input =
- new GZIPInputStream(pg.parent.createInput(filename));
- obj = new PShapeOBJ(pg.parent, PApplet.createReader(input));
- } catch (Exception e) {
- e.printStackTrace();
- }
- }
-
- if (obj != null) {
- int prevTextureMode = pg.textureMode;
- pg.textureMode = NORMAL;
- PShapeOpenGL p3d = PShapeOpenGL.createShape3D(pg.parent, obj);
- pg.textureMode = prevTextureMode;
- return p3d;
- } else {
- return null;
- }
- }
-
-
- //////////////////////////////////////////////////////////////
-
- // SHAPE CREATION
-
-
- @Override
- public PShape createShape(PShape source) {
- return PShapeOpenGL.createShape3D(parent, source);
- }
-
-
- @Override
- public PShape createShape() {
- return createShape(PShape.GEOMETRY);
- }
-
-
- @Override
- public PShape createShape(int type) {
- return createShapeImpl(parent, type);
- }
-
-
- @Override
- public PShape createShape(int kind, float... p) {
- return createShapeImpl(parent, kind, p);
- }
-
-
- static protected PShapeOpenGL createShapeImpl(PApplet parent, int type) {
- PShapeOpenGL shape = null;
- if (type == PConstants.GROUP) {
- shape = new PShapeOpenGL(parent, PConstants.GROUP);
- } else if (type == PShape.PATH) {
- shape = new PShapeOpenGL(parent, PShape.PATH);
- } else if (type == PShape.GEOMETRY) {
- shape = new PShapeOpenGL(parent, PShape.GEOMETRY);
- }
-
- /*
- (type == POINTS) {
- shape = new PShapeOpenGL(parent, PShape.GEOMETRY);
-
- shape.setKind(POINTS);
- } else if (type == LINES) {
- shape = new PShapeOpenGL(parent, PShape.GEOMETRY);
-
- shape.setKind(LINES);
- } else if (type == TRIANGLE || type == TRIANGLES) {
- shape = new PShapeOpenGL(parent, PShape.GEOMETRY);
-
- shape.setKind(TRIANGLES);
- } else if (type == TRIANGLE_FAN) {
- shape = new PShapeOpenGL(parent, PShape.GEOMETRY);
- shape.setKind(TRIANGLE_FAN);
- } else if (type == TRIANGLE_STRIP) {
- shape = new PShapeOpenGL(parent, PShape.GEOMETRY);
- shape.setKind(TRIANGLE_STRIP);
- } else if (type == QUAD || type == QUADS) {
- shape = new PShapeOpenGL(parent, PShape.GEOMETRY);
- shape.setKind(QUADS);
- } else if (type == QUAD_STRIP) {
- shape = new PShapeOpenGL(parent, PShape.GEOMETRY);
- shape.setKind(QUAD_STRIP);
- } else if (type == POLYGON) {
- shape = new PShapeOpenGL(parent, PShape.GEOMETRY);
- shape.setKind(POLYGON);
- }
- */
-
- shape.is3D(true);
- return shape;
- }
-
-
- static protected PShapeOpenGL createShapeImpl(PApplet parent,
- int kind, float... p) {
- PShapeOpenGL shape = null;
- int len = p.length;
-
- if (kind == POINT) {
- if (len != 2 && len != 3) {
- showWarning("Wrong number of parameters");
- return null;
- }
- shape = new PShapeOpenGL(parent, PShape.PRIMITIVE);
- shape.setKind(POINT);
- } else if (kind == LINE) {
- if (len != 4 && len != 6) {
- showWarning("Wrong number of parameters");
- return null;
- }
- shape = new PShapeOpenGL(parent, PShape.PRIMITIVE);
- shape.setKind(LINE);
- } else if (kind == TRIANGLE) {
- if (len != 6) {
- showWarning("Wrong number of parameters");
- return null;
- }
- shape = new PShapeOpenGL(parent, PShape.PRIMITIVE);
- shape.setKind(TRIANGLE);
- } else if (kind == QUAD) {
- if (len != 8) {
- showWarning("Wrong number of parameters");
- return null;
- }
- shape = new PShapeOpenGL(parent, PShape.PRIMITIVE);
- shape.setKind(QUAD);
- } else if (kind == RECT) {
- if (len != 4 && len != 5 && len != 8) {
- showWarning("Wrong number of parameters");
- return null;
- }
- shape = new PShapeOpenGL(parent, PShape.PRIMITIVE);
- shape.setKind(RECT);
- } else if (kind == ELLIPSE) {
- if (len != 4) {
- showWarning("Wrong number of parameters");
- return null;
- }
- shape = new PShapeOpenGL(parent, PShape.PRIMITIVE);
- shape.setKind(ELLIPSE);
- } else if (kind == ARC) {
- if (len != 6 && len != 7) {
- showWarning("Wrong number of parameters");
- return null;
- }
- shape = new PShapeOpenGL(parent, PShape.PRIMITIVE);
- shape.setKind(ARC);
- } else if (kind == BOX) {
- if (len != 1 && len != 3) {
- showWarning("Wrong number of parameters");
- return null;
- }
- shape = new PShapeOpenGL(parent, PShape.PRIMITIVE);
- shape.setKind(BOX);
- } else if (kind == SPHERE) {
- if (len != 1) {
- showWarning("Wrong number of parameters");
- return null;
- }
- shape = new PShapeOpenGL(parent, PShape.PRIMITIVE);
- shape.setKind(SPHERE);
- } else {
- showWarning("Unrecognized primitive type");
- }
-
- if (shape != null) {
- shape.setParams(p);
- }
-
- shape.is3D(true);
- return shape;
- }
-}
\ No newline at end of file
diff --git a/android/core/src/processing/opengl/PGraphicsOpenGL.java b/android/core/src/processing/opengl/PGraphicsOpenGL.java
deleted file mode 100644
index 0fbe05bef9..0000000000
--- a/android/core/src/processing/opengl/PGraphicsOpenGL.java
+++ /dev/null
@@ -1,11814 +0,0 @@
-/* -*- mode: java; c-basic-offset: 2; indent-tabs-mode: nil -*- */
-
-/*
- Part of the Processing project - http://processing.org
-
- Copyright (c) 2004-13 Ben Fry and Casey Reas
-
- This library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Lesser General Public
- License version 2.1 as published by the Free Software Foundation.
-
- This library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License for more details.
-
- You should have received a copy of the GNU Lesser General
- Public License along with this library; if not, write to the
- Free Software Foundation, Inc., 59 Temple Place, Suite 330,
- Boston, MA 02111-1307 USA
- */
-
-package processing.opengl;
-
-import processing.core.*;
-
-import java.net.URL;
-import java.nio.*;
-import java.util.*;
-
-/**
- * OpenGL renderer.
- *
- */
-public class PGraphicsOpenGL extends PGraphics {
- /** Interface between Processing and OpenGL */
- public PGL pgl;
-
- /** The main PApplet renderer. */
- protected static PGraphicsOpenGL pgPrimary = null;
-
- /** The renderer currently in use. */
- protected static PGraphicsOpenGL pgCurrent = null;
-
- /** Font cache for texture objects. */
- protected WeakHashMap fontMap =
- new WeakHashMap();
-
- // ........................................................
-
- static final String OPENGL_THREAD_ERROR =
- "Cannot run the OpenGL renderer outside the main thread, change your code" +
- "\nso the drawing calls are all inside the main thread, " +
- "\nor use the default renderer instead.";
- static final String BLEND_DRIVER_ERROR =
- "blendMode(%1$s) is not supported by this hardware (or driver)";
- static final String BLEND_RENDERER_ERROR =
- "blendMode(%1$s) is not supported by this renderer";
- static final String ALREADY_DRAWING_ERROR =
- "Already called beginDraw()";
- static final String NO_BEGIN_DRAW_ERROR =
- "Cannot call endDraw() before beginDraw()";
- static final String NESTED_DRAW_ERROR =
- "Already called drawing on another PGraphicsOpenGL object";
- static final String ALREADY_BEGAN_CONTOUR_ERROR =
- "Already called beginContour()";
- static final String NO_BEGIN_CONTOUR_ERROR =
- "Need to call beginContour() first";
- static final String UNSUPPORTED_SMOOTH_LEVEL_ERROR =
- "Smooth level %1$s is not available. Using %2$s instead";
- static final String UNSUPPORTED_SMOOTH_ERROR =
- "Smooth is not supported by this hardware (or driver)";
- static final String TOO_MANY_SMOOTH_CALLS_ERROR =
- "The smooth/noSmooth functions are being called too often.\n" +
- "This results in screen flickering, so they will be disabled\n" +
- "for the rest of the sketch's execution";
- static final String UNSUPPORTED_SHAPE_FORMAT_ERROR =
- "Unsupported shape format";
- static final String INVALID_FILTER_SHADER_ERROR =
- "Object is not a valid shader to use as filter";
- static final String INVALID_PROCESSING_SHADER_ERROR =
- "The GLSL code doesn't seem to contain a valid shader to use in Processing";
- static final String WRONG_SHADER_TYPE_ERROR =
- "shader() called with a wrong shader";
- static final String UNKNOWN_SHADER_KIND_ERROR =
- "Unknown shader kind";
- static final String NO_TEXLIGHT_SHADER_ERROR =
- "Your shader cannot be used to render textured " +
- "and lit geometry, using default shader instead.";
- static final String NO_LIGHT_SHADER_ERROR =
- "Your shader cannot be used to render lit " +
- "geometry, using default shader instead.";
- static final String NO_TEXTURE_SHADER_ERROR =
- "Your shader cannot be used to render textured " +
- "geometry, using default shader instead.";
- static final String NO_COLOR_SHADER_ERROR =
- "Your shader cannot be used to render colored " +
- "geometry, using default shader instead.";
- static final String TOO_LONG_STROKE_PATH_ERROR =
- "Stroke path is too long, some bevel triangles won't be added";
- static final String TESSELLATION_ERROR =
- "Tessellation Error: %1$s";
-
- // ........................................................
-
- // Basic rendering parameters:
-
- /** Whether the PGraphics object is ready to render or not. */
- public boolean initialized;
-
- /** Flush modes: continuously (geometry is flushed after each call to
- * endShape) when-full (geometry is accumulated until a maximum size is
- * reached. */
- static protected final int FLUSH_CONTINUOUSLY = 0;
- static protected final int FLUSH_WHEN_FULL = 1;
-
- /** Type of geometry: immediate is that generated with beginShape/vertex/
- * endShape, retained is the result of creating a PShapeOpenGL object with
- * createShape. */
- static protected final int IMMEDIATE = 0;
- static protected final int RETAINED = 1;
-
- /** Current flush mode. */
- protected int flushMode = FLUSH_WHEN_FULL;
-
- // ........................................................
-
- // VBOs for immediate rendering:
-
- public int glPolyVertex;
- public int glPolyColor;
- public int glPolyNormal;
- public int glPolyTexcoord;
- public int glPolyAmbient;
- public int glPolySpecular;
- public int glPolyEmissive;
- public int glPolyShininess;
- public int glPolyIndex;
- protected boolean polyBuffersCreated = false;
- protected int polyBuffersContext;
-
- public int glLineVertex;
- public int glLineColor;
- public int glLineAttrib;
- public int glLineIndex;
- protected boolean lineBuffersCreated = false;
- protected int lineBuffersContext;
-
- public int glPointVertex;
- public int glPointColor;
- public int glPointAttrib;
- public int glPointIndex;
- protected boolean pointBuffersCreated = false;
- protected int pointBuffersContext;
-
- protected static final int INIT_VERTEX_BUFFER_SIZE = 256;
- protected static final int INIT_INDEX_BUFFER_SIZE = 512;
-
- // ........................................................
-
- // GL parameters
-
- static protected boolean glParamsRead = false;
-
- /** Extensions used by Processing */
- static public boolean npotTexSupported;
- static public boolean autoMipmapGenSupported;
- static public boolean fboMultisampleSupported;
- static public boolean packedDepthStencilSupported;
- static public boolean anisoSamplingSupported;
- static public boolean blendEqSupported;
-
- /** Some hardware limits */
- static public int maxTextureSize;
- static public int maxSamples;
- static public float maxPointSize;
- static public float maxLineWidth;
- static public float maxAnisoAmount;
- static public int depthBits;
- static public int stencilBits;
-
- /** OpenGL information strings */
- static public String OPENGL_VENDOR;
- static public String OPENGL_RENDERER;
- static public String OPENGL_VERSION;
- static public String OPENGL_EXTENSIONS;
- static public String GLSL_VERSION;
-
- // ........................................................
-
- // GL objects:
-
- static protected HashMap glTextureObjects =
- new HashMap();
- static protected HashMap glVertexBuffers =
- new HashMap();
- static protected HashMap glFrameBuffers =
- new HashMap();
- static protected HashMap glRenderBuffers =
- new HashMap();
- static protected HashMap glslPrograms =
- new HashMap();
- static protected HashMap glslVertexShaders =
- new HashMap();
- static protected HashMap glslFragmentShaders =
- new HashMap();
-
- // ........................................................
-
- // Shaders
-
- static protected URL defColorShaderVertURL =
- PGraphicsOpenGL.class.getResource("ColorVert.glsl");
- static protected URL defTextureShaderVertURL =
- PGraphicsOpenGL.class.getResource("TextureVert.glsl");
- static protected URL defLightShaderVertURL =
- PGraphicsOpenGL.class.getResource("LightVert.glsl");
- static protected URL defTexlightShaderVertURL =
- PGraphicsOpenGL.class.getResource("TexlightVert.glsl");
- static protected URL defColorShaderFragURL =
- PGraphicsOpenGL.class.getResource("ColorFrag.glsl");
- static protected URL defTextureShaderFragURL =
- PGraphicsOpenGL.class.getResource("TextureFrag.glsl");
- static protected URL defLineShaderVertURL =
- PGraphicsOpenGL.class.getResource("LineVert.glsl");
- static protected URL defLineShaderFragURL =
- PGraphicsOpenGL.class.getResource("LineFrag.glsl");
- static protected URL defPointShaderVertURL =
- PGraphicsOpenGL.class.getResource("PointVert.glsl");
- static protected URL defPointShaderFragURL =
- PGraphicsOpenGL.class.getResource("PointFrag.glsl");
-
- static protected ColorShader defColorShader;
- static protected TexureShader defTextureShader;
- static protected LightShader defLightShader;
- static protected TexlightShader defTexlightShader;
- static protected LineShader defLineShader;
- static protected PointShader defPointShader;
-
- static protected URL maskShaderFragURL =
- PGraphicsOpenGL.class.getResource("MaskFrag.glsl");
- static protected TexureShader maskShader;
-
- protected ColorShader colorShader;
- protected TexureShader textureShader;
- protected LightShader lightShader;
- protected TexlightShader texlightShader;
- protected LineShader lineShader;
- protected PointShader pointShader;
-
- // When shader warnings are enabled, the renderer is strict in regards to the
- // use of the polygon shaders. For instance, if a light shader is set to
- // render lit geometry, but the geometry is mixed with some pieces of unlit or
- // textured geometry, then it will warn that the set shader cannot be used for
- // that other type of geometry, even though Processing will use the correct,
- // built-in shaders to handle it.
- protected boolean shaderWarningsEnabled = true;
-
- // ........................................................
-
- // Tessellator, geometry
-
- protected InGeometry inGeo;
- protected TessGeometry tessGeo;
- static protected Tessellator tessellator;
- protected TexCache texCache;
-
- // ........................................................
-
- // Camera:
-
- /** Camera field of view. */
- public float cameraFOV;
-
- /** Default position of the camera. */
- public float cameraX, cameraY, cameraZ;
- /** Distance of the near and far planes. */
- public float cameraNear, cameraFar;
- /** Aspect ratio of camera's view. */
- public float cameraAspect;
-
- /** Actual position of the camera. */
- protected float cameraEyeX, cameraEyeY, cameraEyeZ;
-
- /** Flag to indicate that we are inside beginCamera/endCamera block. */
- protected boolean manipulatingCamera;
-
- // ........................................................
-
- // All the matrices required for camera and geometry transformations.
- public PMatrix3D projection;
- public PMatrix3D camera;
- public PMatrix3D cameraInv;
- public PMatrix3D modelview;
- public PMatrix3D modelviewInv;
- public PMatrix3D projmodelview;
-
- // To pass to shaders
- protected float[] glProjection;
- protected float[] glModelview;
- protected float[] glProjmodelview;
- protected float[] glNormal;
-
- // Useful to have around.
- static protected PMatrix3D identity = new PMatrix3D();
-
- protected boolean matricesAllocated = false;
-
- /**
- * Marks when changes to the size have occurred, so that the camera
- * will be reset in beginDraw().
- */
- protected boolean sized;
-
- static protected final int MATRIX_STACK_DEPTH = 32;
-
- protected int modelviewStackDepth;
- protected int projectionStackDepth;
-
- /** Modelview matrix stack **/
- protected float[][] modelviewStack = new float[MATRIX_STACK_DEPTH][16];
-
- /** Inverse modelview matrix stack **/
- protected float[][] modelviewInvStack = new float[MATRIX_STACK_DEPTH][16];
-
- /** Camera matrix stack **/
- protected float[][] cameraStack = new float[MATRIX_STACK_DEPTH][16];
-
- /** Inverse camera matrix stack **/
- protected float[][] cameraInvStack = new float[MATRIX_STACK_DEPTH][16];
-
- /** Projection matrix stack **/
- protected float[][] projectionStack = new float[MATRIX_STACK_DEPTH][16];
-
- // ........................................................
-
- // Lights:
-
- public boolean lights;
- public int lightCount = 0;
-
- /** Light types */
- public int[] lightType;
-
- /** Light positions */
- public float[] lightPosition;
-
- /** Light direction (normalized vector) */
- public float[] lightNormal;
-
- /**
- * Ambient colors for lights.
- */
- public float[] lightAmbient;
-
- /**
- * Diffuse colors for lights.
- */
- public float[] lightDiffuse;
-
- /**
- * Specular colors for lights. Internally these are stored as numbers between
- * 0 and 1.
- */
- public float[] lightSpecular;
-
- /** Light falloff */
- public float[] lightFalloffCoefficients;
-
- /** Light spot parameters: Cosine of light spot angle
- * and concentration */
- public float[] lightSpotParameters;
-
- /** Current specular color for lighting */
- public float[] currentLightSpecular;
-
- /** Current light falloff */
- public float currentLightFalloffConstant;
- public float currentLightFalloffLinear;
- public float currentLightFalloffQuadratic;
-
- protected boolean lightsAllocated = false;
-
- // ........................................................
-
- // Texturing:
-
- protected int textureWrap = CLAMP;
- protected int textureSampling = Texture.TRILINEAR;
-
- // ........................................................
-
- // Blending:
-
- protected int blendMode;
-
- // ........................................................
-
- // Clipping
-
- protected boolean clip = false;
-
- /** Clipping rectangle. */
- protected int[] clipRect = {0, 0, 0, 0};
-
-
- // ........................................................
-
- // Text:
-
- /** Font texture of currently selected font. */
- FontTexture textTex;
-
- // .......................................................
-
- // Framebuffer stack:
-
- static protected final int FB_STACK_DEPTH = 16;
-
- static protected int fbStackDepth;
- static protected FrameBuffer[] fbStack = new FrameBuffer[FB_STACK_DEPTH];
- static protected FrameBuffer drawFramebuffer;
- static protected FrameBuffer readFramebuffer;
- static protected FrameBuffer currentFramebuffer;
-
- // .......................................................
-
- // Offscreen rendering:
-
- protected FrameBuffer offscreenFramebuffer;
- protected FrameBuffer multisampleFramebuffer;
- protected boolean offscreenMultisample;
-
- protected boolean pixOpChangedFB;
-
- // ........................................................
-
- // Screen surface:
-
- /** Texture containing the current frame */
- protected Texture texture;
-
- /** Texture containing the previous frame */
- protected Texture ptexture;
-
- /** IntBuffer wrapping the pixels array. */
- protected IntBuffer pixelBuffer;
-
- /** Array to store pixels in OpenGL format. */
- protected int[] nativePixels;
-
- /** IntBuffer wrapping the native pixels array. */
- protected IntBuffer nativePixelBuffer;
-
- /** texture used to apply a filter on the screen image. */
- protected Texture filterTexture;
-
- /** PImage that wraps filterTexture. */
- protected PImage filterImage;
-
- /** Flag to indicate if the user is manipulating the
- * pixels array through the set()/get() methods */
- protected boolean setgetPixels;
-
- // ........................................................
-
- // Utility variables:
-
- /** True if we are inside a beginDraw()/endDraw() block. */
- protected boolean drawing = false;
-
- /** Used to indicate an OpenGL surface recreation */
- protected boolean restoreSurface = false;
-
- /** Used to detect continuous use of the smooth/noSmooth functions */
- protected boolean smoothDisabled = false;
- protected int smoothCallCount = 0;
- protected int lastSmoothCall = -10;
-
- /** Type of pixels operation. */
- static protected final int OP_NONE = 0;
- static protected final int OP_READ = 1;
- static protected final int OP_WRITE = 2;
- protected int pixelsOp = OP_NONE;
-
- /** Viewport dimensions. */
- protected IntBuffer viewport;
-
- /** Used to register calls to glClear. */
- protected boolean clearColorBuffer;
- protected boolean clearColorBuffer0;
-
- protected boolean openContour = false;
- protected boolean breakShape = false;
- protected boolean defaultEdges = false;
- protected PImage textureImage0;
-
- static protected final int EDGE_MIDDLE = 0;
- static protected final int EDGE_START = 1;
- static protected final int EDGE_STOP = 2;
- static protected final int EDGE_SINGLE = 3;
-
- /** Used in round point and ellipse tessellation. The
- * number of subdivisions per round point or ellipse is
- * calculated with the following formula:
- * n = max(N, (TWO_PI * size / F))
- * where size is a measure of the dimensions of the circle
- * when projected on screen coordinates. F just sets the
- * minimum number of subdivisions, while a smaller F
- * would allow to have more detailed circles.
- * N = MIN_POINT_ACCURACY
- * F = POINT_ACCURACY_FACTOR
- */
- final static protected int MIN_POINT_ACCURACY = 20;
- final static protected float POINT_ACCURACY_FACTOR = 10.0f;
-
- /** Used in quad point tessellation. */
- final protected float[][] QUAD_POINT_SIGNS =
- { {-1, +1}, {-1, -1}, {+1, -1}, {+1, +1} };
-
- /** To get data from OpenGL. */
- protected IntBuffer intBuffer;
- protected FloatBuffer floatBuffer;
-
- //////////////////////////////////////////////////////////////
-
- // INIT/ALLOCATE/FINISH
-
-
- public PGraphicsOpenGL() {
- pgl = new PGL(this);
-
- if (tessellator == null) {
- tessellator = new Tessellator();
- }
-
- intBuffer = PGL.allocateIntBuffer(2);
- floatBuffer = PGL.allocateFloatBuffer(2);
- viewport = PGL.allocateIntBuffer(4);
-
- inGeo = newInGeometry(IMMEDIATE);
- tessGeo = newTessGeometry(IMMEDIATE);
- texCache = newTexCache();
-
- initialized = false;
- }
-
-
- // now implemented in PGraphics
-// public void setParent(PApplet parent) {
-// super.setParent(parent);
-// quality = parent.sketchQuality();
-// }
-
-
- @Override
- public void setPrimary(boolean primary) {
- super.setPrimary(primary);
- format = ARGB;
- }
-
-
- //public void setPath(String path) // PGraphics
-
-
- //public void setAntiAlias(int samples) // PGraphics
-
-
- @Override
- public void setFrameRate(float frameRate) {
- pgl.setFrameRate(frameRate);
- }
-
-
- @Override
- public void setSize(int iwidth, int iheight) {
- width = iwidth;
- height = iheight;
-
- allocate();
- reapplySettings();
-
- // init perspective projection based on new dimensions
- cameraFOV = 60 * DEG_TO_RAD; // at least for now
- cameraX = width / 2.0f;
- cameraY = height / 2.0f;
- cameraZ = cameraY / ((float) Math.tan(cameraFOV / 2.0f));
- cameraNear = cameraZ / 10.0f;
- cameraFar = cameraZ * 10.0f;
- cameraAspect = (float) width / (float) height;
-
- // Forces a restart of OpenGL so the canvas has the right size.
- restartPGL();
-
- // set this flag so that beginDraw() will do an update to the camera.
- sized = true;
- }
-
-
- /**
- * Called by resize(), this handles creating the actual GLCanvas the
- * first time around, or simply resizing it on subsequent calls.
- * There is no pixel array to allocate for an OpenGL canvas
- * because OpenGL's pixel buffer is all handled internally.
- */
- @Override
- protected void allocate() {
- super.allocate();
-
- if (!matricesAllocated) {
- projection = new PMatrix3D();
- camera = new PMatrix3D();
- cameraInv = new PMatrix3D();
- modelview = new PMatrix3D();
- modelviewInv = new PMatrix3D();
- projmodelview = new PMatrix3D();
- matricesAllocated = true;
- }
-
- if (!lightsAllocated) {
- lightType = new int[PGL.MAX_LIGHTS];
- lightPosition = new float[4 * PGL.MAX_LIGHTS];
- lightNormal = new float[3 * PGL.MAX_LIGHTS];
- lightAmbient = new float[3 * PGL.MAX_LIGHTS];
- lightDiffuse = new float[3 * PGL.MAX_LIGHTS];
- lightSpecular = new float[3 * PGL.MAX_LIGHTS];
- lightFalloffCoefficients = new float[3 * PGL.MAX_LIGHTS];
- lightSpotParameters = new float[2 * PGL.MAX_LIGHTS];
- currentLightSpecular = new float[3];
- lightsAllocated = true;
- }
- }
-
-
- @Override
- public void dispose() { // PGraphics
- super.dispose();
- deleteFinalizedGLResources();
- deletePolyBuffers();
- deleteLineBuffers();
- deletePointBuffers();
- deleteDefaultShaders();
- pgl.deleteSurface();
- }
-
-
- protected void setFlushMode(int mode) {
- flushMode = mode;
- }
-
-
- //////////////////////////////////////////////////////////////
-
-
- protected void setFontTexture(PFont font, FontTexture fontTexture) {
- fontMap.put(font, fontTexture);
- }
-
-
- protected FontTexture getFontTexture(PFont font) {
- return fontMap.get(font);
- }
-
-
- protected void removeFontTexture(PFont font) {
- fontMap.remove(font);
- }
-
-
- //////////////////////////////////////////////////////////////
-
- // RESOURCE HANDLING
-
-
- protected class GLResource {
- int id;
- int context;
-
- GLResource(int id, int context) {
- this.id = id;
- this.context = context;
- }
-
- @Override
- public boolean equals(Object obj) {
- GLResource other = (GLResource)obj;
- return other.id == id && other.context == context;
- }
-
- @Override
- public int hashCode() {
- int result = 17;
- result = 31 * result + id;
- result = 31 * result + context;
- return result;
- }
- }
-
-
- // Texture Objects -----------------------------------------------------------
-
- protected int createTextureObject(int context) {
- deleteFinalizedTextureObjects();
-
- pgl.genTextures(1, intBuffer);
- int id = intBuffer.get(0);
-
- GLResource res = new GLResource(id, context);
- if (!glTextureObjects.containsKey(res)) {
- glTextureObjects.put(res, false);
- }
-
- return id;
- }
-
- protected void deleteTextureObject(int id, int context) {
- GLResource res = new GLResource(id, context);
- if (glTextureObjects.containsKey(res)) {
- intBuffer.put(0, id);
- if (pgl.threadIsCurrent()) pgl.deleteTextures(1, intBuffer);
- glTextureObjects.remove(res);
- }
- }
-
- protected void deleteAllTextureObjects() {
- for (GLResource res : glTextureObjects.keySet()) {
- intBuffer.put(0, res.id);
- if (pgl.threadIsCurrent()) pgl.deleteTextures(1, intBuffer);
- }
- glTextureObjects.clear();
- }
-
- // This is synchronized because it is called from the GC thread.
- synchronized protected void finalizeTextureObject(int id, int context) {
- GLResource res = new GLResource(id, context);
- if (glTextureObjects.containsKey(res)) {
- glTextureObjects.put(res, true);
- }
- }
-
- protected void deleteFinalizedTextureObjects() {
- Set finalized = new HashSet();
-
- for (GLResource res : glTextureObjects.keySet()) {
- if (glTextureObjects.get(res)) {
- finalized.add(res);
- intBuffer.put(0, res.id);
- if (pgl.threadIsCurrent()) pgl.deleteTextures(1, intBuffer);
- }
- }
-
- for (GLResource res : finalized) {
- glTextureObjects.remove(res);
- }
- }
-
- protected void removeTextureObject(int id, int context) {
- GLResource res = new GLResource(id, context);
- if (glTextureObjects.containsKey(res)) {
- glTextureObjects.remove(res);
- }
- }
-
- // Vertex Buffer Objects -----------------------------------------------------
-
- protected int createVertexBufferObject(int context) {
- deleteFinalizedVertexBufferObjects();
-
- pgl.genBuffers(1, intBuffer);
- int id = intBuffer.get(0);
-
- GLResource res = new GLResource(id, context);
- if (!glVertexBuffers.containsKey(res)) {
- glVertexBuffers.put(res, false);
- }
-
- return id;
- }
-
- protected void deleteVertexBufferObject(int id, int context) {
- GLResource res = new GLResource(id, context);
- if (glVertexBuffers.containsKey(res)) {
- intBuffer.put(0, id);
- if (pgl.threadIsCurrent()) pgl.deleteBuffers(1, intBuffer);
- glVertexBuffers.remove(res);
- }
- }
-
- protected void deleteAllVertexBufferObjects() {
- for (GLResource res : glVertexBuffers.keySet()) {
- intBuffer.put(0, res.id);
- if (pgl.threadIsCurrent()) pgl.deleteBuffers(1, intBuffer);
- }
- glVertexBuffers.clear();
- }
-
- // This is synchronized because it is called from the GC thread.
- synchronized protected void finalizeVertexBufferObject(int id, int context) {
- GLResource res = new GLResource(id, context);
- if (glVertexBuffers.containsKey(res)) {
- glVertexBuffers.put(res, true);
- }
- }
-
- protected void deleteFinalizedVertexBufferObjects() {
- Set finalized = new HashSet();
-
- for (GLResource res : glVertexBuffers.keySet()) {
- if (glVertexBuffers.get(res)) {
- finalized.add(res);
- intBuffer.put(0, res.id);
- if (pgl.threadIsCurrent()) pgl.deleteBuffers(1, intBuffer);
- }
- }
-
- for (GLResource res : finalized) {
- glVertexBuffers.remove(res);
- }
- }
-
- protected void removeVertexBufferObject(int id, int context) {
- GLResource res = new GLResource(id, context);
- if (glVertexBuffers.containsKey(res)) {
- glVertexBuffers.remove(res);
- }
- }
-
- // FrameBuffer Objects -------------------------------------------------------
-
- protected int createFrameBufferObject(int context) {
- deleteFinalizedFrameBufferObjects();
-
- pgl.genFramebuffers(1, intBuffer);
- int id = intBuffer.get(0);
-
- GLResource res = new GLResource(id, context);
- if (!glFrameBuffers.containsKey(res)) {
- glFrameBuffers.put(res, false);
- }
-
- return id;
- }
-
- protected void deleteFrameBufferObject(int id, int context) {
- GLResource res = new GLResource(id, context);
- if (glFrameBuffers.containsKey(res)) {
- intBuffer.put(0, id);
- if (pgl.threadIsCurrent()) pgl.deleteFramebuffers(1, intBuffer);
- glFrameBuffers.remove(res);
- }
- }
-
- protected void deleteAllFrameBufferObjects() {
- for (GLResource res : glFrameBuffers.keySet()) {
- intBuffer.put(0, res.id);
- if (pgl.threadIsCurrent()) pgl.deleteFramebuffers(1, intBuffer);
- }
- glFrameBuffers.clear();
- }
-
- // This is synchronized because it is called from the GC thread.
- synchronized protected void finalizeFrameBufferObject(int id, int context) {
- GLResource res = new GLResource(id, context);
- if (glFrameBuffers.containsKey(res)) {
- glFrameBuffers.put(res, true);
- }
- }
-
- protected void deleteFinalizedFrameBufferObjects() {
- Set finalized = new HashSet();
-
- for (GLResource res : glFrameBuffers.keySet()) {
- if (glFrameBuffers.get(res)) {
- finalized.add(res);
- intBuffer.put(0, res.id);
- if (pgl.threadIsCurrent()) pgl.deleteFramebuffers(1, intBuffer);
- }
- }
-
- for (GLResource res : finalized) {
- glFrameBuffers.remove(res);
- }
- }
-
- protected void removeFrameBufferObject(int id, int context) {
- GLResource res = new GLResource(id, context);
- if (glFrameBuffers.containsKey(res)) {
- glFrameBuffers.remove(res);
- }
- }
-
- // RenderBuffer Objects ------------------------------------------------------
-
- protected int createRenderBufferObject(int context) {
- deleteFinalizedRenderBufferObjects();
-
- pgl.genRenderbuffers(1, intBuffer);
- int id = intBuffer.get(0);
-
- GLResource res = new GLResource(id, context);
- if (!glRenderBuffers.containsKey(res)) {
- glRenderBuffers.put(res, false);
- }
-
- return id;
- }
-
- protected void deleteRenderBufferObject(int id, int context) {
- GLResource res = new GLResource(id, context);
- if (glRenderBuffers.containsKey(res)) {
- intBuffer.put(0, id);
- if (pgl.threadIsCurrent()) pgl.deleteRenderbuffers(1, intBuffer);
- glRenderBuffers.remove(res);
- }
- }
-
- protected void deleteAllRenderBufferObjects() {
- for (GLResource res : glRenderBuffers.keySet()) {
- intBuffer.put(0, res.id);
- if (pgl.threadIsCurrent()) pgl.deleteRenderbuffers(1, intBuffer);
- }
- glRenderBuffers.clear();
- }
-
- // This is synchronized because it is called from the GC thread.
- synchronized protected void finalizeRenderBufferObject(int id, int context) {
- GLResource res = new GLResource(id, context);
- if (glRenderBuffers.containsKey(res)) {
- glRenderBuffers.put(res, true);
- }
- }
-
- protected void deleteFinalizedRenderBufferObjects() {
- Set finalized = new HashSet();
-
- for (GLResource res : glRenderBuffers.keySet()) {
- if (glRenderBuffers.get(res)) {
- finalized.add(res);
- intBuffer.put(0, res.id);
- if (pgl.threadIsCurrent()) pgl.deleteRenderbuffers(1, intBuffer);
- }
- }
-
- for (GLResource res : finalized) {
- glRenderBuffers.remove(res);
- }
- }
-
- protected void removeRenderBufferObject(int id, int context) {
- GLResource res = new GLResource(id, context);
- if (glRenderBuffers.containsKey(res)) {
- glRenderBuffers.remove(res);
- }
- }
-
- // GLSL Program Objects ------------------------------------------------------
-
- protected int createGLSLProgramObject(int context) {
- deleteFinalizedGLSLProgramObjects();
-
- int id = pgl.createProgram();
-
- GLResource res = new GLResource(id, context);
- if (!glslPrograms.containsKey(res)) {
- glslPrograms.put(res, false);
- }
-
- return id;
- }
-
- protected void deleteGLSLProgramObject(int id, int context) {
- GLResource res = new GLResource(id, context);
- if (glslPrograms.containsKey(res)) {
- if (pgl.threadIsCurrent()) pgl.deleteProgram(res.id);
- glslPrograms.remove(res);
- }
- }
-
- protected void deleteAllGLSLProgramObjects() {
- for (GLResource res : glslPrograms.keySet()) {
- if (pgl.threadIsCurrent()) pgl.deleteProgram(res.id);
- }
- glslPrograms.clear();
- }
-
- // This is synchronized because it is called from the GC thread.
- synchronized protected void finalizeGLSLProgramObject(int id, int context) {
- GLResource res = new GLResource(id, context);
- if (glslPrograms.containsKey(res)) {
- glslPrograms.put(res, true);
- }
- }
-
- protected void deleteFinalizedGLSLProgramObjects() {
- Set finalized = new HashSet();
-
- for (GLResource res : glslPrograms.keySet()) {
- if (glslPrograms.get(res)) {
- finalized.add(res);
- if (pgl.threadIsCurrent()) pgl.deleteProgram(res.id);
- }
- }
-
- for (GLResource res : finalized) {
- glslPrograms.remove(res);
- }
- }
-
- protected void removeGLSLProgramObject(int id, int context) {
- GLResource res = new GLResource(id, context);
- if (glslPrograms.containsKey(res)) {
- glslPrograms.remove(res);
- }
- }
-
- // GLSL Vertex Shader Objects ------------------------------------------------
-
- protected int createGLSLVertShaderObject(int context) {
- deleteFinalizedGLSLVertShaderObjects();
-
- int id = pgl.createShader(PGL.VERTEX_SHADER);
-
- GLResource res = new GLResource(id, context);
- if (!glslVertexShaders.containsKey(res)) {
- glslVertexShaders.put(res, false);
- }
-
- return id;
- }
-
- protected void deleteGLSLVertShaderObject(int id, int context) {
- GLResource res = new GLResource(id, context);
- if (glslVertexShaders.containsKey(res)) {
- if (pgl.threadIsCurrent()) pgl.deleteShader(res.id);
- glslVertexShaders.remove(res);
- }
- }
-
- protected void deleteAllGLSLVertShaderObjects() {
- for (GLResource res : glslVertexShaders.keySet()) {
- if (pgl.threadIsCurrent()) pgl.deleteShader(res.id);
- }
- glslVertexShaders.clear();
- }
-
- // This is synchronized because it is called from the GC thread.
- synchronized protected void finalizeGLSLVertShaderObject(int id,
- int context) {
- GLResource res = new GLResource(id, context);
- if (glslVertexShaders.containsKey(res)) {
- glslVertexShaders.put(res, true);
- }
- }
-
- protected void deleteFinalizedGLSLVertShaderObjects() {
- Set finalized = new HashSet();
-
- for (GLResource res : glslVertexShaders.keySet()) {
- if (glslVertexShaders.get(res)) {
- finalized.add(res);
- if (pgl.threadIsCurrent()) pgl.deleteShader(res.id);
- }
- }
-
- for (GLResource res : finalized) {
- glslVertexShaders.remove(res);
- }
- }
-
- protected void removeGLSLVertShaderObject(int id, int context) {
- GLResource res = new GLResource(id, context);
- if (glslVertexShaders.containsKey(res)) {
- glslVertexShaders.remove(res);
- }
- }
-
- // GLSL Fragment Shader Objects ----------------------------------------------
-
- protected int createGLSLFragShaderObject(int context) {
- deleteFinalizedGLSLFragShaderObjects();
-
- int id = pgl.createShader(PGL.FRAGMENT_SHADER);
-
- GLResource res = new GLResource(id, context);
- if (!glslFragmentShaders.containsKey(res)) {
- glslFragmentShaders.put(res, false);
- }
-
- return id;
- }
-
- protected void deleteGLSLFragShaderObject(int id, int context) {
- GLResource res = new GLResource(id, context);
- if (glslFragmentShaders.containsKey(res)) {
- if (pgl.threadIsCurrent()) pgl.deleteShader(res.id);
- glslFragmentShaders.remove(res);
- }
- }
-
- protected void deleteAllGLSLFragShaderObjects() {
- for (GLResource res : glslFragmentShaders.keySet()) {
- if (pgl.threadIsCurrent()) pgl.deleteShader(res.id);
- }
- glslFragmentShaders.clear();
- }
-
- // This is synchronized because it is called from the GC thread.
- synchronized protected void finalizeGLSLFragShaderObject(int id,
- int context) {
- GLResource res = new GLResource(id, context);
- if (glslFragmentShaders.containsKey(res)) {
- glslFragmentShaders.put(res, true);
- }
- }
-
- protected void deleteFinalizedGLSLFragShaderObjects() {
- Set finalized = new HashSet();
-
- for (GLResource res : glslFragmentShaders.keySet()) {
- if (glslFragmentShaders.get(res)) {
- finalized.add(res);
- if (pgl.threadIsCurrent()) pgl.deleteShader(res.id);
- }
- }
-
- for (GLResource res : finalized) {
- glslFragmentShaders.remove(res);
- }
- }
-
- protected void removeGLSLFragShaderObject(int id, int context) {
- GLResource res = new GLResource(id, context);
- if (glslFragmentShaders.containsKey(res)) {
- glslFragmentShaders.remove(res);
- }
- }
-
- // All OpenGL resources ------------------------------------------------------
-
- protected void deleteFinalizedGLResources() {
- deleteFinalizedTextureObjects();
- deleteFinalizedVertexBufferObjects();
- deleteFinalizedFrameBufferObjects();
- deleteFinalizedRenderBufferObjects();
- deleteFinalizedGLSLProgramObjects();
- deleteFinalizedGLSLVertShaderObjects();
- deleteFinalizedGLSLFragShaderObjects();
- }
-
-
- //////////////////////////////////////////////////////////////
-
- // FRAMEBUFFERS
-
-
- protected void pushFramebuffer() {
- if (fbStackDepth == FB_STACK_DEPTH) {
- throw new RuntimeException("Too many pushFramebuffer calls");
- }
- fbStack[fbStackDepth] = currentFramebuffer;
- fbStackDepth++;
- }
-
-
- protected void setFramebuffer(FrameBuffer fbo) {
- if (currentFramebuffer != fbo) {
- currentFramebuffer = fbo;
- currentFramebuffer.bind();
- }
- }
-
-
- protected void popFramebuffer() {
- if (fbStackDepth == 0) {
- throw new RuntimeException("popFramebuffer call is unbalanced.");
- }
- fbStackDepth--;
- FrameBuffer fbo = fbStack[fbStackDepth];
- if (currentFramebuffer != fbo) {
- currentFramebuffer.finish();
- currentFramebuffer = fbo;
- currentFramebuffer.bind();
- }
- }
-
-
- //////////////////////////////////////////////////////////////
-
- // FRAME RENDERING
-
-
- protected void createPolyBuffers() {
- if (!polyBuffersCreated || polyBuffersContextIsOutdated()) {
- polyBuffersContext = pgl.getCurrentContext();
-
- int sizef = INIT_VERTEX_BUFFER_SIZE * PGL.SIZEOF_FLOAT;
- int sizei = INIT_VERTEX_BUFFER_SIZE * PGL.SIZEOF_INT;
- int sizex = INIT_INDEX_BUFFER_SIZE * PGL.SIZEOF_INDEX;
-
- glPolyVertex = createVertexBufferObject(polyBuffersContext);
- pgl.bindBuffer(PGL.ARRAY_BUFFER, glPolyVertex);
- pgl.bufferData(PGL.ARRAY_BUFFER, 3 * sizef, null, PGL.STATIC_DRAW);
-
- glPolyColor = createVertexBufferObject(polyBuffersContext);
- pgl.bindBuffer(PGL.ARRAY_BUFFER, glPolyColor);
- pgl.bufferData(PGL.ARRAY_BUFFER, sizei, null, PGL.STATIC_DRAW);
-
- glPolyNormal = createVertexBufferObject(polyBuffersContext);
- pgl.bindBuffer(PGL.ARRAY_BUFFER, glPolyNormal);
- pgl.bufferData(PGL.ARRAY_BUFFER, 3 * sizef, null, PGL.STATIC_DRAW);
-
- glPolyTexcoord = createVertexBufferObject(polyBuffersContext);
- pgl.bindBuffer(PGL.ARRAY_BUFFER, glPolyTexcoord);
- pgl.bufferData(PGL.ARRAY_BUFFER, 2 * sizef, null, PGL.STATIC_DRAW);
-
- glPolyAmbient = pgPrimary.createVertexBufferObject(polyBuffersContext);
- pgl.bindBuffer(PGL.ARRAY_BUFFER, glPolyAmbient);
- pgl.bufferData(PGL.ARRAY_BUFFER, sizei, null, PGL.STATIC_DRAW);
-
- glPolySpecular = pgPrimary.createVertexBufferObject(polyBuffersContext);
- pgl.bindBuffer(PGL.ARRAY_BUFFER, glPolySpecular);
- pgl.bufferData(PGL.ARRAY_BUFFER, sizei, null, PGL.STATIC_DRAW);
-
- glPolyEmissive = pgPrimary.createVertexBufferObject(polyBuffersContext);
- pgl.bindBuffer(PGL.ARRAY_BUFFER, glPolyEmissive);
- pgl.bufferData(PGL.ARRAY_BUFFER, sizei, null, PGL.STATIC_DRAW);
-
- glPolyShininess = pgPrimary.createVertexBufferObject(polyBuffersContext);
- pgl.bindBuffer(PGL.ARRAY_BUFFER, glPolyShininess);
- pgl.bufferData(PGL.ARRAY_BUFFER, sizef, null, PGL.STATIC_DRAW);
-
- pgl.bindBuffer(PGL.ARRAY_BUFFER, 0);
-
- glPolyIndex = createVertexBufferObject(polyBuffersContext);
- pgl.bindBuffer(PGL.ELEMENT_ARRAY_BUFFER, glPolyIndex);
- pgl.bufferData(PGL.ELEMENT_ARRAY_BUFFER, sizex, null, PGL.STATIC_DRAW);
-
- pgl.bindBuffer(PGL.ELEMENT_ARRAY_BUFFER, 0);
-
- polyBuffersCreated = true;
- }
- }
-
-
- protected void updatePolyBuffers(boolean lit, boolean tex) {
- createPolyBuffers();
-
- int size = tessGeo.polyVertexCount;
- int sizef = size * PGL.SIZEOF_FLOAT;
- int sizei = size * PGL.SIZEOF_INT;
-
- tessGeo.updatePolyVerticesBuffer();
- pgl.bindBuffer(PGL.ARRAY_BUFFER, glPolyVertex);
- pgl.bufferData(PGL.ARRAY_BUFFER, 4 * sizef,
- tessGeo.polyVerticesBuffer, PGL.STATIC_DRAW);
-
- tessGeo.updatePolyColorsBuffer();
- pgl.bindBuffer(PGL.ARRAY_BUFFER, glPolyColor);
- pgl.bufferData(PGL.ARRAY_BUFFER, sizei,
- tessGeo.polyColorsBuffer, PGL.STATIC_DRAW);
-
- if (lit) {
- tessGeo.updatePolyNormalsBuffer();
- pgl.bindBuffer(PGL.ARRAY_BUFFER, glPolyNormal);
- pgl.bufferData(PGL.ARRAY_BUFFER, 3 * sizef,
- tessGeo.polyNormalsBuffer, PGL.STATIC_DRAW);
-
- tessGeo.updatePolyAmbientBuffer();
- pgl.bindBuffer(PGL.ARRAY_BUFFER, glPolyAmbient);
- pgl.bufferData(PGL.ARRAY_BUFFER, sizei,
- tessGeo.polyAmbientBuffer, PGL.STATIC_DRAW);
-
- tessGeo.updatePolySpecularBuffer();
- pgl.bindBuffer(PGL.ARRAY_BUFFER, glPolySpecular);
- pgl.bufferData(PGL.ARRAY_BUFFER, sizei,
- tessGeo.polySpecularBuffer, PGL.STATIC_DRAW);
-
- tessGeo.updatePolyEmissiveBuffer();
- pgl.bindBuffer(PGL.ARRAY_BUFFER, glPolyEmissive);
- pgl.bufferData(PGL.ARRAY_BUFFER, sizei,
- tessGeo.polyEmissiveBuffer, PGL.STATIC_DRAW);
-
- tessGeo.updatePolyShininessBuffer();
- pgl.bindBuffer(PGL.ARRAY_BUFFER, glPolyShininess);
- pgl.bufferData(PGL.ARRAY_BUFFER, sizef,
- tessGeo.polyShininessBuffer, PGL.STATIC_DRAW);
- }
-
- if (tex) {
- tessGeo.updatePolyTexCoordsBuffer();
- pgl.bindBuffer(PGL.ARRAY_BUFFER, glPolyTexcoord);
- pgl.bufferData(PGL.ARRAY_BUFFER, 2 * sizef,
- tessGeo.polyTexCoordsBuffer, PGL.STATIC_DRAW);
- }
-
- tessGeo.updatePolyIndicesBuffer();
- pgl.bindBuffer(PGL.ELEMENT_ARRAY_BUFFER, glPolyIndex);
- pgl.bufferData(PGL.ELEMENT_ARRAY_BUFFER,
- tessGeo.polyIndexCount * PGL.SIZEOF_INDEX, tessGeo.polyIndicesBuffer,
- PGL.STATIC_DRAW);
- }
-
-
- protected void unbindPolyBuffers() {
- pgl.bindBuffer(PGL.ARRAY_BUFFER, 0);
- pgl.bindBuffer(PGL.ELEMENT_ARRAY_BUFFER, 0);
- }
-
-
- protected boolean polyBuffersContextIsOutdated() {
- return !pgl.contextIsCurrent(polyBuffersContext);
- }
-
-
- protected void deletePolyBuffers() {
- if (polyBuffersCreated) {
- deleteVertexBufferObject(glPolyVertex, polyBuffersContext);
- glPolyVertex = 0;
-
- deleteVertexBufferObject(glPolyColor, polyBuffersContext);
- glPolyColor = 0;
-
- deleteVertexBufferObject(glPolyNormal, polyBuffersContext);
- glPolyNormal = 0;
-
- deleteVertexBufferObject(glPolyTexcoord, polyBuffersContext);
- glPolyTexcoord = 0;
-
- deleteVertexBufferObject(glPolyAmbient, polyBuffersContext);
- glPolyAmbient = 0;
-
- deleteVertexBufferObject(glPolySpecular, polyBuffersContext);
- glPolySpecular = 0;
-
- deleteVertexBufferObject(glPolyEmissive, polyBuffersContext);
- glPolyEmissive = 0;
-
- deleteVertexBufferObject(glPolyShininess, polyBuffersContext);
- glPolyShininess = 0;
-
- deleteVertexBufferObject(glPolyIndex, polyBuffersContext);
- glPolyIndex = 0;
-
- polyBuffersCreated = false;
- }
- }
-
-
- protected void createLineBuffers() {
- if (!lineBuffersCreated || lineBufferContextIsOutdated()) {
- lineBuffersContext = pgl.getCurrentContext();
-
- int sizef = INIT_VERTEX_BUFFER_SIZE * PGL.SIZEOF_FLOAT;
- int sizei = INIT_VERTEX_BUFFER_SIZE * PGL.SIZEOF_INT;
- int sizex = INIT_INDEX_BUFFER_SIZE * PGL.SIZEOF_INDEX;
-
- glLineVertex = createVertexBufferObject(lineBuffersContext);
-
- pgl.bindBuffer(PGL.ARRAY_BUFFER, glLineVertex);
- pgl.bufferData(PGL.ARRAY_BUFFER, 3 * sizef, null, PGL.STATIC_DRAW);
-
- glLineColor = createVertexBufferObject(lineBuffersContext);
- pgl.bindBuffer(PGL.ARRAY_BUFFER, glLineColor);
- pgl.bufferData(PGL.ARRAY_BUFFER, sizei, null, PGL.STATIC_DRAW);
-
- glLineAttrib = createVertexBufferObject(lineBuffersContext);
- pgl.bindBuffer(PGL.ARRAY_BUFFER, glLineAttrib);
- pgl.bufferData(PGL.ARRAY_BUFFER, 4 * sizef, null, PGL.STATIC_DRAW);
-
- pgl.bindBuffer(PGL.ARRAY_BUFFER, 0);
-
- glLineIndex = createVertexBufferObject(lineBuffersContext);
- pgl.bindBuffer(PGL.ELEMENT_ARRAY_BUFFER, glLineIndex);
- pgl.bufferData(PGL.ELEMENT_ARRAY_BUFFER, sizex, null, PGL.STATIC_DRAW);
-
- pgl.bindBuffer(PGL.ELEMENT_ARRAY_BUFFER, 0);
-
- lineBuffersCreated = true;
- }
- }
-
-
- protected void updateLineBuffers() {
- createLineBuffers();
-
- int size = tessGeo.lineVertexCount;
- int sizef = size * PGL.SIZEOF_FLOAT;
- int sizei = size * PGL.SIZEOF_INT;
-
- tessGeo.updateLineVerticesBuffer();
- pgl.bindBuffer(PGL.ARRAY_BUFFER, glLineVertex);
- pgl.bufferData(PGL.ARRAY_BUFFER, 4 * sizef, tessGeo.lineVerticesBuffer,
- PGL.STATIC_DRAW);
-
- tessGeo.updateLineColorsBuffer();
- pgl.bindBuffer(PGL.ARRAY_BUFFER, glLineColor);
- pgl.bufferData(PGL.ARRAY_BUFFER, sizei,
- tessGeo.lineColorsBuffer, PGL.STATIC_DRAW);
-
- tessGeo.updateLineDirectionsBuffer();
- pgl.bindBuffer(PGL.ARRAY_BUFFER, glLineAttrib);
- pgl.bufferData(PGL.ARRAY_BUFFER, 4 * sizef,
- tessGeo.lineDirectionsBuffer, PGL.STATIC_DRAW);
-
- tessGeo.updateLineIndicesBuffer();
- pgl.bindBuffer(PGL.ELEMENT_ARRAY_BUFFER, glLineIndex);
- pgl.bufferData(PGL.ELEMENT_ARRAY_BUFFER,
- tessGeo.lineIndexCount * PGL.SIZEOF_INDEX,
- tessGeo.lineIndicesBuffer, PGL.STATIC_DRAW);
- }
-
-
- protected void unbindLineBuffers() {
- pgl.bindBuffer(PGL.ARRAY_BUFFER, 0);
- pgl.bindBuffer(PGL.ELEMENT_ARRAY_BUFFER, 0);
- }
-
-
- protected boolean lineBufferContextIsOutdated() {
- return !pgl.contextIsCurrent(lineBuffersContext);
- }
-
-
- protected void deleteLineBuffers() {
- if (lineBuffersCreated) {
- deleteVertexBufferObject(glLineVertex, lineBuffersContext);
- glLineVertex = 0;
-
- deleteVertexBufferObject(glLineColor, lineBuffersContext);
- glLineColor = 0;
-
- deleteVertexBufferObject(glLineAttrib, lineBuffersContext);
- glLineAttrib = 0;
-
- deleteVertexBufferObject(glLineIndex, lineBuffersContext);
- glLineIndex = 0;
-
- lineBuffersCreated = false;
- }
- }
-
-
- protected void createPointBuffers() {
- if (!pointBuffersCreated || pointBuffersContextIsOutdated()) {
- pointBuffersContext = pgl.getCurrentContext();
-
- int sizef = INIT_VERTEX_BUFFER_SIZE * PGL.SIZEOF_FLOAT;
- int sizei = INIT_VERTEX_BUFFER_SIZE * PGL.SIZEOF_INT;
- int sizex = INIT_INDEX_BUFFER_SIZE * PGL.SIZEOF_INDEX;
-
- glPointVertex = createVertexBufferObject(pointBuffersContext);
- pgl.bindBuffer(PGL.ARRAY_BUFFER, glPointVertex);
- pgl.bufferData(PGL.ARRAY_BUFFER, 3 * sizef, null, PGL.STATIC_DRAW);
-
- glPointColor = createVertexBufferObject(pointBuffersContext);
- pgl.bindBuffer(PGL.ARRAY_BUFFER, glPointColor);
- pgl.bufferData(PGL.ARRAY_BUFFER, sizei, null, PGL.STATIC_DRAW);
-
- glPointAttrib = createVertexBufferObject(pointBuffersContext);
- pgl.bindBuffer(PGL.ARRAY_BUFFER, glPointAttrib);
- pgl.bufferData(PGL.ARRAY_BUFFER, 2 * sizef, null, PGL.STATIC_DRAW);
-
- pgl.bindBuffer(PGL.ARRAY_BUFFER, 0);
-
- glPointIndex = createVertexBufferObject(pointBuffersContext);
- pgl.bindBuffer(PGL.ELEMENT_ARRAY_BUFFER, glPointIndex);
- pgl.bufferData(PGL.ELEMENT_ARRAY_BUFFER, sizex, null, PGL.STATIC_DRAW);
-
- pgl.bindBuffer(PGL.ELEMENT_ARRAY_BUFFER, 0);
-
- pointBuffersCreated = true;
- }
- }
-
-
- protected void updatePointBuffers() {
- createPointBuffers();
-
- int size = tessGeo.pointVertexCount;
- int sizef = size * PGL.SIZEOF_FLOAT;
- int sizei = size * PGL.SIZEOF_INT;
-
- tessGeo.updatePointVerticesBuffer();
- pgl.bindBuffer(PGL.ARRAY_BUFFER, glPointVertex);
- pgl.bufferData(PGL.ARRAY_BUFFER, 4 * sizef,
- tessGeo.pointVerticesBuffer, PGL.STATIC_DRAW);
-
- tessGeo.updatePointColorsBuffer();
- pgl.bindBuffer(PGL.ARRAY_BUFFER, glPointColor);
- pgl.bufferData(PGL.ARRAY_BUFFER, sizei,
- tessGeo.pointColorsBuffer, PGL.STATIC_DRAW);
-
- tessGeo.updatePointOffsetsBuffer();
- pgl.bindBuffer(PGL.ARRAY_BUFFER, glPointAttrib);
- pgl.bufferData(PGL.ARRAY_BUFFER, 2 * sizef,
- tessGeo.pointOffsetsBuffer, PGL.STATIC_DRAW);
-
- tessGeo.updatePointIndicesBuffer();
- pgl.bindBuffer(PGL.ELEMENT_ARRAY_BUFFER, glPointIndex);
- pgl.bufferData(PGL.ELEMENT_ARRAY_BUFFER,
- tessGeo.pointIndexCount * PGL.SIZEOF_INDEX,
- tessGeo.pointIndicesBuffer, PGL.STATIC_DRAW);
- }
-
-
- protected void unbindPointBuffers() {
- pgl.bindBuffer(PGL.ARRAY_BUFFER, 0);
- pgl.bindBuffer(PGL.ELEMENT_ARRAY_BUFFER, 0);
- }
-
-
- protected boolean pointBuffersContextIsOutdated() {
- return !pgl.contextIsCurrent(pointBuffersContext);
- }
-
-
- protected void deletePointBuffers() {
- if (pointBuffersCreated) {
- deleteVertexBufferObject(glPointVertex, pointBuffersContext);
- glPointVertex = 0;
-
- deleteVertexBufferObject(glPointColor, pointBuffersContext);
- glPointColor = 0;
-
- deleteVertexBufferObject(glPointAttrib, pointBuffersContext);
- glPointAttrib = 0;
-
- deleteVertexBufferObject(glPointIndex, pointBuffersContext);
- glPointIndex = 0;
-
- pointBuffersCreated = false;
- }
- }
-
-
- /**
- * OpenGL cannot draw until a proper native peer is available, so this
- * returns the value of PApplet.isDisplayable() (inherited from Component).
- */
- @Override
- public boolean canDraw() {
- return pgl.canDraw();
- }
-
-
- @Override
- public void requestDraw() {
- if (primarySurface) {
- if (initialized) {
- pgl.requestDraw();
- } else {
- initPrimary();
- }
- }
- }
-
-
- @Override
- public void beginDraw() {
- report("top beginDraw()");
-
- if (!checkGLThread()) {
- return;
- }
-
- if (drawing) {
- PGraphics.showWarning(ALREADY_DRAWING_ERROR);
- return;
- }
-
- if (pgCurrent != null && !pgCurrent.primarySurface &&
- !this.primarySurface) {
- // It seems that the user is trying to start another beginDraw()/endDraw()
- // block for an offscreen surface, still drawing on another one.
- PGraphics.showWarning(NESTED_DRAW_ERROR);
- return;
- }
-
- if (!glParamsRead) {
- getGLParameters();
- }
-
- if (primarySurface) {
- beginOnscreenDraw();
- } else {
- beginOffscreenDraw();
- }
- setDefaults();
-
- pgCurrent = this;
- drawing = true;
-
- report("bot beginDraw()");
- }
-
-
- @Override
- public void endDraw() {
- report("top endDraw()");
-
- if (!drawing) {
- PGraphics.showWarning(NO_BEGIN_DRAW_ERROR);
- return;
- }
-
- // Flushing any remaining geometry.
- flush();
-
- if (PGL.SAVE_SURFACE_TO_PIXELS &&
- (!pgPrimary.initialized || parent.frameCount == 0)) {
- // Smooth was disabled/enabled at some point during drawing. We save
- // the current contents of the back buffer (because the buffers haven't
- // been swapped yet) to the pixels array. The frameCount == 0 condition
- // is to handle the situation when no smooth is called in setup in the
- // PDE, but the OpenGL appears to be recreated due to the size() nastiness.
- saveSurfaceToPixels();
- restoreSurface = true;
- }
-
- if (primarySurface) {
- endOnscreenDraw();
- } else {
- endOffscreenDraw();
- }
-
- if (pgCurrent == pgPrimary) {
- // Done with the main surface
- pgCurrent = null;
- } else {
- // Done with an offscreen surface, going back to onscreen drawing.
- pgCurrent = pgPrimary;
- }
- drawing = false;
-
- report("bot endDraw()");
- }
-
-
- @Override
- public PGL beginPGL() {
- flush();
- pgl.beginGL();
- return pgl;
- }
-
-
- @Override
- public void endPGL() {
- pgl.endGL();
- restoreGL();
- }
-
-
- public void updateProjmodelview() {
- projmodelview.set(projection);
- projmodelview.apply(modelview);
- }
-
-
- protected void restartPGL() {
- initialized = false;
- }
-
-
- protected void restoreGL() {
- setBlendMode(blendMode);
-
- if (hints[DISABLE_DEPTH_TEST]) {
- pgl.disable(PGL.DEPTH_TEST);
- } else {
- pgl.enable(PGL.DEPTH_TEST);
- }
- pgl.depthFunc(PGL.LEQUAL);
-
- if (quality < 2) {
- pgl.disable(PGL.MULTISAMPLE);
- } else {
- pgl.enable(PGL.MULTISAMPLE);
- pgl.disable(PGL.POINT_SMOOTH);
- pgl.disable(PGL.LINE_SMOOTH);
- pgl.disable(PGL.POLYGON_SMOOTH);
- }
-
- pgl.viewport(viewport.get(0), viewport.get(1),
- viewport.get(2), viewport.get(3));
- if (clip) {
- pgl.enable(PGL.SCISSOR_TEST);
- pgl.scissor(clipRect[0], clipRect[1], clipRect[2], clipRect[3]);
- } else {
- pgl.disable(PGL.SCISSOR_TEST);
- }
-
- pgl.frontFace(PGL.CW);
- pgl.disable(PGL.CULL_FACE);
-
- pgl.activeTexture(PGL.TEXTURE0);
-
- if (hints[DISABLE_DEPTH_MASK]) {
- pgl.depthMask(false);
- } else {
- pgl.depthMask(true);
- }
-
- currentFramebuffer.bind();
- pgl.drawBuffer(currentFramebuffer.getDefaultDrawBuffer());
- }
-
-
- protected void beginPixelsOp(int op) {
- FrameBuffer pixfb = null;
- if (primarySurface) {
- if (op == OP_READ) {
- if (pgl.isFBOBacked() && pgl.isMultisampled()) {
- // Making sure the back texture is up-to-date...
- pgl.syncBackTexture();
- // ...because the read framebuffer uses it as the color buffer (the
- // draw framebuffer is MSAA so it cannot be read from it).
- pixfb = readFramebuffer;
- } else {
- pixfb = drawFramebuffer;
- }
- } else if (op == OP_WRITE) {
- // We can write to the draw framebuffer irrespective of whether is
- // FBO-baked or multisampled.
- pixfb = drawFramebuffer;
- }
- } else {
- if (op == OP_READ) {
- if (offscreenMultisample) {
- // Making sure the offscreen FBO is up-to-date
- multisampleFramebuffer.copy(offscreenFramebuffer, currentFramebuffer);
- }
- // We always read the screen pixels from the color FBO.
- pixfb = offscreenFramebuffer;
- } else if (op == OP_WRITE) {
- // We can write directly to the color FBO, or to the multisample FBO
- // if multisampling is enabled.
- pixfb = offscreenMultisample ? multisampleFramebuffer :
- offscreenFramebuffer;
- }
- }
-
- // Set the framebuffer where the pixel operation shall be carried out.
- if (pixfb != currentFramebuffer) {
- pushFramebuffer();
- setFramebuffer(pixfb);
- pixOpChangedFB = true;
- }
-
- // We read from/write to the draw buffer.
- if (op == OP_READ) {
- pgl.readBuffer(currentFramebuffer.getDefaultDrawBuffer());
- } else if (op == OP_WRITE) {
- pgl.drawBuffer(currentFramebuffer.getDefaultDrawBuffer());
- }
-
- pixelsOp = op;
- }
-
-
- protected void endPixelsOp() {
- // Restoring current framebuffer prior to the pixel operation
- if (pixOpChangedFB) {
- popFramebuffer();
- pixOpChangedFB = false;
- }
-
- // Restoring default read/draw buffer configuration.
- pgl.readBuffer(currentFramebuffer.getDefaultReadBuffer());
- pgl.drawBuffer(currentFramebuffer.getDefaultDrawBuffer());
-
- pixelsOp = OP_NONE;
- }
-
-
- protected void updateGLProjection() {
- if (glProjection == null) {
- glProjection = new float[16];
- }
-
- glProjection[0] = projection.m00;
- glProjection[1] = projection.m10;
- glProjection[2] = projection.m20;
- glProjection[3] = projection.m30;
-
- glProjection[4] = projection.m01;
- glProjection[5] = projection.m11;
- glProjection[6] = projection.m21;
- glProjection[7] = projection.m31;
-
- glProjection[8] = projection.m02;
- glProjection[9] = projection.m12;
- glProjection[10] = projection.m22;
- glProjection[11] = projection.m32;
-
- glProjection[12] = projection.m03;
- glProjection[13] = projection.m13;
- glProjection[14] = projection.m23;
- glProjection[15] = projection.m33;
- }
-
-
- protected void updateGLModelview() {
- if (glModelview == null) {
- glModelview = new float[16];
- }
-
- glModelview[0] = modelview.m00;
- glModelview[1] = modelview.m10;
- glModelview[2] = modelview.m20;
- glModelview[3] = modelview.m30;
-
- glModelview[4] = modelview.m01;
- glModelview[5] = modelview.m11;
- glModelview[6] = modelview.m21;
- glModelview[7] = modelview.m31;
-
- glModelview[8] = modelview.m02;
- glModelview[9] = modelview.m12;
- glModelview[10] = modelview.m22;
- glModelview[11] = modelview.m32;
-
- glModelview[12] = modelview.m03;
- glModelview[13] = modelview.m13;
- glModelview[14] = modelview.m23;
- glModelview[15] = modelview.m33;
- }
-
-
- protected void updateGLProjmodelview() {
- if (glProjmodelview == null) {
- glProjmodelview = new float[16];
- }
-
- glProjmodelview[0] = projmodelview.m00;
- glProjmodelview[1] = projmodelview.m10;
- glProjmodelview[2] = projmodelview.m20;
- glProjmodelview[3] = projmodelview.m30;
-
- glProjmodelview[4] = projmodelview.m01;
- glProjmodelview[5] = projmodelview.m11;
- glProjmodelview[6] = projmodelview.m21;
- glProjmodelview[7] = projmodelview.m31;
-
- glProjmodelview[8] = projmodelview.m02;
- glProjmodelview[9] = projmodelview.m12;
- glProjmodelview[10] = projmodelview.m22;
- glProjmodelview[11] = projmodelview.m32;
-
- glProjmodelview[12] = projmodelview.m03;
- glProjmodelview[13] = projmodelview.m13;
- glProjmodelview[14] = projmodelview.m23;
- glProjmodelview[15] = projmodelview.m33;
- }
-
-
- protected void updateGLNormal() {
- if (glNormal == null) {
- glNormal = new float[9];
- }
-
- // The normal matrix is the transpose of the inverse of the
- // modelview (remember that gl matrices are column-major,
- // meaning that elements 0, 1, 2 are the first column,
- // 3, 4, 5 the second, etc.):
- glNormal[0] = modelviewInv.m00;
- glNormal[1] = modelviewInv.m01;
- glNormal[2] = modelviewInv.m02;
-
- glNormal[3] = modelviewInv.m10;
- glNormal[4] = modelviewInv.m11;
- glNormal[5] = modelviewInv.m12;
-
- glNormal[6] = modelviewInv.m20;
- glNormal[7] = modelviewInv.m21;
- glNormal[8] = modelviewInv.m22;
- }
-
-
- //////////////////////////////////////////////////////////////
-
- // SETTINGS
-
- // protected void checkSettings()
-
-
- @Override
- protected void defaultSettings() {
- super.defaultSettings();
-
- manipulatingCamera = false;
-
- clearColorBuffer = false;
-
- // easiest for beginners
- textureMode(IMAGE);
-
- // Default material properties
- ambient(255);
- specular(125);
- emissive(0);
- shininess(1);
-
- // To indicate that the user hasn't set ambient
- setAmbient = false;
- }
-
-
- // reapplySettings
-
- //////////////////////////////////////////////////////////////
-
- // HINTS
-
-
- @Override
- public void hint(int which) {
- boolean oldValue = hints[PApplet.abs(which)];
- super.hint(which);
- boolean newValue = hints[PApplet.abs(which)];
-
- if (oldValue == newValue) {
- return;
- }
-
- if (which == DISABLE_DEPTH_TEST) {
- flush();
- pgl.disable(PGL.DEPTH_TEST);
- } else if (which == ENABLE_DEPTH_TEST) {
- flush();
- pgl.enable(PGL.DEPTH_TEST);
- } else if (which == DISABLE_DEPTH_MASK) {
- flush();
- pgl.depthMask(false);
- } else if (which == ENABLE_DEPTH_MASK) {
- flush();
- pgl.depthMask(true);
- } else if (which == ENABLE_OPTIMIZED_STROKE) {
- flush();
- setFlushMode(FLUSH_WHEN_FULL);
- } else if (which == DISABLE_OPTIMIZED_STROKE) {
- flush();
- setFlushMode(FLUSH_CONTINUOUSLY);
- } else if (which == DISABLE_STROKE_PERSPECTIVE) {
- if (0 < tessGeo.lineVertexCount && 0 < tessGeo.lineIndexCount) {
- // We flush the geometry using the previous line setting.
- flush();
- }
- } else if (which == ENABLE_STROKE_PERSPECTIVE) {
- if (0 < tessGeo.lineVertexCount && 0 < tessGeo.lineIndexCount) {
- // We flush the geometry using the previous line setting.
- flush();
- }
- }
- }
-
-
- protected boolean getHint(int which) {
- if (which > 0) {
- return hints[which];
- } else {
- return !hints[-which];
- }
- }
-
-
- //////////////////////////////////////////////////////////////
-
- // VERTEX SHAPES
-
-
- @Override
- public void beginShape(int kind) {
- shape = kind;
- curveVertexCount = 0;
- inGeo.clear();
-
- breakShape = true;
- defaultEdges = true;
-
- textureImage0 = textureImage;
- // The superclass method is called to avoid an early flush.
- super.noTexture();
-
- normalMode = NORMAL_MODE_AUTO;
- }
-
-
- @Override
- public void endShape(int mode) {
- tessellate(mode);
-
- if ((flushMode == FLUSH_CONTINUOUSLY) ||
- (flushMode == FLUSH_WHEN_FULL && tessGeo.isFull())) {
- flush();
- }
- }
-
-
- protected void endShape(int[] indices) {
- endShape(indices, null);
- }
-
-
- protected void endShape(int[] indices, int[] edges) {
- if (shape != TRIANGLE && shape != TRIANGLES) {
- throw new RuntimeException("Indices and edges can only be set for " +
- "TRIANGLE shapes");
- }
-
- tessellate(indices, edges);
-
- if (flushMode == FLUSH_CONTINUOUSLY ||
- (flushMode == FLUSH_WHEN_FULL && tessGeo.isFull())) {
- flush();
- }
- }
-
-
- @Override
- public void textureWrap(int wrap) {
- this.textureWrap = wrap;
- }
-
-
- public void textureSampling(int sampling) {
- this.textureSampling = sampling;
- }
-
-
- @Override
- public void beginContour() {
- if (openContour) {
- PGraphics.showWarning(ALREADY_BEGAN_CONTOUR_ERROR);
- return;
- }
- openContour = true;
- breakShape = true;
- }
-
-
- @Override
- public void endContour() {
- if (!openContour) {
- PGraphics.showWarning(NO_BEGIN_CONTOUR_ERROR);
- return;
- }
- openContour = false;
- }
-
-
- @Override
- public void vertex(float x, float y) {
- vertexImpl(x, y, 0, 0, 0);
- }
-
-
- @Override
- public void vertex(float x, float y, float u, float v) {
- vertexImpl(x, y, 0, u, v);
- }
-
-
- @Override
- public void vertex(float x, float y, float z) {
- vertexImpl(x, y, z, 0, 0);
- }
-
-
- @Override
- public void vertex(float x, float y, float z, float u, float v) {
- vertexImpl(x, y, z, u, v);
- }
-
-
- protected void vertexImpl(float x, float y, float z, float u, float v) {
- boolean textured = textureImage != null;
- int fcolor = 0x00;
- if (fill || textured) {
- if (!textured) {
- fcolor = fillColor;
- } else {
- if (tint) {
- fcolor = tintColor;
- } else {
- fcolor = 0xffFFFFFF;
- }
- }
- }
-
- int scolor = 0x00;
- float sweight = 0;
- if (stroke) {
- scolor = strokeColor;
- sweight = strokeWeight;
- }
-
- if (textured && textureMode == IMAGE) {
- u = PApplet.min(1, u / textureImage.width);
- v = PApplet.min(1, v / textureImage.height);
- }
-
- inGeo.addVertex(x, y, z,
- fcolor,
- normalX, normalY, normalZ,
- u, v,
- scolor, sweight,
- ambientColor, specularColor, emissiveColor, shininess,
- vertexCode());
- }
-
-
- protected int vertexCode() {
- int code = VERTEX;
- if (breakShape) {
- code = BREAK;
- breakShape = false;
- }
- return code;
- }
-
-
- @Override
- protected void clipImpl(float x1, float y1, float x2, float y2) {
- flush();
- pgl.enable(PGL.SCISSOR_TEST);
-
- float h = y2 - y1;
- clipRect[0] = (int)x1;
- clipRect[1] = (int)(height - y1 - h);
- clipRect[2] = (int)(x2 - x1);
- clipRect[3] = (int)h;
- pgl.scissor(clipRect[0], clipRect[1], clipRect[2], clipRect[3]);
-
- clip = true;
- }
-
-
- @Override
- public void noClip() {
- if (clip) {
- flush();
- pgl.disable(PGL.SCISSOR_TEST);
- clip = false;
- }
- }
-
-
- //////////////////////////////////////////////////////////////
-
- // RENDERING
-
- // protected void render()
-
- // protected void sort()
-
-
- protected void tessellate(int mode) {
- tessellator.setInGeometry(inGeo);
- tessellator.setTessGeometry(tessGeo);
- tessellator.setFill(fill || textureImage != null);
- tessellator.setStroke(stroke);
- tessellator.setStrokeColor(strokeColor);
- tessellator.setStrokeWeight(strokeWeight);
- tessellator.setStrokeCap(strokeCap);
- tessellator.setStrokeJoin(strokeJoin);
- tessellator.setTexCache(texCache, textureImage0, textureImage);
- tessellator.setTransform(modelview);
- tessellator.set3D(is3D());
-
- if (shape == POINTS) {
- tessellator.tessellatePoints();
- } else if (shape == LINES) {
- tessellator.tessellateLines();
- } else if (shape == LINE_STRIP) {
- tessellator.tessellateLineStrip();
- } else if (shape == LINE_LOOP) {
- tessellator.tessellateLineLoop();
- } else if (shape == TRIANGLE || shape == TRIANGLES) {
- if (stroke && defaultEdges) inGeo.addTrianglesEdges();
- if (normalMode == NORMAL_MODE_AUTO) inGeo.calcTrianglesNormals();
- tessellator.tessellateTriangles();
- } else if (shape == TRIANGLE_FAN) {
- if (stroke && defaultEdges) inGeo.addTriangleFanEdges();
- if (normalMode == NORMAL_MODE_AUTO) inGeo.calcTriangleFanNormals();
- tessellator.tessellateTriangleFan();
- } else if (shape == TRIANGLE_STRIP) {
- if (stroke && defaultEdges) inGeo.addTriangleStripEdges();
- if (normalMode == NORMAL_MODE_AUTO) inGeo.calcTriangleStripNormals();
- tessellator.tessellateTriangleStrip();
- } else if (shape == QUAD || shape == QUADS) {
- if (stroke && defaultEdges) inGeo.addQuadsEdges();
- if (normalMode == NORMAL_MODE_AUTO) inGeo.calcQuadsNormals();
- tessellator.tessellateQuads();
- } else if (shape == QUAD_STRIP) {
- if (stroke && defaultEdges) inGeo.addQuadStripEdges();
- if (normalMode == NORMAL_MODE_AUTO) inGeo.calcQuadStripNormals();
- tessellator.tessellateQuadStrip();
- } else if (shape == POLYGON) {
- if (stroke && defaultEdges) inGeo.addPolygonEdges(mode == CLOSE);
- tessellator.tessellatePolygon(false, mode == CLOSE,
- normalMode == NORMAL_MODE_AUTO);
- }
- }
-
- protected void tessellate(int[] indices, int[] edges) {
- if (edges != null) {
- int nedges = edges.length / 2;
- for (int n = 0; n < nedges; n++) {
- int i0 = edges[2 * n + 0];
- int i1 = edges[2 * n + 1];
- inGeo.addEdge(i0, i1, n == 0, n == nedges - 1);
- }
- }
-
- tessellator.setInGeometry(inGeo);
- tessellator.setTessGeometry(tessGeo);
- tessellator.setFill(fill || textureImage != null);
- tessellator.setStroke(stroke);
- tessellator.setStrokeColor(strokeColor);
- tessellator.setStrokeWeight(strokeWeight);
- tessellator.setStrokeCap(strokeCap);
- tessellator.setStrokeJoin(strokeJoin);
- tessellator.setTexCache(texCache, textureImage0, textureImage);
- tessellator.setTransform(modelview);
- tessellator.set3D(is3D());
-
- if (stroke && defaultEdges && edges == null) inGeo.addTrianglesEdges();
- if (normalMode == NORMAL_MODE_AUTO) inGeo.calcTrianglesNormals();
- tessellator.tessellateTriangles(indices);
- }
-
-
- @Override
- public void flush() {
- boolean hasPolys = 0 < tessGeo.polyVertexCount &&
- 0 < tessGeo.polyIndexCount;
- boolean hasLines = 0 < tessGeo.lineVertexCount &&
- 0 < tessGeo.lineIndexCount;
- boolean hasPoints = 0 < tessGeo.pointVertexCount &&
- 0 < tessGeo.pointIndexCount;
-
- boolean hasPixels = modified && pixels != null;
-
- if (hasPixels) {
- // If the user has been manipulating individual pixels,
- // the changes need to be copied to the screen before
- // drawing any new geometry.
- flushPixels();
- }
-
- if (hasPoints || hasLines || hasPolys) {
- PMatrix3D modelview0 = null;
- PMatrix3D modelviewInv0 = null;
- if (flushMode == FLUSH_WHEN_FULL) {
- // The modelview transformation has been applied already to the
- // tessellated vertices, so we set the OpenGL modelview matrix as
- // the identity to avoid applying the model transformations twice.
- // We save the modelview objects and temporarily use the identity
- // static matrix to avoid calling pushMatrix(), resetMatrix(),
- // popMatrix().
- modelview0 = modelview;
- modelviewInv0 = modelviewInv;
- modelview = modelviewInv = identity;
- projmodelview.set(projection);
- }
-
- if (hasPolys) {
- flushPolys();
- if (raw != null) {
- rawPolys();
- }
- }
-
- if (is3D()) {
- if (hasLines) {
- flushLines();
- if (raw != null) {
- rawLines();
- }
- }
-
- if (hasPoints) {
- flushPoints();
- if (raw != null) {
- rawPoints();
- }
- }
- }
-
- if (flushMode == FLUSH_WHEN_FULL) {
- modelview = modelview0;
- modelviewInv = modelviewInv0;
- updateProjmodelview();
- }
- }
-
- tessGeo.clear();
- texCache.clear();
- setgetPixels = false;
- }
-
-
- protected void flushPixels() {
- drawPixels(mx1, my1, mx2 - mx1 + 1, my2 - my1 + 1);
- modified = false;
- }
-
-
- protected void flushPolys() {
- updatePolyBuffers(lights, texCache.hasTexture);
-
- texCache.beginRender();
- for (int i = 0; i < texCache.size; i++) {
- Texture tex = texCache.getTexture(i);
-
- // If the renderer is 2D, then lights should always be false,
- // so no need to worry about that.
- BaseShader shader = getPolyShader(lights, tex != null);
- shader.bind();
-
- int first = texCache.firstCache[i];
- int last = texCache.lastCache[i];
- IndexCache cache = tessGeo.polyIndexCache;
-
- for (int n = first; n <= last; n++) {
- int ioffset = n == first ? texCache.firstIndex[i] : cache.indexOffset[n];
- int icount = n == last ? texCache.lastIndex[i] - ioffset + 1 :
- cache.indexOffset[n] + cache.indexCount[n] - ioffset;
- int voffset = cache.vertexOffset[n];
-
- shader.setVertexAttribute(glPolyVertex, 4, PGL.FLOAT, 0,
- 4 * voffset * PGL.SIZEOF_FLOAT);
- shader.setColorAttribute(glPolyColor, 4, PGL.UNSIGNED_BYTE, 0,
- 4 * voffset * PGL.SIZEOF_BYTE);
-
- if (lights) {
- shader.setNormalAttribute(glPolyNormal, 3, PGL.FLOAT, 0,
- 3 * voffset * PGL.SIZEOF_FLOAT);
- shader.setAmbientAttribute(glPolyAmbient, 4, PGL.UNSIGNED_BYTE, 0,
- 4 * voffset * PGL.SIZEOF_BYTE);
- shader.setSpecularAttribute(glPolySpecular, 4, PGL.UNSIGNED_BYTE, 0,
- 4 * voffset * PGL.SIZEOF_BYTE);
- shader.setEmissiveAttribute(glPolyEmissive, 4, PGL.UNSIGNED_BYTE, 0,
- 4 * voffset * PGL.SIZEOF_BYTE);
- shader.setShininessAttribute(glPolyShininess, 1, PGL.FLOAT, 0,
- voffset * PGL.SIZEOF_FLOAT);
- }
-
- if (tex != null) {
- shader.setTexcoordAttribute(glPolyTexcoord, 2, PGL.FLOAT, 0,
- 2 * voffset * PGL.SIZEOF_FLOAT);
- shader.setTexture(tex);
- }
-
- pgl.bindBuffer(PGL.ELEMENT_ARRAY_BUFFER, glPolyIndex);
- pgl.drawElements(PGL.TRIANGLES, icount, PGL.INDEX_TYPE,
- ioffset * PGL.SIZEOF_INDEX);
- pgl.bindBuffer(PGL.ELEMENT_ARRAY_BUFFER, 0);
- }
-
- shader.unbind();
- }
- texCache.endRender();
- unbindPolyBuffers();
- }
-
-
- void rawPolys() {
- raw.colorMode(RGB);
- raw.noStroke();
- raw.beginShape(TRIANGLES);
-
- float[] vertices = tessGeo.polyVertices;
- int[] color = tessGeo.polyColors;
- float[] uv = tessGeo.polyTexCoords;
- short[] indices = tessGeo.polyIndices;
-
- for (int i = 0; i < texCache.size; i++) {
- PImage textureImage = texCache.getTextureImage(i);
-
- int first = texCache.firstCache[i];
- int last = texCache.lastCache[i];
- IndexCache cache = tessGeo.polyIndexCache;
- for (int n = first; n <= last; n++) {
- int ioffset = n == first ? texCache.firstIndex[i] :
- cache.indexOffset[n];
- int icount = n == last ? texCache.lastIndex[i] - ioffset + 1 :
- cache.indexOffset[n] + cache.indexCount[n] -
- ioffset;
- int voffset = cache.vertexOffset[n];
-
- for (int tr = ioffset / 3; tr < (ioffset + icount) / 3; tr++) {
- int i0 = voffset + indices[3 * tr + 0];
- int i1 = voffset + indices[3 * tr + 1];
- int i2 = voffset + indices[3 * tr + 2];
-
- float[] pt0 = {0, 0, 0, 0};
- float[] pt1 = {0, 0, 0, 0};
- float[] pt2 = {0, 0, 0, 0};
- int argb0 = PGL.nativeToJavaARGB(color[i0]);
- int argb1 = PGL.nativeToJavaARGB(color[i1]);
- int argb2 = PGL.nativeToJavaARGB(color[i2]);
-
- if (flushMode == FLUSH_CONTINUOUSLY) {
- float[] src0 = {0, 0, 0, 0};
- float[] src1 = {0, 0, 0, 0};
- float[] src2 = {0, 0, 0, 0};
- PApplet.arrayCopy(vertices, 4 * i0, src0, 0, 4);
- PApplet.arrayCopy(vertices, 4 * i1, src1, 0, 4);
- PApplet.arrayCopy(vertices, 4 * i2, src2, 0, 4);
- modelview.mult(src0, pt0);
- modelview.mult(src1, pt1);
- modelview.mult(src2, pt2);
- } else {
- PApplet.arrayCopy(vertices, 4 * i0, pt0, 0, 4);
- PApplet.arrayCopy(vertices, 4 * i1, pt1, 0, 4);
- PApplet.arrayCopy(vertices, 4 * i2, pt2, 0, 4);
- }
-
- if (textureImage != null) {
- raw.texture(textureImage);
- if (raw.is3D()) {
- raw.fill(argb0);
- raw.vertex(pt0[X], pt0[Y], pt0[Z], uv[2 * i0 + 0], uv[2 * i0 + 1]);
- raw.fill(argb1);
- raw.vertex(pt1[X], pt1[Y], pt1[Z], uv[2 * i1 + 0], uv[2 * i1 + 1]);
- raw.fill(argb2);
- raw.vertex(pt2[X], pt2[Y], pt2[Z], uv[2 * i2 + 0], uv[2 * i2 + 1]);
- } else if (raw.is2D()) {
- float sx0 = screenXImpl(pt0[0], pt0[1], pt0[2], pt0[3]);
- float sy0 = screenYImpl(pt0[0], pt0[1], pt0[2], pt0[3]);
- float sx1 = screenXImpl(pt1[0], pt1[1], pt1[2], pt1[3]);
- float sy1 = screenYImpl(pt1[0], pt1[1], pt1[2], pt1[3]);
- float sx2 = screenXImpl(pt2[0], pt2[1], pt2[2], pt2[3]);
- float sy2 = screenYImpl(pt2[0], pt2[1], pt2[2], pt2[3]);
- raw.fill(argb0);
- raw.vertex(sx0, sy0, uv[2 * i0 + 0], uv[2 * i0 + 1]);
- raw.fill(argb1);
- raw.vertex(sx1, sy1, uv[2 * i1 + 0], uv[2 * i1 + 1]);
- raw.fill(argb1);
- raw.vertex(sx2, sy2, uv[2 * i2 + 0], uv[2 * i2 + 1]);
- }
- } else {
- if (raw.is3D()) {
- raw.fill(argb0);
- raw.vertex(pt0[X], pt0[Y], pt0[Z]);
- raw.fill(argb1);
- raw.vertex(pt1[X], pt1[Y], pt1[Z]);
- raw.fill(argb2);
- raw.vertex(pt2[X], pt2[Y], pt2[Z]);
- } else if (raw.is2D()) {
- float sx0 = screenXImpl(pt0[0], pt0[1], pt0[2], pt0[3]);
- float sy0 = screenYImpl(pt0[0], pt0[1], pt0[2], pt0[3]);
- float sx1 = screenXImpl(pt1[0], pt1[1], pt1[2], pt1[3]);
- float sy1 = screenYImpl(pt1[0], pt1[1], pt1[2], pt1[3]);
- float sx2 = screenXImpl(pt2[0], pt2[1], pt2[2], pt2[3]);
- float sy2 = screenYImpl(pt2[0], pt2[1], pt2[2], pt2[3]);
- raw.fill(argb0);
- raw.vertex(sx0, sy0);
- raw.fill(argb1);
- raw.vertex(sx1, sy1);
- raw.fill(argb2);
- raw.vertex(sx2, sy2);
- }
- }
- }
- }
- }
-
- raw.endShape();
- }
-
-
- protected void flushLines() {
- updateLineBuffers();
-
- LineShader shader = getLineShader();
- shader.bind();
-
- IndexCache cache = tessGeo.lineIndexCache;
- for (int n = 0; n < cache.size; n++) {
- int ioffset = cache.indexOffset[n];
- int icount = cache.indexCount[n];
- int voffset = cache.vertexOffset[n];
-
- shader.setVertexAttribute(glLineVertex, 4, PGL.FLOAT, 0,
- 4 * voffset * PGL.SIZEOF_FLOAT);
- shader.setColorAttribute(glLineColor, 4, PGL.UNSIGNED_BYTE, 0,
- 4 * voffset * PGL.SIZEOF_BYTE);
- shader.setLineAttribute(glLineAttrib, 4, PGL.FLOAT, 0,
- 4 * voffset * PGL.SIZEOF_FLOAT);
-
- pgl.bindBuffer(PGL.ELEMENT_ARRAY_BUFFER, glLineIndex);
- pgl.drawElements(PGL.TRIANGLES, icount, PGL.INDEX_TYPE,
- ioffset * PGL.SIZEOF_INDEX);
- pgl.bindBuffer(PGL.ELEMENT_ARRAY_BUFFER, 0);
- }
-
- shader.unbind();
- unbindLineBuffers();
- }
-
-
- void rawLines() {
- raw.colorMode(RGB);
- raw.noFill();
- raw.strokeCap(strokeCap);
- raw.strokeJoin(strokeJoin);
- raw.beginShape(LINES);
-
- float[] vertices = tessGeo.lineVertices;
- int[] color = tessGeo.lineColors;
- float[] attribs = tessGeo.lineDirections;
- short[] indices = tessGeo.lineIndices;
-
- IndexCache cache = tessGeo.lineIndexCache;
- for (int n = 0; n < cache.size; n++) {
- int ioffset = cache.indexOffset[n];
- int icount = cache.indexCount[n];
- int voffset = cache.vertexOffset[n];
-
- for (int ln = ioffset / 6; ln < (ioffset + icount) / 6; ln++) {
- // Each line segment is defined by six indices since its
- // formed by two triangles. We only need the first and last
- // vertices.
- // This bunch of vertices could also be the bevel triangles,
- // with we detect this situation by looking at the line weight.
- int i0 = voffset + indices[6 * ln + 0];
- int i1 = voffset + indices[6 * ln + 5];
- float sw0 = 2 * attribs[4 * i0 + 3];
- float sw1 = 2 * attribs[4 * i1 + 3];
-
- if (zero(sw0)) continue; // Bevel triangles, skip.
-
- float[] pt0 = {0, 0, 0, 0};
- float[] pt1 = {0, 0, 0, 0};
- int argb0 = PGL.nativeToJavaARGB(color[i0]);
- int argb1 = PGL.nativeToJavaARGB(color[i1]);
-
- if (flushMode == FLUSH_CONTINUOUSLY) {
- float[] src0 = {0, 0, 0, 0};
- float[] src1 = {0, 0, 0, 0};
- PApplet.arrayCopy(vertices, 4 * i0, src0, 0, 4);
- PApplet.arrayCopy(vertices, 4 * i1, src1, 0, 4);
- modelview.mult(src0, pt0);
- modelview.mult(src1, pt1);
- } else {
- PApplet.arrayCopy(vertices, 4 * i0, pt0, 0, 4);
- PApplet.arrayCopy(vertices, 4 * i1, pt1, 0, 4);
- }
-
- if (raw.is3D()) {
- raw.strokeWeight(sw0);
- raw.stroke(argb0);
- raw.vertex(pt0[X], pt0[Y], pt0[Z]);
- raw.strokeWeight(sw1);
- raw.stroke(argb1);
- raw.vertex(pt1[X], pt1[Y], pt1[Z]);
- } else if (raw.is2D()) {
- float sx0 = screenXImpl(pt0[0], pt0[1], pt0[2], pt0[3]);
- float sy0 = screenYImpl(pt0[0], pt0[1], pt0[2], pt0[3]);
- float sx1 = screenXImpl(pt1[0], pt1[1], pt1[2], pt1[3]);
- float sy1 = screenYImpl(pt1[0], pt1[1], pt1[2], pt1[3]);
- raw.strokeWeight(sw0);
- raw.stroke(argb0);
- raw.vertex(sx0, sy0);
- raw.strokeWeight(sw1);
- raw.stroke(argb1);
- raw.vertex(sx1, sy1);
- }
- }
- }
-
- raw.endShape();
- }
-
-
- protected void flushPoints() {
- updatePointBuffers();
-
- PointShader shader = getPointShader();
- shader.bind();
-
- IndexCache cache = tessGeo.pointIndexCache;
- for (int n = 0; n < cache.size; n++) {
- int ioffset = cache.indexOffset[n];
- int icount = cache.indexCount[n];
- int voffset = cache.vertexOffset[n];
-
- shader.setVertexAttribute(glPointVertex, 4, PGL.FLOAT, 0,
- 4 * voffset * PGL.SIZEOF_FLOAT);
- shader.setColorAttribute(glPointColor, 4, PGL.UNSIGNED_BYTE, 0,
- 4 * voffset * PGL.SIZEOF_BYTE);
- shader.setPointAttribute(glPointAttrib, 2, PGL.FLOAT, 0,
- 2 * voffset * PGL.SIZEOF_FLOAT);
-
- pgl.bindBuffer(PGL.ELEMENT_ARRAY_BUFFER, glPointIndex);
- pgl.drawElements(PGL.TRIANGLES, icount, PGL.INDEX_TYPE,
- ioffset * PGL.SIZEOF_INDEX);
- pgl.bindBuffer(PGL.ELEMENT_ARRAY_BUFFER, 0);
- }
-
- shader.unbind();
- unbindPointBuffers();
- }
-
-
- void rawPoints() {
- raw.colorMode(RGB);
- raw.noFill();
- raw.strokeCap(strokeCap);
- raw.beginShape(POINTS);
-
- float[] vertices = tessGeo.pointVertices;
- int[] color = tessGeo.pointColors;
- float[] attribs = tessGeo.pointOffsets;
- short[] indices = tessGeo.pointIndices;
-
- IndexCache cache = tessGeo.pointIndexCache;
- for (int n = 0; n < cache.size; n++) {
- int ioffset = cache.indexOffset[n];
- int icount = cache.indexCount[n];
- int voffset = cache.vertexOffset[n];
-
- int pt = ioffset;
- while (pt < (ioffset + icount) / 3) {
- float size = attribs[2 * pt + 2];
- float weight;
- int perim;
- if (0 < size) { // round point
- weight = +size / 0.5f;
- perim = PApplet.max(MIN_POINT_ACCURACY,
- (int) (TWO_PI * weight / POINT_ACCURACY_FACTOR)) + 1;
- } else { // Square point
- weight = -size / 0.5f;
- perim = 5;
- }
-
- int i0 = voffset + indices[3 * pt];
- int argb0 = PGL.nativeToJavaARGB(color[i0]);
- float[] pt0 = {0, 0, 0, 0};
-
- if (flushMode == FLUSH_CONTINUOUSLY) {
- float[] src0 = {0, 0, 0, 0};
- PApplet.arrayCopy(vertices, 4 * i0, src0, 0, 4);
- modelview.mult(src0, pt0);
- } else {
- PApplet.arrayCopy(vertices, 4 * i0, pt0, 0, 4);
- }
-
- if (raw.is3D()) {
- raw.strokeWeight(weight);
- raw.stroke(argb0);
- raw.vertex(pt0[X], pt0[Y], pt0[Z]);
- } else if (raw.is2D()) {
- float sx0 = screenXImpl(pt0[0], pt0[1], pt0[2], pt0[3]);
- float sy0 = screenYImpl(pt0[0], pt0[1], pt0[2], pt0[3]);
- raw.strokeWeight(weight);
- raw.stroke(argb0);
- raw.vertex(sx0, sy0);
- }
-
- pt += perim;
- }
- }
-
- raw.endShape();
- }
-
-
- //////////////////////////////////////////////////////////////
-
- // BEZIER CURVE VERTICES
-
-
- @Override
- public void bezierVertex(float x2, float y2,
- float x3, float y3,
- float x4, float y4) {
- bezierVertexImpl(x2, y2, 0,
- x3, y3, 0,
- x4, y4, 0);
- }
-
-
- @Override
- public void bezierVertex(float x2, float y2, float z2,
- float x3, float y3, float z3,
- float x4, float y4, float z4) {
- bezierVertexImpl(x2, y2, z2,
- x3, y3, z3,
- x4, y4, z4);
- }
-
-
- protected void bezierVertexImpl(float x2, float y2, float z2,
- float x3, float y3, float z3,
- float x4, float y4, float z4) {
- inGeo.setMaterial(fillColor, strokeColor, strokeWeight,
- ambientColor, specularColor, emissiveColor, shininess);
- inGeo.setNormal(normalX, normalY, normalZ);
- inGeo.addBezierVertex(x2, y2, z2,
- x3, y3, z3,
- x4, y4, z4,
- fill, stroke, bezierDetail, vertexCode(), shape);
-
- }
-
-
- @Override
- public void quadraticVertex(float cx, float cy,
- float x3, float y3) {
- quadraticVertexImpl(cx, cy, 0,
- x3, y3, 0);
- }
-
-
- @Override
- public void quadraticVertex(float cx, float cy, float cz,
- float x3, float y3, float z3) {
- quadraticVertexImpl(cx, cy, cz,
- x3, y3, z3);
- }
-
-
- protected void quadraticVertexImpl(float cx, float cy, float cz,
- float x3, float y3, float z3) {
- inGeo.setMaterial(fillColor, strokeColor, strokeWeight,
- ambientColor, specularColor, emissiveColor, shininess);
- inGeo.setNormal(normalX, normalY, normalZ);
- inGeo.addQuadraticVertex(cx, cy, cz,
- x3, y3, z3,
- fill, stroke, bezierDetail, vertexCode(), shape);
- }
-
-
- //////////////////////////////////////////////////////////////
-
- // CATMULL-ROM CURVE VERTICES
-
-
- @Override
- public void curveVertex(float x, float y) {
- curveVertexImpl(x, y, 0);
- }
-
-
- @Override
- public void curveVertex(float x, float y, float z) {
- curveVertexImpl(x, y, z);
- }
-
-
- protected void curveVertexImpl(float x, float y, float z) {
- inGeo.setMaterial(fillColor, strokeColor, strokeWeight,
- ambientColor, specularColor, emissiveColor, shininess);
- inGeo.setNormal(normalX, normalY, normalZ);
- inGeo.addCurveVertex(x, y, z,
- fill, stroke, curveDetail, vertexCode(), shape);
- }
-
-
- //////////////////////////////////////////////////////////////
-
- // POINT, LINE, TRIANGLE, QUAD
-
-
- @Override
- public void point(float x, float y) {
- pointImpl(x, y, 0);
- }
-
-
- @Override
- public void point(float x, float y, float z) {
- pointImpl(x, y, z);
- }
-
-
- protected void pointImpl(float x, float y, float z) {
- beginShape(POINTS);
- defaultEdges = false;
- normalMode = NORMAL_MODE_SHAPE;
- inGeo.setMaterial(fillColor, strokeColor, strokeWeight,
- ambientColor, specularColor, emissiveColor, shininess);
- inGeo.setNormal(normalX, normalY, normalZ);
- inGeo.addPoint(x, y, z, fill, stroke);
- endShape();
- }
-
-
- @Override
- public void line(float x1, float y1, float x2, float y2) {
- lineImpl(x1, y1, 0, x2, y2, 0);
- }
-
-
- @Override
- public void line(float x1, float y1, float z1,
- float x2, float y2, float z2) {
- lineImpl(x1, y1, z1, x2, y2, z2);
- }
-
-
- protected void lineImpl(float x1, float y1, float z1,
- float x2, float y2, float z2) {
- beginShape(LINES);
- defaultEdges = false;
- normalMode = NORMAL_MODE_SHAPE;
- inGeo.setMaterial(fillColor, strokeColor, strokeWeight,
- ambientColor, specularColor, emissiveColor, shininess);
- inGeo.setNormal(normalX, normalY, normalZ);
- inGeo.addLine(x1, y1, z1,
- x2, y2, z2,
- fill, stroke);
- endShape();
- }
-
-
- @Override
- public void triangle(float x1, float y1, float x2, float y2,
- float x3, float y3) {
- beginShape(TRIANGLES);
- defaultEdges = false;
- normalMode = NORMAL_MODE_SHAPE;
- inGeo.setMaterial(fillColor, strokeColor, strokeWeight,
- ambientColor, specularColor, emissiveColor, shininess);
- inGeo.setNormal(normalX, normalY, normalZ);
- inGeo.addTriangle(x1, y1, 0,
- x2, y2, 0,
- x3, y3, 0,
- fill, stroke);
- endShape();
- }
-
-
- @Override
- public void quad(float x1, float y1, float x2, float y2,
- float x3, float y3, float x4, float y4) {
- beginShape(QUADS);
- defaultEdges = false;
- normalMode = NORMAL_MODE_SHAPE;
- inGeo.setMaterial(fillColor, strokeColor, strokeWeight,
- ambientColor, specularColor, emissiveColor, shininess);
- inGeo.setNormal(normalX, normalY, normalZ);
- inGeo.addQuad(x1, y1, 0,
- x2, y2, 0,
- x3, y3, 0,
- x4, y4, 0,
- fill, stroke);
- endShape();
- }
-
- //////////////////////////////////////////////////////////////
-
- // RECT
-
- // public void rectMode(int mode)
-
- @Override
- public void rect(float a, float b, float c, float d) {
- beginShape(QUADS);
- defaultEdges = false;
- normalMode = NORMAL_MODE_SHAPE;
- inGeo.setMaterial(fillColor, strokeColor, strokeWeight,
- ambientColor, specularColor, emissiveColor, shininess);
- inGeo.setNormal(normalX, normalY, normalZ);
- inGeo.addRect(a, b, c, d,
- fill, stroke, rectMode);
- endShape();
- }
-
-
- @Override
- public void rect(float a, float b, float c, float d,
- float tl, float tr, float br, float bl) {
- beginShape(POLYGON);
- defaultEdges = false;
- normalMode = NORMAL_MODE_SHAPE;
- inGeo.setMaterial(fillColor, strokeColor, strokeWeight,
- ambientColor, specularColor, emissiveColor, shininess);
- inGeo.setNormal(normalX, normalY, normalZ);
- inGeo.addRect(a, b, c, d,
- tl, tr, br, bl,
- fill, stroke, bezierDetail, rectMode);
- endShape(CLOSE);
- }
-
- // protected void rectImpl(float x1, float y1, float x2, float y2)
-
- //////////////////////////////////////////////////////////////
-
- // ELLIPSE
-
- // public void ellipseMode(int mode)
-
-
- @Override
- public void ellipse(float a, float b, float c, float d) {
- beginShape(TRIANGLE_FAN);
- defaultEdges = false;
- normalMode = NORMAL_MODE_SHAPE;
- inGeo.setMaterial(fillColor, strokeColor, strokeWeight,
- ambientColor, specularColor, emissiveColor, shininess);
- inGeo.setNormal(normalX, normalY, normalZ);
- inGeo.addEllipse(a, b, c, d, fill, stroke, ellipseMode);
- endShape();
- }
-
-
- // public void ellipse(float a, float b, float c, float d)
-
-
- @Override
- protected void arcImpl(float x, float y, float w, float h,
- float start, float stop, int mode) {
- beginShape(TRIANGLE_FAN);
- defaultEdges = false;
- normalMode = NORMAL_MODE_SHAPE;
- inGeo.setMaterial(fillColor, strokeColor, strokeWeight,
- ambientColor, specularColor, emissiveColor, shininess);
- inGeo.setNormal(normalX, normalY, normalZ);
- inGeo.addArc(x, y, w, h, start, stop, fill, stroke, mode);
- endShape();
- }
-
-
- //////////////////////////////////////////////////////////////
-
- // BOX
-
- // public void box(float size)
-
- @Override
- public void box(float w, float h, float d) {
- beginShape(QUADS);
- defaultEdges = false;
- normalMode = NORMAL_MODE_VERTEX;
- inGeo.setMaterial(fillColor, strokeColor, strokeWeight,
- ambientColor, specularColor, emissiveColor, shininess);
- inGeo.addBox(w, h, d, fill, stroke);
- endShape();
- }
-
- //////////////////////////////////////////////////////////////
-
- // SPHERE
-
- // public void sphereDetail(int res)
-
- // public void sphereDetail(int ures, int vres)
-
- @Override
- public void sphere(float r) {
- beginShape(TRIANGLES);
- defaultEdges = false;
- normalMode = NORMAL_MODE_VERTEX;
- inGeo.setMaterial(fillColor, strokeColor, strokeWeight,
- ambientColor, specularColor, emissiveColor, shininess);
- int[] indices = inGeo.addSphere(r, sphereDetailU, sphereDetailV,
- fill, stroke);
- endShape(indices);
- }
-
- //////////////////////////////////////////////////////////////
-
- // BEZIER
-
- // public float bezierPoint(float a, float b, float c, float d, float t)
-
- // public float bezierTangent(float a, float b, float c, float d, float t)
-
- // public void bezierDetail(int detail)
-
- // public void bezier(float x1, float y1,
- // float x2, float y2,
- // float x3, float y3,
- // float x4, float y4)
-
- // public void bezier(float x1, float y1, float z1,
- // float x2, float y2, float z2,
- // float x3, float y3, float z3,
- // float x4, float y4, float z4)
-
- //////////////////////////////////////////////////////////////
-
- // CATMULL-ROM CURVES
-
- // public float curvePoint(float a, float b, float c, float d, float t)
-
- // public float curveTangent(float a, float b, float c, float d, float t)
-
- // public void curveDetail(int detail)
-
- // public void curveTightness(float tightness)
-
- // public void curve(float x1, float y1,
- // float x2, float y2,
- // float x3, float y3,
- // float x4, float y4)
-
- // public void curve(float x1, float y1, float z1,
- // float x2, float y2, float z2,
- // float x3, float y3, float z3,
- // float x4, float y4, float z4)
-
- //////////////////////////////////////////////////////////////
-
- // IMAGES
-
- // public void imageMode(int mode)
-
- // public void image(PImage image, float x, float y)
-
- // public void image(PImage image, float x, float y, float c, float d)
-
- // public void image(PImage image,
- // float a, float b, float c, float d,
- // int u1, int v1, int u2, int v2)
-
- // protected void imageImpl(PImage image,
- // float x1, float y1, float x2, float y2,
- // int u1, int v1, int u2, int v2)
-
- //////////////////////////////////////////////////////////////
-
- // SMOOTH
-
-
- @Override
- public void smooth() {
- smooth(2);
- }
-
-
- @Override
- public void smooth(int level) {
- if (smoothDisabled) return;
-
- smooth = true;
-
- if (maxSamples < level) {
- if (0 < maxSamples) {
- PGraphics.showWarning(UNSUPPORTED_SMOOTH_LEVEL_ERROR, level, maxSamples);
- } else{
- PGraphics.showWarning(UNSUPPORTED_SMOOTH_ERROR);
- }
- level = maxSamples;
- }
-
- if (quality != level) {
- smoothCallCount++;
- if (parent.frameCount - lastSmoothCall < 30 && 5 < smoothCallCount) {
- smoothDisabled = true;
- PGraphics.showWarning(TOO_MANY_SMOOTH_CALLS_ERROR);
- }
- lastSmoothCall = parent.frameCount;
-
- quality = level;
- if (quality == 1) {
- quality = 0;
- }
-
- // This will trigger a surface restart next time
- // requestDraw() is called.
- restartPGL();
- }
- }
-
-
- @Override
- public void noSmooth() {
- if (smoothDisabled) return;
-
- smooth = false;
-
- if (1 < quality) {
- smoothCallCount++;
- if (parent.frameCount - lastSmoothCall < 30 && 5 < smoothCallCount) {
- smoothDisabled = true;
- PGraphics.showWarning(TOO_MANY_SMOOTH_CALLS_ERROR);
- }
- lastSmoothCall = parent.frameCount;
-
- quality = 0;
-
- // This will trigger a surface restart next time
- // requestDraw() is called.
- restartPGL();
- }
- }
-
-
- //////////////////////////////////////////////////////////////
-
- // SHAPE
-
- // public void shapeMode(int mode)
-
-
- // TODO unapproved
- @Override
- protected void shape(PShape shape, float x, float y, float z) {
- if (shape.isVisible()) { // don't do expensive matrix ops if invisible
- flush();
-
- pushMatrix();
-
- if (shapeMode == CENTER) {
- translate(x - shape.getWidth() / 2, y - shape.getHeight() / 2, z
- - shape.getDepth() / 2);
-
- } else if ((shapeMode == CORNER) || (shapeMode == CORNERS)) {
- translate(x, y, z);
- }
- shape.draw(this);
-
- popMatrix();
- }
- }
-
-
- // TODO unapproved
- @Override
- protected void shape(PShape shape, float x, float y, float z,
- float c, float d, float e) {
- if (shape.isVisible()) { // don't do expensive matrix ops if invisible
- flush();
-
- pushMatrix();
-
- if (shapeMode == CENTER) {
- // x, y and z are center, c, d and e refer to a diameter
- translate(x - c / 2f, y - d / 2f, z - e / 2f);
- scale(c / shape.getWidth(),
- d / shape.getHeight(),
- e / shape.getDepth());
-
- } else if (shapeMode == CORNER) {
- translate(x, y, z);
- scale(c / shape.getWidth(),
- d / shape.getHeight(),
- e / shape.getDepth());
-
- } else if (shapeMode == CORNERS) {
- // c, d, e are x2/y2/z2, make them into width/height/depth
- c -= x;
- d -= y;
- e -= z;
- // then same as above
- translate(x, y, z);
- scale(c / shape.getWidth(),
- d / shape.getHeight(),
- e / shape.getDepth());
- }
- shape.draw(this);
-
- popMatrix();
- }
- }
-
-
- //////////////////////////////////////////////////////////////
-
- // SHAPE I/O
-
-
- @Override
- public PShape loadShape(String filename) {
- String ext = PApplet.getExtension(filename);
- if (PGraphics2D.isSupportedExtension(ext)) {
- return PGraphics2D.loadShapeImpl(this, filename, ext);
- } if (PGraphics3D.isSupportedExtension(ext)) {
- return PGraphics3D.loadShapeImpl(this, filename, ext);
- } else {
- PGraphics.showWarning(UNSUPPORTED_SHAPE_FORMAT_ERROR);
- return null;
- }
- }
-
-
- //////////////////////////////////////////////////////////////
-
- // TEXT SETTINGS
-
- // public void textAlign(int align)
-
- // public void textAlign(int alignX, int alignY)
-
- // public float textAscent()
-
- // public float textDescent()
-
- // public void textFont(PFont which)
-
- // public void textFont(PFont which, float size)
-
- // public void textLeading(float leading)
-
- // public void textMode(int mode)
-
- @Override
- protected boolean textModeCheck(int mode) {
- return mode == MODEL;
- }
-
- // public void textSize(float size)
-
- // public float textWidth(char c)
-
- // public float textWidth(String str)
-
- // protected float textWidthImpl(char buffer[], int start, int stop)
-
-
- //////////////////////////////////////////////////////////////
-
- // TEXT IMPL
-
-
- // protected void textLineAlignImpl(char buffer[], int start, int stop,
- // float x, float y)
-
- /**
- * Implementation of actual drawing for a line of text.
- */
- @Override
- protected void textLineImpl(char buffer[], int start, int stop,
- float x, float y) {
- textTex = pgPrimary.getFontTexture(textFont);
- if (textTex == null) {
- textTex = new FontTexture(parent, textFont, maxTextureSize,
- maxTextureSize, is3D());
- pgPrimary.setFontTexture(textFont, textTex);
- } else {
- if (textTex.contextIsOutdated()) {
- textTex = new FontTexture(parent, textFont,
- PApplet.min(PGL.MAX_FONT_TEX_SIZE, maxTextureSize),
- PApplet.min(PGL.MAX_FONT_TEX_SIZE, maxTextureSize), is3D());
- pgPrimary.setFontTexture(textFont, textTex);
- }
- }
- textTex.begin();
-
- // Saving style parameters modified by text rendering.
- int savedTextureMode = textureMode;
- boolean savedStroke = stroke;
- float savedNormalX = normalX;
- float savedNormalY = normalY;
- float savedNormalZ = normalZ;
- boolean savedTint = tint;
- int savedTintColor = tintColor;
- int savedBlendMode = blendMode;
-
- // Setting style used in text rendering.
- textureMode = NORMAL;
- stroke = false;
- normalX = 0;
- normalY = 0;
- normalZ = 1;
- tint = true;
- tintColor = fillColor;
-
- blendMode(BLEND);
-
- super.textLineImpl(buffer, start, stop, x, y);
-
- // Restoring original style.
- textureMode = savedTextureMode;
- stroke = savedStroke;
- normalX = savedNormalX;
- normalY = savedNormalY;
- normalZ = savedNormalZ;
- tint = savedTint;
- tintColor = savedTintColor;
-
- // Note that if the user is using a blending mode different from
- // BLEND, and has a bunch of continuous text rendering, the performance
- // won't be optimal because at the end of each text() call the geometry
- // will be flushed when restoring the user's blend.
- blendMode(savedBlendMode);
-
- textTex.end();
- }
-
-
- @Override
- protected void textCharImpl(char ch, float x, float y) {
- PFont.Glyph glyph = textFont.getGlyph(ch);
-
- if (glyph != null) {
- FontTexture.TextureInfo tinfo = textTex.getTexInfo(glyph);
-
- if (tinfo == null) {
- // Adding new glyph to the font texture.
- tinfo = textTex.addToTexture(glyph);
- }
-
- if (textMode == MODEL) {
- float high = glyph.height / (float) textFont.getSize();
- float bwidth = glyph.width / (float) textFont.getSize();
- float lextent = glyph.leftExtent / (float) textFont.getSize();
- float textent = glyph.topExtent / (float) textFont.getSize();
-
- float x1 = x + lextent * textSize;
- float y1 = y - textent * textSize;
- float x2 = x1 + bwidth * textSize;
- float y2 = y1 + high * textSize;
-
- textCharModelImpl(tinfo, x1, y1, x2, y2);
- }
- }
- }
-
-
- protected void textCharModelImpl(FontTexture.TextureInfo info,
- float x0, float y0,
- float x1, float y1) {
- if (textTex.currentTex != info.texIndex) {
- textTex.setTexture(info.texIndex);
- }
- PImage tex = textTex.getCurrentTexture();
-
- beginShape(QUADS);
- texture(tex);
- vertex(x0, y0, info.u0, info.v0);
- vertex(x1, y0, info.u1, info.v0);
- vertex(x1, y1, info.u1, info.v1);
- vertex(x0, y1, info.u0, info.v1);
- endShape();
- }
-
-
- //////////////////////////////////////////////////////////////
-
- // MATRIX STACK
-
-
- @Override
- public void pushMatrix() {
- if (modelviewStackDepth == MATRIX_STACK_DEPTH) {
- throw new RuntimeException(ERROR_PUSHMATRIX_OVERFLOW);
- }
- modelview.get(modelviewStack[modelviewStackDepth]);
- modelviewInv.get(modelviewInvStack[modelviewStackDepth]);
- camera.get(cameraStack[modelviewStackDepth]);
- cameraInv.get(cameraInvStack[modelviewStackDepth]);
- modelviewStackDepth++;
- }
-
-
- @Override
- public void popMatrix() {
- if (modelviewStackDepth == 0) {
- throw new RuntimeException(ERROR_PUSHMATRIX_UNDERFLOW);
- }
- modelviewStackDepth--;
- modelview.set(modelviewStack[modelviewStackDepth]);
- modelviewInv.set(modelviewInvStack[modelviewStackDepth]);
- camera.set(cameraStack[modelviewStackDepth]);
- cameraInv.set(cameraInvStack[modelviewStackDepth]);
- updateProjmodelview();
- }
-
-
- //////////////////////////////////////////////////////////////
-
- // MATRIX TRANSFORMATIONS
-
-
- @Override
- public void translate(float tx, float ty) {
- translateImpl(tx, ty, 0);
- }
-
-
- @Override
- public void translate(float tx, float ty, float tz) {
- translateImpl(tx, ty, tz);
- }
-
-
- protected void translateImpl(float tx, float ty, float tz) {
- modelview.translate(tx, ty, tz);
- invTranslate(modelviewInv, tx, ty, tz);
- projmodelview.translate(tx, ty, tz);
- }
-
-
- static protected void invTranslate(PMatrix3D matrix,
- float tx, float ty, float tz) {
- matrix.preApply(1, 0, 0, -tx,
- 0, 1, 0, -ty,
- 0, 0, 1, -tz,
- 0, 0, 0, 1);
- }
-
-
- /**
- * Two dimensional rotation. Same as rotateZ (this is identical to a 3D
- * rotation along the z-axis) but included for clarity -- it'd be weird for
- * people drawing 2D graphics to be using rotateZ. And they might kick our a--
- * for the confusion.
- */
- @Override
- public void rotate(float angle) {
- rotateImpl(angle, 0, 0, 1);
- }
-
-
- @Override
- public void rotateX(float angle) {
- rotateImpl(angle, 1, 0, 0);
- }
-
-
- @Override
- public void rotateY(float angle) {
- rotateImpl(angle, 0, 1, 0);
- }
-
-
- @Override
- public void rotateZ(float angle) {
- rotateImpl(angle, 0, 0, 1);
- }
-
-
- /**
- * Rotate around an arbitrary vector, similar to glRotate(), except that it
- * takes radians (instead of degrees).
- */
- @Override
- public void rotate(float angle, float v0, float v1, float v2) {
- rotateImpl(angle, v0, v1, v2);
- }
-
-
- protected void rotateImpl(float angle, float v0, float v1, float v2) {
- float norm2 = v0 * v0 + v1 * v1 + v2 * v2;
- if (zero(norm2)) {
- // The vector is zero, cannot apply rotation.
- return;
- }
-
- if (diff(norm2, 1)) {
- // The rotation vector is not normalized.
- float norm = PApplet.sqrt(norm2);
- v0 /= norm;
- v1 /= norm;
- v2 /= norm;
- }
-
- modelview.rotate(angle, v0, v1, v2);
- invRotate(modelviewInv, angle, v0, v1, v2);
- updateProjmodelview(); // Possibly cheaper than doing projmodelview.rotate()
- }
-
-
- static private void invRotate(PMatrix3D matrix, float angle,
- float v0, float v1, float v2) {
- float c = PApplet.cos(-angle);
- float s = PApplet.sin(-angle);
- float t = 1.0f - c;
-
- matrix.preApply((t*v0*v0) + c, (t*v0*v1) - (s*v2), (t*v0*v2) + (s*v1), 0,
- (t*v0*v1) + (s*v2), (t*v1*v1) + c, (t*v1*v2) - (s*v0), 0,
- (t*v0*v2) - (s*v1), (t*v1*v2) + (s*v0), (t*v2*v2) + c, 0,
- 0, 0, 0, 1);
- }
-
-
- /**
- * Same as scale(s, s, s).
- */
- @Override
- public void scale(float s) {
- scaleImpl(s, s, s);
- }
-
-
- /**
- * Same as scale(sx, sy, 1).
- */
- @Override
- public void scale(float sx, float sy) {
- scaleImpl(sx, sy, 1);
- }
-
-
- /**
- * Scale in three dimensions.
- */
- @Override
- public void scale(float sx, float sy, float sz) {
- scaleImpl(sx, sy, sz);
- }
-
- /**
- * Scale in three dimensions.
- */
- protected void scaleImpl(float sx, float sy, float sz) {
- modelview.scale(sx, sy, sz);
- invScale(modelviewInv, sx, sy, sz);
- projmodelview.scale(sx, sy, sz);
- }
-
-
- static protected void invScale(PMatrix3D matrix, float x, float y, float z) {
- matrix.preApply(1/x, 0, 0, 0, 0, 1/y, 0, 0, 0, 0, 1/z, 0, 0, 0, 0, 1);
- }
-
-
- @Override
- public void shearX(float angle) {
- float t = (float) Math.tan(angle);
- applyMatrixImpl(1, t, 0, 0,
- 0, 1, 0, 0,
- 0, 0, 1, 0,
- 0, 0, 0, 1);
- }
-
-
- @Override
- public void shearY(float angle) {
- float t = (float) Math.tan(angle);
- applyMatrixImpl(1, 0, 0, 0,
- t, 1, 0, 0,
- 0, 0, 1, 0,
- 0, 0, 0, 1);
- }
-
-
- //////////////////////////////////////////////////////////////
-
- // MATRIX MORE!
-
-
- @Override
- public void resetMatrix() {
- modelview.reset();
- modelviewInv.reset();
- projmodelview.set(projection);
-
- // For consistency, since modelview = camera * [all other transformations]
- // the camera matrix should be set to the identity as well:
- camera.reset();
- cameraInv.reset();
- }
-
-
- @Override
- public void applyMatrix(PMatrix2D source) {
- applyMatrixImpl(source.m00, source.m01, 0, source.m02,
- source.m10, source.m11, 0, source.m12,
- 0, 0, 1, 0,
- 0, 0, 0, 1);
- }
-
-
- @Override
- public void applyMatrix(float n00, float n01, float n02,
- float n10, float n11, float n12) {
- applyMatrixImpl(n00, n01, 0, n02,
- n10, n11, 0, n12,
- 0, 0, 1, 0,
- 0, 0, 0, 1);
- }
-
-
- @Override
- public void applyMatrix(PMatrix3D source) {
- applyMatrixImpl(source.m00, source.m01, source.m02, source.m03,
- source.m10, source.m11, source.m12, source.m13,
- source.m20, source.m21, source.m22, source.m23,
- source.m30, source.m31, source.m32, source.m33);
- }
-
-
- /**
- * Apply a 4x4 transformation matrix to the modelview stack.
- */
- @Override
- public void applyMatrix(float n00, float n01, float n02, float n03,
- float n10, float n11, float n12, float n13,
- float n20, float n21, float n22, float n23,
- float n30, float n31, float n32, float n33) {
- applyMatrixImpl(n00, n01, n02, n03,
- n10, n11, n12, n13,
- n20, n21, n22, n23,
- n30, n31, n32, n33);
- }
-
-
- protected void applyMatrixImpl(float n00, float n01, float n02, float n03,
- float n10, float n11, float n12, float n13,
- float n20, float n21, float n22, float n23,
- float n30, float n31, float n32, float n33) {
- modelview.apply(n00, n01, n02, n03,
- n10, n11, n12, n13,
- n20, n21, n22, n23,
- n30, n31, n32, n33);
- modelviewInv.set(modelview);
- modelviewInv.invert();
-
- projmodelview.apply(n00, n01, n02, n03,
- n10, n11, n12, n13,
- n20, n21, n22, n23,
- n30, n31, n32, n33);
- }
-
-
- protected void begin2D() {
- }
-
-
- protected void end2D() {
- }
-
-
- //////////////////////////////////////////////////////////////
-
- // MATRIX GET/SET/PRINT
-
-
- @Override
- public PMatrix getMatrix() {
- return modelview.get();
- }
-
-
- // public PMatrix2D getMatrix(PMatrix2D target)
-
-
- @Override
- public PMatrix3D getMatrix(PMatrix3D target) {
- if (target == null) {
- target = new PMatrix3D();
- }
- target.set(modelview);
- return target;
- }
-
-
- // public void setMatrix(PMatrix source)
-
-
- @Override
- public void setMatrix(PMatrix2D source) {
- resetMatrix();
- applyMatrix(source);
- }
-
-
- /**
- * Set the current transformation to the contents of the specified source.
- */
- @Override
- public void setMatrix(PMatrix3D source) {
- resetMatrix();
- applyMatrix(source);
- }
-
-
- /**
- * Print the current model (or "transformation") matrix.
- */
- @Override
- public void printMatrix() {
- modelview.print();
- }
-
-
- //////////////////////////////////////////////////////////////
-
- // PROJECTION
-
-
- public void pushProjection() {
- if (projectionStackDepth == MATRIX_STACK_DEPTH) {
- throw new RuntimeException(ERROR_PUSHMATRIX_OVERFLOW);
- }
- projection.get(projectionStack[projectionStackDepth]);
- projectionStackDepth++;
- }
-
-
- public void popProjection() {
- flush(); // The geometry with the old projection matrix needs to be drawn now
-
- if (projectionStackDepth == 0) {
- throw new RuntimeException(ERROR_PUSHMATRIX_UNDERFLOW);
- }
- projectionStackDepth--;
- projection.set(projectionStack[projectionStackDepth]);
- updateProjmodelview();
- }
-
-
- public void resetProjection() {
- flush();
- projection.reset();
- updateProjmodelview();
- }
-
-
- public void applyProjection(PMatrix3D mat) {
- flush();
- projection.apply(mat);
- updateProjmodelview();
- }
-
-
- public void applyProjection(float n00, float n01, float n02, float n03,
- float n10, float n11, float n12, float n13,
- float n20, float n21, float n22, float n23,
- float n30, float n31, float n32, float n33) {
- flush();
- projection.apply(n00, n01, n02, n03,
- n10, n11, n12, n13,
- n20, n21, n22, n23,
- n30, n31, n32, n33);
- updateProjmodelview();
- }
-
-
- public void setProjection(PMatrix3D mat) {
- flush();
- projection.set(mat);
- updateProjmodelview();
- }
-
-
- // Returns true if the matrix is of the form:
- // x, 0, 0, a,
- // 0, y, 0, b,
- // 0, 0, z, c,
- // 0, 0, 0, 1
- protected boolean orthoProjection() {
- return zero(projection.m01) && zero(projection.m02) &&
- zero(projection.m10) && zero(projection.m12) &&
- zero(projection.m20) && zero(projection.m21) &&
- zero(projection.m30) && zero(projection.m31) &&
- zero(projection.m32) && same(projection.m33, 1);
- }
-
-
- protected boolean nonOrthoProjection() {
- return nonZero(projection.m01) || nonZero(projection.m02) ||
- nonZero(projection.m10) || nonZero(projection.m12) ||
- nonZero(projection.m20) || nonZero(projection.m21) ||
- nonZero(projection.m30) || nonZero(projection.m31) ||
- nonZero(projection.m32) || diff(projection.m33, 1);
- }
-
-
- //////////////////////////////////////////////////////////////
-
- // Some float math utilities
-
-
- protected static boolean same(float a, float b) {
- return Math.abs(a - b) < PGL.FLOAT_EPS;
- }
-
-
- protected static boolean diff(float a, float b) {
- return PGL.FLOAT_EPS <= Math.abs(a - b);
- }
-
-
- protected static boolean zero(float a) {
- return Math.abs(a) < PGL.FLOAT_EPS;
- }
-
-
- protected static boolean nonZero(float a) {
- return PGL.FLOAT_EPS <= Math.abs(a);
- }
-
-
- //////////////////////////////////////////////////////////////
-
- // CAMERA
-
- /**
- * Set matrix mode to the camera matrix (instead of the current transformation
- * matrix). This means applyMatrix, resetMatrix, etc. will affect the camera.
- *
- * Note that the camera matrix is *not* the perspective matrix, it contains
- * the values of the modelview matrix immediatly after the latter was
- * initialized with ortho() or camera(), or the modelview matrix as result of
- * the operations applied between beginCamera()/endCamera().
- *
- * beginCamera() specifies that all coordinate transforms until endCamera()
- * should be pre-applied in inverse to the camera transform matrix. Note that
- * this is only challenging when a user specifies an arbitrary matrix with
- * applyMatrix(). Then that matrix will need to be inverted, which may not be
- * possible. But take heart, if a user is applying a non-invertible matrix to
- * the camera transform, then he is clearly up to no good, and we can wash our
- * hands of those bad intentions.
- *
- * begin/endCamera clauses do not automatically reset the camera transform
- * matrix. That's because we set up a nice default camera transform in
- * setup(), and we expect it to hold through draw(). So we don't reset the
- * camera transform matrix at the top of draw(). That means that an
- * innocuous-looking clause like
- *
- *
- * beginCamera();
- * translate(0, 0, 10);
- * endCamera();
- *
- *
- * at the top of draw(), will result in a runaway camera that shoots
- * infinitely out of the screen over time. In order to prevent this, it is
- * necessary to call some function that does a hard reset of the camera
- * transform matrix inside of begin/endCamera. Two options are
- *
- *
- * camera(); // sets up the nice default camera transform
- * resetMatrix(); // sets up the identity camera transform
- *
- *
- * So to rotate a camera a constant amount, you might try
- *
- *
- * beginCamera();
- * camera();
- * rotateY(PI / 8);
- * endCamera();
- *
- */
- @Override
- public void beginCamera() {
- if (manipulatingCamera) {
- throw new RuntimeException("beginCamera() cannot be called again "
- + "before endCamera()");
- } else {
- manipulatingCamera = true;
- }
- }
-
-
- /**
- * Record the current settings into the camera matrix, and set the matrix mode
- * back to the current transformation matrix.
- *
- * Note that this will destroy any settings to scale(), translate(), or
- * whatever, because the final camera matrix will be copied (not multiplied)
- * into the modelview.
- */
- @Override
- public void endCamera() {
- if (!manipulatingCamera) {
- throw new RuntimeException("Cannot call endCamera() "
- + "without first calling beginCamera()");
- }
-
- camera.set(modelview);
- cameraInv.set(modelviewInv);
-
- // all done
- manipulatingCamera = false;
- }
-
-
- /**
- * Set camera to the default settings.
- *
- * Processing camera behavior:
- *
- * Camera behavior can be split into two separate components, camera
- * transformation, and projection. The transformation corresponds to the
- * physical location, orientation, and scale of the camera. In a physical
- * camera metaphor, this is what can manipulated by handling the camera body
- * (with the exception of scale, which doesn't really have a physcial analog).
- * The projection corresponds to what can be changed by manipulating the lens.
- *
- * We maintain separate matrices to represent the camera transform and
- * projection. An important distinction between the two is that the camera
- * transform should be invertible, where the projection matrix should not,
- * since it serves to map three dimensions to two. It is possible to bake the
- * two matrices into a single one just by multiplying them together, but it
- * isn't a good idea, since lighting, z-ordering, and z-buffering all demand a
- * true camera z coordinate after modelview and camera transforms have been
- * applied but before projection. If the camera transform and projection are
- * combined there is no way to recover a good camera-space z-coordinate from a
- * model coordinate.
- *
- * Fortunately, there are no functions that manipulate both camera
- * transformation and projection.
- *
- * camera() sets the camera position, orientation, and center of the scene. It
- * replaces the camera transform with a new one.
- *
- * The transformation functions are the same ones used to manipulate the
- * modelview matrix (scale, translate, rotate, etc.). But they are bracketed
- * with beginCamera(), endCamera() to indicate that they should apply (in
- * inverse), to the camera transformation matrix.
- */
- @Override
- public void camera() {
- camera(cameraX, cameraY, cameraZ, cameraX, cameraY, 0, 0, 1, 0);
- }
-
-
- /**
- * More flexible method for dealing with camera().
- *
- * The actual call is like gluLookat. Here's the real skinny on what does
- * what:
- *
- *
- * camera(); or
- * camera(ex, ey, ez, cx, cy, cz, ux, uy, uz);
- *
- *
- * do not need to be called from with beginCamera();/endCamera(); That's
- * because they always apply to the camera transformation, and they always
- * totally replace it. That means that any coordinate transforms done before
- * camera(); in draw() will be wiped out. It also means that camera() always
- * operates in untransformed world coordinates. Therefore it is always
- * redundant to call resetMatrix(); before camera(); This isn't technically
- * true of gluLookat, but it's pretty much how it's used.
- *
- * Now, beginCamera(); and endCamera(); are useful if you want to move the
- * camera around using transforms like translate(), etc. They will wipe out
- * any coordinate system transforms that occur before them in draw(), but they
- * will not automatically wipe out the camera transform. This means that they
- * should be at the top of draw(). It also means that the following:
- *
- *
- * beginCamera();
- * rotateY(PI / 8);
- * endCamera();
- *
- *
- * will result in a camera that spins without stopping. If you want to just
- * rotate a small constant amount, try this:
- *
- *
- * beginCamera();
- * camera(); // sets up the default view
- * rotateY(PI / 8);
- * endCamera();
- *
- *
- * That will rotate a little off of the default view. Note that this is
- * entirely equivalent to
- *
- *
- * camera(); // sets up the default view
- * beginCamera();
- * rotateY(PI / 8);
- * endCamera();
- *
- *
- * because camera() doesn't care whether or not it's inside a begin/end
- * clause. Basically it's safe to use camera() or camera(ex, ey, ez, cx, cy,
- * cz, ux, uy, uz) as naked calls because they do all the matrix resetting
- * automatically.
- */
- @Override
- public void camera(float eyeX, float eyeY, float eyeZ,
- float centerX, float centerY, float centerZ,
- float upX, float upY, float upZ) {
- // Calculating Z vector
- float z0 = eyeX - centerX;
- float z1 = eyeY - centerY;
- float z2 = eyeZ - centerZ;
- float mag = PApplet.sqrt(z0 * z0 + z1 * z1 + z2 * z2);
- if (nonZero(mag)) {
- z0 /= mag;
- z1 /= mag;
- z2 /= mag;
- }
- cameraEyeX = eyeX;
- cameraEyeY = eyeY;
- cameraEyeZ = eyeZ;
-
- // Calculating Y vector
- float y0 = upX;
- float y1 = upY;
- float y2 = upZ;
-
- // Computing X vector as Y cross Z
- float x0 = y1 * z2 - y2 * z1;
- float x1 = -y0 * z2 + y2 * z0;
- float x2 = y0 * z1 - y1 * z0;
-
- // Recompute Y = Z cross X
- y0 = z1 * x2 - z2 * x1;
- y1 = -z0 * x2 + z2 * x0;
- y2 = z0 * x1 - z1 * x0;
-
- // Cross product gives area of parallelogram, which is < 1.0 for
- // non-perpendicular unit-length vectors; so normalize x, y here:
- mag = PApplet.sqrt(x0 * x0 + x1 * x1 + x2 * x2);
- if (nonZero(mag)) {
- x0 /= mag;
- x1 /= mag;
- x2 /= mag;
- }
-
- mag = PApplet.sqrt(y0 * y0 + y1 * y1 + y2 * y2);
- if (nonZero(mag)) {
- y0 /= mag;
- y1 /= mag;
- y2 /= mag;
- }
-
- modelview.set(x0, x1, x2, 0,
- y0, y1, y2, 0,
- z0, z1, z2, 0,
- 0, 0, 0, 1);
-
- float tx = -eyeX;
- float ty = -eyeY;
- float tz = -eyeZ;
- modelview.translate(tx, ty, tz);
-
- modelviewInv.set(modelview);
- modelviewInv.invert();
-
- camera.set(modelview);
- cameraInv.set(modelviewInv);
-
- updateProjmodelview();
- }
-
-
- // Sets a camera for 2D rendering, which only involves centering
- public void camera(float centerX, float centerY) {
- modelview.reset();
- modelview.translate(-centerX, -centerY);
-
- modelviewInv.set(modelview);
- modelviewInv.invert();
-
- camera.set(modelview);
- cameraInv.set(modelviewInv);
-
- updateProjmodelview();
- }
-
-
- /**
- * Print the current camera matrix.
- */
- @Override
- public void printCamera() {
- camera.print();
- }
-
-
- protected void defaultCamera() {
- camera();
- }
-
-
- //////////////////////////////////////////////////////////////
-
- // PROJECTION
-
-
- /**
- * Calls ortho() with the proper parameters for Processing's standard
- * orthographic projection.
- */
- @Override
- public void ortho() {
- ortho(0, width, 0, height, cameraNear, cameraFar);
- }
-
-
- /**
- * Calls ortho() with the specified size of the viewing volume along
- * the X and Z directions.
- */
- @Override
- public void ortho(float left, float right,
- float bottom, float top) {
- ortho(left, right, bottom, top, cameraNear, cameraFar);
- }
-
-
- /**
- * Sets an orthographic projection.
- *
- */
- @Override
- public void ortho(float left, float right,
- float bottom, float top,
- float near, float far) {
- left -= width/2;
- right -= width/2;
- bottom -= height/2;
- top -= height/2;
-
- // Flushing geometry with a different perspective configuration.
- flush();
-
- float x = +2.0f / (right - left);
- float y = +2.0f / (top - bottom);
- float z = -2.0f / (far - near);
-
- float tx = -(right + left) / (right - left);
- float ty = -(top + bottom) / (top - bottom);
- float tz = -(far + near) / (far - near);
-
- // The minus sign is needed to invert the Y axis.
- projection.set(x, 0, 0, tx,
- 0, -y, 0, ty,
- 0, 0, z, tz,
- 0, 0, 0, 1);
-
- updateProjmodelview();
- }
-
-
- /**
- * Calls perspective() with Processing's standard coordinate projection.
- *
- * Projection functions:
- *
- * frustrum()
- * ortho()
- * perspective()
- *
- * Each of these three functions completely replaces the projection matrix
- * with a new one. They can be called inside setup(), and their effects will
- * be felt inside draw(). At the top of draw(), the projection matrix is not
- * reset. Therefore the last projection function to be called always
- * dominates. On resize, the default projection is always established, which
- * has perspective.
- *
- * This behavior is pretty much familiar from OpenGL, except where functions
- * replace matrices, rather than multiplying against the previous.
- *
- */
- @Override
- public void perspective() {
- perspective(cameraFOV, cameraAspect, cameraNear, cameraFar);
- }
-
-
- /**
- * Similar to gluPerspective(). Implementation based on Mesa's glu.c
- */
- @Override
- public void perspective(float fov, float aspect, float zNear, float zFar) {
- float ymax = zNear * (float) Math.tan(fov / 2);
- float ymin = -ymax;
- float xmin = ymin * aspect;
- float xmax = ymax * aspect;
- frustum(xmin, xmax, ymin, ymax, zNear, zFar);
- }
-
-
- /**
- * Same as glFrustum(), except that it wipes out (rather than multiplies
- * against) the current perspective matrix.
- *
- * Implementation based on the explanation in the OpenGL blue book.
- */
- @Override
- public void frustum(float left, float right, float bottom, float top,
- float znear, float zfar) {
- // Flushing geometry with a different perspective configuration.
- flush();
-
- float n2 = 2 * znear;
- float w = right - left;
- float h = top - bottom;
- float d = zfar - znear;
-
- projection.set(n2 / w, 0, (right + left) / w, 0,
- 0, -n2 / h, (top + bottom) / h, 0,
- 0, 0, -(zfar + znear) / d, -(n2 * zfar) / d,
- 0, 0, -1, 0);
-
- updateProjmodelview();
- }
-
-
- /**
- * Print the current projection matrix.
- */
- @Override
- public void printProjection() {
- projection.print();
- }
-
-
- protected void defaultPerspective() {
- perspective();
- }
-
-
- //////////////////////////////////////////////////////////////
-
- // SCREEN AND MODEL COORDS
-
-
- @Override
- public float screenX(float x, float y) {
- return screenXImpl(x, y, 0);
- }
-
-
- @Override
- public float screenY(float x, float y) {
- return screenYImpl(x, y, 0);
- }
-
-
- @Override
- public float screenX(float x, float y, float z) {
- return screenXImpl(x, y, z);
- }
-
-
- @Override
- public float screenY(float x, float y, float z) {
- return screenYImpl(x, y, z);
- }
-
-
- @Override
- public float screenZ(float x, float y, float z) {
- return screenZImpl(x, y, z);
- }
-
-
- protected float screenXImpl(float x, float y, float z) {
- float ax =
- modelview.m00*x + modelview.m01*y + modelview.m02*z + modelview.m03;
- float ay =
- modelview.m10*x + modelview.m11*y + modelview.m12*z + modelview.m13;
- float az =
- modelview.m20*x + modelview.m21*y + modelview.m22*z + modelview.m23;
- float aw =
- modelview.m30*x + modelview.m31*y + modelview.m32*z + modelview.m33;
- return screenXImpl(ax, ay, az, aw);
- }
-
-
- protected float screenXImpl(float x, float y, float z, float w) {
- float ox =
- projection.m00*x + projection.m01*y + projection.m02*z + projection.m03*w;
- float ow =
- projection.m30*x + projection.m31*y + projection.m32*z + projection.m33*w;
-
- if (nonZero(ow)) {
- ox /= ow;
- }
- float sx = width * (1 + ox) / 2.0f;
- return sx;
- }
-
-
- protected float screenYImpl(float x, float y, float z) {
- float ax =
- modelview.m00*x + modelview.m01*y + modelview.m02*z + modelview.m03;
- float ay =
- modelview.m10*x + modelview.m11*y + modelview.m12*z + modelview.m13;
- float az =
- modelview.m20*x + modelview.m21*y + modelview.m22*z + modelview.m23;
- float aw =
- modelview.m30*x + modelview.m31*y + modelview.m32*z + modelview.m33;
- return screenYImpl(ax, ay, az, aw);
- }
-
-
- protected float screenYImpl(float x, float y, float z, float w) {
- float oy =
- projection.m10*x + projection.m11*y + projection.m12*z + projection.m13*w;
- float ow =
- projection.m30*x + projection.m31*y + projection.m32*z + projection.m33*w;
-
- if (nonZero(ow)) {
- oy /= ow;
- }
- float sy = height * (1 + oy) / 2.0f;
- // Turning value upside down because of Processing's inverted Y axis.
- sy = height - sy;
- return sy;
- }
-
-
- protected float screenZImpl(float x, float y, float z) {
- float ax =
- modelview.m00*x + modelview.m01*y + modelview.m02*z + modelview.m03;
- float ay =
- modelview.m10*x + modelview.m11*y + modelview.m12*z + modelview.m13;
- float az =
- modelview.m20*x + modelview.m21*y + modelview.m22*z + modelview.m23;
- float aw =
- modelview.m30*x + modelview.m31*y + modelview.m32*z + modelview.m33;
- return screenZImpl(ax, ay, az, aw);
- }
-
-
- protected float screenZImpl(float x, float y, float z, float w) {
- float oz =
- projection.m20*x + projection.m21*y + projection.m22*z + projection.m23*w;
- float ow =
- projection.m30*x + projection.m31*y + projection.m32*z + projection.m33*w;
-
- if (nonZero(ow)) {
- oz /= ow;
- }
- float sz = (oz + 1) / 2.0f;
- return sz;
- }
-
-
- @Override
- public float modelX(float x, float y, float z) {
- float ax =
- modelview.m00*x + modelview.m01*y + modelview.m02*z + modelview.m03;
- float ay =
- modelview.m10*x + modelview.m11*y + modelview.m12*z + modelview.m13;
- float az =
- modelview.m20*x + modelview.m21*y + modelview.m22*z + modelview.m23;
- float aw =
- modelview.m30*x + modelview.m31*y + modelview.m32*z + modelview.m33;
-
- float ox =
- cameraInv.m00*ax + cameraInv.m01*ay + cameraInv.m02*az + cameraInv.m03*aw;
- float ow =
- cameraInv.m30*ax + cameraInv.m31*ay + cameraInv.m32*az + cameraInv.m33*aw;
-
- return nonZero(ow) ? ox / ow : ox;
- }
-
-
- @Override
- public float modelY(float x, float y, float z) {
- float ax =
- modelview.m00*x + modelview.m01*y + modelview.m02*z + modelview.m03;
- float ay =
- modelview.m10*x + modelview.m11*y + modelview.m12*z + modelview.m13;
- float az =
- modelview.m20*x + modelview.m21*y + modelview.m22*z + modelview.m23;
- float aw =
- modelview.m30*x + modelview.m31*y + modelview.m32*z + modelview.m33;
-
- float oy =
- cameraInv.m10*ax + cameraInv.m11*ay + cameraInv.m12*az + cameraInv.m13*aw;
- float ow =
- cameraInv.m30*ax + cameraInv.m31*ay + cameraInv.m32*az + cameraInv.m33*aw;
-
- return nonZero(ow) ? oy / ow : oy;
- }
-
-
- @Override
- public float modelZ(float x, float y, float z) {
- float ax =
- modelview.m00*x + modelview.m01*y + modelview.m02*z + modelview.m03;
- float ay =
- modelview.m10*x + modelview.m11*y + modelview.m12*z + modelview.m13;
- float az =
- modelview.m20*x + modelview.m21*y + modelview.m22*z + modelview.m23;
- float aw =
- modelview.m30*x + modelview.m31*y + modelview.m32*z + modelview.m33;
-
- float oz =
- cameraInv.m20*ax + cameraInv.m21*ay + cameraInv.m22*az + cameraInv.m23*aw;
- float ow =
- cameraInv.m30*ax + cameraInv.m31*ay + cameraInv.m32*az + cameraInv.m33*aw;
-
- return nonZero(ow) ? oz / ow : oz;
- }
-
- // STYLES
-
- // public void pushStyle()
- // public void popStyle()
- // public void style(PStyle)
- // public PStyle getStyle()
- // public void getStyle(PStyle)
-
- //////////////////////////////////////////////////////////////
-
- // COLOR MODE
-
- // public void colorMode(int mode)
- // public void colorMode(int mode, float max)
- // public void colorMode(int mode, float mx, float my, float mz);
- // public void colorMode(int mode, float mx, float my, float mz, float ma);
-
- //////////////////////////////////////////////////////////////
-
- // COLOR CALC
-
- // protected void colorCalc(int rgb)
- // protected void colorCalc(int rgb, float alpha)
- // protected void colorCalc(float gray)
- // protected void colorCalc(float gray, float alpha)
- // protected void colorCalc(float x, float y, float z)
- // protected void colorCalc(float x, float y, float z, float a)
- // protected void colorCalcARGB(int argb, float alpha)
-
- //////////////////////////////////////////////////////////////
-
- // STROKE CAP/JOIN/WEIGHT
-
-
- @Override
- public void strokeWeight(float weight) {
- this.strokeWeight = weight;
- }
-
-
- @Override
- public void strokeJoin(int join) {
- this.strokeJoin = join;
- }
-
-
- @Override
- public void strokeCap(int cap) {
- this.strokeCap = cap;
- }
-
-
- //////////////////////////////////////////////////////////////
-
- // FILL COLOR
-
-
- @Override
- protected void fillFromCalc() {
- super.fillFromCalc();
-
- if (!setAmbient) {
- // Setting the ambient color from the current fill
- // is what the old P3D did and allows to have an
- // default ambient color when the user doesn't specify
- // it explicitly.
- ambientFromCalc();
- // ambientFromCalc sets setAmbient to true, but it hasn't been
- // set by the user so put back to false.
- setAmbient = false;
- }
- }
-
-
- //////////////////////////////////////////////////////////////
-
- // LIGHTING
-
- /**
- * Sets up an ambient and directional light using OpenGL. API taken from
- * PGraphics3D.
- *
- *
- * The Lighting Skinny:
- * The way lighting works is complicated enough that it's worth
- * producing a document to describe it. Lighting calculations proceed
- * pretty much exactly as described in the OpenGL red book.
- * Light-affecting material properties:
- * AMBIENT COLOR
- * - multiplies by light's ambient component
- * - for believability this should match diffuse color
- * DIFFUSE COLOR
- * - multiplies by light's diffuse component
- * SPECULAR COLOR
- * - multiplies by light's specular component
- * - usually less colored than diffuse/ambient
- * SHININESS
- * - the concentration of specular effect
- * - this should be set pretty high (20-50) to see really
- * noticeable specularity
- * EMISSIVE COLOR
- * - constant additive color effect
- * Light types:
- * AMBIENT
- * - one color
- * - no specular color
- * - no direction
- * - may have falloff (constant, linear, and quadratic)
- * - may have position (which matters in non-constant falloff case)
- * - multiplies by a material's ambient reflection
- * DIRECTIONAL
- * - has diffuse color
- * - has specular color
- * - has direction
- * - no position
- * - no falloff
- * - multiplies by a material's diffuse and specular reflections
- * POINT
- * - has diffuse color
- * - has specular color
- * - has position
- * - no direction
- * - may have falloff (constant, linear, and quadratic)
- * - multiplies by a material's diffuse and specular reflections
- * SPOT
- * - has diffuse color
- * - has specular color
- * - has position
- * - has direction
- * - has cone angle (set to half the total cone angle)
- * - has concentration value
- * - may have falloff (constant, linear, and quadratic)
- * - multiplies by a material's diffuse and specular reflections
- * Normal modes:
- * All of the primitives (rect, box, sphere, etc.) have their normals
- * set nicely. During beginShape/endShape normals can be set by the user.
- * AUTO-NORMAL
- * - if no normal is set during the shape, we are in auto-normal mode
- * - auto-normal calculates one normal per triangle (face-normal mode)
- * SHAPE-NORMAL
- * - if one normal is set during the shape, it will be used for
- * all vertices
- * VERTEX-NORMAL
- * - if multiple normals are set, each normal applies to
- * subsequent vertices
- * - (except for the first one, which applies to previous
- * and subsequent vertices)
- * Efficiency consequences:
- * There is a major efficiency consequence of position-dependent
- * lighting calculations per vertex. (See below for determining
- * whether lighting is vertex position-dependent.) If there is no
- * position dependency then the only factors that affect the lighting
- * contribution per vertex are its colors and its normal.
- * There is a major efficiency win if
- * 1) lighting is not position dependent
- * 2) we are in AUTO-NORMAL or SHAPE-NORMAL mode
- * because then we can calculate one lighting contribution per shape
- * (SHAPE-NORMAL) or per triangle (AUTO-NORMAL) and simply multiply it
- * into the vertex colors. The converse is our worst-case performance when
- * 1) lighting is position dependent
- * 2) we are in AUTO-NORMAL mode
- * because then we must calculate lighting per-face * per-vertex.
- * Each vertex has a different lighting contribution per face in
- * which it appears. Yuck.
- * Determining vertex position dependency:
- * If any of the following factors are TRUE then lighting is
- * vertex position dependent:
- * 1) Any lights uses non-constant falloff
- * 2) There are any point or spot lights
- * 3) There is a light with specular color AND there is a
- * material with specular color
- * So worth noting is that default lighting (a no-falloff ambient
- * and a directional without specularity) is not position-dependent.
- * We should capitalize.
- * Simon Greenwold, April 2005
- *
- */
- @Override
- public void lights() {
- enableLighting();
-
- // need to make sure colorMode is RGB 255 here
- int colorModeSaved = colorMode;
- colorMode = RGB;
-
- lightFalloff(1, 0, 0);
- lightSpecular(0, 0, 0);
-
- ambientLight(colorModeX * 0.5f, colorModeY * 0.5f, colorModeZ * 0.5f);
- directionalLight(colorModeX * 0.5f, colorModeY * 0.5f, colorModeZ * 0.5f,
- 0, 0, -1);
-
- colorMode = colorModeSaved;
- }
-
-
- /**
- * Disables lighting.
- */
- @Override
- public void noLights() {
- disableLighting();
- lightCount = 0;
- }
-
-
- /**
- * Add an ambient light based on the current color mode.
- */
- @Override
- public void ambientLight(float r, float g, float b) {
- ambientLight(r, g, b, 0, 0, 0);
- }
-
-
- /**
- * Add an ambient light based on the current color mode. This version includes
- * an (x, y, z) position for situations where the falloff distance is used.
- */
- @Override
- public void ambientLight(float r, float g, float b,
- float x, float y, float z) {
- enableLighting();
- if (lightCount == PGL.MAX_LIGHTS) {
- throw new RuntimeException("can only create " + PGL.MAX_LIGHTS +
- " lights");
- }
-
- lightType[lightCount] = AMBIENT;
-
- lightPosition(lightCount, x, y, z, false);
- lightNormal(lightCount, 0, 0, 0);
-
- lightAmbient(lightCount, r, g, b);
- noLightDiffuse(lightCount);
- noLightSpecular(lightCount);
- noLightSpot(lightCount);
- lightFalloff(lightCount, currentLightFalloffConstant,
- currentLightFalloffLinear,
- currentLightFalloffQuadratic);
-
- lightCount++;
- }
-
-
- @Override
- public void directionalLight(float r, float g, float b,
- float dx, float dy, float dz) {
- enableLighting();
- if (lightCount == PGL.MAX_LIGHTS) {
- throw new RuntimeException("can only create " + PGL.MAX_LIGHTS +
- " lights");
- }
-
- lightType[lightCount] = DIRECTIONAL;
-
- lightPosition(lightCount, 0, 0, 0, true);
- lightNormal(lightCount, dx, dy, dz);
-
- noLightAmbient(lightCount);
- lightDiffuse(lightCount, r, g, b);
- lightSpecular(lightCount, currentLightSpecular[0],
- currentLightSpecular[1],
- currentLightSpecular[2]);
- noLightSpot(lightCount);
- noLightFalloff(lightCount);
-
- lightCount++;
- }
-
-
- @Override
- public void pointLight(float r, float g, float b,
- float x, float y, float z) {
- enableLighting();
- if (lightCount == PGL.MAX_LIGHTS) {
- throw new RuntimeException("can only create " + PGL.MAX_LIGHTS +
- " lights");
- }
-
- lightType[lightCount] = POINT;
-
- lightPosition(lightCount, x, y, z, false);
- lightNormal(lightCount, 0, 0, 0);
-
- noLightAmbient(lightCount);
- lightDiffuse(lightCount, r, g, b);
- lightSpecular(lightCount, currentLightSpecular[0],
- currentLightSpecular[1],
- currentLightSpecular[2]);
- noLightSpot(lightCount);
- lightFalloff(lightCount, currentLightFalloffConstant,
- currentLightFalloffLinear,
- currentLightFalloffQuadratic);
-
- lightCount++;
- }
-
-
- @Override
- public void spotLight(float r, float g, float b,
- float x, float y, float z,
- float dx, float dy, float dz,
- float angle, float concentration) {
- enableLighting();
- if (lightCount == PGL.MAX_LIGHTS) {
- throw new RuntimeException("can only create " + PGL.MAX_LIGHTS +
- " lights");
- }
-
- lightType[lightCount] = SPOT;
-
- lightPosition(lightCount, x, y, z, false);
- lightNormal(lightCount, dx, dy, dz);
-
- noLightAmbient(lightCount);
- lightDiffuse(lightCount, r, g, b);
- lightSpecular(lightCount, currentLightSpecular[0],
- currentLightSpecular[1],
- currentLightSpecular[2]);
- lightSpot(lightCount, angle, concentration);
- lightFalloff(lightCount, currentLightFalloffConstant,
- currentLightFalloffLinear,
- currentLightFalloffQuadratic);
-
- lightCount++;
- }
-
-
- /**
- * Set the light falloff rates for the last light that was created. Default is
- * lightFalloff(1, 0, 0).
- */
- @Override
- public void lightFalloff(float constant, float linear, float quadratic) {
- currentLightFalloffConstant = constant;
- currentLightFalloffLinear = linear;
- currentLightFalloffQuadratic = quadratic;
- }
-
-
- /**
- * Set the specular color of the last light created.
- */
- @Override
- public void lightSpecular(float x, float y, float z) {
- colorCalc(x, y, z);
- currentLightSpecular[0] = calcR;
- currentLightSpecular[1] = calcG;
- currentLightSpecular[2] = calcB;
- }
-
-
- protected void enableLighting() {
- if (!lights) {
- flush(); // Flushing non-lit geometry.
- lights = true;
- }
- }
-
-
- protected void disableLighting() {
- if (lights) {
- flush(); // Flushing lit geometry.
- lights = false;
- }
- }
-
-
- protected void lightPosition(int num, float x, float y, float z,
- boolean dir) {
- lightPosition[4 * num + 0] =
- x*modelview.m00 + y*modelview.m01 + z*modelview.m02 + modelview.m03;
- lightPosition[4 * num + 1] =
- x*modelview.m10 + y*modelview.m11 + z*modelview.m12 + modelview.m13;
- lightPosition[4 * num + 2] =
- x*modelview.m20 + y*modelview.m21 + z*modelview.m22 + modelview.m23;
-
- // Used to inicate if the light is directional or not.
- lightPosition[4 * num + 3] = dir ? 1: 0;
- }
-
-
- protected void lightNormal(int num, float dx, float dy, float dz) {
- // Applying normal matrix to the light direction vector, which is the
- // transpose of the inverse of the modelview.
- float nx =
- dx*modelviewInv.m00 + dy*modelviewInv.m10 + dz*modelviewInv.m20;
- float ny =
- dx*modelviewInv.m01 + dy*modelviewInv.m11 + dz*modelviewInv.m21;
- float nz =
- dx*modelviewInv.m02 + dy*modelviewInv.m12 + dz*modelviewInv.m22;
-
- float invn = 1.0f / PApplet.dist(0, 0, 0, nx, ny, nz);
- lightNormal[3 * num + 0] = invn * nx;
- lightNormal[3 * num + 1] = invn * ny;
- lightNormal[3 * num + 2] = invn * nz;
- }
-
-
- protected void lightAmbient(int num, float r, float g, float b) {
- colorCalc(r, g, b);
- lightAmbient[3 * num + 0] = calcR;
- lightAmbient[3 * num + 1] = calcG;
- lightAmbient[3 * num + 2] = calcB;
- }
-
-
- protected void noLightAmbient(int num) {
- lightAmbient[3 * num + 0] = 0;
- lightAmbient[3 * num + 1] = 0;
- lightAmbient[3 * num + 2] = 0;
- }
-
-
- protected void lightDiffuse(int num, float r, float g, float b) {
- colorCalc(r, g, b);
- lightDiffuse[3 * num + 0] = calcR;
- lightDiffuse[3 * num + 1] = calcG;
- lightDiffuse[3 * num + 2] = calcB;
- }
-
-
- protected void noLightDiffuse(int num) {
- lightDiffuse[3 * num + 0] = 0;
- lightDiffuse[3 * num + 1] = 0;
- lightDiffuse[3 * num + 2] = 0;
- }
-
-
- protected void lightSpecular(int num, float r, float g, float b) {
- lightSpecular[3 * num + 0] = r;
- lightSpecular[3 * num + 1] = g;
- lightSpecular[3 * num + 2] = b;
- }
-
-
- protected void noLightSpecular(int num) {
- lightSpecular[3 * num + 0] = 0;
- lightSpecular[3 * num + 1] = 0;
- lightSpecular[3 * num + 2] = 0;
- }
-
-
- protected void lightFalloff(int num, float c0, float c1, float c2) {
- lightFalloffCoefficients[3 * num + 0] = c0;
- lightFalloffCoefficients[3 * num + 1] = c1;
- lightFalloffCoefficients[3 * num + 2] = c2;
- }
-
-
- protected void noLightFalloff(int num) {
- lightFalloffCoefficients[3 * num + 0] = 1;
- lightFalloffCoefficients[3 * num + 1] = 0;
- lightFalloffCoefficients[3 * num + 2] = 0;
- }
-
-
- protected void lightSpot(int num, float angle, float exponent) {
- lightSpotParameters[2 * num + 0] = Math.max(0, PApplet.cos(angle));
- lightSpotParameters[2 * num + 1] = exponent;
- }
-
-
- protected void noLightSpot(int num) {
- lightSpotParameters[2 * num + 0] = 0;
- lightSpotParameters[2 * num + 1] = 0;
- }
-
-
- //////////////////////////////////////////////////////////////
-
- // BACKGROUND
-
-
- @Override
- protected void backgroundImpl(PImage image) {
- backgroundImpl();
- set(0, 0, image);
- if (0 < parent.frameCount) {
- clearColorBuffer = true;
- }
- }
-
-
- @Override
- protected void backgroundImpl() {
- flush();
-
- pgl.depthMask(true);
- pgl.clearDepth(1);
- pgl.clear(PGL.DEPTH_BUFFER_BIT);
- if (hints[DISABLE_DEPTH_MASK]) {
- pgl.depthMask(false);
- } else {
- pgl.depthMask(true);
- }
-
- pgl.clearColor(backgroundR, backgroundG, backgroundB, backgroundA);
- pgl.clear(PGL.COLOR_BUFFER_BIT);
- if (0 < parent.frameCount) {
- clearColorBuffer = true;
- }
- }
-
-
- //////////////////////////////////////////////////////////////
-
- // COLOR MODE
-
- // colorMode() is inherited from PGraphics.
-
-
- //////////////////////////////////////////////////////////////
-
- // COLOR METHODS
-
- // public final int color(int gray)
- // public final int color(int gray, int alpha)
- // public final int color(int rgb, float alpha)
- // public final int color(int x, int y, int z)
-
- // public final float alpha(int what)
- // public final float red(int what)
- // public final float green(int what)
- // public final float blue(int what)
- // public final float hue(int what)
- // public final float saturation(int what)
- // public final float brightness(int what)
-
- // public int lerpColor(int c1, int c2, float amt)
- // static public int lerpColor(int c1, int c2, float amt, int mode)
-
- //////////////////////////////////////////////////////////////
-
- // BEGINRAW/ENDRAW
-
- // beginRaw, endRaw() both inherited.
-
- //////////////////////////////////////////////////////////////
-
- // WARNINGS and EXCEPTIONS
-
- // showWarning() and showException() available from PGraphics.
-
- /**
- * Report on anything from glError().
- * Don't use this inside glBegin/glEnd otherwise it'll
- * throw an GL_INVALID_OPERATION error.
- */
- public void report(String where) {
- if (!hints[DISABLE_OPENGL_ERRORS]) {
- int err = pgl.getError();
- if (err != 0) {
- String errString = pgl.errorString(err);
- String msg = "OpenGL error " + err + " at " + where + ": " + errString;
- PGraphics.showWarning(msg);
- }
- }
- }
-
-
-
- //////////////////////////////////////////////////////////////
-
- // RENDERER SUPPORT QUERIES
-
- // public boolean displayable()
-
-
- @Override
- public boolean isGL() {
- return true;
- }
-
-
-
- //////////////////////////////////////////////////////////////
-
- // PIMAGE METHODS
-
- // getImage
- // setCache, getCache, removeCache
- // isModified, setModified
-
-
- //////////////////////////////////////////////////////////////
-
- // LOAD/UPDATE PIXELS
-
-
- // Initializes the pixels array, copying the current contents of the
- // color buffer into it.
- @Override
- public void loadPixels() {
- if (primarySurface && sized) {
- // Something wrong going on with threading, sized can never be true if
- // all the steps in a resize happen inside the Animation thread.
- return;
- }
-
- boolean needEndDraw = false;
- if (!drawing) {
- beginDraw();
- needEndDraw = true;
- }
-
- if (!setgetPixels) {
- // Draws any remaining geometry in case the user is still not
- // setting/getting new pixels.
- flush();
- }
-
- allocatePixels();
-
- if (!setgetPixels) {
- readPixels();
- }
-
- if (needEndDraw) {
- endDraw();
- }
- }
-
-
- protected void allocatePixels() {
- if ((pixels == null) || (pixels.length != width * height)) {
- pixels = new int[width * height];
- pixelBuffer = PGL.allocateIntBuffer(pixels);
- }
- }
-
-
- protected void saveSurfaceToPixels() {
- allocatePixels();
- readPixels();
- }
-
-
- protected void restoreSurfaceFromPixels() {
- drawPixels(0, 0, width, height);
- }
-
-
- protected void readPixels() {
- beginPixelsOp(OP_READ);
- try {
- // The readPixels() call in inside a try/catch block because it appears
- // that (only sometimes) JOGL will run beginDraw/endDraw on the EDT
- // thread instead of the Animation thread right after a resize. Because
- // of this the width and height might have a different size than the
- // one of the pixels arrays.
- pgl.readPixels(0, 0, width, height, PGL.RGBA, PGL.UNSIGNED_BYTE,
- pixelBuffer);
- } catch (IndexOutOfBoundsException e) {
- // Silently catch the exception.
- }
- endPixelsOp();
- try {
- // Idem...
- PGL.getIntArray(pixelBuffer, pixels);
- PGL.nativeToJavaARGB(pixels, width, height);
- } catch (ArrayIndexOutOfBoundsException e) {
- }
- }
-
-
- protected void drawPixels(int x, int y, int w, int h) {
- int len = w * h;
- if (nativePixels == null || nativePixels.length < len) {
- nativePixels = new int[len];
- nativePixelBuffer = PGL.allocateIntBuffer(nativePixels);
- }
-
- try {
- if (0 < x || 0 < y || w < width || h < height) {
- // The pixels to copy to the texture need to be consecutive, and they
- // are not in the pixels array, so putting each row one after another
- // in nativePixels.
- int offset0 = y * width + x;
- int offset1 = 0;
-
- for (int yc = y; yc < y + h; yc++) {
- System.arraycopy(pixels, offset0, nativePixels, offset1, w);
- offset0 += width;
- offset1 += w;
- }
- } else {
- PApplet.arrayCopy(pixels, 0, nativePixels, 0, len);
- }
- PGL.javaToNativeARGB(nativePixels, w, h);
- } catch (ArrayIndexOutOfBoundsException e) {
- }
- PGL.putIntArray(nativePixelBuffer, nativePixels);
- // Copying pixel buffer to screen texture...
- if (primarySurface && !pgl.isFBOBacked()) {
- // First making sure that the screen texture is valid. Only in the case
- // of non-FBO-backed primary surface we might need to create the texture.
- loadTextureImpl(POINT, false);
- }
-
- boolean needToDrawTex = primarySurface && (!pgl.isFBOBacked() ||
- (pgl.isFBOBacked() && pgl.isMultisampled())) ||
- offscreenMultisample;
- if (needToDrawTex) {
- // The texture to screen needs to be drawn only if we are on the primary
- // surface w/out FBO-layer, or with FBO-layer and multisampling. Or, we
- // are doing multisampled offscreen. Why? Because in the case of
- // non-multisampled FBO, texture is actually the color buffer used by the
- // color FBO, so with the copy operation we should be done updating the
- // (off)screen buffer.
-
- // First, copy the pixels to the texture. We don't need to invert the
- // pixel copy because the texture will be drawn inverted.
-
- pgl.copyToTexture(texture.glTarget, texture.glFormat, texture.glName,
- x, y, w, h, nativePixelBuffer);
- beginPixelsOp(OP_WRITE);
- drawTexture(x, y, w, h);
- endPixelsOp();
- } else {
- // We only need to copy the pixels to the back texture where we are
- // currently drawing to. Because the texture is invertex along Y, we
- // need to reflect that in the vertical arguments.
- pgl.copyToTexture(texture.glTarget, texture.glFormat, texture.glName,
- x, height - (y + h), w, h, nativePixelBuffer);
- }
- }
-
-
- //////////////////////////////////////////////////////////////
-
- // GET/SET PIXELS
-
-
- @Override
- public int get(int x, int y) {
- loadPixels();
- setgetPixels = true;
- return super.get(x, y);
- }
-
-
- @Override
- protected void getImpl(int sourceX, int sourceY,
- int sourceWidth, int sourceHeight,
- PImage target, int targetX, int targetY) {
- loadPixels();
- setgetPixels = true;
- super.getImpl(sourceX, sourceY, sourceWidth, sourceHeight,
- target, targetX, targetY);
- }
-
-
- @Override
- public void set(int x, int y, int argb) {
- loadPixels();
- setgetPixels = true;
- super.set(x, y, argb);
- }
-
-
- @Override
- protected void setImpl(PImage sourceImage,
- int sourceX, int sourceY,
- int sourceWidth, int sourceHeight,
- int targetX, int targetY) {
- loadPixels();
- setgetPixels = true;
- super.setImpl(sourceImage, sourceX, sourceY, sourceWidth, sourceHeight,
- targetX, targetY);
- }
-
-
- //////////////////////////////////////////////////////////////
-
- // LOAD/UPDATE TEXTURE
-
-
- // Copies the contents of the color buffer into the pixels
- // array, and then the pixels array into the screen texture.
- public void loadTexture() {
- boolean needEndDraw = false;
- if (!drawing) {
- beginDraw();
- needEndDraw = true;
- }
-
- flush(); // To make sure the color buffer is updated.
-
- if (primarySurface) {
- if (pgl.isFBOBacked()) {
- // In the case of MSAA, this is needed so the back buffer is in sync
- // with the rendering.
- pgl.syncBackTexture();
- } else {
- loadTextureImpl(Texture.POINT, false);
-
- // Here we go the slow route: we first copy the contents of the color
- // buffer into a pixels array (but we keep it in native format) and
- // then copy this array into the texture.
- if (nativePixels == null || nativePixels.length < width * height) {
- nativePixels = new int[width * height];
- nativePixelBuffer = PGL.allocateIntBuffer(nativePixels);
- }
-
- beginPixelsOp(OP_READ);
- try {
- // Se comments in readPixels() for the reason for this try/catch.
- pgl.readPixels(0, 0, width, height, PGL.RGBA, PGL.UNSIGNED_BYTE,
- nativePixelBuffer);
- } catch (IndexOutOfBoundsException e) {
- }
- endPixelsOp();
-
- texture.setNative(nativePixelBuffer, 0, 0, width, height);
- }
- } else {
- // We need to copy the contents of the multisampled buffer to the
- // color buffer, so the later is up-to-date with the last drawing.
- if (offscreenMultisample) {
- multisampleFramebuffer.copy(offscreenFramebuffer, currentFramebuffer);
- }
- }
-
- if (needEndDraw) {
- endDraw();
- }
- }
-
-
- // Just marks the whole texture as updated
- public void updateTexture() {
- texture.updateTexels();
- }
-
-
- // Marks the specified rectanglular subregion in the texture as
- // updated.
- public void updateTexture(int x, int y, int w, int h) {
- texture.updateTexels(x, y, w, h);
- }
-
-
- // Draws wherever it is in the screen texture right now to the display.
- public void updateDisplay() {
- flush();
- beginPixelsOp(OP_WRITE);
- drawTexture();
- endPixelsOp();
- }
-
-
- public void drawTexture(int target, int id, int width, int height,
- int X0, int Y0, int X1, int Y1) {
- beginPGL();
- pgl.drawTexture(target, id, width, height, X0, Y0, X1, Y1);
- endPGL();
- }
-
-
- public void drawTexture(int target, int id, int width, int height,
- int texX0, int texY0, int texX1, int texY1,
- int scrX0, int scrY0, int scrX1, int scrY1) {
- beginPGL();
- pgl.drawTexture(target, id, width, height,
- texX0, texY0, texX1, texY1,
- scrX0, scrY0, scrX1, scrY1);
- endPGL();
- }
-
-
- protected void loadTextureImpl(int sampling, boolean mipmap) {
- if (width == 0 || height == 0) return;
- if (texture == null || texture.contextIsOutdated()) {
- Texture.Parameters params = new Texture.Parameters(ARGB,
- sampling, mipmap);
- texture = new Texture(parent, width, height, params);
- texture.invertedY(true);
- texture.colorBufferOf(this);
- pgPrimary.setCache(this, texture);
-
- if (!primarySurface) {
- ptexture = new Texture(parent, width, height, params);
- ptexture.invertedY(true);
- ptexture.colorBufferOf(this);
- }
- }
- }
-
-
- protected void swapTextures() {
- int temp = texture.glName;
- texture.glName = ptexture.glName;
- ptexture.glName = temp;
- if (!primarySurface) {
- offscreenFramebuffer.setColorBuffer(texture);
- }
- }
-
-
- protected void drawTexture() {
- // No blend so the texure replaces wherever is on the screen,
- // irrespective of the alpha
- pgl.disable(PGL.BLEND);
- pgl.drawTexture(texture.glTarget, texture.glName,
- texture.glWidth, texture.glHeight,
- 0, 0, width, height);
- pgl.enable(PGL.BLEND);
- }
-
-
- protected void drawTexture(int x, int y, int w, int h) {
- // Processing Y axis is inverted with respect to OpenGL, so we need to
- // invert the y coordinates of the screen rectangle.
- pgl.disable(PGL.BLEND);
- pgl.drawTexture(texture.glTarget, texture.glName,
- texture.glWidth, texture.glHeight,
- x, y, x + w, y + h,
- x, height - (y + h), x + w, height - y);
- pgl.enable(PGL.BLEND);
- }
-
-
- //////////////////////////////////////////////////////////////
-
- // MASK
-
-
-// @Override
-// public void mask(int alpha[]) {
-// PImage temp = get();
-// temp.mask(alpha);
-// set(0, 0, temp);
-// }
-
-
- @Override
- public void mask(PImage alpha) {
- if (alpha.width != width || alpha.height != height) {
- throw new RuntimeException("The PImage used with mask() must be " +
- "the same size as the applet.");
- }
-
- if (maskShader == null) {
- maskShader = new TexureShader(parent, defTextureShaderVertURL,
- maskShaderFragURL);
- }
- maskShader.set("mask", alpha);
- filter(maskShader);
- }
-
-
-
- //////////////////////////////////////////////////////////////
-
- // FILTER
-
-
- /**
- * This is really inefficient and not a good idea in OpenGL. Use get() and
- * set() with a smaller image area, or call the filter on an image instead,
- * and then draw that.
- */
- @Override
- public void filter(int kind) {
- PImage temp = get();
- temp.filter(kind);
- set(0, 0, temp);
- }
-
-
- /**
- * This is really inefficient and not a good idea in OpenGL. Use get() and
- * set() with a smaller image area, or call the filter on an image instead,
- * and then draw that.
- */
- @Override
- public void filter(int kind, float param) {
- PImage temp = get();
- temp.filter(kind, param);
- set(0, 0, temp);
- }
-
-
- @Override
- public void filter(PShader shader) {
- if (!(shader instanceof TexureShader)) {
- PGraphics.showWarning(INVALID_FILTER_SHADER_ERROR);
- return;
- }
-
- pgl.needFBOLayer();
- loadTexture();
- if (filterTexture == null || filterTexture.contextIsOutdated()) {
- filterTexture = new Texture(parent, texture.width, texture.height,
- texture.getParameters());
- filterTexture.invertedY(true);
- filterImage = wrapTexture(filterTexture);
- }
- filterTexture.set(texture);
-
- // Disable writing to the depth buffer, so that after applying the filter we
- // can still use the depth information to keep adding geometry to the scene.
- pgl.depthMask(false);
- // Also disabling depth testing so the texture is drawn on top of everything
- // that has been drawn before.
- pgl.disable(PGL.DEPTH_TEST);
-
- // Drawing a textured quad in 2D, covering the entire screen,
- // with the filter shader applied to it:
- begin2D();
-
- // Changing light configuration and shader after begin2D()
- // because it calls flush().
- boolean prevLights = lights;
- lights = false;
- int prevTextureMode = textureMode;
- textureMode = NORMAL;
- boolean prevStroke = stroke;
- stroke = false;
-// int prevBlendMode = blendMode;
-// blendMode(REPLACE);
- TexureShader prevTexShader = textureShader;
- textureShader = (TexureShader) shader;
- beginShape(QUADS);
- texture(filterImage);
- vertex(0, 0, 0, 0);
- vertex(width, 0, 1, 0);
- vertex(width, height, 1, 1);
- vertex(0, height, 0, 1);
- endShape();
- end2D();
-
- textureShader = prevTexShader;
-
- // Restoring previous configuration.
- stroke = prevStroke;
- lights = prevLights;
- textureMode = prevTextureMode;
-// blendMode(prevBlendMode);
-
- if (!hints[DISABLE_DEPTH_TEST]) {
- pgl.enable(PGL.DEPTH_TEST);
- }
- if (!hints[DISABLE_DEPTH_MASK]) {
- pgl.depthMask(true);
- }
- }
-
-
- //////////////////////////////////////////////////////////////
-
- /**
- * Extremely slow and not optimized, should use GL methods instead. Currently
- * calls a beginPixels() on the whole canvas, then does the copy, then it
- * calls endPixels().
- */
- // public void copy(int sx1, int sy1, int sx2, int sy2,
- // int dx1, int dy1, int dx2, int dy2)
-
- // public void copy(PImage src,
- // int sx1, int sy1, int sx2, int sy2,
- // int dx1, int dy1, int dx2, int dy2)
-
-
- //////////////////////////////////////////////////////////////
-
- // BLEND
-
- // static public int blendColor(int c1, int c2, int mode)
-
- // public void blend(PImage src,
- // int sx, int sy, int dx, int dy, int mode) {
- // set(dx, dy, PImage.blendColor(src.get(sx, sy), get(dx, dy), mode));
- // }
-
-
- /**
- * Extremely slow and not optimized, should use GL methods instead. Currently
- * calls a beginPixels() on the whole canvas, then does the copy, then it
- * calls endPixels(). Please help fix: Bug 941 , Bug 942 .
- */
- // public void blend(int sx1, int sy1, int sx2, int sy2,
- // int dx1, int dy1, int dx2, int dy2, int mode) {
- // loadPixels();
- // super.blend(sx1, sy1, sx2, sy2, dx1, dy1, dx2, dy2, mode);
- // updatePixels();
- // }
-
- // public void blend(PImage src,
- // int sx1, int sy1, int sx2, int sy2,
- // int dx1, int dy1, int dx2, int dy2, int mode) {
- // loadPixels();
- // super.blend(src, sx1, sy1, sx2, sy2, dx1, dy1, dx2, dy2, mode);
- // updatePixels();
- // }
-
-
- /**
- * Allows to set custom blend modes for the entire scene, using openGL.
- * Reference article about blending modes:
- * http://www.pegtop.net/delphi/articles/blendmodes/
- * HARD_LIGHT, SOFT_LIGHT, OVERLAY, DODGE, BURN modes cannot be
- * implemented in fixed-function pipeline because they require
- * conditional blending and non-linear blending equations.
- */
- @Override
- public void blendMode(int mode) {
- if (blendMode != mode) {
- // Flush any geometry that uses a different blending mode.
- flush();
- setBlendMode(mode);
- }
- }
-
-
- protected void setBlendMode(int mode) {
- blendMode = mode;
- pgl.enable(PGL.BLEND);
-
- if (mode == REPLACE) {
- if (blendEqSupported) {
- pgl.blendEquation(PGL.FUNC_ADD);
- }
- pgl.blendFunc(PGL.ONE, PGL.ZERO);
-
- } else if (mode == BLEND) {
- if (blendEqSupported) {
- pgl.blendEquation(PGL.FUNC_ADD);
- }
- pgl.blendFunc(PGL.SRC_ALPHA, PGL.ONE_MINUS_SRC_ALPHA);
-
- } else if (mode == ADD) {
- if (blendEqSupported) {
- pgl.blendEquation(PGL.FUNC_ADD);
- }
- pgl.blendFunc(PGL.SRC_ALPHA, PGL.ONE);
-
- } else if (mode == SUBTRACT) {
- if (blendEqSupported) {
- pgl.blendEquation(PGL.FUNC_ADD);
- }
- pgl.blendFunc(PGL.ONE_MINUS_DST_COLOR, PGL.ZERO);
-
- } else if (mode == LIGHTEST) {
- if (blendEqSupported) {
- pgl.blendEquation(PGL.FUNC_MAX);
- pgl.blendFunc(PGL.SRC_ALPHA, PGL.DST_ALPHA);
- } else {
- PGraphics.showWarning(BLEND_DRIVER_ERROR, "LIGHTEST");
- }
-
- } else if (mode == DARKEST) {
- if (blendEqSupported) {
- pgl.blendEquation(PGL.FUNC_MIN);
- pgl.blendFunc(PGL.SRC_ALPHA, PGL.DST_ALPHA);
- } else {
- PGraphics.showWarning(BLEND_DRIVER_ERROR, "DARKEST");
- }
-
- } else if (mode == DIFFERENCE) {
- if (blendEqSupported) {
- pgl.blendEquation(PGL.FUNC_REVERSE_SUBTRACT);
- pgl.blendFunc(PGL.ONE, PGL.ONE);
- } else {
- PGraphics.showWarning(BLEND_DRIVER_ERROR, "DIFFERENCE");
- }
-
- } else if (mode == EXCLUSION) {
- if (blendEqSupported) {
- pgl.blendEquation(PGL.FUNC_ADD);
- }
- pgl.blendFunc(PGL.ONE_MINUS_DST_COLOR, PGL.ONE_MINUS_SRC_COLOR);
-
- } else if (mode == MULTIPLY) {
- if (blendEqSupported) {
- pgl.blendEquation(PGL.FUNC_ADD);
- }
- pgl.blendFunc(PGL.DST_COLOR, PGL.SRC_COLOR);
-
- } else if (mode == SCREEN) {
- if (blendEqSupported) {
- pgl.blendEquation(PGL.FUNC_ADD);
- }
- pgl.blendFunc(PGL.ONE_MINUS_DST_COLOR, PGL.ONE);
-
- } else if (mode == OVERLAY) {
- PGraphics.showWarning(BLEND_RENDERER_ERROR, "OVERLAY");
-
- } else if (mode == HARD_LIGHT) {
- PGraphics.showWarning(BLEND_RENDERER_ERROR, "HARD_LIGHT");
-
- } else if (mode == SOFT_LIGHT) {
- PGraphics.showWarning(BLEND_RENDERER_ERROR, "SOFT_LIGHT");
-
- } else if (mode == DODGE) {
- PGraphics.showWarning(BLEND_RENDERER_ERROR, "DODGE");
-
- } else if (mode == BURN) {
- PGraphics.showWarning(BLEND_RENDERER_ERROR, "BURN");
- }
- }
-
-
- //////////////////////////////////////////////////////////////
-
- // SAVE
-
- // public void save(String filename) // PImage calls loadPixels()
-
-
- //////////////////////////////////////////////////////////////
-
- // TEXTURE UTILS
-
-
- /**
- * This utility method returns the texture associated to the renderer's.
- * drawing surface, making sure is updated to reflect the current contents
- * off the screen (or offscreen drawing surface).
- */
- public Texture getTexture() {
- loadTexture();
- return texture;
- }
-
-
- /**
- * This utility method returns the texture associated to the image.
- * creating and/or updating it if needed.
- *
- * @param img the image to have a texture metadata associated to it
- */
- public Texture getTexture(PImage img) {
- Texture tex = (Texture)initCache(img);
- if (tex == null) return null;
-
- if (img.isModified()) {
- if (img.width != tex.width || img.height != tex.height) {
- tex.init(img.width, img.height);
- }
- updateTexture(img, tex);
- }
-
- if (tex.hasBuffers()) {
- tex.bufferUpdate();
- }
-
- checkTexture(tex);
-
- return tex;
- }
-
-
- @Override
- public Object initCache(PImage img) {
- if (!checkGLThread()) {
- return null;
- }
-
- Texture tex = (Texture)pgPrimary.getCache(img);
- if (tex == null || tex.contextIsOutdated()) {
- tex = addTexture(img);
- if (tex != null) {
- img.loadPixels();
- tex.set(img.pixels);
- }
- }
- return tex;
- }
-
-
- protected void bindBackTexture() {
- if (primarySurface) {
- pgl.bindFrontTexture();
- } else {
- ptexture.bind();
- }
- }
-
-
- protected void unbindBackTexture() {
- if (primarySurface) {
- pgl.unbindFrontTexture();
- } else {
- ptexture.unbind();
- }
- }
-
-
- /**
- * This utility method creates a texture for the provided image, and adds it
- * to the metadata cache of the image.
- * @param img the image to have a texture metadata associated to it
- */
- protected Texture addTexture(PImage img) {
- Texture.Parameters params =
- new Texture.Parameters(ARGB, textureSampling,
- getHint(ENABLE_TEXTURE_MIPMAPS),textureWrap);
- return addTexture(img, params);
- }
-
-
- protected Texture addTexture(PImage img, Texture.Parameters params) {
- if (img.width == 0 || img.height == 0) {
- // Cannot add textures of size 0
- return null;
- }
- if (img.parent == null) {
- img.parent = parent;
- }
- Texture tex = new Texture(img.parent, img.width, img.height, params);
- pgPrimary.setCache(img, tex);
- return tex;
- }
-
-
- protected void checkTexture(Texture tex) {
- if (!tex.isColorBuffer() &&
- tex.usingMipmaps == hints[DISABLE_TEXTURE_MIPMAPS]) {
- if (hints[DISABLE_TEXTURE_MIPMAPS]) {
- tex.usingMipmaps(false, textureSampling);
- } else {
- tex.usingMipmaps(true, textureSampling);
- }
- }
-
- if ((tex.usingRepeat && textureWrap == CLAMP) ||
- (!tex.usingRepeat && textureWrap == REPEAT)) {
- if (textureWrap == CLAMP) {
- tex.usingRepeat(false);
- } else {
- tex.usingRepeat(true);
- }
- }
- }
-
-
- protected PImage wrapTexture(Texture tex) {
- // We don't use the PImage(int width, int height, int mode) constructor to
- // avoid initializing the pixels array.
- PImage img = new PImage();
- img.parent = parent;
- img.width = tex.width;
- img.height = tex.height;
- img.format = ARGB;
- pgPrimary.setCache(img, tex);
- return img;
- }
-
-
- protected void updateTexture(PImage img, Texture tex) {
- if (tex != null) {
- int x = img.getModifiedX1();
- int y = img.getModifiedY1();
- int w = img.getModifiedX2() - x + 1;
- int h = img.getModifiedY2() - y + 1;
- tex.set(img.pixels, x, y, w, h, img.format);
- }
- img.setModified(false);
- }
-
-
- protected boolean checkGLThread() {
- if (pgl.threadIsCurrent()) {
- return true;
- } else {
- PGraphics.showWarning(OPENGL_THREAD_ERROR);
- return false;
- }
- }
-
-
- //////////////////////////////////////////////////////////////
-
- // RESIZE
-
-
- @Override
- public void resize(int wide, int high) {
- PGraphics.showMethodWarning("resize");
- }
-
-
- //////////////////////////////////////////////////////////////
-
- // INITIALIZATION ROUTINES
-
-
- protected void initPrimary() {
- pgl.initSurface(quality);
- if (texture != null) {
- pgPrimary.removeCache(this);
- texture = ptexture = null;
- }
- pgPrimary = this;
- initialized = true;
- }
-
-
- protected void updatePrimary() {
- pgl.update();
- }
-
-
- protected void beginOnscreenDraw() {
- updatePrimary();
- pgl.beginDraw(clearColorBuffer);
-
- if (drawFramebuffer == null) {
- drawFramebuffer = new FrameBuffer(parent, width, height, true);
- }
- drawFramebuffer.setFBO(pgl.getDrawFramebuffer());
- if (readFramebuffer == null) {
- readFramebuffer = new FrameBuffer(parent, width, height, true);
- }
- readFramebuffer.setFBO(pgl.getReadFramebuffer());
- if (currentFramebuffer == null) {
- setFramebuffer(drawFramebuffer);
- }
-
- if (pgl.isFBOBacked()) {
- if (texture == null) {
- texture = pgl.wrapBackTexture();
- } else {
- texture.glName = pgl.getBackTextureName();
- }
- if (ptexture == null) {
- ptexture = pgl.wrapFrontTexture();
- } else {
- ptexture.glName = pgl.getFrontTextureName();
- }
- }
- }
-
-
- protected void endOnscreenDraw() {
- pgl.endDraw(clearColorBuffer0);
- }
-
-
- protected void initOffscreen() {
- // Getting the context and capabilities from the main renderer.
- loadTextureImpl(Texture.BILINEAR, false);
-
- // In case of reinitialization (for example, when the smooth level
- // is changed), we make sure that all the OpenGL resources associated
- // to the surface are released by calling delete().
- if (offscreenFramebuffer != null) {
- offscreenFramebuffer.release();
- }
- if (multisampleFramebuffer != null) {
- multisampleFramebuffer.release();
- }
-
- boolean packed = depthBits == 24 && stencilBits == 8 &&
- packedDepthStencilSupported;
- if (PGraphicsOpenGL.fboMultisampleSupported && 1 < quality) {
- multisampleFramebuffer =
- new FrameBuffer(parent, texture.glWidth, texture.glHeight, quality, 0,
- depthBits, stencilBits, packed, false);
-
- multisampleFramebuffer.clear();
- offscreenMultisample = true;
-
- // The offscreen framebuffer where the multisampled image is finally drawn
- // to doesn't need depth and stencil buffers since they are part of the
- // multisampled framebuffer.
- offscreenFramebuffer =
- new FrameBuffer(parent, texture.glWidth, texture.glHeight, 1, 1, 0, 0,
- false, false);
-
- } else {
- quality = 0;
- offscreenFramebuffer =
- new FrameBuffer(parent, texture.glWidth, texture.glHeight, 1, 1,
- depthBits, stencilBits, packed, false);
- offscreenMultisample = false;
- }
-
- offscreenFramebuffer.setColorBuffer(texture);
- offscreenFramebuffer.clear();
-
- initialized = true;
- }
-
-
- protected void updateOffscreen() {
- if (!initialized) {
- initOffscreen();
- } else {
- boolean outdated = offscreenFramebuffer != null &&
- offscreenFramebuffer.contextIsOutdated();
- boolean outdatedMulti = multisampleFramebuffer != null &&
- multisampleFramebuffer.contextIsOutdated();
- if (outdated || outdatedMulti) {
- restartPGL();
- initOffscreen();
- } else {
- // The back texture of the past frame becomes the front,
- // and the front texture becomes the new back texture where the
- // new frame is drawn to.
- swapTextures();
- }
- }
-
- pushFramebuffer();
- if (offscreenMultisample) {
- setFramebuffer(multisampleFramebuffer);
- } else {
- setFramebuffer(offscreenFramebuffer);
- }
- }
-
-
- protected void beginOffscreenDraw() {
- updateOffscreen();
-
- // Just in case the texture was recreated (in a resize event for example)
- offscreenFramebuffer.setColorBuffer(texture);
-
- // Restoring the clipping configuration of the offscreen surface.
- if (clip) {
- pgl.enable(PGL.SCISSOR_TEST);
- pgl.scissor(clipRect[0], clipRect[1], clipRect[2], clipRect[3]);
- } else {
- pgl.disable(PGL.SCISSOR_TEST);
- }
- }
-
-
- protected void endOffscreenDraw() {
- if (offscreenMultisample) {
- multisampleFramebuffer.copy(offscreenFramebuffer, currentFramebuffer);
- }
-
- if (!clearColorBuffer0) {
- // Draw the back texture into the front texture, which will be used as
- // front texture in the next frame. Otherwise flickering will occur if
- // the sketch uses "incremental drawing" (background() not called).
- if (offscreenMultisample) {
- pushFramebuffer();
- setFramebuffer(offscreenFramebuffer);
- }
- offscreenFramebuffer.setColorBuffer(ptexture);
- drawTexture();
- offscreenFramebuffer.setColorBuffer(texture);
- if (offscreenMultisample) {
- popFramebuffer();
- }
- }
-
- popFramebuffer();
- texture.updateTexels(); // Mark all texels in screen texture as modified.
-
- pgPrimary.restoreGL();
- }
-
-
- protected void setDefaults() {
- inGeo.clear();
- tessGeo.clear();
- texCache.clear();
-
- // Each frame starts with textures disabled.
- super.noTexture();
-
- // Screen blend is needed for alpha (i.e. fonts) to work.
- // Using setBlendMode() instead of blendMode() because
- // the latter will set the blend mode only if it is different
- // from current.
- setBlendMode(BLEND);
-
- // this is necessary for 3D drawing
- if (hints[DISABLE_DEPTH_TEST]) {
- pgl.disable(PGL.DEPTH_TEST);
- } else {
- pgl.enable(PGL.DEPTH_TEST);
- }
- // use <= since that's what processing.core does
- pgl.depthFunc(PGL.LEQUAL);
-
- if (hints[DISABLE_OPTIMIZED_STROKE]) {
- flushMode = FLUSH_CONTINUOUSLY;
- } else {
- flushMode = FLUSH_WHEN_FULL;
- }
-
- if (primarySurface) {
- pgl.getIntegerv(PGL.SAMPLES, intBuffer);
- int temp = intBuffer.get(0);
- if (quality != temp && 1 < temp && 1 < quality) {
- quality = temp;
- }
- }
- if (quality < 2) {
- pgl.disable(PGL.MULTISAMPLE);
- } else {
- pgl.enable(PGL.MULTISAMPLE);
- }
- pgl.disable(PGL.POINT_SMOOTH);
- pgl.disable(PGL.LINE_SMOOTH);
- pgl.disable(PGL.POLYGON_SMOOTH);
-
- // setup opengl viewport.
- viewport.put(0, 0); viewport.put(1, 0);
- viewport.put(2, width); viewport.put(3, height);
- pgl.viewport(viewport.get(0), viewport.get(1),
- viewport.get(2), viewport.get(3));
-
- if (sized) {
- // To avoid having garbage in the screen after a resize,
- // in the case background is not called in draw().
- background(backgroundColor);
-
- // Sets the default projection and camera (initializes modelview).
- // If the user has setup up their own projection, they'll need
- // to fix it after resize anyway. This helps the people who haven't
- // set up their own projection.
- defaultPerspective();
- defaultCamera();
-
- // clear the flag
- sized = false;
- } else {
- // Eliminating any user's transformations by going back to the
- // original camera setup.
- modelview.set(camera);
- modelviewInv.set(cameraInv);
- updateProjmodelview();
- }
-
- if (is3D()) {
- noLights();
- lightFalloff(1, 0, 0);
- lightSpecular(0, 0, 0);
- }
-
- // Because y is flipped, the vertices that should be specified by
- // the user in CCW order to define a front-facing facet, end up being CW.
- pgl.frontFace(PGL.CW);
- pgl.disable(PGL.CULL_FACE);
-
- // Processing uses only one texture unit.
- pgl.activeTexture(PGL.TEXTURE0);
-
- // The current normal vector is set to be parallel to the Z axis.
- normalX = normalY = normalZ = 0;
-
- // Clear depth and stencil buffers.
- pgl.depthMask(true);
- pgl.clearDepth(1);
- pgl.clearStencil(0);
- pgl.clear(PGL.DEPTH_BUFFER_BIT | PGL.STENCIL_BUFFER_BIT);
-
- if (!settingsInited) {
- defaultSettings();
- }
-
- if (restoreSurface) {
- restoreSurfaceFromPixels();
- restoreSurface = false;
- }
-
- if (hints[DISABLE_DEPTH_MASK]) {
- pgl.depthMask(false);
- } else {
- pgl.depthMask(true);
- }
-
- pixelsOp = OP_NONE;
-
- modified = false;
- setgetPixels = false;
-
- clearColorBuffer0 = clearColorBuffer;
- clearColorBuffer = false;
- }
-
-
- protected void getGLParameters() {
- OPENGL_VENDOR = pgl.getString(PGL.VENDOR);
- OPENGL_RENDERER = pgl.getString(PGL.RENDERER);
- OPENGL_VERSION = pgl.getString(PGL.VERSION);
- OPENGL_EXTENSIONS = pgl.getString(PGL.EXTENSIONS);
- GLSL_VERSION = pgl.getString(PGL.SHADING_LANGUAGE_VERSION);
-
- int major = pgl.getGLVersion()[0];
- if (major < 2) {
- // GLSL might still be available through extensions.
- if (OPENGL_EXTENSIONS.indexOf("_fragment_shader") == -1 ||
- OPENGL_EXTENSIONS.indexOf("_vertex_shader") == -1 ||
- OPENGL_EXTENSIONS.indexOf("_shader_objects") == -1 ||
- OPENGL_EXTENSIONS.indexOf("_shading_language") == -1) {
- // GLSL extensions are not present, we cannot do anything else here.
- throw new RuntimeException("Processing cannot run because GLSL shaders" +
- " are not available.");
- }
- }
-
- npotTexSupported =
- -1 < OPENGL_EXTENSIONS.indexOf("_texture_non_power_of_two");
- autoMipmapGenSupported =
- -1 < OPENGL_EXTENSIONS.indexOf("_generate_mipmap");
- fboMultisampleSupported =
- -1 < OPENGL_EXTENSIONS.indexOf("_framebuffer_multisample");
- packedDepthStencilSupported =
- -1 < OPENGL_EXTENSIONS.indexOf("_packed_depth_stencil");
- anisoSamplingSupported =
- -1 < OPENGL_EXTENSIONS.indexOf("_texture_filter_anisotropic");
-
- try {
- pgl.blendEquation(PGL.FUNC_ADD);
- blendEqSupported = true;
- } catch (Exception e) {
- blendEqSupported = false;
- }
-
- depthBits = pgl.getDepthBits();
- stencilBits = pgl.getStencilBits();
-
- pgl.getIntegerv(PGL.MAX_TEXTURE_SIZE, intBuffer);
- maxTextureSize = intBuffer.get(0);
-
- pgl.getIntegerv(PGL.MAX_SAMPLES, intBuffer);
- maxSamples = intBuffer.get(0);
-
- pgl.getIntegerv(PGL.ALIASED_LINE_WIDTH_RANGE, intBuffer);
- maxLineWidth = intBuffer.get(0);
-
- pgl.getIntegerv(PGL.ALIASED_POINT_SIZE_RANGE, intBuffer);
- maxPointSize = intBuffer.get(0);
-
- if (anisoSamplingSupported) {
- pgl.getFloatv(PGL.MAX_TEXTURE_MAX_ANISOTROPY, floatBuffer);
- maxAnisoAmount = floatBuffer.get(0);
- }
-
- glParamsRead = true;
- }
-
-
- //////////////////////////////////////////////////////////////
-
- // SHADER HANDLING
-
-
- @Override
- public PShader loadShader(String fragFilename) {
- int shaderType = getShaderType(fragFilename);
- if (shaderType == -1) {
- PGraphics.showWarning(INVALID_PROCESSING_SHADER_ERROR);
- return null;
- }
- PShader shader = null;
- if (shaderType == PShader.POINT) {
- shader = new PointShader(parent);
- shader.setVertexShader(defPointShaderVertURL);
- } else if (shaderType == PShader.LINE) {
- shader = new LineShader(parent);
- shader.setVertexShader(defLineShaderVertURL);
- } else if (shaderType == PShader.TEXLIGHT) {
- shader = new TexlightShader(parent);
- shader.setVertexShader(defTexlightShaderVertURL);
- } else if (shaderType == PShader.LIGHT) {
- shader = new LightShader(parent);
- shader.setVertexShader(defLightShaderVertURL);
- } else if (shaderType == PShader.TEXTURE) {
- shader = new TexureShader(parent);
- shader.setVertexShader(defTextureShaderVertURL);
- } else if (shaderType == PShader.COLOR) {
- shader = new ColorShader(parent);
- shader.setVertexShader(defColorShaderVertURL);
- }
- shader.setFragmentShader(fragFilename);
- return shader;
- }
-
-
- @Override
- public PShader loadShader(String fragFilename, String vertFilename) {
- int shaderType = getShaderType(vertFilename);
- if (shaderType == -1) {
- shaderType = getShaderType(fragFilename);
- }
- if (shaderType == -1) {
- PGraphics.showWarning(INVALID_PROCESSING_SHADER_ERROR);
- return null;
- }
-
- PShader shader = null;
- if (fragFilename == null || fragFilename.equals("")) {
- if (shaderType == PShader.POINT) {
- shader = new PointShader(parent);
- shader.setFragmentShader(defPointShaderFragURL);
- } else if (shaderType == PShader.LINE) {
- shader = new LineShader(parent);
- shader.setFragmentShader(defLineShaderFragURL);
- } else if (shaderType == PShader.TEXLIGHT) {
- shader = new TexlightShader(parent);
- shader.setFragmentShader(defTextureShaderFragURL);
- } else if (shaderType == PShader.LIGHT) {
- shader = new LightShader(parent);
- shader.setFragmentShader(defColorShaderFragURL);
- } else if (shaderType == PShader.TEXTURE) {
- shader = new TexureShader(parent);
- shader.setFragmentShader(defTextureShaderFragURL);
- } else if (shaderType == PShader.COLOR) {
- shader = new ColorShader(parent);
- shader.setFragmentShader(defColorShaderFragURL);
- }
- if (shader != null) {
- shader.setVertexShader(vertFilename);
- }
- } else {
- if (shaderType == PShader.POINT) {
- shader = new PointShader(parent, vertFilename, fragFilename);
- } else if (shaderType == PShader.LINE) {
- shader = new LineShader(parent, vertFilename, fragFilename);
- } else if (shaderType == PShader.TEXLIGHT) {
- shader = new TexlightShader(parent, vertFilename, fragFilename);
- } else if (shaderType == PShader.LIGHT) {
- shader = new LightShader(parent, vertFilename, fragFilename);
- } else if (shaderType == PShader.TEXTURE) {
- shader = new TexureShader(parent, vertFilename, fragFilename);
- } else if (shaderType == PShader.COLOR) {
- shader = new ColorShader(parent, vertFilename, fragFilename);
- }
- }
- return shader;
- }
-
-
- @Override
- public void shader(PShader shader) {
- shader(shader, POLYGON);
- }
-
-
- @Override
- public void shader(PShader shader, int kind) {
- flush(); // Flushing geometry drawn with a different shader.
-
- if (kind == TRIANGLES || kind == QUADS || kind == POLYGON) {
- if (shader instanceof TexureShader) {
- textureShader = (TexureShader) shader;
- } else if (shader instanceof ColorShader) {
- colorShader = (ColorShader) shader;
- } else if (shader instanceof TexlightShader) {
- texlightShader = (TexlightShader) shader;
- } else if (shader instanceof LightShader) {
- lightShader = (LightShader) shader;
- } else {
- PGraphics.showWarning(WRONG_SHADER_TYPE_ERROR);
- }
- } else if (kind == LINES) {
- if (shader instanceof LineShader) {
- lineShader = (LineShader)shader;
- } else {
- PGraphics.showWarning(WRONG_SHADER_TYPE_ERROR);
- }
- } else if (kind == POINTS) {
- if (shader instanceof PointShader) {
- pointShader = (PointShader)shader;
- } else {
- PGraphics.showWarning(WRONG_SHADER_TYPE_ERROR);
- }
- } else {
- PGraphics.showWarning(UNKNOWN_SHADER_KIND_ERROR);
- }
- }
-
-
- @Override
- public void resetShader() {
- resetShader(POLYGON);
- }
-
-
- @Override
- public void resetShader(int kind) {
- flush(); // Flushing geometry drawn with a different shader.
-
- if (kind == TRIANGLES || kind == QUADS || kind == POLYGON) {
- textureShader = null;
- colorShader = null;
- texlightShader = null;
- lightShader = null;
- } else if (kind == LINES) {
- lineShader = null;
- } else if (kind == POINTS) {
- pointShader = null;
- } else {
- PGraphics.showWarning(UNKNOWN_SHADER_KIND_ERROR);
- }
- }
-
-
- public void shaderWarnings(boolean enable) {
- shaderWarningsEnabled = enable;
- }
-
-
- protected int getShaderType(String filename) {
- String[] source = parent.loadStrings(filename);
- int type = -1;
- for (int i = 0; i < source.length; i++) {
- if (source[i].equals("#define PROCESSING_POINT_SHADER")) {
- type = PShader.POINT;
- } else if (source[i].equals("#define PROCESSING_LINE_SHADER")) {
- type = PShader.LINE;
- } else if (source[i].equals("#define PROCESSING_COLOR_SHADER")) {
- type = PShader.COLOR;
- } else if (source[i].equals("#define PROCESSING_LIGHT_SHADER")) {
- type = PShader.LIGHT;
- } else if (source[i].equals("#define PROCESSING_TEXTURE_SHADER")) {
- type = PShader.TEXTURE;
- } else if (source[i].equals("#define PROCESSING_TEXLIGHT_SHADER")) {
- type = PShader.TEXLIGHT;
- }
- }
- return type;
- }
-
-
- protected void deleteDefaultShaders() {
- // The default shaders contains references to the PGraphics object that
- // creates them, so when restarting the renderer, those references should
- // dissapear.
- defColorShader = null;
- defTextureShader = null;
- defLightShader = null;
- defTexlightShader = null;
- defLineShader = null;
- defPointShader = null;
- maskShader = null;
- }
-
-
- protected BaseShader getPolyShader(boolean lit, boolean tex) {
- BaseShader shader;
- if (lit) {
- if (tex) {
- if (texlightShader == null) {
- if (defTexlightShader == null) {
- defTexlightShader = new TexlightShader(parent,
- defTexlightShaderVertURL,
- defTextureShaderFragURL);
- }
- shader = defTexlightShader;
- texlightShaderCheck();
- } else {
- shader = texlightShader;
- }
- } else {
- if (lightShader == null) {
- if (defLightShader == null) {
- defLightShader = new LightShader(parent,
- defLightShaderVertURL,
- defColorShaderFragURL);
- }
- shader = defLightShader;
- lightShaderCheck();
- } else {
- shader = lightShader;
- }
- }
- } else {
- if (tex) {
- if (textureShader == null) {
- if (defTextureShader == null) {
- defTextureShader = new TexureShader(parent,
- defTextureShaderVertURL,
- defTextureShaderFragURL);
- }
- shader = defTextureShader;
- textureShaderCheck();
- } else {
- shader = textureShader;
- }
- } else {
- if (colorShader == null) {
- if (defColorShader == null) {
- defColorShader = new ColorShader(parent,
- defColorShaderVertURL,
- defColorShaderFragURL);
- }
- shader = defColorShader;
- colorShaderCheck();
- } else {
- shader = colorShader;
- }
- }
- }
- shader.setRenderer(this);
- shader.loadAttributes();
- shader.loadUniforms();
- return shader;
- }
-
-
- protected void texlightShaderCheck() {
- if (shaderWarningsEnabled &&
- (lightShader != null ||
- textureShader != null ||
- colorShader != null)) {
- PGraphics.showWarning(NO_TEXLIGHT_SHADER_ERROR);
- }
- }
-
-
- protected void lightShaderCheck() {
- if (shaderWarningsEnabled &&
- (texlightShader != null ||
- textureShader != null ||
- colorShader != null)) {
- PGraphics.showWarning(NO_LIGHT_SHADER_ERROR);
- }
- }
-
-
- protected void textureShaderCheck() {
- if (shaderWarningsEnabled &&
- (texlightShader != null ||
- lightShader != null ||
- colorShader != null)) {
- PGraphics.showWarning(NO_TEXTURE_SHADER_ERROR);
- }
- }
-
-
- protected void colorShaderCheck() {
- if (shaderWarningsEnabled &&
- (texlightShader != null ||
- lightShader != null ||
- textureShader != null)) {
- PGraphics.showWarning(NO_COLOR_SHADER_ERROR);
- }
- }
-
-
- protected LineShader getLineShader() {
- LineShader shader;
- if (lineShader == null) {
- if (defLineShader == null) {
- defLineShader = new LineShader(parent, defLineShaderVertURL,
- defLineShaderFragURL);
- }
- shader = defLineShader;
- } else {
- shader = lineShader;
- }
- shader.setRenderer(this);
- shader.loadAttributes();
- shader.loadUniforms();
- return shader;
- }
-
-
- protected PointShader getPointShader() {
- PointShader shader;
- if (pointShader == null) {
- if (defPointShader == null) {
- defPointShader = new PointShader(parent, defPointShaderVertURL,
- defPointShaderFragURL);
- }
- shader = defPointShader;
- } else {
- shader = pointShader;
- }
- shader.setRenderer(this);
- shader.loadAttributes();
- shader.loadUniforms();
- return shader;
- }
-
-
- protected class BaseShader extends PShader {
- protected int transformLoc;
- protected int modelviewLoc;
- protected int projectionLoc;
- protected int bufferLoc;
- protected int viewportLoc;
-
- public BaseShader(PApplet parent) {
- super(parent);
- }
-
- public BaseShader(PApplet parent, String vertFilename, String fragFilename) {
- super(parent, vertFilename, fragFilename);
- }
-
- public BaseShader(PApplet parent, URL vertURL, URL fragURL) {
- super(parent, vertURL, fragURL);
- }
-
- @Override
- public void loadUniforms() {
- transformLoc = getUniformLoc("transform");
- modelviewLoc = getUniformLoc("modelview");
- projectionLoc = getUniformLoc("projection");
- viewportLoc = getUniformLoc("viewport");
- bufferLoc = getUniformLoc("buffer");
- }
-
- @Override
- public void unbind() {
- if (-1 < bufferLoc) {
- pgl.needFBOLayer();
- pgl.activeTexture(PGL.TEXTURE0 + lastTexUnit);
- pgCurrent.unbindBackTexture();
- pgl.activeTexture(PGL.TEXTURE0);
- }
-
- pgl.bindBuffer(PGL.ARRAY_BUFFER, 0);
-
- super.unbind();
- }
-
- protected void setCommonUniforms() {
- if (-1 < transformLoc) {
- pgCurrent.updateGLProjmodelview();
- setUniformMatrix(transformLoc, pgCurrent.glProjmodelview);
- }
-
- if (-1 < modelviewLoc) {
- pgCurrent.updateGLModelview();
- setUniformMatrix(modelviewLoc, pgCurrent.glModelview);
- }
-
- if (-1 < projectionLoc) {
- pgCurrent.updateGLProjection();
- setUniformMatrix(projectionLoc, pgCurrent.glProjection);
- }
-
- if (-1 < viewportLoc) {
- float x = pgCurrent.viewport.get(0);
- float y = pgCurrent.viewport.get(1);
- float w = pgCurrent.viewport.get(2);
- float h = pgCurrent.viewport.get(3);
- setUniformValue(viewportLoc, x, y, w, h);
- }
-
- if (-1 < bufferLoc) {
- setUniformValue(bufferLoc, lastTexUnit);
- pgl.activeTexture(PGL.TEXTURE0 + lastTexUnit);
- pgCurrent.bindBackTexture();
- }
- }
-
- public void setVertexAttribute(int vboId, int size, int type,
- int stride, int offset) { }
- public void setColorAttribute(int vboId, int size, int type,
- int stride, int offset) { }
- public void setNormalAttribute(int vboId, int size, int type,
- int stride, int offset) { }
- public void setAmbientAttribute(int vboId, int size, int type,
- int stride, int offset) { }
- public void setSpecularAttribute(int vboId, int size, int type,
- int stride, int offset) { }
- public void setEmissiveAttribute(int vboId, int size, int type,
- int stride, int offset) { }
- public void setShininessAttribute(int vboId, int size, int type,
- int stride, int offset) { }
- public void setTexcoordAttribute(int vboId, int size, int type,
- int stride, int offset) { }
- public void setTexture(Texture tex) { }
- }
-
-
- protected class ColorShader extends BaseShader {
- protected int vertexLoc;
- protected int colorLoc;
-
- public ColorShader(PApplet parent) {
- super(parent);
- }
-
- public ColorShader(PApplet parent, String vertFilename,
- String fragFilename) {
- super(parent, vertFilename, fragFilename);
- }
-
- public ColorShader(PApplet parent, URL vertURL, URL fragURL) {
- super(parent, vertURL, fragURL);
- }
-
- @Override
- public void loadAttributes() {
- vertexLoc = getAttributeLoc("vertex");
- colorLoc = getAttributeLoc("color");
- }
-
- @Override
- public void loadUniforms() {
- super.loadUniforms();
- }
-
- @Override
- public void setVertexAttribute(int vboId, int size, int type,
- int stride, int offset) {
- setAttributeVBO(vertexLoc, vboId, size, type, false, stride, offset);
- }
-
- @Override
- public void setColorAttribute(int vboId, int size, int type,
- int stride, int offset) {
- setAttributeVBO(colorLoc, vboId, size, type, true, stride, offset);
- }
-
- @Override
- public void bind() {
- super.bind();
- if (pgCurrent == null) {
- setRenderer(PGraphicsOpenGL.pgCurrent);
- loadAttributes();
- loadUniforms();
- }
-
- if (-1 < vertexLoc) pgl.enableVertexAttribArray(vertexLoc);
- if (-1 < colorLoc) pgl.enableVertexAttribArray(colorLoc);
-
- setCommonUniforms();
- }
-
- @Override
- public void unbind() {
- if (-1 < vertexLoc) pgl.disableVertexAttribArray(vertexLoc);
- if (-1 < colorLoc) pgl.disableVertexAttribArray(colorLoc);
-
- super.unbind();
- }
- }
-
-
- protected class LightShader extends BaseShader {
- protected int normalMatrixLoc;
-
- protected int lightCountLoc;
- protected int lightPositionLoc;
- protected int lightNormalLoc;
- protected int lightAmbientLoc;
- protected int lightDiffuseLoc;
- protected int lightSpecularLoc;
- protected int lightFalloffLoc;
- protected int lightSpotLoc;
-
- protected int vertexLoc;
- protected int colorLoc;
- protected int normalLoc;
-
- protected int ambientLoc;
- protected int specularLoc;
- protected int emissiveLoc;
- protected int shininessLoc;
-
- public LightShader(PApplet parent) {
- super(parent);
- }
-
- public LightShader(PApplet parent, String vertFilename,
- String fragFilename) {
- super(parent, vertFilename, fragFilename);
- }
-
- public LightShader(PApplet parent, URL vertURL, URL fragURL) {
- super(parent, vertURL, fragURL);
- }
-
- @Override
- public void loadAttributes() {
- vertexLoc = getAttributeLoc("vertex");
- colorLoc = getAttributeLoc("color");
- normalLoc = getAttributeLoc("normal");
-
- ambientLoc = getAttributeLoc("ambient");
- specularLoc = getAttributeLoc("specular");
- emissiveLoc = getAttributeLoc("emissive");
- shininessLoc = getAttributeLoc("shininess");
- }
-
- @Override
- public void loadUniforms() {
- super.loadUniforms();
-
- normalMatrixLoc = getUniformLoc("normalMatrix");
-
- lightCountLoc = getUniformLoc("lightCount");
- lightPositionLoc = getUniformLoc("lightPosition");
- lightNormalLoc = getUniformLoc("lightNormal");
- lightAmbientLoc = getUniformLoc("lightAmbient");
- lightDiffuseLoc = getUniformLoc("lightDiffuse");
- lightSpecularLoc = getUniformLoc("lightSpecular");
- lightFalloffLoc = getUniformLoc("lightFalloff");
- lightSpotLoc = getUniformLoc("lightSpot");
- }
-
- @Override
- public void setVertexAttribute(int vboId, int size, int type,
- int stride, int offset) {
- setAttributeVBO(vertexLoc, vboId, size, type, false, stride, offset);
- }
-
- @Override
- public void setColorAttribute(int vboId, int size, int type,
- int stride, int offset) {
- setAttributeVBO(colorLoc, vboId, size, type, true, stride, offset);
- }
-
- @Override
- public void setNormalAttribute(int vboId, int size, int type,
- int stride, int offset) {
- setAttributeVBO(normalLoc, vboId, size, type, false, stride, offset);
- }
-
- @Override
- public void setAmbientAttribute(int vboId, int size, int type,
- int stride, int offset) {
- setAttributeVBO(ambientLoc, vboId, size, type, true, stride, offset);
- }
-
- @Override
- public void setSpecularAttribute(int vboId, int size, int type,
- int stride, int offset) {
- setAttributeVBO(specularLoc, vboId, size, type, true, stride, offset);
- }
-
- @Override
- public void setEmissiveAttribute(int vboId, int size, int type,
- int stride, int offset) {
- setAttributeVBO(emissiveLoc, vboId, size, type, true, stride, offset);
- }
-
- @Override
- public void setShininessAttribute(int vboId, int size, int type,
- int stride, int offset) {
- setAttributeVBO(shininessLoc, vboId, size, type, false, stride, offset);
- }
-
- @Override
- public void bind() {
- super.bind();
- if (pgCurrent == null) {
- setRenderer(PGraphicsOpenGL.pgCurrent);
- loadAttributes();
- loadUniforms();
- }
-
- if (-1 < vertexLoc) pgl.enableVertexAttribArray(vertexLoc);
- if (-1 < colorLoc) pgl.enableVertexAttribArray(colorLoc);
- if (-1 < normalLoc) pgl.enableVertexAttribArray(normalLoc);
-
- if (-1 < ambientLoc) pgl.enableVertexAttribArray(ambientLoc);
- if (-1 < specularLoc) pgl.enableVertexAttribArray(specularLoc);
- if (-1 < emissiveLoc) pgl.enableVertexAttribArray(emissiveLoc);
- if (-1 < shininessLoc) pgl.enableVertexAttribArray(shininessLoc);
-
- if (-1 < normalMatrixLoc) {
- pgCurrent.updateGLNormal();
- setUniformMatrix(normalMatrixLoc, pgCurrent.glNormal);
- }
-
- int count = pgCurrent.lightCount;
- setUniformValue(lightCountLoc, count);
- setUniformVector(lightPositionLoc, pgCurrent.lightPosition, 4, count);
- setUniformVector(lightNormalLoc, pgCurrent.lightNormal, 3, count);
- setUniformVector(lightAmbientLoc, pgCurrent.lightAmbient, 3, count);
- setUniformVector(lightDiffuseLoc, pgCurrent.lightDiffuse, 3, count);
- setUniformVector(lightSpecularLoc, pgCurrent.lightSpecular, 3, count);
- setUniformVector(lightFalloffLoc, pgCurrent.lightFalloffCoefficients,
- 3, count);
- setUniformVector(lightSpotLoc, pgCurrent.lightSpotParameters, 2, count);
-
- setCommonUniforms();
- }
-
- @Override
- public void unbind() {
- if (-1 < vertexLoc) pgl.disableVertexAttribArray(vertexLoc);
- if (-1 < colorLoc) pgl.disableVertexAttribArray(colorLoc);
- if (-1 < normalLoc) pgl.disableVertexAttribArray(normalLoc);
-
- if (-1 < ambientLoc) pgl.disableVertexAttribArray(ambientLoc);
- if (-1 < specularLoc) pgl.disableVertexAttribArray(specularLoc);
- if (-1 < emissiveLoc) pgl.disableVertexAttribArray(emissiveLoc);
- if (-1 < shininessLoc) pgl.disableVertexAttribArray(shininessLoc);
-
- super.unbind();
- }
- }
-
-
- protected class TexureShader extends ColorShader {
- protected int texCoordLoc;
-
- protected int textureLoc;
- protected int texMatrixLoc;
- protected int texOffsetLoc;
-
- protected float[] tcmat;
-
- public TexureShader(PApplet parent) {
- super(parent);
- }
-
- public TexureShader(PApplet parent, String vertFilename,
- String fragFilename) {
- super(parent, vertFilename, fragFilename);
- }
-
- public TexureShader(PApplet parent, URL vertURL, URL fragURL) {
- super(parent, vertURL, fragURL);
- }
-
- @Override
- public void loadUniforms() {
- super.loadUniforms();
-
- textureLoc = getUniformLoc("texture");
- texMatrixLoc = getUniformLoc("texMatrix");
- texOffsetLoc = getUniformLoc("texOffset");
- }
-
- @Override
- public void loadAttributes() {
- super.loadAttributes();
-
- texCoordLoc = getAttributeLoc("texCoord");
- }
-
- @Override
- public void setTexcoordAttribute(int vboId, int size, int type,
- int stride, int offset) {
- setAttributeVBO(texCoordLoc, vboId, size, type, false, stride, offset);
- }
-
- @Override
- public void setTexture(Texture tex) {
- float scaleu = 1;
- float scalev = 1;
- float dispu = 0;
- float dispv = 0;
-
- if (tex.invertedX()) {
- scaleu = -1;
- dispu = 1;
- }
-
- if (tex.invertedY()) {
- scalev = -1;
- dispv = 1;
- }
-
- scaleu *= tex.maxTexcoordU();
- dispu *= tex.maxTexcoordU();
- scalev *= tex.maxTexcoordV();
- dispv *= tex.maxTexcoordV();
-
- if (-1 < texMatrixLoc) {
- if (tcmat == null) {
- tcmat = new float[16];
- }
- tcmat[0] = scaleu; tcmat[4] = 0; tcmat[ 8] = 0; tcmat[12] = dispu;
- tcmat[1] = 0; tcmat[5] = scalev; tcmat[ 9] = 0; tcmat[13] = dispv;
- tcmat[2] = 0; tcmat[6] = 0; tcmat[10] = 0; tcmat[14] = 0;
- tcmat[3] = 0; tcmat[7] = 0; tcmat[11] = 0; tcmat[15] = 0;
- setUniformMatrix(texMatrixLoc, tcmat);
- }
-
- setUniformValue(texOffsetLoc, 1.0f / tex.width, 1.0f / tex.height);
-
- setUniformValue(textureLoc, 0);
- }
-
- @Override
- public void bind() {
- firstTexUnit = 1; // 0 will be used by the textureSampler
-
- super.bind();
-
- if (-1 < texCoordLoc) pgl.enableVertexAttribArray(texCoordLoc);
- }
-
- @Override
- public void unbind() {
- if (-1 < texCoordLoc) pgl.disableVertexAttribArray(texCoordLoc);
-
- super.unbind();
- }
- }
-
-
- protected class TexlightShader extends LightShader {
- protected int texCoordLoc;
-
- protected int textureLoc;
- protected int texMatrixLoc;
- protected int texOffsetLoc;
-
- protected float[] tcmat;
-
- public TexlightShader(PApplet parent) {
- super(parent);
- }
-
- public TexlightShader(PApplet parent, String vertFilename,
- String fragFilename) {
- super(parent, vertFilename, fragFilename);
- }
-
- public TexlightShader(PApplet parent, URL vertURL, URL fragURL) {
- super(parent, vertURL, fragURL);
- }
-
- @Override
- public void loadUniforms() {
- super.loadUniforms();
-
- textureLoc = getUniformLoc("texture");
- texMatrixLoc = getUniformLoc("texMatrix");
- texOffsetLoc = getUniformLoc("texOffset");
- }
-
- @Override
- public void loadAttributes() {
- super.loadAttributes();
-
- texCoordLoc = getAttributeLoc("texCoord");
- }
-
- @Override
- public void setTexcoordAttribute(int vboId, int size, int type,
- int stride, int offset) {
- setAttributeVBO(texCoordLoc, vboId, size, type, false, stride, offset);
- }
-
- @Override
- public void setTexture(Texture tex) {
- float scaleu = 1;
- float scalev = 1;
- float dispu = 0;
- float dispv = 0;
-
- if (tex.invertedX()) {
- scaleu = -1;
- dispu = 1;
- }
-
- if (tex.invertedY()) {
- scalev = -1;
- dispv = 1;
- }
-
- scaleu *= tex.maxTexcoordU;
- dispu *= tex.maxTexcoordU;
- scalev *= tex.maxTexcoordV;
- dispv *= tex.maxTexcoordV;
-
- if (-1 < texMatrixLoc) {
- if (tcmat == null) {
- tcmat = new float[16];
- }
- tcmat[0] = scaleu; tcmat[4] = 0; tcmat[ 8] = 0; tcmat[12] = dispu;
- tcmat[1] = 0; tcmat[5] = scalev; tcmat[ 9] = 0; tcmat[13] = dispv;
- tcmat[2] = 0; tcmat[6] = 0; tcmat[10] = 0; tcmat[14] = 0;
- tcmat[3] = 0; tcmat[7] = 0; tcmat[11] = 0; tcmat[15] = 0;
- setUniformMatrix(texMatrixLoc, tcmat);
- }
-
- setUniformValue(texOffsetLoc, 1.0f / tex.width, 1.0f / tex.height);
-
- setUniformValue(textureLoc, 0);
- }
-
- @Override
- public void bind() {
- firstTexUnit = 1; // 0 will be used by the textureSampler
-
- super.bind();
-
- if (-1 < texCoordLoc) pgl.enableVertexAttribArray(texCoordLoc);
- }
-
- @Override
- public void unbind() {
- if (-1 < texCoordLoc) pgl.disableVertexAttribArray(texCoordLoc);
-
- super.unbind();
- }
- }
-
-
- protected class LineShader extends BaseShader {
- protected int perspectiveLoc;
- protected int scaleLoc;
-
- protected int vertexLoc;
- protected int colorLoc;
- protected int directionLoc;
-
- public LineShader(PApplet parent) {
- super(parent);
- }
-
- public LineShader(PApplet parent, String vertFilename,
- String fragFilename) {
- super(parent, vertFilename, fragFilename);
- }
-
- public LineShader(PApplet parent, URL vertURL, URL fragURL) {
- super(parent, vertURL, fragURL);
- }
-
- @Override
- public void loadAttributes() {
- vertexLoc = getAttributeLoc("vertex");
- colorLoc = getAttributeLoc("color");
- directionLoc = getAttributeLoc("direction");
- }
-
- @Override
- public void loadUniforms() {
- super.loadUniforms();
-
- viewportLoc = getUniformLoc("viewport");
- perspectiveLoc = getUniformLoc("perspective");
- scaleLoc = getUniformLoc("scale");
- }
-
- @Override
- public void setVertexAttribute(int vboId, int size, int type,
- int stride, int offset) {
- setAttributeVBO(vertexLoc, vboId, size, type, false, stride, offset);
- }
-
- @Override
- public void setColorAttribute(int vboId, int size, int type,
- int stride, int offset) {
- setAttributeVBO(colorLoc, vboId, size, type, true, stride, offset);
- }
-
- public void setLineAttribute(int vboId, int size, int type,
- int stride, int offset) {
- setAttributeVBO(directionLoc, vboId, size, type, false, stride, offset);
- }
-
- @Override
- public void bind() {
- super.bind();
- if (pgCurrent == null) {
- setRenderer(PGraphicsOpenGL.pgCurrent);
- loadAttributes();
- loadUniforms();
- }
-
- if (-1 < vertexLoc) pgl.enableVertexAttribArray(vertexLoc);
- if (-1 < colorLoc) pgl.enableVertexAttribArray(colorLoc);
- if (-1 < directionLoc) pgl.enableVertexAttribArray(directionLoc);
-
- if (pgCurrent.getHint(ENABLE_STROKE_PERSPECTIVE) &&
- pgCurrent.nonOrthoProjection()) {
- setUniformValue(perspectiveLoc, 1);
- } else {
- setUniformValue(perspectiveLoc, 0);
- }
-
- if (pgCurrent.getHint(DISABLE_OPTIMIZED_STROKE)) {
- setUniformValue(scaleLoc, 1.0f, 1.0f, 1.0f);
- } else {
- if (orthoProjection()) {
- setUniformValue(scaleLoc, 1.0f, 1.0f, 0.99f);
- } else {
- setUniformValue(scaleLoc, 0.99f, 0.99f, 0.99f);
- }
- }
-
- setCommonUniforms();
- }
-
- @Override
- public void unbind() {
- if (-1 < vertexLoc) pgl.disableVertexAttribArray(vertexLoc);
- if (-1 < colorLoc) pgl.disableVertexAttribArray(colorLoc);
- if (-1 < directionLoc) pgl.disableVertexAttribArray(directionLoc);
-
- super.unbind();
- }
- }
-
-
- protected class PointShader extends BaseShader {
- protected int perspectiveLoc;
-
- protected int vertexLoc;
- protected int colorLoc;
- protected int offsetLoc;
-
- public PointShader(PApplet parent) {
- super(parent);
- }
-
- public PointShader(PApplet parent, String vertFilename,
- String fragFilename) {
- super(parent, vertFilename, fragFilename);
- }
-
- public PointShader(PApplet parent, URL vertURL, URL fragURL) {
- super(parent, vertURL, fragURL);
- }
-
- @Override
- public void loadAttributes() {
- vertexLoc = getAttributeLoc("vertex");
- colorLoc = getAttributeLoc("color");
- offsetLoc = getAttributeLoc("offset");
- }
-
- @Override
- public void loadUniforms() {
- super.loadUniforms();
-
- perspectiveLoc = getUniformLoc("perspective");
- }
-
- @Override
- public void setVertexAttribute(int vboId, int size, int type,
- int stride, int offset) {
- setAttributeVBO(vertexLoc, vboId, size, type, false, stride, offset);
- }
-
- @Override
- public void setColorAttribute(int vboId, int size, int type,
- int stride, int offset) {
- setAttributeVBO(colorLoc, vboId, size, type, true, stride, offset);
- }
-
- public void setPointAttribute(int vboId, int size, int type,
- int stride, int offset) {
- setAttributeVBO(offsetLoc, vboId, size, type, false, stride, offset);
- }
-
- @Override
- public void bind() {
- super.bind();
- if (pgCurrent == null) {
- setRenderer(PGraphicsOpenGL.pgCurrent);
- loadAttributes();
- loadUniforms();
- }
-
- if (-1 < vertexLoc) pgl.enableVertexAttribArray(vertexLoc);
- if (-1 < colorLoc) pgl.enableVertexAttribArray(colorLoc);
- if (-1 < offsetLoc) pgl.enableVertexAttribArray(offsetLoc);
-
- if (pgCurrent.getHint(ENABLE_STROKE_PERSPECTIVE) &&
- pgCurrent.nonOrthoProjection()) {
- setUniformValue(perspectiveLoc, 1);
- } else {
- setUniformValue(perspectiveLoc, 0);
- }
-
- super.setCommonUniforms();
- }
-
- @Override
- public void unbind() {
- if (-1 < vertexLoc) pgl.disableVertexAttribArray(vertexLoc);
- if (-1 < colorLoc) pgl.disableVertexAttribArray(colorLoc);
- if (-1 < offsetLoc) pgl.disableVertexAttribArray(offsetLoc);
-
- super.unbind();
- }
- }
-
-
- //////////////////////////////////////////////////////////////
-
- // Utils
-
- static protected int expandArraySize(int currSize, int newMinSize) {
- int newSize = currSize;
- while (newSize < newMinSize) {
- newSize <<= 1;
- }
- return newSize;
- }
-
- //////////////////////////////////////////////////////////////
-
- // Input (raw) and Tessellated geometry, tessellator.
-
-
- protected InGeometry newInGeometry(int mode) {
- return new InGeometry(mode);
- }
-
-
- protected TessGeometry newTessGeometry(int mode) {
- return new TessGeometry(mode);
- }
-
-
- protected TexCache newTexCache() {
- return new TexCache();
- }
-
-
- // Holds an array of textures and the range of vertex
- // indices each texture applies to.
- protected class TexCache {
- int size;
- PImage[] textures;
- int[] firstIndex;
- int[] lastIndex;
- int[] firstCache;
- int[] lastCache;
- boolean hasTexture;
- Texture tex0;
-
- TexCache() {
- allocate();
- }
-
- void allocate() {
- textures = new PImage[PGL.DEFAULT_IN_TEXTURES];
- firstIndex = new int[PGL.DEFAULT_IN_TEXTURES];
- lastIndex = new int[PGL.DEFAULT_IN_TEXTURES];
- firstCache = new int[PGL.DEFAULT_IN_TEXTURES];
- lastCache = new int[PGL.DEFAULT_IN_TEXTURES];
- size = 0;
- hasTexture = false;
- }
-
- void clear() {
- java.util.Arrays.fill(textures, 0, size, null);
- size = 0;
- hasTexture = false;
- }
-
- void beginRender() {
- tex0 = null;
- }
-
- PImage getTextureImage(int i) {
- return textures[i];
- }
-
- Texture getTexture(int i) {
- PImage img = textures[i];
- Texture tex = null;
-
- if (img != null) {
- tex = pgPrimary.getTexture(img);
- if (tex != null) {
- tex.bind();
- tex0 = tex;
- }
- }
- if (tex == null && tex0 != null) {
- tex0.unbind();
- pgl.disableTexturing(tex0.glTarget);
- }
-
- return tex;
- }
-
- void endRender() {
- if (hasTexture) {
- // Unbinding all the textures in the cache.
- for (int i = 0; i < size; i++) {
- PImage img = textures[i];
- if (img != null) {
- Texture tex = pgPrimary.getTexture(img);
- if (tex != null) {
- tex.unbind();
- pgl.disableTexturing(tex.glTarget);
- }
- }
- }
- }
- }
-
- void addTexture(PImage img, int firsti, int firstb, int lasti, int lastb) {
- arrayCheck();
-
- textures[size] = img;
- firstIndex[size] = firsti;
- lastIndex[size] = lasti;
- firstCache[size] = firstb;
- lastCache[size] = lastb;
-
- // At least one non-null texture since last reset.
- hasTexture |= img != null;
-
- size++;
- }
-
- void setLastIndex(int lasti, int lastb) {
- lastIndex[size - 1] = lasti;
- lastCache[size - 1] = lastb;
- }
-
- void arrayCheck() {
- if (size == textures.length) {
- int newSize = size << 1;
-
- expandTextures(newSize);
- expandFirstIndex(newSize);
- expandLastIndex(newSize);
- expandFirstCache(newSize);
- expandLastCache(newSize);
- }
- }
-
- void expandTextures(int n) {
- PImage[] temp = new PImage[n];
- PApplet.arrayCopy(textures, 0, temp, 0, size);
- textures = temp;
- }
-
- void expandFirstIndex(int n) {
- int[] temp = new int[n];
- PApplet.arrayCopy(firstIndex, 0, temp, 0, size);
- firstIndex = temp;
- }
-
- void expandLastIndex(int n) {
- int[] temp = new int[n];
- PApplet.arrayCopy(lastIndex, 0, temp, 0, size);
- lastIndex = temp;
- }
-
- void expandFirstCache(int n) {
- int[] temp = new int[n];
- PApplet.arrayCopy(firstCache, 0, temp, 0, size);
- firstCache = temp;
- }
-
- void expandLastCache(int n) {
- int[] temp = new int[n];
- PApplet.arrayCopy(lastCache, 0, temp, 0, size);
- lastCache = temp;
- }
- }
-
-
- // Stores the offsets and counts of indices and vertices
- // to render a piece of geometry that doesn't fit in a single
- // glDrawElements() call.
- protected class IndexCache {
- int size;
- int[] indexCount;
- int[] indexOffset;
- int[] vertexCount;
- int[] vertexOffset;
-
- IndexCache() {
- allocate();
- }
-
- void allocate() {
- indexCount = new int[2];
- indexOffset = new int[2];
- vertexCount = new int[2];
- vertexOffset = new int[2];
- size = 0;
- }
-
- void clear() {
- size = 0;
- }
-
- int addNew() {
- arrayCheck();
- init(size);
- size++;
- return size - 1;
- }
-
- int addNew(int index) {
- arrayCheck();
- indexCount[size] = indexCount[index];
- indexOffset[size] = indexOffset[index];
- vertexCount[size] = vertexCount[index];
- vertexOffset[size] = vertexOffset[index];
- size++;
- return size - 1;
- }
-
- int getLast() {
- if (size == 0) {
- arrayCheck();
- init(0);
- size = 1;
- }
- return size - 1;
- }
-
- void incCounts(int index, int icount, int vcount) {
- indexCount[index] += icount;
- vertexCount[index] += vcount;
- }
-
- void init(int n) {
- if (0 < n) {
- indexOffset[n] = indexOffset[n - 1] + indexCount[n - 1];
- vertexOffset[n] = vertexOffset[n - 1] + vertexCount[n - 1];
- } else {
- indexOffset[n] = 0;
- vertexOffset[n] = 0;
- }
- indexCount[n] = 0;
- vertexCount[n] = 0;
- }
-
- void arrayCheck() {
- if (size == indexCount.length) {
- int newSize = size << 1;
-
- expandIndexCount(newSize);
- expandIndexOffset(newSize);
- expandVertexCount(newSize);
- expandVertexOffset(newSize);
- }
- }
-
- void expandIndexCount(int n) {
- int[] temp = new int[n];
- PApplet.arrayCopy(indexCount, 0, temp, 0, size);
- indexCount = temp;
- }
-
- void expandIndexOffset(int n) {
- int[] temp = new int[n];
- PApplet.arrayCopy(indexOffset, 0, temp, 0, size);
- indexOffset = temp;
- }
-
- void expandVertexCount(int n) {
- int[] temp = new int[n];
- PApplet.arrayCopy(vertexCount, 0, temp, 0, size);
- vertexCount = temp;
- }
-
- void expandVertexOffset(int n) {
- int[] temp = new int[n];
- PApplet.arrayCopy(vertexOffset, 0, temp, 0, size);
- vertexOffset = temp;
- }
- }
-
-
- // Holds the input vertices: xyz coordinates, fill/tint color,
- // normal, texture coordinates and stroke color and weight.
- protected class InGeometry {
- int renderMode;
- int vertexCount;
- int edgeCount;
-
- // Range of vertices that will be processed by the
- // tessellator. They can be used in combination with the
- // edges array to have the tessellator using only a specific
- // range of vertices to generate fill geometry, while the
- // line geometry will be read from the edge vertices, which
- // could be completely different.
- int firstVertex;
- int lastVertex;
-
- int firstEdge;
- int lastEdge;
-
- float[] vertices;
- int[] colors;
- float[] normals;
- float[] texcoords;
- int[] strokeColors;
- float[] strokeWeights;
-
- // lines
- boolean[] breaks;
- int[][] edges;
-
- // Material properties
- int[] ambient;
- int[] specular;
- int[] emissive;
- float[] shininess;
-
- // Internally used by the addVertex() methods.
- int fillColor;
- int strokeColor;
- float strokeWeight;
- int ambientColor;
- int specularColor;
- int emissiveColor;
- float shininessFactor;
- float normalX, normalY, normalZ;
-
- InGeometry(int mode) {
- renderMode = mode;
- allocate();
- }
-
- // -----------------------------------------------------------------
- //
- // Allocate/dispose
-
- void clear() {
- vertexCount = firstVertex = lastVertex = 0;
- edgeCount = firstEdge = lastEdge = 0;
- }
-
- void clearEdges() {
- edgeCount = firstEdge = lastEdge = 0;
- }
-
- void allocate() {
- vertices = new float[3 * PGL.DEFAULT_IN_VERTICES];
- colors = new int[PGL.DEFAULT_IN_VERTICES];
- normals = new float[3 * PGL.DEFAULT_IN_VERTICES];
- texcoords = new float[2 * PGL.DEFAULT_IN_VERTICES];
- strokeColors = new int[PGL.DEFAULT_IN_VERTICES];
- strokeWeights = new float[PGL.DEFAULT_IN_VERTICES];
- ambient = new int[PGL.DEFAULT_IN_VERTICES];
- specular = new int[PGL.DEFAULT_IN_VERTICES];
- emissive = new int[PGL.DEFAULT_IN_VERTICES];
- shininess = new float[PGL.DEFAULT_IN_VERTICES];
- breaks = new boolean[PGL.DEFAULT_IN_VERTICES];
- edges = new int[PGL.DEFAULT_IN_EDGES][3];
-
- clear();
- }
-
- void vertexCheck() {
- if (vertexCount == vertices.length / 3) {
- int newSize = vertexCount << 1;
-
- expandVertices(newSize);
- expandColors(newSize);
- expandNormals(newSize);
- expandTexCoords(newSize);
- expandStrokeColors(newSize);
- expandStrokeWeights(newSize);
- expandAmbient(newSize);
- expandSpecular(newSize);
- expandEmissive(newSize);
- expandShininess(newSize);
- expandBreaks(newSize);
- }
- }
-
- void edgeCheck() {
- if (edgeCount == edges.length) {
- int newLen = edgeCount << 1;
-
- expandEdges(newLen);
- }
- }
-
- // -----------------------------------------------------------------
- //
- // Query
-
- float getVertexX(int idx) {
- return vertices[3 * idx + 0];
- }
-
- float getVertexY(int idx) {
- return vertices[3 * idx + 1];
- }
-
- float getVertexZ(int idx) {
- return vertices[3 * idx + 2];
- }
-
- float getLastVertexX() {
- return vertices[3 * (vertexCount - 1) + 0];
- }
-
- float getLastVertexY() {
- return vertices[3 * (vertexCount - 1) + 1];
- }
-
- float getLastVertexZ() {
- return vertices[3 * (vertexCount - 1) + 2];
- }
-
- int getNumEdgeVertices(boolean bevel) {
- int segVert = 4 * (lastEdge - firstEdge + 1);
- int bevVert = 0;
- if (bevel) {
- for (int i = firstEdge; i <= lastEdge; i++) {
- int[] edge = edges[i];
- if (edge[2] == EDGE_MIDDLE || edge[2] == EDGE_START) {
- bevVert++;
- }
- }
- }
- return segVert + bevVert;
- }
-
- int getNumEdgeIndices(boolean bevel) {
- int segInd = 6 * (lastEdge - firstEdge + 1);
- int bevInd = 0;
- if (bevel) {
- for (int i = firstEdge; i <= lastEdge; i++) {
- int[] edge = edges[i];
- if (edge[2] == EDGE_MIDDLE || edge[2] == EDGE_START) {
- bevInd += 6;
- }
- }
- }
- return segInd + bevInd;
- }
-
- void getVertexMin(PVector v) {
- int index;
- for (int i = 0; i < vertexCount; i++) {
- index = 4 * i;
- v.x = PApplet.min(v.x, vertices[index++]);
- v.y = PApplet.min(v.y, vertices[index++]);
- v.z = PApplet.min(v.z, vertices[index ]);
- }
- }
-
- void getVertexMax(PVector v) {
- int index;
- for (int i = 0; i < vertexCount; i++) {
- index = 4 * i;
- v.x = PApplet.max(v.x, vertices[index++]);
- v.y = PApplet.max(v.y, vertices[index++]);
- v.z = PApplet.max(v.z, vertices[index ]);
- }
- }
-
- int getVertexSum(PVector v) {
- int index;
- for (int i = 0; i < vertexCount; i++) {
- index = 4 * i;
- v.x += vertices[index++];
- v.y += vertices[index++];
- v.z += vertices[index ];
- }
- return vertexCount;
- }
-
- // -----------------------------------------------------------------
- //
- // Expand arrays
-
- void expandVertices(int n) {
- float temp[] = new float[3 * n];
- PApplet.arrayCopy(vertices, 0, temp, 0, 3 * vertexCount);
- vertices = temp;
- }
-
- void expandColors(int n) {
- int temp[] = new int[n];
- PApplet.arrayCopy(colors, 0, temp, 0, vertexCount);
- colors = temp;
- }
-
- void expandNormals(int n) {
- float temp[] = new float[3 * n];
- PApplet.arrayCopy(normals, 0, temp, 0, 3 * vertexCount);
- normals = temp;
- }
-
- void expandTexCoords(int n) {
- float temp[] = new float[2 * n];
- PApplet.arrayCopy(texcoords, 0, temp, 0, 2 * vertexCount);
- texcoords = temp;
- }
-
- void expandStrokeColors(int n) {
- int temp[] = new int[n];
- PApplet.arrayCopy(strokeColors, 0, temp, 0, vertexCount);
- strokeColors = temp;
- }
-
- void expandStrokeWeights(int n) {
- float temp[] = new float[n];
- PApplet.arrayCopy(strokeWeights, 0, temp, 0, vertexCount);
- strokeWeights = temp;
- }
-
- void expandAmbient(int n) {
- int temp[] = new int[n];
- PApplet.arrayCopy(ambient, 0, temp, 0, vertexCount);
- ambient = temp;
- }
-
- void expandSpecular(int n) {
- int temp[] = new int[n];
- PApplet.arrayCopy(specular, 0, temp, 0, vertexCount);
- specular = temp;
- }
-
- void expandEmissive(int n) {
- int temp[] = new int[n];
- PApplet.arrayCopy(emissive, 0, temp, 0, vertexCount);
- emissive = temp;
- }
-
- void expandShininess(int n) {
- float temp[] = new float[n];
- PApplet.arrayCopy(shininess, 0, temp, 0, vertexCount);
- shininess = temp;
- }
-
- void expandBreaks(int n) {
- boolean temp[] = new boolean[n];
- PApplet.arrayCopy(breaks, 0, temp, 0, vertexCount);
- breaks = temp;
- }
-
- void expandEdges(int n) {
- int temp[][] = new int[n][3];
- PApplet.arrayCopy(edges, 0, temp, 0, edgeCount);
- edges = temp;
- }
-
- // -----------------------------------------------------------------
- //
- // Trim arrays
-
- void trim() {
- if (0 < vertexCount && vertexCount < vertices.length / 3) {
- trimVertices();
- trimColors();
- trimNormals();
- trimTexCoords();
- trimStrokeColors();
- trimStrokeWeights();
- trimAmbient();
- trimSpecular();
- trimEmissive();
- trimShininess();
- trimBreaks();
- }
-
- if (0 < edgeCount && edgeCount < edges.length) {
- trimEdges();
- }
- }
-
- void trimVertices() {
- float temp[] = new float[3 * vertexCount];
- PApplet.arrayCopy(vertices, 0, temp, 0, 3 * vertexCount);
- vertices = temp;
- }
-
- void trimColors() {
- int temp[] = new int[vertexCount];
- PApplet.arrayCopy(colors, 0, temp, 0, vertexCount);
- colors = temp;
- }
-
- void trimNormals() {
- float temp[] = new float[3 * vertexCount];
- PApplet.arrayCopy(normals, 0, temp, 0, 3 * vertexCount);
- normals = temp;
- }
-
- void trimTexCoords() {
- float temp[] = new float[2 * vertexCount];
- PApplet.arrayCopy(texcoords, 0, temp, 0, 2 * vertexCount);
- texcoords = temp;
- }
-
- void trimStrokeColors() {
- int temp[] = new int[vertexCount];
- PApplet.arrayCopy(strokeColors, 0, temp, 0, vertexCount);
- strokeColors = temp;
- }
-
- void trimStrokeWeights() {
- float temp[] = new float[vertexCount];
- PApplet.arrayCopy(strokeWeights, 0, temp, 0, vertexCount);
- strokeWeights = temp;
- }
-
- void trimAmbient() {
- int temp[] = new int[vertexCount];
- PApplet.arrayCopy(ambient, 0, temp, 0, vertexCount);
- ambient = temp;
- }
-
- void trimSpecular() {
- int temp[] = new int[vertexCount];
- PApplet.arrayCopy(specular, 0, temp, 0, vertexCount);
- specular = temp;
- }
-
- void trimEmissive() {
- int temp[] = new int[vertexCount];
- PApplet.arrayCopy(emissive, 0, temp, 0, vertexCount);
- emissive = temp;
- }
-
- void trimShininess() {
- float temp[] = new float[vertexCount];
- PApplet.arrayCopy(shininess, 0, temp, 0, vertexCount);
- shininess = temp;
- }
-
- void trimBreaks() {
- boolean temp[] = new boolean[vertexCount];
- PApplet.arrayCopy(breaks, 0, temp, 0, vertexCount);
- breaks = temp;
- }
-
- void trimEdges() {
- int temp[][] = new int[edgeCount][3];
- PApplet.arrayCopy(edges, 0, temp, 0, edgeCount);
- edges = temp;
- }
-
- // -----------------------------------------------------------------
- //
- // Vertices
-
- int addVertex(float x, float y,
- int code) {
- return addVertex(x, y, 0,
- fillColor,
- normalX, normalY, normalZ,
- 0, 0,
- strokeColor, strokeWeight,
- ambientColor, specularColor, emissiveColor,
- shininessFactor,
- code);
- }
-
- int addVertex(float x, float y,
- float u, float v,
- int code) {
- return addVertex(x, y, 0,
- fillColor,
- normalX, normalY, normalZ,
- u, v,
- strokeColor, strokeWeight,
- ambientColor, specularColor, emissiveColor,
- shininessFactor,
- code);
- }
-
- int addVertex(float x, float y, float z,
- int code) {
- return addVertex(x, y, z,
- fillColor,
- normalX, normalY, normalZ,
- 0, 0,
- strokeColor, strokeWeight,
- ambientColor, specularColor, emissiveColor,
- shininessFactor,
- code);
- }
-
- int addVertex(float x, float y, float z,
- float u, float v,
- int code) {
- return addVertex(x, y, z,
- fillColor,
- normalX, normalY, normalZ,
- u, v,
- strokeColor, strokeWeight,
- ambientColor, specularColor, emissiveColor,
- shininessFactor,
- code);
- }
-
- int addVertex(float x, float y, float z,
- int fcolor,
- float nx, float ny, float nz,
- float u, float v,
- int scolor, float sweight,
- int am, int sp, int em, float shine,
- int code) {
- vertexCheck();
- int index;
-
- curveVertexCount = 0;
-
- index = 3 * vertexCount;
- vertices[index++] = x;
- vertices[index++] = y;
- vertices[index ] = z;
-
- colors[vertexCount] = PGL.javaToNativeARGB(fcolor);
-
- index = 3 * vertexCount;
- normals[index++] = nx;
- normals[index++] = ny;
- normals[index ] = nz;
-
- index = 2 * vertexCount;
- texcoords[index++] = u;
- texcoords[index ] = v;
-
- strokeColors[vertexCount] = PGL.javaToNativeARGB(scolor);
- strokeWeights[vertexCount] = sweight;
-
- ambient[vertexCount] = PGL.javaToNativeARGB(am);
- specular[vertexCount] = PGL.javaToNativeARGB(sp);
- emissive[vertexCount] = PGL.javaToNativeARGB(em);
- shininess[vertexCount] = shine;
-
- breaks[vertexCount] = code == BREAK;
-
- lastVertex = vertexCount;
- vertexCount++;
-
- return lastVertex;
- }
-
- void addBezierVertex(float x2, float y2, float z2,
- float x3, float y3, float z3,
- float x4, float y4, float z4,
- boolean fill, boolean stroke, int detail, int code) {
- addBezierVertex(x2, y2, z2,
- x3, y3, z3,
- x4, y4, z4,
- fill, stroke, detail, code, POLYGON);
- }
-
- void addBezierVertex(float x2, float y2, float z2,
- float x3, float y3, float z3,
- float x4, float y4, float z4,
- boolean fill, boolean stroke, int detail, int code,
- int shape) {
- bezierInitCheck();
- bezierVertexCheck(shape, vertexCount);
-
- PMatrix3D draw = bezierDrawMatrix;
-
- float x1 = getLastVertexX();
- float y1 = getLastVertexY();
- float z1 = getLastVertexZ();
-
- float xplot1 = draw.m10*x1 + draw.m11*x2 + draw.m12*x3 + draw.m13*x4;
- float xplot2 = draw.m20*x1 + draw.m21*x2 + draw.m22*x3 + draw.m23*x4;
- float xplot3 = draw.m30*x1 + draw.m31*x2 + draw.m32*x3 + draw.m33*x4;
-
- float yplot1 = draw.m10*y1 + draw.m11*y2 + draw.m12*y3 + draw.m13*y4;
- float yplot2 = draw.m20*y1 + draw.m21*y2 + draw.m22*y3 + draw.m23*y4;
- float yplot3 = draw.m30*y1 + draw.m31*y2 + draw.m32*y3 + draw.m33*y4;
-
- float zplot1 = draw.m10*z1 + draw.m11*z2 + draw.m12*z3 + draw.m13*z4;
- float zplot2 = draw.m20*z1 + draw.m21*z2 + draw.m22*z3 + draw.m23*z4;
- float zplot3 = draw.m30*z1 + draw.m31*z2 + draw.m32*z3 + draw.m33*z4;
-
- for (int j = 0; j < detail; j++) {
- x1 += xplot1; xplot1 += xplot2; xplot2 += xplot3;
- y1 += yplot1; yplot1 += yplot2; yplot2 += yplot3;
- z1 += zplot1; zplot1 += zplot2; zplot2 += zplot3;
- addVertex(x1, y1, z1, j == 0 && code == BREAK ? BREAK : VERTEX);
- }
- }
-
- public void addQuadraticVertex(float cx, float cy, float cz,
- float x3, float y3, float z3,
- boolean fill, boolean stroke, int detail,
- int code) {
- addQuadraticVertex(cx, cy, cz,
- x3, y3, z3,
- fill, stroke, detail, code, POLYGON);
- }
-
- public void addQuadraticVertex(float cx, float cy, float cz,
- float x3, float y3, float z3,
- boolean fill, boolean stroke, int detail,
- int code, int shape) {
- float x1 = getLastVertexX();
- float y1 = getLastVertexY();
- float z1 = getLastVertexZ();
- addBezierVertex(
- x1 + ((cx-x1)*2/3.0f), y1 + ((cy-y1)*2/3.0f), z1 + ((cz-z1)*2/3.0f),
- x3 + ((cx-x3)*2/3.0f), y3 + ((cy-y3)*2/3.0f), z3 + ((cz-z3)*2/3.0f),
- x3, y3, z3,
- fill, stroke, detail, code, shape);
- }
-
- void addCurveVertex(float x, float y, float z,
- boolean fill, boolean stroke, int detail, int code) {
- addCurveVertex(x, y, z,
- fill, stroke, detail, code, POLYGON);
- }
-
- void addCurveVertex(float x, float y, float z,
- boolean fill, boolean stroke, int detail, int code,
- int shape) {
- curveVertexCheck(shape);
-
- float[] vertex = curveVertices[curveVertexCount];
- vertex[X] = x;
- vertex[Y] = y;
- vertex[Z] = z;
- curveVertexCount++;
-
- // draw a segment if there are enough points
- if (curveVertexCount > 3) {
- float[] v1 = curveVertices[curveVertexCount-4];
- float[] v2 = curveVertices[curveVertexCount-3];
- float[] v3 = curveVertices[curveVertexCount-2];
- float[] v4 = curveVertices[curveVertexCount-1];
- addCurveVertexSegment(v1[X], v1[Y], v1[Z],
- v2[X], v2[Y], v2[Z],
- v3[X], v3[Y], v3[Z],
- v4[X], v4[Y], v4[Z],
- detail, code);
- }
- }
-
- void addCurveVertexSegment(float x1, float y1, float z1,
- float x2, float y2, float z2,
- float x3, float y3, float z3,
- float x4, float y4, float z4,
- int detail, int code) {
- float x0 = x2;
- float y0 = y2;
- float z0 = z2;
-
- PMatrix3D draw = curveDrawMatrix;
-
- float xplot1 = draw.m10*x1 + draw.m11*x2 + draw.m12*x3 + draw.m13*x4;
- float xplot2 = draw.m20*x1 + draw.m21*x2 + draw.m22*x3 + draw.m23*x4;
- float xplot3 = draw.m30*x1 + draw.m31*x2 + draw.m32*x3 + draw.m33*x4;
-
- float yplot1 = draw.m10*y1 + draw.m11*y2 + draw.m12*y3 + draw.m13*y4;
- float yplot2 = draw.m20*y1 + draw.m21*y2 + draw.m22*y3 + draw.m23*y4;
- float yplot3 = draw.m30*y1 + draw.m31*y2 + draw.m32*y3 + draw.m33*y4;
-
- float zplot1 = draw.m10*z1 + draw.m11*z2 + draw.m12*z3 + draw.m13*z4;
- float zplot2 = draw.m20*z1 + draw.m21*z2 + draw.m22*z3 + draw.m23*z4;
- float zplot3 = draw.m30*z1 + draw.m31*z2 + draw.m32*z3 + draw.m33*z4;
-
- // addVertex() will reset curveVertexCount, so save it
- int savedCount = curveVertexCount;
-
- addVertex(x0, y0, z0, code == BREAK ? BREAK : VERTEX);
- for (int j = 0; j < detail; j++) {
- x0 += xplot1; xplot1 += xplot2; xplot2 += xplot3;
- y0 += yplot1; yplot1 += yplot2; yplot2 += yplot3;
- z0 += zplot1; zplot1 += zplot2; zplot2 += zplot3;
- addVertex(x0, y0, z0, VERTEX);
- }
-
- curveVertexCount = savedCount;
- }
-
- // Returns the vertex data in the PGraphics double array format.
- float[][] getVertexData() {
- float[][] data = new float[vertexCount][VERTEX_FIELD_COUNT];
- for (int i = 0; i < vertexCount; i++) {
- float[] vert = data[i];
-
- vert[X] = vertices[3 * i + 0];
- vert[Y] = vertices[3 * i + 1];
- vert[Z] = vertices[3 * i + 2];
-
- vert[R] = ((colors[i] >> 16) & 0xFF) / 255.0f;
- vert[G] = ((colors[i] >> 8) & 0xFF) / 255.0f;
- vert[B] = ((colors[i] >> 0) & 0xFF) / 255.0f;
- vert[A] = ((colors[i] >> 24) & 0xFF) / 255.0f;
-
- vert[U] = texcoords[2 * i + 0];
- vert[V] = texcoords[2 * i + 1];
-
- vert[NX] = normals[3 * i + 0];
- vert[NY] = normals[3 * i + 1];
- vert[NZ] = normals[3 * i + 2];
-
- vert[SR] = ((strokeColors[i] >> 16) & 0xFF) / 255.0f;
- vert[SG] = ((strokeColors[i] >> 8) & 0xFF) / 255.0f;
- vert[SB] = ((strokeColors[i] >> 0) & 0xFF) / 255.0f;
- vert[SA] = ((strokeColors[i] >> 24) & 0xFF) / 255.0f;
-
- vert[SW] = strokeWeights[i];
-
- /*
- // Android doesn't have these:
- vert[AR] = ((ambient[i] >> 16) & 0xFF) / 255.0f;
- vert[AG] = ((ambient[i] >> 8) & 0xFF) / 255.0f;
- vert[AB] = ((ambient[i] >> 0) & 0xFF) / 255.0f;
-
- vert[SPR] = ((specular[i] >> 16) & 0xFF) / 255.0f;
- vert[SPG] = ((specular[i] >> 8) & 0xFF) / 255.0f;
- vert[SPB] = ((specular[i] >> 0) & 0xFF) / 255.0f;
-
- vert[ER] = ((emissive[i] >> 16) & 0xFF) / 255.0f;
- vert[EG] = ((emissive[i] >> 8) & 0xFF) / 255.0f;
- vert[EB] = ((emissive[i] >> 0) & 0xFF) / 255.0f;
-
- vert[SHINE] = shininess[i];
- */
-
- }
-
- return data;
- }
-
- // -----------------------------------------------------------------
- //
- // Edges
-
- int addEdge(int i, int j, boolean start, boolean end) {
- edgeCheck();
-
- int[] edge = edges[edgeCount];
- edge[0] = i;
- edge[1] = j;
-
- // Possible values for state:
- // 0 = middle edge (not start, not end)
- // 1 = start edge (start, not end)
- // 2 = end edge (not start, end)
- // 3 = isolated edge (start, end)
- edge[2] = (start ? 1 : 0) + 2 * (end ? 1 : 0);
-
- lastEdge = edgeCount;
- edgeCount++;
-
- return lastEdge;
- }
-
- void addTrianglesEdges() {
- for (int i = 0; i < (lastVertex - firstVertex + 1) / 3; i++) {
- int i0 = 3 * i + 0;
- int i1 = 3 * i + 1;
- int i2 = 3 * i + 2;
-
- addEdge(i0, i1, true, false);
- addEdge(i1, i2, false, false);
- addEdge(i2, i0, false, true);
- }
- }
-
- void addTriangleFanEdges() {
- for (int i = firstVertex + 1; i < lastVertex; i++) {
- int i0 = firstVertex;
- int i1 = i;
- int i2 = i + 1;
-
- addEdge(i0, i1, true, false);
- addEdge(i1, i2, false, false);
- addEdge(i2, i0, false, true);
- }
- }
-
- void addTriangleStripEdges() {
- for (int i = firstVertex + 1; i < lastVertex; i++) {
- int i0 = i;
- int i1, i2;
- if (i % 2 == 0) {
- i1 = i - 1;
- i2 = i + 1;
- } else {
- i1 = i + 1;
- i2 = i - 1;
- }
-
- addEdge(i0, i1, true, false);
- addEdge(i1, i2, false, false);
- addEdge(i2, i0, false, true);
- }
- }
-
- void addQuadsEdges() {
- for (int i = 0; i < (lastVertex - firstVertex + 1) / 4; i++) {
- int i0 = 4 * i + 0;
- int i1 = 4 * i + 1;
- int i2 = 4 * i + 2;
- int i3 = 4 * i + 3;
-
- addEdge(i0, i1, true, false);
- addEdge(i1, i2, false, false);
- addEdge(i2, i3, false, false);
- addEdge(i3, i0, false, true);
- }
- }
-
- void addQuadStripEdges() {
- for (int qd = 1; qd < (lastVertex - firstVertex + 1) / 2; qd++) {
- int i0 = firstVertex + 2 * (qd - 1);
- int i1 = firstVertex + 2 * (qd - 1) + 1;
- int i2 = firstVertex + 2 * qd + 1;
- int i3 = firstVertex + 2 * qd;
-
- addEdge(i0, i1, true, false);
- addEdge(i1, i2, false, false);
- addEdge(i2, i3, false, false);
- addEdge(i3, i0, false, true);
- }
- }
-
- void addPolygonEdges(boolean closed) {
- int start = firstVertex;
- boolean begin = true;
- for (int i = firstVertex + 1; i <= lastVertex; i++) {
- if (breaks[i]) {
- if (closed) {
- // Closing previous contour.
- addEdge(i - 1, start, begin, true);
- }
-
- // Starting new contour.
- start = i;
- begin = true;
- } else {
- if (i == lastVertex) {
- if (closed && start + 1 < i) {
- // Closing the end of the last contour, if it
- // has more than 1 segment.
- addEdge(i - 1, i, begin, false);
- addEdge(i, start, false, true);
- } else {
- // Leaving the last contour open.
- addEdge(i - 1, i, begin, true);
- }
- } else {
-
- if (i < lastVertex && breaks[i + 1] && !closed) {
- // A new contour starts at the next vertex and
- // the polygon is not closed, so this is the last
- // segment of the current contour.
- addEdge(i - 1, i, begin, true);
- } else {
- // The current contour does not end at vertex i.
- addEdge(i - 1, i, begin, false);
- }
- }
-
- begin = false;
- }
- }
- }
-
- // -----------------------------------------------------------------
- //
- // Normal calculation
-
- void calcTriangleNormal(int i0, int i1, int i2) {
- int index;
-
- index = 3 * i0;
- float x0 = vertices[index++];
- float y0 = vertices[index++];
- float z0 = vertices[index ];
-
- index = 3 * i1;
- float x1 = vertices[index++];
- float y1 = vertices[index++];
- float z1 = vertices[index ];
-
- index = 3 * i2;
- float x2 = vertices[index++];
- float y2 = vertices[index++];
- float z2 = vertices[index ];
-
- float v12x = x2 - x1;
- float v12y = y2 - y1;
- float v12z = z2 - z1;
-
- float v10x = x0 - x1;
- float v10y = y0 - y1;
- float v10z = z0 - z1;
-
- // The automatic normal calculation in Processing assumes
- // that vertices as given in CCW order so:
- // n = v12 x v10
- // so that the normal outwards.
- float nx = v12y * v10z - v10y * v12z;
- float ny = v12z * v10x - v10z * v12x;
- float nz = v12x * v10y - v10x * v12y;
- float d = PApplet.sqrt(nx * nx + ny * ny + nz * nz);
- nx /= d;
- ny /= d;
- nz /= d;
-
- index = 3 * i0;
- normals[index++] = nx;
- normals[index++] = ny;
- normals[index ] = nz;
-
- index = 3 * i1;
- normals[index++] = nx;
- normals[index++] = ny;
- normals[index ] = nz;
-
- index = 3 * i2;
- normals[index++] = nx;
- normals[index++] = ny;
- normals[index ] = nz;
- }
-
- void calcTrianglesNormals() {
- for (int i = 0; i < (lastVertex - firstVertex + 1) / 3; i++) {
- int i0 = 3 * i + 0;
- int i1 = 3 * i + 1;
- int i2 = 3 * i + 2;
-
- calcTriangleNormal(i0, i1, i2);
- }
- }
-
- void calcTriangleFanNormals() {
- for (int i = firstVertex + 1; i < lastVertex; i++) {
- int i0 = firstVertex;
- int i1 = i;
- int i2 = i + 1;
-
- calcTriangleNormal(i0, i1, i2);
- }
- }
-
- void calcTriangleStripNormals() {
- for (int i = firstVertex + 1; i < lastVertex; i++) {
- int i1 = i;
- int i0, i2;
- if (i % 2 == 0) {
- // The even triangles (0, 2, 4...) should be CW
- i0 = i + 1;
- i2 = i - 1;
- } else {
- // The even triangles (1, 3, 5...) should be CCW
- i0 = i - 1;
- i2 = i + 1;
- }
- calcTriangleNormal(i0, i1, i2);
- }
- }
-
- void calcQuadsNormals() {
- for (int i = 0; i < (lastVertex - firstVertex + 1) / 4; i++) {
- int i0 = 4 * i + 0;
- int i1 = 4 * i + 1;
- int i2 = 4 * i + 2;
- int i3 = 4 * i + 3;
-
- calcTriangleNormal(i0, i1, i2);
- calcTriangleNormal(i2, i3, i0);
- }
- }
-
- void calcQuadStripNormals() {
- for (int qd = 1; qd < (lastVertex - firstVertex + 1) / 2; qd++) {
- int i0 = firstVertex + 2 * (qd - 1);
- int i1 = firstVertex + 2 * (qd - 1) + 1;
- int i2 = firstVertex + 2 * qd;
- int i3 = firstVertex + 2 * qd + 1;
-
- calcTriangleNormal(i0, i3, i1);
- calcTriangleNormal(i0, i2, i3);
- }
- }
-
- // -----------------------------------------------------------------
- //
- // Primitives
-
- void setMaterial(int fillColor, int strokeColor, float strokeWeight,
- int ambientColor, int specularColor, int emissiveColor,
- float shininessFactor) {
- this.fillColor = fillColor;
- this.strokeColor = strokeColor;
- this.strokeWeight = strokeWeight;
- this.ambientColor = ambientColor;
- this.specularColor = specularColor;
- this.emissiveColor = emissiveColor;
- this.shininessFactor = shininessFactor;
- }
-
- void setNormal(float normalX, float normalY, float normalZ) {
- this.normalX = normalX;
- this.normalY = normalY;
- this.normalZ = normalZ;
- }
-
- void addPoint(float x, float y, float z, boolean fill, boolean stroke) {
- addVertex(x, y, z, VERTEX);
- }
-
- void addLine(float x1, float y1, float z1,
- float x2, float y2, float z2,
- boolean fill, boolean stroke) {
- int idx1 = addVertex(x1, y1, z1, VERTEX);
- int idx2 = addVertex(x2, y2, z2, VERTEX);
- if (stroke) addEdge(idx1, idx2, true, true);
- }
-
- void addTriangle(float x1, float y1, float z1,
- float x2, float y2, float z2,
- float x3, float y3, float z3,
- boolean fill, boolean stroke) {
- int idx1 = addVertex(x1, y1, z1, VERTEX);
- int idx2 = addVertex(x2, y2, z2, VERTEX);
- int idx3 = addVertex(x3, y3, z3, VERTEX);
- if (stroke) {
- addEdge(idx1, idx2, true, false);
- addEdge(idx2, idx3, false, false);
- addEdge(idx3, idx1, false, true);
- }
- }
-
- void addQuad(float x1, float y1, float z1,
- float x2, float y2, float z2,
- float x3, float y3, float z3,
- float x4, float y4, float z4,
- boolean fill, boolean stroke) {
- int idx1 = addVertex(x1, y1, z1, 0, 0, VERTEX);
- int idx2 = addVertex(x2, y2, z2, 1, 0, VERTEX);
- int idx3 = addVertex(x3, y3, z3, 1, 1, VERTEX);
- int idx4 = addVertex(x4, y4, z4, 0, 1, VERTEX);
- if (stroke) {
- addEdge(idx1, idx2, true, false);
- addEdge(idx2, idx3, false, false);
- addEdge(idx3, idx4, false, false);
- addEdge(idx4, idx1, false, true);
- }
- }
-
- void addRect(float a, float b, float c, float d,
- boolean fill, boolean stroke, int rectMode) {
- float hradius, vradius;
- switch (rectMode) {
- case CORNERS:
- break;
- case CORNER:
- c += a; d += b;
- break;
- case RADIUS:
- hradius = c;
- vradius = d;
- c = a + hradius;
- d = b + vradius;
- a -= hradius;
- b -= vradius;
- break;
- case CENTER:
- hradius = c / 2.0f;
- vradius = d / 2.0f;
- c = a + hradius;
- d = b + vradius;
- a -= hradius;
- b -= vradius;
- }
-
- if (a > c) {
- float temp = a; a = c; c = temp;
- }
-
- if (b > d) {
- float temp = b; b = d; d = temp;
- }
-
- addQuad(a, b, 0,
- c, b, 0,
- c, d, 0,
- a, d, 0,
- fill, stroke);
- }
-
- void addRect(float a, float b, float c, float d,
- float tl, float tr, float br, float bl,
- boolean fill, boolean stroke, int detail, int rectMode) {
- float hradius, vradius;
- switch (rectMode) {
- case CORNERS:
- break;
- case CORNER:
- c += a; d += b;
- break;
- case RADIUS:
- hradius = c;
- vradius = d;
- c = a + hradius;
- d = b + vradius;
- a -= hradius;
- b -= vradius;
- break;
- case CENTER:
- hradius = c / 2.0f;
- vradius = d / 2.0f;
- c = a + hradius;
- d = b + vradius;
- a -= hradius;
- b -= vradius;
- }
-
- if (a > c) {
- float temp = a; a = c; c = temp;
- }
-
- if (b > d) {
- float temp = b; b = d; d = temp;
- }
-
- float maxRounding = PApplet.min((c - a) / 2, (d - b) / 2);
- if (tl > maxRounding) tl = maxRounding;
- if (tr > maxRounding) tr = maxRounding;
- if (br > maxRounding) br = maxRounding;
- if (bl > maxRounding) bl = maxRounding;
-
- if (nonZero(tr)) {
- addVertex(c-tr, b, VERTEX);
- addQuadraticVertex(c, b, 0, c, b+tr, 0,
- fill, stroke, detail, VERTEX);
- } else {
- addVertex(c, b, VERTEX);
- }
- if (nonZero(br)) {
- addVertex(c, d-br, VERTEX);
- addQuadraticVertex(c, d, 0, c-br, d, 0,
- fill, stroke, detail, VERTEX);
- } else {
- addVertex(c, d, VERTEX);
- }
- if (nonZero(bl)) {
- addVertex(a+bl, d, VERTEX);
- addQuadraticVertex(a, d, 0, a, d-bl, 0,
- fill, stroke, detail, VERTEX);
- } else {
- addVertex(a, d, VERTEX);
- }
- if (nonZero(tl)) {
- addVertex(a, b+tl, VERTEX);
- addQuadraticVertex(a, b, 0, a+tl, b, 0,
- fill, stroke, detail, VERTEX);
- } else {
- addVertex(a, b, VERTEX);
- }
-
- if (stroke) addPolygonEdges(true);
- }
-
- void addEllipse(float a, float b, float c, float d,
- boolean fill, boolean stroke, int ellipseMode) {
- float x = a;
- float y = b;
- float w = c;
- float h = d;
-
- if (ellipseMode == CORNERS) {
- w = c - a;
- h = d - b;
-
- } else if (ellipseMode == RADIUS) {
- x = a - c;
- y = b - d;
- w = c * 2;
- h = d * 2;
-
- } else if (ellipseMode == DIAMETER) {
- x = a - c/2f;
- y = b - d/2f;
- }
-
- if (w < 0) { // undo negative width
- x += w;
- w = -w;
- }
-
- if (h < 0) { // undo negative height
- y += h;
- h = -h;
- }
-
- float radiusH = w / 2;
- float radiusV = h / 2;
-
- float centerX = x + radiusH;
- float centerY = y + radiusV;
-
- // should call screenX/Y using current renderer.
- float sx1 = pgCurrent.screenX(x, y);
- float sy1 = pgCurrent.screenY(x, y);
- float sx2 = pgCurrent.screenX(x + w, y + h);
- float sy2 = pgCurrent.screenY(x + w, y + h);
-
- int accuracy =
- PApplet.max(MIN_POINT_ACCURACY,
- (int) (TWO_PI * PApplet.dist(sx1, sy1, sx2, sy2) /
- POINT_ACCURACY_FACTOR));
- float inc = (float) SINCOS_LENGTH / accuracy;
-
- if (fill) {
- addVertex(centerX, centerY, VERTEX);
- }
- int idx0, pidx, idx;
- idx0 = pidx = idx = 0;
- float val = 0;
- for (int i = 0; i < accuracy; i++) {
- idx = addVertex(centerX + cosLUT[(int) val] * radiusH,
- centerY + sinLUT[(int) val] * radiusV,
- VERTEX);
- val = (val + inc) % SINCOS_LENGTH;
-
- if (0 < i) {
- if (stroke) addEdge(pidx, idx, i == 1, false);
- } else {
- idx0 = idx;
- }
-
- pidx = idx;
- }
- // Back to the beginning
- addVertex(centerX + cosLUT[0] * radiusH,
- centerY + sinLUT[0] * radiusV,
- VERTEX);
- if (stroke) addEdge(idx, idx0, false, true);
- }
-
- // arcMode can be 0, OPEN, CHORD, or PIE
- void addArc(float x, float y, float w, float h,
- float start, float stop,
- boolean fill, boolean stroke, int arcMode) {
- float hr = w / 2f;
- float vr = h / 2f;
-
- float centerX = x + hr;
- float centerY = y + vr;
-
- int startLUT = (int) (0.5f + (start / TWO_PI) * SINCOS_LENGTH);
- int stopLUT = (int) (0.5f + (stop / TWO_PI) * SINCOS_LENGTH);
-
- if (fill) {
- addVertex(centerX, centerY, VERTEX);
- }
-
- int increment = 1; // what's a good algorithm? stopLUT - startLUT;
- int pidx, idx;
- pidx = idx = 0;
- for (int i = startLUT; i < stopLUT; i += increment) {
- int ii = i % SINCOS_LENGTH;
- // modulo won't make the value positive
- if (ii < 0) ii += SINCOS_LENGTH;
- idx = addVertex(centerX + cosLUT[ii] * hr,
- centerY + sinLUT[ii] * vr,
- VERTEX);
-
- if (stroke) {
- if (arcMode == PIE) {
- addEdge(pidx, idx, i == startLUT, false);
- } else if (startLUT < i) {
- addEdge(pidx, idx, i == startLUT + 1, arcMode == 0 &&
- i == stopLUT - 1);
- }
- }
-
- pidx = idx;
- }
- // draw last point explicitly for accuracy
- idx = addVertex(centerX + cosLUT[stopLUT % SINCOS_LENGTH] * hr,
- centerY + sinLUT[stopLUT % SINCOS_LENGTH] * vr,
- VERTEX);
- if (stroke) {
- if (arcMode == PIE) {
- addEdge(idx, 0, false, true);
- }
- }
- if (arcMode == CHORD || arcMode == OPEN) {
- // Add a last vertex coincident with the first along the perimeter
- pidx = idx;
- int i = startLUT;
- int ii = i % SINCOS_LENGTH;
- if (ii < 0) ii += SINCOS_LENGTH;
- idx = addVertex(centerX + cosLUT[ii] * hr,
- centerY + sinLUT[ii] * vr,
- VERTEX);
- if (stroke && arcMode == CHORD) {
- addEdge(pidx, idx, false, true);
- }
- }
- }
-
- void addBox(float w, float h, float d,
- boolean fill, boolean stroke) {
- float x1 = -w/2f; float x2 = w/2f;
- float y1 = -h/2f; float y2 = h/2f;
- float z1 = -d/2f; float z2 = d/2f;
-
- if (fill || stroke) {
- // front face
- setNormal(0, 0, 1);
- addVertex(x1, y1, z1, 0, 0, VERTEX);
- addVertex(x2, y1, z1, 1, 0, VERTEX);
- addVertex(x2, y2, z1, 1, 1, VERTEX);
- addVertex(x1, y2, z1, 0, 1, VERTEX);
-
- // right face
- setNormal(1, 0, 0);
- addVertex(x2, y1, z1, 0, 0, VERTEX);
- addVertex(x2, y1, z2, 1, 0, VERTEX);
- addVertex(x2, y2, z2, 1, 1, VERTEX);
- addVertex(x2, y2, z1, 0, 1, VERTEX);
-
- // back face
- setNormal(0, 0, -1);
- addVertex(x2, y1, z2, 0, 0, VERTEX);
- addVertex(x1, y1, z2, 1, 0, VERTEX);
- addVertex(x1, y2, z2, 1, 1, VERTEX);
- addVertex(x2, y2, z2, 0, 1, VERTEX);
-
- // left face
- setNormal(-1, 0, 0);
- addVertex(x1, y1, z2, 0, 0, VERTEX);
- addVertex(x1, y1, z1, 1, 0, VERTEX);
- addVertex(x1, y2, z1, 1, 1, VERTEX);
- addVertex(x1, y2, z2, 0, 1, VERTEX);
-
- // top face
- setNormal(0, 1, 0);
- addVertex(x1, y1, z2, 0, 0, VERTEX);
- addVertex(x2, y1, z2, 1, 0, VERTEX);
- addVertex(x2, y1, z1, 1, 1, VERTEX);
- addVertex(x1, y1, z1, 0, 1, VERTEX);
-
- // bottom face
- setNormal(0, -1, 0);
- addVertex(x1, y2, z1, 0, 0, VERTEX);
- addVertex(x2, y2, z1, 1, 0, VERTEX);
- addVertex(x2, y2, z2, 1, 1, VERTEX);
- addVertex(x1, y2, z2, 0, 1, VERTEX);
- }
-
- if (stroke) {
- addEdge(0, 1, true, true);
- addEdge(1, 2, true, true);
- addEdge(2, 3, true, true);
- addEdge(3, 0, true, true);
-
- addEdge(0, 9, true, true);
- addEdge(1, 8, true, true);
- addEdge(2, 11, true, true);
- addEdge(3, 10, true, true);
-
- addEdge( 8, 9, true, true);
- addEdge( 9, 10, true, true);
- addEdge(10, 11, true, true);
- addEdge(11, 8, true, true);
- }
- }
-
- // Adds the vertices that define an sphere, without duplicating
- // any vertex or edge.
- int[] addSphere(float r, int detailU, int detailV,
- boolean fill, boolean stroke) {
- if ((detailU < 3) || (detailV < 2)) {
- sphereDetail(30);
- detailU = detailV = 30;
- } else {
- sphereDetail(detailU, detailV);
- }
-
- int nind = 3 * detailU + (6 * detailU + 3) * (detailV - 2) + 3 * detailU;
- int[] indices = new int[nind];
-
- int vertCount = 0;
- int indCount = 0;
- int vert0, vert1;
-
- float u, v;
- float du = 1.0f / (detailU);
- float dv = 1.0f / (detailV);
-
- // Southern cap -------------------------------------------------------
-
- // Adding multiple copies of the south pole vertex, each one with a
- // different u coordinate, so the texture mapping is correct when
- // making the first strip of triangles.
- u = 1; v = 1;
- for (int i = 0; i < detailU; i++) {
- setNormal(0, 1, 0);
- addVertex(0, r, 0, u , v, VERTEX);
- u -= du;
- }
- vertCount = detailU;
- vert0 = vertCount;
- u = 1; v -= dv;
- for (int i = 0; i < detailU; i++) {
- setNormal(sphereX[i], sphereY[i], sphereZ[i]);
- addVertex(r * sphereX[i], r *sphereY[i], r * sphereZ[i], u , v, VERTEX);
- u -= du;
- }
- vertCount += detailU;
- vert1 = vertCount;
- setNormal(sphereX[0], sphereY[0], sphereZ[0]);
- addVertex(r * sphereX[0], r * sphereY[0], r * sphereZ[0], u, v, VERTEX);
- vertCount++;
-
- for (int i = 0; i < detailU; i++) {
- int i1 = vert0 + i;
- int i0 = vert0 + i - detailU;
-
- indices[3 * i + 0] = i1;
- indices[3 * i + 1] = i0;
- indices[3 * i + 2] = i1 + 1;
-
- addEdge(i0, i1, true, true);
- addEdge(i1, i1 + 1, true, true);
- }
- indCount += 3 * detailU;
-
- // Middle rings -------------------------------------------------------
-
- int offset = 0;
- for (int j = 2; j < detailV; j++) {
- offset += detailU;
- vert0 = vertCount;
- u = 1; v -= dv;
- for (int i = 0; i < detailU; i++) {
- int ioff = offset + i;
- setNormal(sphereX[ioff], sphereY[ioff], sphereZ[ioff]);
- addVertex(r * sphereX[ioff], r *sphereY[ioff], r * sphereZ[ioff],
- u , v, VERTEX);
- u -= du;
- }
- vertCount += detailU;
- vert1 = vertCount;
- setNormal(sphereX[offset], sphereY[offset], sphereZ[offset]);
- addVertex(r * sphereX[offset], r * sphereY[offset], r * sphereZ[offset],
- u, v, VERTEX);
- vertCount++;
-
- for (int i = 0; i < detailU; i++) {
- int i1 = vert0 + i;
- int i0 = vert0 + i - detailU - 1;
-
- indices[indCount + 6 * i + 0] = i1;
- indices[indCount + 6 * i + 1] = i0;
- indices[indCount + 6 * i + 2] = i0 + 1;
-
- indices[indCount + 6 * i + 3] = i1;
- indices[indCount + 6 * i + 4] = i0 + 1;
- indices[indCount + 6 * i + 5] = i1 + 1;
-
- addEdge(i0, i1, true, true);
- addEdge(i1, i1 + 1, true, true);
- addEdge(i0 + 1, i1, true, true);
- }
- indCount += 6 * detailU;
- indices[indCount + 0] = vert1;
- indices[indCount + 1] = vert1 - detailU;
- indices[indCount + 2] = vert1 - 1;
- indCount += 3;
-
- addEdge(vert1 - detailU, vert1 - 1, true, true);
- addEdge(vert1 - 1, vert1, true, true);
- }
-
- // Northern cap -------------------------------------------------------
-
- // Adding multiple copies of the north pole vertex, each one with a
- // different u coordinate, so the texture mapping is correct when
- // making the last strip of triangles.
- u = 1; v = 0;
- for (int i = 0; i < detailU; i++) {
- setNormal(0, -1, 0);
- addVertex(0, -r, 0, u , v, VERTEX);
- u -= du;
- }
- vertCount += detailU;
-
- for (int i = 0; i < detailU; i++) {
- int i0 = vert0 + i;
- int i1 = vert0 + i + detailU + 1;
-
- indices[indCount + 3 * i + 0] = i0;
- indices[indCount + 3 * i + 1] = i1;
- indices[indCount + 3 * i + 2] = i0 + 1;
-
- addEdge(i0, i0 + 1, true, true);
- addEdge(i0, i1, true, true);
- }
- indCount += 3 * detailU;
-
- return indices;
- }
- }
-
-
- // Holds tessellated data for polygon, line and point geometry.
- protected class TessGeometry {
- int renderMode;
-
- // Tessellated polygon data
- int polyVertexCount;
- int firstPolyVertex;
- int lastPolyVertex;
- FloatBuffer polyVerticesBuffer;
- IntBuffer polyColorsBuffer;
- FloatBuffer polyNormalsBuffer;
- FloatBuffer polyTexCoordsBuffer;
-
- // Polygon material properties (polyColors is used
- // as the diffuse color when lighting is enabled)
- IntBuffer polyAmbientBuffer;
- IntBuffer polySpecularBuffer;
- IntBuffer polyEmissiveBuffer;
- FloatBuffer polyShininessBuffer;
-
- int polyIndexCount;
- int firstPolyIndex;
- int lastPolyIndex;
- ShortBuffer polyIndicesBuffer;
- IndexCache polyIndexCache = new IndexCache();
-
- // Tessellated line data
- int lineVertexCount;
- int firstLineVertex;
- int lastLineVertex;
- FloatBuffer lineVerticesBuffer;
- IntBuffer lineColorsBuffer;
- FloatBuffer lineDirectionsBuffer;
-
- int lineIndexCount;
- int firstLineIndex;
- int lastLineIndex;
- ShortBuffer lineIndicesBuffer;
- IndexCache lineIndexCache = new IndexCache();
-
- // Tessellated point data
- int pointVertexCount;
- int firstPointVertex;
- int lastPointVertex;
- FloatBuffer pointVerticesBuffer;
- IntBuffer pointColorsBuffer;
- FloatBuffer pointOffsetsBuffer;
-
- int pointIndexCount;
- int firstPointIndex;
- int lastPointIndex;
- ShortBuffer pointIndicesBuffer;
- IndexCache pointIndexCache = new IndexCache();
-
- // Backing arrays
- float[] polyVertices;
- int[] polyColors;
- float[] polyNormals;
- float[] polyTexCoords;
- int[] polyAmbient;
- int[] polySpecular;
- int[] polyEmissive;
- float[] polyShininess;
- short[] polyIndices;
- float[] lineVertices;
- int[] lineColors;
- float[] lineDirections;
- short[] lineIndices;
- float[] pointVertices;
- int[] pointColors;
- float[] pointOffsets;
- short[] pointIndices;
-
- TessGeometry(int mode) {
- renderMode = mode;
- allocate();
- }
-
- // -----------------------------------------------------------------
- //
- // Allocate/dispose
-
- void allocate() {
- polyVertices = new float[4 * PGL.DEFAULT_TESS_VERTICES];
- polyColors = new int[PGL.DEFAULT_TESS_VERTICES];
- polyNormals = new float[3 * PGL.DEFAULT_TESS_VERTICES];
- polyTexCoords = new float[2 * PGL.DEFAULT_TESS_VERTICES];
- polyAmbient = new int[PGL.DEFAULT_TESS_VERTICES];
- polySpecular = new int[PGL.DEFAULT_TESS_VERTICES];
- polyEmissive = new int[PGL.DEFAULT_TESS_VERTICES];
- polyShininess = new float[PGL.DEFAULT_TESS_VERTICES];
- polyIndices = new short[PGL.DEFAULT_TESS_VERTICES];
-
- lineVertices = new float[4 * PGL.DEFAULT_TESS_VERTICES];
- lineColors = new int[PGL.DEFAULT_TESS_VERTICES];
- lineDirections = new float[4 * PGL.DEFAULT_TESS_VERTICES];
- lineIndices = new short[PGL.DEFAULT_TESS_VERTICES];
-
- pointVertices = new float[4 * PGL.DEFAULT_TESS_VERTICES];
- pointColors = new int[PGL.DEFAULT_TESS_VERTICES];
- pointOffsets = new float[2 * PGL.DEFAULT_TESS_VERTICES];
- pointIndices = new short[PGL.DEFAULT_TESS_VERTICES];
-
- polyVerticesBuffer = PGL.allocateFloatBuffer(polyVertices);
- polyColorsBuffer = PGL.allocateIntBuffer(polyColors);
- polyNormalsBuffer = PGL.allocateFloatBuffer(polyNormals);
- polyTexCoordsBuffer = PGL.allocateFloatBuffer(polyTexCoords);
- polyAmbientBuffer = PGL.allocateIntBuffer(polyAmbient);
- polySpecularBuffer = PGL.allocateIntBuffer(polySpecular);
- polyEmissiveBuffer = PGL.allocateIntBuffer(polyEmissive);
- polyShininessBuffer = PGL.allocateFloatBuffer(polyShininess);
- polyIndicesBuffer = PGL.allocateShortBuffer(polyIndices);
-
- lineVerticesBuffer = PGL.allocateFloatBuffer(lineVertices);
- lineColorsBuffer = PGL.allocateIntBuffer(lineColors);
- lineDirectionsBuffer = PGL.allocateFloatBuffer(lineDirections);
- lineIndicesBuffer = PGL.allocateShortBuffer(lineIndices);
-
- pointVerticesBuffer = PGL.allocateFloatBuffer(pointVertices);
- pointColorsBuffer = PGL.allocateIntBuffer(pointColors);
- pointOffsetsBuffer = PGL.allocateFloatBuffer(pointOffsets);
- pointIndicesBuffer = PGL.allocateShortBuffer(pointIndices);
-
- clear();
- }
-
- void clear() {
- firstPolyVertex = lastPolyVertex = polyVertexCount = 0;
- firstPolyIndex = lastPolyIndex = polyIndexCount = 0;
-
- firstLineVertex = lastLineVertex = lineVertexCount = 0;
- firstLineIndex = lastLineIndex = lineIndexCount = 0;
-
- firstPointVertex = lastPointVertex = pointVertexCount = 0;
- firstPointIndex = lastPointIndex = pointIndexCount = 0;
-
- polyIndexCache.clear();
- lineIndexCache.clear();
- pointIndexCache.clear();
- }
-
-
- void polyVertexCheck() {
- if (polyVertexCount == polyVertices.length / 4) {
- int newSize = polyVertexCount << 1;
-
- expandPolyVertices(newSize);
- expandPolyColors(newSize);
- expandPolyNormals(newSize);
- expandPolyTexCoords(newSize);
- expandPolyAmbient(newSize);
- expandPolySpecular(newSize);
- expandPolyEmissive(newSize);
- expandPolyShininess(newSize);
- }
-
- firstPolyVertex = polyVertexCount;
- polyVertexCount++;
- lastPolyVertex = polyVertexCount - 1;
- }
-
- void polyVertexCheck(int count) {
- int oldSize = polyVertices.length / 4;
- if (polyVertexCount + count > oldSize) {
- int newSize = expandArraySize(oldSize, polyVertexCount + count);
-
- expandPolyVertices(newSize);
- expandPolyColors(newSize);
- expandPolyNormals(newSize);
- expandPolyTexCoords(newSize);
- expandPolyAmbient(newSize);
- expandPolySpecular(newSize);
- expandPolyEmissive(newSize);
- expandPolyShininess(newSize);
- }
-
- firstPolyVertex = polyVertexCount;
- polyVertexCount += count;
- lastPolyVertex = polyVertexCount - 1;
- }
-
- void polyIndexCheck(int count) {
- int oldSize = polyIndices.length;
- if (polyIndexCount + count > oldSize) {
- int newSize = expandArraySize(oldSize, polyIndexCount + count);
-
- expandPolyIndices(newSize);
- }
-
- firstPolyIndex = polyIndexCount;
- polyIndexCount += count;
- lastPolyIndex = polyIndexCount - 1;
- }
-
- void polyIndexCheck() {
- if (polyIndexCount == polyIndices.length) {
- int newSize = polyIndexCount << 1;
-
- expandPolyIndices(newSize);
- }
-
- firstPolyIndex = polyIndexCount;
- polyIndexCount++;
- lastPolyIndex = polyIndexCount - 1;
- }
-
- void lineVertexCheck(int count) {
- int oldSize = lineVertices.length / 4;
- if (lineVertexCount + count > oldSize) {
- int newSize = expandArraySize(oldSize, lineVertexCount + count);
-
- expandLineVertices(newSize);
- expandLineColors(newSize);
- expandLineDirections(newSize);
- }
-
- firstLineVertex = lineVertexCount;
- lineVertexCount += count;
- lastLineVertex = lineVertexCount - 1;
- }
-
- void lineIndexCheck(int count) {
- int oldSize = lineIndices.length;
- if (lineIndexCount + count > oldSize) {
- int newSize = expandArraySize(oldSize, lineIndexCount + count);
-
- expandLineIndices(newSize);
- }
-
- firstLineIndex = lineIndexCount;
- lineIndexCount += count;
- lastLineIndex = lineIndexCount - 1;
- }
-
- void pointVertexCheck(int count) {
- int oldSize = pointVertices.length / 4;
- if (pointVertexCount + count > oldSize) {
- int newSize = expandArraySize(oldSize, pointVertexCount + count);
-
- expandPointVertices(newSize);
- expandPointColors(newSize);
- expandPointOffsets(newSize);
- }
-
- firstPointVertex = pointVertexCount;
- pointVertexCount += count;
- lastPointVertex = pointVertexCount - 1;
- }
-
- void pointIndexCheck(int count) {
- int oldSize = pointIndices.length;
- if (pointIndexCount + count > oldSize) {
- int newSize = expandArraySize(oldSize, pointIndexCount + count);
-
- expandPointIndices(newSize);
- }
-
- firstPointIndex = pointIndexCount;
- pointIndexCount += count;
- lastPointIndex = pointIndexCount - 1;
- }
-
- // -----------------------------------------------------------------
- //
- // Query
-
- boolean isFull() {
- return PGL.FLUSH_VERTEX_COUNT <= polyVertexCount ||
- PGL.FLUSH_VERTEX_COUNT <= lineVertexCount ||
- PGL.FLUSH_VERTEX_COUNT <= pointVertexCount;
- }
-
- void getPolyVertexMin(PVector v, int first, int last) {
- for (int i = first; i <= last; i++) {
- int index = 4 * i;
- v.x = PApplet.min(v.x, polyVertices[index++]);
- v.y = PApplet.min(v.y, polyVertices[index++]);
- v.z = PApplet.min(v.z, polyVertices[index ]);
- }
- }
-
- void getLineVertexMin(PVector v, int first, int last) {
- for (int i = first; i <= last; i++) {
- int index = 4 * i;
- v.x = PApplet.min(v.x, lineVertices[index++]);
- v.y = PApplet.min(v.y, lineVertices[index++]);
- v.z = PApplet.min(v.z, lineVertices[index ]);
- }
- }
-
- void getPointVertexMin(PVector v, int first, int last) {
- for (int i = first; i <= last; i++) {
- int index = 4 * i;
- v.x = PApplet.min(v.x, pointVertices[index++]);
- v.y = PApplet.min(v.y, pointVertices[index++]);
- v.z = PApplet.min(v.z, pointVertices[index ]);
- }
- }
-
- void getPolyVertexMax(PVector v, int first, int last) {
- for (int i = first; i <= last; i++) {
- int index = 4 * i;
- v.x = PApplet.max(v.x, polyVertices[index++]);
- v.y = PApplet.max(v.y, polyVertices[index++]);
- v.z = PApplet.max(v.z, polyVertices[index ]);
- }
- }
-
- void getLineVertexMax(PVector v, int first, int last) {
- for (int i = first; i <= last; i++) {
- int index = 4 * i;
- v.x = PApplet.max(v.x, lineVertices[index++]);
- v.y = PApplet.max(v.y, lineVertices[index++]);
- v.z = PApplet.max(v.z, lineVertices[index ]);
- }
- }
-
- void getPointVertexMax(PVector v, int first, int last) {
- for (int i = first; i <= last; i++) {
- int index = 4 * i;
- v.x = PApplet.max(v.x, pointVertices[index++]);
- v.y = PApplet.max(v.y, pointVertices[index++]);
- v.z = PApplet.max(v.z, pointVertices[index ]);
- }
- }
-
- int getPolyVertexSum(PVector v, int first, int last) {
- for (int i = first; i <= last; i++) {
- int index = 4 * i;
- v.x += polyVertices[index++];
- v.y += polyVertices[index++];
- v.z += polyVertices[index ];
- }
- return last - first + 1;
- }
-
- int getLineVertexSum(PVector v, int first, int last) {
- for (int i = first; i <= last; i++) {
- int index = 4 * i;
- v.x += lineVertices[index++];
- v.y += lineVertices[index++];
- v.z += lineVertices[index ];
- }
- return last - first + 1;
- }
-
- int getPointVertexSum(PVector v, int first, int last) {
- for (int i = first; i <= last; i++) {
- int index = 4 * i;
- v.x += pointVertices[index++];
- v.y += pointVertices[index++];
- v.z += pointVertices[index ];
- }
- return last - first + 1;
- }
-
- // -----------------------------------------------------------------
- //
- // Methods to prepare buffers for relative read/write operations
-
- protected void updatePolyVerticesBuffer() {
- updatePolyVerticesBuffer(0, polyVertexCount);
- }
-
- protected void updatePolyVerticesBuffer(int offset, int size) {
- PGL.updateFloatBuffer(polyVerticesBuffer, polyVertices,
- 4 * offset, 4 * size);
- }
-
- protected void updatePolyColorsBuffer() {
- updatePolyColorsBuffer(0, polyVertexCount);
- }
-
- protected void updatePolyColorsBuffer(int offset, int size) {
- PGL.updateIntBuffer(polyColorsBuffer, polyColors, offset, size);
- }
-
- protected void updatePolyNormalsBuffer() {
- updatePolyNormalsBuffer(0, polyVertexCount);
- }
-
- protected void updatePolyNormalsBuffer(int offset, int size) {
- PGL.updateFloatBuffer(polyNormalsBuffer, polyNormals,
- 3 * offset, 3 * size);
- }
-
- protected void updatePolyTexCoordsBuffer() {
- updatePolyTexCoordsBuffer(0, polyVertexCount);
- }
-
- protected void updatePolyTexCoordsBuffer(int offset, int size) {
- PGL.updateFloatBuffer(polyTexCoordsBuffer, polyTexCoords,
- 2 * offset, 2 * size);
- }
-
- protected void updatePolyAmbientBuffer() {
- updatePolyAmbientBuffer(0, polyVertexCount);
- }
-
- protected void updatePolyAmbientBuffer(int offset, int size) {
- PGL.updateIntBuffer(polyAmbientBuffer, polyAmbient, offset, size);
- }
-
- protected void updatePolySpecularBuffer() {
- updatePolySpecularBuffer(0, polyVertexCount);
- }
-
- protected void updatePolySpecularBuffer(int offset, int size) {
- PGL.updateIntBuffer(polySpecularBuffer, polySpecular, offset, size);
- }
-
- protected void updatePolyEmissiveBuffer() {
- updatePolyEmissiveBuffer(0, polyVertexCount);
- }
-
- protected void updatePolyEmissiveBuffer(int offset, int size) {
- PGL.updateIntBuffer(polyEmissiveBuffer, polyEmissive, offset, size);
- }
-
- protected void updatePolyShininessBuffer() {
- updatePolyShininessBuffer(0, polyVertexCount);
- }
-
- protected void updatePolyShininessBuffer(int offset, int size) {
- PGL.updateFloatBuffer(polyShininessBuffer, polyShininess, offset, size);
- }
-
- protected void updatePolyIndicesBuffer() {
- updatePolyIndicesBuffer(0, polyIndexCount);
- }
-
- protected void updatePolyIndicesBuffer(int offset, int size) {
- PGL.updateShortBuffer(polyIndicesBuffer, polyIndices, offset, size);
- }
-
- protected void updateLineVerticesBuffer() {
- updateLineVerticesBuffer(0, lineVertexCount);
- }
-
- protected void updateLineVerticesBuffer(int offset, int size) {
- PGL.updateFloatBuffer(lineVerticesBuffer, lineVertices,
- 4 * offset, 4 * size);
- }
-
- protected void updateLineColorsBuffer() {
- updateLineColorsBuffer(0, lineVertexCount);
- }
-
- protected void updateLineColorsBuffer(int offset, int size) {
- PGL.updateIntBuffer(lineColorsBuffer, lineColors, offset, size);
- }
-
- protected void updateLineDirectionsBuffer() {
- updateLineDirectionsBuffer(0, lineVertexCount);
- }
-
- protected void updateLineDirectionsBuffer(int offset, int size) {
- PGL.updateFloatBuffer(lineDirectionsBuffer, lineDirections,
- 4 * offset, 4 * size);
- }
-
- protected void updateLineIndicesBuffer() {
- updateLineIndicesBuffer(0, lineIndexCount);
- }
-
- protected void updateLineIndicesBuffer(int offset, int size) {
- PGL.updateShortBuffer(lineIndicesBuffer, lineIndices, offset, size);
- }
-
- protected void updatePointVerticesBuffer() {
- updatePointVerticesBuffer(0, pointVertexCount);
- }
-
- protected void updatePointVerticesBuffer(int offset, int size) {
- PGL.updateFloatBuffer(pointVerticesBuffer, pointVertices,
- 4 * offset, 4 * size);
- }
-
- protected void updatePointColorsBuffer() {
- updatePointColorsBuffer(0, pointVertexCount);
- }
-
- protected void updatePointColorsBuffer(int offset, int size) {
- PGL.updateIntBuffer(pointColorsBuffer, pointColors, offset, size);
- }
-
- protected void updatePointOffsetsBuffer() {
- updatePointOffsetsBuffer(0, pointVertexCount);
- }
-
- protected void updatePointOffsetsBuffer(int offset, int size) {
- PGL.updateFloatBuffer(pointOffsetsBuffer, pointOffsets,
- 2 * offset, 2 * size);
- }
-
- protected void updatePointIndicesBuffer() {
- updatePointIndicesBuffer(0, pointIndexCount);
- }
-
- protected void updatePointIndicesBuffer(int offset, int size) {
- PGL.updateShortBuffer(pointIndicesBuffer, pointIndices, offset, size);
- }
-
- // -----------------------------------------------------------------
- //
- // Expand arrays
-
- void expandPolyVertices(int n) {
- float temp[] = new float[4 * n];
- PApplet.arrayCopy(polyVertices, 0, temp, 0, 4 * polyVertexCount);
- polyVertices = temp;
- polyVerticesBuffer = PGL.allocateFloatBuffer(polyVertices);
- }
-
- void expandPolyColors(int n) {
- int temp[] = new int[n];
- PApplet.arrayCopy(polyColors, 0, temp, 0, polyVertexCount);
- polyColors = temp;
- polyColorsBuffer = PGL.allocateIntBuffer(polyColors);
- }
-
- void expandPolyNormals(int n) {
- float temp[] = new float[3 * n];
- PApplet.arrayCopy(polyNormals, 0, temp, 0, 3 * polyVertexCount);
- polyNormals = temp;
- polyNormalsBuffer = PGL.allocateFloatBuffer(polyNormals);
- }
-
- void expandPolyTexCoords(int n) {
- float temp[] = new float[2 * n];
- PApplet.arrayCopy(polyTexCoords, 0, temp, 0, 2 * polyVertexCount);
- polyTexCoords = temp;
- polyTexCoordsBuffer = PGL.allocateFloatBuffer(polyTexCoords);
- }
-
- void expandPolyAmbient(int n) {
- int temp[] = new int[n];
- PApplet.arrayCopy(polyAmbient, 0, temp, 0, polyVertexCount);
- polyAmbient = temp;
- polyAmbientBuffer = PGL.allocateIntBuffer(polyAmbient);
- }
-
- void expandPolySpecular(int n) {
- int temp[] = new int[n];
- PApplet.arrayCopy(polySpecular, 0, temp, 0, polyVertexCount);
- polySpecular = temp;
- polySpecularBuffer = PGL.allocateIntBuffer(polySpecular);
- }
-
- void expandPolyEmissive(int n) {
- int temp[] = new int[n];
- PApplet.arrayCopy(polyEmissive, 0, temp, 0, polyVertexCount);
- polyEmissive = temp;
- polyEmissiveBuffer = PGL.allocateIntBuffer(polyEmissive);
- }
-
- void expandPolyShininess(int n) {
- float temp[] = new float[n];
- PApplet.arrayCopy(polyShininess, 0, temp, 0, polyVertexCount);
- polyShininess = temp;
- polyShininessBuffer = PGL.allocateFloatBuffer(polyShininess);
- }
-
- void expandPolyIndices(int n) {
- short temp[] = new short[n];
- PApplet.arrayCopy(polyIndices, 0, temp, 0, polyIndexCount);
- polyIndices = temp;
- polyIndicesBuffer = PGL.allocateShortBuffer(polyIndices);
- }
-
- void expandLineVertices(int n) {
- float temp[] = new float[4 * n];
- PApplet.arrayCopy(lineVertices, 0, temp, 0, 4 * lineVertexCount);
- lineVertices = temp;
- lineVerticesBuffer = PGL.allocateFloatBuffer(lineVertices);
- }
-
- void expandLineColors(int n) {
- int temp[] = new int[n];
- PApplet.arrayCopy(lineColors, 0, temp, 0, lineVertexCount);
- lineColors = temp;
- lineColorsBuffer = PGL.allocateIntBuffer(lineColors);
- }
-
- void expandLineDirections(int n) {
- float temp[] = new float[4 * n];
- PApplet.arrayCopy(lineDirections, 0, temp, 0, 4 * lineVertexCount);
- lineDirections = temp;
- lineDirectionsBuffer = PGL.allocateFloatBuffer(lineDirections);
- }
-
- void expandLineIndices(int n) {
- short temp[] = new short[n];
- PApplet.arrayCopy(lineIndices, 0, temp, 0, lineIndexCount);
- lineIndices = temp;
- lineIndicesBuffer = PGL.allocateShortBuffer(lineIndices);
- }
-
- void expandPointVertices(int n) {
- float temp[] = new float[4 * n];
- PApplet.arrayCopy(pointVertices, 0, temp, 0, 4 * pointVertexCount);
- pointVertices = temp;
- pointVerticesBuffer = PGL.allocateFloatBuffer(pointVertices);
- }
-
- void expandPointColors(int n) {
- int temp[] = new int[n];
- PApplet.arrayCopy(pointColors, 0, temp, 0, pointVertexCount);
- pointColors = temp;
- pointColorsBuffer = PGL.allocateIntBuffer(pointColors);
- }
-
- void expandPointOffsets(int n) {
- float temp[] = new float[2 * n];
- PApplet.arrayCopy(pointOffsets, 0, temp, 0, 2 * pointVertexCount);
- pointOffsets = temp;
- pointOffsetsBuffer = PGL.allocateFloatBuffer(pointOffsets);
- }
-
- void expandPointIndices(int n) {
- short temp[] = new short[n];
- PApplet.arrayCopy(pointIndices, 0, temp, 0, pointIndexCount);
- pointIndices = temp;
- pointIndicesBuffer = PGL.allocateShortBuffer(pointIndices);
- }
-
- // -----------------------------------------------------------------
- //
- // Trim arrays
-
- void trim() {
- if (0 < polyVertexCount && polyVertexCount < polyVertices.length / 4) {
- trimPolyVertices();
- trimPolyColors();
- trimPolyNormals();
- trimPolyTexCoords();
- trimPolyAmbient();
- trimPolySpecular();
- trimPolyEmissive();
- trimPolyShininess();
- }
-
- if (0 < polyIndexCount && polyIndexCount < polyIndices.length) {
- trimPolyIndices();
- }
-
- if (0 < lineVertexCount && lineVertexCount < lineVertices.length / 4) {
- trimLineVertices();
- trimLineColors();
- trimLineDirections();
- }
-
- if (0 < lineIndexCount && lineIndexCount < lineIndices.length) {
- trimLineIndices();
- }
-
- if (0 < pointVertexCount && pointVertexCount < pointVertices.length / 4) {
- trimPointVertices();
- trimPointColors();
- trimPointOffsets();
- }
-
- if (0 < pointIndexCount && pointIndexCount < pointIndices.length) {
- trimPointIndices();
- }
- }
-
- void trimPolyVertices() {
- float temp[] = new float[4 * polyVertexCount];
- PApplet.arrayCopy(polyVertices, 0, temp, 0, 4 * polyVertexCount);
- polyVertices = temp;
- polyVerticesBuffer = PGL.allocateFloatBuffer(polyVertices);
- }
-
- void trimPolyColors() {
- int temp[] = new int[polyVertexCount];
- PApplet.arrayCopy(polyColors, 0, temp, 0, polyVertexCount);
- polyColors = temp;
- polyColorsBuffer = PGL.allocateIntBuffer(polyColors);
- }
-
- void trimPolyNormals() {
- float temp[] = new float[3 * polyVertexCount];
- PApplet.arrayCopy(polyNormals, 0, temp, 0, 3 * polyVertexCount);
- polyNormals = temp;
- polyNormalsBuffer = PGL.allocateFloatBuffer(polyNormals);
- }
-
- void trimPolyTexCoords() {
- float temp[] = new float[2 * polyVertexCount];
- PApplet.arrayCopy(polyTexCoords, 0, temp, 0, 2 * polyVertexCount);
- polyTexCoords = temp;
- polyTexCoordsBuffer = PGL.allocateFloatBuffer(polyTexCoords);
- }
-
- void trimPolyAmbient() {
- int temp[] = new int[polyVertexCount];
- PApplet.arrayCopy(polyAmbient, 0, temp, 0, polyVertexCount);
- polyAmbient = temp;
- polyAmbientBuffer = PGL.allocateIntBuffer(polyAmbient);
- }
-
- void trimPolySpecular() {
- int temp[] = new int[polyVertexCount];
- PApplet.arrayCopy(polySpecular, 0, temp, 0, polyVertexCount);
- polySpecular = temp;
- polySpecularBuffer = PGL.allocateIntBuffer(polySpecular);
- }
-
- void trimPolyEmissive() {
- int temp[] = new int[polyVertexCount];
- PApplet.arrayCopy(polyEmissive, 0, temp, 0, polyVertexCount);
- polyEmissive = temp;
- polyEmissiveBuffer = PGL.allocateIntBuffer(polyEmissive);
- }
-
- void trimPolyShininess() {
- float temp[] = new float[polyVertexCount];
- PApplet.arrayCopy(polyShininess, 0, temp, 0, polyVertexCount);
- polyShininess = temp;
- polyShininessBuffer = PGL.allocateFloatBuffer(polyShininess);
- }
-
- void trimPolyIndices() {
- short temp[] = new short[polyIndexCount];
- PApplet.arrayCopy(polyIndices, 0, temp, 0, polyIndexCount);
- polyIndices = temp;
- polyIndicesBuffer = PGL.allocateShortBuffer(polyIndices);
- }
-
- void trimLineVertices() {
- float temp[] = new float[4 * lineVertexCount];
- PApplet.arrayCopy(lineVertices, 0, temp, 0, 4 * lineVertexCount);
- lineVertices = temp;
- lineVerticesBuffer = PGL.allocateFloatBuffer(lineVertices);
- }
-
- void trimLineColors() {
- int temp[] = new int[lineVertexCount];
- PApplet.arrayCopy(lineColors, 0, temp, 0, lineVertexCount);
- lineColors = temp;
- lineColorsBuffer = PGL.allocateIntBuffer(lineColors);
- }
-
- void trimLineDirections() {
- float temp[] = new float[4 * lineVertexCount];
- PApplet.arrayCopy(lineDirections, 0, temp, 0, 4 * lineVertexCount);
- lineDirections = temp;
- lineDirectionsBuffer = PGL.allocateFloatBuffer(lineDirections);
- }
-
- void trimLineIndices() {
- short temp[] = new short[lineIndexCount];
- PApplet.arrayCopy(lineIndices, 0, temp, 0, lineIndexCount);
- lineIndices = temp;
- lineIndicesBuffer = PGL.allocateShortBuffer(lineIndices);
- }
-
- void trimPointVertices() {
- float temp[] = new float[4 * pointVertexCount];
- PApplet.arrayCopy(pointVertices, 0, temp, 0, 4 * pointVertexCount);
- pointVertices = temp;
- pointVerticesBuffer = PGL.allocateFloatBuffer(pointVertices);
- }
-
- void trimPointColors() {
- int temp[] = new int[pointVertexCount];
- PApplet.arrayCopy(pointColors, 0, temp, 0, pointVertexCount);
- pointColors = temp;
- pointColorsBuffer = PGL.allocateIntBuffer(pointColors);
- }
-
- void trimPointOffsets() {
- float temp[] = new float[2 * pointVertexCount];
- PApplet.arrayCopy(pointOffsets, 0, temp, 0, 2 * pointVertexCount);
- pointOffsets = temp;
- pointOffsetsBuffer = PGL.allocateFloatBuffer(pointOffsets);
- }
-
- void trimPointIndices() {
- short temp[] = new short[pointIndexCount];
- PApplet.arrayCopy(pointIndices, 0, temp, 0, pointIndexCount);
- pointIndices = temp;
- pointIndicesBuffer = PGL.allocateShortBuffer(pointIndices);
- }
-
- // -----------------------------------------------------------------
- //
- // Aggregation methods
-
- void incPolyIndices(int first, int last, int inc) {
- for (int i = first; i <= last; i++) {
- polyIndices[i] += inc;
- }
- }
-
- void incLineIndices(int first, int last, int inc) {
- for (int i = first; i <= last; i++) {
- lineIndices[i] += inc;
- }
- }
-
- void incPointIndices(int first, int last, int inc) {
- for (int i = first; i <= last; i++) {
- pointIndices[i] += inc;
- }
- }
-
- // -----------------------------------------------------------------
- //
- // Normal calculation
-
- void calcPolyNormal(int i0, int i1, int i2) {
- int index;
-
- index = 4 * i0;
- float x0 = polyVertices[index++];
- float y0 = polyVertices[index++];
- float z0 = polyVertices[index ];
-
- index = 4 * i1;
- float x1 = polyVertices[index++];
- float y1 = polyVertices[index++];
- float z1 = polyVertices[index ];
-
- index = 4 * i2;
- float x2 = polyVertices[index++];
- float y2 = polyVertices[index++];
- float z2 = polyVertices[index ];
-
- float v12x = x2 - x1;
- float v12y = y2 - y1;
- float v12z = z2 - z1;
-
- float v10x = x0 - x1;
- float v10y = y0 - y1;
- float v10z = z0 - z1;
-
- float nx = v12y * v10z - v10y * v12z;
- float ny = v12z * v10x - v10z * v12x;
- float nz = v12x * v10y - v10x * v12y;
- float d = PApplet.sqrt(nx * nx + ny * ny + nz * nz);
- nx /= d;
- ny /= d;
- nz /= d;
-
- index = 3 * i0;
- polyNormals[index++] = nx;
- polyNormals[index++] = ny;
- polyNormals[index ] = nz;
-
- index = 3 * i1;
- polyNormals[index++] = nx;
- polyNormals[index++] = ny;
- polyNormals[index ] = nz;
-
- index = 3 * i2;
- polyNormals[index++] = nx;
- polyNormals[index++] = ny;
- polyNormals[index ] = nz;
- }
-
- // -----------------------------------------------------------------
- //
- // Add point geometry
-
- // Sets point vertex with index tessIdx using the data from input vertex
- // inIdx.
- void setPointVertex(int tessIdx, InGeometry in, int inIdx) {
- int index;
-
- index = 3 * inIdx;
- float x = in.vertices[index++];
- float y = in.vertices[index++];
- float z = in.vertices[index ];
-
- if (renderMode == IMMEDIATE && flushMode == FLUSH_WHEN_FULL) {
- PMatrix3D mm = modelview;
-
- index = 4 * tessIdx;
- pointVertices[index++] = x*mm.m00 + y*mm.m01 + z*mm.m02 + mm.m03;
- pointVertices[index++] = x*mm.m10 + y*mm.m11 + z*mm.m12 + mm.m13;
- pointVertices[index++] = x*mm.m20 + y*mm.m21 + z*mm.m22 + mm.m23;
- pointVertices[index ] = x*mm.m30 + y*mm.m31 + z*mm.m32 + mm.m33;
- } else {
- index = 4 * tessIdx;
- pointVertices[index++] = x;
- pointVertices[index++] = y;
- pointVertices[index++] = z;
- pointVertices[index ] = 1;
- }
-
- pointColors[tessIdx] = in.strokeColors[inIdx];
- }
-
- // -----------------------------------------------------------------
- //
- // Add line geometry
-
- void setLineVertex(int tessIdx, InGeometry in, int inIdx0, int rgba) {
- int index;
-
- index = 3 * inIdx0;
- float x0 = in.vertices[index++];
- float y0 = in.vertices[index++];
- float z0 = in.vertices[index ];
-
- if (renderMode == IMMEDIATE && flushMode == FLUSH_WHEN_FULL) {
- PMatrix3D mm = modelview;
-
- index = 4 * tessIdx;
- lineVertices[index++] = x0*mm.m00 + y0*mm.m01 + z0*mm.m02 + mm.m03;
- lineVertices[index++] = x0*mm.m10 + y0*mm.m11 + z0*mm.m12 + mm.m13;
- lineVertices[index++] = x0*mm.m20 + y0*mm.m21 + z0*mm.m22 + mm.m23;
- lineVertices[index ] = x0*mm.m30 + y0*mm.m31 + z0*mm.m32 + mm.m33;
- } else {
- index = 4 * tessIdx;
- lineVertices[index++] = x0;
- lineVertices[index++] = y0;
- lineVertices[index++] = z0;
- lineVertices[index ] = 1;
- }
-
- lineColors[tessIdx] = rgba;
- index = 4 * tessIdx;
- lineDirections[index++] = 0;
- lineDirections[index++] = 0;
- lineDirections[index++] = 0;
- lineDirections[index ] = 0;
- }
-
- // Sets line vertex with index tessIdx using the data from input vertices
- //inIdx0 and inIdx1.
- void setLineVertex(int tessIdx, InGeometry in, int inIdx0, int inIdx1,
- int rgba, float weight) {
- int index;
-
- index = 3 * inIdx0;
- float x0 = in.vertices[index++];
- float y0 = in.vertices[index++];
- float z0 = in.vertices[index ];
-
- index = 3 * inIdx1;
- float x1 = in.vertices[index++];
- float y1 = in.vertices[index++];
- float z1 = in.vertices[index ];
-
- float dx = x1 - x0;
- float dy = y1 - y0;
- float dz = z1 - z0;
-
- if (renderMode == IMMEDIATE && flushMode == FLUSH_WHEN_FULL) {
- PMatrix3D mm = modelview;
-
- index = 4 * tessIdx;
- lineVertices[index++] = x0*mm.m00 + y0*mm.m01 + z0*mm.m02 + mm.m03;
- lineVertices[index++] = x0*mm.m10 + y0*mm.m11 + z0*mm.m12 + mm.m13;
- lineVertices[index++] = x0*mm.m20 + y0*mm.m21 + z0*mm.m22 + mm.m23;
- lineVertices[index ] = x0*mm.m30 + y0*mm.m31 + z0*mm.m32 + mm.m33;
-
- index = 4 * tessIdx;
- lineDirections[index++] = dx*mm.m00 + dy*mm.m01 + dz*mm.m02;
- lineDirections[index++] = dx*mm.m10 + dy*mm.m11 + dz*mm.m12;
- lineDirections[index ] = dx*mm.m20 + dy*mm.m21 + dz*mm.m22;
- } else {
- index = 4 * tessIdx;
- lineVertices[index++] = x0;
- lineVertices[index++] = y0;
- lineVertices[index++] = z0;
- lineVertices[index ] = 1;
-
- index = 4 * tessIdx;
- lineDirections[index++] = dx;
- lineDirections[index++] = dy;
- lineDirections[index ] = dz;
- }
-
- lineColors[tessIdx] = rgba;
- lineDirections[4 * tessIdx + 3] = weight;
- }
-
- // -----------------------------------------------------------------
- //
- // Add poly geometry
-
- void addPolyVertex(float x, float y, float z,
- int rgba,
- float nx, float ny, float nz,
- float u, float v,
- int am, int sp, int em, float shine) {
- polyVertexCheck();
- int tessIdx = polyVertexCount - 1;
- setPolyVertex(tessIdx, x, y, z,
- rgba,
- nx, ny, nz,
- u, v,
- am, sp, em, shine);
- }
-
- void setPolyVertex(int tessIdx, float x, float y, float z, int rgba) {
- setPolyVertex(tessIdx, x, y, z,
- rgba,
- 0, 0, 1,
- 0, 0,
- 0, 0, 0, 0);
- }
-
- void setPolyVertex(int tessIdx, float x, float y, float z,
- int rgba,
- float nx, float ny, float nz,
- float u, float v,
- int am, int sp, int em, float shine) {
- int index;
-
- if (renderMode == IMMEDIATE && flushMode == FLUSH_WHEN_FULL) {
- PMatrix3D mm = modelview;
- PMatrix3D nm = modelviewInv;
-
- index = 4 * tessIdx;
- polyVertices[index++] = x*mm.m00 + y*mm.m01 + z*mm.m02 + mm.m03;
- polyVertices[index++] = x*mm.m10 + y*mm.m11 + z*mm.m12 + mm.m13;
- polyVertices[index++] = x*mm.m20 + y*mm.m21 + z*mm.m22 + mm.m23;
- polyVertices[index ] = x*mm.m30 + y*mm.m31 + z*mm.m32 + mm.m33;
-
- index = 3 * tessIdx;
- polyNormals[index++] = nx*nm.m00 + ny*nm.m10 + nz*nm.m20;
- polyNormals[index++] = nx*nm.m01 + ny*nm.m11 + nz*nm.m21;
- polyNormals[index ] = nx*nm.m02 + ny*nm.m12 + nz*nm.m22;
- } else {
- index = 4 * tessIdx;
- polyVertices[index++] = x;
- polyVertices[index++] = y;
- polyVertices[index++] = z;
- polyVertices[index ] = 1;
-
- index = 3 * tessIdx;
- polyNormals[index++] = nx;
- polyNormals[index++] = ny;
- polyNormals[index ] = nz;
- }
-
- polyColors[tessIdx] = rgba;
-
- index = 2 * tessIdx;
- polyTexCoords[index++] = u;
- polyTexCoords[index ] = v;
-
- polyAmbient[tessIdx] = am;
- polySpecular[tessIdx] = sp;
- polyEmissive[tessIdx] = em;
- polyShininess[tessIdx] = shine;
- }
-
- void addPolyVertices(InGeometry in) {
- addPolyVertices(in, in.firstVertex, in.lastVertex);
- }
-
- void addPolyVertex(InGeometry in, int i) {
- addPolyVertices(in, i, i);
- }
-
- void addPolyVertices(InGeometry in, int i0, int i1) {
- int index;
- int nvert = i1 - i0 + 1;
-
- polyVertexCheck(nvert);
-
- if (renderMode == IMMEDIATE && flushMode == FLUSH_WHEN_FULL) {
- PMatrix3D mm = modelview;
- PMatrix3D nm = modelviewInv;
-
- for (int i = 0; i < nvert; i++) {
- int inIdx = i0 + i;
- int tessIdx = firstPolyVertex + i;
-
- index = 3 * inIdx;
- float x = in.vertices[index++];
- float y = in.vertices[index++];
- float z = in.vertices[index ];
-
- index = 3 * inIdx;
- float nx = in.normals[index++];
- float ny = in.normals[index++];
- float nz = in.normals[index ];
-
- index = 4 * tessIdx;
- polyVertices[index++] = x*mm.m00 + y*mm.m01 + z*mm.m02 + mm.m03;
- polyVertices[index++] = x*mm.m10 + y*mm.m11 + z*mm.m12 + mm.m13;
- polyVertices[index++] = x*mm.m20 + y*mm.m21 + z*mm.m22 + mm.m23;
- polyVertices[index ] = x*mm.m30 + y*mm.m31 + z*mm.m32 + mm.m33;
-
- index = 3 * tessIdx;
- polyNormals[index++] = nx*nm.m00 + ny*nm.m10 + nz*nm.m20;
- polyNormals[index++] = nx*nm.m01 + ny*nm.m11 + nz*nm.m21;
- polyNormals[index ] = nx*nm.m02 + ny*nm.m12 + nz*nm.m22;
- }
- } else {
- if (nvert <= PGL.MIN_ARRAYCOPY_SIZE) {
- // Copying elements one by one instead of using arrayCopy is more
- // efficient for few vertices...
- for (int i = 0; i < nvert; i++) {
- int inIdx = i0 + i;
- int tessIdx = firstPolyVertex + i;
-
- index = 3 * inIdx;
- float x = in.vertices[index++];
- float y = in.vertices[index++];
- float z = in.vertices[index ];
-
- index = 3 * inIdx;
- float nx = in.normals[index++];
- float ny = in.normals[index++];
- float nz = in.normals[index ];
-
- index = 4 * tessIdx;
- polyVertices[index++] = x;
- polyVertices[index++] = y;
- polyVertices[index++] = z;
- polyVertices[index ] = 1;
-
- index = 3 * tessIdx;
- polyNormals[index++] = nx;
- polyNormals[index++] = ny;
- polyNormals[index ] = nz;
- }
- } else {
- for (int i = 0; i < nvert; i++) {
- int inIdx = i0 + i;
- int tessIdx = firstPolyVertex + i;
- PApplet.arrayCopy(in.vertices, 3 * inIdx,
- polyVertices, 4 * tessIdx, 3);
- polyVertices[4 * tessIdx + 3] = 1;
- }
- PApplet.arrayCopy(in.normals, 3 * i0,
- polyNormals, 3 * firstPolyVertex, 3 * nvert);
- }
- }
-
- if (nvert <= PGL.MIN_ARRAYCOPY_SIZE) {
- for (int i = 0; i < nvert; i++) {
- int inIdx = i0 + i;
- int tessIdx = firstPolyVertex + i;
-
- index = 2 * inIdx;
- float u = in.texcoords[index++];
- float v = in.texcoords[index ];
-
- polyColors[tessIdx] = in.colors[inIdx];
-
- index = 2 * tessIdx;
- polyTexCoords[index++] = u;
- polyTexCoords[index ] = v;
-
- polyAmbient[tessIdx] = in.ambient[inIdx];
- polySpecular[tessIdx] = in.specular[inIdx];
- polyEmissive[tessIdx] = in.emissive[inIdx];
- polyShininess[tessIdx] = in.shininess[inIdx];
- }
- } else {
- PApplet.arrayCopy(in.colors, i0,
- polyColors, firstPolyVertex, nvert);
- PApplet.arrayCopy(in.texcoords, 2 * i0,
- polyTexCoords, 2 * firstPolyVertex, 2 * nvert);
- PApplet.arrayCopy(in.ambient, i0,
- polyAmbient, firstPolyVertex, nvert);
- PApplet.arrayCopy(in.specular, i0,
- polySpecular, firstPolyVertex, nvert);
- PApplet.arrayCopy(in.emissive, i0,
- polyEmissive, firstPolyVertex, nvert);
- PApplet.arrayCopy(in.shininess, i0,
- polyShininess, firstPolyVertex, nvert);
- }
- }
-
- // -----------------------------------------------------------------
- //
- // Matrix transformations
-
- void applyMatrixOnPolyGeometry(PMatrix tr, int first, int last) {
- if (tr instanceof PMatrix2D) {
- applyMatrixOnPolyGeometry((PMatrix2D) tr, first, last);
- } else if (tr instanceof PMatrix3D) {
- applyMatrixOnPolyGeometry((PMatrix3D) tr, first, last);
- }
- }
-
- void applyMatrixOnLineGeometry(PMatrix tr, int first, int last) {
- if (tr instanceof PMatrix2D) {
- applyMatrixOnLineGeometry((PMatrix2D) tr, first, last);
- } else if (tr instanceof PMatrix3D) {
- applyMatrixOnLineGeometry((PMatrix3D) tr, first, last);
- }
- }
-
- void applyMatrixOnPointGeometry(PMatrix tr, int first, int last) {
- if (tr instanceof PMatrix2D) {
- applyMatrixOnPointGeometry((PMatrix2D) tr, first, last);
- } else if (tr instanceof PMatrix3D) {
- applyMatrixOnPointGeometry((PMatrix3D) tr, first, last);
- }
- }
-
- void applyMatrixOnPolyGeometry(PMatrix2D tr, int first, int last) {
- if (first < last) {
- int index;
-
- for (int i = first; i <= last; i++) {
- index = 4 * i;
- float x = polyVertices[index++];
- float y = polyVertices[index ];
-
- index = 3 * i;
- float nx = polyNormals[index++];
- float ny = polyNormals[index ];
-
- index = 4 * i;
- polyVertices[index++] = x*tr.m00 + y*tr.m01 + tr.m02;
- polyVertices[index ] = x*tr.m10 + y*tr.m11 + tr.m12;
-
- index = 3 * i;
- polyNormals[index++] = nx*tr.m00 + ny*tr.m01;
- polyNormals[index ] = nx*tr.m10 + ny*tr.m11;
- }
- }
- }
-
- void applyMatrixOnLineGeometry(PMatrix2D tr, int first, int last) {
- if (first < last) {
- int index;
-
- for (int i = first; i <= last; i++) {
- index = 4 * i;
- float x = lineVertices[index++];
- float y = lineVertices[index ];
-
- index = 4 * i;
- float xa = lineDirections[index++];
- float ya = lineDirections[index ];
-
- float dx = xa - x;
- float dy = ya - y;
-
- index = 4 * i;
- lineVertices[index++] = x*tr.m00 + y*tr.m01 + tr.m02;
- lineVertices[index ] = x*tr.m10 + y*tr.m11 + tr.m12;
-
- index = 4 * i;
- lineDirections[index++] = dx*tr.m00 + dy*tr.m01;
- lineDirections[index ] = dx*tr.m10 + dy*tr.m11;
- }
- }
- }
-
- void applyMatrixOnPointGeometry(PMatrix2D tr, int first, int last) {
- if (first < last) {
- int index;
-
- for (int i = first; i <= last; i++) {
- index = 4 * i;
- float x = pointVertices[index++];
- float y = pointVertices[index ];
-
- index = 4 * i;
- pointVertices[index++] = x*tr.m00 + y*tr.m01 + tr.m02;
- pointVertices[index ] = x*tr.m10 + y*tr.m11 + tr.m12;
- }
- }
- }
-
- void applyMatrixOnPolyGeometry(PMatrix3D tr, int first, int last) {
- if (first < last) {
- int index;
-
- for (int i = first; i <= last; i++) {
- index = 4 * i;
- float x = polyVertices[index++];
- float y = polyVertices[index++];
- float z = polyVertices[index++];
- float w = polyVertices[index ];
-
- index = 3 * i;
- float nx = polyNormals[index++];
- float ny = polyNormals[index++];
- float nz = polyNormals[index ];
-
- index = 4 * i;
- polyVertices[index++] = x*tr.m00 + y*tr.m01 + z*tr.m02 + w*tr.m03;
- polyVertices[index++] = x*tr.m10 + y*tr.m11 + z*tr.m12 + w*tr.m13;
- polyVertices[index++] = x*tr.m20 + y*tr.m21 + z*tr.m22 + w*tr.m23;
- polyVertices[index ] = x*tr.m30 + y*tr.m31 + z*tr.m32 + w*tr.m33;
-
- index = 3 * i;
- polyNormals[index++] = nx*tr.m00 + ny*tr.m01 + nz*tr.m02;
- polyNormals[index++] = nx*tr.m10 + ny*tr.m11 + nz*tr.m12;
- polyNormals[index ] = nx*tr.m20 + ny*tr.m21 + nz*tr.m22;
- }
- }
- }
-
- void applyMatrixOnLineGeometry(PMatrix3D tr, int first, int last) {
- if (first < last) {
- int index;
-
- for (int i = first; i <= last; i++) {
- index = 4 * i;
- float x = lineVertices[index++];
- float y = lineVertices[index++];
- float z = lineVertices[index++];
- float w = lineVertices[index ];
-
- index = 4 * i;
- float xa = lineDirections[index++];
- float ya = lineDirections[index++];
- float za = lineDirections[index ];
-
- float dx = xa - x;
- float dy = ya - y;
- float dz = za - z;
-
- index = 4 * i;
- lineVertices[index++] = x*tr.m00 + y*tr.m01 + z*tr.m02 + w*tr.m03;
- lineVertices[index++] = x*tr.m10 + y*tr.m11 + z*tr.m12 + w*tr.m13;
- lineVertices[index++] = x*tr.m20 + y*tr.m21 + z*tr.m22 + w*tr.m23;
- lineVertices[index ] = x*tr.m30 + y*tr.m31 + z*tr.m32 + w*tr.m33;
-
- index = 4 * i;
- lineDirections[index++] = dx*tr.m00 + dy*tr.m01 + dz*tr.m02;
- lineDirections[index++] = dx*tr.m10 + dy*tr.m11 + dz*tr.m12;
- lineDirections[index ] = dx*tr.m20 + dy*tr.m21 + dz*tr.m22;
- }
- }
- }
-
- void applyMatrixOnPointGeometry(PMatrix3D tr, int first, int last) {
- if (first < last) {
- int index;
-
- for (int i = first; i <= last; i++) {
- index = 4 * i;
- float x = pointVertices[index++];
- float y = pointVertices[index++];
- float z = pointVertices[index++];
- float w = pointVertices[index ];
-
- index = 4 * i;
- pointVertices[index++] = x*tr.m00 + y*tr.m01 + z*tr.m02 + w*tr.m03;
- pointVertices[index++] = x*tr.m10 + y*tr.m11 + z*tr.m12 + w*tr.m13;
- pointVertices[index++] = x*tr.m20 + y*tr.m21 + z*tr.m22 + w*tr.m23;
- pointVertices[index ] = x*tr.m30 + y*tr.m31 + z*tr.m32 + w*tr.m33;
- }
- }
- }
- }
-
- // Generates tessellated geometry given a batch of input vertices.
- // Generates tessellated geometry given a batch of input vertices.
- protected class Tessellator {
- InGeometry in;
- TessGeometry tess;
- TexCache texCache;
- PImage prevTexImage;
- PImage newTexImage;
- int firstTexIndex;
- int firstTexCache;
-
- PGL.Tessellator gluTess;
- TessellatorCallback callback;
-
- boolean fill;
- boolean stroke;
- int strokeColor;
- float strokeWeight;
- int strokeJoin;
- int strokeCap;
- boolean accurate2DStrokes;
-
- PMatrix transform;
- boolean is2D, is3D;
-
- int[] rawIndices;
- int rawSize;
- int[] dupIndices;
- int dupCount;
-
- int firstPolyIndexCache;
- int lastPolyIndexCache;
- int firstLineIndexCache;
- int lastLineIndexCache;
- int firstPointIndexCache;
- int lastPointIndexCache;
-
- public Tessellator() {
- callback = new TessellatorCallback();
- gluTess = pgl.createTessellator(callback);
- rawIndices = new int[512];
- accurate2DStrokes = true;
- transform = null;
- is2D = false;
- is3D = true;
- }
-
- void setInGeometry(InGeometry in) {
- this.in = in;
-
- firstPolyIndexCache = -1;
- lastPolyIndexCache = -1;
- firstLineIndexCache = -1;
- lastLineIndexCache = -1;
- firstPointIndexCache = -1;
- lastPointIndexCache = -1;
- }
-
- void setTessGeometry(TessGeometry tess) {
- this.tess = tess;
- }
-
- void setFill(boolean fill) {
- this.fill = fill;
- }
-
- void setStroke(boolean stroke) {
- this.stroke = stroke;
- }
-
- void setStrokeColor(int color) {
- this.strokeColor = PGL.javaToNativeARGB(color);
- }
-
- void setStrokeWeight(float weight) {
- this.strokeWeight = weight;
- }
-
- void setStrokeJoin(int strokeJoin) {
- this.strokeJoin = strokeJoin;
- }
-
- void setStrokeCap(int strokeCap) {
- this.strokeCap = strokeCap;
- }
-
- void setAccurate2DStrokes(boolean accurate) {
- this.accurate2DStrokes = accurate;
- }
-
- void setTexCache(TexCache texCache, PImage prevTexImage,
- PImage newTexImage) {
- this.texCache = texCache;
- this.prevTexImage = prevTexImage;
- this.newTexImage = newTexImage;
- }
-
- void set3D(boolean value) {
- if (value) {
- this.is2D = false;
- this.is3D = true;
- } else {
- this.is2D = true;
- this.is3D = false;
- }
- }
-
- void setTransform(PMatrix transform) {
- this.transform = transform;
- }
-
- // -----------------------------------------------------------------
- //
- // Point tessellation
-
- void tessellatePoints() {
- if (strokeCap == ROUND) {
- tessellateRoundPoints();
- } else {
- tessellateSquarePoints();
- }
- }
-
- void tessellateRoundPoints() {
- int nInVert = in.lastVertex - in.firstVertex + 1;
- if (stroke && 1 <= nInVert) {
- // Each point generates a separate triangle fan.
- // The number of triangles of each fan depends on the
- // stroke weight of the point.
- int nPtVert =
- PApplet.max(MIN_POINT_ACCURACY,
- (int) (TWO_PI * strokeWeight /
- POINT_ACCURACY_FACTOR)) + 1;
- if (PGL.MAX_VERTEX_INDEX1 <= nPtVert) {
- throw new RuntimeException("Error in point tessellation.");
- }
- updateTex();
- int nvertTot = nPtVert * nInVert;
- int nindTot = 3 * (nPtVert - 1) * nInVert;
- if (is3D) {
- tessellateRoundPoints3D(nvertTot, nindTot, nPtVert);
- } else if (is2D) {
- beginNoTex();
- tessellateRoundPoints2D(nvertTot, nindTot, nPtVert);
- endNoTex();
- }
- }
- }
-
- void tessellateRoundPoints3D(int nvertTot, int nindTot, int nPtVert) {
- int perim = nPtVert - 1;
- tess.pointVertexCheck(nvertTot);
- tess.pointIndexCheck(nindTot);
- int vertIdx = tess.firstPointVertex;
- int attribIdx = tess.firstPointVertex;
- int indIdx = tess.firstPointIndex;
- IndexCache cache = tess.pointIndexCache;
- int index = in.renderMode == RETAINED ? cache.addNew() : cache.getLast();
- firstPointIndexCache = index;
- for (int i = in.firstVertex; i <= in.lastVertex; i++) {
- // Creating the triangle fan for each input vertex.
-
- int count = cache.vertexCount[index];
- if (PGL.MAX_VERTEX_INDEX1 <= count + nPtVert) {
- // We need to start a new index block for this point.
- index = cache.addNew();
- count = 0;
- }
-
- // All the tessellated vertices are identical to the center point
- for (int k = 0; k < nPtVert; k++) {
- tess.setPointVertex(vertIdx, in, i);
- vertIdx++;
- }
-
- // The attributes for each tessellated vertex are the displacement along
- // the circle perimeter. The point shader will read these attributes and
- // displace the vertices in screen coordinates so the circles are always
- // camera facing (bilboards)
- tess.pointOffsets[2 * attribIdx + 0] = 0;
- tess.pointOffsets[2 * attribIdx + 1] = 0;
- attribIdx++;
- float val = 0;
- float inc = (float) SINCOS_LENGTH / perim;
- for (int k = 0; k < perim; k++) {
- tess.pointOffsets[2 * attribIdx + 0] =
- 0.5f * cosLUT[(int) val] * strokeWeight;
- tess.pointOffsets[2 * attribIdx + 1] =
- 0.5f * sinLUT[(int) val] * strokeWeight;
- val = (val + inc) % SINCOS_LENGTH;
- attribIdx++;
- }
-
- // Adding vert0 to take into account the triangles of all
- // the preceding points.
- for (int k = 1; k < nPtVert - 1; k++) {
- tess.pointIndices[indIdx++] = (short) (count + 0);
- tess.pointIndices[indIdx++] = (short) (count + k);
- tess.pointIndices[indIdx++] = (short) (count + k + 1);
- }
- // Final triangle between the last and first point:
- tess.pointIndices[indIdx++] = (short) (count + 0);
- tess.pointIndices[indIdx++] = (short) (count + 1);
- tess.pointIndices[indIdx++] = (short) (count + nPtVert - 1);
-
- cache.incCounts(index, 3 * (nPtVert - 1), nPtVert);
- }
- lastPointIndexCache = index;
- }
-
- void tessellateRoundPoints2D(int nvertTot, int nindTot, int nPtVert) {
- int perim = nPtVert - 1;
- tess.polyVertexCheck(nvertTot);
- tess.polyIndexCheck(nindTot);
- int vertIdx = tess.firstPolyVertex;
- int indIdx = tess.firstPolyIndex;
- IndexCache cache = tess.polyIndexCache;
- int index = in.renderMode == RETAINED ? cache.addNew() : cache.getLast();
- firstPointIndexCache = index;
- for (int i = in.firstVertex; i <= in.lastVertex; i++) {
- int count = cache.vertexCount[index];
- if (PGL.MAX_VERTEX_INDEX1 <= count + nPtVert) {
- // We need to start a new index block for this point.
- index = cache.addNew();
- count = 0;
- }
-
- float x0 = in.vertices[3 * i + 0];
- float y0 = in.vertices[3 * i + 1];
- int rgba = in.strokeColors[i];
-
- float val = 0;
- float inc = (float) SINCOS_LENGTH / perim;
- tess.setPolyVertex(vertIdx, x0, y0, 0, rgba);
- vertIdx++;
- for (int k = 0; k < perim; k++) {
- tess.setPolyVertex(vertIdx,
- x0 + 0.5f * cosLUT[(int) val] * strokeWeight,
- y0 + 0.5f * sinLUT[(int) val] * strokeWeight,
- 0, rgba);
- vertIdx++;
- val = (val + inc) % SINCOS_LENGTH;
- }
-
- // Adding vert0 to take into account the triangles of all
- // the preceding points.
- for (int k = 1; k < nPtVert - 1; k++) {
- tess.polyIndices[indIdx++] = (short) (count + 0);
- tess.polyIndices[indIdx++] = (short) (count + k);
- tess.polyIndices[indIdx++] = (short) (count + k + 1);
- }
- // Final triangle between the last and first point:
- tess.polyIndices[indIdx++] = (short) (count + 0);
- tess.polyIndices[indIdx++] = (short) (count + 1);
- tess.polyIndices[indIdx++] = (short) (count + nPtVert - 1);
-
- cache.incCounts(index, 3 * (nPtVert - 1), nPtVert);
- }
- lastPointIndexCache = lastPolyIndexCache = index;
- }
-
- void tessellateSquarePoints() {
- int nInVert = in.lastVertex - in.firstVertex + 1;
- if (stroke && 1 <= nInVert) {
- updateTex();
- int quadCount = nInVert; // Each point generates a separate quad.
- // Each quad is formed by 5 vertices, the center one
- // is the input vertex, and the other 4 define the
- // corners (so, a triangle fan again).
- int nvertTot = 5 * quadCount;
- // So the quad is formed by 4 triangles, each requires
- // 3 indices.
- int nindTot = 12 * quadCount;
- if (is3D) {
- tessellateSquarePoints3D(nvertTot, nindTot);
- } else if (is2D) {
- beginNoTex();
- tessellateSquarePoints2D(nvertTot, nindTot);
- endNoTex();
- }
- }
- }
-
- void tessellateSquarePoints3D(int nvertTot, int nindTot) {
- tess.pointVertexCheck(nvertTot);
- tess.pointIndexCheck(nindTot);
- int vertIdx = tess.firstPointVertex;
- int attribIdx = tess.firstPointVertex;
- int indIdx = tess.firstPointIndex;
- IndexCache cache = tess.pointIndexCache;
- int index = in.renderMode == RETAINED ? cache.addNew() : cache.getLast();
- firstPointIndexCache = index;
- for (int i = in.firstVertex; i <= in.lastVertex; i++) {
- int nvert = 5;
- int count = cache.vertexCount[index];
- if (PGL.MAX_VERTEX_INDEX1 <= count + nvert) {
- // We need to start a new index block for this point.
- index = cache.addNew();
- count = 0;
- }
-
- for (int k = 0; k < nvert; k++) {
- tess.setPointVertex(vertIdx, in, i);
- vertIdx++;
- }
-
- // The attributes for each tessellated vertex are the displacement along
- // the quad corners. The point shader will read these attributes and
- // displace the vertices in screen coordinates so the quads are always
- // camera facing (bilboards)
- tess.pointOffsets[2 * attribIdx + 0] = 0;
- tess.pointOffsets[2 * attribIdx + 1] = 0;
- attribIdx++;
- for (int k = 0; k < 4; k++) {
- tess.pointOffsets[2 * attribIdx + 0] =
- 0.5f * QUAD_POINT_SIGNS[k][0] * strokeWeight;
- tess.pointOffsets[2 * attribIdx + 1] =
- 0.5f * QUAD_POINT_SIGNS[k][1] * strokeWeight;
- attribIdx++;
- }
-
- // Adding firstVert to take into account the triangles of all
- // the preceding points.
- for (int k = 1; k < nvert - 1; k++) {
- tess.pointIndices[indIdx++] = (short) (count + 0);
- tess.pointIndices[indIdx++] = (short) (count + k);
- tess.pointIndices[indIdx++] = (short) (count + k + 1);
- }
- // Final triangle between the last and first point:
- tess.pointIndices[indIdx++] = (short) (count + 0);
- tess.pointIndices[indIdx++] = (short) (count + 1);
- tess.pointIndices[indIdx++] = (short) (count + nvert - 1);
-
- cache.incCounts(index, 12, 5);
- }
- lastPointIndexCache = index;
- }
-
- void tessellateSquarePoints2D(int nvertTot, int nindTot) {
- tess.polyVertexCheck(nvertTot);
- tess.polyIndexCheck(nindTot);
- int vertIdx = tess.firstPolyVertex;
- int indIdx = tess.firstPolyIndex;
- IndexCache cache = tess.polyIndexCache;
- int index = in.renderMode == RETAINED ? cache.addNew() : cache.getLast();
- firstPointIndexCache = index;
- for (int i = in.firstVertex; i <= in.lastVertex; i++) {
- int nvert = 5;
- int count = cache.vertexCount[index];
- if (PGL.MAX_VERTEX_INDEX1 <= count + nvert) {
- // We need to start a new index block for this point.
- index = cache.addNew();
- count = 0;
- }
-
- float x0 = in.vertices[3 * i + 0];
- float y0 = in.vertices[3 * i + 1];
- int rgba = in.strokeColors[i];
-
- tess.setPolyVertex(vertIdx, x0, y0, 0, rgba);
- vertIdx++;
- for (int k = 0; k < nvert - 1; k++) {
- tess.setPolyVertex(vertIdx,
- x0 + 0.5f * QUAD_POINT_SIGNS[k][0] * strokeWeight,
- y0 + 0.5f * QUAD_POINT_SIGNS[k][1] * strokeWeight,
- 0, rgba);
- vertIdx++;
- }
-
- for (int k = 1; k < nvert - 1; k++) {
- tess.polyIndices[indIdx++] = (short) (count + 0);
- tess.polyIndices[indIdx++] = (short) (count + k);
- tess.polyIndices[indIdx++] = (short) (count + k + 1);
- }
- // Final triangle between the last and first point:
- tess.polyIndices[indIdx++] = (short) (count + 0);
- tess.polyIndices[indIdx++] = (short) (count + 1);
- tess.polyIndices[indIdx++] = (short) (count + nvert - 1);
-
- cache.incCounts(index, 12, 5);
- }
- lastPointIndexCache = lastPolyIndexCache = index;
- }
-
- // -----------------------------------------------------------------
- //
- // Line tessellation
-
- void tessellateLines() {
- int nInVert = in.lastVertex - in.firstVertex + 1;
- if (stroke && 2 <= nInVert) {
- updateTex();
- int lineCount = nInVert / 2; // Each individual line is formed by two consecutive input vertices.
- if (is3D) {
- tessellateLines3D(lineCount);
- } else if (is2D) {
- beginNoTex(); // Line geometry in 2D are stored in the poly array next to the fill triangles, but w/out textures.
- tessellateLines2D(lineCount);
- endNoTex();
- }
- }
- }
-
- void tessellateLines3D(int lineCount) {
- // Lines are made up of 4 vertices defining the quad.
- int nvert = lineCount * 4;
- // Each stroke line has 4 vertices, defining 2 triangles, which
- // require 3 indices to specify their connectivities.
- int nind = lineCount * 2 * 3;
-
- int first = in.firstVertex;
- tess.lineVertexCheck(nvert);
- tess.lineIndexCheck(nind);
- int index = in.renderMode == RETAINED ? tess.lineIndexCache.addNew() :
- tess.lineIndexCache.getLast();
- firstLineIndexCache = index;
- for (int ln = 0; ln < lineCount; ln++) {
- int i0 = first + 2 * ln + 0;
- int i1 = first + 2 * ln + 1;
- index = addLine3D(i0, i1, index, null, false);
- }
- lastLineIndexCache = index;
- }
-
- void tessellateLines2D(int lineCount) {
- int nvert = lineCount * 4;
- int nind = lineCount * 2 * 3;
-
- int first = in.firstVertex;
- if (noCapsJoins(nvert)) {
- tess.polyVertexCheck(nvert);
- tess.polyIndexCheck(nind);
- int index = in.renderMode == RETAINED ? tess.polyIndexCache.addNew() :
- tess.polyIndexCache.getLast();
- firstLineIndexCache = index;
- if (firstPolyIndexCache == -1) firstPolyIndexCache = index; // If the geometry has no fill, needs the first poly index.
- for (int ln = 0; ln < lineCount; ln++) {
- int i0 = first + 2 * ln + 0;
- int i1 = first + 2 * ln + 1;
- index = addLine2D(i0, i1, index, false);
- }
- lastLineIndexCache = lastPolyIndexCache = index;
- } else { // full stroking algorithm
- LinePath path = new LinePath(LinePath.WIND_NON_ZERO);
- for (int ln = 0; ln < lineCount; ln++) {
- int i0 = first + 2 * ln + 0;
- int i1 = first + 2 * ln + 1;
- path.moveTo(in.vertices[3 * i0 + 0], in.vertices[3 * i0 + 1]);
- path.lineTo(in.vertices[3 * i1 + 0], in.vertices[3 * i1 + 1]);
- }
- tessellateLinePath(path);
- }
- }
-
- void tessellateLineStrip() {
- int nInVert = in.lastVertex - in.firstVertex + 1;
- if (stroke && 2 <= nInVert) {
- updateTex();
- int lineCount = nInVert - 1;
- if (is3D) {
- tessellateLineStrip3D(lineCount);
- } else if (is2D) {
- beginNoTex();
- tessellateLineStrip2D(lineCount);
- endNoTex();
- }
- }
- }
-
- void tessellateLineStrip3D(int lineCount) {
- int nBevelTr = noCapsJoins() ? 0 : (lineCount - 1);
- int nvert = lineCount * 4 + nBevelTr;
- int nind = lineCount * 2 * 3 + nBevelTr * 2 * 3;
-
- tess.lineVertexCheck(nvert);
- tess.lineIndexCheck(nind);
- int index = in.renderMode == RETAINED ? tess.lineIndexCache.addNew() :
- tess.lineIndexCache.getLast();
- firstLineIndexCache = index;
- int i0 = in.firstVertex;
- short[] lastInd = {-1, -1};
- for (int ln = 0; ln < lineCount; ln++) {
- int i1 = in.firstVertex + ln + 1;
- if (0 < nBevelTr) {
- index = addLine3D(i0, i1, index, lastInd, false);
- } else {
- index = addLine3D(i0, i1, index, null, false);
- }
- i0 = i1;
- }
- lastLineIndexCache = index;
- }
-
- void tessellateLineStrip2D(int lineCount) {
- int nvert = lineCount * 4;
- int nind = lineCount * 2 * 3;
-
- if (noCapsJoins(nvert)) {
- tess.polyVertexCheck(nvert);
- tess.polyIndexCheck(nind);
- int index = in.renderMode == RETAINED ? tess.polyIndexCache.addNew() :
- tess.polyIndexCache.getLast();
- firstLineIndexCache = index;
- if (firstPolyIndexCache == -1) firstPolyIndexCache = index; // If the geometry has no fill, needs the first poly index.
- int i0 = in.firstVertex;
- for (int ln = 0; ln < lineCount; ln++) {
- int i1 = in.firstVertex + ln + 1;
- index = addLine2D(i0, i1, index, false);
- i0 = i1;
- }
- lastLineIndexCache = lastPolyIndexCache = index;
- } else { // full stroking algorithm
- int first = in.firstVertex;
- LinePath path = new LinePath(LinePath.WIND_NON_ZERO);
- path.moveTo(in.vertices[3 * first + 0], in.vertices[3 * first + 1]);
- for (int ln = 0; ln < lineCount; ln++) {
- int i1 = first + ln + 1;
- path.lineTo(in.vertices[3 * i1 + 0], in.vertices[3 * i1 + 1]);
- }
- tessellateLinePath(path);
- }
- }
-
- void tessellateLineLoop() {
- int nInVert = in.lastVertex - in.firstVertex + 1;
- if (stroke && 2 <= nInVert) {
- updateTex();
- int lineCount = nInVert;
- if (is3D) {
- tessellateLineLoop3D(lineCount);
- } else if (is2D) {
- beginNoTex();
- tessellateLineLoop2D(lineCount);
- endNoTex();
- }
- }
- }
-
- void tessellateLineLoop3D(int lineCount) {
- // TODO: This calculation doesn't add the bevel join between
- // the first and last vertex, need to fix.
- int nBevelTr = noCapsJoins() ? 0 : (lineCount - 1);
- int nvert = lineCount * 4 + nBevelTr;
- int nind = lineCount * 2 * 3 + nBevelTr * 2 * 3;
-
- tess.lineVertexCheck(nvert);
- tess.lineIndexCheck(nind);
- int index = in.renderMode == RETAINED ? tess.lineIndexCache.addNew() :
- tess.lineIndexCache.getLast();
- firstLineIndexCache = index;
- int i0 = in.firstVertex;
- short[] lastInd = {-1, -1};
- for (int ln = 0; ln < lineCount - 1; ln++) {
- int i1 = in.firstVertex + ln + 1;
- if (0 < nBevelTr) {
- index = addLine3D(i0, i1, index, lastInd, false);
- } else {
- index = addLine3D(i0, i1, index, null, false);
- }
- i0 = i1;
- }
- index = addLine3D(in.lastVertex, in.firstVertex, index, lastInd, false);
- lastLineIndexCache = index;
- }
-
- void tessellateLineLoop2D(int lineCount) {
- int nvert = lineCount * 4;
- int nind = lineCount * 2 * 3;
-
- if (noCapsJoins(nvert)) {
- tess.polyVertexCheck(nvert);
- tess.polyIndexCheck(nind);
- int index = in.renderMode == RETAINED ? tess.polyIndexCache.addNew() :
- tess.polyIndexCache.getLast();
- firstLineIndexCache = index;
- if (firstPolyIndexCache == -1) firstPolyIndexCache = index; // If the geometry has no fill, needs the first poly index.
- int i0 = in.firstVertex;
- for (int ln = 0; ln < lineCount - 1; ln++) {
- int i1 = in.firstVertex + ln + 1;
- index = addLine2D(i0, i1, index, false);
- i0 = i1;
- }
- index = addLine2D(in.lastVertex, in.firstVertex, index, false);
- lastLineIndexCache = lastPolyIndexCache = index;
- } else { // full stroking algorithm
- int first = in.firstVertex;
- LinePath path = new LinePath(LinePath.WIND_NON_ZERO);
- path.moveTo(in.vertices[3 * first + 0], in.vertices[3 * first + 1]);
- for (int ln = 0; ln < lineCount - 1; ln++) {
- int i1 = first + ln + 1;
- path.lineTo(in.vertices[3 * i1 + 0], in.vertices[3 * i1 + 1]);
- }
- path.closePath();
- tessellateLinePath(path);
- }
- }
-
- void tessellateEdges() {
- if (stroke) {
- if (in.edgeCount == 0) {
- return;
- }
- if (is3D) {
- tessellateEdges3D();
- } else if (is2D) {
- beginNoTex();
- tessellateEdges2D();
- endNoTex();
- }
- }
- }
-
- void tessellateEdges3D() {
- // This calculation doesn't add the bevel join between
- // the first and last vertex, need to fix.
- boolean bevel = !noCapsJoins();
- int nInVert = in.getNumEdgeVertices(bevel);
- int nInInd = in.getNumEdgeIndices(bevel);
-
- tess.lineVertexCheck(nInVert);
- tess.lineIndexCheck(nInInd);
- int index = in.renderMode == RETAINED ? tess.lineIndexCache.addNew() :
- tess.lineIndexCache.getLast();
- firstLineIndexCache = index;
- short[] lastInd = {-1, -1};
- for (int i = in.firstEdge; i <= in.lastEdge; i++) {
- int[] edge = in.edges[i];
- int i0 = edge[0];
- int i1 = edge[1];
- if (bevel) {
- index = addLine3D(i0, i1, index, lastInd, true);
- if (edge[2] == EDGE_STOP || edge[2] == EDGE_SINGLE) {
- // No join with next line segment.
- lastInd[0] = lastInd[1] = -1;
- }
- } else {
- index = addLine3D(i0, i1, index, null, true);
- }
- }
- lastLineIndexCache = index;
- }
-
- void tessellateEdges2D() {
- int nInVert = in.getNumEdgeVertices(false);
- if (noCapsJoins(nInVert)) {
- int nInInd = in.getNumEdgeIndices(false);
-
- tess.polyVertexCheck(nInVert);
- tess.polyIndexCheck(nInInd);
- int index = in.renderMode == RETAINED ? tess.polyIndexCache.addNew() :
- tess.polyIndexCache.getLast();
- firstLineIndexCache = index;
- if (firstPolyIndexCache == -1) firstPolyIndexCache = index; // If the geometry has no fill, needs the first poly index.
- for (int i = in.firstEdge; i <= in.lastEdge; i++) {
- int[] edge = in.edges[i];
- int i0 = edge[0];
- int i1 = edge[1];
- index = addLine2D(i0, i1, index, true);
- }
- lastLineIndexCache = lastPolyIndexCache = index;
- } else { // full stroking algorithm
- LinePath path = new LinePath(LinePath.WIND_NON_ZERO);
- for (int i = in.firstEdge; i <= in.lastEdge; i++) {
- int[] edge = in.edges[i];
- int i0 = edge[0];
- int i1 = edge[1];
- switch (edge[2]) {
- case EDGE_MIDDLE:
- path.lineTo(in.vertices[3 * i1 + 0], in.vertices[3 * i1 + 1]);
- break;
- case EDGE_START:
- path.moveTo(in.vertices[3 * i0 + 0], in.vertices[3 * i0 + 1]);
- path.lineTo(in.vertices[3 * i1 + 0], in.vertices[3 * i1 + 1]);
- break;
- case EDGE_STOP:
- path.lineTo(in.vertices[3 * i1 + 0], in.vertices[3 * i1 + 1]);
- path.moveTo(in.vertices[3 * i1 + 0], in.vertices[3 * i1 + 1]);
- break;
- case EDGE_SINGLE:
- path.moveTo(in.vertices[3 * i0 + 0], in.vertices[3 * i0 + 1]);
- path.lineTo(in.vertices[3 * i1 + 0], in.vertices[3 * i1 + 1]);
- path.moveTo(in.vertices[3 * i1 + 0], in.vertices[3 * i1 + 1]);
- break;
- }
- }
- tessellateLinePath(path);
- }
- }
-
- // Adding the data that defines a quad starting at vertex i0 and
- // ending at i1.
- int addLine3D(int i0, int i1, int index, short[] lastInd,
- boolean constStroke) {
- IndexCache cache = tess.lineIndexCache;
- int count = cache.vertexCount[index];
- boolean addBevel = lastInd != null && -1 < lastInd[0] && -1 < lastInd[1];
- boolean newCache = false;
- if (PGL.MAX_VERTEX_INDEX1 <= count + 4 + (addBevel ? 1 : 0)) {
- // We need to start a new index block for this line.
- index = cache.addNew();
- count = 0;
- newCache = true;
- }
- int iidx = cache.indexOffset[index] + cache.indexCount[index];
- int vidx = cache.vertexOffset[index] + cache.vertexCount[index];
- int color, color0;
- float weight;
-
- color0 = color = constStroke ? strokeColor : in.strokeColors[i0];
- weight = constStroke ? strokeWeight : in.strokeWeights[i0];
-
- tess.setLineVertex(vidx++, in, i0, i1, color, +weight/2);
- tess.lineIndices[iidx++] = (short) (count + 0);
-
- tess.setLineVertex(vidx++, in, i0, i1, color, -weight/2);
- tess.lineIndices[iidx++] = (short) (count + 1);
-
- color = constStroke ? strokeColor : in.strokeColors[i1];
- weight = constStroke ? strokeWeight : in.strokeWeights[i1];
-
- tess.setLineVertex(vidx++, in, i1, i0, color, -weight/2);
- tess.lineIndices[iidx++] = (short) (count + 2);
-
- // Starting a new triangle re-using prev vertices.
- tess.lineIndices[iidx++] = (short) (count + 2);
- tess.lineIndices[iidx++] = (short) (count + 1);
-
- tess.setLineVertex(vidx++, in, i1, i0, color, +weight/2);
- tess.lineIndices[iidx++] = (short) (count + 3);
-
- cache.incCounts(index, 6, 4);
-
- if (lastInd != null) {
- if (-1 < lastInd[0] && -1 < lastInd[1]) {
- // Adding bevel triangles
- tess.setLineVertex(vidx, in, i0, color0);
-
- if (newCache) {
- PGraphics.showWarning(TOO_LONG_STROKE_PATH_ERROR);
-
- // TODO: Fix this situation, the vertices from the previous cache
- // block should be copied in the newly created one.
- tess.lineIndices[iidx++] = (short) (count + 4);
- tess.lineIndices[iidx++] = (short) (count + 0);
- tess.lineIndices[iidx++] = (short) (count + 0);
-
- tess.lineIndices[iidx++] = (short) (count + 4);
- tess.lineIndices[iidx++] = (short) (count + 1);
- tess.lineIndices[iidx ] = (short) (count + 1);
- } else {
- tess.lineIndices[iidx++] = (short) (count + 4);
- tess.lineIndices[iidx++] = lastInd[0];
- tess.lineIndices[iidx++] = (short) (count + 0);
-
- tess.lineIndices[iidx++] = (short) (count + 4);
- tess.lineIndices[iidx++] = lastInd[1];
- tess.lineIndices[iidx ] = (short) (count + 1);
- }
-
- cache.incCounts(index, 6, 1);
- }
-
- // Vertices for next bevel
- lastInd[0] = (short) (count + 2);
- lastInd[1] = (short) (count + 3);
- }
- return index;
- }
-
- // Adding the data that defines a quad starting at vertex i0 and
- // ending at i1, in the case of pure 2D renderers (line geometry
- // is added to the poly arrays).
- int addLine2D(int i0, int i1, int index, boolean constStroke) {
- IndexCache cache = tess.polyIndexCache;
- int count = cache.vertexCount[index];
- if (PGL.MAX_VERTEX_INDEX1 <= count + 4) {
- // We need to start a new index block for this line.
- index = cache.addNew();
- count = 0;
- }
- int iidx = cache.indexOffset[index] + cache.indexCount[index];
- int vidx = cache.vertexOffset[index] + cache.vertexCount[index];
-
- int color = constStroke ? strokeColor : in.strokeColors[i0];
- float weight = constStroke ? strokeWeight : in.strokeWeights[i0];
-
- float x0 = in.vertices[3 * i0 + 0];
- float y0 = in.vertices[3 * i0 + 1];
-
- float x1 = in.vertices[3 * i1 + 0];
- float y1 = in.vertices[3 * i1 + 1];
-
- // Calculating direction and normal of the line.
- float dirx = x1 - x0;
- float diry = y1 - y0;
- float llen = PApplet.sqrt(dirx * dirx + diry * diry);
- float normx = 0, normy = 0;
- if (nonZero(llen)) {
- normx = -diry / llen;
- normy = +dirx / llen;
- }
-
- tess.setPolyVertex(vidx++, x0 + normx * weight/2, y0 + normy * weight/2,
- 0, color);
- tess.polyIndices[iidx++] = (short) (count + 0);
-
- tess.setPolyVertex(vidx++, x0 - normx * weight/2, y0 - normy * weight/2,
- 0, color);
- tess.polyIndices[iidx++] = (short) (count + 1);
-
- if (!constStroke) {
- color = in.strokeColors[i1];
- weight = in.strokeWeights[i1];
- }
-
- tess.setPolyVertex(vidx++, x1 - normx * weight/2, y1 - normy * weight/2,
- 0, color);
- tess.polyIndices[iidx++] = (short) (count + 2);
-
- // Starting a new triangle re-using prev vertices.
- tess.polyIndices[iidx++] = (short) (count + 2);
- tess.polyIndices[iidx++] = (short) (count + 0);
-
- tess.setPolyVertex(vidx++, x1 + normx * weight/2, y1 + normy * weight/2,
- 0, color);
- tess.polyIndices[iidx++] = (short) (count + 3);
-
- cache.incCounts(index, 6, 4);
- return index;
- }
-
- boolean noCapsJoins(int nInVert) {
- if (!accurate2DStrokes) {
- return true;
- } else if (PGL.MAX_CAPS_JOINS_LENGTH <= nInVert) {
- // The line path is too long, so it could make the GLU tess
- // to run out of memory, so full caps and joins are disabled.
- return true;
- } else {
- return noCapsJoins();
- }
- }
-
- boolean noCapsJoins() {
- // We first calculate the (volumetric) scaling factor that is associated
- // to the current transformation matrix, which is given by the absolute
- // value of its determinant:
- float scaleFactor = 1;
-
- if (transform != null) {
- if (transform instanceof PMatrix2D) {
- PMatrix2D tr = (PMatrix2D)transform;
- float areaScaleFactor = Math.abs(tr.m00 * tr.m11 - tr.m01 * tr.m10);
- scaleFactor = (float) Math.sqrt(areaScaleFactor);
- } else if (transform instanceof PMatrix3D) {
- PMatrix3D tr = (PMatrix3D)transform;
- float volumeScaleFactor =
- Math.abs(tr.m00 * (tr.m11 * tr.m22 - tr.m12 * tr.m21) +
- tr.m01 * (tr.m12 * tr.m20 - tr.m10 * tr.m22) +
- tr.m02 * (tr.m10 * tr.m21 - tr.m11 * tr.m20));
- scaleFactor = (float) Math.pow(volumeScaleFactor, 1.0f / 3.0f);
- }
- }
-
- // The stroke weight is scaled so it correspons to the current
- // "zoom level" being applied on the geometry due to scaling:
- return scaleFactor * strokeWeight < PGL.MIN_CAPS_JOINS_WEIGHT;
- }
-
- // -----------------------------------------------------------------
- //
- // Polygon primitives tessellation
-
- void tessellateTriangles() {
- beginTex();
- int nInVert = in.lastVertex - in.firstVertex + 1;
- if (fill && 3 <= nInVert) {
- int nInInd = nInVert;
- setRawSize(nInInd);
- int idx = 0;
- for (int i = in.firstVertex; i <= in.lastVertex; i++) {
- rawIndices[idx++] = i;
- }
- splitRawIndices();
- }
- endTex();
- tessellateEdges();
- }
-
- void tessellateTriangles(int[] indices) {
- beginTex();
- int nInVert = in.lastVertex - in.firstVertex + 1;
- if (fill && 3 <= nInVert) {
- int nInInd = indices.length;
- setRawSize(nInInd);
- PApplet.arrayCopy(indices, rawIndices, nInInd);
- splitRawIndices();
- }
- endTex();
- tessellateEdges();
- }
-
- void tessellateTriangleFan() {
- beginTex();
- int nInVert = in.lastVertex - in.firstVertex + 1;
- if (fill && 3 <= nInVert) {
- int nInInd = 3 * (nInVert - 2);
- setRawSize(nInInd);
- int idx = 0;
- for (int i = in.firstVertex + 1; i < in.lastVertex; i++) {
- rawIndices[idx++] = in.firstVertex;
- rawIndices[idx++] = i;
- rawIndices[idx++] = i + 1;
- }
- splitRawIndices();
- }
- endTex();
- tessellateEdges();
- }
-
- void tessellateTriangleStrip() {
- beginTex();
- int nInVert = in.lastVertex - in.firstVertex + 1;
- if (fill && 3 <= nInVert) {
- int nInInd = 3 * (nInVert - 2);
- setRawSize(nInInd);
- int idx = 0;
- for (int i = in.firstVertex + 1; i < in.lastVertex; i++) {
- rawIndices[idx++] = i;
- if (i % 2 == 0) {
- rawIndices[idx++] = i - 1;
- rawIndices[idx++] = i + 1;
- } else {
- rawIndices[idx++] = i + 1;
- rawIndices[idx++] = i - 1;
- }
- }
- splitRawIndices();
- }
- endTex();
- tessellateEdges();
- }
-
- void tessellateQuads() {
- beginTex();
- int nInVert = in.lastVertex - in.firstVertex + 1;
- if (fill && 4 <= nInVert) {
- int quadCount = nInVert / 4;
- int nInInd = 6 * quadCount;
- setRawSize(nInInd);
- int idx = 0;
- for (int qd = 0; qd < quadCount; qd++) {
- int i0 = in.firstVertex + 4 * qd + 0;
- int i1 = in.firstVertex + 4 * qd + 1;
- int i2 = in.firstVertex + 4 * qd + 2;
- int i3 = in.firstVertex + 4 * qd + 3;
-
- rawIndices[idx++] = i0;
- rawIndices[idx++] = i1;
- rawIndices[idx++] = i2;
-
- rawIndices[idx++] = i2;
- rawIndices[idx++] = i3;
- rawIndices[idx++] = i0;
- }
- splitRawIndices();
- }
- endTex();
- tessellateEdges();
- }
-
- void tessellateQuadStrip() {
- beginTex();
- int nInVert = in.lastVertex - in.firstVertex + 1;
- if (fill && 4 <= nInVert) {
- int quadCount = nInVert / 2 - 1;
- int nInInd = 6 * quadCount;
- setRawSize(nInInd);
- int idx = 0;
- for (int qd = 1; qd < nInVert / 2; qd++) {
- int i0 = in.firstVertex + 2 * (qd - 1);
- int i1 = in.firstVertex + 2 * (qd - 1) + 1;
- int i2 = in.firstVertex + 2 * qd + 1;
- int i3 = in.firstVertex + 2 * qd;
-
- rawIndices[idx++] = i0;
- rawIndices[idx++] = i1;
- rawIndices[idx++] = i3;
-
- rawIndices[idx++] = i1;
- rawIndices[idx++] = i2;
- rawIndices[idx++] = i3;
- }
- splitRawIndices();
- }
- endTex();
- tessellateEdges();
- }
-
- // Uses the raw indices to split the geometry into contiguous
- // index groups when the vertex indices become too large. The basic
- // idea of this algorithm is to scan through the array of raw indices
- // in groups of three vertices at the time (since we are always dealing
- // with triangles) and create a new offset in the index cache once the
- // index values go above the MAX_VERTEX_INDEX constant. The tricky part
- // is that triangles in the new group might refer to vertices in a
- // previous group. Since the index groups are by definition disjoint,
- // these vertices need to be duplicated at the end of the corresponding
- // region in the vertex array.
- //
- // Also to keep in mind, the ordering of the indices affects performance
- // take a look at some of this references:
- // http://gameangst.com/?p=9
- // http://home.comcast.net/~tom_forsyth/papers/fast_vert_cache_opt.html
- // http://www.ludicon.com/castano/blog/2009/02/optimal-grid-rendering/
- void splitRawIndices() {
- tess.polyIndexCheck(rawSize);
- int offset = tess.firstPolyIndex;
-
- // Current index and vertex ranges
- int inInd0 = 0, inInd1 = 0;
- int inMaxVert0 = in.firstVertex, inMaxVert1 = in.firstVertex;
-
- int inMaxVertRef = inMaxVert0; // Reference vertex where last break split occurred
- int inMaxVertRel = -1; // Position of vertices from last range relative to
- // split position.
- dupCount = 0;
-
- IndexCache cache = tess.polyIndexCache;
- // In retained mode, each shape has with its own cache item, since
- // they should always be available to be rendererd individually, even
- // if contained in a larger hierarchy.
- int index = in.renderMode == RETAINED ? cache.addNew() : cache.getLast();
- firstPolyIndexCache = index;
-
- int trCount = rawSize / 3;
- for (int tr = 0; tr < trCount; tr++) {
- if (index == -1) index = cache.addNew();
-
- int i0 = rawIndices[3 * tr + 0];
- int i1 = rawIndices[3 * tr + 1];
- int i2 = rawIndices[3 * tr + 2];
-
- // Vertex indices relative to the last copy position.
- int ii0 = i0 - inMaxVertRef;
- int ii1 = i1 - inMaxVertRef;
- int ii2 = i2 - inMaxVertRef;
-
- // Vertex indices relative to the current group.
- int count = cache.vertexCount[index];
- int ri0, ri1, ri2;
- if (ii0 < 0) {
- addDupIndex(ii0);
- ri0 = ii0;
- } else ri0 = count + ii0;
- if (ii1 < 0) {
- addDupIndex(ii1);
- ri1 = ii1;
- } else ri1 = count + ii1;
- if (ii2 < 0) {
- addDupIndex(ii2);
- ri2 = ii2;
- } else ri2 = count + ii2;
-
- tess.polyIndices[offset + 3 * tr + 0] = (short) ri0;
- tess.polyIndices[offset + 3 * tr + 1] = (short) ri1;
- tess.polyIndices[offset + 3 * tr + 2] = (short) ri2;
-
- inInd1 = 3 * tr + 2;
- inMaxVert1 = PApplet.max(inMaxVert1, PApplet.max(i0, i1, i2));
- inMaxVert0 = PApplet.min(inMaxVert0, PApplet.min(i0, i1, i2));
-
- inMaxVertRel = PApplet.max(inMaxVertRel, PApplet.max(ri0, ri1, ri2));
-
- if ((PGL.MAX_VERTEX_INDEX1 - 3 <= inMaxVertRel + dupCount &&
- inMaxVertRel + dupCount < PGL.MAX_VERTEX_INDEX1) ||
- (tr == trCount - 1)) {
- // The vertex indices of the current group are about to
- // surpass the MAX_VERTEX_INDEX limit, or we are at the last triangle
- // so we need to wrap-up things anyways.
-
- int nondupCount = 0;
- if (0 < dupCount) {
- // Adjusting the negative indices so they correspond to vertices
- // added at the end of the block.
- for (int i = inInd0; i <= inInd1; i++) {
- int ri = tess.polyIndices[offset + i];
- if (ri < 0) {
- tess.polyIndices[offset + i] =
- (short) (inMaxVertRel + 1 + dupIndexPos(ri));
- }
- }
-
- if (inMaxVertRef <= inMaxVert1) {
- // Copy non-duplicated vertices from current region first
- tess.addPolyVertices(in, inMaxVertRef, inMaxVert1);
- nondupCount = inMaxVert1 - inMaxVertRef + 1;
- }
-
- // Copy duplicated vertices from previous regions last
- for (int i = 0; i < dupCount; i++) {
- tess.addPolyVertex(in, dupIndices[i] + inMaxVertRef);
- }
- } else {
- // Copy non-duplicated vertices from current region first
- tess.addPolyVertices(in, inMaxVert0, inMaxVert1);
- nondupCount = inMaxVert1 - inMaxVert0 + 1;
- }
-
- // Increment counts:
- cache.incCounts(index, inInd1 - inInd0 + 1, nondupCount + dupCount);
- lastPolyIndexCache = index;
-
- // Prepare all variables to start next cache:
- index = -1;
- inMaxVertRel = -1;
- inMaxVertRef = inMaxVert1 + 1;
- inMaxVert0 = inMaxVertRef;
- inInd0 = inInd1 + 1;
- if (dupIndices != null) Arrays.fill(dupIndices, 0, dupCount, 0);
- dupCount = 0;
- }
- }
- }
-
- void addDupIndex(int idx) {
- if (dupIndices == null) {
- dupIndices = new int[16];
- }
- if (dupIndices.length == dupCount) {
- int n = dupCount << 1;
-
- int temp[] = new int[n];
- PApplet.arrayCopy(dupIndices, 0, temp, 0, dupCount);
- dupIndices = temp;
- }
-
- if (idx < dupIndices[0]) {
- // Add at the beginning
- for (int i = dupCount; i > 0; i--) dupIndices[i] = dupIndices[i - 1];
- dupIndices[0] = idx;
- dupCount++;
- } else if (dupIndices[dupCount - 1] < idx) {
- // Add at the end
- dupIndices[dupCount] = idx;
- dupCount++;
- } else {
- for (int i = 0; i < dupCount - 1; i++) {
- if (dupIndices[i] == idx) break;
- if (dupIndices[i] < idx && idx < dupIndices[i + 1]) {
- // Insert between i and i + 1:
- for (int j = dupCount; j > i + 1; j--) {
- dupIndices[j] = dupIndices[j - 1];
- }
- dupIndices[i + 1] = idx;
- dupCount++;
- break;
- }
- }
- }
- }
-
- int dupIndexPos(int idx) {
- for (int i = 0; i < dupCount; i++) {
- if (dupIndices[i] == idx) return i;
- }
- return 0;
- }
-
- void setRawSize(int size) {
- int size0 = rawIndices.length;
- if (size0 < size) {
- int size1 = expandArraySize(size0, size);
- expandRawIndices(size1);
- }
- rawSize = size;
- }
-
- void expandRawIndices(int n) {
- int temp[] = new int[n];
- PApplet.arrayCopy(rawIndices, 0, temp, 0, rawSize);
- rawIndices = temp;
- }
-
- void beginTex() {
- setFirstTexIndex(tess.polyIndexCount, tess.polyIndexCache.size - 1);
- }
-
- void endTex() {
- setLastTexIndex(tess.lastPolyIndex, tess.polyIndexCache.size - 1);
- }
-
- void beginNoTex() {
- prevTexImage = newTexImage;
- newTexImage = null;
- setFirstTexIndex(tess.polyIndexCount, tess.polyIndexCache.size - 1);
- }
-
- void endNoTex() {
- setLastTexIndex(tess.lastPolyIndex, tess.polyIndexCache.size - 1);
- }
-
- void updateTex() {
- beginTex();
- endTex();
- }
-
- void setFirstTexIndex(int firstIndex, int firstCache) {
- if (texCache != null) {
- firstTexIndex = firstIndex;
- firstTexCache = PApplet.max(0, firstCache);
- }
- }
-
- void setLastTexIndex(int lastIndex, int lastCache) {
- if (texCache != null) {
- if (prevTexImage != newTexImage || texCache.size == 0) {
- texCache.addTexture(newTexImage, firstTexIndex, firstTexCache,
- lastIndex, lastCache);
- } else {
- texCache.setLastIndex(lastIndex, lastCache);
- }
- }
- }
-
- // -----------------------------------------------------------------
- //
- // Polygon tessellation
-
- void tessellatePolygon(boolean solid, boolean closed, boolean calcNormals) {
- beginTex();
-
- int nInVert = in.lastVertex - in.firstVertex + 1;
-
- if (fill && 3 <= nInVert) {
- firstPolyIndexCache = -1;
-
- callback.init(in.renderMode == RETAINED, false, calcNormals);
-
- gluTess.beginPolygon();
-
- if (solid) {
- // Using NONZERO winding rule for solid polygons.
- gluTess.setWindingRule(PGL.TESS_WINDING_NONZERO);
- } else {
- // Using ODD winding rule to generate polygon with holes.
- gluTess.setWindingRule(PGL.TESS_WINDING_ODD);
- }
-
- gluTess.beginContour();
-
- // Now, iterate over all input data and send to GLU tessellator..
- for (int i = in.firstVertex; i <= in.lastVertex; i++) {
- boolean breakPt = in.breaks[i];
- if (breakPt) {
- gluTess.endContour();
- gluTess.beginContour();
- }
-
- // Separting colors into individual rgba components for interpolation.
- int fa = (in.colors[i] >> 24) & 0xFF;
- int fr = (in.colors[i] >> 16) & 0xFF;
- int fg = (in.colors[i] >> 8) & 0xFF;
- int fb = (in.colors[i] >> 0) & 0xFF;
-
- int aa = (in.ambient[i] >> 24) & 0xFF;
- int ar = (in.ambient[i] >> 16) & 0xFF;
- int ag = (in.ambient[i] >> 8) & 0xFF;
- int ab = (in.ambient[i] >> 0) & 0xFF;
-
- int sa = (in.specular[i] >> 24) & 0xFF;
- int sr = (in.specular[i] >> 16) & 0xFF;
- int sg = (in.specular[i] >> 8) & 0xFF;
- int sb = (in.specular[i] >> 0) & 0xFF;
-
- int ea = (in.emissive[i] >> 24) & 0xFF;
- int er = (in.emissive[i] >> 16) & 0xFF;
- int eg = (in.emissive[i] >> 8) & 0xFF;
- int eb = (in.emissive[i] >> 0) & 0xFF;
-
- // Vertex data includes coordinates, colors, normals, texture
- // coordinates, and material properties.
- double[] vertex = new double[] {
- in.vertices [3*i + 0], in.vertices [3*i + 1], in.vertices[3*i + 2],
- fa, fr, fg, fb,
- in.normals [3*i + 0], in.normals [3*i + 1], in.normals [3*i + 2],
- in.texcoords[2*i + 0], in.texcoords[2*i + 1],
- aa, ar, ag, ab, sa, sr, sg, sb, ea, er, eg, eb, in.shininess[i]};
-
- gluTess.addVertex(vertex);
- }
- gluTess.endContour();
-
- gluTess.endPolygon();
- }
- endTex();
-
- tessellateEdges();
- }
-
- // Tessellates the path given as parameter. This will work only in 2D.
- // Based on the opengl stroke hack described here:
- // http://wiki.processing.org/w/Stroke_attributes_in_OpenGL
- public void tessellateLinePath(LinePath path) {
- callback.init(in.renderMode == RETAINED, true, false);
-
- int cap = strokeCap == ROUND ? LinePath.CAP_ROUND :
- strokeCap == PROJECT ? LinePath.CAP_SQUARE :
- LinePath.CAP_BUTT;
- int join = strokeJoin == ROUND ? LinePath.JOIN_ROUND :
- strokeJoin == BEVEL ? LinePath.JOIN_BEVEL :
- LinePath.JOIN_MITER;
-
- // Make the outline of the stroke from the path
- LinePath strokedPath = LinePath.createStrokedPath(path, strokeWeight,
- cap, join);
-
- gluTess.beginPolygon();
-
- double[] vertex;
- float[] coords = new float[6];
-
- LinePath.PathIterator iter = strokedPath.getPathIterator();
- int rule = iter.getWindingRule();
- switch(rule) {
- case LinePath.WIND_EVEN_ODD:
- gluTess.setWindingRule(PGL.TESS_WINDING_ODD);
- break;
- case LinePath.WIND_NON_ZERO:
- gluTess.setWindingRule(PGL.TESS_WINDING_NONZERO);
- break;
- }
-
- while (!iter.isDone()) {
- float sr = 0;
- float sg = 0;
- float sb = 0;
- float sa = 0;
-
- switch (iter.currentSegment(coords)) {
-
- case LinePath.SEG_MOVETO:
- gluTess.beginContour();
-
- // $FALL-THROUGH$
- case LinePath.SEG_LINETO:
- sa = (strokeColor >> 24) & 0xFF;
- sr = (strokeColor >> 16) & 0xFF;
- sg = (strokeColor >> 8) & 0xFF;
- sb = (strokeColor >> 0) & 0xFF;
-
- // Vertex data includes coordinates, colors, normals, texture
- // coordinates, and material properties.
- vertex = new double[] { coords[0], coords[1], 0,
- sa, sr, sg, sb,
- 0, 0, 1,
- 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0};
-
- gluTess.addVertex(vertex);
-
- break;
- case LinePath.SEG_CLOSE:
- gluTess.endContour();
- break;
- }
- iter.next();
- }
- gluTess.endPolygon();
- }
-
- /////////////////////////////////////////
-
- // Interenting notes about using the GLU tessellator to render thick
- // polylines:
- // http://stackoverflow.com/questions/687173/how-do-i-render-thick-2d-lines-as-polygons
- //
- // "...Since I disliked the tesselator API I lifted the tesselation code
- // from the free SGI OpenGL reference implementation, rewrote the entire
- // front-end and added memory pools to get the number of allocations down.
- // It took two days to do this, but it was well worth it (like factor five
- // performance improvement)..."
- //
- // This C implementation of GLU could be useful:
- // http://code.google.com/p/glues/
- // to eventually come up with an optimized GLU tessellator in native code.
- protected class TessellatorCallback implements PGL.TessellatorCallback {
- boolean calcNormals;
- boolean strokeTess;
- IndexCache cache;
- int cacheIndex;
- int vertFirst;
- int vertCount;
- int primitive;
-
- public void init(boolean addCache, boolean strokeTess, boolean calcNorm) {
- this.strokeTess = strokeTess;
- this.calcNormals = calcNorm;
-
- cache = tess.polyIndexCache;
- if (addCache) {
- cache.addNew();
- }
- }
-
- public void begin(int type) {
- cacheIndex = cache.getLast();
- if (firstPolyIndexCache == -1) {
- firstPolyIndexCache = cacheIndex;
- }
- if (strokeTess && firstLineIndexCache == -1) {
- firstLineIndexCache = cacheIndex;
- }
-
- vertFirst = cache.vertexCount[cacheIndex];
- vertCount = 0;
-
- switch (type) {
- case PGL.TRIANGLE_FAN:
- primitive = TRIANGLE_FAN;
- break;
- case PGL.TRIANGLE_STRIP:
- primitive = TRIANGLE_STRIP;
- break;
- case PGL.TRIANGLES:
- primitive = TRIANGLES;
- break;
- }
- }
-
- public void end() {
- if (PGL.MAX_VERTEX_INDEX1 <= vertFirst + vertCount) {
- // We need a new index block for the new batch of
- // vertices resulting from this primitive. tessVert can
- // be safely assumed here to be less or equal than
- // MAX_VERTEX_INDEX1 because the condition was checked
- // every time a new vertex was emitted (see vertex() below).
- //tessBlock = tess.addFillIndexBlock(tessBlock);
- cacheIndex = cache.addNew();
- vertFirst = 0;
- }
-
- int indCount = 0;
- switch (primitive) {
- case TRIANGLE_FAN:
- indCount = 3 * (vertCount - 2);
- for (int i = 1; i < vertCount - 1; i++) {
- addIndex(0);
- addIndex(i);
- addIndex(i + 1);
- if (calcNormals) calcTriNormal(0, i, i + 1);
- }
- break;
- case TRIANGLE_STRIP:
- indCount = 3 * (vertCount - 2);
- for (int i = 1; i < vertCount - 1; i++) {
- if (i % 2 == 0) {
- addIndex(i + 1);
- addIndex(i);
- addIndex(i - 1);
- if (calcNormals) calcTriNormal(i + 1, i, i - 1);
- } else {
- addIndex(i - 1);
- addIndex(i);
- addIndex(i + 1);
- if (calcNormals) calcTriNormal(i - 1, i, i + 1);
- }
- }
- break;
- case TRIANGLES:
- indCount = vertCount;
- for (int i = 0; i < vertCount; i++) {
- addIndex(i);
- }
- if (calcNormals) {
- for (int tr = 0; tr < vertCount / 3; tr++) {
- int i0 = 3 * tr + 0;
- int i1 = 3 * tr + 1;
- int i2 = 3 * tr + 2;
- calcTriNormal(i0, i1, i2);
- }
- }
- break;
- }
-
- cache.incCounts(cacheIndex, indCount, vertCount);
- lastPolyIndexCache = cacheIndex;
- if (strokeTess) {
- lastLineIndexCache = cacheIndex;
- }
- }
-
- protected void addIndex(int tessIdx) {
- tess.polyIndexCheck();
- tess.polyIndices[tess.polyIndexCount - 1] =
- (short) (vertFirst + tessIdx);
- }
-
- protected void calcTriNormal(int tessIdx0, int tessIdx1, int tessIdx2) {
- tess.calcPolyNormal(vertFirst + tessIdx0, vertFirst + tessIdx1,
- vertFirst + tessIdx2);
- }
-
- public void vertex(Object data) {
- if (data instanceof double[]) {
- double[] d = (double[]) data;
- int l = d.length;
- if (l < 25) {
- throw new RuntimeException("TessCallback vertex() data is not " +
- "of length 25");
- }
-
- if (vertCount < PGL.MAX_VERTEX_INDEX1) {
- // Combining individual rgba components back into int color values
- int fcolor =
- ((int)d[ 3]<<24) | ((int)d[ 4]<<16) | ((int)d[ 5]<<8) | (int)d[ 6];
- int acolor =
- ((int)d[12]<<24) | ((int)d[13]<<16) | ((int)d[14]<<8) | (int)d[15];
- int scolor =
- ((int)d[16]<<24) | ((int)d[17]<<16) | ((int)d[18]<<8) | (int)d[19];
- int ecolor =
- ((int)d[20]<<24) | ((int)d[21]<<16) | ((int)d[22]<<8) | (int)d[23];
-
- tess.addPolyVertex((float) d[ 0], (float) d[ 1], (float) d[ 2],
- fcolor,
- (float) d[ 7], (float) d[ 8], (float) d[ 9],
- (float) d[10], (float) d[11],
- acolor, scolor, ecolor,
- (float) d[24]);
-
- vertCount++;
- } else {
- throw new RuntimeException("The tessellator is generating too " +
- "many vertices, reduce complexity of " +
- "shape.");
- }
-
- } else {
- throw new RuntimeException("TessCallback vertex() data not " +
- "understood");
- }
- }
-
- public void error(int errnum) {
- String estring = pgl.tessError(errnum);
- PGraphics.showWarning(TESSELLATION_ERROR, estring);
- }
-
- /**
- * Implementation of the GLU_TESS_COMBINE callback.
- * @param coords is the 3-vector of the new vertex
- * @param data is the vertex data to be combined, up to four elements.
- * This is useful when mixing colors together or any other
- * user data that was passed in to gluTessVertex.
- * @param weight is an array of weights, one for each element of "data"
- * that should be linearly combined for new values.
- * @param outData is the set of new values of "data" after being
- * put back together based on the weights. it's passed back as a
- * single element Object[] array because that's the closest
- * that Java gets to a pointer.
- */
- public void combine(double[] coords, Object[] data,
- float[] weight, Object[] outData) {
- double[] vertex = new double[25 + 8];
- vertex[0] = coords[0];
- vertex[1] = coords[1];
- vertex[2] = coords[2];
-
- // Calculating the rest of the vertex parameters (color,
- // normal, texcoords) as the linear combination of the
- // combined vertices.
- for (int i = 3; i < 25; i++) {
- vertex[i] = 0;
- for (int j = 0; j < 4; j++) {
- double[] vertData = (double[])data[j];
- if (vertData != null) {
- vertex[i] += weight[j] * vertData[i];
- }
- }
- }
-
- // Normalizing normal vector, since the weighted
- // combination of normal vectors is not necessarily
- // normal.
- double sum = vertex[7] * vertex[7] +
- vertex[8] * vertex[8] +
- vertex[9] * vertex[9];
- double len = Math.sqrt(sum);
- vertex[7] /= len;
- vertex[8] /= len;
- vertex[9] /= len;
-
- outData[0] = vertex;
- }
- }
- }
-}
diff --git a/android/core/src/processing/opengl/PShader.java b/android/core/src/processing/opengl/PShader.java
deleted file mode 100644
index 4c385a0d18..0000000000
--- a/android/core/src/processing/opengl/PShader.java
+++ /dev/null
@@ -1,931 +0,0 @@
-/* -*- mode: java; c-basic-offset: 2; indent-tabs-mode: nil -*- */
-
-/*
- Part of the Processing project - http://processing.org
-
- Copyright (c) 2011-12 Ben Fry and Casey Reas
-
- This library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Lesser General Public
- License as published by the Free Software Foundation; either
- version 2.1 of the License, or (at your option) any later version.
-
- This library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License for more details.
-
- You should have received a copy of the GNU Lesser General
- Public License along with this library; if not, write to the
- Free Software Foundation, Inc., 59 Temple Place, Suite 330,
- Boston, MA 02111-1307 USA
-*/
-
-package processing.opengl;
-
-import processing.core.*;
-
-import java.io.IOException;
-import java.net.URL;
-import java.nio.FloatBuffer;
-import java.nio.IntBuffer;
-import java.util.HashMap;
-
-/**
- * This class encapsulates a GLSL shader program, including a vertex
- * and a fragment shader. Based on the GLSLShader class from GLGraphics, which
- * in turn was originally based in the code by JohnG:
- * http://processing.org/discourse/beta/num_1159494801.html
- *
- * @webref rendering:shaders
- */
-public class PShader {
- // shaders constants
- static protected final int COLOR = 0;
- static protected final int LIGHT = 1;
- static protected final int TEXTURE = 2;
- static protected final int TEXLIGHT = 3;
- static protected final int LINE = 4;
- static protected final int POINT = 5;
-
- protected PApplet parent;
- // The main renderer associated to the parent PApplet.
- protected PGraphicsOpenGL pgMain;
- // We need a reference to the renderer since a shader might
- // be called by different renderers within a single application
- // (the one corresponding to the main surface, or other offscreen
- // renderers).
- protected PGraphicsOpenGL pgCurrent;
-
- protected PGL pgl;
- protected int context; // The context that created this shader.
-
- public int glProgram;
- public int glVertex;
- public int glFragment;
-
- protected URL vertexURL;
- protected URL fragmentURL;
-
- protected String vertexFilename;
- protected String fragmentFilename;
-
- protected String vertexShaderSource;
- protected String fragmentShaderSource;
-
- protected boolean bound;
-
- protected HashMap uniformValues = null;
-
- protected HashMap textures;
- protected int firstTexUnit;
- protected int lastTexUnit;
-
- // Direct buffers to pass shader dat to GL
- protected IntBuffer intBuffer;
- protected FloatBuffer floatBuffer;
-
- public PShader() {
- parent = null;
- pgMain = null;
- pgl = null;
- context = -1;
-
- this.vertexURL = null;
- this.fragmentURL = null;
- this.vertexFilename = null;
- this.fragmentFilename = null;
-
- glProgram = 0;
- glVertex = 0;
- glFragment = 0;
-
- firstTexUnit = 0;
-
- intBuffer = PGL.allocateIntBuffer(1);
- floatBuffer = PGL.allocateFloatBuffer(1);
-
- bound = false;
- }
-
-
-
- public PShader(PApplet parent) {
- this();
- this.parent = parent;
- pgMain = (PGraphicsOpenGL) parent.g;
- pgl = pgMain.pgl;
- context = pgl.createEmptyContext();
- }
-
-
- /**
- * Creates a shader program using the specified vertex and fragment
- * shaders.
- *
- * @param parent the parent program
- * @param vertFilename name of the vertex shader
- * @param fragFilename name of the fragment shader
- */
- public PShader(PApplet parent, String vertFilename, String fragFilename) {
- this.parent = parent;
- pgMain = (PGraphicsOpenGL) parent.g;
- pgl = pgMain.pgl;
-
- this.vertexURL = null;
- this.fragmentURL = null;
- this.vertexFilename = vertFilename;
- this.fragmentFilename = fragFilename;
-
- glProgram = 0;
- glVertex = 0;
- glFragment = 0;
-
- intBuffer = PGL.allocateIntBuffer(1);
- floatBuffer = PGL.allocateFloatBuffer(1);
- }
-
- /**
- * @param vertURL network location of the vertex shader
- * @param fragURL network location of the fragment shader
- */
- public PShader(PApplet parent, URL vertURL, URL fragURL) {
- this.parent = parent;
- pgMain = (PGraphicsOpenGL) parent.g;
- pgl = pgMain.pgl;
-
- this.vertexURL = vertURL;
- this.fragmentURL = fragURL;
- this.vertexFilename = null;
- this.fragmentFilename = null;
-
- glProgram = 0;
- glVertex = 0;
- glFragment = 0;
-
- intBuffer = PGL.allocateIntBuffer(1);
- floatBuffer = PGL.allocateFloatBuffer(1);
- }
-
-
- @Override
- protected void finalize() throws Throwable {
- try {
- if (glVertex != 0) {
- pgMain.finalizeGLSLVertShaderObject(glVertex, context);
- }
- if (glFragment != 0) {
- pgMain.finalizeGLSLFragShaderObject(glFragment, context);
- }
- if (glProgram != 0) {
- pgMain.finalizeGLSLProgramObject(glProgram, context);
- }
- } finally {
- super.finalize();
- }
- }
-
-
- public void setVertexShader(String vertFilename) {
- this.vertexFilename = vertFilename;
- }
-
-
- public void setVertexShader(URL vertURL) {
- this.vertexURL = vertURL;
- }
-
-
- public void setFragmentShader(String fragFilename) {
- this.fragmentFilename = fragFilename;
- }
-
-
- public void setFragmentShader(URL fragURL) {
- this.fragmentURL = fragURL;
- }
-
-
- /**
- * Initializes (if needed) and binds the shader program.
- */
- public void bind() {
- init();
- pgl.useProgram(glProgram);
- bound = true;
- consumeUniforms();
- bindTextures();
- }
-
-
- /**
- * Unbinds the shader program.
- */
- public void unbind() {
- unbindTextures();
- pgl.useProgram(0);
- bound = false;
- }
-
-
- /**
- * Returns true if the shader is bound, false otherwise.
- */
- public boolean bound() {
- return bound;
- }
-
- /**
- * @webref rendering:shaders
- * @brief Sets a variable within the shader
- * @param name the name of the uniform variable to modify
- * @param x first component of the variable to modify
- */
- public void set(String name, int x) {
- setUniformImpl(name, UniformValue.INT1, new int[] { x });
- }
-
- /**
- * @param y second component of the variable to modify. The variable has to be declared with an array/vector type in the shader (i.e.: int[2], vec2)
- */
- public void set(String name, int x, int y) {
- setUniformImpl(name, UniformValue.INT2, new int[] { x, y });
- }
-
- /**
- * @param z third component of the variable to modify. The variable has to be declared with an array/vector type in the shader (i.e.: int[3], vec3)
- */
- public void set(String name, int x, int y, int z) {
- setUniformImpl(name, UniformValue.INT3, new int[] { x, y, z });
- }
-
- /**
- * @param w fourth component of the variable to modify. The variable has to be declared with an array/vector type in the shader (i.e.: int[4], vec4)
- */
- public void set(String name, int x, int y, int z, int w) {
- setUniformImpl(name, UniformValue.INT4, new int[] { x, y, z });
- }
-
-
- public void set(String name, float x) {
- setUniformImpl(name, UniformValue.FLOAT1, new float[] { x });
- }
-
-
- public void set(String name, float x, float y) {
- setUniformImpl(name, UniformValue.FLOAT2, new float[] { x, y });
- }
-
-
- public void set(String name, float x, float y, float z) {
- setUniformImpl(name, UniformValue.FLOAT3, new float[] { x, y, z });
- }
-
-
- public void set(String name, float x, float y, float z, float w) {
- setUniformImpl(name, UniformValue.FLOAT4, new float[] { x, y, z, w });
- }
-
- /**
- * @param vec modifies all the components of an array/vector uniform variable. PVector can only be used if the type of the variable is vec3.
- */
- public void set(String name, PVector vec) {
- setUniformImpl(name, UniformValue.FLOAT3,
- new float[] { vec.x, vec.y, vec.z });
- }
-
-
- public void set(String name, int[] vec) {
- set(name, vec, 1);
- }
-
- /**
- * @param ncoords number of coordinates per element, max 4
- */
- public void set(String name, int[] vec, int ncoords) {
- if (ncoords == 1) {
- setUniformImpl(name, UniformValue.INT1VEC, vec);
- } else if (ncoords == 2) {
- setUniformImpl(name, UniformValue.INT2VEC, vec);
- } else if (ncoords == 3) {
- setUniformImpl(name, UniformValue.INT3VEC, vec);
- } else if (ncoords == 4) {
- setUniformImpl(name, UniformValue.INT4VEC, vec);
- } else if (4 < ncoords) {
- PGraphics.showWarning("Only up to 4 coordinates per element are " +
- "supported.");
- } else {
- PGraphics.showWarning("Wrong number of coordinates: it is negative!");
- }
- }
-
-
- public void set(String name, float[] vec) {
- set(name, vec, 1);
- }
-
-
- public void set(String name, float[] vec, int ncoords) {
- if (ncoords == 1) {
- setUniformImpl(name, UniformValue.FLOAT1VEC, vec);
- } else if (ncoords == 2) {
- setUniformImpl(name, UniformValue.FLOAT2VEC, vec);
- } else if (ncoords == 3) {
- setUniformImpl(name, UniformValue.FLOAT3VEC, vec);
- } else if (ncoords == 4) {
- setUniformImpl(name, UniformValue.FLOAT4VEC, vec);
- } else if (4 < ncoords) {
- PGraphics.showWarning("Only up to 4 coordinates per element are " +
- "supported.");
- } else {
- PGraphics.showWarning("Wrong number of coordinates: it is negative!");
- }
- }
-
- /**
- * @param mat matrix of values
- */
- public void set(String name, PMatrix2D mat) {
- float[] matv = { mat.m00, mat.m01,
- mat.m10, mat.m11 };
- setUniformImpl(name, UniformValue.MAT2, matv);
- }
-
-
- public void set(String name, PMatrix3D mat) {
- set(name, mat, false);
- }
-
- /**
- * @param use3x3 enforces the matrix is 3 x 3
- */
- public void set(String name, PMatrix3D mat, boolean use3x3) {
- if (use3x3) {
- float[] matv = { mat.m00, mat.m01, mat.m02,
- mat.m10, mat.m11, mat.m12,
- mat.m20, mat.m21, mat.m22 };
- setUniformImpl(name, UniformValue.MAT3, matv);
- } else {
- float[] matv = { mat.m00, mat.m01, mat.m02, mat.m03,
- mat.m10, mat.m11, mat.m12, mat.m13,
- mat.m20, mat.m21, mat.m22, mat.m23,
- mat.m30, mat.m31, mat.m32, mat.m33 };
- setUniformImpl(name, UniformValue.MAT4, matv);
- }
- }
-
- /**
- * @param tex sets the sampler uniform variable to read from this image texture
- */
- public void set(String name, PImage tex) {
- setUniformImpl(name, UniformValue.SAMPLER2D, tex);
- }
-
-
-
- /**
- * Returns the ID location of the attribute parameter given its name.
- *
- * @param name String
- * @return int
- */
- protected int getAttributeLoc(String name) {
- init();
- return pgl.getAttribLocation(glProgram, name);
- }
-
-
- /**
- * Returns the ID location of the uniform parameter given its name.
- *
- * @param name String
- * @return int
- */
- protected int getUniformLoc(String name) {
- init();
- return pgl.getUniformLocation(glProgram, name);
- }
-
-
- protected void setAttributeVBO(int loc, int vboId, int size, int type,
- boolean normalized, int stride, int offset) {
- if (-1 < loc) {
- pgl.bindBuffer(PGL.ARRAY_BUFFER, vboId);
- pgl.vertexAttribPointer(loc, size, type, normalized, stride, offset);
- }
- }
-
-
- protected void setUniformValue(int loc, int x) {
- if (-1 < loc) {
- pgl.uniform1i(loc, x);
- }
- }
-
-
- protected void setUniformValue(int loc, int x, int y) {
- if (-1 < loc) {
- pgl.uniform2i(loc, x, y);
- }
- }
-
-
- protected void setUniformValue(int loc, int x, int y, int z) {
- if (-1 < loc) {
- pgl.uniform3i(loc, x, y, z);
- }
- }
-
-
- protected void setUniformValue(int loc, int x, int y, int z, int w) {
- if (-1 < loc) {
- pgl.uniform4i(loc, x, y, z, w);
- }
- }
-
-
- protected void setUniformValue(int loc, float x) {
- if (-1 < loc) {
- pgl.uniform1f(loc, x);
- }
- }
-
- protected void setUniformValue(int loc, float x, float y) {
- if (-1 < loc) {
- pgl.uniform2f(loc, x, y);
- }
- }
-
-
- protected void setUniformValue(int loc, float x, float y, float z) {
- if (-1 < loc) {
- pgl.uniform3f(loc, x, y, z);
- }
- }
-
-
- protected void setUniformValue(int loc, float x, float y, float z, float w) {
- if (-1 < loc) {
- pgl.uniform4f(loc, x, y, z, w);
- }
- }
-
-
- protected void setUniformVector(int loc, int[] vec, int ncoords,
- int length) {
- if (-1 < loc) {
- updateIntBuffer(vec);
- if (ncoords == 1) {
- pgl.uniform1iv(loc, length, intBuffer);
- } else if (ncoords == 2) {
- pgl.uniform2iv(loc, length, intBuffer);
- } else if (ncoords == 3) {
- pgl.uniform3iv(loc, length, intBuffer);
- } else if (ncoords == 4) {
- pgl.uniform3iv(loc, length, intBuffer);
- }
- }
- }
-
-
- protected void setUniformVector(int loc, float[] vec, int ncoords,
- int length) {
- if (-1 < loc) {
- updateFloatBuffer(vec);
- if (ncoords == 1) {
- pgl.uniform1fv(loc, length, floatBuffer);
- } else if (ncoords == 2) {
- pgl.uniform2fv(loc, length, floatBuffer);
- } else if (ncoords == 3) {
- pgl.uniform3fv(loc, length, floatBuffer);
- } else if (ncoords == 4) {
- pgl.uniform4fv(loc, length, floatBuffer);
- }
- }
- }
-
-
- protected void setUniformMatrix(int loc, float[] mat) {
- if (-1 < loc) {
- updateFloatBuffer(mat);
- if (mat.length == 4) {
- pgl.uniformMatrix2fv(loc, 1, false, floatBuffer);
- } else if (mat.length == 9) {
- pgl.uniformMatrix3fv(loc, 1, false, floatBuffer);
- } else if (mat.length == 16) {
- pgl.uniformMatrix4fv(loc, 1, false, floatBuffer);
- }
- }
- }
-
-
- protected void setUniformTex(int loc, Texture tex) {
- // get unit from last value in bindTextures ...
- // pgl.activeTexture(PGL.TEXTURE0 + unit);
- tex.bind();
- }
-
-
- /*
- // The individual attribute setters are not really needed, read this:
- // http://stackoverflow.com/questions/7718976/what-is-glvertexattrib-versus-glvertexattribpointer-used-for
- // except for setting a constant vertex attribute value.
- public void set1FloatAttribute(int loc, float x) {
- if (-1 < loc) {
- pgl.glVertexAttrib1f(loc, x);
- }
- }
-
-
- public void set2FloatAttribute(int loc, float x, float y) {
- if (-1 < loc) {
- pgl.glVertexAttrib2f(loc, x, y);
- }
- }
-
-
- public void set3FloatAttribute(int loc, float x, float y, float z) {
- if (-1 < loc) {
- pgl.glVertexAttrib3f(loc, x, y, z);
- }
- }
-
-
- public void set4FloatAttribute(int loc, float x, float y, float z, float w) {
- if (-1 < loc) {
- pgl.glVertexAttrib4f(loc, x, y, z, w);
- }
- }
- */
-
-
- protected void setUniformImpl(String name, int type, Object value) {
- int loc = getUniformLoc(name);
- if (-1 < loc) {
- if (uniformValues == null) {
- uniformValues = new HashMap();
- }
- uniformValues.put(loc, new UniformValue(type, value));
- } else {
- PGraphics.showWarning("The shader doesn't have a uniform called \"" +
- name + "\"");
- }
- }
-
-
- protected void consumeUniforms() {
- if (uniformValues != null && 0 < uniformValues.size()) {
- lastTexUnit = firstTexUnit;
- for (Integer loc: uniformValues.keySet()) {
- UniformValue val = uniformValues.get(loc);
- if (val.type == UniformValue.INT1) {
- int[] v = ((int[])val.value);
- pgl.uniform1i(loc, v[0]);
- } else if (val.type == UniformValue.INT2) {
- int[] v = ((int[])val.value);
- pgl.uniform2i(loc, v[0], v[1]);
- } else if (val.type == UniformValue.INT3) {
- int[] v = ((int[])val.value);
- pgl.uniform3i(loc, v[0], v[1], v[2]);
- } else if (val.type == UniformValue.INT4) {
- int[] v = ((int[])val.value);
- pgl.uniform4i(loc, v[0], v[1], v[2], v[4]);
- } else if (val.type == UniformValue.FLOAT1) {
- float[] v = ((float[])val.value);
- pgl.uniform1f(loc, v[0]);
- } else if (val.type == UniformValue.FLOAT2) {
- float[] v = ((float[])val.value);
- pgl.uniform2f(loc, v[0], v[1]);
- } else if (val.type == UniformValue.FLOAT3) {
- float[] v = ((float[])val.value);
- pgl.uniform3f(loc, v[0], v[1], v[2]);
- } else if (val.type == UniformValue.FLOAT4) {
- float[] v = ((float[])val.value);
- pgl.uniform4f(loc, v[0], v[1], v[2], v[3]);
- } else if (val.type == UniformValue.INT1VEC) {
- int[] v = ((int[])val.value);
- updateIntBuffer(v);
- pgl.uniform1iv(loc, v.length, intBuffer);
- } else if (val.type == UniformValue.INT2VEC) {
- int[] v = ((int[])val.value);
- updateIntBuffer(v);
- pgl.uniform2iv(loc, v.length / 2, intBuffer);
- } else if (val.type == UniformValue.INT3VEC) {
- int[] v = ((int[])val.value);
- updateIntBuffer(v);
- pgl.uniform3iv(loc, v.length / 3, intBuffer);
- } else if (val.type == UniformValue.INT4VEC) {
- int[] v = ((int[])val.value);
- updateIntBuffer(v);
- pgl.uniform4iv(loc, v.length / 4, intBuffer);
- } else if (val.type == UniformValue.FLOAT1VEC) {
- float[] v = ((float[])val.value);
- updateFloatBuffer(v);
- pgl.uniform1fv(loc, v.length, floatBuffer);
- } else if (val.type == UniformValue.FLOAT2VEC) {
- float[] v = ((float[])val.value);
- updateFloatBuffer(v);
- pgl.uniform2fv(loc, v.length / 2, floatBuffer);
- } else if (val.type == UniformValue.FLOAT3VEC) {
- float[] v = ((float[])val.value);
- updateFloatBuffer(v);
- pgl.uniform3fv(loc, v.length / 3, floatBuffer);
- } else if (val.type == UniformValue.FLOAT4VEC) {
- float[] v = ((float[])val.value);
- updateFloatBuffer(v);
- pgl.uniform4fv(loc, v.length / 4, floatBuffer);
- } else if (val.type == UniformValue.MAT2) {
- float[] v = ((float[])val.value);
- updateFloatBuffer(v);
- pgl.uniformMatrix2fv(loc, 1, false, floatBuffer);
- } else if (val.type == UniformValue.MAT3) {
- float[] v = ((float[])val.value);
- updateFloatBuffer(v);
- pgl.uniformMatrix3fv(loc, 1, false, floatBuffer);
- } else if (val.type == UniformValue.MAT4) {
- float[] v = ((float[])val.value);
- updateFloatBuffer(v);
- pgl.uniformMatrix4fv(loc, 1, false, floatBuffer);
- } else if (val.type == UniformValue.SAMPLER2D) {
- PImage img = (PImage)val.value;
- Texture tex = pgMain.getTexture(img);
- pgl.uniform1i(loc, lastTexUnit);
- if (textures == null) {
- textures = new HashMap();
- }
- textures.put(lastTexUnit, tex);
- lastTexUnit++;
- }
- }
- uniformValues.clear();
- }
- }
-
-
- protected void updateIntBuffer(int[] vec) {
- intBuffer = PGL.updateIntBuffer(intBuffer, vec, false);
- }
-
-
- protected void updateFloatBuffer(float[] vec) {
- floatBuffer = PGL.updateFloatBuffer(floatBuffer, vec, false);
- }
-
-
- protected void bindTextures() {
- if (textures != null) {
- for (int unit: textures.keySet()) {
- Texture tex = textures.get(unit);
- pgl.activeTexture(PGL.TEXTURE0 + unit);
- tex.bind();
- }
- }
- }
-
-
- protected void unbindTextures() {
- if (textures != null) {
- for (int unit: textures.keySet()) {
- Texture tex = textures.get(unit);
- pgl.activeTexture(PGL.TEXTURE0 + unit);
- tex.unbind();
- }
- pgl.activeTexture(PGL.TEXTURE0);
- }
- }
-
-
- protected void init() {
- if (glProgram == 0 || contextIsOutdated()) {
- context = pgl.getCurrentContext();
- glProgram = pgMain.createGLSLProgramObject(context);
-
- boolean hasVert = false;
- if (vertexFilename != null) {
- hasVert = loadVertexShader(vertexFilename);
- } else if (vertexURL != null) {
- hasVert = loadVertexShader(vertexURL);
- } else {
- PGraphics.showException("Vertex shader filenames and URLs are " +
- "both null!");
- }
-
- boolean hasFrag = false;
- if (fragmentFilename != null) {
- hasFrag = loadFragmentShader(fragmentFilename);
- } else if (fragmentURL != null) {
- hasFrag = loadFragmentShader(fragmentURL);
- } else {
- PGraphics.showException("Fragment shader filenames and URLs are " +
- "both null!");
- }
-
- boolean vertRes = true;
- if (hasVert) {
- vertRes = compileVertexShader();
- }
-
- boolean fragRes = true;
- if (hasFrag) {
- fragRes = compileFragmentShader();
- }
-
- if (vertRes && fragRes) {
- if (hasVert) {
- pgl.attachShader(glProgram, glVertex);
- }
- if (hasFrag) {
- pgl.attachShader(glProgram, glFragment);
- }
- pgl.linkProgram(glProgram);
-
- pgl.getProgramiv(glProgram, PGL.LINK_STATUS, intBuffer);
- boolean linked = intBuffer.get(0) == 0 ? false : true;
- if (!linked) {
- PGraphics.showException("Cannot link shader program:\n" +
- pgl.getProgramInfoLog(glProgram));
- }
-
- pgl.validateProgram(glProgram);
- pgl.getProgramiv(glProgram, PGL.VALIDATE_STATUS, intBuffer);
- boolean validated = intBuffer.get(0) == 0 ? false : true;
- if (!validated) {
- PGraphics.showException("Cannot validate shader program:\n" +
- pgl.getProgramInfoLog(glProgram));
- }
- }
- }
- }
-
-
- protected boolean contextIsOutdated() {
- boolean outdated = !pgl.contextIsCurrent(context);
- if (outdated) {
- pgMain.removeGLSLProgramObject(glProgram, context);
- pgMain.removeGLSLVertShaderObject(glVertex, context);
- pgMain.removeGLSLFragShaderObject(glFragment, context);
-
- glProgram = 0;
- glVertex = 0;
- glFragment = 0;
- }
- return outdated;
- }
-
-
- /**
- * Loads and compiles the vertex shader contained in file.
- *
- * @param file String
- */
- protected boolean loadVertexShader(String filename) {
- vertexShaderSource = PApplet.join(parent.loadStrings(filename), "\n");
- return vertexShaderSource != null;
- }
-
-
- /**
- * Loads and compiles the vertex shader contained in the URL.
- *
- * @param file String
- */
- protected boolean loadVertexShader(URL url) {
- try {
- vertexShaderSource = PApplet.join(PApplet.loadStrings(url.openStream()),
- "\n");
- return vertexShaderSource != null;
- } catch (IOException e) {
- PGraphics.showException("Cannot load vertex shader " + url.getFile());
- return false;
- }
- }
-
-
- /**
- * Loads and compiles the fragment shader contained in file.
- *
- * @param file String
- */
- protected boolean loadFragmentShader(String filename) {
- fragmentShaderSource = PApplet.join(parent.loadStrings(filename), "\n");
- return fragmentShaderSource != null;
- }
-
-
- /**
- * Loads and compiles the fragment shader contained in the URL.
- *
- * @param url URL
- */
- protected boolean loadFragmentShader(URL url) {
- try {
- fragmentShaderSource = PApplet.join(PApplet.loadStrings(url.openStream()),
- "\n");
- return fragmentShaderSource != null;
- } catch (IOException e) {
- PGraphics.showException("Cannot load fragment shader " + url.getFile());
- return false;
- }
- }
-
-
- /**
- * @param shaderSource a string containing the shader's code
- */
- protected boolean compileVertexShader() {
- glVertex = pgMain.createGLSLVertShaderObject(context);
-
- pgl.shaderSource(glVertex, vertexShaderSource);
- pgl.compileShader(glVertex);
-
- pgl.getShaderiv(glVertex, PGL.COMPILE_STATUS, intBuffer);
- boolean compiled = intBuffer.get(0) == 0 ? false : true;
- if (!compiled) {
- PGraphics.showException("Cannot compile vertex shader:\n" +
- pgl.getShaderInfoLog(glVertex));
- return false;
- } else {
- return true;
- }
- }
-
-
- /**
- * @param shaderSource a string containing the shader's code
- */
- protected boolean compileFragmentShader() {
- glFragment = pgMain.createGLSLFragShaderObject(context);
-
- pgl.shaderSource(glFragment, fragmentShaderSource);
- pgl.compileShader(glFragment);
-
- pgl.getShaderiv(glFragment, PGL.COMPILE_STATUS, intBuffer);
- boolean compiled = intBuffer.get(0) == 0 ? false : true;
- if (!compiled) {
- PGraphics.showException("Cannot compile fragment shader:\n" +
- pgl.getShaderInfoLog(glFragment));
- return false;
- } else {
- return true;
- }
- }
-
-
- protected void setRenderer(PGraphicsOpenGL pg) {
- pgCurrent = pg;
- }
-
- protected void loadAttributes() { }
-
-
- protected void loadUniforms() { }
-
-
- protected void release() {
- if (glVertex != 0) {
- pgMain.deleteGLSLVertShaderObject(glVertex, context);
- glVertex = 0;
- }
- if (glFragment != 0) {
- pgMain.deleteGLSLFragShaderObject(glFragment, context);
- glFragment = 0;
- }
- if (glProgram != 0) {
- pgMain.deleteGLSLProgramObject(glProgram, context);
- glProgram = 0;
- }
- }
-
- // Class to store a user-specified value for a uniform parameter
- // in the shader
- protected class UniformValue {
- static final int INT1 = 0;
- static final int INT2 = 1;
- static final int INT3 = 2;
- static final int INT4 = 3;
- static final int FLOAT1 = 4;
- static final int FLOAT2 = 5;
- static final int FLOAT3 = 6;
- static final int FLOAT4 = 7;
- static final int INT1VEC = 8;
- static final int INT2VEC = 9;
- static final int INT3VEC = 10;
- static final int INT4VEC = 11;
- static final int FLOAT1VEC = 12;
- static final int FLOAT2VEC = 13;
- static final int FLOAT3VEC = 14;
- static final int FLOAT4VEC = 15;
- static final int MAT2 = 16;
- static final int MAT3 = 17;
- static final int MAT4 = 18;
- static final int SAMPLER2D = 19;
-
- int type;
- Object value;
-
- UniformValue(int type, Object value) {
- this.type = type;
- this.value = value;
- }
- }
-}
diff --git a/android/core/src/processing/opengl/PShapeOpenGL.java b/android/core/src/processing/opengl/PShapeOpenGL.java
deleted file mode 100644
index dac2201d8f..0000000000
--- a/android/core/src/processing/opengl/PShapeOpenGL.java
+++ /dev/null
@@ -1,4437 +0,0 @@
-/* -*- mode: java; c-basic-offset: 2; indent-tabs-mode: nil -*- */
-
-/*
- Part of the Processing project - http://processing.org
-
- Copyright (c) 2011-12 Ben Fry and Casey Reas
-
- This library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Lesser General Public
- License as published by the Free Software Foundation, version 2.1.
-
- This library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License for more details.
-
- You should have received a copy of the GNU Lesser General
- Public License along with this library; if not, write to the
- Free Software Foundation, Inc., 59 Temple Place, Suite 330,
- Boston, MA 02111-1307 USA
-*/
-
-package processing.opengl;
-
-import processing.core.PApplet;
-import processing.core.PConstants;
-import processing.core.PGraphics;
-import processing.core.PImage;
-import processing.core.PMatrix;
-import processing.core.PMatrix2D;
-import processing.core.PMatrix3D;
-import processing.core.PShape;
-import processing.core.PVector;
-import processing.opengl.PGraphicsOpenGL.LineShader;
-import processing.opengl.PGraphicsOpenGL.PointShader;
-import processing.opengl.PGraphicsOpenGL.BaseShader;
-import processing.opengl.PGraphicsOpenGL.IndexCache;
-import processing.opengl.PGraphicsOpenGL.InGeometry;
-import processing.opengl.PGraphicsOpenGL.TessGeometry;
-import processing.opengl.PGraphicsOpenGL.Tessellator;
-
-import java.util.Arrays;
-import java.util.HashSet;
-
-/**
- * This class holds a 3D model composed of vertices, normals, colors
- * (per vertex) and texture coordinates (also per vertex). All this data is
- * stored in Vertex Buffer Objects (VBO) in GPU memory for very fast access.
- * OBJ loading implemented using code from Saito's OBJLoader library:
- * http://code.google.com/p/saitoobjloader/
- * and OBJReader from Ahmet Kizilay
- * http://www.openprocessing.org/visuals/?visualID=191
- * By Andres Colubri
- *
- *
- * Other formats to consider:
- * AMF: http://en.wikipedia.org/wiki/Additive_Manufacturing_File_Format
- * STL: http://en.wikipedia.org/wiki/STL_(file_format)
- * OFF: http://people.sc.fsu.edu/~jburkardt/data/off/off.html(file_format)
- * DXF: http://en.wikipedia.org/wiki/AutoCAD_DXF
- */
-public class PShapeOpenGL extends PShape {
- static protected final int TRANSLATE = 0;
- static protected final int ROTATE = 1;
- static protected final int SCALE = 2;
- static protected final int MATRIX = 3;
-
- protected PGraphicsOpenGL pg;
- protected PGL pgl;
- protected int context; // The context that created this shape.
-
- protected PShapeOpenGL root;
-
- // ........................................................
-
- // Input, tessellated geometry
-
- protected InGeometry inGeo;
- protected TessGeometry tessGeo;
- protected Tessellator tessellator;
-
- // ........................................................
-
- // Texturing
-
- protected HashSet textures;
- protected boolean strokedTexture;
-
- // ........................................................
-
- // OpenGL buffers
-
- public int glPolyVertex;
- public int glPolyColor;
- public int glPolyNormal;
- public int glPolyTexcoord;
- public int glPolyAmbient;
- public int glPolySpecular;
- public int glPolyEmissive;
- public int glPolyShininess;
- public int glPolyIndex;
-
- public int glLineVertex;
- public int glLineColor;
- public int glLineAttrib;
- public int glLineIndex;
-
- public int glPointVertex;
- public int glPointColor;
- public int glPointAttrib;
- public int glPointIndex;
-
- // ........................................................
-
- // Offsets for geometry aggregation and update.
-
- protected int polyVertCopyOffset;
- protected int polyIndCopyOffset;
- protected int lineVertCopyOffset;
- protected int lineIndCopyOffset;
- protected int pointVertCopyOffset;
- protected int pointIndCopyOffset;
-
- protected int polyIndexOffset;
- protected int polyVertexOffset;
- protected int polyVertexAbs;
- protected int polyVertexRel;
-
- protected int lineIndexOffset;
- protected int lineVertexOffset;
- protected int lineVertexAbs;
- protected int lineVertexRel;
-
- protected int pointIndexOffset;
- protected int pointVertexOffset;
- protected int pointVertexAbs;
- protected int pointVertexRel;
-
- protected int firstPolyIndexCache;
- protected int lastPolyIndexCache;
- protected int firstLineIndexCache;
- protected int lastLineIndexCache;
- protected int firstPointIndexCache;
- protected int lastPointIndexCache;
-
- protected int firstPolyVertex;
- protected int lastPolyVertex;
- protected int firstLineVertex;
- protected int lastLineVertex;
- protected int firstPointVertex;
- protected int lastPointVertex;
-
- // ........................................................
-
- // Geometric transformations.
-
- protected PMatrix transform;
-
- // ........................................................
-
- // State/rendering flags
-
- protected boolean tessellated;
- protected boolean needBufferInit;
-
- protected boolean isSolid;
- protected boolean isClosed;
-
- protected boolean breakShape = false;
- protected boolean shapeCreated = false;
-
- // These variables indicate if the shape contains
- // polygon, line and/or point geometry. In the case of
- // 3D shapes, poly geometry is coincident with the fill
- // triangles, as the lines and points are stored separately.
- // However, for 2D shapes the poly geometry contains all of
- // the three since the same rendering shader applies to
- // fill, line and point geometry.
- protected boolean hasPolys;
- protected boolean hasLines;
- protected boolean hasPoints;
-
- // ........................................................
-
- // Modes inherited from renderer
-
- protected int rectMode;
- protected int ellipseMode;
- protected int shapeMode;
- protected int imageMode;
-
- // ........................................................
-
- // Bezier and Catmull-Rom curves
-
- protected int bezierDetail = 20;
- protected int curveDetail = 20;
- protected float curveTightness = 0;
-
- // ........................................................
-
- // Normals
-
- protected float normalX, normalY, normalZ;
-
- // normal calculated per triangle
- static protected final int NORMAL_MODE_AUTO = 0;
- // one normal manually specified per shape
- static protected final int NORMAL_MODE_SHAPE = 1;
- // normals specified for each shape vertex
- static protected final int NORMAL_MODE_VERTEX = 2;
-
- // Current mode for normals, one of AUTO, SHAPE, or VERTEX
- protected int normalMode;
-
- // ........................................................
-
- // Modification variables (used only by the root shape)
-
- protected boolean modified;
-
- protected boolean modifiedPolyVertices;
- protected boolean modifiedPolyColors;
- protected boolean modifiedPolyNormals;
- protected boolean modifiedPolyTexCoords;
- protected boolean modifiedPolyAmbient;
- protected boolean modifiedPolySpecular;
- protected boolean modifiedPolyEmissive;
- protected boolean modifiedPolyShininess;
-
- protected boolean modifiedLineVertices;
- protected boolean modifiedLineColors;
- protected boolean modifiedLineAttributes;
-
- protected boolean modifiedPointVertices;
- protected boolean modifiedPointColors;
- protected boolean modifiedPointAttributes;
-
- protected int firstModifiedPolyVertex;
- protected int lastModifiedPolyVertex;
- protected int firstModifiedPolyColor;
- protected int lastModifiedPolyColor;
- protected int firstModifiedPolyNormal;
- protected int lastModifiedPolyNormal;
- protected int firstModifiedPolyTexcoord;
- protected int lastModifiedPolyTexcoord;
- protected int firstModifiedPolyAmbient;
- protected int lastModifiedPolyAmbient;
- protected int firstModifiedPolySpecular;
- protected int lastModifiedPolySpecular;
- protected int firstModifiedPolyEmissive;
- protected int lastModifiedPolyEmissive;
- protected int firstModifiedPolyShininess;
- protected int lastModifiedPolyShininess;
-
- protected int firstModifiedLineVertex;
- protected int lastModifiedLineVertex;
- protected int firstModifiedLineColor;
- protected int lastModifiedLineColor;
- protected int firstModifiedLineAttribute;
- protected int lastModifiedLineAttribute;
-
- protected int firstModifiedPointVertex;
- protected int lastModifiedPointVertex;
- protected int firstModifiedPointColor;
- protected int lastModifiedPointColor;
- protected int firstModifiedPointAttribute;
- protected int lastModifiedPointAttribute;
-
-
- PShapeOpenGL() {
- }
-
-
- public PShapeOpenGL(PApplet parent, int family) {
- pg = (PGraphicsOpenGL)parent.g;
- pgl = pg.pgl;
- context = pgl.createEmptyContext();
-
- glPolyVertex = 0;
- glPolyColor = 0;
- glPolyNormal = 0;
- glPolyTexcoord = 0;
- glPolyAmbient = 0;
- glPolySpecular = 0;
- glPolyEmissive = 0;
- glPolyShininess = 0;
- glPolyIndex = 0;
-
- glLineVertex = 0;
- glLineColor = 0;
- glLineAttrib = 0;
- glLineIndex = 0;
-
- glPointVertex = 0;
- glPointColor = 0;
- glPointAttrib = 0;
- glPointIndex = 0;
-
- this.tessellator = PGraphicsOpenGL.tessellator;
- this.family = family;
- this.root = this;
- this.parent = null;
- this.tessellated = false;
-
- if (family == GEOMETRY || family == PRIMITIVE || family == PATH) {
- inGeo = pg.newInGeometry(PGraphicsOpenGL.RETAINED);
- }
-
- // Modes are retrieved from the current values in the renderer.
- textureMode = pg.textureMode;
- rectMode = pg.rectMode;
- ellipseMode = pg.ellipseMode;
- shapeMode = pg.shapeMode;
- imageMode = pg.imageMode;
-
- colorMode(pg.colorMode,
- pg.colorModeX, pg.colorModeY, pg.colorModeZ, pg.colorModeA);
-
- // Initial values for fill, stroke and tint colors are also imported from
- // the renderer. This is particular relevant for primitive shapes, since is
- // not possible to set their color separately when creating them, and their
- // input vertices are actually generated at rendering time, by which the
- // color configuration of the renderer might have changed.
- fill = pg.fill;
- fillColor = pg.fillColor;
-
- stroke = pg.stroke;
- strokeColor = pg.strokeColor;
- strokeWeight = pg.strokeWeight;
- strokeCap = pg.strokeCap;
- strokeJoin = pg.strokeJoin;
-
- tint = pg.tint;
- tintColor = pg.tintColor;
-
- setAmbient = pg.setAmbient;
- ambientColor = pg.ambientColor;
- specularColor = pg.specularColor;
- emissiveColor = pg.emissiveColor;
- shininess = pg.shininess;
-
- normalX = normalY = 0;
- normalZ = 1;
-
- normalMode = NORMAL_MODE_AUTO;
-
- // To make sure that the first vertex is marked as a break.
- // Same behavior as in the immediate mode.
- breakShape = true;
-
- if (family == GROUP) {
- // GROUP shapes are always marked as ended.
- shapeCreated = true;
- }
- }
-
-
- @Override
- public void addChild(PShape child) {
- if (child instanceof PShapeOpenGL) {
- if (family == GROUP) {
- PShapeOpenGL c3d = (PShapeOpenGL)child;
-
- super.addChild(c3d);
- c3d.updateRoot(root);
- markForTessellation();
-
- if (c3d.family == GROUP) {
- if (c3d.textures != null) {
- for (PImage tex: c3d.textures) {
- addTexture(tex);
- }
- }
- if (c3d.strokedTexture) {
- strokedTexture(true);
- }
- } else {
- if (c3d.image != null) {
- addTexture(c3d.image);
- if (c3d.stroke) {
- strokedTexture(true);
- }
- }
- }
-
- } else {
- PGraphics.showWarning("Cannot add child shape to non-group shape.");
- }
- } else {
- PGraphics.showWarning("Shape must be 3D to be added to the group.");
- }
- }
-
-
- protected void updateRoot(PShape root) {
- this.root = (PShapeOpenGL) root;
- if (family == GROUP) {
- for (int i = 0; i < childCount; i++) {
- PShapeOpenGL child = (PShapeOpenGL)children[i];
- child.updateRoot(root);
- }
- }
- }
-
-
- @Override
- protected void finalize() throws Throwable {
- try {
- finalizePolyBuffers();
- finalizeLineBuffers();
- finalizePointBuffers();
- } finally {
- super.finalize();
- }
- }
-
-
- protected void finalizePolyBuffers() {
- if (glPolyVertex != 0) {
- pg.finalizeVertexBufferObject(glPolyVertex, context);
- }
-
- if (glPolyColor != 0) {
- pg.finalizeVertexBufferObject(glPolyColor, context);
- }
-
- if (glPolyNormal != 0) {
- pg.finalizeVertexBufferObject(glPolyNormal, context);
- }
-
- if (glPolyTexcoord != 0) {
- pg.finalizeVertexBufferObject(glPolyTexcoord, context);
- }
-
- if (glPolyAmbient != 0) {
- pg.finalizeVertexBufferObject(glPolyAmbient, context);
- }
-
- if (glPolySpecular != 0) {
- pg.finalizeVertexBufferObject(glPolySpecular, context);
- }
-
- if (glPolyEmissive != 0) {
- pg.finalizeVertexBufferObject(glPolyEmissive, context);
- }
-
- if (glPolyShininess != 0) {
- pg.finalizeVertexBufferObject(glPolyShininess, context);
- }
-
- if (glPolyIndex != 0) {
- pg.finalizeVertexBufferObject(glPolyIndex, context);
- }
- }
-
-
- protected void finalizeLineBuffers() {
- if (glLineVertex != 0) {
- pg.finalizeVertexBufferObject(glLineVertex, context);
- }
-
- if (glLineColor != 0) {
- pg.finalizeVertexBufferObject(glLineColor, context);
- }
-
- if (glLineAttrib != 0) {
- pg.finalizeVertexBufferObject(glLineAttrib, context);
- }
-
- if (glLineIndex != 0) {
- pg.finalizeVertexBufferObject(glLineIndex, context);
- }
- }
-
-
- protected void finalizePointBuffers() {
- if (glPointVertex != 0) {
- pg.finalizeVertexBufferObject(glPointVertex, context);
- }
-
- if (glPointColor != 0) {
- pg.finalizeVertexBufferObject(glPointColor, context);
- }
-
- if (glPointAttrib != 0) {
- pg.finalizeVertexBufferObject(glPointAttrib, context);
- }
-
- if (glPointIndex != 0) {
- pg.finalizeVertexBufferObject(glPointIndex, context);
- }
- }
-
- ///////////////////////////////////////////////////////////
-
- //
- // Shape creation (temporary hack)
-
-
- public static PShapeOpenGL createShape3D(PApplet parent, PShape src) {
- PShapeOpenGL dest = null;
- if (src.getFamily() == GROUP) {
- dest = PGraphics3D.createShapeImpl(parent, GROUP);
- copyGroup3D(parent, src, dest);
- } else if (src.getFamily() == PRIMITIVE) {
- dest = PGraphics3D.createShapeImpl(parent, src.getKind(),
- src.getParams());
- PShape.copyPrimitive(src, dest);
- } else if (src.getFamily() == GEOMETRY) {
- dest = PGraphics3D.createShapeImpl(parent, PShape.GEOMETRY);
- PShape.copyGeometry(src, dest);
- } else if (src.getFamily() == PATH) {
- dest = PGraphics3D.createShapeImpl(parent, PATH);
- PShape.copyPath(src, dest);
- }
- dest.setName(src.getName());
- return dest;
- }
-
-
- static public PShapeOpenGL createShape2D(PApplet parent, PShape src) {
- PShapeOpenGL dest = null;
- if (src.getFamily() == GROUP) {
- dest = PGraphics2D.createShapeImpl(parent, GROUP);
- copyGroup2D(parent, src, dest);
- } else if (src.getFamily() == PRIMITIVE) {
- dest = PGraphics2D.createShapeImpl(parent, src.getKind(),
- src.getParams());
- PShape.copyPrimitive(src, dest);
- } else if (src.getFamily() == GEOMETRY) {
- dest = PGraphics2D.createShapeImpl(parent, PShape.GEOMETRY);
- PShape.copyGeometry(src, dest);
- } else if (src.getFamily() == PATH) {
- dest = PGraphics2D.createShapeImpl(parent, PATH);
- PShape.copyPath(src, dest);
- }
- dest.setName(src.getName());
- return dest;
- }
-
-
- static public void copyGroup3D(PApplet parent, PShape src, PShape dest) {
- copyMatrix(src, dest);
- copyStyles(src, dest);
- copyImage(src, dest);
-
- for (int i = 0; i < src.getChildCount(); i++) {
- PShape c = createShape3D(parent, src.getChild(i));
- dest.addChild(c);
- }
- }
-
-
- static public void copyGroup2D(PApplet parent, PShape src, PShape dest) {
- copyMatrix(src, dest);
- copyStyles(src, dest);
- copyImage(src, dest);
-
- for (int i = 0; i < src.getChildCount(); i++) {
- PShape c = createShape2D(parent, src.getChild(i));
- dest.addChild(c);
- }
- }
-
-
- ///////////////////////////////////////////////////////////
-
- //
-
- // Query methods
-
-
- @Override
- public float getWidth() {
- PVector min = new PVector(Float.POSITIVE_INFINITY, Float.POSITIVE_INFINITY,
- Float.POSITIVE_INFINITY);
- PVector max = new PVector(Float.NEGATIVE_INFINITY, Float.NEGATIVE_INFINITY,
- Float.NEGATIVE_INFINITY);
- if (shapeCreated) {
- getVertexMin(min);
- getVertexMax(max);
- }
- width = max.x - min.x;
- return width;
- }
-
-
- @Override
- public float getHeight() {
- PVector min = new PVector(Float.POSITIVE_INFINITY, Float.POSITIVE_INFINITY,
- Float.POSITIVE_INFINITY);
- PVector max = new PVector(Float.NEGATIVE_INFINITY, Float.NEGATIVE_INFINITY,
- Float.NEGATIVE_INFINITY);
- if (shapeCreated) {
- getVertexMin(min);
- getVertexMax(max);
- }
- height = max.y - min.y;
- return height;
- }
-
-
- @Override
- public float getDepth() {
- PVector min = new PVector(Float.POSITIVE_INFINITY, Float.POSITIVE_INFINITY,
- Float.POSITIVE_INFINITY);
- PVector max = new PVector(Float.NEGATIVE_INFINITY, Float.NEGATIVE_INFINITY,
- Float.NEGATIVE_INFINITY);
- if (shapeCreated) {
- getVertexMin(min);
- getVertexMax(max);
- }
- depth = max.z - min.z;
- return depth;
- }
-
-
- protected void getVertexMin(PVector min) {
- updateTessellation();
-
- if (family == GROUP) {
- for (int i = 0; i < childCount; i++) {
- PShapeOpenGL child = (PShapeOpenGL) children[i];
- child.getVertexMin(min);
- }
- } else {
- if (hasPolys) {
- tessGeo.getPolyVertexMin(min, firstPolyVertex, lastPolyVertex);
- }
- if (is3D()) {
- if (hasLines) {
- tessGeo.getLineVertexMin(min, firstLineVertex, lastLineVertex);
- }
- if (hasPoints) {
- tessGeo.getPointVertexMin(min, firstPointVertex, lastPointVertex);
- }
- }
- }
- }
-
-
- protected void getVertexMax(PVector max) {
- updateTessellation();
-
- if (family == GROUP) {
- for (int i = 0; i < childCount; i++) {
- PShapeOpenGL child = (PShapeOpenGL) children[i];
- child.getVertexMax(max);
- }
- } else {
- if (hasPolys) {
- tessGeo.getPolyVertexMax(max, firstPolyVertex, lastPolyVertex);
- }
- if (is3D()) {
- if (hasLines) {
- tessGeo.getLineVertexMax(max, firstLineVertex, lastLineVertex);
- }
- if (hasPoints) {
- tessGeo.getPointVertexMax(max, firstPointVertex, lastPointVertex);
- }
- }
- }
- }
-
-
- protected int getVertexSum(PVector sum, int count) {
- updateTessellation();
-
- if (family == GROUP) {
- for (int i = 0; i < childCount; i++) {
- PShapeOpenGL child = (PShapeOpenGL) children[i];
- count += child.getVertexSum(sum, count);
- }
- } else {
- if (hasPolys) {
- count += tessGeo.getPolyVertexSum(sum, firstPolyVertex, lastPolyVertex);
- }
- if (is3D()) {
- if (hasLines) {
- count += tessGeo.getLineVertexSum(sum, firstLineVertex,
- lastLineVertex);
- }
- if (hasPoints) {
- count += tessGeo.getPointVertexSum(sum, firstPointVertex,
- lastPointVertex);
- }
- }
- }
- return count;
- }
-
-
- ///////////////////////////////////////////////////////////
-
- //
-
- // Drawing methods
-
-
- @Override
- public void setTextureMode(int mode) {
- if (openShape) {
- PGraphics.showWarning(INSIDE_BEGIN_END_ERROR, "setTextureMode()");
- return;
- }
-
- if (family == GROUP) {
- for (int i = 0; i < childCount; i++) {
- PShapeOpenGL child = (PShapeOpenGL) children[i];
- child.textureMode(mode);
- }
- } else {
- textureMode = mode;
- }
- }
-
-
- @Override
- public void setTexture(PImage tex) {
- if (openShape) {
- PGraphics.showWarning(INSIDE_BEGIN_END_ERROR, "setTexture()");
- return;
- }
-
- if (family == GROUP) {
- for (int i = 0; i < childCount; i++) {
- PShapeOpenGL child = (PShapeOpenGL) children[i];
- child.texture(tex);
- }
- } else {
- PImage tex0 = image;
- image = tex;
- if (tex0 != tex && parent != null) {
- ((PShapeOpenGL)parent).removeTexture(tex);
- }
- if (parent != null) {
- ((PShapeOpenGL)parent).addTexture(image);
- if (is2D() && stroke) {
- ((PShapeOpenGL)parent).strokedTexture(true);
- }
- }
- }
- }
-
-
- protected void addTexture(PImage tex) {
- if (textures == null) {
- textures = new HashSet();
- }
- textures.add(tex);
- if (parent != null) {
- ((PShapeOpenGL)parent).addTexture(tex);
- }
- }
-
-
- protected void removeTexture(PImage tex) {
- if (textures == null || !textures.contains(tex)) return; // Nothing to remove.
-
- // First check that none of the child shapes
- // have texture tex...
- boolean childHasTex = false;
- for (int i = 0; i < childCount; i++) {
- PShapeOpenGL child = (PShapeOpenGL) children[i];
- if (child.hasTexture(tex)) {
- childHasTex = true;
- break;
- }
- }
-
- if (!childHasTex) {
- // ...if not, it is safe to remove from this shape.
- textures.remove(tex);
- if (textures.size() == 0) {
- textures = null;
- }
- }
-
- // Since this shape and all its child shapes don't contain
- // tex anymore, we now can remove it from the parent.
- if (parent != null) {
- ((PShapeOpenGL)parent).removeTexture(tex);
- }
- }
-
-
- protected void strokedTexture(boolean newValue) {
- if (strokedTexture == newValue) return; // Nothing to change.
-
- if (newValue) {
- strokedTexture = true;
- } else {
- // First check that none of the child shapes
- // have have a stroked texture...
- boolean childHasStrokedTex = false;
- for (int i = 0; i < childCount; i++) {
- PShapeOpenGL child = (PShapeOpenGL) children[i];
- if (child.hasStrokedTexture()) {
- childHasStrokedTex = true;
- break;
- }
- }
-
- if (!childHasStrokedTex) {
- // ...if not, it is safe to mark this shape as without
- // stroked texture.
- strokedTexture = false;
- }
- }
-
- // Now we can update the parent shape.
- if (parent != null) {
- ((PShapeOpenGL)parent).strokedTexture(newValue);
- }
- }
-
-
- protected boolean hasTexture(PImage tex) {
- if (family == GROUP) {
- return textures != null && textures.contains(tex);
- } else {
- return image == tex;
- }
- }
-
-
- protected boolean hasStrokedTexture() {
- if (family == GROUP) {
- return strokedTexture;
- } else {
- return image != null && stroke;
- }
- }
-
-
- @Override
- public void solid(boolean solid) {
- if (family == GROUP) {
- for (int i = 0; i < childCount; i++) {
- PShapeOpenGL child = (PShapeOpenGL) children[i];
- child.solid(solid);
- }
- } else {
- isSolid = solid;
- }
- }
-
-
- @Override
- public void beginContour() {
- super.beginContour();
- breakShape = true;
- }
-
-
- @Override
- public void vertex(float x, float y) {
- vertexImpl(x, y, 0, 0, 0);
- }
-
-
- @Override
- public void vertex(float x, float y, float u, float v) {
- vertexImpl(x, y, 0, u, v);
- }
-
-
- @Override
- public void vertex(float x, float y, float z) {
- vertexImpl(x, y, z, 0, 0);
- }
-
-
- @Override
- public void vertex(float x, float y, float z, float u, float v) {
- vertexImpl(x, y, z, u, v);
- }
-
-
- protected void vertexImpl(float x, float y, float z, float u, float v) {
- if (!openShape) {
- PGraphics.showWarning(OUTSIDE_BEGIN_END_ERROR, "vertex()");
- return;
- }
-
- if (family == GROUP) {
- PGraphics.showWarning("Cannot add vertices to GROUP shape");
- return;
- }
-
- boolean textured = image != null;
- int fcolor = 0x00;
- if (fill || textured) {
- if (!textured) {
- fcolor = fillColor;
- } else {
- if (tint) {
- fcolor = tintColor;
- } else {
- fcolor = 0xffFFFFFF;
- }
- }
- }
-
- if (image != null && textureMode == IMAGE) {
- u = PApplet.min(1, u / image.width);
- v = PApplet.min(1, v / image.height);
- }
-
- int scolor = 0x00;
- float sweight = 0;
- if (stroke) {
- scolor = strokeColor;
- sweight = strokeWeight;
- }
-
- inGeo.addVertex(x, y, z,
- fcolor,
- normalX, normalY, normalZ,
- u, v,
- scolor, sweight,
- ambientColor, specularColor, emissiveColor, shininess,
- vertexCode());
-
- markForTessellation();
- }
-
-
- protected int vertexCode() {
- int code = VERTEX;
- if (breakShape) {
- code = BREAK;
- breakShape = false;
- }
- return code;
- }
-
-
- @Override
- public void normal(float nx, float ny, float nz) {
- if (!openShape) {
- PGraphics.showWarning(OUTSIDE_BEGIN_END_ERROR, "normal()");
- return;
- }
-
- if (family == GROUP) {
- PGraphics.showWarning("Cannot set normal in GROUP shape");
- return;
- }
-
- normalX = nx;
- normalY = ny;
- normalZ = nz;
-
- // if drawing a shape and the normal hasn't been set yet,
- // then we need to set the normals for each vertex so far
- if (normalMode == NORMAL_MODE_AUTO) {
- // One normal per begin/end shape
- normalMode = NORMAL_MODE_SHAPE;
- } else if (normalMode == NORMAL_MODE_SHAPE) {
- // a separate normal for each vertex
- normalMode = NORMAL_MODE_VERTEX;
- }
- }
-
-
- @Override
- public void endShape(int mode) {
- super.endShape(mode);
-
- // Input arrays are trimmed since they are expanded by doubling their old
- // size, which might lead to arrays larger than the vertex counts.
- inGeo.trim();
-
- isClosed = mode == CLOSE;
- markForTessellation();
- shapeCreated = true;
- }
-
-
- @Override
- public void setParams(float[] source) {
- if (family != PRIMITIVE) {
- PGraphics.showWarning("Parameters can only be set to PRIMITIVE shapes");
- return;
- }
-
- super.setParams(source);
- markForTessellation();
- shapeCreated = true;
- }
-
-
- @Override
- public void setPath(int vcount, float[][] verts, int ccount, int[] codes) {
- if (family != PATH) {
- PGraphics.showWarning("Vertex coordinates and codes can only be set to " +
- "PATH shapes");
- return;
- }
-
- super.setPath(vcount, verts, ccount, codes);
- markForTessellation();
- shapeCreated = true;
- }
-
-
- ///////////////////////////////////////////////////////////
-
- //
-
- // Geometric transformations
-
-
- @Override
- public void translate(float tx, float ty) {
- transform(TRANSLATE, tx, ty);
- }
-
-
- @Override
- public void translate(float tx, float ty, float tz) {
- transform(TRANSLATE, tx, ty, tz);
- }
-
-
- @Override
- public void rotate(float angle) {
- transform(ROTATE, angle);
- }
-
-
- @Override
- public void rotateX(float angle) {
- rotate(angle, 1, 0, 0);
- }
-
-
- @Override
- public void rotateY(float angle) {
- rotate(angle, 0, 1, 0);
- }
-
-
- @Override
- public void rotateZ(float angle) {
- transform(ROTATE, angle);
- }
-
-
- @Override
- public void rotate(float angle, float v0, float v1, float v2) {
- transform(ROTATE, angle, v0, v1, v2);
- }
-
-
- @Override
- public void scale(float s) {
- transform(SCALE, s, s);
- }
-
-
- @Override
- public void scale(float x, float y) {
- transform(SCALE, x, y);
- }
-
-
- @Override
- public void scale(float x, float y, float z) {
- transform(SCALE, x, y, z);
- }
-
-
- @Override
- public void applyMatrix(PMatrix2D source) {
- transform(MATRIX, source.m00, source.m01, source.m02,
- source.m10, source.m11, source.m12);
- }
-
-
- @Override
- public void applyMatrix(float n00, float n01, float n02,
- float n10, float n11, float n12) {
- transform(MATRIX, n00, n01, n02,
- n10, n11, n12);
- }
-
-
- @Override
- public void applyMatrix(float n00, float n01, float n02, float n03,
- float n10, float n11, float n12, float n13,
- float n20, float n21, float n22, float n23,
- float n30, float n31, float n32, float n33) {
- transform(MATRIX, n00, n01, n02, n03,
- n10, n11, n12, n13,
- n20, n21, n22, n23,
- n30, n31, n32, n33);
- }
-
-
- @Override
- public void resetMatrix() {
- if (shapeCreated && matrix != null) {
- if (family == GROUP) {
- updateTessellation();
- }
- boolean res = matrix.invert();
- if (res) {
- if (tessellated) {
- applyMatrixImpl(matrix);
- }
- matrix = null;
- } else {
- PGraphics.showWarning("The transformation matrix cannot be inverted");
- }
- }
- }
-
-
- protected void transform(int type, float... args) {
- int dimensions;
- if (type == ROTATE) {
- dimensions = args.length == 1 ? 2 : 3;
- } else if (type == MATRIX) {
- dimensions = args.length == 6 ? 2 : 3;
- } else {
- dimensions = args.length;
- }
- transformImpl(type, dimensions, args);
- }
-
-
- protected void transformImpl(int type, int ncoords, float... args) {
- checkMatrix(ncoords);
- calcTransform(type, ncoords, args);
- if (tessellated) {
- applyMatrixImpl(transform);
- }
- }
-
-
- protected void calcTransform(int type, int dimensions, float... args) {
- if (transform == null) {
- if (dimensions == 2) {
- transform = new PMatrix2D();
- } else {
- transform = new PMatrix3D();
- }
- } else {
- transform.reset();
- }
-
- switch (type) {
- case TRANSLATE:
- if (dimensions == 3) {
- transform.translate(args[0], args[1], args[2]);
- } else {
- transform.translate(args[0], args[1]);
- }
- break;
- case ROTATE:
- if (dimensions == 3) {
- transform.rotate(args[0], args[1], args[2], args[3]);
- } else {
- transform.rotate(args[0]);
- }
- break;
- case SCALE:
- if (dimensions == 3) {
- transform.scale(args[0], args[1], args[2]);
- } else {
- transform.scale(args[0], args[1]);
- }
- break;
- case MATRIX:
- if (dimensions == 3) {
- transform.set(args[ 0], args[ 1], args[ 2], args[ 3],
- args[ 4], args[ 5], args[ 6], args[ 7],
- args[ 8], args[ 9], args[10], args[11],
- args[12], args[13], args[14], args[15]);
- } else {
- transform.set(args[0], args[1], args[2],
- args[3], args[4], args[5]);
- }
- break;
- }
- matrix.apply(transform);
- }
-
-
- protected void applyMatrixImpl(PMatrix matrix) {
- if (hasPolys) {
- tessGeo.applyMatrixOnPolyGeometry(matrix,
- firstPolyVertex, lastPolyVertex);
- root.setModifiedPolyVertices(firstPolyVertex, lastPolyVertex);
- root.setModifiedPolyNormals(firstPolyVertex, lastPolyVertex);
- }
-
- if (is3D()) {
- if (hasLines) {
- tessGeo.applyMatrixOnLineGeometry(matrix,
- firstLineVertex, lastLineVertex);
- root.setModifiedLineVertices(firstLineVertex, lastLineVertex);
- root.setModifiedLineAttributes(firstLineVertex, lastLineVertex);
- }
-
- if (hasPoints) {
- tessGeo.applyMatrixOnPointGeometry(matrix,
- firstPointVertex, lastPointVertex);
- root.setModifiedPointVertices(firstPointVertex, lastPointVertex);
- }
- }
- }
-
-
- ///////////////////////////////////////////////////////////
-
- //
-
- // Bezier curves
-
-
- @Override
- public void bezierDetail(int detail) {
- bezierDetail = detail;
- pg.bezierDetail(detail);
- }
-
-
- @Override
- public void bezierVertex(float x2, float y2,
- float x3, float y3,
- float x4, float y4) {
- bezierVertexImpl(x2, y2, 0,
- x3, y3, 0,
- x4, y4, 0);
- }
-
-
- @Override
- public void bezierVertex(float x2, float y2, float z2,
- float x3, float y3, float z3,
- float x4, float y4, float z4) {
- bezierVertexImpl(x2, y2, z2,
- x3, y3, z3,
- x4, y4, z4);
- }
-
-
- protected void bezierVertexImpl(float x2, float y2, float z2,
- float x3, float y3, float z3,
- float x4, float y4, float z4) {
- inGeo.setMaterial(fillColor, strokeColor, strokeWeight,
- ambientColor, specularColor, emissiveColor, shininess);
- inGeo.setNormal(normalX, normalY, normalZ);
- inGeo.addBezierVertex(x2, y2, z2,
- x3, y3, z3,
- x4, y4, z4,
- fill, stroke, bezierDetail, vertexCode(), kind);
- }
-
-
- @Override
- public void quadraticVertex(float cx, float cy,
- float x3, float y3) {
- quadraticVertexImpl(cx, cy, 0,
- x3, y3, 0);
- }
-
-
- @Override
- public void quadraticVertex(float cx, float cy, float cz,
- float x3, float y3, float z3) {
- quadraticVertexImpl(cx, cy, cz,
- x3, y3, z3);
- }
-
-
- protected void quadraticVertexImpl(float cx, float cy, float cz,
- float x3, float y3, float z3) {
- inGeo.setMaterial(fillColor, strokeColor, strokeWeight,
- ambientColor, specularColor, emissiveColor, shininess);
- inGeo.setNormal(normalX, normalY, normalZ);
- inGeo.addQuadraticVertex(cx, cy, cz,
- x3, y3, z3,
- fill, stroke, bezierDetail, vertexCode(), kind);
- }
-
-
- ///////////////////////////////////////////////////////////
-
- //
-
- // Catmull-Rom curves
-
-
- @Override
- public void curveDetail(int detail) {
- curveDetail = detail;
- pg.curveDetail(detail);
- }
-
-
- @Override
- public void curveTightness(float tightness) {
- curveTightness = tightness;
- pg.curveTightness(tightness);
- }
-
-
- @Override
- public void curveVertex(float x, float y) {
- curveVertexImpl(x, y, 0);
- }
-
-
- @Override
- public void curveVertex(float x, float y, float z) {
- curveVertexImpl(x, y, z);
- }
-
-
- protected void curveVertexImpl(float x, float y, float z) {
- inGeo.setMaterial(fillColor, strokeColor, strokeWeight,
- ambientColor, specularColor, emissiveColor, shininess);
- inGeo.setNormal(normalX, normalY, normalZ);
- inGeo.addCurveVertex(x, y, z,
- fill, stroke, curveDetail, vertexCode(), kind);
- }
-
-
- ///////////////////////////////////////////////////////////
-
- //
-
- // Setters/getters of individual vertices
-
-
- @Override
- public int getVertexCount() {
- updateTessellation();
- return family == GROUP ? 0 : inGeo.vertexCount;
- }
-
-
- @Override
- public PVector getVertex(int index, PVector vec) {
- if (vec == null) {
- vec = new PVector();
- }
- vec.x = inGeo.vertices[3 * index + 0];
- vec.y = inGeo.vertices[3 * index + 1];
- vec.z = inGeo.vertices[3 * index + 2];
- return vec;
- }
-
-
- @Override
- public float getVertexX(int index) {
- return inGeo.vertices[3 * index + 0];
- }
-
-
- @Override
- public float getVertexY(int index) {
- return inGeo.vertices[3 * index + 1];
- }
-
-
- @Override
- public float getVertexZ(int index) {
- return inGeo.vertices[3 * index + 2];
- }
-
-
- @Override
- public void setVertex(int index, float x, float y) {
- setVertex(index, x, y, 0);
- }
-
-
- @Override
- public void setVertex(int index, float x, float y, float z) {
- if (openShape) {
- PGraphics.showWarning(INSIDE_BEGIN_END_ERROR, "setVertex()");
- return;
- }
-
- // TODO: in certain cases (kind = TRIANGLE, etc) the correspondence between
- // input and tessellated vertices is 1-1, so in those cases re-tessellation
- // wouldnt' be neccessary.
- inGeo.vertices[3 * index + 0] = x;
- inGeo.vertices[3 * index + 1] = y;
- inGeo.vertices[3 * index + 2] = z;
- markForTessellation();
- }
-
-
- @Override
- public void setVertex(int index, PVector vec) {
- if (openShape) {
- PGraphics.showWarning(INSIDE_BEGIN_END_ERROR, "setVertex()");
- return;
- }
-
- inGeo.vertices[3 * index + 0] = vec.x;
- inGeo.vertices[3 * index + 1] = vec.y;
- inGeo.vertices[3 * index + 2] = vec.z;
- markForTessellation();
- }
-
-
- @Override
- public PVector getNormal(int index, PVector vec) {
- if (vec == null) {
- vec = new PVector();
- }
- vec.x = inGeo.normals[3 * index + 0];
- vec.y = inGeo.normals[3 * index + 1];
- vec.z = inGeo.normals[3 * index + 2];
- return vec;
- }
-
-
- @Override
- public float getNormalX(int index) {
- return inGeo.normals[3 * index + 0];
- }
-
-
- @Override
- public float getNormalY(int index) {
- return inGeo.normals[3 * index + 1];
- }
-
-
- @Override
- public float getNormalZ(int index) {
- return inGeo.normals[3 * index + 2];
- }
-
-
- @Override
- public void setNormal(int index, float nx, float ny, float nz) {
- if (openShape) {
- PGraphics.showWarning(INSIDE_BEGIN_END_ERROR, "setNormal()");
- return;
- }
-
- inGeo.normals[3 * index + 0] = nx;
- inGeo.normals[3 * index + 1] = ny;
- inGeo.normals[3 * index + 2] = nz;
- markForTessellation();
- }
-
-
- @Override
- public float getTextureU(int index) {
- return inGeo.texcoords[2 * index + 0];
- }
-
-
- @Override
- public float getTextureV(int index) {
- return inGeo.texcoords[2 * index + 1];
- }
-
-
- @Override
- public void setTextureUV(int index, float u, float v) {
- if (openShape) {
- PGraphics.showWarning(INSIDE_BEGIN_END_ERROR, "setTextureUV()");
- return;
- }
-
- inGeo.texcoords[2 * index + 0] = u;
- inGeo.texcoords[2 * index + 1] = v;
- markForTessellation();
- }
-
-
- @Override
- public int getFill(int index) {
- if (family != GROUP && image == null) {
- return PGL.nativeToJavaARGB(inGeo.colors[index]);
- } else {
- return 0;
- }
- }
-
-
- @Override
- public void setFill(boolean fill) {
- if (openShape) {
- PGraphics.showWarning(INSIDE_BEGIN_END_ERROR, "setFill()");
- return;
- }
-
- if (family == GROUP) {
- for (int i = 0; i < childCount; i++) {
- PShapeOpenGL child = (PShapeOpenGL) children[i];
- child.setFill(fill);
- }
- } else if (this.fill && !fill) {
- setFillImpl(0x0);
- }
- this.fill = fill;
- }
-
-
- @Override
- public void setFill(int fill) {
- if (openShape) {
- PGraphics.showWarning(INSIDE_BEGIN_END_ERROR, "setFill()");
- return;
- }
-
- if (family == GROUP) {
- for (int i = 0; i < childCount; i++) {
- PShapeOpenGL child = (PShapeOpenGL) children[i];
- child.setFill(fill);
- }
- } else {
- setFillImpl(fill);
- }
- }
-
-
- protected void setFillImpl(int fill) {
- if (fillColor == fill) return;
- fillColor = fill;
-
- if (image == null) {
- Arrays.fill(inGeo.colors, 0, inGeo.vertexCount,
- PGL.javaToNativeARGB(fillColor));
- if (shapeCreated && tessellated && hasPolys) {
- if (is3D()) {
- Arrays.fill(tessGeo.polyColors, firstPolyVertex, lastPolyVertex + 1,
- PGL.javaToNativeARGB(fillColor));
- root.setModifiedPolyColors(firstPolyVertex, lastPolyVertex);
- } else if (is2D()) {
- int last1 = lastPolyVertex + 1;
- if (-1 < firstLineVertex) last1 = firstLineVertex;
- if (-1 < firstPointVertex) last1 = firstPointVertex;
- Arrays.fill(tessGeo.polyColors, firstPolyVertex, last1,
- PGL.javaToNativeARGB(fillColor));
- root.setModifiedPolyColors(firstPolyVertex, last1 - 1);
- }
- }
- }
-
- if (!setAmbient) {
- // Setting the ambient color from the current fill
- // is what the old P3D did and allows to have an
- // default ambient color when the user doesn't specify
- // it explicitly.
- setAmbientImpl(fill);
- setAmbient = false;
- }
- }
-
-
- @Override
- public void setFill(int index, int fill) {
- if (openShape) {
- PGraphics.showWarning(INSIDE_BEGIN_END_ERROR, "setFill()");
- return;
- }
-
- if (image == null) {
- inGeo.colors[index] = PGL.javaToNativeARGB(fill);
- markForTessellation();
- }
- }
-
-
- @Override
- public int getTint(int index) {
- if (family != GROUP && image != null) {
- return PGL.nativeToJavaARGB(inGeo.colors[index]);
- } else {
- return 0;
- }
- }
-
-
- @Override
- public void setTint(boolean tint) {
- if (openShape) {
- PGraphics.showWarning(INSIDE_BEGIN_END_ERROR, "setTint()");
- return;
- }
-
- if (family == GROUP) {
- for (int i = 0; i < childCount; i++) {
- PShapeOpenGL child = (PShapeOpenGL) children[i];
- child.setTint(fill);
- }
- } else if (this.tint && !tint) {
- setTintImpl(0xFFFFFFFF);
- }
- this.tint = tint;
- }
-
-
- @Override
- public void setTint(int tint) {
- if (openShape) {
- PGraphics.showWarning(INSIDE_BEGIN_END_ERROR, "setTint()");
- return;
- }
-
- if (family == GROUP) {
- for (int i = 0; i < childCount; i++) {
- PShapeOpenGL child = (PShapeOpenGL) children[i];
- child.setTint(tint);
- }
- } else {
- setTintImpl(tint);
- }
- }
-
-
- protected void setTintImpl(int tint) {
- if (tintColor == tint) return;
- tintColor = tint;
-
- if (image != null) {
- Arrays.fill(inGeo.colors, 0, inGeo.vertexCount,
- PGL.javaToNativeARGB(tintColor));
- if (shapeCreated && tessellated && hasPolys) {
- if (is3D()) {
- Arrays.fill(tessGeo.polyColors, firstPolyVertex, lastPolyVertex + 1,
- PGL.javaToNativeARGB(tintColor));
- root.setModifiedPolyColors(firstPolyVertex, lastPolyVertex);
- } else if (is2D()) {
- int last1 = lastPolyVertex + 1;
- if (-1 < firstLineVertex) last1 = firstLineVertex;
- if (-1 < firstPointVertex) last1 = firstPointVertex;
- Arrays.fill(tessGeo.polyColors, firstPolyVertex, last1,
- PGL.javaToNativeARGB(tintColor));
- root.setModifiedPolyColors(firstPolyVertex, last1 - 1);
- }
- }
- }
- }
-
-
- @Override
- public void setTint(int index, int tint) {
- if (openShape) {
- PGraphics.showWarning(INSIDE_BEGIN_END_ERROR, "setTint()");
- return;
- }
-
- if (image != null) {
- inGeo.colors[index] = PGL.javaToNativeARGB(tint);
- markForTessellation();
- }
- }
-
-
- @Override
- public int getStroke(int index) {
- if (family != GROUP) {
- return PGL.nativeToJavaARGB(inGeo.strokeColors[index]);
- } else {
- return 0;
- }
- }
-
-
- @Override
- public void setStroke(boolean stroke) {
- if (openShape) {
- PGraphics.showWarning(INSIDE_BEGIN_END_ERROR, "setStroke()");
- return;
- }
-
- if (family == GROUP) {
- for (int i = 0; i < childCount; i++) {
- PShapeOpenGL child = (PShapeOpenGL) children[i];
- child.setStroke(stroke);
- }
- } else if (this.stroke != stroke) {
- if (this.stroke) {
- // Disabling stroke on a shape previously with
- // stroke needs a re-tesellation in order to remove
- // the additional geometry of lines and/or points.
- markForTessellation();
- stroke = false;
- }
- setStrokeImpl(0x0);
- if (is2D() && parent != null) {
- ((PShapeOpenGL)parent).strokedTexture(false);
- }
- }
- this.stroke = stroke;
- }
-
-
- @Override
- public void setStroke(int stroke) {
- if (openShape) {
- PGraphics.showWarning(INSIDE_BEGIN_END_ERROR, "setStroke()");
- return;
- }
-
- if (family == GROUP) {
- for (int i = 0; i < childCount; i++) {
- PShapeOpenGL child = (PShapeOpenGL) children[i];
- child.setStroke(stroke);
- }
- } else {
- setStrokeImpl(stroke);
- }
- }
-
-
- protected void setStrokeImpl(int stroke) {
- if (strokeColor == stroke) return;
- strokeColor = stroke;
-
- Arrays.fill(inGeo.strokeColors, 0, inGeo.vertexCount,
- PGL.javaToNativeARGB(strokeColor));
- if (shapeCreated && tessellated && (hasLines || hasPoints)) {
- if (hasLines) {
- if (is3D()) {
- Arrays.fill(tessGeo.lineColors, firstLineVertex, lastLineVertex + 1,
- PGL.javaToNativeARGB(strokeColor));
- root.setModifiedLineColors(firstLineVertex, lastLineVertex);
- } else if (is2D()) {
- Arrays.fill(tessGeo.polyColors, firstLineVertex, lastLineVertex + 1,
- PGL.javaToNativeARGB(strokeColor));
- root.setModifiedPolyColors(firstLineVertex, lastLineVertex);
- }
- }
- if (hasPoints) {
- if (is3D()) {
- Arrays.fill(tessGeo.pointColors, firstPointVertex, lastPointVertex + 1,
- PGL.javaToNativeARGB(strokeColor));
- root.setModifiedPointColors(firstPointVertex, lastPointVertex);
- } else if (is2D()) {
- Arrays.fill(tessGeo.polyColors, firstPointVertex, lastPointVertex + 1,
- PGL.javaToNativeARGB(strokeColor));
- root.setModifiedPolyColors(firstPointVertex, lastPointVertex);
- }
- }
- }
- }
-
-
- @Override
- public void setStroke(int index, int stroke) {
- if (openShape) {
- PGraphics.showWarning(INSIDE_BEGIN_END_ERROR, "setStroke()");
- return;
- }
-
- inGeo.strokeColors[index] = PGL.javaToNativeARGB(stroke);
- markForTessellation();
- }
-
-
- @Override
- public float getStrokeWeight(int index) {
- if (family != GROUP) {
- return inGeo.strokeWeights[index];
- } else {
- return 0;
- }
- }
-
-
- @Override
- public void setStrokeWeight(float weight) {
- if (openShape) {
- PGraphics.showWarning(INSIDE_BEGIN_END_ERROR, "setStrokeWeight()");
- return;
- }
-
- if (family == GROUP) {
- for (int i = 0; i < childCount; i++) {
- PShapeOpenGL child = (PShapeOpenGL) children[i];
- child.setStrokeWeight(weight);
- }
- } else {
- setStrokeWeightImpl(weight);
- }
- }
-
-
- protected void setStrokeWeightImpl(float weight) {
- if (PGraphicsOpenGL.same(strokeWeight, weight)) return;
- float oldWeight = strokeWeight;
- strokeWeight = weight;
-
- Arrays.fill(inGeo.strokeWeights, 0, inGeo.vertexCount, strokeWeight);
- if (shapeCreated && tessellated && (hasLines || hasPoints)) {
- float resizeFactor = weight / oldWeight;
- if (hasLines) {
- if (is3D()) {
- for (int i = firstLineVertex; i <= lastLineVertex; i++) {
- tessGeo.lineDirections[4 * i + 3] *= resizeFactor;
- }
- root.setModifiedLineAttributes(firstLineVertex, lastLineVertex);
- } else if (is2D()) {
- // Changing the stroke weight on a 2D shape needs a
- // re-tesellation in order to replace the old line
- // geometry.
- markForTessellation();
- }
- }
- if (hasPoints) {
- if (is3D()) {
- for (int i = firstPointVertex; i <= lastPointVertex; i++) {
- tessGeo.pointOffsets[2 * i + 0] *= resizeFactor;
- tessGeo.pointOffsets[2 * i + 1] *= resizeFactor;
- }
- root.setModifiedPointAttributes(firstPointVertex, lastPointVertex);
- } else if (is2D()) {
- // Changing the stroke weight on a 2D shape needs a
- // re-tesellation in order to replace the old point
- // geometry.
- markForTessellation();
- }
- }
- }
- }
-
-
- @Override
- public void setStrokeWeight(int index, float weight) {
- if (openShape) {
- PGraphics.showWarning(INSIDE_BEGIN_END_ERROR, "setStrokeWeight()");
- return;
- }
-
- inGeo.strokeWeights[index] = weight;
- markForTessellation();
- }
-
-
- @Override
- public void setStrokeJoin(int join) {
- if (openShape) {
- PGraphics.showWarning(INSIDE_BEGIN_END_ERROR, "setStrokeJoin()");
- return;
- }
-
- if (family == GROUP) {
- for (int i = 0; i < childCount; i++) {
- PShapeOpenGL child = (PShapeOpenGL) children[i];
- child.setStrokeJoin(join);
- }
- } else {
- if (is2D() && strokeJoin != join) {
- // Changing the stroke join on a 2D shape needs a
- // re-tesellation in order to replace the old join
- // geometry.
- markForTessellation();
- }
- strokeJoin = join;
- }
- }
-
-
- @Override
- public void setStrokeCap(int cap) {
- if (openShape) {
- PGraphics.showWarning(INSIDE_BEGIN_END_ERROR, "setStrokeCap()");
- return;
- }
-
- if (family == GROUP) {
- for (int i = 0; i < childCount; i++) {
- PShapeOpenGL child = (PShapeOpenGL) children[i];
- child.setStrokeCap(cap);
- }
- } else {
- if (is2D() && strokeCap != cap) {
- // Changing the stroke cap on a 2D shape needs a
- // re-tesellation in order to replace the old cap
- // geometry.
- markForTessellation();
- }
- strokeCap = cap;
- }
- }
-
-
- @Override
- public int getAmbient(int index) {
- if (family != GROUP) {
- return PGL.nativeToJavaARGB(inGeo.ambient[index]);
- } else {
- return 0;
- }
- }
-
-
- @Override
- public void setAmbient(int ambient) {
- if (openShape) {
- PGraphics.showWarning(INSIDE_BEGIN_END_ERROR, "setAmbient()");
- return;
- }
-
- if (family == GROUP) {
- for (int i = 0; i < childCount; i++) {
- PShapeOpenGL child = (PShapeOpenGL) children[i];
- child.setAmbient(ambient);
- }
- } else {
- setAmbientImpl(ambient);
- }
- }
-
-
- protected void setAmbientImpl(int ambient) {
- if (ambientColor == ambient) return;
- ambientColor = ambient;
-
- Arrays.fill(inGeo.ambient, 0, inGeo.vertexCount,
- PGL.javaToNativeARGB(ambientColor));
- if (shapeCreated && tessellated && hasPolys) {
- if (is3D()) {
- Arrays.fill(tessGeo.polyAmbient, firstPolyVertex, lastPolyVertex + 1,
- PGL.javaToNativeARGB(ambientColor));
- root.setModifiedPolyAmbient(firstPolyVertex, lastPolyVertex);
- } else if (is2D()) {
- int last1 = lastPolyVertex + 1;
- if (-1 < firstLineVertex) last1 = firstLineVertex;
- if (-1 < firstPointVertex) last1 = firstPointVertex;
- Arrays.fill(tessGeo.polyAmbient, firstPolyVertex, last1,
- PGL.javaToNativeARGB(ambientColor));
- root.setModifiedPolyColors(firstPolyVertex, last1 - 1);
- }
- }
- setAmbient = true;
- }
-
-
- @Override
- public void setAmbient(int index, int ambient) {
- if (openShape) {
- PGraphics.showWarning(INSIDE_BEGIN_END_ERROR, "setAmbient()");
- return;
- }
-
- inGeo.ambient[index] = PGL.javaToNativeARGB(ambient);
- markForTessellation();
- setAmbient = true;
- }
-
-
- @Override
- public int getSpecular(int index) {
- if (family == GROUP) {
- return PGL.nativeToJavaARGB(inGeo.specular[index]);
- } else {
- return 0;
- }
- }
-
-
- @Override
- public void setSpecular(int specular) {
- if (openShape) {
- PGraphics.showWarning(INSIDE_BEGIN_END_ERROR, "setSpecular()");
- return;
- }
-
- if (family == GROUP) {
- for (int i = 0; i < childCount; i++) {
- PShapeOpenGL child = (PShapeOpenGL) children[i];
- child.setSpecular(specular);
- }
- } else {
- setSpecularImpl(specular);
- }
- }
-
-
- protected void setSpecularImpl(int specular) {
- if (specularColor == specular) return;
- specularColor = specular;
-
- Arrays.fill(inGeo.specular, 0, inGeo.vertexCount,
- PGL.javaToNativeARGB(specularColor));
- if (shapeCreated && tessellated && hasPolys) {
- if (is3D()) {
- Arrays.fill(tessGeo.polySpecular, firstPolyVertex, lastPolyVertex + 1,
- PGL.javaToNativeARGB(specularColor));
- root.setModifiedPolySpecular(firstPolyVertex, lastPolyVertex);
- } else if (is2D()) {
- int last1 = lastPolyVertex + 1;
- if (-1 < firstLineVertex) last1 = firstLineVertex;
- if (-1 < firstPointVertex) last1 = firstPointVertex;
- Arrays.fill(tessGeo.polySpecular, firstPolyVertex, last1,
- PGL.javaToNativeARGB(specularColor));
- root.setModifiedPolyColors(firstPolyVertex, last1 - 1);
- }
- }
- }
-
-
- @Override
- public void setSpecular(int index, int specular) {
- if (openShape) {
- PGraphics.showWarning(INSIDE_BEGIN_END_ERROR, "setSpecular()");
- return;
- }
-
- inGeo.specular[index] = PGL.javaToNativeARGB(specular);
- markForTessellation();
- }
-
-
- @Override
- public int getEmissive(int index) {
- if (family == GROUP) {
- return PGL.nativeToJavaARGB(inGeo.emissive[index]);
- } else {
- return 0;
- }
- }
-
-
- @Override
- public void setEmissive(int emissive) {
- if (openShape) {
- PGraphics.showWarning(INSIDE_BEGIN_END_ERROR, "setEmissive()");
- return;
- }
-
- if (family == GROUP) {
- for (int i = 0; i < childCount; i++) {
- PShapeOpenGL child = (PShapeOpenGL) children[i];
- child.setEmissive(emissive);
- }
- } else {
- setEmissiveImpl(emissive);
- }
- }
-
-
- protected void setEmissiveImpl(int emissive) {
- if (emissiveColor == emissive) return;
- emissiveColor = emissive;
-
- Arrays.fill(inGeo.emissive, 0, inGeo.vertexCount,
- PGL.javaToNativeARGB(emissiveColor));
- if (shapeCreated && tessellated && 0 < tessGeo.polyVertexCount) {
- if (is3D()) {
- Arrays.fill(tessGeo.polyEmissive, firstPolyVertex, lastPolyVertex + 1,
- PGL.javaToNativeARGB(emissiveColor));
- root.setModifiedPolyEmissive(firstPolyVertex, lastPolyVertex);
- } else if (is2D()) {
- int last1 = lastPolyVertex + 1;
- if (-1 < firstLineVertex) last1 = firstLineVertex;
- if (-1 < firstPointVertex) last1 = firstPointVertex;
- Arrays.fill(tessGeo.polyEmissive, firstPolyVertex, last1,
- PGL.javaToNativeARGB(emissiveColor));
- root.setModifiedPolyColors(firstPolyVertex, last1 - 1);
- }
- }
- }
-
-
- @Override
- public void setEmissive(int index, int emissive) {
- if (openShape) {
- PGraphics.showWarning(INSIDE_BEGIN_END_ERROR, "setEmissive()");
- return;
- }
-
- inGeo.emissive[index] = PGL.javaToNativeARGB(emissive);
- markForTessellation();
- }
-
-
- @Override
- public float getShininess(int index) {
- if (family == GROUP) {
- return inGeo.shininess[index];
- } else {
- return 0;
- }
- }
-
-
- @Override
- public void setShininess(float shininess) {
- if (openShape) {
- PGraphics.showWarning(INSIDE_BEGIN_END_ERROR, "setShininess()");
- return;
- }
-
- if (family == GROUP) {
- for (int i = 0; i < childCount; i++) {
- PShapeOpenGL child = (PShapeOpenGL) children[i];
- child.setShininess(shininess);
- }
- } else {
- setShininessImpl(shininess);
- }
- }
-
-
- protected void setShininessImpl(float shininess) {
- if (PGraphicsOpenGL.same(this.shininess, shininess)) return;
- this.shininess = shininess;
-
- Arrays.fill(inGeo.shininess, 0, inGeo.vertexCount, shininess);
- if (shapeCreated && tessellated && hasPolys) {
- if (is3D()) {
- Arrays.fill(tessGeo.polyShininess, firstPolyVertex, lastPolyVertex + 1,
- shininess);
- root.setModifiedPolyShininess(firstPolyVertex, lastPolyVertex);
- } else if (is2D()) {
- int last1 = lastPolyVertex + 1;
- if (-1 < firstLineVertex) last1 = firstLineVertex;
- if (-1 < firstPointVertex) last1 = firstPointVertex;
- Arrays.fill(tessGeo.polyShininess, firstPolyVertex, last1, shininess);
- root.setModifiedPolyColors(firstPolyVertex, last1 - 1);
- }
- }
- }
-
-
- @Override
- public void setShininess(int index, float shine) {
- if (openShape) {
- PGraphics.showWarning(INSIDE_BEGIN_END_ERROR, "setShininess()");
- return;
- }
-
- inGeo.shininess[index] = shine;
- markForTessellation();
- }
-
-
- ///////////////////////////////////////////////////////////
-
- //
-
- // Tessellated geometry getter.
-
- @Override
- public PShape getTessellation() {
- updateTessellation();
-
- float[] vertices = tessGeo.polyVertices;
- float[] normals = tessGeo.polyNormals;
- int[] color = tessGeo.polyColors;
- float[] uv = tessGeo.polyTexCoords;
- short[] indices = tessGeo.polyIndices;
-
- PShape tess;
- if (is3D()) {
- tess = PGraphics3D.createShapeImpl(pg.parent, PShape.GEOMETRY);
- } else if (is2D()) {
- tess = PGraphics2D.createShapeImpl(pg.parent, PShape.GEOMETRY);
- } else {
- PGraphics.showWarning("This shape is not either 2D or 3D!");
- return null;
- }
- tess.beginShape(TRIANGLES);
- tess.noStroke();
-
- IndexCache cache = tessGeo.polyIndexCache;
- for (int n = firstPolyIndexCache; n <= lastPolyIndexCache; n++) {
- int ioffset = cache.indexOffset[n];
- int icount = cache.indexCount[n];
- int voffset = cache.vertexOffset[n];
-
- for (int tr = ioffset / 3; tr < (ioffset + icount) / 3; tr++) {
- int i0 = voffset + indices[3 * tr + 0];
- int i1 = voffset + indices[3 * tr + 1];
- int i2 = voffset + indices[3 * tr + 2];
-
- if (is3D()) {
- float x0 = vertices[4 * i0 + 0];
- float y0 = vertices[4 * i0 + 1];
- float z0 = vertices[4 * i0 + 2];
- float x1 = vertices[4 * i1 + 0];
- float y1 = vertices[4 * i1 + 1];
- float z1 = vertices[4 * i1 + 2];
- float x2 = vertices[4 * i2 + 0];
- float y2 = vertices[4 * i2 + 1];
- float z2 = vertices[4 * i2 + 2];
-
- float nx0 = normals[3 * i0 + 0];
- float ny0 = normals[3 * i0 + 1];
- float nz0 = normals[3 * i0 + 2];
- float nx1 = normals[3 * i1 + 0];
- float ny1 = normals[3 * i1 + 1];
- float nz1 = normals[3 * i1 + 2];
- float nx2 = normals[3 * i2 + 0];
- float ny2 = normals[3 * i2 + 1];
- float nz2 = normals[3 * i2 + 2];
-
- int argb0 = PGL.nativeToJavaARGB(color[i0]);
- int argb1 = PGL.nativeToJavaARGB(color[i1]);
- int argb2 = PGL.nativeToJavaARGB(color[i2]);
-
- tess.fill(argb0);
- tess.normal(nx0, ny0, nz0);
- tess.vertex(x0, y0, z0, uv[2 * i0 + 0], uv[2 * i0 + 1]);
-
- tess.fill(argb1);
- tess.normal(nx1, ny1, nz1);
- tess.vertex(x1, y1, z1, uv[2 * i1 + 0], uv[2 * i1 + 1]);
-
- tess.fill(argb2);
- tess.normal(nx2, ny2, nz2);
- tess.vertex(x2, y2, z2, uv[2 * i2 + 0], uv[2 * i2 + 1]);
- } else if (is2D()) {
- float x0 = vertices[4 * i0 + 0], y0 = vertices[4 * i0 + 1];
- float x1 = vertices[4 * i1 + 0], y1 = vertices[4 * i1 + 1];
- float x2 = vertices[4 * i2 + 0], y2 = vertices[4 * i2 + 1];
-
- int argb0 = PGL.nativeToJavaARGB(color[i0]);
- int argb1 = PGL.nativeToJavaARGB(color[i1]);
- int argb2 = PGL.nativeToJavaARGB(color[i2]);
-
- tess.fill(argb0);
- tess.vertex(x0, y0, uv[2 * i0 + 0], uv[2 * i0 + 1]);
-
- tess.fill(argb1);
- tess.vertex(x1, y1, uv[2 * i1 + 0], uv[2 * i1 + 1]);
-
- tess.fill(argb2);
- tess.vertex(x2, y2, uv[2 * i2 + 0], uv[2 * i2 + 1]);
- }
- }
- }
- tess.endShape();
-
- return tess;
- }
-
-
- ///////////////////////////////////////////////////////////
-
- //
-
- // Tessellation
-
-
- protected void updateTessellation() {
- if (!root.tessellated || root.contextIsOutdated()) {
- root.tessellate();
- root.aggregate();
- }
- }
-
-
- protected void markForTessellation() {
- root.tessellated = false;
- tessellated = false;
- }
-
- protected void tessellate() {
- if (root == this && parent == null) {
- if (tessGeo == null) {
- tessGeo = pg.newTessGeometry(PGraphicsOpenGL.RETAINED);
- }
- tessGeo.clear();
-
- tessellateImpl();
-
- // Tessellated arrays are trimmed since they are expanded
- // by doubling their old size, which might lead to arrays
- // larger than the vertex counts.
- tessGeo.trim();
-
- modified = false;
- needBufferInit = true;
-
- modifiedPolyVertices = false;
- modifiedPolyColors = false;
- modifiedPolyNormals = false;
- modifiedPolyTexCoords = false;
- modifiedPolyAmbient = false;
- modifiedPolySpecular = false;
- modifiedPolyEmissive = false;
- modifiedPolyShininess = false;
-
- modifiedLineVertices = false;
- modifiedLineColors = false;
- modifiedLineAttributes = false;
-
- modifiedPointVertices = false;
- modifiedPointColors = false;
- modifiedPointAttributes = false;
-
- firstModifiedPolyVertex = PConstants.MAX_INT;
- lastModifiedPolyVertex = PConstants.MIN_INT;
- firstModifiedPolyColor = PConstants.MAX_INT;
- lastModifiedPolyColor = PConstants.MIN_INT;
- firstModifiedPolyNormal = PConstants.MAX_INT;
- lastModifiedPolyNormal = PConstants.MIN_INT;
- firstModifiedPolyTexcoord = PConstants.MAX_INT;
- lastModifiedPolyTexcoord = PConstants.MIN_INT;
- firstModifiedPolyAmbient = PConstants.MAX_INT;
- lastModifiedPolyAmbient = PConstants.MIN_INT;
- firstModifiedPolySpecular = PConstants.MAX_INT;
- lastModifiedPolySpecular = PConstants.MIN_INT;
- firstModifiedPolyEmissive = PConstants.MAX_INT;
- lastModifiedPolyEmissive = PConstants.MIN_INT;
- firstModifiedPolyShininess = PConstants.MAX_INT;
- lastModifiedPolyShininess = PConstants.MIN_INT;
-
- firstModifiedLineVertex = PConstants.MAX_INT;
- lastModifiedLineVertex = PConstants.MIN_INT;
- firstModifiedLineColor = PConstants.MAX_INT;
- lastModifiedLineColor = PConstants.MIN_INT;
- firstModifiedLineAttribute = PConstants.MAX_INT;
- lastModifiedLineAttribute = PConstants.MIN_INT;
-
- firstModifiedPointVertex = PConstants.MAX_INT;
- lastModifiedPointVertex = PConstants.MIN_INT;
- firstModifiedPointColor = PConstants.MAX_INT;
- lastModifiedPointColor = PConstants.MIN_INT;
- firstModifiedPointAttribute = PConstants.MAX_INT;
- lastModifiedPointAttribute = PConstants.MIN_INT;
- }
- }
-
-
- protected void tessellateImpl() {
- tessGeo = root.tessGeo;
-
- firstPolyIndexCache = -1;
- lastPolyIndexCache = -1;
- firstLineIndexCache = -1;
- lastLineIndexCache = -1;
- firstPointIndexCache = -1;
- lastPointIndexCache = -1;
-
- if (family == GROUP) {
- for (int i = 0; i < childCount; i++) {
- PShapeOpenGL child = (PShapeOpenGL) children[i];
- child.tessellateImpl();
- }
- } else {
- if (shapeCreated) {
- // If the geometry was tessellated previously, then
- // the edges information will still be stored in the
- // input object, so it needs to be removed to avoid
- // duplication.
- inGeo.clearEdges();
-
- tessellator.setInGeometry(inGeo);
- tessellator.setTessGeometry(tessGeo);
- tessellator.setFill(fill || image != null);
- tessellator.setStroke(stroke);
- tessellator.setStrokeColor(strokeColor);
- tessellator.setStrokeWeight(strokeWeight);
- tessellator.setStrokeCap(strokeCap);
- tessellator.setStrokeJoin(strokeJoin);
- tessellator.setTexCache(null, null, null);
- tessellator.setTransform(matrix);
- tessellator.set3D(is3D());
-
- if (family == GEOMETRY) {
- if (kind == POINTS) {
- tessellator.tessellatePoints();
- } else if (kind == LINES) {
- tessellator.tessellateLines();
- } else if (kind == LINE_STRIP) {
- tessellator.tessellateLineStrip();
- } else if (kind == LINE_LOOP) {
- tessellator.tessellateLineLoop();
- } else if (kind == TRIANGLE || kind == TRIANGLES) {
- if (stroke) inGeo.addTrianglesEdges();
- if (normalMode == NORMAL_MODE_AUTO) inGeo.calcTrianglesNormals();
- tessellator.tessellateTriangles();
- } else if (kind == TRIANGLE_FAN) {
- if (stroke) inGeo.addTriangleFanEdges();
- if (normalMode == NORMAL_MODE_AUTO) inGeo.calcTriangleFanNormals();
- tessellator.tessellateTriangleFan();
- } else if (kind == TRIANGLE_STRIP) {
- if (stroke) inGeo.addTriangleStripEdges();
- if (normalMode == NORMAL_MODE_AUTO) inGeo.calcTriangleStripNormals();
- tessellator.tessellateTriangleStrip();
- } else if (kind == QUAD || kind == QUADS) {
- if (stroke) inGeo.addQuadsEdges();
- if (normalMode == NORMAL_MODE_AUTO) inGeo.calcQuadsNormals();
- tessellator.tessellateQuads();
- } else if (kind == QUAD_STRIP) {
- if (stroke) inGeo.addQuadStripEdges();
- if (normalMode == NORMAL_MODE_AUTO) inGeo.calcQuadStripNormals();
- tessellator.tessellateQuadStrip();
- } else if (kind == POLYGON) {
- if (stroke) inGeo.addPolygonEdges(isClosed);
- tessellator.tessellatePolygon(isSolid, isClosed,
- normalMode == NORMAL_MODE_AUTO);
- }
- } else if (family == PRIMITIVE) {
- // The input geometry needs to be cleared because the geometry
- // generation methods in InGeometry add the vertices of the
- // new primitive to what is already stored.
- inGeo.clear();
-
- if (kind == POINT) {
- tessellatePoint();
- } else if (kind == LINE) {
- tessellateLine();
- } else if (kind == TRIANGLE) {
- tessellateTriangle();
- } else if (kind == QUAD) {
- tessellateQuad();
- } else if (kind == RECT) {
- tessellateRect();
- } else if (kind == ELLIPSE) {
- tessellateEllipse();
- } else if (kind == ARC) {
- tessellateArc();
- } else if (kind == BOX) {
- tessellateBox();
- } else if (kind == SPHERE) {
- tessellateSphere();
- }
- } else if (family == PATH) {
- inGeo.clear();
- tessellatePath();
- }
-
- if (image != null && parent != null) {
- ((PShapeOpenGL)parent).addTexture(image);
- }
-
- firstPolyIndexCache = tessellator.firstPolyIndexCache;
- lastPolyIndexCache = tessellator.lastPolyIndexCache;
- firstLineIndexCache = tessellator.firstLineIndexCache;
- lastLineIndexCache = tessellator.lastLineIndexCache;
- firstPointIndexCache = tessellator.firstPointIndexCache;
- lastPointIndexCache = tessellator.lastPointIndexCache;
- }
- }
-
- firstPolyVertex = lastPolyVertex = -1;
- firstLineVertex = lastLineVertex = -1;
- firstPointVertex = lastPointVertex = -1;
-
- tessellated = true;
- }
-
-
- protected void tessellatePoint() {
- float x = 0, y = 0, z = 0;
- if (params.length == 2) {
- x = params[0];
- y = params[1];
- z = 0;
- } else if (params.length == 3) {
- x = params[0];
- y = params[1];
- z = params[2];
- }
-
- inGeo.setMaterial(fillColor, strokeColor, strokeWeight,
- ambientColor, specularColor, emissiveColor, shininess);
- inGeo.setNormal(normalX, normalY, normalZ);
- inGeo.addPoint(x, y, z, fill, stroke);
- tessellator.tessellatePoints();
- }
-
-
- protected void tessellateLine() {
- float x1 = 0, y1 = 0, z1 = 0;
- float x2 = 0, y2 = 0, z2 = 0;
- if (params.length == 4) {
- x1 = params[0];
- y1 = params[1];
- x2 = params[2];
- y2 = params[3];
- } else if (params.length == 6) {
- x1 = params[0];
- y1 = params[1];
- z1 = params[2];
- x2 = params[3];
- y2 = params[4];
- z2 = params[5];
- }
-
- inGeo.setMaterial(fillColor, strokeColor, strokeWeight,
- ambientColor, specularColor, emissiveColor, shininess);
- inGeo.setNormal(normalX, normalY, normalZ);
- inGeo.addLine(x1, y1, z1,
- x2, y2, z2,
- fill, stroke);
- tessellator.tessellateLines();
- }
-
-
- protected void tessellateTriangle() {
- float x1 = 0, y1 = 0;
- float x2 = 0, y2 = 0;
- float x3 = 0, y3 = 0;
- if (params.length == 6) {
- x1 = params[0];
- y1 = params[1];
- x2 = params[2];
- y2 = params[3];
- x3 = params[4];
- y3 = params[5];
- }
-
- inGeo.setMaterial(fillColor, strokeColor, strokeWeight,
- ambientColor, specularColor, emissiveColor, shininess);
- inGeo.setNormal(normalX, normalY, normalZ);
- inGeo.addTriangle(x1, y1, 0,
- x2, y2, 0,
- x3, y3, 0,
- fill, stroke);
- tessellator.tessellateTriangles();
- }
-
-
- protected void tessellateQuad() {
- float x1 = 0, y1 = 0;
- float x2 = 0, y2 = 0;
- float x3 = 0, y3 = 0;
- float x4 = 0, y4 = 0;
- if (params.length == 8) {
- x1 = params[0];
- y1 = params[1];
- x2 = params[2];
- y2 = params[3];
- x3 = params[4];
- y3 = params[5];
- x4 = params[6];
- y4 = params[7];
- }
-
- inGeo.setMaterial(fillColor, strokeColor, strokeWeight,
- ambientColor, specularColor, emissiveColor, shininess);
- inGeo.setNormal(normalX, normalY, normalZ);
- inGeo.addQuad(x1, y1, 0,
- x2, y2, 0,
- x3, y3, 0,
- x4, y4, 0,
- fill, stroke);
- tessellator.tessellateQuads();
- }
-
-
- protected void tessellateRect() {
- float a = 0, b = 0, c = 0, d = 0;
- float tl = 0, tr = 0, br = 0, bl = 0;
- boolean rounded = false;
- if (params.length == 4) {
- rounded = false;
- a = params[0];
- b = params[1];
- c = params[2];
- d = params[3];
- } else if (params.length == 5) {
- a = params[0];
- b = params[1];
- c = params[2];
- d = params[3];
- tl = tr = br = bl = params[4];
- rounded = true;
- } else if (params.length == 8) {
- a = params[0];
- b = params[1];
- c = params[2];
- d = params[3];
- tl = params[4];
- tr = params[5];
- br = params[6];
- bl = params[7];
- rounded = true;
- }
-
- rectMode = CORNER;
- inGeo.setMaterial(fillColor, strokeColor, strokeWeight,
- ambientColor, specularColor, emissiveColor, shininess);
- inGeo.setNormal(normalX, normalY, normalZ);
- if (rounded) {
- inGeo.addRect(a, b, c, d,
- tl, tr, br, bl,
- fill, stroke, bezierDetail, rectMode);
- tessellator.tessellatePolygon(false, true, true);
- } else {
- inGeo.addRect(a, b, c, d,
- fill, stroke, rectMode);
- tessellator.tessellateQuads();
- }
- }
-
-
- protected void tessellateEllipse() {
- float a = 0, b = 0, c = 0, d = 0;
- if (params.length == 4) {
- a = params[0];
- b = params[1];
- c = params[2];
- d = params[3];
- }
-
-// ellipseMode = CORNER;
- inGeo.setMaterial(fillColor, strokeColor, strokeWeight,
- ambientColor, specularColor, emissiveColor, shininess);
- inGeo.setNormal(normalX, normalY, normalZ);
- inGeo.addEllipse(a, b, c, d, fill, stroke, ellipseMode);
- tessellator.tessellateTriangleFan();
- }
-
-
- protected void tessellateArc() {
- float a = 0, b = 0, c = 0, d = 0;
- float start = 0, stop = 0;
- int mode = 0;
- if (params.length == 6 || params.length == 7) {
- a = params[0];
- b = params[1];
- c = params[2];
- d = params[3];
- start = params[4];
- stop = params[5];
- if (params.length == 7) {
- mode = (int)(params[6]);
- }
- }
-
-// ellipseMode = CORNER;
- inGeo.setMaterial(fillColor, strokeColor, strokeWeight,
- ambientColor, specularColor, emissiveColor, shininess);
- inGeo.setNormal(normalX, normalY, normalZ);
- inGeo.addArc(a, b, c, d, start, stop, fill, stroke, mode);
- tessellator.tessellateTriangleFan();
- }
-
-
- protected void tessellateBox() {
- float w = 0, h = 0, d = 0;
- if (params.length == 1) {
- w = h = d = params[0];
- } else if (params.length == 3) {
- w = params[0];
- h = params[1];
- d = params[2];
- }
-
- inGeo.setMaterial(fillColor, strokeColor, strokeWeight,
- ambientColor, specularColor, emissiveColor, shininess);
- inGeo.addBox(w, h, d, fill, stroke);
- tessellator.tessellateQuads();
- }
-
-
- protected void tessellateSphere() {
- // Getting sphere detail from renderer. Is this correct?
- int nu = pg.sphereDetailU;
- int nv = pg.sphereDetailV;
- float r = 0;
- if (params.length == 1) {
- r = params[0];
- }
-
- inGeo.setMaterial(fillColor, strokeColor, strokeWeight,
- ambientColor, specularColor, emissiveColor, shininess);
- int[] indices = inGeo.addSphere(r, nu, nv, fill, stroke);
- tessellator.tessellateTriangles(indices);
- }
-
-
- protected void tessellatePath() {
- if (vertices == null) return;
-
- inGeo.setMaterial(fillColor, strokeColor, strokeWeight,
- ambientColor, specularColor, emissiveColor, shininess);
-
- if (vertexCodeCount == 0) { // each point is a simple vertex
- if (vertices[0].length == 2) { // tesellating 2D vertices
- for (int i = 0; i < vertexCount; i++) {
- inGeo.addVertex(vertices[i][X], vertices[i][Y], VERTEX);
- }
- } else { // drawing 3D vertices
- for (int i = 0; i < vertexCount; i++) {
- inGeo.addVertex(vertices[i][X], vertices[i][Y], vertices[i][Z], VERTEX);
- }
- }
- } else { // coded set of vertices
- int idx = 0;
- int code = BREAK;
-
- if (vertices[0].length == 2) { // tessellating a 2D path
-
- for (int j = 0; j < vertexCodeCount; j++) {
- switch (vertexCodes[j]) {
-
- case VERTEX:
- inGeo.addVertex(vertices[idx][X], vertices[idx][Y], code);
- code = VERTEX;
- idx++;
- break;
-
- case QUAD_BEZIER_VERTEX:
- inGeo.addQuadraticVertex(vertices[idx+0][X], vertices[idx+0][Y], 0,
- vertices[idx+1][X], vertices[idx+1][Y], 0,
- fill, stroke, bezierDetail, code);
- code = VERTEX;
- idx += 2;
- break;
-
- case BEZIER_VERTEX:
- inGeo.addBezierVertex(vertices[idx+0][X], vertices[idx+0][Y], 0,
- vertices[idx+1][X], vertices[idx+1][Y], 0,
- vertices[idx+2][X], vertices[idx+2][Y], 0,
- fill, stroke, bezierDetail, code);
- code = VERTEX;
- idx += 3;
- break;
-
- case CURVE_VERTEX:
- inGeo.addCurveVertex(vertices[idx][X], vertices[idx][Y], 0,
- fill, stroke, curveDetail, code);
- code = VERTEX;
- idx++;
- break;
-
- case BREAK:
- code = BREAK;
- }
- }
- } else { // tessellating a 3D path
- for (int j = 0; j < vertexCodeCount; j++) {
- switch (vertexCodes[j]) {
-
- case VERTEX:
- inGeo.addVertex(vertices[idx][X], vertices[idx][Y],
- vertices[idx][Z], code);
- code = VERTEX;
- idx++;
- break;
-
- case QUAD_BEZIER_VERTEX:
- inGeo.addQuadraticVertex(vertices[idx+0][X],
- vertices[idx+0][Y],
- vertices[idx+0][Z],
- vertices[idx+1][X],
- vertices[idx+1][Y],
- vertices[idx+0][Z],
- fill, stroke, bezierDetail, code);
- code = VERTEX;
- idx += 2;
- break;
-
-
- case BEZIER_VERTEX:
- inGeo.addBezierVertex(vertices[idx+0][X],
- vertices[idx+0][Y],
- vertices[idx+0][Z],
- vertices[idx+1][X],
- vertices[idx+1][Y],
- vertices[idx+1][Z],
- vertices[idx+2][X],
- vertices[idx+2][Y],
- vertices[idx+2][Z],
- fill, stroke, bezierDetail, code);
- code = VERTEX;
- idx += 3;
- break;
-
- case CURVE_VERTEX:
- inGeo.addCurveVertex(vertices[idx][X],
- vertices[idx][Y],
- vertices[idx][Z],
- fill, stroke, curveDetail, code);
- code = VERTEX;
- idx++;
- break;
-
- case BREAK:
- code = BREAK;
- }
- }
- }
- }
-
- if (stroke) inGeo.addPolygonEdges(isClosed);
- tessellator.tessellatePolygon(false, isClosed, true);
- }
-
-
- ///////////////////////////////////////////////////////////
-
- //
-
- // Aggregation
-
-
- protected void aggregate() {
- if (root == this && parent == null) {
- // Initializing auxiliary variables in root node
- // needed for aggregation.
- polyIndexOffset = 0;
- polyVertexOffset = 0;
- polyVertexAbs = 0;
- polyVertexRel = 0;
-
- lineIndexOffset = 0;
- lineVertexOffset = 0;
- lineVertexAbs = 0;
- lineVertexRel = 0;
-
- pointIndexOffset = 0;
- pointVertexOffset = 0;
- pointVertexAbs = 0;
- pointVertexRel = 0;
-
- // Recursive aggregation.
- aggregateImpl();
- }
- }
-
-
- // This method is very important, as it is responsible of generating the
- // correct vertex and index offsets for each level of the shape hierarchy.
- // This is the core of the recursive algorithm that calculates the indices
- // for the vertices accumulated in a single VBO.
- // Basically, the algorithm traverses all the shapes in the hierarchy and
- // updates the index cache for each child shape holding geometry (those being
- // the leaf nodes in the hierarchy tree), and creates index caches for the
- // group shapes so that the draw() method can be called from any shape in the
- // hierarchy and the correct piece of geometry will be rendered.
- //
- // For example, in the following hierarchy:
- //
- // ROOT GROUP
- // |
- // /-----------------0-----------------\
- // | |
- // CHILD GROUP 0 CHILD GROUP 1
- // | |
- // | /---------------0-----------------\
- // | | | |
- // GEO SHAPE 0 GEO SHAPE 0 GEO SHAPE 1 GEO SHAPE 2
- // 4 vertices 5 vertices 6 vertices 3 vertices
- //
- // calling draw() from the root group should result in all the
- // vertices (4 + 5 + 6 + 3 = 18) being rendered, while calling
- // draw() from either child groups 0 or 1 should result in the first
- // 4 vertices or the last 14 vertices being rendered, respectively.
- protected void aggregateImpl() {
- if (family == GROUP) {
- // Recursively aggregating the child shapes.
- hasPolys = false;
- hasLines = false;
- hasPoints = false;
- for (int i = 0; i < childCount; i++) {
- PShapeOpenGL child = (PShapeOpenGL) children[i];
- child.aggregateImpl();
- hasPolys |= child.hasPolys;
- hasLines |= child.hasLines;
- hasPoints |= child.hasPoints;
- }
- } else { // LEAF SHAPE (family either GEOMETRY, PATH or PRIMITIVE)
- hasPolys = -1 < firstPolyIndexCache && -1 < lastPolyIndexCache;
- hasLines = -1 < firstLineIndexCache && -1 < lastLineIndexCache;
- hasPoints = -1 < firstPointIndexCache && -1 < lastPointIndexCache;
- }
-
- if (hasPolys) {
- updatePolyIndexCache();
- }
- if (is3D()) {
- if (hasLines) updateLineIndexCache();
- if (hasPoints) updatePointIndexCache();
- }
-
- if (matrix != null) {
- // Some geometric transformations were applied on
- // this shape before tessellation, so they are applied now.
- //applyMatrixImpl(matrix);
- if (hasPolys) {
- tessGeo.applyMatrixOnPolyGeometry(matrix,
- firstPolyVertex, lastPolyVertex);
- }
- if (is3D()) {
- if (hasLines) {
- tessGeo.applyMatrixOnLineGeometry(matrix,
- firstLineVertex, lastLineVertex);
- }
- if (hasPoints) {
- tessGeo.applyMatrixOnPointGeometry(matrix,
- firstPointVertex, lastPointVertex);
- }
- }
- }
- }
-
-
- // Updates the index cache for the range that corresponds to this shape.
- protected void updatePolyIndexCache() {
- IndexCache cache = tessGeo.polyIndexCache;
- if (family == GROUP) {
- // Updates the index cache to include the elements corresponding to
- // a group shape, using the cache entries of the child shapes. The
- // index cache has a pyramidal structure where the base is formed
- // by the entries corresponding to the leaf (geometry) shapes, and
- // each subsequent level is determined by the higher-level group shapes
- // The index pyramid is flattened into arrays in order to use simple
- // data structures, so each shape needs to store the positions in the
- // cache that corresponds to itself.
-
- // The index ranges of the child shapes that share the vertex offset
- // are unified into a single range in the parent level.
-
- firstPolyIndexCache = lastPolyIndexCache = -1;
- int gindex = -1;
-
- for (int i = 0; i < childCount; i++) {
- PShapeOpenGL child = (PShapeOpenGL) children[i];
-
- int first = child.firstPolyIndexCache;
- int count = -1 < first ? child.lastPolyIndexCache - first + 1 : -1;
- for (int n = first; n < first + count; n++) {
- if (gindex == -1) {
- gindex = cache.addNew(n);
- firstPolyIndexCache = gindex;
- } else {
- if (cache.vertexOffset[gindex] == cache.vertexOffset[n]) {
- // When the vertex offsets are the same, this means that the
- // current index range in the group shape can be extended to
- // include the index range in the current child shape.
- // This is a result of how the indices are updated for the
- // leaf shapes.
- cache.incCounts(gindex,
- cache.indexCount[n], cache.vertexCount[n]);
- } else {
- gindex = cache.addNew(n);
- }
- }
- }
-
- // Updating the first and last poly vertices for this group shape.
- if (-1 < child.firstPolyVertex) {
- if (firstPolyVertex == -1) {
- firstPolyVertex = Integer.MAX_VALUE;
- }
- firstPolyVertex = PApplet.min(firstPolyVertex, child.firstPolyVertex);
- }
- if (-1 < child.lastPolyVertex) {
- lastPolyVertex = PApplet.max(lastPolyVertex, child.lastPolyVertex);
- }
- }
- lastPolyIndexCache = gindex;
- } else {
- // The index cache is updated in order to reflect the fact that all
- // the vertices will be stored in a single VBO in the root shape.
- // This update works as follows (the methodology is the same for
- // poly, line and point): the VertexAbs variable in the root shape
- // stores the index of the last vertex up to this shape (plus one)
- // without taking into consideration the MAX_VERTEX_INDEX limit, so
- // it effectively runs over the entire range.
- // VertexRel, on the other hand, is reset every time the limit is
- // exceeded, therefore creating the start of a new index group in the
- // root shape. When this happens, the indices in the child shape need
- // to be restarted as well to reflect the new index offset.
-
- firstPolyVertex = lastPolyVertex =
- cache.vertexOffset[firstPolyIndexCache];
- for (int n = firstPolyIndexCache; n <= lastPolyIndexCache; n++) {
- int ioffset = cache.indexOffset[n];
- int icount = cache.indexCount[n];
- int vcount = cache.vertexCount[n];
-
- if (PGL.MAX_VERTEX_INDEX1 <= root.polyVertexRel + vcount || // Too many vertices already signal the start of a new cache...
- (is2D() && startStrokedTex(n))) { // ... or, in 2D, the beginning of line or points.
- root.polyVertexRel = 0;
- root.polyVertexOffset = root.polyVertexAbs;
- cache.indexOffset[n] = root.polyIndexOffset;
- } else {
- tessGeo.incPolyIndices(ioffset, ioffset + icount - 1,
- root.polyVertexRel);
- }
- cache.vertexOffset[n] = root.polyVertexOffset;
- if (is2D()) {
- setFirstStrokeVertex(n, lastPolyVertex);
- }
-
- root.polyIndexOffset += icount;
- root.polyVertexAbs += vcount;
- root.polyVertexRel += vcount;
- lastPolyVertex += vcount;
- }
- lastPolyVertex--;
- if (is2D()) {
- setLastStrokeVertex(lastPolyVertex);
- }
- }
- }
-
-
- protected boolean startStrokedTex(int n) {
- return image != null && (n == firstLineIndexCache ||
- n == firstPointIndexCache);
- }
-
-
- protected void setFirstStrokeVertex(int n, int vert) {
- if (n == firstLineIndexCache && firstLineVertex == -1) {
- firstLineVertex = lastLineVertex = vert;
- }
- if (n == firstPointIndexCache && firstPointVertex == -1) {
- firstPointVertex = lastPointVertex = vert;
- }
- }
-
- protected void setLastStrokeVertex(int vert) {
- if (-1 < lastLineVertex) {
- lastLineVertex = vert;
- }
- if (-1 < lastPointVertex) {
- lastPointVertex += vert;
- }
- }
-
- protected void updateLineIndexCache() {
- IndexCache cache = tessGeo.lineIndexCache;
- if (family == GROUP) {
- firstLineIndexCache = lastLineIndexCache = -1;
- int gindex = -1;
-
- for (int i = 0; i < childCount; i++) {
- PShapeOpenGL child = (PShapeOpenGL) children[i];
-
- int first = child.firstLineIndexCache;
- int count = -1 < first ? child.lastLineIndexCache - first + 1 : -1;
- for (int n = first; n < first + count; n++) {
- if (gindex == -1) {
- gindex = cache.addNew(n);
- firstLineIndexCache = gindex;
- } else {
- if (cache.vertexOffset[gindex] == cache.vertexOffset[n]) {
- cache.incCounts(gindex, cache.indexCount[n],
- cache.vertexCount[n]);
- } else {
- gindex = cache.addNew(n);
- }
- }
- }
-
- // Updating the first and last line vertices for this group shape.
- if (-1 < child.firstLineVertex) {
- if (firstLineVertex == -1) firstLineVertex = Integer.MAX_VALUE;
- firstLineVertex = PApplet.min(firstLineVertex, child.firstLineVertex);
- }
- if (-1 < child.lastLineVertex) {
- lastLineVertex = PApplet.max(lastLineVertex, child.lastLineVertex);
- }
- }
- lastLineIndexCache = gindex;
- } else {
- firstLineVertex = lastLineVertex =
- cache.vertexOffset[firstLineIndexCache];
- for (int n = firstLineIndexCache; n <= lastLineIndexCache; n++) {
- int ioffset = cache.indexOffset[n];
- int icount = cache.indexCount[n];
- int vcount = cache.vertexCount[n];
-
- if (PGL.MAX_VERTEX_INDEX1 <= root.lineVertexRel + vcount) {
- root.lineVertexRel = 0;
- root.lineVertexOffset = root.lineVertexAbs;
- cache.indexOffset[n] = root.lineIndexOffset;
- } else {
- tessGeo.incLineIndices(ioffset, ioffset + icount - 1,
- root.lineVertexRel);
- }
- cache.vertexOffset[n] = root.lineVertexOffset;
-
- root.lineIndexOffset += icount;
- root.lineVertexAbs += vcount;
- root.lineVertexRel += vcount;
- lastLineVertex += vcount;
- }
- lastLineVertex--;
- }
- }
-
-
- protected void updatePointIndexCache() {
- IndexCache cache = tessGeo.pointIndexCache;
- if (family == GROUP) {
- firstPointIndexCache = lastPointIndexCache = -1;
- int gindex = -1;
-
- for (int i = 0; i < childCount; i++) {
- PShapeOpenGL child = (PShapeOpenGL) children[i];
-
- int first = child.firstPointIndexCache;
- int count = -1 < first ? child.lastPointIndexCache - first + 1 : -1;
- for (int n = first; n < first + count; n++) {
- if (gindex == -1) {
- gindex = cache.addNew(n);
- firstPointIndexCache = gindex;
- } else {
- if (cache.vertexOffset[gindex] == cache.vertexOffset[n]) {
- // When the vertex offsets are the same, this means that the
- // current index range in the group shape can be extended to
- // include either the index range in the current child shape.
- // This is a result of how the indices are updated for the
- // leaf shapes in aggregateImpl().
- cache.incCounts(gindex, cache.indexCount[n],
- cache.vertexCount[n]);
- } else {
- gindex = cache.addNew(n);
- }
- }
- }
-
- // Updating the first and last point vertices for this group shape.
- if (-1 < child.firstPointVertex) {
- if (firstPointVertex == -1) firstPointVertex = Integer.MAX_VALUE;
- firstPointVertex = PApplet.min(firstPointVertex,
- child.firstPointVertex);
- }
- if (-1 < child.lastPointVertex) {
- lastPointVertex = PApplet.max(lastPointVertex, child.lastPointVertex);
- }
- }
- lastPointIndexCache = gindex;
- } else {
- firstPointVertex = lastPointVertex =
- cache.vertexOffset[firstPointIndexCache];
- for (int n = firstPointIndexCache; n <= lastPointIndexCache; n++) {
- int ioffset = cache.indexOffset[n];
- int icount = cache.indexCount[n];
- int vcount = cache.vertexCount[n];
-
- if (PGL.MAX_VERTEX_INDEX1 <= root.pointVertexRel + vcount) {
- root.pointVertexRel = 0;
- root.pointVertexOffset = root.pointVertexAbs;
- cache.indexOffset[n] = root.pointIndexOffset;
- } else {
- tessGeo.incPointIndices(ioffset, ioffset + icount - 1,
- root.pointVertexRel);
- }
- cache.vertexOffset[n] = root.pointVertexOffset;
-
- root.pointIndexOffset += icount;
- root.pointVertexAbs += vcount;
- root.pointVertexRel += vcount;
- lastPointVertex += vcount;
- }
- lastPointVertex--;
- }
- }
-
-
- ///////////////////////////////////////////////////////////
-
- //
-
- // Buffer initialization
-
-
- protected void initBuffers() {
- if (needBufferInit) {
- context = pgl.getCurrentContext();
-
- if (0 < tessGeo.polyVertexCount && 0 < tessGeo.polyIndexCount) {
- initPolyBuffers();
- }
-
- if (0 < tessGeo.lineVertexCount && 0 < tessGeo.lineIndexCount) {
- initLineBuffers();
- }
-
- if (0 < tessGeo.pointVertexCount && 0 < tessGeo.pointIndexCount) {
- initPointBuffers();
- }
-
- needBufferInit = false;
- }
- }
-
-
- protected void initPolyBuffers() {
- int size = tessGeo.polyVertexCount;
- int sizef = size * PGL.SIZEOF_FLOAT;
- int sizei = size * PGL.SIZEOF_INT;
-
- tessGeo.updatePolyVerticesBuffer();
- glPolyVertex = pg.createVertexBufferObject(context);
- pgl.bindBuffer(PGL.ARRAY_BUFFER, glPolyVertex);
- pgl.bufferData(PGL.ARRAY_BUFFER, 4 * sizef,
- tessGeo.polyVerticesBuffer,
- PGL.STATIC_DRAW);
-
- tessGeo.updatePolyColorsBuffer();
- glPolyColor = pg.createVertexBufferObject(context);
- pgl.bindBuffer(PGL.ARRAY_BUFFER, glPolyColor);
- pgl.bufferData(PGL.ARRAY_BUFFER, sizei,
- tessGeo.polyColorsBuffer, PGL.STATIC_DRAW);
-
- tessGeo.updatePolyNormalsBuffer();
- glPolyNormal = pg.createVertexBufferObject(context);
- pgl.bindBuffer(PGL.ARRAY_BUFFER, glPolyNormal);
- pgl.bufferData(PGL.ARRAY_BUFFER, 3 * sizef,
- tessGeo.polyNormalsBuffer, PGL.STATIC_DRAW);
-
- tessGeo.updatePolyTexCoordsBuffer();
- glPolyTexcoord = pg.createVertexBufferObject(context);
- pgl.bindBuffer(PGL.ARRAY_BUFFER, glPolyTexcoord);
- pgl.bufferData(PGL.ARRAY_BUFFER, 2 * sizef,
- tessGeo.polyTexCoordsBuffer, PGL.STATIC_DRAW);
-
- tessGeo.updatePolyAmbientBuffer();
- glPolyAmbient = pg.createVertexBufferObject(context);
- pgl.bindBuffer(PGL.ARRAY_BUFFER, glPolyAmbient);
- pgl.bufferData(PGL.ARRAY_BUFFER, sizei,
- tessGeo.polyAmbientBuffer, PGL.STATIC_DRAW);
-
- tessGeo.updatePolySpecularBuffer();
- glPolySpecular = pg.createVertexBufferObject(context);
- pgl.bindBuffer(PGL.ARRAY_BUFFER, glPolySpecular);
- pgl.bufferData(PGL.ARRAY_BUFFER, sizei,
- tessGeo.polySpecularBuffer, PGL.STATIC_DRAW);
-
- tessGeo.updatePolyEmissiveBuffer();
- glPolyEmissive = pg.createVertexBufferObject(context);
- pgl.bindBuffer(PGL.ARRAY_BUFFER, glPolyEmissive);
- pgl.bufferData(PGL.ARRAY_BUFFER, sizei,
- tessGeo.polyEmissiveBuffer, PGL.STATIC_DRAW);
-
- tessGeo.updatePolyShininessBuffer();
- glPolyShininess = pg.createVertexBufferObject(context);
- pgl.bindBuffer(PGL.ARRAY_BUFFER, glPolyShininess);
- pgl.bufferData(PGL.ARRAY_BUFFER, sizef,
- tessGeo.polyShininessBuffer, PGL.STATIC_DRAW);
-
- pgl.bindBuffer(PGL.ARRAY_BUFFER, 0);
-
- tessGeo.updatePolyIndicesBuffer();
- glPolyIndex = pg.createVertexBufferObject(context);
- pgl.bindBuffer(PGL.ELEMENT_ARRAY_BUFFER, glPolyIndex);
- pgl.bufferData(PGL.ELEMENT_ARRAY_BUFFER,
- tessGeo.polyIndexCount * PGL.SIZEOF_INDEX,
- tessGeo.polyIndicesBuffer, PGL.STATIC_DRAW);
-
- pgl.bindBuffer(PGL.ELEMENT_ARRAY_BUFFER, 0);
- }
-
-
- protected void initLineBuffers() {
- int size = tessGeo.lineVertexCount;
- int sizef = size * PGL.SIZEOF_FLOAT;
- int sizei = size * PGL.SIZEOF_INT;
-
- tessGeo.updateLineVerticesBuffer();
- glLineVertex = pg.createVertexBufferObject(context);
- pgl.bindBuffer(PGL.ARRAY_BUFFER, glLineVertex);
- pgl.bufferData(PGL.ARRAY_BUFFER, 4 * sizef,
- tessGeo.lineVerticesBuffer, PGL.STATIC_DRAW);
-
- tessGeo.updateLineColorsBuffer();
- glLineColor = pg.createVertexBufferObject(context);
- pgl.bindBuffer(PGL.ARRAY_BUFFER, glLineColor);
- pgl.bufferData(PGL.ARRAY_BUFFER, sizei,
- tessGeo.lineColorsBuffer, PGL.STATIC_DRAW);
-
- tessGeo.updateLineDirectionsBuffer();
- glLineAttrib = pg.createVertexBufferObject(context);
- pgl.bindBuffer(PGL.ARRAY_BUFFER, glLineAttrib);
- pgl.bufferData(PGL.ARRAY_BUFFER, 4 * sizef,
- tessGeo.lineDirectionsBuffer, PGL.STATIC_DRAW);
-
- pgl.bindBuffer(PGL.ARRAY_BUFFER, 0);
-
- tessGeo.updateLineIndicesBuffer();
- glLineIndex = pg.createVertexBufferObject(context);
- pgl.bindBuffer(PGL.ELEMENT_ARRAY_BUFFER, glLineIndex);
- pgl.bufferData(PGL.ELEMENT_ARRAY_BUFFER,
- tessGeo.lineIndexCount * PGL.SIZEOF_INDEX,
- tessGeo.lineIndicesBuffer, PGL.STATIC_DRAW);
-
- pgl.bindBuffer(PGL.ELEMENT_ARRAY_BUFFER, 0);
- }
-
-
- protected void initPointBuffers() {
- int size = tessGeo.pointVertexCount;
- int sizef = size * PGL.SIZEOF_FLOAT;
- int sizei = size * PGL.SIZEOF_INT;
-
- tessGeo.updatePointVerticesBuffer();
- glPointVertex = pg.createVertexBufferObject(context);
- pgl.bindBuffer(PGL.ARRAY_BUFFER, glPointVertex);
- pgl.bufferData(PGL.ARRAY_BUFFER, 4 * sizef,
- tessGeo.pointVerticesBuffer, PGL.STATIC_DRAW);
-
- tessGeo.updatePointColorsBuffer();
- glPointColor = pg.createVertexBufferObject(context);
- pgl.bindBuffer(PGL.ARRAY_BUFFER, glPointColor);
- pgl.bufferData(PGL.ARRAY_BUFFER, sizei,
- tessGeo.pointColorsBuffer, PGL.STATIC_DRAW);
-
- tessGeo.updatePointOffsetsBuffer();
- glPointAttrib = pg.createVertexBufferObject(context);
- pgl.bindBuffer(PGL.ARRAY_BUFFER, glPointAttrib);
- pgl.bufferData(PGL.ARRAY_BUFFER, 2 * sizef,
- tessGeo.pointOffsetsBuffer, PGL.STATIC_DRAW);
-
- pgl.bindBuffer(PGL.ARRAY_BUFFER, 0);
-
- tessGeo.updatePointIndicesBuffer();
- glPointIndex = pg.createVertexBufferObject(context);
- pgl.bindBuffer(PGL.ELEMENT_ARRAY_BUFFER, glPointIndex);
- pgl.bufferData(PGL.ELEMENT_ARRAY_BUFFER,
- tessGeo.pointIndexCount * PGL.SIZEOF_INDEX,
- tessGeo.pointIndicesBuffer, PGL.STATIC_DRAW);
-
- pgl.bindBuffer(PGL.ELEMENT_ARRAY_BUFFER, 0);
- }
-
-
- protected boolean contextIsOutdated() {
- boolean outdated = !pgl.contextIsCurrent(context);
- if (outdated) {
- // Removing the VBOs from the renderer's list so they
- // doesn't get deleted by OpenGL. The VBOs were already
- // automatically disposed when the old context was
- // destroyed.
- pg.removeVertexBufferObject(glPolyVertex, context);
- pg.removeVertexBufferObject(glPolyColor, context);
- pg.removeVertexBufferObject(glPolyNormal, context);
- pg.removeVertexBufferObject(glPolyTexcoord, context);
- pg.removeVertexBufferObject(glPolyAmbient, context);
- pg.removeVertexBufferObject(glPolySpecular, context);
- pg.removeVertexBufferObject(glPolyEmissive, context);
- pg.removeVertexBufferObject(glPolyShininess, context);
- pg.removeVertexBufferObject(glPolyIndex, context);
-
- pg.removeVertexBufferObject(glLineVertex, context);
- pg.removeVertexBufferObject(glLineColor, context);
- pg.removeVertexBufferObject(glLineAttrib, context);
- pg.removeVertexBufferObject(glLineIndex, context);
-
- pg.removeVertexBufferObject(glPointVertex, context);
- pg.removeVertexBufferObject(glPointColor, context);
- pg.removeVertexBufferObject(glPointAttrib, context);
- pg.removeVertexBufferObject(glPointIndex, context);
-
- // The OpenGL resources have been already deleted
- // when the context changed. We only need to zero
- // them to avoid deleting them again when the GC
- // runs the finalizers of the disposed object.
- glPolyVertex = 0;
- glPolyColor = 0;
- glPolyNormal = 0;
- glPolyTexcoord = 0;
- glPolyAmbient = 0;
- glPolySpecular = 0;
- glPolyEmissive = 0;
- glPolyShininess = 0;
- glPolyIndex = 0;
-
- glLineVertex = 0;
- glLineColor = 0;
- glLineAttrib = 0;
- glLineIndex = 0;
-
- glPointVertex = 0;
- glPointColor = 0;
- glPointAttrib = 0;
- glPointIndex = 0;
- }
- return outdated;
- }
-
-
- ///////////////////////////////////////////////////////////
-
- //
-
- // Deletion methods
-
-
- protected void release() {
- deletePolyBuffers();
- deleteLineBuffers();
- deletePointBuffers();
- }
-
-
- protected void deletePolyBuffers() {
- if (glPolyVertex != 0) {
- pg.deleteVertexBufferObject(glPolyVertex, context);
- glPolyVertex = 0;
- }
-
- if (glPolyColor != 0) {
- pg.deleteVertexBufferObject(glPolyColor, context);
- glPolyColor = 0;
- }
-
- if (glPolyNormal != 0) {
- pg.deleteVertexBufferObject(glPolyNormal, context);
- glPolyNormal = 0;
- }
-
- if (glPolyTexcoord != 0) {
- pg.deleteVertexBufferObject(glPolyTexcoord, context);
- glPolyTexcoord = 0;
- }
-
- if (glPolyAmbient != 0) {
- pg.deleteVertexBufferObject(glPolyAmbient, context);
- glPolyAmbient = 0;
- }
-
- if (glPolySpecular != 0) {
- pg.deleteVertexBufferObject(glPolySpecular, context);
- glPolySpecular = 0;
- }
-
- if (glPolyEmissive != 0) {
- pg.deleteVertexBufferObject(glPolyEmissive, context);
- glPolyEmissive = 0;
- }
-
- if (glPolyShininess != 0) {
- pg.deleteVertexBufferObject(glPolyShininess, context);
- glPolyShininess = 0;
- }
-
- if (glPolyIndex != 0) {
- pg.deleteVertexBufferObject(glPolyIndex, context);
- glPolyIndex = 0;
- }
- }
-
-
- protected void deleteLineBuffers() {
- if (glLineVertex != 0) {
- pg.deleteVertexBufferObject(glLineVertex, context);
- glLineVertex = 0;
- }
-
- if (glLineColor != 0) {
- pg.deleteVertexBufferObject(glLineColor, context);
- glLineColor = 0;
- }
-
- if (glLineAttrib != 0) {
- pg.deleteVertexBufferObject(glLineAttrib, context);
- glLineAttrib = 0;
- }
-
- if (glLineIndex != 0) {
- pg.deleteVertexBufferObject(glLineIndex, context);
- glLineIndex = 0;
- }
- }
-
-
- protected void deletePointBuffers() {
- if (glPointVertex != 0) {
- pg.deleteVertexBufferObject(glPointVertex, context);
- glPointVertex = 0;
- }
-
- if (glPointColor != 0) {
- pg.deleteVertexBufferObject(glPointColor, context);
- glPointColor = 0;
- }
-
- if (glPointAttrib != 0) {
- pg.deleteVertexBufferObject(glPointAttrib, context);
- glPointAttrib = 0;
- }
-
- if (glPointIndex != 0) {
- pg.deleteVertexBufferObject(glPointIndex, context);
- glPointIndex = 0;
- }
- }
-
-
- ///////////////////////////////////////////////////////////
-
- //
-
- // Geometry update
-
-
- protected void updateGeometry() {
- root.initBuffers();
- if (root.modified) {
- root.updateGeometryImpl();
- }
- }
-
-
- protected void updateGeometryImpl() {
- if (modifiedPolyVertices) {
- int offset = firstModifiedPolyVertex;
- int size = lastModifiedPolyVertex - offset + 1;
- copyPolyVertices(offset, size);
- modifiedPolyVertices = false;
- firstModifiedPolyVertex = PConstants.MAX_INT;
- lastModifiedPolyVertex = PConstants.MIN_INT;
- }
- if (modifiedPolyColors) {
- int offset = firstModifiedPolyColor;
- int size = lastModifiedPolyColor - offset + 1;
- copyPolyColors(offset, size);
- modifiedPolyColors = false;
- firstModifiedPolyColor = PConstants.MAX_INT;
- lastModifiedPolyColor = PConstants.MIN_INT;
- }
- if (modifiedPolyNormals) {
- int offset = firstModifiedPolyNormal;
- int size = lastModifiedPolyNormal - offset + 1;
- copyPolyNormals(offset, size);
- modifiedPolyNormals = false;
- firstModifiedPolyNormal = PConstants.MAX_INT;
- lastModifiedPolyNormal = PConstants.MIN_INT;
- }
- if (modifiedPolyTexCoords) {
- int offset = firstModifiedPolyTexcoord;
- int size = lastModifiedPolyTexcoord - offset + 1;
- copyPolyTexCoords(offset, size);
- modifiedPolyTexCoords = false;
- firstModifiedPolyTexcoord = PConstants.MAX_INT;
- lastModifiedPolyTexcoord = PConstants.MIN_INT;
- }
- if (modifiedPolyAmbient) {
- int offset = firstModifiedPolyAmbient;
- int size = lastModifiedPolyAmbient - offset + 1;
- copyPolyAmbient(offset, size);
- modifiedPolyAmbient = false;
- firstModifiedPolyAmbient = PConstants.MAX_INT;
- lastModifiedPolyAmbient = PConstants.MIN_INT;
- }
- if (modifiedPolySpecular) {
- int offset = firstModifiedPolySpecular;
- int size = lastModifiedPolySpecular - offset + 1;
- copyPolySpecular(offset, size);
- modifiedPolySpecular = false;
- firstModifiedPolySpecular = PConstants.MAX_INT;
- lastModifiedPolySpecular = PConstants.MIN_INT;
- }
- if (modifiedPolyEmissive) {
- int offset = firstModifiedPolyEmissive;
- int size = lastModifiedPolyEmissive - offset + 1;
- copyPolyEmissive(offset, size);
- modifiedPolyEmissive = false;
- firstModifiedPolyEmissive = PConstants.MAX_INT;
- lastModifiedPolyEmissive = PConstants.MIN_INT;
- }
- if (modifiedPolyShininess) {
- int offset = firstModifiedPolyShininess;
- int size = lastModifiedPolyShininess - offset + 1;
- copyPolyShininess(offset, size);
- modifiedPolyShininess = false;
- firstModifiedPolyShininess = PConstants.MAX_INT;
- lastModifiedPolyShininess = PConstants.MIN_INT;
- }
-
- if (modifiedLineVertices) {
- int offset = firstModifiedLineVertex;
- int size = lastModifiedLineVertex - offset + 1;
- copyLineVertices(offset, size);
- modifiedLineVertices = false;
- firstModifiedLineVertex = PConstants.MAX_INT;
- lastModifiedLineVertex = PConstants.MIN_INT;
- }
- if (modifiedLineColors) {
- int offset = firstModifiedLineColor;
- int size = lastModifiedLineColor - offset + 1;
- copyLineColors(offset, size);
- modifiedLineColors = false;
- firstModifiedLineColor = PConstants.MAX_INT;
- lastModifiedLineColor = PConstants.MIN_INT;
- }
- if (modifiedLineAttributes) {
- int offset = firstModifiedLineAttribute;
- int size = lastModifiedLineAttribute - offset + 1;
- copyLineAttributes(offset, size);
- modifiedLineAttributes = false;
- firstModifiedLineAttribute = PConstants.MAX_INT;
- lastModifiedLineAttribute = PConstants.MIN_INT;
- }
-
- if (modifiedPointVertices) {
- int offset = firstModifiedPointVertex;
- int size = lastModifiedPointVertex - offset + 1;
- copyPointVertices(offset, size);
- modifiedPointVertices = false;
- firstModifiedPointVertex = PConstants.MAX_INT;
- lastModifiedPointVertex = PConstants.MIN_INT;
- }
- if (modifiedPointColors) {
- int offset = firstModifiedPointColor;
- int size = lastModifiedPointColor - offset + 1;
- copyPointColors(offset, size);
- modifiedPointColors = false;
- firstModifiedPointColor = PConstants.MAX_INT;
- lastModifiedPointColor = PConstants.MIN_INT;
- }
- if (modifiedPointAttributes) {
- int offset = firstModifiedPointAttribute;
- int size = lastModifiedPointAttribute - offset + 1;
- copyPointAttributes(offset, size);
- modifiedPointAttributes = false;
- firstModifiedPointAttribute = PConstants.MAX_INT;
- lastModifiedPointAttribute = PConstants.MIN_INT;
- }
-
- modified = false;
- }
-
-
- protected void copyPolyVertices(int offset, int size) {
- tessGeo.updatePolyVerticesBuffer(offset, size);
- pgl.bindBuffer(PGL.ARRAY_BUFFER, glPolyVertex);
- tessGeo.polyVerticesBuffer.position(4 * offset);
- pgl.bufferSubData(PGL.ARRAY_BUFFER, 4 * offset * PGL.SIZEOF_FLOAT,
- 4 * size * PGL.SIZEOF_FLOAT, tessGeo.polyVerticesBuffer);
- tessGeo.polyVerticesBuffer.rewind();
- pgl.bindBuffer(PGL.ARRAY_BUFFER, 0);
- }
-
-
- protected void copyPolyColors(int offset, int size) {
- tessGeo.updatePolyColorsBuffer(offset, size);
- pgl.bindBuffer(PGL.ARRAY_BUFFER, glPolyColor);
- tessGeo.polyColorsBuffer.position(offset);
- pgl.bufferSubData(PGL.ARRAY_BUFFER, offset * PGL.SIZEOF_INT,
- size * PGL.SIZEOF_INT, tessGeo.polyColorsBuffer);
- tessGeo.polyColorsBuffer.rewind();
- pgl.bindBuffer(PGL.ARRAY_BUFFER, 0);
- }
-
-
- protected void copyPolyNormals(int offset, int size) {
- tessGeo.updatePolyNormalsBuffer(offset, size);
- pgl.bindBuffer(PGL.ARRAY_BUFFER, glPolyNormal);
- tessGeo.polyNormalsBuffer.position(3 * offset);
- pgl.bufferSubData(PGL.ARRAY_BUFFER, 3 * offset * PGL.SIZEOF_FLOAT,
- 3 * size * PGL.SIZEOF_FLOAT, tessGeo.polyNormalsBuffer);
- tessGeo.polyNormalsBuffer.rewind();
- pgl.bindBuffer(PGL.ARRAY_BUFFER, 0);
- }
-
-
- protected void copyPolyTexCoords(int offset, int size) {
- tessGeo.updatePolyTexCoordsBuffer(offset, size);
- pgl.bindBuffer(PGL.ARRAY_BUFFER, glPolyTexcoord);
- tessGeo.polyTexCoordsBuffer.position(2 * offset);
- pgl.bufferSubData(PGL.ARRAY_BUFFER, 2 * offset * PGL.SIZEOF_FLOAT,
- 2 * size * PGL.SIZEOF_FLOAT, tessGeo.polyTexCoordsBuffer);
- tessGeo.polyTexCoordsBuffer.rewind();
- pgl.bindBuffer(PGL.ARRAY_BUFFER, 0);
- }
-
-
- protected void copyPolyAmbient(int offset, int size) {
- tessGeo.updatePolyAmbientBuffer(offset, size);
- pgl.bindBuffer(PGL.ARRAY_BUFFER, glPolyAmbient);
- tessGeo.polyAmbientBuffer.position(offset);
- pgl.bufferSubData(PGL.ARRAY_BUFFER, offset * PGL.SIZEOF_INT,
- size * PGL.SIZEOF_INT, tessGeo.polyAmbientBuffer);
- tessGeo.polyAmbientBuffer.rewind();
- pgl.bindBuffer(PGL.ARRAY_BUFFER, 0);
- }
-
-
- protected void copyPolySpecular(int offset, int size) {
- tessGeo.updatePolySpecularBuffer(offset, size);
- pgl.bindBuffer(PGL.ARRAY_BUFFER, glPolySpecular);
- tessGeo.polySpecularBuffer.position(offset);
- pgl.bufferSubData(PGL.ARRAY_BUFFER, offset * PGL.SIZEOF_INT,
- size * PGL.SIZEOF_INT, tessGeo.polySpecularBuffer);
- tessGeo.polySpecularBuffer.rewind();
- pgl.bindBuffer(PGL.ARRAY_BUFFER, 0);
- }
-
-
- protected void copyPolyEmissive(int offset, int size) {
- tessGeo.updatePolyEmissiveBuffer(offset, size);
- pgl.bindBuffer(PGL.ARRAY_BUFFER, glPolyEmissive);
- tessGeo.polyEmissiveBuffer.position(offset);
- pgl.bufferSubData(PGL.ARRAY_BUFFER, offset * PGL.SIZEOF_INT,
- size * PGL.SIZEOF_INT, tessGeo.polyEmissiveBuffer);
- tessGeo.polyEmissiveBuffer.rewind();
- pgl.bindBuffer(PGL.ARRAY_BUFFER, 0);
- }
-
-
- protected void copyPolyShininess(int offset, int size) {
- tessGeo.updatePolyShininessBuffer(offset, size);
- pgl.bindBuffer(PGL.ARRAY_BUFFER, glPolyShininess);
- tessGeo.polyShininessBuffer.position(offset);
- pgl.bufferSubData(PGL.ARRAY_BUFFER, offset * PGL.SIZEOF_FLOAT,
- size * PGL.SIZEOF_FLOAT, tessGeo.polyShininessBuffer);
- tessGeo.polyShininessBuffer.rewind();
- pgl.bindBuffer(PGL.ARRAY_BUFFER, 0);
- }
-
-
- protected void copyLineVertices(int offset, int size) {
- tessGeo.updateLineVerticesBuffer(offset, size);
- pgl.bindBuffer(PGL.ARRAY_BUFFER, glLineVertex);
- tessGeo.lineVerticesBuffer.position(4 * offset);
- pgl.bufferSubData(PGL.ARRAY_BUFFER, 4 * offset * PGL.SIZEOF_FLOAT,
- 4 * size * PGL.SIZEOF_FLOAT, tessGeo.lineVerticesBuffer);
- tessGeo.lineVerticesBuffer.rewind();
- pgl.bindBuffer(PGL.ARRAY_BUFFER, 0);
- }
-
-
- protected void copyLineColors(int offset, int size) {
- tessGeo.updateLineColorsBuffer(offset, size);
- pgl.bindBuffer(PGL.ARRAY_BUFFER, glLineColor);
- tessGeo.lineColorsBuffer.position(offset);
- pgl.bufferSubData(PGL.ARRAY_BUFFER, offset * PGL.SIZEOF_INT,
- size * PGL.SIZEOF_INT, tessGeo.lineColorsBuffer);
- tessGeo.lineColorsBuffer.rewind();
- pgl.bindBuffer(PGL.ARRAY_BUFFER, 0);
- }
-
-
- protected void copyLineAttributes(int offset, int size) {
- tessGeo.updateLineDirectionsBuffer(offset, size);
- pgl.bindBuffer(PGL.ARRAY_BUFFER, glLineAttrib);
- tessGeo.lineDirectionsBuffer.position(4 * offset);
- pgl.bufferSubData(PGL.ARRAY_BUFFER, 4 * offset * PGL.SIZEOF_FLOAT,
- 4 * size * PGL.SIZEOF_FLOAT, tessGeo.lineDirectionsBuffer);
- tessGeo.lineDirectionsBuffer.rewind();
- pgl.bindBuffer(PGL.ARRAY_BUFFER, 0);
- }
-
-
- protected void copyPointVertices(int offset, int size) {
- tessGeo.updatePointVerticesBuffer(offset, size);
- pgl.bindBuffer(PGL.ARRAY_BUFFER, glPointVertex);
- tessGeo.pointVerticesBuffer.position(4 * offset);
- pgl.bufferSubData(PGL.ARRAY_BUFFER, 4 * offset * PGL.SIZEOF_FLOAT,
- 4 * size * PGL.SIZEOF_FLOAT, tessGeo.pointVerticesBuffer);
- tessGeo.pointVerticesBuffer.rewind();
- pgl.bindBuffer(PGL.ARRAY_BUFFER, 0);
- }
-
-
- protected void copyPointColors(int offset, int size) {
- tessGeo.updatePointColorsBuffer(offset, size);
- pgl.bindBuffer(PGL.ARRAY_BUFFER, glPointColor);
- tessGeo.pointColorsBuffer.position(offset);
- pgl.bufferSubData(PGL.ARRAY_BUFFER, offset * PGL.SIZEOF_INT,
- size * PGL.SIZEOF_INT,tessGeo.pointColorsBuffer);
- tessGeo.pointColorsBuffer.rewind();
- pgl.bindBuffer(PGL.ARRAY_BUFFER, 0);
- }
-
-
- protected void copyPointAttributes(int offset, int size) {
- tessGeo.updatePointOffsetsBuffer(offset, size);
- pgl.bindBuffer(PGL.ARRAY_BUFFER, glPointAttrib);
- tessGeo.pointOffsetsBuffer.position(2 * offset);
- pgl.bufferSubData(PGL.ARRAY_BUFFER, 2 * offset * PGL.SIZEOF_FLOAT,
- 2 * size * PGL.SIZEOF_FLOAT, tessGeo.pointOffsetsBuffer);
- tessGeo.pointOffsetsBuffer.rewind();
- pgl.bindBuffer(PGL.ARRAY_BUFFER, 0);
- }
-
-
- protected void setModifiedPolyVertices(int first, int last) {
- if (first < firstModifiedPolyVertex) firstModifiedPolyVertex = first;
- if (last > lastModifiedPolyVertex) lastModifiedPolyVertex = last;
- modifiedPolyVertices = true;
- modified = true;
- }
-
-
- protected void setModifiedPolyColors(int first, int last) {
- if (first < firstModifiedPolyColor) firstModifiedPolyColor = first;
- if (last > lastModifiedPolyColor) lastModifiedPolyColor = last;
- modifiedPolyColors = true;
- modified = true;
- }
-
-
- protected void setModifiedPolyNormals(int first, int last) {
- if (first < firstModifiedPolyNormal) firstModifiedPolyNormal = first;
- if (last > lastModifiedPolyNormal) lastModifiedPolyNormal = last;
- modifiedPolyNormals = true;
- modified = true;
- }
-
-
- protected void setModifiedPolyTexCoords(int first, int last) {
- if (first < firstModifiedPolyTexcoord) firstModifiedPolyTexcoord = first;
- if (last > lastModifiedPolyTexcoord) lastModifiedPolyTexcoord = last;
- modifiedPolyTexCoords = true;
- modified = true;
- }
-
-
- protected void setModifiedPolyAmbient(int first, int last) {
- if (first < firstModifiedPolyAmbient) firstModifiedPolyAmbient = first;
- if (last > lastModifiedPolyAmbient) lastModifiedPolyAmbient = last;
- modifiedPolyAmbient = true;
- modified = true;
- }
-
-
- protected void setModifiedPolySpecular(int first, int last) {
- if (first < firstModifiedPolySpecular) firstModifiedPolySpecular = first;
- if (last > lastModifiedPolySpecular) lastModifiedPolySpecular = last;
- modifiedPolySpecular = true;
- modified = true;
- }
-
-
- protected void setModifiedPolyEmissive(int first, int last) {
- if (first < firstModifiedPolyEmissive) firstModifiedPolyEmissive = first;
- if (last > lastModifiedPolyEmissive) lastModifiedPolyEmissive = last;
- modifiedPolyEmissive = true;
- modified = true;
- }
-
-
- protected void setModifiedPolyShininess(int first, int last) {
- if (first < firstModifiedPolyShininess) firstModifiedPolyShininess = first;
- if (last > lastModifiedPolyShininess) lastModifiedPolyShininess = last;
- modifiedPolyShininess = true;
- modified = true;
- }
-
-
- protected void setModifiedLineVertices(int first, int last) {
- if (first < firstModifiedLineVertex) firstModifiedLineVertex = first;
- if (last > lastModifiedLineVertex) lastModifiedLineVertex = last;
- modifiedLineVertices = true;
- modified = true;
- }
-
-
- protected void setModifiedLineColors(int first, int last) {
- if (first < firstModifiedLineColor) firstModifiedLineColor = first;
- if (last > lastModifiedLineColor) lastModifiedLineColor = last;
- modifiedLineColors = true;
- modified = true;
- }
-
-
- protected void setModifiedLineAttributes(int first, int last) {
- if (first < firstModifiedLineAttribute) firstModifiedLineAttribute = first;
- if (last > lastModifiedLineAttribute) lastModifiedLineAttribute = last;
- modifiedLineAttributes = true;
- modified = true;
- }
-
-
- protected void setModifiedPointVertices(int first, int last) {
- if (first < firstModifiedPointVertex) firstModifiedPointVertex = first;
- if (last > lastModifiedPointVertex) lastModifiedPointVertex = last;
- modifiedPointVertices = true;
- modified = true;
- }
-
-
- protected void setModifiedPointColors(int first, int last) {
- if (first < firstModifiedPointColor) firstModifiedPointColor = first;
- if (last > lastModifiedPointColor) lastModifiedPointColor = last;
- modifiedPointColors = true;
- modified = true;
- }
-
-
- protected void setModifiedPointAttributes(int first, int last) {
- if (first < firstModifiedPointAttribute) firstModifiedPointAttribute = first;
- if (last > lastModifiedPointAttribute) lastModifiedPointAttribute = last;
- modifiedPointAttributes = true;
- modified = true;
- }
-
-
- ///////////////////////////////////////////////////////////
-
- //
-
- // Style handling
-
-
- // Applies the styles of g.
- @Override
- protected void styles(PGraphics g) {
- if (g instanceof PGraphicsOpenGL) {
- if (stroke) {
- stroke(g.strokeColor);
- strokeWeight(g.strokeWeight);
-
- // These two don't to nothing probably:
- strokeCap(g.strokeCap);
- strokeJoin(g.strokeJoin);
- } else {
- noStroke();
- }
-
- if (fill) {
- fill(g.fillColor);
- } else {
- noFill();
- }
-
- ambient(g.ambientColor);
- specular(g.specularColor);
- emissive(g.emissiveColor);
- shininess(g.shininess);
-
- // What about other style parameters, such as rectMode, etc?
- // These should force a tessellation update, same as stroke
- // cap and weight... right?
- } else {
- super.styles(g);
- }
- }
-
-
- ///////////////////////////////////////////////////////////
-
- //
-
- // Rendering methods
-
-
- public void draw() {
- draw(pg);
- }
-
-
- @Override
- public void draw(PGraphics g) {
- if (g instanceof PGraphicsOpenGL) {
- PGraphicsOpenGL gl = (PGraphicsOpenGL)g;
- if (visible) {
- pre(gl);
-
- updateTessellation();
- updateGeometry();
-
- if (family == GROUP) {
- if (fragmentedGroup(gl)) {
- for (int i = 0; i < childCount; i++) {
- ((PShapeOpenGL) children[i]).draw(gl);
- }
- } else {
- PImage tex = null;
- if (textures != null && textures.size() == 1) {
- tex = (PImage)textures.toArray()[0];
- }
- render(gl, tex);
- }
-
- } else {
- render(gl, image);
- }
-
- post(gl);
- }
- } else {
- // The renderer is not PGraphicsOpenGL, which probably
- // means that the draw() method is being called by the
- // recorder. We just use the default drawing from the
- // parent class.
- super.draw(g);
- }
- }
-
-
- // Returns true if some child shapes below this one either
- // use different texture maps or have stroked textures,
- // so they cannot rendered in a single call.
- // Or accurate 2D mode is enabled, which forces each
- // shape to be rendered separately.
- protected boolean fragmentedGroup(PGraphicsOpenGL g) {
- return g.getHint(DISABLE_OPTIMIZED_STROKE) ||
- (textures != null && 1 < textures.size()) ||
- strokedTexture;
- }
-
-
- @Override
- protected void pre(PGraphics g) {
- if (g instanceof PGraphicsOpenGL) {
- if (!style) {
- styles(g);
- }
- } else {
- super.pre(g);
- }
- }
-
-
- @Override
- protected void post(PGraphics g) {
- if (g instanceof PGraphicsOpenGL) {
- } else {
- super.post(g);
- }
- }
-
-
- @Override
- protected void drawGeometry(PGraphics g) {
- vertexCount = inGeo.vertexCount;
- vertices = inGeo.getVertexData();
-
- super.drawGeometry(g);
-
- vertexCount = 0;
- vertices = null;
- }
-
-
- // Render the geometry stored in the root shape as VBOs, for the vertices
- // corresponding to this shape. Sometimes we can have root == this.
- protected void render(PGraphicsOpenGL g, PImage texture) {
- if (root == null) {
- // Some error. Root should never be null. At least it should be 'this'.
- throw new RuntimeException("Error rendering PShapeOpenGL, root shape is " +
- "null");
- }
-
- if (hasPolys) {
- renderPolys(g, texture);
- if (g.haveRaw()) {
- rawPolys(g, texture);
- }
- }
-
- if (is3D()) {
- // In 3D mode, the lines and points need to be rendered separately
- // as they require their own shaders.
- if (hasLines) {
- renderLines(g);
- if (g.haveRaw()) {
- rawLines(g);
- }
- }
-
- if (hasPoints) {
- renderPoints(g);
- if (g.haveRaw()) {
- rawPoints(g);
- }
- }
- }
- }
-
-
- protected void renderPolys(PGraphicsOpenGL g, PImage textureImage) {
- Texture tex = null;
- if (textureImage != null) {
- tex = g.getTexture(textureImage);
- if (tex != null) {
- tex.bind();
- }
- }
-
- boolean renderingFill = false, renderingStroke = false;
- BaseShader shader = null;
- IndexCache cache = tessGeo.polyIndexCache;
- for (int n = firstPolyIndexCache; n <= lastPolyIndexCache; n++) {
- if (is3D() || (tex != null && (firstLineIndexCache == -1 ||
- n < firstLineIndexCache) &&
- (firstPointIndexCache == -1 ||
- n < firstPointIndexCache))) {
- // Rendering fill triangles, which can be lit and textured.
- if (!renderingFill) {
- shader = g.getPolyShader(g.lights, tex != null);
- shader.bind();
- renderingFill = true;
- }
- } else {
- // Rendering line or point triangles, which are never lit nor textured.
- if (!renderingStroke) {
- if (tex != null) {
- tex.unbind();
- tex = null;
- }
-
- if (shader != null && shader.bound()) {
- shader.unbind();
- }
-
- // If the renderer is 2D, then g.lights should always be false,
- // so no need to worry about that.
- shader = g.getPolyShader(g.lights, false);
- shader.bind();
-
- renderingFill = false;
- renderingStroke = true;
- }
- }
-
- int ioffset = cache.indexOffset[n];
- int icount = cache.indexCount[n];
- int voffset = cache.vertexOffset[n];
-
- shader.setVertexAttribute(root.glPolyVertex, 4, PGL.FLOAT,
- 0, 4 * voffset * PGL.SIZEOF_FLOAT);
- shader.setColorAttribute(root.glPolyColor, 4, PGL.UNSIGNED_BYTE,
- 0, 4 * voffset * PGL.SIZEOF_BYTE);
-
- if (g.lights) {
- shader.setNormalAttribute(root.glPolyNormal, 3, PGL.FLOAT,
- 0, 3 * voffset * PGL.SIZEOF_FLOAT);
- shader.setAmbientAttribute(root.glPolyAmbient, 4, PGL.UNSIGNED_BYTE,
- 0, 4 * voffset * PGL.SIZEOF_BYTE);
- shader.setSpecularAttribute(root.glPolySpecular, 4, PGL.UNSIGNED_BYTE,
- 0, 4 * voffset * PGL.SIZEOF_BYTE);
- shader.setEmissiveAttribute(root.glPolyEmissive, 4, PGL.UNSIGNED_BYTE,
- 0, 4 * voffset * PGL.SIZEOF_BYTE);
- shader.setShininessAttribute(root.glPolyShininess, 1, PGL.FLOAT,
- 0, voffset * PGL.SIZEOF_FLOAT);
- }
-
- if (tex != null) {
- shader.setTexcoordAttribute(root.glPolyTexcoord, 2, PGL.FLOAT,
- 0, 2 * voffset * PGL.SIZEOF_FLOAT);
- shader.setTexture(tex);
- }
-
- pgl.bindBuffer(PGL.ELEMENT_ARRAY_BUFFER, root.glPolyIndex);
- pgl.drawElements(PGL.TRIANGLES, icount, PGL.INDEX_TYPE,
- ioffset * PGL.SIZEOF_INDEX);
- pgl.bindBuffer(PGL.ELEMENT_ARRAY_BUFFER, 0);
- }
-
- if (shader != null && shader.bound()) {
- shader.unbind();
- }
-
- if (tex != null) {
- tex.unbind();
- }
- }
-
-
- protected void rawPolys(PGraphicsOpenGL g, PImage textureImage) {
- PGraphics raw = g.getRaw();
-
- raw.colorMode(RGB);
- raw.noStroke();
- raw.beginShape(TRIANGLES);
-
- float[] vertices = tessGeo.polyVertices;
- int[] color = tessGeo.polyColors;
- float[] uv = tessGeo.polyTexCoords;
- short[] indices = tessGeo.polyIndices;
-
- IndexCache cache = tessGeo.polyIndexCache;
- for (int n = firstPolyIndexCache; n <= lastPolyIndexCache; n++) {
- int ioffset = cache.indexOffset[n];
- int icount = cache.indexCount[n];
- int voffset = cache.vertexOffset[n];
-
- for (int tr = ioffset / 3; tr < (ioffset + icount) / 3; tr++) {
- int i0 = voffset + indices[3 * tr + 0];
- int i1 = voffset + indices[3 * tr + 1];
- int i2 = voffset + indices[3 * tr + 2];
-
- float[] src0 = {0, 0, 0, 0};
- float[] src1 = {0, 0, 0, 0};
- float[] src2 = {0, 0, 0, 0};
- float[] pt0 = {0, 0, 0, 0};
- float[] pt1 = {0, 0, 0, 0};
- float[] pt2 = {0, 0, 0, 0};
- int argb0 = PGL.nativeToJavaARGB(color[i0]);
- int argb1 = PGL.nativeToJavaARGB(color[i1]);
- int argb2 = PGL.nativeToJavaARGB(color[i2]);
-
- PApplet.arrayCopy(vertices, 4 * i0, src0, 0, 4);
- PApplet.arrayCopy(vertices, 4 * i1, src1, 0, 4);
- PApplet.arrayCopy(vertices, 4 * i2, src2, 0, 4);
- // Applying any transformation is currently stored in the
- // modelview matrix of the renderer.
- g.modelview.mult(src0, pt0);
- g.modelview.mult(src1, pt1);
- g.modelview.mult(src2, pt2);
-
- if (textureImage != null) {
- raw.texture(textureImage);
- if (raw.is3D()) {
- raw.fill(argb0);
- raw.vertex(pt0[X], pt0[Y], pt0[Z], uv[2 * i0 + 0], uv[2 * i0 + 1]);
- raw.fill(argb1);
- raw.vertex(pt1[X], pt1[Y], pt1[Z], uv[2 * i1 + 0], uv[2 * i1 + 1]);
- raw.fill(argb2);
- raw.vertex(pt2[X], pt2[Y], pt2[Z], uv[2 * i2 + 0], uv[2 * i2 + 1]);
- } else if (raw.is2D()) {
- float sx0 = g.screenXImpl(pt0[0], pt0[1], pt0[2], pt0[3]);
- float sy0 = g.screenYImpl(pt0[0], pt0[1], pt0[2], pt0[3]);
- float sx1 = g.screenXImpl(pt1[0], pt1[1], pt1[2], pt1[3]);
- float sy1 = g.screenYImpl(pt1[0], pt1[1], pt1[2], pt1[3]);
- float sx2 = g.screenXImpl(pt2[0], pt2[1], pt2[2], pt2[3]);
- float sy2 = g.screenYImpl(pt2[0], pt2[1], pt2[2], pt2[3]);
- raw.fill(argb0);
- raw.vertex(sx0, sy0, uv[2 * i0 + 0], uv[2 * i0 + 1]);
- raw.fill(argb1);
- raw.vertex(sx1, sy1, uv[2 * i1 + 0], uv[2 * i1 + 1]);
- raw.fill(argb1);
- raw.vertex(sx2, sy2, uv[2 * i2 + 0], uv[2 * i2 + 1]);
- }
- } else {
- if (raw.is3D()) {
- raw.fill(argb0);
- raw.vertex(pt0[X], pt0[Y], pt0[Z]);
- raw.fill(argb1);
- raw.vertex(pt1[X], pt1[Y], pt1[Z]);
- raw.fill(argb2);
- raw.vertex(pt2[X], pt2[Y], pt2[Z]);
- } else if (raw.is2D()) {
- float sx0 = g.screenXImpl(pt0[0], pt0[1], pt0[2], pt0[3]);
- float sy0 = g.screenYImpl(pt0[0], pt0[1], pt0[2], pt0[3]);
- float sx1 = g.screenXImpl(pt1[0], pt1[1], pt1[2], pt1[3]);
- float sy1 = g.screenYImpl(pt1[0], pt1[1], pt1[2], pt1[3]);
- float sx2 = g.screenXImpl(pt2[0], pt2[1], pt2[2], pt2[3]);
- float sy2 = g.screenYImpl(pt2[0], pt2[1], pt2[2], pt2[3]);
- raw.fill(argb0);
- raw.vertex(sx0, sy0);
- raw.fill(argb1);
- raw.vertex(sx1, sy1);
- raw.fill(argb2);
- raw.vertex(sx2, sy2);
- }
- }
- }
- }
-
- raw.endShape();
- }
-
-
- protected void renderLines(PGraphicsOpenGL g) {
- LineShader shader = g.getLineShader();
- shader.bind();
-
- IndexCache cache = tessGeo.lineIndexCache;
- for (int n = firstLineIndexCache; n <= lastLineIndexCache; n++) {
- int ioffset = cache.indexOffset[n];
- int icount = cache.indexCount[n];
- int voffset = cache.vertexOffset[n];
-
- shader.setVertexAttribute(root.glLineVertex, 4, PGL.FLOAT,
- 0, 4 * voffset * PGL.SIZEOF_FLOAT);
- shader.setColorAttribute(root.glLineColor, 4, PGL.UNSIGNED_BYTE,
- 0, 4 * voffset * PGL.SIZEOF_BYTE);
- shader.setLineAttribute(root.glLineAttrib, 4, PGL.FLOAT,
- 0, 4 * voffset * PGL.SIZEOF_FLOAT);
-
- pgl.bindBuffer(PGL.ELEMENT_ARRAY_BUFFER, root.glLineIndex);
- pgl.drawElements(PGL.TRIANGLES, icount, PGL.INDEX_TYPE,
- ioffset * PGL.SIZEOF_INDEX);
- pgl.bindBuffer(PGL.ELEMENT_ARRAY_BUFFER, 0);
- }
-
- shader.unbind();
- }
-
-
- protected void rawLines(PGraphicsOpenGL g) {
- PGraphics raw = g.getRaw();
-
- raw.colorMode(RGB);
- raw.noFill();
- raw.strokeCap(strokeCap);
- raw.strokeJoin(strokeJoin);
- raw.beginShape(LINES);
-
- float[] vertices = tessGeo.lineVertices;
- int[] color = tessGeo.lineColors;
- float[] attribs = tessGeo.lineDirections;
- short[] indices = tessGeo.lineIndices;
-
- IndexCache cache = tessGeo.lineIndexCache;
- for (int n = firstLineIndexCache; n <= lastLineIndexCache; n++) {
- int ioffset = cache.indexOffset[n];
- int icount = cache.indexCount[n];
- int voffset = cache.vertexOffset[n];
-
- for (int ln = ioffset / 6; ln < (ioffset + icount) / 6; ln++) {
- // Each line segment is defined by six indices since its
- // formed by two triangles. We only need the first and last
- // vertices.
- // This bunch of vertices could also be the bevel triangles,
- // with we detect this situation by looking at the line weight.
- int i0 = voffset + indices[6 * ln + 0];
- int i1 = voffset + indices[6 * ln + 5];
- float sw0 = 2 * attribs[4 * i0 + 3];
- float sw1 = 2 * attribs[4 * i1 + 3];
-
- if (PGraphicsOpenGL.zero(sw0)) continue; // Bevel triangles, skip.
-
- float[] src0 = {0, 0, 0, 0};
- float[] src1 = {0, 0, 0, 0};
- float[] pt0 = {0, 0, 0, 0};
- float[] pt1 = {0, 0, 0, 0};
- int argb0 = PGL.nativeToJavaARGB(color[i0]);
- int argb1 = PGL.nativeToJavaARGB(color[i1]);
-
- PApplet.arrayCopy(vertices, 4 * i0, src0, 0, 4);
- PApplet.arrayCopy(vertices, 4 * i1, src1, 0, 4);
- // Applying any transformation is currently stored in the
- // modelview matrix of the renderer.
- g.modelview.mult(src0, pt0);
- g.modelview.mult(src1, pt1);
-
- if (raw.is3D()) {
- raw.strokeWeight(sw0);
- raw.stroke(argb0);
- raw.vertex(pt0[X], pt0[Y], pt0[Z]);
- raw.strokeWeight(sw1);
- raw.stroke(argb1);
- raw.vertex(pt1[X], pt1[Y], pt1[Z]);
- } else if (raw.is2D()) {
- float sx0 = g.screenXImpl(pt0[0], pt0[1], pt0[2], pt0[3]);
- float sy0 = g.screenYImpl(pt0[0], pt0[1], pt0[2], pt0[3]);
- float sx1 = g.screenXImpl(pt1[0], pt1[1], pt1[2], pt1[3]);
- float sy1 = g.screenYImpl(pt1[0], pt1[1], pt1[2], pt1[3]);
- raw.strokeWeight(sw0);
- raw.stroke(argb0);
- raw.vertex(sx0, sy0);
- raw.strokeWeight(sw1);
- raw.stroke(argb1);
- raw.vertex(sx1, sy1);
- }
- }
- }
-
- raw.endShape();
- }
-
-
- protected void renderPoints(PGraphicsOpenGL g) {
- PointShader shader = g.getPointShader();
- shader.bind();
-
- IndexCache cache = tessGeo.pointIndexCache;
- for (int n = firstPointIndexCache; n <= lastPointIndexCache; n++) {
- int ioffset = cache.indexOffset[n];
- int icount = cache.indexCount[n];
- int voffset = cache.vertexOffset[n];
-
- shader.setVertexAttribute(root.glPointVertex, 4, PGL.FLOAT,
- 0, 4 * voffset * PGL.SIZEOF_FLOAT);
- shader.setColorAttribute(root.glPointColor, 4, PGL.UNSIGNED_BYTE,
- 0, 4 * voffset * PGL.SIZEOF_BYTE);
- shader.setPointAttribute(root.glPointAttrib, 2, PGL.FLOAT,
- 0, 2 * voffset * PGL.SIZEOF_FLOAT);
-
- pgl.bindBuffer(PGL.ELEMENT_ARRAY_BUFFER, root.glPointIndex);
- pgl.drawElements(PGL.TRIANGLES, icount, PGL.INDEX_TYPE,
- ioffset * PGL.SIZEOF_INDEX);
- pgl.bindBuffer(PGL.ELEMENT_ARRAY_BUFFER, 0);
- }
-
- shader.unbind();
- }
-
-
- protected void rawPoints(PGraphicsOpenGL g) {
- PGraphics raw = g.getRaw();
-
- raw.colorMode(RGB);
- raw.noFill();
- raw.strokeCap(strokeCap);
- raw.beginShape(POINTS);
-
- float[] vertices = tessGeo.pointVertices;
- int[] color = tessGeo.pointColors;
- float[] attribs = tessGeo.pointOffsets;
- short[] indices = tessGeo.pointIndices;
-
- IndexCache cache = tessGeo.pointIndexCache;
- for (int n = 0; n < cache.size; n++) {
- int ioffset = cache.indexOffset[n];
- int icount = cache.indexCount[n];
- int voffset = cache.vertexOffset[n];
-
- int pt = ioffset;
- while (pt < (ioffset + icount) / 3) {
- float size = attribs[2 * pt + 2];
- float weight;
- int perim;
- if (0 < size) { // round point
- weight = +size / 0.5f;
- perim = PApplet.max(PGraphicsOpenGL.MIN_POINT_ACCURACY,
- (int) (TWO_PI * weight /
- PGraphicsOpenGL.POINT_ACCURACY_FACTOR)) + 1;
- } else { // Square point
- weight = -size / 0.5f;
- perim = 5;
- }
-
- int i0 = voffset + indices[3 * pt];
- int argb0 = PGL.nativeToJavaARGB(color[i0]);
- float[] pt0 = {0, 0, 0, 0};
-
- float[] src0 = {0, 0, 0, 0};
- PApplet.arrayCopy(vertices, 4 * i0, src0, 0, 4);
- g.modelview.mult(src0, pt0);
-
- if (raw.is3D()) {
- raw.strokeWeight(weight);
- raw.stroke(argb0);
- raw.vertex(pt0[X], pt0[Y], pt0[Z]);
- } else if (raw.is2D()) {
- float sx0 = g.screenXImpl(pt0[0], pt0[1], pt0[2], pt0[3]);
- float sy0 = g.screenYImpl(pt0[0], pt0[1], pt0[2], pt0[3]);
- raw.strokeWeight(weight);
- raw.stroke(argb0);
- raw.vertex(sx0, sy0);
- }
-
- pt += perim;
- }
- }
-
- raw.endShape();
- }
-}
diff --git a/android/core/src/processing/opengl/PointFrag.glsl b/android/core/src/processing/opengl/PointFrag.glsl
deleted file mode 100644
index d5d23ae229..0000000000
--- a/android/core/src/processing/opengl/PointFrag.glsl
+++ /dev/null
@@ -1,30 +0,0 @@
-/*
- Part of the Processing project - http://processing.org
-
- Copyright (c) 2011-13 Ben Fry and Casey Reas
-
- This library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Lesser General Public
- License version 2.1 as published by the Free Software Foundation.
-
- This library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License for more details.
-
- You should have received a copy of the GNU Lesser General
- Public License along with this library; if not, write to the
- Free Software Foundation, Inc., 59 Temple Place, Suite 330,
- Boston, MA 02111-1307 USA
- */
-
-#ifdef GL_ES
-precision mediump float;
-precision mediump int;
-#endif
-
-varying vec4 vertColor;
-
-void main() {
- gl_FragColor = vertColor;
-}
\ No newline at end of file
diff --git a/android/core/src/processing/opengl/PointVert.glsl b/android/core/src/processing/opengl/PointVert.glsl
deleted file mode 100644
index 7523e33267..0000000000
--- a/android/core/src/processing/opengl/PointVert.glsl
+++ /dev/null
@@ -1,55 +0,0 @@
-/*
- Part of the Processing project - http://processing.org
-
- Copyright (c) 2011-13 Ben Fry and Casey Reas
-
- This library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Lesser General Public
- License version 2.1 as published by the Free Software Foundation.
-
- This library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License for more details.
-
- You should have received a copy of the GNU Lesser General
- Public License along with this library; if not, write to the
- Free Software Foundation, Inc., 59 Temple Place, Suite 330,
- Boston, MA 02111-1307 USA
- */
-
-#define PROCESSING_POINT_SHADER
-
-uniform mat4 projection;
-uniform mat4 modelview;
-
-uniform vec4 viewport;
-uniform int perspective;
-
-attribute vec4 vertex;
-attribute vec4 color;
-attribute vec2 offset;
-
-varying vec4 vertColor;
-
-vec4 windowToClipVector(vec2 window, vec4 viewport, float clipw) {
- vec2 xypos = (window / viewport.zw) * 2.0;
- return vec4(xypos, 0.0, 0.0) * clipw;
-}
-
-void main() {
- vec4 pos = modelview * vertex;
- vec4 clip = projection * pos;
-
- if (0 < perspective) {
- // Perspective correction (points will look thiner as they move away
- // from the view position).
- gl_Position = clip + projection * vec4(offset.xy, 0, 0);
- } else {
- // No perspective correction.
- vec4 offset = windowToClipVector(offset.xy, viewport, clip.w);
- gl_Position = clip + offset;
- }
-
- vertColor = color;
-}
\ No newline at end of file
diff --git a/android/core/src/processing/opengl/TexlightVert.glsl b/android/core/src/processing/opengl/TexlightVert.glsl
deleted file mode 100644
index ff981c59cd..0000000000
--- a/android/core/src/processing/opengl/TexlightVert.glsl
+++ /dev/null
@@ -1,147 +0,0 @@
-/*
- Part of the Processing project - http://processing.org
-
- Copyright (c) 2011-13 Ben Fry and Casey Reas
-
- This library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Lesser General Public
- License version 2.1 as published by the Free Software Foundation.
-
- This library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License for more details.
-
- You should have received a copy of the GNU Lesser General
- Public License along with this library; if not, write to the
- Free Software Foundation, Inc., 59 Temple Place, Suite 330,
- Boston, MA 02111-1307 USA
- */
-
-#define PROCESSING_TEXLIGHT_SHADER
-
-uniform mat4 modelview;
-uniform mat4 transform;
-uniform mat3 normalMatrix;
-uniform mat4 texMatrix;
-
-uniform int lightCount;
-uniform vec4 lightPosition[8];
-uniform vec3 lightNormal[8];
-uniform vec3 lightAmbient[8];
-uniform vec3 lightDiffuse[8];
-uniform vec3 lightSpecular[8];
-uniform vec3 lightFalloff[8];
-uniform vec2 lightSpot[8];
-
-attribute vec4 vertex;
-attribute vec4 color;
-attribute vec3 normal;
-attribute vec2 texCoord;
-
-attribute vec4 ambient;
-attribute vec4 specular;
-attribute vec4 emissive;
-attribute float shininess;
-
-varying vec4 vertColor;
-varying vec4 vertTexCoord;
-
-const float zero_float = 0.0;
-const float one_float = 1.0;
-const vec3 zero_vec3 = vec3(0);
-
-float falloffFactor(vec3 lightPos, vec3 vertPos, vec3 coeff) {
- vec3 lpv = lightPos - vertPos;
- vec3 dist = vec3(one_float);
- dist.z = dot(lpv, lpv);
- dist.y = sqrt(dist.z);
- return one_float / dot(dist, coeff);
-}
-
-float spotFactor(vec3 lightPos, vec3 vertPos, vec3 lightNorm, float minCos, float spotExp) {
- vec3 lpv = normalize(lightPos - vertPos);
- vec3 nln = -one_float * lightNorm;
- float spotCos = dot(nln, lpv);
- return spotCos <= minCos ? zero_float : pow(spotCos, spotExp);
-}
-
-float lambertFactor(vec3 lightDir, vec3 vecNormal) {
- return max(zero_float, dot(lightDir, vecNormal));
-}
-
-float blinnPhongFactor(vec3 lightDir, vec3 vertPos, vec3 vecNormal, float shine) {
- vec3 np = normalize(vertPos);
- vec3 ldp = normalize(lightDir - np);
- return pow(max(zero_float, dot(ldp, vecNormal)), shine);
-}
-
-void main() {
- // Vertex in clip coordinates
- gl_Position = transform * vertex;
-
- // Vertex in eye coordinates
- vec3 ecVertex = vec3(modelview * vertex);
-
- // Normal vector in eye coordinates
- vec3 ecNormal = normalize(normalMatrix * normal);
-
- if (dot(-one_float * ecVertex, ecNormal) < zero_float) {
- // If normal is away from camera, choose its opposite.
- // If we add backface culling, this will be backfacing
- ecNormal *= -one_float;
- }
-
- // Light calculations
- vec3 totalAmbient = vec3(0, 0, 0);
- vec3 totalDiffuse = vec3(0, 0, 0);
- vec3 totalSpecular = vec3(0, 0, 0);
- for (int i = 0; i < 8; i++) {
- if (lightCount == i) break;
-
- vec3 lightPos = lightPosition[i].xyz;
- bool isDir = zero_float < lightPosition[i].w;
- float spotCos = lightSpot[i].x;
- float spotExp = lightSpot[i].y;
-
- vec3 lightDir;
- float falloff;
- float spotf;
-
- if (isDir) {
- falloff = one_float;
- lightDir = -one_float * lightNormal[i];
- } else {
- falloff = falloffFactor(lightPos, ecVertex, lightFalloff[i]);
- lightDir = normalize(lightPos - ecVertex);
- }
-
- spotf = spotExp > zero_float ? spotFactor(lightPos, ecVertex, lightNormal[i],
- spotCos, spotExp)
- : one_float;
-
- if (any(greaterThan(lightAmbient[i], zero_vec3))) {
- totalAmbient += lightAmbient[i] * falloff;
- }
-
- if (any(greaterThan(lightDiffuse[i], zero_vec3))) {
- totalDiffuse += lightDiffuse[i] * falloff * spotf *
- lambertFactor(lightDir, ecNormal);
- }
-
- if (any(greaterThan(lightSpecular[i], zero_vec3))) {
- totalSpecular += lightSpecular[i] * falloff * spotf *
- blinnPhongFactor(lightDir, ecVertex, ecNormal, shininess);
- }
- }
-
- // Calculating final color as result of all lights (plus emissive term).
- // Transparency is determined exclusively by the diffuse component.
- vertColor = vec4(totalAmbient, 0) * ambient +
- vec4(totalDiffuse, 1) * color +
- vec4(totalSpecular, 0) * specular +
- vec4(emissive.rgb, 0);
-
- // Calculating texture coordinates, with r and q set both to one
- vertTexCoord = texMatrix * vec4(texCoord, 1.0, 1.0);
-}
diff --git a/android/core/src/processing/opengl/Texture.java b/android/core/src/processing/opengl/Texture.java
deleted file mode 100644
index 32d9a648f8..0000000000
--- a/android/core/src/processing/opengl/Texture.java
+++ /dev/null
@@ -1,1650 +0,0 @@
-/* -*- mode: java; c-basic-offset: 2; indent-tabs-mode: nil -*- */
-
-/*
- Part of the Processing project - http://processing.org
-
- Copyright (c) 2011-12 Ben Fry and Casey Reas
-
- This library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Lesser General Public
- License as published by the Free Software Foundation; either
- version 2.1 of the License, or (at your option) any later version.
-
- This library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License for more details.
-
- You should have received a copy of the GNU Lesser General
- Public License along with this library; if not, write to the
- Free Software Foundation, Inc., 59 Temple Place, Suite 330,
- Boston, MA 02111-1307 USA
-*/
-
-package processing.opengl;
-
-import processing.core.PApplet;
-import processing.core.PConstants;
-import processing.core.PGraphics;
-import processing.core.PImage;
-import java.lang.reflect.Method;
-import java.nio.ByteBuffer;
-import java.nio.IntBuffer;
-import java.util.LinkedList;
-import java.util.NoSuchElementException;
-
-/**
- * This class wraps an OpenGL texture.
- * By Andres Colubri
- *
- */
-public class Texture implements PConstants {
- // texture constants
-
- /**
- * Texture with normalized UV.
- */
- protected static final int TEX2D = 0;
- /**
- * Texture with un-normalized UV.
- */
- protected static final int TEXRECT = 1;
-
- /** Point sampling: both magnification and minification filtering are set
- * to nearest */
- protected static final int POINT = 2;
- /** Linear sampling: magnification filtering is nearest, minification set
- * to linear */
- protected static final int LINEAR = 3;
- /** Bilinear sampling: both magnification filtering is set to linear and
- * minification either to linear-mipmap-nearest (linear interplation is used
- * within a mipmap, but not between different mipmaps). */
- protected static final int BILINEAR = 4;
- /** Trilinear sampling: magnification filtering set to linear, minification to
- * linear-mipmap-linear, which offers the best mipmap quality since linear
- * interpolation to compute the value in each of two maps and then
- * interpolates linearly between these two value. */
- protected static final int TRILINEAR = 5;
-
- public int width, height;
-
- public int glName;
- public int glTarget;
- public int glFormat;
- public int glMinFilter;
- public int glMagFilter;
- public int glWrapS;
- public int glWrapT;
- public int glWidth;
- public int glHeight;
-
- protected PApplet parent; // The Processing applet
- protected PGraphicsOpenGL pg; // The main renderer
- protected PGL pgl; // The interface between Processing and OpenGL.
- protected int context; // The context that created this texture.
- protected PGraphicsOpenGL pgDraw; // The main renderer is the color buffer of.
-
- protected boolean usingMipmaps;
- protected boolean usingRepeat;
- protected float maxTexcoordU;
- protected float maxTexcoordV;
- protected boolean bound;
-
- protected boolean invertedX;
- protected boolean invertedY;
-
- protected int[] rgbaPixels = null;
- protected IntBuffer pixelBuffer = null;
- protected FrameBuffer tempFbo = null;
-
- /** Modified portion of the texture */
- protected boolean modified;
- protected int mx1, my1, mx2, my2;
-
- protected Object bufferSource;
- protected LinkedList bufferCache = null;
- protected Method disposeBufferMethod;
- public static final int MAX_BUFFER_CACHE_SIZE = 3;
-
- ////////////////////////////////////////////////////////////
-
- // Constructors.
-
- public Texture(PApplet parent) {
- this.parent = parent;
-
- pg = (PGraphicsOpenGL)parent.g;
- pgl = pg.pgl;
- context = pgl.createEmptyContext();
-
- pgDraw = null;
-
- glName = 0;
- }
-
-
- /**
- * Creates an instance of PTexture with size width x height. The texture is
- * initialized (empty) to that size.
- * @param parent PApplet
- * @param width int
- * @param height int
- */
- public Texture(PApplet parent, int width, int height) {
- this(parent, width, height, new Parameters());
- }
-
-
- /**
- * Creates an instance of PTexture with size width x height and with the
- * specified parameters. The texture is initialized (empty) to that size.
- * @param parent PApplet
- * @param width int
- * @param height int
- * @param params Parameters
- */
- public Texture(PApplet parent, int width, int height, Object params) {
- this.parent = parent;
-
- pg = (PGraphicsOpenGL)parent.g;
- pgl = pg.pgl;
- context = pgl.createEmptyContext();
-
- pgDraw = null;
-
- glName = 0;
-
- init(width, height, (Parameters)params);
- }
-
-
- @Override
- protected void finalize() throws Throwable {
- try {
- if (glName != 0) {
- pg.finalizeTextureObject(glName, context);
- }
- } finally {
- super.finalize();
- }
- }
-
-
- ////////////////////////////////////////////////////////////
-
- // Init, resize methods
-
-
- /**
- * Sets the size of the image and texture to width x height. If the texture is
- * already initialized, it first destroys the current OpenGL texture object
- * and then creates a new one with the specified size.
- * @param width int
- * @param height int
- */
- public void init(int width, int height) {
- Parameters params;
- if (0 < glName) {
- // Re-initializing a pre-existing texture.
- // We use the current parameters as default:
- params = getParameters();
- } else {
- // Just built-in default parameters otherwise:
- params = new Parameters();
- }
- init(width, height, params);
- }
-
-
- /**
- * Sets the size of the image and texture to width x height, and the
- * parameters of the texture to params. If the texture is already initialized,
- * it first destroys the current OpenGL texture object and then creates a new
- * one with the specified size.
- * @param width int
- * @param height int
- * @param params GLTextureParameters
- */
- public void init(int width, int height, Parameters params) {
- setParameters(params);
- setSize(width, height);
- allocate();
- }
-
-
- /**
- * Initializes the texture using GL parameters
- */
- public void init(int width, int height,
- int glName, int glTarget, int glFormat,
- int glWidth, int glHeight,
- int glMinFilter, int glMagFilter,
- int glWrapS, int glWrapT) {
- this.width = width;
- this.height = height;
-
- this.glName = glName;
- this.glTarget = glTarget;
- this.glFormat = glFormat;
- this.glWidth = glWidth;
- this.glHeight = glHeight;
- this.glMinFilter = glMinFilter;
- this.glMagFilter = glMagFilter;
- this.glWrapS = glWrapS;
- this.glWrapT = glWrapT;
-
- maxTexcoordU = (float)width / glWidth;
- maxTexcoordV = (float)height / glHeight;
-
- usingMipmaps = glMinFilter == PGL.LINEAR_MIPMAP_NEAREST ||
- glMinFilter == PGL.LINEAR_MIPMAP_LINEAR;
-
- usingRepeat = glWrapS == PGL.REPEAT || glWrapT == PGL.REPEAT;
- }
-
-
- public void resize(int wide, int high) {
- // Marking the texture object as finalized so it is deleted
- // when creating the new texture.
- release();
-
- // Creating new texture with the appropriate size.
- Texture tex = new Texture(parent, wide, high, getParameters());
-
- // Copying the contents of this texture into tex.
- tex.set(this);
-
- // Now, overwriting "this" with tex.
- copyObject(tex);
-
- // Nullifying some utility objects so they are recreated with the
- // appropriate size when needed.
- tempFbo = null;
- }
-
-
- /**
- * Returns true if the texture has been initialized.
- * @return boolean
- */
- public boolean available() {
- return 0 < glName;
- }
-
-
- ////////////////////////////////////////////////////////////
-
- // Set methods
-
-
- public void set(PImage img) {
- Texture tex = (Texture)pg.getCache(img);
- set(tex);
- }
-
-
- public void set(PImage img, int x, int y, int w, int h) {
- Texture tex = (Texture)pg.getCache(img);
- set(tex, x, y, w, h);
- }
-
-
- public void set(Texture tex) {
- copyTexture(tex, 0, 0, tex.width, tex.height, true);
- }
-
-
- public void set(Texture tex, int x, int y, int w, int h) {
- copyTexture(tex, x, y, w, h, true);
- }
-
-
- public void set(int texTarget, int texName, int texWidth, int texHeight,
- int w, int h) {
- copyTexture(texTarget, texName, texWidth, texHeight, 0, 0, w, h, true);
- }
-
-
- public void set(int texTarget, int texName, int texWidth, int texHeight,
- int target, int tex, int x, int y, int w, int h) {
- copyTexture(texTarget, texName, texWidth, texHeight, x, y, w, h, true);
- }
-
-
- public void set(int[] pixels) {
- set(pixels, 0, 0, width, height, ARGB);
- }
-
-
- public void set(int[] pixels, int format) {
- set(pixels, 0, 0, width, height, format);
- }
-
-
- public void set(int[] pixels, int x, int y, int w, int h) {
- set(pixels, x, y, w, h, ARGB);
- }
-
-
- public void set(int[] pixels, int x, int y, int w, int h, int format) {
- if (pixels == null) {
- PGraphics.showWarning("The pixels array is null.");
- return;
- }
- if (pixels.length < w * h) {
- PGraphics.showWarning("The pixel array has a length of " +
- pixels.length + ", but it should be at least " +
- w * h);
- return;
- }
-
- if (pixels.length == 0) {
- // Nothing to do (means that w == h == 0) but not an erroneous situation
- return;
- }
-
- boolean enabledTex = false;
- if (!pgl.texturingIsEnabled(glTarget)) {
- pgl.enableTexturing(glTarget);
- enabledTex = true;
- }
- pgl.bindTexture(glTarget, glName);
-
- if (usingMipmaps) {
- if (PGraphicsOpenGL.autoMipmapGenSupported) {
- // Automatic mipmap generation.
- loadPixels(w * h);
- convertToRGBA(pixels, rgbaPixels, format, w, h);
- updatePixelBuffer(rgbaPixels);
- pgl.texSubImage2D(glTarget, 0, x, y, w, h, PGL.RGBA, PGL.UNSIGNED_BYTE,
- pixelBuffer);
- pgl.generateMipmap(glTarget);
- } else {
- // TODO: finish manual mipmap generation, replacing Bitmap with AWT's BufferedImage,
- // making it work in npot textures (embed npot tex into larger pot tex?), subregions,
- // and moving GLUtils.texImage2D (originally from Android SDK) into PGL.
- // Actually, this whole code should go into PGL, so the Android implementation can
- // use Bitmap, and desktop use BufferedImage.
-
- /*
- if (w != width || h != height) {
- System.err.println("Sorry but I don't know how to generate mipmaps for a subregion.");
- return;
- }
-
- // Code by Mike Miller obtained from here:
- // http://insanitydesign.com/wp/2009/08/01/android-opengl-es-mipmaps/
- int w0 = glWidth;
- int h0 = glHeight;
- int[] argbPixels = new int[w0 * h0];
- convertToARGB(pixels, argbPixels, format);
- int level = 0;
- int denom = 1;
-
- // We create a Bitmap because then we use its built-in filtered downsampling
- // functionality.
- Bitmap bitmap = Bitmap.createBitmap(w0, h0, Config.ARGB_8888);
- bitmap.setPixels(argbPixels, 0, w0, 0, 0, w0, h0);
-
- while (w0 >= 1 || h0 >= 1) {
- //First of all, generate the texture from our bitmap and set it to the according level
- GLUtils.texImage2D(glTarget, level, bitmap, 0);
-
- // We are done.
- if (w0 == 1 && h0 == 1) {
- break;
- }
-
- // Increase the mipmap level
- level++;
- denom *= 2;
-
- // Downsampling bitmap. We must eventually arrive to the 1x1 level,
- // and if the width and height are different, there will be a few 1D
- // texture levels just before.
- // This update formula also allows for NPOT resolutions.
- w0 = PApplet.max(1, PApplet.floor((float)glWidth / denom));
- h0 = PApplet.max(1, PApplet.floor((float)glHeight / denom));
- // (see getScaledInstance in AWT Image)
- Bitmap bitmap2 = Bitmap.createScaledBitmap(bitmap, w0, h0, true);
-
- // Clean up
- bitmap.recycle();
- bitmap = bitmap2;
- }
- */
-
- loadPixels(w * h);
- convertToRGBA(pixels, rgbaPixels, format, w, h);
- updatePixelBuffer(rgbaPixels);
- pgl.texSubImage2D(glTarget, 0, x, y, w, h, PGL.RGBA, PGL.UNSIGNED_BYTE,
- pixelBuffer);
- }
- } else {
- loadPixels(w * h);
- convertToRGBA(pixels, rgbaPixels, format, w, h);
- updatePixelBuffer(rgbaPixels);
- pgl.texSubImage2D(glTarget, 0, x, y, w, h, PGL.RGBA, PGL.UNSIGNED_BYTE,
- pixelBuffer);
- }
-
- pgl.bindTexture(glTarget, 0);
- if (enabledTex) {
- pgl.disableTexturing(glTarget);
- }
-
- updateTexels(x, y, w, h);
- }
-
-
- ////////////////////////////////////////////////////////////
-
- // Native set methods
-
-
- public void setNative(int[] pixels) {
- setNative(pixels, 0, 0, width, height);
- }
-
-
- public void setNative(int[] pixels, int x, int y, int w, int h) {
- updatePixelBuffer(pixels);
- setNative(pixelBuffer, x, y, w, h);
- }
-
-
- public void setNative(IntBuffer pixBuf, int x, int y, int w, int h) {
- if (pixBuf == null) {
- pixBuf = null;
- PGraphics.showWarning("The pixel buffer is null.");
- return;
- }
- if (pixBuf.capacity() < w * h) {
- PGraphics.showWarning("The pixel bufer has a length of " +
- pixBuf.capacity() + ", but it should be at least " +
- w * h);
- return;
- }
-
- if (pixBuf.capacity() == 0) {
- // Nothing to do (means that w == h == 0) but not an erroneous situation
- return;
- }
-
- boolean enabledTex = false;
- if (!pgl.texturingIsEnabled(glTarget)) {
- pgl.enableTexturing(glTarget);
- enabledTex = true;
- }
- pgl.bindTexture(glTarget, glName);
-
- if (usingMipmaps) {
- if (PGraphicsOpenGL.autoMipmapGenSupported) {
- pgl.texSubImage2D(glTarget, 0, x, y, w, h, PGL.RGBA, PGL.UNSIGNED_BYTE,
- pixBuf);
- pgl.generateMipmap(glTarget);
- } else {
- pgl.texSubImage2D(glTarget, 0, x, y, w, h, PGL.RGBA, PGL.UNSIGNED_BYTE,
- pixBuf);
- }
- } else {
- pgl.texSubImage2D(glTarget, 0, x, y, w, h, PGL.RGBA, PGL.UNSIGNED_BYTE,
- pixBuf);
- }
-
- pgl.bindTexture(glTarget, 0);
- if (enabledTex) {
- pgl.disableTexturing(glTarget);
- }
-
- updateTexels(x, y, w, h);
- }
-
-
- ////////////////////////////////////////////////////////////
-
- // Get methods
-
-
- /**
- * Copy texture to pixels. Involves video memory to main memory transfer (slow).
- */
- public void get(int[] pixels) {
- if (pixels == null) {
- throw new RuntimeException("Trying to copy texture to null pixels array");
- }
- if (pixels.length != width * height) {
- throw new RuntimeException("Trying to copy texture to pixels array of " +
- "wrong size");
- }
-
- if (tempFbo == null) {
- tempFbo = new FrameBuffer(parent, glWidth, glHeight);
- }
-
- // Attaching the texture to the color buffer of a FBO, binding the FBO and
- // reading the pixels from the current draw buffer (which is the color
- // buffer of the FBO).
- tempFbo.setColorBuffer(this);
- pg.pushFramebuffer();
- pg.setFramebuffer(tempFbo);
- tempFbo.readPixels();
- pg.popFramebuffer();
-
- tempFbo.getPixels(pixels);
- convertToARGB(pixels);
-
- if (invertedX) flipArrayOnX(pixels, 1);
- if (invertedY) flipArrayOnY(pixels, 1);
- }
-
-
- /**
- * Copies the contents of the texture to the pixels array.
- * @param pixels
- */
- public void loadPixels(int[] pixels) {
- if (hasBuffers()) {
- // Updates the texture AND the pixels array of the image at the same time,
- // getting the pixels directly from the buffer data (and thus avoiding
- // expensive transfer between video and main memory).
- bufferUpdate(pixels);
- }
-
- if (isModified()) {
- // Regular pixel copy from texture.
- get(pixels);
- }
-
- setModified(false);
- }
-
-
- ////////////////////////////////////////////////////////////
-
- // Put methods (the source texture is not resized to cover the entire
- // destination).
-
-
- public void put(Texture tex) {
- copyTexture(tex, 0, 0, tex.width, tex.height, false);
- }
-
-
- public void put(Texture tex, int x, int y, int w, int h) {
- copyTexture(tex, x, y, w, h, false);
- }
-
-
- public void put(int texTarget, int texName, int texWidth, int texHeight,
- int w, int h) {
- copyTexture(texTarget, texName, texWidth, texHeight, 0, 0, w, h, false);
- }
-
-
- public void put(int texTarget, int texName, int texWidth, int texHeight,
- int target, int tex, int x, int y, int w, int h) {
- copyTexture(texTarget, texName, texWidth, texHeight, x, y, w, h, false);
- }
-
-
- ////////////////////////////////////////////////////////////
-
- // Get OpenGL parameters
-
-
- /**
- * Returns true or false whether or not the texture is using mipmaps.
- * @return boolean
- */
- public boolean usingMipmaps() {
- return usingMipmaps;
- }
-
-
- public void usingMipmaps(boolean mipmaps, int sampling) {
- if (mipmaps) {
- if (glMinFilter != PGL.LINEAR_MIPMAP_NEAREST &&
- glMinFilter != PGL.LINEAR_MIPMAP_LINEAR) {
- if (sampling == POINT) {
- glMagFilter = PGL.NEAREST;
- glMinFilter = PGL.NEAREST;
- } else if (sampling == LINEAR) {
- glMagFilter = PGL.NEAREST;
- glMinFilter =
- PGL.MIPMAPS_ENABLED ? PGL.LINEAR_MIPMAP_NEAREST : PGL.LINEAR;
- } else if (sampling == BILINEAR) {
- glMagFilter = PGL.LINEAR;
- glMinFilter =
- PGL.MIPMAPS_ENABLED ? PGL.LINEAR_MIPMAP_NEAREST : PGL.LINEAR;
- } else if (sampling == TRILINEAR) {
- glMagFilter = PGL.LINEAR;
- glMinFilter =
- PGL.MIPMAPS_ENABLED ? PGL.LINEAR_MIPMAP_LINEAR : PGL.LINEAR;
- } else {
- throw new RuntimeException("Unknown texture filtering mode");
- }
- }
-
- usingMipmaps = true;
- } else {
- if (glMinFilter == PGL.LINEAR_MIPMAP_NEAREST ||
- glMinFilter == PGL.LINEAR_MIPMAP_LINEAR) {
- glMinFilter = PGL.LINEAR;
- }
- usingMipmaps = false;
- }
-
- bind();
- pgl.texParameteri(glTarget, PGL.TEXTURE_MIN_FILTER, glMinFilter);
- pgl.texParameteri(glTarget, PGL.TEXTURE_MAG_FILTER, glMagFilter);
- if (usingMipmaps) {
- if (PGraphicsOpenGL.autoMipmapGenSupported) {
- pgl.generateMipmap(glTarget);
- } else {
- // TODO: need manual generation here..
- }
- }
- unbind();
- }
-
-
- /**
- * Returns true or false whether or not the texture is using repeat wrap mode
- * along either U or V directions.
- * @return boolean
- */
- public boolean usingRepeat() {
- return usingRepeat;
- }
-
-
- public void usingRepeat(boolean repeat) {
- if (repeat) {
- glWrapS = PGL.REPEAT;
- glWrapT = PGL.REPEAT;
- usingRepeat = true;
- } else {
- glWrapS = PGL.CLAMP_TO_EDGE;
- glWrapT = PGL.CLAMP_TO_EDGE;
- usingRepeat = false;
- }
-
- bind();
- pgl.texParameteri(glTarget, PGL.TEXTURE_WRAP_S, glWrapS);
- pgl.texParameteri(glTarget, PGL.TEXTURE_WRAP_T, glWrapT);
- unbind();
- }
-
-
- /**
- * Returns the maximum possible value for the texture coordinate U
- * (horizontal).
- * @return float
- */
- public float maxTexcoordU() {
- return maxTexcoordU;
- }
-
-
- /**
- * Returns the maximum possible value for the texture coordinate V (vertical).
- * @return float
- */
- public float maxTexcoordV() {
- return maxTexcoordV;
- }
-
-
- /**
- * Returns true if the texture is inverted along the horizontal direction.
- * @return boolean;
- */
- public boolean invertedX() {
- return invertedX;
- }
-
-
- /**
- * Sets the texture as inverted or not along the horizontal direction.
- * @param v boolean;
- */
- public void invertedX(boolean v) {
- invertedX = v;
- }
-
-
- /**
- * Returns true if the texture is inverted along the vertical direction.
- * @return boolean;
- */
- public boolean invertedY() {
- return invertedY;
- }
-
-
- /**
- * Sets the texture as inverted or not along the vertical direction.
- * @param v boolean;
- */
- public void invertedY(boolean v) {
- invertedY = v;
- }
-
-
- ////////////////////////////////////////////////////////////
-
- // Bind/unbind
-
-
- public void bind() {
- // Binding a texture automatically enables texturing for the
- // texture target from that moment onwards. Unbinding the texture
- // won't disable texturing.
- if (!pgl.texturingIsEnabled(glTarget)) {
- pgl.enableTexturing(glTarget);
- }
- pgl.bindTexture(glTarget, glName);
- bound = true;
- }
-
-
- public void unbind() {
- if (pgl.textureIsBound(glTarget, glName)) {
- // We don't want to unbind another texture
- // that might be bound instead of this one.
- if (!pgl.texturingIsEnabled(glTarget)) {
- pgl.enableTexturing(glTarget);
- pgl.bindTexture(glTarget, 0);
- pgl.disableTexturing(glTarget);
- } else {
- pgl.bindTexture(glTarget, 0);
- }
- }
- bound = false;
- }
-
-
- public boolean bound() {
- // A true result might not necessarily mean that texturing is enabled
- // (a texture can be bound to the target, but texturing is disabled).
- return bound;
- }
-
-
- //////////////////////////////////////////////////////////////
-
- // Modified flag
-
-
- public boolean isModified() {
- return modified;
- }
-
-
- public void setModified() {
- modified = true;
- }
-
-
- public void setModified(boolean m) {
- modified = m;
- }
-
-
- public int getModifiedX1() {
- return mx1;
- }
-
-
- public int getModifiedX2() {
- return mx2;
- }
-
-
- public int getModifiedY1() {
- return my1;
- }
-
-
- public int getModifiedY2() {
- return my2;
- }
-
-
- public void updateTexels() {
- updateTexelsImpl(0, 0, width, height);
- }
-
-
- public void updateTexels(int x, int y, int w, int h) {
- updateTexelsImpl(x, y, w, h);
- }
-
-
- protected void updateTexelsImpl(int x, int y, int w, int h) {
- int x2 = x + w;
- int y2 = y + h;
-
- if (!modified) {
- mx1 = PApplet.max(0, x);
- mx2 = PApplet.min(width - 1, x2);
- my1 = PApplet.max(0, y);
- my2 = PApplet.min(height - 1, y2);
- modified = true;
-
- } else {
- if (x < mx1) mx1 = PApplet.max(0, x);
- if (x > mx2) mx2 = PApplet.min(width - 1, x);
- if (y < my1) my1 = PApplet.max(0, y);
- if (y > my2) my2 = y;
-
- if (x2 < mx1) mx1 = PApplet.max(0, x2);
- if (x2 > mx2) mx2 = PApplet.min(width - 1, x2);
- if (y2 < my1) my1 = PApplet.max(0, y2);
- if (y2 > my2) my2 = PApplet.min(height - 1, y2);
- }
- }
-
-
- protected void loadPixels(int len) {
- if (rgbaPixels == null || rgbaPixels.length < len) {
- rgbaPixels = new int[len];
- }
- }
-
-
- protected void updatePixelBuffer(int[] pixels) {
- pixelBuffer = PGL.updateIntBuffer(pixelBuffer, pixels, true);
- }
-
- ////////////////////////////////////////////////////////////
-
- // Buffer sink interface.
-
-
- public void setBufferSource(Object source) {
- bufferSource = source;
- getSourceMethods();
- }
-
-
- public void copyBufferFromSource(Object natRef, ByteBuffer byteBuf,
- int w, int h) {
- if (bufferCache == null) {
- bufferCache = new LinkedList();
- }
-
- if (bufferCache.size() + 1 <= MAX_BUFFER_CACHE_SIZE) {
- bufferCache.add(new BufferData(natRef, byteBuf.asIntBuffer(), w, h));
- } else {
- // The buffer cache reached the maximum size, so we just dispose
- // the new buffer.
- try {
- disposeBufferMethod.invoke(bufferSource, new Object[] { natRef });
- } catch (Exception e) {
- e.printStackTrace();
- }
- }
- }
-
-
- public boolean hasBufferSource() {
- return bufferSource != null;
- }
-
-
- public boolean hasBuffers() {
- return bufferSource != null && bufferCache != null &&
- 0 < bufferCache.size();
- }
-
-
- protected boolean bufferUpdate() {
- BufferData data = null;
- try {
- data = bufferCache.remove(0);
- } catch (NoSuchElementException ex) {
- PGraphics.showWarning("Don't have pixel data to copy to texture");
- }
-
- if (data != null) {
- if ((data.w != width) || (data.h != height)) {
- init(data.w, data.h);
- }
- setNative(data.rgbBuf, 0, 0, width, height);
-
- data.dispose();
-
- return true;
- } else {
- return false;
- }
- }
-
-
- protected boolean bufferUpdate(int[] pixels) {
- BufferData data = null;
- try {
- data = bufferCache.remove(0);
- } catch (NoSuchElementException ex) {
- PGraphics.showWarning("Don't have pixel data to copy to texture");
- }
-
- if (data != null) {
- if ((data.w != width) || (data.h != height)) {
- init(data.w, data.h);
- }
- setNative(data.rgbBuf, 0, 0, width, height);
-
- data.rgbBuf.get(pixels);
- convertToARGB(pixels);
-
- data.dispose();
-
- return true;
- } else {
- return false;
- }
- }
-
-
- protected void getSourceMethods() {
- try {
- disposeBufferMethod = bufferSource.getClass().
- getMethod("disposeBuffer", new Class[] { Object.class });
- } catch (Exception e) {
- throw new RuntimeException("Provided source object doesn't have a " +
- "disposeBuffer method.");
- }
- }
-
-
- ////////////////////////////////////////////////////////////
-
- // Utilities
-
-
- /**
- * Flips intArray along the X axis.
- * @param intArray int[]
- * @param mult int
- */
- protected void flipArrayOnX(int[] intArray, int mult) {
- int index = 0;
- int xindex = mult * (width - 1);
- for (int x = 0; x < width / 2; x++) {
- for (int y = 0; y < height; y++) {
- int i = index + mult * y * width;
- int j = xindex + mult * y * width;
-
- for (int c = 0; c < mult; c++) {
- int temp = intArray[i];
- intArray[i] = intArray[j];
- intArray[j] = temp;
-
- i++;
- j++;
- }
-
- }
- index += mult;
- xindex -= mult;
- }
- }
-
-
- /**
- * Flips intArray along the Y axis.
- * @param intArray int[]
- * @param mult int
- */
- protected void flipArrayOnY(int[] intArray, int mult) {
- int index = 0;
- int yindex = mult * (height - 1) * width;
- for (int y = 0; y < height / 2; y++) {
- for (int x = 0; x < mult * width; x++) {
- int temp = intArray[index];
- intArray[index] = intArray[yindex];
- intArray[yindex] = temp;
-
- index++;
- yindex++;
- }
- yindex -= mult * width * 2;
- }
- }
-
-
- /**
- * Reorders a pixel array in the given format into the order required by
- * OpenGL (RGBA). Both arrays are assumed to be of the same length. The width
- * and height parameters are used in the YUV420 to RBGBA conversion.
- * @param intArray int[]
- * @param tIntArray int[]
- * @param arrayFormat int
- * @param w int
- * @param h int
- */
- protected void convertToRGBA(int[] intArray, int[] tIntArray, int arrayFormat,
- int w, int h) {
- if (PGL.BIG_ENDIAN) {
- switch (arrayFormat) {
- case ALPHA:
-
- // Converting from xxxA into RGBA. RGB is set to white
- // (0xFFFFFF, i.e.: (255, 255, 255))
- for (int i = 0; i< intArray.length; i++) {
- tIntArray[i] = 0xFFFFFF00 | intArray[i];
- }
- break;
-
- case RGB:
-
- // Converting xRGB into RGBA. A is set to 0xFF (255, full opacity).
- for (int i = 0; i< intArray.length; i++) {
- int pixel = intArray[i];
- tIntArray[i] = (pixel << 8) | 0xFF;
- }
- break;
-
- case ARGB:
-
- // Converting ARGB into RGBA. Shifting RGB to 8 bits to the left,
- // and bringing A to the first byte.
- for (int i = 0; i< intArray.length; i++) {
- int pixel = intArray[i];
- tIntArray[i] = (pixel << 8) | ((pixel >> 24) & 0xFF);
- }
- break;
- }
-
- } else {
- // LITTLE_ENDIAN
- // ARGB native, and RGBA opengl means ABGR on windows
- // for the most part just need to swap two components here
- // the sun.cpu.endian here might be "false", oddly enough..
- // (that's why just using an "else", rather than check for "little")
-
- switch (arrayFormat) {
- case ALPHA:
-
- // Converting xxxA into ARGB, with RGB set to white.
- for (int i = 0; i< intArray.length; i++) {
- tIntArray[i] = (intArray[i] << 24) | 0x00FFFFFF;
- }
- break;
-
- case RGB:
-
- // We need to convert xRGB into ABGR,
- // so R and B must be swapped, and the x just made 0xFF.
- for (int i = 0; i< intArray.length; i++) {
- int pixel = intArray[i];
- tIntArray[i] = 0xFF000000 |
- ((pixel & 0xFF) << 16) |
- ((pixel & 0xFF0000) >> 16) |
- (pixel & 0x0000FF00);
- }
- break;
-
- case ARGB:
-
- // We need to convert ARGB into ABGR,
- // so R and B must be swapped, A and G just brought back in.
- for (int i = 0; i < intArray.length; i++) {
- int pixel = intArray[i];
- tIntArray[i] = ((pixel & 0xFF) << 16) |
- ((pixel & 0xFF0000) >> 16) |
- (pixel & 0xFF00FF00);
- }
- break;
-
- }
-
- }
- }
-
-
- /**
- * Reorders an OpenGL pixel array (RGBA) into ARGB. The array must be
- * of size width * height.
- * @param intArray int[]
- */
- protected void convertToARGB(int[] intArray) {
- int t = 0;
- int p = 0;
- if (PGL.BIG_ENDIAN) {
-
- // RGBA to ARGB conversion: shifting RGB 8 bits to the right,
- // and placing A 24 bits to the left.
- for (int y = 0; y < height; y++) {
- for (int x = 0; x < width; x++) {
- int pixel = intArray[p++];
- intArray[t++] = (pixel >> 8) | ((pixel << 24) & 0xFF000000);
- }
- }
-
- } else {
-
- // We have to convert ABGR into ARGB, so R and B must be swapped,
- // A and G just brought back in.
- for (int y = 0; y < height; y++) {
- for (int x = 0; x < width; x++) {
- int pixel = intArray[p++];
- intArray[t++] = ((pixel & 0xFF) << 16) |
- ((pixel & 0xFF0000) >> 16) |
- (pixel & 0xFF00FF00);
-
- }
- }
- }
- }
-
-
-
- ///////////////////////////////////////////////////////////
-
- // Allocate/release texture.
-
-
- protected void setSize(int w, int h) {
- width = w;
- height = h;
-
- if (PGraphicsOpenGL.npotTexSupported) {
- glWidth = w;
- glHeight = h;
- } else {
- glWidth = PGL.nextPowerOfTwo(w);
- glHeight = PGL.nextPowerOfTwo(h);
- }
-
- if (glWidth > PGraphicsOpenGL.maxTextureSize ||
- glHeight > PGraphicsOpenGL.maxTextureSize) {
- glWidth = glHeight = 0;
- throw new RuntimeException("Image width and height cannot be" +
- " larger than " +
- PGraphicsOpenGL.maxTextureSize +
- " with this graphics card.");
- }
-
- // If non-power-of-two textures are not supported, and the specified width
- // or height is non-power-of-two, then glWidth (glHeight) will be greater
- // than w (h) because it is chosen to be the next power of two, and this
- // quotient will give the appropriate maximum texture coordinate value given
- // this situation.
- maxTexcoordU = (float)width / glWidth;
- maxTexcoordV = (float)height / glHeight;
- }
-
-
- /**
- * Allocates the opengl texture object.
- */
- protected void allocate() {
- release(); // Just in the case this object is being re-allocated.
-
- boolean enabledTex = false;
- if (!pgl.texturingIsEnabled(glTarget)) {
- pgl.enableTexturing(glTarget);
- enabledTex = true;
- }
-
- context = pgl.getCurrentContext();
- glName = pg.createTextureObject(context);
-
- pgl.bindTexture(glTarget, glName);
- pgl.texParameteri(glTarget, PGL.TEXTURE_MIN_FILTER, glMinFilter);
- pgl.texParameteri(glTarget, PGL.TEXTURE_MAG_FILTER, glMagFilter);
- pgl.texParameteri(glTarget, PGL.TEXTURE_WRAP_S, glWrapS);
- pgl.texParameteri(glTarget, PGL.TEXTURE_WRAP_T, glWrapT);
- if (PGraphicsOpenGL.anisoSamplingSupported) {
- pgl.texParameterf(glTarget, PGL.TEXTURE_MAX_ANISOTROPY,
- PGraphicsOpenGL.maxAnisoAmount);
- }
-
- // First, we use glTexImage2D to set the full size of the texture (glW/glH
- // might be diff from w/h in the case that the GPU doesn't support NPOT
- // textures)
- pgl.texImage2D(glTarget, 0, glFormat, glWidth, glHeight, 0,
- PGL.RGBA, PGL.UNSIGNED_BYTE, null);
-
- // Makes sure that the texture buffer in video memory doesn't contain
- // any garbage.
- pgl.initTexture(glTarget, PGL.RGBA, width, height);
-
- pgl.bindTexture(glTarget, 0);
- if (enabledTex) {
- pgl.disableTexturing(glTarget);
- }
- bound = false;
- }
-
-
- /**
- * Marks the texture object for deletion.
- */
- protected void release() {
- if (glName != 0) {
- pg.finalizeTextureObject(glName, context);
- glName = 0;
- }
- }
-
-
- protected boolean contextIsOutdated() {
- boolean outdated = !pgl.contextIsCurrent(context);
- if (outdated) {
- // Removing the texture object from the renderer's list so it
- // doesn't get deleted by OpenGL. The texture object was
- // automatically disposed when the old context was destroyed.
- pg.removeTextureObject(glName, context);
-
- // And then set the id to zero, so it doesn't try to be
- // deleted when the object's finalizer is invoked by the GC.
- glName = 0;
- }
- return outdated;
- }
-
-
- public void colorBufferOf(PGraphicsOpenGL pgDraw) {
- this.pgDraw = pgDraw;
- }
-
-
- protected boolean isColorBuffer() {
- return pgDraw != null;
- }
-
-
- ///////////////////////////////////////////////////////////
-
- // Utilities.
-
-
- // Copies source texture tex into this.
- protected void copyTexture(Texture tex, int x, int y, int w, int h,
- boolean scale) {
- if (tex == null) {
- throw new RuntimeException("Source texture is null");
- }
-
- if (tempFbo == null) {
- tempFbo = new FrameBuffer(parent, glWidth, glHeight);
- }
-
- // This texture is the color (destination) buffer of the FBO.
- tempFbo.setColorBuffer(this);
- tempFbo.disableDepthTest();
-
- // FBO copy:
- pg.pushFramebuffer();
- pg.setFramebuffer(tempFbo);
- // Clear the color buffer to make sure that the alpha of the
- pgl.clearColor(0, 0, 0, 0);
- pgl.clear(PGL.COLOR_BUFFER_BIT);
- if (scale) {
- // Rendering tex into "this", and scaling the source rectangle
- // to cover the entire destination region.
- pgl.drawTexture(tex.glTarget, tex.glName, tex.glWidth, tex.glHeight,
- x, y, w, h, 0, 0, width, height);
-
- } else {
- // Rendering tex into "this" but without scaling so the contents
- // of the source texture fall in the corresponding texels of the
- // destination.
- pgl.drawTexture(tex.glTarget, tex.glName, tex.glWidth, tex.glHeight,
- x, y, w, h, x, y, w, h);
- }
- pg.popFramebuffer();
- updateTexels(x, y, w, h);
- }
-
-
- // Copies source texture tex into this.
- protected void copyTexture(int texTarget, int texName,
- int texWidth, int texHeight,
- int x, int y, int w, int h, boolean scale) {
- if (tempFbo == null) {
- tempFbo = new FrameBuffer(parent, glWidth, glHeight);
- }
-
- // This texture is the color (destination) buffer of the FBO.
- tempFbo.setColorBuffer(this);
- tempFbo.disableDepthTest();
-
- // FBO copy:
- pg.pushFramebuffer();
- pg.setFramebuffer(tempFbo);
- if (scale) {
- // Rendering tex into "this", and scaling the source rectangle
- // to cover the entire destination region.
- pgl.drawTexture(texTarget, texName, texWidth, texHeight,
- x, y, w, h, 0, 0, width, height);
-
- } else {
- // Rendering tex into "this" but without scaling so the contents
- // of the source texture fall in the corresponding texels of the
- // destination.
- pgl.drawTexture(texTarget, texName, texWidth, texHeight,
- x, y, w, h, x, y, w, h);
- }
- pg.popFramebuffer();
- updateTexels(x, y, w, h);
- }
-
-
- protected void copyObject(Texture src) {
- // The OpenGL texture of this object is replaced with the one from the
- // source object, so we delete the former to avoid resource wasting.
- release();
-
- width = src.width;
- height = src.height;
-
- parent = src.parent;
- pg = src.pg;
-
- glName = src.glName;
- glTarget = src.glTarget;
- glFormat = src.glFormat;
- glMinFilter = src.glMinFilter;
- glMagFilter = src.glMagFilter;
-
- glWidth= src.glWidth;
- glHeight = src.glHeight;
-
- usingMipmaps = src.usingMipmaps;
- usingRepeat = src.usingRepeat;
- maxTexcoordU = src.maxTexcoordU;
- maxTexcoordV = src.maxTexcoordV;
-
- invertedX = src.invertedX;
- invertedY = src.invertedY;
- }
-
-
- ///////////////////////////////////////////////////////////
-
- // Parameter handling
-
-
- public Parameters getParameters() {
- Parameters res = new Parameters();
-
- if (glTarget == PGL.TEXTURE_2D) {
- res.target = TEX2D;
- }
-
- if (glFormat == PGL.RGB) {
- res.format = RGB;
- } else if (glFormat == PGL.RGBA) {
- res.format = ARGB;
- } else if (glFormat == PGL.ALPHA) {
- res.format = ALPHA;
- }
-
- if (glMagFilter == PGL.NEAREST && glMinFilter == PGL.NEAREST) {
- res.sampling = POINT;
- res.mipmaps = false;
- } else if (glMagFilter == PGL.NEAREST && glMinFilter == PGL.LINEAR) {
- res.sampling = LINEAR;
- res.mipmaps = false;
- } else if (glMagFilter == PGL.NEAREST &&
- glMinFilter == PGL.LINEAR_MIPMAP_NEAREST) {
- res.sampling = LINEAR;
- res.mipmaps = true;
- } else if (glMagFilter == PGL.LINEAR && glMinFilter == PGL.LINEAR) {
- res.sampling = BILINEAR;
- res.mipmaps = false;
- } else if (glMagFilter == PGL.LINEAR &&
- glMinFilter == PGL.LINEAR_MIPMAP_NEAREST) {
- res.sampling = BILINEAR;
- res.mipmaps = true;
- } else if (glMagFilter == PGL.LINEAR &&
- glMinFilter == PGL.LINEAR_MIPMAP_LINEAR) {
- res.sampling = TRILINEAR;
- res.mipmaps = true;
- }
-
- if (glWrapS == PGL.CLAMP_TO_EDGE) {
- res.wrapU = CLAMP;
- } else if (glWrapS == PGL.REPEAT) {
- res.wrapU = REPEAT;
- }
-
- if (glWrapT == PGL.CLAMP_TO_EDGE) {
- res.wrapV = CLAMP;
- } else if (glWrapT == PGL.REPEAT) {
- res.wrapV = REPEAT;
- }
-
- return res;
- }
-
-
- /**
- * Sets texture target and internal format according to the target and
- * type specified.
- * @param target int
- * @param params GLTextureParameters
- */
- protected void setParameters(Parameters params) {
- if (params.target == TEX2D) {
- glTarget = PGL.TEXTURE_2D;
- } else {
- throw new RuntimeException("Unknown texture target");
- }
-
- if (params.format == RGB) {
- glFormat = PGL.RGB;
- } else if (params.format == ARGB) {
- glFormat = PGL.RGBA;
- } else if (params.format == ALPHA) {
- glFormat = PGL.ALPHA;
- } else {
- throw new RuntimeException("Unknown texture format");
- }
-
- if (params.sampling == POINT) {
- glMagFilter = PGL.NEAREST;
- glMinFilter = PGL.NEAREST;
- } else if (params.sampling == LINEAR) {
- glMagFilter = PGL.NEAREST;
- glMinFilter = params.mipmaps && PGL.MIPMAPS_ENABLED ?
- PGL.LINEAR_MIPMAP_NEAREST : PGL.LINEAR;
- } else if (params.sampling == BILINEAR) {
- glMagFilter = PGL.LINEAR;
- glMinFilter = params.mipmaps && PGL.MIPMAPS_ENABLED ?
- PGL.LINEAR_MIPMAP_NEAREST : PGL.LINEAR;
- } else if (params.sampling == TRILINEAR) {
- glMagFilter = PGL.LINEAR;
- glMinFilter = params.mipmaps && PGL.MIPMAPS_ENABLED ?
- PGL.LINEAR_MIPMAP_LINEAR : PGL.LINEAR;
- } else {
- throw new RuntimeException("Unknown texture filtering mode");
- }
-
- if (params.wrapU == CLAMP) {
- glWrapS = PGL.CLAMP_TO_EDGE;
- } else if (params.wrapU == REPEAT) {
- glWrapS = PGL.REPEAT;
- } else {
- throw new RuntimeException("Unknown wrapping mode");
- }
-
- if (params.wrapV == CLAMP) {
- glWrapT = PGL.CLAMP_TO_EDGE;
- } else if (params.wrapV == REPEAT) {
- glWrapT = PGL.REPEAT;
- } else {
- throw new RuntimeException("Unknown wrapping mode");
- }
-
- usingMipmaps = glMinFilter == PGL.LINEAR_MIPMAP_NEAREST ||
- glMinFilter == PGL.LINEAR_MIPMAP_LINEAR;
-
- usingRepeat = glWrapS == PGL.REPEAT || glWrapT == PGL.REPEAT;
-
- invertedX = false;
- invertedY = false;
- }
-
-
- ///////////////////////////////////////////////////////////////////////////
-
- // Parameters object
-
-
- /**
- * This class stores the parameters for a texture: target, internal format,
- * minimization filter and magnification filter.
- */
- static public class Parameters {
- /**
- * Texture target.
- */
- public int target;
-
- /**
- * Texture internal format.
- */
- public int format;
-
- /**
- * Texture filtering (POINT, LINEAR, BILINEAR or TRILINEAR).
- */
- public int sampling;
-
- /**
- * Use mipmaps or not.
- */
- public boolean mipmaps;
-
- /**
- * Wrapping mode along U.
- */
- public int wrapU;
-
- /**
- * Wrapping mode along V.
- */
- public int wrapV;
-
- /**
- * Sets all the parameters to default values.
- */
- public Parameters() {
- this.target = TEX2D;
- this.format = ARGB;
- this.sampling = BILINEAR;
- this.mipmaps = true;
- this.wrapU = CLAMP;
- this.wrapV = CLAMP;
- }
-
- public Parameters(int format) {
- this.target = TEX2D;
- this.format = format;
- this.sampling = BILINEAR;
- this.mipmaps = true;
- this.wrapU = CLAMP;
- this.wrapV = CLAMP;
- }
-
- public Parameters(int format, int sampling) {
- this.target = TEX2D;
- this.format = format;
- this.sampling = sampling;
- this.mipmaps = true;
- this.wrapU = CLAMP;
- this.wrapV = CLAMP;
- }
-
- public Parameters(int format, int sampling, boolean mipmaps) {
- this.target = TEX2D;
- this.format = format;
- this.mipmaps = mipmaps;
- if (sampling == TRILINEAR && !mipmaps) {
- this.sampling = BILINEAR;
- } else {
- this.sampling = sampling;
- }
- this.wrapU = CLAMP;
- this.wrapV = CLAMP;
- }
-
- public Parameters(int format, int sampling, boolean mipmaps, int wrap) {
- this.target = TEX2D;
- this.format = format;
- this.mipmaps = mipmaps;
- if (sampling == TRILINEAR && !mipmaps) {
- this.sampling = BILINEAR;
- } else {
- this.sampling = sampling;
- }
- this.wrapU = wrap;
- this.wrapV = wrap;
- }
-
- public Parameters(Parameters src) {
- set(src);
- }
-
- public void set(int format) {
- this.format = format;
- }
-
- public void set(int format, int sampling) {
- this.format = format;
- this.sampling = sampling;
- }
-
- public void set(int format, int sampling, boolean mipmaps) {
- this.format = format;
- this.sampling = sampling;
- this.mipmaps = mipmaps;
- }
-
- public void set(Parameters src) {
- this.target = src.target;
- this.format = src.format;
- this.sampling = src.sampling;
- this.mipmaps = src.mipmaps;
- this.wrapU = src.wrapU;
- this.wrapV = src.wrapV;
- }
- }
-
- /**
- * This class stores a buffer copied from the buffer source.
- *
- */
- protected class BufferData {
- int w, h;
- // Native buffer object.
- Object natBuf;
- // Buffer viewed as int.
- IntBuffer rgbBuf;
-
- BufferData(Object nat, IntBuffer rgb, int w, int h) {
- natBuf = nat;
- rgbBuf = rgb;
- this.w = w;
- this.h = h;
- }
-
- void dispose() {
- try {
- // Disposing the native buffer.
- disposeBufferMethod.invoke(bufferSource, new Object[] { natBuf });
- natBuf = null;
- rgbBuf = null;
- } catch (Exception e) {
- e.printStackTrace();
- }
- }
- }
-}
diff --git a/android/core/src/processing/opengl/TextureFrag.glsl b/android/core/src/processing/opengl/TextureFrag.glsl
deleted file mode 100644
index f041e61d13..0000000000
--- a/android/core/src/processing/opengl/TextureFrag.glsl
+++ /dev/null
@@ -1,35 +0,0 @@
-/*
- Part of the Processing project - http://processing.org
-
- Copyright (c) 2011-13 Ben Fry and Casey Reas
-
- This library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Lesser General Public
- License version 2.1 as published by the Free Software Foundation.
-
- This library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License for more details.
-
- You should have received a copy of the GNU Lesser General
- Public License along with this library; if not, write to the
- Free Software Foundation, Inc., 59 Temple Place, Suite 330,
- Boston, MA 02111-1307 USA
- */
-
-#ifdef GL_ES
-precision mediump float;
-precision mediump int;
-#endif
-
-uniform sampler2D texture;
-
-uniform vec2 texOffset;
-
-varying vec4 vertColor;
-varying vec4 vertTexCoord;
-
-void main() {
- gl_FragColor = texture2D(texture, vertTexCoord.st) * vertColor;
-}
\ No newline at end of file
diff --git a/android/core/src/processing/opengl/TextureVert.glsl b/android/core/src/processing/opengl/TextureVert.glsl
deleted file mode 100644
index 5260321fb8..0000000000
--- a/android/core/src/processing/opengl/TextureVert.glsl
+++ /dev/null
@@ -1,38 +0,0 @@
-/*
- Part of the Processing project - http://processing.org
-
- Copyright (c) 2011-13 Ben Fry and Casey Reas
-
- This library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Lesser General Public
- License version 2.1 as published by the Free Software Foundation.
-
- This library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License for more details.
-
- You should have received a copy of the GNU Lesser General
- Public License along with this library; if not, write to the
- Free Software Foundation, Inc., 59 Temple Place, Suite 330,
- Boston, MA 02111-1307 USA
- */
-
-#define PROCESSING_TEXTURE_SHADER
-
-uniform mat4 transform;
-uniform mat4 texMatrix;
-
-attribute vec4 vertex;
-attribute vec4 color;
-attribute vec2 texCoord;
-
-varying vec4 vertColor;
-varying vec4 vertTexCoord;
-
-void main() {
- gl_Position = transform * vertex;
-
- vertColor = color;
- vertTexCoord = texMatrix * vec4(texCoord, 1.0, 1.0);
-}
\ No newline at end of file
diff --git a/android/core/src/processing/opengl/tess/ActiveRegion.java b/android/core/src/processing/opengl/tess/ActiveRegion.java
deleted file mode 100644
index 6699923fc6..0000000000
--- a/android/core/src/processing/opengl/tess/ActiveRegion.java
+++ /dev/null
@@ -1,70 +0,0 @@
-/*
-* Portions Copyright (C) 2003-2006 Sun Microsystems, Inc.
-* All rights reserved.
-*/
-
-/*
-** License Applicability. Except to the extent portions of this file are
-** made subject to an alternative license as permitted in the SGI Free
-** Software License B, Version 2.0 (the "License"), the contents of this
-** file are subject only to the provisions of the License. You may not use
-** this file except in compliance with the License. You may obtain a copy
-** of the License at Silicon Graphics, Inc., attn: Legal Services, 1600
-** Amphitheatre Parkway, Mountain View, CA 94043-1351, or at:
-**
-** http://oss.sgi.com/projects/FreeB
-**
-** Note that, as provided in the License, the Software is distributed on an
-** "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS
-** DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND
-** CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A
-** PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
-**
-** NOTE: The Original Code (as defined below) has been licensed to Sun
-** Microsystems, Inc. ("Sun") under the SGI Free Software License B
-** (Version 1.1), shown above ("SGI License"). Pursuant to Section
-** 3.2(3) of the SGI License, Sun is distributing the Covered Code to
-** you under an alternative license ("Alternative License"). This
-** Alternative License includes all of the provisions of the SGI License
-** except that Section 2.2 and 11 are omitted. Any differences between
-** the Alternative License and the SGI License are offered solely by Sun
-** and not by SGI.
-**
-** Original Code. The Original Code is: OpenGL Sample Implementation,
-** Version 1.2.1, released January 26, 2000, developed by Silicon Graphics,
-** Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc.
-** Copyright in any portions created by third parties is as indicated
-** elsewhere herein. All Rights Reserved.
-**
-** Additional Notice Provisions: The application programming interfaces
-** established by SGI in conjunction with the Original Code are The
-** OpenGL(R) Graphics System: A Specification (Version 1.2.1), released
-** April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version
-** 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X
-** Window System(R) (Version 1.3), released October 19, 1998. This software
-** was created using the OpenGL(R) version 1.2.1 Sample Implementation
-** published by SGI, but has not been independently verified as being
-** compliant with the OpenGL(R) version 1.2.1 Specification.
-**
-** Author: Eric Veach, July 1994
-** Java Port: Pepijn Van Eeckhoudt, July 2003
-** Java Port: Nathan Parker Burg, August 2003
-** Processing integration: Andres Colubri, February 2012
-*/
-
-package processing.opengl.tess;
-
-class ActiveRegion {
- GLUhalfEdge eUp; /* upper edge, directed right to left */
- DictNode nodeUp; /* dictionary node corresponding to eUp */
- int windingNumber; /* used to determine which regions are
- * inside the polygon */
- boolean inside; /* is this region inside the polygon? */
- boolean sentinel; /* marks fake edges at t = +/-infinity */
- boolean dirty; /* marks regions where the upper or lower
- * edge has changed, but we haven't checked
- * whether they intersect yet */
- boolean fixUpperEdge; /* marks temporary edges introduced when
- * we process a "right vertex" (one without
- * any edges leaving to the right) */
-}
diff --git a/android/core/src/processing/opengl/tess/CachedVertex.java b/android/core/src/processing/opengl/tess/CachedVertex.java
deleted file mode 100644
index 327960ca02..0000000000
--- a/android/core/src/processing/opengl/tess/CachedVertex.java
+++ /dev/null
@@ -1,60 +0,0 @@
-/*
-* Portions Copyright (C) 2003-2006 Sun Microsystems, Inc.
-* All rights reserved.
-*/
-
-/*
-** License Applicability. Except to the extent portions of this file are
-** made subject to an alternative license as permitted in the SGI Free
-** Software License B, Version 2.0 (the "License"), the contents of this
-** file are subject only to the provisions of the License. You may not use
-** this file except in compliance with the License. You may obtain a copy
-** of the License at Silicon Graphics, Inc., attn: Legal Services, 1600
-** Amphitheatre Parkway, Mountain View, CA 94043-1351, or at:
-**
-** http://oss.sgi.com/projects/FreeB
-**
-** Note that, as provided in the License, the Software is distributed on an
-** "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS
-** DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND
-** CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A
-** PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
-**
-** NOTE: The Original Code (as defined below) has been licensed to Sun
-** Microsystems, Inc. ("Sun") under the SGI Free Software License B
-** (Version 1.1), shown above ("SGI License"). Pursuant to Section
-** 3.2(3) of the SGI License, Sun is distributing the Covered Code to
-** you under an alternative license ("Alternative License"). This
-** Alternative License includes all of the provisions of the SGI License
-** except that Section 2.2 and 11 are omitted. Any differences between
-** the Alternative License and the SGI License are offered solely by Sun
-** and not by SGI.
-**
-** Original Code. The Original Code is: OpenGL Sample Implementation,
-** Version 1.2.1, released January 26, 2000, developed by Silicon Graphics,
-** Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc.
-** Copyright in any portions created by third parties is as indicated
-** elsewhere herein. All Rights Reserved.
-**
-** Additional Notice Provisions: The application programming interfaces
-** established by SGI in conjunction with the Original Code are The
-** OpenGL(R) Graphics System: A Specification (Version 1.2.1), released
-** April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version
-** 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X
-** Window System(R) (Version 1.3), released October 19, 1998. This software
-** was created using the OpenGL(R) version 1.2.1 Sample Implementation
-** published by SGI, but has not been independently verified as being
-** compliant with the OpenGL(R) version 1.2.1 Specification.
-**
-** Author: Eric Veach, July 1994
-** Java Port: Pepijn Van Eeckhoudt, July 2003
-** Java Port: Nathan Parker Burg, August 2003
-** Processing integration: Andres Colubri, February 2012
-*/
-
-package processing.opengl.tess;
-
-class CachedVertex {
- public double[] coords = new double[3];
- public Object data;
-}
diff --git a/android/core/src/processing/opengl/tess/Dict.java b/android/core/src/processing/opengl/tess/Dict.java
deleted file mode 100644
index a1c04ea9d1..0000000000
--- a/android/core/src/processing/opengl/tess/Dict.java
+++ /dev/null
@@ -1,142 +0,0 @@
-/*
-* Portions Copyright (C) 2003-2006 Sun Microsystems, Inc.
-* All rights reserved.
-*/
-
-/*
-** License Applicability. Except to the extent portions of this file are
-** made subject to an alternative license as permitted in the SGI Free
-** Software License B, Version 2.0 (the "License"), the contents of this
-** file are subject only to the provisions of the License. You may not use
-** this file except in compliance with the License. You may obtain a copy
-** of the License at Silicon Graphics, Inc., attn: Legal Services, 1600
-** Amphitheatre Parkway, Mountain View, CA 94043-1351, or at:
-**
-** http://oss.sgi.com/projects/FreeB
-**
-** Note that, as provided in the License, the Software is distributed on an
-** "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS
-** DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND
-** CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A
-** PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
-**
-** NOTE: The Original Code (as defined below) has been licensed to Sun
-** Microsystems, Inc. ("Sun") under the SGI Free Software License B
-** (Version 1.1), shown above ("SGI License"). Pursuant to Section
-** 3.2(3) of the SGI License, Sun is distributing the Covered Code to
-** you under an alternative license ("Alternative License"). This
-** Alternative License includes all of the provisions of the SGI License
-** except that Section 2.2 and 11 are omitted. Any differences between
-** the Alternative License and the SGI License are offered solely by Sun
-** and not by SGI.
-**
-** Original Code. The Original Code is: OpenGL Sample Implementation,
-** Version 1.2.1, released January 26, 2000, developed by Silicon Graphics,
-** Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc.
-** Copyright in any portions created by third parties is as indicated
-** elsewhere herein. All Rights Reserved.
-**
-** Additional Notice Provisions: The application programming interfaces
-** established by SGI in conjunction with the Original Code are The
-** OpenGL(R) Graphics System: A Specification (Version 1.2.1), released
-** April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version
-** 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X
-** Window System(R) (Version 1.3), released October 19, 1998. This software
-** was created using the OpenGL(R) version 1.2.1 Sample Implementation
-** published by SGI, but has not been independently verified as being
-** compliant with the OpenGL(R) version 1.2.1 Specification.
-**
-** Author: Eric Veach, July 1994
-** Java Port: Pepijn Van Eeckhoudt, July 2003
-** Java Port: Nathan Parker Burg, August 2003
-** Processing integration: Andres Colubri, February 2012
-*/
-
-package processing.opengl.tess;
-
-class Dict {
- DictNode head;
- Object frame;
- DictLeq leq;
-
- private Dict() {
- }
-
- static Dict dictNewDict(Object frame, DictLeq leq) {
- Dict dict = new Dict();
- dict.head = new DictNode();
-
- dict.head.key = null;
- dict.head.next = dict.head;
- dict.head.prev = dict.head;
-
- dict.frame = frame;
- dict.leq = leq;
-
- return dict;
- }
-
- static void dictDeleteDict(Dict dict) {
- dict.head = null;
- dict.frame = null;
- dict.leq = null;
- }
-
- static DictNode dictInsert(Dict dict, Object key) {
- return dictInsertBefore(dict, dict.head, key);
- }
-
- static DictNode dictInsertBefore(Dict dict, DictNode node, Object key) {
- do {
- node = node.prev;
- } while (node.key != null && !dict.leq.leq(dict.frame, node.key, key));
-
- DictNode newNode = new DictNode();
- newNode.key = key;
- newNode.next = node.next;
- node.next.prev = newNode;
- newNode.prev = node;
- node.next = newNode;
-
- return newNode;
- }
-
- static Object dictKey(DictNode aNode) {
- return aNode.key;
- }
-
- static DictNode dictSucc(DictNode aNode) {
- return aNode.next;
- }
-
- static DictNode dictPred(DictNode aNode) {
- return aNode.prev;
- }
-
- static DictNode dictMin(Dict aDict) {
- return aDict.head.next;
- }
-
- static DictNode dictMax(Dict aDict) {
- return aDict.head.prev;
- }
-
- static void dictDelete(Dict dict, DictNode node) {
- node.next.prev = node.prev;
- node.prev.next = node.next;
- }
-
- static DictNode dictSearch(Dict dict, Object key) {
- DictNode node = dict.head;
-
- do {
- node = node.next;
- } while (node.key != null && !(dict.leq.leq(dict.frame, key, node.key)));
-
- return node;
- }
-
- public interface DictLeq {
- boolean leq(Object frame, Object key1, Object key2);
- }
-}
diff --git a/android/core/src/processing/opengl/tess/DictNode.java b/android/core/src/processing/opengl/tess/DictNode.java
deleted file mode 100644
index 0e1451ef56..0000000000
--- a/android/core/src/processing/opengl/tess/DictNode.java
+++ /dev/null
@@ -1,61 +0,0 @@
-/*
-* Portions Copyright (C) 2003-2006 Sun Microsystems, Inc.
-* All rights reserved.
-*/
-
-/*
-** License Applicability. Except to the extent portions of this file are
-** made subject to an alternative license as permitted in the SGI Free
-** Software License B, Version 2.0 (the "License"), the contents of this
-** file are subject only to the provisions of the License. You may not use
-** this file except in compliance with the License. You may obtain a copy
-** of the License at Silicon Graphics, Inc., attn: Legal Services, 1600
-** Amphitheatre Parkway, Mountain View, CA 94043-1351, or at:
-**
-** http://oss.sgi.com/projects/FreeB
-**
-** Note that, as provided in the License, the Software is distributed on an
-** "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS
-** DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND
-** CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A
-** PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
-**
-** NOTE: The Original Code (as defined below) has been licensed to Sun
-** Microsystems, Inc. ("Sun") under the SGI Free Software License B
-** (Version 1.1), shown above ("SGI License"). Pursuant to Section
-** 3.2(3) of the SGI License, Sun is distributing the Covered Code to
-** you under an alternative license ("Alternative License"). This
-** Alternative License includes all of the provisions of the SGI License
-** except that Section 2.2 and 11 are omitted. Any differences between
-** the Alternative License and the SGI License are offered solely by Sun
-** and not by SGI.
-**
-** Original Code. The Original Code is: OpenGL Sample Implementation,
-** Version 1.2.1, released January 26, 2000, developed by Silicon Graphics,
-** Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc.
-** Copyright in any portions created by third parties is as indicated
-** elsewhere herein. All Rights Reserved.
-**
-** Additional Notice Provisions: The application programming interfaces
-** established by SGI in conjunction with the Original Code are The
-** OpenGL(R) Graphics System: A Specification (Version 1.2.1), released
-** April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version
-** 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X
-** Window System(R) (Version 1.3), released October 19, 1998. This software
-** was created using the OpenGL(R) version 1.2.1 Sample Implementation
-** published by SGI, but has not been independently verified as being
-** compliant with the OpenGL(R) version 1.2.1 Specification.
-**
-** Author: Eric Veach, July 1994
-** Java Port: Pepijn Van Eeckhoudt, July 2003
-** Java Port: Nathan Parker Burg, August 2003
-** Processing integration: Andres Colubri, February 2012
-*/
-
-package processing.opengl.tess;
-
-class DictNode {
- Object key;
- DictNode next;
- DictNode prev;
-}
diff --git a/android/core/src/processing/opengl/tess/GLUface.java b/android/core/src/processing/opengl/tess/GLUface.java
deleted file mode 100644
index 99afc1c4eb..0000000000
--- a/android/core/src/processing/opengl/tess/GLUface.java
+++ /dev/null
@@ -1,66 +0,0 @@
-/*
-* Portions Copyright (C) 2003-2006 Sun Microsystems, Inc.
-* All rights reserved.
-*/
-
-/*
-** License Applicability. Except to the extent portions of this file are
-** made subject to an alternative license as permitted in the SGI Free
-** Software License B, Version 2.0 (the "License"), the contents of this
-** file are subject only to the provisions of the License. You may not use
-** this file except in compliance with the License. You may obtain a copy
-** of the License at Silicon Graphics, Inc., attn: Legal Services, 1600
-** Amphitheatre Parkway, Mountain View, CA 94043-1351, or at:
-**
-** http://oss.sgi.com/projects/FreeB
-**
-** Note that, as provided in the License, the Software is distributed on an
-** "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS
-** DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND
-** CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A
-** PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
-**
-** NOTE: The Original Code (as defined below) has been licensed to Sun
-** Microsystems, Inc. ("Sun") under the SGI Free Software License B
-** (Version 1.1), shown above ("SGI License"). Pursuant to Section
-** 3.2(3) of the SGI License, Sun is distributing the Covered Code to
-** you under an alternative license ("Alternative License"). This
-** Alternative License includes all of the provisions of the SGI License
-** except that Section 2.2 and 11 are omitted. Any differences between
-** the Alternative License and the SGI License are offered solely by Sun
-** and not by SGI.
-**
-** Original Code. The Original Code is: OpenGL Sample Implementation,
-** Version 1.2.1, released January 26, 2000, developed by Silicon Graphics,
-** Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc.
-** Copyright in any portions created by third parties is as indicated
-** elsewhere herein. All Rights Reserved.
-**
-** Additional Notice Provisions: The application programming interfaces
-** established by SGI in conjunction with the Original Code are The
-** OpenGL(R) Graphics System: A Specification (Version 1.2.1), released
-** April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version
-** 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X
-** Window System(R) (Version 1.3), released October 19, 1998. This software
-** was created using the OpenGL(R) version 1.2.1 Sample Implementation
-** published by SGI, but has not been independently verified as being
-** compliant with the OpenGL(R) version 1.2.1 Specification.
-**
-** Author: Eric Veach, July 1994
-** Java Port: Pepijn Van Eeckhoudt, July 2003
-** Processing integration: Andres Colubri, February 2012
-*/
-
-package processing.opengl.tess;
-
-class GLUface {
- public GLUface next; /* next face (never NULL) */
- public GLUface prev; /* previous face (never NULL) */
- public GLUhalfEdge anEdge; /* a half edge with this left face */
- public Object data; /* room for client's data */
-
- /* Internal data (keep hidden) */
- public GLUface trail; /* "stack" for conversion to strips */
- public boolean marked; /* flag for conversion to strips */
- public boolean inside; /* this face is in the polygon interior */
-}
diff --git a/android/core/src/processing/opengl/tess/GLUhalfEdge.java b/android/core/src/processing/opengl/tess/GLUhalfEdge.java
deleted file mode 100644
index 53d8bd51a3..0000000000
--- a/android/core/src/processing/opengl/tess/GLUhalfEdge.java
+++ /dev/null
@@ -1,72 +0,0 @@
-/*
-* Portions Copyright (C) 2003-2006 Sun Microsystems, Inc.
-* All rights reserved.
-*/
-
-/*
-** License Applicability. Except to the extent portions of this file are
-** made subject to an alternative license as permitted in the SGI Free
-** Software License B, Version 2.0 (the "License"), the contents of this
-** file are subject only to the provisions of the License. You may not use
-** this file except in compliance with the License. You may obtain a copy
-** of the License at Silicon Graphics, Inc., attn: Legal Services, 1600
-** Amphitheatre Parkway, Mountain View, CA 94043-1351, or at:
-**
-** http://oss.sgi.com/projects/FreeB
-**
-** Note that, as provided in the License, the Software is distributed on an
-** "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS
-** DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND
-** CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A
-** PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
-**
-** NOTE: The Original Code (as defined below) has been licensed to Sun
-** Microsystems, Inc. ("Sun") under the SGI Free Software License B
-** (Version 1.1), shown above ("SGI License"). Pursuant to Section
-** 3.2(3) of the SGI License, Sun is distributing the Covered Code to
-** you under an alternative license ("Alternative License"). This
-** Alternative License includes all of the provisions of the SGI License
-** except that Section 2.2 and 11 are omitted. Any differences between
-** the Alternative License and the SGI License are offered solely by Sun
-** and not by SGI.
-**
-** Original Code. The Original Code is: OpenGL Sample Implementation,
-** Version 1.2.1, released January 26, 2000, developed by Silicon Graphics,
-** Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc.
-** Copyright in any portions created by third parties is as indicated
-** elsewhere herein. All Rights Reserved.
-**
-** Additional Notice Provisions: The application programming interfaces
-** established by SGI in conjunction with the Original Code are The
-** OpenGL(R) Graphics System: A Specification (Version 1.2.1), released
-** April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version
-** 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X
-** Window System(R) (Version 1.3), released October 19, 1998. This software
-** was created using the OpenGL(R) version 1.2.1 Sample Implementation
-** published by SGI, but has not been independently verified as being
-** compliant with the OpenGL(R) version 1.2.1 Specification.
-**
-** Author: Eric Veach, July 1994
-** Java Port: Pepijn Van Eeckhoudt, July 2003
-** Processing integration: Andres Colubri, February 2012
-*/
-
-package processing.opengl.tess;
-
-class GLUhalfEdge {
- public GLUhalfEdge next; /* doubly-linked list (prev==Sym->next) */
- public GLUhalfEdge Sym; /* same edge, opposite direction */
- public GLUhalfEdge Onext; /* next edge CCW around origin */
- public GLUhalfEdge Lnext; /* next edge CCW around left face */
- public GLUvertex Org; /* origin vertex (Overtex too long) */
- public GLUface Lface; /* left face */
-
- /* Internal data (keep hidden) */
- public ActiveRegion activeRegion; /* a region with this upper edge (sweep.c) */
- public int winding; /* change in winding number when crossing */
- public boolean first;
-
- public GLUhalfEdge(boolean first) {
- this.first = first;
- }
-}
diff --git a/android/core/src/processing/opengl/tess/GLUmesh.java b/android/core/src/processing/opengl/tess/GLUmesh.java
deleted file mode 100644
index fecee0a75d..0000000000
--- a/android/core/src/processing/opengl/tess/GLUmesh.java
+++ /dev/null
@@ -1,63 +0,0 @@
-/*
-* Portions Copyright (C) 2003-2006 Sun Microsystems, Inc.
-
-* All rights reserved.
-*/
-
-/*
-** License Applicability. Except to the extent portions of this file are
-** made subject to an alternative license as permitted in the SGI Free
-** Software License B, Version 2.0 (the "License"), the contents of this
-** file are subject only to the provisions of the License. You may not use
-** this file except in compliance with the License. You may obtain a copy
-** of the License at Silicon Graphics, Inc., attn: Legal Services, 1600
-** Amphitheatre Parkway, Mountain View, CA 94043-1351, or at:
-**
-** http://oss.sgi.com/projects/FreeB
-**
-** Note that, as provided in the License, the Software is distributed on an
-** "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS
-** DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND
-** CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A
-** PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
-**
-** NOTE: The Original Code (as defined below) has been licensed to Sun
-** Microsystems, Inc. ("Sun") under the SGI Free Software License B
-** (Version 1.1), shown above ("SGI License"). Pursuant to Section
-** 3.2(3) of the SGI License, Sun is distributing the Covered Code to
-** you under an alternative license ("Alternative License"). This
-** Alternative License includes all of the provisions of the SGI License
-** except that Section 2.2 and 11 are omitted. Any differences between
-** the Alternative License and the SGI License are offered solely by Sun
-** and not by SGI.
-**
-** Original Code. The Original Code is: OpenGL Sample Implementation,
-** Version 1.2.1, released January 26, 2000, developed by Silicon Graphics,
-** Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc.
-** Copyright in any portions created by third parties is as indicated
-** elsewhere herein. All Rights Reserved.
-**
-** Additional Notice Provisions: The application programming interfaces
-** established by SGI in conjunction with the Original Code are The
-** OpenGL(R) Graphics System: A Specification (Version 1.2.1), released
-** April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version
-** 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X
-** Window System(R) (Version 1.3), released October 19, 1998. This software
-** was created using the OpenGL(R) version 1.2.1 Sample Implementation
-** published by SGI, but has not been independently verified as being
-** compliant with the OpenGL(R) version 1.2.1 Specification.
-**
-** Author: Eric Veach, July 1994
-** Java Port: Pepijn Van Eeckhoudt, July 2003
-** Java Port: Nathan Parker Burg, August 2003
-** Processing integration: Andres Colubri, February 2012
-*/
-
-package processing.opengl.tess;
-
-class GLUmesh {
- GLUvertex vHead = new GLUvertex(); /* dummy header for vertex list */
- GLUface fHead = new GLUface(); /* dummy header for face list */
- GLUhalfEdge eHead = new GLUhalfEdge(true); /* dummy header for edge list */
- GLUhalfEdge eHeadSym = new GLUhalfEdge(false); /* and its symmetric counterpart */
-}
diff --git a/android/core/src/processing/opengl/tess/GLUtessellatorImpl.java b/android/core/src/processing/opengl/tess/GLUtessellatorImpl.java
deleted file mode 100644
index 072877f9cd..0000000000
--- a/android/core/src/processing/opengl/tess/GLUtessellatorImpl.java
+++ /dev/null
@@ -1,645 +0,0 @@
-/*
-* Portions Copyright (C) 2003-2006 Sun Microsystems, Inc.
-* All rights reserved.
-*/
-
-/*
-** License Applicability. Except to the extent portions of this file are
-** made subject to an alternative license as permitted in the SGI Free
-** Software License B, Version 2.0 (the "License"), the contents of this
-** file are subject only to the provisions of the License. You may not use
-** this file except in compliance with the License. You may obtain a copy
-** of the License at Silicon Graphics, Inc., attn: Legal Services, 1600
-** Amphitheatre Parkway, Mountain View, CA 94043-1351, or at:
-**
-** http://oss.sgi.com/projects/FreeB
-**
-** Note that, as provided in the License, the Software is distributed on an
-** "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS
-** DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND
-** CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A
-** PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
-**
-** NOTE: The Original Code (as defined below) has been licensed to Sun
-** Microsystems, Inc. ("Sun") under the SGI Free Software License B
-** (Version 1.1), shown above ("SGI License"). Pursuant to Section
-** 3.2(3) of the SGI License, Sun is distributing the Covered Code to
-** you under an alternative license ("Alternative License"). This
-** Alternative License includes all of the provisions of the SGI License
-** except that Section 2.2 and 11 are omitted. Any differences between
-** the Alternative License and the SGI License are offered solely by Sun
-** and not by SGI.
-**
-** Original Code. The Original Code is: OpenGL Sample Implementation,
-** Version 1.2.1, released January 26, 2000, developed by Silicon Graphics,
-** Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc.
-** Copyright in any portions created by third parties is as indicated
-** elsewhere herein. All Rights Reserved.
-**
-** Additional Notice Provisions: The application programming interfaces
-** established by SGI in conjunction with the Original Code are The
-** OpenGL(R) Graphics System: A Specification (Version 1.2.1), released
-** April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version
-** 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X
-** Window System(R) (Version 1.3), released October 19, 1998. This software
-** was created using the OpenGL(R) version 1.2.1 Sample Implementation
-** published by SGI, but has not been independently verified as being
-** compliant with the OpenGL(R) version 1.2.1 Specification.
-**
-** Author: Eric Veach, July 1994
-** Java Port: Pepijn Van Eeckhoudt, July 2003
-** Java Port: Nathan Parker Burg, August 2003
-** Processing integration: Andres Colubri, February 2012
-*/
-
-package processing.opengl.tess;
-
-
-public class GLUtessellatorImpl implements PGLUtessellator {
- public static final int TESS_MAX_CACHE = 100;
-
- private int state; /* what begin/end calls have we seen? */
-
- private GLUhalfEdge lastEdge; /* lastEdge->Org is the most recent vertex */
- GLUmesh mesh; /* stores the input contours, and eventually
- the tessellation itself */
-
- /*** state needed for projecting onto the sweep plane ***/
-
- double[] normal = new double[3]; /* user-specified normal (if provided) */
- double[] sUnit = new double[3]; /* unit vector in s-direction (debugging) */
- double[] tUnit = new double[3]; /* unit vector in t-direction (debugging) */
-
- /*** state needed for the line sweep ***/
-
- private double relTolerance; /* tolerance for merging features */
- int windingRule; /* rule for determining polygon interior */
- boolean fatalError; /* fatal error: needed combine callback */
-
- Dict dict; /* edge dictionary for sweep line */
- PriorityQ pq; /* priority queue of vertex events */
- GLUvertex event; /* current sweep event being processed */
-
- /*** state needed for rendering callbacks (see render.c) ***/
-
- boolean flagBoundary; /* mark boundary edges (use EdgeFlag) */
- boolean boundaryOnly; /* Extract contours, not triangles */
- boolean avoidDegenerateTris; /* JOGL-specific hint to try to improve triangulation
- by avoiding producing degenerate (zero-area) triangles;
- has not been tested exhaustively and is therefore an option */
-
- GLUface lonelyTriList;
- /* list of triangles which could not be rendered as strips or fans */
-
-
-
- /*** state needed to cache single-contour polygons for renderCache() */
-
- private boolean flushCacheOnNextVertex; /* empty cache on next vertex() call */
- int cacheCount; /* number of cached vertices */
- CachedVertex[] cache = new CachedVertex[TESS_MAX_CACHE]; /* the vertex data */
-
- /*** rendering callbacks that also pass polygon data ***/
- private Object polygonData; /* client data for current polygon */
-
- private PGLUtessellatorCallback callBegin;
- private PGLUtessellatorCallback callEdgeFlag;
- private PGLUtessellatorCallback callVertex;
- private PGLUtessellatorCallback callEnd;
-// private GLUtessellatorCallback callMesh;
- private PGLUtessellatorCallback callError;
- private PGLUtessellatorCallback callCombine;
-
- private PGLUtessellatorCallback callBeginData;
- private PGLUtessellatorCallback callEdgeFlagData;
- private PGLUtessellatorCallback callVertexData;
- private PGLUtessellatorCallback callEndData;
-// private GLUtessellatorCallback callMeshData;
- private PGLUtessellatorCallback callErrorData;
- private PGLUtessellatorCallback callCombineData;
-
- private static final double GLU_TESS_DEFAULT_TOLERANCE = 0.0;
-// private static final int GLU_TESS_MESH = 100112; /* void (*)(GLUmesh *mesh) */
- private static PGLUtessellatorCallback NULL_CB = new PGLUtessellatorCallbackAdapter();
-
-// #define MAX_FAST_ALLOC (MAX(sizeof(EdgePair), \
-// MAX(sizeof(GLUvertex),sizeof(GLUface))))
-
- private GLUtessellatorImpl() {
- state = TessState.T_DORMANT;
-
- normal[0] = 0;
- normal[1] = 0;
- normal[2] = 0;
-
- relTolerance = GLU_TESS_DEFAULT_TOLERANCE;
- windingRule = PGLU.GLU_TESS_WINDING_ODD;
- flagBoundary = false;
- boundaryOnly = false;
-
- callBegin = NULL_CB;
- callEdgeFlag = NULL_CB;
- callVertex = NULL_CB;
- callEnd = NULL_CB;
- callError = NULL_CB;
- callCombine = NULL_CB;
-// callMesh = NULL_CB;
-
- callBeginData = NULL_CB;
- callEdgeFlagData = NULL_CB;
- callVertexData = NULL_CB;
- callEndData = NULL_CB;
- callErrorData = NULL_CB;
- callCombineData = NULL_CB;
-
- polygonData = null;
-
- for (int i = 0; i < cache.length; i++) {
- cache[i] = new CachedVertex();
- }
- }
-
- static public PGLUtessellator gluNewTess()
- {
- return new GLUtessellatorImpl();
- }
-
-
- private void makeDormant() {
- /* Return the tessellator to its original dormant state. */
-
- if (mesh != null) {
- Mesh.__gl_meshDeleteMesh(mesh);
- }
- state = TessState.T_DORMANT;
- lastEdge = null;
- mesh = null;
- }
-
- private void requireState(int newState) {
- if (state != newState) gotoState(newState);
- }
-
- private void gotoState(int newState) {
- while (state != newState) {
- /* We change the current state one level at a time, to get to
- * the desired state.
- */
- if (state < newState) {
- if (state == TessState.T_DORMANT) {
- callErrorOrErrorData(PGLU.GLU_TESS_MISSING_BEGIN_POLYGON);
- gluTessBeginPolygon(null);
- } else if (state == TessState.T_IN_POLYGON) {
- callErrorOrErrorData(PGLU.GLU_TESS_MISSING_BEGIN_CONTOUR);
- gluTessBeginContour();
- }
- } else {
- if (state == TessState.T_IN_CONTOUR) {
- callErrorOrErrorData(PGLU.GLU_TESS_MISSING_END_CONTOUR);
- gluTessEndContour();
- } else if (state == TessState.T_IN_POLYGON) {
- callErrorOrErrorData(PGLU.GLU_TESS_MISSING_END_POLYGON);
- /* gluTessEndPolygon( tess ) is too much work! */
- makeDormant();
- }
- }
- }
- }
-
- public void gluDeleteTess() {
- requireState(TessState.T_DORMANT);
- }
-
- public void gluTessProperty(int which, double value) {
- switch (which) {
- case PGLU.GLU_TESS_TOLERANCE:
- if (value < 0.0 || value > 1.0) break;
- relTolerance = value;
- return;
-
- case PGLU.GLU_TESS_WINDING_RULE:
- int windingRule = (int) value;
- if (windingRule != value) break; /* not an integer */
-
- switch (windingRule) {
- case PGLU.GLU_TESS_WINDING_ODD:
- case PGLU.GLU_TESS_WINDING_NONZERO:
- case PGLU.GLU_TESS_WINDING_POSITIVE:
- case PGLU.GLU_TESS_WINDING_NEGATIVE:
- case PGLU.GLU_TESS_WINDING_ABS_GEQ_TWO:
- this.windingRule = windingRule;
- return;
- default:
- break;
- }
-
- case PGLU.GLU_TESS_BOUNDARY_ONLY:
- boundaryOnly = (value != 0);
- return;
-
- case PGLU.GLU_TESS_AVOID_DEGENERATE_TRIANGLES:
- avoidDegenerateTris = (value != 0);
- return;
-
- default:
- callErrorOrErrorData(PGLU.GLU_INVALID_ENUM);
- return;
- }
- callErrorOrErrorData(PGLU.GLU_INVALID_VALUE);
- }
-
-/* Returns tessellator property */
- public void gluGetTessProperty(int which, double[] value, int value_offset) {
- switch (which) {
- case PGLU.GLU_TESS_TOLERANCE:
-/* tolerance should be in range [0..1] */
- assert (0.0 <= relTolerance && relTolerance <= 1.0);
- value[value_offset] = relTolerance;
- break;
- case PGLU.GLU_TESS_WINDING_RULE:
- assert (windingRule == PGLU.GLU_TESS_WINDING_ODD ||
- windingRule == PGLU.GLU_TESS_WINDING_NONZERO ||
- windingRule == PGLU.GLU_TESS_WINDING_POSITIVE ||
- windingRule == PGLU.GLU_TESS_WINDING_NEGATIVE ||
- windingRule == PGLU.GLU_TESS_WINDING_ABS_GEQ_TWO);
- value[value_offset] = windingRule;
- break;
- case PGLU.GLU_TESS_BOUNDARY_ONLY:
- assert (boundaryOnly == true || boundaryOnly == false);
- value[value_offset] = boundaryOnly ? 1 : 0;
- break;
- case PGLU.GLU_TESS_AVOID_DEGENERATE_TRIANGLES:
- value[value_offset] = avoidDegenerateTris ? 1 : 0;
- break;
- default:
- value[value_offset] = 0.0;
- callErrorOrErrorData(PGLU.GLU_INVALID_ENUM);
- break;
- }
- } /* gluGetTessProperty() */
-
- public void gluTessNormal(double x, double y, double z) {
- normal[0] = x;
- normal[1] = y;
- normal[2] = z;
- }
-
- public void gluTessCallback(int which, PGLUtessellatorCallback aCallback) {
- switch (which) {
- case PGLU.GLU_TESS_BEGIN:
- callBegin = aCallback == null ? NULL_CB : aCallback;
- return;
- case PGLU.GLU_TESS_BEGIN_DATA:
- callBeginData = aCallback == null ? NULL_CB : aCallback;
- return;
- case PGLU.GLU_TESS_EDGE_FLAG:
- callEdgeFlag = aCallback == null ? NULL_CB : aCallback;
-/* If the client wants boundary edges to be flagged,
- * we render everything as separate triangles (no strips or fans).
- */
- flagBoundary = aCallback != null;
- return;
- case PGLU.GLU_TESS_EDGE_FLAG_DATA:
- callEdgeFlagData = callBegin = aCallback == null ? NULL_CB : aCallback;
-/* If the client wants boundary edges to be flagged,
- * we render everything as separate triangles (no strips or fans).
- */
- flagBoundary = (aCallback != null);
- return;
- case PGLU.GLU_TESS_VERTEX:
- callVertex = aCallback == null ? NULL_CB : aCallback;
- return;
- case PGLU.GLU_TESS_VERTEX_DATA:
- callVertexData = aCallback == null ? NULL_CB : aCallback;
- return;
- case PGLU.GLU_TESS_END:
- callEnd = aCallback == null ? NULL_CB : aCallback;
- return;
- case PGLU.GLU_TESS_END_DATA:
- callEndData = aCallback == null ? NULL_CB : aCallback;
- return;
- case PGLU.GLU_TESS_ERROR:
- callError = aCallback == null ? NULL_CB : aCallback;
- return;
- case PGLU.GLU_TESS_ERROR_DATA:
- callErrorData = aCallback == null ? NULL_CB : aCallback;
- return;
- case PGLU.GLU_TESS_COMBINE:
- callCombine = aCallback == null ? NULL_CB : aCallback;
- return;
- case PGLU.GLU_TESS_COMBINE_DATA:
- callCombineData = aCallback == null ? NULL_CB : aCallback;
- return;
-// case GLU_TESS_MESH:
-// callMesh = aCallback == null ? NULL_CB : aCallback;
-// return;
- default:
- callErrorOrErrorData(PGLU.GLU_INVALID_ENUM);
- return;
- }
- }
-
- private boolean addVertex(double[] coords, Object vertexData) {
- GLUhalfEdge e;
-
- e = lastEdge;
- if (e == null) {
-/* Make a self-loop (one vertex, one edge). */
-
- e = Mesh.__gl_meshMakeEdge(mesh);
- if (e == null) return false;
- if (!Mesh.__gl_meshSplice(e, e.Sym)) return false;
- } else {
-/* Create a new vertex and edge which immediately follow e
- * in the ordering around the left face.
- */
- if (Mesh.__gl_meshSplitEdge(e) == null) return false;
- e = e.Lnext;
- }
-
-/* The new vertex is now e.Org. */
- e.Org.data = vertexData;
- e.Org.coords[0] = coords[0];
- e.Org.coords[1] = coords[1];
- e.Org.coords[2] = coords[2];
-
-/* The winding of an edge says how the winding number changes as we
- * cross from the edge''s right face to its left face. We add the
- * vertices in such an order that a CCW contour will add +1 to
- * the winding number of the region inside the contour.
- */
- e.winding = 1;
- e.Sym.winding = -1;
-
- lastEdge = e;
-
- return true;
- }
-
- private void cacheVertex(double[] coords, Object vertexData) {
- if (cache[cacheCount] == null) {
- cache[cacheCount] = new CachedVertex();
- }
-
- CachedVertex v = cache[cacheCount];
-
- v.data = vertexData;
- v.coords[0] = coords[0];
- v.coords[1] = coords[1];
- v.coords[2] = coords[2];
- ++cacheCount;
- }
-
-
- private boolean flushCache() {
- CachedVertex[] v = cache;
-
- mesh = Mesh.__gl_meshNewMesh();
- if (mesh == null) return false;
-
- for (int i = 0; i < cacheCount; i++) {
- CachedVertex vertex = v[i];
- if (!addVertex(vertex.coords, vertex.data)) return false;
- }
- cacheCount = 0;
- flushCacheOnNextVertex = false;
-
- return true;
- }
-
- public void gluTessVertex(double[] coords, int coords_offset, Object vertexData) {
- int i;
- boolean tooLarge = false;
- double x;
- double[] clamped = new double[3];
-
- requireState(TessState.T_IN_CONTOUR);
-
- if (flushCacheOnNextVertex) {
- if (!flushCache()) {
- callErrorOrErrorData(PGLU.GLU_OUT_OF_MEMORY);
- return;
- }
- lastEdge = null;
- }
- for (i = 0; i < 3; ++i) {
- x = coords[i+coords_offset];
- if (x < -PGLU.GLU_TESS_MAX_COORD) {
- x = -PGLU.GLU_TESS_MAX_COORD;
- tooLarge = true;
- }
- if (x > PGLU.GLU_TESS_MAX_COORD) {
- x = PGLU.GLU_TESS_MAX_COORD;
- tooLarge = true;
- }
- clamped[i] = x;
- }
- if (tooLarge) {
- callErrorOrErrorData(PGLU.GLU_TESS_COORD_TOO_LARGE);
- }
-
- if (mesh == null) {
- if (cacheCount < TESS_MAX_CACHE) {
- cacheVertex(clamped, vertexData);
- return;
- }
- if (!flushCache()) {
- callErrorOrErrorData(PGLU.GLU_OUT_OF_MEMORY);
- return;
- }
- }
-
- if (!addVertex(clamped, vertexData)) {
- callErrorOrErrorData(PGLU.GLU_OUT_OF_MEMORY);
- }
- }
-
-
- public void gluTessBeginPolygon(Object data) {
- requireState(TessState.T_DORMANT);
-
- state = TessState.T_IN_POLYGON;
- cacheCount = 0;
- flushCacheOnNextVertex = false;
- mesh = null;
-
- polygonData = data;
- }
-
-
- public void gluTessBeginContour() {
- requireState(TessState.T_IN_POLYGON);
-
- state = TessState.T_IN_CONTOUR;
- lastEdge = null;
- if (cacheCount > 0) {
-/* Just set a flag so we don't get confused by empty contours
- * -- these can be generated accidentally with the obsolete
- * NextContour() interface.
- */
- flushCacheOnNextVertex = true;
- }
- }
-
-
- public void gluTessEndContour() {
- requireState(TessState.T_IN_CONTOUR);
- state = TessState.T_IN_POLYGON;
- }
-
- public void gluTessEndPolygon() {
- GLUmesh mesh;
-
- try {
- requireState(TessState.T_IN_POLYGON);
- state = TessState.T_DORMANT;
-
- if (this.mesh == null) {
- if (!flagBoundary /*&& callMesh == NULL_CB*/) {
-
-/* Try some special code to make the easy cases go quickly
- * (eg. convex polygons). This code does NOT handle multiple contours,
- * intersections, edge flags, and of course it does not generate
- * an explicit mesh either.
- */
- if (Render.__gl_renderCache(this)) {
- polygonData = null;
- return;
- }
- }
- if (!flushCache()) throw new RuntimeException(); /* could've used a label*/
- }
-
-/* Determine the polygon normal and project vertices onto the plane
- * of the polygon.
- */
- Normal.__gl_projectPolygon(this);
-
-/* __gl_computeInterior( tess ) computes the planar arrangement specified
- * by the given contours, and further subdivides this arrangement
- * into regions. Each region is marked "inside" if it belongs
- * to the polygon, according to the rule given by windingRule.
- * Each interior region is guaranteed be monotone.
- */
- if (!Sweep.__gl_computeInterior(this)) {
- throw new RuntimeException(); /* could've used a label */
- }
-
- mesh = this.mesh;
- if (!fatalError) {
- boolean rc = true;
-
-/* If the user wants only the boundary contours, we throw away all edges
- * except those which separate the interior from the exterior.
- * Otherwise we tessellate all the regions marked "inside".
- */
- if (boundaryOnly) {
- rc = TessMono.__gl_meshSetWindingNumber(mesh, 1, true);
- } else {
- rc = TessMono.__gl_meshTessellateInterior(mesh, avoidDegenerateTris);
- }
- if (!rc) throw new RuntimeException(); /* could've used a label */
-
- Mesh.__gl_meshCheckMesh(mesh);
-
- if (callBegin != NULL_CB || callEnd != NULL_CB
- || callVertex != NULL_CB || callEdgeFlag != NULL_CB
- || callBeginData != NULL_CB
- || callEndData != NULL_CB
- || callVertexData != NULL_CB
- || callEdgeFlagData != NULL_CB) {
- if (boundaryOnly) {
- Render.__gl_renderBoundary(this, mesh); /* output boundary contours */
- } else {
- Render.__gl_renderMesh(this, mesh); /* output strips and fans */
- }
- }
-// if (callMesh != NULL_CB) {
-//
-///* Throw away the exterior faces, so that all faces are interior.
-// * This way the user doesn't have to check the "inside" flag,
-// * and we don't need to even reveal its existence. It also leaves
-// * the freedom for an implementation to not generate the exterior
-// * faces in the first place.
-// */
-// TessMono.__gl_meshDiscardExterior(mesh);
-// callMesh.mesh(mesh); /* user wants the mesh itself */
-// mesh = null;
-// polygonData = null;
-// return;
-// }
- }
- Mesh.__gl_meshDeleteMesh(mesh);
- polygonData = null;
- mesh = null;
- } catch (Exception e) {
- e.printStackTrace();
- callErrorOrErrorData(PGLU.GLU_OUT_OF_MEMORY);
- }
- }
-
- /*******************************************************/
-
-/* Obsolete calls -- for backward compatibility */
-
- public void gluBeginPolygon() {
- gluTessBeginPolygon(null);
- gluTessBeginContour();
- }
-
-
-/*ARGSUSED*/
- public void gluNextContour(int type) {
- gluTessEndContour();
- gluTessBeginContour();
- }
-
-
- public void gluEndPolygon() {
- gluTessEndContour();
- gluTessEndPolygon();
- }
-
- void callBeginOrBeginData(int a) {
- if (callBeginData != NULL_CB)
- callBeginData.beginData(a, polygonData);
- else
- callBegin.begin(a);
- }
-
- void callVertexOrVertexData(Object a) {
- if (callVertexData != NULL_CB)
- callVertexData.vertexData(a, polygonData);
- else
- callVertex.vertex(a);
- }
-
- void callEdgeFlagOrEdgeFlagData(boolean a) {
- if (callEdgeFlagData != NULL_CB)
- callEdgeFlagData.edgeFlagData(a, polygonData);
- else
- callEdgeFlag.edgeFlag(a);
- }
-
- void callEndOrEndData() {
- if (callEndData != NULL_CB)
- callEndData.endData(polygonData);
- else
- callEnd.end();
- }
-
- void callCombineOrCombineData(double[] coords, Object[] vertexData, float[] weights, Object[] outData) {
- if (callCombineData != NULL_CB)
- callCombineData.combineData(coords, vertexData, weights, outData, polygonData);
- else
- callCombine.combine(coords, vertexData, weights, outData);
- }
-
- void callErrorOrErrorData(int a) {
- if (callErrorData != NULL_CB)
- callErrorData.errorData(a, polygonData);
- else
- callError.error(a);
- }
-
-}
diff --git a/android/core/src/processing/opengl/tess/GLUvertex.java b/android/core/src/processing/opengl/tess/GLUvertex.java
deleted file mode 100644
index 8349878a15..0000000000
--- a/android/core/src/processing/opengl/tess/GLUvertex.java
+++ /dev/null
@@ -1,67 +0,0 @@
-/*
-* Portions Copyright (C) 2003-2006 Sun Microsystems, Inc.
-* All rights reserved.
-*/
-
-/*
-** License Applicability. Except to the extent portions of this file are
-** made subject to an alternative license as permitted in the SGI Free
-** Software License B, Version 2.0 (the "License"), the contents of this
-** file are subject only to the provisions of the License. You may not use
-** this file except in compliance with the License. You may obtain a copy
-** of the License at Silicon Graphics, Inc., attn: Legal Services, 1600
-** Amphitheatre Parkway, Mountain View, CA 94043-1351, or at:
-**
-** http://oss.sgi.com/projects/FreeB
-**
-** Note that, as provided in the License, the Software is distributed on an
-** "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS
-** DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND
-** CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A
-** PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
-**
-** NOTE: The Original Code (as defined below) has been licensed to Sun
-** Microsystems, Inc. ("Sun") under the SGI Free Software License B
-** (Version 1.1), shown above ("SGI License"). Pursuant to Section
-** 3.2(3) of the SGI License, Sun is distributing the Covered Code to
-** you under an alternative license ("Alternative License"). This
-** Alternative License includes all of the provisions of the SGI License
-** except that Section 2.2 and 11 are omitted. Any differences between
-** the Alternative License and the SGI License are offered solely by Sun
-** and not by SGI.
-**
-** Original Code. The Original Code is: OpenGL Sample Implementation,
-** Version 1.2.1, released January 26, 2000, developed by Silicon Graphics,
-** Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc.
-** Copyright in any portions created by third parties is as indicated
-** elsewhere herein. All Rights Reserved.
-**
-** Additional Notice Provisions: The application programming interfaces
-** established by SGI in conjunction with the Original Code are The
-** OpenGL(R) Graphics System: A Specification (Version 1.2.1), released
-** April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version
-** 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X
-** Window System(R) (Version 1.3), released October 19, 1998. This software
-** was created using the OpenGL(R) version 1.2.1 Sample Implementation
-** published by SGI, but has not been independently verified as being
-** compliant with the OpenGL(R) version 1.2.1 Specification.
-**
-** Author: Eric Veach, July 1994
-** Java Port: Pepijn Van Eeckhoudt, July 2003
-** Java Port: Nathan Parker Burg, August 2003
-** Processing integration: Andres Colubri, February 2012
-*/
-
-package processing.opengl.tess;
-
-class GLUvertex {
- public GLUvertex next; /* next vertex (never NULL) */
- public GLUvertex prev; /* previous vertex (never NULL) */
- public GLUhalfEdge anEdge; /* a half-edge with this origin */
- public Object data; /* client's data */
-
- /* Internal data (keep hidden) */
- public double[] coords = new double[3]; /* vertex location in 3D */
- public double s, t; /* projection onto the sweep plane */
- public int pqHandle; /* to allow deletion from priority queue */
-}
diff --git a/android/core/src/processing/opengl/tess/Geom.java b/android/core/src/processing/opengl/tess/Geom.java
deleted file mode 100644
index 3aa5e175da..0000000000
--- a/android/core/src/processing/opengl/tess/Geom.java
+++ /dev/null
@@ -1,340 +0,0 @@
-/*
-* Portions Copyright (C) 2003-2006 Sun Microsystems, Inc.
-* All rights reserved.
-*/
-
-/*
-** License Applicability. Except to the extent portions of this file are
-** made subject to an alternative license as permitted in the SGI Free
-** Software License B, Version 2.0 (the "License"), the contents of this
-** file are subject only to the provisions of the License. You may not use
-** this file except in compliance with the License. You may obtain a copy
-** of the License at Silicon Graphics, Inc., attn: Legal Services, 1600
-** Amphitheatre Parkway, Mountain View, CA 94043-1351, or at:
-**
-** http://oss.sgi.com/projects/FreeB
-**
-** Note that, as provided in the License, the Software is distributed on an
-** "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS
-** DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND
-** CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A
-** PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
-**
-** NOTE: The Original Code (as defined below) has been licensed to Sun
-** Microsystems, Inc. ("Sun") under the SGI Free Software License B
-** (Version 1.1), shown above ("SGI License"). Pursuant to Section
-** 3.2(3) of the SGI License, Sun is distributing the Covered Code to
-** you under an alternative license ("Alternative License"). This
-** Alternative License includes all of the provisions of the SGI License
-** except that Section 2.2 and 11 are omitted. Any differences between
-** the Alternative License and the SGI License are offered solely by Sun
-** and not by SGI.
-**
-** Original Code. The Original Code is: OpenGL Sample Implementation,
-** Version 1.2.1, released January 26, 2000, developed by Silicon Graphics,
-** Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc.
-** Copyright in any portions created by third parties is as indicated
-** elsewhere herein. All Rights Reserved.
-**
-** Additional Notice Provisions: The application programming interfaces
-** established by SGI in conjunction with the Original Code are The
-** OpenGL(R) Graphics System: A Specification (Version 1.2.1), released
-** April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version
-** 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X
-** Window System(R) (Version 1.3), released October 19, 1998. This software
-** was created using the OpenGL(R) version 1.2.1 Sample Implementation
-** published by SGI, but has not been independently verified as being
-** compliant with the OpenGL(R) version 1.2.1 Specification.
-**
-** Author: Eric Veach, July 1994
-** Java Port: Pepijn Van Eeckhoudt, July 2003
-** Java Port: Nathan Parker Burg, August 2003
-** Processing integration: Andres Colubri, February 2012
-*/
-
-package processing.opengl.tess;
-
-class Geom {
- private Geom() {
- }
-
- /* Given three vertices u,v,w such that VertLeq(u,v) && VertLeq(v,w),
- * evaluates the t-coord of the edge uw at the s-coord of the vertex v.
- * Returns v->t - (uw)(v->s), ie. the signed distance from uw to v.
- * If uw is vertical (and thus passes thru v), the result is zero.
- *
- * The calculation is extremely accurate and stable, even when v
- * is very close to u or w. In particular if we set v->t = 0 and
- * let r be the negated result (this evaluates (uw)(v->s)), then
- * r is guaranteed to satisfy MIN(u->t,w->t) <= r <= MAX(u->t,w->t).
- */
- static double EdgeEval(GLUvertex u, GLUvertex v, GLUvertex w) {
- double gapL, gapR;
-
- assert (VertLeq(u, v) && VertLeq(v, w));
-
- gapL = v.s - u.s;
- gapR = w.s - v.s;
-
- if (gapL + gapR > 0) {
- if (gapL < gapR) {
- return (v.t - u.t) + (u.t - w.t) * (gapL / (gapL + gapR));
- } else {
- return (v.t - w.t) + (w.t - u.t) * (gapR / (gapL + gapR));
- }
- }
- /* vertical line */
- return 0;
- }
-
- static double EdgeSign(GLUvertex u, GLUvertex v, GLUvertex w) {
- double gapL, gapR;
-
- assert (VertLeq(u, v) && VertLeq(v, w));
-
- gapL = v.s - u.s;
- gapR = w.s - v.s;
-
- if (gapL + gapR > 0) {
- return (v.t - w.t) * gapL + (v.t - u.t) * gapR;
- }
- /* vertical line */
- return 0;
- }
-
-
- /***********************************************************************
- * Define versions of EdgeSign, EdgeEval with s and t transposed.
- */
-
- static double TransEval(GLUvertex u, GLUvertex v, GLUvertex w) {
- /* Given three vertices u,v,w such that TransLeq(u,v) && TransLeq(v,w),
- * evaluates the t-coord of the edge uw at the s-coord of the vertex v.
- * Returns v->s - (uw)(v->t), ie. the signed distance from uw to v.
- * If uw is vertical (and thus passes thru v), the result is zero.
- *
- * The calculation is extremely accurate and stable, even when v
- * is very close to u or w. In particular if we set v->s = 0 and
- * let r be the negated result (this evaluates (uw)(v->t)), then
- * r is guaranteed to satisfy MIN(u->s,w->s) <= r <= MAX(u->s,w->s).
- */
- double gapL, gapR;
-
- assert (TransLeq(u, v) && TransLeq(v, w));
-
- gapL = v.t - u.t;
- gapR = w.t - v.t;
-
- if (gapL + gapR > 0) {
- if (gapL < gapR) {
- return (v.s - u.s) + (u.s - w.s) * (gapL / (gapL + gapR));
- } else {
- return (v.s - w.s) + (w.s - u.s) * (gapR / (gapL + gapR));
- }
- }
- /* vertical line */
- return 0;
- }
-
- static double TransSign(GLUvertex u, GLUvertex v, GLUvertex w) {
- /* Returns a number whose sign matches TransEval(u,v,w) but which
- * is cheaper to evaluate. Returns > 0, == 0 , or < 0
- * as v is above, on, or below the edge uw.
- */
- double gapL, gapR;
-
- assert (TransLeq(u, v) && TransLeq(v, w));
-
- gapL = v.t - u.t;
- gapR = w.t - v.t;
-
- if (gapL + gapR > 0) {
- return (v.s - w.s) * gapL + (v.s - u.s) * gapR;
- }
- /* vertical line */
- return 0;
- }
-
-
- static boolean VertCCW(GLUvertex u, GLUvertex v, GLUvertex w) {
- /* For almost-degenerate situations, the results are not reliable.
- * Unless the floating-point arithmetic can be performed without
- * rounding errors, *any* implementation will give incorrect results
- * on some degenerate inputs, so the client must have some way to
- * handle this situation.
- */
- return (u.s * (v.t - w.t) + v.s * (w.t - u.t) + w.s * (u.t - v.t)) >= 0;
- }
-
-/* Given parameters a,x,b,y returns the value (b*x+a*y)/(a+b),
- * or (x+y)/2 if a==b==0. It requires that a,b >= 0, and enforces
- * this in the rare case that one argument is slightly negative.
- * The implementation is extremely stable numerically.
- * In particular it guarantees that the result r satisfies
- * MIN(x,y) <= r <= MAX(x,y), and the results are very accurate
- * even when a and b differ greatly in magnitude.
- */
- static double Interpolate(double a, double x, double b, double y) {
- a = (a < 0) ? 0 : a;
- b = (b < 0) ? 0 : b;
- if (a <= b) {
- if (b == 0) {
- return (x + y) / 2.0;
- } else {
- return (x + (y - x) * (a / (a + b)));
- }
- } else {
- return (y + (x - y) * (b / (a + b)));
- }
- }
-
- static void EdgeIntersect(GLUvertex o1, GLUvertex d1,
- GLUvertex o2, GLUvertex d2,
- GLUvertex v)
-/* Given edges (o1,d1) and (o2,d2), compute their point of intersection.
- * The computed point is guaranteed to lie in the intersection of the
- * bounding rectangles defined by each edge.
- */ {
- double z1, z2;
-
- /* This is certainly not the most efficient way to find the intersection
- * of two line segments, but it is very numerically stable.
- *
- * Strategy: find the two middle vertices in the VertLeq ordering,
- * and interpolate the intersection s-value from these. Then repeat
- * using the TransLeq ordering to find the intersection t-value.
- */
-
- if (!VertLeq(o1, d1)) {
- GLUvertex temp = o1;
- o1 = d1;
- d1 = temp;
- }
- if (!VertLeq(o2, d2)) {
- GLUvertex temp = o2;
- o2 = d2;
- d2 = temp;
- }
- if (!VertLeq(o1, o2)) {
- GLUvertex temp = o1;
- o1 = o2;
- o2 = temp;
- temp = d1;
- d1 = d2;
- d2 = temp;
- }
-
- if (!VertLeq(o2, d1)) {
- /* Technically, no intersection -- do our best */
- v.s = (o2.s + d1.s) / 2.0;
- } else if (VertLeq(d1, d2)) {
- /* Interpolate between o2 and d1 */
- z1 = EdgeEval(o1, o2, d1);
- z2 = EdgeEval(o2, d1, d2);
- if (z1 + z2 < 0) {
- z1 = -z1;
- z2 = -z2;
- }
- v.s = Interpolate(z1, o2.s, z2, d1.s);
- } else {
- /* Interpolate between o2 and d2 */
- z1 = EdgeSign(o1, o2, d1);
- z2 = -EdgeSign(o1, d2, d1);
- if (z1 + z2 < 0) {
- z1 = -z1;
- z2 = -z2;
- }
- v.s = Interpolate(z1, o2.s, z2, d2.s);
- }
-
- /* Now repeat the process for t */
-
- if (!TransLeq(o1, d1)) {
- GLUvertex temp = o1;
- o1 = d1;
- d1 = temp;
- }
- if (!TransLeq(o2, d2)) {
- GLUvertex temp = o2;
- o2 = d2;
- d2 = temp;
- }
- if (!TransLeq(o1, o2)) {
- GLUvertex temp = o2;
- o2 = o1;
- o1 = temp;
- temp = d2;
- d2 = d1;
- d1 = temp;
- }
-
- if (!TransLeq(o2, d1)) {
- /* Technically, no intersection -- do our best */
- v.t = (o2.t + d1.t) / 2.0;
- } else if (TransLeq(d1, d2)) {
- /* Interpolate between o2 and d1 */
- z1 = TransEval(o1, o2, d1);
- z2 = TransEval(o2, d1, d2);
- if (z1 + z2 < 0) {
- z1 = -z1;
- z2 = -z2;
- }
- v.t = Interpolate(z1, o2.t, z2, d1.t);
- } else {
- /* Interpolate between o2 and d2 */
- z1 = TransSign(o1, o2, d1);
- z2 = -TransSign(o1, d2, d1);
- if (z1 + z2 < 0) {
- z1 = -z1;
- z2 = -z2;
- }
- v.t = Interpolate(z1, o2.t, z2, d2.t);
- }
- }
-
- static boolean VertEq(GLUvertex u, GLUvertex v) {
- return u.s == v.s && u.t == v.t;
- }
-
- static boolean VertLeq(GLUvertex u, GLUvertex v) {
- return u.s < v.s || (u.s == v.s && u.t <= v.t);
- }
-
-/* Versions of VertLeq, EdgeSign, EdgeEval with s and t transposed. */
-
- static boolean TransLeq(GLUvertex u, GLUvertex v) {
- return u.t < v.t || (u.t == v.t && u.s <= v.s);
- }
-
- static boolean EdgeGoesLeft(GLUhalfEdge e) {
- return VertLeq(e.Sym.Org, e.Org);
- }
-
- static boolean EdgeGoesRight(GLUhalfEdge e) {
- return VertLeq(e.Org, e.Sym.Org);
- }
-
- static double VertL1dist(GLUvertex u, GLUvertex v) {
- return Math.abs(u.s - v.s) + Math.abs(u.t - v.t);
- }
-
- /***********************************************************************/
-
- // Compute the cosine of the angle between the edges between o and
- // v1 and between o and v2
- static double EdgeCos(GLUvertex o, GLUvertex v1, GLUvertex v2) {
- double ov1s = v1.s - o.s;
- double ov1t = v1.t - o.t;
- double ov2s = v2.s - o.s;
- double ov2t = v2.t - o.t;
- double dotp = ov1s * ov2s + ov1t * ov2t;
- double len = Math.sqrt(ov1s * ov1s + ov1t * ov1t) * Math.sqrt(ov2s * ov2s + ov2t * ov2t);
- if (len > 0.0) {
- dotp /= len;
- }
- return dotp;
- }
-
- static final double EPSILON = 1.0e-5;
- static final double ONE_MINUS_EPSILON = 1.0 - EPSILON;
-}
diff --git a/android/core/src/processing/opengl/tess/Mesh.java b/android/core/src/processing/opengl/tess/Mesh.java
deleted file mode 100644
index 29764facee..0000000000
--- a/android/core/src/processing/opengl/tess/Mesh.java
+++ /dev/null
@@ -1,736 +0,0 @@
-/*
-* Portions Copyright (C) 2003-2006 Sun Microsystems, Inc.
-* All rights reserved.
-*/
-
-/*
-** License Applicability. Except to the extent portions of this file are
-** made subject to an alternative license as permitted in the SGI Free
-** Software License B, Version 2.0 (the "License"), the contents of this
-** file are subject only to the provisions of the License. You may not use
-** this file except in compliance with the License. You may obtain a copy
-** of the License at Silicon Graphics, Inc., attn: Legal Services, 1600
-** Amphitheatre Parkway, Mountain View, CA 94043-1351, or at:
-**
-** http://oss.sgi.com/projects/FreeB
-**
-** Note that, as provided in the License, the Software is distributed on an
-** "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS
-** DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND
-** CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A
-** PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
-**
-** NOTE: The Original Code (as defined below) has been licensed to Sun
-** Microsystems, Inc. ("Sun") under the SGI Free Software License B
-** (Version 1.1), shown above ("SGI License"). Pursuant to Section
-** 3.2(3) of the SGI License, Sun is distributing the Covered Code to
-** you under an alternative license ("Alternative License"). This
-** Alternative License includes all of the provisions of the SGI License
-** except that Section 2.2 and 11 are omitted. Any differences between
-** the Alternative License and the SGI License are offered solely by Sun
-** and not by SGI.
-**
-** Original Code. The Original Code is: OpenGL Sample Implementation,
-** Version 1.2.1, released January 26, 2000, developed by Silicon Graphics,
-** Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc.
-** Copyright in any portions created by third parties is as indicated
-** elsewhere herein. All Rights Reserved.
-**
-** Additional Notice Provisions: The application programming interfaces
-** established by SGI in conjunction with the Original Code are The
-** OpenGL(R) Graphics System: A Specification (Version 1.2.1), released
-** April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version
-** 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X
-** Window System(R) (Version 1.3), released October 19, 1998. This software
-** was created using the OpenGL(R) version 1.2.1 Sample Implementation
-** published by SGI, but has not been independently verified as being
-** compliant with the OpenGL(R) version 1.2.1 Specification.
-**
-** Author: Eric Veach, July 1994
-** Java Port: Pepijn Van Eeckhoudt, July 2003
-** Java Port: Nathan Parker Burg, August 2003
-** Processing integration: Andres Colubri, February 2012
-*/
-
-package processing.opengl.tess;
-
-class Mesh {
- private Mesh() {
- }
-
- /************************ Utility Routines ************************/
-/* MakeEdge creates a new pair of half-edges which form their own loop.
- * No vertex or face structures are allocated, but these must be assigned
- * before the current edge operation is completed.
- */
- static GLUhalfEdge MakeEdge(GLUhalfEdge eNext) {
- GLUhalfEdge e;
- GLUhalfEdge eSym;
- GLUhalfEdge ePrev;
-
-// EdgePair * pair = (EdgePair *)
-// memAlloc(sizeof(EdgePair));
-// if (pair == NULL) return NULL;
-//
-// e = &pair - > e;
- e = new GLUhalfEdge(true);
-// eSym = &pair - > eSym;
- eSym = new GLUhalfEdge(false);
-
-
- /* Make sure eNext points to the first edge of the edge pair */
- if (!eNext.first) {
- eNext = eNext.Sym;
- }
-
- /* Insert in circular doubly-linked list before eNext.
- * Note that the prev pointer is stored in Sym->next.
- */
- ePrev = eNext.Sym.next;
- eSym.next = ePrev;
- ePrev.Sym.next = e;
- e.next = eNext;
- eNext.Sym.next = eSym;
-
- e.Sym = eSym;
- e.Onext = e;
- e.Lnext = eSym;
- e.Org = null;
- e.Lface = null;
- e.winding = 0;
- e.activeRegion = null;
-
- eSym.Sym = e;
- eSym.Onext = eSym;
- eSym.Lnext = e;
- eSym.Org = null;
- eSym.Lface = null;
- eSym.winding = 0;
- eSym.activeRegion = null;
-
- return e;
- }
-
-/* Splice( a, b ) is best described by the Guibas/Stolfi paper or the
- * CS348a notes (see mesh.h). Basically it modifies the mesh so that
- * a->Onext and b->Onext are exchanged. This can have various effects
- * depending on whether a and b belong to different face or vertex rings.
- * For more explanation see __gl_meshSplice() below.
- */
- static void Splice(GLUhalfEdge a, GLUhalfEdge b) {
- GLUhalfEdge aOnext = a.Onext;
- GLUhalfEdge bOnext = b.Onext;
-
- aOnext.Sym.Lnext = b;
- bOnext.Sym.Lnext = a;
- a.Onext = bOnext;
- b.Onext = aOnext;
- }
-
-/* MakeVertex( newVertex, eOrig, vNext ) attaches a new vertex and makes it the
- * origin of all edges in the vertex loop to which eOrig belongs. "vNext" gives
- * a place to insert the new vertex in the global vertex list. We insert
- * the new vertex *before* vNext so that algorithms which walk the vertex
- * list will not see the newly created vertices.
- */
- static void MakeVertex(GLUvertex newVertex,
- GLUhalfEdge eOrig, GLUvertex vNext) {
- GLUhalfEdge e;
- GLUvertex vPrev;
- GLUvertex vNew = newVertex;
-
- assert (vNew != null);
-
- /* insert in circular doubly-linked list before vNext */
- vPrev = vNext.prev;
- vNew.prev = vPrev;
- vPrev.next = vNew;
- vNew.next = vNext;
- vNext.prev = vNew;
-
- vNew.anEdge = eOrig;
- vNew.data = null;
- /* leave coords, s, t undefined */
-
- /* fix other edges on this vertex loop */
- e = eOrig;
- do {
- e.Org = vNew;
- e = e.Onext;
- } while (e != eOrig);
- }
-
-/* MakeFace( newFace, eOrig, fNext ) attaches a new face and makes it the left
- * face of all edges in the face loop to which eOrig belongs. "fNext" gives
- * a place to insert the new face in the global face list. We insert
- * the new face *before* fNext so that algorithms which walk the face
- * list will not see the newly created faces.
- */
- static void MakeFace(GLUface newFace, GLUhalfEdge eOrig, GLUface fNext) {
- GLUhalfEdge e;
- GLUface fPrev;
- GLUface fNew = newFace;
-
- assert (fNew != null);
-
- /* insert in circular doubly-linked list before fNext */
- fPrev = fNext.prev;
- fNew.prev = fPrev;
- fPrev.next = fNew;
- fNew.next = fNext;
- fNext.prev = fNew;
-
- fNew.anEdge = eOrig;
- fNew.data = null;
- fNew.trail = null;
- fNew.marked = false;
-
- /* The new face is marked "inside" if the old one was. This is a
- * convenience for the common case where a face has been split in two.
- */
- fNew.inside = fNext.inside;
-
- /* fix other edges on this face loop */
- e = eOrig;
- do {
- e.Lface = fNew;
- e = e.Lnext;
- } while (e != eOrig);
- }
-
-/* KillEdge( eDel ) destroys an edge (the half-edges eDel and eDel->Sym),
- * and removes from the global edge list.
- */
- static void KillEdge(GLUhalfEdge eDel) {
- GLUhalfEdge ePrev, eNext;
-
- /* Half-edges are allocated in pairs, see EdgePair above */
- if (!eDel.first) {
- eDel = eDel.Sym;
- }
-
- /* delete from circular doubly-linked list */
- eNext = eDel.next;
- ePrev = eDel.Sym.next;
- eNext.Sym.next = ePrev;
- ePrev.Sym.next = eNext;
- }
-
-
-/* KillVertex( vDel ) destroys a vertex and removes it from the global
- * vertex list. It updates the vertex loop to point to a given new vertex.
- */
- static void KillVertex(GLUvertex vDel, GLUvertex newOrg) {
- GLUhalfEdge e, eStart = vDel.anEdge;
- GLUvertex vPrev, vNext;
-
- /* change the origin of all affected edges */
- e = eStart;
- do {
- e.Org = newOrg;
- e = e.Onext;
- } while (e != eStart);
-
- /* delete from circular doubly-linked list */
- vPrev = vDel.prev;
- vNext = vDel.next;
- vNext.prev = vPrev;
- vPrev.next = vNext;
- }
-
-/* KillFace( fDel ) destroys a face and removes it from the global face
- * list. It updates the face loop to point to a given new face.
- */
- static void KillFace(GLUface fDel, GLUface newLface) {
- GLUhalfEdge e, eStart = fDel.anEdge;
- GLUface fPrev, fNext;
-
- /* change the left face of all affected edges */
- e = eStart;
- do {
- e.Lface = newLface;
- e = e.Lnext;
- } while (e != eStart);
-
- /* delete from circular doubly-linked list */
- fPrev = fDel.prev;
- fNext = fDel.next;
- fNext.prev = fPrev;
- fPrev.next = fNext;
- }
-
-
- /****************** Basic Edge Operations **********************/
-
-/* __gl_meshMakeEdge creates one edge, two vertices, and a loop (face).
- * The loop consists of the two new half-edges.
- */
- public static GLUhalfEdge __gl_meshMakeEdge(GLUmesh mesh) {
- GLUvertex newVertex1 = new GLUvertex();
- GLUvertex newVertex2 = new GLUvertex();
- GLUface newFace = new GLUface();
- GLUhalfEdge e;
-
- e = MakeEdge(mesh.eHead);
- if (e == null) return null;
-
- MakeVertex(newVertex1, e, mesh.vHead);
- MakeVertex(newVertex2, e.Sym, mesh.vHead);
- MakeFace(newFace, e, mesh.fHead);
- return e;
- }
-
-
-/* __gl_meshSplice( eOrg, eDst ) is the basic operation for changing the
- * mesh connectivity and topology. It changes the mesh so that
- * eOrg->Onext <- OLD( eDst->Onext )
- * eDst->Onext <- OLD( eOrg->Onext )
- * where OLD(...) means the value before the meshSplice operation.
- *
- * This can have two effects on the vertex structure:
- * - if eOrg->Org != eDst->Org, the two vertices are merged together
- * - if eOrg->Org == eDst->Org, the origin is split into two vertices
- * In both cases, eDst->Org is changed and eOrg->Org is untouched.
- *
- * Similarly (and independently) for the face structure,
- * - if eOrg->Lface == eDst->Lface, one loop is split into two
- * - if eOrg->Lface != eDst->Lface, two distinct loops are joined into one
- * In both cases, eDst->Lface is changed and eOrg->Lface is unaffected.
- *
- * Some special cases:
- * If eDst == eOrg, the operation has no effect.
- * If eDst == eOrg->Lnext, the new face will have a single edge.
- * If eDst == eOrg->Lprev, the old face will have a single edge.
- * If eDst == eOrg->Onext, the new vertex will have a single edge.
- * If eDst == eOrg->Oprev, the old vertex will have a single edge.
- */
- public static boolean __gl_meshSplice(GLUhalfEdge eOrg, GLUhalfEdge eDst) {
- boolean joiningLoops = false;
- boolean joiningVertices = false;
-
- if (eOrg == eDst) return true;
-
- if (eDst.Org != eOrg.Org) {
- /* We are merging two disjoint vertices -- destroy eDst->Org */
- joiningVertices = true;
- KillVertex(eDst.Org, eOrg.Org);
- }
- if (eDst.Lface != eOrg.Lface) {
- /* We are connecting two disjoint loops -- destroy eDst.Lface */
- joiningLoops = true;
- KillFace(eDst.Lface, eOrg.Lface);
- }
-
- /* Change the edge structure */
- Splice(eDst, eOrg);
-
- if (!joiningVertices) {
- GLUvertex newVertex = new GLUvertex();
-
- /* We split one vertex into two -- the new vertex is eDst.Org.
- * Make sure the old vertex points to a valid half-edge.
- */
- MakeVertex(newVertex, eDst, eOrg.Org);
- eOrg.Org.anEdge = eOrg;
- }
- if (!joiningLoops) {
- GLUface newFace = new GLUface();
-
- /* We split one loop into two -- the new loop is eDst.Lface.
- * Make sure the old face points to a valid half-edge.
- */
- MakeFace(newFace, eDst, eOrg.Lface);
- eOrg.Lface.anEdge = eOrg;
- }
-
- return true;
- }
-
-
-/* __gl_meshDelete( eDel ) removes the edge eDel. There are several cases:
- * if (eDel.Lface != eDel.Rface), we join two loops into one; the loop
- * eDel.Lface is deleted. Otherwise, we are splitting one loop into two;
- * the newly created loop will contain eDel.Dst. If the deletion of eDel
- * would create isolated vertices, those are deleted as well.
- *
- * This function could be implemented as two calls to __gl_meshSplice
- * plus a few calls to memFree, but this would allocate and delete
- * unnecessary vertices and faces.
- */
- static boolean __gl_meshDelete(GLUhalfEdge eDel) {
- GLUhalfEdge eDelSym = eDel.Sym;
- boolean joiningLoops = false;
-
- /* First step: disconnect the origin vertex eDel.Org. We make all
- * changes to get a consistent mesh in this "intermediate" state.
- */
- if (eDel.Lface != eDel.Sym.Lface) {
- /* We are joining two loops into one -- remove the left face */
- joiningLoops = true;
- KillFace(eDel.Lface, eDel.Sym.Lface);
- }
-
- if (eDel.Onext == eDel) {
- KillVertex(eDel.Org, null);
- } else {
- /* Make sure that eDel.Org and eDel.Sym.Lface point to valid half-edges */
- eDel.Sym.Lface.anEdge = eDel.Sym.Lnext;
- eDel.Org.anEdge = eDel.Onext;
-
- Splice(eDel, eDel.Sym.Lnext);
- if (!joiningLoops) {
- GLUface newFace = new GLUface();
-
- /* We are splitting one loop into two -- create a new loop for eDel. */
- MakeFace(newFace, eDel, eDel.Lface);
- }
- }
-
- /* Claim: the mesh is now in a consistent state, except that eDel.Org
- * may have been deleted. Now we disconnect eDel.Dst.
- */
- if (eDelSym.Onext == eDelSym) {
- KillVertex(eDelSym.Org, null);
- KillFace(eDelSym.Lface, null);
- } else {
- /* Make sure that eDel.Dst and eDel.Lface point to valid half-edges */
- eDel.Lface.anEdge = eDelSym.Sym.Lnext;
- eDelSym.Org.anEdge = eDelSym.Onext;
- Splice(eDelSym, eDelSym.Sym.Lnext);
- }
-
- /* Any isolated vertices or faces have already been freed. */
- KillEdge(eDel);
-
- return true;
- }
-
-
- /******************** Other Edge Operations **********************/
-
-/* All these routines can be implemented with the basic edge
- * operations above. They are provided for convenience and efficiency.
- */
-
-
-/* __gl_meshAddEdgeVertex( eOrg ) creates a new edge eNew such that
- * eNew == eOrg.Lnext, and eNew.Dst is a newly created vertex.
- * eOrg and eNew will have the same left face.
- */
- static GLUhalfEdge __gl_meshAddEdgeVertex(GLUhalfEdge eOrg) {
- GLUhalfEdge eNewSym;
- GLUhalfEdge eNew = MakeEdge(eOrg);
-
- eNewSym = eNew.Sym;
-
- /* Connect the new edge appropriately */
- Splice(eNew, eOrg.Lnext);
-
- /* Set the vertex and face information */
- eNew.Org = eOrg.Sym.Org;
- {
- GLUvertex newVertex = new GLUvertex();
-
- MakeVertex(newVertex, eNewSym, eNew.Org);
- }
- eNew.Lface = eNewSym.Lface = eOrg.Lface;
-
- return eNew;
- }
-
-
-/* __gl_meshSplitEdge( eOrg ) splits eOrg into two edges eOrg and eNew,
- * such that eNew == eOrg.Lnext. The new vertex is eOrg.Sym.Org == eNew.Org.
- * eOrg and eNew will have the same left face.
- */
- public static GLUhalfEdge __gl_meshSplitEdge(GLUhalfEdge eOrg) {
- GLUhalfEdge eNew;
- GLUhalfEdge tempHalfEdge = __gl_meshAddEdgeVertex(eOrg);
-
- eNew = tempHalfEdge.Sym;
-
- /* Disconnect eOrg from eOrg.Sym.Org and connect it to eNew.Org */
- Splice(eOrg.Sym, eOrg.Sym.Sym.Lnext);
- Splice(eOrg.Sym, eNew);
-
- /* Set the vertex and face information */
- eOrg.Sym.Org = eNew.Org;
- eNew.Sym.Org.anEdge = eNew.Sym; /* may have pointed to eOrg.Sym */
- eNew.Sym.Lface = eOrg.Sym.Lface;
- eNew.winding = eOrg.winding; /* copy old winding information */
- eNew.Sym.winding = eOrg.Sym.winding;
-
- return eNew;
- }
-
-
-/* __gl_meshConnect( eOrg, eDst ) creates a new edge from eOrg.Sym.Org
- * to eDst.Org, and returns the corresponding half-edge eNew.
- * If eOrg.Lface == eDst.Lface, this splits one loop into two,
- * and the newly created loop is eNew.Lface. Otherwise, two disjoint
- * loops are merged into one, and the loop eDst.Lface is destroyed.
- *
- * If (eOrg == eDst), the new face will have only two edges.
- * If (eOrg.Lnext == eDst), the old face is reduced to a single edge.
- * If (eOrg.Lnext.Lnext == eDst), the old face is reduced to two edges.
- */
- static GLUhalfEdge __gl_meshConnect(GLUhalfEdge eOrg, GLUhalfEdge eDst) {
- GLUhalfEdge eNewSym;
- boolean joiningLoops = false;
- GLUhalfEdge eNew = MakeEdge(eOrg);
-
- eNewSym = eNew.Sym;
-
- if (eDst.Lface != eOrg.Lface) {
- /* We are connecting two disjoint loops -- destroy eDst.Lface */
- joiningLoops = true;
- KillFace(eDst.Lface, eOrg.Lface);
- }
-
- /* Connect the new edge appropriately */
- Splice(eNew, eOrg.Lnext);
- Splice(eNewSym, eDst);
-
- /* Set the vertex and face information */
- eNew.Org = eOrg.Sym.Org;
- eNewSym.Org = eDst.Org;
- eNew.Lface = eNewSym.Lface = eOrg.Lface;
-
- /* Make sure the old face points to a valid half-edge */
- eOrg.Lface.anEdge = eNewSym;
-
- if (!joiningLoops) {
- GLUface newFace = new GLUface();
-
- /* We split one loop into two -- the new loop is eNew.Lface */
- MakeFace(newFace, eNew, eOrg.Lface);
- }
- return eNew;
- }
-
-
- /******************** Other Operations **********************/
-
-/* __gl_meshZapFace( fZap ) destroys a face and removes it from the
- * global face list. All edges of fZap will have a null pointer as their
- * left face. Any edges which also have a null pointer as their right face
- * are deleted entirely (along with any isolated vertices this produces).
- * An entire mesh can be deleted by zapping its faces, one at a time,
- * in any order. Zapped faces cannot be used in further mesh operations!
- */
- static void __gl_meshZapFace(GLUface fZap) {
- GLUhalfEdge eStart = fZap.anEdge;
- GLUhalfEdge e, eNext, eSym;
- GLUface fPrev, fNext;
-
- /* walk around face, deleting edges whose right face is also null */
- eNext = eStart.Lnext;
- do {
- e = eNext;
- eNext = e.Lnext;
-
- e.Lface = null;
- if (e.Sym.Lface == null) {
- /* delete the edge -- see __gl_MeshDelete above */
-
- if (e.Onext == e) {
- KillVertex(e.Org, null);
- } else {
- /* Make sure that e.Org points to a valid half-edge */
- e.Org.anEdge = e.Onext;
- Splice(e, e.Sym.Lnext);
- }
- eSym = e.Sym;
- if (eSym.Onext == eSym) {
- KillVertex(eSym.Org, null);
- } else {
- /* Make sure that eSym.Org points to a valid half-edge */
- eSym.Org.anEdge = eSym.Onext;
- Splice(eSym, eSym.Sym.Lnext);
- }
- KillEdge(e);
- }
- } while (e != eStart);
-
- /* delete from circular doubly-linked list */
- fPrev = fZap.prev;
- fNext = fZap.next;
- fNext.prev = fPrev;
- fPrev.next = fNext;
- }
-
-
-/* __gl_meshNewMesh() creates a new mesh with no edges, no vertices,
- * and no loops (what we usually call a "face").
- */
- public static GLUmesh __gl_meshNewMesh() {
- GLUvertex v;
- GLUface f;
- GLUhalfEdge e;
- GLUhalfEdge eSym;
- GLUmesh mesh = new GLUmesh();
-
- v = mesh.vHead;
- f = mesh.fHead;
- e = mesh.eHead;
- eSym = mesh.eHeadSym;
-
- v.next = v.prev = v;
- v.anEdge = null;
- v.data = null;
-
- f.next = f.prev = f;
- f.anEdge = null;
- f.data = null;
- f.trail = null;
- f.marked = false;
- f.inside = false;
-
- e.next = e;
- e.Sym = eSym;
- e.Onext = null;
- e.Lnext = null;
- e.Org = null;
- e.Lface = null;
- e.winding = 0;
- e.activeRegion = null;
-
- eSym.next = eSym;
- eSym.Sym = e;
- eSym.Onext = null;
- eSym.Lnext = null;
- eSym.Org = null;
- eSym.Lface = null;
- eSym.winding = 0;
- eSym.activeRegion = null;
-
- return mesh;
- }
-
-
-/* __gl_meshUnion( mesh1, mesh2 ) forms the union of all structures in
- * both meshes, and returns the new mesh (the old meshes are destroyed).
- */
- static GLUmesh __gl_meshUnion(GLUmesh mesh1, GLUmesh mesh2) {
- GLUface f1 = mesh1.fHead;
- GLUvertex v1 = mesh1.vHead;
- GLUhalfEdge e1 = mesh1.eHead;
- GLUface f2 = mesh2.fHead;
- GLUvertex v2 = mesh2.vHead;
- GLUhalfEdge e2 = mesh2.eHead;
-
- /* Add the faces, vertices, and edges of mesh2 to those of mesh1 */
- if (f2.next != f2) {
- f1.prev.next = f2.next;
- f2.next.prev = f1.prev;
- f2.prev.next = f1;
- f1.prev = f2.prev;
- }
-
- if (v2.next != v2) {
- v1.prev.next = v2.next;
- v2.next.prev = v1.prev;
- v2.prev.next = v1;
- v1.prev = v2.prev;
- }
-
- if (e2.next != e2) {
- e1.Sym.next.Sym.next = e2.next;
- e2.next.Sym.next = e1.Sym.next;
- e2.Sym.next.Sym.next = e1;
- e1.Sym.next = e2.Sym.next;
- }
-
- return mesh1;
- }
-
-
-/* __gl_meshDeleteMesh( mesh ) will free all storage for any valid mesh.
- */
- static void __gl_meshDeleteMeshZap(GLUmesh mesh) {
- GLUface fHead = mesh.fHead;
-
- while (fHead.next != fHead) {
- __gl_meshZapFace(fHead.next);
- }
- assert (mesh.vHead.next == mesh.vHead);
- }
-
-/* __gl_meshDeleteMesh( mesh ) will free all storage for any valid mesh.
- */
- public static void __gl_meshDeleteMesh(GLUmesh mesh) {
- GLUface f, fNext;
- GLUvertex v, vNext;
- GLUhalfEdge e, eNext;
-
- for (f = mesh.fHead.next; f != mesh.fHead; f = fNext) {
- fNext = f.next;
- }
-
- for (v = mesh.vHead.next; v != mesh.vHead; v = vNext) {
- vNext = v.next;
- }
-
- for (e = mesh.eHead.next; e != mesh.eHead; e = eNext) {
- /* One call frees both e and e.Sym (see EdgePair above) */
- eNext = e.next;
- }
- }
-
-/* __gl_meshCheckMesh( mesh ) checks a mesh for self-consistency.
- */
- public static void __gl_meshCheckMesh(GLUmesh mesh) {
- GLUface fHead = mesh.fHead;
- GLUvertex vHead = mesh.vHead;
- GLUhalfEdge eHead = mesh.eHead;
- GLUface f, fPrev;
- GLUvertex v, vPrev;
- GLUhalfEdge e, ePrev;
-
- fPrev = fHead;
- for (fPrev = fHead; (f = fPrev.next) != fHead; fPrev = f) {
- assert (f.prev == fPrev);
- e = f.anEdge;
- do {
- assert (e.Sym != e);
- assert (e.Sym.Sym == e);
- assert (e.Lnext.Onext.Sym == e);
- assert (e.Onext.Sym.Lnext == e);
- assert (e.Lface == f);
- e = e.Lnext;
- } while (e != f.anEdge);
- }
- assert (f.prev == fPrev && f.anEdge == null && f.data == null);
-
- vPrev = vHead;
- for (vPrev = vHead; (v = vPrev.next) != vHead; vPrev = v) {
- assert (v.prev == vPrev);
- e = v.anEdge;
- do {
- assert (e.Sym != e);
- assert (e.Sym.Sym == e);
- assert (e.Lnext.Onext.Sym == e);
- assert (e.Onext.Sym.Lnext == e);
- assert (e.Org == v);
- e = e.Onext;
- } while (e != v.anEdge);
- }
- assert (v.prev == vPrev && v.anEdge == null && v.data == null);
-
- ePrev = eHead;
- for (ePrev = eHead; (e = ePrev.next) != eHead; ePrev = e) {
- assert (e.Sym.next == ePrev.Sym);
- assert (e.Sym != e);
- assert (e.Sym.Sym == e);
- assert (e.Org != null);
- assert (e.Sym.Org != null);
- assert (e.Lnext.Onext.Sym == e);
- assert (e.Onext.Sym.Lnext == e);
- }
- assert (e.Sym.next == ePrev.Sym
- && e.Sym == mesh.eHeadSym
- && e.Sym.Sym == e
- && e.Org == null && e.Sym.Org == null
- && e.Lface == null && e.Sym.Lface == null);
- }
-}
diff --git a/android/core/src/processing/opengl/tess/Normal.java b/android/core/src/processing/opengl/tess/Normal.java
deleted file mode 100644
index dbee9966d6..0000000000
--- a/android/core/src/processing/opengl/tess/Normal.java
+++ /dev/null
@@ -1,288 +0,0 @@
-/*
-* Portions Copyright (C) 2003-2006 Sun Microsystems, Inc.
-* All rights reserved.
-*/
-
-/*
-** License Applicability. Except to the extent portions of this file are
-** made subject to an alternative license as permitted in the SGI Free
-** Software License B, Version 2.0 (the "License"), the contents of this
-** file are subject only to the provisions of the License. You may not use
-** this file except in compliance with the License. You may obtain a copy
-** of the License at Silicon Graphics, Inc., attn: Legal Services, 1600
-** Amphitheatre Parkway, Mountain View, CA 94043-1351, or at:
-**
-** http://oss.sgi.com/projects/FreeB
-**
-** Note that, as provided in the License, the Software is distributed on an
-** "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS
-** DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND
-** CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A
-** PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
-**
-** NOTE: The Original Code (as defined below) has been licensed to Sun
-** Microsystems, Inc. ("Sun") under the SGI Free Software License B
-** (Version 1.1), shown above ("SGI License"). Pursuant to Section
-** 3.2(3) of the SGI License, Sun is distributing the Covered Code to
-** you under an alternative license ("Alternative License"). This
-** Alternative License includes all of the provisions of the SGI License
-** except that Section 2.2 and 11 are omitted. Any differences between
-** the Alternative License and the SGI License are offered solely by Sun
-** and not by SGI.
-**
-** Original Code. The Original Code is: OpenGL Sample Implementation,
-** Version 1.2.1, released January 26, 2000, developed by Silicon Graphics,
-** Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc.
-** Copyright in any portions created by third parties is as indicated
-** elsewhere herein. All Rights Reserved.
-**
-** Additional Notice Provisions: The application programming interfaces
-** established by SGI in conjunction with the Original Code are The
-** OpenGL(R) Graphics System: A Specification (Version 1.2.1), released
-** April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version
-** 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X
-** Window System(R) (Version 1.3), released October 19, 1998. This software
-** was created using the OpenGL(R) version 1.2.1 Sample Implementation
-** published by SGI, but has not been independently verified as being
-** compliant with the OpenGL(R) version 1.2.1 Specification.
-**
-** Author: Eric Veach, July 1994
-** Java Port: Pepijn Van Eeckhoudt, July 2003
-** Java Port: Nathan Parker Burg, August 2003
-** Processing integration: Andres Colubri, February 2012
-*/
-
-package processing.opengl.tess;
-
-
-class Normal {
- private Normal() {
- }
-
- static boolean SLANTED_SWEEP = false;
- static double S_UNIT_X; /* Pre-normalized */
- static double S_UNIT_Y;
- private static final boolean TRUE_PROJECT = false;
-
- static {
- if (SLANTED_SWEEP) {
-/* The "feature merging" is not intended to be complete. There are
- * special cases where edges are nearly parallel to the sweep line
- * which are not implemented. The algorithm should still behave
- * robustly (ie. produce a reasonable tesselation) in the presence
- * of such edges, however it may miss features which could have been
- * merged. We could minimize this effect by choosing the sweep line
- * direction to be something unusual (ie. not parallel to one of the
- * coordinate axes).
- */
- S_UNIT_X = 0.50941539564955385; /* Pre-normalized */
- S_UNIT_Y = 0.86052074622010633;
- } else {
- S_UNIT_X = 1.0;
- S_UNIT_Y = 0.0;
- }
- }
-
- private static double Dot(double[] u, double[] v) {
- return (u[0] * v[0] + u[1] * v[1] + u[2] * v[2]);
- }
-
- static void Normalize(double[] v) {
- double len = v[0] * v[0] + v[1] * v[1] + v[2] * v[2];
-
- assert (len > 0);
- len = Math.sqrt(len);
- v[0] /= len;
- v[1] /= len;
- v[2] /= len;
- }
-
- static int LongAxis(double[] v) {
- int i = 0;
-
- if (Math.abs(v[1]) > Math.abs(v[0])) {
- i = 1;
- }
- if (Math.abs(v[2]) > Math.abs(v[i])) {
- i = 2;
- }
- return i;
- }
-
- static void ComputeNormal(GLUtessellatorImpl tess, double[] norm) {
- GLUvertex v, v1, v2;
- double c, tLen2, maxLen2;
- double[] maxVal, minVal, d1, d2, tNorm;
- GLUvertex[] maxVert, minVert;
- GLUvertex vHead = tess.mesh.vHead;
- int i;
-
- maxVal = new double[3];
- minVal = new double[3];
- minVert = new GLUvertex[3];
- maxVert = new GLUvertex[3];
- d1 = new double[3];
- d2 = new double[3];
- tNorm = new double[3];
-
- maxVal[0] = maxVal[1] = maxVal[2] = -2 * PGLU.GLU_TESS_MAX_COORD;
- minVal[0] = minVal[1] = minVal[2] = 2 * PGLU.GLU_TESS_MAX_COORD;
-
- for (v = vHead.next; v != vHead; v = v.next) {
- for (i = 0; i < 3; ++i) {
- c = v.coords[i];
- if (c < minVal[i]) {
- minVal[i] = c;
- minVert[i] = v;
- }
- if (c > maxVal[i]) {
- maxVal[i] = c;
- maxVert[i] = v;
- }
- }
- }
-
-/* Find two vertices separated by at least 1/sqrt(3) of the maximum
- * distance between any two vertices
- */
- i = 0;
- if (maxVal[1] - minVal[1] > maxVal[0] - minVal[0]) {
- i = 1;
- }
- if (maxVal[2] - minVal[2] > maxVal[i] - minVal[i]) {
- i = 2;
- }
- if (minVal[i] >= maxVal[i]) {
-/* All vertices are the same -- normal doesn't matter */
- norm[0] = 0;
- norm[1] = 0;
- norm[2] = 1;
- return;
- }
-
-/* Look for a third vertex which forms the triangle with maximum area
- * (Length of normal == twice the triangle area)
- */
- maxLen2 = 0;
- v1 = minVert[i];
- v2 = maxVert[i];
- d1[0] = v1.coords[0] - v2.coords[0];
- d1[1] = v1.coords[1] - v2.coords[1];
- d1[2] = v1.coords[2] - v2.coords[2];
- for (v = vHead.next; v != vHead; v = v.next) {
- d2[0] = v.coords[0] - v2.coords[0];
- d2[1] = v.coords[1] - v2.coords[1];
- d2[2] = v.coords[2] - v2.coords[2];
- tNorm[0] = d1[1] * d2[2] - d1[2] * d2[1];
- tNorm[1] = d1[2] * d2[0] - d1[0] * d2[2];
- tNorm[2] = d1[0] * d2[1] - d1[1] * d2[0];
- tLen2 = tNorm[0] * tNorm[0] + tNorm[1] * tNorm[1] + tNorm[2] * tNorm[2];
- if (tLen2 > maxLen2) {
- maxLen2 = tLen2;
- norm[0] = tNorm[0];
- norm[1] = tNorm[1];
- norm[2] = tNorm[2];
- }
- }
-
- if (maxLen2 <= 0) {
-/* All points lie on a single line -- any decent normal will do */
- norm[0] = norm[1] = norm[2] = 0;
- norm[LongAxis(d1)] = 1;
- }
- }
-
- static void CheckOrientation(GLUtessellatorImpl tess) {
- double area;
- GLUface f, fHead = tess.mesh.fHead;
- GLUvertex v, vHead = tess.mesh.vHead;
- GLUhalfEdge e;
-
-/* When we compute the normal automatically, we choose the orientation
- * so that the the sum of the signed areas of all contours is non-negative.
- */
- area = 0;
- for (f = fHead.next; f != fHead; f = f.next) {
- e = f.anEdge;
- if (e.winding <= 0) continue;
- do {
- area += (e.Org.s - e.Sym.Org.s) * (e.Org.t + e.Sym.Org.t);
- e = e.Lnext;
- } while (e != f.anEdge);
- }
- if (area < 0) {
-/* Reverse the orientation by flipping all the t-coordinates */
- for (v = vHead.next; v != vHead; v = v.next) {
- v.t = -v.t;
- }
- tess.tUnit[0] = -tess.tUnit[0];
- tess.tUnit[1] = -tess.tUnit[1];
- tess.tUnit[2] = -tess.tUnit[2];
- }
- }
-
-/* Determine the polygon normal and project vertices onto the plane
- * of the polygon.
- */
- public static void __gl_projectPolygon(GLUtessellatorImpl tess) {
- GLUvertex v, vHead = tess.mesh.vHead;
- double w;
- double[] norm = new double[3];
- double[] sUnit, tUnit;
- int i;
- boolean computedNormal = false;
-
- norm[0] = tess.normal[0];
- norm[1] = tess.normal[1];
- norm[2] = tess.normal[2];
- if (norm[0] == 0 && norm[1] == 0 && norm[2] == 0) {
- ComputeNormal(tess, norm);
- computedNormal = true;
- }
- sUnit = tess.sUnit;
- tUnit = tess.tUnit;
- i = LongAxis(norm);
-
- if (TRUE_PROJECT) {
-/* Choose the initial sUnit vector to be approximately perpendicular
- * to the normal.
- */
- Normalize(norm);
-
- sUnit[i] = 0;
- sUnit[(i + 1) % 3] = S_UNIT_X;
- sUnit[(i + 2) % 3] = S_UNIT_Y;
-
-/* Now make it exactly perpendicular */
- w = Dot(sUnit, norm);
- sUnit[0] -= w * norm[0];
- sUnit[1] -= w * norm[1];
- sUnit[2] -= w * norm[2];
- Normalize(sUnit);
-
-/* Choose tUnit so that (sUnit,tUnit,norm) form a right-handed frame */
- tUnit[0] = norm[1] * sUnit[2] - norm[2] * sUnit[1];
- tUnit[1] = norm[2] * sUnit[0] - norm[0] * sUnit[2];
- tUnit[2] = norm[0] * sUnit[1] - norm[1] * sUnit[0];
- Normalize(tUnit);
- } else {
-/* Project perpendicular to a coordinate axis -- better numerically */
- sUnit[i] = 0;
- sUnit[(i + 1) % 3] = S_UNIT_X;
- sUnit[(i + 2) % 3] = S_UNIT_Y;
-
- tUnit[i] = 0;
- tUnit[(i + 1) % 3] = (norm[i] > 0) ? -S_UNIT_Y : S_UNIT_Y;
- tUnit[(i + 2) % 3] = (norm[i] > 0) ? S_UNIT_X : -S_UNIT_X;
- }
-
-/* Project the vertices onto the sweep plane */
- for (v = vHead.next; v != vHead; v = v.next) {
- v.s = Dot(v.coords, sUnit);
- v.t = Dot(v.coords, tUnit);
- }
- if (computedNormal) {
- CheckOrientation(tess);
- }
- }
-}
diff --git a/android/core/src/processing/opengl/tess/PGLU.java b/android/core/src/processing/opengl/tess/PGLU.java
deleted file mode 100644
index a4d6eaf76c..0000000000
--- a/android/core/src/processing/opengl/tess/PGLU.java
+++ /dev/null
@@ -1,158 +0,0 @@
-package processing.opengl.tess;
-
-import android.opengl.GLES20;
-
-public class PGLU {
- public static final int GLU_FALSE = 0;
- public static final int GLU_TRUE = 1;
-
- public static final int GLU_INVALID_ENUM = 100900;
- public static final int GLU_INVALID_VALUE = 100901;
- public static final int GLU_OUT_OF_MEMORY = 100902;
- public static final int GLU_INVALID_OPERATION = 100904;
-
- public static final int GLU_POINT = 100010;
- public static final int GLU_LINE = 100011;
- public static final int GLU_FILL = 100012;
- public static final int GLU_SILHOUETTE = 100013;
-
- public static final int GLU_SMOOTH = 100000;
- public static final int GLU_FLAT = 100001;
- public static final int GLU_NONE = 100002;
-
- public static final int GLU_OUTSIDE = 100020;
- public static final int GLU_INSIDE = 100021;
-
- public static final int GLU_ERROR = 100103;
- public static final int GLU_TESS_ERROR = 100103;
-
- public static final int GLU_TESS_BEGIN = 100100;
- public static final int GLU_BEGIN = 100100;
- public static final int GLU_TESS_VERTEX = 100101;
- public static final int GLU_VERTEX = 100101;
- public static final int GLU_TESS_END = 100102;
- public static final int GLU_END = 100102;
-
- public static final int GLU_TESS_EDGE_FLAG = 100104;
- public static final int GLU_EDGE_FLAG = 100104;
- public static final int GLU_TESS_COMBINE = 100105;
- public static final int GLU_TESS_BEGIN_DATA = 100106;
- public static final int GLU_TESS_VERTEX_DATA = 100107;
- public static final int GLU_TESS_END_DATA = 100108;
- public static final int GLU_TESS_ERROR_DATA = 100109;
- public static final int GLU_TESS_EDGE_FLAG_DATA = 100110;
- public static final int GLU_TESS_COMBINE_DATA = 100111;
-
- public static final int GLU_CW = 100120;
- public static final int GLU_CCW = 100121;
- public static final int GLU_INTERIOR = 100122;
- public static final int GLU_EXTERIOR = 100123;
- public static final int GLU_UNKNOWN = 100124;
- public static final int GLU_TESS_WINDING_RULE = 100140;
- public static final int GLU_TESS_BOUNDARY_ONLY = 100141;
- public static final int GLU_TESS_TOLERANCE = 100142;
- public static final int GLU_TESS_AVOID_DEGENERATE_TRIANGLES = 100149;
-
- public static final int GLU_TESS_ERROR1 = 100151;
- public static final int GLU_TESS_ERROR2 = 100152;
- public static final int GLU_TESS_ERROR3 = 100153;
- public static final int GLU_TESS_ERROR4 = 100154;
- public static final int GLU_TESS_ERROR5 = 100155;
- public static final int GLU_TESS_ERROR6 = 100156;
- public static final int GLU_TESS_ERROR7 = 100157;
- public static final int GLU_TESS_ERROR8 = 100158;
-
- public static final int GLU_TESS_MISSING_BEGIN_POLYGON = 100151;
- public static final int GLU_TESS_MISSING_BEGIN_CONTOUR = 100152;
- public static final int GLU_TESS_MISSING_END_POLYGON = 100153;
- public static final int GLU_TESS_MISSING_END_CONTOUR = 100154;
- public static final int GLU_TESS_COORD_TOO_LARGE = 100155;
- public static final int GLU_TESS_NEED_COMBINE_CALLBACK = 100156;
-
- public static final int GLU_TESS_WINDING_ODD = 100130;
- public static final int GLU_TESS_WINDING_NONZERO = 100131;
- public static final int GLU_TESS_WINDING_POSITIVE = 100132;
- public static final int GLU_TESS_WINDING_NEGATIVE = 100133;
- public static final int GLU_TESS_WINDING_ABS_GEQ_TWO = 100134;
-
- public static final double GLU_TESS_MAX_COORD = 1.0E150;
-
- private static String[] glErrorStrings = {
- "invalid enumerant",
- "invalid value",
- "invalid operation",
- "stack overflow",
- "stack underflow",
- "out of memory",
- "invalid framebuffer operation"
- };
-
- private static String[] gluErrorStrings = {
- "invalid enumerant",
- "invalid value",
- "out of memory",
- "",
- "invalid operation"
- };
-
- private static String[] gluTessErrors = {
- " ",
- "gluTessBeginPolygon() must precede a gluTessEndPolygon",
- "gluTessBeginContour() must precede a gluTessEndContour()",
- "gluTessEndPolygon() must follow a gluTessBeginPolygon()",
- "gluTessEndContour() must follow a gluTessBeginContour()",
- "a coordinate is too large",
- "need combine callback"
- };
-
- public static final PGLUtessellator gluNewTess() {
- return GLUtessellatorImpl.gluNewTess();
- }
-
- public static final void gluTessCallback(PGLUtessellator tess, int which, PGLUtessellatorCallback callback) {
- ((GLUtessellatorImpl)tess).gluTessCallback(which, callback);
- }
-
- public static final void gluTessBeginPolygon(PGLUtessellator tess, Object data) {
- ((GLUtessellatorImpl)tess).gluTessBeginPolygon(data);
- }
-
- public static final void gluTessEndPolygon(PGLUtessellator tess) {
- ((GLUtessellatorImpl)tess).gluTessEndPolygon();
- }
-
- public static final void gluTessProperty(PGLUtessellator tess, int which, double value) {
- ((GLUtessellatorImpl)tess).gluTessProperty(which, value);
- }
-
- public static final void gluTessBeginContour(PGLUtessellator tess) {
- ((GLUtessellatorImpl)tess).gluTessBeginContour();
- }
-
- public static final void gluTessEndContour(PGLUtessellator tess) {
- ((GLUtessellatorImpl)tess).gluTessEndContour();
- }
-
- public static final void gluTessVertex(PGLUtessellator tess, double[] coords, int offset, Object vdata) {
- ((GLUtessellatorImpl)tess).gluTessVertex(coords, offset, vdata);
- }
-
- public static String gluErrorString( int errorCode ) {
- if( errorCode == 0 ) {
- return ("no error");
- }
- if( (errorCode >= GLES20.GL_INVALID_ENUM) && (errorCode <= GLES20.GL_INVALID_FRAMEBUFFER_OPERATION) ) {
- return (glErrorStrings[errorCode - GLES20.GL_INVALID_ENUM]);
- }
- if( errorCode == 0x8031 /* GL.GL_TABLE_TOO_LARGE */ ) {
- return ("table too large");
- }
- if( (errorCode >= GLU_INVALID_ENUM) && (errorCode <= GLU_INVALID_OPERATION) ) {
- return (gluErrorStrings[errorCode - GLU_INVALID_ENUM]);
- }
- if( (errorCode >= GLU_TESS_ERROR1) && (errorCode <= GLU_TESS_ERROR8) ) {
- return (gluTessErrors[errorCode - (GLU_TESS_ERROR1 - 1)]);
- }
- return ("error ("+errorCode+")");
- }
-}
diff --git a/android/core/src/processing/opengl/tess/PGLUtessellator.java b/android/core/src/processing/opengl/tess/PGLUtessellator.java
deleted file mode 100644
index c54dc8f921..0000000000
--- a/android/core/src/processing/opengl/tess/PGLUtessellator.java
+++ /dev/null
@@ -1,70 +0,0 @@
-/*
-* Portions Copyright (C) 2003-2006 Sun Microsystems, Inc.
-
-* All rights reserved.
-*/
-
-/*
-** License Applicability. Except to the extent portions of this file are
-** made subject to an alternative license as permitted in the SGI Free
-** Software License B, Version 2.0 (the "License"), the contents of this
-** file are subject only to the provisions of the License. You may not use
-** this file except in compliance with the License. You may obtain a copy
-** of the License at Silicon Graphics, Inc., attn: Legal Services, 1600
-** Amphitheatre Parkway, Mountain View, CA 94043-1351, or at:
-**
-** http://oss.sgi.com/projects/FreeB
-**
-** Note that, as provided in the License, the Software is distributed on an
-** "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS
-** DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND
-** CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A
-** PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
-**
-** NOTE: The Original Code (as defined below) has been licensed to Sun
-** Microsystems, Inc. ("Sun") under the SGI Free Software License B
-** (Version 1.1), shown above ("SGI License"). Pursuant to Section
-** 3.2(3) of the SGI License, Sun is distributing the Covered Code to
-** you under an alternative license ("Alternative License"). This
-** Alternative License includes all of the provisions of the SGI License
-** except that Section 2.2 and 11 are omitted. Any differences between
-** the Alternative License and the SGI License are offered solely by Sun
-** and not by SGI.
-**
-** Original Code. The Original Code is: OpenGL Sample Implementation,
-** Version 1.2.1, released January 26, 2000, developed by Silicon Graphics,
-** Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc.
-** Copyright in any portions created by third parties is as indicated
-** elsewhere herein. All Rights Reserved.
-**
-** Additional Notice Provisions: The application programming interfaces
-** established by SGI in conjunction with the Original Code are The
-** OpenGL(R) Graphics System: A Specification (Version 1.2.1), released
-** April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version
-** 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X
-** Window System(R) (Version 1.3), released October 19, 1998. This software
-** was created using the OpenGL(R) version 1.2.1 Sample Implementation
-** published by SGI, but has not been independently verified as being
-** compliant with the OpenGL(R) version 1.2.1 Specification.
-**
-** Author: Eric Veach, July 1994
-** Java Port: Pepijn Van Eeckhoudt, July 2003
-** Java Port: Nathan Parker Burg, August 2003
-** Processing integration: Andres Colubri, February 2012
-*/
-
-package processing.opengl.tess;
-
-/**
- * The GLUtessellator object is used to hold the data, such as the
- * vertices, edges and callback objects, to describe and tessellate complex
- * polygons. A GLUtessellator object is used with the
- * {@link PGLU GLU} tessellator methods and
- * {@link PGLUtessellatorCallback GLU callbacks}.
- *
- * @author Eric Veach, July 1994
- * @author Java Port: Pepijn Van Eechhoudt, July 2003
- * @author Java Port: Nathan Parker Burg, August 2003
- * @author Processing integration: Andres Colubri, February 2012
- */
-public interface PGLUtessellator {}
diff --git a/android/core/src/processing/opengl/tess/PGLUtessellatorCallback.java b/android/core/src/processing/opengl/tess/PGLUtessellatorCallback.java
deleted file mode 100644
index f047b0764a..0000000000
--- a/android/core/src/processing/opengl/tess/PGLUtessellatorCallback.java
+++ /dev/null
@@ -1,359 +0,0 @@
-/*
-* Portions Copyright (C) 2003-2006 Sun Microsystems, Inc.
-* All rights reserved.
-*/
-
-/*
-** License Applicability. Except to the extent portions of this file are
-** made subject to an alternative license as permitted in the SGI Free
-** Software License B, Version 2.0 (the "License"), the contents of this
-** file are subject only to the provisions of the License. You may not use
-** this file except in compliance with the License. You may obtain a copy
-** of the License at Silicon Graphics, Inc., attn: Legal Services, 1600
-** Amphitheatre Parkway, Mountain View, CA 94043-1351, or at:
-**
-** http://oss.sgi.com/projects/FreeB
-**
-** Note that, as provided in the License, the Software is distributed on an
-** "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS
-** DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND
-** CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A
-** PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
-**
-** NOTE: The Original Code (as defined below) has been licensed to Sun
-** Microsystems, Inc. ("Sun") under the SGI Free Software License B
-** (Version 1.1), shown above ("SGI License"). Pursuant to Section
-** 3.2(3) of the SGI License, Sun is distributing the Covered Code to
-** you under an alternative license ("Alternative License"). This
-** Alternative License includes all of the provisions of the SGI License
-** except that Section 2.2 and 11 are omitted. Any differences between
-** the Alternative License and the SGI License are offered solely by Sun
-** and not by SGI.
-**
-** Original Code. The Original Code is: OpenGL Sample Implementation,
-** Version 1.2.1, released January 26, 2000, developed by Silicon Graphics,
-** Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc.
-** Copyright in any portions created by third parties is as indicated
-** elsewhere herein. All Rights Reserved.
-**
-** Additional Notice Provisions: The application programming interfaces
-** established by SGI in conjunction with the Original Code are The
-** OpenGL(R) Graphics System: A Specification (Version 1.2.1), released
-** April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version
-** 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X
-** Window System(R) (Version 1.3), released October 19, 1998. This software
-** was created using the OpenGL(R) version 1.2.1 Sample Implementation
-** published by SGI, but has not been independently verified as being
-** compliant with the OpenGL(R) version 1.2.1 Specification.
-**
-** Author: Eric Veach, July 1994
-** Java Port: Pepijn Van Eeckhoudt, July 2003
-** Java Port: Nathan Parker Burg, August 2003
-** Processing integration: Andres Colubri, February 2012
-*/
-package processing.opengl.tess;
-
-/**
- * GLUtessellatorCallback interface provides methods that the user will
- * override to define the callbacks for a tessellation object.
- *
- * @author Eric Veach, July 1994
- * @author Java Port: Pepijn Van Eeckhoudt, July 2003
- * @author Java Port: Nathan Parker Burg, August 2003
- * @author Processing integration: Andres Colubri, February 2012
- */
-
-public interface PGLUtessellatorCallback {
- /**
- * The begin callback method is invoked like
- * {@link javax.media.opengl.GL#glBegin glBegin} to indicate the start of a
- * (triangle) primitive. The method takes a single argument of type int. If
- * the GLU_TESS_BOUNDARY_ONLY property is set to GL_FALSE , then
- * the argument is set to either GL_TRIANGLE_FAN ,
- * GL_TRIANGLE_STRIP , or GL_TRIANGLES . If the
- * GLU_TESS_BOUNDARY_ONLY property is set to GL_TRUE , then the
- * argument will be set to GL_LINE_LOOP .
- *
- * @param type
- * Specifics the type of begin/end pair being defined. The following
- * values are valid: GL_TRIANGLE_FAN , GL_TRIANGLE_STRIP ,
- * GL_TRIANGLES or GL_LINE_LOOP .
- *
- * @see PGLU#gluTessCallback gluTessCallback
- * @see #end end
- * @see #begin begin
- */
- public void begin(int type);
-
- /**
- * The same as the {@link #begin begin} callback method except that
- * it takes an additional reference argument. This reference is
- * identical to the opaque reference provided when {@link
- * PGLU#gluTessBeginPolygon gluTessBeginPolygon} was called.
- *
- * @param type
- * Specifics the type of begin/end pair being defined. The following
- * values are valid: GL_TRIANGLE_FAN , GL_TRIANGLE_STRIP ,
- * GL_TRIANGLES or GL_LINE_LOOP .
- * @param polygonData
- * Specifics a reference to user-defined data.
- *
- * @see PGLU#gluTessCallback gluTessCallback
- * @see #endData endData
- * @see #begin begin
- */
- public void beginData(int type, Object polygonData);
-
-
- /**
- * The edgeFlag callback method is similar to
- * {@link javax.media.opengl.GL#glEdgeFlag glEdgeFlag}. The method takes
- * a single boolean boundaryEdge that indicates which edges lie on the
- * polygon boundary. If the boundaryEdge is GL_TRUE , then each vertex
- * that follows begins an edge that lies on the polygon boundary, that is,
- * an edge that separates an interior region from an exterior one. If the
- * boundaryEdge is GL_FALSE , then each vertex that follows begins an
- * edge that lies in the polygon interior. The edge flag callback (if
- * defined) is invoked before the first vertex callback.
- *
- * Since triangle fans and triangle strips do not support edge flags, the
- * begin callback is not called with GL_TRIANGLE_FAN or
- * GL_TRIANGLE_STRIP if a non-null edge flag callback is provided.
- * (If the callback is initialized to null, there is no impact on
- * performance). Instead, the fans and strips are converted to independent
- * triangles.
- *
- * @param boundaryEdge
- * Specifics which edges lie on the polygon boundary.
- *
- * @see PGLU#gluTessCallback gluTessCallback
- * @see #edgeFlagData edgeFlagData
- */
- public void edgeFlag(boolean boundaryEdge);
-
-
- /**
- * The same as the {@link #edgeFlag edgeFlage} callback method
- * except that it takes an additional reference argument. This
- * reference is identical to the opaque reference provided when
- * {@link PGLU#gluTessBeginPolygon gluTessBeginPolygon} was called.
- *
- * @param boundaryEdge
- * Specifics which edges lie on the polygon boundary.
- * @param polygonData
- * Specifics a reference to user-defined data.
- *
- * @see PGLU#gluTessCallback gluTessCallback
- * @see #edgeFlag edgeFlag
- */
- public void edgeFlagData(boolean boundaryEdge, Object polygonData);
-
-
- /**
- * The vertex callback method is invoked between the {@link
- * #begin begin} and {@link #end end} callback methods. It is
- * similar to {@link javax.media.opengl.GL#glVertex3f glVertex3f},
- * and it defines the vertices of the triangles created by the
- * tessellation process. The method takes a reference as its only
- * argument. This reference is identical to the opaque reference
- * provided by the user when the vertex was described (see {@link
- * PGLU#gluTessVertex gluTessVertex}).
- *
- * @param vertexData
- * Specifics a reference to the vertices of the triangles created
- * by the tessellation process.
- *
- * @see PGLU#gluTessCallback gluTessCallback
- * @see #vertexData vertexData
- */
- public void vertex(Object vertexData);
-
-
- /**
- * The same as the {@link #vertex vertex} callback method except
- * that it takes an additional reference argument. This reference is
- * identical to the opaque reference provided when {@link
- * PGLU#gluTessBeginPolygon gluTessBeginPolygon} was called.
- *
- * @param vertexData
- * Specifics a reference to the vertices of the triangles created
- * by the tessellation process.
- * @param polygonData
- * Specifics a reference to user-defined data.
- *
- * @see PGLU#gluTessCallback gluTessCallback
- * @see #vertex vertex
- */
- public void vertexData(Object vertexData, Object polygonData);
-
-
- /**
- * The end callback serves the same purpose as
- * {@link javax.media.opengl.GL#glEnd glEnd}. It indicates the end of a
- * primitive and it takes no arguments.
- *
- * @see PGLU#gluTessCallback gluTessCallback
- * @see #begin begin
- * @see #endData endData
- */
- public void end();
-
-
- /**
- * The same as the {@link #end end} callback method except that it
- * takes an additional reference argument. This reference is
- * identical to the opaque reference provided when {@link
- * PGLU#gluTessBeginPolygon gluTessBeginPolygon} was called.
- *
- * @param polygonData
- * Specifics a reference to user-defined data.
- *
- * @see PGLU#gluTessCallback gluTessCallback
- * @see #beginData beginData
- * @see #end end
- */
- public void endData(Object polygonData);
-
-
- /**
- * The combine callback method is called to create a new vertex when
- * the tessellation detects an intersection, or wishes to merge features. The
- * method takes four arguments: an array of three elements each of type
- * double, an array of four references, an array of four elements each of
- * type float, and a reference to a reference.
- *
- * The vertex is defined as a linear combination of up to four existing
- * vertices, stored in data . The coefficients of the linear combination
- * are given by weight ; these weights always add up to 1. All vertex
- * pointers are valid even when some of the weights are 0. coords gives
- * the location of the new vertex.
- *
- * The user must allocate another vertex, interpolate parameters using
- * data and weight , and return the new vertex pointer in
- * outData . This handle is supplied during rendering callbacks. The
- * user is responsible for freeing the memory some time after
- * {@link PGLU#gluTessEndPolygon gluTessEndPolygon} is
- * called.
- *
- * For example, if the polygon lies in an arbitrary plane in 3-space, and a
- * color is associated with each vertex, the GLU_TESS_COMBINE
- * callback might look like this:
- *
- *
- * void myCombine(double[] coords, Object[] data,
- * float[] weight, Object[] outData)
- * {
- * MyVertex newVertex = new MyVertex();
- *
- * newVertex.x = coords[0];
- * newVertex.y = coords[1];
- * newVertex.z = coords[2];
- * newVertex.r = weight[0]*data[0].r +
- * weight[1]*data[1].r +
- * weight[2]*data[2].r +
- * weight[3]*data[3].r;
- * newVertex.g = weight[0]*data[0].g +
- * weight[1]*data[1].g +
- * weight[2]*data[2].g +
- * weight[3]*data[3].g;
- * newVertex.b = weight[0]*data[0].b +
- * weight[1]*data[1].b +
- * weight[2]*data[2].b +
- * weight[3]*data[3].b;
- * newVertex.a = weight[0]*data[0].a +
- * weight[1]*data[1].a +
- * weight[2]*data[2].a +
- * weight[3]*data[3].a;
- * outData = newVertex;
- * }
- *
- * @param coords
- * Specifics the location of the new vertex.
- * @param data
- * Specifics the vertices used to create the new vertex.
- * @param weight
- * Specifics the weights used to create the new vertex.
- * @param outData
- * Reference user the put the coodinates of the new vertex.
- *
- * @see PGLU#gluTessCallback gluTessCallback
- * @see #combineData combineData
- */
- public void combine(double[] coords, Object[] data,
- float[] weight, Object[] outData);
-
-
- /**
- * The same as the {@link #combine combine} callback method except
- * that it takes an additional reference argument. This reference is
- * identical to the opaque reference provided when {@link
- * PGLU#gluTessBeginPolygon gluTessBeginPolygon} was called.
- *
- * @param coords
- * Specifics the location of the new vertex.
- * @param data
- * Specifics the vertices used to create the new vertex.
- * @param weight
- * Specifics the weights used to create the new vertex.
- * @param outData
- * Reference user the put the coodinates of the new vertex.
- * @param polygonData
- * Specifics a reference to user-defined data.
- *
- * @see PGLU#gluTessCallback gluTessCallback
- * @see #combine combine
- */
- public void combineData(double[] coords, Object[] data,
- float[] weight, Object[] outData,
- Object polygonData);
-
-
- /**
- * The error callback method is called when an error is encountered.
- * The one argument is of type int; it indicates the specific error that
- * occurred and will be set to one of GLU_TESS_MISSING_BEGIN_POLYGON ,
- * GLU_TESS_MISSING_END_POLYGON , GLU_TESS_MISSING_BEGIN_CONTOUR ,
- * GLU_TESS_MISSING_END_CONTOUR , GLU_TESS_COORD_TOO_LARGE ,
- * GLU_TESS_NEED_COMBINE_CALLBACK or GLU_OUT_OF_MEMORY .
- * Character strings describing these errors can be retrieved with the
- * {@link PGLU#gluErrorString gluErrorString} call.
- *
- * The GLU library will recover from the first four errors by inserting the
- * missing call(s). GLU_TESS_COORD_TOO_LARGE indicates that some
- * vertex coordinate exceeded the predefined constant
- * GLU_TESS_MAX_COORD in absolute value, and that the value has been
- * clamped. (Coordinate values must be small enough so that two can be
- * multiplied together without overflow.)
- * GLU_TESS_NEED_COMBINE_CALLBACK indicates that the tessellation
- * detected an intersection between two edges in the input data, and the
- * GLU_TESS_COMBINE or GLU_TESS_COMBINE_DATA callback was not
- * provided. No output is generated. GLU_OUT_OF_MEMORY indicates that
- * there is not enough memory so no output is generated.
- *
- * @param errnum
- * Specifics the error number code.
- *
- * @see PGLU#gluTessCallback gluTessCallback
- * @see #errorData errorData
- */
- public void error(int errnum);
-
-
- /**
- * The same as the {@link #error error} callback method except that
- * it takes an additional reference argument. This reference is
- * identical to the opaque reference provided when {@link
- * PGLU#gluTessBeginPolygon gluTessBeginPolygon} was called.
- *
- * @param errnum
- * Specifics the error number code.
- * @param polygonData
- * Specifics a reference to user-defined data.
- *
- * @see PGLU#gluTessCallback gluTessCallback
- * @see #error error
- */
- public void errorData(int errnum, Object polygonData);
-
- //void mesh(jogamp.opengl.tessellator.GLUmesh mesh);
-}
diff --git a/android/core/src/processing/opengl/tess/PGLUtessellatorCallbackAdapter.java b/android/core/src/processing/opengl/tess/PGLUtessellatorCallbackAdapter.java
deleted file mode 100644
index 9ea9a8c749..0000000000
--- a/android/core/src/processing/opengl/tess/PGLUtessellatorCallbackAdapter.java
+++ /dev/null
@@ -1,87 +0,0 @@
-/*
-* Portions Copyright (C) 2003-2006 Sun Microsystems, Inc.
-* All rights reserved.
-*/
-
-/*
-** License Applicability. Except to the extent portions of this file are
-** made subject to an alternative license as permitted in the SGI Free
-** Software License B, Version 2.0 (the "License"), the contents of this
-** file are subject only to the provisions of the License. You may not use
-** this file except in compliance with the License. You may obtain a copy
-** of the License at Silicon Graphics, Inc., attn: Legal Services, 1600
-** Amphitheatre Parkway, Mountain View, CA 94043-1351, or at:
-**
-** http://oss.sgi.com/projects/FreeB
-**
-** Note that, as provided in the License, the Software is distributed on an
-** "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS
-** DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND
-** CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A
-** PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
-**
-** NOTE: The Original Code (as defined below) has been licensed to Sun
-** Microsystems, Inc. ("Sun") under the SGI Free Software License B
-** (Version 1.1), shown above ("SGI License"). Pursuant to Section
-** 3.2(3) of the SGI License, Sun is distributing the Covered Code to
-** you under an alternative license ("Alternative License"). This
-** Alternative License includes all of the provisions of the SGI License
-** except that Section 2.2 and 11 are omitted. Any differences between
-** the Alternative License and the SGI License are offered solely by Sun
-** and not by SGI.
-**
-** Original Code. The Original Code is: OpenGL Sample Implementation,
-** Version 1.2.1, released January 26, 2000, developed by Silicon Graphics,
-** Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc.
-** Copyright in any portions created by third parties is as indicated
-** elsewhere herein. All Rights Reserved.
-**
-** Additional Notice Provisions: The application programming interfaces
-** established by SGI in conjunction with the Original Code are The
-** OpenGL(R) Graphics System: A Specification (Version 1.2.1), released
-** April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version
-** 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X
-** Window System(R) (Version 1.3), released October 19, 1998. This software
-** was created using the OpenGL(R) version 1.2.1 Sample Implementation
-** published by SGI, but has not been independently verified as being
-** compliant with the OpenGL(R) version 1.2.1 Specification.
-**
-** Author: Eric Veach, July 1994
-** Java Port: Pepijn Van Eeckhoudt, July 2003
-** Java Port: Nathan Parker Burg, August 2003
-** Processing integration: Andres Colubri, February 2012
-*/
-
-package processing.opengl.tess;
-
-/**
- * The GLUtessellatorCallbackAdapter provides a default implementation of
- * {@link PGLUtessellatorCallback GLUtessellatorCallback}
- * with empty callback methods. This class can be extended to provide user
- * defined callback methods.
- *
- * @author Eric Veach, July 1994
- * @author Java Port: Pepijn Van Eechhoudt, July 2003
- * @author Java Port: Nathan Parker Burg, August 2003
- * @author Processing integration: Andres Colubri, February 2012
- */
-
-public class PGLUtessellatorCallbackAdapter implements PGLUtessellatorCallback {
- public void begin(int type) {}
- public void edgeFlag(boolean boundaryEdge) {}
- public void vertex(Object vertexData) {}
- public void end() {}
-// public void mesh(jogamp.opengl.tessellator.GLUmesh mesh) {}
- public void error(int errnum) {}
- public void combine(double[] coords, Object[] data,
- float[] weight, Object[] outData) {}
- public void beginData(int type, Object polygonData) {}
- public void edgeFlagData(boolean boundaryEdge,
- Object polygonData) {}
- public void vertexData(Object vertexData, Object polygonData) {}
- public void endData(Object polygonData) {}
- public void errorData(int errnum, Object polygonData) {}
- public void combineData(double[] coords, Object[] data,
- float[] weight, Object[] outData,
- Object polygonData) {}
-}
diff --git a/android/core/src/processing/opengl/tess/PriorityQ.java b/android/core/src/processing/opengl/tess/PriorityQ.java
deleted file mode 100644
index 99c772869e..0000000000
--- a/android/core/src/processing/opengl/tess/PriorityQ.java
+++ /dev/null
@@ -1,102 +0,0 @@
-/*
-* Portions Copyright (C) 2003-2006 Sun Microsystems, Inc.
-* All rights reserved.
-*/
-
-/*
-** License Applicability. Except to the extent portions of this file are
-** made subject to an alternative license as permitted in the SGI Free
-** Software License B, Version 2.0 (the "License"), the contents of this
-** file are subject only to the provisions of the License. You may not use
-** this file except in compliance with the License. You may obtain a copy
-** of the License at Silicon Graphics, Inc., attn: Legal Services, 1600
-** Amphitheatre Parkway, Mountain View, CA 94043-1351, or at:
-**
-** http://oss.sgi.com/projects/FreeB
-**
-** Note that, as provided in the License, the Software is distributed on an
-** "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS
-** DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND
-** CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A
-** PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
-**
-** NOTE: The Original Code (as defined below) has been licensed to Sun
-** Microsystems, Inc. ("Sun") under the SGI Free Software License B
-** (Version 1.1), shown above ("SGI License"). Pursuant to Section
-** 3.2(3) of the SGI License, Sun is distributing the Covered Code to
-** you under an alternative license ("Alternative License"). This
-** Alternative License includes all of the provisions of the SGI License
-** except that Section 2.2 and 11 are omitted. Any differences between
-** the Alternative License and the SGI License are offered solely by Sun
-** and not by SGI.
-**
-** Original Code. The Original Code is: OpenGL Sample Implementation,
-** Version 1.2.1, released January 26, 2000, developed by Silicon Graphics,
-** Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc.
-** Copyright in any portions created by third parties is as indicated
-** elsewhere herein. All Rights Reserved.
-**
-** Additional Notice Provisions: The application programming interfaces
-** established by SGI in conjunction with the Original Code are The
-** OpenGL(R) Graphics System: A Specification (Version 1.2.1), released
-** April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version
-** 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X
-** Window System(R) (Version 1.3), released October 19, 1998. This software
-** was created using the OpenGL(R) version 1.2.1 Sample Implementation
-** published by SGI, but has not been independently verified as being
-** compliant with the OpenGL(R) version 1.2.1 Specification.
-**
-** Author: Eric Veach, July 1994
-** Java Port: Pepijn Van Eeckhoudt, July 2003
-** Java Port: Nathan Parker Burg, August 2003
-** Processing integration: Andres Colubri, February 2012
-*/
-
-package processing.opengl.tess;
-
-abstract class PriorityQ {
- public static final int INIT_SIZE = 32;
-
- public static class PQnode {
- int handle;
- }
-
- public static class PQhandleElem {
- Object key;
- int node;
- }
-
- public static interface Leq {
- boolean leq(Object key1, Object key2);
- }
-
- // #ifdef FOR_TRITE_TEST_PROGRAM
-// private static boolean LEQ(PriorityQCommon.Leq leq, Object x,Object y) {
-// return pq.leq.leq(x,y);
-// }
-// #else
-/* Violates modularity, but a little faster */
-// #include "geom.h"
- public static boolean LEQ(Leq leq, Object x, Object y) {
- return Geom.VertLeq((GLUvertex) x, (GLUvertex) y);
- }
-
- static PriorityQ pqNewPriorityQ(Leq leq) {
- return new PriorityQSort(leq);
- }
-
- abstract void pqDeletePriorityQ();
-
- abstract boolean pqInit();
-
- abstract int pqInsert(Object keyNew);
-
- abstract Object pqExtractMin();
-
- abstract void pqDelete(int hCurr);
-
- abstract Object pqMinimum();
-
- abstract boolean pqIsEmpty();
-// #endif
-}
diff --git a/android/core/src/processing/opengl/tess/PriorityQHeap.java b/android/core/src/processing/opengl/tess/PriorityQHeap.java
deleted file mode 100644
index d3fae04d9e..0000000000
--- a/android/core/src/processing/opengl/tess/PriorityQHeap.java
+++ /dev/null
@@ -1,271 +0,0 @@
-/*
-* Portions Copyright (C) 2003-2006 Sun Microsystems, Inc.
-* All rights reserved.
-*/
-
-/*
-** License Applicability. Except to the extent portions of this file are
-** made subject to an alternative license as permitted in the SGI Free
-** Software License B, Version 2.0 (the "License"), the contents of this
-** file are subject only to the provisions of the License. You may not use
-** this file except in compliance with the License. You may obtain a copy
-** of the License at Silicon Graphics, Inc., attn: Legal Services, 1600
-** Amphitheatre Parkway, Mountain View, CA 94043-1351, or at:
-**
-** http://oss.sgi.com/projects/FreeB
-**
-** Note that, as provided in the License, the Software is distributed on an
-** "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS
-** DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND
-** CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A
-** PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
-**
-** NOTE: The Original Code (as defined below) has been licensed to Sun
-** Microsystems, Inc. ("Sun") under the SGI Free Software License B
-** (Version 1.1), shown above ("SGI License"). Pursuant to Section
-** 3.2(3) of the SGI License, Sun is distributing the Covered Code to
-** you under an alternative license ("Alternative License"). This
-** Alternative License includes all of the provisions of the SGI License
-** except that Section 2.2 and 11 are omitted. Any differences between
-** the Alternative License and the SGI License are offered solely by Sun
-** and not by SGI.
-**
-** Original Code. The Original Code is: OpenGL Sample Implementation,
-** Version 1.2.1, released January 26, 2000, developed by Silicon Graphics,
-** Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc.
-** Copyright in any portions created by third parties is as indicated
-** elsewhere herein. All Rights Reserved.
-**
-** Additional Notice Provisions: The application programming interfaces
-** established by SGI in conjunction with the Original Code are The
-** OpenGL(R) Graphics System: A Specification (Version 1.2.1), released
-** April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version
-** 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X
-** Window System(R) (Version 1.3), released October 19, 1998. This software
-** was created using the OpenGL(R) version 1.2.1 Sample Implementation
-** published by SGI, but has not been independently verified as being
-** compliant with the OpenGL(R) version 1.2.1 Specification.
-**
-** Author: Eric Veach, July 1994
-** Java Port: Pepijn Van Eeckhoudt, July 2003
-** Java Port: Nathan Parker Burg, August 2003
-** Processing integration: Andres Colubri, February 2012
-*/
-
-package processing.opengl.tess;
-
-class PriorityQHeap extends PriorityQ {
- PriorityQ.PQnode[] nodes;
- PriorityQ.PQhandleElem[] handles;
- int size, max;
- int freeList;
- boolean initialized;
- PriorityQ.Leq leq;
-
-/* really __gl_pqHeapNewPriorityQ */
- public PriorityQHeap(PriorityQ.Leq leq) {
- size = 0;
- max = PriorityQ.INIT_SIZE;
- nodes = new PriorityQ.PQnode[PriorityQ.INIT_SIZE + 1];
- for (int i = 0; i < nodes.length; i++) {
- nodes[i] = new PQnode();
- }
- handles = new PriorityQ.PQhandleElem[PriorityQ.INIT_SIZE + 1];
- for (int i = 0; i < handles.length; i++) {
- handles[i] = new PQhandleElem();
- }
- initialized = false;
- freeList = 0;
- this.leq = leq;
-
- nodes[1].handle = 1; /* so that Minimum() returns NULL */
- handles[1].key = null;
- }
-
-/* really __gl_pqHeapDeletePriorityQ */
- @Override
- void pqDeletePriorityQ() {
- handles = null;
- nodes = null;
- }
-
- void FloatDown(int curr) {
- PriorityQ.PQnode[] n = nodes;
- PriorityQ.PQhandleElem[] h = handles;
- int hCurr, hChild;
- int child;
-
- hCurr = n[curr].handle;
- for (; ;) {
- child = curr << 1;
- if (child < size && LEQ(leq, h[n[child + 1].handle].key,
- h[n[child].handle].key)) {
- ++child;
- }
-
- assert (child <= max);
-
- hChild = n[child].handle;
- if (child > size || LEQ(leq, h[hCurr].key, h[hChild].key)) {
- n[curr].handle = hCurr;
- h[hCurr].node = curr;
- break;
- }
- n[curr].handle = hChild;
- h[hChild].node = curr;
- curr = child;
- }
- }
-
-
- void FloatUp(int curr) {
- PriorityQ.PQnode[] n = nodes;
- PriorityQ.PQhandleElem[] h = handles;
- int hCurr, hParent;
- int parent;
-
- hCurr = n[curr].handle;
- for (; ;) {
- parent = curr >> 1;
- hParent = n[parent].handle;
- if (parent == 0 || LEQ(leq, h[hParent].key, h[hCurr].key)) {
- n[curr].handle = hCurr;
- h[hCurr].node = curr;
- break;
- }
- n[curr].handle = hParent;
- h[hParent].node = curr;
- curr = parent;
- }
- }
-
-/* really __gl_pqHeapInit */
- @Override
- boolean pqInit() {
- int i;
-
- /* This method of building a heap is O(n), rather than O(n lg n). */
-
- for (i = size; i >= 1; --i) {
- FloatDown(i);
- }
- initialized = true;
-
- return true;
- }
-
-/* really __gl_pqHeapInsert */
-/* returns LONG_MAX iff out of memory */
- @Override
- int pqInsert(Object keyNew) {
- int curr;
- int free;
-
- curr = ++size;
- if ((curr * 2) > max) {
- PriorityQ.PQnode[] saveNodes = nodes;
- PriorityQ.PQhandleElem[] saveHandles = handles;
-
- /* If the heap overflows, double its size. */
- max <<= 1;
-// pq->nodes = (PQnode *)memRealloc( pq->nodes, (size_t) ((pq->max + 1) * sizeof( pq->nodes[0] )));
- PriorityQ.PQnode[] pqNodes = new PriorityQ.PQnode[max + 1];
- System.arraycopy( nodes, 0, pqNodes, 0, nodes.length );
- for (int i = nodes.length; i < pqNodes.length; i++) {
- pqNodes[i] = new PQnode();
- }
- nodes = pqNodes;
- if (nodes == null) {
- nodes = saveNodes; /* restore ptr to free upon return */
- return Integer.MAX_VALUE;
- }
-
-// pq->handles = (PQhandleElem *)memRealloc( pq->handles,(size_t)((pq->max + 1) * sizeof( pq->handles[0] )));
- PriorityQ.PQhandleElem[] pqHandles = new PriorityQ.PQhandleElem[max + 1];
- System.arraycopy( handles, 0, pqHandles, 0, handles.length );
- for (int i = handles.length; i < pqHandles.length; i++) {
- pqHandles[i] = new PQhandleElem();
- }
- handles = pqHandles;
- if (handles == null) {
- handles = saveHandles; /* restore ptr to free upon return */
- return Integer.MAX_VALUE;
- }
- }
-
- if (freeList == 0) {
- free = curr;
- } else {
- free = freeList;
- freeList = handles[free].node;
- }
-
- nodes[curr].handle = free;
- handles[free].node = curr;
- handles[free].key = keyNew;
-
- if (initialized) {
- FloatUp(curr);
- }
- assert (free != Integer.MAX_VALUE);
- return free;
- }
-
-/* really __gl_pqHeapExtractMin */
- @Override
- Object pqExtractMin() {
- PriorityQ.PQnode[] n = nodes;
- PriorityQ.PQhandleElem[] h = handles;
- int hMin = n[1].handle;
- Object min = h[hMin].key;
-
- if (size > 0) {
- n[1].handle = n[size].handle;
- h[n[1].handle].node = 1;
-
- h[hMin].key = null;
- h[hMin].node = freeList;
- freeList = hMin;
-
- if (--size > 0) {
- FloatDown(1);
- }
- }
- return min;
- }
-
-/* really __gl_pqHeapDelete */
- @Override
- void pqDelete(int hCurr) {
- PriorityQ.PQnode[] n = nodes;
- PriorityQ.PQhandleElem[] h = handles;
- int curr;
-
- assert (hCurr >= 1 && hCurr <= max && h[hCurr].key != null);
-
- curr = h[hCurr].node;
- n[curr].handle = n[size].handle;
- h[n[curr].handle].node = curr;
-
- if (curr <= --size) {
- if (curr <= 1 || LEQ(leq, h[n[curr >> 1].handle].key, h[n[curr].handle].key)) {
- FloatDown(curr);
- } else {
- FloatUp(curr);
- }
- }
- h[hCurr].key = null;
- h[hCurr].node = freeList;
- freeList = hCurr;
- }
-
- @Override
- Object pqMinimum() {
- return handles[nodes[1].handle].key;
- }
-
- @Override
- boolean pqIsEmpty() {
- return size == 0;
- }
-}
diff --git a/android/core/src/processing/opengl/tess/PriorityQSort.java b/android/core/src/processing/opengl/tess/PriorityQSort.java
deleted file mode 100644
index 8b5c274d24..0000000000
--- a/android/core/src/processing/opengl/tess/PriorityQSort.java
+++ /dev/null
@@ -1,288 +0,0 @@
-/*
-** License Applicability. Except to the extent portions of this file are
-
-** made subject to an alternative license as permitted in the SGI Free
-** Software License B, Version 2.0 (the "License"), the contents of this
-** file are subject only to the provisions of the License. You may not use
-** this file except in compliance with the License. You may obtain a copy
-** of the License at Silicon Graphics, Inc., attn: Legal Services, 1600
-** Amphitheatre Parkway, Mountain View, CA 94043-1351, or at:
-**
-** http://oss.sgi.com/projects/FreeB
-**
-** Note that, as provided in the License, the Software is distributed on an
-** "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS
-** DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND
-** CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A
-** PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
-**
-** NOTE: The Original Code (as defined below) has been licensed to Sun
-** Microsystems, Inc. ("Sun") under the SGI Free Software License B
-** (Version 1.1), shown above ("SGI License"). Pursuant to Section
-** 3.2(3) of the SGI License, Sun is distributing the Covered Code to
-** you under an alternative license ("Alternative License"). This
-** Alternative License includes all of the provisions of the SGI License
-** except that Section 2.2 and 11 are omitted. Any differences between
-** the Alternative License and the SGI License are offered solely by Sun
-** and not by SGI.
-**
-** Original Code. The Original Code is: OpenGL Sample Implementation,
-** Version 1.2.1, released January 26, 2000, developed by Silicon Graphics,
-** Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc.
-** Copyright in any portions created by third parties is as indicated
-** elsewhere herein. All Rights Reserved.
-**
-** Additional Notice Provisions: The application programming interfaces
-** established by SGI in conjunction with the Original Code are The
-** OpenGL(R) Graphics System: A Specification (Version 1.2.1), released
-** April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version
-** 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X
-** Window System(R) (Version 1.3), released October 19, 1998. This software
-** was created using the OpenGL(R) version 1.2.1 Sample Implementation
-** published by SGI, but has not been independently verified as being
-** compliant with the OpenGL(R) version 1.2.1 Specification.
-**
-** Author: Eric Veach, July 1994
-** Java Port: Pepijn Van Eeckhoudt, July 2003
-** Java Port: Nathan Parker Burg, August 2003
-** Processing integration: Andres Colubri, February 2012
-*/
-
-package processing.opengl.tess;
-
-class PriorityQSort extends PriorityQ {
- PriorityQHeap heap;
- Object[] keys;
-
- // JAVA: 'order' contains indices into the keys array.
- // This simulates the indirect pointers used in the original C code
- // (from Frank Suykens, Luciad.com).
- int[] order;
- int size, max;
- boolean initialized;
- PriorityQ.Leq leq;
-
- public PriorityQSort(PriorityQ.Leq leq) {
- heap = new PriorityQHeap(leq);
-
- keys = new Object[PriorityQ.INIT_SIZE];
-
- size = 0;
- max = PriorityQ.INIT_SIZE;
- initialized = false;
- this.leq = leq;
- }
-
-/* really __gl_pqSortDeletePriorityQ */
- @Override
- void pqDeletePriorityQ() {
- if (heap != null) heap.pqDeletePriorityQ();
- order = null;
- keys = null;
- }
-
- private static boolean LT(PriorityQ.Leq leq, Object x, Object y) {
- return (!PriorityQ.LEQ(leq, y, x));
- }
-
- private static boolean GT(PriorityQ.Leq leq, Object x, Object y) {
- return (!PriorityQ.LEQ(leq, x, y));
- }
-
- private static void Swap(int[] array, int a, int b) {
- if (true) {
- int tmp = array[a];
- array[a] = array[b];
- array[b] = tmp;
- } else {
-
- }
- }
-
- private static class Stack {
- int p, r;
- }
-
-/* really __gl_pqSortInit */
- @Override
- boolean pqInit() {
- int p, r, i, j;
- int piv;
- Stack[] stack = new Stack[50];
- for (int k = 0; k < stack.length; k++) {
- stack[k] = new Stack();
- }
- int top = 0;
-
- int seed = 2016473283;
-
- /* Create an array of indirect pointers to the keys, so that we
- * the handles we have returned are still valid.
- */
- order = new int[size + 1];
-/* the previous line is a patch to compensate for the fact that IBM */
-/* machines return a null on a malloc of zero bytes (unlike SGI), */
-/* so we have to put in this defense to guard against a memory */
-/* fault four lines down. from fossum@austin.ibm.com. */
- p = 0;
- r = size - 1;
- for (piv = 0, i = p; i <= r; ++piv, ++i) {
- // indirect pointers: keep an index into the keys array, not a direct pointer to its contents
- order[i] = piv;
- }
-
- /* Sort the indirect pointers in descending order,
- * using randomized Quicksort
- */
- stack[top].p = p;
- stack[top].r = r;
- ++top;
- while (--top >= 0) {
- p = stack[top].p;
- r = stack[top].r;
- while (r > p + 10) {
- seed = Math.abs( seed * 1539415821 + 1 );
- i = p + seed % (r - p + 1);
- piv = order[i];
- order[i] = order[p];
- order[p] = piv;
- i = p - 1;
- j = r + 1;
- do {
- do {
- ++i;
- } while (GT(leq, keys[order[i]], keys[piv]));
- do {
- --j;
- } while (LT(leq, keys[order[j]], keys[piv]));
- Swap(order, i, j);
- } while (i < j);
- Swap(order, i, j); /* Undo last swap */
- if (i - p < r - j) {
- stack[top].p = j + 1;
- stack[top].r = r;
- ++top;
- r = i - 1;
- } else {
- stack[top].p = p;
- stack[top].r = i - 1;
- ++top;
- p = j + 1;
- }
- }
- /* Insertion sort small lists */
- for (i = p + 1; i <= r; ++i) {
- piv = order[i];
- for (j = i; j > p && LT(leq, keys[order[j - 1]], keys[piv]); --j) {
- order[j] = order[j - 1];
- }
- order[j] = piv;
- }
- }
- max = size;
- initialized = true;
- heap.pqInit(); /* always succeeds */
-
-/* #ifndef NDEBUG
- p = order;
- r = p + size - 1;
- for (i = p; i < r; ++i) {
- Assertion.doAssert(LEQ( * * (i + 1), **i ));
- }
- #endif*/
-
- return true;
- }
-
-/* really __gl_pqSortInsert */
-/* returns LONG_MAX iff out of memory */
- @Override
- int pqInsert(Object keyNew) {
- int curr;
-
- if (initialized) {
- return heap.pqInsert(keyNew);
- }
- curr = size;
- if (++size >= max) {
- Object[] saveKey = keys;
-
- /* If the heap overflows, double its size. */
- max <<= 1;
-// pq->keys = (PQHeapKey *)memRealloc( pq->keys,(size_t)(pq->max * sizeof( pq->keys[0] )));
- Object[] pqKeys = new Object[max];
- System.arraycopy( keys, 0, pqKeys, 0, keys.length );
- keys = pqKeys;
- if (keys == null) {
- keys = saveKey; /* restore ptr to free upon return */
- return Integer.MAX_VALUE;
- }
- }
- assert curr != Integer.MAX_VALUE;
- keys[curr] = keyNew;
-
- /* Negative handles index the sorted array. */
- return -(curr + 1);
- }
-
-/* really __gl_pqSortExtractMin */
- @Override
- Object pqExtractMin() {
- Object sortMin, heapMin;
-
- if (size == 0) {
- return heap.pqExtractMin();
- }
- sortMin = keys[order[size - 1]];
- if (!heap.pqIsEmpty()) {
- heapMin = heap.pqMinimum();
- if (LEQ(leq, heapMin, sortMin)) {
- return heap.pqExtractMin();
- }
- }
- do {
- --size;
- } while (size > 0 && keys[order[size - 1]] == null);
- return sortMin;
- }
-
-/* really __gl_pqSortMinimum */
- @Override
- Object pqMinimum() {
- Object sortMin, heapMin;
-
- if (size == 0) {
- return heap.pqMinimum();
- }
- sortMin = keys[order[size - 1]];
- if (!heap.pqIsEmpty()) {
- heapMin = heap.pqMinimum();
- if (PriorityQ.LEQ(leq, heapMin, sortMin)) {
- return heapMin;
- }
- }
- return sortMin;
- }
-
-/* really __gl_pqSortIsEmpty */
- @Override
- boolean pqIsEmpty() {
- return (size == 0) && heap.pqIsEmpty();
- }
-
-/* really __gl_pqSortDelete */
- @Override
- void pqDelete(int curr) {
- if (curr >= 0) {
- heap.pqDelete(curr);
- return;
- }
- curr = -(curr + 1);
- assert curr < max && keys[curr] != null;
-
- keys[curr] = null;
- while (size > 0 && keys[order[size - 1]] == null) {
- --size;
- }
- }
-}
diff --git a/android/core/src/processing/opengl/tess/Render.java b/android/core/src/processing/opengl/tess/Render.java
deleted file mode 100644
index 17156deda9..0000000000
--- a/android/core/src/processing/opengl/tess/Render.java
+++ /dev/null
@@ -1,558 +0,0 @@
-/*
-* Portions Copyright (C) 2003-2006 Sun Microsystems, Inc.
-* All rights reserved.
-*/
-
-/*
-** License Applicability. Except to the extent portions of this file are
-** made subject to an alternative license as permitted in the SGI Free
-** Software License B, Version 2.0 (the "License"), the contents of this
-** file are subject only to the provisions of the License. You may not use
-** this file except in compliance with the License. You may obtain a copy
-** of the License at Silicon Graphics, Inc., attn: Legal Services, 1600
-** Amphitheatre Parkway, Mountain View, CA 94043-1351, or at:
-**
-** http://oss.sgi.com/projects/FreeB
-**
-** Note that, as provided in the License, the Software is distributed on an
-** "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS
-** DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND
-** CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A
-** PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
-**
-** NOTE: The Original Code (as defined below) has been licensed to Sun
-** Microsystems, Inc. ("Sun") under the SGI Free Software License B
-** (Version 1.1), shown above ("SGI License"). Pursuant to Section
-** 3.2(3) of the SGI License, Sun is distributing the Covered Code to
-** you under an alternative license ("Alternative License"). This
-** Alternative License includes all of the provisions of the SGI License
-** except that Section 2.2 and 11 are omitted. Any differences between
-** the Alternative License and the SGI License are offered solely by Sun
-** and not by SGI.
-**
-** Original Code. The Original Code is: OpenGL Sample Implementation,
-** Version 1.2.1, released January 26, 2000, developed by Silicon Graphics,
-** Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc.
-** Copyright in any portions created by third parties is as indicated
-** elsewhere herein. All Rights Reserved.
-**
-** Additional Notice Provisions: The application programming interfaces
-** established by SGI in conjunction with the Original Code are The
-** OpenGL(R) Graphics System: A Specification (Version 1.2.1), released
-** April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version
-** 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X
-** Window System(R) (Version 1.3), released October 19, 1998. This software
-** was created using the OpenGL(R) version 1.2.1 Sample Implementation
-** published by SGI, but has not been independently verified as being
-** compliant with the OpenGL(R) version 1.2.1 Specification.
-**
-** Author: Eric Veach, July 1994
-** Java Port: Pepijn Van Eeckhoudt, July 2003
-** Java Port: Nathan Parker Burg, August 2003
-** Processing integration: Andres Colubri, February 2012
-*/
-
-package processing.opengl.tess;
-
-import android.opengl.GLES20;
-
-class Render {
- private static final boolean USE_OPTIMIZED_CODE_PATH = false;
-
- private Render() {
- }
-
- private static final RenderFan renderFan = new RenderFan();
- private static final RenderStrip renderStrip = new RenderStrip();
- private static final RenderTriangle renderTriangle = new RenderTriangle();
-
-/* This structure remembers the information we need about a primitive
- * to be able to render it later, once we have determined which
- * primitive is able to use the most triangles.
- */
- private static class FaceCount {
- public FaceCount() {
- }
-
- public FaceCount(long size, GLUhalfEdge eStart, renderCallBack render) {
- this.size = size;
- this.eStart = eStart;
- this.render = render;
- }
-
- long size; /* number of triangles used */
- GLUhalfEdge eStart; /* edge where this primitive starts */
- renderCallBack render;
- };
-
- private static interface renderCallBack {
- void render(GLUtessellatorImpl tess, GLUhalfEdge e, long size);
- }
-
- /************************ Strips and Fans decomposition ******************/
-
-/* __gl_renderMesh( tess, mesh ) takes a mesh and breaks it into triangle
- * fans, strips, and separate triangles. A substantial effort is made
- * to use as few rendering primitives as possible (ie. to make the fans
- * and strips as large as possible).
- *
- * The rendering output is provided as callbacks (see the api).
- */
- public static void __gl_renderMesh(GLUtessellatorImpl tess, GLUmesh mesh) {
- GLUface f;
-
- /* Make a list of separate triangles so we can render them all at once */
- tess.lonelyTriList = null;
-
- for (f = mesh.fHead.next; f != mesh.fHead; f = f.next) {
- f.marked = false;
- }
- for (f = mesh.fHead.next; f != mesh.fHead; f = f.next) {
-
- /* We examine all faces in an arbitrary order. Whenever we find
- * an unprocessed face F, we output a group of faces including F
- * whose size is maximum.
- */
- if (f.inside && !f.marked) {
- RenderMaximumFaceGroup(tess, f);
- assert (f.marked);
- }
- }
- if (tess.lonelyTriList != null) {
- RenderLonelyTriangles(tess, tess.lonelyTriList);
- tess.lonelyTriList = null;
- }
- }
-
-
- static void RenderMaximumFaceGroup(GLUtessellatorImpl tess, GLUface fOrig) {
- /* We want to find the largest triangle fan or strip of unmarked faces
- * which includes the given face fOrig. There are 3 possible fans
- * passing through fOrig (one centered at each vertex), and 3 possible
- * strips (one for each CCW permutation of the vertices). Our strategy
- * is to try all of these, and take the primitive which uses the most
- * triangles (a greedy approach).
- */
- GLUhalfEdge e = fOrig.anEdge;
- FaceCount max = new FaceCount();
- FaceCount newFace = new FaceCount();
-
- max.size = 1;
- max.eStart = e;
- max.render = renderTriangle;
-
- if (!tess.flagBoundary) {
- newFace = MaximumFan(e);
- if (newFace.size > max.size) {
- max = newFace;
- }
- newFace = MaximumFan(e.Lnext);
- if (newFace.size > max.size) {
- max = newFace;
- }
- newFace = MaximumFan(e.Onext.Sym);
- if (newFace.size > max.size) {
- max = newFace;
- }
-
- newFace = MaximumStrip(e);
- if (newFace.size > max.size) {
- max = newFace;
- }
- newFace = MaximumStrip(e.Lnext);
- if (newFace.size > max.size) {
- max = newFace;
- }
- newFace = MaximumStrip(e.Onext.Sym);
- if (newFace.size > max.size) {
- max = newFace;
- }
- }
- max.render.render(tess, max.eStart, max.size);
- }
-
-
-/* Macros which keep track of faces we have marked temporarily, and allow
- * us to backtrack when necessary. With triangle fans, this is not
- * really necessary, since the only awkward case is a loop of triangles
- * around a single origin vertex. However with strips the situation is
- * more complicated, and we need a general tracking method like the
- * one here.
- */
- private static boolean Marked(GLUface f) {
- return !f.inside || f.marked;
- }
-
- private static GLUface AddToTrail(GLUface f, GLUface t) {
- f.trail = t;
- f.marked = true;
- return f;
- }
-
- private static void FreeTrail(GLUface t) {
- if (true) {
- while (t != null) {
- t.marked = false;
- t = t.trail;
- }
- } else {
- /* absorb trailing semicolon */
- }
- }
-
- static FaceCount MaximumFan(GLUhalfEdge eOrig) {
- /* eOrig.Lface is the face we want to render. We want to find the size
- * of a maximal fan around eOrig.Org. To do this we just walk around
- * the origin vertex as far as possible in both directions.
- */
- FaceCount newFace = new FaceCount(0, null, renderFan);
- GLUface trail = null;
- GLUhalfEdge e;
-
- for (e = eOrig; !Marked(e.Lface); e = e.Onext) {
- trail = AddToTrail(e.Lface, trail);
- ++newFace.size;
- }
- for (e = eOrig; !Marked(e.Sym.Lface); e = e.Sym.Lnext) {
- trail = AddToTrail(e.Sym.Lface, trail);
- ++newFace.size;
- }
- newFace.eStart = e;
- /*LINTED*/
- FreeTrail(trail);
- return newFace;
- }
-
-
- private static boolean IsEven(long n) {
- return (n & 0x1L) == 0;
- }
-
- static FaceCount MaximumStrip(GLUhalfEdge eOrig) {
- /* Here we are looking for a maximal strip that contains the vertices
- * eOrig.Org, eOrig.Dst, eOrig.Lnext.Dst (in that order or the
- * reverse, such that all triangles are oriented CCW).
- *
- * Again we walk forward and backward as far as possible. However for
- * strips there is a twist: to get CCW orientations, there must be
- * an *even* number of triangles in the strip on one side of eOrig.
- * We walk the strip starting on a side with an even number of triangles;
- * if both side have an odd number, we are forced to shorten one side.
- */
- FaceCount newFace = new FaceCount(0, null, renderStrip);
- long headSize = 0, tailSize = 0;
- GLUface trail = null;
- GLUhalfEdge e, eTail, eHead;
-
- for (e = eOrig; !Marked(e.Lface); ++tailSize, e = e.Onext) {
- trail = AddToTrail(e.Lface, trail);
- ++tailSize;
- e = e.Lnext.Sym;
- if (Marked(e.Lface)) break;
- trail = AddToTrail(e.Lface, trail);
- }
- eTail = e;
-
- for (e = eOrig; !Marked(e.Sym.Lface); ++headSize, e = e.Sym.Onext.Sym) {
- trail = AddToTrail(e.Sym.Lface, trail);
- ++headSize;
- e = e.Sym.Lnext;
- if (Marked(e.Sym.Lface)) break;
- trail = AddToTrail(e.Sym.Lface, trail);
- }
- eHead = e;
-
- newFace.size = tailSize + headSize;
- if (IsEven(tailSize)) {
- newFace.eStart = eTail.Sym;
- } else if (IsEven(headSize)) {
- newFace.eStart = eHead;
- } else {
- /* Both sides have odd length, we must shorten one of them. In fact,
- * we must start from eHead to guarantee inclusion of eOrig.Lface.
- */
- --newFace.size;
- newFace.eStart = eHead.Onext;
- }
- /*LINTED*/
- FreeTrail(trail);
- return newFace;
- }
-
- private static class RenderTriangle implements renderCallBack {
- public void render(GLUtessellatorImpl tess, GLUhalfEdge e, long size) {
- /* Just add the triangle to a triangle list, so we can render all
- * the separate triangles at once.
- */
- assert (size == 1);
- tess.lonelyTriList = AddToTrail(e.Lface, tess.lonelyTriList);
- }
- }
-
-
- static void RenderLonelyTriangles(GLUtessellatorImpl tess, GLUface f) {
- /* Now we render all the separate triangles which could not be
- * grouped into a triangle fan or strip.
- */
- GLUhalfEdge e;
- int newState;
- int edgeState = -1; /* force edge state output for first vertex */
-
- tess.callBeginOrBeginData(GLES20.GL_TRIANGLES);
-
- for (; f != null; f = f.trail) {
- /* Loop once for each edge (there will always be 3 edges) */
-
- e = f.anEdge;
- do {
- if (tess.flagBoundary) {
- /* Set the "edge state" to true just before we output the
- * first vertex of each edge on the polygon boundary.
- */
- newState = (!e.Sym.Lface.inside) ? 1 : 0;
- if (edgeState != newState) {
- edgeState = newState;
- tess.callEdgeFlagOrEdgeFlagData( edgeState != 0);
- }
- }
- tess.callVertexOrVertexData( e.Org.data);
-
- e = e.Lnext;
- } while (e != f.anEdge);
- }
- tess.callEndOrEndData();
- }
-
- private static class RenderFan implements renderCallBack {
- public void render(GLUtessellatorImpl tess, GLUhalfEdge e, long size) {
- /* Render as many CCW triangles as possible in a fan starting from
- * edge "e". The fan *should* contain exactly "size" triangles
- * (otherwise we've goofed up somewhere).
- */
- tess.callBeginOrBeginData(GLES20.GL_TRIANGLE_FAN);
- tess.callVertexOrVertexData( e.Org.data);
- tess.callVertexOrVertexData( e.Sym.Org.data);
-
- while (!Marked(e.Lface)) {
- e.Lface.marked = true;
- --size;
- e = e.Onext;
- tess.callVertexOrVertexData( e.Sym.Org.data);
- }
-
- assert (size == 0);
- tess.callEndOrEndData();
- }
- }
-
- private static class RenderStrip implements renderCallBack {
- public void render(GLUtessellatorImpl tess, GLUhalfEdge e, long size) {
- /* Render as many CCW triangles as possible in a strip starting from
- * edge "e". The strip *should* contain exactly "size" triangles
- * (otherwise we've goofed up somewhere).
- */
- tess.callBeginOrBeginData(GLES20.GL_TRIANGLE_STRIP);
- tess.callVertexOrVertexData( e.Org.data);
- tess.callVertexOrVertexData( e.Sym.Org.data);
-
- while (!Marked(e.Lface)) {
- e.Lface.marked = true;
- --size;
- e = e.Lnext.Sym;
- tess.callVertexOrVertexData( e.Org.data);
- if (Marked(e.Lface)) break;
-
- e.Lface.marked = true;
- --size;
- e = e.Onext;
- tess.callVertexOrVertexData( e.Sym.Org.data);
- }
-
- assert (size == 0);
- tess.callEndOrEndData();
- }
- }
-
- /************************ Boundary contour decomposition ******************/
-
-/* __gl_renderBoundary( tess, mesh ) takes a mesh, and outputs one
- * contour for each face marked "inside". The rendering output is
- * provided as callbacks (see the api).
- */
- public static void __gl_renderBoundary(GLUtessellatorImpl tess, GLUmesh mesh) {
- GLUface f;
- GLUhalfEdge e;
-
- for (f = mesh.fHead.next; f != mesh.fHead; f = f.next) {
- if (f.inside) {
- tess.callBeginOrBeginData(GLES20.GL_LINE_LOOP);
- e = f.anEdge;
- do {
- tess.callVertexOrVertexData( e.Org.data);
- e = e.Lnext;
- } while (e != f.anEdge);
- tess.callEndOrEndData();
- }
- }
- }
-
-
- /************************ Quick-and-dirty decomposition ******************/
-
- private static final int SIGN_INCONSISTENT = 2;
-
- static int ComputeNormal(GLUtessellatorImpl tess, double[] norm, boolean check)
-/*
- * If check==false, we compute the polygon normal and place it in norm[].
- * If check==true, we check that each triangle in the fan from v0 has a
- * consistent orientation with respect to norm[]. If triangles are
- * consistently oriented CCW, return 1; if CW, return -1; if all triangles
- * are degenerate return 0; otherwise (no consistent orientation) return
- * SIGN_INCONSISTENT.
- */ {
- CachedVertex[] v = tess.cache;
-// CachedVertex vn = v0 + tess.cacheCount;
- int vn = tess.cacheCount;
-// CachedVertex vc;
- int vc;
- double dot, xc, yc, zc, xp, yp, zp;
- double[] n = new double[3];
- int sign = 0;
-
- /* Find the polygon normal. It is important to get a reasonable
- * normal even when the polygon is self-intersecting (eg. a bowtie).
- * Otherwise, the computed normal could be very tiny, but perpendicular
- * to the true plane of the polygon due to numerical noise. Then all
- * the triangles would appear to be degenerate and we would incorrectly
- * decompose the polygon as a fan (or simply not render it at all).
- *
- * We use a sum-of-triangles normal algorithm rather than the more
- * efficient sum-of-trapezoids method (used in CheckOrientation()
- * in normal.c). This lets us explicitly reverse the signed area
- * of some triangles to get a reasonable normal in the self-intersecting
- * case.
- */
- if (!check) {
- norm[0] = norm[1] = norm[2] = 0.0;
- }
-
- vc = 1;
- xc = v[vc].coords[0] - v[0].coords[0];
- yc = v[vc].coords[1] - v[0].coords[1];
- zc = v[vc].coords[2] - v[0].coords[2];
- while (++vc < vn) {
- xp = xc;
- yp = yc;
- zp = zc;
- xc = v[vc].coords[0] - v[0].coords[0];
- yc = v[vc].coords[1] - v[0].coords[1];
- zc = v[vc].coords[2] - v[0].coords[2];
-
- /* Compute (vp - v0) cross (vc - v0) */
- n[0] = yp * zc - zp * yc;
- n[1] = zp * xc - xp * zc;
- n[2] = xp * yc - yp * xc;
-
- dot = n[0] * norm[0] + n[1] * norm[1] + n[2] * norm[2];
- if (!check) {
- /* Reverse the contribution of back-facing triangles to get
- * a reasonable normal for self-intersecting polygons (see above)
- */
- if (dot >= 0) {
- norm[0] += n[0];
- norm[1] += n[1];
- norm[2] += n[2];
- } else {
- norm[0] -= n[0];
- norm[1] -= n[1];
- norm[2] -= n[2];
- }
- } else if (dot != 0) {
- /* Check the new orientation for consistency with previous triangles */
- if (dot > 0) {
- if (sign < 0) return SIGN_INCONSISTENT;
- sign = 1;
- } else {
- if (sign > 0) return SIGN_INCONSISTENT;
- sign = -1;
- }
- }
- }
- return sign;
- }
-
-/* __gl_renderCache( tess ) takes a single contour and tries to render it
- * as a triangle fan. This handles convex polygons, as well as some
- * non-convex polygons if we get lucky.
- *
- * Returns true if the polygon was successfully rendered. The rendering
- * output is provided as callbacks (see the api).
- */
- public static boolean __gl_renderCache(GLUtessellatorImpl tess) {
- CachedVertex[] v = tess.cache;
-// CachedVertex vn = v0 + tess.cacheCount;
- int vn = tess.cacheCount;
-// CachedVertex vc;
- int vc;
- double[] norm = new double[3];
- int sign;
-
- if (tess.cacheCount < 3) {
- /* Degenerate contour -- no output */
- return true;
- }
-
- norm[0] = tess.normal[0];
- norm[1] = tess.normal[1];
- norm[2] = tess.normal[2];
- if (norm[0] == 0 && norm[1] == 0 && norm[2] == 0) {
- ComputeNormal( tess, norm, false);
- }
-
- sign = ComputeNormal( tess, norm, true);
- if (sign == SIGN_INCONSISTENT) {
- /* Fan triangles did not have a consistent orientation */
- return false;
- }
- if (sign == 0) {
- /* All triangles were degenerate */
- return true;
- }
-
- if ( !USE_OPTIMIZED_CODE_PATH ) {
- return false;
- } else {
- /* Make sure we do the right thing for each winding rule */
- switch (tess.windingRule) {
- case PGLU.GLU_TESS_WINDING_ODD:
- case PGLU.GLU_TESS_WINDING_NONZERO:
- break;
- case PGLU.GLU_TESS_WINDING_POSITIVE:
- if (sign < 0) return true;
- break;
- case PGLU.GLU_TESS_WINDING_NEGATIVE:
- if (sign > 0) return true;
- break;
- case PGLU.GLU_TESS_WINDING_ABS_GEQ_TWO:
- return true;
- }
-
- tess.callBeginOrBeginData( tess.boundaryOnly ? GLES20.GL_LINE_LOOP
- : (tess.cacheCount > 3) ? GLES20.GL_TRIANGLE_FAN
- : GLES20.GL_TRIANGLES);
-
- tess.callVertexOrVertexData( v[0].data);
- if (sign > 0) {
- for (vc = 1; vc < vn; ++vc) {
- tess.callVertexOrVertexData( v[vc].data);
- }
- } else {
- for (vc = vn - 1; vc > 0; --vc) {
- tess.callVertexOrVertexData( v[vc].data);
- }
- }
- tess.callEndOrEndData();
- return true;
- }
- }
-}
diff --git a/android/core/src/processing/opengl/tess/Sweep.java b/android/core/src/processing/opengl/tess/Sweep.java
deleted file mode 100644
index 9117de0d64..0000000000
--- a/android/core/src/processing/opengl/tess/Sweep.java
+++ /dev/null
@@ -1,1354 +0,0 @@
-/*
-* Portions Copyright (C) 2003-2006 Sun Microsystems, Inc.
-
-* All rights reserved.
-*/
-
-/*
-** License Applicability. Except to the extent portions of this file are
-** made subject to an alternative license as permitted in the SGI Free
-** Software License B, Version 2.0 (the "License"), the contents of this
-** file are subject only to the provisions of the License. You may not use
-** this file except in compliance with the License. You may obtain a copy
-** of the License at Silicon Graphics, Inc., attn: Legal Services, 1600
-** Amphitheatre Parkway, Mountain View, CA 94043-1351, or at:
-**
-** http://oss.sgi.com/projects/FreeB
-**
-** Note that, as provided in the License, the Software is distributed on an
-** "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS
-** DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND
-** CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A
-** PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
-**
-** NOTE: The Original Code (as defined below) has been licensed to Sun
-** Microsystems, Inc. ("Sun") under the SGI Free Software License B
-** (Version 1.1), shown above ("SGI License"). Pursuant to Section
-** 3.2(3) of the SGI License, Sun is distributing the Covered Code to
-** you under an alternative license ("Alternative License"). This
-** Alternative License includes all of the provisions of the SGI License
-** except that Section 2.2 and 11 are omitted. Any differences between
-** the Alternative License and the SGI License are offered solely by Sun
-** and not by SGI.
-**
-** Original Code. The Original Code is: OpenGL Sample Implementation,
-** Version 1.2.1, released January 26, 2000, developed by Silicon Graphics,
-** Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc.
-** Copyright in any portions created by third parties is as indicated
-** elsewhere herein. All Rights Reserved.
-**
-** Additional Notice Provisions: The application programming interfaces
-** established by SGI in conjunction with the Original Code are The
-** OpenGL(R) Graphics System: A Specification (Version 1.2.1), released
-** April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version
-** 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X
-** Window System(R) (Version 1.3), released October 19, 1998. This software
-** was created using the OpenGL(R) version 1.2.1 Sample Implementation
-** published by SGI, but has not been independently verified as being
-** compliant with the OpenGL(R) version 1.2.1 Specification.
-**
-** Author: Eric Veach, July 1994
-** Java Port: Pepijn Van Eeckhoudt, July 2003
-** Java Port: Nathan Parker Burg, August 2003
-** Processing integration: Andres Colubri, February 2012
-*/
-
-package processing.opengl.tess;
-
-
-class Sweep {
- private Sweep() {
- }
-
-// #ifdef FOR_TRITE_TEST_PROGRAM
-// extern void DebugEvent( GLUtessellator *tess );
-// #else
- private static void DebugEvent(GLUtessellatorImpl tess) {
-
- }
-// #endif
-
-/*
- * Invariants for the Edge Dictionary.
- * - each pair of adjacent edges e2=Succ(e1) satisfies EdgeLeq(e1,e2)
- * at any valid location of the sweep event
- * - if EdgeLeq(e2,e1) as well (at any valid sweep event), then e1 and e2
- * share a common endpoint
- * - for each e, e.Dst has been processed, but not e.Org
- * - each edge e satisfies VertLeq(e.Dst,event) && VertLeq(event,e.Org)
- * where "event" is the current sweep line event.
- * - no edge e has zero length
- *
- * Invariants for the Mesh (the processed portion).
- * - the portion of the mesh left of the sweep line is a planar graph,
- * ie. there is *some* way to embed it in the plane
- * - no processed edge has zero length
- * - no two processed vertices have identical coordinates
- * - each "inside" region is monotone, ie. can be broken into two chains
- * of monotonically increasing vertices according to VertLeq(v1,v2)
- * - a non-invariant: these chains may intersect (very slightly)
- *
- * Invariants for the Sweep.
- * - if none of the edges incident to the event vertex have an activeRegion
- * (ie. none of these edges are in the edge dictionary), then the vertex
- * has only right-going edges.
- * - if an edge is marked "fixUpperEdge" (it is a temporary edge introduced
- * by ConnectRightVertex), then it is the only right-going edge from
- * its associated vertex. (This says that these edges exist only
- * when it is necessary.)
- */
-
-/* When we merge two edges into one, we need to compute the combined
- * winding of the new edge.
- */
- private static void AddWinding(GLUhalfEdge eDst, GLUhalfEdge eSrc) {
- eDst.winding += eSrc.winding;
- eDst.Sym.winding += eSrc.Sym.winding;
- }
-
-
- private static ActiveRegion RegionBelow(ActiveRegion r) {
- return ((ActiveRegion) Dict.dictKey(Dict.dictPred(r.nodeUp)));
- }
-
- private static ActiveRegion RegionAbove(ActiveRegion r) {
- return ((ActiveRegion) Dict.dictKey(Dict.dictSucc(r.nodeUp)));
- }
-
- static boolean EdgeLeq(GLUtessellatorImpl tess, ActiveRegion reg1, ActiveRegion reg2)
-/*
- * Both edges must be directed from right to left (this is the canonical
- * direction for the upper edge of each region).
- *
- * The strategy is to evaluate a "t" value for each edge at the
- * current sweep line position, given by tess.event. The calculations
- * are designed to be very stable, but of course they are not perfect.
- *
- * Special case: if both edge destinations are at the sweep event,
- * we sort the edges by slope (they would otherwise compare equally).
- */ {
- GLUvertex event = tess.event;
- GLUhalfEdge e1, e2;
- double t1, t2;
-
- e1 = reg1.eUp;
- e2 = reg2.eUp;
-
- if (e1.Sym.Org == event) {
- if (e2.Sym.Org == event) {
- /* Two edges right of the sweep line which meet at the sweep event.
- * Sort them by slope.
- */
- if (Geom.VertLeq(e1.Org, e2.Org)) {
- return Geom.EdgeSign(e2.Sym.Org, e1.Org, e2.Org) <= 0;
- }
- return Geom.EdgeSign(e1.Sym.Org, e2.Org, e1.Org) >= 0;
- }
- return Geom.EdgeSign(e2.Sym.Org, event, e2.Org) <= 0;
- }
- if (e2.Sym.Org == event) {
- return Geom.EdgeSign(e1.Sym.Org, event, e1.Org) >= 0;
- }
-
- /* General case - compute signed distance *from* e1, e2 to event */
- t1 = Geom.EdgeEval(e1.Sym.Org, event, e1.Org);
- t2 = Geom.EdgeEval(e2.Sym.Org, event, e2.Org);
- return (t1 >= t2);
- }
-
-
- static void DeleteRegion(GLUtessellatorImpl tess, ActiveRegion reg) {
- if (reg.fixUpperEdge) {
- /* It was created with zero winding number, so it better be
- * deleted with zero winding number (ie. it better not get merged
- * with a real edge).
- */
- assert (reg.eUp.winding == 0);
- }
- reg.eUp.activeRegion = null;
- Dict.dictDelete(tess.dict, reg.nodeUp); /* __gl_dictListDelete */
- }
-
-
- static boolean FixUpperEdge(ActiveRegion reg, GLUhalfEdge newEdge)
-/*
- * Replace an upper edge which needs fixing (see ConnectRightVertex).
- */ {
- assert (reg.fixUpperEdge);
- if (!Mesh.__gl_meshDelete(reg.eUp)) return false;
- reg.fixUpperEdge = false;
- reg.eUp = newEdge;
- newEdge.activeRegion = reg;
-
- return true;
- }
-
- static ActiveRegion TopLeftRegion(ActiveRegion reg) {
- GLUvertex org = reg.eUp.Org;
- GLUhalfEdge e;
-
- /* Find the region above the uppermost edge with the same origin */
- do {
- reg = RegionAbove(reg);
- } while (reg.eUp.Org == org);
-
- /* If the edge above was a temporary edge introduced by ConnectRightVertex,
- * now is the time to fix it.
- */
- if (reg.fixUpperEdge) {
- e = Mesh.__gl_meshConnect(RegionBelow(reg).eUp.Sym, reg.eUp.Lnext);
- if (e == null) return null;
- if (!FixUpperEdge(reg, e)) return null;
- reg = RegionAbove(reg);
- }
- return reg;
- }
-
- static ActiveRegion TopRightRegion(ActiveRegion reg) {
- GLUvertex dst = reg.eUp.Sym.Org;
-
- /* Find the region above the uppermost edge with the same destination */
- do {
- reg = RegionAbove(reg);
- } while (reg.eUp.Sym.Org == dst);
- return reg;
- }
-
- static ActiveRegion AddRegionBelow(GLUtessellatorImpl tess,
- ActiveRegion regAbove,
- GLUhalfEdge eNewUp)
-/*
- * Add a new active region to the sweep line, *somewhere* below "regAbove"
- * (according to where the new edge belongs in the sweep-line dictionary).
- * The upper edge of the new region will be "eNewUp".
- * Winding number and "inside" flag are not updated.
- */ {
- ActiveRegion regNew = new ActiveRegion();
- if (regNew == null) throw new RuntimeException();
-
- regNew.eUp = eNewUp;
- /* __gl_dictListInsertBefore */
- regNew.nodeUp = Dict.dictInsertBefore(tess.dict, regAbove.nodeUp, regNew);
- if (regNew.nodeUp == null) throw new RuntimeException();
- regNew.fixUpperEdge = false;
- regNew.sentinel = false;
- regNew.dirty = false;
-
- eNewUp.activeRegion = regNew;
- return regNew;
- }
-
- static boolean IsWindingInside(GLUtessellatorImpl tess, int n) {
- switch (tess.windingRule) {
- case PGLU.GLU_TESS_WINDING_ODD:
- return (n & 1) != 0;
- case PGLU.GLU_TESS_WINDING_NONZERO:
- return (n != 0);
- case PGLU.GLU_TESS_WINDING_POSITIVE:
- return (n > 0);
- case PGLU.GLU_TESS_WINDING_NEGATIVE:
- return (n < 0);
- case PGLU.GLU_TESS_WINDING_ABS_GEQ_TWO:
- return (n >= 2) || (n <= -2);
- }
- /*LINTED*/
-// assert (false);
- throw new InternalError();
- /*NOTREACHED*/
- }
-
-
- static void ComputeWinding(GLUtessellatorImpl tess, ActiveRegion reg) {
- reg.windingNumber = RegionAbove(reg).windingNumber + reg.eUp.winding;
- reg.inside = IsWindingInside(tess, reg.windingNumber);
- }
-
-
- static void FinishRegion(GLUtessellatorImpl tess, ActiveRegion reg)
-/*
- * Delete a region from the sweep line. This happens when the upper
- * and lower chains of a region meet (at a vertex on the sweep line).
- * The "inside" flag is copied to the appropriate mesh face (we could
- * not do this before -- since the structure of the mesh is always
- * changing, this face may not have even existed until now).
- */ {
- GLUhalfEdge e = reg.eUp;
- GLUface f = e.Lface;
-
- f.inside = reg.inside;
- f.anEdge = e; /* optimization for __gl_meshTessellateMonoRegion() */
- DeleteRegion(tess, reg);
- }
-
-
- static GLUhalfEdge FinishLeftRegions(GLUtessellatorImpl tess,
- ActiveRegion regFirst, ActiveRegion regLast)
-/*
- * We are given a vertex with one or more left-going edges. All affected
- * edges should be in the edge dictionary. Starting at regFirst.eUp,
- * we walk down deleting all regions where both edges have the same
- * origin vOrg. At the same time we copy the "inside" flag from the
- * active region to the face, since at this point each face will belong
- * to at most one region (this was not necessarily true until this point
- * in the sweep). The walk stops at the region above regLast; if regLast
- * is null we walk as far as possible. At the same time we relink the
- * mesh if necessary, so that the ordering of edges around vOrg is the
- * same as in the dictionary.
- */ {
- ActiveRegion reg, regPrev;
- GLUhalfEdge e, ePrev;
-
- regPrev = regFirst;
- ePrev = regFirst.eUp;
- while (regPrev != regLast) {
- regPrev.fixUpperEdge = false; /* placement was OK */
- reg = RegionBelow(regPrev);
- e = reg.eUp;
- if (e.Org != ePrev.Org) {
- if (!reg.fixUpperEdge) {
- /* Remove the last left-going edge. Even though there are no further
- * edges in the dictionary with this origin, there may be further
- * such edges in the mesh (if we are adding left edges to a vertex
- * that has already been processed). Thus it is important to call
- * FinishRegion rather than just DeleteRegion.
- */
- FinishRegion(tess, regPrev);
- break;
- }
- /* If the edge below was a temporary edge introduced by
- * ConnectRightVertex, now is the time to fix it.
- */
- e = Mesh.__gl_meshConnect(ePrev.Onext.Sym, e.Sym);
- if (e == null) throw new RuntimeException();
- if (!FixUpperEdge(reg, e)) throw new RuntimeException();
- }
-
- /* Relink edges so that ePrev.Onext == e */
- if (ePrev.Onext != e) {
- if (!Mesh.__gl_meshSplice(e.Sym.Lnext, e)) throw new RuntimeException();
- if (!Mesh.__gl_meshSplice(ePrev, e)) throw new RuntimeException();
- }
- FinishRegion(tess, regPrev); /* may change reg.eUp */
- ePrev = reg.eUp;
- regPrev = reg;
- }
- return ePrev;
- }
-
-
- static void AddRightEdges(GLUtessellatorImpl tess, ActiveRegion regUp,
- GLUhalfEdge eFirst, GLUhalfEdge eLast, GLUhalfEdge eTopLeft,
- boolean cleanUp)
-/*
- * Purpose: insert right-going edges into the edge dictionary, and update
- * winding numbers and mesh connectivity appropriately. All right-going
- * edges share a common origin vOrg. Edges are inserted CCW starting at
- * eFirst; the last edge inserted is eLast.Sym.Lnext. If vOrg has any
- * left-going edges already processed, then eTopLeft must be the edge
- * such that an imaginary upward vertical segment from vOrg would be
- * contained between eTopLeft.Sym.Lnext and eTopLeft; otherwise eTopLeft
- * should be null.
- */ {
- ActiveRegion reg, regPrev;
- GLUhalfEdge e, ePrev;
- boolean firstTime = true;
-
- /* Insert the new right-going edges in the dictionary */
- e = eFirst;
- do {
- assert (Geom.VertLeq(e.Org, e.Sym.Org));
- AddRegionBelow(tess, regUp, e.Sym);
- e = e.Onext;
- } while (e != eLast);
-
- /* Walk *all* right-going edges from e.Org, in the dictionary order,
- * updating the winding numbers of each region, and re-linking the mesh
- * edges to match the dictionary ordering (if necessary).
- */
- if (eTopLeft == null) {
- eTopLeft = RegionBelow(regUp).eUp.Sym.Onext;
- }
- regPrev = regUp;
- ePrev = eTopLeft;
- for (; ;) {
- reg = RegionBelow(regPrev);
- e = reg.eUp.Sym;
- if (e.Org != ePrev.Org) break;
-
- if (e.Onext != ePrev) {
- /* Unlink e from its current position, and relink below ePrev */
- if (!Mesh.__gl_meshSplice(e.Sym.Lnext, e)) throw new RuntimeException();
- if (!Mesh.__gl_meshSplice(ePrev.Sym.Lnext, e)) throw new RuntimeException();
- }
- /* Compute the winding number and "inside" flag for the new regions */
- reg.windingNumber = regPrev.windingNumber - e.winding;
- reg.inside = IsWindingInside(tess, reg.windingNumber);
-
- /* Check for two outgoing edges with same slope -- process these
- * before any intersection tests (see example in __gl_computeInterior).
- */
- regPrev.dirty = true;
- if (!firstTime && CheckForRightSplice(tess, regPrev)) {
- AddWinding(e, ePrev);
- DeleteRegion(tess, regPrev);
- if (!Mesh.__gl_meshDelete(ePrev)) throw new RuntimeException();
- }
- firstTime = false;
- regPrev = reg;
- ePrev = e;
- }
- regPrev.dirty = true;
- assert (regPrev.windingNumber - e.winding == reg.windingNumber);
-
- if (cleanUp) {
- /* Check for intersections between newly adjacent edges. */
- WalkDirtyRegions(tess, regPrev);
- }
- }
-
-
- static void CallCombine(GLUtessellatorImpl tess, GLUvertex isect,
- Object[] data, float[] weights, boolean needed) {
- double[] coords = new double[3];
-
- /* Copy coord data in case the callback changes it. */
- coords[0] = isect.coords[0];
- coords[1] = isect.coords[1];
- coords[2] = isect.coords[2];
-
- Object[] outData = new Object[1];
- tess.callCombineOrCombineData(coords, data, weights, outData);
- isect.data = outData[0];
- if (isect.data == null) {
- if (!needed) {
- isect.data = data[0];
- } else if (!tess.fatalError) {
- /* The only way fatal error is when two edges are found to intersect,
- * but the user has not provided the callback necessary to handle
- * generated intersection points.
- */
- tess.callErrorOrErrorData(PGLU.GLU_TESS_NEED_COMBINE_CALLBACK);
- tess.fatalError = true;
- }
- }
- }
-
- static void SpliceMergeVertices(GLUtessellatorImpl tess, GLUhalfEdge e1,
- GLUhalfEdge e2)
-/*
- * Two vertices with idential coordinates are combined into one.
- * e1.Org is kept, while e2.Org is discarded.
- */ {
- Object[] data = new Object[4];
- float[] weights = new float[]{0.5f, 0.5f, 0.0f, 0.0f};
-
- data[0] = e1.Org.data;
- data[1] = e2.Org.data;
- CallCombine(tess, e1.Org, data, weights, false);
- if (!Mesh.__gl_meshSplice(e1, e2)) throw new RuntimeException();
- }
-
- static void VertexWeights(GLUvertex isect, GLUvertex org, GLUvertex dst,
- float[] weights)
-/*
- * Find some weights which describe how the intersection vertex is
- * a linear combination of "org" and "dest". Each of the two edges
- * which generated "isect" is allocated 50% of the weight; each edge
- * splits the weight between its org and dst according to the
- * relative distance to "isect".
- */ {
- double t1 = Geom.VertL1dist(org, isect);
- double t2 = Geom.VertL1dist(dst, isect);
-
- weights[0] = (float) (0.5 * t2 / (t1 + t2));
- weights[1] = (float) (0.5 * t1 / (t1 + t2));
- isect.coords[0] += weights[0] * org.coords[0] + weights[1] * dst.coords[0];
- isect.coords[1] += weights[0] * org.coords[1] + weights[1] * dst.coords[1];
- isect.coords[2] += weights[0] * org.coords[2] + weights[1] * dst.coords[2];
- }
-
-
- static void GetIntersectData(GLUtessellatorImpl tess, GLUvertex isect,
- GLUvertex orgUp, GLUvertex dstUp,
- GLUvertex orgLo, GLUvertex dstLo)
-/*
- * We've computed a new intersection point, now we need a "data" pointer
- * from the user so that we can refer to this new vertex in the
- * rendering callbacks.
- */ {
- Object[] data = new Object[4];
- float[] weights = new float[4];
- float[] weights1 = new float[2];
- float[] weights2 = new float[2];
-
- data[0] = orgUp.data;
- data[1] = dstUp.data;
- data[2] = orgLo.data;
- data[3] = dstLo.data;
-
- isect.coords[0] = isect.coords[1] = isect.coords[2] = 0;
- VertexWeights(isect, orgUp, dstUp, weights1);
- VertexWeights(isect, orgLo, dstLo, weights2);
- System.arraycopy(weights1, 0, weights, 0, 2);
- System.arraycopy(weights2, 0, weights, 2, 2);
-
- CallCombine(tess, isect, data, weights, true);
- }
-
- static boolean CheckForRightSplice(GLUtessellatorImpl tess, ActiveRegion regUp)
-/*
- * Check the upper and lower edge of "regUp", to make sure that the
- * eUp.Org is above eLo, or eLo.Org is below eUp (depending on which
- * origin is leftmost).
- *
- * The main purpose is to splice right-going edges with the same
- * dest vertex and nearly identical slopes (ie. we can't distinguish
- * the slopes numerically). However the splicing can also help us
- * to recover from numerical errors. For example, suppose at one
- * point we checked eUp and eLo, and decided that eUp.Org is barely
- * above eLo. Then later, we split eLo into two edges (eg. from
- * a splice operation like this one). This can change the result of
- * our test so that now eUp.Org is incident to eLo, or barely below it.
- * We must correct this condition to maintain the dictionary invariants.
- *
- * One possibility is to check these edges for intersection again
- * (ie. CheckForIntersect). This is what we do if possible. However
- * CheckForIntersect requires that tess.event lies between eUp and eLo,
- * so that it has something to fall back on when the intersection
- * calculation gives us an unusable answer. So, for those cases where
- * we can't check for intersection, this routine fixes the problem
- * by just splicing the offending vertex into the other edge.
- * This is a guaranteed solution, no matter how degenerate things get.
- * Basically this is a combinatorial solution to a numerical problem.
- */ {
- ActiveRegion regLo = RegionBelow(regUp);
- GLUhalfEdge eUp = regUp.eUp;
- GLUhalfEdge eLo = regLo.eUp;
-
- if (Geom.VertLeq(eUp.Org, eLo.Org)) {
- if (Geom.EdgeSign(eLo.Sym.Org, eUp.Org, eLo.Org) > 0) return false;
-
- /* eUp.Org appears to be below eLo */
- if (!Geom.VertEq(eUp.Org, eLo.Org)) {
- /* Splice eUp.Org into eLo */
- if (Mesh.__gl_meshSplitEdge(eLo.Sym) == null) throw new RuntimeException();
- if (!Mesh.__gl_meshSplice(eUp, eLo.Sym.Lnext)) throw new RuntimeException();
- regUp.dirty = regLo.dirty = true;
-
- } else if (eUp.Org != eLo.Org) {
- /* merge the two vertices, discarding eUp.Org */
- tess.pq.pqDelete(eUp.Org.pqHandle); /* __gl_pqSortDelete */
- SpliceMergeVertices(tess, eLo.Sym.Lnext, eUp);
- }
- } else {
- if (Geom.EdgeSign(eUp.Sym.Org, eLo.Org, eUp.Org) < 0) return false;
-
- /* eLo.Org appears to be above eUp, so splice eLo.Org into eUp */
- RegionAbove(regUp).dirty = regUp.dirty = true;
- if (Mesh.__gl_meshSplitEdge(eUp.Sym) == null) throw new RuntimeException();
- if (!Mesh.__gl_meshSplice(eLo.Sym.Lnext, eUp)) throw new RuntimeException();
- }
- return true;
- }
-
- static boolean CheckForLeftSplice(GLUtessellatorImpl tess, ActiveRegion regUp)
-/*
- * Check the upper and lower edge of "regUp", to make sure that the
- * eUp.Sym.Org is above eLo, or eLo.Sym.Org is below eUp (depending on which
- * destination is rightmost).
- *
- * Theoretically, this should always be true. However, splitting an edge
- * into two pieces can change the results of previous tests. For example,
- * suppose at one point we checked eUp and eLo, and decided that eUp.Sym.Org
- * is barely above eLo. Then later, we split eLo into two edges (eg. from
- * a splice operation like this one). This can change the result of
- * the test so that now eUp.Sym.Org is incident to eLo, or barely below it.
- * We must correct this condition to maintain the dictionary invariants
- * (otherwise new edges might get inserted in the wrong place in the
- * dictionary, and bad stuff will happen).
- *
- * We fix the problem by just splicing the offending vertex into the
- * other edge.
- */ {
- ActiveRegion regLo = RegionBelow(regUp);
- GLUhalfEdge eUp = regUp.eUp;
- GLUhalfEdge eLo = regLo.eUp;
- GLUhalfEdge e;
-
- assert (!Geom.VertEq(eUp.Sym.Org, eLo.Sym.Org));
-
- if (Geom.VertLeq(eUp.Sym.Org, eLo.Sym.Org)) {
- if (Geom.EdgeSign(eUp.Sym.Org, eLo.Sym.Org, eUp.Org) < 0) return false;
-
- /* eLo.Sym.Org is above eUp, so splice eLo.Sym.Org into eUp */
- RegionAbove(regUp).dirty = regUp.dirty = true;
- e = Mesh.__gl_meshSplitEdge(eUp);
- if (e == null) throw new RuntimeException();
- if (!Mesh.__gl_meshSplice(eLo.Sym, e)) throw new RuntimeException();
- e.Lface.inside = regUp.inside;
- } else {
- if (Geom.EdgeSign(eLo.Sym.Org, eUp.Sym.Org, eLo.Org) > 0) return false;
-
- /* eUp.Sym.Org is below eLo, so splice eUp.Sym.Org into eLo */
- regUp.dirty = regLo.dirty = true;
- e = Mesh.__gl_meshSplitEdge(eLo);
- if (e == null) throw new RuntimeException();
- if (!Mesh.__gl_meshSplice(eUp.Lnext, eLo.Sym)) throw new RuntimeException();
- e.Sym.Lface.inside = regUp.inside;
- }
- return true;
- }
-
-
- static boolean CheckForIntersect(GLUtessellatorImpl tess, ActiveRegion regUp)
-/*
- * Check the upper and lower edges of the given region to see if
- * they intersect. If so, create the intersection and add it
- * to the data structures.
- *
- * Returns true if adding the new intersection resulted in a recursive
- * call to AddRightEdges(); in this case all "dirty" regions have been
- * checked for intersections, and possibly regUp has been deleted.
- */ {
- ActiveRegion regLo = RegionBelow(regUp);
- GLUhalfEdge eUp = regUp.eUp;
- GLUhalfEdge eLo = regLo.eUp;
- GLUvertex orgUp = eUp.Org;
- GLUvertex orgLo = eLo.Org;
- GLUvertex dstUp = eUp.Sym.Org;
- GLUvertex dstLo = eLo.Sym.Org;
- double tMinUp, tMaxLo;
- GLUvertex isect = new GLUvertex();
- GLUvertex orgMin;
- GLUhalfEdge e;
-
- assert (!Geom.VertEq(dstLo, dstUp));
- assert (Geom.EdgeSign(dstUp, tess.event, orgUp) <= 0);
- assert (Geom.EdgeSign(dstLo, tess.event, orgLo) >= 0);
- assert (orgUp != tess.event && orgLo != tess.event);
- assert (!regUp.fixUpperEdge && !regLo.fixUpperEdge);
-
- if (orgUp == orgLo) return false; /* right endpoints are the same */
-
- tMinUp = Math.min(orgUp.t, dstUp.t);
- tMaxLo = Math.max(orgLo.t, dstLo.t);
- if (tMinUp > tMaxLo) return false; /* t ranges do not overlap */
-
- if (Geom.VertLeq(orgUp, orgLo)) {
- if (Geom.EdgeSign(dstLo, orgUp, orgLo) > 0) return false;
- } else {
- if (Geom.EdgeSign(dstUp, orgLo, orgUp) < 0) return false;
- }
-
- /* At this point the edges intersect, at least marginally */
- DebugEvent(tess);
-
- Geom.EdgeIntersect(dstUp, orgUp, dstLo, orgLo, isect);
- /* The following properties are guaranteed: */
- assert (Math.min(orgUp.t, dstUp.t) <= isect.t);
- assert (isect.t <= Math.max(orgLo.t, dstLo.t));
- assert (Math.min(dstLo.s, dstUp.s) <= isect.s);
- assert (isect.s <= Math.max(orgLo.s, orgUp.s));
-
- if (Geom.VertLeq(isect, tess.event)) {
- /* The intersection point lies slightly to the left of the sweep line,
- * so move it until it''s slightly to the right of the sweep line.
- * (If we had perfect numerical precision, this would never happen
- * in the first place). The easiest and safest thing to do is
- * replace the intersection by tess.event.
- */
- isect.s = tess.event.s;
- isect.t = tess.event.t;
- }
- /* Similarly, if the computed intersection lies to the right of the
- * rightmost origin (which should rarely happen), it can cause
- * unbelievable inefficiency on sufficiently degenerate inputs.
- * (If you have the test program, try running test54.d with the
- * "X zoom" option turned on).
- */
- orgMin = Geom.VertLeq(orgUp, orgLo) ? orgUp : orgLo;
- if (Geom.VertLeq(orgMin, isect)) {
- isect.s = orgMin.s;
- isect.t = orgMin.t;
- }
-
- if (Geom.VertEq(isect, orgUp) || Geom.VertEq(isect, orgLo)) {
- /* Easy case -- intersection at one of the right endpoints */
- CheckForRightSplice(tess, regUp);
- return false;
- }
-
- if ((!Geom.VertEq(dstUp, tess.event)
- && Geom.EdgeSign(dstUp, tess.event, isect) >= 0)
- || (!Geom.VertEq(dstLo, tess.event)
- && Geom.EdgeSign(dstLo, tess.event, isect) <= 0)) {
- /* Very unusual -- the new upper or lower edge would pass on the
- * wrong side of the sweep event, or through it. This can happen
- * due to very small numerical errors in the intersection calculation.
- */
- if (dstLo == tess.event) {
- /* Splice dstLo into eUp, and process the new region(s) */
- if (Mesh.__gl_meshSplitEdge(eUp.Sym) == null) throw new RuntimeException();
- if (!Mesh.__gl_meshSplice(eLo.Sym, eUp)) throw new RuntimeException();
- regUp = TopLeftRegion(regUp);
- if (regUp == null) throw new RuntimeException();
- eUp = RegionBelow(regUp).eUp;
- FinishLeftRegions(tess, RegionBelow(regUp), regLo);
- AddRightEdges(tess, regUp, eUp.Sym.Lnext, eUp, eUp, true);
- return true;
- }
- if (dstUp == tess.event) {
- /* Splice dstUp into eLo, and process the new region(s) */
- if (Mesh.__gl_meshSplitEdge(eLo.Sym) == null) throw new RuntimeException();
- if (!Mesh.__gl_meshSplice(eUp.Lnext, eLo.Sym.Lnext)) throw new RuntimeException();
- regLo = regUp;
- regUp = TopRightRegion(regUp);
- e = RegionBelow(regUp).eUp.Sym.Onext;
- regLo.eUp = eLo.Sym.Lnext;
- eLo = FinishLeftRegions(tess, regLo, null);
- AddRightEdges(tess, regUp, eLo.Onext, eUp.Sym.Onext, e, true);
- return true;
- }
- /* Special case: called from ConnectRightVertex. If either
- * edge passes on the wrong side of tess.event, split it
- * (and wait for ConnectRightVertex to splice it appropriately).
- */
- if (Geom.EdgeSign(dstUp, tess.event, isect) >= 0) {
- RegionAbove(regUp).dirty = regUp.dirty = true;
- if (Mesh.__gl_meshSplitEdge(eUp.Sym) == null) throw new RuntimeException();
- eUp.Org.s = tess.event.s;
- eUp.Org.t = tess.event.t;
- }
- if (Geom.EdgeSign(dstLo, tess.event, isect) <= 0) {
- regUp.dirty = regLo.dirty = true;
- if (Mesh.__gl_meshSplitEdge(eLo.Sym) == null) throw new RuntimeException();
- eLo.Org.s = tess.event.s;
- eLo.Org.t = tess.event.t;
- }
- /* leave the rest for ConnectRightVertex */
- return false;
- }
-
- /* General case -- split both edges, splice into new vertex.
- * When we do the splice operation, the order of the arguments is
- * arbitrary as far as correctness goes. However, when the operation
- * creates a new face, the work done is proportional to the size of
- * the new face. We expect the faces in the processed part of
- * the mesh (ie. eUp.Lface) to be smaller than the faces in the
- * unprocessed original contours (which will be eLo.Sym.Lnext.Lface).
- */
- if (Mesh.__gl_meshSplitEdge(eUp.Sym) == null) throw new RuntimeException();
- if (Mesh.__gl_meshSplitEdge(eLo.Sym) == null) throw new RuntimeException();
- if (!Mesh.__gl_meshSplice(eLo.Sym.Lnext, eUp)) throw new RuntimeException();
- eUp.Org.s = isect.s;
- eUp.Org.t = isect.t;
- eUp.Org.pqHandle = tess.pq.pqInsert(eUp.Org); /* __gl_pqSortInsert */
- if (eUp.Org.pqHandle == Long.MAX_VALUE) {
- tess.pq.pqDeletePriorityQ(); /* __gl_pqSortDeletePriorityQ */
- tess.pq = null;
- throw new RuntimeException();
- }
- GetIntersectData(tess, eUp.Org, orgUp, dstUp, orgLo, dstLo);
- RegionAbove(regUp).dirty = regUp.dirty = regLo.dirty = true;
- return false;
- }
-
- static void WalkDirtyRegions(GLUtessellatorImpl tess, ActiveRegion regUp)
-/*
- * When the upper or lower edge of any region changes, the region is
- * marked "dirty". This routine walks through all the dirty regions
- * and makes sure that the dictionary invariants are satisfied
- * (see the comments at the beginning of this file). Of course
- * new dirty regions can be created as we make changes to restore
- * the invariants.
- */ {
- ActiveRegion regLo = RegionBelow(regUp);
- GLUhalfEdge eUp, eLo;
-
- for (; ;) {
- /* Find the lowest dirty region (we walk from the bottom up). */
- while (regLo.dirty) {
- regUp = regLo;
- regLo = RegionBelow(regLo);
- }
- if (!regUp.dirty) {
- regLo = regUp;
- regUp = RegionAbove(regUp);
- if (regUp == null || !regUp.dirty) {
- /* We've walked all the dirty regions */
- return;
- }
- }
- regUp.dirty = false;
- eUp = regUp.eUp;
- eLo = regLo.eUp;
-
- if (eUp.Sym.Org != eLo.Sym.Org) {
- /* Check that the edge ordering is obeyed at the Dst vertices. */
- if (CheckForLeftSplice(tess, regUp)) {
-
- /* If the upper or lower edge was marked fixUpperEdge, then
- * we no longer need it (since these edges are needed only for
- * vertices which otherwise have no right-going edges).
- */
- if (regLo.fixUpperEdge) {
- DeleteRegion(tess, regLo);
- if (!Mesh.__gl_meshDelete(eLo)) throw new RuntimeException();
- regLo = RegionBelow(regUp);
- eLo = regLo.eUp;
- } else if (regUp.fixUpperEdge) {
- DeleteRegion(tess, regUp);
- if (!Mesh.__gl_meshDelete(eUp)) throw new RuntimeException();
- regUp = RegionAbove(regLo);
- eUp = regUp.eUp;
- }
- }
- }
- if (eUp.Org != eLo.Org) {
- if (eUp.Sym.Org != eLo.Sym.Org
- && !regUp.fixUpperEdge && !regLo.fixUpperEdge
- && (eUp.Sym.Org == tess.event || eLo.Sym.Org == tess.event)) {
- /* When all else fails in CheckForIntersect(), it uses tess.event
- * as the intersection location. To make this possible, it requires
- * that tess.event lie between the upper and lower edges, and also
- * that neither of these is marked fixUpperEdge (since in the worst
- * case it might splice one of these edges into tess.event, and
- * violate the invariant that fixable edges are the only right-going
- * edge from their associated vertex).
- */
- if (CheckForIntersect(tess, regUp)) {
- /* WalkDirtyRegions() was called recursively; we're done */
- return;
- }
- } else {
- /* Even though we can't use CheckForIntersect(), the Org vertices
- * may violate the dictionary edge ordering. Check and correct this.
- */
- CheckForRightSplice(tess, regUp);
- }
- }
- if (eUp.Org == eLo.Org && eUp.Sym.Org == eLo.Sym.Org) {
- /* A degenerate loop consisting of only two edges -- delete it. */
- AddWinding(eLo, eUp);
- DeleteRegion(tess, regUp);
- if (!Mesh.__gl_meshDelete(eUp)) throw new RuntimeException();
- regUp = RegionAbove(regLo);
- }
- }
- }
-
-
- static void ConnectRightVertex(GLUtessellatorImpl tess, ActiveRegion regUp,
- GLUhalfEdge eBottomLeft)
-/*
- * Purpose: connect a "right" vertex vEvent (one where all edges go left)
- * to the unprocessed portion of the mesh. Since there are no right-going
- * edges, two regions (one above vEvent and one below) are being merged
- * into one. "regUp" is the upper of these two regions.
- *
- * There are two reasons for doing this (adding a right-going edge):
- * - if the two regions being merged are "inside", we must add an edge
- * to keep them separated (the combined region would not be monotone).
- * - in any case, we must leave some record of vEvent in the dictionary,
- * so that we can merge vEvent with features that we have not seen yet.
- * For example, maybe there is a vertical edge which passes just to
- * the right of vEvent; we would like to splice vEvent into this edge.
- *
- * However, we don't want to connect vEvent to just any vertex. We don''t
- * want the new edge to cross any other edges; otherwise we will create
- * intersection vertices even when the input data had no self-intersections.
- * (This is a bad thing; if the user's input data has no intersections,
- * we don't want to generate any false intersections ourselves.)
- *
- * Our eventual goal is to connect vEvent to the leftmost unprocessed
- * vertex of the combined region (the union of regUp and regLo).
- * But because of unseen vertices with all right-going edges, and also
- * new vertices which may be created by edge intersections, we don''t
- * know where that leftmost unprocessed vertex is. In the meantime, we
- * connect vEvent to the closest vertex of either chain, and mark the region
- * as "fixUpperEdge". This flag says to delete and reconnect this edge
- * to the next processed vertex on the boundary of the combined region.
- * Quite possibly the vertex we connected to will turn out to be the
- * closest one, in which case we won''t need to make any changes.
- */ {
- GLUhalfEdge eNew;
- GLUhalfEdge eTopLeft = eBottomLeft.Onext;
- ActiveRegion regLo = RegionBelow(regUp);
- GLUhalfEdge eUp = regUp.eUp;
- GLUhalfEdge eLo = regLo.eUp;
- boolean degenerate = false;
-
- if (eUp.Sym.Org != eLo.Sym.Org) {
- CheckForIntersect(tess, regUp);
- }
-
- /* Possible new degeneracies: upper or lower edge of regUp may pass
- * through vEvent, or may coincide with new intersection vertex
- */
- if (Geom.VertEq(eUp.Org, tess.event)) {
- if (!Mesh.__gl_meshSplice(eTopLeft.Sym.Lnext, eUp)) throw new RuntimeException();
- regUp = TopLeftRegion(regUp);
- if (regUp == null) throw new RuntimeException();
- eTopLeft = RegionBelow(regUp).eUp;
- FinishLeftRegions(tess, RegionBelow(regUp), regLo);
- degenerate = true;
- }
- if (Geom.VertEq(eLo.Org, tess.event)) {
- if (!Mesh.__gl_meshSplice(eBottomLeft, eLo.Sym.Lnext)) throw new RuntimeException();
- eBottomLeft = FinishLeftRegions(tess, regLo, null);
- degenerate = true;
- }
- if (degenerate) {
- AddRightEdges(tess, regUp, eBottomLeft.Onext, eTopLeft, eTopLeft, true);
- return;
- }
-
- /* Non-degenerate situation -- need to add a temporary, fixable edge.
- * Connect to the closer of eLo.Org, eUp.Org.
- */
- if (Geom.VertLeq(eLo.Org, eUp.Org)) {
- eNew = eLo.Sym.Lnext;
- } else {
- eNew = eUp;
- }
- eNew = Mesh.__gl_meshConnect(eBottomLeft.Onext.Sym, eNew);
- if (eNew == null) throw new RuntimeException();
-
- /* Prevent cleanup, otherwise eNew might disappear before we've even
- * had a chance to mark it as a temporary edge.
- */
- AddRightEdges(tess, regUp, eNew, eNew.Onext, eNew.Onext, false);
- eNew.Sym.activeRegion.fixUpperEdge = true;
- WalkDirtyRegions(tess, regUp);
- }
-
-/* Because vertices at exactly the same location are merged together
- * before we process the sweep event, some degenerate cases can't occur.
- * However if someone eventually makes the modifications required to
- * merge features which are close together, the cases below marked
- * TOLERANCE_NONZERO will be useful. They were debugged before the
- * code to merge identical vertices in the main loop was added.
- */
- private static final boolean TOLERANCE_NONZERO = false;
-
- static void ConnectLeftDegenerate(GLUtessellatorImpl tess,
- ActiveRegion regUp, GLUvertex vEvent)
-/*
- * The event vertex lies exacty on an already-processed edge or vertex.
- * Adding the new vertex involves splicing it into the already-processed
- * part of the mesh.
- */ {
- GLUhalfEdge e, eTopLeft, eTopRight, eLast;
- ActiveRegion reg;
-
- e = regUp.eUp;
- if (Geom.VertEq(e.Org, vEvent)) {
- /* e.Org is an unprocessed vertex - just combine them, and wait
- * for e.Org to be pulled from the queue
- */
- assert (TOLERANCE_NONZERO);
- SpliceMergeVertices(tess, e, vEvent.anEdge);
- return;
- }
-
- if (!Geom.VertEq(e.Sym.Org, vEvent)) {
- /* General case -- splice vEvent into edge e which passes through it */
- if (Mesh.__gl_meshSplitEdge(e.Sym) == null) throw new RuntimeException();
- if (regUp.fixUpperEdge) {
- /* This edge was fixable -- delete unused portion of original edge */
- if (!Mesh.__gl_meshDelete(e.Onext)) throw new RuntimeException();
- regUp.fixUpperEdge = false;
- }
- if (!Mesh.__gl_meshSplice(vEvent.anEdge, e)) throw new RuntimeException();
- SweepEvent(tess, vEvent); /* recurse */
- return;
- }
-
- /* vEvent coincides with e.Sym.Org, which has already been processed.
- * Splice in the additional right-going edges.
- */
- assert (TOLERANCE_NONZERO);
- regUp = TopRightRegion(regUp);
- reg = RegionBelow(regUp);
- eTopRight = reg.eUp.Sym;
- eTopLeft = eLast = eTopRight.Onext;
- if (reg.fixUpperEdge) {
- /* Here e.Sym.Org has only a single fixable edge going right.
- * We can delete it since now we have some real right-going edges.
- */
- assert (eTopLeft != eTopRight); /* there are some left edges too */
- DeleteRegion(tess, reg);
- if (!Mesh.__gl_meshDelete(eTopRight)) throw new RuntimeException();
- eTopRight = eTopLeft.Sym.Lnext;
- }
- if (!Mesh.__gl_meshSplice(vEvent.anEdge, eTopRight)) throw new RuntimeException();
- if (!Geom.EdgeGoesLeft(eTopLeft)) {
- /* e.Sym.Org had no left-going edges -- indicate this to AddRightEdges() */
- eTopLeft = null;
- }
- AddRightEdges(tess, regUp, eTopRight.Onext, eLast, eTopLeft, true);
- }
-
-
- static void ConnectLeftVertex(GLUtessellatorImpl tess, GLUvertex vEvent)
-/*
- * Purpose: connect a "left" vertex (one where both edges go right)
- * to the processed portion of the mesh. Let R be the active region
- * containing vEvent, and let U and L be the upper and lower edge
- * chains of R. There are two possibilities:
- *
- * - the normal case: split R into two regions, by connecting vEvent to
- * the rightmost vertex of U or L lying to the left of the sweep line
- *
- * - the degenerate case: if vEvent is close enough to U or L, we
- * merge vEvent into that edge chain. The subcases are:
- * - merging with the rightmost vertex of U or L
- * - merging with the active edge of U or L
- * - merging with an already-processed portion of U or L
- */ {
- ActiveRegion regUp, regLo, reg;
- GLUhalfEdge eUp, eLo, eNew;
- ActiveRegion tmp = new ActiveRegion();
-
- /* assert ( vEvent.anEdge.Onext.Onext == vEvent.anEdge ); */
-
- /* Get a pointer to the active region containing vEvent */
- tmp.eUp = vEvent.anEdge.Sym;
- /* __GL_DICTLISTKEY */ /* __gl_dictListSearch */
- regUp = (ActiveRegion) Dict.dictKey(Dict.dictSearch(tess.dict, tmp));
- regLo = RegionBelow(regUp);
- eUp = regUp.eUp;
- eLo = regLo.eUp;
-
- /* Try merging with U or L first */
- if (Geom.EdgeSign(eUp.Sym.Org, vEvent, eUp.Org) == 0) {
- ConnectLeftDegenerate(tess, regUp, vEvent);
- return;
- }
-
- /* Connect vEvent to rightmost processed vertex of either chain.
- * e.Sym.Org is the vertex that we will connect to vEvent.
- */
- reg = Geom.VertLeq(eLo.Sym.Org, eUp.Sym.Org) ? regUp : regLo;
-
- if (regUp.inside || reg.fixUpperEdge) {
- if (reg == regUp) {
- eNew = Mesh.__gl_meshConnect(vEvent.anEdge.Sym, eUp.Lnext);
- if (eNew == null) throw new RuntimeException();
- } else {
- GLUhalfEdge tempHalfEdge = Mesh.__gl_meshConnect(eLo.Sym.Onext.Sym, vEvent.anEdge);
- if (tempHalfEdge == null) throw new RuntimeException();
-
- eNew = tempHalfEdge.Sym;
- }
- if (reg.fixUpperEdge) {
- if (!FixUpperEdge(reg, eNew)) throw new RuntimeException();
- } else {
- ComputeWinding(tess, AddRegionBelow(tess, regUp, eNew));
- }
- SweepEvent(tess, vEvent);
- } else {
- /* The new vertex is in a region which does not belong to the polygon.
- * We don''t need to connect this vertex to the rest of the mesh.
- */
- AddRightEdges(tess, regUp, vEvent.anEdge, vEvent.anEdge, null, true);
- }
- }
-
-
- static void SweepEvent(GLUtessellatorImpl tess, GLUvertex vEvent)
-/*
- * Does everything necessary when the sweep line crosses a vertex.
- * Updates the mesh and the edge dictionary.
- */ {
- ActiveRegion regUp, reg;
- GLUhalfEdge e, eTopLeft, eBottomLeft;
-
- tess.event = vEvent; /* for access in EdgeLeq() */
- DebugEvent(tess);
-
- /* Check if this vertex is the right endpoint of an edge that is
- * already in the dictionary. In this case we don't need to waste
- * time searching for the location to insert new edges.
- */
- e = vEvent.anEdge;
- while (e.activeRegion == null) {
- e = e.Onext;
- if (e == vEvent.anEdge) {
- /* All edges go right -- not incident to any processed edges */
- ConnectLeftVertex(tess, vEvent);
- return;
- }
- }
-
- /* Processing consists of two phases: first we "finish" all the
- * active regions where both the upper and lower edges terminate
- * at vEvent (ie. vEvent is closing off these regions).
- * We mark these faces "inside" or "outside" the polygon according
- * to their winding number, and delete the edges from the dictionary.
- * This takes care of all the left-going edges from vEvent.
- */
- regUp = TopLeftRegion(e.activeRegion);
- if (regUp == null) throw new RuntimeException();
- reg = RegionBelow(regUp);
- eTopLeft = reg.eUp;
- eBottomLeft = FinishLeftRegions(tess, reg, null);
-
- /* Next we process all the right-going edges from vEvent. This
- * involves adding the edges to the dictionary, and creating the
- * associated "active regions" which record information about the
- * regions between adjacent dictionary edges.
- */
- if (eBottomLeft.Onext == eTopLeft) {
- /* No right-going edges -- add a temporary "fixable" edge */
- ConnectRightVertex(tess, regUp, eBottomLeft);
- } else {
- AddRightEdges(tess, regUp, eBottomLeft.Onext, eTopLeft, eTopLeft, true);
- }
- }
-
-
-/* Make the sentinel coordinates big enough that they will never be
- * merged with real input features. (Even with the largest possible
- * input contour and the maximum tolerance of 1.0, no merging will be
- * done with coordinates larger than 3 * GLU_TESS_MAX_COORD).
- */
- private static final double SENTINEL_COORD = (4.0 * PGLU.GLU_TESS_MAX_COORD);
-
- static void AddSentinel(GLUtessellatorImpl tess, double t)
-/*
- * We add two sentinel edges above and below all other edges,
- * to avoid special cases at the top and bottom.
- */ {
- GLUhalfEdge e;
- ActiveRegion reg = new ActiveRegion();
- if (reg == null) throw new RuntimeException();
-
- e = Mesh.__gl_meshMakeEdge(tess.mesh);
- if (e == null) throw new RuntimeException();
-
- e.Org.s = SENTINEL_COORD;
- e.Org.t = t;
- e.Sym.Org.s = -SENTINEL_COORD;
- e.Sym.Org.t = t;
- tess.event = e.Sym.Org; /* initialize it */
-
- reg.eUp = e;
- reg.windingNumber = 0;
- reg.inside = false;
- reg.fixUpperEdge = false;
- reg.sentinel = true;
- reg.dirty = false;
- reg.nodeUp = Dict.dictInsert(tess.dict, reg); /* __gl_dictListInsertBefore */
- if (reg.nodeUp == null) throw new RuntimeException();
- }
-
-
- static void InitEdgeDict(final GLUtessellatorImpl tess)
-/*
- * We maintain an ordering of edge intersections with the sweep line.
- * This order is maintained in a dynamic dictionary.
- */ {
- /* __gl_dictListNewDict */
- tess.dict = Dict.dictNewDict(tess, new Dict.DictLeq() {
- public boolean leq(Object frame, Object key1, Object key2) {
- return EdgeLeq(tess, (ActiveRegion) key1, (ActiveRegion) key2);
- }
- });
- if (tess.dict == null) throw new RuntimeException();
-
- AddSentinel(tess, -SENTINEL_COORD);
- AddSentinel(tess, SENTINEL_COORD);
- }
-
-
- static void DoneEdgeDict(GLUtessellatorImpl tess) {
- ActiveRegion reg;
- int fixedEdges = 0;
-
- /* __GL_DICTLISTKEY */ /* __GL_DICTLISTMIN */
- while ((reg = (ActiveRegion) Dict.dictKey(Dict.dictMin(tess.dict))) != null) {
- /*
- * At the end of all processing, the dictionary should contain
- * only the two sentinel edges, plus at most one "fixable" edge
- * created by ConnectRightVertex().
- */
- if (!reg.sentinel) {
- assert (reg.fixUpperEdge);
- assert (++fixedEdges == 1);
- }
- assert (reg.windingNumber == 0);
- DeleteRegion(tess, reg);
-/* __gl_meshDelete( reg.eUp );*/
- }
- Dict.dictDeleteDict(tess.dict); /* __gl_dictListDeleteDict */
- }
-
-
- static void RemoveDegenerateEdges(GLUtessellatorImpl tess)
-/*
- * Remove zero-length edges, and contours with fewer than 3 vertices.
- */ {
- GLUhalfEdge e, eNext, eLnext;
- GLUhalfEdge eHead = tess.mesh.eHead;
-
- /*LINTED*/
- for (e = eHead.next; e != eHead; e = eNext) {
- eNext = e.next;
- eLnext = e.Lnext;
-
- if (Geom.VertEq(e.Org, e.Sym.Org) && e.Lnext.Lnext != e) {
- /* Zero-length edge, contour has at least 3 edges */
-
- SpliceMergeVertices(tess, eLnext, e); /* deletes e.Org */
- if (!Mesh.__gl_meshDelete(e)) throw new RuntimeException(); /* e is a self-loop */
- e = eLnext;
- eLnext = e.Lnext;
- }
- if (eLnext.Lnext == e) {
- /* Degenerate contour (one or two edges) */
-
- if (eLnext != e) {
- if (eLnext == eNext || eLnext == eNext.Sym) {
- eNext = eNext.next;
- }
- if (!Mesh.__gl_meshDelete(eLnext)) throw new RuntimeException();
- }
- if (e == eNext || e == eNext.Sym) {
- eNext = eNext.next;
- }
- if (!Mesh.__gl_meshDelete(e)) throw new RuntimeException();
- }
- }
- }
-
- static boolean InitPriorityQ(GLUtessellatorImpl tess)
-/*
- * Insert all vertices into the priority queue which determines the
- * order in which vertices cross the sweep line.
- */ {
- PriorityQ pq;
- GLUvertex v, vHead;
-
- /* __gl_pqSortNewPriorityQ */
- pq = tess.pq = PriorityQ.pqNewPriorityQ(new PriorityQ.Leq() {
- public boolean leq(Object key1, Object key2) {
- return Geom.VertLeq(((GLUvertex) key1), (GLUvertex) key2);
- }
- });
- if (pq == null) return false;
-
- vHead = tess.mesh.vHead;
- for (v = vHead.next; v != vHead; v = v.next) {
- v.pqHandle = pq.pqInsert(v); /* __gl_pqSortInsert */
- if (v.pqHandle == Long.MAX_VALUE) break;
- }
- if (v != vHead || !pq.pqInit()) { /* __gl_pqSortInit */
- tess.pq.pqDeletePriorityQ(); /* __gl_pqSortDeletePriorityQ */
- tess.pq = null;
- return false;
- }
-
- return true;
- }
-
-
- static void DonePriorityQ(GLUtessellatorImpl tess) {
- tess.pq.pqDeletePriorityQ(); /* __gl_pqSortDeletePriorityQ */
- }
-
-
- static boolean RemoveDegenerateFaces(GLUmesh mesh)
-/*
- * Delete any degenerate faces with only two edges. WalkDirtyRegions()
- * will catch almost all of these, but it won't catch degenerate faces
- * produced by splice operations on already-processed edges.
- * The two places this can happen are in FinishLeftRegions(), when
- * we splice in a "temporary" edge produced by ConnectRightVertex(),
- * and in CheckForLeftSplice(), where we splice already-processed
- * edges to ensure that our dictionary invariants are not violated
- * by numerical errors.
- *
- * In both these cases it is *very* dangerous to delete the offending
- * edge at the time, since one of the routines further up the stack
- * will sometimes be keeping a pointer to that edge.
- */ {
- GLUface f, fNext;
- GLUhalfEdge e;
-
- /*LINTED*/
- for (f = mesh.fHead.next; f != mesh.fHead; f = fNext) {
- fNext = f.next;
- e = f.anEdge;
- assert (e.Lnext != e);
-
- if (e.Lnext.Lnext == e) {
- /* A face with only two edges */
- AddWinding(e.Onext, e);
- if (!Mesh.__gl_meshDelete(e)) return false;
- }
- }
- return true;
- }
-
- public static boolean __gl_computeInterior(GLUtessellatorImpl tess)
-/*
- * __gl_computeInterior( tess ) computes the planar arrangement specified
- * by the given contours, and further subdivides this arrangement
- * into regions. Each region is marked "inside" if it belongs
- * to the polygon, according to the rule given by tess.windingRule.
- * Each interior region is guaranteed be monotone.
- */ {
- GLUvertex v, vNext;
-
- tess.fatalError = false;
-
- /* Each vertex defines an event for our sweep line. Start by inserting
- * all the vertices in a priority queue. Events are processed in
- * lexicographic order, ie.
- *
- * e1 < e2 iff e1.x < e2.x || (e1.x == e2.x && e1.y < e2.y)
- */
- RemoveDegenerateEdges(tess);
- if (!InitPriorityQ(tess)) return false; /* if error */
- InitEdgeDict(tess);
-
- /* __gl_pqSortExtractMin */
- while ((v = (GLUvertex) tess.pq.pqExtractMin()) != null) {
- for (; ;) {
- vNext = (GLUvertex) tess.pq.pqMinimum(); /* __gl_pqSortMinimum */
- if (vNext == null || !Geom.VertEq(vNext, v)) break;
-
- /* Merge together all vertices at exactly the same location.
- * This is more efficient than processing them one at a time,
- * simplifies the code (see ConnectLeftDegenerate), and is also
- * important for correct handling of certain degenerate cases.
- * For example, suppose there are two identical edges A and B
- * that belong to different contours (so without this code they would
- * be processed by separate sweep events). Suppose another edge C
- * crosses A and B from above. When A is processed, we split it
- * at its intersection point with C. However this also splits C,
- * so when we insert B we may compute a slightly different
- * intersection point. This might leave two edges with a small
- * gap between them. This kind of error is especially obvious
- * when using boundary extraction (GLU_TESS_BOUNDARY_ONLY).
- */
- vNext = (GLUvertex) tess.pq.pqExtractMin(); /* __gl_pqSortExtractMin*/
- SpliceMergeVertices(tess, v.anEdge, vNext.anEdge);
- }
- SweepEvent(tess, v);
- }
-
- /* Set tess.event for debugging purposes */
- /* __GL_DICTLISTKEY */ /* __GL_DICTLISTMIN */
- tess.event = ((ActiveRegion) Dict.dictKey(Dict.dictMin(tess.dict))).eUp.Org;
- DebugEvent(tess);
- DoneEdgeDict(tess);
- DonePriorityQ(tess);
-
- if (!RemoveDegenerateFaces(tess.mesh)) return false;
- Mesh.__gl_meshCheckMesh(tess.mesh);
-
- return true;
- }
-}
diff --git a/android/core/src/processing/opengl/tess/TessMono.java b/android/core/src/processing/opengl/tess/TessMono.java
deleted file mode 100644
index 683197f6c4..0000000000
--- a/android/core/src/processing/opengl/tess/TessMono.java
+++ /dev/null
@@ -1,243 +0,0 @@
-/*
-* Portions Copyright (C) 2003-2006 Sun Microsystems, Inc.
-* All rights reserved.
-*/
-
-/*
-** License Applicability. Except to the extent portions of this file are
-** made subject to an alternative license as permitted in the SGI Free
-** Software License B, Version 2.0 (the "License"), the contents of this
-** file are subject only to the provisions of the License. You may not use
-** this file except in compliance with the License. You may obtain a copy
-** of the License at Silicon Graphics, Inc., attn: Legal Services, 1600
-** Amphitheatre Parkway, Mountain View, CA 94043-1351, or at:
-**
-** http://oss.sgi.com/projects/FreeB
-**
-** Note that, as provided in the License, the Software is distributed on an
-** "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS
-** DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND
-** CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A
-** PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
-**
-** NOTE: The Original Code (as defined below) has been licensed to Sun
-** Microsystems, Inc. ("Sun") under the SGI Free Software License B
-** (Version 1.1), shown above ("SGI License"). Pursuant to Section
-** 3.2(3) of the SGI License, Sun is distributing the Covered Code to
-** you under an alternative license ("Alternative License"). This
-** Alternative License includes all of the provisions of the SGI License
-** except that Section 2.2 and 11 are omitted. Any differences between
-** the Alternative License and the SGI License are offered solely by Sun
-** and not by SGI.
-**
-** Original Code. The Original Code is: OpenGL Sample Implementation,
-** Version 1.2.1, released January 26, 2000, developed by Silicon Graphics,
-** Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc.
-** Copyright in any portions created by third parties is as indicated
-** elsewhere herein. All Rights Reserved.
-**
-** Additional Notice Provisions: The application programming interfaces
-** established by SGI in conjunction with the Original Code are The
-** OpenGL(R) Graphics System: A Specification (Version 1.2.1), released
-** April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version
-** 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X
-** Window System(R) (Version 1.3), released October 19, 1998. This software
-** was created using the OpenGL(R) version 1.2.1 Sample Implementation
-** published by SGI, but has not been independently verified as being
-** compliant with the OpenGL(R) version 1.2.1 Specification.
-**
-** Author: Eric Veach, July 1994
-** Java Port: Pepijn Van Eeckhoudt, July 2003
-** Java Port: Nathan Parker Burg, August 2003
-** Processing integration: Andres Colubri, February 2012
-*/
-
-package processing.opengl.tess;
-
-class TessMono {
-/* __gl_meshTessellateMonoRegion( face ) tessellates a monotone region
- * (what else would it do??) The region must consist of a single
- * loop of half-edges (see mesh.h) oriented CCW. "Monotone" in this
- * case means that any vertical line intersects the interior of the
- * region in a single interval.
- *
- * Tessellation consists of adding interior edges (actually pairs of
- * half-edges), to split the region into non-overlapping triangles.
- *
- * The basic idea is explained in Preparata and Shamos (which I don''t
- * have handy right now), although their implementation is more
- * complicated than this one. The are two edge chains, an upper chain
- * and a lower chain. We process all vertices from both chains in order,
- * from right to left.
- *
- * The algorithm ensures that the following invariant holds after each
- * vertex is processed: the untessellated region consists of two
- * chains, where one chain (say the upper) is a single edge, and
- * the other chain is concave. The left vertex of the single edge
- * is always to the left of all vertices in the concave chain.
- *
- * Each step consists of adding the rightmost unprocessed vertex to one
- * of the two chains, and forming a fan of triangles from the rightmost
- * of two chain endpoints. Determining whether we can add each triangle
- * to the fan is a simple orientation test. By making the fan as large
- * as possible, we restore the invariant (check it yourself).
- */
- static boolean __gl_meshTessellateMonoRegion(GLUface face, boolean avoidDegenerateTris) {
- GLUhalfEdge up, lo;
-
- /* All edges are oriented CCW around the boundary of the region.
- * First, find the half-edge whose origin vertex is rightmost.
- * Since the sweep goes from left to right, face->anEdge should
- * be close to the edge we want.
- */
- up = face.anEdge;
- assert (up.Lnext != up && up.Lnext.Lnext != up);
-
- for (; Geom.VertLeq(up.Sym.Org, up.Org); up = up.Onext.Sym)
- ;
- for (; Geom.VertLeq(up.Org, up.Sym.Org); up = up.Lnext)
- ;
- lo = up.Onext.Sym;
-
- boolean mustConnect = false; // hack for avoidDegenerateTris
-
- while (up.Lnext != lo) {
- if (avoidDegenerateTris && !mustConnect) {
- // Skip over regions where several vertices are collinear,
- // to try to avoid producing degenerate (zero-area) triangles
- //
- // The "mustConnect" flag is a hack to try to avoid
- // skipping too large regions and causing incorrect
- // triangulations. This entire modification is overall
- // not robust and needs more work
- if (Geom.EdgeCos(lo.Lnext.Org, lo.Org, lo.Lnext.Lnext.Org) <= -Geom.ONE_MINUS_EPSILON) {
- // Lines around lo
- do {
- lo = lo.Onext.Sym;
- mustConnect = true;
- } while (up.Lnext != lo &&
- Geom.EdgeCos(lo.Lnext.Org, lo.Org, lo.Lnext.Lnext.Org) <= -Geom.ONE_MINUS_EPSILON);
- } else if (Geom.EdgeCos(up.Onext.Sym.Org, up.Org, up.Onext.Sym.Onext.Sym.Org) <= -Geom.ONE_MINUS_EPSILON) {
- // Lines around up
- do {
- up = up.Lnext;
- mustConnect = true;
- } while (up.Lnext != lo &&
- Geom.EdgeCos(up.Onext.Sym.Org, up.Org, up.Onext.Sym.Onext.Sym.Org) <= -Geom.ONE_MINUS_EPSILON);
- }
-
- if (up.Lnext == lo)
- break;
- }
-
- if (Geom.VertLeq(up.Sym.Org, lo.Org)) {
- /* up.Sym.Org is on the left. It is safe to form triangles from lo.Org.
- * The EdgeGoesLeft test guarantees progress even when some triangles
- * are CW, given that the upper and lower chains are truly monotone.
- */
- while (lo.Lnext != up && (Geom.EdgeGoesLeft(lo.Lnext)
- || Geom.EdgeSign(lo.Org, lo.Sym.Org, lo.Lnext.Sym.Org) <= 0)) {
- GLUhalfEdge tempHalfEdge = Mesh.__gl_meshConnect(lo.Lnext, lo);
- mustConnect = false;
- if (tempHalfEdge == null) return false;
- lo = tempHalfEdge.Sym;
- }
- lo = lo.Onext.Sym;
- } else {
- /* lo.Org is on the left. We can make CCW triangles from up.Sym.Org. */
- while (lo.Lnext != up && (Geom.EdgeGoesRight(up.Onext.Sym)
- || Geom.EdgeSign(up.Sym.Org, up.Org, up.Onext.Sym.Org) >= 0)) {
- GLUhalfEdge tempHalfEdge = Mesh.__gl_meshConnect(up, up.Onext.Sym);
- mustConnect = false;
- if (tempHalfEdge == null) return false;
- up = tempHalfEdge.Sym;
- }
- up = up.Lnext;
- }
- }
-
- /* Now lo.Org == up.Sym.Org == the leftmost vertex. The remaining region
- * can be tessellated in a fan from this leftmost vertex.
- */
- assert (lo.Lnext != up);
- while (lo.Lnext.Lnext != up) {
- GLUhalfEdge tempHalfEdge = Mesh.__gl_meshConnect(lo.Lnext, lo);
- if (tempHalfEdge == null) return false;
- lo = tempHalfEdge.Sym;
- }
-
- return true;
- }
-
-
-/* __gl_meshTessellateInterior( mesh ) tessellates each region of
- * the mesh which is marked "inside" the polygon. Each such region
- * must be monotone.
- */
- public static boolean __gl_meshTessellateInterior(GLUmesh mesh, boolean avoidDegenerateTris) {
- GLUface f, next;
-
- /*LINTED*/
- for (f = mesh.fHead.next; f != mesh.fHead; f = next) {
- /* Make sure we don''t try to tessellate the new triangles. */
- next = f.next;
- if (f.inside) {
- if (!__gl_meshTessellateMonoRegion(f, avoidDegenerateTris)) return false;
- }
- }
-
- return true;
- }
-
-
-/* __gl_meshDiscardExterior( mesh ) zaps (ie. sets to NULL) all faces
- * which are not marked "inside" the polygon. Since further mesh operations
- * on NULL faces are not allowed, the main purpose is to clean up the
- * mesh so that exterior loops are not represented in the data structure.
- */
- public static void __gl_meshDiscardExterior(GLUmesh mesh) {
- GLUface f, next;
-
- /*LINTED*/
- for (f = mesh.fHead.next; f != mesh.fHead; f = next) {
- /* Since f will be destroyed, save its next pointer. */
- next = f.next;
- if (!f.inside) {
- Mesh.__gl_meshZapFace(f);
- }
- }
- }
-
-// private static final int MARKED_FOR_DELETION = 0x7fffffff;
-
-/* __gl_meshSetWindingNumber( mesh, value, keepOnlyBoundary ) resets the
- * winding numbers on all edges so that regions marked "inside" the
- * polygon have a winding number of "value", and regions outside
- * have a winding number of 0.
- *
- * If keepOnlyBoundary is TRUE, it also deletes all edges which do not
- * separate an interior region from an exterior one.
- */
- public static boolean __gl_meshSetWindingNumber(GLUmesh mesh, int value, boolean keepOnlyBoundary) {
- GLUhalfEdge e, eNext;
-
- for (e = mesh.eHead.next; e != mesh.eHead; e = eNext) {
- eNext = e.next;
- if (e.Sym.Lface.inside != e.Lface.inside) {
-
- /* This is a boundary edge (one side is interior, one is exterior). */
- e.winding = (e.Lface.inside) ? value : -value;
- } else {
-
- /* Both regions are interior, or both are exterior. */
- if (!keepOnlyBoundary) {
- e.winding = 0;
- } else {
- if (!Mesh.__gl_meshDelete(e)) return false;
- }
- }
- }
- return true;
- }
-
-}
diff --git a/android/core/src/processing/opengl/tess/TessState.java b/android/core/src/processing/opengl/tess/TessState.java
deleted file mode 100644
index 123d3bf719..0000000000
--- a/android/core/src/processing/opengl/tess/TessState.java
+++ /dev/null
@@ -1,61 +0,0 @@
-/*
-* Portions Copyright (C) 2003-2006 Sun Microsystems, Inc.
-* All rights reserved.
-*/
-
-/*
-** License Applicability. Except to the extent portions of this file are
-** made subject to an alternative license as permitted in the SGI Free
-** Software License B, Version 2.0 (the "License"), the contents of this
-** file are subject only to the provisions of the License. You may not use
-** this file except in compliance with the License. You may obtain a copy
-** of the License at Silicon Graphics, Inc., attn: Legal Services, 1600
-** Amphitheatre Parkway, Mountain View, CA 94043-1351, or at:
-**
-** http://oss.sgi.com/projects/FreeB
-**
-** Note that, as provided in the License, the Software is distributed on an
-** "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS
-** DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND
-** CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A
-** PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
-**
-** NOTE: The Original Code (as defined below) has been licensed to Sun
-** Microsystems, Inc. ("Sun") under the SGI Free Software License B
-** (Version 1.1), shown above ("SGI License"). Pursuant to Section
-** 3.2(3) of the SGI License, Sun is distributing the Covered Code to
-** you under an alternative license ("Alternative License"). This
-** Alternative License includes all of the provisions of the SGI License
-** except that Section 2.2 and 11 are omitted. Any differences between
-** the Alternative License and the SGI License are offered solely by Sun
-** and not by SGI.
-**
-** Original Code. The Original Code is: OpenGL Sample Implementation,
-** Version 1.2.1, released January 26, 2000, developed by Silicon Graphics,
-** Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc.
-** Copyright in any portions created by third parties is as indicated
-** elsewhere herein. All Rights Reserved.
-**
-** Additional Notice Provisions: The application programming interfaces
-** established by SGI in conjunction with the Original Code are The
-** OpenGL(R) Graphics System: A Specification (Version 1.2.1), released
-** April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version
-** 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X
-** Window System(R) (Version 1.3), released October 19, 1998. This software
-** was created using the OpenGL(R) version 1.2.1 Sample Implementation
-** published by SGI, but has not been independently verified as being
-** compliant with the OpenGL(R) version 1.2.1 Specification.
-**
-** Author: Eric Veach, July 1994
-** Java Port: Pepijn Van Eeckhoudt, July 2003
-** Java Port: Nathan Parker Burg, August 2003
-** Processing integration: Andres Colubri, February 2012
-*/
-
-package processing.opengl.tess;
-
-class TessState {
- public static final int T_DORMANT = 0;
- public static final int T_IN_POLYGON = 1;
- public static final int T_IN_CONTOUR = 2;
-}
diff --git a/android/done.txt b/android/done.txt
deleted file mode 100644
index 6aa915498c..0000000000
--- a/android/done.txt
+++ /dev/null
@@ -1,671 +0,0 @@
-0215 android (2.0b7)
-X removing default imports for
-X android.view.MotionEvent, android.view.KeyEvent,android.graphics.Bitmap
-X due to conflicts w/ the new p5 event system
-X change event handling to hopefully clean up some inconsistencies
-X remove motionX/Y/Pressure... these need to be handled separately
-X mouseX/Y no longer include history with moves
-X better to use motion object when that's done
-o coordinates from motionX/Y reportedly inconsistent
-X http://code.google.com/p/processing/issues/detail?id=1018
-X moving away from this anyway
-X pmouseX/Y not being set properly?
-X http://code.google.com/p/processing/issues/detail?id=238
-X mouseEvent is back (see the Wiki)
-o add method to bring up the keyboard in sketches
-o actually, just write an example of how to do it, since holding menu works
-o http://code.google.com/p/processing/issues/detail?id=234
-X values for pmouseX/Y aren't great
-X Examples > Topics > Drawing > Continuous Lines shows gaps
-X http://code.google.com/p/processing/issues/detail?id=238
-X debug information not coming through (Windows only?)
-X http://code.google.com/p/processing/issues/detail?id=1440
-X "no library found" with android.text.format (so android.* is a problem)
-X Remove requirement for Google APIs in Android mode
-X http://code.google.com/p/processing/issues/detail?id=613
-
-cleaning/earlier
-A Defects in the tessellation of SVG shapes in A3D
-A http://code.google.com/p/processing/issues/detail?id=291
-X change run/present/export/export application names in the menus
-A Blacked-out screen when restoring Android app from background.
-A http://code.google.com/p/processing/issues/detail?id=381
-X android sdk/build location has changed (android-7 not 2.1) fix build.xml
-A excessive rotation of application causes memory to run out
-A this probably means that some memory isn't being freed that should be
-A new window and surfaceview objects are being created in onCreate
-A so they should probably be taken down in onDestroy.. but how?
-A http://code.google.com/p/processing/issues/detail?id=235
-o should alpha PImage stuff use a non-4byte config?
-X http://code.google.com/p/processing/issues/detail?id=242
-X hasn't emerged as a real issue
-o try using the internal javac on windows and see if exceptions come through..
-o actually i think that might have been worse...
-X rounded rect support
-X http://code.google.com/p/processing/issues/detail?id=929
-o too many temporary objects (particularly w/ color) created with A2D
-X http://code.google.com/p/processing/issues/detail?id=213
-X no votes after a couple years
-X resize() needs to use the android resize stuff
-o right now using the rather than expensive copy()
-X instead, create a new resized bitmap, and get rid of pixels[]
-X http://code.google.com/p/processing/issues/detail?id=239
-
-motion events
-o registerMethod("motionEvent") and "mouseEvent" not implemented
-o PMotionEvent is being used internal to PApplet, need to re-wrap
-o should be able to fire MotionEvents
-o modify MotionEvent code to use TouchEvent class, even if basic version
-o internally, PApplet might subclass it for the pointers
-o but queueing needs to work
-X opting to take a step backwards on the motion event handling
-o write a little stub code for people who want to use motionX/Y/etc
-
-
-0214 android (2.0b6)
-X No changes on the Android side of things
-
-
-0213 android (2.0b5)
-no changes
-
-
-0212 android (2.0b4)
-X key value is not set in android mode
-X http://code.google.com/p/processing/issues/detail?id=1254
-X hue() in HSB mode returns out of range values
-X hue method on Android may just be different
-X http://code.google.com/p/processing/issues/detail?id=1257
-
-
-0211 android (2.0b3)
-X implement registerMethod(keyEvent) (motion and mouse still unavailable)
-
-
-0210 android (2.0b2)
-X lots of example updates from Andres
-X update example categories in the browser
-
-
-0209 android (2.0b1)
-A GL android sketch stops running after rotation
-A http://code.google.com/p/processing/issues/detail?id=1146
-X lack of registerXxx() implementation is breaking pre() and post() in particles
-X pause/resume trickiness with interactive apps
-X can we serialize objects (even if slow?)
-X add pause() and resume() methods to PApplet -> this is start/stop
-X register(this, "pause") -> libs will need pause events on android
-
-
-0208 android (2.0a9)
-X inherited PShape API changes from the desktop version
-
-
-0207 android (2.0a8)
-X lots of cleanup on this todo list
-X Support Native Code in Libraries for Android (includes fix)
-X http://code.google.com/p/processing/issues/detail?id=1117
-X patch from m4rlonj
-
-cleaning/earlier
-X exceptions with StreamPump and adb devices on osx and linux
-X http://code.google.com/p/processing/issues/detail?id=252
-o when starting the emulator, the adb server gets reset
-o then it causes this exception, which kills the thread waiting for input
-o so another reset is necessary
-Exception in thread "StreamPump 49" java.lang.RuntimeException: Inside processing.app.exec.StreamPump@1ebe8ec for out: adb devices
- at processing.app.exec.StreamPump.run(StreamPump.java:82)
- at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
- at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
- at java.lang.Thread.run(Thread.java:637)
-Caused by: java.io.IOException: Stream closed
- at java.io.BufferedInputStream.getBufIfOpen(BufferedInputStream.java:145)
- at java.io.BufferedInputStream.read1(BufferedInputStream.java:255)
- at java.io.BufferedInputStream.read(BufferedInputStream.java:317)
- at sun.nio.cs.StreamDecoder.readBytes(StreamDecoder.java:264)
- at sun.nio.cs.StreamDecoder.implRead(StreamDecoder.java:306)
- at sun.nio.cs.StreamDecoder.read(StreamDecoder.java:158)
- at java.io.InputStreamReader.read(InputStreamReader.java:167)
- at java.io.BufferedReader.fill(BufferedReader.java:136)
- at java.io.BufferedReader.readLine(BufferedReader.java:299)
- at java.io.BufferedReader.readLine(BufferedReader.java:362)
- at processing.app.exec.StreamPump.run(StreamPump.java:71)
- ... 3 more
-X when returning to the application after link(), screen stays blank
-X http://code.google.com/p/processing/issues/detail?id=237
-X fixed in 0195
-X remove various debug messages on the console
-X right now, there are too many places where errors occur
-X http://code.google.com/p/processing/issues/detail?id=204
-J only send error text to System.err (i.e. "Launching emulator" is not an error)
-J send these debug log messages to System.out
-o "Sketch started on emulator" in spite of the emulator only halfway booted
-o sent email about this one
-o additional manifest gui necessary:
-X icons are apparently important, android:icon
-X http://developer.android.com/guide/practices/ui_guidelines/icon_design.html
-
-
-0206 android (2.0a7)
-X add full PAppletMethods implementation to Android
-X swap Run on Device and Run on Emulator
-X http://code.google.com/p/processing/issues/detail?id=1083
-X XML crash on loading because of desktop-specific attribute
-X error: "http://apache.org/xml/features/nonvalidating/load-external-dtd"
-X http://code.google.com/p/processing/issues/detail?id=1128
-X fix problems with XML loading so that PShape works again
-X http://code.google.com/p/processing/issues/detail?id=1054
-X sketch names cannot start with underscore
-X http://code.google.com/p/processing/issues/detail?id=1047
-
-
-0205 android (2.0a6)
-X finish xml writing on android
-X http://stackoverflow.com/questions/2290945/writing-xml-on-android
-X consider switch to android 2.2 as the minimum
-X screenWidth/Height replaced with displayWidth/Height
-X update this on the Wiki page
-X docs: P2D and P3D are now OpenGL variations
-X Android mode is broken on Windows in Processing 2.0a5
-o file a bug for this w/ Google
-X http://code.google.com/p/processing/issues/detail?id=1022
-
-andres
-A GL2 specific code in Processing 2.0a5 break P3D on GLES2 hardware
-A http://code.google.com/p/processing/issues/detail?id=1029
-A OpenGL/ES requires precision specifier on float types
-A http://code.google.com/p/processing/issues/detail?id=1035
-A loadshape with obj file broken in 2.05a android mode.
-A http://code.google.com/p/processing/issues/detail?id=1048
-A camera() and arc() don't work together
-A http://code.google.com/p/processing/issues/detail?id=751
-
-earlier
-X remove unnecessary processing.xml.* code from android-core
-X http://code.google.com/p/processing/issues/detail?id=214
-X remove unnecessary processing.xml.* code from android-core
-X http://code.google.com/p/processing/issues/detail?id=214
-
-
-0204 android (2.0a5)
-X Android emulator not launching on Windows with 2.0 alpha releases
-X http://code.google.com/p/processing/issues/detail?id=899
-X http://code.google.com/p/processing/issues/detail?id=769
-X /opt/android using version #s again? fix build script (earlier)
-X smooth() is now the default
-X update to Android tools 17
-X add workarounds for problem with tools 17 version of dex
-o import statements with android.* break things
-X http://code.google.com/p/processing/issues/detail?id=989
-X was already fixed
-X now requiring SDK 10 (2.3.3) because of OpenGL issues
-X not SDK 9, which is 2.3.1 (and still Gingerbread)
-X noted on the changes page in the Wiki
-X make a note of the change on the Android Wiki
-X modify the .java build to require it
-X make sure build.xml uses it too
-
-
-0203 android (2.0a4)
-X fix incessant "inefficient font rendering" message
-X fix build.xml to point at the correct SDK version
-
-
-0202 android (2.0a3)
-X fix problem with export menu, keys, toolbar being different
-X change default package name a bit
-X switch to SDK 8 (Android 2.2) as the minimum
-X update the project files for Android SDK Tools Revision 15 (now required)
-X launching on emulator not working well
-X Latest android sdk breaks processing - new build.xml output required
-X http://code.google.com/p/processing/issues/detail?id=876
-X remove 'processing.test' package--people are posting on the market w/ it
-X too many 'already exists' messages
-X fix problem where creating a new AVD didn't update the device list
-X remove 'includeantruntime' warning
-X Android mode does not recognize library imports
-X http://code.google.com/p/processing/issues/detail?id=766
-X "Date could not be parsed" error
-X http://code.google.com/p/processing/issues/detail?id=864
-
-
-0201 android (2.0a2)
-X lots of updates to PGraphics et al, especially on the 3D side
-X change export menu/key/toolbar ordering
-
-
-0200 android
-X fix BufferedHttpEntity problem
-X was trying to allocate a byte buffer for entire size of HTTP file
-
-
-0199 android
-X tries to create and AVD when running on the phone.. why?
-X this is a real problem, causes lots of crashing on startup
-
-
-0198 android
-A mask() has no effect unless image has already been drawn in A3D
-A http://code.google.com/p/processing/issues/detail?id=623
-A point() doesn't render in A3D
-A http://code.google.com/p/processing/issues/detail?id=592
-A excessive rotation of application causes memory to run out
-A http://code.google.com/p/processing/issues/detail?id=235
-A mirroring in A3D when background() not called within draw()
-A http://code.google.com/p/processing/issues/detail?id=624
-X remove A2D and A3D constants
-o colorMode() error
-o http://code.google.com/p/processing/issues/detail?id=223
-
-
-0197 android (1.5.1)
-
-fixed earlier
-X compiler errors on Windows not appearing, nor highlighting the line number
-X http://code.google.com/p/processing/issues/detail?id=253
-
-
-0196 android (1.5)
-X workaround for loadImage(url) bug in Google's Android source (via psoden)
-X http://code.google.com/p/processing/issues/detail?id=629
-
-earlier
-X Build an interface for control of permissions on Android
-X http://code.google.com/p/processing/issues/detail?id=275
-X Implement createGraphics()
-X http://code.google.com/p/processing/issues/detail?id=240
-X Android 0192 sketch in static mode crashes on exit
-X http://code.google.com/p/processing/issues/detail?id=518
-
-
-0195 android (pre)
-X point() doesn't render in A3D
-X http://code.google.com/p/processing/issues/detail?id=592
-X Processing 0194 + Android = "Starting Build"
-X http://code.google.com/p/processing/issues/detail?id=590
-X hanging at problem where it's prompting for info on the cmd line
-o renaming the old AVD is fixing a lot of issues with hanging at startup
-X modes/android/android-core.zip (No such file or directory)
-X problem was that the build was ignoring no sdk silently
-X need to require ANDROID_SDK set for build.xml dist
-X http://code.google.com/p/processing/issues/detail?id=577
-X No library found for android.content (and all the others)
-X need to suppress the messages ala java.*
-o ctrl-shift-r (run on device) is totally hosed
-X when returning to android application, sometimes screen stays black
-X http://code.google.com/p/processing/issues/detail?id=237
-X Device Killed or Disconnected Error Message with Libraries
-X http://code.google.com/p/processing/issues/detail?id=565
-X there's gotta be something we can do to get better ant build message
-X "Unable to resolve target 'Google...'" when APIs aren't installed
-X add an error message that explains what to do
-X canceling an attempt to find the Android SDK leaves no window open
-X (Linux and Windows)
-X crash when trying to change Android mode void sketch no Android SDK Installed
-X http://code.google.com/p/processing/issues/detail?id=605
-
-earlier
-X Error 336 Can't run any sketch.
-X javac.exe was not included with the download
-X http://code.google.com/p/processing/issues/detail?id=393
-
-
-0194 android (pre)
-X Can't change Sketch Permissions
-X http://code.google.com/p/processing/issues/detail?id=559
-
-
-0193 android (pre)
-o verify that processing-core.jar has downloaded properly
-o http://code.google.com/p/processing/issues/detail?id=421
-o this is the download page:
-o http://code.google.com/p/processing/downloads/detail?name=processing-android-core-0191.zip
-o so look for "SHA1 Checksum: 1ed63f9316441fe46949ef5a92a28f58cc7ee226"
-X just use generic android apis as requirement, not the google apis
-X though it does give us the emulator skin.. maybe another option
-X android debug certificate expired
-X http://forum.processing.org/topic/ant-rules-r3-xml-209-395-error#25080000000262001
-X just delete ~/.android/debug.keystore
-X .java files are reported with Syntax Error with the Android build 0191
-X http://code.google.com/p/processing/issues/detail?id=404
-X implement mode switching for android/java/etc
-X save state re: whether sketches are android or java mode (or others?)
-X http://dev.processing.org/bugs/show_bug.cgi?id=1380
-X http://code.google.com/p/processing/issues/detail?id=202
-X android mode is currently per-editor (and clunky)
-X http://dev.processing.org/bugs/show_bug.cgi?id=1379
-X http://code.google.com/p/processing/issues/detail?id=201
-X remove use of clone() for images
-X http://code.google.com/p/processing/issues/detail?id=42
-
-
-0192 android (pre)
-X compile android-core with java 5 as the target so that it works on OS X 10.5
-X A3D should use lower color depth on older devices
-X http://code.google.com/p/processing/issues/detail?id=391
-X new api for begin/endRecord()
-A Finish opengl blending modes in A3D
-A http://code.google.com/p/processing/issues/detail?id=290
-A Automatic normal calculation in A3D
-A http://code.google.com/p/processing/issues/detail?id=345
-A Improve texture handling in A3D's PFont
-A http://code.google.com/p/processing/issues/detail?id=394
-A OpenGL resource release mechanism in A3D is broken
-A http://code.google.com/p/processing/issues/detail?id=456
-A Multitexturing in A3D
-A http://code.google.com/p/processing/issues/detail?id=344
-A Problems when loading images asynchronously in A3D.
-A http://code.google.com/p/processing/issues/detail?id=465
-X make several changes to get android running properly with sdk tools r8
-
-
-0191 android (pre)
-X won't interpret size() in Android Mode without spaces between arguments
-X http://code.google.com/p/processing/issues/detail?id=390
-
-A Implement offscreen operations in A3D when FBO extension is not available
-A http://code.google.com/p/processing/issues/detail?id=300
-A Get opengl matrices in A3D when GL_OES_matrix_get extension is not available
-A http://code.google.com/p/processing/issues/detail?id=286
-A Implement calculateModelviewInverse() in A3D
-A http://code.google.com/p/processing/issues/detail?id=287
-A Automatic clear/noClear() switch in A3D
-A http://code.google.com/p/processing/issues/detail?id=289
-A Camera issues in A3D
-A http://code.google.com/p/processing/issues/detail?id=367
-A major fixes for type to work properly in 3D (fixes KineticType)
-A http://code.google.com/p/processing/issues/detail?id=358
-A Lighting and materials testing in A3D
-A http://code.google.com/p/processing/issues/detail?id=294
-A Generate mipmaps when the GL_OES_generate_mipmaps extension is not available.
-A http://code.google.com/p/processing/issues/detail?id=288
-A Finish screen pixels/texture operations in A3D
-A http://code.google.com/p/processing/issues/detail?id=298
-
-1) I fixed a bug in the camera handling that a user pointed out recently (http://forum.processing.org/topic/possible-3d-bug). This was a quite urgent issue, since affected pretty much everything. It went unnoticed until now because the math error canceled out with the default camera settings.
-2) I also finished the implementation of the getImpl() method in PImage, so it initializes the texture of the new image in A3D mode. This makes the CubicVR example to work fine.
-
-
-0190 android (pre)
-X allow screenWidth/Height as parameters to size()
-X right now would cause NumberFormatException
-X add notes to the wiki about the size() method
-X make sure sketchRenderer()/sketchWidth()/sketchHeight() are working on desktop
-o see about getting them documented in the reference
-X do a writeup of the size() method in the wiki
-X size() command is currently ignored in Android
-X http://dev.processing.org/bugs/show_bug.cgi?id=1397
-X http://code.google.com/p/processing/issues/detail?id=211
-X Implement P3D, OpenGL, A3D for Android
-X http://dev.processing.org/bugs/show_bug.cgi?id=1396
-X fix mouseX/Y mapping when using smaller screen sizes
-o image() problems (includes sketch)
-o http://dev.processing.org/bugs/show_bug.cgi?id=1565
-o next time the avd is updated
-o remove old AVDs because their APIs might be out of date
-o probably need to name AVDs based on their API spec
-o http://dev.processing.org/bugs/show_bug.cgi?id=1526
-o http://code.google.com/p/processing/issues/detail?id=249
-X text ascent/descent problem, text("blah\nblah") doesn't work properly
-X reverting to using the PGraphics version rather than P2D
-X because Paint.ascent() is returning negative values
-X properly handle setting whatever permissions are necessary
-X added dialog box to set permissions
-X re: rewriting manifest on each build
-o http://dev.processing.org/bugs/show_bug.cgi?id=1429
-X http://code.google.com/p/processing/issues/detail?id=221
-X change skewX/Y to shearX/Y
-X make updated reference
-X copy the changes over from the xml library
-X remove 'import processing.opengl.*' in the preprocessor?
-X add to wiki - rename 'data' folder to 'assets' when inside eclipse
-X prevent rotation of applications? (or require a certain orientation)
-o add to activity tag in the manifest:
-o android:configChanges="keyboardHidden|orientation"
-o android:screenOrientation="landscape"
-X or programmatically specify:
-X setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_LANDSCAPE);
-X setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_PORTRAIT);
-X get the dpi of the screen (added to wiki)
-X http://developer.android.com/reference/android/util/DisplayMetrics.html
-X add hutch stuff to the wiki
-X http://lukehutch.wordpress.com/2010/01/06/my-multi-touch-code-ported-to-eclair/
-X also for the wiki:
-X add information about permissions, since loadStrings() will break
-X add information to wiki about preparing apps for release
-X http://developer.android.com/guide/publishing/preparing.html
-X make size() work to place the component at the center of the screen
-X make size() work to change the renderer
-X how does size work?
-X if size() method is used, things are scaled based on that
-X if no size() method, then the full screen/full resolution is used
-X make apps properly handle screen resize
-o remove SurfaceView2D/SurfaceView3D separation, or clean up
-o test controlp5 with android
-X get core.zip out of svn (once tool is separate, modes stuff working etc)
-X fix the width of the build window
-X some sort of warning re: messing with AndroidManifest.xml
-X added to the wiki
-X implement createGraphics() for A3D/P3D/OPENGL
-X http://dev.processing.org/bugs/show_bug.cgi?id=1488
-X http://code.google.com/p/processing/issues/detail?id=240
-X added a note to the wiki
-X make sure that AndroidManifest and other files are copied on Save As
-X icons.. any others?
-X Errors show up that .java files are duplicates with the Android tools.
-X problem is with the packages and where the preproc is putting the file
-X example sketch added to bug report
-X http://code.google.com/p/processing/issues/detail?id=232
-X prevent adding the opengl library when it's not needed
-X preprocessor removes the code by before export
-X added a note to the wiki
-X implement android menu
-X reset option
-X permissions
-X run the 'android' application (since finding its location is painful)
-o remove the need for a "Reset Android" menu option
-o might need to just put this in the menu for times when things go weird
-o http://dev.processing.org/bugs/show_bug.cgi?id=1392
-o http://code.google.com/p/processing/issues/detail?id=209
-X added orientation(PORTRAIT) and orientation(LANDSCAPE)
-
-earlier
-X if sketchRenderer() et al are used in android, need to add to desktop
-X remove processing.opengl.* classes and finish PGraphicsAndroid3D
-X http://dev.processing.org/bugs/show_bug.cgi?id=1401
-J need to prevent hitting 'run' twice (threaded, so would work)
-J currently things just keep restarting the build, bad state
-J http://dev.processing.org/bugs/show_bug.cgi?id=1387
-
-before 0190 release
-X post processing-android-core-0190.zip to the download page
-X get some help w/ the dist script to make the right file
-X have casey do a reference build (skewX/Y to shearX/Y)
-X also changes to the xml api naming
-
-
-0189 android (1.2.1)
-X no changes
-
-
-0188 android (1.2)
-X no changes (and android features hidden)
-
-
-0187 android (pre)
-X don't kill adb server each time that run is hit
-X move about.txt to the wiki
-
-done in 0186
-X move to Android 2.1 as the minimum requirement?
-X since 2.0.1 seems to be used on only a 0.46% of devices?
-X http://developer.android.com/resources/dashboard/platform-versions.html
-X need to side-port changes from PShape/SVG over to Android
-
-
-0186 android (pre)
-X move to sdk 7 because 6 has been deprecated
-X merged svg changes with those in desktop core
-
-
-0185 android (pre)
-X fix two bugs with fonts created with specific charsets
-X fix for adobe illustrator-mangled svg id names with hex characters
-X add redirect and fix problem with core.zip location after server move
-X http://code.google.com/p/processing/issues/detail?id=269
-X added android.permission.INTERNET
-X and android.permission.WRITE_EXTERNAL_STORAGE
-
-
-0184 android (pre)
-o when running a sketch, need to unlock the device
-o http://dev.processing.org/bugs/show_bug.cgi?id=1500
-X add Pattern caching to match() to speed things up
-X make saveStream() return a boolean to indicate success
-X implement 'export' to create a local android folder
-X 'stop' is now a no-op for the android tools
-X partially fixed but hangs after pressing stop
-X http://dev.processing.org/bugs/show_bug.cgi?id=1386
-X path problems finding javac.exe on vista
-X http://dev.processing.org/bugs/show_bug.cgi?id=1528
-
-earlier
-J figure out how to set ANDROID_SDK for the build scripts
-J right now, just setting the env value is required
-
-
-0183 android (pre-release)
-X mention in the notes
-o emulator doesn't always start the sketch the first time
-X emulator stays open because it's too slow to restart it
-X add notes to about.txt, and add link to it
-
-
-0182 android (pre-release)
-X added skewX/Y implementation
-X http://dev.processing.org/bugs/show_bug.cgi?id=1448
-
-
-0181 android (pre-release)
-X some changes to A3D
-
-
-0180 android (pre-release)
-X change sdk to use revision 6 (2.0.1) as the version
-X change instructions on site
-X add support for a default font
-
-
-0179 (1.1, but no android tools)
-X screenWidth/Height instead of screenW/H
-X errors that happen inside events (e.g. keys) not highlighting lines
-X useful stack trace information not coming through.. why?
-X http://dev.processing.org/bugs/show_bug.cgi?id=1384
-
-previous
-X don't require JDK installation and PATH setting
-X if using processing with java download, should be able to use its tools.jar
-X http://dev.processing.org/bugs/show_bug.cgi?id=1470
-
-
-0178 (private)
-X noLoop() is broken (draw is never called)
-X http://dev.processing.org/bugs/show_bug.cgi?id=1467
-X fix the freakout that happens with onPause()
-o solution is to call stop() to kill the thread, but that's not a pause
-X http://dev.processing.org/bugs/show_bug.cgi?id=1483
-X app not pausing or closing when switching to another activity
-X http://dev.processing.org/bugs/show_bug.cgi?id=1404
-o if !looping, is it necessary to call redraw() in onResume()?
-X doesn't appear to be, since it gets completely rebuilt
-X bezier curves were broken in A2D
-X extra point is drawn connecting the shape to the corner
-X fix other minor bugs in shape drawing
-X mask() now implemented in A2D
-X updatePixels() now work properly for A2D
-X set() should now be working
-X using set() on an image that doesn't have a bitmap, or has pixels loaded
-X requestImage() now working
-X drastically improve the performance of the time functions
-X point wasn't detecting different stroke weights
-X point wasn't working with strokeWeight > 1
-X fix rotate() bug (was using degrees instead of radians)
-X http://dev.processing.org/bugs/show_bug.cgi?id=1497
-X arc() now working properly
-X createGraphics() works, at least with A2D (or aliases P2D and JAVA2D)
-X "The application ... has stopped unexpectedly." when quitting a slow app
-X http://dev.processing.org/bugs/show_bug.cgi?id=1485
-X Examples > Topics > Effects > Wormhole - needs work, something with resize()
-X test createFont()
-X createGraphics() broken
-X http://dev.processing.org/bugs/show_bug.cgi?id=1437
-X remove legacy PGraphics3D class from processing.core.android
-X http://dev.processing.org/bugs/show_bug.cgi?id=1402
-X is there a way to get a width/height default to use for surfaceChanged?
-
-cleaning
-X move to eclair (donut devices will have terrible performance anyway)
-X make change from src folder to assets folder for export
-X what to do with other classes that rely on PApplet? (e.g. vida)
-X remove drawCube() method from PApplet
-X add methods to request rendering
-o need to deal with fps problems with this model
-o gz files not allowed, need to remove the code from createInput() et al
-X or maybe not, since could still come from a site or a File?
-X just can't come from the assets file..
-
-jdf
-X get stdout and stderr from the emulator/device
-X http://dev.processing.org/bugs/show_bug.cgi?id=1381
-X remove ANDROID_SDK env variable requirement
-X http://dev.processing.org/bugs/show_bug.cgi?id=1471
-X ANDROID_SDK doesn't seem to be mentioned anywhere anymore
-X this may mean that p5 might just need to get the location
-X ANDROID_SDK not getting set on OS X
-X http://dev.processing.org/bugs/show_bug.cgi?id=1469
-X http://stackoverflow.com/questions/603785/environment-variables-in-mac-os-x
-X timeout isn't long enough for emulator to boot and startup
-X always times out on a 3 GHz OS X machine
-
-
-0177 (private)
-X fix error with typo in the build file:
-X Open quote is expected for attribute "{1}" associated with an
-X element type "android:minSdkVersion".
-
-
-0176 (private)
-X begin the merge of the new A3D, remove old OpenGL code
-X escape slashes properly on windows (also place sdk in program files)
-X writer.println("sdk.dir=" + Android.sdkPath); // r4 of the sdk
-X writer.println("sdk.dir=" + Android.sdkPath.replace("\\", "\\" +"\\"));
-X move processing.android.core back to processing.core
-X need to document the rationale
-X Android tools on Windows are broken due to naming changes in r4 SDK
-X http://dev.processing.org/bugs/show_bug.cgi?id=1432
-X images with tint() starting to work
-X tint() causes crash
-X http://dev.processing.org/bugs/show_bug.cgi?id=1435
-X loadFont() now working, createFont() not tested yet
-X implement library support for android
-X also code folder support
-
-
-0175 (private)
-X fix problem with windows claiming "does not appear to contain an Android SDK"
-X loadImage() and other loadXxxx() functions not yet working
-X http://dev.processing.org/bugs/show_bug.cgi?id=1414
-X can the data folder have subfolders? - yes
-
-
-0174 (private)
-X not handling key characters correctly (space bar, tab, others)
-X http://dev.processing.org/bugs/show_bug.cgi?id=1405
-X why aren't mouse drag events coming through?
-X http://dev.processing.org/bugs/show_bug.cgi?id=1382
-X "taskdef class com.android.ant.SetupTask cannot be found" on Linux
-X http://dev.processing.org/bugs/show_bug.cgi?id=1407
-X update to r4 of android sdk
-X this release will not run on r3 or earlier
-X download core.zip from local files
-
diff --git a/android/examples/Basics/Arrays/Array/Array.pde b/android/examples/Basics/Arrays/Array/Array.pde
deleted file mode 100644
index a981fa4709..0000000000
--- a/android/examples/Basics/Arrays/Array/Array.pde
+++ /dev/null
@@ -1,35 +0,0 @@
-/**
- * Array.
- *
- * An array is a list of data. Each piece of data in an array
- * is identified by an index number representing its position in
- * the array. Arrays are zero based, which means that the first
- * element in the array is [0], the second element is [1], and so on.
- * In this example, an array named "coswav" is created and
- * filled with the cosine values. This data is displayed three
- * separate ways on the screen.
- */
-
-size(200, 200);
-
-float[] coswave = new float[width];
-
-for (int i = 0; i < width; i++) {
- float amount = map(i, 0, width, 0, PI);
- coswave[i] = abs(cos(amount));
-}
-
-for (int i = 0; i < width; i++) {
- stroke(coswave[i]*255);
- line(i, 0, i, height/3);
-}
-
-for (int i = 0; i < width; i++) {
- stroke(coswave[i]*255 / 4);
- line(i, height/3, i, height/3*2);
-}
-
-for (int i = 0; i < width; i++) {
- stroke(255 - coswave[i]*255);
- line(i, height/3*2, i, height);
-}
diff --git a/android/examples/Basics/Arrays/Array2D/Array2D.pde b/android/examples/Basics/Arrays/Array2D/Array2D.pde
deleted file mode 100644
index 3a97587e79..0000000000
--- a/android/examples/Basics/Arrays/Array2D/Array2D.pde
+++ /dev/null
@@ -1,32 +0,0 @@
-/**
- * Array 2D.
- *
- * Demonstrates the syntax for creating a two-dimensional (2D) array.
- * Values in a 2D array are accessed through two index values.
- * 2D arrays are useful for storing images. In this example, each dot
- * is colored in relation to its distance from the center of the image.
- */
-
-float[][] distances;
-float maxDistance;
-
-size(200, 200);
-background(0);
-maxDistance = dist(width/2, height/2, width, height);
-distances = new float[width][height];
-for(int i=0; i= big || x <= 0) {
- xdir *= -1;
- x = x + (1 * xdir);
- y = y + (1 * ydir);
- }
- if (y >= big || y <= 0) {
- ydir *= -1;
- y = y + (1 * ydir);
- }
- }
-
- // Custom method for drawing the object
- void draw() {
- stroke(second() * 4);
- point(mx+x-1, my+y-1);
- }
-}
diff --git a/android/examples/Basics/Camera/MoveEye/MoveEye.pde b/android/examples/Basics/Camera/MoveEye/MoveEye.pde
deleted file mode 100644
index 0e305f5929..0000000000
--- a/android/examples/Basics/Camera/MoveEye/MoveEye.pde
+++ /dev/null
@@ -1,29 +0,0 @@
-/**
- * Move Eye.
- * by Simon Greenwold.
- *
- * The camera lifts up (controlled by mouseY) while looking at the same point.
- */
-
-void setup() {
- size(640, 360, P3D);
- orientation(LANDSCAPE);
- fill(204);
-}
-
-void draw() {
- lights();
- background(0);
-
- // Change height of the camera with mouseY
- camera(30.0, mouseY, 220.0, // eyeX, eyeY, eyeZ
- 0.0, 0.0, 0.0, // centerX, centerY, centerZ
- 0.0, 1.0, 0.0); // upX, upY, upZ
-
- noStroke();
- box(90);
- stroke(255);
- line(-100, 0, 0, 100, 0, 0);
- line(0, -100, 0, 0, 100, 0);
- line(0, 0, -100, 0, 0, 100);
-}
diff --git a/android/examples/Basics/Camera/Perspective/Perspective.pde b/android/examples/Basics/Camera/Perspective/Perspective.pde
deleted file mode 100644
index 819248d05f..0000000000
--- a/android/examples/Basics/Camera/Perspective/Perspective.pde
+++ /dev/null
@@ -1,42 +0,0 @@
-/**
- * Perspective.
- *
- * Move the mouse left and right to change the field of view (fov).
- * Click to modify the aspect ratio. The perspective() function
- * sets a perspective projection applying foreshortening, making
- * distant objects appear smaller than closer ones. The parameters
- * define a viewing volume with the shape of truncated pyramid.
- * Objects near to the front of the volume appear their actual size,
- * while farther objects appear smaller. This projection simulates
- * the perspective of the world more accurately than orthographic projection.
- * The version of perspective without parameters sets the default
- * perspective and the version with four parameters allows the programmer
- * to set the area precisely.
- */
-
-void setup() {
- size(displayWidth, displayHeight, P3D);
- orientation(LANDSCAPE);
- noStroke();
-}
-
-void draw() {
- lights();
- background(204);
- float cameraY = height/2.0;
- float fov = mouseX/float(width) * PI/2;
- float cameraZ = cameraY / tan(fov / 2.0);
- float aspect = float(width)/float(height);
- if (mousePressed) {
- aspect = aspect / 2.0;
- }
- perspective(fov, aspect, cameraZ/10.0, cameraZ*10.0);
-
- translate(width/2+30, height/2, 0);
- rotateX(-PI/6);
- rotateY(PI/3 + mouseY/float(height) * PI);
- box(45);
- translate(0, 0, -50);
- box(30);
-}
-
diff --git a/android/examples/Basics/Color/Brightness/Brightness.pde b/android/examples/Basics/Color/Brightness/Brightness.pde
deleted file mode 100644
index a91331e302..0000000000
--- a/android/examples/Basics/Color/Brightness/Brightness.pde
+++ /dev/null
@@ -1,29 +0,0 @@
-/**
- * Brightness
- * by Rusty Robison.
- *
- * Brightness is the relative lightness or darkness of a color.
- * Move the cursor vertically over each bar to alter its brightness.
- *
- * Updated 28 February 2010.
- */
-
-int barWidth = 5;
-int lastBar = -1;
-
-void setup() {
- size(200, 200);
- colorMode(HSB, 360, 100, height);
- noStroke();
- background(0);
-}
-
-void draw() {
- int whichBar = mouseX / barWidth;
- if (whichBar != lastBar) {
- int barX = whichBar * barWidth;
- fill(barX, 100, mouseY);
- rect(barX, 0, barWidth, height);
- lastBar = whichBar;
- }
-}
diff --git a/android/examples/Basics/Color/ColorWheel/ColorWheel.pde b/android/examples/Basics/Color/ColorWheel/ColorWheel.pde
deleted file mode 100644
index 69c34602a3..0000000000
--- a/android/examples/Basics/Color/ColorWheel/ColorWheel.pde
+++ /dev/null
@@ -1,88 +0,0 @@
-/**
- * Subtractive Color Wheel
- * by Ira Greenberg.
- *
- * The primaries are red, yellow, and blue. The secondaries are green,
- * purple, and orange. The tertiaries are yellow-orange, red-orange,
- * red-purple, blue-purple, blue-green, and yellow-green.
- *
- * Create a shade or tint of the subtractive color wheel using
- * SHADE or TINT parameters.
- *
- * Updated 26 February 2010.
- */
-
-int segs = 12;
-int steps = 6;
-float rotAdjust = TWO_PI / segs / 2;
-float radius;
-float segWidth;
-float interval = TWO_PI / segs;
-
-
-void setup() {
- size(200, 200);
- background(127);
- smooth();
- ellipseMode(RADIUS);
- noStroke();
- // make the diameter 90% of the sketch area
- radius = min(width, height) * 0.45;
- segWidth = radius / steps;
-
- // swap which line is commented out to draw the other version
- //drawTintWheel();
- drawShadeWheel();
-}
-
-
-void drawShadeWheel() {
- for (int j = 0; j < steps; j++) {
- color[] cols = {
- color(255-(255/steps)*j, 255-(255/steps)*j, 0),
- color(255-(255/steps)*j, (255/1.5)-((255/1.5)/steps)*j, 0),
- color(255-(255/steps)*j, (255/2)-((255/2)/steps)*j, 0),
- color(255-(255/steps)*j, (255/2.5)-((255/2.5)/steps)*j, 0),
- color(255-(255/steps)*j, 0, 0),
- color(255-(255/steps)*j, 0, (255/2)-((255/2)/steps)*j),
- color(255-(255/steps)*j, 0, 255-(255/steps)*j),
- color((255/2)-((255/2)/steps)*j, 0, 255-(255/steps)*j),
- color(0, 0, 255-(255/steps)*j),
- color(0, 255-(255/steps)*j, (255/2.5)-((255/2.5)/steps)*j),
- color(0, 255-(255/steps)*j, 0),
- color((255/2)-((255/2)/steps)*j, 255-(255/steps)*j, 0)
- };
- for (int i = 0; i < segs; i++) {
- fill(cols[i]);
- arc(width/2, height/2, radius, radius,
- interval*i+rotAdjust, interval*(i+1)+rotAdjust);
- }
- radius -= segWidth;
- }
-}
-
-
-void drawTintWheel() {
- for (int j = 0; j < steps; j++) {
- color[] cols = {
- color((255/steps)*j, (255/steps)*j, 0),
- color((255/steps)*j, ((255/1.5)/steps)*j, 0),
- color((255/steps)*j, ((255/2)/steps)*j, 0),
- color((255/steps)*j, ((255/2.5)/steps)*j, 0),
- color((255/steps)*j, 0, 0),
- color((255/steps)*j, 0, ((255/2)/steps)*j),
- color((255/steps)*j, 0, (255/steps)*j),
- color(((255/2)/steps)*j, 0, (255/steps)*j),
- color(0, 0, (255/steps)*j),
- color(0, (255/steps)*j, ((255/2.5)/steps)*j),
- color(0, (255/steps)*j, 0),
- color(((255/2)/steps)*j, (255/steps)*j, 0)
- };
- for (int i = 0; i < segs; i++) {
- fill(cols[i]);
- arc(width/2, height/2, radius, radius,
- interval*i+rotAdjust, interval*(i+1)+rotAdjust);
- }
- radius -= segWidth;
- }
-}
diff --git a/android/examples/Basics/Color/Creating/Creating.pde b/android/examples/Basics/Color/Creating/Creating.pde
deleted file mode 100644
index 628e1f7ac4..0000000000
--- a/android/examples/Basics/Color/Creating/Creating.pde
+++ /dev/null
@@ -1,26 +0,0 @@
-/**
- * Creating Colors (Homage to Albers).
- *
- * Creating variables for colors that may be referred to
- * in the program by their name, rather than a number.
- */
-
-size(200, 200);
-noStroke();
-
-color inside = color(204, 102, 0);
-color middle = color(204, 153, 0);
-color outside = color(153, 51, 0);
-
-// These statements are equivalent to the statements above.
-// Programmers may use the format they prefer.
-//color inside = #CC6600;
-//color middle = #CC9900;
-//color outside = #993300;
-
-fill(outside);
-rect(0, 0, 200, 200);
-fill(middle);
-rect(40, 60, 120, 120);
-fill(inside);
-rect(60, 90, 80, 80);
diff --git a/android/examples/Basics/Color/Hue/Hue.pde b/android/examples/Basics/Color/Hue/Hue.pde
deleted file mode 100644
index b22ffb5350..0000000000
--- a/android/examples/Basics/Color/Hue/Hue.pde
+++ /dev/null
@@ -1,31 +0,0 @@
-/**
- * Hue.
- *
- * Hue is the color reflected from or transmitted through an object
- * and is typically referred to as the name of the color (red, blue, yellow, etc.)
- * Move the cursor vertically over each bar to alter its hue.
- */
-
-int barWidth = 5;
-int[] hue;
-
-void setup()
-{
- size(200, 200);
- colorMode(HSB, 360, height, height);
- hue = new int[width/barWidth];
- noStroke();
-}
-
-void draw()
-{
- int j = 0;
- for (int i=0; i<=(width-barWidth); i+=barWidth) {
- if ((mouseX > i) && (mouseX < i+barWidth)) {
- hue[j] = mouseY;
- }
- fill(hue[j], height/1.2, height/1.2);
- rect(i, 0, barWidth, height);
- j++;
- }
-}
diff --git a/android/examples/Basics/Color/LinearGradient/LinearGradient.pde b/android/examples/Basics/Color/LinearGradient/LinearGradient.pde
deleted file mode 100644
index f41fc2b662..0000000000
--- a/android/examples/Basics/Color/LinearGradient/LinearGradient.pde
+++ /dev/null
@@ -1,73 +0,0 @@
-/**
- * Simple Linear Gradient
- * by Ira Greenberg.
- *
- * Using the convenient red(), green()
- * and blue() component functions,
- * generate some linear gradients.
- */
-
-// constants
-int Y_AXIS = 1;
-int X_AXIS = 2;
-
-void setup(){
- size(200, 200);
-
- // create some gradients
- // background
- color b1 = color(190, 190, 190);
- color b2 = color(20, 20, 20);
- setGradient(0, 0, width, height, b1, b2, Y_AXIS);
- //center squares
- color c1 = color(255, 120, 0);
- color c2 = color(10, 45, 255);
- color c3 = color(10, 255, 15);
- color c4 = color(125, 2, 140);
- color c5 = color(255, 255, 0);
- color c6 = color(25, 255, 200);
- setGradient(25, 25, 75, 75, c1, c2, Y_AXIS);
- setGradient(100, 25, 75, 75, c3, c4, X_AXIS);
- setGradient(25, 100, 75, 75, c2, c5, X_AXIS);
- setGradient(100, 100, 75, 75, c4, c6, Y_AXIS);
-}
-
-void setGradient(int x, int y, float w, float h, color c1, color c2, int axis ){
- // calculate differences between color components
- float deltaR = red(c2)-red(c1);
- float deltaG = green(c2)-green(c1);
- float deltaB = blue(c2)-blue(c1);
-
- // choose axis
- if(axis == Y_AXIS){
- /*nested for loops set pixels
- in a basic table structure */
- // column
- for (int i=x; i<=(x+w); i++){
- // row
- for (int j = y; j<=(y+h); j++){
- color c = color(
- (red(c1)+(j-y)*(deltaR/h)),
- (green(c1)+(j-y)*(deltaG/h)),
- (blue(c1)+(j-y)*(deltaB/h))
- );
- set(i, j, c);
- }
- }
- }
- else if(axis == X_AXIS){
- // column
- for (int i=y; i<=(y+h); i++){
- // row
- for (int j = x; j<=(x+w); j++){
- color c = color(
- (red(c1)+(j-x)*(deltaR/h)),
- (green(c1)+(j-x)*(deltaG/h)),
- (blue(c1)+(j-x)*(deltaB/h))
- );
- set(j, i, c);
- }
- }
- }
-}
-
diff --git a/android/examples/Basics/Color/RadialGradient/RadialGradient.pde b/android/examples/Basics/Color/RadialGradient/RadialGradient.pde
deleted file mode 100644
index f5ba2b3fe6..0000000000
--- a/android/examples/Basics/Color/RadialGradient/RadialGradient.pde
+++ /dev/null
@@ -1,58 +0,0 @@
-/**
- * Simple Radial Gradient
- * by Ira Greenberg.
- *
- * Using the convenient red(), green()
- * and blue() component functions,
- * generate an array of radial gradients.
- */
-
-void setup(){
- size(200, 200);
- background(0);
- smooth();
-
- // create a simple table of gradients
- int columns = 4;
- int radius = (width/columns)/2;
- // create some gradients
- for (int i=radius; i< width; i+=radius*2){
- for (int j =radius; j< height; j+=radius*2){
- createGradient(i, j, radius,
- color(int(random(255)), int(random(255)), int(random(255))),
- color(int(random(255)), int(random(255)), int(random(255))));
- }
- }
-}
-
-void createGradient (float x, float y, float radius, color c1, color c2){
- float px = 0, py = 0, angle = 0;
-
- // calculate differences between color components
- float deltaR = red(c2)-red(c1);
- float deltaG = green(c2)-green(c1);
- float deltaB = blue(c2)-blue(c1);
- // hack to ensure there are no holes in gradient
- // needs to be increased, as radius increases
- float gapFiller = 8.0;
-
- for (int i=0; i< radius; i++){
- for (float j=0; j<360; j+=1.0/gapFiller){
- px = x+cos(radians(angle))*i;
- py = y+sin(radians(angle))*i;
- angle+=1.0/gapFiller;
- color c = color(
- (red(c1)+(i)*(deltaR/radius)),
- (green(c1)+(i)*(deltaG/radius)),
- (blue(c1)+(i)*(deltaB/radius))
- );
- set(int(px), int(py), c);
- }
- }
- // adds smooth edge
- // hack anti-aliasing
- noFill();
- strokeWeight(3);
- ellipse(x, y, radius*2, radius*2);
-}
-
diff --git a/android/examples/Basics/Color/RadialGradient2/RadialGradient2.pde b/android/examples/Basics/Color/RadialGradient2/RadialGradient2.pde
deleted file mode 100644
index ad571fcc0b..0000000000
--- a/android/examples/Basics/Color/RadialGradient2/RadialGradient2.pde
+++ /dev/null
@@ -1,43 +0,0 @@
-/**
- * Inspired by Ira Greenberg's RadialGradient sketch,
- * but uses a different method for the gradients.
- */
-
-int dim = 40;
-
-void setup() {
- size(200, 200);
- background(0);
- smooth();
- noStroke();
- ellipseMode(RADIUS);
-
- // create a simple table of gradients
- int rows = height / dim;
- int cols = width / dim;
-
- for (int row = 0; row < rows; row++) {
- for (int col = 0; col < cols; col++) {
- drawGradient(col*dim + dim/2, row*dim + dim/2);
- }
- }
-}
-
-void drawGradient(float x, float y) {
- int radius = dim/2 - 2;
- float r1 = random(255);
- float g1 = random(255);
- float b1 = random(255);
- float dr = (random(255) - r1) / radius;
- float dg = (random(255) - g1) / radius;
- float db = (random(255) - b1) / radius;
-
- for (int r = radius; r > 0; --r) {
- fill(r1, g1, b1);
- ellipse(x, y, r, r);
- r1 += dr;
- g1 += dg;
- b1 += db;
- }
-}
-
diff --git a/android/examples/Basics/Color/Reading/Reading.pde b/android/examples/Basics/Color/Reading/Reading.pde
deleted file mode 100644
index d142aff884..0000000000
--- a/android/examples/Basics/Color/Reading/Reading.pde
+++ /dev/null
@@ -1,46 +0,0 @@
-/**
- * Reading.
- *
- * An image is recreated from its individual component colors.
- * The many colors of the image are created through modulating the
- * red, green, and blue values. This is an exageration of an LCD display.
- */
-
-size(200, 200);
-noStroke();
-background(0);
-
-// Load an image from the data directory
-PImage img = loadImage("cait.jpg");
-img.loadPixels();
-
-// figure out how big to make each block based on
-// the sketch area and the size of the input image
-int eachW = width / img.width;
-int eachH = height / img.height;
-int each = min(eachW, eachH);
-// vertical stripes will be a third as wide
-int stripeW = each / 3;
-// make sure the block size is a multiple of 3
-each = 3 * stripeW;
-
-int left = (width - (img.width * each)) / 2;
-int top = (height - (img.height * each)) / 2;
-
-for (int y = 0; y < img.height; y++) {
- int y1 = top + y*each;
-
- for (int x = 0; x < img.width; x++) {
- int pixel = img.get(x, y);
- int x1 = left + x*each;
-
- fill(red(pixel), 0, 0);
- rect(x1 + stripeW*0, y1, stripeW, each);
-
- fill(0, green(pixel), 0);
- rect(x1 + stripeW*1, y1, stripeW, each);
-
- fill(0, 0, blue(pixel));
- rect(x1 + stripeW*2, y1, stripeW, each);
- }
-}
diff --git a/android/examples/Basics/Color/Reading/data/cait.jpg b/android/examples/Basics/Color/Reading/data/cait.jpg
deleted file mode 100644
index bc15e16a57..0000000000
Binary files a/android/examples/Basics/Color/Reading/data/cait.jpg and /dev/null differ
diff --git a/android/examples/Basics/Color/Relativity/Relativity.pde b/android/examples/Basics/Color/Relativity/Relativity.pde
deleted file mode 100644
index 9332e9bafb..0000000000
--- a/android/examples/Basics/Color/Relativity/Relativity.pde
+++ /dev/null
@@ -1,42 +0,0 @@
-/**
- * Relativity.
- *
- * Each color is perceived in relation to other colors.
- * The top and bottom bars each contain the same component colors,
- * but a different display order causes individual colors to appear differently.
- */
-
-color a, b, c, d, e;
-
-void setup() {
- size(200, 200);
- noStroke();
- a = color(165, 167, 20);
- b = color(77, 86, 59);
- c = color(42, 106, 105);
- d = color(165, 89, 20);
- e = color(146, 150, 127);
- noLoop();
-}
-
-void draw() {
- drawBand(a, b, c, d, e, 0, width/50);
- drawBand(c, a, d, b, e, height/2, width/50);
-}
-
-void drawBand(color v, color w, color x, color y, color z, int ypos, int barWidth) {
- int num = 5;
- color[] colorOrder = { v, w, x, y, z };
- for(int i = 0; i < width; i += barWidth*num) {
- for(int j = 0; j < num; j++) {
- fill(colorOrder[j]);
- rect(i+j*barWidth, ypos, barWidth, height/2);
- }
- }
-}
-
-
-
-
-
-
diff --git a/android/examples/Basics/Color/Saturation/Saturation.pde b/android/examples/Basics/Color/Saturation/Saturation.pde
deleted file mode 100644
index 84137147ea..0000000000
--- a/android/examples/Basics/Color/Saturation/Saturation.pde
+++ /dev/null
@@ -1,29 +0,0 @@
-/**
- * Saturation.
- *
- * Saturation is the strength or purity of the color and represents the
- * amount of gray in proportion to the hue. A "saturated" color is pure
- * and an "unsaturated" color has a large percentage of gray.
- * Move the cursor vertically over each bar to alter its saturation.
- */
-
-int barWidth = 5;
-int lastBar = -1;
-
-
-void setup() {
- size(200, 200);
- colorMode(HSB, width, height, 100);
- noStroke();
-}
-
-
-void draw() {
- int whichBar = mouseX / barWidth;
- if (whichBar != lastBar) {
- int barX = whichBar * barWidth;
- fill(barX, mouseY, 66);
- rect(barX, 0, barWidth, height);
- lastBar = whichBar;
- }
-}
diff --git a/android/examples/Basics/Color/WaveGradient/WaveGradient.pde b/android/examples/Basics/Color/WaveGradient/WaveGradient.pde
deleted file mode 100644
index eac305093f..0000000000
--- a/android/examples/Basics/Color/WaveGradient/WaveGradient.pde
+++ /dev/null
@@ -1,39 +0,0 @@
-/**
- * Wave Gradient
- * by Ira Greenberg.
- *
- * Generate a gradient along a sin() wave.
- */
-
-float angle = 0;
-float px = 0, py = 0;
-float amplitude = 30;
-float frequency = 0;
-float fillGap = 2.5;
-color c;
-
-void setup() {
- size(200, 200);
- background(200,200,200);
- noLoop();
-}
-
-void draw() {
- for (int i =- 75; i < height+75; i++){
- // Reset angle to 0, so waves stack properly
- angle = 0;
- // Increasing frequency causes more gaps
- frequency+=.006;
- for (float j=0; j 0){
- for(int j = margin; j < width-margin; j+= box_space){
- fill(255-box_size*10);
- rect(j, i, box_size, box_size);
- }
- box_size = box_size - 0.6;
- }
-}
-
-
diff --git a/android/examples/Basics/Control/Iteration/Iteration.pde b/android/examples/Basics/Control/Iteration/Iteration.pde
deleted file mode 100644
index 722806122a..0000000000
--- a/android/examples/Basics/Control/Iteration/Iteration.pde
+++ /dev/null
@@ -1,45 +0,0 @@
-/**
- * Iteration.
- *
- * Iteration with a "for" structure constructs repetitive forms.
- */
-
-int k;
-int xpos1 = 100;
-int xpos2 = 118;
-int count = 0;
-int timey = 0;
-int num = 12;
-
-size(200, 200);
-background(102);
-noStroke();
-
-// Draw gray bars
-fill(255);
-k=60;
-for(int i=0; i < num/3; i++) {
- rect(25, k, 155, 5);
- k+=10;
-}
-
-// Black bars
-fill(51);
-k = 40;
-for(int i=0; i < num; i++) {
- rect(105, k, 30, 5);
- k += 10;
-}
-k = 15;
-for(int i = 0; i < num; i++) {
- rect(125, k, 30, 5);
- k +=10;
-}
-
-// Thin lines
-k = 42;
-fill(0);
-for(int i=0; i < num-1; i++) {
- rect(36, k, 20, 1);
- k+=10;
-}
diff --git a/android/examples/Basics/Control/LogicalOperators/LogicalOperators.pde b/android/examples/Basics/Control/LogicalOperators/LogicalOperators.pde
deleted file mode 100644
index d9329c0048..0000000000
--- a/android/examples/Basics/Control/LogicalOperators/LogicalOperators.pde
+++ /dev/null
@@ -1,45 +0,0 @@
-/**
- * Logical Operators.
- *
- * The logical operators for AND (&&) and OR (||) are used to
- * combine simple relational statements into more complex expressions.
- * The NOT (!) operator is used to negate a boolean statement.
- */
-
-size(200, 200);
-background(126);
-
-boolean op = false;
-
-for(int i=5; i<=195; i+=5) {
- // Logical AND
- stroke(0);
- if((i > 35) && (i < 100)) {
- line(5, i, 95, i);
- op = false;
- }
-
- // Logical OR
- stroke(76);
- if((i <= 35) || (i >= 100)) {
- line(105, i, 195, i);
- op = true;
- }
-
- // Testing if a boolean value is "true"
- // The expression "if(op)" is equivalent to "if(op == true)"
- if(op) {
- stroke(0);
- point(width/2, i);
- }
-
- // Testing if a boolean value is "false"
- // The expression "if(!op)" is equivalent to "if(op == false)"
- if(!op) {
- stroke(255);
- point(width/4, i);
- }
-}
-
-
-
diff --git a/android/examples/Basics/Data/CharactersStrings/CharactersStrings.pde b/android/examples/Basics/Data/CharactersStrings/CharactersStrings.pde
deleted file mode 100644
index c5b528562d..0000000000
--- a/android/examples/Basics/Data/CharactersStrings/CharactersStrings.pde
+++ /dev/null
@@ -1,82 +0,0 @@
-/**
- * Characters Strings.
- *
- * Click on the image to give it focus and then type letters to
- * shift the location of the image.
- * Characters are typographic symbols such as A, d, and %.
- * The character datatype, abbreviated as char, stores letters and
- * symbols in the Unicode format, a coding system developed to support
- * a variety of world languages. Characters are distinguished from other
- * symbols by putting them between single quotes ('P').
- * A string is a sequence of characters. A string is noted by surrounding
- * a group of letters with double quotes ("Processing").
- * Chars and strings are most often used with the keyboard methods,
- * to display text to the screen, and to load images or files.
- */
-
-PImage frog;
-PFont font;
-int xoffset;
-char letter;
-
-void setup()
-{
- size(200, 200, P2D);
-
- font = loadFont("Eureka-90.vlw");
- textFont(font);
- // Draw text more accurately and efficiently.
- textMode(SCREEN);
- textAlign(CENTER);
-
- // The String datatype must be capitalized because it is a complex datatype.
- // A String is actually a class with its own methods, some of which are
- // featured below.
- String name = "rathausFrog";
- String extension = ".jpg";
- int nameLength = name.length();
- println("The length of " + name + " is " + nameLength + ".");
- name = name.concat(extension);
- nameLength = name.length();
- println("The length of " + name + " is " + nameLength + ".");
-
- // The parameter for the loadImage() method must be a string
- // This line could also be written "frog = loadImage("rathausFrog.jpg");
- frog = loadImage(name);
-}
-
-void draw()
-{
- background(51); // Set background to dark gray
-
- // Same as image(frog, xoffset, 0), but more efficient
- // because no transformations or tint() or smooth() are used.
- set(xoffset, 0, frog);
-
- // Draw an X
- line(0, 0, width, height);
- line(0, height, width, 0);
-
-// // Get the width of the letter
-// float letterWidth = textWidth(letter);
-//
- // Draw the letter to the center of the screen
- text(letter, width/2, height/2);
-}
-
-void keyPressed()
-{
- // The variable "key" always contains the value of the most recent key pressed.
- // If the key is an upper or lowercase letter between 'A' and 'z'
- // the image is shifted to the corresponding value of that key
- if (key >= 'A' && key <= 'z') {
- // Map the index of the key pressed from the range between 'A' and 'z',
- // into a position for the left edge of the image. The maximum xoffset
- // is the width of the drawing area minus the size of the image.
- xoffset = int(map(key, 'A', 'z', 0, width - frog.width));
- // Update the letter shown to the screen
- letter = key;
- // Write the letter to the console
- println(key);
- }
-}
diff --git a/android/examples/Basics/Data/CharactersStrings/data/Eureka-90.vlw b/android/examples/Basics/Data/CharactersStrings/data/Eureka-90.vlw
deleted file mode 100644
index d78d182728..0000000000
Binary files a/android/examples/Basics/Data/CharactersStrings/data/Eureka-90.vlw and /dev/null differ
diff --git a/android/examples/Basics/Data/CharactersStrings/data/rathausFrog.jpg b/android/examples/Basics/Data/CharactersStrings/data/rathausFrog.jpg
deleted file mode 100644
index 220deece8f..0000000000
Binary files a/android/examples/Basics/Data/CharactersStrings/data/rathausFrog.jpg and /dev/null differ
diff --git a/android/examples/Basics/Data/DatatypeConversion/DatatypeConversion.pde b/android/examples/Basics/Data/DatatypeConversion/DatatypeConversion.pde
deleted file mode 100644
index 381afd181b..0000000000
--- a/android/examples/Basics/Data/DatatypeConversion/DatatypeConversion.pde
+++ /dev/null
@@ -1,28 +0,0 @@
-/**
- * Datatype Conversion.
- *
- * It is sometimes beneficial to convert a value from one type of
- * data to another. Each of the conversion functions converts its parameter
- * to an equivalent representation within its datatype.
- * The conversion functions include int(), float(), char(), byte(), and others.
- */
-
-size(200, 200);
-background(51);
-noStroke();
-
-char c; // Chars are used for storing typographic symbols
-float f; // Floats are decimal numbers
-int i; // Ints are values between 2,147,483,647 and -2147483648
-byte b; // Bytes are values between -128 and 128
-
-c = 'A';
-f = float(c); // Sets f = 65.0
-i = int(f * 1.4); // Sets i to 91
-b = byte(c / 2); // Sets b to 32
-
-rect(f, 0, 40, 66);
-fill(204);
-rect(i, 67, 40, 66);
-fill(255);
-rect(b, 134, 40, 66);
diff --git a/android/examples/Basics/Data/IntegersFloats/IntegersFloats.pde b/android/examples/Basics/Data/IntegersFloats/IntegersFloats.pde
deleted file mode 100644
index 87bf67f19b..0000000000
--- a/android/examples/Basics/Data/IntegersFloats/IntegersFloats.pde
+++ /dev/null
@@ -1,36 +0,0 @@
-/**
- * Integers Floats.
- *
- * Integers and floats are two different kinds of numerical data.
- * An integer (more commonly called an int) is a number without
- * a decimal point. A float is a floating-point number, which means
- * it is a number that has a decimal place. Floats are used when
- * more precision is needed.
- */
-
-int a = 0; // Create a variable "a" of the datatype "int"
-float b = 0.0; // Create a variable "b" of the datatype "float"
-
-void setup()
-{
- size(200, 200);
- stroke(255);
- frameRate(30);
-}
-
-void draw()
-{
- background(51);
-
- a = a + 1;
- b = b + 0.2;
- line(a, 0, a, height/2);
- line(b, height/2, b, height);
-
- if(a > width) {
- a = 0;
- }
- if(b > width) {
- b = 0;
- }
-}
diff --git a/android/examples/Basics/Data/TrueFalse/TrueFalse.pde b/android/examples/Basics/Data/TrueFalse/TrueFalse.pde
deleted file mode 100644
index c4bb0531ff..0000000000
--- a/android/examples/Basics/Data/TrueFalse/TrueFalse.pde
+++ /dev/null
@@ -1,34 +0,0 @@
-/**
- * True/False.
- *
- * Boolean data is one bit of information. True or false.
- * It is common to use Booleans with control statements to
- * determine the flow of a program. In this example, when the
- * boolean value "x" is true, vertical black lines are drawn and when
- * the boolean value "x" is false, horizontal gray lines are drawn.
- */
-
-boolean x = false;
-
-size(200, 200);
-background(0);
-stroke(0);
-
-for (int i = 1; i < width; i += 2)
-{
- if (i < width/2) {
- x = true;
- } else {
- x = false;
- }
-
- if (x) {
- stroke(255);
- line(i, 1, i, height-1);
- }
-
- if (!x) {
- stroke(126);
- line(width/2 , i, width-2, i);
- }
-}
diff --git a/android/examples/Basics/Data/VariableScope/VariableScope.pde b/android/examples/Basics/Data/VariableScope/VariableScope.pde
deleted file mode 100644
index 8c2ae3559e..0000000000
--- a/android/examples/Basics/Data/VariableScope/VariableScope.pde
+++ /dev/null
@@ -1,61 +0,0 @@
-/**
- * Variable Scope.
- *
- * Variables may either have a global or local "scope".
- * For example, variables declared within either the
- * setup() or loop() functions may be only used in these
- * functions. Global variables, variables declared outside
- * of setup() and loop(), may be used anywhere within the program.
- * If a local variable is declared with the same name as a
- * global variable, the program will use the local variable to make
- * its calculations within the current scope. Variables may be localized
- * within classes, functions, and iterative statements.
- */
-
-int a = 20; // Create a global variable "a"
-
-void setup()
-{
- size(200, 200);
- background(51);
- stroke(255);
- noLoop();
-}
-
-void draw()
-{
- // Draw a line using the global variable "a"
- line(a, 0, a, height);
-
- // Create a new variable "a" local to the for() statement
- for(int a=50; a<80; a += 2) {
- line(a, 0, a, height);
- }
-
- // Create a new variable "a" local to the loop() method
- int a = 100;
- // Draw a line using the new local variable "a"
- line(a, 0, a, height);
-
- // Make a call to the custom function drawAnotherLine()
- drawAnotherLine();
-
- // Make a call to the custom function setYetAnotherLine()
- drawYetAnotherLine();
-}
-
-void drawAnotherLine()
-{
- // Create a new variable "a" local to this method
- int a = 185;
- // Draw a line using the local variable "a"
- line(a, 0, a, height);
-}
-
-void drawYetAnotherLine()
-{
- // Because no new local variable "a" is set,
- // this lines draws using the original global
- // variable "a" which is set to the value 20.
- line(a+2, 0, a+2, height);
-}
diff --git a/android/examples/Basics/Data/Variables/Variables.pde b/android/examples/Basics/Data/Variables/Variables.pde
deleted file mode 100644
index 9566ae472a..0000000000
--- a/android/examples/Basics/Data/Variables/Variables.pde
+++ /dev/null
@@ -1,23 +0,0 @@
-/**
- * Variables.
- *
- * Variables are used for storing values. In this example, changing
- * the values of variables 'a' and 'b' significantly change the composition.
- */
-
-size(200, 200);
-background(0);
-stroke(153);
-
-int a = 20;
-int b = 50;
-int c = a*8;
-int d = a*9;
-int e = b-a;
-int f = b*2;
-int g = f+e;
-
-line(a, f, b, g);
-line(b, e, b, g);
-line(b, e, d, c);
-line(a, e, d-e, c);
diff --git a/android/examples/Basics/Form/Bezier/Bezier.pde b/android/examples/Basics/Form/Bezier/Bezier.pde
deleted file mode 100644
index e0b53db21d..0000000000
--- a/android/examples/Basics/Form/Bezier/Bezier.pde
+++ /dev/null
@@ -1,18 +0,0 @@
-/**
- * Bezier.
- *
- * The first two parameters for the bezier() function specify the
- * first point in the curve and the last two parameters specify
- * the last point. The middle parameters set the control points
- * that define the shape of the curve.
- */
-
-size(200, 200);
-background(0);
-stroke(255);
-noFill();
-smooth();
-
-for(int i = 0; i < 100; i += 20) {
- bezier(90-(i/2.0), 20+i, 210, 10, 220, 150, 120-(i/8.0), 150+(i/4.0));
-}
diff --git a/android/examples/Basics/Form/BezierEllipse/BezierEllipse.pde b/android/examples/Basics/Form/BezierEllipse/BezierEllipse.pde
deleted file mode 100644
index 7db555f8c3..0000000000
--- a/android/examples/Basics/Form/BezierEllipse/BezierEllipse.pde
+++ /dev/null
@@ -1,103 +0,0 @@
-/**
- * Bezier Ellipse
- * By Ira Greenberg
- *
- * Generates an ellipse using bezier() and
- * trig functions. Approximately every 1/2
- * second a new ellipse is plotted using
- * random values for control/anchor points.
- */
-
-// arrays to hold ellipse coordinate data
-float[] px, py, cx, cy, cx2, cy2;
-
-// global variable-points in ellipse
-int pts = 4;
-
-color controlPtCol = #222222;
-color anchorPtCol = #BBBBBB;
-
-void setup(){
- size(200, 200);
- smooth();
- setEllipse(pts, 65, 65);
- frameRate(1);
-}
-
-void draw(){
- background(145);
- drawEllipse();
- setEllipse(int(random(3, 12)), random(-100, 150), random(-100, 150));
-}
-
-// draw ellipse with anchor/control points
-void drawEllipse(){
- strokeWeight(1.125);
- stroke(255);
- noFill();
- // create ellipse
- for (int i=0; i0){
- line(px[i], py[i], cx2[i-1], cy2[i-1]);
- }
- line(px[i], py[i], cx[i], cy[i]);
- }
-
- for ( int i=0; i< pts; i++){
- fill(controlPtCol);
- noStroke();
- //control handles
- ellipse(cx[i], cy[i], 4, 4);
- ellipse(cx2[i], cy2[i], 4, 4);
-
- fill(anchorPtCol);
- stroke(0);
- //anchor points
- rect(px[i], py[i], 5, 5);
- }
-}
-
-// fill up arrays with ellipse coordinate data
-void setEllipse(int points, float radius, float controlRadius){
- pts = points;
- px = new float[points];
- py = new float[points];
- cx = new float[points];
- cy = new float[points];
- cx2 = new float[points];
- cy2 = new float[points];
- float angle = 360.0/points;
- float controlAngle1 = angle/3.0;
- float controlAngle2 = controlAngle1*2.0;
- for ( int i=0; i 1) { sa = 1; }
- return 1-sa;
-}
-
-float squared(float sa) {
- sa = sa*sa;
- return sa;
-}
diff --git a/android/examples/Basics/Form/TriangleStrip/TriangleStrip.pde b/android/examples/Basics/Form/TriangleStrip/TriangleStrip.pde
deleted file mode 100644
index 8ad1dbdc0b..0000000000
--- a/android/examples/Basics/Form/TriangleStrip/TriangleStrip.pde
+++ /dev/null
@@ -1,36 +0,0 @@
-/**
- * TRIANGLE_STRIP Mode
- * by Ira Greenberg.
- *
- * Generate a closed ring using vertex()
- * function and beginShape(TRIANGLE_STRIP)
- * mode. outerRad and innerRad variables
- * control ring's outer/inner radii respectively.
- * Trig functions generate ring.
- */
-
-size(200, 200);
-background(204);
-smooth();
-
-int x = width/2;
-int y = height/2;
-float outerRad = min(width, height) * 0.4;
-float innerRad = outerRad * 0.6;
-float px = 0, py = 0, angle = 0;
-float pts = 36;
-float rot = 360.0/pts;
-
-beginShape(TRIANGLE_STRIP);
-for (int i = 0; i < pts; i++) {
- px = x + cos(radians(angle))*outerRad;
- py = y + sin(radians(angle))*outerRad;
- angle += rot;
- vertex(px, py);
- px = x + cos(radians(angle))*innerRad;
- py = y + sin(radians(angle))*innerRad;
- vertex(px, py);
- angle += rot;
-}
-endShape();
-
diff --git a/android/examples/Basics/Form/Vertices/Vertices.pde b/android/examples/Basics/Form/Vertices/Vertices.pde
deleted file mode 100644
index f8c7056504..0000000000
--- a/android/examples/Basics/Form/Vertices/Vertices.pde
+++ /dev/null
@@ -1,47 +0,0 @@
-/**
- * Vertices.
- *
- * The beginShape() function begins recording vertices
- * for a shape and endShape() stops recording.
- * A vertex is a location in space specified by X, Y,
- * and sometimes Z coordinates. After calling the beginShape() function,
- * a series of vertex() functions must follow.
- * To stop drawing the shape, call the endShape() functions.
- */
-
-size(200, 200);
-background(0);
-noFill();
-
-stroke(102);
-beginShape();
-curveVertex(168, 182);
-curveVertex(168, 182);
-curveVertex(136, 38);
-curveVertex(42, 34);
-curveVertex(64, 200);
-curveVertex(64, 200);
-endShape();
-
-stroke(51);
-beginShape(LINES);
-vertex(60, 40);
-vertex(160, 10);
-vertex(170, 150);
-vertex(60, 150);
-endShape();
-
-stroke(126);
-beginShape();
-vertex(60, 40);
-bezierVertex(160, 10, 170, 150, 60, 150);
-endShape();
-
-stroke(255);
-beginShape(POINTS);
-vertex(60, 40);
-vertex(160, 10);
-vertex(170, 150);
-vertex(60, 150);
-endShape();
-
diff --git a/android/examples/Basics/Image/Alphamask/Alphamask.pde b/android/examples/Basics/Image/Alphamask/Alphamask.pde
deleted file mode 100644
index 59684e6a47..0000000000
--- a/android/examples/Basics/Image/Alphamask/Alphamask.pde
+++ /dev/null
@@ -1,24 +0,0 @@
-/**
- * Alpha Mask.
- *
- * Loads a "mask" for an image to specify the transparency
- * in different parts of the image. The two images are blended
- * together using the mask() method of PImage.
- */
-
-PImage img;
-PImage maskImg;
-
-void setup() {
- size(200, 200);
- img = loadImage("test.jpg");
- maskImg = loadImage("mask.jpg");
- img.mask(maskImg);
- imageMode(CENTER);
-}
-
-void draw() {
- background(map(mouseX+mouseY, 0, width+height, 0, 255));
- image(img, width/2, height/2);
- image(img, mouseX, mouseY);
-}
diff --git a/android/examples/Basics/Image/Alphamask/data/mask.jpg b/android/examples/Basics/Image/Alphamask/data/mask.jpg
deleted file mode 100644
index bbd1382544..0000000000
Binary files a/android/examples/Basics/Image/Alphamask/data/mask.jpg and /dev/null differ
diff --git a/android/examples/Basics/Image/Alphamask/data/test.jpg b/android/examples/Basics/Image/Alphamask/data/test.jpg
deleted file mode 100644
index 04d3fc56db..0000000000
Binary files a/android/examples/Basics/Image/Alphamask/data/test.jpg and /dev/null differ
diff --git a/android/examples/Basics/Image/BackgroundImage/BackgroundImage.pde b/android/examples/Basics/Image/BackgroundImage/BackgroundImage.pde
deleted file mode 100644
index 2c5f1aac8a..0000000000
--- a/android/examples/Basics/Image/BackgroundImage/BackgroundImage.pde
+++ /dev/null
@@ -1,30 +0,0 @@
-/**
- * Background Image.
- *
- * This example presents the fastest way to load a background image
- * into Processing. To load an image as the background, it must be
- * the same width and height as the program.
- */
-
-PImage bg;
-int a;
-
-void setup()
-{
- size(200,200);
- frameRate(30);
- // The background image must be the same size as the parameters
- // into the size() method. In this program, the size of "milan_rubbish.jpg"
- // is 200 x 200 pixels.
- bg = loadImage("milan_rubbish.jpg");
-}
-
-void draw()
-{
- background(bg);
-
- a = (a + 1)%(width+32);
- stroke(226, 204, 0);
- line(0, a, width, a-26);
- line(0, a-6, width, a-32);
-}
diff --git a/android/examples/Basics/Image/BackgroundImage/data/milan_rubbish.jpg b/android/examples/Basics/Image/BackgroundImage/data/milan_rubbish.jpg
deleted file mode 100644
index 516d46d5d1..0000000000
Binary files a/android/examples/Basics/Image/BackgroundImage/data/milan_rubbish.jpg and /dev/null differ
diff --git a/android/examples/Basics/Image/CreateImage/CreateImage.pde b/android/examples/Basics/Image/CreateImage/CreateImage.pde
deleted file mode 100644
index df095a75e9..0000000000
--- a/android/examples/Basics/Image/CreateImage/CreateImage.pde
+++ /dev/null
@@ -1,24 +0,0 @@
-/**
- * Create Image.
- *
- * The createImage() function provides a fresh buffer of pixels to play with.
- * This example creates an image gradient.
- */
-
-PImage img;
-
-void setup()
-{
- size(200, 200);
- img = createImage(120, 120, ARGB);
- for(int i=0; i < img.pixels.length; i++) {
- img.pixels[i] = color(0, 90, 102, i%img.width * 2);
- }
-}
-
-void draw()
-{
- background(204);
- image(img, 33, 33);
- image(img, mouseX-60, mouseY-60);
-}
diff --git a/android/examples/Basics/Image/CreateImage/data/mask.jpg b/android/examples/Basics/Image/CreateImage/data/mask.jpg
deleted file mode 100644
index bbd1382544..0000000000
Binary files a/android/examples/Basics/Image/CreateImage/data/mask.jpg and /dev/null differ
diff --git a/android/examples/Basics/Image/CreateImage/data/test.jpg b/android/examples/Basics/Image/CreateImage/data/test.jpg
deleted file mode 100644
index 04d3fc56db..0000000000
Binary files a/android/examples/Basics/Image/CreateImage/data/test.jpg and /dev/null differ
diff --git a/android/examples/Basics/Image/LoadDisplayImage/LoadDisplayImage.pde b/android/examples/Basics/Image/LoadDisplayImage/LoadDisplayImage.pde
deleted file mode 100644
index 8252c5cbc1..0000000000
--- a/android/examples/Basics/Image/LoadDisplayImage/LoadDisplayImage.pde
+++ /dev/null
@@ -1,23 +0,0 @@
-/**
- * Load and Display
- *
- * Images can be loaded and displayed to the screen at their actual size
- * or any other size.
- */
-
-PImage a; // Declare variable "a" of type PImage
-
-void setup() {
- size(200, 200);
- // The file "jelly.jpg" must be in the data folder
- // of the current sketch to load successfully
- a = loadImage("jelly.jpg"); // Load the image into the program
- noLoop(); // Makes draw() only run once
-}
-
-void draw() {
- // Displays the image at its actual size at point (0,0)
- image(a, 0, 0);
- // Displays the image at point (100, 0) at half of its size
- image(a, 100, 0, a.width/2, a.height/2);
-}
diff --git a/android/examples/Basics/Image/LoadDisplayImage/data/jelly.jpg b/android/examples/Basics/Image/LoadDisplayImage/data/jelly.jpg
deleted file mode 100644
index a881c7e8bd..0000000000
Binary files a/android/examples/Basics/Image/LoadDisplayImage/data/jelly.jpg and /dev/null differ
diff --git a/android/examples/Basics/Image/Pointillism/Pointillism.pde b/android/examples/Basics/Image/Pointillism/Pointillism.pde
deleted file mode 100644
index 3b7c96700a..0000000000
--- a/android/examples/Basics/Image/Pointillism/Pointillism.pde
+++ /dev/null
@@ -1,38 +0,0 @@
-/**
- * Pointillism
- * by Daniel Shiffman.
- *
- * Mouse horizontal location controls size of dots.
- * Creates a simple pointillist effect using ellipses colored
- * according to pixels in an image.
- *
- * Updated 27 February 2010.
- */
-
-PImage img;
-
-int smallPoint = 2;
-int largePoint;
-int top, left;
-
-void setup() {
- size(200, 200);
- img = loadImage("eames.jpg");
- //img = loadImage("sunflower.jpg"); // an alternative image
- noStroke();
- background(255);
- smooth();
- largePoint = min(width, height) / 10;
- // center the image on the screen
- left = (width - img.width) / 2;
- top = (height - img.height) / 2;
-}
-
-void draw() {
- float pointillize = map(mouseX, 0, width, smallPoint, largePoint);
- int x = int(random(img.width));
- int y = int(random(img.height));
- color pix = img.get(x, y);
- fill(pix, 128);
- ellipse(left + x, top + y, pointillize, pointillize);
-}
diff --git a/android/examples/Basics/Image/Pointillism/data/eames.jpg b/android/examples/Basics/Image/Pointillism/data/eames.jpg
deleted file mode 100644
index c89377e40b..0000000000
Binary files a/android/examples/Basics/Image/Pointillism/data/eames.jpg and /dev/null differ
diff --git a/android/examples/Basics/Image/Pointillism/data/sunflower.jpg b/android/examples/Basics/Image/Pointillism/data/sunflower.jpg
deleted file mode 100644
index 88398d1883..0000000000
Binary files a/android/examples/Basics/Image/Pointillism/data/sunflower.jpg and /dev/null differ
diff --git a/android/examples/Basics/Image/RequestImage/RequestImage.pde b/android/examples/Basics/Image/RequestImage/RequestImage.pde
deleted file mode 100644
index 0e835c7ca0..0000000000
--- a/android/examples/Basics/Image/RequestImage/RequestImage.pde
+++ /dev/null
@@ -1,91 +0,0 @@
-/**
- * Request Image
- * by Ira Greenberg.
- * From Processing for Flash Developers, Friends of ED, 2009.
- *
- * Shows how to use the requestImage() function with preloader animation.
- * The requestImage() function loads images on a separate thread so that
- * the sketch does not freeze while they load. It's very useful when you are
- * loading large images, as this example demonstrates.
- *
- * To work, this example requires 10 images named dublin0.jpg ... dublin9.jpg
- * in the sketch data directory. To save space, these images are not included
- * with the example.
- */
-
-int imgCount = 10;
-PImage[] imgs = new PImage[imgCount];
-float imgW;
-
-// Keeps track of loaded images (true or false)
-boolean[] loadStates = new boolean[imgCount];
-
-// For loading animation
-float loaderX, loaderY, theta;
-
-void setup() {
- size(800, 60);
- smooth();
- imgW = width/imgCount;
-
- // Load images asynchronously
- for (int i = 0; i < imgCount; i++){
- imgs[i] = requestImage("dublin"+i+".jpg");
- }
-}
-
-void draw(){
- background(0);
-
- // Start loading animation
- runLoaderAni();
-
- for (int i = 0; i < imgs.length; i++){
- // Check if individual images are fully loaded
- if ((imgs[i].width != 0) && (imgs[i].width != -1)){
- // As images are loaded set true in boolean array
- loadStates[i] = true;
- }
- }
- // When all images are loaded draw them to the screen
- if (checkLoadStates()){
- drawImages();
- }
-}
-
-void drawImages(){
- for (int i = 0; i < imgs.length; i++){
- image(imgs[i], width/10*i, 0, imgW, height);
- }
-}
-
-// Loading animation
-void runLoaderAni(){
- // Only run when images are loading
- if (!checkLoadStates()){
- ellipse(loaderX, loaderY, 10, 10);
- loaderX += 2;
- loaderY = height/2 + sin(theta) * (height/2.5);
- theta += PI/22;
- // Reposition ellipse if it goes off the screen
- if (loaderX > width + 5){
- loaderX = -5;
- }
- }
-}
-
-// Return true when all images are loaded - no false values left in array
-boolean checkLoadStates(){
- for (int i = 0; i < imgs.length; i++){
- if (loadStates[i] == false){
- return false;
- }
- }
- return true;
-}
-
-
-
-
-
-
diff --git a/android/examples/Basics/Image/Sprite/Sprite.pde b/android/examples/Basics/Image/Sprite/Sprite.pde
deleted file mode 100644
index 2ea0c27820..0000000000
--- a/android/examples/Basics/Image/Sprite/Sprite.pde
+++ /dev/null
@@ -1,38 +0,0 @@
-/**
- * Sprite (Teddy)
- * by James Patterson.
- *
- * Demonstrates loading and displaying a transparent GIF image.
- */
-
-PImage teddy;
-
-float xpos;
-float ypos;
-float drag = 30;
-
-void setup() {
- size(200, 200);
- teddy = loadImage("teddy.gif");
- xpos = width/2;
- ypos = height/2;
-}
-
-void draw() {
- background(102);
-
- float difx = mouseX - xpos-teddy.width/2;
- if (abs(difx) > 1) {
- xpos = xpos + difx/drag;
- xpos = constrain(xpos, 0, width-teddy.width);
- }
-
- float dify = mouseY - ypos-teddy.height/2;
- if (abs(dify) > 1) {
- ypos = ypos + dify/drag;
- ypos = constrain(ypos, 0, height-teddy.height);
- }
-
- // Display the sprite at the position xpos, ypos
- image(teddy, xpos, ypos);
-}
diff --git a/android/examples/Basics/Image/Sprite/data/teddy.gif b/android/examples/Basics/Image/Sprite/data/teddy.gif
deleted file mode 100644
index 8994c1bdd6..0000000000
Binary files a/android/examples/Basics/Image/Sprite/data/teddy.gif and /dev/null differ
diff --git a/android/examples/Basics/Image/Sprite2/Sprite2.pde b/android/examples/Basics/Image/Sprite2/Sprite2.pde
deleted file mode 100644
index dff97453a6..0000000000
--- a/android/examples/Basics/Image/Sprite2/Sprite2.pde
+++ /dev/null
@@ -1,45 +0,0 @@
-/**
- * Sprite2 (Teddy)
- * by James Patterson.
- *
- * Demonstrates loading and displaying a transparent GIF image.
- * This alternate version shows a sky image in the background.
- */
-
-PImage teddy;
-PImage sky;
-
-float xpos;
-float ypos;
-float drag = 30.0;
-
-void setup() {
- size(200, 200);
- teddy = loadImage("teddy.gif");
- sky = loadImage("sky.jpg");
- xpos = width/2;
- ypos = height/2;
- // resize the background image so that it fills the screen
- if (sky.width != width || sky.height != height) {
- sky.resize(width, height);
- }
-}
-
-void draw() {
- background(sky);
-
- float difx = mouseX - xpos-teddy.width/2;
- if (abs(difx) > 1) {
- xpos = xpos + difx/drag;
- xpos = constrain(xpos, 0, width-teddy.width);
- }
-
- float dify = mouseY - ypos-teddy.height/2;
- if (abs(dify) > 1 ) {
- ypos = ypos + dify/drag;
- ypos = constrain(ypos, 0, height-teddy.height);
- }
-
- // Display the sprite at the position xpos, ypos
- image(teddy, xpos, ypos);
-}
diff --git a/android/examples/Basics/Image/Sprite2/data/sky.jpg b/android/examples/Basics/Image/Sprite2/data/sky.jpg
deleted file mode 100644
index 361509941b..0000000000
Binary files a/android/examples/Basics/Image/Sprite2/data/sky.jpg and /dev/null differ
diff --git a/android/examples/Basics/Image/Sprite2/data/teddy.gif b/android/examples/Basics/Image/Sprite2/data/teddy.gif
deleted file mode 100644
index 8994c1bdd6..0000000000
Binary files a/android/examples/Basics/Image/Sprite2/data/teddy.gif and /dev/null differ
diff --git a/android/examples/Basics/Image/Transparency/Transparency.pde b/android/examples/Basics/Image/Transparency/Transparency.pde
deleted file mode 100644
index a528ddb35d..0000000000
--- a/android/examples/Basics/Image/Transparency/Transparency.pde
+++ /dev/null
@@ -1,29 +0,0 @@
-/**
- * Transparency.
- *
- * Move the pointer left and right across the image to change
- * its position. This program overlays one image over another
- * by modifying the alpha value of the image with the tint() function.
- */
-
-PImage a, b;
-float offset;
-
-void setup() {
- size(200, 200);
- a = loadImage("construct.jpg"); // Load an image into the program
- b = loadImage("wash.jpg"); // Load an image into the program
-}
-
-void draw() {
- image(a, 0, 0);
- float offsetTarget = map(mouseX, 0, width, -b.width/2 - width/2, 0);
- offset += (offsetTarget-offset)*0.05;
- tint(255, 153);
- image(b, offset, 20);
-}
-
-
-
-
-
diff --git a/android/examples/Basics/Image/Transparency/data/construct.jpg b/android/examples/Basics/Image/Transparency/data/construct.jpg
deleted file mode 100644
index 648678bb98..0000000000
Binary files a/android/examples/Basics/Image/Transparency/data/construct.jpg and /dev/null differ
diff --git a/android/examples/Basics/Image/Transparency/data/wash.jpg b/android/examples/Basics/Image/Transparency/data/wash.jpg
deleted file mode 100644
index 03beb544de..0000000000
Binary files a/android/examples/Basics/Image/Transparency/data/wash.jpg and /dev/null differ
diff --git a/android/examples/Basics/Input/Clock/Clock.pde b/android/examples/Basics/Input/Clock/Clock.pde
deleted file mode 100644
index 27ce7b3342..0000000000
--- a/android/examples/Basics/Input/Clock/Clock.pde
+++ /dev/null
@@ -1,64 +0,0 @@
-/**
- * Clock.
- *
- * The current time can be read with the second(), minute(),
- * and hour() functions. In this example, sin() and cos() values
- * are used to set the position of the hands.
- *
- * Updated 27 February 2010 to handle size() changes.
- */
-
-int cx, cy;
-float secondsRadius;
-float minutesRadius;
-float hoursRadius;
-float clockDiameter;
-
-void setup() {
- size(200, 200);
- stroke(255);
- smooth();
-
- int radius = min(width, height) / 2;
- secondsRadius = radius * 0.72;
- minutesRadius = radius * 0.60;
- hoursRadius = radius * 0.50;
- clockDiameter = radius * 1.8;
-
- cx = width / 2;
- cy = height / 2;
-}
-
-void draw2() {
- background(0);
-
- // Draw the clock background
- fill(80);
- noStroke();
- ellipse(cx, cy, clockDiameter, clockDiameter);
-
- // Angles for sin() and cos() start at 3 o'clock;
- // subtract HALF_PI to make them start at the top
- float s = map(second(), 0, 60, 0, TWO_PI) - HALF_PI;
- float m = map(minute() + norm(second(), 0, 60), 0, 60, 0, TWO_PI) - HALF_PI;
- float h = map(hour() + norm(minute(), 0, 60), 0, 24, 0, TWO_PI * 2) - HALF_PI;
-
- // Draw the hands of the clock
- stroke(255);
- strokeWeight(1);
- line(cx, cy, cx + cos(s) * secondsRadius, cy + sin(s) * secondsRadius);
- strokeWeight(2);
- line(cx, cy, cx + cos(m) * minutesRadius, cy + sin(m) * minutesRadius);
- strokeWeight(4);
- line(cx, cy, cx + cos(h) * hoursRadius, cy + sin(h) * hoursRadius);
-
- // Draw the minute ticks
- strokeWeight(2);
- beginShape(POINTS);
- for (int a = 0; a < 360; a+=6) {
- float x = cx + cos(radians(a)) * secondsRadius;
- float y = cy + sin(radians(a)) * secondsRadius;
- vertex(x, y);
- }
- endShape();
-}
diff --git a/android/examples/Basics/Input/Constrain/Constrain.pde b/android/examples/Basics/Input/Constrain/Constrain.pde
deleted file mode 100644
index 84fcf06feb..0000000000
--- a/android/examples/Basics/Input/Constrain/Constrain.pde
+++ /dev/null
@@ -1,41 +0,0 @@
-/**
- * Constrain.
- *
- * Move the mouse across the screen to move the circle.
- * The program constrains the circle to its box.
- *
- * Updated 27 February 2010 to handle changes in size().
- */
-
-float mx;
-float my;
-float easing = 0.05;
-int radius = 24;
-int edge = 56;
-int inner = edge + radius;
-
-void setup() {
- size(200, 200);
- noStroke();
- smooth();
- ellipseMode(RADIUS);
- rectMode(CORNERS);
-}
-
-void draw() {
- background(51);
-
- if (abs(mouseX - mx) > 0.1) {
- mx = mx + (mouseX - mx) * easing;
- }
- if (abs(mouseY - my) > 0.1) {
- my = my + (mouseY- my) * easing;
- }
-
- mx = constrain(mx, inner, width - inner);
- my = constrain(my, inner, height - inner);
- fill(76);
- rect(edge, edge, width-edge, height-edge);
- fill(255);
- ellipse(mx, my, radius, radius);
-}
diff --git a/android/examples/Basics/Input/Easing/Easing.pde b/android/examples/Basics/Input/Easing/Easing.pde
deleted file mode 100644
index a090116397..0000000000
--- a/android/examples/Basics/Input/Easing/Easing.pde
+++ /dev/null
@@ -1,41 +0,0 @@
-/**
- * Easing.
- *
- * Move the mouse across the screen and the symbol will follow.
- * Between drawing each frame of the animation, the program
- * calculates the difference between the position of the
- * symbol and the cursor. If the distance is larger than
- * 1 pixel, the symbol moves part of the distance (0.05) from its
- * current position toward the cursor.
- */
-
-float x;
-float y;
-float targetX, targetY;
-float easing = 0.05;
-
-void setup()
-{
- size(200, 200);
- smooth();
- noStroke();
-}
-
-void draw()
-{
- background( 51 );
-
- targetX = mouseX;
- float dx = targetX - x;
- if(abs(dx) > 1) {
- x += dx * easing;
- }
-
- targetY = mouseY;
- float dy = targetY - y;
- if(abs(dy) > 1) {
- y += dy * easing;
- }
-
- ellipse(x, y, 33, 33);
-}
diff --git a/android/examples/Basics/Input/Keyboard/Keyboard.pde b/android/examples/Basics/Input/Keyboard/Keyboard.pde
deleted file mode 100644
index 3eba1f1d24..0000000000
--- a/android/examples/Basics/Input/Keyboard/Keyboard.pde
+++ /dev/null
@@ -1,39 +0,0 @@
-/**
- * Keyboard.
- *
- * Click on the image to give it focus and press the letter keys
- * to create forms in time and space. Each key has a unique identifying
- * number called its ASCII value. These numbers can be used to position
- * shapes in space.
- */
-
-int rectWidth;
-
-void setup() {
- size(200, 200);
- noStroke();
- background(0);
- rectWidth = width/4;
-}
-
-void draw() {
- // keep draw() here to continue looping while waiting for keys
-}
-
-void keyPressed() {
- int keyIndex = -1;
- if (key >= 'A' && key <= 'Z') {
- keyIndex = key - 'A';
- } else if (key >= 'a' && key <= 'z') {
- keyIndex = key - 'a';
- }
- if (keyIndex == -1) {
- // If it's not a letter key, clear the screen
- background(0);
- } else {
- // It's a letter key, fill a rectangle
- fill(millis() % 255);
- float x = map(keyIndex, 0, 25, 0, width - rectWidth);
- rect(x, 0, rectWidth, height);
- }
-}
diff --git a/android/examples/Basics/Input/KeyboardFunctions/KeyboardFunctions.pde b/android/examples/Basics/Input/KeyboardFunctions/KeyboardFunctions.pde
deleted file mode 100644
index 882e92d63d..0000000000
--- a/android/examples/Basics/Input/KeyboardFunctions/KeyboardFunctions.pde
+++ /dev/null
@@ -1,89 +0,0 @@
-/**
- * Keyboard Functions.
- * Modified from code by Martin.
- * Original 'Color Typewriter' concept by John Maeda.
- *
- * Click on the window to give it focus and press the letter keys to type colors.
- * The keyboard function keyPressed() is called whenever
- * a key is pressed. keyReleased() is another keyboard
- * function that is called when a key is released.
- */
-
-int max_height = 20;
-int min_height = 10;
-int letter_height = max_height; // Height of the letters
-int letter_width = 10; // Width of the letter
-
-int x = -letter_width; // X position of the letters
-int y = 0; // Y position of the letters
-
-boolean newletter;
-
-int numChars = 26; // There are 26 characters in the alphabet
-color[] colors = new color[numChars];
-
-void setup()
-{
- size(200, 200);
- noStroke();
- colorMode(RGB, numChars);
- background(numChars/2);
- // Set a gray value for each key
- for(int i=0; i= 'A' && key <= 'z') {
- int keyIndex;
- if(key <= 'Z') {
- keyIndex = key-'A';
- letter_height = max_height;
- fill(colors[key-'A']);
- } else {
- keyIndex = key-'a';
- letter_height = min_height;
- fill(colors[key-'a']);
- }
- } else {
- fill(0);
- letter_height = 10;
- }
-
- newletter = true;
-
- // Update the "letter" position
- x = ( x + letter_width );
-
- // Wrap horizontally
- if (x > width - letter_width) {
- x = 0;
- y+= max_height;
- }
-
- // Wrap vertically
- if( y > height - letter_height) {
- y = 0; // reset y to 0
- }
-}
diff --git a/android/examples/Basics/Input/KeyboardFunctions/data/brugges.jpg b/android/examples/Basics/Input/KeyboardFunctions/data/brugges.jpg
deleted file mode 100644
index fa723f9dad..0000000000
Binary files a/android/examples/Basics/Input/KeyboardFunctions/data/brugges.jpg and /dev/null differ
diff --git a/android/examples/Basics/Input/Milliseconds/Milliseconds.pde b/android/examples/Basics/Input/Milliseconds/Milliseconds.pde
deleted file mode 100644
index 2439ba363a..0000000000
--- a/android/examples/Basics/Input/Milliseconds/Milliseconds.pde
+++ /dev/null
@@ -1,26 +0,0 @@
-/**
- * Milliseconds.
- *
- * A millisecond is 1/1000 of a second.
- * Processing keeps track of the number of milliseconds a program has run.
- * By modifying this number with the modulo(%) operator,
- * different patterns in time are created.
- */
-
-float scale;
-
-void setup()
-{
- size(200, 200);
- noStroke();
- scale = width/10;
-}
-
-void draw()
-{
- for(int i=0; i 90) {
- gx = 90;
- }
-
- if (gy > 90) {
- gy = 90;
- } else if (gy < 10) {
- gy = 10;
- }
-}
diff --git a/android/examples/Basics/Input/Mouse2D/Mouse2D.pde b/android/examples/Basics/Input/Mouse2D/Mouse2D.pde
deleted file mode 100644
index c316bc6ce3..0000000000
--- a/android/examples/Basics/Input/Mouse2D/Mouse2D.pde
+++ /dev/null
@@ -1,24 +0,0 @@
-/**
- * Mouse 2D.
- *
- * Moving the mouse changes the position and size of each box.
- */
-
-void setup()
-{
- size(200, 200);
- noStroke();
- rectMode(CENTER);
-}
-
-void draw()
-{
- background(51);
- fill(255, 204);
- rect(mouseX, height/2, mouseY/2+10, mouseY/2+10);
- fill(255, 204);
- int inverseX = width-mouseX;
- int inverseY = height-mouseY;
- rect(inverseX, height/2, (inverseY/2)+10, (inverseY/2)+10);
-}
-
diff --git a/android/examples/Basics/Input/MouseFunctions/MouseFunctions.pde b/android/examples/Basics/Input/MouseFunctions/MouseFunctions.pde
deleted file mode 100644
index 8d4e0fe363..0000000000
--- a/android/examples/Basics/Input/MouseFunctions/MouseFunctions.pde
+++ /dev/null
@@ -1,68 +0,0 @@
-/**
- * Mouse Functions.
- *
- * Click on the box and drag it across the screen.
- */
-
-float bx;
-float by;
-int bs = 20;
-boolean bover = false;
-boolean locked = false;
-float bdifx = 0.0;
-float bdify = 0.0;
-
-
-void setup()
-{
- size(200, 200);
- bx = width/2.0;
- by = height/2.0;
- rectMode(RADIUS);
-}
-
-void draw()
-{
- background(0);
-
- // Test if the cursor is over the box
- if (mouseX > bx-bs && mouseX < bx+bs &&
- mouseY > by-bs && mouseY < by+bs) {
- bover = true;
- if(!locked) {
- stroke(255);
- fill(153);
- }
- } else {
- stroke(153);
- fill(153);
- bover = false;
- }
-
- // Draw the box
- rect(bx, by, bs, bs);
-}
-
-void mousePressed() {
- if(bover) {
- locked = true;
- fill(255, 255, 255);
- } else {
- locked = false;
- }
- bdifx = mouseX-bx;
- bdify = mouseY-by;
-
-}
-
-void mouseDragged() {
- if(locked) {
- bx = mouseX-bdifx;
- by = mouseY-bdify;
- }
-}
-
-void mouseReleased() {
- locked = false;
-}
-
diff --git a/android/examples/Basics/Input/MousePress/MousePress.pde b/android/examples/Basics/Input/MousePress/MousePress.pde
deleted file mode 100644
index 526eced768..0000000000
--- a/android/examples/Basics/Input/MousePress/MousePress.pde
+++ /dev/null
@@ -1,23 +0,0 @@
-/**
- * Click.
- *
- * Move the mouse to position the shape.
- * Press the mouse button to invert the color.
- */
-
-
-void setup() {
- size(200, 200);
- fill(126);
- background(102);
-}
-
-void draw() {
- if(mousePressed) {
- stroke(255);
- } else {
- stroke(0);
- }
- line(mouseX-66, mouseY, mouseX+66, mouseY);
- line(mouseX, mouseY-66, mouseX, mouseY+66);
-}
diff --git a/android/examples/Basics/Input/MouseSignals/MouseSignals.pde b/android/examples/Basics/Input/MouseSignals/MouseSignals.pde
deleted file mode 100644
index 6e1fd2bbc3..0000000000
--- a/android/examples/Basics/Input/MouseSignals/MouseSignals.pde
+++ /dev/null
@@ -1,54 +0,0 @@
-/**
- * Mouse Signals.
- *
- * Move and click the mouse to generate signals.
- * The top row is the signal from "mouseX",
- * the middle row is the signal from "mouseY",
- * and the bottom row is the signal from "mousePressed".
- */
-
-int[] xvals;
-int[] yvals;
-int[] bvals;
-
-void setup()
-{
- size(200, 200);
- xvals = new int[width];
- yvals = new int[width];
- bvals = new int[width];
-}
-
-int arrayindex = 0;
-
-void draw()
-{
- background(102);
-
- for(int i=1; i 10000
-
-void setup()
-{
- size(640, 360, P3D);
- orientation(LANDSCAPE);
- noStroke();
- fill(204);
- sphereDetail(30);
-}
-
-void draw()
-{
- background(0);
-
- // Light the bottom of the sphere
- directionalLight(51, 102, 126, 0, -1, 0);
-
- // Orange light on the upper-right of the sphere
- spotLight(204, 153, 0, 360, 160, 600, 0, 0, -1, PI/2, 600);
-
- // Moving spotlight that follows the mouse
- spotLight(102, 153, 204, 360, mouseY, 600, 0, 0, -1, PI/2, 600);
-
- translate(width/2, height/2, 0);
- sphere(120);
-}
-
diff --git a/android/examples/Basics/Math/AdditiveWave/AdditiveWave.pde b/android/examples/Basics/Math/AdditiveWave/AdditiveWave.pde
deleted file mode 100644
index 14ba9914fc..0000000000
--- a/android/examples/Basics/Math/AdditiveWave/AdditiveWave.pde
+++ /dev/null
@@ -1,69 +0,0 @@
-/**
- * Additive Wave
- * by Daniel Shiffman.
- *
- * Create a more complex wave by adding two waves together.
- */
-
-int xspacing = 8; // How far apart should each horizontal location be spaced
-int w; // Width of entire wave
-int maxwaves = 4; // total # of waves to add together
-
-float theta = 0.0;
-float[] amplitude = new float[maxwaves]; // Height of wave
-float[] dx = new float[maxwaves]; // Value for incrementing X, to be calculated as a function of period and xspacing
-float[] yvalues; // Using an array to store height values for the wave (not entirely necessary)
-
-void setup() {
- size(200, 200);
- frameRate(30);
- colorMode(RGB, 255, 255, 255, 100);
- smooth();
- w = width + 16;
-
- for (int i = 0; i < maxwaves; i++) {
- amplitude[i] = random(10,30);
- float period = random(100,300); // How many pixels before the wave repeats
- dx[i] = (TWO_PI / period) * xspacing;
- }
-
- yvalues = new float[w/xspacing];
-}
-
-void draw() {
- background(0);
- calcWave();
- renderWave();
-}
-
-void calcWave() {
- // Increment theta (try different values for 'angular velocity' here
- theta += 0.02;
-
- // Set all height values to zero
- for (int i = 0; i < yvalues.length; i++) {
- yvalues[i] = 0;
- }
-
- // Accumulate wave height values
- for (int j = 0; j < maxwaves; j++) {
- float x = theta;
- for (int i = 0; i < yvalues.length; i++) {
- // Every other wave is cosine instead of sine
- if (j % 2 == 0) yvalues[i] += sin(x)*amplitude[j];
- else yvalues[i] += cos(x)*amplitude[j];
- x+=dx[j];
- }
- }
-}
-
-void renderWave() {
- // A simple way to draw the wave with an ellipse at each location
- noStroke();
- fill(255,50);
- ellipseMode(CENTER);
- for (int x = 0; x < yvalues.length; x++) {
- ellipse(x*xspacing,width/2+yvalues[x],16,16);
- }
-}
-
diff --git a/android/examples/Basics/Math/Arctangent/Arctangent.pde b/android/examples/Basics/Math/Arctangent/Arctangent.pde
deleted file mode 100644
index b03e0bda64..0000000000
--- a/android/examples/Basics/Math/Arctangent/Arctangent.pde
+++ /dev/null
@@ -1,67 +0,0 @@
-/**
- * Arctangent.
- *
- * Move the mouse to change the direction of the eyes.
- * The atan2() function computes the angle from each eye
- * to the cursor.
- */
-
-Eye e1, e2, e3, e4, e5;
-
-void setup()
-{
- size(200, 200);
- smooth();
- noStroke();
- e1 = new Eye( 50, 16, 80);
- e2 = new Eye( 64, 85, 40);
- e3 = new Eye( 90, 200, 120);
- e4 = new Eye(150, 44, 40);
- e5 = new Eye(175, 120, 80);
-}
-
-void draw()
-{
- background(102);
-
- e1.update(mouseX, mouseY);
- e2.update(mouseX, mouseY);
- e3.update(mouseX, mouseY);
- e4.update(mouseX, mouseY);
- e5.update(mouseX, mouseY);
-
- e1.display();
- e2.display();
- e3.display();
- e4.display();
- e5.display();
-}
-
-class Eye
-{
- int ex, ey;
- int size;
- float angle = 0.0;
-
- Eye(int x, int y, int s) {
- ex = x;
- ey = y;
- size = s;
- }
-
- void update(int mx, int my) {
- angle = atan2(my-ey, mx-ex);
- }
-
- void display() {
- pushMatrix();
- translate(ex, ey);
- fill(255);
- ellipse(0, 0, size, size);
- rotate(angle);
- fill(153);
- ellipse(size/4, 0, size/2, size/2);
- popMatrix();
- }
-}
-
diff --git a/android/examples/Basics/Math/Distance1D/Distance1D.pde b/android/examples/Basics/Math/Distance1D/Distance1D.pde
deleted file mode 100644
index a17b3febcf..0000000000
--- a/android/examples/Basics/Math/Distance1D/Distance1D.pde
+++ /dev/null
@@ -1,51 +0,0 @@
-/**
- * Distance 1D.
- *
- * Move the mouse left and right to control the
- * speed and direction of the moving shapes.
- */
-
-int thin = 8;
-int thick = 36;
-float xpos1 = 134.0;
-float xpos2 = 44.0;
-float xpos3 = 58.0;
-float xpos4 = 120.0;
-
-void setup()
-{
- size(200, 200);
- noStroke();
- frameRate(60);
-}
-
-void draw()
-{
- background(0);
-
- float mx = mouseX * 0.4 - width/5.0;
-
- fill(102);
- rect(xpos2, 0, thick, height/2);
- fill(204);
- rect(xpos1, 0, thin, height/2);
- fill(102);
- rect(xpos4, height/2, thick, height/2);
- fill(204);
- rect(xpos3, height/2, thin, height/2);
-
- xpos1 += mx/16;
- xpos2 += mx/64;
- xpos3 -= mx/16;
- xpos4 -= mx/64;
-
- if(xpos1 < -thin) { xpos1 = width; }
- if(xpos1 > width) { xpos1 = -thin; }
- if(xpos2 < -thick) { xpos2 = width; }
- if(xpos2 > width) { xpos2 = -thick; }
- if(xpos3 < -thin) { xpos3 = width; }
- if(xpos3 > width) { xpos3 = -thin; }
- if(xpos4 < -thick) { xpos4 = width; }
- if(xpos4 > width) { xpos4 = -thick; }
-}
-
diff --git a/android/examples/Basics/Math/Distance2D/Distance2D.pde b/android/examples/Basics/Math/Distance2D/Distance2D.pde
deleted file mode 100644
index e2bfe4b44d..0000000000
--- a/android/examples/Basics/Math/Distance2D/Distance2D.pde
+++ /dev/null
@@ -1,29 +0,0 @@
-/**
- * Distance 2D.
- *
- * Move the mouse across the image to obscure and reveal the matrix.
- * Measures the distance from the mouse to each square and sets the
- * size proportionally.
- */
-
-float max_distance;
-
-void setup() {
- size(200, 200);
- smooth();
- noStroke();
- max_distance = dist(0, 0, width, height);
-}
-
-void draw()
-{
- background(51);
-
- for(int i = 0; i <= width; i += 20) {
- for(int j = 0; j <= height; j += 20) {
- float size = dist(mouseX, mouseY, i, j);
- size = size/max_distance * 66;
- ellipse(i, j, size, size);
- }
- }
-}
diff --git a/android/examples/Basics/Math/DoubleRandom/DoubleRandom.pde b/android/examples/Basics/Math/DoubleRandom/DoubleRandom.pde
deleted file mode 100644
index a33bc7523b..0000000000
--- a/android/examples/Basics/Math/DoubleRandom/DoubleRandom.pde
+++ /dev/null
@@ -1,20 +0,0 @@
-/**
- * Double Random
- * by Ira Greenberg.
- *
- * Using two random() calls and the point() function
- * to create an irregular sawtooth line.
- */
-
-size(200, 200);
-background(0);
-int totalPts = 300;
-float steps = totalPts + 1;
-stroke(255);
-float rand = 0;
-
-for (int i = 1; i < steps; i++){
- point( (width/steps) * i, (height/2) + random(-rand, rand) );
- rand += random(-5, 5);
-}
-
diff --git a/android/examples/Basics/Math/Graphing2DEquation/Graphing2DEquation.pde b/android/examples/Basics/Math/Graphing2DEquation/Graphing2DEquation.pde
deleted file mode 100644
index bd20ed864b..0000000000
--- a/android/examples/Basics/Math/Graphing2DEquation/Graphing2DEquation.pde
+++ /dev/null
@@ -1,40 +0,0 @@
-/**
- * Graphing 2D Equations
- * by Daniel Shiffman.
- *
- * Graphics the following equation:
- * sin(n*cos(r) + 5*theta)
- * where n is a function of horizontal mouse location.
- */
-
-void setup() {
- size(200,200);
- frameRate(30);
-}
-
-void draw() {
- loadPixels();
- float n = (mouseX * 10.0) / width;
- float w = 16.0; // 2D space width
- float h = 16.0; // 2D space height
- float dx = w / width; // Increment x this amount per pixel
- float dy = h / height; // Increment y this amount per pixel
- float x = -w/2; // Start x at -1 * width / 2
- for (int i = 0; i < width; i++) {
- float y = -h/2; // Start y at -1 * height / 2
- for (int j = 0; j < height; j++) {
- float r = sqrt((x*x) + (y*y)); // Convert cartesian to polar
- float theta = atan2(y,x); // Convert cartesian to polar
- // Compute 2D polar coordinate function
- float val = sin(n*cos(r) + 5 * theta); // Results in a value between -1 and 1
- //float val = cos(r); // Another simple function
- //float val = sin(theta); // Another simple function
- // Map resulting vale to grayscale value
- pixels[i+j*width] = color((val + 1.0) * 255.0/2.0); // Scale to between 0 and 255
- y += dy; // Increment y
- }
- x += dx; // Increment x
- }
- updatePixels();
-}
-
diff --git a/android/examples/Basics/Math/IncrementDecrement/IncrementDecrement.pde b/android/examples/Basics/Math/IncrementDecrement/IncrementDecrement.pde
deleted file mode 100644
index 8398c5faab..0000000000
--- a/android/examples/Basics/Math/IncrementDecrement/IncrementDecrement.pde
+++ /dev/null
@@ -1,46 +0,0 @@
-/**
- * Increment Decrement.
- *
- * Writing "a++" is equivalent to "a = a + 1".
- * Writing "a--" is equivalent to "a = a - 1".
- */
-
-int a;
-int b;
-boolean direction;
-
-void setup()
-{
- size(200, 200);
- colorMode(RGB, width);
- a = 0;
- b = width;
- direction = true;
- frameRate(30);
-}
-
-void draw()
-{
- a++;
- if(a > width) {
- a = 0;
- direction = !direction;
- }
- if(direction == true){
- stroke(a);
- } else {
- stroke(width-a);
- }
- line(a, 0, a, height/2);
-
- b--;
- if(b < 0) {
- b = width;
- }
- if(direction == true) {
- stroke(width-b);
- } else {
- stroke(b);
- }
- line(b, height/2+1, b, height);
-}
diff --git a/android/examples/Basics/Math/Modulo/Modulo.pde b/android/examples/Basics/Math/Modulo/Modulo.pde
deleted file mode 100644
index 7ad1f5dc31..0000000000
--- a/android/examples/Basics/Math/Modulo/Modulo.pde
+++ /dev/null
@@ -1,31 +0,0 @@
-/**
- * Modulo.
- *
- * The modulo operator (%) returns the remainder of a number
- * divided by another. As in this example, it is often used
- * to keep numerical values within a set range.
- */
-
-int num = 20;
-float c;
-
-void setup()
-{
- size(200,200);
- fill(255);
- frameRate(30);
-}
-
-void draw()
-{
- background(0);
- c+=0.1;
- for(int i=1; i <= >=
-// Equality: == !=
-// Logical AND: &&
-// Logical OR: ||
-// Assignment: = += -= *= /= %=
-
-size(200, 200);
-background(51);
-noFill();
-stroke(51);
-
-stroke(204);
-for(int i=0; i< width-20; i+= 4) {
- // The 30 is added to 70 and then evaluated
- // if it is greater than the current value of "i"
- // For clarity, write as "if(i > (30 + 70)) {"
- if(i > 30 + 70) {
- line(i, 0, i, 50);
- }
-}
-
-stroke(255);
-// The 2 is multiplied by the 8 and the result is added to the 5
-// For clarity, write as "rect(5 + (2 * 8), 0, 90, 20);"
-rect(4 + 2 * 8, 52, 90, 48);
-rect((4 + 2) * 8, 100, 90, 49);
-
-stroke(153);
-for(int i=0; i< width; i+= 2) {
- // The relational statements are evaluated
- // first, and then the logical AND statements and
- // finally the logical OR. For clarity, write as:
- // "if(((i > 10) && (i < 50)) || ((i > 80) && (i < 160))) {"
- if(i > 20 && i < 50 || i > 100 && i < width-20) {
- line(i, 151, i, height-1);
- }
-}
-
-
diff --git a/android/examples/Basics/Math/PolarToCartesian/PolarToCartesian.pde b/android/examples/Basics/Math/PolarToCartesian/PolarToCartesian.pde
deleted file mode 100644
index f1f2b1e7d9..0000000000
--- a/android/examples/Basics/Math/PolarToCartesian/PolarToCartesian.pde
+++ /dev/null
@@ -1,52 +0,0 @@
-/**
- * PolarToCartesian
- * by Daniel Shiffman.
- *
- * Convert a polar coordinate (r,theta) to cartesian (x,y):
- * x = r * cos(theta)
- * y = r * sin(theta)
- */
-
-float r;
-
-// Angle and angular velocity, accleration
-float theta;
-float theta_vel;
-float theta_acc;
-
-void setup() {
- size(200, 200);
- frameRate(30);
- smooth();
-
- // Initialize all values
- r = 50;
- theta = 0;
- theta_vel = 0;
- theta_acc = 0.0001;
-}
-
-void draw() {
- background(0);
- // Translate the origin point to the center of the screen
- translate(width/2, height/2);
-
- // Convert polar to cartesian
- float x = r * cos(theta);
- float y = r * sin(theta);
-
- // Draw the ellipse at the cartesian coordinate
- ellipseMode(CENTER);
- noStroke();
- fill(200);
- ellipse(x, y, 16, 16);
-
- // Apply acceleration and velocity to angle (r remains static in this example)
- theta_vel += theta_acc;
- theta += theta_vel;
-
-}
-
-
-
-
diff --git a/android/examples/Basics/Math/Random/Random.pde b/android/examples/Basics/Math/Random/Random.pde
deleted file mode 100644
index 5fa97b8f07..0000000000
--- a/android/examples/Basics/Math/Random/Random.pde
+++ /dev/null
@@ -1,19 +0,0 @@
-/**
- * Random.
- *
- * Random numbers create the basis of this image.
- * Each time the program is loaded the result is different.
- */
-
-size(200, 200);
-smooth();
-background(0);
-strokeWeight(10);
-
-for(int i = 0; i < width; i++) {
- float r = random(255);
- float x = random(0, width);
- stroke(r, 100);
- line(i, 0, x, height);
-}
-
diff --git a/android/examples/Basics/Math/Sine/Sine.pde b/android/examples/Basics/Math/Sine/Sine.pde
deleted file mode 100644
index 848add369d..0000000000
--- a/android/examples/Basics/Math/Sine/Sine.pde
+++ /dev/null
@@ -1,46 +0,0 @@
-/**
- * Sine.
- *
- * Smoothly scaling size with the sin() function.
- */
-
-float spin = 0.0;
-float diameter = 84.0;
-float angle;
-
-float angle_rot;
-int rad_points = 90;
-
-void setup()
-{
- size(200, 200);
- noStroke();
- smooth();
-}
-
-void draw()
-{
- background(153);
-
- translate(130, 65);
-
- fill(255);
- ellipse(0, 0, 16, 16);
-
- angle_rot = 0;
- fill(51);
-
- for(int i=0; i<5; i++) {
- pushMatrix();
- rotate(angle_rot + -45);
- ellipse(-116, 0, diameter, diameter);
- popMatrix();
- angle_rot += PI*2/5;
- }
-
- diameter = 34 * sin(angle) + 168;
-
- angle += 0.02;
- if (angle > TWO_PI) { angle = 0; }
-}
-
diff --git a/android/examples/Basics/Math/SineCosine/SineCosine.pde b/android/examples/Basics/Math/SineCosine/SineCosine.pde
deleted file mode 100644
index 4a40ddee2a..0000000000
--- a/android/examples/Basics/Math/SineCosine/SineCosine.pde
+++ /dev/null
@@ -1,59 +0,0 @@
-/**
- * Sine Cosine.
- *
- * Linear movement with sin() and cos().
- * Numbers between 0 and PI*2 (TWO_PI which is roughly 6.28)
- * are put into these functions and numbers between -1 and 1 are
- * returned. These values are then scaled to produce larger movements.
- */
-
-int i = 45;
-int j = 225;
-float pos1 = 0;
-float pos2 = 0;
-float pos3 = 0;
-float pos4 = 0;
-int sc = 40;
-
-void setup()
-{
- size(200, 200);
- noStroke();
- smooth();
-}
-
-void draw()
-{
- background(0);
-
- fill(51);
- rect(60, 60, 80, 80);
-
- fill(255);
- ellipse(pos1, 36, 32, 32);
-
- fill(153);
- ellipse(36, pos2, 32, 32);
-
- fill(255);
- ellipse(pos3, 164, 32, 32);
-
- fill(153);
- ellipse(164, pos4, 32, 32);
-
- i += 3;
- j -= 3;
-
- if(i > 405) {
- i = 45;
- j = 225;
- }
-
- float ang1 = radians(i); // convert degrees to radians
- float ang2 = radians(j); // convert degrees to radians
- pos1 = width/2 + (sc * cos(ang1));
- pos2 = width/2 + (sc * sin(ang1));
- pos3 = width/2 + (sc * cos(ang2));
- pos4 = width/2 + (sc * sin(ang2));
-}
-
diff --git a/android/examples/Basics/Math/SineWave/SineWave.pde b/android/examples/Basics/Math/SineWave/SineWave.pde
deleted file mode 100644
index da47bed36c..0000000000
--- a/android/examples/Basics/Math/SineWave/SineWave.pde
+++ /dev/null
@@ -1,55 +0,0 @@
-/**
- * Sine Wave
- * by Daniel Shiffman.
- *
- * Render a simple sine wave.
- */
-
-int xspacing = 8; // How far apart should each horizontal location be spaced
-int w; // Width of entire wave
-
-float theta = 0.0; // Start angle at 0
-float amplitude = 75.0; // Height of wave
-float period = 500.0; // How many pixels before the wave repeats
-float dx; // Value for incrementing X, a function of period and xspacing
-float[] yvalues; // Using an array to store height values for the wave
-
-void setup() {
- size(200,200);
- frameRate(30);
- colorMode(RGB,255,255,255,100);
- smooth();
- w = width+16;
- dx = (TWO_PI / period) * xspacing;
- yvalues = new float[w/xspacing];
-}
-
-void draw() {
- background(0);
- calcWave();
- renderWave();
-
-}
-
-void calcWave() {
- // Increment theta (try different values for 'angular velocity' here
- theta += 0.02;
-
- // For every x value, calculate a y value with sine function
- float x = theta;
- for (int i = 0; i < yvalues.length; i++) {
- yvalues[i] = sin(x)*amplitude;
- x+=dx;
- }
-}
-
-void renderWave() {
- // A simple way to draw the wave with an ellipse at each location
- for (int x = 0; x < yvalues.length; x++) {
- noStroke();
- fill(255,50);
- ellipseMode(CENTER);
- ellipse(x*xspacing,width/2+yvalues[x],16,16);
- }
-}
-
diff --git a/android/examples/Basics/Objects/CompositeObjects/CompositeObjects.pde b/android/examples/Basics/Objects/CompositeObjects/CompositeObjects.pde
deleted file mode 100644
index 8987bda9e0..0000000000
--- a/android/examples/Basics/Objects/CompositeObjects/CompositeObjects.pde
+++ /dev/null
@@ -1,24 +0,0 @@
-/**
- * Composite Objects
- *
- * An object can include several other objects. Creating such composite objects
- * is a good way to use the principles of modularity and build higher levels of
- * abstraction within a program.
- */
-
-EggRing er1, er2;
-
-
-void setup() {
- size(200, 200);
- smooth();
- er1 = new EggRing(66, 132, 0.1, 66);
- er2 = new EggRing(132, 180, 0.05, 132);
-}
-
-
-void draw() {
- background(0);
- er1.transmit();
- er2.transmit();
-}
diff --git a/android/examples/Basics/Objects/CompositeObjects/Egg.pde b/android/examples/Basics/Objects/CompositeObjects/Egg.pde
deleted file mode 100644
index e6638aa79b..0000000000
--- a/android/examples/Basics/Objects/CompositeObjects/Egg.pde
+++ /dev/null
@@ -1,36 +0,0 @@
-class Egg {
- float x, y; // X-coordinate, y-coordinate
- float tilt; // Left and right angle offset
- float angle; // Used to define the tilt
- float scalar; // Height of the egg
-
- // Constructor
- Egg(int xpos, int ypos, float t, float s) {
- x = xpos;
- y = ypos;
- tilt = t;
- scalar = s / 100.0;
- }
-
- void wobble() {
- tilt = cos(angle) / 8;
- angle += 0.1;
- }
-
- void display() {
- noStroke();
- fill(255);
- pushMatrix();
- translate(x, y);
- rotate(tilt);
- scale(scalar);
- beginShape();
- vertex(0, -100);
- bezierVertex(25, -100, 40, -65, 40, -40);
- bezierVertex(40, -15, 25, 0, 0, 0);
- bezierVertex(-25, 0, -40, -15, -40, -40);
- bezierVertex(-40, -65, -25, -100, 0, -100);
- endShape();
- popMatrix();
- }
-}
\ No newline at end of file
diff --git a/android/examples/Basics/Objects/CompositeObjects/EggRing.pde b/android/examples/Basics/Objects/CompositeObjects/EggRing.pde
deleted file mode 100644
index 2648603f93..0000000000
--- a/android/examples/Basics/Objects/CompositeObjects/EggRing.pde
+++ /dev/null
@@ -1,19 +0,0 @@
-class EggRing {
- Egg ovoid;
- Ring circle = new Ring();
-
- EggRing(int x, int y, float t, float sp) {
- ovoid = new Egg(x, y, t, sp);
- circle.start(x, y - sp/2);
- }
-
- void transmit() {
- ovoid.wobble();
- ovoid.display();
- circle.grow();
- circle.display();
- if (circle.on == false) {
- circle.on = true;
- }
- }
-}
diff --git a/android/examples/Basics/Objects/CompositeObjects/Ring.pde b/android/examples/Basics/Objects/CompositeObjects/Ring.pde
deleted file mode 100644
index 3baf5623d5..0000000000
--- a/android/examples/Basics/Objects/CompositeObjects/Ring.pde
+++ /dev/null
@@ -1,27 +0,0 @@
-class Ring {
- float x, y; // X-coordinate, y-coordinate
- float diameter; // Diameter of the ring
- boolean on = false; // Turns the display on and off
- void start(float xpos, float ypos) {
- x = xpos;
- y = ypos;
- on = true;
- diameter = 1;
- }
- void grow() {
- if (on == true) {
- diameter += 0.5;
- if (diameter > width*2) {
- diameter = 0.0;
- }
- }
- }
- void display() {
- if (on == true) {
- noFill();
- strokeWeight(4);
- stroke(155, 153);
- ellipse(x, y, diameter, diameter);
- }
- }
-}
diff --git a/android/examples/Basics/Objects/Inheritance/Inheritance.pde b/android/examples/Basics/Objects/Inheritance/Inheritance.pde
deleted file mode 100644
index 6c4af0bc84..0000000000
--- a/android/examples/Basics/Objects/Inheritance/Inheritance.pde
+++ /dev/null
@@ -1,78 +0,0 @@
-/**
- * Inheritance
- *
- * A class can be defined using another class as a foundation. In object-oriented
- * programming terminology, one class can inherit fi elds and methods from another.
- * An object that inherits from another is called a subclass, and the object it
- * inherits from is called a superclass. A subclass extends the superclass.
- */
-
-SpinSpots spots;
-SpinArm arm;
-
-void setup()
-{
- size(200, 200);
- smooth();
- arm = new SpinArm(width/2, height/2, 0.01);
- spots = new SpinSpots(width/2, height/2, -0.02, 33.0);
-}
-
-void draw()
-{
- background(204);
- arm.update();
- arm.display();
- spots.update();
- spots.display();
-}
-
-class Spin
-{
- float x, y, speed;
- float angle = 0.0;
- Spin(float xpos, float ypos, float s) {
- x = xpos;
- y = ypos;
- speed = s;
- }
- void update() {
- angle += speed;
- }
-}
-
-class SpinArm extends Spin
-{
- SpinArm(float x, float y, float s) {
- super(x, y, s);
- }
- void display() {
- strokeWeight(1);
- stroke(0);
- pushMatrix();
- translate(x, y);
- angle += speed;
- rotate(angle);
- line(0, 0, 66, 0);
- popMatrix();
- }
-}
-
-class SpinSpots extends Spin
-{
- float dim;
- SpinSpots(float x, float y, float s, float d) {
- super(x, y, s);
- dim = d;
- }
- void display() {
- noStroke();
- pushMatrix();
- translate(x, y);
- angle += speed;
- rotate(angle);
- ellipse(-dim/2, 0, dim, dim);
- ellipse(dim/2, 0, dim, dim);
- popMatrix();
- }
-}
diff --git a/android/examples/Basics/Objects/MultipleConstructors/MultipleConstructors.pde b/android/examples/Basics/Objects/MultipleConstructors/MultipleConstructors.pde
deleted file mode 100644
index fd57edbfde..0000000000
--- a/android/examples/Basics/Objects/MultipleConstructors/MultipleConstructors.pde
+++ /dev/null
@@ -1,47 +0,0 @@
-/**
- * Multiple constructors
- *
- * A class can have multiple constructors that assign the fields in different ways.
- * Sometimes it's beneficial to specify every aspect of an object's data by assigning
- * parameters to the fields, but other times it might be appropriate to define only
- * one or a few.
- */
-
-Spot sp1, sp2;
-void setup()
-{
- size(200, 200);
- background(204);
- smooth();
- noLoop();
- // Run the constructor without parameters
- sp1 = new Spot();
- // Run the constructor with three parameters
- sp2 = new Spot(122, 100, 40);
-}
-
-void draw() {
- sp1.display();
- sp2.display();
-}
-
-class Spot {
- float x, y, radius;
- // First version of the Spot constructor;
- // the fields are assigned default values
- Spot() {
- x = 66;
- y = 100;
- radius = 16;
- }
- // Second version of the Spot constructor;
- // the fields are assigned with parameters
- Spot(float xpos, float ypos, float r) {
- x = xpos;
- y = ypos;
- radius = r;
- }
- void display() {
- ellipse(x, y, radius*2, radius*2);
- }
-}
diff --git a/android/examples/Basics/Objects/Neighborhood/Neighborhood.pde b/android/examples/Basics/Objects/Neighborhood/Neighborhood.pde
deleted file mode 100644
index f70893d25f..0000000000
--- a/android/examples/Basics/Objects/Neighborhood/Neighborhood.pde
+++ /dev/null
@@ -1,303 +0,0 @@
-/**
- * Neighborhood (OOP Example)
- * By Ira Greenberg
- *
- * Draw a neighborhood of houses using
- * Door, Window, Roof and House classes.
- * Good example of class composition, with component
- * Door, Window, Roof class references encapsulated
- * within House class. This arrangement allows
- * House class to handle placement and sizing of
- * its components, while still allowing user
- * customization of the individual components.
- */
-
-void setup(){
- size(200, 200);
- background(190);
- smooth();
- // Ground plane
- int groundHeight = 10;
- fill(0);
- rect(0, height-groundHeight, width, groundHeight);
- fill(255);
-
- // Center the houses
- translate(12, 0);
-
- // Houses
- Door door1 = new Door(20, 40);
- Window window1 = new Window(50, 62, false, Window.DOUBLE);
- Roof roof1 = new Roof(Roof.DOME);
- House house1 = new House(75, 75, door1, window1, roof1, House.MIDDLE_DOOR);
- house1.drawHouse(0, height-groundHeight-house1.h, true);
-
- Door door2 = new Door(20, 40);
- Window window2 = new Window(50, 62, true, Window.QUAD);
- Roof roof2 = new Roof(Roof.GAMBREL);
- House house2 = new House(100, 60, door2, window2, roof2, House.LEFT_DOOR);
- house2.drawHouse(house1.x + house1.w, height-groundHeight-house2.h, true);
-}
-
-class Door{
- //door properties
- int x;
- int y;
- int w;
- int h;
-
- // for knob
- int knobLoc = 1;
- //constants
- final static int RT = 0;
- final static int LFT = 1;
-
- // constructor
- Door(int w, int h){
- this.w = w;
- this.h = h;
- }
-
- // draw the door
- void drawDoor(int x, int y) {
- rect(x, y, w, h);
- int knobsize = w/10;
- if (knobLoc == 0){
- //right side
- ellipse(x+w-knobsize, y+h/2, knobsize, knobsize);
- }
- else {
- //left side
- ellipse(x+knobsize, y+h/2, knobsize, knobsize);
- }
- }
-
- // set knob position
- void setKnob(int knobLoc){
- this. knobLoc = knobLoc;
- }
-}
-
-class Window{
- //window properties
- int x;
- int y;
- int w;
- int h;
-
- // customized features
- boolean hasSash = false;
-
- // single, double, quad pane
- int style = 0;
- //constants
- final static int SINGLE = 0;
- final static int DOUBLE = 1;
- final static int QUAD = 2;
-
- // constructor 1
- Window(int w, int h){
- this.w = w;
- this.h = h;
- }
- // constructor 2
- Window(int w, int h, int style){
- this.w = w;
- this.h = h;
- this.style = style;
- }
- // constructor 3
- Window(int w, int h, boolean hasSash, int style){
- this.w = w;
- this.h = h;
- this.hasSash = hasSash;
- this.style = style;
- }
-
- // draw the window
- void drawWindow(int x, int y) {
- //local variables
- int margin = 0;
- int winHt = 0;
- int winWdth = 0;
-
- if (hasSash){
- margin = w/15;
- }
-
- switch(style){
- case 0:
- //outer window (sash)
- rect(x, y, w, h);
- //inner window
- rect(x+margin, y+margin, w-margin*2, h-margin*2);
- break;
- case 1:
- winHt = (h-margin*3)/2;
- //outer window (sash)
- rect(x, y, w, h);
- //inner window (top)
- rect(x+margin, y+margin, w-margin*2, winHt);
- //inner windows (bottom)
- rect(x+margin, y+winHt+margin*2, w-margin*2, winHt);
- break;
- case 2:
- winWdth = (w-margin*3)/2;
- winHt = (h-margin*3)/2;
- //outer window (sash)
- rect(x, y, w, h);
- //inner window (top-left)
- rect(x+margin, y+margin, winWdth, winHt);
- //inner window (top-right)
- rect(x+winWdth+margin*2, y+margin, winWdth, winHt);
- //inner windows (bottom-left)
- rect(x+margin, y+winHt+margin*2, winWdth, winHt);
- //inner windows (bottom-right)
- rect(x+winWdth+margin*2, y+winHt+margin*2, winWdth, winHt);
- break;
- }
- }
-
- // set window style (number of panes)
- void setStyle(int style){
- this.style = style;
- }
-}
-
-class Roof{
- //roof properties
- int x;
- int y;
- int w;
- int h;
-
- // roof style
- int style = 0;
- //constants
- final static int CATHEDRAL = 0;
- final static int GAMBREL = 1;
- final static int DOME = 2;
-
- // default constructor
- Roof(){
- }
-
- // constructor 2
- Roof(int style){
- this.style = style;
- }
-
- // draw the roof
- void drawRoof(int x, int y, int w, int h) {
- switch(style){
- case 0:
- beginShape();
- vertex(x, y);
- vertex(x+w/2, y-h/3);
- vertex(x+w, y);
- endShape(CLOSE);
- break;
- case 1:
- beginShape();
- vertex(x, y);
- vertex(x+w/7, y-h/4);
- vertex(x+w/2, y-h/2);
- vertex(x+(w-w/7), y-h/4);
- vertex(x+w, y);
- endShape(CLOSE);
- break;
- case 2:
- ellipseMode(CORNER);
- arc(x, y-h/2, w, h, PI, TWO_PI);
- line(x, y, x+w, y);
- break;
- }
-
- }
-
- // set roof style
- void setStyle(int style){
- this.style = style;
- }
-}
-
-class House{
- //house properties
- int x;
- int y;
- int w;
- int h;
-
- //component reference variables
- Door door;
- Window window;
- Roof roof;
-
- //optional autosize variable
- boolean AutoSizeComponents = false;
-
- //door placement
- int doorLoc = 0;
- //constants
- final static int MIDDLE_DOOR = 0;
- final static int LEFT_DOOR = 1;
- final static int RIGHT_DOOR = 2;
-
- //constructor
- House(int w, int h, Door door, Window window, Roof roof, int doorLoc) {
- this.w = w;
- this.h = h;
- this.door = door;
- this.window = window;
- this.roof = roof;
- this.doorLoc = doorLoc;
- }
-
- void drawHouse(int x, int y, boolean AutoSizeComponents) {
- this.x = x;
- this.y =y;
- this.AutoSizeComponents = AutoSizeComponents;
-
- //automatically sizes doors and windows
- if(AutoSizeComponents){
- //autosize door
- door.h = h/4;
- door.w = door.h/2;
-
- //autosize windows
- window.h = h/3;
- window.w = window.h/2;
-
- }
- // draw bldg block
- rect(x, y, w, h);
-
- // draw door
- switch(doorLoc){
- case 0:
- door.drawDoor(x+w/2-door.w/2, y+h-door.h);
- break;
- case 1:
- door.drawDoor(x+w/8, y+h-door.h);
- break;
- case 2:
- door.drawDoor(x+w-w/8-door.w, y+h-door.h);
- break;
- }
-
- // draw windows
- int windowMargin = (w-window.w*2)/3;
- window.drawWindow(x+windowMargin, y+h/6);
- window.drawWindow(x+windowMargin*2+window.w, y+h/6);
-
- // draw roof
- roof.drawRoof(x, y, w, h);
- }
-
- // catch drawHouse method without boolean argument
- void drawHouse(int x, int y){
- // recall with required 3rd argument
- drawHouse(x, y, false);
- }
-}
-
diff --git a/android/examples/Basics/Objects/Objects/Objects.pde b/android/examples/Basics/Objects/Objects/Objects.pde
deleted file mode 100644
index 80a09a3d6c..0000000000
--- a/android/examples/Basics/Objects/Objects/Objects.pde
+++ /dev/null
@@ -1,71 +0,0 @@
-/**
- * Objects
- * by hbarragan.
- *
- * Move the cursor across the image to change the speed and positions
- * of the geometry. The class MRect defines a group of lines.
- */
-
-MRect r1, r2, r3, r4;
-
-void setup()
-{
- size(200, 200);
- fill(255, 204);
- noStroke();
- r1 = new MRect(1, 134.0, 0.532, 0.083*height, 10.0, 60.0);
- r2 = new MRect(2, 44.0, 0.166, 0.332*height, 5.0, 50.0);
- r3 = new MRect(2, 58.0, 0.332, 0.4482*height, 10.0, 35.0);
- r4 = new MRect(1, 120.0, 0.0498, 0.913*height, 15.0, 60.0);
-}
-
-void draw()
-{
- background(0);
-
- r1.display();
- r2.display();
- r3.display();
- r4.display();
-
- r1.move(mouseX-(width/2), mouseY+(height*0.1), 30);
- r2.move((mouseX+(width*0.05))%width, mouseY+(height*0.025), 20);
- r3.move(mouseX/4, mouseY-(height*0.025), 40);
- r4.move(mouseX-(width/2), (height-mouseY), 50);
-}
-
-class MRect
-{
- int w; // single bar width
- float xpos; // rect xposition
- float h; // rect height
- float ypos ; // rect yposition
- float d; // single bar distance
- float t; // number of bars
-
- MRect(int iw, float ixp, float ih, float iyp, float id, float it) {
- w = iw;
- xpos = ixp;
- h = ih;
- ypos = iyp;
- d = id;
- t = it;
- }
-
- void move (float posX, float posY, float damping) {
- float dif = ypos - posY;
- if (abs(dif) > 1) {
- ypos -= dif/damping;
- }
- dif = xpos - posX;
- if (abs(dif) > 1) {
- xpos -= dif/damping;
- }
- }
-
- void display() {
- for (int i=0; i
-
-
-
-
-]>
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/android/examples/Basics/Shape/GetChild/GetChild.pde b/android/examples/Basics/Shape/GetChild/GetChild.pde
deleted file mode 100644
index 0b9b9d393f..0000000000
--- a/android/examples/Basics/Shape/GetChild/GetChild.pde
+++ /dev/null
@@ -1,45 +0,0 @@
-/**
- * Get Child.
- *
- * SVG files can be made of many individual shapes.
- * Each of these shapes (called a "child") has its own name
- * that can be used to extract it from the "parent" file.
- * This example loads a map of the United States and creates
- * two new PShape objects by extracting the data from two states.
- */
-
-PShape usa;
-PShape michigan;
-PShape ohio;
-
-void setup() {
- size(640, 360);
- usa = loadShape("usa-wikipedia.svg");
- michigan = usa.getChild("MI");
- ohio = usa.getChild("OH");
- smooth(); // Improves the drawing quality of the SVG
- noLoop();
-}
-
-void draw() {
- background(255);
-
- // Draw the full map
- shape(usa, -600, -180);
-
- // Disable the colors found in the SVG file
- michigan.disableStyle();
- // Set our own coloring
- fill(0, 51, 102);
- noStroke();
- // Draw a single state
- shape(michigan, -600, -180); // Go Blue!
-
- // Disable the colors found in the SVG file
- ohio.disableStyle();
- // Set our own coloring
- fill(153, 0, 0);
- noStroke();
- // Draw a single state
- shape(ohio, -600, -180); // Boo Buckeyes!
-}
diff --git a/android/examples/Basics/Shape/GetChild/data/usa-wikipedia.svg b/android/examples/Basics/Shape/GetChild/data/usa-wikipedia.svg
deleted file mode 100644
index 247ba73838..0000000000
--- a/android/examples/Basics/Shape/GetChild/data/usa-wikipedia.svg
+++ /dev/null
@@ -1,452 +0,0 @@
-
-
-
-
-]>
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/android/examples/Basics/Shape/LoadDisplayOBJ/LoadDisplayOBJ.pde b/android/examples/Basics/Shape/LoadDisplayOBJ/LoadDisplayOBJ.pde
deleted file mode 100644
index 154eeb4f06..0000000000
--- a/android/examples/Basics/Shape/LoadDisplayOBJ/LoadDisplayOBJ.pde
+++ /dev/null
@@ -1,31 +0,0 @@
-/**
- * Load and Display an OBJ Shape.
- *
- * The loadShape() command is used to read simple SVG (Scalable Vector Graphics)
- * files and OBJ (Object) files into a Processing sketch. This example loads an
- * OBJ file of a rocket and displays it to the screen.
- */
-
-
-PShape rocket;
-
-float ry;
-
-public void setup() {
- size(640, 360, P3D);
- orientation(LANDSCAPE);
-
- rocket = loadShape("rocket.obj");
-}
-
-public void draw() {
- background(0);
- lights();
-
- translate(width/2, height/2 + 100, -200);
- rotateZ(PI);
- rotateY(ry);
- shape(rocket);
-
- ry += 0.02;
-}
diff --git a/android/examples/Basics/Shape/LoadDisplayOBJ/data/rocket.mtl b/android/examples/Basics/Shape/LoadDisplayOBJ/data/rocket.mtl
deleted file mode 100644
index fbce8d0263..0000000000
--- a/android/examples/Basics/Shape/LoadDisplayOBJ/data/rocket.mtl
+++ /dev/null
@@ -1,8 +0,0 @@
-newmtl Default
-illum 2
-Ka 0.698039 0.698039 0.698039
-Kd 0.698039 0.698039 0.698039
-Ks 0.710000 0.710000 0.710000
-Ns 76.109253
-map_Kd rocket.png
-
diff --git a/android/examples/Basics/Shape/LoadDisplayOBJ/data/rocket.obj b/android/examples/Basics/Shape/LoadDisplayOBJ/data/rocket.obj
deleted file mode 100644
index 1a3b689157..0000000000
--- a/android/examples/Basics/Shape/LoadDisplayOBJ/data/rocket.obj
+++ /dev/null
@@ -1,1688 +0,0 @@
-mtllib rocket.mtl
-g Rocket
-v 0.088187 27.748848 0.016643
-v 25.227547 19.502979 -25.122717
-v 35.640614 19.502979 0.016642
-v 0.088185 19.502979 -35.535782
-v 0.088187 27.748848 0.016643
-v -25.051176 19.502979 -25.122717
-v -35.464237 19.502979 0.016645
-v -25.051170 19.502979 25.156006
-v 0.088191 19.502979 35.569065
-v 0.088187 27.748848 0.016643
-v 25.227552 19.502979 25.156000
-v 0.088187 27.748848 0.016643
-v 35.640614 19.502979 0.016642
-v 35.199703 86.845764 -35.094872
-v 49.743370 86.845764 0.016642
-v 25.227547 19.502979 -25.122717
-v 0.088184 86.845764 -49.638538
-v 0.088185 19.502979 -35.535782
-v -35.023331 86.845764 -35.094872
-v 0.088185 19.502979 -35.535782
-v -25.051176 19.502979 -25.122717
-v -49.566994 86.845764 0.016646
-v -35.023331 86.845764 -35.094872
-v -35.464237 19.502979 0.016645
-v -35.023323 86.845764 35.128162
-v -49.566994 86.845764 0.016646
-v -25.051170 19.502979 25.156006
-v 0.088193 86.845764 49.671825
-v -35.023323 86.845764 35.128162
-v -25.051170 19.502979 25.156006
-v 0.088191 19.502979 35.569065
-v 0.088191 19.502979 35.569065
-v 35.199711 86.845764 35.128155
-v 0.088193 86.845764 49.671825
-v 25.227552 19.502979 25.156000
-v 25.227552 19.502979 25.156000
-v 35.640614 19.502979 0.016642
-v 35.199703 173.055786 -35.094872
-v 49.743370 173.055786 0.016643
-v 35.199703 86.845764 -35.094872
-v 0.088184 173.055786 -49.638535
-v 35.199703 86.845764 -35.094872
-v -35.023331 173.055786 -35.094872
-v -35.023331 86.845764 -35.094872
-v -49.566994 173.055786 0.016647
-v -35.023331 173.055786 -35.094872
-v -49.566994 86.845764 0.016646
-v -35.023323 173.055786 35.128166
-v -49.566994 86.845764 0.016646
-v 0.088193 173.055786 49.671829
-v 0.088193 86.845764 49.671825
-v 35.199711 173.055786 35.128159
-v 0.088193 173.055786 49.671829
-v 35.199711 86.845764 35.128155
-v 35.199711 173.055786 35.128159
-v 49.743370 173.055786 0.016643
-v 27.145910 222.581848 -27.041082
-v 38.353592 222.581848 0.016642
-v 49.743370 173.055786 0.016643
-v 35.199703 173.055786 -35.094872
-v 0.088185 222.581848 -38.248760
-v 35.199703 173.055786 -35.094872
-v 0.088184 173.055786 -49.638535
-v 0.088184 173.055786 -49.638535
-v -26.969542 222.581848 -27.041082
-v -35.023331 173.055786 -35.094872
-v -38.177216 222.581848 0.016646
-v -26.969542 222.581848 -27.041082
-v -49.566994 173.055786 0.016647
-v -26.969536 222.581848 27.074369
-v -38.177216 222.581848 0.016646
-v -35.023323 173.055786 35.128166
-v 0.088192 222.581848 38.282043
-v -26.969536 222.581848 27.074369
-v -35.023323 173.055786 35.128166
-v 0.088193 173.055786 49.671829
-v 27.145916 222.581848 27.074364
-v 0.088192 222.581848 38.282043
-v 0.088193 173.055786 49.671829
-v 35.199711 173.055786 35.128159
-v 35.199711 173.055786 35.128159
-v 0.088187 317.654602 0.016646
-v 0.088185 222.581848 -38.248760
-v 0.088187 317.654602 0.016646
-v 0.088185 222.581848 -38.248760
-v 0.088187 317.654602 0.016646
-v -38.177216 222.581848 0.016646
-v 0.088187 317.654602 0.016646
-v -26.969536 222.581848 27.074369
-v 0.088187 317.654602 0.016646
-v 27.145916 222.581848 27.074364
-v 38.353592 222.581848 0.016642
-vt 0.365478 0.904922
-vt 0.427267 0.972178
-vt 0.452861 0.904922
-vt 0.365478 1.000036
-vt 0.365478 0.904922
-vt 0.303689 0.972178
-vt 0.278095 0.904922
-vt 0.303689 0.837667
-vt 0.365478 0.809809
-vt 0.365478 0.904922
-vt 0.427267 0.837667
-vt 0.365478 0.904922
-vt 0.183561 0.319288
-vt 0.274884 0.473113
-vt 0.183561 0.473113
-vt 0.274884 0.319288
-vt 0.366208 0.473113
-vt 0.366208 0.319288
-vt 0.457532 0.473113
-vt 0.366208 0.319288
-vt 0.457532 0.319288
-vt 0.548855 0.473113
-vt 0.457532 0.473113
-vt 0.548855 0.319288
-vt 0.640179 0.473113
-vt 0.548855 0.473113
-vt 0.640179 0.319288
-vt 0.731503 0.473113
-vt 0.640179 0.473113
-vt 0.640179 0.319288
-vt 0.731503 0.319288
-vt 0.000913 0.319288
-vt 0.092237 0.473113
-vt 0.000913 0.473113
-vt 0.092237 0.319288
-vt 0.092237 0.319288
-vt 0.183561 0.319288
-vt 0.274884 0.670034
-vt 0.183561 0.670034
-vt 0.274884 0.473113
-vt 0.366208 0.670034
-vt 0.274884 0.473113
-vt 0.457532 0.670034
-vt 0.457532 0.473113
-vt 0.548855 0.670034
-vt 0.457532 0.670034
-vt 0.548855 0.473113
-vt 0.640179 0.670034
-vt 0.548855 0.473113
-vt 0.731503 0.670034
-vt 0.731503 0.473113
-vt 0.092237 0.670034
-vt 0.000913 0.670034
-vt 0.092237 0.473113
-vt 0.092237 0.670034
-vt 0.183561 0.670034
-vt 0.274884 0.783161
-vt 0.183561 0.783161
-vt 0.183561 0.670034
-vt 0.274884 0.670034
-vt 0.366208 0.783161
-vt 0.274884 0.670034
-vt 0.366208 0.670034
-vt 0.366208 0.670034
-vt 0.457532 0.783161
-vt 0.457532 0.670034
-vt 0.548855 0.783161
-vt 0.457532 0.783161
-vt 0.548855 0.670034
-vt 0.640179 0.783161
-vt 0.548855 0.783161
-vt 0.640179 0.670034
-vt 0.731503 0.783161
-vt 0.640179 0.783161
-vt 0.640179 0.670034
-vt 0.731503 0.670034
-vt 0.092237 0.783161
-vt 0.000913 0.783161
-vt 0.000913 0.670034
-vt 0.092237 0.670034
-vt 0.092237 0.670034
-vt 0.000913 1.000327
-vt 0.366208 0.783161
-vt 0.731503 1.000327
-vt 0.366208 0.783161
-vt 0.731503 1.000327
-vt 0.548855 0.783161
-vt 0.731503 1.000327
-vt 0.640179 0.783161
-vt 0.000913 1.000327
-vt 0.092237 0.783161
-vt 0.183561 0.783161
-usemtl Default
-f 1/1 2/2 3/3
-f 1/1 4/4 2/2
-f 5/5 6/6 4/4
-f 5/5 7/7 6/6
-f 5/5 8/8 7/7
-f 5/5 9/9 8/8
-f 10/10 11/11 9/9
-f 12/12 3/3 11/11
-f 13/13 14/14 15/15
-f 13/13 16/16 14/14
-f 16/16 17/17 14/14
-f 16/16 18/18 17/17
-f 18/18 19/19 17/17
-f 20/20 21/21 19/19
-f 21/21 22/22 23/23
-f 21/21 24/24 22/22
-f 24/24 25/25 26/26
-f 24/24 27/27 25/25
-f 27/27 28/28 29/29
-f 30/30 31/31 28/28
-f 32/32 33/33 34/34
-f 32/32 35/35 33/33
-f 35/35 15/15 33/33
-f 36/36 37/37 15/15
-f 15/15 38/38 39/39
-f 15/15 14/14 38/38
-f 40/40 41/41 38/38
-f 42/42 17/17 41/41
-f 17/17 43/43 41/41
-f 17/17 44/44 43/43
-f 19/19 45/45 46/46
-f 19/19 22/22 45/45
-f 47/47 48/48 45/45
-f 49/49 25/25 48/48
-f 29/29 50/50 48/48
-f 29/29 51/51 50/50
-f 34/34 52/52 53/53
-f 34/34 54/54 52/52
-f 33/33 39/39 55/55
-f 33/33 15/15 39/39
-f 56/56 57/57 58/58
-f 59/59 38/38 57/57
-f 60/60 61/61 57/57
-f 62/62 63/63 61/61
-f 64/64 65/65 61/61
-f 64/64 46/46 65/65
-f 66/66 67/67 68/68
-f 43/43 45/45 67/67
-f 69/69 70/70 71/71
-f 69/69 48/48 70/70
-f 72/72 73/73 74/74
-f 75/75 76/76 73/73
-f 53/53 77/77 78/78
-f 79/79 80/80 77/77
-f 81/81 58/58 77/77
-f 55/55 59/59 58/58
-f 82/82 58/58 57/57
-f 82/82 57/57 83/83
-f 84/84 85/85 68/68
-f 84/84 65/65 71/71
-f 86/86 87/87 74/74
-f 88/88 89/89 73/73
-f 82/82 78/78 77/77
-f 90/90 91/91 92/92
-g wing01
-v -72.964706 -60.615013 2.752965
-v -80.651077 -69.945724 2.752970
-v -79.178032 -68.157547 0.201571
-v -72.964706 -60.615013 2.752965
-v -72.964706 -60.615021 -2.628587
-v -58.352703 -20.619514 -2.628605
-v -58.352703 -20.619514 -2.628605
-v -58.352703 -20.619511 2.752947
-v -72.964706 -60.615013 2.752965
-v -58.352703 -20.619511 2.752947
-v -58.352703 -20.619514 -2.628605
-v -46.947498 1.234928 -2.628614
-v -46.947498 1.234928 -2.628614
-v -46.947498 1.234928 2.752937
-v -58.352703 -20.619511 2.752947
-v -41.276043 7.132179 0.062164
-v -46.947498 1.234928 -2.628614
-v -40.422783 8.019409 -2.628617
-v -81.873581 11.210991 0.201533
-v -49.119144 52.636772 -1.776468
-v -48.766163 52.964798 -2.628637
-v -48.766163 52.964798 -2.628637
-v -82.419724 10.123146 -2.628616
-v -81.873581 11.210991 0.201533
-v -82.482941 10.347294 2.752934
-v -80.651093 4.123146 2.752937
-v -58.352703 -20.619511 2.752947
-v -58.352703 -20.619511 2.752947
-v -46.947498 1.234928 2.752937
-v -82.482941 10.347294 2.752934
-v -79.178032 -68.157547 0.201571
-v -80.812019 -70.141090 -2.628582
-v -72.964706 -60.615021 -2.628587
-v -72.964706 -60.615021 -2.628587
-v -72.964706 -60.615013 2.752965
-v -79.178032 -68.157547 0.201571
-v -80.651077 -69.945724 2.752970
-v -72.964706 -60.615013 2.752965
-v -58.352703 -20.619511 2.752947
-v -58.352703 -20.619511 2.752947
-v -80.651093 4.123146 2.752937
-v -80.651077 -69.945724 2.752970
-v -46.947498 1.234928 2.752937
-v -40.422787 8.019402 2.752935
-v -48.766171 36.348991 2.752924
-v -48.766171 36.348991 2.752924
-v -82.482941 10.347294 2.752934
-v -46.947498 1.234928 2.752937
-v -58.352703 -20.619514 -2.628605
-v -72.964706 -60.615021 -2.628587
-v -80.812019 -70.141090 -2.628582
-v -80.812019 -70.141090 -2.628582
-v -80.812027 4.123146 -2.628614
-v -58.352703 -20.619514 -2.628605
-v -82.419724 10.123146 -2.628616
-v -48.766163 52.964798 -2.628637
-v -48.766171 36.348991 -2.628628
-v -58.352703 -20.619514 -2.628605
-v -80.812027 4.123146 -2.628614
-v -82.419724 10.123146 -2.628616
-v -82.419724 10.123146 -2.628616
-v -46.947498 1.234928 -2.628614
-v -58.352703 -20.619514 -2.628605
-v -82.482941 10.347294 2.752934
-v -48.765190 53.047668 2.755279
-v -49.880726 51.661064 0.062147
-v -49.880726 51.661064 0.062147
-v -81.873581 11.210991 0.201533
-v -82.482941 10.347294 2.752934
-v -41.276043 7.132179 0.062164
-v -40.422787 8.019402 2.752935
-v -46.947498 1.234928 2.752937
-v -46.947498 1.234928 2.752937
-v -46.947498 1.234928 -2.628614
-v -41.276043 7.132179 0.062164
-v -48.766171 36.348991 2.752924
-v -48.765190 53.047668 2.755279
-v -82.482941 10.347294 2.752934
-v -40.422783 8.019409 -2.628617
-v -46.947498 1.234928 -2.628614
-v -82.419724 10.123146 -2.628616
-v -82.419724 10.123146 -2.628616
-v -48.766171 36.348991 -2.628628
-v -40.422783 8.019409 -2.628617
-v -49.880726 51.661064 0.062147
-v -49.119144 52.636772 -1.776468
-v -81.873581 11.210991 0.201533
-vt 0.653246 0.106736
-vt 0.645259 0.106736
-vt 0.646789 0.060132
-vt 0.653246 0.106736
-vt 0.653246 0.008436
-vt 0.687484 0.008435
-vt 0.687484 0.008435
-vt 0.687484 0.106736
-vt 0.653246 0.106736
-vt 0.687484 0.106736
-vt 0.687484 0.008435
-vt 0.706193 0.008435
-vt 0.706193 0.008435
-vt 0.706193 0.106735
-vt 0.687484 0.106736
-vt 0.711241 0.057585
-vt 0.706193 0.008435
-vt 0.712001 0.008435
-vt 0.487940 0.249578
-vt 0.452478 0.213447
-vt 0.452197 0.197881
-vt 0.452197 0.197881
-vt 0.488872 0.197882
-vt 0.487940 0.249578
-vt 0.992226 0.113639
-vt 0.982006 0.129463
-vt 0.857606 0.192369
-vt 0.857606 0.192369
-vt 0.793978 0.136806
-vt 0.992226 0.113639
-vt 0.646789 0.060132
-vt 0.645091 0.008436
-vt 0.653246 0.008436
-vt 0.653246 0.008436
-vt 0.653246 0.106736
-vt 0.646789 0.060132
-vt 0.982006 0.317777
-vt 0.939125 0.294054
-vt 0.857606 0.192369
-vt 0.857606 0.192369
-vt 0.982006 0.129463
-vt 0.982006 0.317777
-vt 0.793978 0.136806
-vt 0.757577 0.119557
-vt 0.804124 0.047532
-vt 0.804124 0.047532
-vt 0.992226 0.113639
-vt 0.793978 0.136806
-vt 0.481912 0.158658
-vt 0.390770 0.067710
-vt 0.369062 0.018867
-vt 0.369062 0.018867
-vt 0.538296 0.018867
-vt 0.481912 0.158658
-vt 0.551969 0.008861
-vt 0.649597 0.218327
-vt 0.611733 0.218327
-vt 0.481912 0.158658
-vt 0.538296 0.018867
-vt 0.551969 0.008861
-vt 0.551969 0.008861
-vt 0.531714 0.229646
-vt 0.481912 0.158658
-vt 0.488680 0.296182
-vt 0.452126 0.296225
-vt 0.453313 0.247032
-vt 0.453313 0.247032
-vt 0.487940 0.249578
-vt 0.488680 0.296182
-vt 0.711241 0.057585
-vt 0.712001 0.106735
-vt 0.706193 0.106735
-vt 0.706193 0.106735
-vt 0.706193 0.008435
-vt 0.711241 0.057585
-vt 0.804124 0.047532
-vt 0.804119 0.005077
-vt 0.992226 0.113639
-vt 0.547175 0.270257
-vt 0.531714 0.229646
-vt 0.551969 0.008861
-vt 0.551969 0.008861
-vt 0.611733 0.218327
-vt 0.547175 0.270257
-vt 0.453313 0.247032
-vt 0.452478 0.213447
-vt 0.487940 0.249578
-usemtl Default
-f 93/93 94/94 95/95
-f 96/96 97/97 98/98
-f 99/99 100/100 101/101
-f 102/102 103/103 104/104
-f 105/105 106/106 107/107
-f 108/108 109/109 110/110
-f 111/111 112/112 113/113
-f 114/114 115/115 116/116
-f 117/117 118/118 119/119
-f 120/120 121/121 122/122
-f 123/123 124/124 125/125
-f 126/126 127/127 128/128
-f 129/129 130/130 131/131
-f 132/132 133/133 134/134
-f 135/135 136/136 137/137
-f 138/138 139/139 140/140
-f 141/141 142/142 143/143
-f 144/144 145/145 146/146
-f 147/147 148/148 149/149
-f 150/150 151/151 152/152
-f 153/153 154/154 155/155
-f 156/156 157/157 158/158
-f 159/159 160/160 161/161
-f 162/162 163/163 164/164
-f 165/165 166/166 167/167
-f 168/168 169/169 170/170
-f 171/171 172/172 173/173
-f 174/174 175/175 176/176
-f 177/177 178/178 179/179
-g reactor01
-v -92.410393 -77.997627 0.213196
-v -86.097389 -76.306053 0.213195
-v -89.253891 -76.306053 5.680415
-v -92.410393 -77.997627 0.213196
-v -89.253891 -76.306053 5.680415
-v -95.566895 -76.306053 5.680414
-v -98.723396 -76.306053 0.213195
-v -92.410393 -77.997627 0.213196
-v -95.566895 -76.306068 -5.254023
-v -89.253891 -76.306068 -5.254023
-v -86.097389 -76.306053 0.213195
-v -81.475952 -71.684624 0.213195
-v -86.943176 -71.684624 9.682695
-v -86.943176 -71.684624 9.682695
-v -97.877609 -71.684624 9.682695
-v -95.566895 -76.306053 5.680414
-v -95.566895 -76.306053 5.680414
-v -103.344833 -71.684624 0.213194
-v -95.566895 -76.306053 5.680414
-v -98.723396 -76.306053 0.213195
-v -103.344833 -71.684624 0.213194
-v -97.877609 -71.684624 -9.256306
-v -86.943176 -71.684624 -9.256305
-v -95.566895 -76.306068 -5.254023
-v -86.943176 -71.684624 -9.256305
-v -89.253891 -76.306068 -5.254023
-v -81.475952 -71.684624 0.213195
-v -86.097389 -76.306053 0.213195
-v -81.475952 -71.684624 0.213195
-v -79.784393 -65.371635 0.213195
-v -86.097397 -65.371620 11.147633
-v -81.475952 -71.684624 0.213195
-v -86.943176 -71.684624 9.682695
-v -86.097397 -65.371620 11.147633
-v -98.723396 -65.371620 11.147632
-v -97.877609 -71.684624 9.682695
-v -105.036392 -65.371635 0.213194
-v -103.344833 -71.684624 0.213194
-v -105.036392 -65.371635 0.213194
-v -98.723389 -65.371635 -10.721243
-v -97.877609 -71.684624 -9.256306
-v -86.097389 -65.371635 -10.721241
-v -97.877609 -71.684624 -9.256306
-v -81.475952 -71.684624 0.213195
-v -79.784393 6.376373 0.213193
-v -86.097397 6.376373 11.147631
-v -79.784393 -65.371635 0.213195
-v -86.097397 6.376373 11.147631
-v -98.723396 6.376373 11.147630
-v -98.723396 -65.371620 11.147632
-v -105.036392 6.376373 0.213192
-v -105.036392 -65.371635 0.213194
-v -105.036392 -65.371635 0.213194
-v -98.723389 6.376373 -10.721245
-v -98.723389 -65.371635 -10.721243
-v -86.097389 6.376373 -10.721243
-v -86.097389 -65.371635 -10.721241
-v -86.097389 6.376373 -10.721243
-v -79.784393 -65.371635 0.213195
-v -81.475952 12.689369 0.213193
-v -86.943176 12.689369 9.682693
-v -86.943176 12.689369 9.682693
-v -97.877609 12.689369 9.682693
-v -86.097397 6.376373 11.147631
-v -98.723396 6.376373 11.147630
-v -103.344833 12.689369 0.213192
-v -105.036392 6.376373 0.213192
-v -103.344833 12.689369 0.213192
-v -97.877609 12.689369 -9.256309
-v -105.036392 6.376373 0.213192
-v -98.723389 6.376373 -10.721245
-v -86.943176 12.689369 -9.256308
-v -98.723389 6.376373 -10.721245
-v -86.097389 6.376373 -10.721243
-v -86.097389 6.376373 -10.721243
-v -86.943176 12.689369 -9.256308
-v -79.784393 6.376373 0.213193
-v -81.475952 12.689369 0.213193
-v -86.097389 17.310806 0.213192
-v -89.253891 17.310806 5.680411
-v -81.475952 12.689369 0.213193
-v -89.253891 17.310806 5.680411
-v -95.566895 17.310806 5.680411
-v -86.943176 12.689369 9.682693
-v -97.877609 12.689369 9.682693
-v -95.566895 17.310806 5.680411
-v -98.723396 17.310806 0.213192
-v -103.344833 12.689369 0.213192
-v -98.723396 17.310806 0.213192
-v -95.566895 17.310806 -5.254026
-v -97.877609 12.689369 -9.256309
-v -97.877609 12.689369 -9.256309
-v -95.566895 17.310806 -5.254026
-v -89.253891 17.310806 -5.254026
-v -86.097389 17.310806 0.213192
-v -81.475952 12.689369 0.213193
-v -92.410393 19.002373 0.213192
-v -89.253891 17.310806 5.680411
-v -95.566895 17.310806 5.680411
-v -98.723396 17.310806 0.213192
-v -92.410393 19.002373 0.213192
-v -92.410393 19.002373 0.213192
-vt 0.750000 0.750000
-vt 0.807692 0.754360
-vt 0.769231 0.754360
-vt 0.980769 0.750000
-vt 1.000000 0.754360
-vt 0.961538 0.754360
-vt 0.923077 0.754360
-vt 0.980769 0.750000
-vt 0.884615 0.754360
-vt 0.846154 0.754360
-vt 0.807692 0.754360
-vt 0.807692 0.766271
-vt 0.769231 0.766271
-vt 1.000000 0.766271
-vt 0.961538 0.766271
-vt 0.961538 0.754360
-vt 0.961538 0.754360
-vt 0.923077 0.766271
-vt 0.961538 0.754360
-vt 0.923077 0.754360
-vt 0.923077 0.766271
-vt 0.884615 0.766271
-vt 0.846154 0.766271
-vt 0.884615 0.754360
-vt 0.846154 0.766271
-vt 0.846154 0.754360
-vt 0.807692 0.766271
-vt 0.807692 0.754360
-vt 0.807692 0.766271
-vt 0.807692 0.782541
-vt 0.769231 0.782541
-vt 0.807692 0.766271
-vt 0.769231 0.766271
-vt 1.000000 0.782541
-vt 0.961538 0.782541
-vt 0.961538 0.766271
-vt 0.923077 0.782541
-vt 0.923077 0.766271
-vt 0.923077 0.782541
-vt 0.884615 0.782541
-vt 0.884615 0.766271
-vt 0.846154 0.782541
-vt 0.884615 0.766271
-vt 0.807692 0.766271
-vt 0.807692 0.967459
-vt 0.769231 0.967459
-vt 0.807692 0.782541
-vt 1.000000 0.967459
-vt 0.961538 0.967459
-vt 0.961538 0.782541
-vt 0.923077 0.967459
-vt 0.923077 0.782541
-vt 0.923077 0.782541
-vt 0.884615 0.967459
-vt 0.884615 0.782541
-vt 0.846154 0.967459
-vt 0.846154 0.782541
-vt 0.846154 0.967459
-vt 0.807692 0.782541
-vt 0.807692 0.983729
-vt 0.769231 0.983729
-vt 1.000000 0.983729
-vt 0.961538 0.983729
-vt 1.000000 0.967459
-vt 0.961538 0.967459
-vt 0.923077 0.983729
-vt 0.923077 0.967459
-vt 0.923077 0.983729
-vt 0.884615 0.983729
-vt 0.923077 0.967459
-vt 0.884615 0.967459
-vt 0.846154 0.983729
-vt 0.884615 0.967459
-vt 0.846154 0.967459
-vt 0.846154 0.967459
-vt 0.846154 0.983729
-vt 0.807692 0.967459
-vt 0.807692 0.983729
-vt 0.807692 0.995640
-vt 0.769231 0.995640
-vt 0.807692 0.983729
-vt 1.000000 0.995640
-vt 0.961538 0.995640
-vt 1.000000 0.983729
-vt 0.961538 0.983729
-vt 0.961538 0.995640
-vt 0.923077 0.995640
-vt 0.923077 0.983729
-vt 0.923077 0.995640
-vt 0.884615 0.995640
-vt 0.884615 0.983729
-vt 0.884615 0.983729
-vt 0.884615 0.995640
-vt 0.846154 0.995640
-vt 0.807692 0.995640
-vt 0.807692 0.983729
-vt 0.865385 1.000000
-vt 0.769231 0.995640
-vt 0.961538 0.995640
-vt 0.923077 0.995640
-vt 0.865385 1.000000
-vt 0.865385 1.000000
-usemtl Default
-f 180/180 181/181 182/182
-f 183/183 184/184 185/185
-f 183/183 185/185 186/186
-f 187/187 186/186 188/188
-f 180/180 188/188 189/189
-f 180/180 189/189 181/181
-f 190/190 191/191 192/192
-f 181/181 192/192 182/182
-f 184/184 193/193 194/194
-f 184/184 194/194 195/195
-f 196/196 194/194 197/197
-f 198/198 197/197 199/199
-f 186/186 200/200 201/201
-f 199/199 201/201 188/188
-f 188/188 201/201 202/202
-f 203/203 202/202 189/189
-f 189/189 204/204 191/191
-f 205/205 206/206 207/207
-f 208/208 209/209 210/210
-f 211/211 210/210 212/212
-f 193/193 213/213 214/214
-f 193/193 214/214 194/194
-f 215/215 214/214 216/216
-f 215/215 216/216 217/217
-f 200/200 218/218 219/219
-f 200/200 219/219 201/201
-f 220/220 219/219 221/221
-f 222/222 221/221 204/204
-f 202/202 221/221 209/209
-f 202/202 209/209 223/223
-f 209/209 224/224 225/225
-f 226/226 225/225 210/210
-f 213/213 227/227 228/228
-f 213/213 228/228 214/214
-f 229/229 228/228 230/230
-f 229/229 230/230 231/231
-f 232/232 230/230 233/233
-f 232/232 233/233 219/219
-f 234/234 233/233 235/235
-f 234/234 235/235 221/221
-f 236/236 237/237 224/224
-f 236/236 224/224 238/238
-f 224/224 239/239 240/240
-f 224/224 240/240 225/225
-f 227/227 241/241 242/242
-f 243/243 242/242 244/244
-f 244/244 242/242 245/245
-f 244/244 245/245 246/246
-f 246/246 247/247 248/248
-f 249/249 248/248 233/233
-f 250/250 248/248 251/251
-f 252/252 251/251 253/253
-f 254/254 255/255 239/239
-f 253/253 239/239 256/256
-f 257/257 258/258 259/259
-f 260/260 259/259 240/240
-f 241/241 261/261 262/262
-f 263/263 262/262 264/264
-f 242/242 265/265 266/266
-f 242/242 266/266 247/247
-f 267/267 268/268 269/269
-f 267/267 269/269 270/270
-f 271/271 272/272 273/273
-f 271/271 273/273 255/255
-f 251/251 273/273 258/258
-f 251/251 274/274 275/275
-f 258/258 276/276 277/277
-f 261/261 276/276 265/265
-f 278/278 276/276 279/279
-f 266/266 280/280 269/269
-f 269/269 276/276 273/273
-f 273/273 281/281 258/258
-g wing02
-v 39.599403 -60.615013 60.362041
-v 43.442596 -69.945724 67.018631
-v 40.496494 -68.157547 67.018639
-v 39.599403 -60.615013 60.362041
-v 34.938843 -60.615013 63.052818
-v 27.632818 -20.619514 50.398453
-v 27.632818 -20.619514 50.398453
-v 32.293377 -20.619514 47.707680
-v 39.599403 -60.615013 60.362041
-v 32.293377 -20.619514 47.707680
-v 27.632818 -20.619514 50.398453
-v 21.930204 1.234921 40.521259
-v 21.930204 1.234921 40.521259
-v 26.590763 1.234924 37.830482
-v 32.293377 -20.619514 47.707680
-v 21.424757 7.132172 34.264244
-v 21.930204 1.234921 40.521259
-v 18.667843 8.019402 34.870689
-v 41.844223 11.210991 69.353058
-v 23.754000 52.636765 41.975880
-v 22.839508 52.964790 42.096275
-v 22.839508 52.964790 42.096275
-v 39.666317 10.123146 71.241112
-v 41.844223 11.210991 69.353058
-v 44.358482 10.347294 68.605080
-v 43.442562 4.123146 67.018654
-v 32.293377 -20.619514 47.707680
-v 32.293377 -20.619514 47.707680
-v 26.590763 1.234924 37.830482
-v 44.358482 10.347294 68.605080
-v 40.496494 -68.157547 67.018639
-v 38.862507 -70.141083 69.848785
-v 34.938843 -60.615013 63.052818
-v 34.938843 -60.615013 63.052818
-v 39.599403 -60.615013 60.362041
-v 40.496494 -68.157547 67.018639
-v 43.442596 -69.945724 67.018631
-v 39.599403 -60.615013 60.362041
-v 32.293377 -20.619514 47.707680
-v 32.293377 -20.619514 47.707680
-v 43.442562 4.123146 67.018654
-v 43.442596 -69.945724 67.018631
-v 26.590763 1.234924 37.830482
-v 23.328405 8.019394 32.179916
-v 27.500082 36.348984 39.405502
-v 27.500082 36.348984 39.405502
-v 44.358482 10.347294 68.605080
-v 26.590763 1.234924 37.830482
-v 27.632818 -20.619514 50.398453
-v 34.938843 -60.615013 63.052818
-v 38.862507 -70.141083 69.848785
-v 38.862507 -70.141083 69.848785
-v 38.862469 4.123146 69.848801
-v 27.632818 -20.619514 50.398453
-v 39.666317 10.123146 71.241112
-v 22.839508 52.964790 42.096275
-v 22.839521 36.348984 42.096279
-v 27.632818 -20.619514 50.398453
-v 38.862469 4.123146 69.848801
-v 39.666317 10.123146 71.241112
-v 39.666317 10.123146 71.241112
-v 21.930204 1.234921 40.521259
-v 27.632818 -20.619514 50.398453
-v 44.358482 10.347294 68.605080
-v 27.501629 53.047661 39.403473
-v 25.727077 51.661057 41.716122
-v 25.727077 51.661057 41.716122
-v 41.844223 11.210991 69.353058
-v 44.358482 10.347294 68.605080
-v 21.424757 7.132172 34.264244
-v 23.328405 8.019394 32.179916
-v 26.590763 1.234924 37.830482
-v 26.590763 1.234924 37.830482
-v 21.930204 1.234921 40.521259
-v 21.424757 7.132172 34.264244
-v 27.500082 36.348984 39.405502
-v 27.501629 53.047661 39.403473
-v 44.358482 10.347294 68.605080
-v 18.667843 8.019402 34.870689
-v 21.930204 1.234921 40.521259
-v 39.666317 10.123146 71.241112
-v 39.666317 10.123146 71.241112
-v 22.839521 36.348984 42.096279
-v 18.667843 8.019402 34.870689
-v 25.727077 51.661057 41.716122
-v 23.754000 52.636765 41.975880
-v 41.844223 11.210991 69.353058
-vt 0.675235 0.145939
-vt 0.659189 0.137027
-vt 0.671489 0.138735
-vt 0.675235 0.145939
-vt 0.694693 0.145939
-vt 0.725197 0.184137
-vt 0.725197 0.184137
-vt 0.705738 0.184137
-vt 0.675235 0.145939
-vt 0.705738 0.184137
-vt 0.725197 0.184137
-vt 0.749006 0.205010
-vt 0.749006 0.205010
-vt 0.729548 0.205010
-vt 0.705738 0.184137
-vt 0.029621 0.222596
-vt 0.031731 0.241442
-vt 0.018110 0.224422
-vt 0.591267 0.027020
-vt 0.626730 0.111287
-vt 0.627011 0.115546
-vt 0.627011 0.115546
-vt 0.590336 0.037165
-vt 0.591267 0.027020
-vt 0.994963 0.356031
-vt 0.983367 0.371855
-vt 0.842205 0.434762
-vt 0.842205 0.434762
-vt 0.770004 0.379199
-vt 0.994963 0.356031
-vt 0.671489 0.138735
-vt 0.678311 0.136840
-vt 0.694693 0.145939
-vt 0.694693 0.145939
-vt 0.675235 0.145939
-vt 0.671489 0.138735
-vt 0.983367 0.560169
-vt 0.934708 0.536447
-vt 0.842205 0.434762
-vt 0.842205 0.434762
-vt 0.983367 0.371855
-vt 0.983367 0.560169
-vt 0.770004 0.379199
-vt 0.745067 0.361950
-vt 0.781517 0.289924
-vt 0.781517 0.289924
-vt 0.994963 0.356031
-vt 0.770004 0.379199
-vt 0.263651 0.176102
-vt 0.172508 0.072900
-vt 0.150800 0.017476
-vt 0.150800 0.017476
-vt 0.320035 0.017476
-vt 0.263651 0.176102
-vt 0.333708 0.006121
-vt 0.431336 0.243810
-vt 0.393471 0.243810
-vt 0.263651 0.176102
-vt 0.320035 0.017476
-vt 0.333708 0.006121
-vt 0.333708 0.006121
-vt 0.313453 0.256655
-vt 0.263651 0.176102
-vt 0.590528 0.015309
-vt 0.627082 0.093830
-vt 0.625895 0.102096
-vt 0.625895 0.102096
-vt 0.591267 0.027020
-vt 0.590528 0.015309
-vt 0.029621 0.222596
-vt 0.037569 0.216318
-vt 0.051190 0.233338
-vt 0.051190 0.233338
-vt 0.031731 0.241442
-vt 0.029621 0.222596
-vt 0.781517 0.289924
-vt 0.781502 0.247469
-vt 0.994963 0.356031
-vt 0.328914 0.302738
-vt 0.313453 0.256655
-vt 0.333708 0.006121
-vt 0.333708 0.006121
-vt 0.393471 0.243810
-vt 0.328914 0.302738
-vt 0.625895 0.102096
-vt 0.626730 0.111287
-vt 0.591267 0.027020
-usemtl Default
-f 282/282 283/283 284/284
-f 285/285 286/286 287/287
-f 288/288 289/289 290/290
-f 291/291 292/292 293/293
-f 294/294 295/295 296/296
-f 297/297 298/298 299/299
-f 300/300 301/301 302/302
-f 303/303 304/304 305/305
-f 306/306 307/307 308/308
-f 309/309 310/310 311/311
-f 312/312 313/313 314/314
-f 315/315 316/316 317/317
-f 318/318 319/319 320/320
-f 321/321 322/322 323/323
-f 324/324 325/325 326/326
-f 327/327 328/328 329/329
-f 330/330 331/331 332/332
-f 333/333 334/334 335/335
-f 336/336 337/337 338/338
-f 339/339 340/340 341/341
-f 342/342 343/343 344/344
-f 345/345 346/346 347/347
-f 348/348 349/349 350/350
-f 351/351 352/352 353/353
-f 354/354 355/355 356/356
-f 357/357 358/358 359/359
-f 360/360 361/361 362/362
-f 363/363 364/364 365/365
-f 366/366 367/367 368/368
-g reactor03
-v 45.685333 -77.997643 -78.439079
-v 42.528831 -76.306068 -72.971855
-v 39.372334 -76.306068 -78.439079
-v 45.685333 -77.997643 -78.439079
-v 42.528839 -76.306068 -83.906296
-v 48.841839 -76.306068 -83.906296
-v 51.998333 -76.306068 -78.439072
-v 45.685333 -77.997643 -78.439079
-v 48.841831 -76.306068 -72.971855
-v 48.841831 -76.306068 -72.971855
-v 40.218109 -71.684639 -68.969574
-v 34.750896 -71.684639 -78.439079
-v 39.372334 -76.306068 -78.439079
-v 39.372334 -76.306068 -78.439079
-v 34.750896 -71.684639 -78.439079
-v 40.218121 -71.684639 -87.908577
-v 39.372334 -76.306068 -78.439079
-v 42.528839 -76.306068 -83.906296
-v 51.152557 -71.684624 -87.908577
-v 48.841839 -76.306068 -83.906296
-v 48.841839 -76.306068 -83.906296
-v 51.152557 -71.684624 -87.908577
-v 56.619770 -71.684624 -78.439072
-v 51.998333 -76.306068 -78.439072
-v 51.998333 -76.306068 -78.439072
-v 56.619770 -71.684624 -78.439072
-v 51.152546 -71.684624 -68.969574
-v 51.998333 -76.306068 -78.439072
-v 51.152546 -71.684624 -68.969574
-v 42.528831 -76.306068 -72.971855
-v 40.218109 -71.684639 -68.969574
-v 39.372326 -65.371635 -67.504639
-v 33.059330 -65.371635 -78.439087
-v 33.059330 -65.371635 -78.439087
-v 39.372337 -65.371635 -89.373520
-v 34.750896 -71.684639 -78.439079
-v 40.218121 -71.684639 -87.908577
-v 39.372337 -65.371635 -89.373520
-v 51.998341 -65.371635 -89.373512
-v 40.218121 -71.684639 -87.908577
-v 51.152557 -71.684624 -87.908577
-v 51.998341 -65.371635 -89.373512
-v 58.311333 -65.371635 -78.439072
-v 56.619770 -71.684624 -78.439072
-v 51.998325 -65.371635 -67.504631
-v 56.619770 -71.684624 -78.439072
-v 51.152546 -71.684624 -68.969574
-v 51.998325 -65.371635 -67.504631
-v 39.372314 6.376366 -67.504646
-v 33.059319 6.376366 -78.439087
-v 39.372326 -65.371635 -67.504639
-v 33.059330 -65.371635 -78.439087
-v 33.059330 -65.371635 -78.439087
-v 33.059319 6.376366 -78.439087
-v 39.372326 6.376366 -89.373520
-v 39.372337 -65.371635 -89.373520
-v 39.372337 -65.371635 -89.373520
-v 51.998329 6.376366 -89.373512
-v 58.311321 6.376366 -78.439072
-v 58.311333 -65.371635 -78.439072
-v 58.311321 6.376366 -78.439072
-v 51.998314 6.376366 -67.504639
-v 51.998325 -65.371635 -67.504631
-v 51.998314 6.376366 -67.504639
-v 39.372326 -65.371635 -67.504639
-v 40.218094 12.689362 -68.969582
-v 34.750881 12.689362 -78.439087
-v 40.218105 12.689362 -87.908585
-v 33.059319 6.376366 -78.439087
-v 39.372326 6.376366 -89.373520
-v 51.152542 12.689362 -87.908577
-v 51.998329 6.376366 -89.373512
-v 56.619755 12.689362 -78.439072
-v 58.311321 6.376366 -78.439072
-v 58.311321 6.376366 -78.439072
-v 51.152531 12.689362 -68.969574
-v 58.311321 6.376366 -78.439072
-v 51.998314 6.376366 -67.504639
-v 51.152531 12.689362 -68.969574
-v 51.998314 6.376366 -67.504639
-v 40.218094 12.689362 -68.969582
-v 39.372314 6.376366 -67.504646
-v 40.218094 12.689362 -68.969582
-v 42.528816 17.310799 -72.971863
-v 39.372318 17.310799 -78.439079
-v 34.750881 12.689362 -78.439087
-v 39.372318 17.310799 -78.439079
-v 42.528820 17.310799 -83.906303
-v 40.218105 12.689362 -87.908585
-v 48.841824 17.310799 -83.906296
-v 40.218105 12.689362 -87.908585
-v 51.152542 12.689362 -87.908577
-v 51.152542 12.689362 -87.908577
-v 48.841824 17.310799 -83.906296
-v 51.998318 17.310799 -78.439072
-v 56.619755 12.689362 -78.439072
-v 48.841816 17.310799 -72.971855
-v 51.152531 12.689362 -68.969574
-v 48.841816 17.310799 -72.971855
-v 42.528816 17.310799 -72.971863
-v 45.685318 19.002365 -78.439079
-v 39.372318 17.310799 -78.439079
-v 42.528820 17.310799 -83.906303
-v 48.841824 17.310799 -83.906296
-v 51.998318 17.310799 -78.439072
-v 48.841816 17.310799 -72.971855
-v 45.685318 19.002365 -78.439079
-vt 0.750000 1.000000
-vt 0.821429 0.995640
-vt 0.857143 0.995640
-vt 0.964286 1.000000
-vt 0.892857 0.995640
-vt 0.928571 0.995640
-vt 0.964286 0.995640
-vt 0.964286 1.000000
-vt 1.000000 0.995640
-vt 0.785714 0.995640
-vt 0.821429 0.983729
-vt 0.857143 0.983729
-vt 0.857143 0.995640
-vt 0.857143 0.995640
-vt 0.857143 0.983729
-vt 0.892857 0.983729
-vt 0.857143 0.995640
-vt 0.892857 0.995640
-vt 0.928571 0.983729
-vt 0.928571 0.995640
-vt 0.928571 0.995640
-vt 0.928571 0.983729
-vt 0.964286 0.983729
-vt 0.964286 0.995640
-vt 0.964286 0.995640
-vt 0.964286 0.983729
-vt 1.000000 0.983729
-vt 0.964286 0.995640
-vt 0.785714 0.983729
-vt 0.821429 0.995640
-vt 0.821429 0.983729
-vt 0.821429 0.967459
-vt 0.857143 0.967459
-vt 0.857143 0.967459
-vt 0.892857 0.967459
-vt 0.857143 0.983729
-vt 0.892857 0.983729
-vt 0.892857 0.967459
-vt 0.928571 0.967459
-vt 0.892857 0.983729
-vt 0.928571 0.983729
-vt 0.928571 0.967459
-vt 0.964286 0.967459
-vt 0.964286 0.983729
-vt 1.000000 0.967459
-vt 0.964286 0.983729
-vt 1.000000 0.983729
-vt 0.785714 0.967459
-vt 0.821429 0.782541
-vt 0.857143 0.782541
-vt 0.821429 0.967459
-vt 0.857143 0.967459
-vt 0.857143 0.967459
-vt 0.857143 0.782541
-vt 0.892857 0.782541
-vt 0.892857 0.967459
-vt 0.892857 0.967459
-vt 0.928571 0.782541
-vt 0.964286 0.782541
-vt 0.964286 0.967459
-vt 0.964286 0.782541
-vt 1.000000 0.782541
-vt 1.000000 0.967459
-vt 0.785714 0.782541
-vt 0.821429 0.967459
-vt 0.821429 0.766271
-vt 0.857143 0.766271
-vt 0.892857 0.766271
-vt 0.857143 0.782541
-vt 0.892857 0.782541
-vt 0.928571 0.766271
-vt 0.928571 0.782541
-vt 0.964286 0.766271
-vt 0.964286 0.782541
-vt 0.964286 0.782541
-vt 1.000000 0.766271
-vt 0.964286 0.782541
-vt 1.000000 0.782541
-vt 0.785714 0.766271
-vt 0.785714 0.782541
-vt 0.821429 0.766271
-vt 0.821429 0.782541
-vt 0.821429 0.766271
-vt 0.821429 0.754360
-vt 0.857143 0.754360
-vt 0.857143 0.766271
-vt 0.857143 0.754360
-vt 0.892857 0.754360
-vt 0.892857 0.766271
-vt 0.928571 0.754360
-vt 0.892857 0.766271
-vt 0.928571 0.766271
-vt 0.928571 0.766271
-vt 0.928571 0.754360
-vt 0.964286 0.754360
-vt 0.964286 0.766271
-vt 1.000000 0.754360
-vt 1.000000 0.766271
-vt 0.785714 0.754360
-vt 0.821429 0.754360
-vt 0.857143 0.750000
-vt 0.857143 0.754360
-vt 0.892857 0.754360
-vt 0.928571 0.754360
-vt 0.750000 0.754360
-vt 0.785714 0.754360
-vt 0.857143 0.750000
-usemtl Default
-f 369/369 370/370 371/371
-f 372/372 371/371 373/373
-f 372/372 373/373 374/374
-f 372/372 374/374 375/375
-f 376/376 375/375 377/377
-f 369/369 378/378 370/370
-f 370/370 379/379 380/380
-f 370/370 380/380 381/381
-f 382/382 383/383 384/384
-f 385/385 384/384 373/373
-f 386/386 384/384 387/387
-f 373/373 387/387 388/388
-f 389/389 390/390 391/391
-f 389/389 391/391 392/392
-f 393/393 394/394 395/395
-f 396/396 395/395 377/377
-f 378/378 397/397 379/379
-f 378/378 379/379 398/398
-f 399/399 400/400 401/401
-f 379/379 401/401 380/380
-f 383/383 402/402 403/403
-f 404/404 403/403 384/384
-f 405/405 406/406 407/407
-f 408/408 407/407 409/409
-f 409/409 410/410 411/411
-f 409/409 411/411 412/412
-f 412/412 411/411 413/413
-f 414/414 413/413 415/415
-f 397/397 416/416 400/400
-f 397/397 400/400 399/399
-f 400/400 417/417 418/418
-f 419/419 418/418 420/420
-f 421/421 422/422 423/423
-f 421/421 423/423 424/424
-f 425/425 423/423 426/426
-f 425/425 426/426 407/407
-f 410/410 426/426 427/427
-f 410/410 427/427 411/411
-f 428/428 429/429 430/430
-f 428/428 430/430 431/431
-f 416/416 432/432 417/417
-f 416/416 417/417 433/433
-f 417/417 434/434 435/435
-f 417/417 435/435 418/418
-f 422/422 435/435 436/436
-f 437/437 436/436 438/438
-f 423/423 436/436 439/439
-f 423/423 439/439 440/440
-f 426/426 439/439 441/441
-f 426/426 441/441 442/442
-f 443/443 441/441 444/444
-f 445/445 444/444 446/446
-f 432/432 447/447 434/434
-f 448/448 449/449 450/450
-f 451/451 452/452 453/453
-f 434/434 453/453 454/454
-f 435/435 455/455 456/456
-f 435/435 456/456 436/436
-f 457/457 456/456 458/458
-f 459/459 458/458 460/460
-f 461/461 462/462 463/463
-f 439/439 463/463 441/441
-f 464/464 463/463 465/465
-f 464/464 465/465 466/466
-f 447/447 467/467 452/452
-f 447/447 452/452 451/451
-f 468/468 469/469 470/470
-f 470/470 469/469 456/456
-f 471/471 469/469 458/458
-f 472/472 469/469 463/463
-f 473/473 469/469 467/467
-f 474/474 475/475 468/468
-g wing03
-v 33.762955 -60.615021 -62.868530
-v 37.606140 -69.945724 -69.525124
-v 39.079193 -68.157547 -66.973732
-v 33.762955 -60.615021 -62.868530
-v 38.423519 -60.615021 -60.177750
-v 31.117521 -20.619514 -47.523380
-v 31.117521 -20.619514 -47.523380
-v 26.456961 -20.619514 -50.214157
-v 33.762955 -60.615021 -62.868530
-v 26.456961 -20.619514 -50.214157
-v 31.117521 -20.619514 -47.523380
-v 25.414923 1.234928 -37.646183
-v 20.754362 1.234928 -40.336960
-v 20.248913 7.132179 -34.079948
-v 25.414923 1.234928 -37.646183
-v 22.152567 8.019409 -31.995615
-v 40.426983 11.210987 -69.308144
-v 25.762754 52.636772 -39.952969
-v 26.324265 52.964798 -39.221191
-v 26.324265 52.964798 -39.221191
-v 43.151035 10.123142 -68.366035
-v 40.426983 11.210987 -69.308144
-v 38.522083 10.347294 -71.111565
-v 37.606159 4.123146 -69.525139
-v 26.456961 -20.619514 -50.214157
-v 26.456961 -20.619514 -50.214157
-v 20.754362 1.234928 -40.336960
-v 38.522083 10.347294 -71.111565
-v 39.079193 -68.157547 -66.973732
-v 42.347172 -70.141090 -66.973724
-v 38.423519 -60.615021 -60.177750
-v 38.423519 -60.615021 -60.177750
-v 33.762955 -60.615021 -62.868530
-v 39.079193 -68.157547 -66.973732
-v 37.606140 -69.945724 -69.525124
-v 33.762955 -60.615021 -62.868530
-v 26.456961 -20.619514 -50.214157
-v 26.456961 -20.619514 -50.214157
-v 37.606159 4.123146 -69.525139
-v 37.606140 -69.945724 -69.525124
-v 20.754362 1.234928 -40.336960
-v 17.492006 8.019402 -34.686394
-v 21.663702 36.348991 -41.911976
-v 21.663702 36.348991 -41.911976
-v 38.522083 10.347294 -71.111565
-v 20.754362 1.234928 -40.336960
-v 31.117521 -20.619514 -47.523380
-v 38.423519 -60.615021 -60.177750
-v 42.347172 -70.141090 -66.973724
-v 42.347172 -70.141090 -66.973724
-v 42.347187 4.123142 -66.973732
-v 31.117521 -20.619514 -47.523380
-v 43.151035 10.123142 -68.366035
-v 26.324265 52.964798 -39.221191
-v 26.324265 36.348991 -39.221199
-v 31.117521 -20.619514 -47.523380
-v 42.347187 4.123142 -66.973732
-v 43.151035 10.123142 -68.366035
-v 43.151035 10.123142 -68.366035
-v 25.414923 1.234928 -37.646183
-v 31.117521 -20.619514 -47.523380
-v 38.522083 10.347294 -71.111565
-v 21.661169 53.047668 -41.912308
-v 24.551258 51.661064 -41.531822
-v 24.551258 51.661064 -41.531822
-v 40.426983 11.210987 -69.308144
-v 38.522083 10.347294 -71.111565
-v 20.248913 7.132179 -34.079948
-v 17.492006 8.019402 -34.686394
-v 20.754362 1.234928 -40.336960
-v 20.754362 1.234928 -40.336960
-v 25.414923 1.234928 -37.646183
-v 20.248913 7.132179 -34.079948
-v 21.663702 36.348991 -41.911976
-v 21.661169 53.047668 -41.912308
-v 38.522083 10.347294 -71.111565
-v 22.152567 8.019409 -31.995615
-v 25.414923 1.234928 -37.646183
-v 43.151035 10.123142 -68.366035
-v 43.151035 10.123142 -68.366035
-v 26.324265 36.348991 -39.221199
-v 22.152567 8.019409 -31.995615
-v 24.551258 51.661064 -41.531822
-v 25.762754 52.636772 -39.952969
-v 40.426983 11.210987 -69.308144
-vt 0.716045 0.241039
-vt 0.731750 0.232127
-vt 0.737769 0.233835
-vt 0.716045 0.241039
-vt 0.735090 0.241039
-vt 0.705235 0.279237
-vt 0.705235 0.279237
-vt 0.686190 0.279237
-vt 0.716045 0.241039
-vt 0.686190 0.279237
-vt 0.705235 0.279237
-vt 0.681932 0.300110
-vt 0.662887 0.300110
-vt 0.034182 0.291360
-vt 0.055292 0.280633
-vt 0.041961 0.297629
-vt 0.767298 0.024370
-vt 0.731836 0.091226
-vt 0.731555 0.088666
-vt 0.731555 0.088666
-vt 0.768230 0.011951
-vt 0.767298 0.024370
-vt 0.745454 0.612416
-vt 0.756774 0.596591
-vt 0.894572 0.533685
-vt 0.894572 0.533685
-vt 0.965052 0.589248
-vt 0.745454 0.612416
-vt 0.737769 0.233835
-vt 0.751124 0.231941
-vt 0.735090 0.241039
-vt 0.735090 0.241039
-vt 0.716045 0.241039
-vt 0.737769 0.233835
-vt 0.756774 0.408278
-vt 0.804274 0.432001
-vt 0.894572 0.533685
-vt 0.894572 0.533685
-vt 0.756774 0.596591
-vt 0.756774 0.408278
-vt 0.965052 0.589248
-vt 0.989004 0.606497
-vt 0.953814 0.678523
-vt 0.953814 0.678523
-vt 0.745454 0.612416
-vt 0.965052 0.589248
-vt 0.177091 0.135932
-vt 0.268233 0.236675
-vt 0.289941 0.290778
-vt 0.289941 0.290778
-vt 0.120707 0.290778
-vt 0.177091 0.135932
-vt 0.107034 0.301862
-vt 0.009406 0.069838
-vt 0.047271 0.069838
-vt 0.177091 0.135932
-vt 0.120707 0.290778
-vt 0.107034 0.301862
-vt 0.107034 0.301862
-vt 0.127289 0.057299
-vt 0.177091 0.135932
-vt 0.768038 0.033055
-vt 0.731484 0.109925
-vt 0.732671 0.096749
-vt 0.732671 0.096749
-vt 0.767298 0.024370
-vt 0.768038 0.033055
-vt 0.034182 0.291360
-vt 0.022916 0.289536
-vt 0.036247 0.272540
-vt 0.036247 0.272540
-vt 0.055292 0.280633
-vt 0.034182 0.291360
-vt 0.953814 0.678523
-vt 0.953811 0.720977
-vt 0.745454 0.612416
-vt 0.111828 0.012315
-vt 0.127289 0.057299
-vt 0.107034 0.301862
-vt 0.107034 0.301862
-vt 0.047271 0.069838
-vt 0.111828 0.012315
-vt 0.732671 0.096749
-vt 0.731836 0.091226
-vt 0.767298 0.024370
-usemtl Default
-f 476/476 477/477 478/478
-f 479/479 480/480 481/481
-f 482/482 483/483 484/484
-f 485/485 486/486 487/487
-f 487/487 488/488 485/485
-f 489/489 490/490 491/491
-f 492/492 493/493 494/494
-f 495/495 496/496 497/497
-f 498/498 499/499 500/500
-f 501/501 502/502 503/503
-f 504/504 505/505 506/506
-f 507/507 508/508 509/509
-f 510/510 511/511 512/512
-f 513/513 514/514 515/515
-f 516/516 517/517 518/518
-f 519/519 520/520 521/521
-f 522/522 523/523 524/524
-f 525/525 526/526 527/527
-f 528/528 529/529 530/530
-f 531/531 532/532 533/533
-f 534/534 535/535 536/536
-f 537/537 538/538 539/539
-f 540/540 541/541 542/542
-f 543/543 544/544 545/545
-f 546/546 547/547 548/548
-f 549/549 550/550 551/551
-f 552/552 553/553 554/554
-f 555/555 556/556 557/557
-f 558/558 559/559 560/560
-g reactor02
-v 47.122719 -77.997612 78.472374
-v 43.966217 -76.306053 73.005157
-v 50.279217 -76.306053 73.005157
-v 53.435719 -76.306053 78.472374
-v 53.435719 -76.306053 78.472374
-v 50.279217 -76.306053 83.939598
-v 47.122719 -77.997612 78.472374
-v 43.966217 -76.306053 83.939598
-v 47.122719 -77.997612 78.472374
-v 40.809719 -76.306053 78.472374
-v 47.122719 -77.997612 78.472374
-v 43.966217 -76.306053 73.005157
-v 41.655499 -71.684608 69.002876
-v 52.589939 -71.684624 69.002876
-v 50.279217 -76.306053 73.005157
-v 58.057159 -71.684624 78.472374
-v 52.589939 -71.684624 87.941879
-v 50.279217 -76.306053 83.939598
-v 52.589939 -71.684624 87.941879
-v 41.655502 -71.684608 87.941879
-v 50.279217 -76.306053 83.939598
-v 43.966217 -76.306053 83.939598
-v 36.188282 -71.684608 78.472374
-v 43.966217 -76.306053 83.939598
-v 40.809719 -76.306053 78.472374
-v 41.655499 -71.684608 69.002876
-v 43.966217 -76.306053 73.005157
-v 40.809723 -65.371620 67.537941
-v 53.435722 -65.371620 67.537941
-v 52.589939 -71.684624 69.002876
-v 59.748722 -65.371620 78.472374
-v 52.589939 -71.684624 69.002876
-v 58.057159 -71.684624 78.472374
-v 53.435722 -65.371620 89.406815
-v 58.057159 -71.684624 78.472374
-v 52.589939 -71.684624 87.941879
-v 53.435722 -65.371620 89.406815
-v 40.809723 -65.371620 89.406815
-v 52.589939 -71.684624 87.941879
-v 40.809723 -65.371620 89.406815
-v 34.496723 -65.371620 78.472374
-v 41.655502 -71.684608 87.941879
-v 36.188282 -71.684608 78.472374
-v 34.496723 -65.371620 78.472374
-v 36.188282 -71.684608 78.472374
-v 41.655499 -71.684608 69.002876
-v 40.809750 6.376381 67.537941
-v 53.435753 6.376381 67.537933
-v 53.435722 -65.371620 67.537941
-v 53.435722 -65.371620 67.537941
-v 59.748753 6.376373 78.472374
-v 59.748722 -65.371620 78.472374
-v 53.435753 6.376381 89.406815
-v 53.435722 -65.371620 89.406815
-v 53.435753 6.376381 89.406815
-v 40.809750 6.376381 89.406815
-v 34.496750 6.376389 78.472374
-v 34.496723 -65.371620 78.472374
-v 34.496723 -65.371620 78.472374
-v 40.809723 -65.371620 67.537941
-v 41.655537 12.689377 69.002876
-v 52.589973 12.689377 69.002876
-v 40.809750 6.376381 67.537941
-v 58.057194 12.689369 78.472374
-v 59.748753 6.376373 78.472374
-v 58.057194 12.689369 78.472374
-v 52.589973 12.689377 87.941872
-v 59.748753 6.376373 78.472374
-v 52.589973 12.689377 87.941872
-v 41.655537 12.689377 87.941872
-v 53.435753 6.376381 89.406815
-v 36.188316 12.689384 78.472374
-v 34.496750 6.376389 78.472374
-v 34.496750 6.376389 78.472374
-v 41.655537 12.689377 69.002876
-v 43.966255 17.310814 73.005157
-v 50.279255 17.310814 73.005157
-v 52.589973 12.689377 69.002876
-v 53.435757 17.310814 78.472374
-v 53.435757 17.310814 78.472374
-v 50.279255 17.310814 83.939590
-v 50.279255 17.310814 83.939590
-v 43.966255 17.310814 83.939590
-v 43.966255 17.310814 83.939590
-v 40.809757 17.310814 78.472374
-v 36.188316 12.689384 78.472374
-v 36.188316 12.689384 78.472374
-v 43.966255 17.310814 73.005157
-v 47.122757 19.002380 78.472374
-v 50.279255 17.310814 83.939590
-v 47.122757 19.002380 78.472374
-v 40.809757 17.310814 78.472374
-v 47.122757 19.002380 78.472374
-vt 0.857143 1.000000
-vt 0.892857 0.995640
-vt 0.928571 0.995640
-vt 0.964286 0.995640
-vt 0.750000 0.995640
-vt 0.785714 0.995640
-vt 0.857143 1.000000
-vt 0.821429 0.995640
-vt 0.857143 1.000000
-vt 0.857143 0.995640
-vt 0.857143 1.000000
-vt 0.892857 0.995640
-vt 0.892857 0.983729
-vt 0.928571 0.983729
-vt 0.928571 0.995640
-vt 0.964286 0.983729
-vt 1.000000 0.983729
-vt 1.000000 0.995640
-vt 0.785714 0.983729
-vt 0.821429 0.983729
-vt 0.785714 0.995640
-vt 0.821429 0.995640
-vt 0.857143 0.983729
-vt 0.821429 0.995640
-vt 0.857143 0.995640
-vt 0.892857 0.983729
-vt 0.892857 0.995640
-vt 0.892857 0.967459
-vt 0.928571 0.967459
-vt 0.928571 0.983729
-vt 0.964286 0.967459
-vt 0.928571 0.983729
-vt 0.964286 0.983729
-vt 1.000000 0.967459
-vt 0.964286 0.983729
-vt 1.000000 0.983729
-vt 0.785714 0.967459
-vt 0.821429 0.967459
-vt 0.785714 0.983729
-vt 0.821429 0.967459
-vt 0.857143 0.967459
-vt 0.821429 0.983729
-vt 0.857143 0.983729
-vt 0.857143 0.967459
-vt 0.857143 0.983729
-vt 0.892857 0.983729
-vt 0.892857 0.782541
-vt 0.928571 0.782541
-vt 0.928571 0.967459
-vt 0.928571 0.967459
-vt 0.964286 0.782541
-vt 0.964286 0.967459
-vt 1.000000 0.782541
-vt 1.000000 0.967459
-vt 0.785714 0.782541
-vt 0.821429 0.782541
-vt 0.857143 0.782541
-vt 0.857143 0.967459
-vt 0.857143 0.967459
-vt 0.892857 0.967459
-vt 0.892857 0.766271
-vt 0.928571 0.766271
-vt 0.892857 0.782541
-vt 0.964286 0.766271
-vt 0.964286 0.782541
-vt 0.964286 0.766271
-vt 1.000000 0.766271
-vt 0.964286 0.782541
-vt 0.785714 0.766271
-vt 0.821428 0.766271
-vt 0.785714 0.782541
-vt 0.857143 0.766271
-vt 0.857143 0.782541
-vt 0.857143 0.782541
-vt 0.892857 0.766271
-vt 0.892857 0.754360
-vt 0.928571 0.754360
-vt 0.928571 0.766271
-vt 0.964286 0.754360
-vt 0.964286 0.754360
-vt 1.000000 0.754360
-vt 0.785714 0.754360
-vt 0.821428 0.754360
-vt 0.821428 0.754360
-vt 0.857143 0.754360
-vt 0.857143 0.766271
-vt 0.857143 0.766271
-vt 0.892857 0.754360
-vt 0.964286 0.750000
-vt 1.000000 0.754360
-vt 0.750000 0.750000
-vt 0.857143 0.754360
-vt 0.964286 0.750000
-usemtl Default
-f 561/561 562/562 563/563
-f 561/561 563/563 564/564
-f 561/561 565/565 566/566
-f 567/567 566/566 568/568
-f 569/569 568/568 570/570
-f 571/571 570/570 562/562
-f 572/572 573/573 574/574
-f 572/572 574/574 575/575
-f 563/563 574/574 576/576
-f 575/575 576/576 564/564
-f 564/564 576/576 577/577
-f 564/564 577/577 578/578
-f 566/566 579/579 580/580
-f 581/581 580/580 582/582
-f 582/582 580/580 583/583
-f 584/584 583/583 585/585
-f 570/570 583/583 573/573
-f 570/570 586/586 587/587
-f 586/586 588/588 589/589
-f 573/573 589/589 574/574
-f 590/590 589/589 591/591
-f 592/592 591/591 593/593
-f 576/576 591/591 594/594
-f 595/595 594/594 596/596
-f 579/579 597/597 598/598
-f 599/599 598/598 580/580
-f 580/580 600/600 601/601
-f 602/602 601/601 603/603
-f 583/583 604/604 588/588
-f 605/605 588/588 606/606
-f 588/588 607/607 608/608
-f 588/588 608/608 609/609
-f 610/610 608/608 611/611
-f 610/610 611/611 591/591
-f 612/612 611/611 613/613
-f 612/612 613/613 614/614
-f 597/597 615/615 616/616
-f 597/597 616/616 598/598
-f 600/600 616/616 617/617
-f 600/600 617/617 604/604
-f 618/618 617/617 607/607
-f 619/619 607/607 620/620
-f 607/607 621/621 622/622
-f 623/623 622/622 608/608
-f 608/608 622/622 624/624
-f 608/608 624/624 611/611
-f 625/625 626/626 627/627
-f 628/628 627/627 613/613
-f 615/615 629/629 630/630
-f 631/631 630/630 616/616
-f 616/616 630/630 632/632
-f 616/616 632/632 633/633
-f 634/634 632/632 621/621
-f 617/617 635/635 607/607
-f 621/621 636/636 637/637
-f 621/621 637/637 622/622
-f 638/638 637/637 639/639
-f 622/622 639/639 626/626
-f 626/626 640/640 641/641
-f 626/626 641/641 627/627
-f 629/629 642/642 643/643
-f 629/629 643/643 630/630
-f 630/630 644/644 645/645
-f 630/630 645/645 632/632
-f 646/646 645/645 636/636
-f 647/647 636/636 621/621
-f 648/648 649/649 637/637
-f 637/637 649/649 639/639
-f 639/639 649/649 650/650
-f 642/642 651/651 643/643
-f 643/643 651/651 652/652
-f 645/645 653/653 648/648
diff --git a/android/examples/Basics/Shape/LoadDisplayOBJ/data/rocket.png b/android/examples/Basics/Shape/LoadDisplayOBJ/data/rocket.png
deleted file mode 100644
index b9724ab8ea..0000000000
Binary files a/android/examples/Basics/Shape/LoadDisplayOBJ/data/rocket.png and /dev/null differ
diff --git a/android/examples/Basics/Shape/LoadDisplaySVG/LoadDisplaySVG.pde b/android/examples/Basics/Shape/LoadDisplaySVG/LoadDisplaySVG.pde
deleted file mode 100644
index 5cb9c91d41..0000000000
--- a/android/examples/Basics/Shape/LoadDisplaySVG/LoadDisplaySVG.pde
+++ /dev/null
@@ -1,26 +0,0 @@
-/**
- * Load and Display a Shape.
- * Illustration by George Brower.
- *
- * The loadShape() command is used to read simple SVG (Scalable Vector Graphics)
- * files and OBJ (Object) files into a Processing sketch. This example loads an
- * SVG file of a monster robot face and displays it to the screen.
- */
-
-// The next line is needed if running in JavaScript Mode with Processing.js
-/* @pjs preload="bot1.svg"; */
-
-PShape bot;
-
-void setup() {
- size(640, 360);
- // The file "bot1.svg" must be in the data folder
- // of the current sketch to load successfully
- bot = loadShape("bot1.svg");
-}
-
-void draw(){
- background(102);
- shape(bot, 110, 90, 100, 100); // Draw at coordinate (110, 90) at size 100 x 100
- shape(bot, 280, 40); // Draw at coordinate (280, 40) at the default size
-}
diff --git a/android/examples/Basics/Shape/LoadDisplaySVG/data/bot1.svg b/android/examples/Basics/Shape/LoadDisplaySVG/data/bot1.svg
deleted file mode 100644
index 3c56f2d604..0000000000
--- a/android/examples/Basics/Shape/LoadDisplaySVG/data/bot1.svg
+++ /dev/null
@@ -1,160 +0,0 @@
-
-
-
-
-
-]>
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/android/examples/Basics/Shape/ScaleShape/ScaleShape.pde b/android/examples/Basics/Shape/ScaleShape/ScaleShape.pde
deleted file mode 100644
index 879f20b687..0000000000
--- a/android/examples/Basics/Shape/ScaleShape/ScaleShape.pde
+++ /dev/null
@@ -1,26 +0,0 @@
-/**
- * Scale Shape.
- * Illustration by George Brower.
- *
- * Move the mouse left and right to zoom the SVG file.
- * This shows how, unlike an imported image, the lines
- * remain smooth at any size.
- */
-
-PShape bot;
-
-void setup() {
- size(640, 360);
- smooth();
- // The file "bot1.svg" must be in the data folder
- // of the current sketch to load successfully
- bot = loadShape("bot1.svg");
-}
-
-void draw() {
- background(102);
- translate(width/2, height/2);
- float zoom = map(mouseX, 0, width, 0.1, 4.5);
- scale(zoom);
- shape(bot, -140, -140);
-}
diff --git a/android/examples/Basics/Shape/ScaleShape/data/bot1.svg b/android/examples/Basics/Shape/ScaleShape/data/bot1.svg
deleted file mode 100644
index 3c56f2d604..0000000000
--- a/android/examples/Basics/Shape/ScaleShape/data/bot1.svg
+++ /dev/null
@@ -1,160 +0,0 @@
-
-
-
-
-
-]>
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/android/examples/Basics/Structure/Coordinates/Coordinates.pde b/android/examples/Basics/Structure/Coordinates/Coordinates.pde
deleted file mode 100644
index c63c147b7e..0000000000
--- a/android/examples/Basics/Structure/Coordinates/Coordinates.pde
+++ /dev/null
@@ -1,41 +0,0 @@
-/**
- * Coordinates.
- *
- * All shapes drawn to the screen have a position that is specified as a coordinate.
- * All coordinates are measured as the distance from the origin in units of pixels.
- * The origin [0, 0] is the coordinate is in the upper left of the window
- * and the coordinate in the lower right is [width-1, height-1].
- */
-
-// Sets the screen to be 200, 200, so the width of the window is 200 pixels
-// and the height of the window is 200 pixels
-size(200, 200);
-background(0);
-noFill();
-stroke(255);
-
-// The two parameters of the point() method each specify coordinates.
-// This call to point() draws at the position [100, 100]
-point(width/2, height/2);
-
-// Draws to the position [100, 50]
-point(width/2, height/4);
-
-// It is also possible to specify a point with any parameter,
-// but only coordinates on the screen are visible
-point(60, 30);
-point(60, 134);
-point(160, 50);
-point(280, -800);
-point(201, 100);
-
-// Coordinates are used for drawing all shapes, not just points.
-// Parameters for different methods are used for different purposes.
-// For example, the first two parameters to line() specify the coordinates of the
-// first point and the second two parameters specify the second point
-stroke(204);
-line(0, 73, width, 73);
-
-// The first two parameters to rect() are coordinates
-// and the second two are the width and height
-rect(110, 55, 40, 36);
diff --git a/android/examples/Basics/Structure/CreateGraphics/CreateGraphics.pde b/android/examples/Basics/Structure/CreateGraphics/CreateGraphics.pde
deleted file mode 100644
index af137112e7..0000000000
--- a/android/examples/Basics/Structure/CreateGraphics/CreateGraphics.pde
+++ /dev/null
@@ -1,33 +0,0 @@
-/**
- * Create Graphics.
- *
- * The createGraphics() function creates an object from the PGraphics class
- * (PGraphics is the main graphics and rendering context for Processing).
- * The beginDraw() method is necessary to prepare for drawing and endDraw() is
- * necessary to finish. Use this class if you need to draw into an off-screen
- * graphics buffer or to maintain two contexts with different properties.
- */
-
-PGraphics pg;
-
-void setup() {
- size(200, 200);
- pg = createGraphics(80, 80);
-}
-
-void draw() {
- fill(0, 12);
- rect(0, 0, width, height);
- fill(255);
- noStroke();
- ellipse(mouseX, mouseY, 60, 60);
-
- pg.beginDraw();
- pg.background(102);
- pg.noFill();
- pg.stroke(255);
- pg.ellipse(mouseX-60, mouseY-60, 60, 60);
- pg.endDraw();
-
- image(pg, 60, 60);
-}
diff --git a/android/examples/Basics/Structure/CreateGraphics/data/mask.jpg b/android/examples/Basics/Structure/CreateGraphics/data/mask.jpg
deleted file mode 100644
index bbd1382544..0000000000
Binary files a/android/examples/Basics/Structure/CreateGraphics/data/mask.jpg and /dev/null differ
diff --git a/android/examples/Basics/Structure/CreateGraphics/data/test.jpg b/android/examples/Basics/Structure/CreateGraphics/data/test.jpg
deleted file mode 100644
index 04d3fc56db..0000000000
Binary files a/android/examples/Basics/Structure/CreateGraphics/data/test.jpg and /dev/null differ
diff --git a/android/examples/Basics/Structure/Functions/Functions.pde b/android/examples/Basics/Structure/Functions/Functions.pde
deleted file mode 100644
index b94fdb01e9..0000000000
--- a/android/examples/Basics/Structure/Functions/Functions.pde
+++ /dev/null
@@ -1,33 +0,0 @@
-/**
- * Functions.
- *
- * The drawTarget() function makes it easy to draw many distinct targets.
- * Each call to drawTarget() specifies the position, size, and number of
- * rings for each target.
- */
-
-void setup()
-{
- size(200, 200);
- background(51);
- noStroke();
- smooth();
- noLoop();
-}
-
-void draw()
-{
- drawTarget(68, 34, 200, 10);
- drawTarget(152, 16, 100, 3);
- drawTarget(100, 144, 80, 5);
-}
-
-void drawTarget(int xloc, int yloc, int size, int num)
-{
- float grayvalues = 255/num;
- float steps = size/num;
- for(int i=0; i 1) {
- level = level - 1;
- drawCircle(x - radius/2, radius/2, level);
- drawCircle(x + radius/2, radius/2, level);
- }
-}
diff --git a/android/examples/Basics/Structure/Recursion2/Recursion2.pde b/android/examples/Basics/Structure/Recursion2/Recursion2.pde
deleted file mode 100644
index 0da7d10cc0..0000000000
--- a/android/examples/Basics/Structure/Recursion2/Recursion2.pde
+++ /dev/null
@@ -1,32 +0,0 @@
-/**
- * Recursion.
- *
- * A demonstration of recursion, which means functions call themselves.
- * Notice how the drawCircle() function calls itself at the end of its block.
- * It continues to do this until the variable "level" is equal to 1.
- */
-
-void setup()
-{
- size(200, 200);
- noStroke();
- smooth();
- drawCircle(100, 100, 80, 8);
-}
-
-void drawCircle(float x, float y, int radius, int level)
-{
- float tt = 126 * level/6.0;
- fill(tt, 153);
- ellipse(x, y, radius*2, radius*2);
- if(level > 1) {
- level = level - 1;
- int num = int(random(2, 6));
- for(int i=0; i TWO_PI) {
- a = 0.0;
- }
-
- translate(width/2, height/2);
-
- rotateX(a);
- rotateY(a * 2.0);
- fill(255);
- rect(-rSize, -rSize, rSize*2, rSize*2);
-
- rotateX(a * 1.001);
- rotateY(a * 2.002);
- fill(0);
- rect(-rSize, -rSize, rSize*2, rSize*2);
-
-}
diff --git a/android/examples/Basics/Transform/Scale/Scale.pde b/android/examples/Basics/Transform/Scale/Scale.pde
deleted file mode 100644
index dc41a584d3..0000000000
--- a/android/examples/Basics/Transform/Scale/Scale.pde
+++ /dev/null
@@ -1,38 +0,0 @@
-/**
- * Scale
- * by Denis Grutze.
- *
- * Paramenters for the scale() function are values specified
- * as decimal percentages. For example, the method call scale(2.0)
- * will increase the dimension of the shape by 200 percent.
- * Objects always scale from the origin.
- */
-
-float a = 0.0;
-float s = 0.0;
-
-void setup()
-{
- size(200,200);
- noStroke();
- rectMode(CENTER);
- frameRate(30);
-}
-
-void draw()
-{
- background(102);
-
- a = a + 0.04;
- s = cos(a)*2;
-
- translate(width/2, height/2);
- scale(s);
- fill(51);
- rect(0, 0, 50, 50);
-
- translate(75, 0);
- fill(255);
- scale(s);
- rect(0, 0, 50, 50);
-}
diff --git a/android/examples/Basics/Transform/Translate/Translate.pde b/android/examples/Basics/Transform/Translate/Translate.pde
deleted file mode 100644
index 81b39af9d3..0000000000
--- a/android/examples/Basics/Transform/Translate/Translate.pde
+++ /dev/null
@@ -1,41 +0,0 @@
-/**
- * Translate.
- *
- * The translate() function allows objects to be moved
- * to any location within the window. The first parameter
- * sets the x-axis offset and the second parameter sets the
- * y-axis offset.
- */
-
-float x, y;
-float size = 40.0;
-
-void setup()
-{
- size(200,200);
- noStroke();
- frameRate(30);
-}
-
-void draw()
-{
- background(102);
-
- x = x + 0.8;
-
- if (x > width + size) {
- x = -size;
- }
-
- translate(x, height/2-size/2);
- fill(255);
- rect(-size/2, -size/2, size, size);
-
- // Transforms accumulate.
- // Notice how this rect moves twice
- // as fast as the other, but it has
- // the same parameter for the x-axis value
- translate(x, size);
- fill(0);
- rect(-size/2, -size/2, size, size);
-}
diff --git a/android/examples/Basics/Transform/TriangleFlower/TriangleFlower.pde b/android/examples/Basics/Transform/TriangleFlower/TriangleFlower.pde
deleted file mode 100644
index e87e97c722..0000000000
--- a/android/examples/Basics/Transform/TriangleFlower/TriangleFlower.pde
+++ /dev/null
@@ -1,47 +0,0 @@
-/**
- * Triangle Flower
- * by Ira Greenberg.
- *
- * Using rotate() and triangle() functions generate a pretty
- * flower. Uncomment the line "// rotate(rot+=radians(spin));"
- * in the triBlur() function for a nice variation.
- *
- * Updated 27 February 2010.
- */
-
-PVector[] p = new PVector[3];
-float shift = 1.0;
-float fade = 0;
-float fillCol = 0;
-float rot = 0;
-float spin = 0;
-
-void setup() {
- size(200, 200);
- background(0);
- smooth();
- fade = 255.0 / (width/2.0/shift);
- spin = 360.0 / (width/2.0/shift);
- p[0] = new PVector(-width/2, height/2);
- p[1] = new PVector(width/2, height/2);
- p[2] = new PVector(0, -height/2);
- noStroke();
- translate(width/2, height/2);
- triBlur();
-}
-
-void triBlur() {
- fill(fillCol);
- fillCol += fade;
- rotate(spin);
- // another interesting variation: uncomment the line below
- // rotate(rot+=radians(spin));
- triangle(p[0].x += shift, p[0].y -= shift/2,
- p[1].x -= shift, p[1].y -= shift/2,
- p[2].x, p[2].y += shift);
- if (p[0].x < 0) {
- // recursive call
- triBlur();
- }
-}
-
diff --git a/android/examples/Basics/Typography/Letters/Letters.pde b/android/examples/Basics/Typography/Letters/Letters.pde
deleted file mode 100644
index 66fd2302fe..0000000000
--- a/android/examples/Basics/Typography/Letters/Letters.pde
+++ /dev/null
@@ -1,72 +0,0 @@
-/**
- * Letters.
- *
- * Draws letters to the screen. This requires loading a font,
- * setting the font, and then drawing the letters.
- */
-
-PFont fontA;
-
-void setup()
-{
- size(200, 200);
- background(0);
- smooth();
- // Load the font. Fonts must be placed within the data
- // directory of your sketch. A font must first be created
- // using the 'Create Font...' option in the Tools menu.
- fontA = loadFont("CourierNew36.vlw");
- textAlign(CENTER);
-
- // Set the font and its size (in units of pixels)
- textFont(fontA, 32);
-
- // Only draw once
- noLoop();
-}
-
-void draw()
-{
- // Set the gray value of the letters
- fill(255);
-
- // Set the left and top margin
- int margin = 6;
- int gap = 30;
- translate(margin*1.5, margin*2);
-
- // Create a matrix of letterforms
- int counter = 0;
- for(int i=0; i= 26) {
- counter = 0;
- }
- }
- }
-}
-
diff --git a/android/examples/Basics/Typography/Letters/data/CourierNew36.vlw b/android/examples/Basics/Typography/Letters/data/CourierNew36.vlw
deleted file mode 100644
index 904771486a..0000000000
Binary files a/android/examples/Basics/Typography/Letters/data/CourierNew36.vlw and /dev/null differ
diff --git a/android/examples/Basics/Typography/Words/Words.pde b/android/examples/Basics/Typography/Words/Words.pde
deleted file mode 100644
index d8e8a5f96e..0000000000
--- a/android/examples/Basics/Typography/Words/Words.pde
+++ /dev/null
@@ -1,39 +0,0 @@
-/**
- * Words.
- *
- * The text() function is used for writing words to the screen.
- */
-
-
-int x = 30;
-PFont fontA;
-
-void setup()
-{
- size(200, 200);
- background(102);
-
- // Load the font. Fonts must be placed within the data
- // directory of your sketch. Use Tools > Create Font
- // to create a distributable bitmap font.
- // For vector fonts, use the createFont() function.
- fontA = loadFont("Ziggurat-HTF-Black-32.vlw");
-
- // Set the font and its size (in units of pixels)
- textFont(fontA, 32);
-
- // Only draw once
- noLoop();
-}
-
-void draw() {
- // Use fill() to change the value or color of the text
- fill(0);
- text("ichi", x, 60);
- fill(51);
- text("ni", x, 95);
- fill(204);
- text("san", x, 130);
- fill(255);
- text("shi", x, 165);
-}
diff --git a/android/examples/Basics/Typography/Words/data/Ziggurat-HTF-Black-32.vlw b/android/examples/Basics/Typography/Words/data/Ziggurat-HTF-Black-32.vlw
deleted file mode 100644
index 84c2d4b59e..0000000000
Binary files a/android/examples/Basics/Typography/Words/data/Ziggurat-HTF-Black-32.vlw and /dev/null differ
diff --git a/android/examples/Basics/Web/EmbeddedLinks/EmbeddedLinks.pde b/android/examples/Basics/Web/EmbeddedLinks/EmbeddedLinks.pde
deleted file mode 100644
index 2501487e35..0000000000
--- a/android/examples/Basics/Web/EmbeddedLinks/EmbeddedLinks.pde
+++ /dev/null
@@ -1,67 +0,0 @@
-/**
- * Loading URLs.
- *
- * Click on the left button to open a different URL in the same window (Only
- * works online). Click on the right button to open a URL in a new browser window.
-*/
-
-boolean overLeftButton = false;
-boolean overRightButton = false;
-
-void setup() {
- size(200, 200);
-}
-
-void draw() {
- background(204);
-
- // Left buttom
- if (overLeftButton == true) {
- fill(255);
- } else {
- noFill();
- }
- rect(20, 60, 75, 75);
- rect(50, 90, 15, 15);
-
- // Right button
- if (overRightButton == true) {
- fill(255);
- } else {
- noFill();
- }
- rect(105, 60, 75, 75);
- line(135, 105, 155, 85);
- line(140, 85, 155, 85);
- line(155, 85, 155, 100);
-}
-
-void mousePressed() {
- if (overLeftButton) {
- link("http://www.processing.org");
- } else if (overRightButton) {
- link("http://www.processing.org", "_new");
- }
-}
-
-void mouseMoved() {
- checkButtons();
-}
-
-void mouseDragged() {
- checkButtons();
-}
-
-void checkButtons() {
- if (mouseX > 20 && mouseX < 95 && mouseY > 60 && mouseY < 135) {
- overLeftButton = true;
- } else if (mouseX > 105 && mouseX < 180 && mouseY > 60 && mouseY <135) {
- overRightButton = true;
- } else {
- overLeftButton = overRightButton = false;
- }
-}
-
-
-
-
diff --git a/android/examples/Basics/Web/LoadingImages/LoadingImages.pde b/android/examples/Basics/Web/LoadingImages/LoadingImages.pde
deleted file mode 100644
index e2a958d22a..0000000000
--- a/android/examples/Basics/Web/LoadingImages/LoadingImages.pde
+++ /dev/null
@@ -1,13 +0,0 @@
-/**
- * Loading Images.
- *
- * Loads an image from over the network. Be sure to have INTERNET
- * permission enabled, otherwise img will always return null.
- */
-
-size(200, 200);
-PImage img1;
-img1 = loadImage("http://processing.org/img/processing_cover.gif");
-if (img != null) {
- image(img1, 0, 0);
-}
diff --git a/android/examples/Demos/Graphics/Particles/Particle.pde b/android/examples/Demos/Graphics/Particles/Particle.pde
deleted file mode 100644
index b205887c81..0000000000
--- a/android/examples/Demos/Graphics/Particles/Particle.pde
+++ /dev/null
@@ -1,59 +0,0 @@
-class Particle {
-
- PVector velocity;
- float lifespan = 255;
-
- PShape part;
- float partSize;
-
- PVector gravity = new PVector(0,0.1);
-
-
- Particle() {
- partSize = random(10,60);
- part = createShape();
- part.beginShape(QUAD);
- part.noStroke();
- part.texture(sprite);
- part.normal(0, 0, 1);
- part.vertex(-partSize/2, -partSize/2, 0, 0);
- part.vertex(+partSize/2, -partSize/2, sprite.width, 0);
- part.vertex(+partSize/2, +partSize/2, sprite.width, sprite.height);
- part.vertex(-partSize/2, +partSize/2, 0, sprite.height);
- part.endShape();
-
- rebirth(width/2,height/2);
- lifespan = random(255);
- }
-
- PShape getShape() {
- return part;
- }
-
- void rebirth(float x, float y) {
- float a = random(TWO_PI);
- float speed = random(0.5,4);
- velocity = new PVector(cos(a), sin(a));
- velocity.mult(speed);
- lifespan = 255;
- part.resetMatrix();
- part.translate(x, y);
- }
-
- boolean isDead() {
- if (lifespan < 0) {
- return true;
- } else {
- return false;
- }
- }
-
-
- public void update() {
- lifespan = lifespan - 1;
- velocity.add(gravity);
-
- part.setTint(color(255,lifespan));
- part.translate(velocity.x, velocity.y);
- }
-}
diff --git a/android/examples/Demos/Graphics/Particles/ParticleSystem.pde b/android/examples/Demos/Graphics/Particles/ParticleSystem.pde
deleted file mode 100644
index 0d164dcd70..0000000000
--- a/android/examples/Demos/Graphics/Particles/ParticleSystem.pde
+++ /dev/null
@@ -1,36 +0,0 @@
-class ParticleSystem {
- ArrayList particles;
-
- PShape particleShape;
-
- ParticleSystem(int n) {
- particles = new ArrayList();
- particleShape = createShape(PShape.GROUP);
-
- for (int i = 0; i < n; i++) {
- Particle p = new Particle();
- particles.add(p);
- particleShape.addChild(p.getShape());
- }
- }
-
- void update() {
- for (Particle p : particles) {
- p.update();
- }
- }
-
- void setEmitter(float x, float y) {
- for (Particle p : particles) {
- if (p.isDead()) {
- p.rebirth(x, y);
- }
- }
- }
-
- void display() {
-
- shape(particleShape);
- }
-}
-
diff --git a/android/examples/Demos/Graphics/Particles/Particles.pde b/android/examples/Demos/Graphics/Particles/Particles.pde
deleted file mode 100644
index 4d9cd03e60..0000000000
--- a/android/examples/Demos/Graphics/Particles/Particles.pde
+++ /dev/null
@@ -1,30 +0,0 @@
-// Particles, by Daniel Shiffman
-
-ParticleSystem ps;
-PImage sprite;
-
-void setup() {
- size(displayWidth, displayHeight, P2D);
- orientation(LANDSCAPE);
- sprite = loadImage("sprite.png");
- ps = new ParticleSystem(2000);
-
- // Writing to the depth buffer is disabled to avoid rendering
- // artifacts due to the fact that the particles are semi-transparent
- // but not z-sorted.
- hint(DISABLE_DEPTH_MASK);
-}
-
-void draw () {
- background(0);
- ps.update();
- ps.display();
-
- ps.setEmitter(mouseX,mouseY);
-
- fill(255);
- textSize(16);
- text("Frame rate: " + int(frameRate),10,20);
-}
-
-
diff --git a/android/examples/Demos/Graphics/Particles/data/sprite.png b/android/examples/Demos/Graphics/Particles/data/sprite.png
deleted file mode 100644
index cc0f45cba1..0000000000
Binary files a/android/examples/Demos/Graphics/Particles/data/sprite.png and /dev/null differ
diff --git a/android/examples/Demos/Graphics/Patch/Patch.pde b/android/examples/Demos/Graphics/Patch/Patch.pde
deleted file mode 100644
index 2b11d6f3a1..0000000000
--- a/android/examples/Demos/Graphics/Patch/Patch.pde
+++ /dev/null
@@ -1,162 +0,0 @@
-// Bezier patch By Maritus Watz:
-// http://www.openprocessing.org/sketch/57709
-// Normal calculation added by Andres Colubri
-// Direct port of sample code by Paul Bourke.
-// Original code: http://paulbourke.net/geometry/bezier/
-
-int ni=3, nj=4, RESI=ni*10, RESJ=nj*10;
-PVector outp[][], inp[][];
-PVector normp[][];
-boolean autoNormals = false;
-
-void setup() {
- size(displayWidth, displayHeight, P3D);
- orientation(LANDSCAPE);
- build();
-}
-
-void draw() {
- background(255);
- translate(width/2,height/2);
- lights();
- scale(0.9);
- rotateY(map(mouseX,0,width,-PI,PI));
- rotateX(map(mouseY,0,height,-PI,PI));
-
- noStroke();
- fill(255);
- for(int i=0; i= 1) {
- blend *= nn;
- nn--;
- if (kn > 1) {
- blend /= (double)kn;
- kn--;
- }
- if (nkn > 1) {
- blend /= (double)nkn;
- nkn--;
- }
- }
- if (k > 0)
- blend *= Math.pow(mu, (double)k);
- if (n-k > 0)
- blend *= Math.pow(1-mu, (double)(n-k));
-
- return(blend);
-}
-
-double DBezierBlend(int k, double mu, int n) {
- int nn, kn, nkn;
- double dblendf = 1;
-
- nn = n;
- kn = k;
- nkn = n - k;
-
- while (nn >= 1) {
- dblendf *= nn;
- nn--;
- if (kn > 1) {
- dblendf /= (double)kn;
- kn--;
- }
- if (nkn > 1) {
- dblendf /= (double)nkn;
- nkn--;
- }
- }
-
- double fk = 1;
- double dk = 0;
- double fnk = 1;
- double dnk = 0;
- if (k > 0) {
- fk = Math.pow(mu, (double)k);
- dk = k*Math.pow(mu, (double)k-1);
- }
- if (n-k > 0) {
- fnk = Math.pow(1-mu, (double)(n-k));
- dnk = (k-n)*Math.pow(1-mu, (double)(n-k-1));
- }
- dblendf *= (dk * fnk + fk * dnk);
-
- return(dblendf);
-}
diff --git a/android/examples/Demos/Graphics/Planets/Perlin.pde b/android/examples/Demos/Graphics/Planets/Perlin.pde
deleted file mode 100644
index 20963499d1..0000000000
--- a/android/examples/Demos/Graphics/Planets/Perlin.pde
+++ /dev/null
@@ -1,261 +0,0 @@
-// Implementation of 1D, 2D, and 3D Perlin noise. Based on the
-// C code by Paul Bourke:
-// http://local.wasp.uwa.edu.au/~pbourke/texture_colour/perlin/
-class Perlin {
- int B = 0x100;
- int BM = 0xff;
- int N = 0x1000;
- int NP = 12;
- int NM = 0xfff;
-
- int p[];
- float g3[][];
- float g2[][];
- float g1[];
-
- void normalize2(float v[]) {
- float s = sqrt(v[0] * v[0] + v[1] * v[1]);
- v[0] = v[0] / s;
- v[1] = v[1] / s;
- }
-
- void normalize3(float v[]) {
- float s = sqrt(v[0] * v[0] + v[1] * v[1] + v[2] * v[2]);
- v[0] = v[0] / s;
- v[1] = v[1] / s;
- v[2] = v[2] / s;
- }
-
- float sCurve(float t) {
- return t * t * (3.0 - 2.0 * t);
- }
-
- float at2(float q[], float rx, float ry) {
- return rx * q[0] + ry * q[1];
- }
-
- float at3(float q[], float rx, float ry, float rz) {
- return rx * q[0] + ry * q[1] + rz * q[2];
- }
-
- Perlin() {
- p = new int[B + B + 2];
- g3 = new float[B + B + 2][3];
- g2 = new float[B + B + 2][2];
- g1 = new float[B + B + 2];
-
- init();
- }
-
- void init() {
- int i, j, k;
-
- for (i = 0 ; i < B ; i++) {
- p[i] = i;
- g1[i] = (random(B + B) - B) / B;
-
- for (j = 0 ; j < 2 ; j++)
- g2[i][j] = (random(B + B) - B) / B;
- normalize2(g2[i]);
-
- for (j = 0 ; j < 3 ; j++)
- g3[i][j] = (random(B + B) - B) / B;
- normalize3(g3[i]);
- }
-
- while (0 < --i) {
- k = p[i];
- p[i] = p[j = int(random(B))];
- p[j] = k;
- }
-
- for (i = 0 ; i < B + 2 ; i++) {
- p[B + i] = p[i];
- g1[B + i] = g1[i];
- for (j = 0 ; j < 2 ; j++)
- g2[B + i][j] = g2[i][j];
- for (j = 0 ; j < 3 ; j++)
- g3[B + i][j] = g3[i][j];
- }
- }
-
- float noise1(float[] vec) {
- int bx0, bx1;
- float rx0, rx1, sx, t, u, v;
-
- t = vec[0] + N;
- bx0 = int(t) & BM;
- bx1 = (bx0 + 1) & BM;
- rx0 = t - int(t);
- rx1 = rx0 - 1.0;
-
- sx = sCurve(rx0);
- u = rx0 * g1[p[bx0]];
- v = rx1 * g1[p[bx1]];
-
- return lerp(u, v, sx);
- }
-
- float noise2(float[] vec) {
- int bx0, bx1, by0, by1, b00, b10, b01, b11;
- float rx0, rx1, ry0, ry1, sx, sy, a, b, t, u, v;
- float[] q;
- int i, j;
-
- t = vec[0] + N;
- bx0 = int(t) & BM;
- bx1 = (bx0 + 1) & BM;
- rx0 = t - int(t);
- rx1 = rx0 - 1.0;
-
- t = vec[1] + N;
- by0 = int(t) & BM;
- by1 = (by0 + 1) & BM;
- ry0 = t - int(t);
- ry1 = ry0 - 1.0;
-
- i = p[bx0];
- j = p[bx1];
-
- b00 = p[i + by0];
- b10 = p[j + by0];
- b01 = p[i + by1];
- b11 = p[j + by1];
-
- sx = sCurve(rx0);
- sy = sCurve(ry0);
-
- q = g2[b00];
- u = at2(q, rx0, ry0);
- q = g2[b10];
- v = at2(q, rx1, ry0);
- a = lerp(u, v, sx);
-
- q = g2[b01] ;
- u = at2(q, rx0, ry1);
- q = g2[b11] ;
- v = at2(q, rx1, ry1);
- b = lerp(u, v, sx);
-
- return lerp(a, b, sy);
- }
-
- float noise3(float[] vec) {
- int bx0, bx1, by0, by1, bz0, bz1, b00, b10, b01, b11;
- float rx0, rx1, ry0, ry1, rz0, rz1, sy, sz, a, b, c, d, t, u, v;
- float[] q;
- int i, j;
-
- t = vec[0] + N;
- bx0 = int(t) & BM;
- bx1 = (bx0 + 1) & BM;
- rx0 = t - int(t);
- rx1 = rx0 - 1.0;
-
- t = vec[1] + N;
- by0 = int(t) & BM;
- by1 = (by0 + 1) & BM;
- ry0 = t - int(t);
- ry1 = ry0 - 1.0;
-
- t = vec[2] + N;
- bz0 = int(t) & BM;
- bz1 = (bz0 + 1) & BM;
- rz0 = t - int(t);
- rz1 = rz0 - 1.0;
-
- i = p[bx0];
- j = p[bx1];
-
- b00 = p[i + by0];
- b10 = p[j + by0];
- b01 = p[i + by1];
- b11 = p[j + by1];
-
- t = sCurve(rx0);
- sy = sCurve(ry0);
- sz = sCurve(rz0);
-
- q = g3[b00 + bz0];
- u = at3(q, rx0, ry0, rz0);
- q = g3[b10 + bz0];
- v = at3(q, rx1, ry0, rz0);
- a = lerp(u, v, t);
-
- q = g3[b01 + bz0];
- u = at3(q, rx0, ry1, rz0);
- q = g3[b11 + bz0];
- v = at3(q, rx1, ry1, rz0);
- b = lerp(u, v, t);
-
- c = lerp(a, b, sy);
-
- q = g3[b00 + bz1];
- u = at3(q, rx0, ry0, rz1);
- q = g3[b10 + bz1];
- v = at3(q, rx1, ry0, rz1);
- a = lerp(u, v, t);
-
- q = g3[b01 + bz1];
- u = at3(q, rx0, ry1, rz1);
- q = g3[b11 + bz1];
- v = at3(q, rx1, ry1, rz1);
- b = lerp(u, v, t);
-
- d = lerp(a, b, sy);
-
- return lerp(c, d, sz);
- }
-
- // In what follows "nalpha" is the weight when the sum is formed.
- // Typically it is 2, as this approaches 1 the function is noisier.
- // "nbeta" is the harmonic scaling/spacing, typically 2. n is the
- // number of harmonics added up in the final result. Higher number
- // results in more detailed noise.
-
- float noise1D(float x, float nalpha, float nbeta, int n) {
- float val, sum = 0;
- float v[] = {x};
- float nscale = 1;
-
- for (int i = 0; i < n; i++) {
- val = noise1(v);
- sum += val / nscale;
- nscale *= nalpha;
- v[0] *= nbeta;
- }
- return sum;
- }
-
- float noise2D(float x, float y, float nalpha, float nbeta, int n) {
- float val,sum = 0;
- float v[] = {x, y};
- float nscale = 1;
-
- for (int i = 0; i < n; i++) {
- val = noise2(v);
- sum += val / nscale;
- nscale *= nalpha;
- v[0] *= nbeta;
- v[1] *= nbeta;
- }
- return sum;
- }
-
- float noise3D(float x, float y, float z, float nalpha, float nbeta, int n) {
- float val, sum = 0;
- float v[] = {x, y, z};
- float nscale = 1;
-
- for (int i = 0 ; i < n; i++) {
- val = noise3(v);
- sum += val / nscale;
- nscale *= nalpha;
- v[0] *= nbeta;
- v[1] *= nbeta;
- v[2] *= nbeta;
- }
- return sum;
- }
-}
-
diff --git a/android/examples/Demos/Graphics/Planets/Planets.pde b/android/examples/Demos/Graphics/Planets/Planets.pde
deleted file mode 100644
index 7c74f9738b..0000000000
--- a/android/examples/Demos/Graphics/Planets/Planets.pde
+++ /dev/null
@@ -1,123 +0,0 @@
-// Planets, by Andres Colubri
-//
-// Sun and mercury textures from http://planetpixelemporium.com
-// Star field picture from http://www.galacticimages.com/
-
-PImage starfield;
-
-PShape sun;
-PImage suntex;
-
-PShape planet1;
-PImage surftex1;
-PImage cloudtex;
-
-PShape planet2;
-PImage surftex2;
-
-void setup() {
- size(800, 480, P3D);
- orientation(LANDSCAPE);
-
- starfield = loadImage("starfield.jpg");
- suntex = loadImage("sun.jpg");
- surftex1 = loadImage("planet.jpg");
-
- // We need trilinear sampling for this texture so it looks good
- // even when rendered very small.
- //PTexture.Parameters params1 = PTexture.newParameters(ARGB, TRILINEAR);
- surftex2 = loadImage("mercury.jpg");
-
- /*
- // The clouds texture will "move" having the values of its u
- // texture coordinates displaced by adding a constant increment
- // in each frame. This requires REPEAT wrapping mode so texture
- // coordinates can be larger than 1.
- //PTexture.Parameters params2 = PTexture.newParameters();
- //params2.wrapU = REPEAT;
- cloudtex = createImage(512, 256);
-
- // Using 3D Perlin noise to generate a clouds texture that is seamless on
- // its edges so it can be applied on a sphere.
- cloudtex.loadPixels();
- Perlin perlin = new Perlin();
- for (int j = 0; j < cloudtex.height; j++) {
- for (int i = 0; i < cloudtex.width; i++) {
- // The angle values corresponding to each u,v pair:
- float u = float(i) / cloudtex.width;
- float v = float(j) / cloudtex.height;
- float phi = map(u, 0, 1, TWO_PI, 0);
- float theta = map(v, 0, 1, -HALF_PI, HALF_PI);
- // The x, y, z point corresponding to these angles:
- float x = cos(phi) * cos(theta);
- float y = sin(theta);
- float z = sin(phi) * cos(theta);
- float n = perlin.noise3D(x, y, z, 1.2, 2, 8);
- cloudtex.pixels[j * cloudtex.width + i] = color(255, 255, 255, 255 * n * n);
- }
- }
- cloudtex.updatePixels();
- */
-
- noStroke();
- fill(255);
- sphereDetail(30);
-
- sun = createShape(SPHERE, 150);
- sun.texture(suntex);
-
- planet1 = createShape(SPHERE, 150);
- planet1.texture(surftex1);
-
- planet2 = createShape(SPHERE, 50);
- planet2.texture(surftex2);
-}
-
-void draw() {
- // Even we draw a full screen image after this, it is recommended to use
- // background to clear the screen anyways, otherwise A3D will think
- // you want to keep each drawn frame in the framebuffer, which results in
- // slower rendering.
- background(0);
-
- // Disabling writing to the depth mask so the
- // background image doesn't occludes any 3D object.
- hint(DISABLE_DEPTH_MASK);
- image(starfield, 0, 0, width, height);
- hint(ENABLE_DEPTH_MASK);
-
- /*
- // Displacing the u texture coordinate of layer 1 in planet
- // so it creates the effect of moving clouds.
- PShape3D p = (PShape3D)planet1;
- p.loadTexcoords(1);
- for (int i = 0; i < p.getVertexCount(); i++) {
- float u = p.texcoords[2 * i + 0];
- u += 0.002;
- p.texcoords[2 * i + 0] = u;
- }
- p.updateTexcoords();
- */
-
- pushMatrix();
- translate(width/2, height/2, -300);
-
- pushMatrix();
- rotateY(PI * frameCount / 500);
- shape(sun);
- popMatrix();
-
- pointLight(255, 255, 255, 0, 0, 0);
- rotateY(PI * frameCount / 300);
- translate(0, 0, 300);
-
- shape(planet2);
-
- popMatrix();
-
- noLights();
- pointLight(255, 255, 255, 0, 0, -150);
-
- translate(0.75 * width, 0.6 * height, 50);
- shape(planet1);
-}
diff --git a/android/examples/Demos/Graphics/Planets/data/mercury.jpg b/android/examples/Demos/Graphics/Planets/data/mercury.jpg
deleted file mode 100644
index 9bb2c0be0e..0000000000
Binary files a/android/examples/Demos/Graphics/Planets/data/mercury.jpg and /dev/null differ
diff --git a/android/examples/Demos/Graphics/Planets/data/planet.jpg b/android/examples/Demos/Graphics/Planets/data/planet.jpg
deleted file mode 100644
index 8fd33bf9bb..0000000000
Binary files a/android/examples/Demos/Graphics/Planets/data/planet.jpg and /dev/null differ
diff --git a/android/examples/Demos/Graphics/Planets/data/starfield.jpg b/android/examples/Demos/Graphics/Planets/data/starfield.jpg
deleted file mode 100644
index bf190dfb00..0000000000
Binary files a/android/examples/Demos/Graphics/Planets/data/starfield.jpg and /dev/null differ
diff --git a/android/examples/Demos/Graphics/Planets/data/sun.jpg b/android/examples/Demos/Graphics/Planets/data/sun.jpg
deleted file mode 100644
index 46d7beae6c..0000000000
Binary files a/android/examples/Demos/Graphics/Planets/data/sun.jpg and /dev/null differ
diff --git a/android/examples/Demos/Graphics/Ribbons/ArcBall.pde b/android/examples/Demos/Graphics/Ribbons/ArcBall.pde
deleted file mode 100644
index 5c4f74cc23..0000000000
--- a/android/examples/Demos/Graphics/Ribbons/ArcBall.pde
+++ /dev/null
@@ -1,190 +0,0 @@
-// Ariel and V3ga's arcball class with a couple tiny mods by Robert Hodgin
-
-class Arcball {
- float center_x, center_y, radius;
- Vec3 v_down, v_drag;
- Quat q_now, q_down, q_drag;
- Vec3[] axisSet;
- int axis;
- float mxv, myv;
- float x, y;
-
- Arcball(float center_x, float center_y, float radius){
- this.center_x = center_x;
- this.center_y = center_y;
- this.radius = radius;
-
- v_down = new Vec3();
- v_drag = new Vec3();
-
- q_now = new Quat();
- q_down = new Quat();
- q_drag = new Quat();
-
- axisSet = new Vec3[] {new Vec3(1.0f, 0.0f, 0.0f), new Vec3(0.0f, 1.0f, 0.0f), new Vec3(0.0f, 0.0f, 1.0f)};
- axis = -1; // no constraints...
- }
-
- void mousePressed(){
- v_down = mouse_to_sphere(mouseX, mouseY);
- q_down.set(q_now);
- q_drag.reset();
- }
-
- void mouseDragged(){
- v_drag = mouse_to_sphere(mouseX, mouseY);
- q_drag.set(Vec3.dot(v_down, v_drag), Vec3.cross(v_down, v_drag));
- }
-
- void run(){
- q_now = Quat.mul(q_drag, q_down);
- applyQuat2Matrix(q_now);
-
- x += mxv;
- y += myv;
- mxv -= mxv * .01;
- myv -= myv * .01;
- }
-
- Vec3 mouse_to_sphere(float x, float y){
- Vec3 v = new Vec3();
- v.x = (x - center_x) / radius;
- v.y = (y - center_y) / radius;
-
- float mag = v.x * v.x + v.y * v.y;
- if (mag > 1.0f){
- v.normalize();
- } else {
- v.z = sqrt(1.0f - mag);
- }
-
- return (axis == -1) ? v : constrain_vector(v, axisSet[axis]);
- }
-
- Vec3 constrain_vector(Vec3 vector, Vec3 axis){
- Vec3 res = new Vec3();
- res.sub(vector, Vec3.mul(axis, Vec3.dot(axis, vector)));
- res.normalize();
- return res;
- }
-
- void applyQuat2Matrix(Quat q){
- // instead of transforming q into a matrix and applying it...
-
- float[] aa = q.getValue();
- rotate(aa[0], aa[1], aa[2], aa[3]);
- }
-}
-
-static class Vec3{
- float x, y, z;
-
- Vec3(){
- }
-
- Vec3(float x, float y, float z){
- this.x = x;
- this.y = y;
- this.z = z;
- }
-
- void normalize(){
- float length = length();
- x /= length;
- y /= length;
- z /= length;
- }
-
- float length(){
- return (float) Math.sqrt(x * x + y * y + z * z);
- }
-
- static Vec3 cross(Vec3 v1, Vec3 v2){
- Vec3 res = new Vec3();
- res.x = v1.y * v2.z - v1.z * v2.y;
- res.y = v1.z * v2.x - v1.x * v2.z;
- res.z = v1.x * v2.y - v1.y * v2.x;
- return res;
- }
-
- static float dot(Vec3 v1, Vec3 v2){
- return v1.x * v2.x + v1.y * v2.y + v1.z * v2.z;
- }
-
- static Vec3 mul(Vec3 v, float d){
- Vec3 res = new Vec3();
- res.x = v.x * d;
- res.y = v.y * d;
- res.z = v.z * d;
- return res;
- }
-
- void sub(Vec3 v1, Vec3 v2){
- x = v1.x - v2.x;
- y = v1.y - v2.y;
- z = v1.z - v2.z;
- }
-}
-
-static class Quat{
- float w, x, y, z;
-
- Quat(){
- reset();
- }
-
- Quat(float w, float x, float y, float z){
- this.w = w;
- this.x = x;
- this.y = y;
- this.z = z;
- }
-
- void reset(){
- w = 1.0f;
- x = 0.0f;
- y = 0.0f;
- z = 0.0f;
- }
-
- void set(float w, Vec3 v){
- this.w = w;
- x = v.x;
- y = v.y;
- z = v.z;
- }
-
- void set(Quat q){
- w = q.w;
- x = q.x;
- y = q.y;
- z = q.z;
- }
-
- static Quat mul(Quat q1, Quat q2){
- Quat res = new Quat();
- res.w = q1.w * q2.w - q1.x * q2.x - q1.y * q2.y - q1.z * q2.z;
- res.x = q1.w * q2.x + q1.x * q2.w + q1.y * q2.z - q1.z * q2.y;
- res.y = q1.w * q2.y + q1.y * q2.w + q1.z * q2.x - q1.x * q2.z;
- res.z = q1.w * q2.z + q1.z * q2.w + q1.x * q2.y - q1.y * q2.x;
- return res;
- }
-
- float[] getValue(){
- // transforming this quat into an angle and an axis vector...
-
- float[] res = new float[4];
-
- float sa = (float) Math.sqrt(1.0f - w * w);
- if (sa < EPSILON){
- sa = 1.0f;
- }
-
- res[0] = (float) Math.acos(w) * 2.0f;
- res[1] = x / sa;
- res[2] = y / sa;
- res[3] = z / sa;
-
- return res;
- }
-}
diff --git a/android/examples/Demos/Graphics/Ribbons/BSpline.pde b/android/examples/Demos/Graphics/Ribbons/BSpline.pde
deleted file mode 100644
index b622e84982..0000000000
--- a/android/examples/Demos/Graphics/Ribbons/BSpline.pde
+++ /dev/null
@@ -1,307 +0,0 @@
-final int MAX_BEZIER_ORDER = 10; // Maximum curve order.
-
-final float[][] BSplineMatrix = {
- {-1.0/6.0, 1.0/2.0, -1.0/2.0, 1.0/6.0},
- { 1.0/2.0, -1.0, 1.0/2.0, 0.0},
- {-1.0/2.0, 0.0, 1.0/2.0, 0.0},
- { 1.0/6.0, 2.0/3.0, 1.0/6.0, 0.0}
-};
-
-// The element(i, n) of this array contains the binomial coefficient
-// C(i, n) = n!/(i!(n-i)!)
-final int[][] BinomialCoefTable = {
- {1, 1, 1, 1, 1, 1, 1, 1, 1, 1},
- {1, 2, 3, 4, 5, 6, 7, 8, 9, 10},
- {0, 1, 3, 6, 10, 15, 21, 28, 36, 45},
- {0, 0, 1, 4, 10, 20, 35, 56, 84, 120},
- {0, 0, 0, 1, 5, 15, 35, 70, 126, 210},
- {0, 0, 0, 0, 1, 6, 21, 56, 126, 252},
- {0, 0, 0, 0, 0, 1, 7, 28, 84, 210},
- {0, 0, 0, 0, 0, 0, 1, 8, 36, 120},
- {0, 0, 0, 0, 0, 0, 0, 1, 9, 45},
- {0, 0, 0, 0, 0, 0, 0, 0, 1, 10},
- {0, 0, 0, 0, 0, 0, 0, 0, 0, 1}
-};
-
-// The element of this(i, j) of this table contains(i/10)^(3-j).
-final float[][] TVectorTable = {
-// t^3, t^2, t^1, t^0
- { 0, 0, 0, 1}, // t = 0.0
- {0.001, 0.01, 0.1, 1}, // t = 0.1
- {0.008, 0.04, 0.2, 1}, // t = 0.2
- {0.027, 0.09, 0.3, 1}, // t = 0.3
- {0.064, 0.16, 0.4, 1}, // t = 0.4
- {0.125, 0.25, 0.5, 1}, // t = 0.5
- {0.216, 0.36, 0.6, 1}, // t = 0.6
- {0.343, 0.49, 0.7, 1}, // t = 0.7
- {0.512, 0.64, 0.8, 1}, // u = 0.8
- {0.729, 0.81, 0.9, 1}, // t = 0.9
- { 1, 1, 1, 1} // t = 1.0
-};
-
-// The element of this(i, j) of this table contains(3-j)*(i/10)^(2-j) if
-// j < 3, 0 otherwise.
-final float[][] DTVectorTable = {
-// 3t^2, 2t^1, t^0
- { 0, 0, 1, 0}, // t = 0.0
- {0.03, 0.2, 1, 0}, // t = 0.1
- {0.12, 0.4, 1, 0}, // t = 0.2
- {0.27, 0.6, 1, 0}, // t = 0.3
- {0.48, 0.8, 1, 0}, // t = 0.4
- {0.75, 1.0, 1, 0}, // t = 0.5
- {1.08, 1.2, 1, 0}, // t = 0.6
- {1.47, 1.4, 1, 0}, // t = 0.7
- {1.92, 1.6, 1, 0}, // t = 0.8
- {2.43, 1.8, 1, 0}, // t = 0.9
- { 3, 2, 1, 0} // t = 1.0
-};
-
-abstract class Curve3D {
- abstract void feval(float t, PVector p);
- abstract void deval(float t, PVector d);
- abstract float fevalX(float t);
- abstract float fevalY(float t);
- abstract float fevalZ(float t);
- abstract float devalX(float t);
- abstract float devalY(float t);
- abstract float devalZ(float t);
-}
-
-abstract class Spline extends Curve3D {
- // The factorial of n.
- int factorial(int n) {
- return n <= 0 ? 1 : n * factorial(n - 1);
- }
-
- // Gives n!/(i!(n-i)!).
- int binomialCoef(int i, int n) {
- if ((i <= MAX_BEZIER_ORDER) && (n <= MAX_BEZIER_ORDER)) return BinomialCoefTable[i][n - 1];
- else return int(factorial(n) / (factorial(i) * factorial(n - i)));
- }
-
- // Evaluates the Berstein polinomial(i, n) at u.
- float bersteinPol(int i, int n, float u) {
- return binomialCoef(i, n) * pow(u, i) * pow(1 - u, n - i);
- }
-
- // The derivative of the Berstein polinomial.
- float dbersteinPol(int i, int n, float u) {
- float s1, s2;
- if (i == 0) s1 = 0;
- else s1 = i * pow(u, i-1) * pow(1 - u, n - i);
- if (n == i) s2 = 0;
- else s2 = -(n - i) * pow(u, i) * pow(1 - u, n - i - 1);
- return binomialCoef(i, n) *(s1 + s2);
- }
-}
-
-class BSpline extends Spline {
- // Control points.
- float[][] bsplineCPoints;
-
- // Parameters.
- boolean lookup;
-
- // Auxiliary arrays used in the calculations.
- float[][] M3;
- float[] TVector, DTVector;
-
- // Point and tangent vectors.
- float[] pt, tg;
-
- BSpline() {
- initParameters(true);
- }
-
- BSpline(boolean t) {
- initParameters(t);
- }
-
- // Sets lookup table use.
- void initParameters(boolean t) {
- bsplineCPoints = new float[4][3];
- TVector = new float[4];
- DTVector = new float[4];
- M3 = new float[4][3];
- pt = new float[3];
- tg = new float[3];
- lookup = t;
- }
-
- // Sets n-th control point.
- void setCPoint(int n, PVector P) {
- bsplineCPoints[n][0] = P.x;
- bsplineCPoints[n][1] = P.y;
- bsplineCPoints[n][2] = P.z;
- updateMatrix3();
- }
-
- // Gets n-th control point.
- void getCPoint(int n, PVector P) {
- P.set(bsplineCPoints[n]);
- }
-
- // Replaces the current B-spline control points(0, 1, 2) with(1, 2, 3). This
- // is used when a new spline is to be joined to the recently drawn.
- void shiftBSplineCPoints() {
- for (int i = 0; i < 3; i++) {
- bsplineCPoints[0][i] = bsplineCPoints[1][i];
- bsplineCPoints[1][i] = bsplineCPoints[2][i];
- bsplineCPoints[2][i] = bsplineCPoints[3][i];
- }
- updateMatrix3();
- }
-
- void copyCPoints(int n_source, int n_dest) {
- for (int i = 0; i < 3; i++) {
- bsplineCPoints[n_dest][i] = bsplineCPoints[n_source][i];
- }
- }
-
- // Updates the temporal matrix used in order 3 calculations.
- void updateMatrix3() {
- float s;
- int i, j, k;
- for(i = 0; i < 4; i++) {
- for(j = 0; j < 3; j++) {
- s = 0;
- for(k = 0; k < 4; k++) s += BSplineMatrix[i][k] * bsplineCPoints[k][j];
- M3[i][j] = s;
- }
- }
- }
-
- void feval(float t, PVector p) {
- evalPoint(t);
- p.set(pt);
- }
-
- void deval(float t, PVector d) {
- evalTangent(t);
- d.set(tg);
- }
-
- float fevalX(float t) {
- evalPoint(t);
- return pt[0];
- }
-
- float fevalY(float t) {
- evalPoint(t);
- return pt[1];
- }
-
- float fevalZ(float t) {
- evalPoint(t);
- return pt[2];
- }
-
- float devalX(float t) {
- evalTangent(t);
- return tg[0];
- }
-
- float devalY(float t) {
- evalTangent(t);
- return tg[1];
- }
-
- float devalZ(float t) {
- evalTangent(t);
- return tg[2];
- }
-
- // Point evaluation.
- void evalPoint(float t) {
- if (lookup) {
- bsplinePointI(int(10 * t));
- } else {
- bsplinePoint(t);
- }
- }
-
- // Tangent evaluation.
- void evalTangent(float t) {
- if (lookup) {
- bsplineTangentI(int(10 * t));
- } else {
- bsplineTangent(t);
- }
- }
-
- // Calculates the point on the cubic spline corresponding to the parameter value t in [0, 1].
- void bsplinePoint(float t) {
- // Q(u) = UVector * BSplineMatrix * BSplineCPoints
-
- float s;
- int i, j, k;
-
- for(i = 0; i < 4; i++) {
- TVector[i] = pow(t, 3 - i);
- }
-
- for(j = 0; j < 3; j++) {
- s = 0;
- for(k = 0; k < 4; k++) {
- s += TVector[k] * M3[k][j];
- }
- pt[j] = s;
- }
- }
-
- // Calculates the tangent vector of the spline at t.
- void bsplineTangent(float t) {
- // Q(u) = DTVector * BSplineMatrix * BSplineCPoints
-
- float s;
- int i, j, k;
-
- for(i = 0; i < 4; i++) {
- if (i < 3) {
- DTVector[i] = (3 - i) * pow(t, 2 - i);
- } else {
- DTVector[i] = 0;
- }
- }
-
- for(j = 0; j < 3; j++) {
- s = 0;
- for(k = 0; k < 4; k++) {
- s += DTVector[k] * M3[k][j];
- }
- tg[j] = s;
- }
- }
-
- // Gives the point on the cubic spline corresponding to t/10(using the lookup table).
- void bsplinePointI(int t) {
- // Q(u) = TVectorTable[u] * BSplineMatrix * BSplineCPoints
-
- float s;
- int j, k;
-
- for(j = 0; j < 3; j++) {
- s = 0;
- for(k = 0; k < 4; k++) {
- s += TVectorTable[t][k] * M3[k][j];
- }
- pt[j] = s;
- }
- }
-
- // Calulates the tangent vector of the spline at t/10.
- void bsplineTangentI(int t) {
- // Q(u) = DTVectorTable[u] * BSplineMatrix * BSplineCPoints
-
- float s;
- int j, k;
-
- for(j = 0; j < 3; j++) {
- s = 0;
- for(k = 0; k < 4; k++) {
- s += DTVectorTable[t][k] * M3[k][j];
- }
- tg[j] = s;
- }
- }
-}
diff --git a/android/examples/Demos/Graphics/Ribbons/Geometry.pde b/android/examples/Demos/Graphics/Ribbons/Geometry.pde
deleted file mode 100644
index 302b0f4131..0000000000
--- a/android/examples/Demos/Graphics/Ribbons/Geometry.pde
+++ /dev/null
@@ -1,497 +0,0 @@
-BSpline splineSide1;
-BSpline splineCenter;
-BSpline splineSide2;
-PVector flipTestV;
-int uspacing;
-
-int HELIX = 0;
-int STRAND = 1;
-int COIL = 2;
-int LHANDED = -1;
-int RHANDED = 1;
-
-void createRibbonModel(ArrayList residues, PShape model, ArrayList trj) {
- // For line ribbons
- ArrayList vertices0 = new ArrayList();
- ArrayList vertices1 = new ArrayList();
- ArrayList vertices2 = new ArrayList();
-
- // For flat ribbons
- ArrayList vertices = new ArrayList();
- ArrayList normals = new ArrayList();
-
- if (ribbonDetail == 1) uspacing = 10;
- else if (ribbonDetail == 2) uspacing = 5;
- else if (ribbonDetail == 3) uspacing = 2;
- else uspacing = 1;
-
- flipTestV = new PVector();
- splineSide1 = new BSpline(false);
- splineCenter = new BSpline(false);
- splineSide2 = new BSpline(false);
-
- int[] ss = new int[residues.size()];
- int[] handness = new int[residues.size()];
-
- calculateSecStr(residues, ss, handness);
-
- for (int i = 0; i < residues.size(); i++) {
- constructControlPoints(residues, i, ss[i], handness[i]);
-
- if (renderMode == 0) {
- generateSpline(0, vertices0);
- generateSpline(1, vertices1);
- generateSpline(2, vertices2);
- }
- else {
- generateFlatRibbon(vertices, normals);
- }
- }
-
- if (renderMode == 0) {
- model = createShape();
- model.beginShape();
- model.stroke(ribbonColor);
- model.noFill();
- model.beginContour();
- for (int i = 0; i < vertices0.size(); i++) {
- PVector posVec = (PVector)vertices0.get(i);
- model.vertex(posVec.x, posVec.y, posVec.z);
- }
- model.endContour();
- model.beginContour();
- for (int i = 0; i < vertices1.size(); i++) {
- PVector posVec = (PVector)vertices1.get(i);
- model.vertex(posVec.x, posVec.y, posVec.z);
- }
- model.endContour();
- model.beginContour();
- for (int i = 0; i < vertices2.size(); i++) {
- PVector posVec = (PVector)vertices2.get(i);
- model.vertex(posVec.x, posVec.y, posVec.z);
- }
- model.endContour();
- model.endShape(OPEN);
- } else {
- // The ribbon construction is fairly inneficient here, since
- // it could use triangle strips instead to avoid duplicating
- // shared vertices...
- model = createShape();
- model.beginShape(TRIANGLES);
- model.noStroke();
- model.fill(ribbonColor);
- for (int i = 0; i < vertices.size(); i++) {
- PVector posVec = (PVector)vertices.get(i);
- PVector normVec = (PVector)normals.get(i);
- model.normal(-normVec.x, -normVec.y, -normVec.z);
- model.vertex(posVec.x, posVec.y, posVec.z);
- }
- model.endShape();
- }
-
- trj.add(model);
-
- if (renderMode == 0) {
- int totCount = vertices0.size() + vertices1.size() + vertices2.size();
- println("Adding new model with " + totCount + " vertices.");
- } else {
- println("Adding new model with " + vertices.size() + " vertices.");
- }
-}
-
-float calculateGyrRadius(ArrayList atoms) {
- PVector ati, atj;
- float dx, dy, dz;
- float r = 0;
- for (int i = 0; i < atoms.size(); i++) {
- ati = (PVector)atoms.get(i);
- for (int j = i + 1; j < atoms.size(); j++) {
- atj = (PVector)atoms.get(j);
-
- dx = ati.x - atj.x;
- dy = ati.y - atj.y;
- dz = ati.z - atj.z;
- r += dx * dx + dy * dy + dz * dz;
- }
- }
- return sqrt(r) / (atoms.size() + 1);
-}
-
-// Does a cheap and dirty secondary structure assignment to the protein
-// residues given in the array.
-void calculateSecStr(ArrayList residues, int[] ss, int[] handness) {
- PVector c0, n1, ca1, c1, n2;
- HashMap res0, res1, res2;
- int n = residues.size();
-
- float[] phi = new float[n];
- float[] psi = new float[n];
-
- for (int i = 0; i < n; i++) {
- if (i == 0 || i == n - 1) {
- phi[i] = 90;
- psi[i] = 90;
- } else {
- res0 = (HashMap)residues.get(i - 1);
- res1 = (HashMap)residues.get(i);
- res2 = (HashMap)residues.get(i + 1);
-
- c0 = (PVector)res0.get("C");
- n1 = (PVector)res1.get("N");
- ca1 = (PVector)res1.get("CA");
- c1 = (PVector)res1.get("C");
- n2 = (PVector)res2.get("N");
-
- phi[i] = calculateTorsionalAngle(c0, n1, ca1, c1);
- psi[i] = calculateTorsionalAngle(n1, ca1, c1, n2);
- }
- }
-
- int firstHelix = 0;
- int nconsRHelix = 0;
- int nconsLHelix = 0;
- int firstStrand = 0;
- int nconsStrand = 0;
- for (int i = 0; i < n; i++) {
- // Right-handed helix
- if ((dist(phi[i], psi[i], -60, -45) < 30) && (i < n - 1)) {
- if (nconsRHelix == 0) firstHelix = i;
- nconsRHelix++;
- }
- else {
- if (3 <= nconsRHelix) {
- for (int k = firstHelix; k < i; k++) {
- ss[k] = HELIX;
- handness[k] = RHANDED;
- }
- }
- nconsRHelix = 0;
- }
-
- // Left-handed helix
- if ((dist(phi[i], psi[i], +60, +45) < 30) && (i < n - 1)) {
- if (nconsLHelix == 0) firstHelix = i;
- nconsLHelix++;
-
- } else {
- if (3 <= nconsLHelix) {
- for (int k = firstHelix; k < i; k++) {
- ss[k] = HELIX;
- handness[k] = LHANDED;
- }
- }
- nconsLHelix = 0;
- }
-
- // Strand
- if ((dist(phi[i], psi[i], -110, +130) < 30) && (i < n - 1)) {
- if (nconsStrand == 0) firstStrand = i;
- nconsStrand++;
- } else {
- if (2 <= nconsStrand) {
- for (int k = firstStrand; k < i; k++) {
- ss[k] = STRAND;
- handness[k] = RHANDED;
-
- }
- }
- nconsStrand = 0;
- }
-
- ss[i] = COIL;
- handness[i] = RHANDED;
- }
-}
-
-// Calculates the torsional angle defined by four atoms with positions at0, at1, at2 and at3.
-float calculateTorsionalAngle(PVector at0, PVector at1, PVector at2, PVector at3) {
- PVector r01 = PVector.sub(at0, at1);
- PVector r32 = PVector.sub(at3, at2);
- PVector r12 = PVector.sub(at1, at2);
-
- PVector p = r12.cross(r01);
- PVector q = r12.cross(r32);
- PVector r = r12.cross(q);
-
- float u = q.dot(q);
- float v = r.dot(r);
-
- float a;
- if (u <= 0.0 || v <= 0.0) {
- a = 360.0;
- } else {
- float u1 = p.dot(q); // u1 = p * q
- float v1 = p.dot(r); // v1 = p * r
-
- u = u1 / sqrt(u);
- v = v1 / sqrt(v);
-
- if (abs(u) > 0.01 || abs(v) > 0.01) a = degrees(atan2(v, u));
- else a = 360.0;
- }
- return a;
-}
-
-void generateSpline(int n, ArrayList vertices) {
- int ui;
- float u;
- PVector v0, v1;
-
- v1 = new PVector();
-
- if (n == 0) splineSide1.feval(0, v1);
- else if (n == 1) splineCenter.feval(0, v1);
- else splineSide2.feval(0, v1);
- vertices.add(new PVector(v1.x, v1.y, v1.z));
-
- for (ui = 1; ui <= 10; ui ++) {
- if (ui % uspacing == 0) {
- u = 0.1 * ui;
-
- if (n == 0) splineSide1.feval(u, v1);
- else if (n == 1) splineCenter.feval(u, v1);
- else splineSide2.feval(u, v1);
-
- vertices.add(new PVector(v1.x, v1.y, v1.z));
- }
- }
-}
-
-void generateFlatRibbon(ArrayList vertices, ArrayList normals) {
- PVector CentPoint0, CentPoint1;
- PVector Sid1Point0, Sid1Point1;
- PVector Sid2Point0, Sid2Point1;
- PVector Transversal, Tangent;
- PVector Normal0, Normal1;
- int ui;
- float u;
-
- CentPoint0 = new PVector();
- CentPoint1 = new PVector();
- Sid1Point0 = new PVector();
- Sid1Point1 = new PVector();
- Sid2Point0 = new PVector();
- Sid2Point1 = new PVector();
- Transversal = new PVector();
- Tangent = new PVector();
- Normal0 = new PVector();
- Normal1 = new PVector();
-
- // The initial geometry is generated.
- splineSide1.feval(0, Sid1Point1);
- splineCenter.feval(0, CentPoint1);
- splineSide2.feval(0, Sid2Point1);
-
- // The tangents at the three previous points are the same.
- splineSide2.deval(0, Tangent);
-
- // Vector transversal to the ribbon.
- Transversal = PVector.sub(Sid1Point1, Sid2Point1);
-
- // The normal is calculated.
- Normal1 = Transversal.cross(Tangent);
- Normal1.normalize();
-
- for (ui = 1; ui <= 10; ui ++) {
- if (ui % uspacing == 0) {
- u = 0.1 * ui;
-
- // The geometry of the previous iteration is saved.
- Sid1Point0.set(Sid1Point1);
- CentPoint0.set(CentPoint1);
- Sid2Point0.set(Sid2Point1);
- Normal0.set(Normal1);
-
- // The new geometry is generated.
- splineSide1.feval(u, Sid1Point1);
- splineCenter.feval(u, CentPoint1);
- splineSide2.feval(u, Sid2Point1);
-
- // The tangents at the three previous points are the same.
- splineSide2.deval(u, Tangent);
- // Vector transversal to the ribbon.
- Transversal = PVector.sub(Sid1Point1, Sid2Point1);
- // The normal is calculated.
- Normal1 = Transversal.cross(Tangent);
- Normal1.normalize();
-
- // The (Sid1Point0, Sid1Point1, CentPoint1) triangle is added.
- vertices.add(new PVector(Sid1Point0.x, Sid1Point0.y, Sid1Point0.z));
- normals.add(new PVector(Normal0.x, Normal0.y, Normal0.z));
-
- vertices.add(new PVector(Sid1Point1.x, Sid1Point1.y, Sid1Point1.z));
- normals.add(new PVector(Normal1.x, Normal1.y, Normal1.z));
-
- vertices.add(new PVector(CentPoint1.x, CentPoint1.y, CentPoint1.z));
- normals.add(new PVector(Normal1.x, Normal1.y, Normal1.z));
-
- // The (Sid1Point0, CentPoint1, CentPoint0) triangle is added.
- vertices.add(new PVector(Sid1Point0.x, Sid1Point0.y, Sid1Point0.z));
- normals.add(new PVector(Normal0.x, Normal0.y, Normal0.z));
-
- vertices.add(new PVector(CentPoint1.x, CentPoint1.y, CentPoint1.z));
- normals.add(new PVector(Normal1.x, Normal1.y, Normal1.z));
-
- vertices.add(new PVector(CentPoint0.x, CentPoint0.y, CentPoint0.z));
- normals.add(new PVector(Normal0.x, Normal0.y, Normal0.z));
-
- // (Sid2Point0, Sid2Point1, CentPoint1) triangle is added.
- vertices.add(new PVector(Sid2Point0.x, Sid2Point0.y, Sid2Point0.z));
- normals.add(new PVector(Normal0.x, Normal0.y, Normal0.z));
-
- vertices.add(new PVector(Sid2Point1.x, Sid2Point1.y, Sid2Point1.z));
- normals.add(new PVector(Normal1.x, Normal1.y, Normal1.z));
-
- vertices.add(new PVector(CentPoint1.x, CentPoint1.y, CentPoint1.z));
- normals.add(new PVector(Normal1.x, Normal1.y, Normal1.z));
-
- // (Sid2Point0, CentPoint1, CentPoint0) triangle is added.
- vertices.add(new PVector(Sid2Point0.x, Sid2Point0.y, Sid2Point0.z));
- normals.add(new PVector(Normal0.x, Normal0.y, Normal0.z));
-
- vertices.add(new PVector(CentPoint1.x, CentPoint1.y, CentPoint1.z));
- normals.add(new PVector(Normal1.x, Normal1.y, Normal1.z));
-
- vertices.add(new PVector(CentPoint0.x, CentPoint0.y, CentPoint0.z));
- normals.add(new PVector(Normal0.x, Normal0.y, Normal0.z));
- }
- }
-}
-
-/******************************************************************************
- * The code in the following three functions is based in the method introduced
- * in this paper:
- * "Algorithm for ribbon models of proteins."
- * Authors: Mike Carson and Charles E. Bugg
- * Published in: J.Mol.Graphics 4, pp. 121-122 (1986)
- ******************************************************************************/
-
-// Shifts the control points one place to the left.
-void shiftControlPoints() {
- splineSide1.shiftBSplineCPoints();
- splineCenter.shiftBSplineCPoints();
- splineSide2.shiftBSplineCPoints();
-}
-
-// Adds a new control point to the arrays CPCenter, CPRight and CPLeft
-void addControlPoints(PVector ca0, PVector ox0, PVector ca1, int ss, int handness) {
- PVector A, B, C, D, p0, cpt0, cpt1, cpt2;
-
- A = PVector.sub(ca1, ca0);
- B = PVector.sub(ox0, ca0);
-
- // Vector normal to the peptide plane (pointing outside in the case of the
- // alpha helix).
- C = A.cross(B);
-
- // Vector contained in the peptide plane (perpendicular to its direction).
- D = C.cross(A);
-
- // Normalizing vectors.
- C.normalize();
- D.normalize();
-
- // Flipping test (to avoid self crossing in the strands).
- if ((ss != HELIX) && (90.0 < degrees(PVector.angleBetween(flipTestV, D)))) {
- // Flip detected. The plane vector is inverted.
- D.mult(-1.0);
- }
-
- // The central control point is constructed.
- cpt0 = linearComb(0.5, ca0, 0.5, ca1);
- splineCenter.setCPoint(3, cpt0);
-
- if (ss == HELIX) {
- // When residue i is contained in a helix, the control point is moved away
- // from the helix axis, along the C direction.
- p0 = new PVector();
- splineCenter.getCPoint(3, p0);
- cpt0 = linearComb(1.0, p0, handness * helixDiam, C);
- splineCenter.setCPoint(3, cpt0);
- }
-
- // The control points for the side ribbons are constructed.
- cpt1 = linearComb(1.0, cpt0, +ribbonWidth[ss], D);
- splineSide1.setCPoint(3, cpt1);
-
- cpt2 = linearComb(1.0, cpt0, -ribbonWidth[ss], D);
- splineSide2.setCPoint(3, cpt2);
-
- // Saving the plane vector (for the flipping test in the next call).
- flipTestV.set(D);
-}
-
-void constructControlPoints(ArrayList residues, int res, int ss, int handness) {
- PVector ca0, ox0, ca1;
- PVector p0, p1, p2, p3;
-
- p1 = new PVector();
- p2 = new PVector();
- p3 = new PVector();
-
- HashMap res0, res1;
-
- res0 = res1 = null;
- if (res == 0) {
- // The control points 2 and 3 are created.
- flipTestV.set(0, 0, 0);
-
- res0 = (HashMap)residues.get(res);
- res1 = (HashMap)residues.get(res + 1);
- ca0 = (PVector)res0.get("CA");
- ox0 = (PVector)res0.get("O");
- ca1 = (PVector)res1.get("CA");
- addControlPoints(ca0, ox0, ca1, ss, handness);
- splineSide1.copyCPoints(3, 2);
- splineCenter.copyCPoints(3, 2);
- splineSide2.copyCPoints(3, 2);
-
- res0 = (HashMap)residues.get(res + 1);
- res1 = (HashMap)residues.get(res + 2);
- ca0 = (PVector)res0.get("CA");
- ox0 = (PVector)res0.get("O");
- ca1 = (PVector)res1.get("CA");
- addControlPoints(ca0, ox0, ca1, ss, handness);
-
- // We still need the two first control points.
- // Moving backwards along the cp_center[2] - cp_center[3] direction.
- splineCenter.getCPoint(2, p2);
- splineCenter.getCPoint(3, p3);
-
- p1 = linearComb(2.0, p2, -1, p3);
- splineCenter.setCPoint(1, p1);
- splineSide1.setCPoint(1, linearComb(1.0, p1, +ribbonWidth[ss], flipTestV));
- splineSide2.setCPoint(1, linearComb(1.0, p1, -ribbonWidth[ss], flipTestV));
-
- p0 = linearComb(2.0, p1, -1, p2);
- splineCenter.setCPoint(0, p0);
- splineSide1.setCPoint(0, linearComb(1.0, p0, +ribbonWidth[ss], flipTestV));
- splineSide2.setCPoint(0, linearComb(1.0, p0, -ribbonWidth[ss], flipTestV));
- } else {
- shiftControlPoints();
- if ((residues.size() - 1 == res) || (residues.size() - 2 == res)) {
- // Moving forward along the cp_center[1] - cp_center[2] direction.
- splineCenter.getCPoint(1, p1);
- splineCenter.getCPoint(2, p2);
-
- p3 = linearComb(2.0, p2, -1, p1);
- splineCenter.setCPoint(3, p3);
- splineSide1.setCPoint(3, linearComb(1.0, p3, +ribbonWidth[ss], flipTestV));
- splineSide2.setCPoint(3, linearComb(1.0, p3, -ribbonWidth[ss], flipTestV));
- } else {
- res0 = (HashMap)residues.get(res + 1);
- res1 = (HashMap)residues.get(res + 2);
- ca0 = (PVector)res0.get("CA");
- ox0 = (PVector)res0.get("O");
- ca1 = (PVector)res1.get("CA");
- addControlPoints(ca0, ox0, ca1, ss, handness);
- }
- }
- splineSide1.updateMatrix3();
- splineCenter.updateMatrix3();
- splineSide2.updateMatrix3();
-}
-
-PVector linearComb(float scalar0, PVector vector0, float scalar1, PVector vector1) {
- return PVector.add(PVector.mult(vector0, scalar0), PVector.mult(vector1, scalar1));
-}
diff --git a/android/examples/Demos/Graphics/Ribbons/PDB.pde b/android/examples/Demos/Graphics/Ribbons/PDB.pde
deleted file mode 100644
index c3daf443b9..0000000000
--- a/android/examples/Demos/Graphics/Ribbons/PDB.pde
+++ /dev/null
@@ -1,115 +0,0 @@
-void readPDB(String filename) {
- String strLines[];
-
- float xmin, xmax, ymin, ymax, zmin, zmax;
-
- String xstr, ystr, zstr;
- float x, y, z;
- int res, res0;
- int nmdl;
- String atstr, resstr;
-
- PShape model;
- ArrayList atoms;
- ArrayList residues;
- HashMap residue;
- PVector v;
- String s;
- strLines = loadStrings(filename);
-
- models = new ArrayList();
-
- xmin = ymin = zmin = 10000;
- xmax = ymax = zmax = -10000;
-
- atoms = null;
- residues = null;
- residue = null;
- model = null;
- res0 = -1;
- nmdl = -1;
- for (int i = 0; i < strLines.length; i++) {
- s = strLines[i];
-
- if (s.startsWith("MODEL") || (s.startsWith("ATOM") && res0 == -1)) {
- nmdl++;
-
- res0 = -1;
-
- atoms = new ArrayList();
- residues = new ArrayList();
- }
-
- if (s.startsWith("ATOM")) {
- atstr = s.substring(12, 15);
- atstr = atstr.trim();
- resstr = s.substring(22, 26);
- resstr = resstr.trim();
- res = parseInt(resstr);
-
- xstr = s.substring(30, 37);
- xstr = xstr.trim();
- ystr = s.substring(38, 45);
- ystr = ystr.trim();
- zstr = s.substring(46, 53);
- zstr = zstr.trim();
-
- x = scaleFactor * parseFloat(xstr);
- y = scaleFactor * parseFloat(ystr);
- z = scaleFactor * parseFloat(zstr);
- v = new PVector(x, y, z);
-
- xmin = min(xmin, x);
- xmax = max(xmax, x);
-
- ymin = min(ymin, y);
- ymax = max(ymax, y);
-
- zmin = min(zmin, z);
- zmax = max(zmax, z);
-
- atoms.add(v);
-
- if (res0 != res) {
- if (residue != null) residues.add(residue);
- residue = new HashMap();
- }
- residue.put(atstr, v);
-
- res0 = res;
- }
-
- if (s.startsWith("ENDMDL") || s.startsWith("TER")) {
- if (residue != null) residues.add(residue);
-
- createRibbonModel(residues, model, models);
- float rgyr = calculateGyrRadius(atoms);
-
- res0 = -1;
- residue = null;
- atoms = null;
- residues = null;
- }
- }
-
- if (residue != null) {
- if (residue != null) residues.add(residue);
-
- createRibbonModel(residues, model, models);
- float rgyr = calculateGyrRadius(atoms);
-
- atoms = null;
- residues = null;
- }
-
- // Centering models at (0, 0, 0).
- float dx = -0.5f * (xmin + xmax);
- float dy = -0.5f * (ymin + ymax);
- float dz = -0.5f * (zmin + zmax);
- for (int n = 0; n < models.size(); n++) {
- model = (PShape) models.get(n);
- model.translate(dx, dy, dz);
- }
-
- println("Loaded PDB file with " + models.size() + " models.");
-}
diff --git a/android/examples/Demos/Graphics/Ribbons/Ribbons.pde b/android/examples/Demos/Graphics/Ribbons/Ribbons.pde
deleted file mode 100644
index 69b3f77b0f..0000000000
--- a/android/examples/Demos/Graphics/Ribbons/Ribbons.pde
+++ /dev/null
@@ -1,52 +0,0 @@
-// Ribbons, by Andres Colubri
-// ArcBall class by Ariel, V3ga and Robert Hodgin (flight404)
-// This sketch loads 3D atomic coordinates of a protein molecule
-// from a file in PDB format (http://www.pdb.org/) and displays
-// the structure using a ribbon representation.
-
-String pdbFile = "4HHB.pdb"; // PDB file to read
-//String pdbFile = "1CBS.pdb";
-//String pdbFile = "2POR.pdb";
-
-// Some parameters to control the visual appearance:
-float scaleFactor = 10; // Size factor
-int renderMode = 1; // 0 = lines, 1 = flat ribbons
-int ribbonDetail = 4; // Ribbon detail: from 1 (lowest) to 4 (highest)
-float helixDiam = 10; // Helix diameter.
-int[] ribbonWidth = {10, 7, 2}; // Ribbon widths for helix, strand and coil
-color ribbonColor = color(0, 102, 153, 255); // Ribbon color
-
-// All the molecular models read from the PDB file (it could contain more than one)
-ArrayList models;
-
-Arcball arcball;
-
-void setup() {
- size(displayWidth, displayHeight, P3D);
- orientation(LANDSCAPE);
-
- arcball = new Arcball(width/2, height/2, 600);
- readPDB(pdbFile);
-}
-
-void draw() {
- background(0);
-
- ambient(80);
- lights();
-
- translate(width/2, height/2, 200);
- arcball.run();
-
- for (int i = 0; i < models.size(); i++) {
- shape((PShape)models.get(i));
- }
-}
-
-void mousePressed(){
- arcball.mousePressed();
-}
-
-void mouseDragged(){
- arcball.mouseDragged();
-}
diff --git a/android/examples/Demos/Graphics/Ribbons/data/1CBS.pdb b/android/examples/Demos/Graphics/Ribbons/data/1CBS.pdb
deleted file mode 100644
index 2f1693c725..0000000000
--- a/android/examples/Demos/Graphics/Ribbons/data/1CBS.pdb
+++ /dev/null
@@ -1,1573 +0,0 @@
-HEADER RETINOIC-ACID TRANSPORT 28-SEP-94 1CBS
-TITLE CRYSTAL STRUCTURE OF CELLULAR RETINOIC-ACID-BINDING
-TITLE 2 PROTEINS I AND II IN COMPLEX WITH ALL-TRANS-RETINOIC ACID
-TITLE 3 AND A SYNTHETIC RETINOID
-COMPND MOL_ID: 1;
-COMPND 2 MOLECULE: CELLULAR RETINOIC ACID BINDING PROTEIN TYPE II;
-COMPND 3 CHAIN: A;
-COMPND 4 ENGINEERED: YES
-SOURCE MOL_ID: 1;
-SOURCE 2 ORGANISM_SCIENTIFIC: HOMO SAPIENS;
-SOURCE 3 ORGANISM_COMMON: HUMAN;
-SOURCE 4 ORGANISM_TAXID: 9606;
-SOURCE 5 CELL_LINE: BL21;
-SOURCE 6 GENE: HUMAN CRABP-II;
-SOURCE 7 EXPRESSION_SYSTEM: ESCHERICHIA COLI BL21(DE3);
-SOURCE 8 EXPRESSION_SYSTEM_TAXID: 469008;
-SOURCE 9 EXPRESSION_SYSTEM_STRAIN: BL21 (DE3);
-SOURCE 10 EXPRESSION_SYSTEM_PLASMID: PET-3A
-KEYWDS RETINOIC-ACID TRANSPORT
-EXPDTA X-RAY DIFFRACTION
-AUTHOR G.J.KLEYWEGT,T.BERGFORS,T.A.JONES
-REVDAT 3 24-FEB-09 1CBS 1 VERSN
-REVDAT 2 01-APR-03 1CBS 1 JRNL
-REVDAT 1 26-JAN-95 1CBS 0
-JRNL AUTH G.J.KLEYWEGT,T.BERGFORS,H.SENN,P.LE MOTTE,B.GSELL,
-JRNL AUTH 2 K.SHUDO,T.A.JONES
-JRNL TITL CRYSTAL STRUCTURES OF CELLULAR RETINOIC ACID
-JRNL TITL 2 BINDING PROTEINS I AND II IN COMPLEX WITH
-JRNL TITL 3 ALL-TRANS-RETINOIC ACID AND A SYNTHETIC RETINOID.
-JRNL REF STRUCTURE V. 2 1241 1994
-JRNL REFN ISSN 0969-2126
-JRNL PMID 7704533
-JRNL DOI 10.1016/S0969-2126(94)00125-1
-REMARK 1
-REMARK 1 REFERENCE 1
-REMARK 1 AUTH L.BANASZAK,N.WINTER,Z.XU,D.A.BERNLOHR,S.W.COWAN,
-REMARK 1 AUTH 2 T.A.JONES
-REMARK 1 TITL LIPID-BINDING PROTEINS: A FAMILY OF FATTY ACID AND
-REMARK 1 TITL 2 RETINOID TRANSPORT PROTEINS
-REMARK 1 REF ADV.PROTEIN CHEM. V. 45 89 1994
-REMARK 1 REFN ISSN 0065-3233
-REMARK 1 REFERENCE 2
-REMARK 1 AUTH T.BERGFORS,G.J.KLEYWEGT,T.A.JONES
-REMARK 1 TITL CRYSTALLISATION AND PRELIMINARY X-RAY ANALYSIS OF
-REMARK 1 TITL 2 RECOMBINANT BOVINE CELLULAR RETINOIC ACID-BINDING
-REMARK 1 TITL 3 PROTEIN
-REMARK 1 REF ACTA CRYSTALLOGR.,SECT.D V. 50 370 1994
-REMARK 1 REFN ISSN 0907-4449
-REMARK 1 REFERENCE 3
-REMARK 1 AUTH S.W.COWAN,M.E.NEWCOMER,T.A.JONES
-REMARK 1 TITL CRYSTALLOGRAPHIC STUDIES ON A FAMILY OF LIPOPHILIC
-REMARK 1 TITL 2 TRANSPORT PROTEINS. REFINEMENT OF P2 MYELIN
-REMARK 1 TITL 3 PROTEIN AND THE STRUCTURE DETERMINATION AND
-REMARK 1 TITL 4 REFINEMENT OF CELLULAR RETINOL-BINDING PROTEIN IN
-REMARK 1 TITL 5 COMPLEX WITH ALL-TRANS-RETINOL
-REMARK 1 REF J.MOL.BIOL. V. 230 1225 1993
-REMARK 1 REFN ISSN 0022-2836
-REMARK 1 REFERENCE 4
-REMARK 1 AUTH T.A.JONES,T.BERGFORS,J.SEDZIK,T.UNGE
-REMARK 1 TITL THE THREE-DIMENSIONAL STRUCTURE OF P2 MYELIN
-REMARK 1 TITL 2 PROTEIN
-REMARK 1 REF EMBO J. V. 7 1597 1988
-REMARK 1 REFN ISSN 0261-4189
-REMARK 2
-REMARK 2 RESOLUTION. 1.80 ANGSTROMS.
-REMARK 3
-REMARK 3 REFINEMENT.
-REMARK 3 PROGRAM : X-PLOR
-REMARK 3 AUTHORS : BRUNGER
-REMARK 3
-REMARK 3 DATA USED IN REFINEMENT.
-REMARK 3 RESOLUTION RANGE HIGH (ANGSTROMS) : 1.80
-REMARK 3 RESOLUTION RANGE LOW (ANGSTROMS) : 8.00
-REMARK 3 DATA CUTOFF (SIGMA(F)) : 2.000
-REMARK 3 DATA CUTOFF HIGH (ABS(F)) : NULL
-REMARK 3 DATA CUTOFF LOW (ABS(F)) : NULL
-REMARK 3 COMPLETENESS (WORKING+TEST) (%) : 90.3
-REMARK 3 NUMBER OF REFLECTIONS : 14312
-REMARK 3
-REMARK 3 FIT TO DATA USED IN REFINEMENT.
-REMARK 3 CROSS-VALIDATION METHOD : NULL
-REMARK 3 FREE R VALUE TEST SET SELECTION : NULL
-REMARK 3 R VALUE (WORKING SET) : 0.200
-REMARK 3 FREE R VALUE : 0.237
-REMARK 3 FREE R VALUE TEST SET SIZE (%) : NULL
-REMARK 3 FREE R VALUE TEST SET COUNT : NULL
-REMARK 3 ESTIMATED ERROR OF FREE R VALUE : NULL
-REMARK 3
-REMARK 3 FIT IN THE HIGHEST RESOLUTION BIN.
-REMARK 3 TOTAL NUMBER OF BINS USED : NULL
-REMARK 3 BIN RESOLUTION RANGE HIGH (A) : NULL
-REMARK 3 BIN RESOLUTION RANGE LOW (A) : NULL
-REMARK 3 BIN COMPLETENESS (WORKING+TEST) (%) : NULL
-REMARK 3 REFLECTIONS IN BIN (WORKING SET) : NULL
-REMARK 3 BIN R VALUE (WORKING SET) : NULL
-REMARK 3 BIN FREE R VALUE : NULL
-REMARK 3 BIN FREE R VALUE TEST SET SIZE (%) : NULL
-REMARK 3 BIN FREE R VALUE TEST SET COUNT : NULL
-REMARK 3 ESTIMATED ERROR OF BIN FREE R VALUE : NULL
-REMARK 3
-REMARK 3 NUMBER OF NON-HYDROGEN ATOMS USED IN REFINEMENT.
-REMARK 3 PROTEIN ATOMS : 1091
-REMARK 3 NUCLEIC ACID ATOMS : 0
-REMARK 3 HETEROGEN ATOMS : 22
-REMARK 3 SOLVENT ATOMS : 100
-REMARK 3
-REMARK 3 B VALUES.
-REMARK 3 FROM WILSON PLOT (A**2) : NULL
-REMARK 3 MEAN B VALUE (OVERALL, A**2) : 16.60
-REMARK 3 OVERALL ANISOTROPIC B VALUE.
-REMARK 3 B11 (A**2) : NULL
-REMARK 3 B22 (A**2) : NULL
-REMARK 3 B33 (A**2) : NULL
-REMARK 3 B12 (A**2) : NULL
-REMARK 3 B13 (A**2) : NULL
-REMARK 3 B23 (A**2) : NULL
-REMARK 3
-REMARK 3 ESTIMATED COORDINATE ERROR.
-REMARK 3 ESD FROM LUZZATI PLOT (A) : 0.20
-REMARK 3 ESD FROM SIGMAA (A) : NULL
-REMARK 3 LOW RESOLUTION CUTOFF (A) : NULL
-REMARK 3
-REMARK 3 CROSS-VALIDATED ESTIMATED COORDINATE ERROR.
-REMARK 3 ESD FROM C-V LUZZATI PLOT (A) : NULL
-REMARK 3 ESD FROM C-V SIGMAA (A) : NULL
-REMARK 3
-REMARK 3 RMS DEVIATIONS FROM IDEAL VALUES.
-REMARK 3 BOND LENGTHS (A) : 0.010
-REMARK 3 BOND ANGLES (DEGREES) : 1.51
-REMARK 3 DIHEDRAL ANGLES (DEGREES) : 27.40
-REMARK 3 IMPROPER ANGLES (DEGREES) : 1.32
-REMARK 3
-REMARK 3 ISOTROPIC THERMAL MODEL : NULL
-REMARK 3
-REMARK 3 ISOTROPIC THERMAL FACTOR RESTRAINTS. RMS SIGMA
-REMARK 3 MAIN-CHAIN BOND (A**2) : NULL ; NULL
-REMARK 3 MAIN-CHAIN ANGLE (A**2) : NULL ; NULL
-REMARK 3 SIDE-CHAIN BOND (A**2) : NULL ; NULL
-REMARK 3 SIDE-CHAIN ANGLE (A**2) : NULL ; NULL
-REMARK 3
-REMARK 3 NCS MODEL : NULL
-REMARK 3
-REMARK 3 NCS RESTRAINTS. RMS SIGMA/WEIGHT
-REMARK 3 GROUP 1 POSITIONAL (A) : NULL ; NULL
-REMARK 3 GROUP 1 B-FACTOR (A**2) : NULL ; NULL
-REMARK 3
-REMARK 3 PARAMETER FILE 1 : NULL
-REMARK 3 TOPOLOGY FILE 1 : NULL
-REMARK 3
-REMARK 3 OTHER REFINEMENT REMARKS: NULL
-REMARK 4
-REMARK 4 1CBS COMPLIES WITH FORMAT V. 3.15, 01-DEC-08
-REMARK 100
-REMARK 100 THIS ENTRY HAS BEEN PROCESSED BY BNL.
-REMARK 200
-REMARK 200 EXPERIMENTAL DETAILS
-REMARK 200 EXPERIMENT TYPE : X-RAY DIFFRACTION
-REMARK 200 DATE OF DATA COLLECTION : NULL
-REMARK 200 TEMPERATURE (KELVIN) : NULL
-REMARK 200 PH : NULL
-REMARK 200 NUMBER OF CRYSTALS USED : NULL
-REMARK 200
-REMARK 200 SYNCHROTRON (Y/N) : NULL
-REMARK 200 RADIATION SOURCE : NULL
-REMARK 200 BEAMLINE : NULL
-REMARK 200 X-RAY GENERATOR MODEL : NULL
-REMARK 200 MONOCHROMATIC OR LAUE (M/L) : NULL
-REMARK 200 WAVELENGTH OR RANGE (A) : NULL
-REMARK 200 MONOCHROMATOR : NULL
-REMARK 200 OPTICS : NULL
-REMARK 200
-REMARK 200 DETECTOR TYPE : NULL
-REMARK 200 DETECTOR MANUFACTURER : NULL
-REMARK 200 INTENSITY-INTEGRATION SOFTWARE : NULL
-REMARK 200 DATA SCALING SOFTWARE : NULL
-REMARK 200
-REMARK 200 NUMBER OF UNIQUE REFLECTIONS : 14678
-REMARK 200 RESOLUTION RANGE HIGH (A) : NULL
-REMARK 200 RESOLUTION RANGE LOW (A) : NULL
-REMARK 200 REJECTION CRITERIA (SIGMA(I)) : 3.000
-REMARK 200
-REMARK 200 OVERALL.
-REMARK 200 COMPLETENESS FOR RANGE (%) : 90.3
-REMARK 200 DATA REDUNDANCY : NULL
-REMARK 200 R MERGE (I) : NULL
-REMARK 200 R SYM (I) : NULL
-REMARK 200 FOR THE DATA SET : NULL
-REMARK 200
-REMARK 200 IN THE HIGHEST RESOLUTION SHELL.
-REMARK 200 HIGHEST RESOLUTION SHELL, RANGE HIGH (A) : NULL
-REMARK 200 HIGHEST RESOLUTION SHELL, RANGE LOW (A) : NULL
-REMARK 200 COMPLETENESS FOR SHELL (%) : NULL
-REMARK 200 DATA REDUNDANCY IN SHELL : NULL
-REMARK 200 R MERGE FOR SHELL (I) : NULL
-REMARK 200 R SYM FOR SHELL (I) : NULL
-REMARK 200 FOR SHELL : NULL
-REMARK 200
-REMARK 200 DIFFRACTION PROTOCOL: NULL
-REMARK 200 METHOD USED TO DETERMINE THE STRUCTURE: NULL
-REMARK 200 SOFTWARE USED: X-PLOR
-REMARK 200 STARTING MODEL: NULL
-REMARK 200
-REMARK 200 REMARK: NULL
-REMARK 280
-REMARK 280 CRYSTAL
-REMARK 280 SOLVENT CONTENT, VS (%): 54.49
-REMARK 280 MATTHEWS COEFFICIENT, VM (ANGSTROMS**3/DA): 2.70
-REMARK 280
-REMARK 280 CRYSTALLIZATION CONDITIONS: NULL
-REMARK 290
-REMARK 290 CRYSTALLOGRAPHIC SYMMETRY
-REMARK 290 SYMMETRY OPERATORS FOR SPACE GROUP: P 21 21 21
-REMARK 290
-REMARK 290 SYMOP SYMMETRY
-REMARK 290 NNNMMM OPERATOR
-REMARK 290 1555 X,Y,Z
-REMARK 290 2555 -X+1/2,-Y,Z+1/2
-REMARK 290 3555 -X,Y+1/2,-Z+1/2
-REMARK 290 4555 X+1/2,-Y+1/2,-Z
-REMARK 290
-REMARK 290 WHERE NNN -> OPERATOR NUMBER
-REMARK 290 MMM -> TRANSLATION VECTOR
-REMARK 290
-REMARK 290 CRYSTALLOGRAPHIC SYMMETRY TRANSFORMATIONS
-REMARK 290 THE FOLLOWING TRANSFORMATIONS OPERATE ON THE ATOM/HETATM
-REMARK 290 RECORDS IN THIS ENTRY TO PRODUCE CRYSTALLOGRAPHICALLY
-REMARK 290 RELATED MOLECULES.
-REMARK 290 SMTRY1 1 1.000000 0.000000 0.000000 0.00000
-REMARK 290 SMTRY2 1 0.000000 1.000000 0.000000 0.00000
-REMARK 290 SMTRY3 1 0.000000 0.000000 1.000000 0.00000
-REMARK 290 SMTRY1 2 -1.000000 0.000000 0.000000 22.82500
-REMARK 290 SMTRY2 2 0.000000 -1.000000 0.000000 0.00000
-REMARK 290 SMTRY3 2 0.000000 0.000000 1.000000 38.80500
-REMARK 290 SMTRY1 3 -1.000000 0.000000 0.000000 0.00000
-REMARK 290 SMTRY2 3 0.000000 1.000000 0.000000 23.78000
-REMARK 290 SMTRY3 3 0.000000 0.000000 -1.000000 38.80500
-REMARK 290 SMTRY1 4 1.000000 0.000000 0.000000 22.82500
-REMARK 290 SMTRY2 4 0.000000 -1.000000 0.000000 23.78000
-REMARK 290 SMTRY3 4 0.000000 0.000000 -1.000000 0.00000
-REMARK 290
-REMARK 290 REMARK: NULL
-REMARK 300
-REMARK 300 BIOMOLECULE: 1
-REMARK 300 SEE REMARK 350 FOR THE AUTHOR PROVIDED AND/OR PROGRAM
-REMARK 300 GENERATED ASSEMBLY INFORMATION FOR THE STRUCTURE IN
-REMARK 300 THIS ENTRY. THE REMARK MAY ALSO PROVIDE INFORMATION ON
-REMARK 300 BURIED SURFACE AREA.
-REMARK 350
-REMARK 350 COORDINATES FOR A COMPLETE MULTIMER REPRESENTING THE KNOWN
-REMARK 350 BIOLOGICALLY SIGNIFICANT OLIGOMERIZATION STATE OF THE
-REMARK 350 MOLECULE CAN BE GENERATED BY APPLYING BIOMT TRANSFORMATIONS
-REMARK 350 GIVEN BELOW. BOTH NON-CRYSTALLOGRAPHIC AND
-REMARK 350 CRYSTALLOGRAPHIC OPERATIONS ARE GIVEN.
-REMARK 350
-REMARK 350 BIOMOLECULE: 1
-REMARK 350 AUTHOR DETERMINED BIOLOGICAL UNIT: MONOMERIC
-REMARK 350 APPLY THE FOLLOWING TO CHAINS: A
-REMARK 350 BIOMT1 1 1.000000 0.000000 0.000000 0.00000
-REMARK 350 BIOMT2 1 0.000000 1.000000 0.000000 0.00000
-REMARK 350 BIOMT3 1 0.000000 0.000000 1.000000 0.00000
-REMARK 500
-REMARK 500 GEOMETRY AND STEREOCHEMISTRY
-REMARK 500 SUBTOPIC: TORSION ANGLES
-REMARK 500
-REMARK 500 TORSION ANGLES OUTSIDE THE EXPECTED RAMACHANDRAN REGIONS:
-REMARK 500 (M=MODEL NUMBER; RES=RESIDUE NAME; C=CHAIN IDENTIFIER;
-REMARK 500 SSEQ=SEQUENCE NUMBER; I=INSERTION CODE).
-REMARK 500
-REMARK 500 STANDARD TABLE:
-REMARK 500 FORMAT:(10X,I3,1X,A3,1X,A1,I4,A1,4X,F7.2,3X,F7.2)
-REMARK 500
-REMARK 500 EXPECTED VALUES: GJ KLEYWEGT AND TA JONES (1996). PHI/PSI-
-REMARK 500 CHOLOGY: RAMACHANDRAN REVISITED. STRUCTURE 4, 1395 - 1400
-REMARK 500
-REMARK 500 M RES CSSEQI PSI PHI
-REMARK 500 GLU A 73 -154.28 -144.94
-REMARK 500 ASP A 126 -115.96 55.69
-REMARK 500
-REMARK 500 REMARK: NULL
-REMARK 525
-REMARK 525 SOLVENT
-REMARK 525
-REMARK 525 THE SOLVENT MOLECULES HAVE CHAIN IDENTIFIERS THAT
-REMARK 525 INDICATE THE POLYMER CHAIN WITH WHICH THEY ARE MOST
-REMARK 525 CLOSELY ASSOCIATED. THE REMARK LISTS ALL THE SOLVENT
-REMARK 525 MOLECULES WHICH ARE MORE THAN 5A AWAY FROM THE
-REMARK 525 NEAREST POLYMER CHAIN (M = MODEL NUMBER;
-REMARK 525 RES=RESIDUE NAME; C=CHAIN IDENTIFIER; SSEQ=SEQUENCE
-REMARK 525 NUMBER; I=INSERTION CODE):
-REMARK 525
-REMARK 525 M RES CSSEQI
-REMARK 525 HOH A 376 DISTANCE = 5.94 ANGSTROMS
-REMARK 800
-REMARK 800 SITE
-REMARK 800 SITE_IDENTIFIER: AC1
-REMARK 800 EVIDENCE_CODE: SOFTWARE
-REMARK 800 SITE_DESCRIPTION: BINDING SITE FOR RESIDUE REA A 200
-DBREF 1CBS A 1 137 UNP P29373 RABP2_HUMAN 1 137
-SEQRES 1 A 137 PRO ASN PHE SER GLY ASN TRP LYS ILE ILE ARG SER GLU
-SEQRES 2 A 137 ASN PHE GLU GLU LEU LEU LYS VAL LEU GLY VAL ASN VAL
-SEQRES 3 A 137 MET LEU ARG LYS ILE ALA VAL ALA ALA ALA SER LYS PRO
-SEQRES 4 A 137 ALA VAL GLU ILE LYS GLN GLU GLY ASP THR PHE TYR ILE
-SEQRES 5 A 137 LYS THR SER THR THR VAL ARG THR THR GLU ILE ASN PHE
-SEQRES 6 A 137 LYS VAL GLY GLU GLU PHE GLU GLU GLN THR VAL ASP GLY
-SEQRES 7 A 137 ARG PRO CYS LYS SER LEU VAL LYS TRP GLU SER GLU ASN
-SEQRES 8 A 137 LYS MET VAL CYS GLU GLN LYS LEU LEU LYS GLY GLU GLY
-SEQRES 9 A 137 PRO LYS THR SER TRP THR ARG GLU LEU THR ASN ASP GLY
-SEQRES 10 A 137 GLU LEU ILE LEU THR MET THR ALA ASP ASP VAL VAL CYS
-SEQRES 11 A 137 THR ARG VAL TYR VAL ARG GLU
-HET REA A 200 22
-HETNAM REA RETINOIC ACID
-FORMUL 2 REA C20 H28 O2
-FORMUL 3 HOH *100(H2 O)
-HELIX 1 1 ASN A 14 LEU A 22 1 9
-HELIX 2 2 ASN A 25 SER A 37 1 13
-SHEET 1 A10 THR A 60 LYS A 66 0
-SHEET 2 A10 THR A 49 SER A 55 -1 N PHE A 50 O PHE A 65
-SHEET 3 A10 ALA A 40 GLU A 46 -1 O ALA A 40 N SER A 55
-SHEET 4 A10 GLY A 5 GLU A 13 -1 O GLY A 5 N ILE A 43
-SHEET 5 A10 VAL A 128 ARG A 136 -1 O THR A 131 N GLU A 13
-SHEET 6 A10 LEU A 119 ALA A 125 -1 O LEU A 119 N TYR A 134
-SHEET 7 A10 THR A 107 LEU A 113 -1 O SER A 108 N THR A 124
-SHEET 8 A10 LYS A 92 LEU A 99 -1 N MET A 93 O ARG A 111
-SHEET 9 A10 PRO A 80 SER A 89 -1 N LYS A 82 O LYS A 98
-SHEET 10 A10 PHE A 71 GLN A 74 -1 O PHE A 71 N SER A 83
-SITE 1 AC1 10 GLU A 13 ALA A 32 THR A 54 VAL A 58
-SITE 2 AC1 10 VAL A 76 LEU A 121 ARG A 132 TYR A 134
-SITE 3 AC1 10 HOH A 309 HOH A 343
-CRYST1 45.650 47.560 77.610 90.00 90.00 90.00 P 21 21 21 4
-ORIGX1 1.000000 0.000000 0.000000 0.00000
-ORIGX2 0.000000 1.000000 0.000000 0.00000
-ORIGX3 0.000000 0.000000 1.000000 0.00000
-SCALE1 0.021906 0.000000 0.000000 0.00000
-SCALE2 0.000000 0.021026 0.000000 0.00000
-SCALE3 0.000000 0.000000 0.012885 0.00000
-ATOM 1 N PRO A 1 16.979 13.301 44.555 1.00 30.05 N
-ATOM 2 CA PRO A 1 18.150 13.525 43.680 1.00 28.82 C
-ATOM 3 C PRO A 1 18.656 14.966 43.784 1.00 26.59 C
-ATOM 4 O PRO A 1 17.890 15.889 44.078 1.00 26.84 O
-ATOM 5 CB PRO A 1 17.678 13.270 42.255 1.00 29.24 C
-ATOM 6 CG PRO A 1 16.248 13.734 42.347 1.00 29.29 C
-ATOM 7 CD PRO A 1 15.762 13.216 43.724 1.00 30.71 C
-ATOM 8 N ASN A 2 19.957 15.139 43.558 1.00 24.04 N
-ATOM 9 CA ASN A 2 20.576 16.457 43.578 1.00 20.79 C
-ATOM 10 C ASN A 2 21.301 16.714 42.262 1.00 16.75 C
-ATOM 11 O ASN A 2 22.402 16.215 42.028 1.00 15.23 O
-ATOM 12 CB ASN A 2 21.559 16.620 44.724 1.00 22.81 C
-ATOM 13 CG ASN A 2 22.240 17.968 44.685 1.00 24.29 C
-ATOM 14 OD1 ASN A 2 21.612 18.984 44.358 1.00 21.87 O
-ATOM 15 ND2 ASN A 2 23.537 17.983 44.966 1.00 27.94 N
-ATOM 16 N PHE A 3 20.637 17.477 41.402 1.00 14.69 N
-ATOM 17 CA PHE A 3 21.144 17.838 40.087 1.00 12.62 C
-ATOM 18 C PHE A 3 22.152 18.987 40.140 1.00 12.43 C
-ATOM 19 O PHE A 3 22.796 19.289 39.136 1.00 12.12 O
-ATOM 20 CB PHE A 3 19.970 18.262 39.188 1.00 10.74 C
-ATOM 21 CG PHE A 3 19.073 17.128 38.750 1.00 11.85 C
-ATOM 22 CD1 PHE A 3 18.066 16.646 39.581 1.00 10.90 C
-ATOM 23 CD2 PHE A 3 19.189 16.588 37.475 1.00 13.26 C
-ATOM 24 CE1 PHE A 3 17.200 15.662 39.149 1.00 9.12 C
-ATOM 25 CE2 PHE A 3 18.312 15.594 37.041 1.00 11.76 C
-ATOM 26 CZ PHE A 3 17.324 15.137 37.878 1.00 10.30 C
-ATOM 27 N SER A 4 22.282 19.630 41.299 1.00 11.24 N
-ATOM 28 CA SER A 4 23.170 20.780 41.464 1.00 11.30 C
-ATOM 29 C SER A 4 24.627 20.568 41.091 1.00 10.39 C
-ATOM 30 O SER A 4 25.201 19.532 41.384 1.00 10.24 O
-ATOM 31 CB SER A 4 23.112 21.301 42.906 1.00 13.53 C
-ATOM 32 OG SER A 4 21.821 21.787 43.240 1.00 16.76 O
-ATOM 33 N GLY A 5 25.224 21.572 40.460 1.00 9.87 N
-ATOM 34 CA GLY A 5 26.628 21.486 40.103 1.00 10.86 C
-ATOM 35 C GLY A 5 26.985 22.158 38.794 1.00 11.21 C
-ATOM 36 O GLY A 5 26.123 22.761 38.142 1.00 9.91 O
-ATOM 37 N ASN A 6 28.277 22.142 38.475 1.00 10.41 N
-ATOM 38 CA ASN A 6 28.796 22.676 37.211 1.00 11.06 C
-ATOM 39 C ASN A 6 29.117 21.435 36.378 1.00 10.33 C
-ATOM 40 O ASN A 6 29.947 20.603 36.754 1.00 11.28 O
-ATOM 41 CB ASN A 6 30.023 23.548 37.445 1.00 12.95 C
-ATOM 42 CG ASN A 6 29.675 24.816 38.200 1.00 18.08 C
-ATOM 43 OD1 ASN A 6 29.022 25.708 37.665 1.00 19.52 O
-ATOM 44 ND2 ASN A 6 30.047 24.872 39.467 1.00 21.23 N
-ATOM 45 N TRP A 7 28.399 21.289 35.272 1.00 8.66 N
-ATOM 46 CA TRP A 7 28.518 20.119 34.424 1.00 8.74 C
-ATOM 47 C TRP A 7 29.246 20.352 33.092 1.00 9.63 C
-ATOM 48 O TRP A 7 29.064 21.389 32.440 1.00 9.45 O
-ATOM 49 CB TRP A 7 27.115 19.563 34.152 1.00 8.00 C
-ATOM 50 CG TRP A 7 26.325 19.198 35.391 1.00 8.01 C
-ATOM 51 CD1 TRP A 7 25.556 20.031 36.159 1.00 8.29 C
-ATOM 52 CD2 TRP A 7 26.174 17.885 35.947 1.00 7.60 C
-ATOM 53 NE1 TRP A 7 24.922 19.308 37.156 1.00 9.20 N
-ATOM 54 CE2 TRP A 7 25.286 17.987 37.046 1.00 8.73 C
-ATOM 55 CE3 TRP A 7 26.694 16.625 35.618 1.00 6.99 C
-ATOM 56 CZ2 TRP A 7 24.909 16.876 37.815 1.00 7.67 C
-ATOM 57 CZ3 TRP A 7 26.320 15.527 36.380 1.00 7.58 C
-ATOM 58 CH2 TRP A 7 25.433 15.663 37.468 1.00 5.92 C
-ATOM 59 N LYS A 8 30.052 19.368 32.702 1.00 9.39 N
-ATOM 60 CA LYS A 8 30.802 19.424 31.450 1.00 11.56 C
-ATOM 61 C LYS A 8 30.342 18.243 30.611 1.00 10.56 C
-ATOM 62 O LYS A 8 30.091 17.158 31.138 1.00 10.14 O
-ATOM 63 CB LYS A 8 32.308 19.360 31.710 1.00 15.20 C
-ATOM 64 CG LYS A 8 32.785 18.080 32.313 1.00 18.52 C
-ATOM 65 CD LYS A 8 34.263 18.182 32.618 1.00 26.26 C
-ATOM 66 CE LYS A 8 35.091 18.499 31.378 1.00 29.22 C
-ATOM 67 NZ LYS A 8 35.067 17.393 30.369 1.00 32.48 N
-ATOM 68 N ILE A 9 30.222 18.447 29.308 1.00 8.21 N
-ATOM 69 CA ILE A 9 29.739 17.384 28.441 1.00 8.08 C
-ATOM 70 C ILE A 9 30.798 16.325 28.117 1.00 7.86 C
-ATOM 71 O ILE A 9 31.990 16.635 28.028 1.00 8.38 O
-ATOM 72 CB ILE A 9 29.148 17.997 27.144 1.00 10.70 C
-ATOM 73 CG1 ILE A 9 28.285 16.981 26.401 1.00 10.95 C
-ATOM 74 CG2 ILE A 9 30.261 18.500 26.243 1.00 10.70 C
-ATOM 75 CD1 ILE A 9 27.586 17.597 25.207 1.00 13.23 C
-ATOM 76 N ILE A 10 30.373 15.067 27.995 1.00 7.08 N
-ATOM 77 CA ILE A 10 31.288 13.988 27.656 1.00 7.45 C
-ATOM 78 C ILE A 10 30.812 13.201 26.441 1.00 8.49 C
-ATOM 79 O ILE A 10 31.561 12.397 25.892 1.00 9.49 O
-ATOM 80 CB ILE A 10 31.586 13.023 28.847 1.00 10.28 C
-ATOM 81 CG1 ILE A 10 30.304 12.393 29.382 1.00 10.51 C
-ATOM 82 CG2 ILE A 10 32.349 13.756 29.963 1.00 10.10 C
-ATOM 83 CD1 ILE A 10 30.578 11.242 30.325 1.00 12.18 C
-ATOM 84 N ARG A 11 29.566 13.419 26.030 1.00 7.59 N
-ATOM 85 CA ARG A 11 29.015 12.742 24.851 1.00 8.70 C
-ATOM 86 C ARG A 11 27.821 13.500 24.290 1.00 9.41 C
-ATOM 87 O ARG A 11 26.990 14.004 25.043 1.00 9.84 O
-ATOM 88 CB ARG A 11 28.563 11.316 25.184 1.00 8.07 C
-ATOM 89 CG ARG A 11 27.912 10.616 23.998 1.00 12.26 C
-ATOM 90 CD ARG A 11 27.234 9.340 24.394 1.00 13.46 C
-ATOM 91 NE ARG A 11 28.157 8.304 24.847 1.00 15.44 N
-ATOM 92 CZ ARG A 11 28.815 7.470 24.037 1.00 19.59 C
-ATOM 93 NH1 ARG A 11 28.677 7.559 22.714 1.00 19.40 N
-ATOM 94 NH2 ARG A 11 29.521 6.467 24.547 1.00 17.50 N
-ATOM 95 N SER A 12 27.748 13.594 22.965 1.00 8.84 N
-ATOM 96 CA SER A 12 26.621 14.245 22.310 1.00 8.61 C
-ATOM 97 C SER A 12 26.278 13.431 21.063 1.00 9.48 C
-ATOM 98 O SER A 12 27.159 13.147 20.250 1.00 9.84 O
-ATOM 99 CB SER A 12 26.966 15.676 21.925 1.00 9.02 C
-ATOM 100 OG SER A 12 25.863 16.285 21.273 1.00 11.97 O
-ATOM 101 N GLU A 13 25.016 13.038 20.924 1.00 7.59 N
-ATOM 102 CA GLU A 13 24.586 12.258 19.768 1.00 9.67 C
-ATOM 103 C GLU A 13 23.368 12.887 19.118 1.00 9.06 C
-ATOM 104 O GLU A 13 22.457 13.343 19.815 1.00 7.34 O
-ATOM 105 CB GLU A 13 24.185 10.833 20.184 1.00 9.72 C
-ATOM 106 CG GLU A 13 25.257 10.018 20.895 1.00 15.17 C
-ATOM 107 CD GLU A 13 26.262 9.340 19.954 1.00 18.75 C
-ATOM 108 OE1 GLU A 13 26.031 9.310 18.726 1.00 18.53 O
-ATOM 109 OE2 GLU A 13 27.286 8.822 20.457 1.00 19.23 O
-ATOM 110 N ASN A 14 23.363 12.919 17.786 1.00 8.79 N
-ATOM 111 CA ASN A 14 22.202 13.408 17.025 1.00 8.29 C
-ATOM 112 C ASN A 14 21.813 14.896 17.153 1.00 7.35 C
-ATOM 113 O ASN A 14 20.681 15.245 16.860 1.00 7.00 O
-ATOM 114 CB ASN A 14 20.989 12.522 17.383 1.00 7.23 C
-ATOM 115 CG ASN A 14 20.358 11.833 16.172 1.00 9.38 C
-ATOM 116 OD1 ASN A 14 20.996 11.670 15.128 1.00 10.37 O
-ATOM 117 ND2 ASN A 14 19.106 11.436 16.310 1.00 6.35 N
-ATOM 118 N PHE A 15 22.734 15.777 17.536 1.00 7.26 N
-ATOM 119 CA PHE A 15 22.385 17.198 17.681 1.00 9.06 C
-ATOM 120 C PHE A 15 22.041 17.878 16.358 1.00 9.15 C
-ATOM 121 O PHE A 15 21.041 18.578 16.265 1.00 8.64 O
-ATOM 122 CB PHE A 15 23.497 17.990 18.379 1.00 10.05 C
-ATOM 123 CG PHE A 15 23.102 19.397 18.746 1.00 10.57 C
-ATOM 124 CD1 PHE A 15 22.032 19.633 19.605 1.00 13.39 C
-ATOM 125 CD2 PHE A 15 23.813 20.485 18.254 1.00 11.47 C
-ATOM 126 CE1 PHE A 15 21.678 20.929 19.968 1.00 13.52 C
-ATOM 127 CE2 PHE A 15 23.467 21.784 18.609 1.00 11.60 C
-ATOM 128 CZ PHE A 15 22.399 22.006 19.469 1.00 13.52 C
-ATOM 129 N GLU A 16 22.878 17.699 15.342 1.00 11.17 N
-ATOM 130 CA GLU A 16 22.583 18.313 14.053 1.00 12.58 C
-ATOM 131 C GLU A 16 21.271 17.797 13.468 1.00 11.71 C
-ATOM 132 O GLU A 16 20.503 18.567 12.888 1.00 12.66 O
-ATOM 133 CB GLU A 16 23.711 18.081 13.060 1.00 15.91 C
-ATOM 134 CG GLU A 16 23.274 18.337 11.626 1.00 21.31 C
-ATOM 135 CD GLU A 16 24.376 18.878 10.757 1.00 25.39 C
-ATOM 136 OE1 GLU A 16 25.526 18.984 11.240 1.00 27.92 O
-ATOM 137 OE2 GLU A 16 24.084 19.213 9.588 1.00 28.60 O
-ATOM 138 N GLU A 17 21.018 16.497 13.619 1.00 11.67 N
-ATOM 139 CA GLU A 17 19.785 15.878 13.116 1.00 13.65 C
-ATOM 140 C GLU A 17 18.529 16.490 13.767 1.00 13.48 C
-ATOM 141 O GLU A 17 17.490 16.662 13.115 1.00 11.68 O
-ATOM 142 CB GLU A 17 19.811 14.361 13.325 1.00 17.06 C
-ATOM 143 CG GLU A 17 20.806 13.602 12.430 1.00 23.45 C
-ATOM 144 CD GLU A 17 22.279 13.624 12.909 1.00 27.80 C
-ATOM 145 OE1 GLU A 17 22.637 14.338 13.881 1.00 26.52 O
-ATOM 146 OE2 GLU A 17 23.097 12.897 12.291 1.00 31.80 O
-ATOM 147 N LEU A 18 18.640 16.834 15.048 1.00 10.82 N
-ATOM 148 CA LEU A 18 17.547 17.468 15.777 1.00 9.45 C
-ATOM 149 C LEU A 18 17.302 18.849 15.155 1.00 9.27 C
-ATOM 150 O LEU A 18 16.153 19.246 14.927 1.00 9.04 O
-ATOM 151 CB LEU A 18 17.931 17.644 17.253 1.00 9.77 C
-ATOM 152 CG LEU A 18 16.921 18.358 18.163 1.00 11.36 C
-ATOM 153 CD1 LEU A 18 15.817 17.402 18.554 1.00 13.85 C
-ATOM 154 CD2 LEU A 18 17.616 18.876 19.409 1.00 12.69 C
-ATOM 155 N LEU A 19 18.387 19.568 14.864 1.00 10.75 N
-ATOM 156 CA LEU A 19 18.275 20.906 14.276 1.00 11.15 C
-ATOM 157 C LEU A 19 17.671 20.873 12.874 1.00 12.52 C
-ATOM 158 O LEU A 19 16.932 21.777 12.485 1.00 10.05 O
-ATOM 159 CB LEU A 19 19.631 21.616 14.263 1.00 12.01 C
-ATOM 160 CG LEU A 19 20.282 21.963 15.614 1.00 10.42 C
-ATOM 161 CD1 LEU A 19 21.560 22.763 15.369 1.00 13.01 C
-ATOM 162 CD2 LEU A 19 19.312 22.742 16.513 1.00 11.45 C
-ATOM 163 N LYS A 20 17.944 19.795 12.150 1.00 14.41 N
-ATOM 164 CA LYS A 20 17.427 19.628 10.800 1.00 16.54 C
-ATOM 165 C LYS A 20 15.902 19.512 10.832 1.00 16.17 C
-ATOM 166 O LYS A 20 15.201 20.164 10.053 1.00 15.90 O
-ATOM 167 CB LYS A 20 18.048 18.390 10.157 1.00 20.07 C
-ATOM 168 CG LYS A 20 18.592 18.643 8.765 1.00 26.61 C
-ATOM 169 CD LYS A 20 18.960 17.349 8.027 1.00 30.95 C
-ATOM 170 CE LYS A 20 20.226 16.690 8.579 1.00 35.68 C
-ATOM 171 NZ LYS A 20 21.485 17.466 8.342 1.00 39.27 N
-ATOM 172 N VAL A 21 15.395 18.700 11.759 1.00 15.31 N
-ATOM 173 CA VAL A 21 13.958 18.508 11.927 1.00 14.41 C
-ATOM 174 C VAL A 21 13.275 19.831 12.316 1.00 15.02 C
-ATOM 175 O VAL A 21 12.150 20.119 11.878 1.00 13.59 O
-ATOM 176 CB VAL A 21 13.674 17.422 12.998 1.00 14.93 C
-ATOM 177 CG1 VAL A 21 12.194 17.383 13.364 1.00 17.29 C
-ATOM 178 CG2 VAL A 21 14.115 16.082 12.482 1.00 15.09 C
-ATOM 179 N LEU A 22 13.966 20.643 13.119 1.00 14.52 N
-ATOM 180 CA LEU A 22 13.432 21.938 13.569 1.00 14.42 C
-ATOM 181 C LEU A 22 13.478 22.984 12.467 1.00 15.49 C
-ATOM 182 O LEU A 22 13.038 24.115 12.666 1.00 16.81 O
-ATOM 183 CB LEU A 22 14.180 22.440 14.818 1.00 13.61 C
-ATOM 184 CG LEU A 22 13.986 21.565 16.069 1.00 13.97 C
-ATOM 185 CD1 LEU A 22 14.852 22.047 17.225 1.00 13.25 C
-ATOM 186 CD2 LEU A 22 12.525 21.580 16.467 1.00 14.62 C
-ATOM 187 N GLY A 23 14.062 22.618 11.328 1.00 16.41 N
-ATOM 188 CA GLY A 23 14.123 23.516 10.183 1.00 17.05 C
-ATOM 189 C GLY A 23 15.241 24.539 10.125 1.00 18.00 C
-ATOM 190 O GLY A 23 15.112 25.545 9.425 1.00 19.45 O
-ATOM 191 N VAL A 24 16.320 24.315 10.869 1.00 14.78 N
-ATOM 192 CA VAL A 24 17.440 25.241 10.860 1.00 13.71 C
-ATOM 193 C VAL A 24 18.289 24.983 9.607 1.00 15.09 C
-ATOM 194 O VAL A 24 18.679 23.840 9.334 1.00 14.12 O
-ATOM 195 CB VAL A 24 18.297 25.081 12.139 1.00 12.19 C
-ATOM 196 CG1 VAL A 24 19.465 26.054 12.109 1.00 8.69 C
-ATOM 197 CG2 VAL A 24 17.416 25.294 13.388 1.00 11.37 C
-ATOM 198 N ASN A 25 18.595 26.047 8.866 1.00 15.37 N
-ATOM 199 CA ASN A 25 19.360 25.914 7.635 1.00 17.74 C
-ATOM 200 C ASN A 25 20.808 25.466 7.819 1.00 18.29 C
-ATOM 201 O ASN A 25 21.377 25.592 8.903 1.00 18.05 O
-ATOM 202 CB ASN A 25 19.230 27.172 6.742 1.00 19.41 C
-ATOM 203 CG ASN A 25 20.090 28.351 7.200 1.00 22.35 C
-ATOM 204 OD1 ASN A 25 21.207 28.189 7.698 1.00 22.64 O
-ATOM 205 ND2 ASN A 25 19.602 29.558 6.933 1.00 24.15 N
-ATOM 206 N VAL A 26 21.398 24.971 6.733 1.00 18.67 N
-ATOM 207 CA VAL A 26 22.755 24.444 6.742 1.00 19.24 C
-ATOM 208 C VAL A 26 23.825 25.280 7.421 1.00 18.39 C
-ATOM 209 O VAL A 26 24.558 24.764 8.261 1.00 18.50 O
-ATOM 210 CB VAL A 26 23.223 24.088 5.320 1.00 20.77 C
-ATOM 211 CG1 VAL A 26 24.624 23.523 5.378 1.00 22.39 C
-ATOM 212 CG2 VAL A 26 22.276 23.084 4.698 1.00 21.28 C
-ATOM 213 N MET A 27 23.932 26.556 7.052 1.00 19.00 N
-ATOM 214 CA MET A 27 24.948 27.433 7.628 1.00 19.54 C
-ATOM 215 C MET A 27 24.734 27.741 9.099 1.00 19.04 C
-ATOM 216 O MET A 27 25.702 27.820 9.849 1.00 18.28 O
-ATOM 217 CB MET A 27 25.104 28.736 6.830 1.00 23.31 C
-ATOM 218 CG MET A 27 25.955 28.602 5.552 1.00 29.99 C
-ATOM 219 SD MET A 27 24.975 28.527 4.010 1.00 37.48 S
-ATOM 220 CE MET A 27 26.198 29.150 2.776 1.00 35.24 C
-ATOM 221 N LEU A 28 23.480 27.932 9.507 1.00 16.74 N
-ATOM 222 CA LEU A 28 23.190 28.209 10.912 1.00 16.39 C
-ATOM 223 C LEU A 28 23.477 26.954 11.722 1.00 16.86 C
-ATOM 224 O LEU A 28 23.954 27.038 12.852 1.00 15.09 O
-ATOM 225 CB LEU A 28 21.739 28.679 11.111 1.00 15.94 C
-ATOM 226 CG LEU A 28 21.490 30.154 10.741 1.00 16.72 C
-ATOM 227 CD1 LEU A 28 20.008 30.496 10.780 1.00 14.38 C
-ATOM 228 CD2 LEU A 28 22.302 31.074 11.665 1.00 12.81 C
-ATOM 229 N ARG A 29 23.228 25.791 11.121 1.00 16.05 N
-ATOM 230 CA ARG A 29 23.498 24.524 11.798 1.00 18.43 C
-ATOM 231 C ARG A 29 24.980 24.377 12.076 1.00 19.22 C
-ATOM 232 O ARG A 29 25.383 23.987 13.171 1.00 17.97 O
-ATOM 233 CB ARG A 29 23.030 23.334 10.969 1.00 18.63 C
-ATOM 234 CG ARG A 29 21.596 22.983 11.189 1.00 21.26 C
-ATOM 235 CD ARG A 29 21.339 21.572 10.739 1.00 24.71 C
-ATOM 236 NE ARG A 29 20.571 21.564 9.513 1.00 29.88 N
-ATOM 237 CZ ARG A 29 21.019 21.147 8.340 1.00 29.19 C
-ATOM 238 NH1 ARG A 29 22.248 20.682 8.205 1.00 30.52 N
-ATOM 239 NH2 ARG A 29 20.232 21.233 7.295 1.00 31.61 N
-ATOM 240 N LYS A 30 25.790 24.709 11.078 1.00 19.76 N
-ATOM 241 CA LYS A 30 27.235 24.619 11.198 1.00 21.96 C
-ATOM 242 C LYS A 30 27.706 25.418 12.417 1.00 20.91 C
-ATOM 243 O LYS A 30 28.470 24.916 13.239 1.00 22.15 O
-ATOM 244 CB LYS A 30 27.894 25.143 9.915 1.00 25.07 C
-ATOM 245 CG LYS A 30 29.404 25.031 9.905 1.00 30.48 C
-ATOM 246 CD LYS A 30 30.013 25.631 8.639 1.00 35.43 C
-ATOM 247 CE LYS A 30 31.533 25.759 8.778 1.00 37.96 C
-ATOM 248 NZ LYS A 30 32.180 26.388 7.584 1.00 41.61 N
-ATOM 249 N ILE A 31 27.208 26.643 12.544 1.00 18.38 N
-ATOM 250 CA ILE A 31 27.557 27.527 13.652 1.00 16.41 C
-ATOM 251 C ILE A 31 27.105 26.932 14.989 1.00 15.39 C
-ATOM 252 O ILE A 31 27.888 26.855 15.930 1.00 14.90 O
-ATOM 253 CB ILE A 31 26.881 28.920 13.471 1.00 16.63 C
-ATOM 254 CG1 ILE A 31 27.419 29.606 12.208 1.00 18.74 C
-ATOM 255 CG2 ILE A 31 27.071 29.791 14.713 1.00 15.71 C
-ATOM 256 CD1 ILE A 31 26.735 30.946 11.858 1.00 17.27 C
-ATOM 257 N ALA A 32 25.853 26.487 15.048 1.00 13.39 N
-ATOM 258 CA ALA A 32 25.271 25.930 16.267 1.00 12.76 C
-ATOM 259 C ALA A 32 25.994 24.685 16.775 1.00 12.11 C
-ATOM 260 O ALA A 32 26.325 24.598 17.946 1.00 10.54 O
-ATOM 261 CB ALA A 32 23.790 25.638 16.040 1.00 12.45 C
-ATOM 262 N VAL A 33 26.252 23.731 15.886 1.00 11.95 N
-ATOM 263 CA VAL A 33 26.932 22.490 16.256 1.00 13.80 C
-ATOM 264 C VAL A 33 28.328 22.701 16.855 1.00 14.00 C
-ATOM 265 O VAL A 33 28.693 22.048 17.832 1.00 14.07 O
-ATOM 266 CB VAL A 33 27.016 21.504 15.044 1.00 13.56 C
-ATOM 267 CG1 VAL A 33 27.909 20.318 15.375 1.00 16.07 C
-ATOM 268 CG2 VAL A 33 25.621 21.006 14.684 1.00 14.96 C
-ATOM 269 N ALA A 34 29.101 23.620 16.281 1.00 14.73 N
-ATOM 270 CA ALA A 34 30.443 23.898 16.780 1.00 14.95 C
-ATOM 271 C ALA A 34 30.381 24.505 18.178 1.00 15.59 C
-ATOM 272 O ALA A 34 31.120 24.085 19.065 1.00 16.65 O
-ATOM 273 CB ALA A 34 31.191 24.844 15.833 1.00 16.10 C
-ATOM 274 N ALA A 35 29.495 25.480 18.375 1.00 13.20 N
-ATOM 275 CA ALA A 35 29.371 26.134 19.671 1.00 13.04 C
-ATOM 276 C ALA A 35 28.807 25.200 20.749 1.00 12.91 C
-ATOM 277 O ALA A 35 29.245 25.239 21.895 1.00 12.32 O
-ATOM 278 CB ALA A 35 28.517 27.387 19.552 1.00 12.14 C
-ATOM 279 N ALA A 36 27.878 24.332 20.362 1.00 11.40 N
-ATOM 280 CA ALA A 36 27.253 23.416 21.312 1.00 12.63 C
-ATOM 281 C ALA A 36 28.128 22.256 21.770 1.00 13.40 C
-ATOM 282 O ALA A 36 27.743 21.512 22.668 1.00 13.47 O
-ATOM 283 CB ALA A 36 25.952 22.883 20.744 1.00 11.79 C
-ATOM 284 N SER A 37 29.286 22.080 21.148 1.00 13.86 N
-ATOM 285 CA SER A 37 30.169 20.983 21.520 1.00 15.95 C
-ATOM 286 C SER A 37 30.938 21.245 22.818 1.00 16.46 C
-ATOM 287 O SER A 37 31.488 20.320 23.406 1.00 18.23 O
-ATOM 288 CB SER A 37 31.145 20.689 20.388 1.00 16.93 C
-ATOM 289 OG SER A 37 32.100 21.729 20.293 1.00 21.65 O
-ATOM 290 N LYS A 38 30.957 22.496 23.272 1.00 16.91 N
-ATOM 291 CA LYS A 38 31.657 22.869 24.502 1.00 18.36 C
-ATOM 292 C LYS A 38 30.817 23.809 25.382 1.00 15.90 C
-ATOM 293 O LYS A 38 31.175 24.975 25.591 1.00 16.72 O
-ATOM 294 CB LYS A 38 33.004 23.539 24.156 1.00 23.99 C
-ATOM 295 CG LYS A 38 32.907 24.607 23.046 1.00 30.97 C
-ATOM 296 CD LYS A 38 34.250 25.320 22.792 1.00 36.44 C
-ATOM 297 CE LYS A 38 34.266 26.098 21.456 1.00 38.70 C
-ATOM 298 NZ LYS A 38 33.193 27.131 21.321 1.00 39.37 N
-ATOM 299 N PRO A 39 29.669 23.321 25.906 1.00 13.53 N
-ATOM 300 CA PRO A 39 28.851 24.201 26.747 1.00 11.87 C
-ATOM 301 C PRO A 39 29.292 24.248 28.211 1.00 12.05 C
-ATOM 302 O PRO A 39 30.027 23.380 28.676 1.00 12.12 O
-ATOM 303 CB PRO A 39 27.469 23.560 26.649 1.00 9.34 C
-ATOM 304 CG PRO A 39 27.779 22.131 26.593 1.00 10.32 C
-ATOM 305 CD PRO A 39 29.009 22.020 25.703 1.00 10.86 C
-ATOM 306 N ALA A 40 28.921 25.316 28.898 1.00 11.52 N
-ATOM 307 CA ALA A 40 29.192 25.423 30.329 1.00 11.84 C
-ATOM 308 C ALA A 40 27.773 25.329 30.894 1.00 10.23 C
-ATOM 309 O ALA A 40 26.894 26.080 30.478 1.00 10.42 O
-ATOM 310 CB ALA A 40 29.830 26.767 30.673 1.00 11.40 C
-ATOM 311 N VAL A 41 27.518 24.345 31.750 1.00 10.73 N
-ATOM 312 CA VAL A 41 26.185 24.169 32.333 1.00 9.92 C
-ATOM 313 C VAL A 41 26.226 24.295 33.854 1.00 11.64 C
-ATOM 314 O VAL A 41 27.026 23.627 34.514 1.00 11.40 O
-ATOM 315 CB VAL A 41 25.594 22.772 31.987 1.00 10.67 C
-ATOM 316 CG1 VAL A 41 24.204 22.596 32.612 1.00 11.34 C
-ATOM 317 CG2 VAL A 41 25.507 22.583 30.475 1.00 11.31 C
-ATOM 318 N GLU A 42 25.364 25.147 34.399 1.00 10.94 N
-ATOM 319 CA GLU A 42 25.271 25.327 35.845 1.00 12.40 C
-ATOM 320 C GLU A 42 23.837 25.095 36.316 1.00 11.42 C
-ATOM 321 O GLU A 42 22.898 25.720 35.825 1.00 10.46 O
-ATOM 322 CB GLU A 42 25.711 26.721 36.270 1.00 16.26 C
-ATOM 323 CG GLU A 42 25.495 26.947 37.768 1.00 23.78 C
-ATOM 324 CD GLU A 42 25.944 28.311 38.242 1.00 27.94 C
-ATOM 325 OE1 GLU A 42 25.308 29.329 37.872 1.00 29.92 O
-ATOM 326 OE2 GLU A 42 26.935 28.351 39.002 1.00 32.64 O
-ATOM 327 N ILE A 43 23.673 24.176 37.261 1.00 10.55 N
-ATOM 328 CA ILE A 43 22.362 23.864 37.794 1.00 10.69 C
-ATOM 329 C ILE A 43 22.360 24.120 39.300 1.00 11.07 C
-ATOM 330 O ILE A 43 23.307 23.764 39.992 1.00 10.83 O
-ATOM 331 CB ILE A 43 21.996 22.374 37.552 1.00 10.47 C
-ATOM 332 CG1 ILE A 43 21.974 22.072 36.056 1.00 10.46 C
-ATOM 333 CG2 ILE A 43 20.636 22.031 38.186 1.00 10.34 C
-ATOM 334 CD1 ILE A 43 21.607 20.639 35.726 1.00 9.00 C
-ATOM 335 N LYS A 44 21.315 24.784 39.778 1.00 12.26 N
-ATOM 336 CA LYS A 44 21.127 25.051 41.201 1.00 13.96 C
-ATOM 337 C LYS A 44 19.729 24.528 41.516 1.00 14.16 C
-ATOM 338 O LYS A 44 18.749 24.920 40.873 1.00 14.12 O
-ATOM 339 CB LYS A 44 21.220 26.545 41.503 1.00 16.58 C
-ATOM 340 CG LYS A 44 22.580 27.150 41.170 1.00 22.90 C
-ATOM 341 CD LYS A 44 22.571 28.654 41.385 1.00 29.01 C
-ATOM 342 CE LYS A 44 23.890 29.293 40.982 1.00 31.56 C
-ATOM 343 NZ LYS A 44 23.818 30.781 41.111 1.00 34.70 N
-ATOM 344 N GLN A 45 19.649 23.594 42.460 1.00 15.66 N
-ATOM 345 CA GLN A 45 18.377 22.993 42.852 1.00 16.03 C
-ATOM 346 C GLN A 45 18.098 23.182 44.342 1.00 17.60 C
-ATOM 347 O GLN A 45 18.989 23.024 45.164 1.00 17.17 O
-ATOM 348 CB GLN A 45 18.397 21.498 42.544 1.00 15.51 C
-ATOM 349 CG GLN A 45 17.168 20.744 43.015 1.00 13.62 C
-ATOM 350 CD GLN A 45 17.312 19.256 42.838 1.00 15.68 C
-ATOM 351 OE1 GLN A 45 18.348 18.769 42.397 1.00 18.84 O
-ATOM 352 NE2 GLN A 45 16.276 18.521 43.177 1.00 16.73 N
-ATOM 353 N GLU A 46 16.868 23.551 44.670 1.00 18.48 N
-ATOM 354 CA GLU A 46 16.441 23.718 46.062 1.00 21.26 C
-ATOM 355 C GLU A 46 15.108 23.004 46.105 1.00 19.06 C
-ATOM 356 O GLU A 46 14.080 23.589 45.784 1.00 20.08 O
-ATOM 357 CB GLU A 46 16.239 25.194 46.408 1.00 26.45 C
-ATOM 358 CG GLU A 46 17.284 25.787 47.361 1.00 37.46 C
-ATOM 359 CD GLU A 46 17.093 25.374 48.832 1.00 42.24 C
-ATOM 360 OE1 GLU A 46 16.192 25.944 49.501 1.00 44.05 O
-ATOM 361 OE2 GLU A 46 17.867 24.507 49.320 1.00 44.14 O
-ATOM 362 N GLY A 47 15.131 21.720 46.429 1.00 18.35 N
-ATOM 363 CA GLY A 47 13.893 20.970 46.463 1.00 18.96 C
-ATOM 364 C GLY A 47 13.382 20.755 45.053 1.00 18.27 C
-ATOM 365 O GLY A 47 14.067 20.157 44.238 1.00 18.05 O
-ATOM 366 N ASP A 48 12.194 21.262 44.755 1.00 16.66 N
-ATOM 367 CA ASP A 48 11.617 21.107 43.420 1.00 16.86 C
-ATOM 368 C ASP A 48 11.771 22.378 42.566 1.00 15.92 C
-ATOM 369 O ASP A 48 11.139 22.511 41.504 1.00 14.50 O
-ATOM 370 CB ASP A 48 10.136 20.694 43.513 1.00 19.00 C
-ATOM 371 CG ASP A 48 9.943 19.221 43.897 1.00 21.49 C
-ATOM 372 OD1 ASP A 48 10.901 18.406 43.840 1.00 23.51 O
-ATOM 373 OD2 ASP A 48 8.802 18.868 44.243 1.00 25.04 O
-ATOM 374 N THR A 49 12.610 23.299 43.042 1.00 13.75 N
-ATOM 375 CA THR A 49 12.870 24.551 42.348 1.00 13.82 C
-ATOM 376 C THR A 49 14.231 24.460 41.678 1.00 13.22 C
-ATOM 377 O THR A 49 15.235 24.152 42.322 1.00 12.56 O
-ATOM 378 CB THR A 49 12.847 25.741 43.316 1.00 16.10 C
-ATOM 379 OG1 THR A 49 11.556 25.815 43.941 1.00 17.94 O
-ATOM 380 CG2 THR A 49 13.100 27.037 42.571 1.00 16.15 C
-ATOM 381 N PHE A 50 14.266 24.794 40.392 1.00 12.20 N
-ATOM 382 CA PHE A 50 15.485 24.704 39.602 1.00 10.82 C
-ATOM 383 C PHE A 50 15.842 25.979 38.855 1.00 10.40 C
-ATOM 384 O PHE A 50 14.968 26.758 38.460 1.00 9.90 O
-ATOM 385 CB PHE A 50 15.338 23.591 38.547 1.00 10.78 C
-ATOM 386 CG PHE A 50 15.316 22.192 39.107 1.00 13.13 C
-ATOM 387 CD1 PHE A 50 14.146 21.653 39.634 1.00 11.97 C
-ATOM 388 CD2 PHE A 50 16.464 21.401 39.079 1.00 14.34 C
-ATOM 389 CE1 PHE A 50 14.113 20.367 40.120 1.00 12.69 C
-ATOM 390 CE2 PHE A 50 16.439 20.098 39.569 1.00 14.64 C
-ATOM 391 CZ PHE A 50 15.258 19.582 40.092 1.00 13.15 C
-ATOM 392 N TYR A 51 17.147 26.165 38.678 1.00 10.37 N
-ATOM 393 CA TYR A 51 17.709 27.258 37.910 1.00 10.95 C
-ATOM 394 C TYR A 51 18.714 26.513 37.039 1.00 9.84 C
-ATOM 395 O TYR A 51 19.540 25.761 37.547 1.00 9.78 O
-ATOM 396 CB TYR A 51 18.436 28.284 38.790 1.00 12.57 C
-ATOM 397 CG TYR A 51 19.396 29.178 38.014 1.00 12.91 C
-ATOM 398 CD1 TYR A 51 18.939 30.302 37.327 1.00 15.83 C
-ATOM 399 CD2 TYR A 51 20.762 28.896 37.974 1.00 14.05 C
-ATOM 400 CE1 TYR A 51 19.822 31.126 36.621 1.00 16.52 C
-ATOM 401 CE2 TYR A 51 21.655 29.705 37.275 1.00 14.62 C
-ATOM 402 CZ TYR A 51 21.179 30.818 36.604 1.00 16.59 C
-ATOM 403 OH TYR A 51 22.060 31.633 35.932 1.00 17.52 O
-ATOM 404 N ILE A 52 18.610 26.676 35.726 1.00 10.57 N
-ATOM 405 CA ILE A 52 19.520 26.004 34.801 1.00 9.09 C
-ATOM 406 C ILE A 52 20.066 27.020 33.801 1.00 8.55 C
-ATOM 407 O ILE A 52 19.296 27.652 33.086 1.00 10.49 O
-ATOM 408 CB ILE A 52 18.807 24.859 34.026 1.00 8.96 C
-ATOM 409 CG1 ILE A 52 18.242 23.814 35.013 1.00 9.15 C
-ATOM 410 CG2 ILE A 52 19.792 24.189 33.070 1.00 10.39 C
-ATOM 411 CD1 ILE A 52 17.585 22.616 34.366 1.00 8.10 C
-ATOM 412 N LYS A 53 21.388 27.197 33.791 1.00 8.61 N
-ATOM 413 CA LYS A 53 22.049 28.115 32.868 1.00 9.66 C
-ATOM 414 C LYS A 53 22.939 27.319 31.924 1.00 8.71 C
-ATOM 415 O LYS A 53 23.815 26.583 32.362 1.00 7.58 O
-ATOM 416 CB LYS A 53 22.909 29.120 33.611 1.00 10.60 C
-ATOM 417 CG LYS A 53 23.580 30.135 32.688 1.00 14.21 C
-ATOM 418 CD LYS A 53 24.496 31.006 33.505 1.00 20.27 C
-ATOM 419 CE LYS A 53 24.831 32.319 32.828 1.00 26.91 C
-ATOM 420 NZ LYS A 53 25.878 33.009 33.659 1.00 29.12 N
-ATOM 421 N THR A 54 22.686 27.445 30.625 1.00 8.49 N
-ATOM 422 CA THR A 54 23.478 26.747 29.628 1.00 7.98 C
-ATOM 423 C THR A 54 24.118 27.820 28.764 1.00 8.23 C
-ATOM 424 O THR A 54 23.433 28.584 28.087 1.00 8.40 O
-ATOM 425 CB THR A 54 22.621 25.817 28.789 1.00 8.33 C
-ATOM 426 OG1 THR A 54 21.896 24.946 29.660 1.00 9.95 O
-ATOM 427 CG2 THR A 54 23.505 24.976 27.873 1.00 4.95 C
-ATOM 428 N SER A 55 25.444 27.840 28.758 1.00 8.75 N
-ATOM 429 CA SER A 55 26.171 28.865 28.047 1.00 10.50 C
-ATOM 430 C SER A 55 27.116 28.382 26.950 1.00 9.24 C
-ATOM 431 O SER A 55 27.802 27.370 27.101 1.00 8.98 O
-ATOM 432 CB SER A 55 26.934 29.694 29.082 1.00 13.09 C
-ATOM 433 OG SER A 55 27.781 30.646 28.473 1.00 23.11 O
-ATOM 434 N THR A 56 27.091 29.094 25.825 1.00 8.86 N
-ATOM 435 CA THR A 56 27.978 28.831 24.684 1.00 8.05 C
-ATOM 436 C THR A 56 28.393 30.215 24.138 1.00 8.09 C
-ATOM 437 O THR A 56 27.834 31.237 24.525 1.00 7.17 O
-ATOM 438 CB THR A 56 27.296 28.024 23.534 1.00 6.70 C
-ATOM 439 OG1 THR A 56 26.294 28.829 22.909 1.00 9.76 O
-ATOM 440 CG2 THR A 56 26.653 26.751 24.049 1.00 7.76 C
-ATOM 441 N THR A 57 29.381 30.242 23.249 1.00 9.17 N
-ATOM 442 CA THR A 57 29.871 31.485 22.644 1.00 8.49 C
-ATOM 443 C THR A 57 28.820 32.222 21.802 1.00 7.50 C
-ATOM 444 O THR A 57 28.952 33.412 21.565 1.00 9.40 O
-ATOM 445 CB THR A 57 31.091 31.205 21.716 1.00 9.12 C
-ATOM 446 OG1 THR A 57 30.758 30.171 20.786 1.00 9.41 O
-ATOM 447 CG2 THR A 57 32.297 30.775 22.516 1.00 11.48 C
-ATOM 448 N VAL A 58 27.786 31.510 21.356 1.00 8.04 N
-ATOM 449 CA VAL A 58 26.733 32.090 20.500 1.00 9.09 C
-ATOM 450 C VAL A 58 25.328 32.224 21.102 1.00 8.67 C
-ATOM 451 O VAL A 58 24.466 32.892 20.531 1.00 6.97 O
-ATOM 452 CB VAL A 58 26.602 31.287 19.155 1.00 9.96 C
-ATOM 453 CG1 VAL A 58 27.976 31.161 18.454 1.00 11.08 C
-ATOM 454 CG2 VAL A 58 26.010 29.890 19.404 1.00 9.41 C
-ATOM 455 N ARG A 59 25.100 31.620 22.266 1.00 8.88 N
-ATOM 456 CA ARG A 59 23.783 31.655 22.882 1.00 9.95 C
-ATOM 457 C ARG A 59 23.843 31.140 24.303 1.00 10.14 C
-ATOM 458 O ARG A 59 24.440 30.108 24.556 1.00 10.10 O
-ATOM 459 CB ARG A 59 22.837 30.751 22.074 1.00 13.11 C
-ATOM 460 CG ARG A 59 21.417 30.569 22.623 1.00 16.80 C
-ATOM 461 CD ARG A 59 20.521 29.961 21.535 1.00 18.74 C
-ATOM 462 NE ARG A 59 19.250 29.440 22.032 1.00 20.63 N
-ATOM 463 CZ ARG A 59 18.147 30.165 22.193 1.00 22.94 C
-ATOM 464 NH1 ARG A 59 18.138 31.462 21.894 1.00 22.55 N
-ATOM 465 NH2 ARG A 59 17.051 29.594 22.686 1.00 23.68 N
-ATOM 466 N THR A 60 23.183 31.849 25.211 1.00 11.23 N
-ATOM 467 CA THR A 60 23.120 31.458 26.611 1.00 11.84 C
-ATOM 468 C THR A 60 21.650 31.500 27.005 1.00 11.73 C
-ATOM 469 O THR A 60 20.934 32.423 26.620 1.00 13.69 O
-ATOM 470 CB THR A 60 23.916 32.451 27.519 1.00 10.13 C
-ATOM 471 OG1 THR A 60 25.320 32.302 27.276 1.00 10.55 O
-ATOM 472 CG2 THR A 60 23.632 32.181 29.003 1.00 11.01 C
-ATOM 473 N THR A 61 21.183 30.470 27.706 1.00 11.78 N
-ATOM 474 CA THR A 61 19.797 30.413 28.175 1.00 11.54 C
-ATOM 475 C THR A 61 19.831 30.214 29.686 1.00 10.88 C
-ATOM 476 O THR A 61 20.734 29.570 30.205 1.00 9.63 O
-ATOM 477 CB THR A 61 18.965 29.229 27.539 1.00 12.65 C
-ATOM 478 OG1 THR A 61 19.563 27.976 27.874 1.00 14.13 O
-ATOM 479 CG2 THR A 61 18.889 29.336 26.012 1.00 14.15 C
-ATOM 480 N GLU A 62 18.878 30.828 30.382 1.00 12.14 N
-ATOM 481 CA GLU A 62 18.749 30.698 31.833 1.00 12.88 C
-ATOM 482 C GLU A 62 17.283 30.444 32.100 1.00 12.21 C
-ATOM 483 O GLU A 62 16.450 31.270 31.745 1.00 13.95 O
-ATOM 484 CB GLU A 62 19.151 31.990 32.538 1.00 16.15 C
-ATOM 485 CG GLU A 62 20.585 32.344 32.326 1.00 23.65 C
-ATOM 486 CD GLU A 62 20.961 33.649 32.979 1.00 29.90 C
-ATOM 487 OE1 GLU A 62 20.969 33.703 34.229 1.00 31.84 O
-ATOM 488 OE2 GLU A 62 21.258 34.616 32.236 1.00 33.89 O
-ATOM 489 N ILE A 63 16.943 29.292 32.657 1.00 10.43 N
-ATOM 490 CA ILE A 63 15.548 29.021 32.946 1.00 11.02 C
-ATOM 491 C ILE A 63 15.352 28.816 34.446 1.00 11.60 C
-ATOM 492 O ILE A 63 16.286 28.434 35.144 1.00 9.20 O
-ATOM 493 CB ILE A 63 14.976 27.816 32.125 1.00 11.28 C
-ATOM 494 CG1 ILE A 63 15.717 26.519 32.431 1.00 10.60 C
-ATOM 495 CG2 ILE A 63 15.020 28.129 30.638 1.00 11.62 C
-ATOM 496 CD1 ILE A 63 15.126 25.293 31.720 1.00 13.40 C
-ATOM 497 N ASN A 64 14.184 29.219 34.933 1.00 12.13 N
-ATOM 498 CA ASN A 64 13.824 29.083 36.343 1.00 14.79 C
-ATOM 499 C ASN A 64 12.451 28.441 36.375 1.00 13.29 C
-ATOM 500 O ASN A 64 11.490 28.976 35.802 1.00 13.29 O
-ATOM 501 CB ASN A 64 13.732 30.450 37.054 1.00 16.87 C
-ATOM 502 CG ASN A 64 15.079 31.089 37.279 1.00 20.91 C
-ATOM 503 OD1 ASN A 64 15.775 30.764 38.238 1.00 22.91 O
-ATOM 504 ND2 ASN A 64 15.459 32.007 36.393 1.00 22.20 N
-ATOM 505 N PHE A 65 12.347 27.301 37.044 1.00 12.90 N
-ATOM 506 CA PHE A 65 11.058 26.641 37.132 1.00 12.63 C
-ATOM 507 C PHE A 65 10.858 25.841 38.410 1.00 13.07 C
-ATOM 508 O PHE A 65 11.811 25.531 39.121 1.00 12.50 O
-ATOM 509 CB PHE A 65 10.829 25.731 35.922 1.00 11.31 C
-ATOM 510 CG PHE A 65 11.794 24.586 35.825 1.00 12.32 C
-ATOM 511 CD1 PHE A 65 11.549 23.386 36.494 1.00 10.31 C
-ATOM 512 CD2 PHE A 65 12.947 24.706 35.070 1.00 11.23 C
-ATOM 513 CE1 PHE A 65 12.441 22.329 36.413 1.00 11.00 C
-ATOM 514 CE2 PHE A 65 13.847 23.645 34.984 1.00 11.69 C
-ATOM 515 CZ PHE A 65 13.593 22.461 35.655 1.00 12.20 C
-ATOM 516 N LYS A 66 9.599 25.560 38.713 1.00 13.15 N
-ATOM 517 CA LYS A 66 9.251 24.735 39.849 1.00 13.41 C
-ATOM 518 C LYS A 66 8.555 23.552 39.178 1.00 12.17 C
-ATOM 519 O LYS A 66 7.763 23.747 38.251 1.00 12.93 O
-ATOM 520 CB LYS A 66 8.313 25.498 40.800 1.00 16.68 C
-ATOM 521 CG LYS A 66 7.722 24.639 41.907 1.00 24.60 C
-ATOM 522 CD LYS A 66 7.391 25.453 43.165 1.00 28.53 C
-ATOM 523 CE LYS A 66 6.664 24.585 44.213 1.00 32.17 C
-ATOM 524 NZ LYS A 66 7.393 23.332 44.604 1.00 32.54 N
-ATOM 525 N VAL A 67 8.918 22.329 39.562 1.00 11.82 N
-ATOM 526 CA VAL A 67 8.295 21.141 38.975 1.00 10.93 C
-ATOM 527 C VAL A 67 6.783 21.174 39.226 1.00 11.97 C
-ATOM 528 O VAL A 67 6.343 21.480 40.342 1.00 13.54 O
-ATOM 529 CB VAL A 67 8.908 19.827 39.541 1.00 10.09 C
-ATOM 530 CG1 VAL A 67 8.271 18.617 38.883 1.00 10.96 C
-ATOM 531 CG2 VAL A 67 10.410 19.808 39.320 1.00 10.21 C
-ATOM 532 N GLY A 68 6.006 20.965 38.160 1.00 9.80 N
-ATOM 533 CA GLY A 68 4.557 20.962 38.265 1.00 9.33 C
-ATOM 534 C GLY A 68 3.887 22.298 38.031 1.00 10.60 C
-ATOM 535 O GLY A 68 2.653 22.389 38.039 1.00 11.93 O
-ATOM 536 N GLU A 69 4.688 23.337 37.809 1.00 11.12 N
-ATOM 537 CA GLU A 69 4.165 24.682 37.553 1.00 12.64 C
-ATOM 538 C GLU A 69 4.604 25.185 36.184 1.00 13.09 C
-ATOM 539 O GLU A 69 5.774 25.107 35.820 1.00 12.17 O
-ATOM 540 CB GLU A 69 4.578 25.642 38.668 1.00 12.20 C
-ATOM 541 CG GLU A 69 3.857 25.282 39.964 1.00 17.44 C
-ATOM 542 CD GLU A 69 4.116 26.211 41.138 1.00 21.02 C
-ATOM 543 OE1 GLU A 69 4.496 27.384 40.945 1.00 21.43 O
-ATOM 544 OE2 GLU A 69 3.902 25.753 42.282 1.00 23.44 O
-ATOM 545 N GLU A 70 3.633 25.622 35.397 1.00 14.53 N
-ATOM 546 CA GLU A 70 3.912 26.102 34.059 1.00 15.80 C
-ATOM 547 C GLU A 70 4.816 27.329 34.007 1.00 13.72 C
-ATOM 548 O GLU A 70 4.761 28.208 34.863 1.00 13.66 O
-ATOM 549 CB GLU A 70 2.606 26.359 33.320 1.00 19.99 C
-ATOM 550 CG GLU A 70 2.814 26.634 31.851 1.00 28.23 C
-ATOM 551 CD GLU A 70 1.518 26.678 31.097 1.00 32.73 C
-ATOM 552 OE1 GLU A 70 0.975 25.589 30.789 1.00 35.76 O
-ATOM 553 OE2 GLU A 70 1.045 27.802 30.823 1.00 35.75 O
-ATOM 554 N PHE A 71 5.713 27.340 33.028 1.00 12.80 N
-ATOM 555 CA PHE A 71 6.638 28.448 32.837 1.00 12.36 C
-ATOM 556 C PHE A 71 6.856 28.678 31.350 1.00 12.97 C
-ATOM 557 O PHE A 71 6.382 27.917 30.516 1.00 12.54 O
-ATOM 558 CB PHE A 71 7.975 28.243 33.589 1.00 10.02 C
-ATOM 559 CG PHE A 71 8.851 27.148 33.033 1.00 10.48 C
-ATOM 560 CD1 PHE A 71 8.549 25.815 33.256 1.00 9.95 C
-ATOM 561 CD2 PHE A 71 10.006 27.459 32.331 1.00 9.29 C
-ATOM 562 CE1 PHE A 71 9.380 24.811 32.793 1.00 9.74 C
-ATOM 563 CE2 PHE A 71 10.832 26.464 31.868 1.00 9.51 C
-ATOM 564 CZ PHE A 71 10.518 25.136 32.102 1.00 8.47 C
-ATOM 565 N GLU A 72 7.581 29.733 31.028 1.00 15.04 N
-ATOM 566 CA GLU A 72 7.826 30.063 29.644 1.00 17.19 C
-ATOM 567 C GLU A 72 9.323 30.036 29.357 1.00 15.53 C
-ATOM 568 O GLU A 72 10.130 30.511 30.158 1.00 16.16 O
-ATOM 569 CB GLU A 72 7.248 31.448 29.379 1.00 22.03 C
-ATOM 570 CG GLU A 72 6.700 31.658 28.002 1.00 30.80 C
-ATOM 571 CD GLU A 72 6.157 33.060 27.827 1.00 34.75 C
-ATOM 572 OE1 GLU A 72 5.014 33.309 28.276 1.00 35.88 O
-ATOM 573 OE2 GLU A 72 6.885 33.912 27.255 1.00 38.91 O
-ATOM 574 N GLU A 73 9.691 29.378 28.263 1.00 13.46 N
-ATOM 575 CA GLU A 73 11.088 29.302 27.836 1.00 13.89 C
-ATOM 576 C GLU A 73 11.083 29.318 26.301 1.00 13.70 C
-ATOM 577 O GLU A 73 10.159 29.859 25.690 1.00 13.63 O
-ATOM 578 CB GLU A 73 11.780 28.032 28.379 1.00 12.63 C
-ATOM 579 CG GLU A 73 11.145 26.706 27.986 1.00 10.55 C
-ATOM 580 CD GLU A 73 11.997 25.499 28.366 1.00 8.94 C
-ATOM 581 OE1 GLU A 73 13.191 25.650 28.642 1.00 12.29 O
-ATOM 582 OE2 GLU A 73 11.485 24.374 28.363 1.00 10.37 O
-ATOM 583 N GLN A 74 12.115 28.751 25.685 1.00 13.09 N
-ATOM 584 CA GLN A 74 12.187 28.691 24.239 1.00 13.16 C
-ATOM 585 C GLN A 74 12.618 27.315 23.806 1.00 12.86 C
-ATOM 586 O GLN A 74 13.290 26.596 24.552 1.00 13.17 O
-ATOM 587 CB GLN A 74 13.218 29.685 23.706 1.00 15.91 C
-ATOM 588 CG GLN A 74 12.803 31.133 23.779 1.00 19.68 C
-ATOM 589 CD GLN A 74 13.827 32.066 23.159 1.00 21.00 C
-ATOM 590 OE1 GLN A 74 15.010 31.730 23.024 1.00 22.37 O
-ATOM 591 NE2 GLN A 74 13.373 33.247 22.774 1.00 24.07 N
-ATOM 592 N THR A 75 12.229 26.935 22.600 1.00 10.98 N
-ATOM 593 CA THR A 75 12.664 25.656 22.056 1.00 11.83 C
-ATOM 594 C THR A 75 14.162 25.828 21.729 1.00 11.24 C
-ATOM 595 O THR A 75 14.681 26.951 21.764 1.00 9.95 O
-ATOM 596 CB THR A 75 11.895 25.325 20.757 1.00 11.93 C
-ATOM 597 OG1 THR A 75 12.123 26.366 19.795 1.00 13.31 O
-ATOM 598 CG2 THR A 75 10.396 25.202 21.042 1.00 13.29 C
-ATOM 599 N VAL A 76 14.841 24.731 21.377 1.00 13.77 N
-ATOM 600 CA VAL A 76 16.278 24.762 21.049 1.00 14.39 C
-ATOM 601 C VAL A 76 16.612 25.734 19.914 1.00 12.97 C
-ATOM 602 O VAL A 76 17.639 26.407 19.956 1.00 13.75 O
-ATOM 603 CB VAL A 76 16.827 23.351 20.680 1.00 15.44 C
-ATOM 604 CG1 VAL A 76 18.332 23.314 20.844 1.00 17.74 C
-ATOM 605 CG2 VAL A 76 16.218 22.293 21.548 1.00 19.99 C
-ATOM 606 N ASP A 77 15.730 25.824 18.921 1.00 13.67 N
-ATOM 607 CA ASP A 77 15.933 26.727 17.789 1.00 14.47 C
-ATOM 608 C ASP A 77 15.486 28.172 18.061 1.00 15.23 C
-ATOM 609 O ASP A 77 15.461 29.002 17.153 1.00 14.90 O
-ATOM 610 CB ASP A 77 15.301 26.158 16.503 1.00 15.63 C
-ATOM 611 CG ASP A 77 13.790 26.007 16.585 1.00 15.92 C
-ATOM 612 OD1 ASP A 77 13.260 25.470 17.586 1.00 14.64 O
-ATOM 613 OD2 ASP A 77 13.123 26.409 15.613 1.00 17.79 O
-ATOM 614 N GLY A 78 15.095 28.445 19.312 1.00 15.17 N
-ATOM 615 CA GLY A 78 14.709 29.790 19.726 1.00 15.90 C
-ATOM 616 C GLY A 78 13.268 30.281 19.701 1.00 16.89 C
-ATOM 617 O GLY A 78 13.038 31.489 19.790 1.00 19.37 O
-ATOM 618 N ARG A 79 12.292 29.389 19.620 1.00 16.76 N
-ATOM 619 CA ARG A 79 10.896 29.822 19.587 1.00 18.08 C
-ATOM 620 C ARG A 79 10.229 29.768 20.961 1.00 16.55 C
-ATOM 621 O ARG A 79 10.379 28.787 21.680 1.00 16.57 O
-ATOM 622 CB ARG A 79 10.112 28.961 18.604 1.00 20.74 C
-ATOM 623 CG ARG A 79 10.667 28.997 17.194 1.00 25.89 C
-ATOM 624 CD ARG A 79 9.986 27.976 16.310 1.00 29.77 C
-ATOM 625 NE ARG A 79 10.144 26.626 16.842 1.00 34.52 N
-ATOM 626 CZ ARG A 79 10.128 25.516 16.109 1.00 35.90 C
-ATOM 627 NH1 ARG A 79 9.971 25.580 14.789 1.00 37.70 N
-ATOM 628 NH2 ARG A 79 10.266 24.337 16.702 1.00 35.58 N
-ATOM 629 N PRO A 80 9.501 30.830 21.352 1.00 15.98 N
-ATOM 630 CA PRO A 80 8.819 30.867 22.651 1.00 15.47 C
-ATOM 631 C PRO A 80 7.825 29.725 22.833 1.00 14.23 C
-ATOM 632 O PRO A 80 7.058 29.393 21.926 1.00 14.56 O
-ATOM 633 CB PRO A 80 8.100 32.220 22.628 1.00 15.48 C
-ATOM 634 CG PRO A 80 9.010 33.057 21.846 1.00 18.18 C
-ATOM 635 CD PRO A 80 9.418 32.145 20.696 1.00 17.08 C
-ATOM 636 N CYS A 81 7.817 29.148 24.028 1.00 13.52 N
-ATOM 637 CA CYS A 81 6.914 28.055 24.331 1.00 12.41 C
-ATOM 638 C CYS A 81 6.548 28.054 25.811 1.00 12.52 C
-ATOM 639 O CYS A 81 7.202 28.718 26.624 1.00 11.74 O
-ATOM 640 CB CYS A 81 7.563 26.705 23.950 1.00 11.59 C
-ATOM 641 SG CYS A 81 9.063 26.255 24.894 1.00 12.86 S
-ATOM 642 N LYS A 82 5.448 27.379 26.121 1.00 13.86 N
-ATOM 643 CA LYS A 82 4.988 27.197 27.492 1.00 14.38 C
-ATOM 644 C LYS A 82 5.436 25.779 27.839 1.00 13.51 C
-ATOM 645 O LYS A 82 5.227 24.842 27.063 1.00 12.69 O
-ATOM 646 CB LYS A 82 3.473 27.299 27.589 1.00 18.36 C
-ATOM 647 CG LYS A 82 2.940 28.716 27.584 1.00 26.02 C
-ATOM 648 CD LYS A 82 3.353 29.506 28.826 1.00 31.13 C
-ATOM 649 CE LYS A 82 2.686 30.894 28.832 1.00 35.39 C
-ATOM 650 NZ LYS A 82 2.868 31.652 30.120 1.00 37.63 N
-ATOM 651 N SER A 83 6.110 25.638 28.974 1.00 11.15 N
-ATOM 652 CA SER A 83 6.624 24.352 29.397 1.00 10.10 C
-ATOM 653 C SER A 83 6.083 23.931 30.752 1.00 11.16 C
-ATOM 654 O SER A 83 5.721 24.769 31.575 1.00 10.21 O
-ATOM 655 CB SER A 83 8.149 24.418 29.446 1.00 10.30 C
-ATOM 656 OG SER A 83 8.686 24.518 28.132 1.00 11.50 O
-ATOM 657 N LEU A 84 6.028 22.620 30.954 1.00 11.17 N
-ATOM 658 CA LEU A 84 5.557 22.016 32.192 1.00 11.84 C
-ATOM 659 C LEU A 84 6.427 20.793 32.470 1.00 10.42 C
-ATOM 660 O LEU A 84 6.444 19.846 31.684 1.00 11.20 O
-ATOM 661 CB LEU A 84 4.091 21.576 32.067 1.00 13.44 C
-ATOM 662 CG LEU A 84 3.552 20.784 33.270 1.00 15.74 C
-ATOM 663 CD1 LEU A 84 3.515 21.683 34.484 1.00 16.96 C
-ATOM 664 CD2 LEU A 84 2.178 20.231 32.982 1.00 18.76 C
-ATOM 665 N VAL A 85 7.146 20.828 33.589 1.00 9.60 N
-ATOM 666 CA VAL A 85 8.028 19.738 34.006 1.00 9.50 C
-ATOM 667 C VAL A 85 7.344 18.878 35.082 1.00 9.74 C
-ATOM 668 O VAL A 85 6.680 19.404 35.985 1.00 9.28 O
-ATOM 669 CB VAL A 85 9.384 20.291 34.598 1.00 8.89 C
-ATOM 670 CG1 VAL A 85 10.327 19.140 34.970 1.00 8.20 C
-ATOM 671 CG2 VAL A 85 10.062 21.227 33.612 1.00 8.48 C
-ATOM 672 N LYS A 86 7.504 17.563 34.971 1.00 9.96 N
-ATOM 673 CA LYS A 86 6.946 16.621 35.945 1.00 11.92 C
-ATOM 674 C LYS A 86 8.003 15.558 36.247 1.00 11.88 C
-ATOM 675 O LYS A 86 8.917 15.340 35.453 1.00 11.00 O
-ATOM 676 CB LYS A 86 5.700 15.911 35.385 1.00 12.40 C
-ATOM 677 CG LYS A 86 4.538 16.819 35.058 1.00 16.01 C
-ATOM 678 CD LYS A 86 3.333 16.017 34.559 1.00 21.36 C
-ATOM 679 CE LYS A 86 2.140 16.939 34.345 1.00 23.23 C
-ATOM 680 NZ LYS A 86 0.919 16.212 33.929 1.00 28.41 N
-ATOM 681 N TRP A 87 7.868 14.889 37.386 1.00 10.75 N
-ATOM 682 CA TRP A 87 8.775 13.811 37.738 1.00 9.53 C
-ATOM 683 C TRP A 87 8.238 12.559 37.052 1.00 9.89 C
-ATOM 684 O TRP A 87 7.144 12.107 37.370 1.00 11.80 O
-ATOM 685 CB TRP A 87 8.791 13.569 39.268 1.00 8.76 C
-ATOM 686 CG TRP A 87 9.494 14.641 40.062 1.00 8.86 C
-ATOM 687 CD1 TRP A 87 8.923 15.525 40.939 1.00 8.80 C
-ATOM 688 CD2 TRP A 87 10.889 14.990 39.992 1.00 9.42 C
-ATOM 689 NE1 TRP A 87 9.872 16.410 41.400 1.00 8.01 N
-ATOM 690 CE2 TRP A 87 11.086 16.103 40.835 1.00 10.85 C
-ATOM 691 CE3 TRP A 87 11.985 14.475 39.283 1.00 9.60 C
-ATOM 692 CZ2 TRP A 87 12.340 16.716 40.994 1.00 11.45 C
-ATOM 693 CZ3 TRP A 87 13.230 15.084 39.438 1.00 10.72 C
-ATOM 694 CH2 TRP A 87 13.395 16.192 40.289 1.00 11.78 C
-ATOM 695 N GLU A 88 8.954 12.040 36.064 1.00 9.93 N
-ATOM 696 CA GLU A 88 8.526 10.807 35.416 1.00 11.30 C
-ATOM 697 C GLU A 88 8.826 9.726 36.448 1.00 11.75 C
-ATOM 698 O GLU A 88 8.068 8.784 36.623 1.00 12.78 O
-ATOM 699 CB GLU A 88 9.337 10.541 34.156 1.00 13.50 C
-ATOM 700 CG GLU A 88 8.917 9.261 33.454 1.00 18.67 C
-ATOM 701 CD GLU A 88 9.756 8.958 32.226 1.00 23.49 C
-ATOM 702 OE1 GLU A 88 9.581 9.650 31.205 1.00 26.53 O
-ATOM 703 OE2 GLU A 88 10.587 8.025 32.276 1.00 26.54 O
-ATOM 704 N SER A 89 9.972 9.870 37.103 1.00 11.49 N
-ATOM 705 CA SER A 89 10.402 8.954 38.158 1.00 11.10 C
-ATOM 706 C SER A 89 11.206 9.776 39.163 1.00 11.14 C
-ATOM 707 O SER A 89 11.397 10.983 38.979 1.00 9.92 O
-ATOM 708 CB SER A 89 11.221 7.778 37.604 1.00 12.43 C
-ATOM 709 OG SER A 89 12.396 8.215 36.947 1.00 14.39 O
-ATOM 710 N GLU A 90 11.674 9.130 40.227 1.00 10.17 N
-ATOM 711 CA GLU A 90 12.433 9.826 41.254 1.00 10.83 C
-ATOM 712 C GLU A 90 13.657 10.629 40.772 1.00 9.86 C
-ATOM 713 O GLU A 90 13.932 11.715 41.289 1.00 10.30 O
-ATOM 714 CB GLU A 90 12.858 8.846 42.348 1.00 11.92 C
-ATOM 715 CG GLU A 90 13.536 9.572 43.487 1.00 16.53 C
-ATOM 716 CD GLU A 90 13.912 8.671 44.644 1.00 19.80 C
-ATOM 717 OE1 GLU A 90 14.122 7.464 44.426 1.00 21.18 O
-ATOM 718 OE2 GLU A 90 14.012 9.187 45.774 1.00 22.91 O
-ATOM 719 N ASN A 91 14.376 10.102 39.783 1.00 8.79 N
-ATOM 720 CA ASN A 91 15.578 10.767 39.274 1.00 10.50 C
-ATOM 721 C ASN A 91 15.455 11.289 37.855 1.00 9.69 C
-ATOM 722 O ASN A 91 16.467 11.627 37.246 1.00 7.10 O
-ATOM 723 CB ASN A 91 16.760 9.798 39.305 1.00 14.33 C
-ATOM 724 CG ASN A 91 17.064 9.307 40.693 1.00 17.71 C
-ATOM 725 OD1 ASN A 91 17.445 10.087 41.560 1.00 20.87 O
-ATOM 726 ND2 ASN A 91 16.855 8.016 40.928 1.00 19.39 N
-ATOM 727 N LYS A 92 14.230 11.387 37.352 1.00 8.60 N
-ATOM 728 CA LYS A 92 14.016 11.835 35.981 1.00 8.88 C
-ATOM 729 C LYS A 92 12.861 12.812 35.807 1.00 8.61 C
-ATOM 730 O LYS A 92 11.721 12.511 36.168 1.00 8.95 O
-ATOM 731 CB LYS A 92 13.781 10.626 35.078 1.00 9.10 C
-ATOM 732 CG LYS A 92 13.566 10.996 33.618 1.00 11.95 C
-ATOM 733 CD LYS A 92 13.467 9.762 32.759 1.00 14.04 C
-ATOM 734 CE LYS A 92 13.333 10.124 31.299 1.00 16.33 C
-ATOM 735 NZ LYS A 92 13.129 8.884 30.506 1.00 17.37 N
-ATOM 736 N MET A 93 13.172 13.988 35.268 1.00 7.58 N
-ATOM 737 CA MET A 93 12.159 14.985 34.995 1.00 8.21 C
-ATOM 738 C MET A 93 11.915 15.038 33.496 1.00 9.18 C
-ATOM 739 O MET A 93 12.833 14.838 32.690 1.00 7.74 O
-ATOM 740 CB MET A 93 12.565 16.359 35.523 1.00 9.68 C
-ATOM 741 CG MET A 93 13.826 16.925 34.937 1.00 13.16 C
-ATOM 742 SD MET A 93 14.238 18.543 35.628 1.00 17.49 S
-ATOM 743 CE MET A 93 15.009 18.106 37.076 1.00 18.53 C
-ATOM 744 N VAL A 94 10.658 15.239 33.128 1.00 9.48 N
-ATOM 745 CA VAL A 94 10.266 15.334 31.726 1.00 9.55 C
-ATOM 746 C VAL A 94 9.516 16.639 31.528 1.00 10.10 C
-ATOM 747 O VAL A 94 8.683 17.024 32.364 1.00 9.47 O
-ATOM 748 CB VAL A 94 9.371 14.164 31.315 1.00 11.05 C
-ATOM 749 CG1 VAL A 94 8.878 14.354 29.878 1.00 12.88 C
-ATOM 750 CG2 VAL A 94 10.147 12.866 31.420 1.00 14.00 C
-ATOM 751 N CYS A 95 9.802 17.312 30.413 1.00 9.49 N
-ATOM 752 CA CYS A 95 9.169 18.582 30.094 1.00 8.82 C
-ATOM 753 C CYS A 95 8.431 18.559 28.758 1.00 11.70 C
-ATOM 754 O CYS A 95 9.014 18.215 27.723 1.00 12.29 O
-ATOM 755 CB CYS A 95 10.229 19.679 30.059 1.00 8.79 C
-ATOM 756 SG CYS A 95 9.620 21.322 29.690 1.00 10.97 S
-ATOM 757 N GLU A 96 7.149 18.902 28.791 1.00 10.87 N
-ATOM 758 CA GLU A 96 6.342 18.962 27.587 1.00 14.78 C
-ATOM 759 C GLU A 96 6.267 20.439 27.182 1.00 13.83 C
-ATOM 760 O GLU A 96 6.044 21.311 28.030 1.00 12.79 O
-ATOM 761 CB GLU A 96 4.957 18.397 27.885 1.00 20.21 C
-ATOM 762 CG GLU A 96 3.981 18.432 26.726 1.00 32.46 C
-ATOM 763 CD GLU A 96 2.646 17.765 27.065 1.00 38.97 C
-ATOM 764 OE1 GLU A 96 2.053 18.108 28.128 1.00 42.61 O
-ATOM 765 OE2 GLU A 96 2.201 16.892 26.271 1.00 42.17 O
-ATOM 766 N GLN A 97 6.513 20.725 25.903 1.00 13.39 N
-ATOM 767 CA GLN A 97 6.489 22.100 25.402 1.00 13.55 C
-ATOM 768 C GLN A 97 5.357 22.334 24.400 1.00 15.88 C
-ATOM 769 O GLN A 97 5.013 21.455 23.591 1.00 16.25 O
-ATOM 770 CB GLN A 97 7.823 22.465 24.747 1.00 12.20 C
-ATOM 771 CG GLN A 97 9.033 22.324 25.650 1.00 12.55 C
-ATOM 772 CD GLN A 97 10.321 22.613 24.927 1.00 14.20 C
-ATOM 773 OE1 GLN A 97 10.478 22.288 23.749 1.00 12.94 O
-ATOM 774 NE2 GLN A 97 11.260 23.235 25.627 1.00 14.75 N
-ATOM 775 N LYS A 98 4.801 23.541 24.450 1.00 17.30 N
-ATOM 776 CA LYS A 98 3.696 23.952 23.582 1.00 19.78 C
-ATOM 777 C LYS A 98 3.990 25.340 23.019 1.00 18.56 C
-ATOM 778 O LYS A 98 4.162 26.293 23.771 1.00 17.70 O
-ATOM 779 CB LYS A 98 2.389 23.953 24.389 1.00 23.30 C
-ATOM 780 CG LYS A 98 1.294 24.857 23.867 1.00 30.94 C
-ATOM 781 CD LYS A 98 0.210 25.047 24.934 1.00 37.10 C
-ATOM 782 CE LYS A 98 -0.849 26.072 24.520 1.00 39.73 C
-ATOM 783 NZ LYS A 98 -0.326 27.476 24.541 1.00 42.46 N
-ATOM 784 N LEU A 99 4.073 25.445 21.696 1.00 19.35 N
-ATOM 785 CA LEU A 99 4.357 26.721 21.041 1.00 21.32 C
-ATOM 786 C LEU A 99 3.307 27.770 21.351 1.00 22.86 C
-ATOM 787 O LEU A 99 2.108 27.496 21.261 1.00 23.41 O
-ATOM 788 CB LEU A 99 4.466 26.542 19.526 1.00 22.09 C
-ATOM 789 CG LEU A 99 5.692 25.792 18.997 1.00 22.72 C
-ATOM 790 CD1 LEU A 99 5.585 25.639 17.490 1.00 23.04 C
-ATOM 791 CD2 LEU A 99 6.951 26.548 19.372 1.00 23.61 C
-ATOM 792 N LEU A 100 3.767 28.962 21.722 1.00 24.11 N
-ATOM 793 CA LEU A 100 2.879 30.070 22.051 1.00 27.59 C
-ATOM 794 C LEU A 100 2.130 30.545 20.815 1.00 30.94 C
-ATOM 795 O LEU A 100 0.951 30.908 20.877 1.00 31.34 O
-ATOM 796 CB LEU A 100 3.680 31.227 22.640 1.00 25.50 C
-ATOM 797 CG LEU A 100 4.254 30.947 24.020 1.00 24.80 C
-ATOM 798 CD1 LEU A 100 4.960 32.171 24.542 1.00 26.59 C
-ATOM 799 CD2 LEU A 100 3.141 30.554 24.935 1.00 24.80 C
-ATOM 800 N LYS A 101 2.835 30.531 19.689 1.00 34.60 N
-ATOM 801 CA LYS A 101 2.282 30.961 18.413 1.00 37.81 C
-ATOM 802 C LYS A 101 2.847 30.088 17.292 1.00 37.39 C
-ATOM 803 O LYS A 101 4.019 29.687 17.319 1.00 37.22 O
-ATOM 804 CB LYS A 101 2.653 32.429 18.147 1.00 40.57 C
-ATOM 805 CG LYS A 101 2.182 33.426 19.212 1.00 45.13 C
-ATOM 806 CD LYS A 101 2.955 34.741 19.125 1.00 48.57 C
-ATOM 807 CE LYS A 101 4.479 34.527 19.248 1.00 51.31 C
-ATOM 808 NZ LYS A 101 4.917 33.952 20.559 1.00 51.14 N
-ATOM 809 N GLY A 102 1.997 29.786 16.318 1.00 37.21 N
-ATOM 810 CA GLY A 102 2.423 28.993 15.184 1.00 36.82 C
-ATOM 811 C GLY A 102 2.333 27.494 15.344 1.00 36.36 C
-ATOM 812 O GLY A 102 1.690 26.977 16.265 1.00 35.74 O
-ATOM 813 N GLU A 103 2.954 26.803 14.395 1.00 35.74 N
-ATOM 814 CA GLU A 103 2.988 25.348 14.377 1.00 35.50 C
-ATOM 815 C GLU A 103 4.418 24.880 14.140 1.00 31.92 C
-ATOM 816 O GLU A 103 5.281 25.654 13.723 1.00 31.61 O
-ATOM 817 CB GLU A 103 2.077 24.784 13.274 1.00 39.37 C
-ATOM 818 CG GLU A 103 0.652 24.422 13.712 1.00 45.52 C
-ATOM 819 CD GLU A 103 -0.383 25.503 13.395 1.00 50.23 C
-ATOM 820 OE1 GLU A 103 -0.130 26.346 12.499 1.00 53.12 O
-ATOM 821 OE2 GLU A 103 -1.464 25.500 14.036 1.00 52.16 O
-ATOM 822 N GLY A 104 4.653 23.604 14.414 1.00 28.97 N
-ATOM 823 CA GLY A 104 5.967 23.024 14.231 1.00 25.41 C
-ATOM 824 C GLY A 104 6.012 21.648 14.863 1.00 22.09 C
-ATOM 825 O GLY A 104 4.987 21.160 15.347 1.00 21.89 O
-ATOM 826 N PRO A 105 7.176 20.976 14.832 1.00 19.50 N
-ATOM 827 CA PRO A 105 7.338 19.640 15.418 1.00 17.92 C
-ATOM 828 C PRO A 105 7.020 19.664 16.914 1.00 15.61 C
-ATOM 829 O PRO A 105 7.170 20.696 17.567 1.00 14.42 O
-ATOM 830 CB PRO A 105 8.828 19.348 15.202 1.00 18.86 C
-ATOM 831 CG PRO A 105 9.188 20.164 14.005 1.00 18.76 C
-ATOM 832 CD PRO A 105 8.423 21.440 14.199 1.00 18.40 C
-ATOM 833 N LYS A 106 6.552 18.541 17.444 1.00 16.02 N
-ATOM 834 CA LYS A 106 6.255 18.453 18.868 1.00 16.93 C
-ATOM 835 C LYS A 106 7.609 18.305 19.554 1.00 15.49 C
-ATOM 836 O LYS A 106 8.397 17.437 19.183 1.00 14.76 O
-ATOM 837 CB LYS A 106 5.387 17.229 19.174 1.00 20.98 C
-ATOM 838 CG LYS A 106 5.015 17.097 20.662 1.00 27.98 C
-ATOM 839 CD LYS A 106 4.463 18.433 21.229 1.00 33.23 C
-ATOM 840 CE LYS A 106 4.250 18.417 22.764 1.00 35.21 C
-ATOM 841 NZ LYS A 106 5.519 18.251 23.566 1.00 33.75 N
-ATOM 842 N THR A 107 7.907 19.167 20.515 1.00 13.91 N
-ATOM 843 CA THR A 107 9.203 19.086 21.190 1.00 12.14 C
-ATOM 844 C THR A 107 9.083 18.819 22.681 1.00 11.66 C
-ATOM 845 O THR A 107 8.061 19.120 23.295 1.00 10.59 O
-ATOM 846 CB THR A 107 10.012 20.382 21.016 1.00 12.37 C
-ATOM 847 OG1 THR A 107 9.263 21.480 21.547 1.00 12.36 O
-ATOM 848 CG2 THR A 107 10.327 20.643 19.544 1.00 12.62 C
-ATOM 849 N SER A 108 10.140 18.249 23.250 1.00 10.16 N
-ATOM 850 CA SER A 108 10.192 17.975 24.681 1.00 9.98 C
-ATOM 851 C SER A 108 11.649 17.774 25.081 1.00 9.90 C
-ATOM 852 O SER A 108 12.549 17.774 24.227 1.00 8.48 O
-ATOM 853 CB SER A 108 9.370 16.729 25.024 1.00 9.84 C
-ATOM 854 OG SER A 108 9.844 15.601 24.313 1.00 13.87 O
-ATOM 855 N TRP A 109 11.890 17.708 26.386 1.00 7.96 N
-ATOM 856 CA TRP A 109 13.233 17.446 26.894 1.00 7.85 C
-ATOM 857 C TRP A 109 13.109 16.693 28.209 1.00 7.56 C
-ATOM 858 O TRP A 109 12.053 16.728 28.837 1.00 8.14 O
-ATOM 859 CB TRP A 109 14.094 18.722 27.051 1.00 8.25 C
-ATOM 860 CG TRP A 109 13.627 19.829 28.007 1.00 8.07 C
-ATOM 861 CD1 TRP A 109 13.120 21.046 27.648 1.00 9.28 C
-ATOM 862 CD2 TRP A 109 13.745 19.865 29.450 1.00 9.31 C
-ATOM 863 NE1 TRP A 109 12.929 21.836 28.760 1.00 9.69 N
-ATOM 864 CE2 TRP A 109 13.306 21.136 29.878 1.00 9.04 C
-ATOM 865 CE3 TRP A 109 14.186 18.939 30.416 1.00 9.92 C
-ATOM 866 CZ2 TRP A 109 13.286 21.515 31.228 1.00 9.72 C
-ATOM 867 CZ3 TRP A 109 14.163 19.316 31.758 1.00 10.25 C
-ATOM 868 CH2 TRP A 109 13.717 20.593 32.149 1.00 10.11 C
-ATOM 869 N THR A 110 14.136 15.924 28.549 1.00 7.39 N
-ATOM 870 CA THR A 110 14.168 15.176 29.808 1.00 6.23 C
-ATOM 871 C THR A 110 15.577 15.334 30.395 1.00 7.40 C
-ATOM 872 O THR A 110 16.558 15.563 29.652 1.00 6.43 O
-ATOM 873 CB THR A 110 13.887 13.633 29.626 1.00 7.17 C
-ATOM 874 OG1 THR A 110 15.000 13.002 28.973 1.00 7.49 O
-ATOM 875 CG2 THR A 110 12.616 13.377 28.803 1.00 6.64 C
-ATOM 876 N ARG A 111 15.669 15.293 31.727 1.00 6.72 N
-ATOM 877 CA ARG A 111 16.966 15.356 32.425 1.00 6.27 C
-ATOM 878 C ARG A 111 16.924 14.287 33.483 1.00 7.89 C
-ATOM 879 O ARG A 111 15.928 14.156 34.193 1.00 8.35 O
-ATOM 880 CB ARG A 111 17.240 16.722 33.068 1.00 6.20 C
-ATOM 881 CG ARG A 111 17.703 17.765 32.060 1.00 7.38 C
-ATOM 882 CD ARG A 111 18.100 19.072 32.727 1.00 8.70 C
-ATOM 883 NE ARG A 111 18.783 19.965 31.784 1.00 9.83 N
-ATOM 884 CZ ARG A 111 18.158 20.804 30.963 1.00 10.23 C
-ATOM 885 NH1 ARG A 111 16.840 20.869 30.966 1.00 10.89 N
-ATOM 886 NH2 ARG A 111 18.847 21.590 30.144 1.00 11.56 N
-ATOM 887 N GLU A 112 17.957 13.464 33.534 1.00 7.64 N
-ATOM 888 CA GLU A 112 17.977 12.402 34.527 1.00 10.31 C
-ATOM 889 C GLU A 112 19.356 12.142 35.113 1.00 9.93 C
-ATOM 890 O GLU A 112 20.367 12.273 34.425 1.00 7.92 O
-ATOM 891 CB GLU A 112 17.401 11.118 33.940 1.00 14.05 C
-ATOM 892 CG GLU A 112 18.213 10.489 32.836 1.00 20.37 C
-ATOM 893 CD GLU A 112 17.484 9.325 32.177 1.00 25.09 C
-ATOM 894 OE1 GLU A 112 17.223 8.308 32.883 1.00 22.36 O
-ATOM 895 OE2 GLU A 112 17.175 9.443 30.955 1.00 25.10 O
-ATOM 896 N LEU A 113 19.387 11.816 36.401 1.00 8.96 N
-ATOM 897 CA LEU A 113 20.634 11.503 37.091 1.00 12.04 C
-ATOM 898 C LEU A 113 20.789 9.991 37.081 1.00 12.06 C
-ATOM 899 O LEU A 113 19.906 9.270 37.559 1.00 12.08 O
-ATOM 900 CB LEU A 113 20.575 11.983 38.532 1.00 14.38 C
-ATOM 901 CG LEU A 113 20.768 13.465 38.799 1.00 17.46 C
-ATOM 902 CD1 LEU A 113 20.709 13.656 40.298 1.00 19.61 C
-ATOM 903 CD2 LEU A 113 22.128 13.945 38.266 1.00 18.46 C
-ATOM 904 N THR A 114 21.895 9.502 36.535 1.00 11.06 N
-ATOM 905 CA THR A 114 22.110 8.062 36.452 1.00 11.74 C
-ATOM 906 C THR A 114 22.816 7.522 37.686 1.00 11.41 C
-ATOM 907 O THR A 114 23.327 8.282 38.501 1.00 11.47 O
-ATOM 908 CB THR A 114 22.894 7.700 35.188 1.00 12.89 C
-ATOM 909 OG1 THR A 114 24.109 8.451 35.164 1.00 15.50 O
-ATOM 910 CG2 THR A 114 22.075 8.037 33.951 1.00 14.75 C
-ATOM 911 N ASN A 115 22.834 6.202 37.808 1.00 13.23 N
-ATOM 912 CA ASN A 115 23.441 5.538 38.951 1.00 16.19 C
-ATOM 913 C ASN A 115 24.930 5.761 39.139 1.00 14.24 C
-ATOM 914 O ASN A 115 25.432 5.626 40.256 1.00 14.74 O
-ATOM 915 CB ASN A 115 23.123 4.047 38.918 1.00 21.89 C
-ATOM 916 CG ASN A 115 21.703 3.754 39.357 1.00 29.77 C
-ATOM 917 OD1 ASN A 115 20.955 3.046 38.669 1.00 34.83 O
-ATOM 918 ND2 ASN A 115 21.313 4.310 40.516 1.00 32.90 N
-ATOM 919 N ASP A 116 25.626 6.095 38.055 1.00 12.05 N
-ATOM 920 CA ASP A 116 27.061 6.364 38.094 1.00 11.99 C
-ATOM 921 C ASP A 116 27.424 7.821 38.397 1.00 11.45 C
-ATOM 922 O ASP A 116 28.592 8.184 38.393 1.00 12.23 O
-ATOM 923 CB ASP A 116 27.764 5.875 36.806 1.00 13.89 C
-ATOM 924 CG ASP A 116 27.177 6.474 35.512 1.00 16.58 C
-ATOM 925 OD1 ASP A 116 26.263 7.303 35.569 1.00 19.66 O
-ATOM 926 OD2 ASP A 116 27.651 6.113 34.422 1.00 20.14 O
-ATOM 927 N GLY A 117 26.420 8.647 38.675 1.00 10.58 N
-ATOM 928 CA GLY A 117 26.669 10.042 38.997 1.00 9.83 C
-ATOM 929 C GLY A 117 26.652 11.019 37.831 1.00 9.97 C
-ATOM 930 O GLY A 117 26.945 12.192 38.019 1.00 10.45 O
-ATOM 931 N GLU A 118 26.289 10.550 36.638 1.00 9.43 N
-ATOM 932 CA GLU A 118 26.242 11.413 35.458 1.00 7.79 C
-ATOM 933 C GLU A 118 24.834 11.955 35.213 1.00 7.60 C
-ATOM 934 O GLU A 118 23.872 11.565 35.885 1.00 8.05 O
-ATOM 935 CB GLU A 118 26.776 10.653 34.241 1.00 8.86 C
-ATOM 936 CG GLU A 118 28.227 10.234 34.427 1.00 9.64 C
-ATOM 937 CD GLU A 118 28.770 9.370 33.310 1.00 13.39 C
-ATOM 938 OE1 GLU A 118 28.036 9.043 32.355 1.00 11.90 O
-ATOM 939 OE2 GLU A 118 29.956 8.998 33.405 1.00 16.59 O
-ATOM 940 N LEU A 119 24.732 12.884 34.269 1.00 7.57 N
-ATOM 941 CA LEU A 119 23.467 13.513 33.917 1.00 6.94 C
-ATOM 942 C LEU A 119 23.189 13.277 32.431 1.00 8.29 C
-ATOM 943 O LEU A 119 24.070 13.506 31.593 1.00 8.23 O
-ATOM 944 CB LEU A 119 23.556 15.023 34.184 1.00 7.83 C
-ATOM 945 CG LEU A 119 22.417 15.972 33.810 1.00 9.54 C
-ATOM 946 CD1 LEU A 119 21.213 15.661 34.618 1.00 11.05 C
-ATOM 947 CD2 LEU A 119 22.822 17.421 34.066 1.00 12.54 C
-ATOM 948 N ILE A 120 22.010 12.743 32.119 1.00 6.17 N
-ATOM 949 CA ILE A 120 21.638 12.529 30.730 1.00 6.22 C
-ATOM 950 C ILE A 120 20.527 13.511 30.354 1.00 7.47 C
-ATOM 951 O ILE A 120 19.493 13.580 31.036 1.00 6.54 O
-ATOM 952 CB ILE A 120 21.103 11.118 30.485 1.00 7.19 C
-ATOM 953 CG1 ILE A 120 22.171 10.070 30.801 1.00 8.26 C
-ATOM 954 CG2 ILE A 120 20.556 11.003 29.047 1.00 6.54 C
-ATOM 955 CD1 ILE A 120 21.668 8.658 30.600 1.00 9.35 C
-ATOM 956 N LEU A 121 20.771 14.301 29.306 1.00 6.41 N
-ATOM 957 CA LEU A 121 19.783 15.236 28.779 1.00 6.25 C
-ATOM 958 C LEU A 121 19.299 14.693 27.426 1.00 7.41 C
-ATOM 959 O LEU A 121 20.115 14.242 26.619 1.00 6.01 O
-ATOM 960 CB LEU A 121 20.400 16.624 28.526 1.00 7.37 C
-ATOM 961 CG LEU A 121 19.607 17.580 27.597 1.00 7.96 C
-ATOM 962 CD1 LEU A 121 18.340 18.117 28.290 1.00 7.91 C
-ATOM 963 CD2 LEU A 121 20.501 18.739 27.151 1.00 7.96 C
-ATOM 964 N THR A 122 17.988 14.607 27.222 1.00 6.71 N
-ATOM 965 CA THR A 122 17.514 14.205 25.898 1.00 7.80 C
-ATOM 966 C THR A 122 16.633 15.334 25.402 1.00 8.58 C
-ATOM 967 O THR A 122 15.988 16.034 26.194 1.00 7.21 O
-ATOM 968 CB THR A 122 16.754 12.843 25.832 1.00 7.51 C
-ATOM 969 OG1 THR A 122 15.422 12.992 26.313 1.00 9.27 O
-ATOM 970 CG2 THR A 122 17.484 11.759 26.622 1.00 7.86 C
-ATOM 971 N MET A 123 16.732 15.613 24.110 1.00 7.87 N
-ATOM 972 CA MET A 123 15.904 16.643 23.494 1.00 9.22 C
-ATOM 973 C MET A 123 15.194 15.950 22.337 1.00 8.66 C
-ATOM 974 O MET A 123 15.828 15.189 21.601 1.00 8.09 O
-ATOM 975 CB MET A 123 16.760 17.818 23.019 1.00 9.37 C
-ATOM 976 CG MET A 123 17.359 18.612 24.171 1.00 11.81 C
-ATOM 977 SD MET A 123 18.325 20.048 23.658 1.00 16.59 S
-ATOM 978 CE MET A 123 19.871 19.278 23.173 1.00 14.10 C
-ATOM 979 N THR A 124 13.895 16.195 22.186 1.00 7.20 N
-ATOM 980 CA THR A 124 13.133 15.534 21.134 1.00 9.54 C
-ATOM 981 C THR A 124 12.407 16.513 20.222 1.00 10.12 C
-ATOM 982 O THR A 124 11.941 17.563 20.665 1.00 9.54 O
-ATOM 983 CB THR A 124 12.073 14.552 21.756 1.00 10.74 C
-ATOM 984 OG1 THR A 124 12.740 13.544 22.535 1.00 11.99 O
-ATOM 985 CG2 THR A 124 11.247 13.865 20.679 1.00 11.66 C
-ATOM 986 N ALA A 125 12.346 16.167 18.935 1.00 11.06 N
-ATOM 987 CA ALA A 125 11.634 16.962 17.923 1.00 11.63 C
-ATOM 988 C ALA A 125 10.981 15.878 17.078 1.00 13.46 C
-ATOM 989 O ALA A 125 11.669 15.144 16.352 1.00 13.11 O
-ATOM 990 CB ALA A 125 12.603 17.786 17.091 1.00 13.16 C
-ATOM 991 N ASP A 126 9.664 15.754 17.216 1.00 14.63 N
-ATOM 992 CA ASP A 126 8.901 14.721 16.536 1.00 17.86 C
-ATOM 993 C ASP A 126 9.512 13.364 16.905 1.00 18.66 C
-ATOM 994 O ASP A 126 9.519 13.006 18.080 1.00 19.38 O
-ATOM 995 CB ASP A 126 8.835 14.982 15.023 1.00 18.40 C
-ATOM 996 CG ASP A 126 7.786 16.032 14.660 1.00 22.34 C
-ATOM 997 OD1 ASP A 126 6.800 16.198 15.422 1.00 23.23 O
-ATOM 998 OD2 ASP A 126 7.940 16.702 13.621 1.00 24.32 O
-ATOM 999 N ASP A 127 10.064 12.629 15.945 1.00 20.19 N
-ATOM 1000 CA ASP A 127 10.656 11.333 16.271 1.00 21.56 C
-ATOM 1001 C ASP A 127 12.175 11.279 16.416 1.00 18.85 C
-ATOM 1002 O ASP A 127 12.732 10.219 16.657 1.00 20.67 O
-ATOM 1003 CB ASP A 127 10.178 10.263 15.303 1.00 26.47 C
-ATOM 1004 CG ASP A 127 9.043 9.450 15.880 1.00 33.21 C
-ATOM 1005 OD1 ASP A 127 7.892 9.959 15.934 1.00 36.08 O
-ATOM 1006 OD2 ASP A 127 9.318 8.308 16.318 1.00 38.35 O
-ATOM 1007 N VAL A 128 12.836 12.418 16.281 1.00 15.22 N
-ATOM 1008 CA VAL A 128 14.286 12.486 16.407 1.00 12.83 C
-ATOM 1009 C VAL A 128 14.681 12.843 17.835 1.00 11.58 C
-ATOM 1010 O VAL A 128 14.176 13.811 18.408 1.00 9.74 O
-ATOM 1011 CB VAL A 128 14.864 13.503 15.423 1.00 12.79 C
-ATOM 1012 CG1 VAL A 128 16.338 13.757 15.706 1.00 12.93 C
-ATOM 1013 CG2 VAL A 128 14.677 12.968 14.005 1.00 14.30 C
-ATOM 1014 N VAL A 129 15.586 12.051 18.397 1.00 9.29 N
-ATOM 1015 CA VAL A 129 16.054 12.257 19.761 1.00 7.95 C
-ATOM 1016 C VAL A 129 17.558 12.546 19.842 1.00 7.49 C
-ATOM 1017 O VAL A 129 18.374 11.816 19.276 1.00 8.73 O
-ATOM 1018 CB VAL A 129 15.764 11.007 20.617 1.00 9.43 C
-ATOM 1019 CG1 VAL A 129 16.153 11.253 22.076 1.00 9.09 C
-ATOM 1020 CG2 VAL A 129 14.293 10.610 20.495 1.00 9.45 C
-ATOM 1021 N CYS A 130 17.912 13.630 20.534 1.00 7.54 N
-ATOM 1022 CA CYS A 130 19.305 14.010 20.756 1.00 6.47 C
-ATOM 1023 C CYS A 130 19.670 13.627 22.200 1.00 6.61 C
-ATOM 1024 O CYS A 130 18.955 13.992 23.135 1.00 7.53 O
-ATOM 1025 CB CYS A 130 19.485 15.517 20.544 1.00 6.05 C
-ATOM 1026 SG CYS A 130 21.063 16.183 21.077 1.00 8.82 S
-ATOM 1027 N THR A 131 20.786 12.925 22.372 1.00 6.58 N
-ATOM 1028 CA THR A 131 21.241 12.462 23.693 1.00 5.93 C
-ATOM 1029 C THR A 131 22.569 13.102 24.054 1.00 6.18 C
-ATOM 1030 O THR A 131 23.528 13.003 23.294 1.00 5.77 O
-ATOM 1031 CB THR A 131 21.419 10.914 23.699 1.00 6.63 C
-ATOM 1032 OG1 THR A 131 20.199 10.299 23.289 1.00 7.60 O
-ATOM 1033 CG2 THR A 131 21.763 10.399 25.091 1.00 7.76 C
-ATOM 1034 N ARG A 132 22.624 13.780 25.202 1.00 6.29 N
-ATOM 1035 CA ARG A 132 23.853 14.429 25.660 1.00 7.67 C
-ATOM 1036 C ARG A 132 24.108 13.960 27.093 1.00 7.19 C
-ATOM 1037 O ARG A 132 23.184 13.895 27.902 1.00 8.65 O
-ATOM 1038 CB ARG A 132 23.719 15.957 25.621 1.00 9.67 C
-ATOM 1039 CG ARG A 132 22.945 16.470 24.429 1.00 15.02 C
-ATOM 1040 CD ARG A 132 23.781 17.260 23.476 1.00 16.80 C
-ATOM 1041 NE ARG A 132 24.140 18.580 23.984 1.00 12.48 N
-ATOM 1042 CZ ARG A 132 25.030 19.377 23.395 1.00 12.93 C
-ATOM 1043 NH1 ARG A 132 25.641 19.005 22.279 1.00 13.84 N
-ATOM 1044 NH2 ARG A 132 25.398 20.506 23.973 1.00 11.57 N
-ATOM 1045 N VAL A 133 25.359 13.633 27.397 1.00 5.99 N
-ATOM 1046 CA VAL A 133 25.739 13.124 28.719 1.00 5.92 C
-ATOM 1047 C VAL A 133 26.773 14.055 29.345 1.00 5.85 C
-ATOM 1048 O VAL A 133 27.713 14.492 28.681 1.00 5.50 O
-ATOM 1049 CB VAL A 133 26.333 11.698 28.608 1.00 6.37 C
-ATOM 1050 CG1 VAL A 133 26.609 11.120 29.988 1.00 7.95 C
-ATOM 1051 CG2 VAL A 133 25.385 10.782 27.832 1.00 6.46 C
-ATOM 1052 N TYR A 134 26.619 14.337 30.635 1.00 5.35 N
-ATOM 1053 CA TYR A 134 27.538 15.228 31.322 1.00 4.57 C
-ATOM 1054 C TYR A 134 28.014 14.611 32.617 1.00 5.30 C
-ATOM 1055 O TYR A 134 27.371 13.712 33.165 1.00 3.92 O
-ATOM 1056 CB TYR A 134 26.846 16.550 31.686 1.00 6.84 C
-ATOM 1057 CG TYR A 134 26.118 17.251 30.574 1.00 8.89 C
-ATOM 1058 CD1 TYR A 134 24.901 16.762 30.122 1.00 10.29 C
-ATOM 1059 CD2 TYR A 134 26.628 18.406 29.992 1.00 10.49 C
-ATOM 1060 CE1 TYR A 134 24.212 17.386 29.133 1.00 13.03 C
-ATOM 1061 CE2 TYR A 134 25.930 19.051 28.982 1.00 12.15 C
-ATOM 1062 CZ TYR A 134 24.723 18.517 28.567 1.00 12.80 C
-ATOM 1063 OH TYR A 134 23.991 19.082 27.567 1.00 18.07 O
-ATOM 1064 N VAL A 135 29.113 15.158 33.119 1.00 6.63 N
-ATOM 1065 CA VAL A 135 29.697 14.762 34.394 1.00 8.42 C
-ATOM 1066 C VAL A 135 30.100 16.086 35.064 1.00 9.05 C
-ATOM 1067 O VAL A 135 30.340 17.086 34.385 1.00 9.02 O
-ATOM 1068 CB VAL A 135 30.925 13.815 34.204 1.00 8.05 C
-ATOM 1069 CG1 VAL A 135 32.109 14.556 33.596 1.00 9.27 C
-ATOM 1070 CG2 VAL A 135 31.304 13.151 35.533 1.00 10.37 C
-ATOM 1071 N ARG A 136 30.117 16.133 36.390 1.00 9.57 N
-ATOM 1072 CA ARG A 136 30.498 17.375 37.040 1.00 10.86 C
-ATOM 1073 C ARG A 136 31.964 17.676 36.776 1.00 11.68 C
-ATOM 1074 O ARG A 136 32.782 16.765 36.686 1.00 11.35 O
-ATOM 1075 CB ARG A 136 30.221 17.319 38.536 1.00 11.99 C
-ATOM 1076 CG ARG A 136 28.746 17.454 38.885 1.00 13.89 C
-ATOM 1077 CD ARG A 136 28.576 17.533 40.382 1.00 15.85 C
-ATOM 1078 NE ARG A 136 27.185 17.407 40.754 1.00 17.08 N
-ATOM 1079 CZ ARG A 136 26.561 16.245 40.926 1.00 21.69 C
-ATOM 1080 NH1 ARG A 136 27.217 15.102 40.754 1.00 23.26 N
-ATOM 1081 NH2 ARG A 136 25.278 16.227 41.283 1.00 22.60 N
-ATOM 1082 N GLU A 137 32.282 18.963 36.663 1.00 15.12 N
-ATOM 1083 CA GLU A 137 33.641 19.430 36.400 1.00 18.00 C
-ATOM 1084 C GLU A 137 34.615 19.038 37.493 1.00 18.96 C
-ATOM 1085 O GLU A 137 34.221 19.175 38.659 1.00 17.37 O
-ATOM 1086 CB GLU A 137 33.661 20.943 36.293 1.00 19.89 C
-ATOM 1087 CG GLU A 137 33.092 21.492 35.035 1.00 28.03 C
-ATOM 1088 CD GLU A 137 33.469 22.953 34.865 1.00 33.22 C
-ATOM 1089 OE1 GLU A 137 34.630 23.217 34.473 1.00 37.31 O
-ATOM 1090 OE2 GLU A 137 32.636 23.836 35.164 1.00 36.38 O
-ATOM 1091 OXT GLU A 137 35.776 18.680 37.173 1.00 22.23 O
-TER 1092 GLU A 137
-HETATM 1093 C1 REA A 200 21.972 29.831 16.739 1.00 15.25 C
-HETATM 1094 C2 REA A 200 20.921 30.524 15.841 1.00 15.61 C
-HETATM 1095 C3 REA A 200 20.245 29.635 14.848 1.00 16.19 C
-HETATM 1096 C4 REA A 200 19.555 28.479 15.488 1.00 14.59 C
-HETATM 1097 C5 REA A 200 20.389 27.812 16.587 1.00 14.10 C
-HETATM 1098 C6 REA A 200 21.425 28.446 17.218 1.00 14.42 C
-HETATM 1099 C7 REA A 200 22.242 27.851 18.297 1.00 13.89 C
-HETATM 1100 C8 REA A 200 21.868 26.977 19.240 1.00 11.86 C
-HETATM 1101 C9 REA A 200 22.705 26.434 20.286 1.00 10.87 C
-HETATM 1102 C10 REA A 200 22.159 25.536 21.131 1.00 9.19 C
-HETATM 1103 C11 REA A 200 22.875 24.924 22.234 1.00 10.35 C
-HETATM 1104 C12 REA A 200 22.237 24.026 22.990 1.00 10.53 C
-HETATM 1105 C13 REA A 200 22.856 23.377 24.125 1.00 10.91 C
-HETATM 1106 C14 REA A 200 22.135 22.473 24.834 1.00 11.88 C
-HETATM 1107 C15 REA A 200 22.563 21.710 26.016 1.00 14.86 C
-HETATM 1108 C16 REA A 200 22.238 30.737 17.948 1.00 15.47 C
-HETATM 1109 C17 REA A 200 23.292 29.620 15.948 1.00 13.42 C
-HETATM 1110 C18 REA A 200 19.791 26.449 16.947 1.00 12.61 C
-HETATM 1111 C19 REA A 200 24.181 26.841 20.385 1.00 10.08 C
-HETATM 1112 C20 REA A 200 24.303 23.747 24.489 1.00 10.10 C
-HETATM 1113 O1 REA A 200 23.640 21.075 25.978 1.00 13.29 O
-HETATM 1114 O2 REA A 200 21.840 21.712 27.037 1.00 10.99 O
-HETATM 1115 O HOH A 300 21.817 19.604 31.169 1.00 17.43 O
-HETATM 1116 O HOH A 301 7.617 26.892 37.107 1.00 12.66 O
-HETATM 1117 O HOH A 302 22.885 27.835 25.056 1.00 18.86 O
-HETATM 1118 O HOH A 303 30.685 27.402 22.818 1.00 14.12 O
-HETATM 1119 O HOH A 304 29.930 20.839 40.398 1.00 16.48 O
-HETATM 1120 O HOH A 305 31.492 21.096 28.452 1.00 16.65 O
-HETATM 1121 O HOH A 306 19.459 26.601 30.320 1.00 9.81 O
-HETATM 1122 O HOH A 307 19.116 26.759 22.930 1.00 22.33 O
-HETATM 1123 O HOH A 308 16.356 22.299 28.453 1.00 35.46 O
-HETATM 1124 O HOH A 309 21.823 21.939 29.734 1.00 13.95 O
-HETATM 1125 O HOH A 310 13.206 22.267 22.102 1.00 20.07 O
-HETATM 1126 O HOH A 311 30.300 22.803 12.740 1.00 24.70 O
-HETATM 1127 O HOH A 312 7.344 23.059 35.600 1.00 8.82 O
-HETATM 1128 O HOH A 313 6.876 22.668 20.375 1.00 29.74 O
-HETATM 1129 O HOH A 314 17.917 24.800 29.159 1.00 23.69 O
-HETATM 1130 O HOH A 315 37.101 16.714 38.714 1.00 19.84 O
-HETATM 1131 O HOH A 316 28.721 7.425 30.043 1.00 14.94 O
-HETATM 1132 O HOH A 317 13.212 14.450 25.193 1.00 18.03 O
-HETATM 1133 O HOH A 318 6.094 9.777 39.151 1.00 13.98 O
-HETATM 1134 O HOH A 319 19.296 10.379 13.144 1.00 27.20 O
-HETATM 1135 O HOH A 320 25.337 10.931 16.577 1.00 18.41 O
-HETATM 1136 O HOH A 321 25.244 34.269 18.193 1.00 9.65 O
-HETATM 1137 O HOH A 322 23.567 10.727 14.429 1.00 11.13 O
-HETATM 1138 O HOH A 323 17.151 12.178 30.238 1.00 11.53 O
-HETATM 1139 O HOH A 324 27.768 11.967 42.077 1.00 23.33 O
-HETATM 1140 O HOH A 325 30.270 12.554 21.386 1.00 25.05 O
-HETATM 1141 O HOH A 326 25.662 15.488 18.515 1.00 10.80 O
-HETATM 1142 O HOH A 327 4.514 21.426 18.685 1.00 45.94 O
-HETATM 1143 O HOH A 328 8.081 23.201 17.690 1.00 30.16 O
-HETATM 1144 O HOH A 329 13.242 29.389 14.924 1.00 39.93 O
-HETATM 1145 O HOH A 330 10.514 18.772 10.176 1.00 33.65 O
-HETATM 1146 O HOH A 331 10.555 13.666 26.313 1.00 32.55 O
-HETATM 1147 O HOH A 332 5.189 16.418 31.375 1.00 35.78 O
-HETATM 1148 O HOH A 333 0.738 25.633 36.349 1.00 29.00 O
-HETATM 1149 O HOH A 334 2.976 28.966 37.321 1.00 40.14 O
-HETATM 1150 O HOH A 335 6.424 28.750 38.849 1.00 32.17 O
-HETATM 1151 O HOH A 336 12.503 30.488 31.704 1.00 41.11 O
-HETATM 1152 O HOH A 337 14.979 30.157 27.559 1.00 23.78 O
-HETATM 1153 O HOH A 338 17.312 32.981 28.812 1.00 20.84 O
-HETATM 1154 O HOH A 339 29.473 25.946 34.693 1.00 29.05 O
-HETATM 1155 O HOH A 340 30.328 23.817 33.494 1.00 24.17 O
-HETATM 1156 O HOH A 341 31.158 28.144 26.433 1.00 42.66 O
-HETATM 1157 O HOH A 342 30.276 28.397 16.400 1.00 21.90 O
-HETATM 1158 O HOH A 343 19.533 23.600 26.857 1.00 21.12 O
-HETATM 1159 O HOH A 344 17.892 24.675 24.549 1.00 48.11 O
-HETATM 1160 O HOH A 345 14.211 24.152 25.435 1.00 21.09 O
-HETATM 1161 O HOH A 346 15.223 27.626 27.056 1.00 27.16 O
-HETATM 1162 O HOH A 347 3.502 22.911 43.083 1.00 30.15 O
-HETATM 1163 O HOH A 348 20.610 7.668 40.212 1.00 49.06 O
-HETATM 1164 O HOH A 349 24.813 2.899 36.403 1.00 48.98 O
-HETATM 1165 O HOH A 350 29.900 5.163 26.918 1.00 23.60 O
-HETATM 1166 O HOH A 351 14.333 5.466 42.757 1.00 22.90 O
-HETATM 1167 O HOH A 352 8.914 5.771 35.515 1.00 35.92 O
-HETATM 1168 O HOH A 353 14.519 28.906 40.193 1.00 28.73 O
-HETATM 1169 O HOH A 354 17.573 20.203 47.080 1.00 37.63 O
-HETATM 1170 O HOH A 355 13.324 32.251 34.152 1.00 47.79 O
-HETATM 1171 O HOH A 356 12.491 24.840 7.594 1.00 39.45 O
-HETATM 1172 O HOH A 357 25.066 15.777 15.214 1.00 27.39 O
-HETATM 1173 O HOH A 358 27.138 17.638 17.834 1.00 45.12 O
-HETATM 1174 O HOH A 359 27.611 19.792 19.503 1.00 24.45 O
-HETATM 1175 O HOH A 360 11.358 8.880 19.119 1.00 24.31 O
-HETATM 1176 O HOH A 361 16.252 27.169 24.557 1.00 25.40 O
-HETATM 1177 O HOH A 362 22.049 27.870 4.565 1.00 25.37 O
-HETATM 1178 O HOH A 363 11.533 6.689 34.501 1.00 29.92 O
-HETATM 1179 O HOH A 364 13.269 4.551 36.338 1.00 45.75 O
-HETATM 1180 O HOH A 365 23.149 9.493 41.173 1.00 30.10 O
-HETATM 1181 O HOH A 366 21.090 12.171 43.973 1.00 27.97 O
-HETATM 1182 O HOH A 367 11.884 13.399 42.560 1.00 23.28 O
-HETATM 1183 O HOH A 368 29.542 17.520 20.025 1.00 38.32 O
-HETATM 1184 O HOH A 369 31.058 17.427 22.538 1.00 37.85 O
-HETATM 1185 O HOH A 370 31.928 9.444 23.294 1.00 46.07 O
-HETATM 1186 O HOH A 371 25.699 10.933 9.557 1.00 44.12 O
-HETATM 1187 O HOH A 372 26.533 13.428 16.334 1.00 45.21 O
-HETATM 1188 O HOH A 373 27.078 16.850 13.245 1.00 39.52 O
-HETATM 1189 O HOH A 374 20.596 32.070 6.807 1.00 36.38 O
-HETATM 1190 O HOH A 375 17.126 28.421 9.515 1.00 23.81 O
-HETATM 1191 O HOH A 376 16.626 32.383 11.231 1.00 20.11 O
-HETATM 1192 O HOH A 377 6.046 30.510 19.639 1.00 29.02 O
-HETATM 1193 O HOH A 378 9.543 16.072 11.145 1.00 50.91 O
-HETATM 1194 O HOH A 379 8.174 14.289 20.240 1.00 54.21 O
-HETATM 1195 O HOH A 380 11.561 10.834 22.873 1.00 43.23 O
-HETATM 1196 O HOH A 381 5.486 15.385 24.922 1.00 50.19 O
-HETATM 1197 O HOH A 382 6.038 21.424 43.276 1.00 46.64 O
-HETATM 1198 O HOH A 383 34.144 19.165 27.284 1.00 41.41 O
-HETATM 1199 O HOH A 384 16.916 27.142 42.621 1.00 29.32 O
-HETATM 1200 O HOH A 385 25.509 24.918 41.520 1.00 32.12 O
-HETATM 1201 O HOH A 386 31.446 7.504 31.389 1.00 28.93 O
-HETATM 1202 O HOH A 387 18.212 20.893 5.892 1.00 29.90 O
-HETATM 1203 O HOH A 388 15.148 27.608 7.685 1.00 30.91 O
-HETATM 1204 O HOH A 389 2.656 23.148 20.117 1.00 35.98 O
-HETATM 1205 O HOH A 390 3.100 22.690 28.640 1.00 31.31 O
-HETATM 1206 O HOH A 391 13.699 19.720 21.819 1.00 26.56 O
-HETATM 1207 O HOH A 392 26.833 28.283 32.272 1.00 31.48 O
-HETATM 1208 O HOH A 393 20.458 26.214 25.811 1.00 24.39 O
-HETATM 1209 O HOH A 394 32.304 27.731 18.152 1.00 41.66 O
-HETATM 1210 O HOH A 395 24.283 13.868 42.687 1.00 35.59 O
-HETATM 1211 O HOH A 396 11.833 12.657 45.160 1.00 38.30 O
-HETATM 1212 O HOH A 397 1.988 27.992 43.589 1.00 33.97 O
-HETATM 1213 O HOH A 398 32.913 22.982 40.176 1.00 39.26 O
-HETATM 1214 O HOH A 399 32.435 20.043 40.169 1.00 33.87 O
-CONECT 1093 1094 1098 1108 1109
-CONECT 1094 1093 1095
-CONECT 1095 1094 1096
-CONECT 1096 1095 1097
-CONECT 1097 1096 1098 1110
-CONECT 1098 1093 1097 1099
-CONECT 1099 1098 1100
-CONECT 1100 1099 1101
-CONECT 1101 1100 1102 1111
-CONECT 1102 1101 1103
-CONECT 1103 1102 1104
-CONECT 1104 1103 1105
-CONECT 1105 1104 1106 1112
-CONECT 1106 1105 1107
-CONECT 1107 1106 1113 1114
-CONECT 1108 1093
-CONECT 1109 1093
-CONECT 1110 1097
-CONECT 1111 1101
-CONECT 1112 1105
-CONECT 1113 1107
-CONECT 1114 1107
-MASTER 264 0 1 2 10 0 3 6 1213 1 22 11
-END
diff --git a/android/examples/Demos/Graphics/Ribbons/data/2POR.pdb b/android/examples/Demos/Graphics/Ribbons/data/2POR.pdb
deleted file mode 100644
index 67a93b82e8..0000000000
--- a/android/examples/Demos/Graphics/Ribbons/data/2POR.pdb
+++ /dev/null
@@ -1,3257 +0,0 @@
-HEADER INTEGRAL MEMBRANE PROTEIN PORIN 24-APR-92 2POR
-TITLE STRUCTURE OF PORIN REFINED AT 1.8 ANGSTROMS RESOLUTION
-COMPND MOL_ID: 1;
-COMPND 2 MOLECULE: PORIN;
-COMPND 3 CHAIN: A;
-COMPND 4 ENGINEERED: YES
-SOURCE MOL_ID: 1;
-SOURCE 2 ORGANISM_SCIENTIFIC: RHODOBACTER CAPSULATUS;
-SOURCE 3 ORGANISM_TAXID: 1061
-KEYWDS INTEGRAL MEMBRANE PROTEIN PORIN
-EXPDTA X-RAY DIFFRACTION
-AUTHOR M.S.WEISS,G.E.SCHULZ
-REVDAT 3 24-FEB-09 2POR 1 VERSN
-REVDAT 2 01-APR-03 2POR 1 JRNL
-REVDAT 1 15-JUL-93 2POR 0
-JRNL AUTH M.S.WEISS,G.E.SCHULZ
-JRNL TITL STRUCTURE OF PORIN REFINED AT 1.8 A RESOLUTION.
-JRNL REF J.MOL.BIOL. V. 227 493 1992
-JRNL REFN ISSN 0022-2836
-JRNL PMID 1328651
-JRNL DOI 10.1016/0022-2836(92)90903-W
-REMARK 1
-REMARK 1 REFERENCE 1
-REMARK 1 AUTH M.S.WEISS,U.ABELE,J.WECKESSER,W.WELTE,E.SCHILTZ,
-REMARK 1 AUTH 2 G.E.SCHULZ
-REMARK 1 TITL MOLECULAR ARCHITECTURE AND ELECTROSTATIC
-REMARK 1 TITL 2 PROPERTIES OF A BACTERIAL PORIN
-REMARK 1 REF SCIENCE V. 254 1627 1991
-REMARK 1 REFN ISSN 0036-8075
-REMARK 1 REFERENCE 2
-REMARK 1 AUTH E.SCHILTZ,A.KREUSCH,U.NESTEL,G.E.SCHULZ
-REMARK 1 TITL PRIMARY STRUCTURE OF PORIN FROM RHODOBACTER
-REMARK 1 TITL 2 CAPSULATUS
-REMARK 1 REF EUR.J.BIOCHEM. V. 199 587 1991
-REMARK 1 REFN ISSN 0014-2956
-REMARK 1 REFERENCE 3
-REMARK 1 AUTH M.S.WEISS,A.KREUSCH,E.SCHILTZ,U.NESTEL,W.WELTE,
-REMARK 1 AUTH 2 J.WECKESSER,G.E.SCHULZ
-REMARK 1 TITL THE STRUCTURE OF PORIN FROM RHODOBACTER CAPSULATUS
-REMARK 1 TITL 2 AT 1.8 ANGSTROMS RESOLUTION
-REMARK 1 REF FEBS LETT. V. 280 379 1991
-REMARK 1 REFN ISSN 0014-5793
-REMARK 1 REFERENCE 4
-REMARK 1 AUTH A.KREUSCH,M.S.WEISS,W.WELTE,J.WECKESSER,G.E.SCHULZ
-REMARK 1 TITL CRYSTALS OF AN INTEGRAL MEMBRANE PROTEIN
-REMARK 1 TITL 2 DIFFRACTING TO 1.8 ANGSTROMS RESOLUTION
-REMARK 1 REF J.MOL.BIOL. V. 217 9 1991
-REMARK 1 REFN ISSN 0022-2836
-REMARK 1 REFERENCE 5
-REMARK 1 AUTH M.S.WEISS,T.WACKER,J.WECKESSER,W.WELTE,G.E.SCHULZ
-REMARK 1 TITL THE THREE-DIMENSIONAL STRUCTURE OF PORIN FROM
-REMARK 1 TITL 2 RHODOBACTER CAPSULATUS AT 3 ANGSTROMS RESOLUTION
-REMARK 1 REF FEBS LETT. V. 267 268 1990
-REMARK 1 REFN ISSN 0014-5793
-REMARK 1 REFERENCE 6
-REMARK 1 AUTH M.S.WEISS,T.WACKER,U.NESTEL,D.WOITZIK,J.WECKESSER,
-REMARK 1 AUTH 2 W.KREUTZ,W.WELTE,G.E.SCHULZ
-REMARK 1 TITL THE STRUCTURE OF PORIN FROM RHODOBACTER CAPSULATUS
-REMARK 1 TITL 2 AT 0.6 NM RESOLUTION
-REMARK 1 REF FEBS LETT. V. 256 143 1989
-REMARK 1 REFN ISSN 0014-5793
-REMARK 1 REFERENCE 7
-REMARK 1 AUTH U.NESTEL,T.WACKER,D.WOITZIK,J.WECKESSER,W.KREUTZ,
-REMARK 1 AUTH 2 W.WELTE
-REMARK 1 TITL CRYSTALLIZATION AND PRELIMINARY X-RAY ANALYSIS OF
-REMARK 1 TITL 2 PORIN FROM RHODOBACTER CAPSULATUS
-REMARK 1 REF FEBS LETT. V. 242 405 1989
-REMARK 1 REFN ISSN 0014-5793
-REMARK 2
-REMARK 2 RESOLUTION. 1.80 ANGSTROMS.
-REMARK 3
-REMARK 3 REFINEMENT.
-REMARK 3 PROGRAM : X-PLOR
-REMARK 3 AUTHORS : BRUNGER
-REMARK 3
-REMARK 3 DATA USED IN REFINEMENT.
-REMARK 3 RESOLUTION RANGE HIGH (ANGSTROMS) : 1.80
-REMARK 3 RESOLUTION RANGE LOW (ANGSTROMS) : 10.00
-REMARK 3 DATA CUTOFF (SIGMA(F)) : NULL
-REMARK 3 DATA CUTOFF HIGH (ABS(F)) : NULL
-REMARK 3 DATA CUTOFF LOW (ABS(F)) : NULL
-REMARK 3 COMPLETENESS (WORKING+TEST) (%) : NULL
-REMARK 3 NUMBER OF REFLECTIONS : 42851
-REMARK 3
-REMARK 3 FIT TO DATA USED IN REFINEMENT.
-REMARK 3 CROSS-VALIDATION METHOD : NULL
-REMARK 3 FREE R VALUE TEST SET SELECTION : NULL
-REMARK 3 R VALUE (WORKING SET) : 0.186
-REMARK 3 FREE R VALUE : NULL
-REMARK 3 FREE R VALUE TEST SET SIZE (%) : NULL
-REMARK 3 FREE R VALUE TEST SET COUNT : NULL
-REMARK 3 ESTIMATED ERROR OF FREE R VALUE : NULL
-REMARK 3
-REMARK 3 FIT IN THE HIGHEST RESOLUTION BIN.
-REMARK 3 TOTAL NUMBER OF BINS USED : NULL
-REMARK 3 BIN RESOLUTION RANGE HIGH (A) : NULL
-REMARK 3 BIN RESOLUTION RANGE LOW (A) : NULL
-REMARK 3 BIN COMPLETENESS (WORKING+TEST) (%) : NULL
-REMARK 3 REFLECTIONS IN BIN (WORKING SET) : NULL
-REMARK 3 BIN R VALUE (WORKING SET) : NULL
-REMARK 3 BIN FREE R VALUE : NULL
-REMARK 3 BIN FREE R VALUE TEST SET SIZE (%) : NULL
-REMARK 3 BIN FREE R VALUE TEST SET COUNT : NULL
-REMARK 3 ESTIMATED ERROR OF BIN FREE R VALUE : NULL
-REMARK 3
-REMARK 3 NUMBER OF NON-HYDROGEN ATOMS USED IN REFINEMENT.
-REMARK 3 PROTEIN ATOMS : 2228
-REMARK 3 NUCLEIC ACID ATOMS : 0
-REMARK 3 HETEROGEN ATOMS : 87
-REMARK 3 SOLVENT ATOMS : 274
-REMARK 3
-REMARK 3 B VALUES.
-REMARK 3 FROM WILSON PLOT (A**2) : NULL
-REMARK 3 MEAN B VALUE (OVERALL, A**2) : NULL
-REMARK 3 OVERALL ANISOTROPIC B VALUE.
-REMARK 3 B11 (A**2) : NULL
-REMARK 3 B22 (A**2) : NULL
-REMARK 3 B33 (A**2) : NULL
-REMARK 3 B12 (A**2) : NULL
-REMARK 3 B13 (A**2) : NULL
-REMARK 3 B23 (A**2) : NULL
-REMARK 3
-REMARK 3 ESTIMATED COORDINATE ERROR.
-REMARK 3 ESD FROM LUZZATI PLOT (A) : NULL
-REMARK 3 ESD FROM SIGMAA (A) : NULL
-REMARK 3 LOW RESOLUTION CUTOFF (A) : NULL
-REMARK 3
-REMARK 3 CROSS-VALIDATED ESTIMATED COORDINATE ERROR.
-REMARK 3 ESD FROM C-V LUZZATI PLOT (A) : NULL
-REMARK 3 ESD FROM C-V SIGMAA (A) : NULL
-REMARK 3
-REMARK 3 RMS DEVIATIONS FROM IDEAL VALUES.
-REMARK 3 BOND LENGTHS (A) : 0.015
-REMARK 3 BOND ANGLES (DEGREES) : 2.80
-REMARK 3 DIHEDRAL ANGLES (DEGREES) : NULL
-REMARK 3 IMPROPER ANGLES (DEGREES) : NULL
-REMARK 3
-REMARK 3 ISOTROPIC THERMAL MODEL : NULL
-REMARK 3
-REMARK 3 ISOTROPIC THERMAL FACTOR RESTRAINTS. RMS SIGMA
-REMARK 3 MAIN-CHAIN BOND (A**2) : NULL ; NULL
-REMARK 3 MAIN-CHAIN ANGLE (A**2) : NULL ; NULL
-REMARK 3 SIDE-CHAIN BOND (A**2) : NULL ; NULL
-REMARK 3 SIDE-CHAIN ANGLE (A**2) : NULL ; NULL
-REMARK 3
-REMARK 3 NCS MODEL : NULL
-REMARK 3
-REMARK 3 NCS RESTRAINTS. RMS SIGMA/WEIGHT
-REMARK 3 GROUP 1 POSITIONAL (A) : NULL ; NULL
-REMARK 3 GROUP 1 B-FACTOR (A**2) : NULL ; NULL
-REMARK 3
-REMARK 3 PARAMETER FILE 1 : NULL
-REMARK 3 TOPOLOGY FILE 1 : NULL
-REMARK 3
-REMARK 3 OTHER REFINEMENT REMARKS: THE CRYSTALS HAVE FORM *B* AS
-REMARK 3 DESCRIBED IN THE *JRNL* REFERENCE. RESIDUE 545 HAS NOT BEEN
-REMARK 3 UNAMBIGUOUSLY IDENTIFIED. IT HAS BEEN MODELED AS A DETERGENT N
-REMARK 3 -OCTYLTETRAOXYETHYLENE
-REMARK 4
-REMARK 4 2POR COMPLIES WITH FORMAT V. 3.15, 01-DEC-08
-REMARK 100
-REMARK 100 THIS ENTRY HAS BEEN PROCESSED BY BNL.
-REMARK 200
-REMARK 200 EXPERIMENTAL DETAILS
-REMARK 200 EXPERIMENT TYPE : X-RAY DIFFRACTION
-REMARK 200 DATE OF DATA COLLECTION : NULL
-REMARK 200 TEMPERATURE (KELVIN) : NULL
-REMARK 200 PH : NULL
-REMARK 200 NUMBER OF CRYSTALS USED : NULL
-REMARK 200
-REMARK 200 SYNCHROTRON (Y/N) : NULL
-REMARK 200 RADIATION SOURCE : NULL
-REMARK 200 BEAMLINE : NULL
-REMARK 200 X-RAY GENERATOR MODEL : NULL
-REMARK 200 MONOCHROMATIC OR LAUE (M/L) : NULL
-REMARK 200 WAVELENGTH OR RANGE (A) : NULL
-REMARK 200 MONOCHROMATOR : NULL
-REMARK 200 OPTICS : NULL
-REMARK 200
-REMARK 200 DETECTOR TYPE : NULL
-REMARK 200 DETECTOR MANUFACTURER : NULL
-REMARK 200 INTENSITY-INTEGRATION SOFTWARE : NULL
-REMARK 200 DATA SCALING SOFTWARE : NULL
-REMARK 200
-REMARK 200 NUMBER OF UNIQUE REFLECTIONS : NULL
-REMARK 200 RESOLUTION RANGE HIGH (A) : NULL
-REMARK 200 RESOLUTION RANGE LOW (A) : NULL
-REMARK 200 REJECTION CRITERIA (SIGMA(I)) : NULL
-REMARK 200
-REMARK 200 OVERALL.
-REMARK 200 COMPLETENESS FOR RANGE (%) : NULL
-REMARK 200 DATA REDUNDANCY : NULL
-REMARK 200 R MERGE (I) : NULL
-REMARK 200 R SYM (I) : NULL
-REMARK 200 FOR THE DATA SET : NULL
-REMARK 200
-REMARK 200 IN THE HIGHEST RESOLUTION SHELL.
-REMARK 200 HIGHEST RESOLUTION SHELL, RANGE HIGH (A) : NULL
-REMARK 200 HIGHEST RESOLUTION SHELL, RANGE LOW (A) : NULL
-REMARK 200 COMPLETENESS FOR SHELL (%) : NULL
-REMARK 200 DATA REDUNDANCY IN SHELL : NULL
-REMARK 200 R MERGE FOR SHELL (I) : NULL
-REMARK 200 R SYM FOR SHELL (I) : NULL
-REMARK 200 FOR SHELL : NULL
-REMARK 200
-REMARK 200 DIFFRACTION PROTOCOL: NULL
-REMARK 200 METHOD USED TO DETERMINE THE STRUCTURE: NULL
-REMARK 200 SOFTWARE USED: NULL
-REMARK 200 STARTING MODEL: NULL
-REMARK 200
-REMARK 200 REMARK: NULL
-REMARK 280
-REMARK 280 CRYSTAL
-REMARK 280 SOLVENT CONTENT, VS (%): 67.61
-REMARK 280 MATTHEWS COEFFICIENT, VM (ANGSTROMS**3/DA): 3.80
-REMARK 280
-REMARK 280 CRYSTALLIZATION CONDITIONS: NULL
-REMARK 290
-REMARK 290 CRYSTALLOGRAPHIC SYMMETRY
-REMARK 290 SYMMETRY OPERATORS FOR SPACE GROUP: H 3
-REMARK 290
-REMARK 290 SYMOP SYMMETRY
-REMARK 290 NNNMMM OPERATOR
-REMARK 290 1555 X,Y,Z
-REMARK 290 2555 -Y,X-Y,Z
-REMARK 290 3555 -X+Y,-X,Z
-REMARK 290 4555 X+2/3,Y+1/3,Z+1/3
-REMARK 290 5555 -Y+2/3,X-Y+1/3,Z+1/3
-REMARK 290 6555 -X+Y+2/3,-X+1/3,Z+1/3
-REMARK 290 7555 X+1/3,Y+2/3,Z+2/3
-REMARK 290 8555 -Y+1/3,X-Y+2/3,Z+2/3
-REMARK 290 9555 -X+Y+1/3,-X+2/3,Z+2/3
-REMARK 290
-REMARK 290 WHERE NNN -> OPERATOR NUMBER
-REMARK 290 MMM -> TRANSLATION VECTOR
-REMARK 290
-REMARK 290 CRYSTALLOGRAPHIC SYMMETRY TRANSFORMATIONS
-REMARK 290 THE FOLLOWING TRANSFORMATIONS OPERATE ON THE ATOM/HETATM
-REMARK 290 RECORDS IN THIS ENTRY TO PRODUCE CRYSTALLOGRAPHICALLY
-REMARK 290 RELATED MOLECULES.
-REMARK 290 SMTRY1 1 1.000000 0.000000 0.000000 0.00000
-REMARK 290 SMTRY2 1 0.000000 1.000000 0.000000 0.00000
-REMARK 290 SMTRY3 1 0.000000 0.000000 1.000000 0.00000
-REMARK 290 SMTRY1 2 -0.500000 -0.866025 0.000000 0.00000
-REMARK 290 SMTRY2 2 0.866025 -0.500000 0.000000 0.00000
-REMARK 290 SMTRY3 2 0.000000 0.000000 1.000000 0.00000
-REMARK 290 SMTRY1 3 -0.500000 0.866025 0.000000 0.00000
-REMARK 290 SMTRY2 3 -0.866025 -0.500000 0.000000 0.00000
-REMARK 290 SMTRY3 3 0.000000 0.000000 1.000000 0.00000
-REMARK 290 SMTRY1 4 1.000000 0.000000 0.000000 46.15000
-REMARK 290 SMTRY2 4 0.000000 1.000000 0.000000 26.64471
-REMARK 290 SMTRY3 4 0.000000 0.000000 1.000000 48.73333
-REMARK 290 SMTRY1 5 -0.500000 -0.866025 0.000000 46.15000
-REMARK 290 SMTRY2 5 0.866025 -0.500000 0.000000 26.64471
-REMARK 290 SMTRY3 5 0.000000 0.000000 1.000000 48.73333
-REMARK 290 SMTRY1 6 -0.500000 0.866025 0.000000 46.15000
-REMARK 290 SMTRY2 6 -0.866025 -0.500000 0.000000 26.64471
-REMARK 290 SMTRY3 6 0.000000 0.000000 1.000000 48.73333
-REMARK 290 SMTRY1 7 1.000000 0.000000 0.000000 0.00000
-REMARK 290 SMTRY2 7 0.000000 1.000000 0.000000 53.28943
-REMARK 290 SMTRY3 7 0.000000 0.000000 1.000000 97.46667
-REMARK 290 SMTRY1 8 -0.500000 -0.866025 0.000000 0.00000
-REMARK 290 SMTRY2 8 0.866025 -0.500000 0.000000 53.28943
-REMARK 290 SMTRY3 8 0.000000 0.000000 1.000000 97.46667
-REMARK 290 SMTRY1 9 -0.500000 0.866025 0.000000 0.00000
-REMARK 290 SMTRY2 9 -0.866025 -0.500000 0.000000 53.28943
-REMARK 290 SMTRY3 9 0.000000 0.000000 1.000000 97.46667
-REMARK 290
-REMARK 290 REMARK: NULL
-REMARK 300
-REMARK 300 BIOMOLECULE: 1
-REMARK 300 SEE REMARK 350 FOR THE AUTHOR PROVIDED AND/OR PROGRAM
-REMARK 300 GENERATED ASSEMBLY INFORMATION FOR THE STRUCTURE IN
-REMARK 300 THIS ENTRY. THE REMARK MAY ALSO PROVIDE INFORMATION ON
-REMARK 300 BURIED SURFACE AREA.
-REMARK 350
-REMARK 350 COORDINATES FOR A COMPLETE MULTIMER REPRESENTING THE KNOWN
-REMARK 350 BIOLOGICALLY SIGNIFICANT OLIGOMERIZATION STATE OF THE
-REMARK 350 MOLECULE CAN BE GENERATED BY APPLYING BIOMT TRANSFORMATIONS
-REMARK 350 GIVEN BELOW. BOTH NON-CRYSTALLOGRAPHIC AND
-REMARK 350 CRYSTALLOGRAPHIC OPERATIONS ARE GIVEN.
-REMARK 350
-REMARK 350 BIOMOLECULE: 1
-REMARK 350 AUTHOR DETERMINED BIOLOGICAL UNIT: TRIMERIC
-REMARK 350 APPLY THE FOLLOWING TO CHAINS: A
-REMARK 350 BIOMT1 1 1.000000 0.000000 0.000000 0.00000
-REMARK 350 BIOMT2 1 0.000000 1.000000 0.000000 0.00000
-REMARK 350 BIOMT3 1 0.000000 0.000000 1.000000 0.00000
-REMARK 350 BIOMT1 2 -0.500000 -0.866025 0.000000 0.00000
-REMARK 350 BIOMT2 2 0.866025 -0.500000 0.000000 0.00000
-REMARK 350 BIOMT3 2 0.000000 0.000000 1.000000 0.00000
-REMARK 350 BIOMT1 3 -0.500000 0.866025 0.000000 0.00000
-REMARK 350 BIOMT2 3 -0.866025 -0.500000 0.000000 0.00000
-REMARK 350 BIOMT3 3 0.000000 0.000000 1.000000 0.00000
-REMARK 375
-REMARK 375 SPECIAL POSITION
-REMARK 375 THE FOLLOWING ATOMS ARE FOUND TO BE WITHIN 0.15 ANGSTROMS
-REMARK 375 OF A SYMMETRY RELATED ATOM AND ARE ASSUMED TO BE ON SPECIAL
-REMARK 375 POSITIONS.
-REMARK 375
-REMARK 375 ATOM RES CSSEQI
-REMARK 375 HOH A 361 LIES ON A SPECIAL POSITION.
-REMARK 500
-REMARK 500 GEOMETRY AND STEREOCHEMISTRY
-REMARK 500 SUBTOPIC: COVALENT BOND LENGTHS
-REMARK 500
-REMARK 500 THE STEREOCHEMICAL PARAMETERS OF THE FOLLOWING RESIDUES
-REMARK 500 HAVE VALUES WHICH DEVIATE FROM EXPECTED VALUES BY MORE
-REMARK 500 THAN 6*RMSD (M=MODEL NUMBER; RES=RESIDUE NAME; C=CHAIN
-REMARK 500 IDENTIFIER; SSEQ=SEQUENCE NUMBER; I=INSERTION CODE).
-REMARK 500
-REMARK 500 STANDARD TABLE:
-REMARK 500 FORMAT: (10X,I3,1X,2(A3,1X,A1,I4,A1,1X,A4,3X),1X,F6.3)
-REMARK 500
-REMARK 500 EXPECTED VALUES PROTEIN: ENGH AND HUBER, 1999
-REMARK 500 EXPECTED VALUES NUCLEIC ACID: CLOWNEY ET AL 1996
-REMARK 500
-REMARK 500 M RES CSSEQI ATM1 RES CSSEQI ATM2 DEVIATION
-REMARK 500 HIS A 229 NE2 HIS A 229 CD2 -0.067
-REMARK 500
-REMARK 500 REMARK: NULL
-REMARK 500
-REMARK 500 GEOMETRY AND STEREOCHEMISTRY
-REMARK 500 SUBTOPIC: COVALENT BOND ANGLES
-REMARK 500
-REMARK 500 THE STEREOCHEMICAL PARAMETERS OF THE FOLLOWING RESIDUES
-REMARK 500 HAVE VALUES WHICH DEVIATE FROM EXPECTED VALUES BY MORE
-REMARK 500 THAN 6*RMSD (M=MODEL NUMBER; RES=RESIDUE NAME; C=CHAIN
-REMARK 500 IDENTIFIER; SSEQ=SEQUENCE NUMBER; I=INSERTION CODE).
-REMARK 500
-REMARK 500 STANDARD TABLE:
-REMARK 500 FORMAT: (10X,I3,1X,A3,1X,A1,I4,A1,3(1X,A4,2X),12X,F5.1)
-REMARK 500
-REMARK 500 EXPECTED VALUES PROTEIN: ENGH AND HUBER, 1999
-REMARK 500 EXPECTED VALUES NUCLEIC ACID: CLOWNEY ET AL 1996
-REMARK 500
-REMARK 500 M RES CSSEQI ATM1 ATM2 ATM3
-REMARK 500 ARG A 9 NE - CZ - NH2 ANGL. DEV. = -3.2 DEGREES
-REMARK 500 TRP A 19 CD1 - CG - CD2 ANGL. DEV. = 6.6 DEGREES
-REMARK 500 TRP A 19 CE2 - CD2 - CG ANGL. DEV. = -5.6 DEGREES
-REMARK 500 ARG A 24 NE - CZ - NH1 ANGL. DEV. = 3.1 DEGREES
-REMARK 500 ASP A 101 CB - CG - OD1 ANGL. DEV. = 7.3 DEGREES
-REMARK 500 TYR A 123 CB - CG - CD1 ANGL. DEV. = -3.9 DEGREES
-REMARK 500 ASP A 136 CB - CG - OD1 ANGL. DEV. = 6.2 DEGREES
-REMARK 500 TYR A 167 CB - CG - CD2 ANGL. DEV. = -4.2 DEGREES
-REMARK 500 TYR A 263 CB - CG - CD1 ANGL. DEV. = -4.4 DEGREES
-REMARK 500
-REMARK 500 REMARK: NULL
-REMARK 500
-REMARK 500 GEOMETRY AND STEREOCHEMISTRY
-REMARK 500 SUBTOPIC: TORSION ANGLES
-REMARK 500
-REMARK 500 TORSION ANGLES OUTSIDE THE EXPECTED RAMACHANDRAN REGIONS:
-REMARK 500 (M=MODEL NUMBER; RES=RESIDUE NAME; C=CHAIN IDENTIFIER;
-REMARK 500 SSEQ=SEQUENCE NUMBER; I=INSERTION CODE).
-REMARK 500
-REMARK 500 STANDARD TABLE:
-REMARK 500 FORMAT:(10X,I3,1X,A3,1X,A1,I4,A1,4X,F7.2,3X,F7.2)
-REMARK 500
-REMARK 500 EXPECTED VALUES: GJ KLEYWEGT AND TA JONES (1996). PHI/PSI-
-REMARK 500 CHOLOGY: RAMACHANDRAN REVISITED. STRUCTURE 4, 1395 - 1400
-REMARK 500
-REMARK 500 M RES CSSEQI PSI PHI
-REMARK 500 ASP A 17 -37.35 -132.37
-REMARK 500 ASP A 93 83.99 64.70
-REMARK 500 THR A 256 -7.57 73.01
-REMARK 500 ILE A 257 -77.43 -108.97
-REMARK 500 SER A 289 112.52 -34.30
-REMARK 500
-REMARK 500 REMARK: NULL
-REMARK 525
-REMARK 525 SOLVENT
-REMARK 525
-REMARK 525 THE SOLVENT MOLECULES HAVE CHAIN IDENTIFIERS THAT
-REMARK 525 INDICATE THE POLYMER CHAIN WITH WHICH THEY ARE MOST
-REMARK 525 CLOSELY ASSOCIATED. THE REMARK LISTS ALL THE SOLVENT
-REMARK 525 MOLECULES WHICH ARE MORE THAN 5A AWAY FROM THE
-REMARK 525 NEAREST POLYMER CHAIN (M = MODEL NUMBER;
-REMARK 525 RES=RESIDUE NAME; C=CHAIN IDENTIFIER; SSEQ=SEQUENCE
-REMARK 525 NUMBER; I=INSERTION CODE):
-REMARK 525
-REMARK 525 M RES CSSEQI
-REMARK 525 HOH A 446 DISTANCE = 5.96 ANGSTROMS
-REMARK 525 HOH A 558 DISTANCE = 7.12 ANGSTROMS
-REMARK 525 HOH A 565 DISTANCE = 6.72 ANGSTROMS
-REMARK 525 HOH A 568 DISTANCE = 7.37 ANGSTROMS
-REMARK 525 HOH A 571 DISTANCE = 5.80 ANGSTROMS
-REMARK 525 HOH A 573 DISTANCE = 5.38 ANGSTROMS
-REMARK 525 HOH A 582 DISTANCE = 5.49 ANGSTROMS
-REMARK 600
-REMARK 600 HETEROGEN
-REMARK 600 THIRTY FOUR DETERGENT FRAGMENTS HAVE BEEN MODELED AS WATERS
-REMARK 620
-REMARK 620 METAL COORDINATION
-REMARK 620 (M=MODEL NUMBER; RES=RESIDUE NAME; C=CHAIN IDENTIFIER;
-REMARK 620 SSEQ=SEQUENCE NUMBER; I=INSERTION CODE):
-REMARK 620
-REMARK 620 COORDINATION ANGLES FOR: M RES CSSEQI METAL
-REMARK 620 CA A 302 CA
-REMARK 620 N RES CSSEQI ATOM
-REMARK 620 1 HOH A 312 O
-REMARK 620 2 HOH A 307 O 79.4
-REMARK 620 3 HOH A 339 O 86.7 74.4
-REMARK 620 4 GLU A 80 OE2 80.9 75.3 148.9
-REMARK 620 5 GLU A 80 OE1 92.0 125.5 159.5 50.2
-REMARK 620 6 ASP A 108 OD2 175.3 95.8 92.3 97.7 90.6
-REMARK 620 7 HOH A 305 O 86.9 150.3 78.6 128.6 80.9 97.5
-REMARK 620 N 1 2 3 4 5 6
-REMARK 620
-REMARK 620 COORDINATION ANGLES FOR: M RES CSSEQI METAL
-REMARK 620 CA A 303 CA
-REMARK 620 N RES CSSEQI ATOM
-REMARK 620 1 ASP A 95 OD1
-REMARK 620 2 ASN A 100 OD1 73.7
-REMARK 620 3 ASP A 101 OD1 85.1 81.2
-REMARK 620 4 HOH A 331 O 150.5 76.9 93.2
-REMARK 620 5 ASP A 93 OD1 77.7 77.7 155.8 93.5
-REMARK 620 6 ASP A 93 OD2 113.9 122.8 151.9 80.1 52.3
-REMARK 620 7 ASP A 95 OD2 49.5 123.2 94.3 159.4 87.3 84.2
-REMARK 620 8 HOH A 327 O 126.7 146.6 75.5 80.8 128.6 76.5 82.6
-REMARK 620 N 1 2 3 4 5 6 7
-REMARK 620
-REMARK 620 COORDINATION ANGLES FOR: M RES CSSEQI METAL
-REMARK 620 CA A 304 CA
-REMARK 620 N RES CSSEQI ATOM
-REMARK 620 1 ASN A 116 OD1
-REMARK 620 2 ASP A 136 OD2 103.7
-REMARK 620 3 LYS A 138 O 81.6 128.0
-REMARK 620 4 GLY A 140 O 95.7 145.2 82.9
-REMARK 620 5 HOH A 314 O 84.5 78.0 152.9 75.4
-REMARK 620 6 ASP A 136 OD1 89.8 52.3 76.4 157.5 126.9
-REMARK 620 7 ASN A 20 OD1 174.7 81.5 94.8 79.9 97.2 93.2
-REMARK 620 N 1 2 3 4 5 6
-REMARK 700
-REMARK 700 SHEET
-REMARK 700 THE SHEET PRESENTED AS *S1* ON SHEET RECORDS BELOW IS
-REMARK 700 ACTUALLY A SIXTEEN-STRANDED BETA-BARREL. THIS IS
-REMARK 700 REPRESENTED AS A SEVENTEEN-STRANDED SHEET IN WHICH THE
-REMARK 700 FIRST AND LAST STRANDS ARE IDENTICAL.
-REMARK 800
-REMARK 800 SITE
-REMARK 800 SITE_IDENTIFIER: AC1
-REMARK 800 EVIDENCE_CODE: SOFTWARE
-REMARK 800 SITE_DESCRIPTION: BINDING SITE FOR RESIDUE CA A 302
-REMARK 800 SITE_IDENTIFIER: AC2
-REMARK 800 EVIDENCE_CODE: SOFTWARE
-REMARK 800 SITE_DESCRIPTION: BINDING SITE FOR RESIDUE CA A 303
-REMARK 800 SITE_IDENTIFIER: AC3
-REMARK 800 EVIDENCE_CODE: SOFTWARE
-REMARK 800 SITE_DESCRIPTION: BINDING SITE FOR RESIDUE CA A 304
-REMARK 800 SITE_IDENTIFIER: AC4
-REMARK 800 EVIDENCE_CODE: SOFTWARE
-REMARK 800 SITE_DESCRIPTION: BINDING SITE FOR RESIDUE C8E A 545
-REMARK 800 SITE_IDENTIFIER: AC5
-REMARK 800 EVIDENCE_CODE: SOFTWARE
-REMARK 800 SITE_DESCRIPTION: BINDING SITE FOR RESIDUE C8E A 546
-REMARK 800 SITE_IDENTIFIER: AC6
-REMARK 800 EVIDENCE_CODE: SOFTWARE
-REMARK 800 SITE_DESCRIPTION: BINDING SITE FOR RESIDUE C8E A 548
-DBREF 2POR A 1 301 UNP P31243 PORI_RHOCA 1 301
-SEQRES 1 A 301 GLU VAL LYS LEU SER GLY ASP ALA ARG MET GLY VAL MET
-SEQRES 2 A 301 TYR ASN GLY ASP ASP TRP ASN PHE SER SER ARG SER ARG
-SEQRES 3 A 301 VAL LEU PHE THR MET SER GLY THR THR ASP SER GLY LEU
-SEQRES 4 A 301 GLU PHE GLY ALA SER PHE LYS ALA HIS GLU SER VAL GLY
-SEQRES 5 A 301 ALA GLU THR GLY GLU ASP GLY THR VAL PHE LEU SER GLY
-SEQRES 6 A 301 ALA PHE GLY LYS ILE GLU MET GLY ASP ALA LEU GLY ALA
-SEQRES 7 A 301 SER GLU ALA LEU PHE GLY ASP LEU TYR GLU VAL GLY TYR
-SEQRES 8 A 301 THR ASP LEU ASP ASP ARG GLY GLY ASN ASP ILE PRO TYR
-SEQRES 9 A 301 LEU THR GLY ASP GLU ARG LEU THR ALA GLU ASP ASN PRO
-SEQRES 10 A 301 VAL LEU LEU TYR THR TYR SER ALA GLY ALA PHE SER VAL
-SEQRES 11 A 301 ALA ALA SER MET SER ASP GLY LYS VAL GLY GLU THR SER
-SEQRES 12 A 301 GLU ASP ASP ALA GLN GLU MET ALA VAL ALA ALA ALA TYR
-SEQRES 13 A 301 THR PHE GLY ASN TYR THR VAL GLY LEU GLY TYR GLU LYS
-SEQRES 14 A 301 ILE ASP SER PRO ASP THR ALA LEU MET ALA ASP MET GLU
-SEQRES 15 A 301 GLN LEU GLU LEU ALA ALA ILE ALA LYS PHE GLY ALA THR
-SEQRES 16 A 301 ASN VAL LYS ALA TYR TYR ALA ASP GLY GLU LEU ASP ARG
-SEQRES 17 A 301 ASP PHE ALA ARG ALA VAL PHE ASP LEU THR PRO VAL ALA
-SEQRES 18 A 301 ALA ALA ALA THR ALA VAL ASP HIS LYS ALA TYR GLY LEU
-SEQRES 19 A 301 SER VAL ASP SER THR PHE GLY ALA THR THR VAL GLY GLY
-SEQRES 20 A 301 TYR VAL GLN VAL LEU ASP ILE ASP THR ILE ASP ASP VAL
-SEQRES 21 A 301 THR TYR TYR GLY LEU GLY ALA SER TYR ASP LEU GLY GLY
-SEQRES 22 A 301 GLY ALA SER ILE VAL GLY GLY ILE ALA ASP ASN ASP LEU
-SEQRES 23 A 301 PRO ASN SER ASP MET VAL ALA ASP LEU GLY VAL LYS PHE
-SEQRES 24 A 301 LYS PHE
-HET CA A 302 1
-HET CA A 303 1
-HET CA A 304 1
-HET C8E A 545 21
-HET C8E A 546 21
-HET C8E A 547 21
-HET C8E A 548 21
-HETNAM CA CALCIUM ION
-HETNAM C8E (HYDROXYETHYLOXY)TRI(ETHYLOXY)OCTANE
-FORMUL 2 CA 3(CA 2+)
-FORMUL 5 C8E 4(C16 H34 O5)
-FORMUL 9 HOH *274(H2 O)
-HELIX 1 H1 SER A 50 GLU A 54 1 5
-HELIX 2 H2 GLY A 77 PHE A 83 1 7
-HELIX 3 H3 ARG A 208 VAL A 214 1 7
-SHEET 1 S117 GLU A 1 ASN A 15 0
-SHEET 2 S117 ASP A 18 THR A 35 -1 O ASP A 18 N ASN A 15
-SHEET 3 S117 LEU A 39 LYS A 46 -1 O LEU A 39 N THR A 35
-SHEET 4 S117 GLY A 59 GLY A 65 -1 N THR A 60 O SER A 44
-SHEET 5 S117 GLY A 68 ASP A 74 -1 N GLY A 68 O GLY A 65
-SHEET 6 S117 VAL A 118 ALA A 125 -1 N VAL A 118 O GLY A 73
-SHEET 7 S117 PHE A 128 SER A 135 -1 N PHE A 128 O ALA A 125
-SHEET 8 S117 GLN A 148 PHE A 158 -1 O GLU A 149 N SER A 135
-SHEET 9 S117 TYR A 161 ASP A 171 -1 N TYR A 161 O PHE A 158
-SHEET 10 S117 MET A 181 PHE A 192 -1 N MET A 181 O ILE A 170
-SHEET 11 S117 THR A 195 LEU A 206 -1 N THR A 195 O PHE A 192
-SHEET 12 S117 VAL A 227 PHE A 240 -1 N VAL A 227 O LEU A 206
-SHEET 13 S117 THR A 243 ILE A 254 -1 N THR A 243 O PHE A 240
-SHEET 14 S117 ASP A 258 LEU A 271 -1 N ASP A 258 O ILE A 254
-SHEET 15 S117 ALA A 275 ASP A 285 -1 O ALA A 275 N LEU A 271
-SHEET 16 S117 VAL A 292 PHE A 301 -1 N VAL A 292 O ALA A 282
-SHEET 17 S117 GLU A 1 ASN A 15 1 N GLY A 6 O PHE A 301
-LINK CA CA A 302 O HOH A 312 1555 1555 2.28
-LINK CA CA A 302 O HOH A 307 1555 1555 2.32
-LINK CA CA A 302 O HOH A 339 1555 1555 2.38
-LINK CA CA A 302 OE2 GLU A 80 1555 1555 2.48
-LINK CA CA A 302 OE1 GLU A 80 1555 1555 2.53
-LINK CA CA A 302 OD2 ASP A 108 1555 1555 2.24
-LINK CA CA A 302 O HOH A 305 1555 1555 2.43
-LINK CA CA A 303 OD1 ASP A 95 1555 1555 2.63
-LINK CA CA A 303 OD1 ASN A 100 1555 1555 2.31
-LINK CA CA A 303 OD1 ASP A 101 1555 1555 2.25
-LINK CA CA A 303 O HOH A 331 1555 1555 2.39
-LINK CA CA A 303 OD1 ASP A 93 1555 1555 2.33
-LINK CA CA A 303 OD2 ASP A 93 1555 1555 2.45
-LINK CA CA A 303 OD2 ASP A 95 1555 1555 2.40
-LINK CA CA A 303 O HOH A 327 1555 1555 2.24
-LINK CA CA A 304 OD1 ASN A 116 1555 1555 2.16
-LINK CA CA A 304 OD2 ASP A 136 1555 1555 2.39
-LINK CA CA A 304 O LYS A 138 1555 1555 2.55
-LINK CA CA A 304 O GLY A 140 1555 1555 2.18
-LINK CA CA A 304 O HOH A 314 1555 1555 2.35
-LINK CA CA A 304 OD1 ASP A 136 1555 1555 2.35
-LINK CA CA A 304 OD1 ASN A 20 1555 2555 2.18
-SITE 1 AC1 6 GLU A 80 ASP A 108 HOH A 305 HOH A 307
-SITE 2 AC1 6 HOH A 312 HOH A 339
-SITE 1 AC2 6 ASP A 93 ASP A 95 ASN A 100 ASP A 101
-SITE 2 AC2 6 HOH A 327 HOH A 331
-SITE 1 AC3 6 ASN A 20 ASN A 116 ASP A 136 LYS A 138
-SITE 2 AC3 6 GLY A 140 HOH A 314
-SITE 1 AC4 4 GLN A 183 VAL A 214 LEU A 286 ASN A 288
-SITE 1 AC5 4 TRP A 19 MET A 134 GLN A 148 GLY A 280
-SITE 1 AC6 4 TYR A 200 TYR A 232 VAL A 249 THR A 261
-CRYST1 92.300 92.300 146.200 90.00 90.00 120.00 H 3 9
-ORIGX1 1.000000 0.000000 0.000000 0.00000
-ORIGX2 0.000000 1.000000 0.000000 0.00000
-ORIGX3 0.000000 0.000000 1.000000 0.00000
-SCALE1 0.010834 0.006255 0.000000 0.00000
-SCALE2 0.000000 0.012510 0.000000 0.00000
-SCALE3 0.000000 0.000000 0.006840 0.00000
-ATOM 1 N GLU A 1 10.975 -2.428 6.735 1.00 27.59 N
-ATOM 2 CA GLU A 1 9.566 -2.578 6.405 1.00 36.06 C
-ATOM 3 C GLU A 1 8.689 -3.034 7.601 1.00 22.34 C
-ATOM 4 O GLU A 1 9.156 -3.908 8.335 1.00 23.38 O
-ATOM 5 CB GLU A 1 9.513 -3.583 5.273 1.00 27.56 C
-ATOM 6 CG GLU A 1 8.120 -3.932 4.767 1.00 46.76 C
-ATOM 7 CD GLU A 1 8.059 -5.151 3.839 1.00 78.17 C
-ATOM 8 OE1 GLU A 1 8.986 -5.978 3.838 1.00 83.62 O
-ATOM 9 OE2 GLU A 1 7.059 -5.270 3.122 1.00 88.58 O
-ATOM 10 N VAL A 2 7.445 -2.564 7.760 1.00 24.91 N
-ATOM 11 CA VAL A 2 6.554 -2.916 8.868 1.00 26.19 C
-ATOM 12 C VAL A 2 5.235 -3.431 8.314 1.00 21.63 C
-ATOM 13 O VAL A 2 4.554 -2.685 7.614 1.00 25.05 O
-ATOM 14 CB VAL A 2 6.258 -1.672 9.795 1.00 21.80 C
-ATOM 15 CG1 VAL A 2 5.414 -2.151 10.975 1.00 21.14 C
-ATOM 16 CG2 VAL A 2 7.526 -1.022 10.328 1.00 21.61 C
-ATOM 17 N LYS A 3 4.811 -4.658 8.584 1.00 17.35 N
-ATOM 18 CA LYS A 3 3.536 -5.187 8.138 1.00 16.93 C
-ATOM 19 C LYS A 3 2.611 -5.431 9.336 1.00 22.75 C
-ATOM 20 O LYS A 3 3.086 -5.703 10.440 1.00 24.29 O
-ATOM 21 CB LYS A 3 3.712 -6.524 7.421 1.00 20.86 C
-ATOM 22 CG LYS A 3 4.477 -6.434 6.116 1.00 49.31 C
-ATOM 23 CD LYS A 3 4.137 -7.645 5.248 1.00 66.30 C
-ATOM 24 CE LYS A 3 4.389 -7.309 3.763 1.00 91.35 C
-ATOM 25 NZ LYS A 3 3.660 -6.128 3.288 1.00 86.70 N
-ATOM 26 N LEU A 4 1.317 -5.393 9.102 1.00 18.28 N
-ATOM 27 CA LEU A 4 0.307 -5.586 10.089 1.00 17.20 C
-ATOM 28 C LEU A 4 -0.511 -6.790 9.822 1.00 25.71 C
-ATOM 29 O LEU A 4 -0.857 -7.096 8.688 1.00 22.60 O
-ATOM 30 CB LEU A 4 -0.658 -4.425 10.135 1.00 17.62 C
-ATOM 31 CG LEU A 4 -0.154 -3.047 10.591 1.00 25.02 C
-ATOM 32 CD1 LEU A 4 -1.260 -2.032 10.663 1.00 27.49 C
-ATOM 33 CD2 LEU A 4 0.342 -3.158 12.001 1.00 28.78 C
-ATOM 34 N SER A 5 -0.858 -7.520 10.854 1.00 18.09 N
-ATOM 35 CA SER A 5 -1.843 -8.581 10.759 1.00 16.56 C
-ATOM 36 C SER A 5 -2.590 -8.569 12.107 1.00 21.22 C
-ATOM 37 O SER A 5 -2.231 -7.755 12.976 1.00 17.63 O
-ATOM 38 CB SER A 5 -1.182 -9.918 10.543 1.00 15.90 C
-ATOM 39 OG SER A 5 -0.206 -10.289 11.503 1.00 22.45 O
-ATOM 40 N GLY A 6 -3.582 -9.404 12.337 1.00 22.36 N
-ATOM 41 CA GLY A 6 -4.313 -9.399 13.598 1.00 18.52 C
-ATOM 42 C GLY A 6 -5.194 -10.590 13.711 1.00 20.43 C
-ATOM 43 O GLY A 6 -5.272 -11.470 12.839 1.00 19.89 O
-ATOM 44 N ASP A 7 -5.858 -10.676 14.845 1.00 17.75 N
-ATOM 45 CA ASP A 7 -6.828 -11.730 15.071 1.00 14.63 C
-ATOM 46 C ASP A 7 -7.839 -11.230 16.099 1.00 17.50 C
-ATOM 47 O ASP A 7 -7.656 -10.162 16.698 1.00 17.10 O
-ATOM 48 CB ASP A 7 -6.157 -13.038 15.557 1.00 15.83 C
-ATOM 49 CG ASP A 7 -5.230 -12.906 16.760 1.00 23.05 C
-ATOM 50 OD1 ASP A 7 -5.656 -12.431 17.801 1.00 20.15 O
-ATOM 51 OD2 ASP A 7 -4.071 -13.234 16.640 1.00 25.78 O
-ATOM 52 N ALA A 8 -8.944 -11.946 16.224 1.00 19.52 N
-ATOM 53 CA ALA A 8 -10.035 -11.603 17.141 1.00 15.71 C
-ATOM 54 C ALA A 8 -10.861 -12.858 17.357 1.00 19.05 C
-ATOM 55 O ALA A 8 -10.682 -13.866 16.641 1.00 18.32 O
-ATOM 56 CB ALA A 8 -10.945 -10.502 16.587 1.00 14.05 C
-ATOM 57 N ARG A 9 -11.662 -12.914 18.432 1.00 16.33 N
-ATOM 58 CA ARG A 9 -12.501 -14.065 18.709 1.00 13.95 C
-ATOM 59 C ARG A 9 -13.651 -13.601 19.567 1.00 17.40 C
-ATOM 60 O ARG A 9 -13.553 -12.536 20.208 1.00 18.39 O
-ATOM 61 CB ARG A 9 -11.687 -15.156 19.410 1.00 15.94 C
-ATOM 62 CG ARG A 9 -11.320 -14.825 20.843 1.00 16.00 C
-ATOM 63 CD ARG A 9 -10.256 -15.772 21.276 1.00 19.18 C
-ATOM 64 NE ARG A 9 -10.038 -15.564 22.699 1.00 20.39 N
-ATOM 65 CZ ARG A 9 -8.998 -16.081 23.374 1.00 23.61 C
-ATOM 66 NH1 ARG A 9 -8.039 -16.818 22.792 1.00 19.92 N
-ATOM 67 NH2 ARG A 9 -8.922 -15.805 24.689 1.00 23.34 N
-ATOM 68 N MET A 10 -14.789 -14.262 19.531 1.00 15.77 N
-ATOM 69 CA MET A 10 -15.931 -13.891 20.365 1.00 19.06 C
-ATOM 70 C MET A 10 -16.832 -15.099 20.499 1.00 24.44 C
-ATOM 71 O MET A 10 -16.838 -15.965 19.620 1.00 18.02 O
-ATOM 72 CB MET A 10 -16.723 -12.707 19.809 1.00 18.72 C
-ATOM 73 CG MET A 10 -17.489 -12.938 18.541 1.00 25.28 C
-ATOM 74 SD MET A 10 -18.482 -11.490 18.191 1.00 30.85 S
-ATOM 75 CE MET A 10 -18.740 -12.010 16.541 1.00 33.80 C
-ATOM 76 N GLY A 11 -17.502 -15.304 21.642 1.00 17.85 N
-ATOM 77 CA GLY A 11 -18.325 -16.491 21.829 1.00 18.79 C
-ATOM 78 C GLY A 11 -18.676 -16.572 23.288 1.00 25.94 C
-ATOM 79 O GLY A 11 -18.702 -15.531 23.959 1.00 21.22 O
-ATOM 80 N VAL A 12 -18.929 -17.776 23.769 1.00 22.43 N
-ATOM 81 CA VAL A 12 -19.310 -18.051 25.177 1.00 22.84 C
-ATOM 82 C VAL A 12 -18.421 -19.118 25.753 1.00 21.81 C
-ATOM 83 O VAL A 12 -18.005 -20.034 25.037 1.00 20.69 O
-ATOM 84 CB VAL A 12 -20.786 -18.518 25.319 1.00 23.09 C
-ATOM 85 CG1 VAL A 12 -21.639 -17.287 25.071 1.00 21.02 C
-ATOM 86 CG2 VAL A 12 -21.167 -19.632 24.355 1.00 22.56 C
-ATOM 87 N MET A 13 -18.010 -18.982 27.018 1.00 16.86 N
-ATOM 88 CA MET A 13 -17.066 -19.909 27.604 1.00 18.95 C
-ATOM 89 C MET A 13 -17.695 -20.359 28.938 1.00 26.49 C
-ATOM 90 O MET A 13 -18.277 -19.533 29.649 1.00 22.68 O
-ATOM 91 CB MET A 13 -15.725 -19.176 27.821 1.00 19.57 C
-ATOM 92 CG AMET A 13 -14.661 -20.018 28.553 0.51 33.28 C
-ATOM 93 CG BMET A 13 -14.564 -19.969 28.448 0.49 31.07 C
-ATOM 94 SD AMET A 13 -14.864 -20.093 30.362 0.51 18.59 S
-ATOM 95 SD BMET A 13 -14.047 -19.495 30.135 0.49 33.60 S
-ATOM 96 CE AMET A 13 -14.637 -18.365 30.663 0.51 14.41 C
-ATOM 97 CE BMET A 13 -13.423 -21.075 30.594 0.49 12.77 C
-ATOM 98 N TYR A 14 -17.572 -21.615 29.305 1.00 23.01 N
-ATOM 99 CA TYR A 14 -18.178 -22.199 30.497 1.00 25.16 C
-ATOM 100 C TYR A 14 -17.029 -22.485 31.428 1.00 23.22 C
-ATOM 101 O TYR A 14 -16.171 -23.295 31.063 1.00 23.70 O
-ATOM 102 CB TYR A 14 -18.841 -23.482 30.133 1.00 24.00 C
-ATOM 103 CG TYR A 14 -19.541 -24.129 31.300 1.00 28.72 C
-ATOM 104 CD1 TYR A 14 -20.727 -23.561 31.734 1.00 29.42 C
-ATOM 105 CD2 TYR A 14 -19.017 -25.283 31.856 1.00 27.77 C
-ATOM 106 CE1 TYR A 14 -21.430 -24.167 32.750 1.00 32.13 C
-ATOM 107 CE2 TYR A 14 -19.717 -25.895 32.876 1.00 30.23 C
-ATOM 108 CZ TYR A 14 -20.915 -25.329 33.305 1.00 32.81 C
-ATOM 109 OH TYR A 14 -21.626 -25.944 34.326 1.00 50.72 O
-ATOM 110 N ASN A 15 -17.000 -21.905 32.638 1.00 22.01 N
-ATOM 111 CA ASN A 15 -15.841 -22.047 33.535 1.00 22.52 C
-ATOM 112 C ASN A 15 -15.889 -23.250 34.484 1.00 31.39 C
-ATOM 113 O ASN A 15 -15.038 -23.447 35.359 1.00 32.32 O
-ATOM 114 CB ASN A 15 -15.660 -20.755 34.380 1.00 24.87 C
-ATOM 115 CG ASN A 15 -16.856 -20.434 35.271 1.00 23.96 C
-ATOM 116 OD1 ASN A 15 -17.708 -21.291 35.515 1.00 23.91 O
-ATOM 117 ND2 ASN A 15 -17.090 -19.204 35.695 1.00 26.01 N
-ATOM 118 N GLY A 16 -16.865 -24.119 34.303 1.00 26.28 N
-ATOM 119 CA GLY A 16 -17.013 -25.246 35.198 1.00 33.32 C
-ATOM 120 C GLY A 16 -18.353 -25.113 35.878 1.00 30.42 C
-ATOM 121 O GLY A 16 -18.975 -26.124 36.199 1.00 36.69 O
-ATOM 122 N ASP A 17 -18.860 -23.882 36.047 1.00 29.56 N
-ATOM 123 CA ASP A 17 -20.141 -23.614 36.727 1.00 29.65 C
-ATOM 124 C ASP A 17 -21.077 -22.659 35.981 1.00 32.17 C
-ATOM 125 O ASP A 17 -22.304 -22.831 35.929 1.00 30.83 O
-ATOM 126 CB ASP A 17 -19.849 -23.042 38.165 1.00 35.32 C
-ATOM 127 CG ASP A 17 -18.950 -23.913 39.090 1.00 51.32 C
-ATOM 128 OD1 ASP A 17 -19.361 -25.019 39.486 1.00 59.35 O
-ATOM 129 OD2 ASP A 17 -17.822 -23.488 39.391 1.00 65.43 O
-ATOM 130 N ASP A 18 -20.505 -21.638 35.336 1.00 24.80 N
-ATOM 131 CA ASP A 18 -21.301 -20.661 34.621 1.00 23.22 C
-ATOM 132 C ASP A 18 -20.689 -20.330 33.261 1.00 26.47 C
-ATOM 133 O ASP A 18 -19.485 -20.520 33.049 1.00 25.52 O
-ATOM 134 CB ASP A 18 -21.381 -19.351 35.370 1.00 25.98 C
-ATOM 135 CG ASP A 18 -22.210 -19.562 36.608 1.00 43.16 C
-ATOM 136 OD1 ASP A 18 -23.428 -19.634 36.500 1.00 41.16 O
-ATOM 137 OD2 ASP A 18 -21.610 -19.689 37.666 1.00 33.11 O
-ATOM 138 N TRP A 19 -21.570 -19.845 32.394 1.00 24.02 N
-ATOM 139 CA TRP A 19 -21.228 -19.334 31.074 1.00 29.52 C
-ATOM 140 C TRP A 19 -20.887 -17.850 31.201 1.00 34.72 C
-ATOM 141 O TRP A 19 -21.489 -17.150 32.023 1.00 26.95 O
-ATOM 142 CB TRP A 19 -22.413 -19.489 30.099 1.00 20.45 C
-ATOM 143 CG TRP A 19 -22.600 -20.931 29.671 1.00 34.12 C
-ATOM 144 CD1 TRP A 19 -23.521 -21.735 30.283 1.00 38.42 C
-ATOM 145 CD2 TRP A 19 -21.879 -21.586 28.704 1.00 43.20 C
-ATOM 146 NE1 TRP A 19 -23.378 -22.907 29.705 1.00 28.98 N
-ATOM 147 CE2 TRP A 19 -22.416 -22.861 28.769 1.00 43.13 C
-ATOM 148 CE3 TRP A 19 -20.869 -21.291 27.804 1.00 27.67 C
-ATOM 149 CZ2 TRP A 19 -21.955 -23.858 27.942 1.00 37.29 C
-ATOM 150 CZ3 TRP A 19 -20.404 -22.293 26.974 1.00 26.31 C
-ATOM 151 CH2 TRP A 19 -20.947 -23.560 27.045 1.00 34.35 C
-ATOM 152 N ASN A 20 -19.915 -17.345 30.439 1.00 20.14 N
-ATOM 153 CA ASN A 20 -19.610 -15.934 30.363 1.00 20.63 C
-ATOM 154 C ASN A 20 -19.325 -15.585 28.909 1.00 21.59 C
-ATOM 155 O ASN A 20 -18.824 -16.452 28.179 1.00 20.91 O
-ATOM 156 CB ASN A 20 -18.358 -15.571 31.135 1.00 19.26 C
-ATOM 157 CG ASN A 20 -18.632 -15.209 32.594 1.00 16.94 C
-ATOM 158 OD1 ASN A 20 -18.981 -14.061 32.912 1.00 19.32 O
-ATOM 159 ND2 ASN A 20 -18.356 -16.193 33.429 1.00 18.90 N
-ATOM 160 N PHE A 21 -19.579 -14.348 28.511 1.00 20.31 N
-ATOM 161 CA PHE A 21 -19.123 -13.839 27.208 1.00 18.80 C
-ATOM 162 C PHE A 21 -17.596 -13.740 27.273 1.00 29.01 C
-ATOM 163 O PHE A 21 -17.046 -13.375 28.323 1.00 18.59 O
-ATOM 164 CB PHE A 21 -19.693 -12.434 26.920 1.00 15.96 C
-ATOM 165 CG PHE A 21 -21.210 -12.260 26.798 1.00 16.47 C
-ATOM 166 CD1 PHE A 21 -22.038 -13.317 26.450 1.00 18.25 C
-ATOM 167 CD2 PHE A 21 -21.730 -11.004 27.047 1.00 17.20 C
-ATOM 168 CE1 PHE A 21 -23.387 -13.081 26.366 1.00 20.58 C
-ATOM 169 CE2 PHE A 21 -23.088 -10.789 26.954 1.00 18.95 C
-ATOM 170 CZ PHE A 21 -23.906 -11.831 26.615 1.00 18.40 C
-ATOM 171 N SER A 22 -16.849 -14.072 26.211 1.00 16.37 N
-ATOM 172 CA SER A 22 -15.406 -13.978 26.201 1.00 15.71 C
-ATOM 173 C SER A 22 -14.989 -13.518 24.795 1.00 27.98 C
-ATOM 174 O SER A 22 -15.346 -14.160 23.810 1.00 18.52 O
-ATOM 175 CB SER A 22 -14.824 -15.314 26.508 1.00 13.95 C
-ATOM 176 OG SER A 22 -13.431 -15.173 26.702 1.00 17.49 O
-ATOM 177 N SER A 23 -14.273 -12.416 24.652 1.00 17.53 N
-ATOM 178 CA SER A 23 -13.869 -11.906 23.350 1.00 21.71 C
-ATOM 179 C SER A 23 -12.546 -11.168 23.448 1.00 27.30 C
-ATOM 180 O SER A 23 -12.101 -10.859 24.561 1.00 18.45 O
-ATOM 181 CB SER A 23 -14.984 -11.006 22.851 1.00 13.04 C
-ATOM 182 OG SER A 23 -15.192 -9.821 23.590 1.00 17.20 O
-ATOM 183 N ARG A 24 -11.805 -10.927 22.371 1.00 16.47 N
-ATOM 184 CA ARG A 24 -10.586 -10.139 22.390 1.00 18.28 C
-ATOM 185 C ARG A 24 -10.232 -9.787 20.944 1.00 21.67 C
-ATOM 186 O ARG A 24 -10.765 -10.417 20.032 1.00 17.72 O
-ATOM 187 CB ARG A 24 -9.384 -10.889 22.934 1.00 14.39 C
-ATOM 188 CG ARG A 24 -8.805 -12.022 22.187 1.00 17.95 C
-ATOM 189 CD ARG A 24 -7.506 -12.385 22.785 1.00 18.22 C
-ATOM 190 NE ARG A 24 -6.965 -13.447 21.943 1.00 16.16 N
-ATOM 191 CZ ARG A 24 -5.984 -14.286 22.251 1.00 22.92 C
-ATOM 192 NH1 ARG A 24 -5.364 -14.285 23.426 1.00 23.47 N
-ATOM 193 NH2 ARG A 24 -5.544 -15.105 21.299 1.00 24.06 N
-ATOM 194 N SER A 25 -9.355 -8.836 20.719 1.00 19.57 N
-ATOM 195 CA SER A 25 -8.788 -8.593 19.406 1.00 19.55 C
-ATOM 196 C SER A 25 -7.354 -8.200 19.668 1.00 22.34 C
-ATOM 197 O SER A 25 -7.009 -7.632 20.724 1.00 18.07 O
-ATOM 198 CB SER A 25 -9.563 -7.488 18.650 1.00 15.96 C
-ATOM 199 OG SER A 25 -9.822 -6.295 19.331 1.00 31.90 O
-ATOM 200 N ARG A 26 -6.442 -8.524 18.741 1.00 16.42 N
-ATOM 201 CA ARG A 26 -5.006 -8.261 18.856 1.00 14.69 C
-ATOM 202 C ARG A 26 -4.472 -7.806 17.479 1.00 18.06 C
-ATOM 203 O ARG A 26 -5.093 -8.135 16.455 1.00 16.70 O
-ATOM 204 CB ARG A 26 -4.249 -9.528 19.261 1.00 15.19 C
-ATOM 205 CG ARG A 26 -4.855 -10.136 20.527 1.00 18.12 C
-ATOM 206 CD ARG A 26 -3.970 -11.208 21.079 1.00 19.43 C
-ATOM 207 NE ARG A 26 -3.803 -12.232 20.097 1.00 17.77 N
-ATOM 208 CZ ARG A 26 -2.963 -13.245 20.234 1.00 29.11 C
-ATOM 209 NH1 ARG A 26 -2.202 -13.413 21.297 1.00 20.54 N
-ATOM 210 NH2 ARG A 26 -2.829 -14.114 19.235 1.00 23.76 N
-ATOM 211 N VAL A 27 -3.371 -7.074 17.436 1.00 18.18 N
-ATOM 212 CA VAL A 27 -2.700 -6.649 16.202 1.00 17.02 C
-ATOM 213 C VAL A 27 -1.254 -7.078 16.396 1.00 20.98 C
-ATOM 214 O VAL A 27 -0.700 -6.935 17.506 1.00 18.90 O
-ATOM 215 CB VAL A 27 -2.810 -5.120 16.021 1.00 13.14 C
-ATOM 216 CG1 VAL A 27 -1.844 -4.555 14.983 1.00 20.80 C
-ATOM 217 CG2 VAL A 27 -4.232 -4.852 15.560 1.00 18.48 C
-ATOM 218 N LEU A 28 -0.669 -7.658 15.334 1.00 13.21 N
-ATOM 219 CA LEU A 28 0.727 -8.028 15.294 1.00 12.34 C
-ATOM 220 C LEU A 28 1.508 -7.115 14.333 1.00 16.60 C
-ATOM 221 O LEU A 28 1.087 -6.828 13.211 1.00 19.12 O
-ATOM 222 CB LEU A 28 0.834 -9.503 14.877 1.00 15.44 C
-ATOM 223 CG LEU A 28 2.234 -10.063 14.618 1.00 17.29 C
-ATOM 224 CD1 LEU A 28 3.075 -10.180 15.886 1.00 19.53 C
-ATOM 225 CD2 LEU A 28 2.062 -11.434 14.044 1.00 18.79 C
-ATOM 226 N PHE A 29 2.623 -6.562 14.779 1.00 14.46 N
-ATOM 227 CA PHE A 29 3.533 -5.760 13.971 1.00 19.10 C
-ATOM 228 C PHE A 29 4.627 -6.700 13.519 1.00 28.14 C
-ATOM 229 O PHE A 29 5.273 -7.290 14.396 1.00 19.55 O
-ATOM 230 CB PHE A 29 4.201 -4.663 14.773 1.00 14.05 C
-ATOM 231 CG PHE A 29 3.203 -3.682 15.339 1.00 21.24 C
-ATOM 232 CD1 PHE A 29 2.576 -2.776 14.523 1.00 17.81 C
-ATOM 233 CD2 PHE A 29 2.900 -3.706 16.696 1.00 23.31 C
-ATOM 234 CE1 PHE A 29 1.646 -1.902 15.054 1.00 26.27 C
-ATOM 235 CE2 PHE A 29 1.972 -2.831 17.226 1.00 20.41 C
-ATOM 236 CZ PHE A 29 1.340 -1.928 16.407 1.00 22.27 C
-ATOM 237 N THR A 30 4.879 -6.914 12.210 1.00 18.98 N
-ATOM 238 CA THR A 30 6.001 -7.751 11.761 1.00 17.37 C
-ATOM 239 C THR A 30 6.950 -6.853 11.010 1.00 18.66 C
-ATOM 240 O THR A 30 6.537 -6.160 10.078 1.00 21.64 O
-ATOM 241 CB THR A 30 5.535 -8.820 10.853 1.00 16.98 C
-ATOM 242 OG1 THR A 30 4.602 -9.605 11.567 1.00 23.49 O
-ATOM 243 CG2 THR A 30 6.660 -9.675 10.412 1.00 20.20 C
-ATOM 244 N MET A 31 8.199 -6.782 11.425 1.00 16.66 N
-ATOM 245 CA MET A 31 9.149 -5.864 10.838 1.00 17.95 C
-ATOM 246 C MET A 31 10.236 -6.670 10.197 1.00 20.41 C
-ATOM 247 O MET A 31 10.633 -7.704 10.743 1.00 16.53 O
-ATOM 248 CB MET A 31 9.738 -4.957 11.902 1.00 18.36 C
-ATOM 249 CG MET A 31 8.614 -4.154 12.542 1.00 28.91 C
-ATOM 250 SD MET A 31 9.221 -2.829 13.578 1.00 29.44 S
-ATOM 251 CE MET A 31 9.642 -3.773 14.989 1.00 24.49 C
-ATOM 252 N SER A 32 10.719 -6.278 9.007 1.00 18.58 N
-ATOM 253 CA SER A 32 11.747 -7.076 8.317 1.00 18.25 C
-ATOM 254 C SER A 32 12.663 -6.231 7.441 1.00 17.77 C
-ATOM 255 O SER A 32 12.309 -5.074 7.116 1.00 21.99 O
-ATOM 256 CB SER A 32 11.084 -8.169 7.454 1.00 21.16 C
-ATOM 257 OG SER A 32 10.036 -7.595 6.687 1.00 36.32 O
-ATOM 258 N GLY A 33 13.846 -6.810 7.214 1.00 18.75 N
-ATOM 259 CA GLY A 33 14.879 -6.169 6.423 1.00 19.45 C
-ATOM 260 C GLY A 33 15.928 -7.193 5.988 1.00 19.89 C
-ATOM 261 O GLY A 33 15.912 -8.349 6.429 1.00 18.98 O
-ATOM 262 N THR A 34 16.861 -6.765 5.111 1.00 20.70 N
-ATOM 263 CA THR A 34 17.891 -7.609 4.533 1.00 18.70 C
-ATOM 264 C THR A 34 19.122 -6.741 4.408 1.00 15.56 C
-ATOM 265 O THR A 34 19.002 -5.588 3.989 1.00 22.55 O
-ATOM 266 CB THR A 34 17.516 -8.091 3.111 1.00 23.51 C
-ATOM 267 OG1 THR A 34 16.253 -8.696 3.212 1.00 25.34 O
-ATOM 268 CG2 THR A 34 18.429 -9.157 2.563 1.00 21.14 C
-ATOM 269 N THR A 35 20.302 -7.237 4.741 1.00 16.89 N
-ATOM 270 CA THR A 35 21.478 -6.410 4.639 1.00 19.04 C
-ATOM 271 C THR A 35 21.964 -6.602 3.189 1.00 31.99 C
-ATOM 272 O THR A 35 21.482 -7.478 2.459 1.00 22.91 O
-ATOM 273 CB THR A 35 22.529 -6.898 5.632 1.00 21.23 C
-ATOM 274 OG1 THR A 35 22.879 -8.235 5.245 1.00 19.46 O
-ATOM 275 CG2 THR A 35 21.993 -6.888 7.090 1.00 20.86 C
-ATOM 276 N ASP A 36 22.997 -5.869 2.796 1.00 26.13 N
-ATOM 277 CA ASP A 36 23.590 -5.924 1.463 1.00 25.73 C
-ATOM 278 C ASP A 36 24.060 -7.327 1.137 1.00 25.09 C
-ATOM 279 O ASP A 36 23.867 -7.777 0.000 1.00 31.82 O
-ATOM 280 CB ASP A 36 24.735 -4.929 1.425 1.00 23.29 C
-ATOM 281 CG ASP A 36 24.297 -3.456 1.398 1.00 29.35 C
-ATOM 282 OD1 ASP A 36 23.086 -3.192 1.251 1.00 32.92 O
-ATOM 283 OD2 ASP A 36 25.180 -2.587 1.538 1.00 36.59 O
-ATOM 284 N SER A 37 24.590 -8.117 2.070 1.00 25.70 N
-ATOM 285 CA SER A 37 24.981 -9.467 1.714 1.00 23.90 C
-ATOM 286 C SER A 37 23.883 -10.508 1.852 1.00 22.34 C
-ATOM 287 O SER A 37 24.157 -11.702 1.670 1.00 24.38 O
-ATOM 288 CB SER A 37 26.190 -9.852 2.557 1.00 30.09 C
-ATOM 289 OG SER A 37 25.867 -9.979 3.940 1.00 48.00 O
-ATOM 290 N GLY A 38 22.646 -10.103 2.203 1.00 21.78 N
-ATOM 291 CA GLY A 38 21.563 -11.054 2.307 1.00 18.40 C
-ATOM 292 C GLY A 38 21.344 -11.680 3.691 1.00 21.34 C
-ATOM 293 O GLY A 38 20.692 -12.732 3.780 1.00 22.81 O
-ATOM 294 N LEU A 39 21.905 -11.117 4.777 1.00 21.84 N
-ATOM 295 CA LEU A 39 21.498 -11.566 6.115 1.00 23.27 C
-ATOM 296 C LEU A 39 20.097 -10.977 6.290 1.00 19.54 C
-ATOM 297 O LEU A 39 19.805 -9.851 5.869 1.00 23.50 O
-ATOM 298 CB LEU A 39 22.375 -10.994 7.207 1.00 22.31 C
-ATOM 299 CG LEU A 39 23.816 -11.396 7.138 1.00 21.30 C
-ATOM 300 CD1 LEU A 39 24.572 -10.776 8.272 1.00 28.69 C
-ATOM 301 CD2 LEU A 39 23.898 -12.869 7.179 1.00 25.27 C
-ATOM 302 N GLU A 40 19.151 -11.696 6.862 1.00 18.39 N
-ATOM 303 CA GLU A 40 17.800 -11.215 7.032 1.00 18.96 C
-ATOM 304 C GLU A 40 17.670 -10.825 8.514 1.00 26.64 C
-ATOM 305 O GLU A 40 18.276 -11.448 9.393 1.00 22.66 O
-ATOM 306 CB GLU A 40 16.815 -12.318 6.729 1.00 21.71 C
-ATOM 307 CG GLU A 40 16.895 -12.947 5.330 1.00 36.43 C
-ATOM 308 CD GLU A 40 16.532 -11.980 4.209 1.00 58.73 C
-ATOM 309 OE1 GLU A 40 15.614 -11.176 4.367 1.00 52.82 O
-ATOM 310 OE2 GLU A 40 17.172 -12.043 3.163 1.00 61.13 O
-ATOM 311 N PHE A 41 16.903 -9.813 8.825 1.00 23.28 N
-ATOM 312 CA PHE A 41 16.729 -9.397 10.204 1.00 20.43 C
-ATOM 313 C PHE A 41 15.288 -9.003 10.392 1.00 33.11 C
-ATOM 314 O PHE A 41 14.563 -8.770 9.407 1.00 17.55 O
-ATOM 315 CB PHE A 41 17.694 -8.252 10.489 1.00 17.40 C
-ATOM 316 CG PHE A 41 17.603 -6.962 9.670 1.00 19.97 C
-ATOM 317 CD1 PHE A 41 16.752 -5.938 10.031 1.00 18.79 C
-ATOM 318 CD2 PHE A 41 18.455 -6.794 8.582 1.00 24.90 C
-ATOM 319 CE1 PHE A 41 16.740 -4.744 9.333 1.00 18.42 C
-ATOM 320 CE2 PHE A 41 18.444 -5.600 7.882 1.00 18.53 C
-ATOM 321 CZ PHE A 41 17.594 -4.583 8.257 1.00 20.56 C
-ATOM 322 N GLY A 42 14.810 -8.936 11.626 1.00 16.60 N
-ATOM 323 CA GLY A 42 13.432 -8.570 11.827 1.00 15.94 C
-ATOM 324 C GLY A 42 13.130 -8.441 13.326 1.00 18.51 C
-ATOM 325 O GLY A 42 14.038 -8.612 14.142 1.00 17.74 O
-ATOM 326 N ALA A 43 11.882 -8.141 13.619 1.00 19.68 N
-ATOM 327 CA ALA A 43 11.393 -8.009 14.983 1.00 19.54 C
-ATOM 328 C ALA A 43 9.876 -8.122 14.929 1.00 25.22 C
-ATOM 329 O ALA A 43 9.252 -7.819 13.898 1.00 20.81 O
-ATOM 330 CB ALA A 43 11.797 -6.646 15.537 1.00 16.52 C
-ATOM 331 N SER A 44 9.180 -8.631 15.949 1.00 17.32 N
-ATOM 332 CA SER A 44 7.736 -8.545 15.971 1.00 13.95 C
-ATOM 333 C SER A 44 7.250 -8.527 17.428 1.00 17.36 C
-ATOM 334 O SER A 44 7.963 -9.025 18.307 1.00 16.29 O
-ATOM 335 CB SER A 44 7.093 -9.733 15.268 1.00 18.32 C
-ATOM 336 OG SER A 44 7.556 -10.959 15.751 1.00 28.70 O
-ATOM 337 N PHE A 45 6.076 -7.971 17.629 1.00 18.21 N
-ATOM 338 CA PHE A 45 5.403 -7.974 18.916 1.00 19.59 C
-ATOM 339 C PHE A 45 3.972 -7.562 18.664 1.00 21.25 C
-ATOM 340 O PHE A 45 3.681 -7.002 17.593 1.00 19.84 O
-ATOM 341 CB PHE A 45 6.102 -6.994 19.881 1.00 12.80 C
-ATOM 342 CG PHE A 45 6.124 -5.522 19.533 1.00 16.76 C
-ATOM 343 CD1 PHE A 45 5.086 -4.685 19.910 1.00 13.03 C
-ATOM 344 CD2 PHE A 45 7.207 -4.996 18.829 1.00 15.77 C
-ATOM 345 CE1 PHE A 45 5.134 -3.325 19.575 1.00 18.11 C
-ATOM 346 CE2 PHE A 45 7.242 -3.644 18.503 1.00 14.29 C
-ATOM 347 CZ PHE A 45 6.208 -2.799 18.869 1.00 18.49 C
-ATOM 348 N LYS A 46 3.049 -7.825 19.601 1.00 14.65 N
-ATOM 349 CA LYS A 46 1.661 -7.465 19.434 1.00 13.19 C
-ATOM 350 C LYS A 46 1.393 -6.162 20.108 1.00 16.83 C
-ATOM 351 O LYS A 46 2.154 -5.743 20.989 1.00 18.21 O
-ATOM 352 CB LYS A 46 0.738 -8.518 20.001 1.00 14.48 C
-ATOM 353 CG LYS A 46 1.038 -9.835 19.322 1.00 19.35 C
-ATOM 354 CD LYS A 46 -0.003 -10.886 19.568 1.00 22.07 C
-ATOM 355 CE LYS A 46 0.414 -12.179 18.892 1.00 29.45 C
-ATOM 356 NZ LYS A 46 1.569 -12.753 19.553 1.00 30.58 N
-ATOM 357 N ALA A 47 0.308 -5.501 19.763 1.00 13.74 N
-ATOM 358 CA ALA A 47 0.078 -4.159 20.218 1.00 14.51 C
-ATOM 359 C ALA A 47 -0.066 -4.148 21.761 1.00 17.84 C
-ATOM 360 O ALA A 47 0.398 -3.213 22.427 1.00 16.71 O
-ATOM 361 CB ALA A 47 -1.210 -3.622 19.625 1.00 13.21 C
-ATOM 362 N HIS A 48 -0.708 -5.145 22.361 1.00 18.81 N
-ATOM 363 CA HIS A 48 -0.891 -5.162 23.828 1.00 17.50 C
-ATOM 364 C HIS A 48 0.419 -5.424 24.553 1.00 22.24 C
-ATOM 365 O HIS A 48 0.466 -5.259 25.766 1.00 17.89 O
-ATOM 366 CB HIS A 48 -1.945 -6.227 24.217 1.00 11.96 C
-ATOM 367 CG HIS A 48 -1.534 -7.665 24.011 1.00 19.24 C
-ATOM 368 ND1 HIS A 48 -1.497 -8.384 22.895 1.00 19.50 N
-ATOM 369 CD2 HIS A 48 -1.086 -8.486 25.013 1.00 18.37 C
-ATOM 370 CE1 HIS A 48 -1.055 -9.584 23.167 1.00 20.35 C
-ATOM 371 NE2 HIS A 48 -0.808 -9.640 24.459 1.00 20.64 N
-ATOM 372 N GLU A 49 1.498 -5.770 23.833 1.00 14.70 N
-ATOM 373 CA GLU A 49 2.792 -6.076 24.377 1.00 14.46 C
-ATOM 374 C GLU A 49 3.721 -4.937 24.115 1.00 14.22 C
-ATOM 375 O GLU A 49 4.926 -5.114 24.355 1.00 15.82 O
-ATOM 376 CB GLU A 49 3.502 -7.231 23.733 1.00 15.73 C
-ATOM 377 CG GLU A 49 2.678 -8.470 23.628 1.00 24.60 C
-ATOM 378 CD GLU A 49 3.401 -9.595 22.894 1.00 32.30 C
-ATOM 379 OE1 GLU A 49 3.947 -9.415 21.802 1.00 21.35 O
-ATOM 380 OE2 GLU A 49 3.405 -10.693 23.434 1.00 21.91 O
-ATOM 381 N SER A 50 3.267 -3.778 23.639 1.00 14.73 N
-ATOM 382 CA SER A 50 4.225 -2.763 23.249 1.00 13.74 C
-ATOM 383 C SER A 50 5.102 -2.232 24.381 1.00 20.29 C
-ATOM 384 O SER A 50 6.283 -1.952 24.134 1.00 16.11 O
-ATOM 385 CB ASER A 50 3.509 -1.575 22.648 0.60 12.78 C
-ATOM 386 CB BSER A 50 3.508 -1.603 22.576 0.40 12.35 C
-ATOM 387 OG ASER A 50 2.591 -1.903 21.621 0.60 15.12 O
-ATOM 388 OG BSER A 50 2.465 -1.023 23.337 0.40 13.87 O
-ATOM 389 N VAL A 51 4.593 -2.082 25.643 1.00 15.56 N
-ATOM 390 CA VAL A 51 5.457 -1.647 26.754 1.00 16.90 C
-ATOM 391 C VAL A 51 6.573 -2.640 27.042 1.00 10.27 C
-ATOM 392 O VAL A 51 7.741 -2.242 27.190 1.00 17.77 O
-ATOM 393 CB VAL A 51 4.552 -1.433 27.990 1.00 16.34 C
-ATOM 394 CG1 VAL A 51 5.421 -1.112 29.187 1.00 18.56 C
-ATOM 395 CG2 VAL A 51 3.614 -0.273 27.756 1.00 16.82 C
-ATOM 396 N GLY A 52 6.229 -3.936 27.076 1.00 12.24 N
-ATOM 397 CA GLY A 52 7.179 -4.995 27.308 1.00 13.64 C
-ATOM 398 C GLY A 52 8.163 -5.141 26.173 1.00 15.14 C
-ATOM 399 O GLY A 52 9.333 -5.412 26.407 1.00 15.99 O
-ATOM 400 N ALA A 53 7.731 -4.935 24.916 1.00 18.76 N
-ATOM 401 CA ALA A 53 8.646 -5.080 23.781 1.00 14.32 C
-ATOM 402 C ALA A 53 9.731 -4.043 23.846 1.00 10.54 C
-ATOM 403 O ALA A 53 10.860 -4.300 23.428 1.00 15.30 O
-ATOM 404 CB ALA A 53 7.858 -4.926 22.504 1.00 14.72 C
-ATOM 405 N GLU A 54 9.478 -2.845 24.408 1.00 13.35 N
-ATOM 406 CA GLU A 54 10.494 -1.846 24.572 1.00 13.86 C
-ATOM 407 C GLU A 54 11.561 -2.194 25.631 1.00 17.54 C
-ATOM 408 O GLU A 54 12.581 -1.509 25.658 1.00 17.99 O
-ATOM 409 CB GLU A 54 9.754 -0.556 24.867 1.00 16.36 C
-ATOM 410 CG GLU A 54 10.604 0.728 24.700 1.00 19.98 C
-ATOM 411 CD GLU A 54 11.242 1.324 25.973 1.00 33.77 C
-ATOM 412 OE1 GLU A 54 10.752 1.040 27.063 1.00 26.33 O
-ATOM 413 OE2 GLU A 54 12.220 2.070 25.890 1.00 28.75 O
-ATOM 414 N THR A 55 11.475 -3.220 26.506 1.00 19.05 N
-ATOM 415 CA THR A 55 12.551 -3.557 27.444 1.00 15.96 C
-ATOM 416 C THR A 55 13.110 -4.947 27.155 1.00 17.46 C
-ATOM 417 O THR A 55 14.042 -5.381 27.817 1.00 21.17 O
-ATOM 418 CB THR A 55 12.005 -3.513 28.919 1.00 13.94 C
-ATOM 419 OG1 THR A 55 11.287 -4.727 29.108 1.00 16.77 O
-ATOM 420 CG2 THR A 55 11.073 -2.348 29.195 1.00 18.93 C
-ATOM 421 N GLY A 56 12.570 -5.748 26.218 1.00 18.11 N
-ATOM 422 CA GLY A 56 13.084 -7.088 25.925 1.00 14.36 C
-ATOM 423 C GLY A 56 12.237 -8.176 26.524 1.00 14.53 C
-ATOM 424 O GLY A 56 12.434 -9.374 26.329 1.00 19.77 O
-ATOM 425 N GLU A 57 11.236 -7.772 27.302 1.00 17.95 N
-ATOM 426 CA GLU A 57 10.388 -8.714 28.003 1.00 14.56 C
-ATOM 427 C GLU A 57 9.399 -9.429 27.094 1.00 19.55 C
-ATOM 428 O GLU A 57 8.985 -10.570 27.364 1.00 18.74 O
-ATOM 429 CB GLU A 57 9.647 -7.937 29.080 1.00 15.25 C
-ATOM 430 CG GLU A 57 8.695 -8.852 29.844 1.00 25.44 C
-ATOM 431 CD GLU A 57 7.968 -8.238 31.032 1.00 32.41 C
-ATOM 432 OE1 GLU A 57 7.965 -7.015 31.165 1.00 25.94 O
-ATOM 433 OE2 GLU A 57 7.404 -9.005 31.819 1.00 40.55 O
-ATOM 434 N ASP A 58 8.907 -8.711 26.061 1.00 16.20 N
-ATOM 435 CA ASP A 58 7.928 -9.271 25.141 1.00 12.73 C
-ATOM 436 C ASP A 58 8.437 -9.040 23.703 1.00 13.30 C
-ATOM 437 O ASP A 58 9.261 -8.155 23.492 1.00 14.77 O
-ATOM 438 CB ASP A 58 6.608 -8.577 25.263 1.00 14.67 C
-ATOM 439 CG ASP A 58 5.857 -8.919 26.553 1.00 21.34 C
-ATOM 440 OD1 ASP A 58 5.853 -10.077 26.968 1.00 21.30 O
-ATOM 441 OD2 ASP A 58 5.266 -8.004 27.106 1.00 23.15 O
-ATOM 442 N GLY A 59 7.926 -9.816 22.763 1.00 19.15 N
-ATOM 443 CA GLY A 59 8.326 -9.704 21.358 1.00 17.18 C
-ATOM 444 C GLY A 59 9.697 -10.284 21.149 1.00 19.54 C
-ATOM 445 O GLY A 59 10.389 -10.660 22.106 1.00 19.80 O
-ATOM 446 N THR A 60 10.154 -10.452 19.904 1.00 16.10 N
-ATOM 447 CA THR A 60 11.516 -10.939 19.634 1.00 16.20 C
-ATOM 448 C THR A 60 12.208 -10.120 18.533 1.00 19.22 C
-ATOM 449 O THR A 60 11.492 -9.446 17.781 1.00 17.59 O
-ATOM 450 CB THR A 60 11.550 -12.410 19.180 1.00 22.89 C
-ATOM 451 OG1 THR A 60 10.585 -12.586 18.156 1.00 24.63 O
-ATOM 452 CG2 THR A 60 11.269 -13.368 20.330 1.00 22.82 C
-ATOM 453 N VAL A 61 13.543 -10.107 18.509 1.00 17.23 N
-ATOM 454 CA VAL A 61 14.372 -9.452 17.504 1.00 19.01 C
-ATOM 455 C VAL A 61 15.238 -10.597 16.937 1.00 26.28 C
-ATOM 456 O VAL A 61 15.644 -11.502 17.696 1.00 18.85 O
-ATOM 457 CB VAL A 61 15.254 -8.357 18.149 1.00 17.83 C
-ATOM 458 CG1 VAL A 61 16.149 -7.691 17.106 1.00 18.08 C
-ATOM 459 CG2 VAL A 61 14.370 -7.300 18.743 1.00 17.74 C
-ATOM 460 N PHE A 62 15.514 -10.677 15.619 1.00 19.51 N
-ATOM 461 CA PHE A 62 16.360 -11.751 15.103 1.00 17.61 C
-ATOM 462 C PHE A 62 17.285 -11.275 13.976 1.00 21.17 C
-ATOM 463 O PHE A 62 17.061 -10.220 13.354 1.00 17.39 O
-ATOM 464 CB PHE A 62 15.511 -12.906 14.593 1.00 17.41 C
-ATOM 465 CG PHE A 62 14.791 -12.663 13.262 1.00 22.01 C
-ATOM 466 CD1 PHE A 62 15.435 -12.942 12.052 1.00 26.08 C
-ATOM 467 CD2 PHE A 62 13.491 -12.194 13.274 1.00 20.41 C
-ATOM 468 CE1 PHE A 62 14.763 -12.753 10.858 1.00 24.18 C
-ATOM 469 CE2 PHE A 62 12.832 -12.009 12.065 1.00 39.24 C
-ATOM 470 CZ PHE A 62 13.459 -12.287 10.860 1.00 26.42 C
-ATOM 471 N LEU A 63 18.313 -12.091 13.770 1.00 21.61 N
-ATOM 472 CA LEU A 63 19.300 -11.936 12.695 1.00 23.98 C
-ATOM 473 C LEU A 63 19.526 -13.326 12.165 1.00 24.88 C
-ATOM 474 O LEU A 63 19.743 -14.212 12.996 1.00 20.07 O
-ATOM 475 CB LEU A 63 20.666 -11.435 13.169 1.00 23.98 C
-ATOM 476 CG LEU A 63 21.744 -11.227 12.093 1.00 27.68 C
-ATOM 477 CD1 LEU A 63 21.356 -10.091 11.154 1.00 22.99 C
-ATOM 478 CD2 LEU A 63 23.025 -10.825 12.760 1.00 34.32 C
-ATOM 479 N SER A 64 19.433 -13.609 10.848 1.00 21.19 N
-ATOM 480 CA SER A 64 19.710 -14.943 10.320 1.00 18.57 C
-ATOM 481 C SER A 64 20.561 -14.868 9.041 1.00 18.66 C
-ATOM 482 O SER A 64 20.680 -13.840 8.382 1.00 22.26 O
-ATOM 483 CB SER A 64 18.431 -15.690 10.024 1.00 18.27 C
-ATOM 484 OG SER A 64 17.538 -15.009 9.176 1.00 24.76 O
-ATOM 485 N GLY A 65 21.253 -15.940 8.800 1.00 21.15 N
-ATOM 486 CA GLY A 65 22.140 -16.038 7.682 1.00 24.41 C
-ATOM 487 C GLY A 65 22.359 -17.507 7.432 1.00 28.66 C
-ATOM 488 O GLY A 65 21.615 -18.399 7.867 1.00 22.09 O
-ATOM 489 N ALA A 66 23.471 -17.768 6.775 1.00 26.28 N
-ATOM 490 CA ALA A 66 23.831 -19.125 6.445 1.00 25.46 C
-ATOM 491 C ALA A 66 24.142 -19.955 7.687 1.00 26.02 C
-ATOM 492 O ALA A 66 24.006 -21.176 7.675 1.00 27.00 O
-ATOM 493 CB ALA A 66 25.052 -19.103 5.562 1.00 28.91 C
-ATOM 494 N PHE A 67 24.560 -19.236 8.733 1.00 33.18 N
-ATOM 495 CA PHE A 67 24.872 -19.766 10.064 1.00 33.95 C
-ATOM 496 C PHE A 67 23.639 -20.176 10.879 1.00 35.16 C
-ATOM 497 O PHE A 67 23.792 -20.833 11.897 1.00 30.66 O
-ATOM 498 CB PHE A 67 25.670 -18.717 10.875 1.00 23.01 C
-ATOM 499 CG PHE A 67 24.970 -17.367 11.142 1.00 45.98 C
-ATOM 500 CD1 PHE A 67 24.078 -17.228 12.210 1.00 41.66 C
-ATOM 501 CD2 PHE A 67 25.204 -16.287 10.294 1.00 34.67 C
-ATOM 502 CE1 PHE A 67 23.430 -16.028 12.410 1.00 40.95 C
-ATOM 503 CE2 PHE A 67 24.550 -15.087 10.505 1.00 32.83 C
-ATOM 504 CZ PHE A 67 23.665 -14.960 11.562 1.00 35.21 C
-ATOM 505 N GLY A 68 22.416 -19.819 10.532 1.00 20.84 N
-ATOM 506 CA GLY A 68 21.265 -20.203 11.306 1.00 21.82 C
-ATOM 507 C GLY A 68 20.642 -18.916 11.769 1.00 28.92 C
-ATOM 508 O GLY A 68 20.925 -17.877 11.156 1.00 24.29 O
-ATOM 509 N LYS A 69 19.851 -18.891 12.843 1.00 21.72 N
-ATOM 510 CA LYS A 69 19.098 -17.707 13.231 1.00 18.84 C
-ATOM 511 C LYS A 69 19.320 -17.462 14.730 1.00 23.51 C
-ATOM 512 O LYS A 69 19.251 -18.415 15.506 1.00 20.90 O
-ATOM 513 CB LYS A 69 17.634 -17.977 12.954 1.00 16.30 C
-ATOM 514 CG LYS A 69 16.700 -16.815 13.294 1.00 16.85 C
-ATOM 515 CD LYS A 69 15.304 -17.356 13.064 1.00 20.17 C
-ATOM 516 CE LYS A 69 14.288 -16.324 13.436 1.00 31.92 C
-ATOM 517 NZ LYS A 69 12.951 -16.787 13.098 1.00 46.73 N
-ATOM 518 N ILE A 70 19.558 -16.242 15.121 1.00 19.45 N
-ATOM 519 CA ILE A 70 19.738 -15.850 16.517 1.00 23.74 C
-ATOM 520 C ILE A 70 18.550 -14.960 16.846 1.00 25.87 C
-ATOM 521 O ILE A 70 18.354 -13.935 16.184 1.00 20.11 O
-ATOM 522 CB ILE A 70 21.033 -15.053 16.665 1.00 25.58 C
-ATOM 523 CG1 ILE A 70 22.222 -15.938 16.316 1.00 43.31 C
-ATOM 524 CG2 ILE A 70 21.155 -14.549 18.101 1.00 33.44 C
-ATOM 525 CD1 ILE A 70 23.489 -15.098 16.072 1.00 57.37 C
-ATOM 526 N GLU A 71 17.762 -15.262 17.870 1.00 19.38 N
-ATOM 527 CA GLU A 71 16.580 -14.500 18.236 1.00 17.37 C
-ATOM 528 C GLU A 71 16.710 -14.081 19.723 1.00 24.39 C
-ATOM 529 O GLU A 71 17.124 -14.941 20.523 1.00 20.85 O
-ATOM 530 CB GLU A 71 15.440 -15.420 18.004 1.00 15.42 C
-ATOM 531 CG GLU A 71 14.084 -14.781 18.104 1.00 22.29 C
-ATOM 532 CD GLU A 71 12.943 -15.740 17.774 1.00 23.14 C
-ATOM 533 OE1 GLU A 71 13.125 -16.928 17.975 1.00 42.67 O
-ATOM 534 OE2 GLU A 71 11.889 -15.293 17.301 1.00 53.77 O
-ATOM 535 N MET A 72 16.371 -12.852 20.135 1.00 19.50 N
-ATOM 536 CA MET A 72 16.509 -12.441 21.530 1.00 17.32 C
-ATOM 537 C MET A 72 15.222 -11.759 21.904 1.00 23.46 C
-ATOM 538 O MET A 72 14.672 -11.008 21.078 1.00 19.57 O
-ATOM 539 CB MET A 72 17.661 -11.496 21.646 1.00 18.57 C
-ATOM 540 CG MET A 72 18.009 -11.158 23.111 1.00 19.11 C
-ATOM 541 SD MET A 72 19.490 -10.156 23.277 1.00 23.42 S
-ATOM 542 CE MET A 72 20.692 -11.366 22.863 1.00 18.32 C
-ATOM 543 N GLY A 73 14.688 -12.049 23.105 1.00 17.35 N
-ATOM 544 CA GLY A 73 13.504 -11.376 23.637 1.00 14.94 C
-ATOM 545 C GLY A 73 12.683 -12.424 24.343 1.00 13.51 C
-ATOM 546 O GLY A 73 13.232 -13.308 25.002 1.00 18.04 O
-ATOM 547 N ASP A 74 11.386 -12.433 24.107 1.00 15.69 N
-ATOM 548 CA ASP A 74 10.515 -13.406 24.681 1.00 17.65 C
-ATOM 549 C ASP A 74 10.486 -14.603 23.728 1.00 22.75 C
-ATOM 550 O ASP A 74 9.524 -14.828 23.003 1.00 21.21 O
-ATOM 551 CB ASP A 74 9.137 -12.740 24.892 1.00 14.59 C
-ATOM 552 CG ASP A 74 8.076 -13.590 25.598 1.00 19.98 C
-ATOM 553 OD1 ASP A 74 8.318 -14.775 25.902 1.00 18.00 O
-ATOM 554 OD2 ASP A 74 6.980 -13.063 25.837 1.00 24.40 O
-ATOM 555 N ALA A 75 11.532 -15.419 23.750 1.00 18.50 N
-ATOM 556 CA ALA A 75 11.713 -16.573 22.864 1.00 19.75 C
-ATOM 557 C ALA A 75 11.337 -17.890 23.491 1.00 25.86 C
-ATOM 558 O ALA A 75 11.278 -18.023 24.725 1.00 24.49 O
-ATOM 559 CB ALA A 75 13.178 -16.655 22.429 1.00 15.70 C
-ATOM 560 N LEU A 76 11.070 -18.878 22.664 1.00 18.04 N
-ATOM 561 CA LEU A 76 10.802 -20.214 23.107 1.00 15.51 C
-ATOM 562 C LEU A 76 12.092 -20.838 23.503 1.00 14.71 C
-ATOM 563 O LEU A 76 13.152 -20.342 23.143 1.00 17.59 O
-ATOM 564 CB LEU A 76 10.206 -21.060 22.015 1.00 16.00 C
-ATOM 565 CG LEU A 76 8.883 -20.535 21.479 1.00 22.46 C
-ATOM 566 CD1 LEU A 76 8.475 -21.434 20.341 1.00 21.79 C
-ATOM 567 CD2 LEU A 76 7.799 -20.480 22.572 1.00 22.12 C
-ATOM 568 N GLY A 77 12.076 -21.891 24.310 1.00 17.76 N
-ATOM 569 CA GLY A 77 13.327 -22.567 24.572 1.00 17.10 C
-ATOM 570 C GLY A 77 13.556 -23.559 23.419 1.00 17.15 C
-ATOM 571 O GLY A 77 12.610 -23.809 22.655 1.00 18.35 O
-ATOM 572 N ALA A 78 14.754 -24.139 23.296 1.00 20.25 N
-ATOM 573 CA ALA A 78 15.128 -25.036 22.197 1.00 16.35 C
-ATOM 574 C ALA A 78 14.198 -26.183 21.912 1.00 23.67 C
-ATOM 575 O ALA A 78 13.814 -26.393 20.755 1.00 22.78 O
-ATOM 576 CB ALA A 78 16.462 -25.588 22.481 1.00 18.71 C
-ATOM 577 N SER A 79 13.714 -26.937 22.908 1.00 18.97 N
-ATOM 578 CA SER A 79 12.786 -28.017 22.665 1.00 20.71 C
-ATOM 579 C SER A 79 11.439 -27.556 22.153 1.00 27.48 C
-ATOM 580 O SER A 79 10.922 -28.131 21.189 1.00 21.54 O
-ATOM 581 CB SER A 79 12.560 -28.836 23.938 1.00 24.34 C
-ATOM 582 OG SER A 79 13.824 -29.214 24.459 1.00 24.45 O
-ATOM 583 N GLU A 80 10.819 -26.536 22.748 1.00 20.47 N
-ATOM 584 CA GLU A 80 9.535 -26.056 22.298 1.00 18.48 C
-ATOM 585 C GLU A 80 9.685 -25.501 20.868 1.00 15.64 C
-ATOM 586 O GLU A 80 8.783 -25.769 20.080 1.00 21.68 O
-ATOM 587 CB GLU A 80 9.069 -24.969 23.223 1.00 14.52 C
-ATOM 588 CG GLU A 80 7.633 -24.660 22.893 1.00 19.36 C
-ATOM 589 CD GLU A 80 6.848 -23.844 23.889 1.00 21.31 C
-ATOM 590 OE1 GLU A 80 7.308 -23.565 24.990 1.00 23.28 O
-ATOM 591 OE2 GLU A 80 5.698 -23.516 23.611 1.00 17.31 O
-ATOM 592 N ALA A 81 10.788 -24.801 20.564 1.00 18.80 N
-ATOM 593 CA ALA A 81 11.098 -24.231 19.243 1.00 19.97 C
-ATOM 594 C ALA A 81 11.057 -25.363 18.192 1.00 25.91 C
-ATOM 595 O ALA A 81 10.494 -25.167 17.108 1.00 26.82 O
-ATOM 596 CB ALA A 81 12.488 -23.601 19.244 1.00 18.56 C
-ATOM 597 N LEU A 82 11.536 -26.581 18.470 1.00 24.81 N
-ATOM 598 CA LEU A 82 11.430 -27.667 17.504 1.00 20.49 C
-ATOM 599 C LEU A 82 10.182 -28.507 17.592 1.00 30.61 C
-ATOM 600 O LEU A 82 9.701 -28.908 16.531 1.00 30.38 O
-ATOM 601 CB LEU A 82 12.645 -28.604 17.602 1.00 18.07 C
-ATOM 602 CG LEU A 82 14.010 -27.947 17.469 1.00 23.91 C
-ATOM 603 CD1 LEU A 82 15.093 -28.988 17.327 1.00 21.74 C
-ATOM 604 CD2 LEU A 82 13.996 -27.023 16.282 1.00 22.55 C
-ATOM 605 N PHE A 83 9.531 -28.797 18.743 1.00 23.86 N
-ATOM 606 CA PHE A 83 8.420 -29.760 18.772 1.00 18.13 C
-ATOM 607 C PHE A 83 7.055 -29.177 18.997 1.00 21.39 C
-ATOM 608 O PHE A 83 6.075 -29.879 18.742 1.00 24.29 O
-ATOM 609 CB PHE A 83 8.669 -30.868 19.847 1.00 20.46 C
-ATOM 610 CG PHE A 83 10.096 -31.430 19.770 1.00 31.47 C
-ATOM 611 CD1 PHE A 83 10.595 -31.925 18.569 1.00 36.76 C
-ATOM 612 CD2 PHE A 83 10.920 -31.396 20.884 1.00 29.87 C
-ATOM 613 CE1 PHE A 83 11.894 -32.359 18.508 1.00 29.95 C
-ATOM 614 CE2 PHE A 83 12.217 -31.832 20.811 1.00 27.18 C
-ATOM 615 CZ PHE A 83 12.701 -32.308 19.620 1.00 28.91 C
-ATOM 616 N GLY A 84 6.950 -27.901 19.432 1.00 21.59 N
-ATOM 617 CA GLY A 84 5.655 -27.273 19.633 1.00 19.54 C
-ATOM 618 C GLY A 84 4.752 -27.918 20.688 1.00 20.13 C
-ATOM 619 O GLY A 84 5.208 -28.576 21.628 1.00 24.79 O
-ATOM 620 N ASP A 85 3.452 -27.708 20.541 1.00 18.15 N
-ATOM 621 CA ASP A 85 2.428 -28.142 21.477 1.00 22.04 C
-ATOM 622 C ASP A 85 1.488 -29.149 20.869 1.00 32.84 C
-ATOM 623 O ASP A 85 1.564 -29.420 19.679 1.00 25.86 O
-ATOM 624 CB ASP A 85 1.613 -26.922 21.969 1.00 21.66 C
-ATOM 625 CG ASP A 85 2.469 -26.050 22.883 1.00 22.97 C
-ATOM 626 OD1 ASP A 85 3.261 -26.564 23.668 1.00 22.67 O
-ATOM 627 OD2 ASP A 85 2.388 -24.840 22.763 1.00 22.22 O
-ATOM 628 N LEU A 86 0.563 -29.709 21.643 1.00 21.52 N
-ATOM 629 CA LEU A 86 -0.397 -30.678 21.160 1.00 19.15 C
-ATOM 630 C LEU A 86 -1.549 -29.874 20.579 1.00 18.35 C
-ATOM 631 O LEU A 86 -1.559 -28.627 20.662 1.00 21.62 O
-ATOM 632 CB LEU A 86 -0.857 -31.592 22.322 1.00 18.02 C
-ATOM 633 CG LEU A 86 0.206 -32.397 23.057 1.00 21.20 C
-ATOM 634 CD1 LEU A 86 -0.562 -33.296 24.012 1.00 24.06 C
-ATOM 635 CD2 LEU A 86 1.083 -33.271 22.144 1.00 22.07 C
-ATOM 636 N TYR A 87 -2.516 -30.554 19.969 1.00 20.03 N
-ATOM 637 CA TYR A 87 -3.665 -29.918 19.323 1.00 23.10 C
-ATOM 638 C TYR A 87 -4.395 -28.937 20.251 1.00 35.01 C
-ATOM 639 O TYR A 87 -4.824 -29.313 21.327 1.00 21.25 O
-ATOM 640 CB TYR A 87 -4.648 -31.014 18.836 1.00 22.33 C
-ATOM 641 CG TYR A 87 -5.850 -30.450 18.083 1.00 24.26 C
-ATOM 642 CD1 TYR A 87 -5.703 -29.865 16.826 1.00 29.11 C
-ATOM 643 CD2 TYR A 87 -7.092 -30.502 18.680 1.00 25.25 C
-ATOM 644 CE1 TYR A 87 -6.812 -29.336 16.187 1.00 24.19 C
-ATOM 645 CE2 TYR A 87 -8.197 -29.969 18.054 1.00 23.60 C
-ATOM 646 CZ TYR A 87 -8.038 -29.393 16.820 1.00 32.01 C
-ATOM 647 OH TYR A 87 -9.141 -28.823 16.238 1.00 38.33 O
-ATOM 648 N GLU A 88 -4.612 -27.696 19.830 1.00 24.04 N
-ATOM 649 CA GLU A 88 -5.228 -26.664 20.628 1.00 23.00 C
-ATOM 650 C GLU A 88 -6.711 -26.782 20.555 1.00 28.26 C
-ATOM 651 O GLU A 88 -7.325 -26.777 19.487 1.00 25.13 O
-ATOM 652 CB GLU A 88 -4.745 -25.312 20.120 1.00 19.61 C
-ATOM 653 CG GLU A 88 -5.293 -24.187 20.941 1.00 19.84 C
-ATOM 654 CD GLU A 88 -4.733 -22.814 20.603 1.00 19.96 C
-ATOM 655 OE1 GLU A 88 -3.531 -22.588 20.634 1.00 22.24 O
-ATOM 656 OE2 GLU A 88 -5.525 -21.927 20.345 1.00 28.96 O
-ATOM 657 N VAL A 89 -7.293 -26.892 21.731 1.00 20.98 N
-ATOM 658 CA VAL A 89 -8.725 -27.043 21.863 1.00 19.79 C
-ATOM 659 C VAL A 89 -9.368 -25.772 22.381 1.00 21.24 C
-ATOM 660 O VAL A 89 -8.820 -25.141 23.301 1.00 25.75 O
-ATOM 661 CB VAL A 89 -8.985 -28.240 22.811 1.00 21.18 C
-ATOM 662 CG1 VAL A 89 -10.471 -28.313 23.162 1.00 20.32 C
-ATOM 663 CG2 VAL A 89 -8.500 -29.529 22.147 1.00 23.18 C
-ATOM 664 N GLY A 90 -10.544 -25.508 21.775 1.00 18.46 N
-ATOM 665 CA GLY A 90 -11.503 -24.447 22.072 1.00 17.42 C
-ATOM 666 C GLY A 90 -11.182 -23.088 21.423 1.00 16.29 C
-ATOM 667 O GLY A 90 -10.017 -22.772 21.178 1.00 21.52 O
-ATOM 668 N TYR A 91 -12.170 -22.231 21.137 1.00 15.81 N
-ATOM 669 CA TYR A 91 -11.894 -20.937 20.537 1.00 16.90 C
-ATOM 670 C TYR A 91 -11.119 -20.046 21.479 1.00 20.78 C
-ATOM 671 O TYR A 91 -10.452 -19.147 20.996 1.00 20.06 O
-ATOM 672 CB TYR A 91 -13.201 -20.266 20.121 1.00 14.86 C
-ATOM 673 CG TYR A 91 -13.911 -19.353 21.115 1.00 20.42 C
-ATOM 674 CD1 TYR A 91 -13.614 -18.019 21.136 1.00 17.43 C
-ATOM 675 CD2 TYR A 91 -14.866 -19.845 21.983 1.00 21.36 C
-ATOM 676 CE1 TYR A 91 -14.268 -17.195 22.018 1.00 21.64 C
-ATOM 677 CE2 TYR A 91 -15.536 -19.021 22.871 1.00 17.13 C
-ATOM 678 CZ TYR A 91 -15.218 -17.704 22.874 1.00 16.53 C
-ATOM 679 OH TYR A 91 -15.829 -16.860 23.749 1.00 19.49 O
-ATOM 680 N THR A 92 -11.188 -20.209 22.824 1.00 22.98 N
-ATOM 681 CA THR A 92 -10.447 -19.354 23.771 1.00 20.64 C
-ATOM 682 C THR A 92 -9.123 -20.013 24.167 1.00 19.15 C
-ATOM 683 O THR A 92 -8.362 -19.403 24.901 1.00 20.90 O
-ATOM 684 CB THR A 92 -11.280 -19.076 25.084 1.00 15.66 C
-ATOM 685 OG1 THR A 92 -11.525 -20.348 25.670 1.00 19.23 O
-ATOM 686 CG2 THR A 92 -12.624 -18.457 24.881 1.00 13.61 C
-ATOM 687 N ASP A 93 -8.787 -21.221 23.667 1.00 18.00 N
-ATOM 688 CA ASP A 93 -7.643 -22.059 24.031 1.00 18.24 C
-ATOM 689 C ASP A 93 -7.851 -22.464 25.485 1.00 25.81 C
-ATOM 690 O ASP A 93 -7.377 -21.806 26.430 1.00 22.47 O
-ATOM 691 CB ASP A 93 -6.291 -21.317 23.863 1.00 17.88 C
-ATOM 692 CG ASP A 93 -5.053 -22.146 24.152 1.00 20.65 C
-ATOM 693 OD1 ASP A 93 -5.084 -23.364 24.383 1.00 25.25 O
-ATOM 694 OD2 ASP A 93 -3.957 -21.594 24.164 1.00 20.38 O
-ATOM 695 N LEU A 94 -8.639 -23.527 25.668 1.00 23.49 N
-ATOM 696 CA LEU A 94 -9.100 -23.935 27.007 1.00 22.32 C
-ATOM 697 C LEU A 94 -8.008 -24.604 27.802 1.00 20.94 C
-ATOM 698 O LEU A 94 -7.974 -25.821 27.928 1.00 22.40 O
-ATOM 699 CB LEU A 94 -10.273 -24.902 26.917 1.00 24.80 C
-ATOM 700 CG LEU A 94 -11.581 -24.375 26.447 1.00 24.83 C
-ATOM 701 CD1 LEU A 94 -12.516 -25.561 26.131 1.00 24.63 C
-ATOM 702 CD2 LEU A 94 -12.146 -23.440 27.488 1.00 23.77 C
-ATOM 703 N ASP A 95 -7.099 -23.826 28.366 1.00 18.41 N
-ATOM 704 CA ASP A 95 -6.002 -24.365 29.143 1.00 18.77 C
-ATOM 705 C ASP A 95 -6.284 -24.434 30.644 1.00 24.15 C
-ATOM 706 O ASP A 95 -5.442 -24.795 31.454 1.00 20.30 O
-ATOM 707 CB ASP A 95 -4.809 -23.519 28.974 1.00 17.45 C
-ATOM 708 CG ASP A 95 -4.129 -23.674 27.640 1.00 24.99 C
-ATOM 709 OD1 ASP A 95 -4.161 -24.728 27.031 1.00 21.65 O
-ATOM 710 OD2 ASP A 95 -3.530 -22.716 27.180 1.00 22.05 O
-ATOM 711 N ASP A 96 -7.492 -24.085 31.012 1.00 20.70 N
-ATOM 712 CA ASP A 96 -7.930 -23.954 32.391 1.00 32.92 C
-ATOM 713 C ASP A 96 -7.735 -25.224 33.224 1.00 36.10 C
-ATOM 714 O ASP A 96 -7.517 -25.108 34.428 1.00 35.21 O
-ATOM 715 CB ASP A 96 -9.409 -23.549 32.372 1.00 30.21 C
-ATOM 716 CG ASP A 96 -9.729 -22.319 31.536 1.00 59.42 C
-ATOM 717 OD1 ASP A 96 -9.849 -22.388 30.298 1.00 30.49 O
-ATOM 718 OD2 ASP A 96 -9.838 -21.277 32.168 1.00 41.87 O
-ATOM 719 N ARG A 97 -7.799 -26.443 32.668 1.00 26.01 N
-ATOM 720 CA ARG A 97 -7.645 -27.688 33.412 1.00 19.44 C
-ATOM 721 C ARG A 97 -6.329 -28.368 33.142 1.00 21.06 C
-ATOM 722 O ARG A 97 -6.125 -29.539 33.499 1.00 27.98 O
-ATOM 723 CB ARG A 97 -8.821 -28.616 33.064 1.00 19.30 C
-ATOM 724 CG ARG A 97 -10.199 -28.149 33.511 1.00 23.19 C
-ATOM 725 CD ARG A 97 -10.293 -28.108 35.047 1.00 30.26 C
-ATOM 726 NE ARG A 97 -11.599 -27.602 35.423 1.00 30.05 N
-ATOM 727 CZ ARG A 97 -11.841 -26.321 35.774 1.00 29.77 C
-ATOM 728 NH1 ARG A 97 -10.861 -25.427 35.835 1.00 40.21 N
-ATOM 729 NH2 ARG A 97 -13.097 -25.868 35.956 1.00 29.73 N
-ATOM 730 N GLY A 98 -5.379 -27.669 32.518 1.00 22.17 N
-ATOM 731 CA GLY A 98 -4.081 -28.250 32.166 1.00 19.78 C
-ATOM 732 C GLY A 98 -3.587 -27.777 30.785 1.00 21.06 C
-ATOM 733 O GLY A 98 -2.408 -27.445 30.590 1.00 26.48 O
-ATOM 734 N GLY A 99 -4.531 -27.865 29.847 1.00 26.61 N
-ATOM 735 CA GLY A 99 -4.325 -27.364 28.504 1.00 26.18 C
-ATOM 736 C GLY A 99 -3.553 -28.261 27.572 1.00 24.45 C
-ATOM 737 O GLY A 99 -3.059 -29.334 27.906 1.00 23.54 O
-ATOM 738 N ASN A 100 -3.380 -27.785 26.358 1.00 25.90 N
-ATOM 739 CA ASN A 100 -2.760 -28.567 25.281 1.00 19.24 C
-ATOM 740 C ASN A 100 -1.272 -28.389 25.247 1.00 19.02 C
-ATOM 741 O ASN A 100 -0.561 -29.090 24.545 1.00 22.88 O
-ATOM 742 CB ASN A 100 -3.383 -28.115 23.946 1.00 23.30 C
-ATOM 743 CG ASN A 100 -3.047 -26.667 23.616 1.00 22.39 C
-ATOM 744 OD1 ASN A 100 -3.379 -25.727 24.342 1.00 24.51 O
-ATOM 745 ND2 ASN A 100 -2.335 -26.428 22.526 1.00 21.36 N
-ATOM 746 N ASP A 101 -0.712 -27.422 25.954 1.00 21.84 N
-ATOM 747 CA ASP A 101 0.699 -27.106 25.874 1.00 16.59 C
-ATOM 748 C ASP A 101 1.559 -28.190 26.422 1.00 26.25 C
-ATOM 749 O ASP A 101 1.207 -28.795 27.422 1.00 24.73 O
-ATOM 750 CB ASP A 101 0.994 -25.823 26.639 1.00 17.86 C
-ATOM 751 CG ASP A 101 0.141 -24.622 26.220 1.00 18.10 C
-ATOM 752 OD1 ASP A 101 -1.064 -24.668 25.870 1.00 23.14 O
-ATOM 753 OD2 ASP A 101 0.747 -23.573 26.231 1.00 23.00 O
-ATOM 754 N ILE A 102 2.666 -28.500 25.798 1.00 19.76 N
-ATOM 755 CA ILE A 102 3.537 -29.509 26.333 1.00 21.70 C
-ATOM 756 C ILE A 102 4.321 -28.842 27.477 1.00 22.28 C
-ATOM 757 O ILE A 102 4.686 -27.665 27.349 1.00 20.29 O
-ATOM 758 CB ILE A 102 4.443 -30.043 25.154 1.00 19.72 C
-ATOM 759 CG1 ILE A 102 3.599 -30.939 24.230 1.00 25.08 C
-ATOM 760 CG2 ILE A 102 5.665 -30.807 25.682 1.00 18.10 C
-ATOM 761 CD1 ILE A 102 4.422 -31.467 23.005 1.00 22.45 C
-ATOM 762 N PRO A 103 4.621 -29.544 28.600 1.00 24.84 N
-ATOM 763 CA PRO A 103 5.227 -28.946 29.789 1.00 28.04 C
-ATOM 764 C PRO A 103 6.720 -28.787 29.684 1.00 25.87 C
-ATOM 765 O PRO A 103 7.484 -29.523 30.324 1.00 26.05 O
-ATOM 766 CB PRO A 103 4.775 -29.866 30.923 1.00 21.68 C
-ATOM 767 CG PRO A 103 4.679 -31.225 30.267 1.00 24.38 C
-ATOM 768 CD PRO A 103 4.108 -30.899 28.902 1.00 21.16 C
-ATOM 769 N TYR A 104 7.182 -27.838 28.863 1.00 18.31 N
-ATOM 770 CA TYR A 104 8.608 -27.635 28.761 1.00 18.73 C
-ATOM 771 C TYR A 104 9.073 -26.921 30.023 1.00 20.07 C
-ATOM 772 O TYR A 104 8.361 -26.098 30.593 1.00 21.70 O
-ATOM 773 CB TYR A 104 8.971 -26.789 27.514 1.00 20.72 C
-ATOM 774 CG TYR A 104 8.556 -27.514 26.228 1.00 20.99 C
-ATOM 775 CD1 TYR A 104 9.331 -28.550 25.758 1.00 23.25 C
-ATOM 776 CD2 TYR A 104 7.414 -27.137 25.529 1.00 21.35 C
-ATOM 777 CE1 TYR A 104 8.951 -29.198 24.590 1.00 23.05 C
-ATOM 778 CE2 TYR A 104 7.042 -27.786 24.360 1.00 18.76 C
-ATOM 779 CZ TYR A 104 7.830 -28.816 23.914 1.00 22.33 C
-ATOM 780 OH TYR A 104 7.505 -29.528 22.797 1.00 26.62 O
-ATOM 781 N LEU A 105 10.287 -27.267 30.428 1.00 19.68 N
-ATOM 782 CA LEU A 105 10.892 -26.687 31.606 1.00 27.46 C
-ATOM 783 C LEU A 105 11.398 -25.269 31.384 1.00 24.74 C
-ATOM 784 O LEU A 105 11.335 -24.466 32.314 1.00 18.69 O
-ATOM 785 CB LEU A 105 12.060 -27.619 32.094 1.00 24.81 C
-ATOM 786 CG LEU A 105 12.850 -27.282 33.414 1.00 23.54 C
-ATOM 787 CD1 LEU A 105 11.903 -27.421 34.607 1.00 22.08 C
-ATOM 788 CD2 LEU A 105 14.036 -28.212 33.581 1.00 19.57 C
-ATOM 789 N THR A 106 11.939 -24.878 30.204 1.00 22.99 N
-ATOM 790 CA THR A 106 12.566 -23.563 30.052 1.00 22.98 C
-ATOM 791 C THR A 106 11.922 -22.739 28.921 1.00 18.20 C
-ATOM 792 O THR A 106 11.066 -23.276 28.199 1.00 21.22 O
-ATOM 793 CB THR A 106 14.132 -23.718 29.810 1.00 29.35 C
-ATOM 794 OG1 THR A 106 14.327 -24.208 28.473 1.00 25.92 O
-ATOM 795 CG2 THR A 106 14.823 -24.635 30.873 1.00 19.42 C
-ATOM 796 N GLY A 107 12.329 -21.461 28.785 1.00 17.26 N
-ATOM 797 CA GLY A 107 11.894 -20.551 27.729 1.00 18.97 C
-ATOM 798 C GLY A 107 10.440 -20.263 27.925 1.00 27.01 C
-ATOM 799 O GLY A 107 9.838 -20.634 28.939 1.00 22.34 O
-ATOM 800 N ASP A 108 9.898 -19.520 26.977 1.00 18.09 N
-ATOM 801 CA ASP A 108 8.489 -19.175 26.967 1.00 14.02 C
-ATOM 802 C ASP A 108 8.007 -18.619 28.318 1.00 16.56 C
-ATOM 803 O ASP A 108 7.084 -19.135 28.971 1.00 19.46 O
-ATOM 804 CB ASP A 108 7.652 -20.396 26.617 1.00 14.02 C
-ATOM 805 CG ASP A 108 6.232 -20.071 26.186 1.00 20.04 C
-ATOM 806 OD1 ASP A 108 5.930 -18.919 25.882 1.00 22.75 O
-ATOM 807 OD2 ASP A 108 5.399 -20.983 26.091 1.00 21.20 O
-ATOM 808 N GLU A 109 8.764 -17.583 28.705 1.00 18.15 N
-ATOM 809 CA GLU A 109 8.495 -16.749 29.872 1.00 24.76 C
-ATOM 810 C GLU A 109 8.816 -17.406 31.222 1.00 28.53 C
-ATOM 811 O GLU A 109 8.360 -16.907 32.248 1.00 24.18 O
-ATOM 812 CB GLU A 109 7.031 -16.306 29.903 1.00 23.74 C
-ATOM 813 CG GLU A 109 6.609 -15.513 28.685 1.00 39.02 C
-ATOM 814 CD GLU A 109 5.164 -15.091 28.776 1.00 35.83 C
-ATOM 815 OE1 GLU A 109 4.307 -15.965 28.666 1.00 42.26 O
-ATOM 816 OE2 GLU A 109 4.922 -13.901 28.984 1.00 50.54 O
-ATOM 817 N ARG A 110 9.587 -18.495 31.296 1.00 23.57 N
-ATOM 818 CA ARG A 110 10.058 -19.072 32.572 1.00 25.84 C
-ATOM 819 C ARG A 110 10.919 -18.036 33.304 1.00 30.43 C
-ATOM 820 O ARG A 110 10.672 -17.724 34.475 1.00 24.85 O
-ATOM 821 CB ARG A 110 10.883 -20.353 32.319 1.00 21.39 C
-ATOM 822 CG ARG A 110 11.404 -21.078 33.569 1.00 23.85 C
-ATOM 823 CD ARG A 110 10.161 -21.588 34.342 1.00 24.89 C
-ATOM 824 NE ARG A 110 9.647 -22.774 33.671 1.00 27.06 N
-ATOM 825 CZ ARG A 110 8.375 -23.149 33.571 1.00 24.00 C
-ATOM 826 NH1 ARG A 110 7.435 -22.413 34.118 1.00 34.29 N
-ATOM 827 NH2 ARG A 110 8.022 -24.277 32.956 1.00 26.57 N
-ATOM 828 N LEU A 111 11.915 -17.438 32.657 1.00 17.88 N
-ATOM 829 CA LEU A 111 12.745 -16.429 33.264 1.00 18.66 C
-ATOM 830 C LEU A 111 12.707 -15.080 32.576 1.00 19.35 C
-ATOM 831 O LEU A 111 13.309 -14.108 33.051 1.00 18.67 O
-ATOM 832 CB LEU A 111 14.157 -16.942 33.296 1.00 19.31 C
-ATOM 833 CG LEU A 111 14.430 -18.083 34.253 1.00 24.75 C
-ATOM 834 CD1 LEU A 111 15.824 -18.593 34.125 1.00 28.02 C
-ATOM 835 CD2 LEU A 111 14.261 -17.553 35.646 1.00 33.78 C
-ATOM 836 N THR A 112 12.007 -14.963 31.439 1.00 18.03 N
-ATOM 837 CA THR A 112 11.980 -13.716 30.682 1.00 18.21 C
-ATOM 838 C THR A 112 11.282 -12.671 31.542 1.00 16.40 C
-ATOM 839 O THR A 112 10.238 -12.982 32.125 1.00 21.37 O
-ATOM 840 CB THR A 112 11.196 -13.930 29.365 1.00 20.52 C
-ATOM 841 OG1 THR A 112 11.651 -15.180 28.849 1.00 21.48 O
-ATOM 842 CG2 THR A 112 11.362 -12.778 28.399 1.00 16.54 C
-ATOM 843 N ALA A 113 11.761 -11.438 31.610 1.00 17.64 N
-ATOM 844 CA ALA A 113 11.156 -10.417 32.442 1.00 22.16 C
-ATOM 845 C ALA A 113 11.625 -9.054 31.967 1.00 23.20 C
-ATOM 846 O ALA A 113 12.433 -8.975 31.031 1.00 21.50 O
-ATOM 847 CB ALA A 113 11.606 -10.647 33.900 1.00 20.45 C
-ATOM 848 N GLU A 114 11.168 -7.983 32.636 1.00 17.56 N
-ATOM 849 CA GLU A 114 11.550 -6.643 32.300 1.00 17.62 C
-ATOM 850 C GLU A 114 13.050 -6.545 32.268 1.00 20.21 C
-ATOM 851 O GLU A 114 13.744 -7.079 33.127 1.00 19.38 O
-ATOM 852 CB GLU A 114 10.943 -5.731 33.326 1.00 21.43 C
-ATOM 853 CG GLU A 114 11.353 -4.286 33.067 1.00 31.92 C
-ATOM 854 CD GLU A 114 10.679 -3.178 33.891 1.00 50.58 C
-ATOM 855 OE1 GLU A 114 9.970 -3.484 34.845 1.00 58.25 O
-ATOM 856 OE2 GLU A 114 10.863 -1.999 33.570 1.00 57.25 O
-ATOM 857 N ASP A 115 13.595 -5.983 31.191 1.00 18.34 N
-ATOM 858 CA ASP A 115 15.035 -5.858 30.963 1.00 18.30 C
-ATOM 859 C ASP A 115 15.803 -7.156 30.977 1.00 14.16 C
-ATOM 860 O ASP A 115 17.021 -7.232 31.237 1.00 18.02 O
-ATOM 861 CB ASP A 115 15.700 -4.964 32.002 1.00 19.01 C
-ATOM 862 CG ASP A 115 15.275 -3.526 32.012 1.00 25.40 C
-ATOM 863 OD1 ASP A 115 14.861 -3.002 30.973 1.00 28.95 O
-ATOM 864 OD2 ASP A 115 15.386 -2.918 33.069 1.00 32.28 O
-ATOM 865 N ASN A 116 15.080 -8.231 30.694 1.00 16.08 N
-ATOM 866 CA ASN A 116 15.715 -9.515 30.775 1.00 21.18 C
-ATOM 867 C ASN A 116 15.183 -10.408 29.648 1.00 17.53 C
-ATOM 868 O ASN A 116 14.329 -11.285 29.847 1.00 18.38 O
-ATOM 869 CB ASN A 116 15.462 -10.131 32.189 1.00 13.57 C
-ATOM 870 CG ASN A 116 16.452 -11.274 32.370 1.00 13.13 C
-ATOM 871 OD1 ASN A 116 17.716 -11.114 32.335 1.00 22.25 O
-ATOM 872 ND2 ASN A 116 15.861 -12.462 32.579 1.00 17.70 N
-ATOM 873 N PRO A 117 15.676 -10.216 28.405 1.00 19.89 N
-ATOM 874 CA PRO A 117 15.360 -11.102 27.297 1.00 22.27 C
-ATOM 875 C PRO A 117 16.088 -12.442 27.412 1.00 18.54 C
-ATOM 876 O PRO A 117 17.132 -12.521 28.078 1.00 18.89 O
-ATOM 877 CB PRO A 117 15.760 -10.264 26.087 1.00 15.27 C
-ATOM 878 CG PRO A 117 16.976 -9.504 26.572 1.00 17.83 C
-ATOM 879 CD PRO A 117 16.553 -9.125 27.988 1.00 17.26 C
-ATOM 880 N VAL A 118 15.596 -13.518 26.766 1.00 16.16 N
-ATOM 881 CA VAL A 118 16.341 -14.777 26.664 1.00 16.43 C
-ATOM 882 C VAL A 118 16.766 -14.959 25.175 1.00 25.34 C
-ATOM 883 O VAL A 118 16.320 -14.206 24.289 1.00 19.32 O
-ATOM 884 CB VAL A 118 15.473 -16.017 27.179 1.00 18.45 C
-ATOM 885 CG1 VAL A 118 15.247 -15.671 28.696 1.00 15.26 C
-ATOM 886 CG2 VAL A 118 14.085 -16.264 26.552 1.00 15.58 C
-ATOM 887 N LEU A 119 17.618 -15.929 24.877 1.00 20.33 N
-ATOM 888 CA LEU A 119 18.212 -16.171 23.561 1.00 20.99 C
-ATOM 889 C LEU A 119 17.806 -17.484 22.914 1.00 20.18 C
-ATOM 890 O LEU A 119 17.746 -18.515 23.600 1.00 19.36 O
-ATOM 891 CB LEU A 119 19.702 -16.108 23.761 1.00 19.83 C
-ATOM 892 CG LEU A 119 20.525 -16.192 22.531 1.00 29.38 C
-ATOM 893 CD1 LEU A 119 20.499 -14.841 21.877 1.00 33.62 C
-ATOM 894 CD2 LEU A 119 21.929 -16.539 22.872 1.00 28.54 C
-ATOM 895 N LEU A 120 17.509 -17.596 21.616 1.00 16.23 N
-ATOM 896 CA LEU A 120 17.189 -18.885 21.005 1.00 12.16 C
-ATOM 897 C LEU A 120 17.994 -18.923 19.717 1.00 23.81 C
-ATOM 898 O LEU A 120 17.999 -17.948 18.969 1.00 18.46 O
-ATOM 899 CB LEU A 120 15.739 -19.008 20.630 1.00 14.54 C
-ATOM 900 CG LEU A 120 15.309 -20.190 19.798 1.00 17.59 C
-ATOM 901 CD1 LEU A 120 15.600 -21.483 20.543 1.00 20.38 C
-ATOM 902 CD2 LEU A 120 13.811 -20.074 19.496 1.00 15.97 C
-ATOM 903 N TYR A 121 18.739 -19.971 19.482 1.00 22.12 N
-ATOM 904 CA TYR A 121 19.505 -20.129 18.261 1.00 23.52 C
-ATOM 905 C TYR A 121 18.888 -21.304 17.518 1.00 22.86 C
-ATOM 906 O TYR A 121 18.665 -22.334 18.165 1.00 23.27 O
-ATOM 907 CB TYR A 121 20.961 -20.421 18.590 1.00 22.24 C
-ATOM 908 CG TYR A 121 21.739 -20.937 17.382 1.00 25.99 C
-ATOM 909 CD1 TYR A 121 22.117 -20.087 16.352 1.00 34.91 C
-ATOM 910 CD2 TYR A 121 21.999 -22.288 17.324 1.00 26.29 C
-ATOM 911 CE1 TYR A 121 22.758 -20.613 15.256 1.00 27.38 C
-ATOM 912 CE2 TYR A 121 22.633 -22.826 16.234 1.00 35.27 C
-ATOM 913 CZ TYR A 121 23.005 -21.983 15.214 1.00 36.17 C
-ATOM 914 OH TYR A 121 23.631 -22.562 14.125 1.00 35.43 O
-ATOM 915 N THR A 122 18.599 -21.227 16.193 1.00 22.81 N
-ATOM 916 CA THR A 122 18.112 -22.375 15.451 1.00 19.32 C
-ATOM 917 C THR A 122 18.914 -22.461 14.151 1.00 27.70 C
-ATOM 918 O THR A 122 19.473 -21.465 13.656 1.00 21.98 O
-ATOM 919 CB THR A 122 16.640 -22.248 15.110 1.00 21.37 C
-ATOM 920 OG1 THR A 122 16.478 -20.913 14.669 1.00 27.26 O
-ATOM 921 CG2 THR A 122 15.706 -22.489 16.285 1.00 29.49 C
-ATOM 922 N TYR A 123 18.931 -23.678 13.643 1.00 26.58 N
-ATOM 923 CA TYR A 123 19.626 -23.982 12.406 1.00 28.58 C
-ATOM 924 C TYR A 123 19.029 -25.198 11.750 1.00 30.09 C
-ATOM 925 O TYR A 123 18.779 -26.203 12.416 1.00 26.30 O
-ATOM 926 CB TYR A 123 21.060 -24.251 12.713 1.00 29.46 C
-ATOM 927 CG TYR A 123 21.859 -24.701 11.507 1.00 31.07 C
-ATOM 928 CD1 TYR A 123 22.355 -23.720 10.683 1.00 39.10 C
-ATOM 929 CD2 TYR A 123 22.061 -26.048 11.277 1.00 34.75 C
-ATOM 930 CE1 TYR A 123 23.083 -24.079 9.583 1.00 35.87 C
-ATOM 931 CE2 TYR A 123 22.787 -26.421 10.180 1.00 42.57 C
-ATOM 932 CZ TYR A 123 23.284 -25.427 9.354 1.00 47.35 C
-ATOM 933 OH TYR A 123 24.014 -25.777 8.240 1.00 53.04 O
-ATOM 934 N SER A 124 18.827 -25.167 10.444 1.00 29.07 N
-ATOM 935 CA SER A 124 18.380 -26.360 9.780 1.00 25.74 C
-ATOM 936 C SER A 124 19.212 -26.528 8.512 1.00 32.52 C
-ATOM 937 O SER A 124 19.737 -25.560 7.954 1.00 28.10 O
-ATOM 938 CB SER A 124 16.959 -26.266 9.361 1.00 29.36 C
-ATOM 939 OG SER A 124 16.102 -26.031 10.448 1.00 40.97 O
-ATOM 940 N ALA A 125 19.358 -27.755 8.074 1.00 38.12 N
-ATOM 941 CA ALA A 125 20.047 -28.066 6.845 1.00 28.40 C
-ATOM 942 C ALA A 125 19.350 -29.333 6.392 1.00 30.58 C
-ATOM 943 O ALA A 125 19.430 -30.369 7.065 1.00 39.26 O
-ATOM 944 CB ALA A 125 21.487 -28.341 7.146 1.00 24.99 C
-ATOM 945 N GLY A 126 18.578 -29.298 5.319 1.00 37.02 N
-ATOM 946 CA GLY A 126 17.941 -30.499 4.836 1.00 31.57 C
-ATOM 947 C GLY A 126 16.898 -31.059 5.780 1.00 47.32 C
-ATOM 948 O GLY A 126 15.877 -30.451 6.108 1.00 45.65 O
-ATOM 949 N ALA A 127 17.180 -32.278 6.195 1.00 33.24 N
-ATOM 950 CA ALA A 127 16.275 -33.037 7.039 1.00 42.64 C
-ATOM 951 C ALA A 127 16.458 -32.822 8.549 1.00 33.08 C
-ATOM 952 O ALA A 127 15.702 -33.301 9.402 1.00 40.51 O
-ATOM 953 CB ALA A 127 16.490 -34.498 6.705 1.00 35.42 C
-ATOM 954 N PHE A 128 17.468 -32.083 8.902 1.00 27.81 N
-ATOM 955 CA PHE A 128 17.848 -32.020 10.258 1.00 28.97 C
-ATOM 956 C PHE A 128 17.701 -30.613 10.786 1.00 40.19 C
-ATOM 957 O PHE A 128 17.975 -29.634 10.085 1.00 29.96 O
-ATOM 958 CB PHE A 128 19.218 -32.562 10.176 1.00 27.26 C
-ATOM 959 CG PHE A 128 20.062 -32.313 11.399 1.00 62.21 C
-ATOM 960 CD1 PHE A 128 19.988 -33.205 12.457 1.00 68.83 C
-ATOM 961 CD2 PHE A 128 20.908 -31.200 11.430 1.00 68.66 C
-ATOM 962 CE1 PHE A 128 20.783 -32.970 13.564 1.00 68.63 C
-ATOM 963 CE2 PHE A 128 21.699 -30.972 12.540 1.00 72.56 C
-ATOM 964 CZ PHE A 128 21.630 -31.866 13.601 1.00 71.50 C
-ATOM 965 N SER A 129 17.331 -30.540 12.060 1.00 32.05 N
-ATOM 966 CA SER A 129 17.219 -29.262 12.751 1.00 30.97 C
-ATOM 967 C SER A 129 17.830 -29.309 14.144 1.00 26.59 C
-ATOM 968 O SER A 129 17.736 -30.344 14.808 1.00 27.36 O
-ATOM 969 CB SER A 129 15.772 -28.871 12.897 1.00 27.55 C
-ATOM 970 OG SER A 129 15.072 -28.729 11.673 1.00 47.00 O
-ATOM 971 N VAL A 130 18.521 -28.261 14.560 1.00 28.17 N
-ATOM 972 CA VAL A 130 19.019 -28.143 15.916 1.00 29.20 C
-ATOM 973 C VAL A 130 18.641 -26.796 16.512 1.00 40.17 C
-ATOM 974 O VAL A 130 18.516 -25.799 15.787 1.00 25.40 O
-ATOM 975 CB VAL A 130 20.511 -28.239 16.012 1.00 24.69 C
-ATOM 976 CG1 VAL A 130 20.801 -29.679 15.851 1.00 34.50 C
-ATOM 977 CG2 VAL A 130 21.225 -27.340 15.037 1.00 27.14 C
-ATOM 978 N ALA A 131 18.434 -26.730 17.829 1.00 24.58 N
-ATOM 979 CA ALA A 131 18.111 -25.468 18.511 1.00 21.75 C
-ATOM 980 C ALA A 131 18.877 -25.407 19.842 1.00 27.70 C
-ATOM 981 O ALA A 131 19.246 -26.460 20.409 1.00 27.02 O
-ATOM 982 CB ALA A 131 16.591 -25.405 18.742 1.00 16.82 C
-ATOM 983 N ALA A 132 19.238 -24.228 20.323 1.00 24.98 N
-ATOM 984 CA ALA A 132 19.932 -24.098 21.596 1.00 25.03 C
-ATOM 985 C ALA A 132 19.448 -22.801 22.221 1.00 34.14 C
-ATOM 986 O ALA A 132 19.250 -21.814 21.513 1.00 20.34 O
-ATOM 987 CB ALA A 132 21.444 -24.029 21.375 1.00 23.74 C
-ATOM 988 N SER A 133 19.188 -22.737 23.518 1.00 21.23 N
-ATOM 989 CA SER A 133 18.664 -21.524 24.131 1.00 18.46 C
-ATOM 990 C SER A 133 19.284 -21.285 25.516 1.00 24.03 C
-ATOM 991 O SER A 133 19.802 -22.239 26.115 1.00 22.23 O
-ATOM 992 CB SER A 133 17.176 -21.672 24.250 1.00 14.79 C
-ATOM 993 OG SER A 133 16.814 -22.952 24.768 1.00 19.72 O
-ATOM 994 N MET A 134 19.303 -20.077 26.055 1.00 22.25 N
-ATOM 995 CA MET A 134 19.802 -19.845 27.405 1.00 21.58 C
-ATOM 996 C MET A 134 19.357 -18.485 27.899 1.00 33.98 C
-ATOM 997 O MET A 134 18.998 -17.634 27.066 1.00 19.01 O
-ATOM 998 CB MET A 134 21.317 -19.910 27.405 1.00 18.41 C
-ATOM 999 CG MET A 134 21.955 -18.746 26.654 1.00 25.36 C
-ATOM 1000 SD MET A 134 23.758 -18.772 26.669 1.00 35.96 S
-ATOM 1001 CE MET A 134 24.092 -18.494 28.385 1.00 37.35 C
-ATOM 1002 N SER A 135 19.314 -18.261 29.212 1.00 18.02 N
-ATOM 1003 CA SER A 135 19.041 -16.944 29.746 1.00 16.76 C
-ATOM 1004 C SER A 135 20.400 -16.477 30.208 1.00 16.94 C
-ATOM 1005 O SER A 135 21.361 -17.253 30.182 1.00 20.09 O
-ATOM 1006 CB SER A 135 18.034 -17.017 30.907 1.00 20.02 C
-ATOM 1007 OG SER A 135 18.468 -17.881 31.957 1.00 20.86 O
-ATOM 1008 N ASP A 136 20.575 -15.243 30.638 1.00 16.31 N
-ATOM 1009 CA ASP A 136 21.896 -14.789 30.953 1.00 16.45 C
-ATOM 1010 C ASP A 136 22.306 -14.956 32.433 1.00 22.62 C
-ATOM 1011 O ASP A 136 23.431 -14.549 32.746 1.00 22.11 O
-ATOM 1012 CB ASP A 136 22.008 -13.322 30.545 1.00 18.28 C
-ATOM 1013 CG ASP A 136 21.118 -12.306 31.234 1.00 26.65 C
-ATOM 1014 OD1 ASP A 136 20.599 -12.470 32.340 1.00 23.99 O
-ATOM 1015 OD2 ASP A 136 20.891 -11.237 30.680 1.00 20.64 O
-ATOM 1016 N GLY A 137 21.469 -15.440 33.377 1.00 24.48 N
-ATOM 1017 CA GLY A 137 21.879 -15.654 34.775 1.00 23.91 C
-ATOM 1018 C GLY A 137 21.825 -14.434 35.682 1.00 26.85 C
-ATOM 1019 O GLY A 137 22.169 -14.569 36.854 1.00 25.96 O
-ATOM 1020 N LYS A 138 21.421 -13.236 35.265 1.00 17.66 N
-ATOM 1021 CA LYS A 138 21.367 -12.055 36.104 1.00 18.17 C
-ATOM 1022 C LYS A 138 20.022 -11.408 35.986 1.00 30.18 C
-ATOM 1023 O LYS A 138 19.466 -11.268 34.880 1.00 21.24 O
-ATOM 1024 CB LYS A 138 22.372 -10.986 35.727 1.00 16.38 C
-ATOM 1025 CG LYS A 138 23.792 -11.496 35.715 1.00 23.82 C
-ATOM 1026 CD LYS A 138 24.140 -11.859 37.123 1.00 27.64 C
-ATOM 1027 CE LYS A 138 25.533 -12.379 37.245 1.00 44.82 C
-ATOM 1028 NZ LYS A 138 26.012 -11.923 38.538 1.00 46.52 N
-ATOM 1029 N VAL A 139 19.474 -10.987 37.108 1.00 18.51 N
-ATOM 1030 CA VAL A 139 18.174 -10.375 37.172 1.00 17.22 C
-ATOM 1031 C VAL A 139 18.172 -9.096 36.379 1.00 17.48 C
-ATOM 1032 O VAL A 139 19.123 -8.335 36.540 1.00 19.74 O
-ATOM 1033 CB VAL A 139 17.788 -10.042 38.624 1.00 22.74 C
-ATOM 1034 CG1 VAL A 139 16.425 -9.380 38.662 1.00 20.52 C
-ATOM 1035 CG2 VAL A 139 17.643 -11.326 39.407 1.00 19.66 C
-ATOM 1036 N GLY A 140 17.163 -8.830 35.530 1.00 20.23 N
-ATOM 1037 CA GLY A 140 17.145 -7.617 34.718 1.00 18.19 C
-ATOM 1038 C GLY A 140 18.483 -7.470 33.993 1.00 15.63 C
-ATOM 1039 O GLY A 140 19.102 -8.463 33.521 1.00 24.74 O
-ATOM 1040 N GLU A 141 18.944 -6.222 34.012 1.00 20.17 N
-ATOM 1041 CA GLU A 141 20.259 -5.874 33.503 1.00 22.48 C
-ATOM 1042 C GLU A 141 21.126 -5.535 34.696 1.00 27.63 C
-ATOM 1043 O GLU A 141 22.035 -4.706 34.600 1.00 24.54 O
-ATOM 1044 CB GLU A 141 20.171 -4.664 32.566 1.00 23.70 C
-ATOM 1045 CG GLU A 141 19.722 -5.124 31.158 1.00 28.35 C
-ATOM 1046 CD GLU A 141 19.280 -4.042 30.161 1.00 35.14 C
-ATOM 1047 OE1 GLU A 141 19.521 -2.849 30.346 1.00 29.71 O
-ATOM 1048 OE2 GLU A 141 18.647 -4.398 29.172 1.00 26.87 O
-ATOM 1049 N THR A 142 20.874 -6.205 35.825 1.00 24.87 N
-ATOM 1050 CA THR A 142 21.602 -5.920 37.045 1.00 26.14 C
-ATOM 1051 C THR A 142 22.691 -6.951 37.228 1.00 26.00 C
-ATOM 1052 O THR A 142 22.900 -7.827 36.391 1.00 26.49 O
-ATOM 1053 CB THR A 142 20.652 -5.937 38.303 1.00 22.12 C
-ATOM 1054 OG1 THR A 142 20.367 -7.309 38.664 1.00 23.47 O
-ATOM 1055 CG2 THR A 142 19.428 -5.058 38.051 1.00 22.33 C
-ATOM 1056 N SER A 143 23.421 -6.876 38.341 1.00 25.41 N
-ATOM 1057 CA SER A 143 24.368 -7.911 38.667 1.00 24.21 C
-ATOM 1058 C SER A 143 23.801 -8.929 39.653 1.00 29.13 C
-ATOM 1059 O SER A 143 24.544 -9.831 40.060 1.00 29.64 O
-ATOM 1060 CB SER A 143 25.611 -7.272 39.238 1.00 30.36 C
-ATOM 1061 OG SER A 143 26.293 -6.538 38.236 1.00 34.01 O
-ATOM 1062 N GLU A 144 22.512 -8.883 40.023 1.00 25.37 N
-ATOM 1063 CA GLU A 144 21.989 -9.861 40.964 1.00 23.57 C
-ATOM 1064 C GLU A 144 21.841 -11.232 40.318 1.00 32.22 C
-ATOM 1065 O GLU A 144 21.251 -11.321 39.236 1.00 26.96 O
-ATOM 1066 CB GLU A 144 20.651 -9.323 41.474 1.00 30.98 C
-ATOM 1067 CG GLU A 144 20.131 -10.086 42.704 1.00 55.43 C
-ATOM 1068 CD GLU A 144 18.655 -9.917 43.094 1.00 68.87 C
-ATOM 1069 OE1 GLU A 144 18.059 -8.877 42.796 1.00 57.51 O
-ATOM 1070 OE2 GLU A 144 18.102 -10.844 43.704 1.00 82.75 O
-ATOM 1071 N ASP A 145 22.347 -12.300 40.937 1.00 24.45 N
-ATOM 1072 CA ASP A 145 22.274 -13.644 40.397 1.00 23.62 C
-ATOM 1073 C ASP A 145 20.885 -14.160 40.292 1.00 31.40 C
-ATOM 1074 O ASP A 145 20.085 -13.976 41.211 1.00 27.58 O
-ATOM 1075 CB ASP A 145 23.020 -14.680 41.223 1.00 27.22 C
-ATOM 1076 CG ASP A 145 24.550 -14.597 41.158 1.00 43.72 C
-ATOM 1077 OD1 ASP A 145 25.098 -14.301 40.098 1.00 55.35 O
-ATOM 1078 OD2 ASP A 145 25.207 -14.860 42.168 1.00 70.49 O
-ATOM 1079 N ASP A 146 20.597 -14.825 39.175 1.00 23.66 N
-ATOM 1080 CA ASP A 146 19.260 -15.333 38.926 1.00 18.81 C
-ATOM 1081 C ASP A 146 19.452 -16.804 38.675 1.00 10.77 C
-ATOM 1082 O ASP A 146 20.572 -17.306 38.563 1.00 22.23 O
-ATOM 1083 CB ASP A 146 18.641 -14.610 37.668 1.00 21.54 C
-ATOM 1084 CG ASP A 146 17.119 -14.645 37.537 1.00 31.62 C
-ATOM 1085 OD1 ASP A 146 16.459 -15.328 38.315 1.00 34.30 O
-ATOM 1086 OD2 ASP A 146 16.552 -13.985 36.671 1.00 26.76 O
-ATOM 1087 N ALA A 147 18.352 -17.567 38.662 1.00 16.46 N
-ATOM 1088 CA ALA A 147 18.384 -18.938 38.146 1.00 23.36 C
-ATOM 1089 C ALA A 147 18.787 -18.819 36.658 1.00 25.54 C
-ATOM 1090 O ALA A 147 18.528 -17.764 36.053 1.00 21.29 O
-ATOM 1091 CB ALA A 147 17.004 -19.572 38.198 1.00 18.36 C
-ATOM 1092 N GLN A 148 19.417 -19.794 36.046 1.00 20.67 N
-ATOM 1093 CA GLN A 148 19.780 -19.644 34.654 1.00 21.13 C
-ATOM 1094 C GLN A 148 19.249 -20.829 33.907 1.00 28.17 C
-ATOM 1095 O GLN A 148 19.476 -21.942 34.380 1.00 24.20 O
-ATOM 1096 CB GLN A 148 21.233 -19.585 34.578 1.00 21.13 C
-ATOM 1097 CG GLN A 148 21.619 -19.436 33.129 1.00 25.80 C
-ATOM 1098 CD GLN A 148 23.080 -19.135 32.982 1.00 34.87 C
-ATOM 1099 OE1 GLN A 148 23.490 -18.474 32.035 1.00 38.87 O
-ATOM 1100 NE2 GLN A 148 23.954 -19.503 33.912 1.00 47.02 N
-ATOM 1101 N GLU A 149 18.555 -20.666 32.777 1.00 17.81 N
-ATOM 1102 CA GLU A 149 18.010 -21.814 32.074 1.00 17.51 C
-ATOM 1103 C GLU A 149 18.825 -22.040 30.814 1.00 20.63 C
-ATOM 1104 O GLU A 149 19.517 -21.103 30.376 1.00 18.55 O
-ATOM 1105 CB GLU A 149 16.573 -21.597 31.681 1.00 19.12 C
-ATOM 1106 CG GLU A 149 16.351 -20.335 30.838 1.00 18.36 C
-ATOM 1107 CD GLU A 149 14.915 -19.997 30.523 1.00 20.39 C
-ATOM 1108 OE1 GLU A 149 14.001 -20.666 31.017 1.00 21.55 O
-ATOM 1109 OE2 GLU A 149 14.713 -19.031 29.780 1.00 21.49 O
-ATOM 1110 N MET A 150 18.765 -23.266 30.310 1.00 18.17 N
-ATOM 1111 CA MET A 150 19.475 -23.652 29.080 1.00 20.14 C
-ATOM 1112 C MET A 150 18.815 -24.867 28.505 1.00 28.58 C
-ATOM 1113 O MET A 150 18.294 -25.697 29.249 1.00 27.20 O
-ATOM 1114 CB MET A 150 20.897 -24.106 29.266 1.00 27.78 C
-ATOM 1115 CG MET A 150 21.860 -23.060 29.696 1.00 64.16 C
-ATOM 1116 SD MET A 150 23.096 -23.853 30.745 1.00 78.93 S
-ATOM 1117 CE MET A 150 24.207 -22.466 30.751 1.00 70.32 C
-ATOM 1118 N ALA A 151 18.839 -25.057 27.189 1.00 21.76 N
-ATOM 1119 CA ALA A 151 18.277 -26.257 26.591 1.00 22.34 C
-ATOM 1120 C ALA A 151 18.943 -26.437 25.223 1.00 22.98 C
-ATOM 1121 O ALA A 151 19.548 -25.489 24.661 1.00 20.23 O
-ATOM 1122 CB ALA A 151 16.789 -26.128 26.374 1.00 15.31 C
-ATOM 1123 N VAL A 152 18.928 -27.676 24.774 1.00 21.53 N
-ATOM 1124 CA VAL A 152 19.474 -28.033 23.471 1.00 23.07 C
-ATOM 1125 C VAL A 152 18.471 -29.062 22.924 1.00 29.71 C
-ATOM 1126 O VAL A 152 17.850 -29.818 23.689 1.00 27.21 O
-ATOM 1127 CB VAL A 152 20.971 -28.628 23.592 1.00 25.13 C
-ATOM 1128 CG1AVAL A 152 21.917 -27.575 24.154 0.53 28.48 C
-ATOM 1129 CG1BVAL A 152 21.452 -29.025 22.205 0.26 24.20 C
-ATOM 1130 CG1CVAL A 152 21.013 -29.912 24.410 0.21 26.31 C
-ATOM 1131 CG2AVAL A 152 20.993 -29.863 24.477 0.53 23.43 C
-ATOM 1132 CG2BVAL A 152 21.950 -27.615 24.169 0.26 29.11 C
-ATOM 1133 CG2CVAL A 152 21.509 -28.858 22.190 0.21 24.18 C
-ATOM 1134 N ALA A 153 18.188 -29.091 21.614 1.00 27.54 N
-ATOM 1135 CA ALA A 153 17.282 -30.081 21.038 1.00 23.02 C
-ATOM 1136 C ALA A 153 17.694 -30.354 19.578 1.00 25.00 C
-ATOM 1137 O ALA A 153 18.306 -29.478 18.939 1.00 23.08 O
-ATOM 1138 CB ALA A 153 15.849 -29.557 21.074 1.00 20.58 C
-ATOM 1139 N ALA A 154 17.409 -31.528 19.045 1.00 25.22 N
-ATOM 1140 CA ALA A 154 17.720 -31.854 17.658 1.00 31.60 C
-ATOM 1141 C ALA A 154 16.571 -32.634 17.111 1.00 28.50 C
-ATOM 1142 O ALA A 154 15.874 -33.314 17.860 1.00 28.42 O
-ATOM 1143 CB ALA A 154 18.932 -32.711 17.543 1.00 24.29 C
-ATOM 1144 N ALA A 155 16.262 -32.535 15.825 1.00 26.24 N
-ATOM 1145 CA ALA A 155 15.174 -33.295 15.245 1.00 31.59 C
-ATOM 1146 C ALA A 155 15.619 -33.740 13.846 1.00 32.78 C
-ATOM 1147 O ALA A 155 16.532 -33.181 13.226 1.00 27.08 O
-ATOM 1148 CB ALA A 155 13.908 -32.446 15.078 1.00 29.48 C
-ATOM 1149 N TYR A 156 14.961 -34.772 13.379 1.00 27.28 N
-ATOM 1150 CA TYR A 156 15.207 -35.330 12.082 1.00 27.65 C
-ATOM 1151 C TYR A 156 13.878 -35.745 11.455 1.00 25.30 C
-ATOM 1152 O TYR A 156 13.049 -36.464 12.029 1.00 31.37 O
-ATOM 1153 CB TYR A 156 16.168 -36.499 12.279 1.00 40.64 C
-ATOM 1154 CG TYR A 156 16.505 -37.195 10.962 1.00 72.25 C
-ATOM 1155 CD1 TYR A 156 17.270 -36.535 10.007 1.00 68.07 C
-ATOM 1156 CD2 TYR A 156 15.995 -38.472 10.714 1.00 78.75 C
-ATOM 1157 CE1 TYR A 156 17.511 -37.161 8.799 1.00 70.03 C
-ATOM 1158 CE2 TYR A 156 16.239 -39.101 9.507 1.00 76.52 C
-ATOM 1159 CZ TYR A 156 16.995 -38.430 8.559 1.00 81.42 C
-ATOM 1160 OH TYR A 156 17.234 -39.034 7.335 1.00 98.25 O
-ATOM 1161 N THR A 157 13.640 -35.245 10.249 1.00 33.54 N
-ATOM 1162 CA THR A 157 12.446 -35.609 9.529 1.00 41.02 C
-ATOM 1163 C THR A 157 12.781 -36.673 8.478 1.00 45.31 C
-ATOM 1164 O THR A 157 13.782 -36.556 7.773 1.00 47.36 O
-ATOM 1165 CB THR A 157 11.885 -34.354 8.890 1.00 31.49 C
-ATOM 1166 OG1 THR A 157 11.816 -33.382 9.932 1.00 47.00 O
-ATOM 1167 CG2 THR A 157 10.503 -34.583 8.279 1.00 34.86 C
-ATOM 1168 N PHE A 158 12.016 -37.750 8.382 1.00 40.52 N
-ATOM 1169 CA PHE A 158 12.155 -38.795 7.393 1.00 46.68 C
-ATOM 1170 C PHE A 158 10.739 -39.174 7.005 1.00 44.70 C
-ATOM 1171 O PHE A 158 9.926 -39.803 7.693 1.00 50.08 O
-ATOM 1172 CB PHE A 158 12.915 -40.006 7.961 1.00 40.11 C
-ATOM 1173 CG PHE A 158 12.415 -40.654 9.250 1.00 60.39 C
-ATOM 1174 CD1 PHE A 158 12.675 -40.063 10.478 1.00 73.87 C
-ATOM 1175 CD2 PHE A 158 11.701 -41.847 9.191 1.00 75.24 C
-ATOM 1176 CE1 PHE A 158 12.219 -40.663 11.632 1.00 73.60 C
-ATOM 1177 CE2 PHE A 158 11.249 -42.442 10.357 1.00 79.76 C
-ATOM 1178 CZ PHE A 158 11.509 -41.848 11.575 1.00 79.46 C
-ATOM 1179 N GLY A 159 10.399 -38.592 5.878 1.00 54.47 N
-ATOM 1180 CA GLY A 159 9.112 -38.851 5.291 1.00 53.05 C
-ATOM 1181 C GLY A 159 8.071 -38.135 6.113 1.00 50.28 C
-ATOM 1182 O GLY A 159 8.189 -36.924 6.359 1.00 60.39 O
-ATOM 1183 N ASN A 160 7.122 -38.958 6.579 1.00 40.08 N
-ATOM 1184 CA ASN A 160 5.983 -38.481 7.367 1.00 58.74 C
-ATOM 1185 C ASN A 160 6.321 -38.149 8.812 1.00 49.02 C
-ATOM 1186 O ASN A 160 5.490 -37.547 9.498 1.00 47.25 O
-ATOM 1187 CB ASN A 160 4.845 -39.503 7.494 1.00 63.82 C
-ATOM 1188 CG ASN A 160 4.460 -40.322 6.266 1.00 89.40 C
-ATOM 1189 OD1 ASN A 160 5.283 -41.093 5.758 1.00107.52 O
-ATOM 1190 ND2 ASN A 160 3.234 -40.234 5.751 1.00 92.23 N
-ATOM 1191 N TYR A 161 7.518 -38.572 9.221 1.00 38.38 N
-ATOM 1192 CA TYR A 161 7.993 -38.571 10.582 1.00 39.40 C
-ATOM 1193 C TYR A 161 9.020 -37.553 10.920 1.00 45.36 C
-ATOM 1194 O TYR A 161 9.923 -37.343 10.126 1.00 41.06 O
-ATOM 1195 CB TYR A 161 8.619 -39.886 10.939 1.00 34.37 C
-ATOM 1196 CG TYR A 161 7.655 -40.974 10.566 1.00 57.59 C
-ATOM 1197 CD1 TYR A 161 6.653 -41.311 11.450 1.00 69.71 C
-ATOM 1198 CD2 TYR A 161 7.725 -41.562 9.317 1.00 70.14 C
-ATOM 1199 CE1 TYR A 161 5.689 -42.237 11.087 1.00 73.90 C
-ATOM 1200 CE2 TYR A 161 6.765 -42.487 8.947 1.00 73.04 C
-ATOM 1201 CZ TYR A 161 5.750 -42.816 9.836 1.00 78.64 C
-ATOM 1202 OH TYR A 161 4.758 -43.712 9.471 1.00 85.47 O
-ATOM 1203 N THR A 162 8.891 -36.915 12.069 1.00 30.45 N
-ATOM 1204 CA THR A 162 9.994 -36.168 12.600 1.00 27.25 C
-ATOM 1205 C THR A 162 10.140 -36.784 13.950 1.00 35.32 C
-ATOM 1206 O THR A 162 9.140 -37.069 14.615 1.00 33.92 O
-ATOM 1207 CB THR A 162 9.703 -34.725 12.782 1.00 31.07 C
-ATOM 1208 OG1 THR A 162 9.394 -34.238 11.483 1.00 39.71 O
-ATOM 1209 CG2 THR A 162 10.889 -33.987 13.414 1.00 29.14 C
-ATOM 1210 N VAL A 163 11.356 -37.105 14.293 1.00 27.12 N
-ATOM 1211 CA VAL A 163 11.576 -37.553 15.642 1.00 37.49 C
-ATOM 1212 C VAL A 163 12.619 -36.613 16.222 1.00 30.21 C
-ATOM 1213 O VAL A 163 13.349 -35.952 15.479 1.00 33.78 O
-ATOM 1214 CB VAL A 163 12.069 -39.057 15.742 1.00 34.36 C
-ATOM 1215 CG1 VAL A 163 10.966 -39.939 15.165 1.00 32.38 C
-ATOM 1216 CG2 VAL A 163 13.420 -39.271 15.075 1.00 43.54 C
-ATOM 1217 N GLY A 164 12.688 -36.440 17.536 1.00 28.78 N
-ATOM 1218 CA GLY A 164 13.703 -35.572 18.098 1.00 30.23 C
-ATOM 1219 C GLY A 164 13.877 -35.769 19.601 1.00 28.31 C
-ATOM 1220 O GLY A 164 13.120 -36.518 20.239 1.00 28.35 O
-ATOM 1221 N LEU A 165 14.870 -35.075 20.147 1.00 24.05 N
-ATOM 1222 CA LEU A 165 15.090 -35.081 21.571 1.00 31.20 C
-ATOM 1223 C LEU A 165 15.630 -33.765 22.024 1.00 23.08 C
-ATOM 1224 O LEU A 165 16.230 -33.001 21.279 1.00 27.04 O
-ATOM 1225 CB LEU A 165 16.049 -36.185 21.995 1.00 40.23 C
-ATOM 1226 CG LEU A 165 17.491 -36.359 21.615 1.00 55.61 C
-ATOM 1227 CD1 LEU A 165 18.360 -36.288 22.871 1.00 64.27 C
-ATOM 1228 CD2 LEU A 165 17.674 -37.743 20.975 1.00 58.44 C
-ATOM 1229 N GLY A 166 15.339 -33.481 23.275 1.00 28.71 N
-ATOM 1230 CA GLY A 166 15.723 -32.228 23.857 1.00 24.37 C
-ATOM 1231 C GLY A 166 16.128 -32.454 25.298 1.00 22.71 C
-ATOM 1232 O GLY A 166 15.752 -33.451 25.916 1.00 23.22 O
-ATOM 1233 N TYR A 167 16.924 -31.547 25.782 1.00 22.54 N
-ATOM 1234 CA TYR A 167 17.385 -31.601 27.114 1.00 21.68 C
-ATOM 1235 C TYR A 167 17.386 -30.166 27.552 1.00 22.97 C
-ATOM 1236 O TYR A 167 18.019 -29.272 26.994 1.00 25.70 O
-ATOM 1237 CB TYR A 167 18.742 -32.178 27.097 1.00 19.60 C
-ATOM 1238 CG TYR A 167 19.294 -32.136 28.482 1.00 30.51 C
-ATOM 1239 CD1 TYR A 167 18.831 -33.005 29.458 1.00 31.48 C
-ATOM 1240 CD2 TYR A 167 20.232 -31.163 28.747 1.00 35.86 C
-ATOM 1241 CE1 TYR A 167 19.337 -32.873 30.737 1.00 34.71 C
-ATOM 1242 CE2 TYR A 167 20.735 -31.024 30.022 1.00 45.09 C
-ATOM 1243 CZ TYR A 167 20.279 -31.881 31.001 1.00 45.63 C
-ATOM 1244 OH TYR A 167 20.781 -31.711 32.274 1.00 43.91 O
-ATOM 1245 N GLU A 168 16.761 -30.020 28.698 1.00 25.32 N
-ATOM 1246 CA GLU A 168 16.579 -28.730 29.323 1.00 22.85 C
-ATOM 1247 C GLU A 168 17.031 -28.704 30.781 1.00 23.46 C
-ATOM 1248 O GLU A 168 16.833 -29.685 31.510 1.00 21.97 O
-ATOM 1249 CB GLU A 168 15.129 -28.374 29.303 1.00 23.96 C
-ATOM 1250 CG GLU A 168 14.336 -28.524 28.005 1.00 18.08 C
-ATOM 1251 CD GLU A 168 12.978 -27.879 28.137 1.00 17.37 C
-ATOM 1252 OE1 GLU A 168 12.883 -26.660 28.050 1.00 19.97 O
-ATOM 1253 OE2 GLU A 168 11.995 -28.566 28.325 1.00 21.50 O
-ATOM 1254 N LYS A 169 17.600 -27.609 31.238 1.00 21.91 N
-ATOM 1255 CA LYS A 169 17.934 -27.489 32.645 1.00 26.98 C
-ATOM 1256 C LYS A 169 17.850 -26.074 33.211 1.00 33.90 C
-ATOM 1257 O LYS A 169 17.944 -25.073 32.479 1.00 21.78 O
-ATOM 1258 CB LYS A 169 19.311 -28.049 32.861 1.00 22.39 C
-ATOM 1259 CG LYS A 169 20.349 -27.286 32.129 1.00 33.73 C
-ATOM 1260 CD LYS A 169 21.591 -27.849 32.707 1.00 55.00 C
-ATOM 1261 CE LYS A 169 22.497 -26.654 32.902 1.00 70.05 C
-ATOM 1262 NZ LYS A 169 23.579 -27.016 33.806 1.00 76.45 N
-ATOM 1263 N ILE A 170 17.570 -25.964 34.531 1.00 24.31 N
-ATOM 1264 CA ILE A 170 17.564 -24.681 35.251 1.00 26.64 C
-ATOM 1265 C ILE A 170 18.554 -24.824 36.423 1.00 22.64 C
-ATOM 1266 O ILE A 170 18.462 -25.750 37.218 1.00 26.39 O
-ATOM 1267 CB ILE A 170 16.144 -24.293 35.810 1.00 22.23 C
-ATOM 1268 CG1 ILE A 170 15.068 -24.222 34.712 1.00 18.13 C
-ATOM 1269 CG2 ILE A 170 16.296 -22.936 36.512 1.00 20.59 C
-ATOM 1270 CD1 ILE A 170 13.666 -23.890 35.214 1.00 22.57 C
-ATOM 1271 N ASP A 171 19.579 -24.004 36.473 1.00 21.42 N
-ATOM 1272 CA ASP A 171 20.512 -23.901 37.562 1.00 22.65 C
-ATOM 1273 C ASP A 171 20.069 -22.845 38.533 1.00 24.81 C
-ATOM 1274 O ASP A 171 19.879 -21.676 38.196 1.00 25.52 O
-ATOM 1275 CB ASP A 171 21.876 -23.496 37.110 1.00 24.09 C
-ATOM 1276 CG ASP A 171 22.500 -24.534 36.202 1.00 37.12 C
-ATOM 1277 OD1 ASP A 171 22.150 -25.716 36.302 1.00 39.08 O
-ATOM 1278 OD2 ASP A 171 23.325 -24.134 35.385 1.00 63.64 O
-ATOM 1279 N SER A 172 19.937 -23.309 39.769 1.00 28.50 N
-ATOM 1280 CA SER A 172 19.500 -22.508 40.890 1.00 29.34 C
-ATOM 1281 C SER A 172 20.603 -21.582 41.329 1.00 19.80 C
-ATOM 1282 O SER A 172 21.745 -22.025 41.398 1.00 27.09 O
-ATOM 1283 CB SER A 172 19.152 -23.383 42.069 1.00 25.55 C
-ATOM 1284 OG SER A 172 18.727 -22.499 43.089 1.00 28.00 O
-ATOM 1285 N PRO A 173 20.365 -20.329 41.698 1.00 23.04 N
-ATOM 1286 CA PRO A 173 21.386 -19.495 42.291 1.00 24.44 C
-ATOM 1287 C PRO A 173 21.652 -19.986 43.713 1.00 46.59 C
-ATOM 1288 O PRO A 173 22.743 -19.708 44.184 1.00 45.87 O
-ATOM 1289 CB PRO A 173 20.825 -18.111 42.244 1.00 21.93 C
-ATOM 1290 CG PRO A 173 19.367 -18.345 42.486 1.00 24.05 C
-ATOM 1291 CD PRO A 173 19.060 -19.699 41.802 1.00 23.65 C
-ATOM 1292 N ASP A 174 20.755 -20.703 44.425 1.00 32.74 N
-ATOM 1293 CA ASP A 174 21.015 -21.137 45.794 1.00 29.56 C
-ATOM 1294 C ASP A 174 20.241 -22.413 46.005 1.00 19.81 C
-ATOM 1295 O ASP A 174 19.009 -22.376 46.189 1.00 27.36 O
-ATOM 1296 CB ASP A 174 20.540 -20.070 46.777 1.00 37.96 C
-ATOM 1297 CG ASP A 174 20.907 -20.292 48.261 1.00 44.06 C
-ATOM 1298 OD1 ASP A 174 21.200 -21.404 48.694 1.00 35.40 O
-ATOM 1299 OD2 ASP A 174 20.893 -19.320 49.006 1.00 47.06 O
-ATOM 1300 N THR A 175 20.975 -23.537 46.006 1.00 25.91 N
-ATOM 1301 CA THR A 175 20.332 -24.837 46.136 1.00 31.18 C
-ATOM 1302 C THR A 175 19.824 -25.196 47.551 1.00 37.44 C
-ATOM 1303 O THR A 175 19.134 -26.220 47.700 1.00 34.89 O
-ATOM 1304 CB THR A 175 21.284 -25.941 45.576 1.00 35.52 C
-ATOM 1305 OG1 THR A 175 22.537 -25.807 46.225 1.00 41.72 O
-ATOM 1306 CG2 THR A 175 21.422 -25.836 44.040 1.00 30.09 C
-ATOM 1307 N ALA A 176 20.096 -24.349 48.577 1.00 36.77 N
-ATOM 1308 CA ALA A 176 19.430 -24.459 49.880 1.00 34.55 C
-ATOM 1309 C ALA A 176 18.005 -23.977 49.703 1.00 34.09 C
-ATOM 1310 O ALA A 176 17.077 -24.499 50.335 1.00 32.18 O
-ATOM 1311 CB ALA A 176 20.016 -23.557 50.947 1.00 29.40 C
-ATOM 1312 N LEU A 177 17.824 -22.983 48.808 1.00 25.68 N
-ATOM 1313 CA LEU A 177 16.506 -22.431 48.562 1.00 24.25 C
-ATOM 1314 C LEU A 177 15.700 -23.029 47.398 1.00 30.49 C
-ATOM 1315 O LEU A 177 14.464 -23.081 47.479 1.00 25.58 O
-ATOM 1316 CB LEU A 177 16.683 -20.949 48.375 1.00 34.03 C
-ATOM 1317 CG LEU A 177 17.151 -20.199 49.612 1.00 41.02 C
-ATOM 1318 CD1 LEU A 177 17.335 -18.758 49.257 1.00 40.73 C
-ATOM 1319 CD2 LEU A 177 16.116 -20.270 50.711 1.00 41.14 C
-ATOM 1320 N MET A 178 16.328 -23.506 46.315 1.00 27.88 N
-ATOM 1321 CA MET A 178 15.605 -24.068 45.157 1.00 24.64 C
-ATOM 1322 C MET A 178 16.543 -25.061 44.535 1.00 15.20 C
-ATOM 1323 O MET A 178 17.697 -24.725 44.299 1.00 22.04 O
-ATOM 1324 CB MET A 178 15.272 -22.965 44.134 1.00 24.97 C
-ATOM 1325 CG MET A 178 14.350 -23.526 43.050 1.00 37.40 C
-ATOM 1326 SD MET A 178 14.025 -22.325 41.726 1.00 34.16 S
-ATOM 1327 CE MET A 178 15.624 -22.293 40.939 1.00 28.69 C
-ATOM 1328 N ALA A 179 16.135 -26.306 44.380 1.00 18.97 N
-ATOM 1329 CA ALA A 179 16.960 -27.343 43.800 1.00 21.25 C
-ATOM 1330 C ALA A 179 17.175 -27.052 42.312 1.00 32.90 C
-ATOM 1331 O ALA A 179 16.345 -26.407 41.660 1.00 23.82 O
-ATOM 1332 CB ALA A 179 16.276 -28.705 43.867 1.00 19.86 C
-ATOM 1333 N ASP A 180 18.275 -27.497 41.758 1.00 25.51 N
-ATOM 1334 CA ASP A 180 18.459 -27.512 40.305 1.00 29.77 C
-ATOM 1335 C ASP A 180 17.437 -28.418 39.632 1.00 35.87 C
-ATOM 1336 O ASP A 180 17.017 -29.425 40.230 1.00 25.57 O
-ATOM 1337 CB ASP A 180 19.804 -28.048 39.948 1.00 22.82 C
-ATOM 1338 CG ASP A 180 20.966 -27.176 40.326 1.00 19.28 C
-ATOM 1339 OD1 ASP A 180 20.783 -25.984 40.534 1.00 24.24 O
-ATOM 1340 OD2 ASP A 180 22.072 -27.706 40.385 1.00 34.46 O
-ATOM 1341 N MET A 181 17.040 -28.135 38.384 1.00 21.42 N
-ATOM 1342 CA MET A 181 16.020 -28.935 37.732 1.00 19.55 C
-ATOM 1343 C MET A 181 16.540 -29.368 36.348 1.00 26.26 C
-ATOM 1344 O MET A 181 17.428 -28.705 35.790 1.00 23.03 O
-ATOM 1345 CB MET A 181 14.741 -28.115 37.558 1.00 20.30 C
-ATOM 1346 CG MET A 181 14.208 -27.429 38.832 1.00 22.93 C
-ATOM 1347 SD MET A 181 12.538 -26.784 38.747 1.00 27.32 S
-ATOM 1348 CE MET A 181 13.039 -25.172 39.188 1.00 22.23 C
-ATOM 1349 N GLU A 182 16.055 -30.464 35.782 1.00 23.25 N
-ATOM 1350 CA GLU A 182 16.419 -30.849 34.433 1.00 28.22 C
-ATOM 1351 C GLU A 182 15.314 -31.697 33.888 1.00 22.99 C
-ATOM 1352 O GLU A 182 14.491 -32.218 34.658 1.00 23.60 O
-ATOM 1353 CB GLU A 182 17.693 -31.633 34.372 1.00 27.70 C
-ATOM 1354 CG GLU A 182 17.653 -32.917 35.150 1.00 39.91 C
-ATOM 1355 CD GLU A 182 18.798 -33.865 34.827 1.00 49.50 C
-ATOM 1356 OE1 GLU A 182 19.958 -33.436 34.775 1.00 46.27 O
-ATOM 1357 OE2 GLU A 182 18.494 -35.043 34.614 1.00 81.45 O
-ATOM 1358 N GLN A 183 15.218 -31.801 32.555 1.00 23.57 N
-ATOM 1359 CA GLN A 183 14.186 -32.607 31.917 1.00 20.27 C
-ATOM 1360 C GLN A 183 14.734 -33.027 30.559 1.00 24.71 C
-ATOM 1361 O GLN A 183 15.397 -32.226 29.892 1.00 25.60 O
-ATOM 1362 CB GLN A 183 12.923 -31.774 31.752 1.00 21.67 C
-ATOM 1363 CG GLN A 183 11.739 -32.520 31.215 1.00 22.57 C
-ATOM 1364 CD GLN A 183 10.536 -31.621 31.271 1.00 34.59 C
-ATOM 1365 OE1 GLN A 183 10.031 -31.397 32.344 1.00 33.27 O
-ATOM 1366 NE2 GLN A 183 9.947 -31.040 30.243 1.00 26.73 N
-ATOM 1367 N LEU A 184 14.506 -34.276 30.212 1.00 25.90 N
-ATOM 1368 CA LEU A 184 14.900 -34.830 28.935 1.00 25.47 C
-ATOM 1369 C LEU A 184 13.623 -35.127 28.194 1.00 30.93 C
-ATOM 1370 O LEU A 184 12.692 -35.640 28.813 1.00 29.59 O
-ATOM 1371 CB LEU A 184 15.656 -36.119 29.106 1.00 30.36 C
-ATOM 1372 CG LEU A 184 16.019 -36.860 27.796 1.00 53.58 C
-ATOM 1373 CD1 LEU A 184 17.325 -36.325 27.169 1.00 41.36 C
-ATOM 1374 CD2 LEU A 184 16.137 -38.333 28.120 1.00 61.50 C
-ATOM 1375 N GLU A 185 13.503 -34.832 26.895 1.00 24.93 N
-ATOM 1376 CA GLU A 185 12.284 -35.106 26.139 1.00 21.56 C
-ATOM 1377 C GLU A 185 12.589 -35.929 24.871 1.00 20.96 C
-ATOM 1378 O GLU A 185 13.661 -35.744 24.270 1.00 25.62 O
-ATOM 1379 CB GLU A 185 11.596 -33.838 25.621 1.00 28.40 C
-ATOM 1380 CG GLU A 185 11.036 -32.816 26.599 1.00 33.30 C
-ATOM 1381 CD GLU A 185 11.903 -31.609 26.892 1.00 31.54 C
-ATOM 1382 OE1 GLU A 185 12.775 -31.231 26.123 1.00 27.29 O
-ATOM 1383 OE2 GLU A 185 11.691 -31.016 27.928 1.00 25.85 O
-ATOM 1384 N LEU A 186 11.646 -36.789 24.489 1.00 24.15 N
-ATOM 1385 CA LEU A 186 11.653 -37.500 23.212 1.00 28.00 C
-ATOM 1386 C LEU A 186 10.327 -37.093 22.629 1.00 28.26 C
-ATOM 1387 O LEU A 186 9.305 -37.108 23.330 1.00 29.09 O
-ATOM 1388 CB LEU A 186 11.600 -39.020 23.305 1.00 30.48 C
-ATOM 1389 CG LEU A 186 12.737 -39.599 24.072 1.00 49.76 C
-ATOM 1390 CD1 LEU A 186 12.437 -41.058 24.322 1.00 56.71 C
-ATOM 1391 CD2 LEU A 186 14.029 -39.335 23.332 1.00 41.46 C
-ATOM 1392 N ALA A 187 10.310 -36.701 21.364 1.00 23.92 N
-ATOM 1393 CA ALA A 187 9.078 -36.291 20.743 1.00 23.34 C
-ATOM 1394 C ALA A 187 9.031 -36.945 19.363 1.00 27.75 C
-ATOM 1395 O ALA A 187 10.069 -37.214 18.757 1.00 26.70 O
-ATOM 1396 CB ALA A 187 9.074 -34.777 20.610 1.00 24.93 C
-ATOM 1397 N ALA A 188 7.853 -37.216 18.873 1.00 25.88 N
-ATOM 1398 CA ALA A 188 7.663 -37.789 17.563 1.00 34.01 C
-ATOM 1399 C ALA A 188 6.512 -37.031 16.935 1.00 33.31 C
-ATOM 1400 O ALA A 188 5.540 -36.744 17.644 1.00 29.55 O
-ATOM 1401 CB ALA A 188 7.278 -39.264 17.674 1.00 26.52 C
-ATOM 1402 N ILE A 189 6.550 -36.671 15.649 1.00 36.39 N
-ATOM 1403 CA ILE A 189 5.415 -36.037 14.968 1.00 27.67 C
-ATOM 1404 C ILE A 189 5.231 -36.770 13.625 1.00 37.92 C
-ATOM 1405 O ILE A 189 6.221 -37.089 12.968 1.00 33.44 O
-ATOM 1406 CB ILE A 189 5.690 -34.555 14.703 1.00 29.72 C
-ATOM 1407 CG1 ILE A 189 5.971 -33.831 15.991 1.00 39.00 C
-ATOM 1408 CG2 ILE A 189 4.471 -33.934 14.052 1.00 33.27 C
-ATOM 1409 CD1 ILE A 189 7.077 -32.793 15.839 1.00 38.17 C
-ATOM 1410 N ALA A 190 4.005 -37.054 13.215 1.00 34.42 N
-ATOM 1411 CA ALA A 190 3.697 -37.834 12.044 1.00 33.15 C
-ATOM 1412 C ALA A 190 2.509 -37.223 11.388 1.00 43.94 C
-ATOM 1413 O ALA A 190 1.528 -36.880 12.068 1.00 36.50 O
-ATOM 1414 CB ALA A 190 3.273 -39.248 12.368 1.00 29.97 C
-ATOM 1415 N LYS A 191 2.600 -37.037 10.076 1.00 49.78 N
-ATOM 1416 CA LYS A 191 1.414 -36.648 9.317 1.00 48.56 C
-ATOM 1417 C LYS A 191 1.095 -37.790 8.400 1.00 51.68 C
-ATOM 1418 O LYS A 191 1.979 -38.318 7.727 1.00 65.27 O
-ATOM 1419 CB LYS A 191 1.596 -35.413 8.439 1.00 49.42 C
-ATOM 1420 CG LYS A 191 2.988 -35.255 7.842 1.00 75.96 C
-ATOM 1421 CD LYS A 191 3.450 -33.831 8.138 1.00 86.39 C
-ATOM 1422 CE LYS A 191 3.796 -33.646 9.617 1.00 88.43 C
-ATOM 1423 NZ LYS A 191 3.690 -32.249 10.002 1.00 91.69 N
-ATOM 1424 N PHE A 192 -0.144 -38.241 8.423 1.00 57.59 N
-ATOM 1425 CA PHE A 192 -0.631 -39.312 7.574 1.00 49.63 C
-ATOM 1426 C PHE A 192 -1.764 -38.691 6.778 1.00 55.22 C
-ATOM 1427 O PHE A 192 -2.963 -38.943 6.982 1.00 60.13 O
-ATOM 1428 CB PHE A 192 -1.160 -40.470 8.406 1.00 52.90 C
-ATOM 1429 CG PHE A 192 -0.106 -41.110 9.279 1.00 55.44 C
-ATOM 1430 CD1 PHE A 192 1.159 -41.341 8.773 1.00 63.13 C
-ATOM 1431 CD2 PHE A 192 -0.444 -41.441 10.573 1.00 62.68 C
-ATOM 1432 CE1 PHE A 192 2.102 -41.910 9.584 1.00 71.79 C
-ATOM 1433 CE2 PHE A 192 0.510 -42.012 11.376 1.00 64.06 C
-ATOM 1434 CZ PHE A 192 1.776 -42.244 10.882 1.00 66.40 C
-ATOM 1435 N GLY A 193 -1.361 -37.770 5.903 1.00 53.26 N
-ATOM 1436 CA GLY A 193 -2.343 -37.079 5.097 1.00 64.96 C
-ATOM 1437 C GLY A 193 -3.109 -36.029 5.906 1.00 72.86 C
-ATOM 1438 O GLY A 193 -2.497 -35.117 6.471 1.00 83.89 O
-ATOM 1439 N ALA A 194 -4.437 -36.170 6.010 1.00 65.54 N
-ATOM 1440 CA ALA A 194 -5.274 -35.195 6.707 1.00 58.81 C
-ATOM 1441 C ALA A 194 -5.139 -35.243 8.241 1.00 53.68 C
-ATOM 1442 O ALA A 194 -5.696 -34.378 8.931 1.00 41.71 O
-ATOM 1443 CB ALA A 194 -6.725 -35.456 6.319 1.00 56.03 C
-ATOM 1444 N THR A 195 -4.446 -36.286 8.739 1.00 51.68 N
-ATOM 1445 CA THR A 195 -4.191 -36.606 10.142 1.00 43.81 C
-ATOM 1446 C THR A 195 -2.808 -36.267 10.679 1.00 45.19 C
-ATOM 1447 O THR A 195 -1.786 -36.640 10.106 1.00 37.22 O
-ATOM 1448 CB THR A 195 -4.464 -38.101 10.326 1.00 33.57 C
-ATOM 1449 OG1 THR A 195 -5.800 -38.272 9.841 1.00 41.80 O
-ATOM 1450 CG2 THR A 195 -4.342 -38.606 11.756 1.00 33.82 C
-ATOM 1451 N ASN A 196 -2.749 -35.582 11.812 1.00 33.40 N
-ATOM 1452 CA ASN A 196 -1.485 -35.230 12.428 1.00 34.17 C
-ATOM 1453 C ASN A 196 -1.419 -35.980 13.746 1.00 26.07 C
-ATOM 1454 O ASN A 196 -2.456 -36.072 14.427 1.00 31.07 O
-ATOM 1455 CB ASN A 196 -1.462 -33.757 12.688 1.00 34.94 C
-ATOM 1456 CG ASN A 196 -1.494 -32.946 11.405 1.00 37.97 C
-ATOM 1457 OD1 ASN A 196 -0.518 -32.901 10.654 1.00 38.93 O
-ATOM 1458 ND2 ASN A 196 -2.596 -32.276 11.098 1.00 35.68 N
-ATOM 1459 N VAL A 197 -0.292 -36.559 14.121 1.00 27.67 N
-ATOM 1460 CA VAL A 197 -0.188 -37.257 15.380 1.00 27.06 C
-ATOM 1461 C VAL A 197 1.051 -36.667 16.017 1.00 32.58 C
-ATOM 1462 O VAL A 197 2.038 -36.440 15.321 1.00 35.46 O
-ATOM 1463 CB VAL A 197 -0.021 -38.766 15.163 1.00 26.96 C
-ATOM 1464 CG1 VAL A 197 0.146 -39.477 16.495 1.00 31.44 C
-ATOM 1465 CG2 VAL A 197 -1.285 -39.339 14.562 1.00 30.72 C
-ATOM 1466 N LYS A 198 1.028 -36.336 17.304 1.00 28.97 N
-ATOM 1467 CA LYS A 198 2.191 -35.794 17.991 1.00 23.59 C
-ATOM 1468 C LYS A 198 2.177 -36.537 19.331 1.00 20.72 C
-ATOM 1469 O LYS A 198 1.100 -36.798 19.904 1.00 25.42 O
-ATOM 1470 CB LYS A 198 2.030 -34.282 18.191 1.00 22.91 C
-ATOM 1471 CG LYS A 198 3.317 -33.727 18.781 1.00 31.46 C
-ATOM 1472 CD LYS A 198 3.327 -32.223 18.990 1.00 27.19 C
-ATOM 1473 CE LYS A 198 3.301 -31.529 17.642 1.00 27.71 C
-ATOM 1474 NZ LYS A 198 3.444 -30.081 17.745 1.00 22.82 N
-ATOM 1475 N ALA A 199 3.360 -36.920 19.792 1.00 23.92 N
-ATOM 1476 CA ALA A 199 3.512 -37.643 21.050 1.00 29.51 C
-ATOM 1477 C ALA A 199 4.826 -37.264 21.694 1.00 31.31 C
-ATOM 1478 O ALA A 199 5.773 -36.903 20.976 1.00 27.54 O
-ATOM 1479 CB ALA A 199 3.547 -39.137 20.831 1.00 29.98 C
-ATOM 1480 N TYR A 200 4.948 -37.287 23.029 1.00 24.08 N
-ATOM 1481 CA TYR A 200 6.232 -36.978 23.647 1.00 25.77 C
-ATOM 1482 C TYR A 200 6.312 -37.781 24.957 1.00 19.77 C
-ATOM 1483 O TYR A 200 5.285 -38.229 25.471 1.00 25.09 O
-ATOM 1484 CB TYR A 200 6.366 -35.468 23.965 1.00 21.68 C
-ATOM 1485 CG TYR A 200 5.449 -35.011 25.114 1.00 27.89 C
-ATOM 1486 CD1 TYR A 200 4.100 -34.740 24.906 1.00 23.60 C
-ATOM 1487 CD2 TYR A 200 5.979 -34.928 26.414 1.00 26.80 C
-ATOM 1488 CE1 TYR A 200 3.280 -34.398 25.985 1.00 21.78 C
-ATOM 1489 CE2 TYR A 200 5.167 -34.592 27.493 1.00 21.58 C
-ATOM 1490 CZ TYR A 200 3.825 -34.331 27.276 1.00 29.96 C
-ATOM 1491 OH TYR A 200 3.038 -34.016 28.377 1.00 24.28 O
-ATOM 1492 N TYR A 201 7.499 -37.895 25.487 1.00 22.60 N
-ATOM 1493 CA TYR A 201 7.706 -38.468 26.778 1.00 24.74 C
-ATOM 1494 C TYR A 201 8.768 -37.559 27.381 1.00 26.88 C
-ATOM 1495 O TYR A 201 9.741 -37.191 26.708 1.00 24.56 O
-ATOM 1496 CB TYR A 201 8.194 -39.901 26.603 1.00 25.19 C
-ATOM 1497 CG TYR A 201 8.675 -40.448 27.936 1.00 34.01 C
-ATOM 1498 CD1 TYR A 201 7.727 -40.932 28.815 1.00 36.14 C
-ATOM 1499 CD2 TYR A 201 10.031 -40.414 28.250 1.00 34.68 C
-ATOM 1500 CE1 TYR A 201 8.137 -41.392 30.041 1.00 36.17 C
-ATOM 1501 CE2 TYR A 201 10.442 -40.870 29.481 1.00 35.36 C
-ATOM 1502 CZ TYR A 201 9.481 -41.356 30.357 1.00 36.59 C
-ATOM 1503 OH TYR A 201 9.869 -41.825 31.601 1.00 56.03 O
-ATOM 1504 N ALA A 202 8.630 -37.196 28.663 1.00 27.52 N
-ATOM 1505 CA ALA A 202 9.600 -36.329 29.339 1.00 25.10 C
-ATOM 1506 C ALA A 202 9.877 -36.931 30.722 1.00 25.08 C
-ATOM 1507 O ALA A 202 8.982 -37.486 31.356 1.00 25.54 O
-ATOM 1508 CB ALA A 202 9.058 -34.895 29.564 1.00 22.21 C
-ATOM 1509 N ASP A 203 11.085 -36.782 31.198 1.00 24.00 N
-ATOM 1510 CA ASP A 203 11.489 -37.363 32.447 1.00 28.68 C
-ATOM 1511 C ASP A 203 12.535 -36.459 33.079 1.00 29.57 C
-ATOM 1512 O ASP A 203 13.419 -35.951 32.363 1.00 32.82 O
-ATOM 1513 CB ASP A 203 12.041 -38.754 32.119 1.00 37.41 C
-ATOM 1514 CG ASP A 203 12.421 -39.547 33.336 1.00 48.02 C
-ATOM 1515 OD1 ASP A 203 11.555 -40.148 33.968 1.00 75.41 O
-ATOM 1516 OD2 ASP A 203 13.595 -39.536 33.663 1.00 67.85 O
-ATOM 1517 N GLY A 204 12.517 -36.218 34.397 1.00 32.61 N
-ATOM 1518 CA GLY A 204 13.595 -35.437 34.988 1.00 28.05 C
-ATOM 1519 C GLY A 204 13.367 -35.210 36.468 1.00 28.93 C
-ATOM 1520 O GLY A 204 12.778 -36.061 37.158 1.00 27.42 O
-ATOM 1521 N GLU A 205 13.792 -34.049 36.946 1.00 23.03 N
-ATOM 1522 CA GLU A 205 13.529 -33.721 38.332 1.00 27.54 C
-ATOM 1523 C GLU A 205 13.293 -32.246 38.482 1.00 28.34 C
-ATOM 1524 O GLU A 205 13.832 -31.424 37.742 1.00 25.57 O
-ATOM 1525 CB GLU A 205 14.677 -34.139 39.236 1.00 27.61 C
-ATOM 1526 CG GLU A 205 15.986 -33.454 38.992 1.00 43.67 C
-ATOM 1527 CD GLU A 205 17.151 -34.034 39.790 1.00 51.38 C
-ATOM 1528 OE1 GLU A 205 17.227 -35.262 39.922 1.00 51.17 O
-ATOM 1529 OE2 GLU A 205 17.983 -33.235 40.248 1.00 66.67 O
-ATOM 1530 N LEU A 206 12.434 -31.947 39.450 1.00 21.41 N
-ATOM 1531 CA LEU A 206 11.951 -30.610 39.719 1.00 19.79 C
-ATOM 1532 C LEU A 206 12.248 -30.216 41.161 1.00 33.84 C
-ATOM 1533 O LEU A 206 12.428 -31.096 42.002 1.00 26.21 O
-ATOM 1534 CB LEU A 206 10.459 -30.554 39.522 1.00 20.83 C
-ATOM 1535 CG LEU A 206 9.898 -30.808 38.130 1.00 25.89 C
-ATOM 1536 CD1 LEU A 206 8.383 -30.698 38.181 1.00 25.84 C
-ATOM 1537 CD2 LEU A 206 10.522 -29.805 37.148 1.00 21.85 C
-ATOM 1538 N ASP A 207 12.317 -28.920 41.474 1.00 24.31 N
-ATOM 1539 CA ASP A 207 12.413 -28.443 42.833 1.00 26.55 C
-ATOM 1540 C ASP A 207 11.104 -28.863 43.501 1.00 29.31 C
-ATOM 1541 O ASP A 207 10.014 -28.742 42.920 1.00 22.97 O
-ATOM 1542 CB ASP A 207 12.536 -26.942 42.841 1.00 22.03 C
-ATOM 1543 CG ASP A 207 12.384 -26.355 44.241 1.00 23.24 C
-ATOM 1544 OD1 ASP A 207 13.308 -26.532 45.038 1.00 24.98 O
-ATOM 1545 OD2 ASP A 207 11.350 -25.751 44.519 1.00 24.03 O
-ATOM 1546 N ARG A 208 11.204 -29.311 44.760 1.00 26.76 N
-ATOM 1547 CA ARG A 208 10.052 -29.752 45.541 1.00 22.68 C
-ATOM 1548 C ARG A 208 8.952 -28.731 45.619 1.00 17.48 C
-ATOM 1549 O ARG A 208 7.799 -29.036 45.306 1.00 22.76 O
-ATOM 1550 CB ARG A 208 10.450 -30.093 46.997 1.00 24.59 C
-ATOM 1551 CG ARG A 208 9.280 -30.540 47.905 1.00 26.44 C
-ATOM 1552 CD ARG A 208 9.711 -30.470 49.382 1.00 20.80 C
-ATOM 1553 NE ARG A 208 9.912 -29.091 49.803 1.00 20.58 N
-ATOM 1554 CZ ARG A 208 11.067 -28.707 50.348 1.00 17.56 C
-ATOM 1555 NH1 ARG A 208 12.081 -29.547 50.557 1.00 22.76 N
-ATOM 1556 NH2 ARG A 208 11.220 -27.432 50.651 1.00 19.37 N
-ATOM 1557 N ASP A 209 9.283 -27.519 46.063 1.00 16.79 N
-ATOM 1558 CA ASP A 209 8.224 -26.561 46.241 1.00 17.98 C
-ATOM 1559 C ASP A 209 7.692 -26.008 44.913 1.00 25.82 C
-ATOM 1560 O ASP A 209 6.514 -25.676 44.824 1.00 23.17 O
-ATOM 1561 CB ASP A 209 8.746 -25.456 47.156 1.00 24.37 C
-ATOM 1562 CG ASP A 209 8.958 -25.951 48.609 1.00 28.77 C
-ATOM 1563 OD1 ASP A 209 8.332 -26.917 49.039 1.00 22.89 O
-ATOM 1564 OD2 ASP A 209 9.773 -25.356 49.292 1.00 27.21 O
-ATOM 1565 N PHE A 210 8.491 -25.966 43.857 1.00 24.91 N
-ATOM 1566 CA PHE A 210 7.994 -25.609 42.515 1.00 27.45 C
-ATOM 1567 C PHE A 210 6.967 -26.694 42.077 1.00 21.30 C
-ATOM 1568 O PHE A 210 5.830 -26.381 41.667 1.00 22.41 O
-ATOM 1569 CB PHE A 210 9.258 -25.511 41.609 1.00 24.74 C
-ATOM 1570 CG PHE A 210 9.033 -25.362 40.108 1.00 36.77 C
-ATOM 1571 CD1 PHE A 210 8.844 -26.489 39.318 1.00 36.73 C
-ATOM 1572 CD2 PHE A 210 9.010 -24.107 39.535 1.00 48.62 C
-ATOM 1573 CE1 PHE A 210 8.629 -26.361 37.958 1.00 42.01 C
-ATOM 1574 CE2 PHE A 210 8.796 -23.984 38.169 1.00 38.96 C
-ATOM 1575 CZ PHE A 210 8.605 -25.107 37.388 1.00 34.54 C
-ATOM 1576 N ALA A 211 7.288 -27.989 42.248 1.00 18.70 N
-ATOM 1577 CA ALA A 211 6.367 -29.070 41.962 1.00 17.41 C
-ATOM 1578 C ALA A 211 5.078 -28.999 42.740 1.00 21.61 C
-ATOM 1579 O ALA A 211 3.986 -29.206 42.197 1.00 23.50 O
-ATOM 1580 CB ALA A 211 7.087 -30.370 42.259 1.00 20.52 C
-ATOM 1581 N ARG A 212 5.119 -28.675 44.039 1.00 24.46 N
-ATOM 1582 CA ARG A 212 3.907 -28.580 44.840 1.00 21.96 C
-ATOM 1583 C ARG A 212 3.031 -27.442 44.354 1.00 20.18 C
-ATOM 1584 O ARG A 212 1.803 -27.553 44.346 1.00 23.86 O
-ATOM 1585 CB ARG A 212 4.259 -28.343 46.321 1.00 19.67 C
-ATOM 1586 CG ARG A 212 5.020 -29.538 46.960 1.00 22.71 C
-ATOM 1587 CD ARG A 212 5.446 -29.292 48.472 1.00 23.65 C
-ATOM 1588 NE ARG A 212 4.273 -28.986 49.277 1.00 20.64 N
-ATOM 1589 CZ ARG A 212 3.513 -29.926 49.838 1.00 19.45 C
-ATOM 1590 NH1 ARG A 212 3.829 -31.205 49.748 1.00 22.61 N
-ATOM 1591 NH2 ARG A 212 2.434 -29.615 50.517 1.00 22.43 N
-ATOM 1592 N ALA A 213 3.637 -26.328 43.942 1.00 22.64 N
-ATOM 1593 CA ALA A 213 2.875 -25.177 43.421 1.00 24.94 C
-ATOM 1594 C ALA A 213 2.142 -25.528 42.113 1.00 28.90 C
-ATOM 1595 O ALA A 213 1.063 -24.985 41.886 1.00 28.23 O
-ATOM 1596 CB ALA A 213 3.804 -23.997 43.173 1.00 18.67 C
-ATOM 1597 N VAL A 214 2.628 -26.470 41.272 1.00 27.53 N
-ATOM 1598 CA VAL A 214 1.899 -26.961 40.096 1.00 24.66 C
-ATOM 1599 C VAL A 214 0.549 -27.454 40.554 1.00 28.81 C
-ATOM 1600 O VAL A 214 -0.439 -27.180 39.876 1.00 36.46 O
-ATOM 1601 CB VAL A 214 2.580 -28.169 39.376 1.00 28.48 C
-ATOM 1602 CG1 VAL A 214 1.708 -28.805 38.273 1.00 34.90 C
-ATOM 1603 CG2 VAL A 214 3.853 -27.658 38.787 1.00 30.97 C
-ATOM 1604 N PHE A 215 0.479 -28.167 41.701 1.00 30.95 N
-ATOM 1605 CA PHE A 215 -0.780 -28.734 42.192 1.00 22.46 C
-ATOM 1606 C PHE A 215 -1.475 -27.849 43.206 1.00 22.21 C
-ATOM 1607 O PHE A 215 -2.456 -28.240 43.854 1.00 31.72 O
-ATOM 1608 CB PHE A 215 -0.532 -30.139 42.785 1.00 25.11 C
-ATOM 1609 CG PHE A 215 -0.220 -31.216 41.740 1.00 24.68 C
-ATOM 1610 CD1 PHE A 215 -1.257 -31.912 41.157 1.00 29.63 C
-ATOM 1611 CD2 PHE A 215 1.084 -31.461 41.357 1.00 33.02 C
-ATOM 1612 CE1 PHE A 215 -0.979 -32.845 40.185 1.00 29.05 C
-ATOM 1613 CE2 PHE A 215 1.353 -32.394 40.383 1.00 34.93 C
-ATOM 1614 CZ PHE A 215 0.323 -33.079 39.802 1.00 28.48 C
-ATOM 1615 N ASP A 216 -0.985 -26.613 43.281 1.00 21.70 N
-ATOM 1616 CA ASP A 216 -1.535 -25.593 44.127 1.00 28.43 C
-ATOM 1617 C ASP A 216 -1.438 -25.965 45.612 1.00 31.75 C
-ATOM 1618 O ASP A 216 -2.385 -25.730 46.383 1.00 34.20 O
-ATOM 1619 CB ASP A 216 -2.975 -25.386 43.685 1.00 30.70 C
-ATOM 1620 CG ASP A 216 -3.447 -23.971 43.857 1.00 58.07 C
-ATOM 1621 OD1 ASP A 216 -2.615 -23.066 43.765 1.00 71.62 O
-ATOM 1622 OD2 ASP A 216 -4.644 -23.792 44.079 1.00 83.68 O
-ATOM 1623 N LEU A 217 -0.302 -26.558 45.999 1.00 27.44 N
-ATOM 1624 CA LEU A 217 -0.097 -27.045 47.363 1.00 27.84 C
-ATOM 1625 C LEU A 217 0.868 -26.098 48.046 1.00 27.78 C
-ATOM 1626 O LEU A 217 1.775 -25.587 47.365 1.00 26.69 O
-ATOM 1627 CB LEU A 217 0.482 -28.462 47.339 1.00 22.43 C
-ATOM 1628 CG LEU A 217 -0.368 -29.545 46.687 1.00 21.31 C
-ATOM 1629 CD1 LEU A 217 0.425 -30.812 46.668 1.00 20.93 C
-ATOM 1630 CD2 LEU A 217 -1.675 -29.707 47.397 1.00 24.17 C
-ATOM 1631 N THR A 218 0.654 -25.760 49.335 1.00 24.26 N
-ATOM 1632 CA THR A 218 1.603 -24.878 50.056 1.00 27.38 C
-ATOM 1633 C THR A 218 2.998 -25.499 50.095 1.00 19.15 C
-ATOM 1634 O THR A 218 3.123 -26.738 50.111 1.00 25.68 O
-ATOM 1635 CB THR A 218 1.172 -24.558 51.583 1.00 30.12 C
-ATOM 1636 OG1 THR A 218 0.441 -25.619 52.157 1.00 46.14 O
-ATOM 1637 CG2 THR A 218 0.361 -23.302 51.629 1.00 61.20 C
-ATOM 1638 N PRO A 219 4.068 -24.709 50.157 1.00 21.50 N
-ATOM 1639 CA PRO A 219 5.423 -25.218 50.277 1.00 23.92 C
-ATOM 1640 C PRO A 219 5.713 -25.861 51.643 1.00 32.60 C
-ATOM 1641 O PRO A 219 4.957 -25.603 52.600 1.00 29.02 O
-ATOM 1642 CB PRO A 219 6.264 -24.003 49.999 1.00 26.19 C
-ATOM 1643 CG PRO A 219 5.428 -22.849 50.465 1.00 25.43 C
-ATOM 1644 CD PRO A 219 4.030 -23.251 50.079 1.00 20.73 C
-ATOM 1645 N VAL A 220 6.764 -26.694 51.739 1.00 33.44 N
-ATOM 1646 CA VAL A 220 7.141 -27.212 53.041 1.00 28.14 C
-ATOM 1647 C VAL A 220 8.321 -26.376 53.539 1.00 37.97 C
-ATOM 1648 O VAL A 220 9.198 -25.938 52.775 1.00 26.48 O
-ATOM 1649 CB VAL A 220 7.474 -28.788 53.044 1.00 32.32 C
-ATOM 1650 CG1 VAL A 220 6.828 -29.437 51.860 1.00 24.32 C
-ATOM 1651 CG2 VAL A 220 8.915 -29.093 53.141 1.00 34.39 C
-ATOM 1652 N ALA A 221 8.313 -26.094 54.847 1.00 25.77 N
-ATOM 1653 CA ALA A 221 9.325 -25.258 55.460 1.00 22.75 C
-ATOM 1654 C ALA A 221 10.534 -26.080 55.804 1.00 34.19 C
-ATOM 1655 O ALA A 221 10.722 -26.485 56.955 1.00 35.48 O
-ATOM 1656 CB ALA A 221 8.750 -24.626 56.716 1.00 25.04 C
-ATOM 1657 N ALA A 222 11.347 -26.358 54.787 1.00 25.99 N
-ATOM 1658 CA ALA A 222 12.566 -27.158 54.881 1.00 20.53 C
-ATOM 1659 C ALA A 222 13.474 -26.719 53.755 1.00 27.31 C
-ATOM 1660 O ALA A 222 13.019 -25.985 52.869 1.00 32.70 O
-ATOM 1661 CB ALA A 222 12.334 -28.656 54.664 1.00 17.91 C
-ATOM 1662 N ALA A 223 14.750 -27.089 53.799 1.00 27.27 N
-ATOM 1663 CA ALA A 223 15.696 -26.836 52.713 1.00 33.28 C
-ATOM 1664 C ALA A 223 15.235 -27.607 51.455 1.00 43.31 C
-ATOM 1665 O ALA A 223 14.658 -28.721 51.516 1.00 26.72 O
-ATOM 1666 CB ALA A 223 17.090 -27.326 53.081 1.00 24.82 C
-ATOM 1667 N ALA A 224 15.479 -26.956 50.312 1.00 32.68 N
-ATOM 1668 CA ALA A 224 15.033 -27.446 49.021 1.00 27.30 C
-ATOM 1669 C ALA A 224 15.546 -28.827 48.722 1.00 25.24 C
-ATOM 1670 O ALA A 224 16.683 -29.196 49.031 1.00 29.56 O
-ATOM 1671 CB ALA A 224 15.531 -26.539 47.921 1.00 25.05 C
-ATOM 1672 N THR A 225 14.685 -29.618 48.132 1.00 24.13 N
-ATOM 1673 CA THR A 225 15.074 -30.941 47.687 1.00 25.61 C
-ATOM 1674 C THR A 225 14.543 -31.084 46.261 1.00 36.20 C
-ATOM 1675 O THR A 225 13.669 -30.284 45.868 1.00 26.28 O
-ATOM 1676 CB THR A 225 14.448 -32.041 48.615 1.00 32.35 C
-ATOM 1677 OG1 THR A 225 13.015 -31.944 48.645 1.00 30.23 O
-ATOM 1678 CG2 THR A 225 14.976 -31.857 50.034 1.00 42.70 C
-ATOM 1679 N ALA A 226 15.011 -32.065 45.487 1.00 30.91 N
-ATOM 1680 CA ALA A 226 14.462 -32.311 44.154 1.00 36.76 C
-ATOM 1681 C ALA A 226 13.513 -33.515 44.156 1.00 34.85 C
-ATOM 1682 O ALA A 226 13.738 -34.427 44.952 1.00 40.82 O
-ATOM 1683 CB ALA A 226 15.588 -32.581 43.203 1.00 25.21 C
-ATOM 1684 N VAL A 227 12.415 -33.564 43.381 1.00 31.55 N
-ATOM 1685 CA VAL A 227 11.510 -34.715 43.239 1.00 25.98 C
-ATOM 1686 C VAL A 227 11.584 -35.229 41.797 1.00 37.72 C
-ATOM 1687 O VAL A 227 11.799 -34.425 40.888 1.00 30.25 O
-ATOM 1688 CB VAL A 227 10.031 -34.368 43.536 1.00 26.42 C
-ATOM 1689 CG1 VAL A 227 9.922 -34.313 45.040 1.00 35.42 C
-ATOM 1690 CG2 VAL A 227 9.569 -33.052 42.897 1.00 24.43 C
-ATOM 1691 N ASP A 228 11.438 -36.512 41.495 1.00 28.65 N
-ATOM 1692 CA ASP A 228 11.515 -37.003 40.118 1.00 30.27 C
-ATOM 1693 C ASP A 228 10.189 -36.852 39.473 1.00 27.49 C
-ATOM 1694 O ASP A 228 9.171 -36.951 40.160 1.00 27.44 O
-ATOM 1695 CB ASP A 228 11.888 -38.488 40.051 1.00 29.18 C
-ATOM 1696 CG ASP A 228 13.287 -38.733 40.626 1.00 36.93 C
-ATOM 1697 OD1 ASP A 228 14.240 -38.049 40.232 1.00 60.99 O
-ATOM 1698 OD2 ASP A 228 13.419 -39.588 41.502 1.00 67.40 O
-ATOM 1699 N HIS A 229 10.128 -36.639 38.165 1.00 27.81 N
-ATOM 1700 CA HIS A 229 8.830 -36.503 37.511 1.00 27.57 C
-ATOM 1701 C HIS A 229 8.896 -37.122 36.125 1.00 22.47 C
-ATOM 1702 O HIS A 229 9.984 -37.331 35.560 1.00 25.44 O
-ATOM 1703 CB HIS A 229 8.397 -35.013 37.341 1.00 24.81 C
-ATOM 1704 CG HIS A 229 9.312 -34.181 36.403 1.00 25.52 C
-ATOM 1705 ND1 HIS A 229 10.615 -33.896 36.508 1.00 26.06 N
-ATOM 1706 CD2 HIS A 229 8.872 -33.550 35.242 1.00 26.80 C
-ATOM 1707 CE1 HIS A 229 10.975 -33.137 35.493 1.00 31.27 C
-ATOM 1708 NE2 HIS A 229 9.917 -32.942 34.749 1.00 24.74 N
-ATOM 1709 N LYS A 230 7.707 -37.415 35.634 1.00 25.04 N
-ATOM 1710 CA LYS A 230 7.595 -37.800 34.269 1.00 31.02 C
-ATOM 1711 C LYS A 230 6.333 -37.202 33.715 1.00 29.49 C
-ATOM 1712 O LYS A 230 5.422 -36.866 34.461 1.00 24.54 O
-ATOM 1713 CB LYS A 230 7.587 -39.292 34.172 1.00 26.28 C
-ATOM 1714 CG LYS A 230 6.388 -40.093 34.564 1.00 47.78 C
-ATOM 1715 CD LYS A 230 6.930 -41.543 34.609 1.00 73.52 C
-ATOM 1716 CE LYS A 230 8.071 -41.699 35.655 1.00 89.17 C
-ATOM 1717 NZ LYS A 230 8.899 -42.887 35.501 1.00101.19 N
-ATOM 1718 N ALA A 231 6.307 -36.988 32.407 1.00 28.59 N
-ATOM 1719 CA ALA A 231 5.160 -36.419 31.722 1.00 23.31 C
-ATOM 1720 C ALA A 231 5.135 -37.079 30.339 1.00 23.75 C
-ATOM 1721 O ALA A 231 6.189 -37.406 29.764 1.00 27.95 O
-ATOM 1722 CB ALA A 231 5.364 -34.920 31.575 1.00 23.08 C
-ATOM 1723 N TYR A 232 3.972 -37.375 29.801 1.00 23.45 N
-ATOM 1724 CA TYR A 232 3.874 -37.908 28.445 1.00 32.26 C
-ATOM 1725 C TYR A 232 2.487 -37.605 27.895 1.00 29.25 C
-ATOM 1726 O TYR A 232 1.550 -37.348 28.668 1.00 27.46 O
-ATOM 1727 CB TYR A 232 4.162 -39.439 28.413 1.00 28.02 C
-ATOM 1728 CG TYR A 232 3.494 -40.240 29.515 1.00 27.17 C
-ATOM 1729 CD1 TYR A 232 4.167 -40.375 30.718 1.00 35.93 C
-ATOM 1730 CD2 TYR A 232 2.236 -40.789 29.331 1.00 30.56 C
-ATOM 1731 CE1 TYR A 232 3.571 -41.057 31.753 1.00 40.00 C
-ATOM 1732 CE2 TYR A 232 1.634 -41.488 30.366 1.00 39.00 C
-ATOM 1733 CZ TYR A 232 2.312 -41.611 31.573 1.00 38.48 C
-ATOM 1734 OH TYR A 232 1.717 -42.278 32.642 1.00 56.10 O
-ATOM 1735 N GLY A 233 2.285 -37.561 26.574 1.00 22.51 N
-ATOM 1736 CA GLY A 233 0.985 -37.244 26.014 1.00 24.02 C
-ATOM 1737 C GLY A 233 0.950 -37.507 24.514 1.00 26.25 C
-ATOM 1738 O GLY A 233 1.941 -37.833 23.856 1.00 24.83 O
-ATOM 1739 N LEU A 234 -0.223 -37.323 23.996 1.00 25.95 N
-ATOM 1740 CA LEU A 234 -0.460 -37.640 22.618 1.00 24.03 C
-ATOM 1741 C LEU A 234 -1.584 -36.777 22.103 1.00 28.04 C
-ATOM 1742 O LEU A 234 -2.514 -36.506 22.890 1.00 28.24 O
-ATOM 1743 CB LEU A 234 -0.866 -39.070 22.566 1.00 31.10 C
-ATOM 1744 CG LEU A 234 -1.539 -39.544 21.317 1.00 41.38 C
-ATOM 1745 CD1 LEU A 234 -0.480 -39.786 20.245 1.00 34.15 C
-ATOM 1746 CD2 LEU A 234 -2.356 -40.751 21.648 1.00 42.03 C
-ATOM 1747 N SER A 235 -1.534 -36.329 20.833 1.00 26.13 N
-ATOM 1748 CA SER A 235 -2.724 -35.732 20.265 1.00 25.83 C
-ATOM 1749 C SER A 235 -2.895 -36.213 18.836 1.00 25.93 C
-ATOM 1750 O SER A 235 -1.899 -36.580 18.179 1.00 28.39 O
-ATOM 1751 CB SER A 235 -2.699 -34.190 20.226 1.00 32.71 C
-ATOM 1752 OG SER A 235 -1.734 -33.546 19.431 1.00 30.62 O
-ATOM 1753 N VAL A 236 -4.162 -36.183 18.415 1.00 24.17 N
-ATOM 1754 CA VAL A 236 -4.537 -36.596 17.082 1.00 35.92 C
-ATOM 1755 C VAL A 236 -5.526 -35.562 16.575 1.00 30.98 C
-ATOM 1756 O VAL A 236 -6.478 -35.231 17.299 1.00 29.40 O
-ATOM 1757 CB VAL A 236 -5.242 -37.999 17.076 1.00 37.21 C
-ATOM 1758 CG1 VAL A 236 -5.538 -38.410 15.632 1.00 36.84 C
-ATOM 1759 CG2 VAL A 236 -4.348 -39.079 17.632 1.00 26.11 C
-ATOM 1760 N ASP A 237 -5.348 -35.028 15.361 1.00 32.91 N
-ATOM 1761 CA ASP A 237 -6.394 -34.211 14.758 1.00 25.51 C
-ATOM 1762 C ASP A 237 -6.495 -34.598 13.289 1.00 35.12 C
-ATOM 1763 O ASP A 237 -5.479 -35.003 12.696 1.00 26.89 O
-ATOM 1764 CB ASP A 237 -6.092 -32.730 14.842 1.00 18.52 C
-ATOM 1765 CG ASP A 237 -4.815 -32.240 14.216 1.00 30.05 C
-ATOM 1766 OD1 ASP A 237 -3.766 -32.292 14.847 1.00 32.68 O
-ATOM 1767 OD2 ASP A 237 -4.885 -31.769 13.090 1.00 32.21 O
-ATOM 1768 N SER A 238 -7.670 -34.485 12.706 1.00 26.63 N
-ATOM 1769 CA SER A 238 -7.842 -34.834 11.317 1.00 37.70 C
-ATOM 1770 C SER A 238 -8.823 -33.890 10.690 1.00 32.20 C
-ATOM 1771 O SER A 238 -9.807 -33.469 11.318 1.00 31.51 O
-ATOM 1772 CB SER A 238 -8.377 -36.244 11.179 1.00 41.15 C
-ATOM 1773 OG SER A 238 -8.165 -36.687 9.837 1.00 71.90 O
-ATOM 1774 N THR A 239 -8.540 -33.586 9.431 1.00 36.96 N
-ATOM 1775 CA THR A 239 -9.398 -32.696 8.670 1.00 32.71 C
-ATOM 1776 C THR A 239 -10.155 -33.389 7.544 1.00 36.75 C
-ATOM 1777 O THR A 239 -9.556 -34.067 6.710 1.00 49.53 O
-ATOM 1778 CB THR A 239 -8.536 -31.582 8.106 1.00 32.24 C
-ATOM 1779 OG1 THR A 239 -7.852 -30.961 9.187 1.00 37.41 O
-ATOM 1780 CG2 THR A 239 -9.370 -30.533 7.409 1.00 43.12 C
-ATOM 1781 N PHE A 240 -11.462 -33.214 7.506 1.00 32.39 N
-ATOM 1782 CA PHE A 240 -12.341 -33.703 6.445 1.00 34.60 C
-ATOM 1783 C PHE A 240 -13.163 -32.519 5.907 1.00 35.95 C
-ATOM 1784 O PHE A 240 -14.186 -32.080 6.472 1.00 35.29 O
-ATOM 1785 CB PHE A 240 -13.350 -34.771 6.926 1.00 44.97 C
-ATOM 1786 CG PHE A 240 -13.345 -35.118 8.409 1.00 76.78 C
-ATOM 1787 CD1 PHE A 240 -12.351 -35.948 8.916 1.00 80.80 C
-ATOM 1788 CD2 PHE A 240 -14.340 -34.611 9.227 1.00 80.91 C
-ATOM 1789 CE1 PHE A 240 -12.351 -36.280 10.251 1.00 68.89 C
-ATOM 1790 CE2 PHE A 240 -14.331 -34.950 10.563 1.00 82.55 C
-ATOM 1791 CZ PHE A 240 -13.340 -35.778 11.067 1.00 81.89 C
-ATOM 1792 N GLY A 241 -12.680 -31.948 4.808 1.00 34.25 N
-ATOM 1793 CA GLY A 241 -13.350 -30.824 4.204 1.00 33.96 C
-ATOM 1794 C GLY A 241 -13.040 -29.537 4.968 1.00 29.52 C
-ATOM 1795 O GLY A 241 -11.882 -29.126 5.127 1.00 42.22 O
-ATOM 1796 N ALA A 242 -14.115 -28.897 5.419 1.00 36.46 N
-ATOM 1797 CA ALA A 242 -14.010 -27.686 6.217 1.00 38.95 C
-ATOM 1798 C ALA A 242 -13.882 -28.010 7.720 1.00 32.64 C
-ATOM 1799 O ALA A 242 -13.627 -27.086 8.491 1.00 34.81 O
-ATOM 1800 CB ALA A 242 -15.262 -26.850 5.969 1.00 29.62 C
-ATOM 1801 N THR A 243 -14.038 -29.268 8.161 1.00 28.72 N
-ATOM 1802 CA THR A 243 -14.065 -29.689 9.551 1.00 32.77 C
-ATOM 1803 C THR A 243 -12.794 -30.303 10.043 1.00 38.01 C
-ATOM 1804 O THR A 243 -12.331 -31.287 9.467 1.00 34.60 O
-ATOM 1805 CB THR A 243 -15.173 -30.719 9.790 1.00 29.34 C
-ATOM 1806 OG1 THR A 243 -16.361 -30.152 9.254 1.00 38.80 O
-ATOM 1807 CG2 THR A 243 -15.431 -31.019 11.255 1.00 36.27 C
-ATOM 1808 N THR A 244 -12.219 -29.739 11.095 1.00 27.70 N
-ATOM 1809 CA THR A 244 -11.122 -30.407 11.774 1.00 21.95 C
-ATOM 1810 C THR A 244 -11.688 -30.849 13.123 1.00 38.04 C
-ATOM 1811 O THR A 244 -12.524 -30.149 13.726 1.00 29.47 O
-ATOM 1812 CB THR A 244 -10.004 -29.457 11.967 1.00 27.11 C
-ATOM 1813 OG1 THR A 244 -9.643 -29.054 10.641 1.00 30.63 O
-ATOM 1814 CG2 THR A 244 -8.854 -30.056 12.776 1.00 22.16 C
-ATOM 1815 N VAL A 245 -11.298 -32.053 13.533 1.00 32.84 N
-ATOM 1816 CA VAL A 245 -11.691 -32.672 14.799 1.00 23.59 C
-ATOM 1817 C VAL A 245 -10.380 -33.151 15.399 1.00 30.46 C
-ATOM 1818 O VAL A 245 -9.480 -33.587 14.666 1.00 28.97 O
-ATOM 1819 CB VAL A 245 -12.643 -33.860 14.564 1.00 26.50 C
-ATOM 1820 CG1 VAL A 245 -12.936 -34.616 15.851 1.00 42.06 C
-ATOM 1821 CG2 VAL A 245 -13.983 -33.313 14.105 1.00 29.56 C
-ATOM 1822 N GLY A 246 -10.217 -32.981 16.715 1.00 30.97 N
-ATOM 1823 CA GLY A 246 -8.989 -33.402 17.357 1.00 28.37 C
-ATOM 1824 C GLY A 246 -9.056 -33.404 18.881 1.00 31.52 C
-ATOM 1825 O GLY A 246 -10.015 -32.875 19.467 1.00 29.24 O
-ATOM 1826 N GLY A 247 -8.033 -33.959 19.524 1.00 26.92 N
-ATOM 1827 CA GLY A 247 -8.013 -34.006 20.963 1.00 25.58 C
-ATOM 1828 C GLY A 247 -6.646 -34.406 21.421 1.00 36.99 C
-ATOM 1829 O GLY A 247 -5.803 -34.741 20.587 1.00 25.32 O
-ATOM 1830 N TYR A 248 -6.416 -34.408 22.735 1.00 23.62 N
-ATOM 1831 CA TYR A 248 -5.115 -34.748 23.270 1.00 20.94 C
-ATOM 1832 C TYR A 248 -5.325 -35.358 24.660 1.00 20.63 C
-ATOM 1833 O TYR A 248 -6.406 -35.164 25.255 1.00 21.90 O
-ATOM 1834 CB TYR A 248 -4.231 -33.486 23.387 1.00 21.56 C
-ATOM 1835 CG TYR A 248 -4.760 -32.431 24.364 1.00 25.21 C
-ATOM 1836 CD1 TYR A 248 -4.438 -32.548 25.708 1.00 27.92 C
-ATOM 1837 CD2 TYR A 248 -5.615 -31.411 23.968 1.00 24.90 C
-ATOM 1838 CE1 TYR A 248 -4.966 -31.665 26.639 1.00 26.26 C
-ATOM 1839 CE2 TYR A 248 -6.151 -30.519 24.904 1.00 31.70 C
-ATOM 1840 CZ TYR A 248 -5.819 -30.648 26.258 1.00 26.70 C
-ATOM 1841 OH TYR A 248 -6.318 -29.797 27.251 1.00 25.24 O
-ATOM 1842 N VAL A 249 -4.321 -36.040 25.195 1.00 24.77 N
-ATOM 1843 CA VAL A 249 -4.367 -36.470 26.593 1.00 27.74 C
-ATOM 1844 C VAL A 249 -2.923 -36.423 27.059 1.00 28.50 C
-ATOM 1845 O VAL A 249 -1.975 -36.725 26.318 1.00 24.37 O
-ATOM 1846 CB VAL A 249 -5.003 -37.894 26.729 1.00 30.76 C
-ATOM 1847 CG1 VAL A 249 -4.158 -38.959 26.069 1.00 36.77 C
-ATOM 1848 CG2 VAL A 249 -5.154 -38.207 28.211 1.00 29.16 C
-ATOM 1849 N GLN A 250 -2.715 -35.905 28.269 1.00 22.78 N
-ATOM 1850 CA GLN A 250 -1.387 -35.776 28.807 1.00 23.77 C
-ATOM 1851 C GLN A 250 -1.468 -36.243 30.256 1.00 25.06 C
-ATOM 1852 O GLN A 250 -2.549 -36.178 30.872 1.00 21.33 O
-ATOM 1853 CB GLN A 250 -0.900 -34.339 28.864 1.00 23.22 C
-ATOM 1854 CG GLN A 250 -1.124 -33.547 27.625 1.00 24.76 C
-ATOM 1855 CD GLN A 250 -0.215 -32.353 27.600 1.00 18.99 C
-ATOM 1856 OE1 GLN A 250 0.992 -32.480 27.720 1.00 23.92 O
-ATOM 1857 NE2 GLN A 250 -0.707 -31.141 27.461 1.00 20.19 N
-ATOM 1858 N VAL A 251 -0.358 -36.761 30.770 1.00 29.03 N
-ATOM 1859 CA VAL A 251 -0.307 -37.017 32.189 1.00 26.98 C
-ATOM 1860 C VAL A 251 1.015 -36.492 32.676 1.00 25.15 C
-ATOM 1861 O VAL A 251 2.068 -36.481 32.014 1.00 26.27 O
-ATOM 1862 CB VAL A 251 -0.510 -38.552 32.608 1.00 33.15 C
-ATOM 1863 CG1 VAL A 251 -0.968 -39.355 31.434 1.00 26.27 C
-ATOM 1864 CG2 VAL A 251 0.702 -39.104 33.283 1.00 32.70 C
-ATOM 1865 N LEU A 252 0.873 -35.954 33.891 1.00 23.70 N
-ATOM 1866 CA LEU A 252 2.023 -35.435 34.601 1.00 21.27 C
-ATOM 1867 C LEU A 252 2.033 -36.219 35.906 1.00 26.27 C
-ATOM 1868 O LEU A 252 0.990 -36.303 36.555 1.00 26.01 O
-ATOM 1869 CB LEU A 252 1.825 -33.976 34.863 1.00 22.83 C
-ATOM 1870 CG LEU A 252 2.836 -33.284 35.749 1.00 32.44 C
-ATOM 1871 CD1 LEU A 252 4.251 -33.390 35.206 1.00 25.21 C
-ATOM 1872 CD2 LEU A 252 2.333 -31.861 35.904 1.00 28.50 C
-ATOM 1873 N ASP A 253 3.167 -36.799 36.251 1.00 25.12 N
-ATOM 1874 CA ASP A 253 3.301 -37.651 37.415 1.00 34.71 C
-ATOM 1875 C ASP A 253 4.503 -37.199 38.247 1.00 25.50 C
-ATOM 1876 O ASP A 253 5.652 -37.463 37.851 1.00 26.91 O
-ATOM 1877 CB ASP A 253 3.454 -39.066 36.865 1.00 31.51 C
-ATOM 1878 CG ASP A 253 3.436 -40.240 37.841 1.00 52.04 C
-ATOM 1879 OD1 ASP A 253 3.598 -40.015 39.040 1.00 49.77 O
-ATOM 1880 OD2 ASP A 253 3.257 -41.381 37.389 1.00 67.89 O
-ATOM 1881 N ILE A 254 4.327 -36.531 39.394 1.00 24.18 N
-ATOM 1882 CA ILE A 254 5.467 -36.087 40.166 1.00 23.34 C
-ATOM 1883 C ILE A 254 5.483 -36.909 41.440 1.00 30.07 C
-ATOM 1884 O ILE A 254 4.540 -36.908 42.249 1.00 29.61 O
-ATOM 1885 CB ILE A 254 5.378 -34.625 40.550 1.00 20.78 C
-ATOM 1886 CG1 ILE A 254 5.120 -33.770 39.278 1.00 23.54 C
-ATOM 1887 CG2 ILE A 254 6.696 -34.241 41.236 1.00 20.01 C
-ATOM 1888 CD1 ILE A 254 4.936 -32.261 39.497 1.00 30.48 C
-ATOM 1889 N ASP A 255 6.606 -37.585 41.539 1.00 27.10 N
-ATOM 1890 CA ASP A 255 6.902 -38.482 42.630 1.00 37.11 C
-ATOM 1891 C ASP A 255 6.845 -37.723 43.957 1.00 34.48 C
-ATOM 1892 O ASP A 255 7.377 -36.618 44.107 1.00 33.20 O
-ATOM 1893 CB ASP A 255 8.290 -39.064 42.417 1.00 36.96 C
-ATOM 1894 CG ASP A 255 8.690 -40.163 43.403 1.00 61.77 C
-ATOM 1895 OD1 ASP A 255 7.879 -41.053 43.678 1.00 63.74 O
-ATOM 1896 OD2 ASP A 255 9.818 -40.132 43.893 1.00 54.70 O
-ATOM 1897 N THR A 256 6.132 -38.389 44.869 1.00 38.04 N
-ATOM 1898 CA THR A 256 5.860 -37.972 46.235 1.00 27.79 C
-ATOM 1899 C THR A 256 4.849 -36.835 46.246 1.00 45.76 C
-ATOM 1900 O THR A 256 4.408 -36.503 47.344 1.00 49.10 O
-ATOM 1901 CB THR A 256 7.129 -37.485 47.075 1.00 37.48 C
-ATOM 1902 OG1 THR A 256 7.491 -36.195 46.656 1.00 37.65 O
-ATOM 1903 CG2 THR A 256 8.331 -38.390 46.918 1.00 36.65 C
-ATOM 1904 N ILE A 257 4.398 -36.198 45.147 1.00 46.16 N
-ATOM 1905 CA ILE A 257 3.436 -35.093 45.238 1.00 36.33 C
-ATOM 1906 C ILE A 257 2.150 -35.643 44.702 1.00 45.12 C
-ATOM 1907 O ILE A 257 1.300 -36.026 45.495 1.00 39.40 O
-ATOM 1908 CB ILE A 257 3.835 -33.831 44.393 1.00 30.69 C
-ATOM 1909 CG1 ILE A 257 5.261 -33.393 44.729 1.00 26.95 C
-ATOM 1910 CG2 ILE A 257 2.776 -32.750 44.585 1.00 28.34 C
-ATOM 1911 CD1 ILE A 257 5.617 -33.165 46.186 1.00 47.06 C
-ATOM 1912 N ASP A 258 1.980 -35.772 43.386 1.00 26.70 N
-ATOM 1913 CA ASP A 258 0.726 -36.235 42.834 1.00 20.95 C
-ATOM 1914 C ASP A 258 0.900 -36.477 41.310 1.00 21.68 C
-ATOM 1915 O ASP A 258 1.987 -36.248 40.781 1.00 25.33 O
-ATOM 1916 CB ASP A 258 -0.359 -35.176 43.097 1.00 24.31 C
-ATOM 1917 CG ASP A 258 -1.793 -35.738 43.188 1.00 39.02 C
-ATOM 1918 OD1 ASP A 258 -2.027 -36.953 43.009 1.00 36.22 O
-ATOM 1919 OD2 ASP A 258 -2.705 -34.944 43.447 1.00 49.23 O
-ATOM 1920 N ASP A 259 -0.152 -36.966 40.657 1.00 32.03 N
-ATOM 1921 CA ASP A 259 -0.230 -37.188 39.229 1.00 35.51 C
-ATOM 1922 C ASP A 259 -1.548 -36.603 38.763 1.00 29.00 C
-ATOM 1923 O ASP A 259 -2.461 -36.390 39.566 1.00 29.90 O
-ATOM 1924 CB ASP A 259 -0.192 -38.674 38.860 1.00 29.16 C
-ATOM 1925 CG ASP A 259 -1.224 -39.576 39.537 1.00 32.42 C
-ATOM 1926 OD1 ASP A 259 -2.393 -39.544 39.181 1.00 53.80 O
-ATOM 1927 OD2 ASP A 259 -0.846 -40.322 40.433 1.00 66.04 O
-ATOM 1928 N VAL A 260 -1.665 -36.276 37.483 1.00 23.61 N
-ATOM 1929 CA VAL A 260 -2.910 -35.780 36.928 1.00 21.31 C
-ATOM 1930 C VAL A 260 -2.886 -36.211 35.452 1.00 25.64 C
-ATOM 1931 O VAL A 260 -1.818 -36.338 34.836 1.00 25.09 O
-ATOM 1932 CB VAL A 260 -2.958 -34.221 37.123 1.00 21.65 C
-ATOM 1933 CG1 VAL A 260 -1.779 -33.495 36.460 1.00 22.43 C
-ATOM 1934 CG2 VAL A 260 -4.300 -33.747 36.600 1.00 23.25 C
-ATOM 1935 N THR A 261 -4.073 -36.529 34.953 1.00 26.37 N
-ATOM 1936 CA THR A 261 -4.323 -36.788 33.551 1.00 29.83 C
-ATOM 1937 C THR A 261 -5.306 -35.690 33.145 1.00 28.17 C
-ATOM 1938 O THR A 261 -6.336 -35.465 33.799 1.00 27.71 O
-ATOM 1939 CB THR A 261 -4.949 -38.190 33.349 1.00 28.09 C
-ATOM 1940 OG1 THR A 261 -3.930 -39.126 33.734 1.00 29.64 O
-ATOM 1941 CG2 THR A 261 -5.462 -38.417 31.908 1.00 25.84 C
-ATOM 1942 N TYR A 262 -4.983 -34.982 32.066 1.00 29.21 N
-ATOM 1943 CA TYR A 262 -5.785 -33.861 31.598 1.00 24.79 C
-ATOM 1944 C TYR A 262 -5.915 -34.030 30.083 1.00 23.96 C
-ATOM 1945 O TYR A 262 -5.044 -34.609 29.415 1.00 24.24 O
-ATOM 1946 CB TYR A 262 -5.088 -32.537 31.993 1.00 24.82 C
-ATOM 1947 CG TYR A 262 -3.579 -32.350 31.796 1.00 25.17 C
-ATOM 1948 CD1 TYR A 262 -2.604 -33.061 32.501 1.00 21.56 C
-ATOM 1949 CD2 TYR A 262 -3.159 -31.368 30.913 1.00 32.68 C
-ATOM 1950 CE1 TYR A 262 -1.248 -32.785 32.330 1.00 28.66 C
-ATOM 1951 CE2 TYR A 262 -1.802 -31.079 30.741 1.00 24.26 C
-ATOM 1952 CZ TYR A 262 -0.855 -31.784 31.449 1.00 29.01 C
-ATOM 1953 OH TYR A 262 0.468 -31.450 31.285 1.00 26.50 O
-ATOM 1954 N TYR A 263 -7.042 -33.622 29.559 1.00 22.32 N
-ATOM 1955 CA TYR A 263 -7.335 -33.906 28.175 1.00 30.67 C
-ATOM 1956 C TYR A 263 -8.337 -32.893 27.616 1.00 32.19 C
-ATOM 1957 O TYR A 263 -8.975 -32.135 28.353 1.00 24.76 O
-ATOM 1958 CB TYR A 263 -7.857 -35.363 28.104 1.00 25.45 C
-ATOM 1959 CG TYR A 263 -9.175 -35.513 28.819 1.00 36.72 C
-ATOM 1960 CD1 TYR A 263 -10.316 -35.199 28.093 1.00 42.51 C
-ATOM 1961 CD2 TYR A 263 -9.207 -35.844 30.165 1.00 40.64 C
-ATOM 1962 CE1 TYR A 263 -11.539 -35.174 28.691 1.00 50.49 C
-ATOM 1963 CE2 TYR A 263 -10.438 -35.822 30.778 1.00 36.33 C
-ATOM 1964 CZ TYR A 263 -11.580 -35.477 30.032 1.00 50.61 C
-ATOM 1965 OH TYR A 263 -12.823 -35.358 30.642 1.00 80.92 O
-ATOM 1966 N GLY A 264 -8.571 -32.889 26.313 1.00 25.91 N
-ATOM 1967 CA GLY A 264 -9.496 -31.983 25.661 1.00 21.27 C
-ATOM 1968 C GLY A 264 -9.816 -32.541 24.276 1.00 23.07 C
-ATOM 1969 O GLY A 264 -9.062 -33.344 23.705 1.00 25.86 O
-ATOM 1970 N LEU A 265 -10.947 -32.088 23.794 1.00 23.56 N
-ATOM 1971 CA LEU A 265 -11.537 -32.566 22.562 1.00 26.65 C
-ATOM 1972 C LEU A 265 -12.237 -31.344 21.956 1.00 27.04 C
-ATOM 1973 O LEU A 265 -13.041 -30.658 22.628 1.00 23.67 O
-ATOM 1974 CB LEU A 265 -12.584 -33.655 22.879 1.00 27.27 C
-ATOM 1975 CG LEU A 265 -12.649 -34.995 22.175 1.00 60.41 C
-ATOM 1976 CD1 LEU A 265 -12.763 -34.816 20.658 1.00 50.33 C
-ATOM 1977 CD2 LEU A 265 -11.395 -35.779 22.546 1.00 66.28 C
-ATOM 1978 N GLY A 266 -11.951 -31.022 20.694 1.00 24.66 N
-ATOM 1979 CA GLY A 266 -12.640 -29.907 20.061 1.00 28.90 C
-ATOM 1980 C GLY A 266 -12.729 -30.028 18.549 1.00 30.41 C
-ATOM 1981 O GLY A 266 -12.123 -30.912 17.929 1.00 27.92 O
-ATOM 1982 N ALA A 267 -13.472 -29.113 17.964 1.00 24.95 N
-ATOM 1983 CA ALA A 267 -13.627 -29.097 16.532 1.00 33.88 C
-ATOM 1984 C ALA A 267 -13.626 -27.690 16.016 1.00 31.63 C
-ATOM 1985 O ALA A 267 -13.943 -26.760 16.764 1.00 24.94 O
-ATOM 1986 CB ALA A 267 -14.947 -29.688 16.119 1.00 24.74 C
-ATOM 1987 N SER A 268 -13.311 -27.544 14.737 1.00 29.24 N
-ATOM 1988 CA SER A 268 -13.505 -26.275 14.076 1.00 25.82 C
-ATOM 1989 C SER A 268 -14.077 -26.503 12.695 1.00 31.52 C
-ATOM 1990 O SER A 268 -13.861 -27.550 12.082 1.00 28.68 O
-ATOM 1991 CB SER A 268 -12.188 -25.504 13.964 1.00 24.92 C
-ATOM 1992 OG SER A 268 -11.044 -26.303 13.739 1.00 39.59 O
-ATOM 1993 N TYR A 269 -14.763 -25.494 12.230 1.00 26.59 N
-ATOM 1994 CA TYR A 269 -15.364 -25.502 10.940 1.00 25.66 C
-ATOM 1995 C TYR A 269 -14.905 -24.252 10.228 1.00 25.81 C
-ATOM 1996 O TYR A 269 -15.202 -23.132 10.648 1.00 25.05 O
-ATOM 1997 CB TYR A 269 -16.841 -25.513 11.147 1.00 23.54 C
-ATOM 1998 CG TYR A 269 -17.518 -25.612 9.808 1.00 33.37 C
-ATOM 1999 CD1 TYR A 269 -17.639 -26.848 9.204 1.00 29.64 C
-ATOM 2000 CD2 TYR A 269 -17.940 -24.462 9.180 1.00 39.37 C
-ATOM 2001 CE1 TYR A 269 -18.189 -26.926 7.938 1.00 52.56 C
-ATOM 2002 CE2 TYR A 269 -18.482 -24.534 7.916 1.00 51.57 C
-ATOM 2003 CZ TYR A 269 -18.605 -25.768 7.301 1.00 58.86 C
-ATOM 2004 OH TYR A 269 -19.150 -25.833 6.027 1.00 61.25 O
-ATOM 2005 N ASP A 270 -14.225 -24.389 9.114 1.00 22.56 N
-ATOM 2006 CA ASP A 270 -13.728 -23.239 8.392 1.00 20.61 C
-ATOM 2007 C ASP A 270 -14.818 -22.578 7.539 1.00 29.68 C
-ATOM 2008 O ASP A 270 -15.426 -23.238 6.697 1.00 34.39 O
-ATOM 2009 CB ASP A 270 -12.550 -23.739 7.549 1.00 24.95 C
-ATOM 2010 CG ASP A 270 -11.686 -22.678 6.877 1.00 33.53 C
-ATOM 2011 OD1 ASP A 270 -12.079 -21.518 6.858 1.00 33.68 O
-ATOM 2012 OD2 ASP A 270 -10.599 -23.005 6.391 1.00 54.40 O
-ATOM 2013 N LEU A 271 -15.094 -21.291 7.724 1.00 24.09 N
-ATOM 2014 CA LEU A 271 -16.068 -20.546 6.940 1.00 21.32 C
-ATOM 2015 C LEU A 271 -15.387 -19.861 5.747 1.00 23.96 C
-ATOM 2016 O LEU A 271 -16.039 -19.186 4.965 1.00 23.54 O
-ATOM 2017 CB LEU A 271 -16.718 -19.450 7.764 1.00 19.85 C
-ATOM 2018 CG LEU A 271 -17.482 -19.817 9.037 1.00 23.59 C
-ATOM 2019 CD1 LEU A 271 -18.005 -18.566 9.724 1.00 24.13 C
-ATOM 2020 CD2 LEU A 271 -18.614 -20.710 8.684 1.00 25.97 C
-ATOM 2021 N GLY A 272 -14.077 -19.917 5.657 1.00 21.11 N
-ATOM 2022 CA GLY A 272 -13.297 -19.265 4.646 1.00 20.61 C
-ATOM 2023 C GLY A 272 -13.020 -17.808 4.960 1.00 23.49 C
-ATOM 2024 O GLY A 272 -13.642 -17.214 5.841 1.00 26.07 O
-ATOM 2025 N GLY A 273 -12.048 -17.183 4.294 1.00 16.10 N
-ATOM 2026 CA GLY A 273 -11.850 -15.758 4.404 1.00 15.88 C
-ATOM 2027 C GLY A 273 -11.120 -15.370 5.693 1.00 23.40 C
-ATOM 2028 O GLY A 273 -10.858 -14.193 5.896 1.00 24.50 O
-ATOM 2029 N GLY A 274 -10.716 -16.337 6.529 1.00 27.38 N
-ATOM 2030 CA GLY A 274 -10.024 -16.087 7.796 1.00 27.44 C
-ATOM 2031 C GLY A 274 -10.951 -16.319 9.003 1.00 31.13 C
-ATOM 2032 O GLY A 274 -10.559 -15.962 10.109 1.00 26.17 O
-ATOM 2033 N ALA A 275 -12.150 -16.880 8.849 1.00 21.61 N
-ATOM 2034 CA ALA A 275 -13.084 -17.081 9.935 1.00 21.23 C
-ATOM 2035 C ALA A 275 -13.397 -18.550 10.106 1.00 31.65 C
-ATOM 2036 O ALA A 275 -13.438 -19.304 9.129 1.00 22.67 O
-ATOM 2037 CB ALA A 275 -14.384 -16.338 9.664 1.00 16.02 C
-ATOM 2038 N SER A 276 -13.567 -19.003 11.350 1.00 19.43 N
-ATOM 2039 CA SER A 276 -13.933 -20.370 11.654 1.00 19.76 C
-ATOM 2040 C SER A 276 -14.798 -20.406 12.926 1.00 25.83 C
-ATOM 2041 O SER A 276 -14.736 -19.480 13.750 1.00 23.50 O
-ATOM 2042 CB SER A 276 -12.659 -21.228 11.821 1.00 21.87 C
-ATOM 2043 OG SER A 276 -11.650 -20.655 12.638 1.00 34.39 O
-ATOM 2044 N ILE A 277 -15.679 -21.387 13.049 1.00 22.23 N
-ATOM 2045 CA ILE A 277 -16.508 -21.592 14.227 1.00 22.99 C
-ATOM 2046 C ILE A 277 -15.711 -22.641 14.979 1.00 28.21 C
-ATOM 2047 O ILE A 277 -15.281 -23.638 14.373 1.00 23.58 O
-ATOM 2048 CB ILE A 277 -17.884 -22.116 13.800 1.00 26.04 C
-ATOM 2049 CG1 ILE A 277 -18.611 -21.066 13.027 1.00 28.06 C
-ATOM 2050 CG2 ILE A 277 -18.730 -22.472 15.023 1.00 24.61 C
-ATOM 2051 CD1 ILE A 277 -19.860 -21.684 12.370 1.00 28.49 C
-ATOM 2052 N VAL A 278 -15.414 -22.462 16.276 1.00 24.26 N
-ATOM 2053 CA VAL A 278 -14.525 -23.365 17.035 1.00 25.14 C
-ATOM 2054 C VAL A 278 -15.179 -23.631 18.396 1.00 25.78 C
-ATOM 2055 O VAL A 278 -15.724 -22.712 19.016 1.00 23.74 O
-ATOM 2056 CB VAL A 278 -13.131 -22.725 17.291 1.00 22.54 C
-ATOM 2057 CG1 VAL A 278 -12.205 -23.783 17.813 1.00 18.27 C
-ATOM 2058 CG2 VAL A 278 -12.549 -22.120 16.040 1.00 24.97 C
-ATOM 2059 N GLY A 279 -15.140 -24.844 18.907 1.00 22.69 N
-ATOM 2060 CA GLY A 279 -15.720 -25.165 20.201 1.00 23.27 C
-ATOM 2061 C GLY A 279 -14.945 -26.330 20.772 1.00 25.33 C
-ATOM 2062 O GLY A 279 -14.236 -27.024 20.031 1.00 26.35 O
-ATOM 2063 N GLY A 280 -15.009 -26.605 22.070 1.00 22.79 N
-ATOM 2064 CA GLY A 280 -14.234 -27.694 22.641 1.00 23.14 C
-ATOM 2065 C GLY A 280 -14.617 -27.915 24.096 1.00 20.25 C
-ATOM 2066 O GLY A 280 -15.400 -27.157 24.669 1.00 22.34 O
-ATOM 2067 N ILE A 281 -14.043 -28.956 24.637 1.00 18.86 N
-ATOM 2068 CA ILE A 281 -14.332 -29.423 25.969 1.00 27.28 C
-ATOM 2069 C ILE A 281 -12.965 -29.757 26.547 1.00 24.01 C
-ATOM 2070 O ILE A 281 -12.083 -30.231 25.818 1.00 25.84 O
-ATOM 2071 CB ILE A 281 -15.335 -30.615 25.721 1.00 34.33 C
-ATOM 2072 CG1 ILE A 281 -16.473 -30.269 26.569 1.00 32.29 C
-ATOM 2073 CG2 ILE A 281 -14.878 -32.035 26.009 1.00 32.21 C
-ATOM 2074 CD1 ILE A 281 -17.453 -29.412 25.782 1.00 41.67 C
-ATOM 2075 N ALA A 282 -12.689 -29.490 27.833 1.00 25.05 N
-ATOM 2076 CA ALA A 282 -11.411 -29.873 28.421 1.00 21.98 C
-ATOM 2077 C ALA A 282 -11.621 -30.175 29.916 1.00 30.82 C
-ATOM 2078 O ALA A 282 -12.518 -29.625 30.583 1.00 25.28 O
-ATOM 2079 CB ALA A 282 -10.373 -28.757 28.319 1.00 19.90 C
-ATOM 2080 N ASP A 283 -10.792 -31.067 30.451 1.00 29.24 N
-ATOM 2081 CA ASP A 283 -10.865 -31.448 31.852 1.00 27.15 C
-ATOM 2082 C ASP A 283 -9.629 -32.154 32.344 1.00 28.94 C
-ATOM 2083 O ASP A 283 -8.650 -32.367 31.612 1.00 25.65 O
-ATOM 2084 CB ASP A 283 -12.056 -32.351 32.044 1.00 25.99 C
-ATOM 2085 CG ASP A 283 -12.651 -32.316 33.442 1.00 44.57 C
-ATOM 2086 OD1 ASP A 283 -12.188 -31.605 34.358 1.00 33.69 O
-ATOM 2087 OD2 ASP A 283 -13.632 -33.032 33.566 1.00 35.12 O
-ATOM 2088 N ASN A 284 -9.624 -32.469 33.630 1.00 25.13 N
-ATOM 2089 CA ASN A 284 -8.575 -33.323 34.132 1.00 24.84 C
-ATOM 2090 C ASN A 284 -9.281 -34.178 35.168 1.00 32.53 C
-ATOM 2091 O ASN A 284 -10.446 -33.966 35.501 1.00 27.71 O
-ATOM 2092 CB ASN A 284 -7.428 -32.531 34.784 1.00 22.73 C
-ATOM 2093 CG ASN A 284 -7.841 -31.655 35.937 1.00 35.10 C
-ATOM 2094 OD1 ASN A 284 -8.594 -32.043 36.830 1.00 32.48 O
-ATOM 2095 ND2 ASN A 284 -7.398 -30.419 35.956 1.00 26.62 N
-ATOM 2096 N ASP A 285 -8.571 -35.160 35.662 1.00 26.45 N
-ATOM 2097 CA ASP A 285 -9.119 -36.062 36.668 1.00 41.39 C
-ATOM 2098 C ASP A 285 -8.918 -35.651 38.136 1.00 38.31 C
-ATOM 2099 O ASP A 285 -9.037 -36.477 39.045 1.00 41.71 O
-ATOM 2100 CB ASP A 285 -8.515 -37.458 36.442 1.00 22.77 C
-ATOM 2101 CG ASP A 285 -7.018 -37.619 36.682 1.00 23.18 C
-ATOM 2102 OD1 ASP A 285 -6.299 -36.642 36.961 1.00 33.04 O
-ATOM 2103 OD2 ASP A 285 -6.564 -38.760 36.574 1.00 41.33 O
-ATOM 2104 N LEU A 286 -8.522 -34.433 38.464 1.00 31.53 N
-ATOM 2105 CA LEU A 286 -8.375 -34.096 39.864 1.00 25.13 C
-ATOM 2106 C LEU A 286 -9.781 -34.072 40.470 1.00 41.07 C
-ATOM 2107 O LEU A 286 -10.786 -33.987 39.738 1.00 43.63 O
-ATOM 2108 CB LEU A 286 -7.705 -32.751 39.998 1.00 27.21 C
-ATOM 2109 CG LEU A 286 -6.270 -32.835 39.611 1.00 27.72 C
-ATOM 2110 CD1 LEU A 286 -5.760 -31.443 39.694 1.00 35.20 C
-ATOM 2111 CD2 LEU A 286 -5.476 -33.794 40.484 1.00 33.80 C
-ATOM 2112 N PRO A 287 -9.877 -34.225 41.816 1.00 72.08 N
-ATOM 2113 CA PRO A 287 -11.137 -34.283 42.564 1.00 57.25 C
-ATOM 2114 C PRO A 287 -12.204 -33.202 42.339 1.00 55.50 C
-ATOM 2115 O PRO A 287 -13.372 -33.508 42.071 1.00 64.32 O
-ATOM 2116 CB PRO A 287 -10.653 -34.366 44.012 1.00 64.34 C
-ATOM 2117 CG PRO A 287 -9.230 -33.836 43.996 1.00 69.23 C
-ATOM 2118 CD PRO A 287 -8.755 -34.511 42.729 1.00 60.19 C
-ATOM 2119 N ASN A 288 -11.828 -31.922 42.497 1.00 54.09 N
-ATOM 2120 CA ASN A 288 -12.770 -30.799 42.318 1.00 73.15 C
-ATOM 2121 C ASN A 288 -13.272 -30.582 40.876 1.00 74.10 C
-ATOM 2122 O ASN A 288 -14.484 -30.447 40.665 1.00 75.41 O
-ATOM 2123 CB ASN A 288 -12.090 -29.477 42.876 1.00 81.36 C
-ATOM 2124 CG ASN A 288 -12.242 -28.127 42.121 1.00 97.42 C
-ATOM 2125 OD1 ASN A 288 -13.325 -27.546 41.955 1.00 97.46 O
-ATOM 2126 ND2 ASN A 288 -11.144 -27.539 41.643 1.00101.92 N
-ATOM 2127 N SER A 289 -12.316 -30.570 39.928 1.00 69.19 N
-ATOM 2128 CA SER A 289 -12.486 -30.226 38.533 1.00 50.17 C
-ATOM 2129 C SER A 289 -13.769 -30.567 37.808 1.00 43.85 C
-ATOM 2130 O SER A 289 -14.129 -31.734 37.591 1.00 46.69 O
-ATOM 2131 CB SER A 289 -11.310 -30.821 37.778 1.00 52.12 C
-ATOM 2132 OG SER A 289 -10.127 -30.246 38.340 1.00 71.82 O
-ATOM 2133 N ASP A 290 -14.474 -29.478 37.467 1.00 38.06 N
-ATOM 2134 CA ASP A 290 -15.638 -29.592 36.585 1.00 44.01 C
-ATOM 2135 C ASP A 290 -15.048 -29.256 35.203 1.00 33.18 C
-ATOM 2136 O ASP A 290 -14.076 -28.504 35.098 1.00 32.33 O
-ATOM 2137 CB ASP A 290 -16.736 -28.563 36.815 1.00 56.50 C
-ATOM 2138 CG ASP A 290 -16.866 -28.005 38.221 1.00 77.24 C
-ATOM 2139 OD1 ASP A 290 -16.176 -27.018 38.549 1.00 84.59 O
-ATOM 2140 OD2 ASP A 290 -17.688 -28.568 38.949 1.00 73.57 O
-ATOM 2141 N MET A 291 -15.650 -29.801 34.153 1.00 36.97 N
-ATOM 2142 CA MET A 291 -15.240 -29.609 32.773 1.00 34.70 C
-ATOM 2143 C MET A 291 -15.491 -28.176 32.316 1.00 26.12 C
-ATOM 2144 O MET A 291 -16.588 -27.636 32.596 1.00 28.32 O
-ATOM 2145 CB MET A 291 -16.046 -30.548 31.941 1.00 33.14 C
-ATOM 2146 CG MET A 291 -15.721 -30.633 30.469 1.00 52.66 C
-ATOM 2147 SD MET A 291 -17.054 -31.586 29.705 1.00 48.22 S
-ATOM 2148 CE MET A 291 -18.376 -30.408 29.816 1.00 41.88 C
-ATOM 2149 N VAL A 292 -14.461 -27.601 31.653 1.00 30.89 N
-ATOM 2150 CA VAL A 292 -14.602 -26.296 30.995 1.00 28.79 C
-ATOM 2151 C VAL A 292 -15.001 -26.548 29.519 1.00 27.78 C
-ATOM 2152 O VAL A 292 -14.798 -27.642 28.964 1.00 23.47 O
-ATOM 2153 CB VAL A 292 -13.278 -25.451 31.060 1.00 21.26 C
-ATOM 2154 CG1 VAL A 292 -13.068 -25.121 32.513 1.00 24.54 C
-ATOM 2155 CG2 VAL A 292 -12.062 -26.151 30.493 1.00 17.97 C
-ATOM 2156 N ALA A 293 -15.630 -25.598 28.853 1.00 24.90 N
-ATOM 2157 CA ALA A 293 -16.075 -25.765 27.478 1.00 28.34 C
-ATOM 2158 C ALA A 293 -16.194 -24.388 26.843 1.00 31.62 C
-ATOM 2159 O ALA A 293 -16.271 -23.380 27.571 1.00 21.58 O
-ATOM 2160 CB ALA A 293 -17.455 -26.411 27.425 1.00 21.46 C
-ATOM 2161 N ASP A 294 -16.208 -24.253 25.507 1.00 20.79 N
-ATOM 2162 CA ASP A 294 -16.521 -22.962 24.906 1.00 18.22 C
-ATOM 2163 C ASP A 294 -17.085 -23.151 23.509 1.00 23.81 C
-ATOM 2164 O ASP A 294 -16.994 -24.277 22.981 1.00 21.81 O
-ATOM 2165 CB ASP A 294 -15.275 -22.092 24.862 1.00 16.80 C
-ATOM 2166 CG ASP A 294 -14.135 -22.482 23.933 1.00 28.79 C
-ATOM 2167 OD1 ASP A 294 -14.298 -23.157 22.922 1.00 23.51 O
-ATOM 2168 OD2 ASP A 294 -13.027 -22.066 24.222 1.00 20.09 O
-ATOM 2169 N LEU A 295 -17.630 -22.092 22.934 1.00 22.29 N
-ATOM 2170 CA LEU A 295 -18.156 -22.143 21.590 1.00 23.66 C
-ATOM 2171 C LEU A 295 -18.129 -20.735 21.068 1.00 20.00 C
-ATOM 2172 O LEU A 295 -18.736 -19.833 21.657 1.00 18.17 O
-ATOM 2173 CB LEU A 295 -19.584 -22.665 21.597 1.00 22.86 C
-ATOM 2174 CG LEU A 295 -20.239 -22.727 20.174 1.00 36.71 C
-ATOM 2175 CD1 LEU A 295 -19.494 -23.716 19.279 1.00 28.60 C
-ATOM 2176 CD2 LEU A 295 -21.662 -23.194 20.270 1.00 32.46 C
-ATOM 2177 N GLY A 296 -17.427 -20.481 19.963 1.00 17.67 N
-ATOM 2178 CA GLY A 296 -17.406 -19.135 19.432 1.00 17.33 C
-ATOM 2179 C GLY A 296 -16.815 -19.125 18.034 1.00 21.99 C
-ATOM 2180 O GLY A 296 -16.764 -20.163 17.371 1.00 20.73 O
-ATOM 2181 N VAL A 297 -16.360 -17.965 17.591 1.00 23.91 N
-ATOM 2182 CA VAL A 297 -15.762 -17.790 16.259 1.00 24.04 C
-ATOM 2183 C VAL A 297 -14.373 -17.194 16.384 1.00 27.04 C
-ATOM 2184 O VAL A 297 -14.139 -16.389 17.291 1.00 20.84 O
-ATOM 2185 CB VAL A 297 -16.662 -16.873 15.351 1.00 20.97 C
-ATOM 2186 CG1 VAL A 297 -17.934 -17.628 15.031 1.00 27.35 C
-ATOM 2187 CG2 VAL A 297 -17.101 -15.596 16.010 1.00 23.73 C
-ATOM 2188 N LYS A 298 -13.401 -17.578 15.569 1.00 18.69 N
-ATOM 2189 CA LYS A 298 -12.053 -17.027 15.608 1.00 16.67 C
-ATOM 2190 C LYS A 298 -11.825 -16.348 14.264 1.00 23.47 C
-ATOM 2191 O LYS A 298 -12.314 -16.874 13.261 1.00 24.58 O
-ATOM 2192 CB LYS A 298 -11.017 -18.111 15.770 1.00 19.12 C
-ATOM 2193 CG LYS A 298 -10.986 -18.627 17.195 1.00 21.33 C
-ATOM 2194 CD LYS A 298 -10.117 -19.822 17.223 1.00 18.34 C
-ATOM 2195 CE LYS A 298 -8.728 -19.349 17.070 1.00 21.34 C
-ATOM 2196 NZ LYS A 298 -7.845 -20.499 17.110 1.00 30.35 N
-ATOM 2197 N PHE A 299 -11.150 -15.210 14.187 1.00 18.24 N
-ATOM 2198 CA PHE A 299 -10.953 -14.448 12.960 1.00 17.66 C
-ATOM 2199 C PHE A 299 -9.485 -14.163 12.794 1.00 26.51 C
-ATOM 2200 O PHE A 299 -8.769 -13.944 13.784 1.00 22.18 O
-ATOM 2201 CB PHE A 299 -11.681 -13.135 13.055 1.00 14.69 C
-ATOM 2202 CG PHE A 299 -13.179 -13.199 13.267 1.00 21.01 C
-ATOM 2203 CD1 PHE A 299 -13.978 -14.058 12.533 1.00 22.78 C
-ATOM 2204 CD2 PHE A 299 -13.765 -12.359 14.185 1.00 20.84 C
-ATOM 2205 CE1 PHE A 299 -15.346 -14.077 12.712 1.00 23.54 C
-ATOM 2206 CE2 PHE A 299 -15.137 -12.388 14.348 1.00 22.22 C
-ATOM 2207 CZ PHE A 299 -15.934 -13.240 13.619 1.00 21.26 C
-ATOM 2208 N LYS A 300 -8.952 -14.173 11.593 1.00 17.76 N
-ATOM 2209 CA LYS A 300 -7.572 -13.787 11.346 1.00 17.46 C
-ATOM 2210 C LYS A 300 -7.649 -12.631 10.356 1.00 24.16 C
-ATOM 2211 O LYS A 300 -8.564 -12.607 9.499 1.00 26.46 O
-ATOM 2212 CB LYS A 300 -6.813 -14.912 10.727 1.00 22.55 C
-ATOM 2213 CG LYS A 300 -6.657 -16.072 11.650 1.00 34.41 C
-ATOM 2214 CD LYS A 300 -5.385 -16.857 11.324 1.00 54.10 C
-ATOM 2215 CE LYS A 300 -5.453 -17.720 10.063 1.00 75.73 C
-ATOM 2216 NZ LYS A 300 -4.221 -18.486 9.901 1.00 84.85 N
-ATOM 2217 N PHE A 301 -6.747 -11.655 10.457 1.00 19.50 N
-ATOM 2218 CA PHE A 301 -6.819 -10.437 9.678 1.00 18.21 C
-ATOM 2219 C PHE A 301 -5.466 -10.102 9.104 1.00 22.86 C
-ATOM 2220 O PHE A 301 -4.454 -10.631 9.571 1.00 17.64 O
-ATOM 2221 CB PHE A 301 -7.251 -9.193 10.471 1.00 18.80 C
-ATOM 2222 CG PHE A 301 -8.614 -9.367 11.100 1.00 24.96 C
-ATOM 2223 CD1 PHE A 301 -9.760 -9.256 10.344 1.00 18.68 C
-ATOM 2224 CD2 PHE A 301 -8.718 -9.610 12.461 1.00 23.97 C
-ATOM 2225 CE1 PHE A 301 -11.019 -9.379 10.920 1.00 19.16 C
-ATOM 2226 CE2 PHE A 301 -9.983 -9.730 13.030 1.00 19.39 C
-ATOM 2227 CZ PHE A 301 -11.135 -9.616 12.275 1.00 20.43 C
-ATOM 2228 OXT PHE A 301 -5.445 -9.316 8.144 1.00 28.38 O
-TER 2229 PHE A 301
-HETATM 2230 CA CA A 302 5.011 -23.190 25.968 1.00 21.26 CA
-HETATM 2231 CA CA A 303 -2.860 -23.590 25.053 1.00 18.82 CA
-HETATM 2232 CA CA A 304 19.713 -10.305 32.535 1.00 19.02 CA
-HETATM 2233 C1 C8E A 545 8.213 -29.709 34.111 0.88 42.96 C
-HETATM 2234 C2 C8E A 545 7.552 -28.411 34.504 0.88 41.67 C
-HETATM 2235 C3 C8E A 545 6.087 -28.660 34.394 0.88 42.57 C
-HETATM 2236 C4 C8E A 545 5.485 -27.321 34.709 0.88 43.55 C
-HETATM 2237 C5 C8E A 545 4.152 -27.105 34.003 0.88 44.03 C
-HETATM 2238 C6 C8E A 545 3.097 -28.172 34.277 0.88 42.16 C
-HETATM 2239 C7 C8E A 545 1.680 -27.738 33.857 0.88 39.75 C
-HETATM 2240 C8 C8E A 545 0.806 -28.916 34.194 0.88 37.75 C
-HETATM 2241 O9 C8E A 545 -0.600 -28.806 34.267 0.88 38.94 O
-HETATM 2242 C10 C8E A 545 -1.108 -29.343 35.484 0.88 40.72 C
-HETATM 2243 C11 C8E A 545 -2.584 -29.539 35.411 0.88 45.43 C
-HETATM 2244 O12 C8E A 545 -3.364 -29.456 36.593 0.88 54.18 O
-HETATM 2245 C13 C8E A 545 -3.888 -28.142 36.821 0.88 63.79 C
-HETATM 2246 C14 C8E A 545 -3.546 -27.475 38.160 0.88 72.45 C
-HETATM 2247 O15 C8E A 545 -3.840 -28.181 39.385 0.88 79.05 O
-HETATM 2248 C16 C8E A 545 -4.714 -27.481 40.299 0.88 84.79 C
-HETATM 2249 C17 C8E A 545 -6.141 -28.045 40.520 0.88 88.54 C
-HETATM 2250 O18 C8E A 545 -6.994 -27.791 41.671 0.88 91.31 O
-HETATM 2251 C19 C8E A 545 -6.710 -28.672 42.798 0.88 93.11 C
-HETATM 2252 C20 C8E A 545 -7.835 -29.597 43.315 0.88 93.71 C
-HETATM 2253 O21 C8E A 545 -8.715 -29.939 42.235 0.88 93.34 O
-HETATM 2254 C1 C8E A 546 -16.910 -30.948 20.987 0.83 50.61 C
-HETATM 2255 C2 C8E A 546 -17.003 -29.492 20.487 0.83 51.77 C
-HETATM 2256 C3 C8E A 546 -18.226 -28.681 20.944 0.83 50.98 C
-HETATM 2257 C4 C8E A 546 -18.230 -28.157 22.386 0.83 51.13 C
-HETATM 2258 C5 C8E A 546 -19.478 -27.295 22.528 0.83 52.63 C
-HETATM 2259 C6 C8E A 546 -19.775 -26.873 23.954 0.83 55.60 C
-HETATM 2260 C7 C8E A 546 -21.264 -26.522 24.126 0.83 60.07 C
-HETATM 2261 C8 C8E A 546 -21.652 -25.072 23.799 0.83 64.27 C
-HETATM 2262 O9 C8E A 546 -23.025 -24.744 23.463 0.83 66.21 O
-HETATM 2263 C10 C8E A 546 -23.879 -24.185 24.492 0.83 66.45 C
-HETATM 2264 C11 C8E A 546 -24.241 -22.690 24.589 0.83 65.91 C
-HETATM 2265 O12 C8E A 546 -25.371 -22.371 25.423 0.83 65.26 O
-HETATM 2266 C13 C8E A 546 -25.072 -21.784 26.706 0.83 65.04 C
-HETATM 2267 C14 C8E A 546 -25.775 -20.508 27.231 0.83 64.60 C
-HETATM 2268 O15 C8E A 546 -25.456 -19.172 26.782 0.83 63.35 O
-HETATM 2269 C16 C8E A 546 -25.077 -18.304 27.864 0.83 61.87 C
-HETATM 2270 C17 C8E A 546 -25.057 -16.798 27.655 0.83 60.37 C
-HETATM 2271 O18 C8E A 546 -24.686 -15.946 28.736 0.83 60.64 O
-HETATM 2272 C19 C8E A 546 -25.722 -14.991 28.972 0.83 62.75 C
-HETATM 2273 C20 C8E A 546 -26.625 -15.182 30.187 0.83 65.74 C
-HETATM 2274 O21 C8E A 546 -27.717 -14.265 30.253 0.83 68.59 O
-HETATM 2275 C1 C8E A 547 -27.555 -14.778 24.966 0.69 53.41 C
-HETATM 2276 C2 C8E A 547 -26.516 -15.667 24.244 0.69 52.85 C
-HETATM 2277 C3 C8E A 547 -25.613 -14.788 23.406 0.69 51.32 C
-HETATM 2278 C4 C8E A 547 -24.590 -15.611 22.646 0.69 50.00 C
-HETATM 2279 C5 C8E A 547 -23.742 -14.660 21.812 0.69 48.73 C
-HETATM 2280 C6 C8E A 547 -22.770 -15.402 20.910 0.69 49.05 C
-HETATM 2281 C7 C8E A 547 -21.887 -14.406 20.188 0.69 50.17 C
-HETATM 2282 C8 C8E A 547 -20.855 -15.059 19.282 0.69 51.75 C
-HETATM 2283 O9 C8E A 547 -21.254 -15.638 18.040 0.69 53.80 O
-HETATM 2284 C10 C8E A 547 -20.727 -16.961 17.815 0.69 55.39 C
-HETATM 2285 C11 C8E A 547 -21.412 -18.239 18.340 0.69 57.31 C
-HETATM 2286 O12 C8E A 547 -20.997 -19.520 17.825 0.69 59.43 O
-HETATM 2287 C13 C8E A 547 -21.900 -20.072 16.839 0.69 62.71 C
-HETATM 2288 C14 C8E A 547 -21.762 -19.847 15.315 0.69 66.12 C
-HETATM 2289 O15 C8E A 547 -21.863 -18.520 14.749 0.69 68.53 O
-HETATM 2290 C16 C8E A 547 -21.503 -18.438 13.354 0.69 69.38 C
-HETATM 2291 C17 C8E A 547 -22.432 -17.855 12.267 0.69 69.19 C
-HETATM 2292 O18 C8E A 547 -23.574 -18.559 11.772 0.69 69.55 O
-HETATM 2293 C19 C8E A 547 -23.224 -19.417 10.680 0.69 71.17 C
-HETATM 2294 C20 C8E A 547 -23.699 -19.093 9.256 0.69 73.02 C
-HETATM 2295 O21 C8E A 547 -23.190 -19.997 8.271 0.69 74.35 O
-HETATM 2296 C1 C8E A 548 8.635 -40.960 22.015 0.66 38.33 C
-HETATM 2297 C2 C8E A 548 7.129 -40.823 22.217 0.66 39.82 C
-HETATM 2298 C3 C8E A 548 6.553 -41.828 23.201 0.66 42.86 C
-HETATM 2299 C4 C8E A 548 5.132 -41.410 23.650 0.66 46.04 C
-HETATM 2300 C5 C8E A 548 4.404 -42.484 24.470 0.66 48.47 C
-HETATM 2301 C6 C8E A 548 3.158 -42.049 25.250 0.66 49.60 C
-HETATM 2302 C7 C8E A 548 1.937 -41.675 24.427 0.66 50.98 C
-HETATM 2303 C8 C8E A 548 0.665 -42.117 25.157 0.66 53.35 C
-HETATM 2304 O9 C8E A 548 0.300 -41.619 26.461 0.66 56.73 O
-HETATM 2305 C10 C8E A 548 -1.055 -41.115 26.530 0.66 60.75 C
-HETATM 2306 C11 C8E A 548 -1.893 -41.075 27.835 0.66 64.78 C
-HETATM 2307 O12 C8E A 548 -2.307 -42.251 28.554 0.66 68.03 O
-HETATM 2308 C13 C8E A 548 -3.602 -42.750 28.183 0.66 70.92 C
-HETATM 2309 C14 C8E A 548 -4.589 -43.152 29.296 0.66 73.54 C
-HETATM 2310 O15 C8E A 548 -5.324 -42.194 30.083 0.66 75.50 O
-HETATM 2311 C16 C8E A 548 -6.755 -42.418 30.010 0.66 77.12 C
-HETATM 2312 C17 C8E A 548 -7.846 -41.611 30.782 0.66 78.17 C
-HETATM 2313 O18 C8E A 548 -8.228 -40.241 30.482 0.66 78.30 O
-HETATM 2314 C19 C8E A 548 -9.532 -40.067 29.908 0.66 78.18 C
-HETATM 2315 C20 C8E A 548 -9.622 -39.737 28.426 0.66 78.11 C
-HETATM 2316 O21 C8E A 548 -10.967 -39.509 28.017 0.66 79.53 O
-HETATM 2317 O HOH A 305 6.190 -23.830 27.989 1.00 20.83 O
-HETATM 2318 O HOH A 306 -2.513 -6.904 20.688 1.00 16.79 O
-HETATM 2319 O HOH A 307 3.039 -23.016 24.751 1.00 20.86 O
-HETATM 2320 O HOH A 308 17.950 -13.715 34.357 1.00 19.18 O
-HETATM 2321 O HOH A 309 -4.859 -6.074 21.898 1.00 17.25 O
-HETATM 2322 O HOH A 310 6.039 -11.790 23.498 1.00 19.05 O
-HETATM 2323 O HOH A 311 18.294 -13.615 30.404 1.00 18.03 O
-HETATM 2324 O HOH A 312 4.466 -25.396 25.736 1.00 18.77 O
-HETATM 2325 O HOH A 313 -6.309 -26.069 24.210 1.00 19.97 O
-HETATM 2326 O HOH A 314 19.069 -8.882 30.781 1.00 16.16 O
-HETATM 2327 O HOH A 315 18.817 -16.108 33.989 1.00 22.41 O
-HETATM 2328 O HOH A 316 10.011 -23.278 25.760 1.00 19.18 O
-HETATM 2329 O HOH A 317 18.991 -18.503 7.840 1.00 26.78 O
-HETATM 2330 O HOH A 318 -7.473 -27.703 26.057 1.00 23.41 O
-HETATM 2331 O HOH A 319 -13.465 -11.566 27.451 1.00 17.66 O
-HETATM 2332 O HOH A 320 11.714 -25.598 25.532 1.00 19.10 O
-HETATM 2333 O HOH A 321 13.702 -8.194 22.282 1.00 17.80 O
-HETATM 2334 O HOH A 322 -2.605 -12.728 24.049 1.00 21.07 O
-HETATM 2335 O HOH A 323 -7.669 -27.382 30.103 1.00 21.64 O
-HETATM 2336 O HOH A 324 8.492 -23.381 29.404 1.00 23.75 O
-HETATM 2337 O HOH A 325 -11.446 -14.377 24.890 1.00 23.49 O
-HETATM 2338 O HOH A 326 -7.805 -13.385 19.252 1.00 21.15 O
-HETATM 2339 O HOH A 327 -1.282 -22.004 25.223 1.00 26.61 O
-HETATM 2340 O HOH A 328 10.411 -16.311 26.801 1.00 17.22 O
-HETATM 2341 O HOH A 329 16.385 -22.562 27.462 1.00 18.42 O
-HETATM 2342 O HOH A 330 15.053 -19.043 24.819 1.00 21.28 O
-HETATM 2343 O HOH A 331 -2.033 -23.630 22.810 1.00 20.17 O
-HETATM 2344 O HOH A 332 16.071 -18.702 16.398 1.00 23.35 O
-HETATM 2345 O HOH A 333 11.348 -6.919 22.129 1.00 20.95 O
-HETATM 2346 O HOH A 334 10.900 -18.006 19.817 1.00 19.73 O
-HETATM 2347 O HOH A 335 2.111 -8.782 11.097 1.00 21.76 O
-HETATM 2348 O HOH A 336 15.747 -19.876 27.405 1.00 21.38 O
-HETATM 2349 O HOH A 337 8.435 0.102 28.114 1.00 20.97 O
-HETATM 2350 O HOH A 338 14.119 -13.294 35.691 1.00 24.59 O
-HETATM 2351 O HOH A 339 3.274 -23.071 27.583 1.00 22.54 O
-HETATM 2352 O HOH A 340 3.727 -5.504 27.684 1.00 30.10 O
-HETATM 2353 O HOH A 341 20.299 -15.296 4.898 1.00 27.64 O
-HETATM 2354 O HOH A 342 -7.206 -29.986 29.888 1.00 24.28 O
-HETATM 2355 O HOH A 343 -7.959 -18.152 20.294 1.00 28.57 O
-HETATM 2356 O HOH A 344 8.762 -4.598 30.296 1.00 31.66 O
-HETATM 2357 O HOH A 345 -7.654 -16.035 18.504 1.00 27.53 O
-HETATM 2358 O HOH A 346 5.672 -25.355 30.536 1.00 33.44 O
-HETATM 2359 O HOH A 347 7.619 -6.968 7.308 1.00 28.72 O
-HETATM 2360 O HOH A 348 12.106 -27.183 47.407 1.00 24.32 O
-HETATM 2361 O HOH A 349 0.478 -23.170 21.728 1.00 32.87 O
-HETATM 2362 O HOH A 350 18.157 -15.935 6.506 1.00 25.47 O
-HETATM 2363 O HOH A 351 12.279 -17.795 29.840 1.00 20.42 O
-HETATM 2364 O HOH A 352 14.939 -10.637 35.420 1.00 23.31 O
-HETATM 2365 O HOH A 353 -17.331 -18.796 32.329 1.00 28.26 O
-HETATM 2366 O HOH A 354 -10.692 -19.212 6.721 1.00 31.00 O
-HETATM 2367 O HOH A 355 -10.459 -12.836 28.783 1.00 28.25 O
-HETATM 2368 O HOH A 356 -11.477 -26.875 19.463 1.00 29.65 O
-HETATM 2369 O HOH A 357 16.141 -3.886 4.277 1.00 31.85 O
-HETATM 2370 O HOH A 358 4.524 -23.752 21.031 1.00 29.74 O
-HETATM 2371 O HOH A 359 -10.030 -18.674 11.768 1.00 26.75 O
-HETATM 2372 O HOH A 360 -24.381 -19.610 33.507 1.00 42.24 O
-HETATM 2373 O HOH A 361 0.000 0.000 29.011 1.00 48.27 O
-HETATM 2374 O HOH A 362 4.589 -24.630 46.774 1.00 32.73 O
-HETATM 2375 O HOH A 363 6.578 -32.633 49.463 1.00 37.66 O
-HETATM 2376 O HOH A 364 25.694 -6.688 4.569 1.00 40.03 O
-HETATM 2377 O HOH A 365 1.755 -2.930 26.627 1.00 29.16 O
-HETATM 2378 O HOH A 366 -5.526 -19.104 20.325 1.00 43.77 O
-HETATM 2379 O HOH A 367 -7.843 -16.280 15.397 1.00 34.97 O
-HETATM 2380 O HOH A 368 19.857 -29.108 43.670 1.00 37.84 O
-HETATM 2381 O HOH A 369 -11.211 -17.107 28.043 1.00 35.39 O
-HETATM 2382 O HOH A 370 14.990 0.034 26.464 1.00 36.44 O
-HETATM 2383 O HOH A 371 -8.092 -22.145 19.499 1.00 36.57 O
-HETATM 2384 O HOH A 372 10.405 -22.698 48.281 1.00 43.83 O
-HETATM 2385 O HOH A 373 11.850 -23.603 46.017 1.00 33.68 O
-HETATM 2386 O HOH A 374 4.425 -11.538 20.182 1.00 35.76 O
-HETATM 2387 O HOH A 375 7.444 -13.328 21.435 1.00 32.10 O
-HETATM 2388 O HOH A 376 -2.266 -33.722 16.734 1.00 27.51 O
-HETATM 2389 O HOH A 377 6.830 -21.304 30.790 1.00 40.21 O
-HETATM 2390 O HOH A 378 -2.927 -15.540 24.275 1.00 47.68 O
-HETATM 2391 O HOH A 379 -10.545 -20.059 28.206 1.00 34.03 O
-HETATM 2392 O HOH A 380 -1.346 -12.314 13.279 1.00 43.15 O
-HETATM 2393 O HOH A 381 13.767 -31.917 11.168 1.00 41.20 O
-HETATM 2394 O HOH A 382 17.255 -3.976 35.357 1.00 36.40 O
-HETATM 2395 O HOH A 383 0.396 -4.333 6.326 1.00 39.85 O
-HETATM 2396 O HOH A 384 -12.123 -22.655 35.807 1.00 48.67 O
-HETATM 2397 O HOH A 385 23.092 -24.324 40.946 1.00 47.58 O
-HETATM 2398 O HOH A 386 25.532 -15.924 6.357 1.00 40.32 O
-HETATM 2399 O HOH A 387 13.903 -23.443 52.205 1.00 38.71 O
-HETATM 2400 O HOH A 388 0.585 -6.342 28.179 1.00 38.73 O
-HETATM 2401 O HOH A 389 -6.137 -17.395 25.246 1.00 39.55 O
-HETATM 2402 O HOH A 390 -11.281 -26.866 9.706 1.00 44.19 O
-HETATM 2403 O HOH A 391 15.765 -28.449 56.448 1.00 44.93 O
-HETATM 2404 O HOH A 392 9.171 -8.256 34.890 1.00 41.01 O
-HETATM 2405 O HOH A 393 -6.013 -32.205 10.535 1.00 37.42 O
-HETATM 2406 O HOH A 394 18.746 -31.079 42.115 1.00 49.33 O
-HETATM 2407 O HOH A 395 6.332 -11.876 18.420 1.00 53.49 O
-HETATM 2408 O HOH A 396 8.026 -2.478 31.687 1.00 46.06 O
-HETATM 2409 O HOH A 397 -0.055 -34.380 47.695 1.00 50.52 O
-HETATM 2410 O HOH A 398 21.271 -25.134 5.337 1.00 44.63 O
-HETATM 2411 O HOH A 399 -9.488 -22.353 13.924 1.00 46.80 O
-HETATM 2412 O HOH A 400 15.734 -19.165 9.159 1.00 56.53 O
-HETATM 2413 O HOH A 401 2.338 -26.278 18.066 1.00 41.82 O
-HETATM 2414 O HOH A 402 10.433 -23.644 51.740 1.00 40.08 O
-HETATM 2415 O HOH A 403 12.597 -21.278 37.850 1.00 51.56 O
-HETATM 2416 O HOH A 404 -25.186 -24.967 30.656 1.00 54.32 O
-HETATM 2417 O HOH A 405 18.299 -6.839 40.824 1.00 44.63 O
-HETATM 2418 O HOH A 406 4.650 -23.154 18.361 1.00 75.55 O
-HETATM 2419 O HOH A 407 -0.008 -4.901 30.754 1.00 49.18 O
-HETATM 2420 O HOH A 408 1.872 -33.925 49.640 1.00 57.48 O
-HETATM 2421 O HOH A 409 7.040 -24.438 17.754 1.00 42.07 O
-HETATM 2422 O HOH A 410 -3.254 -13.637 11.943 1.00 48.26 O
-HETATM 2423 O HOH A 411 18.028 -20.224 9.740 1.00 48.76 O
-HETATM 2424 O HOH A 412 25.458 -8.685 6.151 1.00 61.69 O
-HETATM 2425 O HOH A 413 12.316 1.336 29.307 1.00 45.17 O
-HETATM 2426 O HOH A 414 -12.699 -18.312 34.507 1.00 42.63 O
-HETATM 2427 O HOH A 415 16.663 -21.820 11.396 1.00 53.03 O
-HETATM 2428 O HOH A 416 7.348 -12.211 28.736 1.00 39.48 O
-HETATM 2429 O HOH A 417 10.478 -12.015 14.973 1.00 46.65 O
-HETATM 2430 O HOH A 418 -5.879 -30.859 46.808 1.00 48.30 O
-HETATM 2431 O HOH A 419 13.821 -10.350 6.801 1.00 53.86 O
-HETATM 2432 O HOH A 420 10.873 -19.767 38.963 1.00 68.06 O
-HETATM 2433 O HOH A 421 -3.553 -27.075 16.792 1.00 49.89 O
-HETATM 2434 O HOH A 422 -4.659 -28.801 12.842 1.00 61.39 O
-HETATM 2435 O HOH A 423 4.059 -19.738 23.834 1.00 57.43 O
-HETATM 2436 O HOH A 424 0.410 -28.151 30.141 1.00 41.42 O
-HETATM 2437 O HOH A 425 7.366 -39.760 38.638 1.00 50.68 O
-HETATM 2438 O HOH A 426 1.421 -2.870 29.704 1.00 45.66 O
-HETATM 2439 O HOH A 427 -7.977 -18.799 13.558 1.00 51.14 O
-HETATM 2440 O HOH A 428 -9.936 -18.793 30.658 1.00 40.22 O
-HETATM 2441 O HOH A 429 -0.583 -26.657 18.732 1.00 42.31 O
-HETATM 2442 O HOH A 430 9.412 -14.531 34.411 1.00 46.27 O
-HETATM 2443 O HOH A 431 -11.155 -17.058 32.393 1.00 49.31 O
-HETATM 2444 O HOH A 432 4.672 -9.906 30.002 1.00 51.14 O
-HETATM 2445 O HOH A 433 9.764 -22.104 43.517 1.00 61.72 O
-HETATM 2446 O HOH A 434 3.091 -25.536 29.792 1.00 54.50 O
-HETATM 2447 O HOH A 435 -3.234 -19.131 23.927 1.00 48.27 O
-HETATM 2448 O HOH A 436 7.747 -11.972 31.658 1.00 44.09 O
-HETATM 2449 O HOH A 437 -21.260 -27.979 29.311 1.00 52.83 O
-HETATM 2450 O HOH A 438 -3.320 -15.277 14.229 1.00 60.95 O
-HETATM 2451 O HOH A 439 -3.236 -23.883 48.320 1.00 57.64 O
-HETATM 2452 O HOH A 440 6.985 -0.498 5.672 1.00 55.03 O
-HETATM 2453 O HOH A 441 13.244 -18.776 16.145 1.00 47.33 O
-HETATM 2454 O HOH A 442 12.435 -24.416 49.444 1.00 42.38 O
-HETATM 2455 O HOH A 443 11.545 -34.010 48.466 1.00 47.66 O
-HETATM 2456 O HOH A 444 7.079 -16.967 24.430 1.00 44.53 O
-HETATM 2457 O HOH A 445 -13.286 -27.152 39.025 1.00 62.40 O
-HETATM 2458 O HOH A 446 5.906 -18.733 19.699 1.00 74.18 O
-HETATM 2459 O HOH A 447 23.374 -11.624 43.898 1.00 50.06 O
-HETATM 2460 O HOH A 448 8.721 0.013 30.916 1.00 39.51 O
-HETATM 2461 O HOH A 449 -3.066 -8.233 6.997 1.00 53.63 O
-HETATM 2462 O HOH A 450 -7.364 -20.734 29.488 1.00 37.68 O
-HETATM 2463 O HOH A 451 5.654 -12.347 12.613 1.00 53.20 O
-HETATM 2464 O HOH A 452 -8.412 -26.868 14.398 1.00 47.15 O
-HETATM 2465 O HOH A 453 4.183 -22.036 46.452 1.00 58.11 O
-HETATM 2466 O HOH A 454 -16.832 -30.212 5.669 1.00 66.31 O
-HETATM 2467 O HOH A 455 18.868 -33.707 4.064 1.00 70.96 O
-HETATM 2468 O HOH A 456 -3.664 -39.512 36.539 1.00 51.90 O
-HETATM 2469 O HOH A 457 27.016 -12.573 5.049 1.00 76.94 O
-HETATM 2470 O HOH A 458 -25.119 -23.325 33.171 1.00 75.09 O
-HETATM 2471 O HOH A 459 -1.458 -7.896 28.585 1.00 56.50 O
-HETATM 2472 O HOH A 460 11.504 -38.042 43.991 1.00 45.95 O
-HETATM 2473 O HOH A 461 -11.171 -18.623 1.902 1.00 59.14 O
-HETATM 2474 O HOH A 462 10.010 -10.532 10.832 1.00 52.16 O
-HETATM 2475 O HOH A 463 13.737 -7.752 35.913 1.00 35.27 O
-HETATM 2476 O HOH A 464 25.692 -15.689 34.348 1.00 67.65 O
-HETATM 2477 O HOH A 465 15.408 -35.291 2.794 1.00 73.43 O
-HETATM 2478 O HOH A 466 8.907 -34.814 48.496 1.00 57.98 O
-HETATM 2479 O HOH A 467 4.516 -34.612 49.401 1.00 72.32 O
-HETATM 2480 O HOH A 468 -9.019 -15.380 28.445 1.00 70.17 O
-HETATM 2481 O HOH A 469 -10.223 -12.395 26.157 1.00 36.34 O
-HETATM 2482 O HOH A 470 -5.859 -25.485 16.336 1.00 56.33 O
-HETATM 2483 O HOH A 471 13.126 -33.897 4.119 1.00 75.50 O
-HETATM 2484 O HOH A 472 -1.899 -19.466 26.293 1.00 66.81 O
-HETATM 2485 O HOH A 473 -5.232 -26.610 46.500 1.00 54.10 O
-HETATM 2486 O HOH A 474 3.194 -39.452 42.635 1.00 58.95 O
-HETATM 2487 O HOH A 475 5.417 -19.041 32.998 1.00 64.71 O
-HETATM 2488 O HOH A 476 -5.159 -20.076 27.294 1.00 53.66 O
-HETATM 2489 O HOH A 477 -7.560 -20.565 33.886 1.00 74.59 O
-HETATM 2490 O HOH A 478 14.733 -29.399 8.426 1.00 52.60 O
-HETATM 2491 O HOH A 479 12.989 -5.891 3.303 1.00 73.28 O
-HETATM 2492 O HOH A 480 11.888 -4.745 37.090 1.00 79.45 O
-HETATM 2493 O HOH A 481 -9.719 -33.018 3.473 1.00 79.74 O
-HETATM 2494 O HOH A 482 -4.477 -30.281 44.408 1.00 55.45 O
-HETATM 2495 O HOH A 483 23.282 -4.364 40.147 1.00 62.96 O
-HETATM 2496 O HOH A 484 -2.579 -20.233 21.451 1.00 54.07 O
-HETATM 2497 O HOH A 485 -0.965 -23.721 18.378 1.00 69.32 O
-HETATM 2498 O HOH A 486 4.489 -3.984 31.120 1.00 70.03 O
-HETATM 2499 O HOH A 487 8.811 -22.700 16.234 1.00 66.77 O
-HETATM 2500 O HOH A 488 2.660 -12.859 10.427 1.00 58.10 O
-HETATM 2501 O HOH A 489 -1.387 -22.273 29.103 1.00 65.27 O
-HETATM 2502 O HOH A 490 -24.219 -16.069 32.703 1.00 56.86 O
-HETATM 2503 O HOH A 491 13.243 -24.599 13.470 1.00 56.42 O
-HETATM 2504 O HOH A 492 12.805 -39.013 36.774 1.00 56.25 O
-HETATM 2505 O HOH A 493 -9.880 -19.986 9.385 1.00 49.66 O
-HETATM 2506 O HOH A 494 13.601 -14.414 38.762 1.00 62.01 O
-HETATM 2507 O HOH A 495 -3.474 -42.227 33.006 1.00 61.29 O
-HETATM 2508 O HOH A 496 10.775 -20.406 17.335 1.00 61.82 O
-HETATM 2509 O HOH A 497 -16.983 -22.582 4.035 1.00 81.82 O
-HETATM 2510 O HOH A 498 -0.061 -32.045 16.343 1.00 52.03 O
-HETATM 2511 O HOH A 499 1.700 -8.945 27.927 1.00 55.91 O
-HETATM 2512 O HOH A 500 6.985 -35.205 10.094 1.00 54.60 O
-HETATM 2513 O HOH A 501 -18.744 -29.204 33.911 1.00 62.48 O
-HETATM 2514 O HOH A 502 -3.013 -32.508 44.619 1.00 56.15 O
-HETATM 2515 O HOH A 503 -9.599 -26.433 17.708 1.00 47.52 O
-HETATM 2516 O HOH A 504 23.100 -23.126 5.577 1.00 66.96 O
-HETATM 2517 O HOH A 505 -9.245 -18.936 35.479 1.00 88.14 O
-HETATM 2518 O HOH A 506 2.537 -11.203 26.087 1.00 70.57 O
-HETATM 2519 O HOH A 507 25.103 -27.995 42.947 1.00 77.52 O
-HETATM 2520 O HOH A 508 10.413 -40.233 37.531 1.00 68.06 O
-HETATM 2521 O HOH A 509 -0.334 -29.010 17.030 1.00 60.83 O
-HETATM 2522 O HOH A 510 -9.223 -11.719 6.742 1.00 43.72 O
-HETATM 2523 O HOH A 511 -1.417 -2.836 32.189 1.00 64.23 O
-HETATM 2524 O HOH A 512 2.862 -14.652 12.746 1.00 67.86 O
-HETATM 2525 O HOH A 513 -1.741 -11.688 16.055 1.00 48.46 O
-HETATM 2526 O HOH A 514 1.544 -22.784 46.295 1.00 58.53 O
-HETATM 2527 O HOH A 515 18.967 -28.869 46.391 1.00 49.61 O
-HETATM 2528 O HOH A 516 18.900 -1.671 35.946 1.00 63.03 O
-HETATM 2529 O HOH A 517 25.588 -9.757 43.162 1.00 70.54 O
-HETATM 2530 O HOH A 518 -5.187 -16.800 15.371 1.00 71.25 O
-HETATM 2531 O HOH A 519 23.680 -16.891 38.002 1.00 49.95 O
-HETATM 2532 O HOH A 520 22.376 -19.370 38.400 1.00 48.64 O
-HETATM 2533 O HOH A 521 3.024 -14.199 16.344 1.00 66.81 O
-HETATM 2534 O HOH A 522 -20.871 -27.856 37.688 1.00 77.42 O
-HETATM 2535 O HOH A 523 14.349 -31.425 53.433 1.00 76.39 O
-HETATM 2536 O HOH A 524 25.962 -3.949 39.123 1.00 73.03 O
-HETATM 2537 O HOH A 525 -1.900 -17.739 19.749 1.00 77.39 O
-HETATM 2538 O HOH A 526 15.300 -15.636 5.977 1.00 67.58 O
-HETATM 2539 O HOH A 527 14.023 -21.234 12.521 1.00 62.67 O
-HETATM 2540 O HOH A 528 -2.577 -33.369 47.317 1.00 67.32 O
-HETATM 2541 O HOH A 529 3.580 -21.150 21.484 1.00 76.35 O
-HETATM 2542 O HOH A 530 13.429 -0.224 31.429 1.00 66.81 O
-HETATM 2543 O HOH A 531 24.396 -18.463 40.400 1.00 71.46 O
-HETATM 2544 O HOH A 532 8.064 -11.657 35.360 1.00 79.97 O
-HETATM 2545 O HOH A 533 4.163 -19.214 29.519 1.00 65.18 O
-HETATM 2546 O HOH A 534 16.247 -4.931 40.302 1.00 66.98 O
-HETATM 2547 O HOH A 535 -12.361 -20.969 33.706 1.00 57.49 O
-HETATM 2548 O HOH A 536 2.542 -10.157 8.311 1.00 63.19 O
-HETATM 2549 O HOH A 537 -10.391 -21.350 3.340 1.00 61.09 O
-HETATM 2550 O HOH A 538 22.816 -29.263 43.850 1.00 71.51 O
-HETATM 2551 O HOH A 539 1.548 -32.124 14.108 1.00 65.27 O
-HETATM 2552 O HOH A 540 4.442 -14.466 22.488 1.00 66.67 O
-HETATM 2553 O HOH A 541 14.949 -15.727 9.137 1.00 57.15 O
-HETATM 2554 O HOH A 542 -3.841 -17.336 21.933 1.00 73.37 O
-HETATM 2555 O HOH A 543 0.148 -1.579 25.046 1.00 57.28 O
-HETATM 2556 O HOH A 544 1.772 -33.983 12.170 1.00 64.62 O
-HETATM 2557 O HOH A 549 -17.923 -26.775 15.606 1.00 45.08 O
-HETATM 2558 O HOH A 550 23.530 -24.401 25.957 1.00 57.73 O
-HETATM 2559 O HOH A 551 26.759 -24.207 11.635 1.00 54.12 O
-HETATM 2560 O HOH A 552 23.462 -20.651 22.231 1.00 49.12 O
-HETATM 2561 O HOH A 553 -23.391 -27.104 30.643 1.00 53.13 O
-HETATM 2562 O HOH A 554 3.998 -44.799 28.989 1.00 65.70 O
-HETATM 2563 O HOH A 555 -8.344 -38.052 23.422 1.00 51.43 O
-HETATM 2564 O HOH A 556 -19.689 -30.737 11.462 1.00 74.75 O
-HETATM 2565 O HOH A 557 23.241 -22.420 24.265 1.00 58.01 O
-HETATM 2566 O HOH A 558 20.793 -38.159 27.686 1.00 76.00 O
-HETATM 2567 O HOH A 559 25.724 -26.198 13.506 1.00 63.30 O
-HETATM 2568 O HOH A 560 28.575 -20.254 8.172 1.00 78.96 O
-HETATM 2569 O HOH A 561 -6.785 -38.481 21.333 1.00 56.46 O
-HETATM 2570 O HOH A 562 -8.442 -40.548 13.066 1.00 74.14 O
-HETATM 2571 O HOH A 563 5.420 -44.518 31.307 1.00 72.99 O
-HETATM 2572 O HOH A 564 -9.958 -37.743 18.331 1.00 62.33 O
-HETATM 2573 O HOH A 565 -18.589 -32.618 15.228 1.00 72.81 O
-HETATM 2574 O HOH A 566 18.004 -36.417 16.015 1.00 60.73 O
-HETATM 2575 O HOH A 567 -20.827 -28.396 26.744 1.00 60.68 O
-HETATM 2576 O HOH A 568 18.980 -40.765 25.192 1.00 66.66 O
-HETATM 2577 O HOH A 569 20.580 -34.799 24.845 1.00 69.04 O
-HETATM 2578 O HOH A 570 -9.200 -42.458 17.427 1.00 71.01 O
-HETATM 2579 O HOH A 571 9.238 -44.707 26.611 1.00 69.97 O
-HETATM 2580 O HOH A 572 -7.335 -42.291 15.281 1.00 83.29 O
-HETATM 2581 O HOH A 573 -23.107 -27.093 18.628 1.00 74.27 O
-HETATM 2582 O HOH A 574 -4.629 -42.624 14.481 1.00 69.37 O
-HETATM 2583 O HOH A 575 20.398 -33.206 22.405 1.00 58.19 O
-HETATM 2584 O HOH A 576 -9.431 -37.868 15.541 1.00 74.36 O
-HETATM 2585 O HOH A 577 -17.338 -34.648 10.071 1.00 89.58 O
-HETATM 2586 O HOH A 578 22.986 -33.974 26.496 1.00 75.72 O
-HETATM 2587 O HOH A 579 22.497 -27.333 27.869 1.00 68.59 O
-HETATM 2588 O HOH A 580 -10.506 -37.902 25.211 1.00 58.90 O
-HETATM 2589 O HOH A 581 5.670 -43.729 27.194 1.00 69.01 O
-HETATM 2590 O HOH A 582 -22.243 -24.640 11.035 1.00 82.74 O
-CONECT 590 2230
-CONECT 591 2230
-CONECT 693 2231
-CONECT 694 2231
-CONECT 709 2231
-CONECT 710 2231
-CONECT 744 2231
-CONECT 752 2231
-CONECT 807 2230
-CONECT 871 2232
-CONECT 1014 2232
-CONECT 1015 2232
-CONECT 1023 2232
-CONECT 1039 2232
-CONECT 2230 590 591 807 2317
-CONECT 2230 2319 2324 2351
-CONECT 2231 693 694 709 710
-CONECT 2231 744 752 2339 2343
-CONECT 2232 871 1014 1015 1023
-CONECT 2232 1039 2326
-CONECT 2233 2234
-CONECT 2234 2233 2235
-CONECT 2235 2234 2236
-CONECT 2236 2235 2237
-CONECT 2237 2236 2238
-CONECT 2238 2237 2239
-CONECT 2239 2238 2240
-CONECT 2240 2239 2241
-CONECT 2241 2240 2242
-CONECT 2242 2241 2243
-CONECT 2243 2242 2244
-CONECT 2244 2243 2245
-CONECT 2245 2244 2246
-CONECT 2246 2245 2247
-CONECT 2247 2246 2248
-CONECT 2248 2247 2249
-CONECT 2249 2248 2250
-CONECT 2250 2249 2251
-CONECT 2251 2250 2252
-CONECT 2252 2251 2253
-CONECT 2253 2252
-CONECT 2254 2255
-CONECT 2255 2254 2256
-CONECT 2256 2255 2257
-CONECT 2257 2256 2258
-CONECT 2258 2257 2259
-CONECT 2259 2258 2260
-CONECT 2260 2259 2261
-CONECT 2261 2260 2262
-CONECT 2262 2261 2263
-CONECT 2263 2262 2264
-CONECT 2264 2263 2265
-CONECT 2265 2264 2266
-CONECT 2266 2265 2267
-CONECT 2267 2266 2268
-CONECT 2268 2267 2269
-CONECT 2269 2268 2270
-CONECT 2270 2269 2271
-CONECT 2271 2270 2272
-CONECT 2272 2271 2273
-CONECT 2273 2272 2274
-CONECT 2274 2273
-CONECT 2275 2276
-CONECT 2276 2275 2277
-CONECT 2277 2276 2278
-CONECT 2278 2277 2279
-CONECT 2279 2278 2280
-CONECT 2280 2279 2281
-CONECT 2281 2280 2282
-CONECT 2282 2281 2283
-CONECT 2283 2282 2284
-CONECT 2284 2283 2285
-CONECT 2285 2284 2286
-CONECT 2286 2285 2287
-CONECT 2287 2286 2288
-CONECT 2288 2287 2289
-CONECT 2289 2288 2290
-CONECT 2290 2289 2291
-CONECT 2291 2290 2292
-CONECT 2292 2291 2293
-CONECT 2293 2292 2294
-CONECT 2294 2293 2295
-CONECT 2295 2294
-CONECT 2296 2297
-CONECT 2297 2296 2298
-CONECT 2298 2297 2299
-CONECT 2299 2298 2300
-CONECT 2300 2299 2301
-CONECT 2301 2300 2302
-CONECT 2302 2301 2303
-CONECT 2303 2302 2304
-CONECT 2304 2303 2305
-CONECT 2305 2304 2306
-CONECT 2306 2305 2307
-CONECT 2307 2306 2308
-CONECT 2308 2307 2309
-CONECT 2309 2308 2310
-CONECT 2310 2309 2311
-CONECT 2311 2310 2312
-CONECT 2312 2311 2313
-CONECT 2313 2312 2314
-CONECT 2314 2313 2315
-CONECT 2315 2314 2316
-CONECT 2316 2315
-CONECT 2317 2230
-CONECT 2319 2230
-CONECT 2324 2230
-CONECT 2326 2232
-CONECT 2339 2231
-CONECT 2343 2231
-CONECT 2351 2230
-MASTER 438 4 7 3 17 17 9 6 2589 1 111 24
-END
diff --git a/android/examples/Demos/Graphics/Ribbons/data/4HHB.pdb b/android/examples/Demos/Graphics/Ribbons/data/4HHB.pdb
deleted file mode 100644
index 8a55a28865..0000000000
--- a/android/examples/Demos/Graphics/Ribbons/data/4HHB.pdb
+++ /dev/null
@@ -1,5991 +0,0 @@
-HEADER OXYGEN TRANSPORT 07-MAR-84 4HHB
-TITLE THE CRYSTAL STRUCTURE OF HUMAN DEOXYHAEMOGLOBIN AT 1.74
-TITLE 2 ANGSTROMS RESOLUTION
-COMPND MOL_ID: 1;
-COMPND 2 MOLECULE: HEMOGLOBIN (DEOXY) (ALPHA CHAIN);
-COMPND 3 CHAIN: A, C;
-COMPND 4 ENGINEERED: YES;
-COMPND 5 MOL_ID: 2;
-COMPND 6 MOLECULE: HEMOGLOBIN (DEOXY) (BETA CHAIN);
-COMPND 7 CHAIN: B, D;
-COMPND 8 ENGINEERED: YES
-SOURCE MOL_ID: 1;
-SOURCE 2 ORGANISM_SCIENTIFIC: HOMO SAPIENS;
-SOURCE 3 ORGANISM_COMMON: HUMAN;
-SOURCE 4 ORGANISM_TAXID: 9606;
-SOURCE 5 MOL_ID: 2;
-SOURCE 6 ORGANISM_SCIENTIFIC: HOMO SAPIENS;
-SOURCE 7 ORGANISM_COMMON: HUMAN;
-SOURCE 8 ORGANISM_TAXID: 9606
-KEYWDS OXYGEN TRANSPORT
-EXPDTA X-RAY DIFFRACTION
-AUTHOR G.FERMI,M.F.PERUTZ
-REVDAT 4 24-FEB-09 4HHB 1 VERSN
-REVDAT 3 01-APR-03 4HHB 1 JRNL
-REVDAT 2 15-OCT-89 4HHB 3 MTRIX
-REVDAT 1 17-JUL-84 4HHB 0
-SPRSDE 17-JUL-84 4HHB 1HHB
-JRNL AUTH G.FERMI,M.F.PERUTZ,B.SHAANAN,R.FOURME
-JRNL TITL THE CRYSTAL STRUCTURE OF HUMAN DEOXYHAEMOGLOBIN AT
-JRNL TITL 2 1.74 A RESOLUTION
-JRNL REF J.MOL.BIOL. V. 175 159 1984
-JRNL REFN ISSN 0022-2836
-JRNL PMID 6726807
-JRNL DOI 10.1016/0022-2836(84)90472-8
-REMARK 1
-REMARK 1 REFERENCE 1
-REMARK 1 AUTH M.F.PERUTZ,S.S.HASNAIN,P.J.DUKE,J.L.SESSLER,
-REMARK 1 AUTH 2 J.E.HAHN
-REMARK 1 TITL STEREOCHEMISTRY OF IRON IN DEOXYHAEMOGLOBIN
-REMARK 1 REF NATURE V. 295 535 1982
-REMARK 1 REFN ISSN 0028-0836
-REMARK 1 REFERENCE 2
-REMARK 1 AUTH G.FERMI,M.F.PERUTZ
-REMARK 1 REF HAEMOGLOBIN AND MYOGLOBIN. V. 2 1981
-REMARK 1 REF 2 ATLAS OF MOLECULAR
-REMARK 1 REF 3 STRUCTURES IN BIOLOGY
-REMARK 1 PUBL OXFORD UNIVERSITY PRESS
-REMARK 1 REFN
-REMARK 1 REFERENCE 3
-REMARK 1 AUTH M.F.PERUTZ
-REMARK 1 TITL REGULATION OF OXYGEN AFFINITY OF HEMOGLOBIN.
-REMARK 1 TITL 2 INFLUENCE OF STRUCTURE OF THE GLOBIN ON THE HEME
-REMARK 1 TITL 3 IRON
-REMARK 1 REF ANNU.REV.BIOCHEM. V. 48 327 1979
-REMARK 1 REFN ISSN 0066-4154
-REMARK 1 REFERENCE 4
-REMARK 1 AUTH L.F.TENEYCK,A.ARNONE
-REMARK 1 TITL THREE-DIMENSIONAL FOURIER SYNTHESIS OF HUMAN
-REMARK 1 TITL 2 DEOXYHEMOGLOBIN AT 2.5 ANGSTROMS RESOLUTION,
-REMARK 1 TITL 3 I.X-RAY ANALYSIS
-REMARK 1 REF J.MOL.BIOL. V. 100 3 1976
-REMARK 1 REFN ISSN 0022-2836
-REMARK 1 REFERENCE 5
-REMARK 1 AUTH G.FERMI
-REMARK 1 TITL THREE-DIMENSIONAL FOURIER SYNTHESIS OF HUMAN
-REMARK 1 TITL 2 DEOXYHAEMOGLOBIN AT 2.5 ANGSTROMS RESOLUTION,
-REMARK 1 TITL 3 REFINEMENT OF THE ATOMIC MODEL
-REMARK 1 REF J.MOL.BIOL. V. 97 237 1975
-REMARK 1 REFN ISSN 0022-2836
-REMARK 1 REFERENCE 6
-REMARK 1 AUTH H.MUIRHEAD,J.GREER
-REMARK 1 TITL THREE-DIMENSIONAL FOURIER SYNTHESIS OF HUMAN
-REMARK 1 TITL 2 DEOXYHAEMOGLOBIN AT 3.5 ANGSTROMS RESOLUTION
-REMARK 1 REF NATURE V. 228 516 1970
-REMARK 1 REFN ISSN 0028-0836
-REMARK 1 REFERENCE 7
-REMARK 1 EDIT M.O.DAYHOFF
-REMARK 1 REF ATLAS OF PROTEIN SEQUENCE V. 5 56 1972
-REMARK 1 REF 2 AND STRUCTURE (DATA SECTION)
-REMARK 1 PUBL NATIONAL BIOMEDICAL RESEARCH FOUNDATION, SILVER
-REMARK 1 PUBL 2 SPRING,MD.
-REMARK 1 REFN
-REMARK 1 REFERENCE 8
-REMARK 1 EDIT M.O.DAYHOFF
-REMARK 1 REF ATLAS OF PROTEIN SEQUENCE V. 5 64 1972
-REMARK 1 REF 2 AND STRUCTURE (DATA SECTION)
-REMARK 1 PUBL NATIONAL BIOMEDICAL RESEARCH FOUNDATION, SILVER
-REMARK 1 PUBL 2 SPRING,MD.
-REMARK 1 REFN
-REMARK 2
-REMARK 2 RESOLUTION. 1.74 ANGSTROMS.
-REMARK 3
-REMARK 3 REFINEMENT.
-REMARK 3 PROGRAM : NULL
-REMARK 3 AUTHORS : NULL
-REMARK 3
-REMARK 3 DATA USED IN REFINEMENT.
-REMARK 3 RESOLUTION RANGE HIGH (ANGSTROMS) : 1.74
-REMARK 3 RESOLUTION RANGE LOW (ANGSTROMS) : NULL
-REMARK 3 DATA CUTOFF (SIGMA(F)) : NULL
-REMARK 3 DATA CUTOFF HIGH (ABS(F)) : NULL
-REMARK 3 DATA CUTOFF LOW (ABS(F)) : NULL
-REMARK 3 COMPLETENESS (WORKING+TEST) (%) : NULL
-REMARK 3 NUMBER OF REFLECTIONS : NULL
-REMARK 3
-REMARK 3 FIT TO DATA USED IN REFINEMENT.
-REMARK 3 CROSS-VALIDATION METHOD : NULL
-REMARK 3 FREE R VALUE TEST SET SELECTION : NULL
-REMARK 3 R VALUE (WORKING SET) : 0.135
-REMARK 3 FREE R VALUE : NULL
-REMARK 3 FREE R VALUE TEST SET SIZE (%) : NULL
-REMARK 3 FREE R VALUE TEST SET COUNT : NULL
-REMARK 3 ESTIMATED ERROR OF FREE R VALUE : NULL
-REMARK 3
-REMARK 3 FIT IN THE HIGHEST RESOLUTION BIN.
-REMARK 3 TOTAL NUMBER OF BINS USED : NULL
-REMARK 3 BIN RESOLUTION RANGE HIGH (A) : NULL
-REMARK 3 BIN RESOLUTION RANGE LOW (A) : NULL
-REMARK 3 BIN COMPLETENESS (WORKING+TEST) (%) : NULL
-REMARK 3 REFLECTIONS IN BIN (WORKING SET) : NULL
-REMARK 3 BIN R VALUE (WORKING SET) : NULL
-REMARK 3 BIN FREE R VALUE : NULL
-REMARK 3 BIN FREE R VALUE TEST SET SIZE (%) : NULL
-REMARK 3 BIN FREE R VALUE TEST SET COUNT : NULL
-REMARK 3 ESTIMATED ERROR OF BIN FREE R VALUE : NULL
-REMARK 3
-REMARK 3 NUMBER OF NON-HYDROGEN ATOMS USED IN REFINEMENT.
-REMARK 3 PROTEIN ATOMS : 4384
-REMARK 3 NUCLEIC ACID ATOMS : 0
-REMARK 3 HETEROGEN ATOMS : 174
-REMARK 3 SOLVENT ATOMS : 221
-REMARK 3
-REMARK 3 B VALUES.
-REMARK 3 FROM WILSON PLOT (A**2) : NULL
-REMARK 3 MEAN B VALUE (OVERALL, A**2) : NULL
-REMARK 3 OVERALL ANISOTROPIC B VALUE.
-REMARK 3 B11 (A**2) : NULL
-REMARK 3 B22 (A**2) : NULL
-REMARK 3 B33 (A**2) : NULL
-REMARK 3 B12 (A**2) : NULL
-REMARK 3 B13 (A**2) : NULL
-REMARK 3 B23 (A**2) : NULL
-REMARK 3
-REMARK 3 ESTIMATED COORDINATE ERROR.
-REMARK 3 ESD FROM LUZZATI PLOT (A) : NULL
-REMARK 3 ESD FROM SIGMAA (A) : NULL
-REMARK 3 LOW RESOLUTION CUTOFF (A) : NULL
-REMARK 3
-REMARK 3 CROSS-VALIDATED ESTIMATED COORDINATE ERROR.
-REMARK 3 ESD FROM C-V LUZZATI PLOT (A) : NULL
-REMARK 3 ESD FROM C-V SIGMAA (A) : NULL
-REMARK 3
-REMARK 3 RMS DEVIATIONS FROM IDEAL VALUES.
-REMARK 3 BOND LENGTHS (A) : NULL
-REMARK 3 BOND ANGLES (DEGREES) : NULL
-REMARK 3 DIHEDRAL ANGLES (DEGREES) : NULL
-REMARK 3 IMPROPER ANGLES (DEGREES) : NULL
-REMARK 3
-REMARK 3 ISOTROPIC THERMAL MODEL : NULL
-REMARK 3
-REMARK 3 ISOTROPIC THERMAL FACTOR RESTRAINTS. RMS SIGMA
-REMARK 3 MAIN-CHAIN BOND (A**2) : NULL ; NULL
-REMARK 3 MAIN-CHAIN ANGLE (A**2) : NULL ; NULL
-REMARK 3 SIDE-CHAIN BOND (A**2) : NULL ; NULL
-REMARK 3 SIDE-CHAIN ANGLE (A**2) : NULL ; NULL
-REMARK 3
-REMARK 3 NCS MODEL : NULL
-REMARK 3
-REMARK 3 NCS RESTRAINTS. RMS SIGMA/WEIGHT
-REMARK 3 GROUP 1 POSITIONAL (A) : NULL ; NULL
-REMARK 3 GROUP 1 B-FACTOR (A**2) : NULL ; NULL
-REMARK 3
-REMARK 3 PARAMETER FILE 1 : NULL
-REMARK 3 TOPOLOGY FILE 1 : NULL
-REMARK 3
-REMARK 3 OTHER REFINEMENT REMARKS: THE COORDINATES GIVEN HERE ARE IN
-REMARK 3 THE ORTHOGONAL ANGSTROM SYSTEM STANDARD FOR HEMOGLOBINS. THE Y
-REMARK 3 AXIS IS THE (NON CRYSTALLOGRAPHIC) MOLECULAR DIAD AND THE X
-REMARK 3 AXIS IS THE PSEUDO DIAD WHICH RELATES THE ALPHA-1 AND BETA-1
-REMARK 3 CHAINS. THE TRANSFORMATION GIVEN IN THE *MTRIX* RECORDS BELOW
-REMARK 3 WILL GENERATE COORDINATES FOR THE *C* AND *D* CHAINS FROM THE
-REMARK 3 *A* AND *B* CHAINS RESPECTIVELY.
-REMARK 4
-REMARK 4 4HHB COMPLIES WITH FORMAT V. 3.15, 01-DEC-08
-REMARK 100
-REMARK 100 THIS ENTRY HAS BEEN PROCESSED BY BNL.
-REMARK 200
-REMARK 200 EXPERIMENTAL DETAILS
-REMARK 200 EXPERIMENT TYPE : X-RAY DIFFRACTION
-REMARK 200 DATE OF DATA COLLECTION : NULL
-REMARK 200 TEMPERATURE (KELVIN) : NULL
-REMARK 200 PH : NULL
-REMARK 200 NUMBER OF CRYSTALS USED : NULL
-REMARK 200
-REMARK 200 SYNCHROTRON (Y/N) : NULL
-REMARK 200 RADIATION SOURCE : NULL
-REMARK 200 BEAMLINE : NULL
-REMARK 200 X-RAY GENERATOR MODEL : NULL
-REMARK 200 MONOCHROMATIC OR LAUE (M/L) : NULL
-REMARK 200 WAVELENGTH OR RANGE (A) : NULL
-REMARK 200 MONOCHROMATOR : NULL
-REMARK 200 OPTICS : NULL
-REMARK 200
-REMARK 200 DETECTOR TYPE : NULL
-REMARK 200 DETECTOR MANUFACTURER : NULL
-REMARK 200 INTENSITY-INTEGRATION SOFTWARE : NULL
-REMARK 200 DATA SCALING SOFTWARE : NULL
-REMARK 200
-REMARK 200 NUMBER OF UNIQUE REFLECTIONS : NULL
-REMARK 200 RESOLUTION RANGE HIGH (A) : NULL
-REMARK 200 RESOLUTION RANGE LOW (A) : NULL
-REMARK 200 REJECTION CRITERIA (SIGMA(I)) : NULL
-REMARK 200
-REMARK 200 OVERALL.
-REMARK 200 COMPLETENESS FOR RANGE (%) : NULL
-REMARK 200 DATA REDUNDANCY : NULL
-REMARK 200 R MERGE (I) : NULL
-REMARK 200 R SYM (I) : NULL
-REMARK 200 FOR THE DATA SET : NULL
-REMARK 200
-REMARK 200 IN THE HIGHEST RESOLUTION SHELL.
-REMARK 200 HIGHEST RESOLUTION SHELL, RANGE HIGH (A) : NULL
-REMARK 200 HIGHEST RESOLUTION SHELL, RANGE LOW (A) : NULL
-REMARK 200 COMPLETENESS FOR SHELL (%) : NULL
-REMARK 200 DATA REDUNDANCY IN SHELL : NULL
-REMARK 200 R MERGE FOR SHELL (I) : NULL
-REMARK 200 R SYM FOR SHELL (I) : NULL
-REMARK 200 FOR SHELL : NULL
-REMARK 200
-REMARK 200 DIFFRACTION PROTOCOL: NULL
-REMARK 200 METHOD USED TO DETERMINE THE STRUCTURE: NULL
-REMARK 200 SOFTWARE USED: NULL
-REMARK 200 STARTING MODEL: NULL
-REMARK 200
-REMARK 200 REMARK: NULL
-REMARK 280
-REMARK 280 CRYSTAL
-REMARK 280 SOLVENT CONTENT, VS (%): 45.48
-REMARK 280 MATTHEWS COEFFICIENT, VM (ANGSTROMS**3/DA): 2.26
-REMARK 280
-REMARK 280 CRYSTALLIZATION CONDITIONS: NULL
-REMARK 290
-REMARK 290 CRYSTALLOGRAPHIC SYMMETRY
-REMARK 290 SYMMETRY OPERATORS FOR SPACE GROUP: P 1 21 1
-REMARK 290
-REMARK 290 SYMOP SYMMETRY
-REMARK 290 NNNMMM OPERATOR
-REMARK 290 1555 X,Y,Z
-REMARK 290 2555 -X,Y+1/2,-Z
-REMARK 290
-REMARK 290 WHERE NNN -> OPERATOR NUMBER
-REMARK 290 MMM -> TRANSLATION VECTOR
-REMARK 290
-REMARK 290 CRYSTALLOGRAPHIC SYMMETRY TRANSFORMATIONS
-REMARK 290 THE FOLLOWING TRANSFORMATIONS OPERATE ON THE ATOM/HETATM
-REMARK 290 RECORDS IN THIS ENTRY TO PRODUCE CRYSTALLOGRAPHICALLY
-REMARK 290 RELATED MOLECULES.
-REMARK 290 SMTRY1 1 1.000000 0.000000 0.000000 0.00000
-REMARK 290 SMTRY2 1 0.000000 1.000000 0.000000 0.00000
-REMARK 290 SMTRY3 1 0.000000 0.000000 1.000000 0.00000
-REMARK 290 SMTRY1 2 -0.949456 -0.312801 -0.025883 -6.64347
-REMARK 290 SMTRY2 2 -0.312858 0.936202 0.160212 41.12228
-REMARK 290 SMTRY3 2 -0.025884 0.160188 -0.986745 3.40218
-REMARK 290
-REMARK 290 REMARK: NULL
-REMARK 300
-REMARK 300 BIOMOLECULE: 1
-REMARK 300 SEE REMARK 350 FOR THE AUTHOR PROVIDED AND/OR PROGRAM
-REMARK 300 GENERATED ASSEMBLY INFORMATION FOR THE STRUCTURE IN
-REMARK 300 THIS ENTRY. THE REMARK MAY ALSO PROVIDE INFORMATION ON
-REMARK 300 BURIED SURFACE AREA.
-REMARK 350
-REMARK 350 COORDINATES FOR A COMPLETE MULTIMER REPRESENTING THE KNOWN
-REMARK 350 BIOLOGICALLY SIGNIFICANT OLIGOMERIZATION STATE OF THE
-REMARK 350 MOLECULE CAN BE GENERATED BY APPLYING BIOMT TRANSFORMATIONS
-REMARK 350 GIVEN BELOW. BOTH NON-CRYSTALLOGRAPHIC AND
-REMARK 350 CRYSTALLOGRAPHIC OPERATIONS ARE GIVEN.
-REMARK 350
-REMARK 350 BIOMOLECULE: 1
-REMARK 350 AUTHOR DETERMINED BIOLOGICAL UNIT: TETRAMERIC
-REMARK 350 SOFTWARE DETERMINED QUATERNARY STRUCTURE: TETRAMERIC
-REMARK 350 SOFTWARE USED: PISA
-REMARK 350 TOTAL BURIED SURFACE AREA: 11630 ANGSTROM**2
-REMARK 350 SURFACE AREA OF THE COMPLEX: 24010 ANGSTROM**2
-REMARK 350 CHANGE IN SOLVENT FREE ENERGY: -98.0 KCAL/MOL
-REMARK 350 APPLY THE FOLLOWING TO CHAINS: A, B, C, D
-REMARK 350 BIOMT1 1 1.000000 0.000000 0.000000 0.00000
-REMARK 350 BIOMT2 1 0.000000 1.000000 0.000000 0.00000
-REMARK 350 BIOMT3 1 0.000000 0.000000 1.000000 0.00000
-REMARK 500
-REMARK 500 GEOMETRY AND STEREOCHEMISTRY
-REMARK 500 SUBTOPIC: CLOSE CONTACTS IN SAME ASYMMETRIC UNIT
-REMARK 500
-REMARK 500 THE FOLLOWING ATOMS ARE IN CLOSE CONTACT.
-REMARK 500
-REMARK 500 ATM1 RES C SSEQI ATM2 RES C SSEQI DISTANCE
-REMARK 500 CB THR D 4 OE2 GLU D 6 2.00
-REMARK 500 NZ LYS D 66 O1A HEM D 148 2.06
-REMARK 500 OD2 ASP D 73 O HOH D 174 2.10
-REMARK 500 OG1 THR D 4 OE2 GLU D 6 2.19
-REMARK 500
-REMARK 500 REMARK: NULL
-REMARK 500
-REMARK 500 GEOMETRY AND STEREOCHEMISTRY
-REMARK 500 SUBTOPIC: CLOSE CONTACTS
-REMARK 500
-REMARK 500 THE FOLLOWING ATOMS THAT ARE RELATED BY CRYSTALLOGRAPHIC
-REMARK 500 SYMMETRY ARE IN CLOSE CONTACT. AN ATOM LOCATED WITHIN 0.15
-REMARK 500 ANGSTROMS OF A SYMMETRY RELATED ATOM IS ASSUMED TO BE ON A
-REMARK 500 SPECIAL POSITION AND IS, THEREFORE, LISTED IN REMARK 375
-REMARK 500 INSTEAD OF REMARK 500. ATOMS WITH NON-BLANK ALTERNATE
-REMARK 500 LOCATION INDICATORS ARE NOT INCLUDED IN THE CALCULATIONS.
-REMARK 500
-REMARK 500 DISTANCE CUTOFF:
-REMARK 500 2.2 ANGSTROMS FOR CONTACTS NOT INVOLVING HYDROGEN ATOMS
-REMARK 500 1.6 ANGSTROMS FOR CONTACTS INVOLVING HYDROGEN ATOMS
-REMARK 500
-REMARK 500 ATM1 RES C SSEQI ATM2 RES C SSEQI SSYMOP DISTANCE
-REMARK 500 OD2 ASP C 85 O HOH B 204 2657 1.41
-REMARK 500 O HOH B 204 O HOH C 161 2647 2.02
-REMARK 500
-REMARK 500 REMARK: NULL
-REMARK 500
-REMARK 500 GEOMETRY AND STEREOCHEMISTRY
-REMARK 500 SUBTOPIC: COVALENT BOND LENGTHS
-REMARK 500
-REMARK 500 THE STEREOCHEMICAL PARAMETERS OF THE FOLLOWING RESIDUES
-REMARK 500 HAVE VALUES WHICH DEVIATE FROM EXPECTED VALUES BY MORE
-REMARK 500 THAN 6*RMSD (M=MODEL NUMBER; RES=RESIDUE NAME; C=CHAIN
-REMARK 500 IDENTIFIER; SSEQ=SEQUENCE NUMBER; I=INSERTION CODE).
-REMARK 500
-REMARK 500 STANDARD TABLE:
-REMARK 500 FORMAT: (10X,I3,1X,2(A3,1X,A1,I4,A1,1X,A4,3X),1X,F6.3)
-REMARK 500
-REMARK 500 EXPECTED VALUES PROTEIN: ENGH AND HUBER, 1999
-REMARK 500 EXPECTED VALUES NUCLEIC ACID: CLOWNEY ET AL 1996
-REMARK 500
-REMARK 500 M RES CSSEQI ATM1 RES CSSEQI ATM2 DEVIATION
-REMARK 500 VAL A 1 N VAL A 1 CA -0.295
-REMARK 500 VAL A 1 CA VAL A 1 CB 0.299
-REMARK 500 VAL A 1 CB VAL A 1 CG1 -0.206
-REMARK 500 VAL A 1 CB VAL A 1 CG2 -0.283
-REMARK 500 LEU A 2 CA LEU A 2 C 0.249
-REMARK 500 SER A 3 N SER A 3 CA 0.167
-REMARK 500 SER A 3 CB SER A 3 OG -0.132
-REMARK 500 LEU A 2 C SER A 3 N -0.320
-REMARK 500 PRO A 4 N PRO A 4 CA -0.149
-REMARK 500 PRO A 4 CA PRO A 4 CB 0.200
-REMARK 500 SER A 3 C PRO A 4 N 0.282
-REMARK 500 ALA A 5 N ALA A 5 CA -0.130
-REMARK 500 ALA A 5 CA ALA A 5 CB 0.247
-REMARK 500 PRO A 4 C ALA A 5 N 0.257
-REMARK 500 LYS A 7 N LYS A 7 CA 0.157
-REMARK 500 THR A 8 CA THR A 8 CB 0.178
-REMARK 500 THR A 8 CB THR A 8 OG1 -0.173
-REMARK 500 THR A 8 CB THR A 8 CG2 -0.245
-REMARK 500 THR A 8 CA THR A 8 C -0.174
-REMARK 500 LYS A 7 C THR A 8 N 0.258
-REMARK 500 THR A 8 C ASN A 9 N 0.179
-REMARK 500 VAL A 10 CB VAL A 10 CG2 -0.179
-REMARK 500 VAL A 10 CA VAL A 10 C 0.160
-REMARK 500 LYS A 11 N LYS A 11 CA 0.131
-REMARK 500 LYS A 11 CA LYS A 11 CB -0.137
-REMARK 500 LYS A 11 CB LYS A 11 CG -0.196
-REMARK 500 LYS A 11 CG LYS A 11 CD -0.206
-REMARK 500 LYS A 11 CD LYS A 11 CE 0.454
-REMARK 500 ALA A 12 N ALA A 12 CA -0.133
-REMARK 500 ALA A 12 C ALA A 12 O 0.225
-REMARK 500 ALA A 13 CA ALA A 13 C 0.201
-REMARK 500 TRP A 14 CA TRP A 14 CB 0.291
-REMARK 500 TRP A 14 CB TRP A 14 CG -0.274
-REMARK 500 TRP A 14 CG TRP A 14 CD1 0.306
-REMARK 500 TRP A 14 CD1 TRP A 14 NE1 0.158
-REMARK 500 TRP A 14 NE1 TRP A 14 CE2 -0.234
-REMARK 500 TRP A 14 CE2 TRP A 14 CZ2 -0.243
-REMARK 500 TRP A 14 CE2 TRP A 14 CD2 0.221
-REMARK 500 TRP A 14 CH2 TRP A 14 CZ2 -0.217
-REMARK 500 GLY A 15 CA GLY A 15 C 0.182
-REMARK 500 GLY A 15 C GLY A 15 O 0.437
-REMARK 500 LYS A 16 CB LYS A 16 CG 0.164
-REMARK 500 LYS A 16 CG LYS A 16 CD 0.488
-REMARK 500 LYS A 16 CD LYS A 16 CE 0.410
-REMARK 500 LYS A 16 C LYS A 16 O -0.149
-REMARK 500 GLY A 15 C LYS A 16 N -0.418
-REMARK 500 VAL A 17 N VAL A 17 CA -0.191
-REMARK 500 VAL A 17 CA VAL A 17 CB -0.168
-REMARK 500 VAL A 17 CA VAL A 17 C 0.432
-REMARK 500 VAL A 17 C VAL A 17 O -0.483
-REMARK 500
-REMARK 500 THIS ENTRY HAS 1277 BOND DEVIATIONS.
-REMARK 500
-REMARK 500 REMARK: NULL
-REMARK 500
-REMARK 500 GEOMETRY AND STEREOCHEMISTRY
-REMARK 500 SUBTOPIC: COVALENT BOND ANGLES
-REMARK 500
-REMARK 500 THE STEREOCHEMICAL PARAMETERS OF THE FOLLOWING RESIDUES
-REMARK 500 HAVE VALUES WHICH DEVIATE FROM EXPECTED VALUES BY MORE
-REMARK 500 THAN 6*RMSD (M=MODEL NUMBER; RES=RESIDUE NAME; C=CHAIN
-REMARK 500 IDENTIFIER; SSEQ=SEQUENCE NUMBER; I=INSERTION CODE).
-REMARK 500
-REMARK 500 STANDARD TABLE:
-REMARK 500 FORMAT: (10X,I3,1X,A3,1X,A1,I4,A1,3(1X,A4,2X),12X,F5.1)
-REMARK 500
-REMARK 500 EXPECTED VALUES PROTEIN: ENGH AND HUBER, 1999
-REMARK 500 EXPECTED VALUES NUCLEIC ACID: CLOWNEY ET AL 1996
-REMARK 500
-REMARK 500 M RES CSSEQI ATM1 ATM2 ATM3
-REMARK 500 VAL A 1 CG1 - CB - CG2 ANGL. DEV. = 27.5 DEGREES
-REMARK 500 VAL A 1 CA - CB - CG2 ANGL. DEV. = -25.9 DEGREES
-REMARK 500 LEU A 2 N - CA - CB ANGL. DEV. = -17.9 DEGREES
-REMARK 500 LEU A 2 CB - CG - CD1 ANGL. DEV. = 13.0 DEGREES
-REMARK 500 LEU A 2 CA - C - O ANGL. DEV. = -21.8 DEGREES
-REMARK 500 VAL A 1 CA - C - N ANGL. DEV. = -13.3 DEGREES
-REMARK 500 VAL A 1 O - C - N ANGL. DEV. = 12.7 DEGREES
-REMARK 500 LEU A 2 C - N - CA ANGL. DEV. = -20.6 DEGREES
-REMARK 500 SER A 3 N - CA - CB ANGL. DEV. = -9.7 DEGREES
-REMARK 500 SER A 3 CA - C - O ANGL. DEV. = 15.9 DEGREES
-REMARK 500 LEU A 2 O - C - N ANGL. DEV. = 30.2 DEGREES
-REMARK 500 PRO A 4 CB - CA - C ANGL. DEV. = -30.7 DEGREES
-REMARK 500 PRO A 4 CA - CB - CG ANGL. DEV. = -14.9 DEGREES
-REMARK 500 PRO A 4 N - CD - CG ANGL. DEV. = -12.4 DEGREES
-REMARK 500 SER A 3 O - C - N ANGL. DEV. = -14.6 DEGREES
-REMARK 500 PRO A 4 C - N - CA ANGL. DEV. = -14.1 DEGREES
-REMARK 500 ALA A 5 CB - CA - C ANGL. DEV. = -10.8 DEGREES
-REMARK 500 PRO A 4 O - C - N ANGL. DEV. = -9.9 DEGREES
-REMARK 500 ASP A 6 CB - CG - OD1 ANGL. DEV. = 6.5 DEGREES
-REMARK 500 ASP A 6 CB - CG - OD2 ANGL. DEV. = -8.8 DEGREES
-REMARK 500 LYS A 7 N - CA - CB ANGL. DEV. = -13.5 DEGREES
-REMARK 500 LYS A 7 CD - CE - NZ ANGL. DEV. = -27.4 DEGREES
-REMARK 500 LYS A 7 N - CA - C ANGL. DEV. = 22.1 DEGREES
-REMARK 500 ASP A 6 O - C - N ANGL. DEV. = 14.8 DEGREES
-REMARK 500 LYS A 7 C - N - CA ANGL. DEV. = -20.2 DEGREES
-REMARK 500 THR A 8 CA - CB - CG2 ANGL. DEV. = -10.7 DEGREES
-REMARK 500 THR A 8 CA - C - O ANGL. DEV. = 21.3 DEGREES
-REMARK 500 LYS A 7 CA - C - N ANGL. DEV. = -20.1 DEGREES
-REMARK 500 THR A 8 C - N - CA ANGL. DEV. = -15.7 DEGREES
-REMARK 500 VAL A 10 O - C - N ANGL. DEV. = 11.4 DEGREES
-REMARK 500 ALA A 12 CB - CA - C ANGL. DEV. = -29.5 DEGREES
-REMARK 500 ALA A 12 N - CA - CB ANGL. DEV. = -14.5 DEGREES
-REMARK 500 ALA A 12 C - N - CA ANGL. DEV. = -22.9 DEGREES
-REMARK 500 ALA A 12 O - C - N ANGL. DEV. = -25.9 DEGREES
-REMARK 500 TRP A 14 CA - CB - CG ANGL. DEV. = -22.4 DEGREES
-REMARK 500 TRP A 14 CG - CD1 - NE1 ANGL. DEV. = -13.5 DEGREES
-REMARK 500 TRP A 14 CD1 - NE1 - CE2 ANGL. DEV. = 19.8 DEGREES
-REMARK 500 TRP A 14 NE1 - CE2 - CZ2 ANGL. DEV. = 11.2 DEGREES
-REMARK 500 TRP A 14 CH2 - CZ2 - CE2 ANGL. DEV. = 13.2 DEGREES
-REMARK 500 ALA A 13 O - C - N ANGL. DEV. = 13.6 DEGREES
-REMARK 500 GLY A 15 N - CA - C ANGL. DEV. = -24.3 DEGREES
-REMARK 500 GLY A 15 CA - C - O ANGL. DEV. = -21.6 DEGREES
-REMARK 500 GLY A 15 C - N - CA ANGL. DEV. = -19.0 DEGREES
-REMARK 500 LYS A 16 N - CA - CB ANGL. DEV. = 14.8 DEGREES
-REMARK 500 LYS A 16 CG - CD - CE ANGL. DEV. = -48.6 DEGREES
-REMARK 500 LYS A 16 CD - CE - NZ ANGL. DEV. = 17.9 DEGREES
-REMARK 500 GLY A 15 CA - C - N ANGL. DEV. = 25.6 DEGREES
-REMARK 500 GLY A 15 O - C - N ANGL. DEV. = -10.0 DEGREES
-REMARK 500 LYS A 16 C - N - CA ANGL. DEV. = 15.1 DEGREES
-REMARK 500 VAL A 17 N - CA - CB ANGL. DEV. = 15.3 DEGREES
-REMARK 500
-REMARK 500 THIS ENTRY HAS 1473 ANGLE DEVIATIONS.
-REMARK 500
-REMARK 500 REMARK: NULL
-REMARK 500
-REMARK 500 GEOMETRY AND STEREOCHEMISTRY
-REMARK 500 SUBTOPIC: TORSION ANGLES
-REMARK 500
-REMARK 500 TORSION ANGLES OUTSIDE THE EXPECTED RAMACHANDRAN REGIONS:
-REMARK 500 (M=MODEL NUMBER; RES=RESIDUE NAME; C=CHAIN IDENTIFIER;
-REMARK 500 SSEQ=SEQUENCE NUMBER; I=INSERTION CODE).
-REMARK 500
-REMARK 500 STANDARD TABLE:
-REMARK 500 FORMAT:(10X,I3,1X,A3,1X,A1,I4,A1,4X,F7.2,3X,F7.2)
-REMARK 500
-REMARK 500 EXPECTED VALUES: GJ KLEYWEGT AND TA JONES (1996). PHI/PSI-
-REMARK 500 CHOLOGY: RAMACHANDRAN REVISITED. STRUCTURE 4, 1395 - 1400
-REMARK 500
-REMARK 500 M RES CSSEQI PSI PHI
-REMARK 500 SER A 3 -176.01 -60.80
-REMARK 500 LYS A 16 -55.41 -1.55
-REMARK 500 ALA A 21 -76.55 -47.40
-REMARK 500 LEU A 48 40.81 -103.90
-REMARK 500 SER A 52 150.87 -47.80
-REMARK 500 HIS A 122 -70.12 -41.02
-REMARK 500 THR B 4 -176.32 -55.07
-REMARK 500 GLU B 7 -71.39 -64.26
-REMARK 500 PHE B 45 -9.16 -52.07
-REMARK 500 ASN B 80 59.72 -142.35
-REMARK 500 TYR B 145 130.62 -35.71
-REMARK 500 SER C 3 172.94 -57.29
-REMARK 500 VAL C 17 -70.34 -65.44
-REMARK 500 LEU C 48 32.06 -92.63
-REMARK 500 ASP C 75 72.45 -151.27
-REMARK 500 LYS C 90 -77.18 -122.52
-REMARK 500 LEU C 113 71.25 -107.78
-REMARK 500 LEU D 3 -163.80 -100.24
-REMARK 500 ASN D 19 94.43 -63.05
-REMARK 500 GLN D 39 0.49 -67.48
-REMARK 500 SER D 72 -71.73 -40.75
-REMARK 500 ASP D 73 -43.09 -22.67
-REMARK 500 ALA D 76 7.73 -63.28
-REMARK 500 HIS D 77 62.58 -172.71
-REMARK 500 LEU D 78 -50.86 -25.69
-REMARK 500 ASN D 80 85.05 -167.04
-REMARK 500 HIS D 97 35.26 76.08
-REMARK 500
-REMARK 500 REMARK: NULL
-REMARK 500
-REMARK 500 GEOMETRY AND STEREOCHEMISTRY
-REMARK 500 SUBTOPIC: NON-CIS, NON-TRANS
-REMARK 500
-REMARK 500 THE FOLLOWING PEPTIDE BONDS DEVIATE SIGNIFICANTLY FROM BOTH
-REMARK 500 CIS AND TRANS CONFORMATION. CIS BONDS, IF ANY, ARE LISTED
-REMARK 500 ON CISPEP RECORDS. TRANS IS DEFINED AS 180 +/- 30 AND
-REMARK 500 CIS IS DEFINED AS 0 +/- 30 DEGREES.
-REMARK 500 MODEL OMEGA
-REMARK 500 GLY A 18 ALA A 19 -145.49
-REMARK 500 SER B 49 THR B 50 113.74
-REMARK 500 LEU D 3 THR D 4 148.65
-REMARK 500 VAL D 18 ASN D 19 148.41
-REMARK 500 LEU D 48 SER D 49 -144.37
-REMARK 500 SER D 49 THR D 50 143.57
-REMARK 500
-REMARK 500 REMARK: NULL
-REMARK 500
-REMARK 500 GEOMETRY AND STEREOCHEMISTRY
-REMARK 500 SUBTOPIC: PLANAR GROUPS
-REMARK 500
-REMARK 500 PLANAR GROUPS IN THE FOLLOWING RESIDUES HAVE A TOTAL
-REMARK 500 RMS DISTANCE OF ALL ATOMS FROM THE BEST-FIT PLANE
-REMARK 500 BY MORE THAN AN EXPECTED VALUE OF 6*RMSD, WITH AN
-REMARK 500 RMSD 0.02 ANGSTROMS, OR AT LEAST ONE ATOM HAS
-REMARK 500 AN RMSD GREATER THAN THIS VALUE
-REMARK 500 (M=MODEL NUMBER; RES=RESIDUE NAME; C=CHAIN IDENTIFIER;
-REMARK 500 SSEQ=SEQUENCE NUMBER; I=INSERTION CODE).
-REMARK 500
-REMARK 500 M RES CSSEQI RMS TYPE
-REMARK 500 HIS A 20 0.17 SIDE_CHAIN
-REMARK 500 GLU A 23 0.25 SIDE_CHAIN
-REMARK 500 TYR A 24 0.10 SIDE_CHAIN
-REMARK 500 PHE A 36 0.09 SIDE_CHAIN
-REMARK 500 HIS A 45 0.11 SIDE_CHAIN
-REMARK 500 HIS A 50 0.20 SIDE_CHAIN
-REMARK 500 GLN A 54 0.10 SIDE_CHAIN
-REMARK 500 ASP A 64 0.14 SIDE_CHAIN
-REMARK 500 HIS A 72 0.24 SIDE_CHAIN
-REMARK 500 ASN A 78 0.08 SIDE_CHAIN
-REMARK 500 ASP A 85 0.09 SIDE_CHAIN
-REMARK 500 ARG A 92 0.08 SIDE_CHAIN
-REMARK 500 ASP A 126 0.10 SIDE_CHAIN
-REMARK 500 ARG A 141 0.08 SIDE_CHAIN
-REMARK 500 HIS B 2 0.16 SIDE_CHAIN
-REMARK 500 GLU B 6 0.16 SIDE_CHAIN
-REMARK 500 ASN B 19 0.08 SIDE_CHAIN
-REMARK 500 ASP B 21 0.15 SIDE_CHAIN
-REMARK 500 GLU B 22 0.51 SIDE_CHAIN
-REMARK 500 GLU B 26 0.38 SIDE_CHAIN
-REMARK 500 ASP B 47 0.14 SIDE_CHAIN
-REMARK 500 ASP B 52 0.19 SIDE_CHAIN
-REMARK 500 HIS B 63 0.11 SIDE_CHAIN
-REMARK 500 ASP B 79 0.11 SIDE_CHAIN
-REMARK 500 ASN B 80 0.20 SIDE_CHAIN
-REMARK 500 GLU B 90 0.15 SIDE_CHAIN
-REMARK 500 ARG B 104 0.39 SIDE_CHAIN
-REMARK 500 HIS B 117 0.22 SIDE_CHAIN
-REMARK 500 PHE B 118 0.13 SIDE_CHAIN
-REMARK 500 GLU B 121 0.26 SIDE_CHAIN
-REMARK 500 HIS B 143 0.10 SIDE_CHAIN
-REMARK 500 HIS B 146 0.31 SIDE_CHAIN
-REMARK 500 ASN C 9 0.08 SIDE_CHAIN
-REMARK 500 HIS C 20 0.14 SIDE_CHAIN
-REMARK 500 GLU C 23 0.30 SIDE_CHAIN
-REMARK 500 HIS C 45 0.10 SIDE_CHAIN
-REMARK 500 PHE C 46 0.10 SIDE_CHAIN
-REMARK 500 ASP C 47 0.15 SIDE_CHAIN
-REMARK 500 ASP C 64 0.08 SIDE_CHAIN
-REMARK 500 ASP C 75 0.07 SIDE_CHAIN
-REMARK 500 ASN C 78 0.11 SIDE_CHAIN
-REMARK 500 ARG C 92 0.20 SIDE_CHAIN
-REMARK 500 GLU C 116 0.09 SIDE_CHAIN
-REMARK 500 ASP C 126 0.11 SIDE_CHAIN
-REMARK 500 ARG C 141 0.08 SIDE_CHAIN
-REMARK 500 HIS D 2 0.10 SIDE_CHAIN
-REMARK 500 GLU D 6 0.17 SIDE_CHAIN
-REMARK 500 GLU D 7 0.10 SIDE_CHAIN
-REMARK 500 ASN D 19 0.38 SIDE_CHAIN
-REMARK 500 ASP D 21 0.18 SIDE_CHAIN
-REMARK 500 GLU D 22 0.21 SIDE_CHAIN
-REMARK 500 GLU D 26 0.54 SIDE_CHAIN
-REMARK 500 ARG D 40 0.12 SIDE_CHAIN
-REMARK 500 GLU D 43 0.15 SIDE_CHAIN
-REMARK 500 ASP D 52 0.33 SIDE_CHAIN
-REMARK 500 HIS D 63 0.18 SIDE_CHAIN
-REMARK 500 HIS D 77 0.14 SIDE_CHAIN
-REMARK 500 ASP D 79 0.33 SIDE_CHAIN
-REMARK 500 GLU D 90 0.34 SIDE_CHAIN
-REMARK 500 HIS D 92 0.08 SIDE_CHAIN
-REMARK 500 ASP D 94 0.08 SIDE_CHAIN
-REMARK 500 GLU D 101 0.10 SIDE_CHAIN
-REMARK 500 ARG D 104 0.29 SIDE_CHAIN
-REMARK 500 ASN D 108 0.10 SIDE_CHAIN
-REMARK 500 HIS D 117 0.08 SIDE_CHAIN
-REMARK 500 PHE D 118 0.10 SIDE_CHAIN
-REMARK 500 GLU D 121 0.32 SIDE_CHAIN
-REMARK 500 GLN D 127 0.07 SIDE_CHAIN
-REMARK 500 ASN D 139 0.21 SIDE_CHAIN
-REMARK 500 HIS D 143 0.09 SIDE_CHAIN
-REMARK 500 HIS D 146 0.10 SIDE_CHAIN
-REMARK 500
-REMARK 500 REMARK: NULL
-REMARK 500
-REMARK 500 GEOMETRY AND STEREOCHEMISTRY
-REMARK 500 SUBTOPIC: MAIN CHAIN PLANARITY
-REMARK 500
-REMARK 500 THE FOLLOWING RESIDUES HAVE A PSEUDO PLANARITY
-REMARK 500 TORSION, C(I) - CA(I) - N(I+1) - O(I), GREATER
-REMARK 500 10.0 DEGREES. (M=MODEL NUMBER; RES=RESIDUE NAME;
-REMARK 500 C=CHAIN IDENTIFIER; SSEQ=SEQUENCE NUMBER;
-REMARK 500 I=INSERTION CODE).
-REMARK 500
-REMARK 500 M RES CSSEQI ANGLE
-REMARK 500 VAL A 1 -12.66
-REMARK 500 SER A 3 -13.96
-REMARK 500 PRO A 4 -17.06
-REMARK 500 ASN A 9 10.02
-REMARK 500 LYS A 11 -14.58
-REMARK 500 ALA A 12 -29.94
-REMARK 500 GLY A 15 25.08
-REMARK 500 ALA A 19 -16.87
-REMARK 500 ALA A 21 26.61
-REMARK 500 GLY A 22 15.67
-REMARK 500 THR A 41 10.65
-REMARK 500 PHE A 46 -10.97
-REMARK 500 LEU A 48 -25.01
-REMARK 500 SER A 52 -10.23
-REMARK 500 LYS A 56 14.67
-REMARK 500 GLY A 59 -10.71
-REMARK 500 LYS A 61 -11.09
-REMARK 500 ALA A 63 -17.65
-REMARK 500 ASP A 74 18.25
-REMARK 500 ASP A 75 -17.02
-REMARK 500 MET A 76 -10.23
-REMARK 500 ASN A 78 -10.93
-REMARK 500 SER A 81 -10.91
-REMARK 500 ALA A 82 11.29
-REMARK 500 LEU A 83 -10.53
-REMARK 500 ASP A 85 -12.19
-REMARK 500 ALA A 88 11.87
-REMARK 500 LYS A 90 -14.75
-REMARK 500 ASN A 97 -10.48
-REMARK 500 LYS A 99 -15.40
-REMARK 500 LEU A 101 -10.99
-REMARK 500 LEU A 106 -10.02
-REMARK 500 ALA A 111 10.63
-REMARK 500 PRO A 114 -12.36
-REMARK 500 THR A 118 -18.84
-REMARK 500 HIS A 122 17.52
-REMARK 500 VAL B 1 34.93
-REMARK 500 LEU B 3 14.19
-REMARK 500 THR B 4 -16.98
-REMARK 500 GLU B 7 12.85
-REMARK 500 LEU B 14 12.16
-REMARK 500 ASP B 21 -10.62
-REMARK 500 THR B 38 14.87
-REMARK 500 GLU B 43 -24.15
-REMARK 500 SER B 44 54.71
-REMARK 500 ASP B 47 16.36
-REMARK 500 SER B 49 -74.55
-REMARK 500 GLY B 56 -31.39
-REMARK 500 LYS B 59 -12.59
-REMARK 500 VAL B 60 10.98
-REMARK 500 LYS B 61 -15.00
-REMARK 500 ALA B 62 10.49
-REMARK 500 HIS B 63 -10.22
-REMARK 500 LEU B 78 -25.59
-REMARK 500 ASP B 79 22.50
-REMARK 500 ASN B 80 -11.76
-REMARK 500 LEU B 81 11.29
-REMARK 500 THR B 84 10.62
-REMARK 500 GLU B 90 -10.55
-REMARK 500 PRO B 100 -11.02
-REMARK 500 GLU B 101 -10.37
-REMARK 500 LEU B 114 12.32
-REMARK 500 THR B 123 -10.84
-REMARK 500 VAL B 126 -11.54
-REMARK 500 GLN B 131 -10.69
-REMARK 500 ASN B 139 -17.46
-REMARK 500 LEU B 141 16.07
-REMARK 500 SER C 3 -11.99
-REMARK 500 ALA C 5 12.77
-REMARK 500 TRP C 14 -12.14
-REMARK 500 VAL C 17 12.38
-REMARK 500 GLY C 18 -13.67
-REMARK 500 ALA C 21 -14.14
-REMARK 500 GLY C 25 -12.75
-REMARK 500 PRO C 44 -13.45
-REMARK 500 HIS C 45 12.45
-REMARK 500 PHE C 46 -11.87
-REMARK 500 ASP C 47 19.24
-REMARK 500 LEU C 48 -13.66
-REMARK 500 ALA C 69 11.81
-REMARK 500 ALA C 71 22.14
-REMARK 500 HIS C 72 13.20
-REMARK 500 ASP C 74 12.29
-REMARK 500 ASP C 75 -23.66
-REMARK 500 LEU C 80 -11.12
-REMARK 500 LEU C 83 -10.01
-REMARK 500 ALA C 88 13.88
-REMARK 500 PRO C 95 -13.42
-REMARK 500 LEU C 109 16.42
-REMARK 500 ALA C 110 13.99
-REMARK 500 ALA C 111 15.47
-REMARK 500 HIS C 112 15.18
-REMARK 500 LEU C 113 -20.94
-REMARK 500 PRO C 114 -32.91
-REMARK 500 GLU C 116 -12.30
-REMARK 500 PRO C 119 11.39
-REMARK 500 LEU C 125 -10.17
-REMARK 500 VAL C 135 14.71
-REMARK 500 SER C 138 10.64
-REMARK 500 VAL D 1 -18.79
-REMARK 500 HIS D 2 -12.81
-REMARK 500 LEU D 3 -69.40
-REMARK 500 PRO D 5 -10.95
-REMARK 500 LYS D 8 -16.56
-REMARK 500 LYS D 17 10.52
-REMARK 500 ASP D 21 -17.88
-REMARK 500 GLU D 22 23.39
-REMARK 500 VAL D 33 11.00
-REMARK 500 VAL D 34 11.48
-REMARK 500 PHE D 42 10.18
-REMARK 500 GLY D 46 -18.80
-REMARK 500 LEU D 48 13.68
-REMARK 500 SER D 49 -21.45
-REMARK 500 ASP D 52 12.37
-REMARK 500 GLY D 56 17.16
-REMARK 500 VAL D 60 10.39
-REMARK 500 GLY D 64 -10.31
-REMARK 500 LYS D 66 16.91
-REMARK 500 ASP D 73 -11.34
-REMARK 500 LEU D 75 15.44
-REMARK 500 ALA D 76 -28.12
-REMARK 500 ASP D 79 -15.13
-REMARK 500 ASN D 80 -17.79
-REMARK 500 GLY D 83 -24.24
-REMARK 500 THR D 84 23.01
-REMARK 500 HIS D 92 -12.19
-REMARK 500 LEU D 96 11.44
-REMARK 500 HIS D 117 12.17
-REMARK 500 LYS D 120 -25.33
-REMARK 500 VAL D 137 -19.82
-REMARK 500 LYS D 144 17.08
-REMARK 500
-REMARK 500 REMARK: NULL
-REMARK 500
-REMARK 500 GEOMETRY AND STEREOCHEMISTRY
-REMARK 500 SUBTOPIC: CHIRAL CENTERS
-REMARK 500
-REMARK 500 UNEXPECTED CONFIGURATION OF THE FOLLOWING CHIRAL
-REMARK 500 CENTER(S) USING IMPROPER CA--C--CB--N CHIRALITY
-REMARK 500 M=MODEL NUMBER; RES=RESIDUE NAME; C=CHAIN
-REMARK 500 IDENTIFIER; SSEQ=SEQUENCE NUMBER; I=INSERTION CODE
-REMARK 500
-REMARK 500 STANDARD TABLE:
-REMARK 500 FORMAT: (11X,I3,1X,A3,1X,A1,I4,A1,6X,F5.1,6X,A1,10X,A1,3X,A16)
-REMARK 500
-REMARK 500 M RES CSSEQI IMPROPER EXPECTED FOUND DETAILS
-REMARK 500 SER A 3 47.5 L L OUTSIDE RANGE
-REMARK 500 LYS A 7 22.9 L L OUTSIDE RANGE
-REMARK 500 LYS A 16 14.6 L L OUTSIDE RANGE
-REMARK 500 VAL A 17 18.2 L L OUTSIDE RANGE
-REMARK 500 ALA A 26 18.6 L L OUTSIDE RANGE
-REMARK 500 PHE A 33 25.0 L L OUTSIDE RANGE
-REMARK 500 SER A 49 47.6 L L OUTSIDE RANGE
-REMARK 500 LYS A 56 14.8 L L OUTSIDE RANGE
-REMARK 500 LYS A 60 22.7 L L OUTSIDE RANGE
-REMARK 500 ALA A 71 48.3 L L OUTSIDE RANGE
-REMARK 500 PRO A 77 16.7 L L OUTSIDE RANGE
-REMARK 500 SER A 84 23.0 L L OUTSIDE RANGE
-REMARK 500 HIS A 89 23.9 L L OUTSIDE RANGE
-REMARK 500 LYS A 90 17.4 L L OUTSIDE RANGE
-REMARK 500 HIS A 103 22.3 L L OUTSIDE RANGE
-REMARK 500 ALA A 111 21.3 L L OUTSIDE RANGE
-REMARK 500 PRO A 114 49.5 L L OUTSIDE RANGE
-REMARK 500 PHE A 117 21.9 L L OUTSIDE RANGE
-REMARK 500 ALA A 120 20.3 L L OUTSIDE RANGE
-REMARK 500 HIS A 122 46.2 L L OUTSIDE RANGE
-REMARK 500 TYR A 140 23.5 L L OUTSIDE RANGE
-REMARK 500 PRO B 5 18.3 L L OUTSIDE RANGE
-REMARK 500 SER B 9 13.0 L L OUTSIDE RANGE
-REMARK 500 ALA B 13 23.4 L L OUTSIDE RANGE
-REMARK 500 LEU B 28 16.4 L L OUTSIDE RANGE
-REMARK 500 THR B 38 24.4 L L OUTSIDE RANGE
-REMARK 500 GLU B 43 46.6 L L OUTSIDE RANGE
-REMARK 500 ASP B 47 45.8 L L OUTSIDE RANGE
-REMARK 500 SER B 49 53.4 L L OUTSIDE RANGE
-REMARK 500 VAL B 60 24.9 L L OUTSIDE RANGE
-REMARK 500 LYS B 65 20.6 L L OUTSIDE RANGE
-REMARK 500 HIS B 77 47.6 L L OUTSIDE RANGE
-REMARK 500 ASP B 79 51.3 L L OUTSIDE RANGE
-REMARK 500 ASN B 80 45.3 L L OUTSIDE RANGE
-REMARK 500 LYS B 82 47.0 L L OUTSIDE RANGE
-REMARK 500 THR B 84 23.8 L L OUTSIDE RANGE
-REMARK 500 GLU B 90 11.1 L L OUTSIDE RANGE
-REMARK 500 LEU B 96 22.2 L L OUTSIDE RANGE
-REMARK 500 ASP B 99 47.0 L L OUTSIDE RANGE
-REMARK 500 HIS B 117 22.8 L L OUTSIDE RANGE
-REMARK 500 GLN B 127 23.5 L L OUTSIDE RANGE
-REMARK 500 VAL B 134 20.6 L L OUTSIDE RANGE
-REMARK 500 TYR B 145 13.6 L L OUTSIDE RANGE
-REMARK 500 VAL C 1 85.9 L L OUTSIDE RANGE
-REMARK 500 ALA C 5 23.1 L L OUTSIDE RANGE
-REMARK 500 ALA C 12 13.9 L L OUTSIDE RANGE
-REMARK 500 LYS C 16 18.8 L L OUTSIDE RANGE
-REMARK 500 VAL C 17 23.9 L L OUTSIDE RANGE
-REMARK 500 TYR C 24 23.1 L L OUTSIDE RANGE
-REMARK 500 ALA C 26 24.5 L L OUTSIDE RANGE
-REMARK 500 PRO C 44 49.8 L L OUTSIDE RANGE
-REMARK 500 ALA C 53 18.8 L L OUTSIDE RANGE
-REMARK 500 HIS C 72 10.8 L L OUTSIDE RANGE
-REMARK 500 VAL C 73 21.3 L L OUTSIDE RANGE
-REMARK 500 ASP C 75 50.5 L L OUTSIDE RANGE
-REMARK 500 PRO C 77 23.1 L L OUTSIDE RANGE
-REMARK 500 ASN C 78 7.6 L D EXPECTING SP3
-REMARK 500 SER C 84 22.3 L L OUTSIDE RANGE
-REMARK 500 ALA C 88 23.4 L L OUTSIDE RANGE
-REMARK 500 HIS C 89 24.6 L L OUTSIDE RANGE
-REMARK 500 LYS C 90 16.1 L L OUTSIDE RANGE
-REMARK 500 LYS C 99 23.5 L L OUTSIDE RANGE
-REMARK 500 VAL C 107 23.4 L L OUTSIDE RANGE
-REMARK 500 PRO C 114 58.4 L L OUTSIDE RANGE
-REMARK 500 ALA C 115 17.3 L L OUTSIDE RANGE
-REMARK 500 ARG C 141 24.7 L L OUTSIDE RANGE
-REMARK 500 HIS D 2 0.2 L D EXPECTING SP3
-REMARK 500 THR D 4 19.6 L L OUTSIDE RANGE
-REMARK 500 ALA D 10 48.1 L L OUTSIDE RANGE
-REMARK 500 ALA D 13 16.1 L L OUTSIDE RANGE
-REMARK 500 LYS D 17 21.9 L L OUTSIDE RANGE
-REMARK 500 ASN D 19 20.8 L L OUTSIDE RANGE
-REMARK 500 VAL D 20 14.8 L L OUTSIDE RANGE
-REMARK 500 ASP D 21 18.2 L L OUTSIDE RANGE
-REMARK 500 LEU D 31 23.7 L L OUTSIDE RANGE
-REMARK 500 ASP D 47 70.5 L L OUTSIDE RANGE
-REMARK 500 ASP D 52 59.4 L L OUTSIDE RANGE
-REMARK 500 ALA D 53 24.1 L L OUTSIDE RANGE
-REMARK 500 LYS D 59 23.2 L L OUTSIDE RANGE
-REMARK 500 SER D 72 4.3 L D EXPECTING SP3
-REMARK 500 ASP D 73 7.4 L D EXPECTING SP3
-REMARK 500 ALA D 76 83.0 L L OUTSIDE RANGE
-REMARK 500 LEU D 78 -0.1 L D EXPECTING SP3
-REMARK 500 HIS D 92 48.8 L L OUTSIDE RANGE
-REMARK 500 ASP D 94 47.8 L L OUTSIDE RANGE
-REMARK 500 PRO D 100 22.6 L L OUTSIDE RANGE
-REMARK 500 CYS D 112 22.5 L L OUTSIDE RANGE
-REMARK 500 PHE D 122 45.5 L L OUTSIDE RANGE
-REMARK 500 GLN D 131 24.7 L L OUTSIDE RANGE
-REMARK 500 VAL D 137 22.8 L L OUTSIDE RANGE
-REMARK 500 HIS D 143 24.9 L L OUTSIDE RANGE
-REMARK 500 LYS D 144 3.0 L D EXPECTING SP3
-REMARK 500 TYR D 145 23.9 L L OUTSIDE RANGE
-REMARK 500 HIS D 146 48.0 L L OUTSIDE RANGE
-REMARK 500
-REMARK 500 REMARK: NULL
-REMARK 610
-REMARK 610 MISSING HETEROATOM
-REMARK 610 THE FOLLOWING RESIDUES HAVE MISSING ATOMS (M=MODEL NUMBER;
-REMARK 610 RES=RESIDUE NAME; C=CHAIN IDENTIFIER; SSEQ=SEQUENCE NUMBER;
-REMARK 610 I=INSERTION CODE):
-REMARK 610 M RES C SSEQI
-REMARK 610 PO4 D 147
-REMARK 610 PO4 B 147
-REMARK 800
-REMARK 800 SITE
-REMARK 800 SITE_IDENTIFIER: AC1
-REMARK 800 EVIDENCE_CODE: SOFTWARE
-REMARK 800 SITE_DESCRIPTION: BINDING SITE FOR RESIDUE PO4 D 147
-REMARK 800 SITE_IDENTIFIER: AC2
-REMARK 800 EVIDENCE_CODE: SOFTWARE
-REMARK 800 SITE_DESCRIPTION: BINDING SITE FOR RESIDUE PO4 B 147
-REMARK 800 SITE_IDENTIFIER: AC3
-REMARK 800 EVIDENCE_CODE: SOFTWARE
-REMARK 800 SITE_DESCRIPTION: BINDING SITE FOR RESIDUE HEM A 142
-REMARK 800 SITE_IDENTIFIER: AC4
-REMARK 800 EVIDENCE_CODE: SOFTWARE
-REMARK 800 SITE_DESCRIPTION: BINDING SITE FOR RESIDUE HEM B 148
-REMARK 800 SITE_IDENTIFIER: AC5
-REMARK 800 EVIDENCE_CODE: SOFTWARE
-REMARK 800 SITE_DESCRIPTION: BINDING SITE FOR RESIDUE HEM C 142
-REMARK 800 SITE_IDENTIFIER: AC6
-REMARK 800 EVIDENCE_CODE: SOFTWARE
-REMARK 800 SITE_DESCRIPTION: BINDING SITE FOR RESIDUE HEM D 148
-REMARK 900
-REMARK 900 RELATED ENTRIES
-REMARK 900 RELATED ID: 2HHB RELATED DB: PDB
-REMARK 900 REFINED BY THE METHOD OF JACK AND LEVITT. THIS ENTRY
-REMARK 900 PRESENTS THE BEST ESTIMATE OF THE COORDINATES.
-REMARK 900 RELATED ID: 3HHB RELATED DB: PDB
-REMARK 900 SYMMETRY AVERAGED ABOUT THE (NON-CRYSTALLOGRAPHIC)
-REMARK 900 MOLECULAR AXIS AND THEN RE-REGULARIZED BY THE ENERGY
-REMARK 900 REFINEMENT METHOD OF LEVITT. THIS ENTRY PRESENTS
-REMARK 900 COORDINATES THAT ARE ADEQUATE FOR MOST PURPOSES, SUCH AS
-REMARK 900 COMPARISON WITH OTHER STRUCTURES.
-REMARK 900 RELATED ID: 1GLI RELATED DB: PDB
-DBREF 4HHB A 1 141 UNP P69905 HBA_HUMAN 1 141
-DBREF 4HHB B 1 146 UNP P68871 HBB_HUMAN 1 146
-DBREF 4HHB C 1 141 UNP P69905 HBA_HUMAN 1 141
-DBREF 4HHB D 1 146 UNP P68871 HBB_HUMAN 1 146
-SEQRES 1 A 141 VAL LEU SER PRO ALA ASP LYS THR ASN VAL LYS ALA ALA
-SEQRES 2 A 141 TRP GLY LYS VAL GLY ALA HIS ALA GLY GLU TYR GLY ALA
-SEQRES 3 A 141 GLU ALA LEU GLU ARG MET PHE LEU SER PHE PRO THR THR
-SEQRES 4 A 141 LYS THR TYR PHE PRO HIS PHE ASP LEU SER HIS GLY SER
-SEQRES 5 A 141 ALA GLN VAL LYS GLY HIS GLY LYS LYS VAL ALA ASP ALA
-SEQRES 6 A 141 LEU THR ASN ALA VAL ALA HIS VAL ASP ASP MET PRO ASN
-SEQRES 7 A 141 ALA LEU SER ALA LEU SER ASP LEU HIS ALA HIS LYS LEU
-SEQRES 8 A 141 ARG VAL ASP PRO VAL ASN PHE LYS LEU LEU SER HIS CYS
-SEQRES 9 A 141 LEU LEU VAL THR LEU ALA ALA HIS LEU PRO ALA GLU PHE
-SEQRES 10 A 141 THR PRO ALA VAL HIS ALA SER LEU ASP LYS PHE LEU ALA
-SEQRES 11 A 141 SER VAL SER THR VAL LEU THR SER LYS TYR ARG
-SEQRES 1 B 146 VAL HIS LEU THR PRO GLU GLU LYS SER ALA VAL THR ALA
-SEQRES 2 B 146 LEU TRP GLY LYS VAL ASN VAL ASP GLU VAL GLY GLY GLU
-SEQRES 3 B 146 ALA LEU GLY ARG LEU LEU VAL VAL TYR PRO TRP THR GLN
-SEQRES 4 B 146 ARG PHE PHE GLU SER PHE GLY ASP LEU SER THR PRO ASP
-SEQRES 5 B 146 ALA VAL MET GLY ASN PRO LYS VAL LYS ALA HIS GLY LYS
-SEQRES 6 B 146 LYS VAL LEU GLY ALA PHE SER ASP GLY LEU ALA HIS LEU
-SEQRES 7 B 146 ASP ASN LEU LYS GLY THR PHE ALA THR LEU SER GLU LEU
-SEQRES 8 B 146 HIS CYS ASP LYS LEU HIS VAL ASP PRO GLU ASN PHE ARG
-SEQRES 9 B 146 LEU LEU GLY ASN VAL LEU VAL CYS VAL LEU ALA HIS HIS
-SEQRES 10 B 146 PHE GLY LYS GLU PHE THR PRO PRO VAL GLN ALA ALA TYR
-SEQRES 11 B 146 GLN LYS VAL VAL ALA GLY VAL ALA ASN ALA LEU ALA HIS
-SEQRES 12 B 146 LYS TYR HIS
-SEQRES 1 C 141 VAL LEU SER PRO ALA ASP LYS THR ASN VAL LYS ALA ALA
-SEQRES 2 C 141 TRP GLY LYS VAL GLY ALA HIS ALA GLY GLU TYR GLY ALA
-SEQRES 3 C 141 GLU ALA LEU GLU ARG MET PHE LEU SER PHE PRO THR THR
-SEQRES 4 C 141 LYS THR TYR PHE PRO HIS PHE ASP LEU SER HIS GLY SER
-SEQRES 5 C 141 ALA GLN VAL LYS GLY HIS GLY LYS LYS VAL ALA ASP ALA
-SEQRES 6 C 141 LEU THR ASN ALA VAL ALA HIS VAL ASP ASP MET PRO ASN
-SEQRES 7 C 141 ALA LEU SER ALA LEU SER ASP LEU HIS ALA HIS LYS LEU
-SEQRES 8 C 141 ARG VAL ASP PRO VAL ASN PHE LYS LEU LEU SER HIS CYS
-SEQRES 9 C 141 LEU LEU VAL THR LEU ALA ALA HIS LEU PRO ALA GLU PHE
-SEQRES 10 C 141 THR PRO ALA VAL HIS ALA SER LEU ASP LYS PHE LEU ALA
-SEQRES 11 C 141 SER VAL SER THR VAL LEU THR SER LYS TYR ARG
-SEQRES 1 D 146 VAL HIS LEU THR PRO GLU GLU LYS SER ALA VAL THR ALA
-SEQRES 2 D 146 LEU TRP GLY LYS VAL ASN VAL ASP GLU VAL GLY GLY GLU
-SEQRES 3 D 146 ALA LEU GLY ARG LEU LEU VAL VAL TYR PRO TRP THR GLN
-SEQRES 4 D 146 ARG PHE PHE GLU SER PHE GLY ASP LEU SER THR PRO ASP
-SEQRES 5 D 146 ALA VAL MET GLY ASN PRO LYS VAL LYS ALA HIS GLY LYS
-SEQRES 6 D 146 LYS VAL LEU GLY ALA PHE SER ASP GLY LEU ALA HIS LEU
-SEQRES 7 D 146 ASP ASN LEU LYS GLY THR PHE ALA THR LEU SER GLU LEU
-SEQRES 8 D 146 HIS CYS ASP LYS LEU HIS VAL ASP PRO GLU ASN PHE ARG
-SEQRES 9 D 146 LEU LEU GLY ASN VAL LEU VAL CYS VAL LEU ALA HIS HIS
-SEQRES 10 D 146 PHE GLY LYS GLU PHE THR PRO PRO VAL GLN ALA ALA TYR
-SEQRES 11 D 146 GLN LYS VAL VAL ALA GLY VAL ALA ASN ALA LEU ALA HIS
-SEQRES 12 D 146 LYS TYR HIS
-HET PO4 D 147 1
-HET PO4 B 147 1
-HET HEM A 142 43
-HET HEM B 148 43
-HET HEM C 142 43
-HET HEM D 148 43
-HETNAM PO4 PHOSPHATE ION
-HETNAM HEM PROTOPORPHYRIN IX CONTAINING FE
-HETSYN HEM HEME
-FORMUL 5 PO4 2(O4 P 3-)
-FORMUL 7 HEM 4(C34 H32 FE N4 O4)
-FORMUL 11 HOH *221(H2 O)
-HELIX 1 AA SER A 3 GLY A 18 1 16
-HELIX 2 AB HIS A 20 SER A 35 1 16
-HELIX 3 AC PHE A 36 TYR A 42 1 7
-HELIX 4 AD HIS A 50 GLY A 51 1DEGEN 2 RES HLX RETAIN HOMOL 2
-HELIX 5 AE SER A 52 ALA A 71 1 20
-HELIX 6 AF LEU A 80 ALA A 88 1 9
-HELIX 7 AG ASP A 94 HIS A 112 1 19
-HELIX 8 AH THR A 118 SER A 138 1 21
-HELIX 9 BA THR B 4 VAL B 18 1 15
-HELIX 10 BB ASN B 19 VAL B 34 1 16
-HELIX 11 BC TYR B 35 PHE B 41 1 7
-HELIX 12 BD THR B 50 GLY B 56 1 7
-HELIX 13 BE ASN B 57 ALA B 76 1 20
-HELIX 14 BF PHE B 85 CYS B 93 1 9
-HELIX 15 BG ASP B 99 HIS B 117 1 19
-HELIX 16 BH THR B 123 HIS B 143 1 21
-HELIX 17 CA SER C 3 GLY C 18 1 16
-HELIX 18 CB HIS C 20 SER C 35 1 16
-HELIX 19 CC PHE C 36 TYR C 42 1 7
-HELIX 20 CD HIS C 50 GLY C 51 1DEGEN 2 RES HLX RETAIN HOMOL 2
-HELIX 21 CE SER C 52 ALA C 71 1 20
-HELIX 22 CF LEU C 80 ALA C 88 1 9
-HELIX 23 CG ASP C 94 HIS C 112 1 19
-HELIX 24 CH THR C 118 SER C 138 1 21
-HELIX 25 DA THR D 4 VAL D 18 1 15
-HELIX 26 DB ASN D 19 VAL D 34 1 16
-HELIX 27 DC TYR D 35 PHE D 41 1 7
-HELIX 28 DD THR D 50 GLY D 56 1 7
-HELIX 29 DE ASN D 57 ALA D 76 1 20
-HELIX 30 DF PHE D 85 CYS D 93 1 9
-HELIX 31 DG ASP D 99 HIS D 117 1 19
-HELIX 32 DH THR D 123 HIS D 143 1 21
-LINK NE2 HIS A 87 FE HEM A 142 1555 1555 2.14
-LINK NE2 HIS B 92 FE HEM B 148 1555 1555 2.22
-LINK NE2 HIS C 87 FE HEM C 142 1555 1555 2.26
-LINK NE2 HIS D 92 FE HEM D 148 1555 1555 1.98
-SITE 1 AC1 1 VAL D 1
-SITE 1 AC2 1 HOH B 197
-SITE 1 AC3 16 TYR A 42 PHE A 43 HIS A 45 PHE A 46
-SITE 2 AC3 16 HIS A 58 LYS A 61 LEU A 86 HIS A 87
-SITE 3 AC3 16 LEU A 91 VAL A 93 ASN A 97 PHE A 98
-SITE 4 AC3 16 LEU A 101 LEU A 136 HOH A 144 HOH A 159
-SITE 1 AC4 13 ALA A 53 HOH A 145 PHE B 41 HIS B 63
-SITE 2 AC4 13 LYS B 66 VAL B 67 HIS B 92 LEU B 96
-SITE 3 AC4 13 ASN B 102 PHE B 103 LEU B 141 HOH B 175
-SITE 4 AC4 13 HOH B 193
-SITE 1 AC5 15 TYR C 42 PHE C 43 HIS C 45 HIS C 58
-SITE 2 AC5 15 LYS C 61 LEU C 83 LEU C 86 HIS C 87
-SITE 3 AC5 15 LEU C 91 VAL C 93 ASN C 97 PHE C 98
-SITE 4 AC5 15 LEU C 136 HOH C 149 HOH C 164
-SITE 1 AC6 7 HIS D 63 LYS D 66 VAL D 67 HIS D 92
-SITE 2 AC6 7 LEU D 96 ASN D 102 LEU D 141
-CRYST1 63.150 83.590 53.800 90.00 99.34 90.00 P 1 21 1 4
-ORIGX1 0.963457 0.136613 0.230424 16.61000
-ORIGX2 -0.158977 0.983924 0.081383 13.72000
-ORIGX3 -0.215598 -0.115048 0.969683 37.65000
-SCALE1 0.015462 0.002192 0.003698 0.26656
-SCALE2 -0.001902 0.011771 0.000974 0.16413
-SCALE3 -0.001062 -0.001721 0.018728 0.75059
-MTRIX1 1 -1.000000 0.000000 0.000000 0.00001 1
-MTRIX2 1 0.000000 1.000000 0.000000 0.00002 1
-MTRIX3 1 0.000000 0.000000 -1.000000 0.00002 1
-ATOM 1 N VAL A 1 6.204 16.869 4.854 1.00 49.05 N
-ATOM 2 CA VAL A 1 6.913 17.759 4.607 1.00 43.14 C
-ATOM 3 C VAL A 1 8.504 17.378 4.797 1.00 24.80 C
-ATOM 4 O VAL A 1 8.805 17.011 5.943 1.00 37.68 O
-ATOM 5 CB VAL A 1 6.369 19.044 5.810 1.00 72.12 C
-ATOM 6 CG1 VAL A 1 7.009 20.127 5.418 1.00 61.79 C
-ATOM 7 CG2 VAL A 1 5.246 18.533 5.681 1.00 80.12 C
-ATOM 8 N LEU A 2 9.096 18.040 3.857 1.00 26.44 N
-ATOM 9 CA LEU A 2 10.600 17.889 4.283 1.00 26.32 C
-ATOM 10 C LEU A 2 11.265 19.184 5.297 1.00 32.96 C
-ATOM 11 O LEU A 2 10.813 20.177 4.647 1.00 31.90 O
-ATOM 12 CB LEU A 2 11.099 18.007 2.815 1.00 29.23 C
-ATOM 13 CG LEU A 2 11.322 16.956 1.934 1.00 37.71 C
-ATOM 14 CD1 LEU A 2 11.468 15.596 2.337 1.00 39.10 C
-ATOM 15 CD2 LEU A 2 11.423 17.268 0.300 1.00 37.47 C
-ATOM 16 N SER A 3 11.584 18.730 6.148 1.00 28.01 N
-ATOM 17 CA SER A 3 12.263 19.871 7.087 1.00 26.03 C
-ATOM 18 C SER A 3 13.304 20.329 6.300 1.00 25.99 C
-ATOM 19 O SER A 3 14.085 19.818 5.364 1.00 25.98 O
-ATOM 20 CB SER A 3 12.744 19.045 8.223 1.00 23.41 C
-ATOM 21 OG SER A 3 13.781 18.286 8.179 1.00 30.00 O
-ATOM 22 N PRO A 4 14.196 21.422 7.097 1.00 37.49 N
-ATOM 23 CA PRO A 4 15.048 21.890 6.206 1.00 38.81 C
-ATOM 24 C PRO A 4 16.464 21.282 6.288 1.00 25.63 C
-ATOM 25 O PRO A 4 17.212 20.899 5.409 1.00 34.38 O
-ATOM 26 CB PRO A 4 15.814 23.113 7.166 1.00 50.44 C
-ATOM 27 CG PRO A 4 14.493 23.536 7.638 1.00 43.42 C
-ATOM 28 CD PRO A 4 13.298 22.523 7.651 1.00 42.77 C
-ATOM 29 N ALA A 5 16.399 20.279 7.524 1.00 24.33 N
-ATOM 30 CA ALA A 5 17.552 19.622 7.588 1.00 24.06 C
-ATOM 31 C ALA A 5 17.376 18.283 6.601 1.00 20.01 C
-ATOM 32 O ALA A 5 18.422 17.849 6.010 1.00 24.46 O
-ATOM 33 CB ALA A 5 17.454 18.830 9.164 1.00 28.15 C
-ATOM 34 N ASP A 6 16.050 17.799 6.298 1.00 21.19 N
-ATOM 35 CA ASP A 6 15.881 16.887 5.120 1.00 23.14 C
-ATOM 36 C ASP A 6 16.573 17.497 3.915 1.00 15.75 C
-ATOM 37 O ASP A 6 17.240 16.611 3.235 1.00 18.92 O
-ATOM 38 CB ASP A 6 14.530 16.515 4.983 1.00 18.68 C
-ATOM 39 CG ASP A 6 13.966 15.638 6.125 1.00 21.70 C
-ATOM 40 OD1 ASP A 6 14.573 14.751 6.678 1.00 19.76 O
-ATOM 41 OD2 ASP A 6 12.734 15.931 6.321 1.00 21.26 O
-ATOM 42 N LYS A 7 16.082 18.800 3.719 1.00 15.62 N
-ATOM 43 CA LYS A 7 16.897 19.255 2.400 1.00 26.74 C
-ATOM 44 C LYS A 7 18.354 19.319 2.072 1.00 24.82 C
-ATOM 45 O LYS A 7 18.858 18.855 1.145 1.00 21.36 O
-ATOM 46 CB LYS A 7 16.022 20.503 2.054 1.00 28.73 C
-ATOM 47 CG LYS A 7 14.518 20.443 2.287 1.00 34.11 C
-ATOM 48 CD LYS A 7 13.833 21.967 2.124 1.00 46.50 C
-ATOM 49 CE LYS A 7 12.524 21.830 2.733 1.00 40.75 C
-ATOM 50 NZ LYS A 7 12.310 23.286 2.231 1.00 50.05 N
-ATOM 51 N THR A 8 18.879 19.583 3.554 1.00 20.80 N
-ATOM 52 CA THR A 8 20.359 19.452 3.495 1.00 23.21 C
-ATOM 53 C THR A 8 21.000 18.322 3.125 1.00 17.85 C
-ATOM 54 O THR A 8 21.907 17.957 2.500 1.00 20.04 O
-ATOM 55 CB THR A 8 20.762 20.269 4.939 1.00 31.90 C
-ATOM 56 OG1 THR A 8 20.363 21.458 4.886 1.00 31.01 O
-ATOM 57 CG2 THR A 8 22.026 20.115 4.978 1.00 43.78 C
-ATOM 58 N ASN A 9 20.249 17.203 3.818 1.00 16.13 N
-ATOM 59 CA ASN A 9 20.591 15.889 3.728 1.00 17.84 C
-ATOM 60 C ASN A 9 20.630 15.286 2.184 1.00 14.45 C
-ATOM 61 O ASN A 9 21.319 14.475 1.822 1.00 21.78 O
-ATOM 62 CB ASN A 9 19.836 14.946 4.644 1.00 20.10 C
-ATOM 63 CG ASN A 9 20.193 15.272 6.089 1.00 34.82 C
-ATOM 64 OD1 ASN A 9 21.294 15.680 6.444 1.00 26.93 O
-ATOM 65 ND2 ASN A 9 19.527 14.719 6.950 1.00 28.08 N
-ATOM 66 N VAL A 10 19.435 15.546 1.583 1.00 19.64 N
-ATOM 67 CA VAL A 10 19.157 15.110 0.179 1.00 13.04 C
-ATOM 68 C VAL A 10 20.341 15.904 -0.719 1.00 18.71 C
-ATOM 69 O VAL A 10 20.832 15.221 -1.618 1.00 22.34 O
-ATOM 70 CB VAL A 10 17.776 15.394 -0.119 1.00 19.07 C
-ATOM 71 CG1 VAL A 10 17.623 15.138 -1.549 1.00 21.59 C
-ATOM 72 CG2 VAL A 10 16.816 14.756 0.575 1.00 22.75 C
-ATOM 73 N LYS A 11 20.392 17.201 -0.404 1.00 18.31 N
-ATOM 74 CA LYS A 11 21.297 18.030 -1.415 1.00 24.80 C
-ATOM 75 C LYS A 11 22.762 17.451 -1.066 1.00 19.51 C
-ATOM 76 O LYS A 11 23.584 17.190 -2.069 1.00 22.33 O
-ATOM 77 CB LYS A 11 21.334 19.381 -1.059 1.00 39.77 C
-ATOM 78 CG LYS A 11 20.229 20.052 -1.350 1.00 34.41 C
-ATOM 79 CD LYS A 11 20.256 21.365 -1.389 1.00 46.95 C
-ATOM 80 CE LYS A 11 18.633 21.891 -2.358 1.00 49.55 C
-ATOM 81 NZ LYS A 11 18.398 23.088 -1.720 1.00 78.67 N
-ATOM 82 N ALA A 12 23.031 16.766 0.069 1.00 20.60 N
-ATOM 83 CA ALA A 12 24.347 16.671 -0.059 1.00 25.98 C
-ATOM 84 C ALA A 12 24.529 15.278 -0.129 1.00 38.04 C
-ATOM 85 O ALA A 12 25.505 14.711 -1.045 1.00 31.19 O
-ATOM 86 CB ALA A 12 24.641 16.359 1.529 1.00 28.13 C
-ATOM 87 N ALA A 13 23.581 14.281 -0.261 1.00 21.69 N
-ATOM 88 CA ALA A 13 23.822 13.010 -0.701 1.00 19.11 C
-ATOM 89 C ALA A 13 23.807 12.890 -2.423 1.00 22.93 C
-ATOM 90 O ALA A 13 24.517 12.116 -2.938 1.00 24.98 O
-ATOM 91 CB ALA A 13 22.612 12.109 -0.160 1.00 23.17 C
-ATOM 92 N TRP A 14 22.807 13.763 -2.832 1.00 22.14 N
-ATOM 93 CA TRP A 14 22.715 13.681 -4.311 1.00 21.27 C
-ATOM 94 C TRP A 14 24.007 14.453 -5.015 1.00 28.97 C
-ATOM 95 O TRP A 14 24.452 13.999 -6.086 1.00 27.61 O
-ATOM 96 CB TRP A 14 21.129 14.484 -4.728 1.00 29.00 C
-ATOM 97 CG TRP A 14 21.116 13.951 -5.830 1.00 25.79 C
-ATOM 98 CD1 TRP A 14 21.182 14.904 -7.199 1.00 22.38 C
-ATOM 99 CD2 TRP A 14 20.358 12.768 -6.306 1.00 20.46 C
-ATOM 100 NE1 TRP A 14 20.545 13.886 -8.152 1.00 29.74 N
-ATOM 101 CE2 TRP A 14 20.127 12.855 -7.917 1.00 27.75 C
-ATOM 102 CE3 TRP A 14 19.993 11.556 -5.760 1.00 34.00 C
-ATOM 103 CZ2 TRP A 14 19.685 11.924 -8.428 1.00 34.81 C
-ATOM 104 CZ3 TRP A 14 19.443 10.605 -6.677 1.00 42.11 C
-ATOM 105 CH2 TRP A 14 19.361 10.910 -7.988 1.00 47.54 C
-ATOM 106 N GLY A 15 24.563 15.294 -4.064 1.00 40.92 N
-ATOM 107 CA GLY A 15 25.545 16.032 -4.810 1.00 38.97 C
-ATOM 108 C GLY A 15 26.606 14.720 -4.643 1.00 34.61 C
-ATOM 109 O GLY A 15 27.532 14.956 -6.011 1.00 36.24 O
-ATOM 110 N LYS A 16 27.023 14.192 -4.019 1.00 35.37 N
-ATOM 111 CA LYS A 16 27.691 12.809 -3.990 1.00 29.09 C
-ATOM 112 C LYS A 16 27.692 11.980 -5.322 1.00 27.28 C
-ATOM 113 O LYS A 16 28.444 11.335 -5.752 1.00 36.62 O
-ATOM 114 CB LYS A 16 27.773 11.881 -2.758 1.00 30.47 C
-ATOM 115 CG LYS A 16 29.128 10.897 -2.949 1.00 47.02 C
-ATOM 116 CD LYS A 16 30.512 12.265 -2.454 1.00 66.41 C
-ATOM 117 CE LYS A 16 31.160 10.590 -3.127 1.00 65.00 C
-ATOM 118 NZ LYS A 16 31.293 9.343 -2.468 1.00 69.28 N
-ATOM 119 N VAL A 17 26.231 11.894 -5.716 1.00 40.63 N
-ATOM 120 CA VAL A 17 25.763 11.093 -6.580 1.00 32.19 C
-ATOM 121 C VAL A 17 26.644 11.417 -8.297 1.00 51.53 C
-ATOM 122 O VAL A 17 27.090 10.850 -8.486 1.00 36.95 O
-ATOM 123 CB VAL A 17 24.455 10.688 -6.704 1.00 24.77 C
-ATOM 124 CG1 VAL A 17 24.024 10.418 -8.088 1.00 21.73 C
-ATOM 125 CG2 VAL A 17 23.718 9.922 -5.546 1.00 23.90 C
-ATOM 126 N GLY A 18 26.340 12.947 -7.963 1.00 36.07 N
-ATOM 127 CA GLY A 18 27.063 13.723 -8.931 1.00 37.64 C
-ATOM 128 C GLY A 18 26.574 12.969 -10.560 1.00 27.84 C
-ATOM 129 O GLY A 18 25.253 13.110 -10.707 1.00 34.16 O
-ATOM 130 N ALA A 19 27.657 12.515 -11.022 1.00 35.70 N
-ATOM 131 CA ALA A 19 27.728 12.613 -12.429 1.00 37.59 C
-ATOM 132 C ALA A 19 27.500 10.976 -12.552 1.00 34.69 C
-ATOM 133 O ALA A 19 27.084 10.420 -13.842 1.00 48.59 O
-ATOM 134 CB ALA A 19 29.012 12.664 -13.280 1.00 46.19 C
-ATOM 135 N HIS A 20 27.156 10.119 -11.606 1.00 20.24 N
-ATOM 136 CA HIS A 20 26.883 8.665 -11.713 1.00 19.03 C
-ATOM 137 C HIS A 20 25.297 8.749 -11.742 1.00 17.82 C
-ATOM 138 O HIS A 20 24.744 7.547 -11.745 1.00 20.59 O
-ATOM 139 CB HIS A 20 27.211 8.007 -10.561 1.00 31.92 C
-ATOM 140 CG HIS A 20 28.495 7.629 -10.284 1.00 45.35 C
-ATOM 141 ND1 HIS A 20 29.488 7.023 -11.531 1.00 52.86 N
-ATOM 142 CD2 HIS A 20 29.445 8.698 -9.743 1.00 43.12 C
-ATOM 143 CE1 HIS A 20 30.546 7.246 -10.801 1.00 68.75 C
-ATOM 144 NE2 HIS A 20 30.729 7.865 -10.003 1.00 55.89 N
-ATOM 145 N ALA A 21 24.687 9.784 -11.799 1.00 29.55 N
-ATOM 146 CA ALA A 21 23.159 9.917 -11.488 1.00 29.36 C
-ATOM 147 C ALA A 21 22.579 8.284 -12.650 1.00 46.23 C
-ATOM 148 O ALA A 21 21.659 8.109 -12.129 1.00 27.88 O
-ATOM 149 CB ALA A 21 22.561 11.174 -11.335 1.00 28.64 C
-ATOM 150 N GLY A 22 22.741 9.029 -13.713 1.00 27.74 N
-ATOM 151 CA GLY A 22 22.302 7.955 -14.644 1.00 29.10 C
-ATOM 152 C GLY A 22 22.405 6.768 -14.523 1.00 40.30 C
-ATOM 153 O GLY A 22 21.884 5.714 -14.971 1.00 33.08 O
-ATOM 154 N GLU A 23 23.751 6.163 -14.331 1.00 22.76 N
-ATOM 155 CA GLU A 23 24.084 4.748 -14.144 1.00 14.60 C
-ATOM 156 C GLU A 23 23.211 4.210 -12.893 1.00 13.41 C
-ATOM 157 O GLU A 23 22.937 3.039 -12.842 1.00 16.24 O
-ATOM 158 CB GLU A 23 25.664 4.939 -13.797 1.00 20.16 C
-ATOM 159 CG GLU A 23 26.201 3.519 -13.776 1.00 40.65 C
-ATOM 160 CD GLU A 23 28.243 3.900 -13.483 1.00 70.75 C
-ATOM 161 OE1 GLU A 23 27.931 3.380 -11.875 1.00 57.57 O
-ATOM 162 OE2 GLU A 23 28.452 5.212 -13.971 1.00 57.46 O
-ATOM 163 N TYR A 24 23.179 5.044 -11.863 1.00 18.60 N
-ATOM 164 CA TYR A 24 22.505 4.593 -10.679 1.00 26.35 C
-ATOM 165 C TYR A 24 21.016 4.562 -11.095 1.00 17.67 C
-ATOM 166 O TYR A 24 20.360 3.603 -10.478 1.00 17.15 O
-ATOM 167 CB TYR A 24 22.464 5.807 -9.581 1.00 21.47 C
-ATOM 168 CG TYR A 24 23.992 5.643 -8.868 1.00 17.94 C
-ATOM 169 CD1 TYR A 24 24.282 6.445 -7.897 1.00 25.54 C
-ATOM 170 CD2 TYR A 24 24.950 4.858 -9.353 1.00 18.41 C
-ATOM 171 CE1 TYR A 24 25.677 6.369 -7.422 1.00 27.77 C
-ATOM 172 CE2 TYR A 24 26.305 4.768 -8.960 1.00 24.84 C
-ATOM 173 CZ TYR A 24 26.528 5.702 -7.748 1.00 28.92 C
-ATOM 174 OH TYR A 24 27.827 5.849 -7.564 1.00 33.79 O
-ATOM 175 N GLY A 25 20.378 5.478 -11.759 1.00 17.58 N
-ATOM 176 CA GLY A 25 19.016 5.420 -12.390 1.00 16.95 C
-ATOM 177 C GLY A 25 18.833 4.130 -12.941 1.00 12.93 C
-ATOM 178 O GLY A 25 17.819 3.343 -12.872 1.00 14.53 O
-ATOM 179 N ALA A 26 19.615 3.604 -13.915 1.00 15.78 N
-ATOM 180 CA ALA A 26 19.582 2.579 -14.539 1.00 18.05 C
-ATOM 181 C ALA A 26 19.480 1.089 -13.772 1.00 13.38 C
-ATOM 182 O ALA A 26 18.901 0.084 -13.805 1.00 13.68 O
-ATOM 183 CB ALA A 26 20.556 2.124 -15.501 1.00 21.17 C
-ATOM 184 N GLU A 27 20.535 1.124 -12.715 1.00 13.26 N
-ATOM 185 CA GLU A 27 20.575 0.021 -11.753 1.00 15.73 C
-ATOM 186 C GLU A 27 19.308 -0.043 -10.886 1.00 9.69 C
-ATOM 187 O GLU A 27 18.918 -1.164 -10.735 1.00 13.70 O
-ATOM 188 CB GLU A 27 21.903 0.397 -10.962 1.00 17.47 C
-ATOM 189 CG GLU A 27 21.998 -0.702 -9.888 1.00 16.72 C
-ATOM 190 CD GLU A 27 23.378 -0.554 -8.914 1.00 28.34 C
-ATOM 191 OE1 GLU A 27 23.164 -0.938 -7.844 1.00 20.53 O
-ATOM 192 OE2 GLU A 27 24.282 0.068 -9.385 1.00 20.32 O
-ATOM 193 N ALA A 28 18.802 1.101 -10.459 1.00 11.71 N
-ATOM 194 CA ALA A 28 17.589 1.092 -9.707 1.00 14.08 C
-ATOM 195 C ALA A 28 16.437 0.281 -10.410 1.00 18.50 C
-ATOM 196 O ALA A 28 15.609 -0.358 -10.010 1.00 12.43 O
-ATOM 197 CB ALA A 28 17.166 2.432 -9.252 1.00 19.09 C
-ATOM 198 N LEU A 29 16.400 0.918 -11.698 1.00 12.19 N
-ATOM 199 CA LEU A 29 15.328 0.075 -12.594 1.00 17.48 C
-ATOM 200 C LEU A 29 15.559 -1.439 -12.734 1.00 9.74 C
-ATOM 201 O LEU A 29 14.606 -2.189 -12.644 1.00 10.80 O
-ATOM 202 CB LEU A 29 15.302 0.859 -14.203 1.00 12.13 C
-ATOM 203 CG LEU A 29 14.894 2.291 -14.067 1.00 14.66 C
-ATOM 204 CD1 LEU A 29 15.261 2.690 -15.515 1.00 16.80 C
-ATOM 205 CD2 LEU A 29 13.402 2.225 -13.944 1.00 18.58 C
-ATOM 206 N GLU A 30 16.843 -1.859 -13.083 1.00 9.20 N
-ATOM 207 CA GLU A 30 17.065 -3.260 -13.067 1.00 11.66 C
-ATOM 208 C GLU A 30 16.682 -4.043 -11.806 1.00 13.48 C
-ATOM 209 O GLU A 30 16.222 -5.112 -11.842 1.00 17.00 O
-ATOM 210 CB GLU A 30 18.445 -3.450 -13.556 1.00 19.11 C
-ATOM 211 CG GLU A 30 18.613 -4.789 -13.421 1.00 27.23 C
-ATOM 212 CD GLU A 30 20.397 -5.050 -14.290 1.00 43.77 C
-ATOM 213 OE1 GLU A 30 21.034 -4.018 -14.191 1.00 45.21 O
-ATOM 214 OE2 GLU A 30 20.320 -6.204 -14.925 1.00 45.13 O
-ATOM 215 N ARG A 31 17.074 -3.325 -10.709 1.00 11.70 N
-ATOM 216 CA ARG A 31 16.706 -3.885 -9.384 1.00 13.69 C
-ATOM 217 C ARG A 31 15.116 -4.077 -9.266 1.00 13.95 C
-ATOM 218 O ARG A 31 14.772 -5.201 -8.729 1.00 16.42 O
-ATOM 219 CB ARG A 31 17.207 -3.143 -8.212 1.00 9.32 C
-ATOM 220 CG ARG A 31 18.786 -3.298 -8.162 1.00 14.85 C
-ATOM 221 CD ARG A 31 19.223 -2.383 -7.101 1.00 20.12 C
-ATOM 222 NE ARG A 31 20.863 -2.372 -6.759 1.00 14.83 N
-ATOM 223 CZ ARG A 31 21.361 -3.431 -6.210 1.00 13.22 C
-ATOM 224 NH1 ARG A 31 20.746 -4.460 -5.716 1.00 11.40 N
-ATOM 225 NH2 ARG A 31 22.719 -3.344 -6.301 1.00 17.34 N
-ATOM 226 N MET A 32 14.439 -3.020 -9.681 1.00 11.37 N
-ATOM 227 CA MET A 32 13.032 -3.139 -9.600 1.00 10.16 C
-ATOM 228 C MET A 32 12.471 -4.206 -10.484 1.00 12.10 C
-ATOM 229 O MET A 32 11.562 -5.027 -10.075 1.00 12.78 O
-ATOM 230 CB MET A 32 12.387 -1.842 -9.978 1.00 12.48 C
-ATOM 231 CG MET A 32 10.889 -1.620 -9.930 1.00 17.73 C
-ATOM 232 SD MET A 32 10.285 -0.089 -10.543 1.00 15.12 S
-ATOM 233 CE MET A 32 10.633 -0.449 -12.284 1.00 11.32 C
-ATOM 234 N PHE A 33 12.859 -4.341 -11.658 1.00 13.98 N
-ATOM 235 CA PHE A 33 12.423 -5.476 -12.584 1.00 16.07 C
-ATOM 236 C PHE A 33 12.551 -6.737 -12.305 1.00 12.29 C
-ATOM 237 O PHE A 33 11.788 -7.686 -12.349 1.00 14.84 O
-ATOM 238 CB PHE A 33 12.947 -5.237 -13.990 1.00 11.16 C
-ATOM 239 CG PHE A 33 12.536 -3.998 -14.641 1.00 10.01 C
-ATOM 240 CD1 PHE A 33 11.466 -3.383 -14.673 1.00 13.62 C
-ATOM 241 CD2 PHE A 33 13.679 -3.464 -15.536 1.00 19.46 C
-ATOM 242 CE1 PHE A 33 11.074 -2.180 -15.483 1.00 17.65 C
-ATOM 243 CE2 PHE A 33 13.177 -2.070 -16.087 1.00 14.83 C
-ATOM 244 CZ PHE A 33 12.158 -1.591 -16.095 1.00 12.93 C
-ATOM 245 N LEU A 34 13.735 -6.963 -11.432 1.00 16.04 N
-ATOM 246 CA LEU A 34 14.079 -8.337 -11.022 1.00 14.57 C
-ATOM 247 C LEU A 34 13.293 -8.578 -9.676 1.00 17.64 C
-ATOM 248 O LEU A 34 12.997 -9.724 -9.442 1.00 18.98 O
-ATOM 249 CB LEU A 34 15.453 -8.526 -10.814 1.00 18.08 C
-ATOM 250 CG LEU A 34 16.401 -8.680 -11.761 1.00 28.60 C
-ATOM 251 CD1 LEU A 34 17.957 -8.573 -11.703 1.00 25.37 C
-ATOM 252 CD2 LEU A 34 15.936 -9.330 -12.871 1.00 34.83 C
-ATOM 253 N SER A 35 13.220 -7.510 -8.706 1.00 15.41 N
-ATOM 254 CA SER A 35 12.815 -7.908 -7.502 1.00 14.95 C
-ATOM 255 C SER A 35 11.238 -7.909 -7.418 1.00 15.69 C
-ATOM 256 O SER A 35 10.517 -8.531 -6.585 1.00 14.29 O
-ATOM 257 CB SER A 35 13.131 -6.749 -6.442 1.00 13.14 C
-ATOM 258 OG SER A 35 14.485 -7.014 -6.085 1.00 17.78 O
-ATOM 259 N PHE A 36 10.680 -7.033 -8.262 1.00 13.54 N
-ATOM 260 CA PHE A 36 9.195 -6.850 -8.454 1.00 13.46 C
-ATOM 261 C PHE A 36 8.843 -6.910 -9.927 1.00 8.62 C
-ATOM 262 O PHE A 36 8.478 -5.788 -10.556 1.00 14.12 O
-ATOM 263 CB PHE A 36 8.936 -5.457 -7.919 1.00 16.50 C
-ATOM 264 CG PHE A 36 9.418 -4.974 -6.493 1.00 13.63 C
-ATOM 265 CD1 PHE A 36 10.591 -4.292 -6.329 1.00 11.92 C
-ATOM 266 CD2 PHE A 36 8.828 -5.831 -5.362 1.00 19.28 C
-ATOM 267 CE1 PHE A 36 11.048 -4.090 -5.054 1.00 15.75 C
-ATOM 268 CE2 PHE A 36 9.372 -5.629 -4.112 1.00 13.78 C
-ATOM 269 CZ PHE A 36 10.535 -4.872 -4.007 1.00 15.33 C
-ATOM 270 N PRO A 37 8.621 -8.156 -10.145 1.00 14.18 N
-ATOM 271 CA PRO A 37 8.292 -8.333 -11.715 1.00 17.12 C
-ATOM 272 C PRO A 37 7.088 -7.804 -12.224 1.00 17.85 C
-ATOM 273 O PRO A 37 6.976 -7.542 -13.453 1.00 18.50 O
-ATOM 274 CB PRO A 37 8.433 -9.844 -11.897 1.00 23.37 C
-ATOM 275 CG PRO A 37 8.573 -10.410 -10.572 1.00 28.27 C
-ATOM 276 CD PRO A 37 8.857 -9.204 -9.532 1.00 20.43 C
-ATOM 277 N THR A 38 6.105 -7.481 -11.322 1.00 18.86 N
-ATOM 278 CA THR A 38 4.849 -6.949 -11.938 1.00 14.66 C
-ATOM 279 C THR A 38 5.134 -5.609 -12.568 1.00 12.72 C
-ATOM 280 O THR A 38 4.433 -5.064 -13.326 1.00 15.75 O
-ATOM 281 CB THR A 38 3.879 -6.749 -10.732 1.00 19.10 C
-ATOM 282 OG1 THR A 38 4.340 -6.112 -9.661 1.00 18.82 O
-ATOM 283 CG2 THR A 38 3.543 -8.224 -10.416 1.00 22.69 C
-ATOM 284 N THR A 39 6.269 -4.882 -12.154 1.00 14.27 N
-ATOM 285 CA THR A 39 6.491 -3.556 -12.776 1.00 10.19 C
-ATOM 286 C THR A 39 6.886 -3.690 -14.302 1.00 10.17 C
-ATOM 287 O THR A 39 6.836 -2.719 -14.886 1.00 14.01 O
-ATOM 288 CB THR A 39 7.510 -2.917 -11.996 1.00 15.56 C
-ATOM 289 OG1 THR A 39 8.881 -3.562 -11.937 1.00 14.68 O
-ATOM 290 CG2 THR A 39 7.258 -2.652 -10.511 1.00 20.52 C
-ATOM 291 N LYS A 40 7.174 -4.831 -14.593 1.00 14.72 N
-ATOM 292 CA LYS A 40 7.574 -4.871 -15.954 1.00 15.89 C
-ATOM 293 C LYS A 40 6.392 -4.785 -17.012 1.00 21.37 C
-ATOM 294 O LYS A 40 6.437 -4.614 -18.103 1.00 15.72 O
-ATOM 295 CB LYS A 40 8.145 -6.482 -16.338 1.00 11.64 C
-ATOM 296 CG LYS A 40 9.529 -6.584 -15.725 1.00 16.19 C
-ATOM 297 CD LYS A 40 10.167 -7.889 -16.138 1.00 23.35 C
-ATOM 298 CE LYS A 40 9.677 -9.033 -15.597 1.00 24.42 C
-ATOM 299 NZ LYS A 40 10.352 -10.362 -15.922 1.00 19.04 N
-ATOM 300 N THR A 41 5.127 -4.865 -16.397 1.00 13.16 N
-ATOM 301 CA THR A 41 3.875 -4.707 -17.174 1.00 14.78 C
-ATOM 302 C THR A 41 3.932 -3.487 -17.746 1.00 15.32 C
-ATOM 303 O THR A 41 3.044 -3.054 -18.672 1.00 15.67 O
-ATOM 304 CB THR A 41 2.612 -5.037 -16.228 1.00 15.38 C
-ATOM 305 OG1 THR A 41 2.526 -4.071 -15.248 1.00 14.93 O
-ATOM 306 CG2 THR A 41 2.578 -6.405 -15.884 1.00 16.57 C
-ATOM 307 N TYR A 42 4.610 -2.356 -17.311 1.00 10.46 N
-ATOM 308 CA TYR A 42 4.398 -1.015 -17.861 1.00 12.73 C
-ATOM 309 C TYR A 42 5.571 -0.792 -19.101 1.00 7.07 C
-ATOM 310 O TYR A 42 5.611 0.312 -19.642 1.00 12.11 O
-ATOM 311 CB TYR A 42 4.898 -0.049 -16.794 1.00 14.67 C
-ATOM 312 CG TYR A 42 3.618 0.026 -15.875 1.00 13.54 C
-ATOM 313 CD1 TYR A 42 2.437 0.794 -16.095 1.00 19.68 C
-ATOM 314 CD2 TYR A 42 3.661 -0.765 -14.634 1.00 18.38 C
-ATOM 315 CE1 TYR A 42 1.433 0.570 -15.142 1.00 23.98 C
-ATOM 316 CE2 TYR A 42 2.601 -0.739 -13.758 1.00 13.41 C
-ATOM 317 CZ TYR A 42 1.469 -0.048 -14.033 1.00 18.96 C
-ATOM 318 OH TYR A 42 0.436 -0.054 -13.115 1.00 19.81 O
-ATOM 319 N PHE A 43 6.476 -1.826 -19.154 1.00 17.11 N
-ATOM 320 CA PHE A 43 7.621 -1.843 -20.115 1.00 18.18 C
-ATOM 321 C PHE A 43 7.472 -2.895 -21.133 1.00 24.86 C
-ATOM 322 O PHE A 43 8.506 -3.413 -21.456 1.00 22.13 O
-ATOM 323 CB PHE A 43 8.883 -1.731 -19.445 1.00 15.44 C
-ATOM 324 CG PHE A 43 9.117 -0.406 -18.576 1.00 14.36 C
-ATOM 325 CD1 PHE A 43 8.554 -0.479 -17.198 1.00 14.47 C
-ATOM 326 CD2 PHE A 43 9.564 0.739 -18.886 1.00 16.54 C
-ATOM 327 CE1 PHE A 43 8.777 0.624 -16.478 1.00 20.56 C
-ATOM 328 CE2 PHE A 43 9.747 1.973 -18.107 1.00 17.61 C
-ATOM 329 CZ PHE A 43 9.344 1.707 -16.778 1.00 18.88 C
-ATOM 330 N PRO A 44 6.315 -3.239 -21.641 1.00 18.09 N
-ATOM 331 CA PRO A 44 6.381 -4.414 -22.439 1.00 22.24 C
-ATOM 332 C PRO A 44 7.028 -3.933 -24.077 1.00 24.15 C
-ATOM 333 O PRO A 44 7.495 -4.754 -24.733 1.00 24.01 O
-ATOM 334 CB PRO A 44 5.048 -4.531 -22.752 1.00 28.44 C
-ATOM 335 CG PRO A 44 4.370 -3.210 -22.675 1.00 24.77 C
-ATOM 336 CD PRO A 44 5.151 -2.594 -21.501 1.00 21.37 C
-ATOM 337 N HIS A 45 7.181 -2.759 -24.200 1.00 22.61 N
-ATOM 338 CA HIS A 45 7.861 -2.190 -25.416 1.00 32.33 C
-ATOM 339 C HIS A 45 9.330 -2.042 -25.421 1.00 27.50 C
-ATOM 340 O HIS A 45 9.974 -1.539 -26.257 1.00 22.34 O
-ATOM 341 CB HIS A 45 7.358 -0.919 -25.693 1.00 28.91 C
-ATOM 342 CG HIS A 45 7.192 0.375 -24.801 1.00 24.48 C
-ATOM 343 ND1 HIS A 45 6.886 -0.058 -23.407 1.00 28.61 N
-ATOM 344 CD2 HIS A 45 7.956 1.463 -24.795 1.00 25.11 C
-ATOM 345 CE1 HIS A 45 7.011 1.085 -22.716 1.00 26.97 C
-ATOM 346 NE2 HIS A 45 7.765 2.042 -23.628 1.00 30.40 N
-ATOM 347 N PHE A 46 10.122 -2.386 -24.054 1.00 17.28 N
-ATOM 348 CA PHE A 46 11.455 -2.262 -23.909 1.00 16.89 C
-ATOM 349 C PHE A 46 12.005 -3.636 -24.127 1.00 16.17 C
-ATOM 350 O PHE A 46 11.604 -4.686 -23.635 1.00 18.14 O
-ATOM 351 CB PHE A 46 11.684 -1.700 -22.434 1.00 19.02 C
-ATOM 352 CG PHE A 46 11.699 -0.399 -22.451 1.00 24.73 C
-ATOM 353 CD1 PHE A 46 12.430 0.377 -21.434 1.00 19.60 C
-ATOM 354 CD2 PHE A 46 11.298 0.412 -23.118 1.00 32.07 C
-ATOM 355 CE1 PHE A 46 12.410 1.666 -21.260 1.00 16.62 C
-ATOM 356 CE2 PHE A 46 11.265 1.969 -23.113 1.00 32.95 C
-ATOM 357 CZ PHE A 46 11.777 2.738 -22.175 1.00 26.82 C
-ATOM 358 N ASP A 47 13.392 -3.464 -24.534 1.00 19.28 N
-ATOM 359 CA ASP A 47 14.201 -4.676 -24.267 1.00 21.11 C
-ATOM 360 C ASP A 47 14.839 -4.498 -22.659 1.00 19.86 C
-ATOM 361 O ASP A 47 15.431 -3.489 -22.547 1.00 21.26 O
-ATOM 362 CB ASP A 47 15.523 -4.420 -25.240 1.00 18.49 C
-ATOM 363 CG ASP A 47 16.401 -5.761 -25.037 1.00 31.25 C
-ATOM 364 OD1 ASP A 47 16.311 -6.607 -24.275 1.00 29.75 O
-ATOM 365 OD2 ASP A 47 17.439 -5.328 -25.588 1.00 43.41 O
-ATOM 366 N LEU A 48 14.368 -5.324 -22.041 1.00 24.03 N
-ATOM 367 CA LEU A 48 14.753 -5.341 -20.734 1.00 18.27 C
-ATOM 368 C LEU A 48 15.791 -6.404 -20.198 1.00 36.02 C
-ATOM 369 O LEU A 48 16.171 -6.209 -19.141 1.00 39.74 O
-ATOM 370 CB LEU A 48 13.415 -5.610 -19.721 1.00 19.69 C
-ATOM 371 CG LEU A 48 12.489 -4.486 -19.789 1.00 21.82 C
-ATOM 372 CD1 LEU A 48 11.174 -5.208 -18.951 1.00 33.27 C
-ATOM 373 CD2 LEU A 48 12.620 -3.262 -19.549 1.00 24.10 C
-ATOM 374 N SER A 49 16.783 -6.499 -21.225 1.00 29.95 N
-ATOM 375 CA SER A 49 18.122 -7.384 -21.060 1.00 36.57 C
-ATOM 376 C SER A 49 18.846 -6.374 -20.277 1.00 27.84 C
-ATOM 377 O SER A 49 19.000 -5.086 -20.358 1.00 22.88 O
-ATOM 378 CB SER A 49 18.154 -8.122 -22.211 1.00 37.22 C
-ATOM 379 OG SER A 49 18.651 -7.428 -22.904 1.00 43.53 O
-ATOM 380 N HIS A 50 19.910 -7.126 -19.381 1.00 28.70 N
-ATOM 381 CA HIS A 50 20.458 -5.929 -18.816 1.00 33.73 C
-ATOM 382 C HIS A 50 21.497 -5.179 -19.493 1.00 26.32 C
-ATOM 383 O HIS A 50 22.162 -5.918 -20.594 1.00 31.00 O
-ATOM 384 CB HIS A 50 21.839 -7.147 -17.996 1.00 52.72 C
-ATOM 385 CG HIS A 50 22.748 -6.326 -17.477 1.00 44.40 C
-ATOM 386 ND1 HIS A 50 22.626 -5.701 -16.215 1.00 33.80 N
-ATOM 387 CD2 HIS A 50 24.218 -6.937 -17.247 1.00 47.43 C
-ATOM 388 CE1 HIS A 50 23.812 -5.042 -15.891 1.00 41.56 C
-ATOM 389 NE2 HIS A 50 24.721 -5.696 -16.698 1.00 46.05 N
-ATOM 390 N GLY A 51 21.750 -4.254 -19.494 1.00 24.77 N
-ATOM 391 CA GLY A 51 22.455 -3.151 -20.084 1.00 47.57 C
-ATOM 392 C GLY A 51 21.857 -2.536 -21.373 1.00 38.90 C
-ATOM 393 O GLY A 51 22.594 -2.038 -22.085 1.00 36.29 O
-ATOM 394 N SER A 52 20.675 -3.017 -21.484 1.00 31.32 N
-ATOM 395 CA SER A 52 19.963 -2.196 -22.851 1.00 26.23 C
-ATOM 396 C SER A 52 20.134 -0.997 -22.782 1.00 16.57 C
-ATOM 397 O SER A 52 19.933 -0.129 -21.983 1.00 20.02 O
-ATOM 398 CB SER A 52 18.619 -2.881 -22.964 1.00 27.24 C
-ATOM 399 OG SER A 52 17.746 -2.046 -22.388 1.00 23.82 O
-ATOM 400 N ALA A 53 20.194 -0.382 -24.103 1.00 17.74 N
-ATOM 401 CA ALA A 53 20.270 0.998 -24.154 1.00 23.86 C
-ATOM 402 C ALA A 53 18.923 1.773 -23.848 1.00 16.18 C
-ATOM 403 O ALA A 53 18.953 2.849 -23.330 1.00 19.42 O
-ATOM 404 CB ALA A 53 20.303 1.395 -25.787 1.00 25.47 C
-ATOM 405 N GLN A 54 17.736 0.981 -23.874 1.00 20.85 N
-ATOM 406 CA GLN A 54 16.512 1.657 -23.573 1.00 13.59 C
-ATOM 407 C GLN A 54 16.574 1.828 -21.914 1.00 19.26 C
-ATOM 408 O GLN A 54 15.942 2.867 -21.609 1.00 20.48 O
-ATOM 409 CB GLN A 54 15.353 0.611 -23.904 1.00 15.39 C
-ATOM 410 CG GLN A 54 14.983 0.803 -25.364 1.00 20.40 C
-ATOM 411 CD GLN A 54 14.209 -0.311 -25.782 1.00 15.48 C
-ATOM 412 OE1 GLN A 54 14.579 -1.521 -25.849 1.00 23.45 O
-ATOM 413 NE2 GLN A 54 13.268 -0.063 -26.856 1.00 19.86 N
-ATOM 414 N VAL A 55 16.964 0.770 -21.300 1.00 16.87 N
-ATOM 415 CA VAL A 55 17.057 0.967 -19.825 1.00 16.48 C
-ATOM 416 C VAL A 55 17.956 2.003 -19.318 1.00 17.36 C
-ATOM 417 O VAL A 55 17.791 2.873 -18.570 1.00 18.40 O
-ATOM 418 CB VAL A 55 17.306 -0.514 -19.268 1.00 14.78 C
-ATOM 419 CG1 VAL A 55 17.609 -0.401 -17.796 1.00 21.77 C
-ATOM 420 CG2 VAL A 55 16.107 -1.297 -19.446 1.00 16.83 C
-ATOM 421 N LYS A 56 19.228 1.986 -19.953 1.00 16.43 N
-ATOM 422 CA LYS A 56 20.094 3.039 -19.797 1.00 16.52 C
-ATOM 423 C LYS A 56 19.566 4.272 -19.699 1.00 21.58 C
-ATOM 424 O LYS A 56 19.825 5.350 -19.163 1.00 20.11 O
-ATOM 425 CB LYS A 56 21.563 2.786 -20.316 1.00 18.35 C
-ATOM 426 CG LYS A 56 21.968 1.412 -19.848 1.00 28.49 C
-ATOM 427 CD LYS A 56 23.832 1.798 -20.631 1.00 44.71 C
-ATOM 428 CE LYS A 56 24.647 0.185 -20.276 1.00 47.65 C
-ATOM 429 NZ LYS A 56 26.042 0.618 -20.926 1.00 52.31 N
-ATOM 430 N GLY A 57 19.018 4.549 -21.123 1.00 17.21 N
-ATOM 431 CA GLY A 57 18.386 5.829 -21.439 1.00 25.10 C
-ATOM 432 C GLY A 57 17.163 6.322 -20.441 1.00 19.44 C
-ATOM 433 O GLY A 57 17.339 7.478 -20.078 1.00 20.54 O
-ATOM 434 N HIS A 58 16.465 5.322 -20.170 1.00 18.79 N
-ATOM 435 CA HIS A 58 15.350 5.701 -19.218 1.00 20.27 C
-ATOM 436 C HIS A 58 15.995 6.080 -17.623 1.00 13.51 C
-ATOM 437 O HIS A 58 15.432 7.056 -17.182 1.00 17.47 O
-ATOM 438 CB HIS A 58 14.449 4.447 -19.262 1.00 17.90 C
-ATOM 439 CG HIS A 58 13.058 4.996 -18.478 1.00 15.76 C
-ATOM 440 ND1 HIS A 58 12.287 6.114 -18.800 1.00 20.40 N
-ATOM 441 CD2 HIS A 58 12.522 4.394 -17.450 1.00 20.31 C
-ATOM 442 CE1 HIS A 58 11.473 6.092 -17.719 1.00 20.13 C
-ATOM 443 NE2 HIS A 58 11.497 5.103 -17.065 1.00 21.08 N
-ATOM 444 N GLY A 59 16.881 5.222 -17.443 1.00 14.95 N
-ATOM 445 CA GLY A 59 17.562 5.623 -16.096 1.00 18.11 C
-ATOM 446 C GLY A 59 18.124 6.806 -15.942 1.00 19.85 C
-ATOM 447 O GLY A 59 17.932 7.718 -15.003 1.00 15.36 O
-ATOM 448 N LYS A 60 18.701 7.399 -17.074 1.00 17.17 N
-ATOM 449 CA LYS A 60 19.105 8.846 -17.109 1.00 18.34 C
-ATOM 450 C LYS A 60 18.266 9.905 -16.940 1.00 18.03 C
-ATOM 451 O LYS A 60 18.249 10.847 -16.377 1.00 18.72 O
-ATOM 452 CB LYS A 60 20.142 9.096 -18.402 1.00 30.65 C
-ATOM 453 CG LYS A 60 20.617 10.355 -18.546 1.00 41.57 C
-ATOM 454 CD LYS A 60 21.486 10.272 -19.721 1.00 63.44 C
-ATOM 455 CE LYS A 60 22.042 12.123 -19.760 1.00 44.10 C
-ATOM 456 NZ LYS A 60 23.253 10.931 -21.838 1.00 49.08 N
-ATOM 457 N LYS A 61 17.057 9.480 -17.740 1.00 16.33 N
-ATOM 458 CA LYS A 61 15.986 10.442 -17.612 1.00 17.87 C
-ATOM 459 C LYS A 61 15.127 10.479 -16.158 1.00 14.89 C
-ATOM 460 O LYS A 61 14.981 11.608 -15.829 1.00 19.71 O
-ATOM 461 CB LYS A 61 14.717 10.033 -18.529 1.00 25.67 C
-ATOM 462 CG LYS A 61 14.971 10.361 -20.143 1.00 41.04 C
-ATOM 463 CD LYS A 61 13.959 9.646 -21.043 1.00 54.25 C
-ATOM 464 CE LYS A 61 14.061 9.666 -21.851 1.00 78.95 C
-ATOM 465 NZ LYS A 61 13.029 9.011 -23.092 1.00 43.58 N
-ATOM 466 N VAL A 62 15.316 9.304 -15.709 1.00 15.10 N
-ATOM 467 CA VAL A 62 14.699 9.322 -14.234 1.00 16.18 C
-ATOM 468 C VAL A 62 15.686 10.200 -13.093 1.00 18.93 C
-ATOM 469 O VAL A 62 15.095 11.051 -12.555 1.00 16.64 O
-ATOM 470 CB VAL A 62 14.660 7.890 -13.835 1.00 13.59 C
-ATOM 471 CG1 VAL A 62 14.141 7.704 -12.419 1.00 20.28 C
-ATOM 472 CG2 VAL A 62 13.407 7.365 -14.552 1.00 17.24 C
-ATOM 473 N ALA A 63 16.863 9.822 -13.546 1.00 18.60 N
-ATOM 474 CA ALA A 63 17.806 10.661 -12.634 1.00 14.91 C
-ATOM 475 C ALA A 63 18.050 11.967 -12.922 1.00 18.47 C
-ATOM 476 O ALA A 63 17.940 12.889 -11.976 1.00 18.58 O
-ATOM 477 CB ALA A 63 19.170 9.768 -12.782 1.00 37.76 C
-ATOM 478 N ASP A 64 17.821 12.573 -14.198 1.00 16.80 N
-ATOM 479 CA ASP A 64 17.733 13.912 -14.174 1.00 24.74 C
-ATOM 480 C ASP A 64 16.549 14.773 -13.697 1.00 17.12 C
-ATOM 481 O ASP A 64 16.672 15.717 -13.116 1.00 22.08 O
-ATOM 482 CB ASP A 64 17.603 14.212 -15.737 1.00 35.97 C
-ATOM 483 CG ASP A 64 19.349 14.293 -16.612 1.00 31.06 C
-ATOM 484 OD1 ASP A 64 20.156 13.672 -15.497 1.00 35.72 O
-ATOM 485 OD2 ASP A 64 18.977 14.172 -17.839 1.00 43.58 O
-ATOM 486 N ALA A 65 15.332 13.912 -13.869 1.00 13.28 N
-ATOM 487 CA ALA A 65 14.329 14.415 -13.017 1.00 17.27 C
-ATOM 488 C ALA A 65 14.445 14.482 -11.415 1.00 13.03 C
-ATOM 489 O ALA A 65 13.989 15.536 -11.013 1.00 17.77 O
-ATOM 490 CB ALA A 65 12.982 13.578 -13.361 1.00 23.35 C
-ATOM 491 N LEU A 66 15.162 13.498 -11.063 1.00 15.51 N
-ATOM 492 CA LEU A 66 15.339 13.706 -9.605 1.00 11.63 C
-ATOM 493 C LEU A 66 16.337 14.754 -9.333 1.00 19.15 C
-ATOM 494 O LEU A 66 16.146 15.585 -8.334 1.00 19.52 O
-ATOM 495 CB LEU A 66 15.829 12.371 -9.144 1.00 13.76 C
-ATOM 496 CG LEU A 66 14.823 11.115 -8.963 1.00 19.82 C
-ATOM 497 CD1 LEU A 66 15.489 9.880 -8.746 1.00 18.79 C
-ATOM 498 CD2 LEU A 66 13.658 11.434 -8.143 1.00 21.54 C
-ATOM 499 N THR A 67 17.286 14.890 -10.137 1.00 15.35 N
-ATOM 500 CA THR A 67 18.223 15.978 -10.096 1.00 19.22 C
-ATOM 501 C THR A 67 17.538 17.420 -10.103 1.00 19.35 C
-ATOM 502 O THR A 67 17.647 18.426 -9.135 1.00 25.50 O
-ATOM 503 CB THR A 67 19.391 15.815 -10.975 1.00 27.92 C
-ATOM 504 OG1 THR A 67 20.048 14.951 -10.890 1.00 31.77 O
-ATOM 505 CG2 THR A 67 20.007 17.263 -11.105 1.00 31.55 C
-ATOM 506 N ASN A 68 16.575 17.470 -11.016 1.00 18.73 N
-ATOM 507 CA ASN A 68 15.744 18.747 -11.028 1.00 18.68 C
-ATOM 508 C ASN A 68 14.923 18.912 -9.894 1.00 24.52 C
-ATOM 509 O ASN A 68 14.765 20.137 -9.247 1.00 25.75 O
-ATOM 510 CB ASN A 68 14.756 18.608 -12.121 1.00 25.79 C
-ATOM 511 CG ASN A 68 13.735 19.831 -12.299 1.00 36.65 C
-ATOM 512 OD1 ASN A 68 14.126 20.875 -12.151 1.00 38.63 O
-ATOM 513 ND2 ASN A 68 12.596 19.698 -13.037 1.00 39.67 N
-ATOM 514 N ALA A 69 14.365 17.791 -9.099 1.00 17.85 N
-ATOM 515 CA ALA A 69 13.480 18.120 -7.964 1.00 16.12 C
-ATOM 516 C ALA A 69 14.454 18.477 -6.733 1.00 15.28 C
-ATOM 517 O ALA A 69 14.055 19.178 -5.996 1.00 20.90 O
-ATOM 518 CB ALA A 69 13.019 16.796 -7.635 1.00 21.91 C
-ATOM 519 N VAL A 70 15.742 17.807 -6.739 1.00 18.42 N
-ATOM 520 CA VAL A 70 16.670 18.320 -5.560 1.00 18.79 C
-ATOM 521 C VAL A 70 17.052 19.774 -5.743 1.00 21.40 C
-ATOM 522 O VAL A 70 16.986 20.472 -4.749 1.00 22.44 O
-ATOM 523 CB VAL A 70 17.782 17.521 -5.616 1.00 19.75 C
-ATOM 524 CG1 VAL A 70 19.021 17.739 -4.714 1.00 24.49 C
-ATOM 525 CG2 VAL A 70 17.476 16.043 -5.206 1.00 30.23 C
-ATOM 526 N ALA A 71 17.156 20.293 -6.971 1.00 20.17 N
-ATOM 527 CA ALA A 71 17.389 21.815 -7.308 1.00 23.56 C
-ATOM 528 C ALA A 71 16.370 22.294 -6.912 1.00 25.98 C
-ATOM 529 O ALA A 71 16.635 23.655 -6.511 1.00 33.09 O
-ATOM 530 CB ALA A 71 17.654 21.789 -8.655 1.00 32.78 C
-ATOM 531 N HIS A 72 15.081 22.080 -6.888 1.00 23.78 N
-ATOM 532 CA HIS A 72 13.997 22.837 -6.617 1.00 21.95 C
-ATOM 533 C HIS A 72 13.181 22.411 -5.617 1.00 20.17 C
-ATOM 534 O HIS A 72 11.897 22.212 -5.613 1.00 23.99 O
-ATOM 535 CB HIS A 72 12.821 22.953 -7.947 1.00 35.07 C
-ATOM 536 CG HIS A 72 13.866 23.277 -8.689 1.00 34.89 C
-ATOM 537 ND1 HIS A 72 13.873 24.932 -9.510 1.00 43.74 N
-ATOM 538 CD2 HIS A 72 14.464 23.117 -10.031 1.00 29.96 C
-ATOM 539 CE1 HIS A 72 15.153 25.255 -9.959 1.00 41.69 C
-ATOM 540 NE2 HIS A 72 15.223 24.225 -10.948 1.00 44.85 N
-ATOM 541 N VAL A 73 13.752 21.857 -4.446 1.00 23.31 N
-ATOM 542 CA VAL A 73 13.057 21.077 -3.315 1.00 23.32 C
-ATOM 543 C VAL A 73 12.075 21.651 -2.904 1.00 32.07 C
-ATOM 544 O VAL A 73 10.955 21.485 -2.533 1.00 42.18 O
-ATOM 545 CB VAL A 73 13.998 20.556 -2.485 1.00 41.19 C
-ATOM 546 CG1 VAL A 73 14.923 21.399 -1.795 1.00 52.76 C
-ATOM 547 CG2 VAL A 73 13.799 19.262 -2.036 1.00 47.91 C
-ATOM 548 N ASP A 74 12.275 23.065 -2.789 1.00 30.40 N
-ATOM 549 CA ASP A 74 11.145 24.002 -2.142 1.00 34.95 C
-ATOM 550 C ASP A 74 10.049 24.015 -3.350 1.00 50.97 C
-ATOM 551 O ASP A 74 9.132 24.778 -2.717 1.00 49.62 O
-ATOM 552 CB ASP A 74 11.678 25.422 -2.020 1.00 42.77 C
-ATOM 553 CG ASP A 74 12.830 25.304 -0.645 1.00 52.01 C
-ATOM 554 OD1 ASP A 74 12.752 24.865 0.015 1.00 49.67 O
-ATOM 555 OD2 ASP A 74 14.337 25.661 -0.918 1.00 51.46 O
-ATOM 556 N ASP A 75 9.922 23.915 -4.261 1.00 36.55 N
-ATOM 557 CA ASP A 75 8.668 23.936 -5.208 1.00 36.46 C
-ATOM 558 C ASP A 75 8.874 22.788 -6.315 1.00 19.07 C
-ATOM 559 O ASP A 75 8.567 23.036 -7.581 1.00 22.77 O
-ATOM 560 CB ASP A 75 9.451 25.163 -6.540 1.00 64.13 C
-ATOM 561 CG ASP A 75 8.868 25.436 -6.330 1.00 74.46 C
-ATOM 562 OD1 ASP A 75 7.314 26.337 -6.605 1.00 47.43 O
-ATOM 563 OD2 ASP A 75 8.881 25.994 -8.289 1.00 60.83 O
-ATOM 564 N MET A 76 8.625 21.775 -5.634 1.00 28.83 N
-ATOM 565 CA MET A 76 8.674 20.530 -6.647 1.00 25.75 C
-ATOM 566 C MET A 76 7.271 20.288 -7.401 1.00 26.47 C
-ATOM 567 O MET A 76 7.358 19.996 -8.579 1.00 25.06 O
-ATOM 568 CB MET A 76 8.643 19.305 -5.552 1.00 26.87 C
-ATOM 569 CG MET A 76 9.740 19.092 -5.553 1.00 44.91 C
-ATOM 570 SD MET A 76 10.207 17.317 -4.716 1.00 43.69 S
-ATOM 571 CE MET A 76 10.186 17.272 -3.278 1.00 47.45 C
-ATOM 572 N PRO A 77 6.289 20.734 -6.858 1.00 24.72 N
-ATOM 573 CA PRO A 77 5.288 21.011 -7.720 1.00 32.25 C
-ATOM 574 C PRO A 77 5.404 21.500 -8.895 1.00 33.71 C
-ATOM 575 O PRO A 77 4.843 20.983 -10.107 1.00 27.50 O
-ATOM 576 CB PRO A 77 3.868 21.504 -6.885 1.00 35.42 C
-ATOM 577 CG PRO A 77 4.538 21.027 -5.570 1.00 42.65 C
-ATOM 578 CD PRO A 77 5.873 20.979 -5.490 1.00 26.77 C
-ATOM 579 N ASN A 78 5.832 22.745 -9.066 1.00 28.71 N
-ATOM 580 CA ASN A 78 5.931 23.542 -10.146 1.00 29.25 C
-ATOM 581 C ASN A 78 7.105 22.960 -10.923 1.00 25.30 C
-ATOM 582 O ASN A 78 7.043 22.562 -12.258 1.00 31.49 O
-ATOM 583 CB ASN A 78 6.292 25.075 -10.189 1.00 52.85 C
-ATOM 584 CG ASN A 78 5.615 25.627 -10.060 1.00 62.76 C
-ATOM 585 OD1 ASN A 78 4.765 26.184 -8.258 1.00 71.55 O
-ATOM 586 ND2 ASN A 78 4.594 25.811 -10.486 1.00 72.60 N
-ATOM 587 N ALA A 79 8.114 22.456 -10.315 1.00 21.06 N
-ATOM 588 CA ALA A 79 9.264 21.897 -10.989 1.00 28.88 C
-ATOM 589 C ALA A 79 8.963 20.522 -11.944 1.00 27.69 C
-ATOM 590 O ALA A 79 9.465 20.431 -13.022 1.00 25.51 O
-ATOM 591 CB ALA A 79 10.294 21.701 -10.105 1.00 35.64 C
-ATOM 592 N LEU A 80 8.232 19.781 -11.312 1.00 22.21 N
-ATOM 593 CA LEU A 80 7.767 18.341 -11.815 1.00 24.91 C
-ATOM 594 C LEU A 80 6.510 18.562 -12.698 1.00 29.49 C
-ATOM 595 O LEU A 80 5.875 17.479 -12.950 1.00 21.47 O
-ATOM 596 CB LEU A 80 7.734 17.285 -10.765 1.00 17.03 C
-ATOM 597 CG LEU A 80 9.126 17.077 -10.078 1.00 26.04 C
-ATOM 598 CD1 LEU A 80 8.930 16.109 -9.016 1.00 30.97 C
-ATOM 599 CD2 LEU A 80 10.040 16.545 -11.282 1.00 40.31 C
-ATOM 600 N SER A 81 5.857 19.827 -12.942 1.00 21.07 N
-ATOM 601 CA SER A 81 4.431 19.687 -13.335 1.00 18.09 C
-ATOM 602 C SER A 81 4.363 19.087 -14.671 1.00 20.48 C
-ATOM 603 O SER A 81 3.314 18.257 -14.890 1.00 25.77 O
-ATOM 604 CB SER A 81 4.467 21.619 -13.861 1.00 32.64 C
-ATOM 605 OG SER A 81 2.994 21.456 -13.913 1.00 44.30 O
-ATOM 606 N ALA A 82 5.219 18.957 -15.594 1.00 23.80 N
-ATOM 607 CA ALA A 82 5.295 18.397 -16.849 1.00 21.23 C
-ATOM 608 C ALA A 82 5.047 16.984 -16.596 1.00 19.91 C
-ATOM 609 O ALA A 82 4.419 16.133 -17.266 1.00 24.36 O
-ATOM 610 CB ALA A 82 6.433 18.664 -17.830 1.00 22.94 C
-ATOM 611 N LEU A 83 6.039 16.444 -15.755 1.00 18.35 N
-ATOM 612 CA LEU A 83 5.983 14.900 -15.664 1.00 19.01 C
-ATOM 613 C LEU A 83 4.967 14.491 -14.735 1.00 18.91 C
-ATOM 614 O LEU A 83 4.393 13.347 -14.967 1.00 18.17 O
-ATOM 615 CB LEU A 83 7.250 14.624 -14.735 1.00 22.27 C
-ATOM 616 CG LEU A 83 8.130 13.821 -15.009 1.00 34.66 C
-ATOM 617 CD1 LEU A 83 8.449 13.918 -16.558 1.00 28.24 C
-ATOM 618 CD2 LEU A 83 9.756 14.153 -14.680 1.00 38.79 C
-ATOM 619 N SER A 84 4.321 15.210 -13.869 1.00 13.22 N
-ATOM 620 CA SER A 84 3.091 14.769 -13.309 1.00 14.54 C
-ATOM 621 C SER A 84 1.806 14.643 -14.240 1.00 13.50 C
-ATOM 622 O SER A 84 1.081 13.802 -14.037 1.00 20.19 O
-ATOM 623 CB SER A 84 2.316 15.701 -11.953 1.00 25.45 C
-ATOM 624 OG SER A 84 3.028 16.684 -12.075 1.00 36.19 O
-ATOM 625 N ASP A 85 1.894 15.645 -15.194 1.00 15.99 N
-ATOM 626 CA ASP A 85 0.657 15.457 -16.246 1.00 18.10 C
-ATOM 627 C ASP A 85 0.872 14.320 -17.117 1.00 20.71 C
-ATOM 628 O ASP A 85 0.085 13.524 -17.249 1.00 20.01 O
-ATOM 629 CB ASP A 85 0.847 16.636 -17.207 1.00 30.89 C
-ATOM 630 CG ASP A 85 0.240 17.791 -16.350 1.00 57.00 C
-ATOM 631 OD1 ASP A 85 -0.408 17.890 -15.984 1.00 51.34 O
-ATOM 632 OD2 ASP A 85 0.645 19.250 -17.189 1.00 50.68 O
-ATOM 633 N LEU A 86 2.217 13.883 -17.444 1.00 20.13 N
-ATOM 634 CA LEU A 86 2.516 12.802 -18.225 1.00 17.03 C
-ATOM 635 C LEU A 86 2.094 11.499 -17.604 1.00 14.48 C
-ATOM 636 O LEU A 86 1.613 10.536 -18.155 1.00 18.46 O
-ATOM 637 CB LEU A 86 4.085 12.859 -18.555 1.00 16.01 C
-ATOM 638 CG LEU A 86 4.479 11.856 -19.204 1.00 23.66 C
-ATOM 639 CD1 LEU A 86 4.217 11.927 -20.682 1.00 40.43 C
-ATOM 640 CD2 LEU A 86 6.063 11.399 -19.455 1.00 33.72 C
-ATOM 641 N HIS A 87 2.488 11.534 -16.185 1.00 12.17 N
-ATOM 642 CA HIS A 87 2.237 10.125 -15.649 1.00 12.85 C
-ATOM 643 C HIS A 87 0.524 10.055 -15.280 1.00 15.39 C
-ATOM 644 O HIS A 87 0.114 8.957 -15.394 1.00 15.03 O
-ATOM 645 CB HIS A 87 2.873 10.043 -14.177 1.00 13.63 C
-ATOM 646 CG HIS A 87 4.357 9.531 -14.510 1.00 14.91 C
-ATOM 647 ND1 HIS A 87 5.315 10.638 -14.847 1.00 15.35 N
-ATOM 648 CD2 HIS A 87 5.128 8.461 -14.450 1.00 17.85 C
-ATOM 649 CE1 HIS A 87 6.425 9.938 -15.110 1.00 15.29 C
-ATOM 650 NE2 HIS A 87 6.410 8.672 -14.776 1.00 15.64 N
-ATOM 651 N ALA A 88 0.070 11.240 -15.092 1.00 19.56 N
-ATOM 652 CA ALA A 88 -1.450 11.245 -14.731 1.00 16.45 C
-ATOM 653 C ALA A 88 -2.307 10.782 -16.164 1.00 28.29 C
-ATOM 654 O ALA A 88 -3.217 10.321 -15.884 1.00 25.27 O
-ATOM 655 CB ALA A 88 -1.985 12.408 -13.954 1.00 17.34 C
-ATOM 656 N HIS A 89 -1.856 11.542 -17.115 1.00 21.56 N
-ATOM 657 CA HIS A 89 -2.652 11.471 -18.284 1.00 29.42 C
-ATOM 658 C HIS A 89 -2.430 10.590 -19.375 1.00 27.17 C
-ATOM 659 O HIS A 89 -3.237 9.974 -20.183 1.00 22.35 O
-ATOM 660 CB HIS A 89 -2.855 12.836 -18.839 1.00 26.26 C
-ATOM 661 CG HIS A 89 -3.474 13.775 -17.933 1.00 44.45 C
-ATOM 662 ND1 HIS A 89 -4.582 13.545 -17.082 1.00 45.59 N
-ATOM 663 CD2 HIS A 89 -3.036 15.133 -17.376 1.00 45.61 C
-ATOM 664 CE1 HIS A 89 -4.931 14.373 -15.965 1.00 42.72 C
-ATOM 665 NE2 HIS A 89 -3.969 15.212 -16.507 1.00 43.49 N
-ATOM 666 N LYS A 90 -1.237 10.085 -19.553 1.00 18.65 N
-ATOM 667 CA LYS A 90 -0.701 9.212 -20.311 1.00 28.92 C
-ATOM 668 C LYS A 90 -0.235 7.836 -20.094 1.00 28.09 C
-ATOM 669 O LYS A 90 -0.814 6.865 -20.213 1.00 25.04 O
-ATOM 670 CB LYS A 90 0.483 9.973 -21.248 1.00 32.47 C
-ATOM 671 CG LYS A 90 -0.258 11.271 -22.102 1.00 49.97 C
-ATOM 672 CD LYS A 90 -1.161 11.150 -22.865 1.00 58.54 C
-ATOM 673 CE LYS A 90 -0.717 12.584 -23.928 1.00 66.22 C
-ATOM 674 NZ LYS A 90 -3.148 11.648 -24.501 1.00 63.54 N
-ATOM 675 N LEU A 91 0.684 7.834 -19.083 1.00 17.50 N
-ATOM 676 CA LEU A 91 1.357 6.678 -18.728 1.00 15.47 C
-ATOM 677 C LEU A 91 0.469 5.814 -17.729 1.00 18.54 C
-ATOM 678 O LEU A 91 0.360 4.623 -17.933 1.00 17.03 O
-ATOM 679 CB LEU A 91 2.810 6.867 -17.956 1.00 13.84 C
-ATOM 680 CG LEU A 91 3.828 7.564 -18.848 1.00 16.01 C
-ATOM 681 CD1 LEU A 91 4.943 7.934 -18.256 1.00 18.27 C
-ATOM 682 CD2 LEU A 91 3.998 6.811 -20.081 1.00 22.12 C
-ATOM 683 N ARG A 92 -0.013 6.544 -16.785 1.00 18.03 N
-ATOM 684 CA ARG A 92 -1.120 5.962 -15.831 1.00 14.41 C
-ATOM 685 C ARG A 92 -0.663 4.876 -15.136 1.00 15.84 C
-ATOM 686 O ARG A 92 -1.280 3.746 -14.964 1.00 17.92 O
-ATOM 687 CB ARG A 92 -2.457 5.762 -16.768 1.00 18.61 C
-ATOM 688 CG ARG A 92 -3.108 6.901 -17.068 1.00 25.14 C
-ATOM 689 CD ARG A 92 -3.735 6.578 -19.206 1.00 53.25 C
-ATOM 690 NE ARG A 92 -4.375 7.010 -18.108 1.00 51.61 N
-ATOM 691 CZ ARG A 92 -5.273 6.721 -20.498 1.00 59.18 C
-ATOM 692 NH1 ARG A 92 -4.092 6.059 -21.138 1.00 31.30 N
-ATOM 693 NH2 ARG A 92 -6.080 6.715 -20.222 1.00 36.70 N
-ATOM 694 N VAL A 93 0.444 4.876 -14.510 1.00 14.32 N
-ATOM 695 CA VAL A 93 1.119 3.933 -13.665 1.00 16.19 C
-ATOM 696 C VAL A 93 0.472 3.844 -12.448 1.00 13.83 C
-ATOM 697 O VAL A 93 0.272 4.879 -11.643 1.00 14.88 O
-ATOM 698 CB VAL A 93 2.564 4.273 -13.453 1.00 12.60 C
-ATOM 699 CG1 VAL A 93 3.153 3.301 -12.513 1.00 15.68 C
-ATOM 700 CG2 VAL A 93 3.314 4.342 -14.815 1.00 15.91 C
-ATOM 701 N ASP A 94 0.015 2.696 -11.867 1.00 14.66 N
-ATOM 702 CA ASP A 94 -0.813 2.633 -10.611 1.00 11.73 C
-ATOM 703 C ASP A 94 0.271 3.244 -9.468 1.00 12.54 C
-ATOM 704 O ASP A 94 1.339 2.859 -9.516 1.00 16.42 O
-ATOM 705 CB ASP A 94 -1.010 1.197 -10.262 1.00 12.92 C
-ATOM 706 CG ASP A 94 -1.972 1.228 -9.080 1.00 22.91 C
-ATOM 707 OD1 ASP A 94 -3.187 1.146 -9.201 1.00 22.17 O
-ATOM 708 OD2 ASP A 94 -1.457 1.316 -7.935 1.00 19.01 O
-ATOM 709 N PRO A 95 -0.249 3.901 -8.527 1.00 16.46 N
-ATOM 710 CA PRO A 95 0.567 4.636 -7.596 1.00 14.67 C
-ATOM 711 C PRO A 95 1.260 3.622 -6.816 1.00 17.74 C
-ATOM 712 O PRO A 95 2.400 4.046 -6.219 1.00 22.38 O
-ATOM 713 CB PRO A 95 -0.368 5.238 -6.654 1.00 22.16 C
-ATOM 714 CG PRO A 95 -1.377 5.777 -7.565 1.00 21.38 C
-ATOM 715 CD PRO A 95 -1.576 4.623 -8.536 1.00 20.78 C
-ATOM 716 N VAL A 96 0.927 2.374 -6.618 1.00 13.01 N
-ATOM 717 CA VAL A 96 1.730 1.539 -5.762 1.00 11.93 C
-ATOM 718 C VAL A 96 3.098 1.350 -6.142 1.00 21.27 C
-ATOM 719 O VAL A 96 4.069 1.031 -5.537 1.00 16.07 O
-ATOM 720 CB VAL A 96 0.857 0.099 -5.620 1.00 29.83 C
-ATOM 721 CG1 VAL A 96 0.923 -0.687 -6.401 1.00 48.43 C
-ATOM 722 CG2 VAL A 96 1.322 -0.240 -4.779 1.00 70.91 C
-ATOM 723 N ASN A 97 3.269 1.470 -7.559 1.00 15.63 N
-ATOM 724 CA ASN A 97 4.615 1.047 -8.098 1.00 10.10 C
-ATOM 725 C ASN A 97 5.675 2.262 -7.895 1.00 4.91 C
-ATOM 726 O ASN A 97 6.828 1.839 -7.860 1.00 9.67 O
-ATOM 727 CB ASN A 97 4.581 0.892 -9.670 1.00 13.43 C
-ATOM 728 CG ASN A 97 3.716 -0.282 -9.938 1.00 17.91 C
-ATOM 729 OD1 ASN A 97 4.086 -1.378 -9.937 1.00 10.92 O
-ATOM 730 ND2 ASN A 97 2.339 0.119 -10.294 1.00 21.96 N
-ATOM 731 N PHE A 98 5.251 3.390 -7.458 1.00 9.20 N
-ATOM 732 CA PHE A 98 6.132 4.482 -7.110 1.00 12.10 C
-ATOM 733 C PHE A 98 6.958 4.075 -5.773 1.00 12.02 C
-ATOM 734 O PHE A 98 8.240 4.323 -5.676 1.00 11.50 O
-ATOM 735 CB PHE A 98 5.590 5.923 -6.936 1.00 16.66 C
-ATOM 736 CG PHE A 98 5.051 6.336 -8.208 1.00 14.23 C
-ATOM 737 CD1 PHE A 98 5.894 7.220 -8.806 1.00 16.70 C
-ATOM 738 CD2 PHE A 98 3.842 5.962 -8.759 1.00 12.76 C
-ATOM 739 CE1 PHE A 98 5.529 7.688 -9.904 1.00 23.57 C
-ATOM 740 CE2 PHE A 98 3.513 6.440 -10.107 1.00 15.74 C
-ATOM 741 CZ PHE A 98 4.374 7.231 -10.516 1.00 17.50 C
-ATOM 742 N LYS A 99 6.362 3.356 -4.846 1.00 13.69 N
-ATOM 743 CA LYS A 99 7.109 2.770 -3.687 1.00 13.57 C
-ATOM 744 C LYS A 99 7.912 1.744 -3.941 1.00 14.35 C
-ATOM 745 O LYS A 99 9.044 1.864 -3.350 1.00 13.29 O
-ATOM 746 CB LYS A 99 5.909 2.378 -2.665 1.00 22.01 C
-ATOM 747 CG LYS A 99 5.016 2.967 -2.454 1.00 54.35 C
-ATOM 748 CD LYS A 99 4.488 3.000 -1.609 1.00 72.56 C
-ATOM 749 CE LYS A 99 2.959 1.795 -1.600 1.00 73.99 C
-ATOM 750 NZ LYS A 99 1.741 2.896 -0.134 1.00 80.12 N
-ATOM 751 N LEU A 100 7.785 1.013 -5.037 1.00 9.89 N
-ATOM 752 CA LEU A 100 8.665 -0.028 -5.354 1.00 8.80 C
-ATOM 753 C LEU A 100 9.884 0.546 -6.019 1.00 9.28 C
-ATOM 754 O LEU A 100 11.014 0.165 -5.616 1.00 12.09 O
-ATOM 755 CB LEU A 100 8.009 -1.084 -6.185 1.00 11.00 C
-ATOM 756 CG LEU A 100 6.724 -1.520 -5.691 1.00 16.83 C
-ATOM 757 CD1 LEU A 100 6.069 -2.688 -6.703 1.00 20.94 C
-ATOM 758 CD2 LEU A 100 7.065 -2.491 -4.548 1.00 18.49 C
-ATOM 759 N LEU A 101 9.812 1.484 -6.927 1.00 8.39 N
-ATOM 760 CA LEU A 101 10.986 2.076 -7.511 1.00 10.30 C
-ATOM 761 C LEU A 101 11.701 2.979 -6.551 1.00 14.49 C
-ATOM 762 O LEU A 101 12.986 2.948 -6.333 1.00 16.14 O
-ATOM 763 CB LEU A 101 10.485 2.971 -8.570 1.00 11.44 C
-ATOM 764 CG LEU A 101 11.708 3.704 -9.282 1.00 15.06 C
-ATOM 765 CD1 LEU A 101 12.805 2.937 -9.771 1.00 17.72 C
-ATOM 766 CD2 LEU A 101 11.060 4.651 -10.427 1.00 19.38 C
-ATOM 767 N SER A 102 11.019 3.662 -5.475 1.00 15.17 N
-ATOM 768 CA SER A 102 11.653 4.426 -4.454 1.00 9.19 C
-ATOM 769 C SER A 102 12.577 3.423 -3.620 1.00 9.91 C
-ATOM 770 O SER A 102 13.768 3.831 -3.267 1.00 14.07 O
-ATOM 771 CB SER A 102 10.597 5.003 -3.570 1.00 12.36 C
-ATOM 772 OG SER A 102 9.919 6.079 -4.248 1.00 16.52 O
-ATOM 773 N HIS A 103 12.034 2.275 -3.168 1.00 12.27 N
-ATOM 774 CA HIS A 103 12.685 1.217 -2.471 1.00 10.16 C
-ATOM 775 C HIS A 103 14.063 1.009 -3.068 1.00 13.13 C
-ATOM 776 O HIS A 103 15.226 0.862 -2.602 1.00 13.37 O
-ATOM 777 CB HIS A 103 11.949 0.073 -2.013 1.00 12.31 C
-ATOM 778 CG HIS A 103 12.674 -1.002 -1.380 1.00 10.33 C
-ATOM 779 ND1 HIS A 103 12.899 -2.229 -2.007 1.00 10.01 N
-ATOM 780 CD2 HIS A 103 13.318 -0.937 -0.179 1.00 9.56 C
-ATOM 781 CE1 HIS A 103 13.687 -2.798 -1.043 1.00 12.63 C
-ATOM 782 NE2 HIS A 103 14.053 -2.093 0.083 1.00 10.77 N
-ATOM 783 N CYS A 104 13.914 0.657 -4.439 1.00 11.06 N
-ATOM 784 CA CYS A 104 15.233 0.205 -5.307 1.00 11.72 C
-ATOM 785 C CYS A 104 16.049 1.418 -5.518 1.00 9.58 C
-ATOM 786 O CYS A 104 17.228 1.081 -5.567 1.00 14.10 O
-ATOM 787 CB CYS A 104 14.671 -0.439 -6.552 1.00 16.81 C
-ATOM 788 SG CYS A 104 13.797 -1.958 -6.414 1.00 14.76 S
-ATOM 789 N LEU A 105 15.618 2.594 -5.516 1.00 7.99 N
-ATOM 790 CA LEU A 105 16.723 3.634 -5.593 1.00 10.43 C
-ATOM 791 C LEU A 105 17.448 3.890 -4.202 1.00 11.96 C
-ATOM 792 O LEU A 105 18.594 3.985 -4.326 1.00 15.19 O
-ATOM 793 CB LEU A 105 15.765 4.895 -6.092 1.00 16.93 C
-ATOM 794 CG LEU A 105 15.765 5.438 -7.260 1.00 44.57 C
-ATOM 795 CD1 LEU A 105 14.641 6.498 -7.442 1.00 40.98 C
-ATOM 796 CD2 LEU A 105 16.687 5.564 -8.008 1.00 33.21 C
-ATOM 797 N LEU A 106 16.617 3.676 -3.143 1.00 10.40 N
-ATOM 798 CA LEU A 106 17.322 3.635 -1.869 1.00 15.02 C
-ATOM 799 C LEU A 106 18.190 2.641 -1.668 1.00 13.79 C
-ATOM 800 O LEU A 106 19.481 2.857 -1.263 1.00 13.12 O
-ATOM 801 CB LEU A 106 16.241 3.634 -0.757 1.00 16.59 C
-ATOM 802 CG LEU A 106 15.821 4.348 0.036 1.00 26.87 C
-ATOM 803 CD1 LEU A 106 14.832 4.036 0.973 1.00 28.01 C
-ATOM 804 CD2 LEU A 106 16.399 5.824 0.153 1.00 18.73 C
-ATOM 805 N VAL A 107 18.054 1.391 -2.126 1.00 9.58 N
-ATOM 806 CA VAL A 107 18.953 0.372 -2.172 1.00 10.69 C
-ATOM 807 C VAL A 107 20.116 0.640 -3.008 1.00 12.39 C
-ATOM 808 O VAL A 107 21.316 0.322 -2.651 1.00 13.09 O
-ATOM 809 CB VAL A 107 18.301 -0.968 -2.671 1.00 14.48 C
-ATOM 810 CG1 VAL A 107 19.286 -1.955 -2.913 1.00 19.64 C
-ATOM 811 CG2 VAL A 107 17.236 -1.532 -1.566 1.00 13.81 C
-ATOM 812 N THR A 108 19.963 1.288 -4.127 1.00 12.66 N
-ATOM 813 CA THR A 108 21.110 1.595 -5.027 1.00 11.04 C
-ATOM 814 C THR A 108 21.986 2.516 -4.350 1.00 11.25 C
-ATOM 815 O THR A 108 23.209 2.402 -4.407 1.00 13.68 O
-ATOM 816 CB THR A 108 20.373 2.089 -6.467 1.00 8.55 C
-ATOM 817 OG1 THR A 108 19.740 1.009 -7.110 1.00 9.51 O
-ATOM 818 CG2 THR A 108 21.547 2.322 -7.342 1.00 15.85 C
-ATOM 819 N LEU A 109 21.371 3.638 -3.771 1.00 11.20 N
-ATOM 820 CA LEU A 109 22.189 4.682 -3.080 1.00 12.61 C
-ATOM 821 C LEU A 109 23.015 3.976 -1.882 1.00 16.09 C
-ATOM 822 O LEU A 109 24.210 4.291 -1.739 1.00 14.60 O
-ATOM 823 CB LEU A 109 21.280 5.707 -2.657 1.00 17.08 C
-ATOM 824 CG LEU A 109 20.748 6.795 -3.713 1.00 24.50 C
-ATOM 825 CD1 LEU A 109 19.679 7.424 -3.306 1.00 22.52 C
-ATOM 826 CD2 LEU A 109 21.379 6.943 -4.782 1.00 32.08 C
-ATOM 827 N ALA A 110 22.243 3.090 -1.228 1.00 13.55 N
-ATOM 828 CA ALA A 110 22.985 2.551 -0.107 1.00 19.86 C
-ATOM 829 C ALA A 110 24.128 1.797 -0.396 1.00 18.59 C
-ATOM 830 O ALA A 110 25.285 1.654 0.094 1.00 14.76 O
-ATOM 831 CB ALA A 110 21.957 1.572 0.573 1.00 17.34 C
-ATOM 832 N ALA A 111 24.211 0.998 -1.558 1.00 15.15 N
-ATOM 833 CA ALA A 111 25.062 0.161 -2.216 1.00 13.42 C
-ATOM 834 C ALA A 111 26.376 1.017 -2.643 1.00 16.84 C
-ATOM 835 O ALA A 111 27.331 0.420 -2.883 1.00 21.50 O
-ATOM 836 CB ALA A 111 24.726 -0.813 -3.252 1.00 16.85 C
-ATOM 837 N HIS A 112 26.089 2.220 -3.063 1.00 17.71 N
-ATOM 838 CA HIS A 112 27.174 3.032 -3.686 1.00 25.83 C
-ATOM 839 C HIS A 112 27.556 4.174 -2.656 1.00 21.86 C
-ATOM 840 O HIS A 112 28.710 4.609 -3.162 1.00 23.07 O
-ATOM 841 CB HIS A 112 26.642 3.736 -5.093 1.00 17.12 C
-ATOM 842 CG HIS A 112 26.500 2.730 -6.083 1.00 18.91 C
-ATOM 843 ND1 HIS A 112 27.696 2.669 -6.792 1.00 20.25 N
-ATOM 844 CD2 HIS A 112 25.457 2.082 -6.643 1.00 13.97 C
-ATOM 845 CE1 HIS A 112 27.065 1.572 -7.791 1.00 16.16 C
-ATOM 846 NE2 HIS A 112 25.728 1.142 -7.624 1.00 16.17 N
-ATOM 847 N LEU A 113 26.962 4.473 -1.633 1.00 16.18 N
-ATOM 848 CA LEU A 113 27.430 5.708 -0.856 1.00 18.52 C
-ATOM 849 C LEU A 113 27.676 5.161 0.490 1.00 15.09 C
-ATOM 850 O LEU A 113 26.991 5.652 1.418 1.00 22.00 O
-ATOM 851 CB LEU A 113 26.385 6.569 -0.567 1.00 26.60 C
-ATOM 852 CG LEU A 113 25.991 7.546 -1.915 1.00 26.91 C
-ATOM 853 CD1 LEU A 113 25.025 8.844 -1.799 1.00 38.78 C
-ATOM 854 CD2 LEU A 113 27.117 7.882 -2.870 1.00 35.29 C
-ATOM 855 N PRO A 114 28.523 4.242 0.795 1.00 18.92 N
-ATOM 856 CA PRO A 114 28.714 3.528 2.218 1.00 24.61 C
-ATOM 857 C PRO A 114 29.102 4.799 3.218 1.00 23.92 C
-ATOM 858 O PRO A 114 28.415 4.826 4.106 1.00 21.99 O
-ATOM 859 CB PRO A 114 30.033 2.940 1.849 1.00 23.94 C
-ATOM 860 CG PRO A 114 30.698 3.344 0.612 1.00 18.92 C
-ATOM 861 CD PRO A 114 29.469 3.904 -0.168 1.00 16.59 C
-ATOM 862 N ALA A 115 29.794 5.877 2.767 1.00 18.42 N
-ATOM 863 CA ALA A 115 30.159 6.863 3.921 1.00 21.98 C
-ATOM 864 C ALA A 115 28.895 7.716 4.285 1.00 22.41 C
-ATOM 865 O ALA A 115 28.703 8.192 5.284 1.00 22.94 O
-ATOM 866 CB ALA A 115 31.247 7.657 3.369 1.00 30.20 C
-ATOM 867 N GLU A 116 28.136 8.035 3.290 1.00 15.58 N
-ATOM 868 CA GLU A 116 27.073 9.160 3.429 1.00 17.43 C
-ATOM 869 C GLU A 116 25.648 8.548 3.788 1.00 15.97 C
-ATOM 870 O GLU A 116 24.768 9.367 4.171 1.00 23.49 O
-ATOM 871 CB GLU A 116 26.875 9.750 1.910 1.00 21.21 C
-ATOM 872 CG GLU A 116 27.948 10.674 1.482 1.00 24.18 C
-ATOM 873 CD GLU A 116 28.950 9.665 0.967 1.00 26.12 C
-ATOM 874 OE1 GLU A 116 28.992 8.438 0.543 1.00 28.16 O
-ATOM 875 OE2 GLU A 116 30.132 10.301 0.462 1.00 33.82 O
-ATOM 876 N PHE A 117 25.414 7.310 3.661 1.00 16.62 N
-ATOM 877 CA PHE A 117 24.245 6.614 3.985 1.00 14.17 C
-ATOM 878 C PHE A 117 23.918 6.335 5.559 1.00 17.74 C
-ATOM 879 O PHE A 117 23.649 5.222 5.819 1.00 19.92 O
-ATOM 880 CB PHE A 117 23.936 5.421 3.086 1.00 12.47 C
-ATOM 881 CG PHE A 117 22.448 4.906 2.825 1.00 9.61 C
-ATOM 882 CD1 PHE A 117 21.681 5.713 2.037 1.00 15.09 C
-ATOM 883 CD2 PHE A 117 22.071 3.807 3.568 1.00 15.73 C
-ATOM 884 CE1 PHE A 117 20.396 5.197 1.858 1.00 17.90 C
-ATOM 885 CE2 PHE A 117 20.593 3.448 3.517 1.00 23.05 C
-ATOM 886 CZ PHE A 117 19.914 4.171 2.606 1.00 14.00 C
-ATOM 887 N THR A 118 23.856 7.434 6.252 1.00 11.56 N
-ATOM 888 CA THR A 118 23.660 7.280 7.655 1.00 10.93 C
-ATOM 889 C THR A 118 22.259 6.982 7.820 1.00 15.34 C
-ATOM 890 O THR A 118 21.447 7.435 7.051 1.00 14.33 O
-ATOM 891 CB THR A 118 23.982 8.621 8.138 1.00 22.78 C
-ATOM 892 OG1 THR A 118 23.375 9.780 7.827 1.00 25.00 O
-ATOM 893 CG2 THR A 118 25.586 8.842 8.226 1.00 25.00 C
-ATOM 894 N PRO A 119 21.833 6.884 9.086 1.00 16.93 N
-ATOM 895 CA PRO A 119 20.398 6.708 9.436 1.00 7.97 C
-ATOM 896 C PRO A 119 19.633 7.821 9.121 1.00 9.71 C
-ATOM 897 O PRO A 119 18.484 7.899 8.632 1.00 13.14 O
-ATOM 898 CB PRO A 119 20.352 6.336 10.909 1.00 15.02 C
-ATOM 899 CG PRO A 119 21.556 5.500 11.105 1.00 20.08 C
-ATOM 900 CD PRO A 119 22.686 6.188 10.125 1.00 23.85 C
-ATOM 901 N ALA A 120 20.184 9.026 9.484 1.00 18.30 N
-ATOM 902 CA ALA A 120 19.624 10.215 9.304 1.00 20.48 C
-ATOM 903 C ALA A 120 19.441 10.650 7.769 1.00 11.11 C
-ATOM 904 O ALA A 120 18.342 11.025 7.255 1.00 14.90 O
-ATOM 905 CB ALA A 120 20.042 11.527 10.014 1.00 21.25 C
-ATOM 906 N VAL A 121 20.278 10.312 7.027 1.00 15.02 N
-ATOM 907 CA VAL A 121 20.243 10.488 5.614 1.00 11.64 C
-ATOM 908 C VAL A 121 19.214 9.526 4.899 1.00 13.80 C
-ATOM 909 O VAL A 121 18.469 9.919 4.066 1.00 15.60 O
-ATOM 910 CB VAL A 121 21.606 10.473 4.939 1.00 16.28 C
-ATOM 911 CG1 VAL A 121 21.595 10.524 3.309 1.00 17.80 C
-ATOM 912 CG2 VAL A 121 22.496 11.659 5.330 1.00 19.30 C
-ATOM 913 N HIS A 122 19.312 8.350 5.306 1.00 15.45 N
-ATOM 914 CA HIS A 122 18.254 7.136 4.913 1.00 11.57 C
-ATOM 915 C HIS A 122 16.950 7.952 5.022 1.00 13.88 C
-ATOM 916 O HIS A 122 16.085 7.716 4.230 1.00 13.87 O
-ATOM 917 CB HIS A 122 18.754 5.950 5.667 1.00 12.36 C
-ATOM 918 CG HIS A 122 17.848 4.887 5.471 1.00 15.49 C
-ATOM 919 ND1 HIS A 122 18.318 3.588 6.013 1.00 14.41 N
-ATOM 920 CD2 HIS A 122 16.770 4.643 4.716 1.00 16.00 C
-ATOM 921 CE1 HIS A 122 17.238 2.617 5.530 1.00 20.76 C
-ATOM 922 NE2 HIS A 122 16.304 3.230 4.756 1.00 17.17 N
-ATOM 923 N ALA A 123 16.659 8.268 6.248 1.00 12.31 N
-ATOM 924 CA ALA A 123 15.409 8.791 6.637 1.00 12.34 C
-ATOM 925 C ALA A 123 14.961 9.969 5.694 1.00 12.36 C
-ATOM 926 O ALA A 123 13.756 10.012 5.125 1.00 16.22 O
-ATOM 927 CB ALA A 123 15.295 9.229 8.074 1.00 18.20 C
-ATOM 928 N SER A 124 15.970 10.909 5.411 1.00 11.72 N
-ATOM 929 CA SER A 124 15.641 12.024 4.678 1.00 15.71 C
-ATOM 930 C SER A 124 15.409 11.594 3.146 1.00 11.97 C
-ATOM 931 O SER A 124 14.491 12.176 2.530 1.00 13.78 O
-ATOM 932 CB SER A 124 16.719 13.075 4.649 1.00 17.31 C
-ATOM 933 OG SER A 124 16.856 13.618 5.975 1.00 19.36 O
-ATOM 934 N LEU A 125 16.244 10.663 2.745 1.00 11.45 N
-ATOM 935 CA LEU A 125 16.012 10.336 1.348 1.00 9.77 C
-ATOM 936 C LEU A 125 14.814 9.607 1.165 1.00 13.87 C
-ATOM 937 O LEU A 125 14.134 9.697 0.072 1.00 12.03 O
-ATOM 938 CB LEU A 125 17.131 9.446 0.945 1.00 14.61 C
-ATOM 939 CG LEU A 125 18.555 9.965 0.565 1.00 15.39 C
-ATOM 940 CD1 LEU A 125 19.590 8.976 0.528 1.00 26.84 C
-ATOM 941 CD2 LEU A 125 18.455 10.851 -0.577 1.00 19.46 C
-ATOM 942 N ASP A 126 14.277 8.735 2.034 1.00 13.89 N
-ATOM 943 CA ASP A 126 13.042 7.997 2.040 1.00 14.28 C
-ATOM 944 C ASP A 126 11.977 8.930 1.898 1.00 13.60 C
-ATOM 945 O ASP A 126 10.911 8.959 1.188 1.00 12.25 O
-ATOM 946 CB ASP A 126 12.901 7.025 3.127 1.00 9.77 C
-ATOM 947 CG ASP A 126 11.751 5.958 3.086 1.00 17.51 C
-ATOM 948 OD1 ASP A 126 11.597 5.517 1.933 1.00 22.67 O
-ATOM 949 OD2 ASP A 126 10.812 6.013 3.738 1.00 20.83 O
-ATOM 950 N LYS A 127 11.945 10.077 2.732 1.00 11.87 N
-ATOM 951 CA LYS A 127 11.051 11.143 2.756 1.00 11.94 C
-ATOM 952 C LYS A 127 11.080 11.794 1.382 1.00 16.34 C
-ATOM 953 O LYS A 127 9.925 12.173 0.922 1.00 15.26 O
-ATOM 954 CB LYS A 127 11.131 11.830 4.210 1.00 27.23 C
-ATOM 955 CG LYS A 127 10.719 12.405 4.298 1.00 41.38 C
-ATOM 956 CD LYS A 127 10.893 12.716 6.240 1.00 22.35 C
-ATOM 957 CE LYS A 127 10.245 13.990 6.093 1.00 24.85 C
-ATOM 958 NZ LYS A 127 10.431 14.893 7.319 1.00 27.43 N
-ATOM 959 N PHE A 128 12.109 12.155 0.978 1.00 9.60 N
-ATOM 960 CA PHE A 128 12.219 12.896 -0.315 1.00 9.45 C
-ATOM 961 C PHE A 128 11.648 12.055 -1.437 1.00 11.35 C
-ATOM 962 O PHE A 128 10.825 12.624 -2.222 1.00 13.72 O
-ATOM 963 CB PHE A 128 13.691 13.118 -0.597 1.00 10.04 C
-ATOM 964 CG PHE A 128 13.845 13.645 -2.016 1.00 12.71 C
-ATOM 965 CD1 PHE A 128 13.433 15.022 -2.350 1.00 22.47 C
-ATOM 966 CD2 PHE A 128 14.442 12.953 -2.821 1.00 15.10 C
-ATOM 967 CE1 PHE A 128 13.646 15.369 -3.684 1.00 21.90 C
-ATOM 968 CE2 PHE A 128 15.006 13.229 -4.197 1.00 24.41 C
-ATOM 969 CZ PHE A 128 14.491 14.511 -4.397 1.00 19.00 C
-ATOM 970 N LEU A 129 11.863 10.701 -1.438 1.00 10.92 N
-ATOM 971 CA LEU A 129 11.247 9.983 -2.588 1.00 8.59 C
-ATOM 972 C LEU A 129 9.888 9.762 -2.445 1.00 15.58 C
-ATOM 973 O LEU A 129 9.123 9.780 -3.420 1.00 12.33 O
-ATOM 974 CB LEU A 129 11.971 8.639 -2.709 1.00 11.08 C
-ATOM 975 CG LEU A 129 13.553 8.574 -3.067 1.00 16.43 C
-ATOM 976 CD1 LEU A 129 14.162 7.385 -2.920 1.00 21.21 C
-ATOM 977 CD2 LEU A 129 13.509 9.197 -4.648 1.00 24.11 C
-ATOM 978 N ALA A 130 9.315 9.777 -1.285 1.00 13.59 N
-ATOM 979 CA ALA A 130 7.861 9.751 -0.992 1.00 12.80 C
-ATOM 980 C ALA A 130 7.198 11.000 -1.487 1.00 13.10 C
-ATOM 981 O ALA A 130 6.124 11.123 -2.087 1.00 16.72 O
-ATOM 982 CB ALA A 130 7.566 9.549 0.507 1.00 11.70 C
-ATOM 983 N SER A 131 7.929 12.205 -1.316 1.00 12.15 N
-ATOM 984 CA SER A 131 7.318 13.421 -1.788 1.00 17.97 C
-ATOM 985 C SER A 131 7.403 13.484 -3.383 1.00 14.23 C
-ATOM 986 O SER A 131 6.313 14.078 -3.819 1.00 17.89 O
-ATOM 987 CB SER A 131 8.230 14.652 -1.217 1.00 19.09 C
-ATOM 988 OG SER A 131 7.985 14.599 -0.027 1.00 34.89 O
-ATOM 989 N VAL A 132 8.509 13.092 -3.817 1.00 11.02 N
-ATOM 990 CA VAL A 132 8.474 13.187 -5.332 1.00 13.44 C
-ATOM 991 C VAL A 132 7.379 12.239 -5.739 1.00 13.26 C
-ATOM 992 O VAL A 132 6.574 12.766 -6.727 1.00 14.28 O
-ATOM 993 CB VAL A 132 9.676 12.669 -5.775 1.00 17.47 C
-ATOM 994 CG1 VAL A 132 9.886 12.366 -7.268 1.00 23.96 C
-ATOM 995 CG2 VAL A 132 10.893 13.605 -5.556 1.00 15.24 C
-ATOM 996 N SER A 133 7.084 11.034 -5.279 1.00 11.44 N
-ATOM 997 CA SER A 133 6.003 10.145 -5.616 1.00 14.28 C
-ATOM 998 C SER A 133 4.653 10.824 -5.346 1.00 22.70 C
-ATOM 999 O SER A 133 3.857 10.661 -6.312 1.00 18.73 O
-ATOM 1000 CB SER A 133 6.206 8.913 -4.797 1.00 14.07 C
-ATOM 1001 OG SER A 133 7.326 8.157 -5.136 1.00 16.41 O
-ATOM 1002 N THR A 134 4.415 11.603 -4.390 1.00 14.75 N
-ATOM 1003 CA THR A 134 3.185 12.188 -4.293 1.00 11.93 C
-ATOM 1004 C THR A 134 3.018 13.180 -5.135 1.00 12.33 C
-ATOM 1005 O THR A 134 1.906 13.411 -5.657 1.00 15.87 O
-ATOM 1006 CB THR A 134 3.337 12.691 -2.840 1.00 23.98 C
-ATOM 1007 OG1 THR A 134 3.226 11.963 -1.926 1.00 24.65 O
-ATOM 1008 CG2 THR A 134 2.127 13.740 -2.527 1.00 35.48 C
-ATOM 1009 N VAL A 135 3.914 14.063 -5.633 1.00 16.85 N
-ATOM 1010 CA VAL A 135 3.773 15.122 -6.561 1.00 15.02 C
-ATOM 1011 C VAL A 135 3.692 14.401 -7.901 1.00 18.49 C
-ATOM 1012 O VAL A 135 2.676 14.854 -8.623 1.00 17.84 O
-ATOM 1013 CB VAL A 135 5.097 16.044 -6.643 1.00 21.41 C
-ATOM 1014 CG1 VAL A 135 5.125 16.829 -7.908 1.00 28.88 C
-ATOM 1015 CG2 VAL A 135 5.265 16.767 -5.381 1.00 18.54 C
-ATOM 1016 N LEU A 136 4.254 13.322 -8.291 1.00 15.13 N
-ATOM 1017 CA LEU A 136 3.951 12.616 -9.538 1.00 14.14 C
-ATOM 1018 C LEU A 136 2.480 12.083 -9.717 1.00 16.82 C
-ATOM 1019 O LEU A 136 2.071 11.725 -10.914 1.00 16.56 O
-ATOM 1020 CB LEU A 136 5.082 11.671 -9.878 1.00 19.05 C
-ATOM 1021 CG LEU A 136 6.468 12.174 -10.486 1.00 19.99 C
-ATOM 1022 CD1 LEU A 136 7.357 11.046 -10.401 1.00 23.33 C
-ATOM 1023 CD2 LEU A 136 6.502 13.371 -11.272 1.00 20.84 C
-ATOM 1024 N THR A 137 1.951 11.790 -8.618 1.00 14.14 N
-ATOM 1025 CA THR A 137 0.509 10.996 -8.584 1.00 17.11 C
-ATOM 1026 C THR A 137 -0.385 12.070 -8.267 1.00 15.43 C
-ATOM 1027 O THR A 137 -1.637 11.700 -8.230 1.00 15.99 O
-ATOM 1028 CB THR A 137 0.560 9.964 -6.978 1.00 17.27 C
-ATOM 1029 OG1 THR A 137 1.278 8.939 -8.074 1.00 28.37 O
-ATOM 1030 CG2 THR A 137 1.320 10.263 -6.388 1.00 47.04 C
-ATOM 1031 N SER A 138 -0.164 13.266 -8.168 1.00 16.91 N
-ATOM 1032 CA SER A 138 -0.947 14.363 -7.753 1.00 23.51 C
-ATOM 1033 C SER A 138 -2.266 14.743 -8.597 1.00 23.60 C
-ATOM 1034 O SER A 138 -3.250 14.937 -8.017 1.00 27.80 O
-ATOM 1035 CB SER A 138 0.046 16.222 -7.976 1.00 22.76 C
-ATOM 1036 OG SER A 138 -0.261 15.617 -6.862 1.00 45.85 O
-ATOM 1037 N LYS A 139 -2.026 14.453 -9.807 1.00 19.13 N
-ATOM 1038 CA LYS A 139 -3.058 14.995 -10.892 1.00 21.43 C
-ATOM 1039 C LYS A 139 -3.804 13.721 -11.284 1.00 18.35 C
-ATOM 1040 O LYS A 139 -4.384 13.814 -12.266 1.00 22.16 O
-ATOM 1041 CB LYS A 139 -2.474 15.794 -11.975 1.00 24.13 C
-ATOM 1042 CG LYS A 139 -1.839 16.973 -11.481 1.00 28.98 C
-ATOM 1043 CD LYS A 139 -0.886 17.619 -12.549 1.00 33.18 C
-ATOM 1044 CE LYS A 139 -0.495 18.885 -12.192 1.00 52.82 C
-ATOM 1045 NZ LYS A 139 0.788 19.253 -13.621 1.00 55.02 N
-ATOM 1046 N TYR A 140 -3.715 12.530 -10.777 1.00 17.12 N
-ATOM 1047 CA TYR A 140 -4.275 11.374 -11.162 1.00 22.48 C
-ATOM 1048 C TYR A 140 -5.830 11.291 -11.160 1.00 18.75 C
-ATOM 1049 O TYR A 140 -6.423 10.704 -12.162 1.00 22.47 O
-ATOM 1050 CB TYR A 140 -3.896 10.028 -10.426 1.00 23.15 C
-ATOM 1051 CG TYR A 140 -2.655 9.444 -11.006 1.00 15.57 C
-ATOM 1052 CD1 TYR A 140 -2.495 7.940 -11.096 1.00 16.98 C
-ATOM 1053 CD2 TYR A 140 -1.471 10.093 -11.392 1.00 18.11 C
-ATOM 1054 CE1 TYR A 140 -1.296 7.400 -11.625 1.00 19.97 C
-ATOM 1055 CE2 TYR A 140 -0.267 9.379 -11.806 1.00 14.94 C
-ATOM 1056 CZ TYR A 140 -0.246 7.948 -11.911 1.00 17.89 C
-ATOM 1057 OH TYR A 140 0.808 7.493 -12.283 1.00 18.05 O
-ATOM 1058 N ARG A 141 -6.399 12.034 -10.391 1.00 17.59 N
-ATOM 1059 CA ARG A 141 -8.000 12.137 -10.191 1.00 24.58 C
-ATOM 1060 C ARG A 141 -8.327 13.610 -9.572 1.00 44.44 C
-ATOM 1061 O ARG A 141 -7.492 14.016 -8.882 1.00 21.81 O
-ATOM 1062 CB ARG A 141 -8.478 10.914 -9.869 1.00 33.40 C
-ATOM 1063 CG ARG A 141 -8.068 10.650 -8.145 1.00 17.28 C
-ATOM 1064 CD ARG A 141 -9.053 9.446 -7.867 1.00 14.66 C
-ATOM 1065 NE ARG A 141 -8.372 9.269 -6.610 1.00 22.73 N
-ATOM 1066 CZ ARG A 141 -9.233 8.420 -5.781 1.00 26.88 C
-ATOM 1067 NH1 ARG A 141 -10.147 7.455 -6.079 1.00 23.24 N
-ATOM 1068 NH2 ARG A 141 -8.672 8.328 -4.506 1.00 33.34 N
-ATOM 1069 OXT ARG A 141 -9.474 13.682 -9.742 1.00 31.52 O
-TER 1070 ARG A 141
-ATOM 1071 N VAL B 1 9.223 -20.614 1.365 1.00 46.08 N
-ATOM 1072 CA VAL B 1 8.694 -20.026 -0.123 1.00 70.96 C
-ATOM 1073 C VAL B 1 9.668 -21.068 -1.645 1.00 69.74 C
-ATOM 1074 O VAL B 1 9.370 -22.612 -0.994 1.00 71.82 O
-ATOM 1075 CB VAL B 1 9.283 -18.281 -0.381 1.00 59.18 C
-ATOM 1076 CG1 VAL B 1 7.449 -17.518 -0.791 1.00 57.89 C
-ATOM 1077 CG2 VAL B 1 10.416 -18.038 0.066 1.00 44.20 C
-ATOM 1078 N HIS B 2 9.270 -20.650 -2.180 1.00 53.55 N
-ATOM 1079 CA HIS B 2 10.245 -21.378 -3.143 1.00 62.62 C
-ATOM 1080 C HIS B 2 11.419 -20.331 -4.099 1.00 51.71 C
-ATOM 1081 O HIS B 2 11.252 -19.250 -5.024 1.00 48.42 O
-ATOM 1082 CB HIS B 2 9.225 -20.955 -4.825 1.00 62.58 C
-ATOM 1083 CG HIS B 2 9.378 -21.082 -5.634 1.00 73.96 C
-ATOM 1084 ND1 HIS B 2 9.645 -19.683 -6.869 1.00 80.12 N
-ATOM 1085 CD2 HIS B 2 10.077 -22.950 -6.116 1.00 63.02 C
-ATOM 1086 CE1 HIS B 2 10.672 -21.165 -8.087 1.00 76.40 C
-ATOM 1087 NE2 HIS B 2 11.344 -22.584 -7.734 1.00 62.86 N
-ATOM 1088 N LEU B 3 12.365 -20.722 -3.649 1.00 43.89 N
-ATOM 1089 CA LEU B 3 13.611 -20.183 -4.477 1.00 43.79 C
-ATOM 1090 C LEU B 3 14.557 -21.356 -5.125 1.00 32.77 C
-ATOM 1091 O LEU B 3 14.340 -22.536 -4.780 1.00 41.84 O
-ATOM 1092 CB LEU B 3 14.522 -19.852 -2.996 1.00 28.80 C
-ATOM 1093 CG LEU B 3 13.980 -18.598 -2.183 1.00 28.70 C
-ATOM 1094 CD1 LEU B 3 14.846 -18.445 -1.199 1.00 63.39 C
-ATOM 1095 CD2 LEU B 3 14.509 -17.517 -3.001 1.00 32.10 C
-ATOM 1096 N THR B 4 14.840 -20.756 -6.280 1.00 42.35 N
-ATOM 1097 CA THR B 4 15.864 -21.825 -6.744 1.00 41.74 C
-ATOM 1098 C THR B 4 16.873 -22.187 -6.071 1.00 36.91 C
-ATOM 1099 O THR B 4 17.370 -21.395 -5.237 1.00 31.57 O
-ATOM 1100 CB THR B 4 15.949 -21.050 -8.090 1.00 38.91 C
-ATOM 1101 OG1 THR B 4 16.952 -20.015 -8.082 1.00 52.85 O
-ATOM 1102 CG2 THR B 4 14.967 -20.467 -9.056 1.00 56.94 C
-ATOM 1103 N PRO B 5 17.854 -23.111 -6.524 1.00 45.56 N
-ATOM 1104 CA PRO B 5 18.731 -23.731 -6.023 1.00 47.54 C
-ATOM 1105 C PRO B 5 19.935 -22.444 -5.760 1.00 37.80 C
-ATOM 1106 O PRO B 5 20.658 -22.372 -4.793 1.00 33.06 O
-ATOM 1107 CB PRO B 5 19.534 -24.900 -6.291 1.00 62.12 C
-ATOM 1108 CG PRO B 5 18.296 -25.318 -7.157 1.00 42.55 C
-ATOM 1109 CD PRO B 5 17.186 -24.560 -7.385 1.00 48.08 C
-ATOM 1110 N GLU B 6 19.819 -21.815 -6.978 1.00 27.00 N
-ATOM 1111 CA GLU B 6 20.898 -20.991 -7.230 1.00 34.37 C
-ATOM 1112 C GLU B 6 20.521 -19.635 -6.155 1.00 23.02 C
-ATOM 1113 O GLU B 6 21.687 -18.920 -5.617 1.00 28.54 O
-ATOM 1114 CB GLU B 6 20.842 -20.165 -8.661 1.00 37.20 C
-ATOM 1115 CG GLU B 6 20.141 -19.957 -9.396 1.00 66.65 C
-ATOM 1116 CD GLU B 6 19.153 -21.597 -10.181 1.00 60.44 C
-ATOM 1117 OE1 GLU B 6 20.183 -22.830 -9.731 1.00 63.16 O
-ATOM 1118 OE2 GLU B 6 18.299 -21.975 -10.007 1.00 70.62 O
-ATOM 1119 N GLU B 7 19.362 -19.413 -5.964 1.00 31.47 N
-ATOM 1120 CA GLU B 7 18.560 -18.284 -5.124 1.00 34.08 C
-ATOM 1121 C GLU B 7 19.160 -18.789 -3.682 1.00 21.49 C
-ATOM 1122 O GLU B 7 19.620 -17.847 -3.008 1.00 27.04 O
-ATOM 1123 CB GLU B 7 17.625 -18.097 -5.359 1.00 35.55 C
-ATOM 1124 CG GLU B 7 17.103 -17.196 -6.791 1.00 33.74 C
-ATOM 1125 CD GLU B 7 15.759 -16.911 -6.659 1.00 31.89 C
-ATOM 1126 OE1 GLU B 7 15.476 -15.756 -7.225 1.00 52.51 O
-ATOM 1127 OE2 GLU B 7 14.748 -17.803 -6.419 1.00 32.56 O
-ATOM 1128 N LYS B 8 18.747 -19.865 -3.237 1.00 26.08 N
-ATOM 1129 CA LYS B 8 19.026 -20.305 -2.016 1.00 32.23 C
-ATOM 1130 C LYS B 8 20.466 -20.216 -1.796 1.00 26.59 C
-ATOM 1131 O LYS B 8 21.162 -19.731 -0.601 1.00 26.11 O
-ATOM 1132 CB LYS B 8 18.395 -21.925 -1.875 1.00 36.34 C
-ATOM 1133 CG LYS B 8 18.802 -22.252 -1.182 1.00 64.20 C
-ATOM 1134 CD LYS B 8 18.769 -23.771 -0.248 1.00 73.64 C
-ATOM 1135 CE LYS B 8 19.461 -24.137 0.849 1.00 79.30 C
-ATOM 1136 NZ LYS B 8 19.874 -26.365 1.034 1.00 66.73 N
-ATOM 1137 N SER B 9 21.467 -20.675 -2.533 1.00 23.88 N
-ATOM 1138 CA SER B 9 22.559 -20.677 -2.426 1.00 36.76 C
-ATOM 1139 C SER B 9 23.490 -19.070 -2.230 1.00 37.61 C
-ATOM 1140 O SER B 9 24.284 -18.831 -1.430 1.00 28.84 O
-ATOM 1141 CB SER B 9 23.619 -21.853 -3.256 1.00 36.63 C
-ATOM 1142 OG SER B 9 23.958 -20.627 -4.033 1.00 64.02 O
-ATOM 1143 N ALA B 10 22.719 -18.196 -3.034 1.00 21.54 N
-ATOM 1144 CA ALA B 10 23.262 -17.029 -2.963 1.00 32.77 C
-ATOM 1145 C ALA B 10 22.792 -16.202 -1.459 1.00 23.64 C
-ATOM 1146 O ALA B 10 23.628 -15.408 -0.898 1.00 26.26 O
-ATOM 1147 CB ALA B 10 22.504 -16.176 -3.856 1.00 30.88 C
-ATOM 1148 N VAL B 11 21.589 -16.575 -0.940 1.00 22.75 N
-ATOM 1149 CA VAL B 11 21.174 -16.108 0.417 1.00 18.12 C
-ATOM 1150 C VAL B 11 22.242 -16.512 1.434 1.00 18.13 C
-ATOM 1151 O VAL B 11 22.655 -15.680 2.245 1.00 19.40 O
-ATOM 1152 CB VAL B 11 19.853 -16.542 0.518 1.00 19.48 C
-ATOM 1153 CG1 VAL B 11 19.403 -16.415 1.946 1.00 26.15 C
-ATOM 1154 CG2 VAL B 11 18.815 -15.702 -0.276 1.00 23.37 C
-ATOM 1155 N THR B 12 22.386 -17.775 1.358 1.00 19.01 N
-ATOM 1156 CA THR B 12 23.153 -18.592 2.377 1.00 25.04 C
-ATOM 1157 C THR B 12 24.569 -18.098 2.437 1.00 20.68 C
-ATOM 1158 O THR B 12 25.254 -17.692 3.335 1.00 23.87 O
-ATOM 1159 CB THR B 12 23.196 -20.284 2.185 1.00 42.63 C
-ATOM 1160 OG1 THR B 12 22.010 -20.433 2.444 1.00 42.78 O
-ATOM 1161 CG2 THR B 12 23.729 -20.348 1.974 1.00 67.38 C
-ATOM 1162 N ALA B 13 25.190 -17.913 1.267 1.00 22.79 N
-ATOM 1163 CA ALA B 13 26.401 -17.387 1.166 1.00 26.66 C
-ATOM 1164 C ALA B 13 26.828 -16.135 1.582 1.00 26.26 C
-ATOM 1165 O ALA B 13 27.614 -15.809 2.378 1.00 27.07 O
-ATOM 1166 CB ALA B 13 26.857 -17.378 -0.445 1.00 26.35 C
-ATOM 1167 N LEU B 14 25.928 -14.999 1.236 1.00 15.70 N
-ATOM 1168 CA LEU B 14 26.092 -13.737 1.994 1.00 15.10 C
-ATOM 1169 C LEU B 14 25.996 -13.791 3.419 1.00 17.25 C
-ATOM 1170 O LEU B 14 26.440 -13.013 4.127 1.00 15.43 O
-ATOM 1171 CB LEU B 14 25.023 -12.816 1.145 1.00 16.82 C
-ATOM 1172 CG LEU B 14 25.284 -11.388 1.257 1.00 27.27 C
-ATOM 1173 CD1 LEU B 14 26.470 -10.984 0.911 1.00 40.43 C
-ATOM 1174 CD2 LEU B 14 23.923 -10.655 1.151 1.00 24.81 C
-ATOM 1175 N TRP B 15 24.847 -14.542 3.847 1.00 17.75 N
-ATOM 1176 CA TRP B 15 24.543 -14.533 5.293 1.00 20.73 C
-ATOM 1177 C TRP B 15 25.779 -15.040 6.144 1.00 17.66 C
-ATOM 1178 O TRP B 15 25.791 -14.500 7.295 1.00 18.75 O
-ATOM 1179 CB TRP B 15 23.337 -15.255 5.477 1.00 17.11 C
-ATOM 1180 CG TRP B 15 22.785 -14.972 6.964 1.00 17.91 C
-ATOM 1181 CD1 TRP B 15 22.809 -15.647 8.020 1.00 21.87 C
-ATOM 1182 CD2 TRP B 15 21.992 -13.854 7.213 1.00 17.58 C
-ATOM 1183 NE1 TRP B 15 22.135 -15.153 9.079 1.00 18.04 N
-ATOM 1184 CE2 TRP B 15 21.659 -13.824 8.669 1.00 16.29 C
-ATOM 1185 CE3 TRP B 15 21.610 -12.684 6.475 1.00 16.29 C
-ATOM 1186 CZ2 TRP B 15 20.847 -12.810 9.252 1.00 25.87 C
-ATOM 1187 CZ3 TRP B 15 20.839 -11.689 7.176 1.00 17.96 C
-ATOM 1188 CH2 TRP B 15 20.450 -11.898 8.453 1.00 24.12 C
-ATOM 1189 N GLY B 16 26.491 -15.885 5.456 1.00 18.59 N
-ATOM 1190 CA GLY B 16 27.793 -16.367 6.203 1.00 18.72 C
-ATOM 1191 C GLY B 16 28.640 -15.293 6.479 1.00 24.14 C
-ATOM 1192 O GLY B 16 29.526 -15.462 7.418 1.00 24.08 O
-ATOM 1193 N LYS B 17 28.533 -14.214 5.902 1.00 16.20 N
-ATOM 1194 CA LYS B 17 29.341 -13.100 6.055 1.00 17.17 C
-ATOM 1195 C LYS B 17 28.732 -12.165 6.877 1.00 17.84 C
-ATOM 1196 O LYS B 17 29.459 -11.044 7.345 1.00 23.03 O
-ATOM 1197 CB LYS B 17 29.636 -12.212 4.866 1.00 27.63 C
-ATOM 1198 CG LYS B 17 30.260 -13.332 3.793 1.00 26.84 C
-ATOM 1199 CD LYS B 17 30.681 -12.758 2.663 1.00 36.92 C
-ATOM 1200 CE LYS B 17 31.201 -13.748 1.394 1.00 48.09 C
-ATOM 1201 NZ LYS B 17 31.749 -12.471 0.760 1.00 51.60 N
-ATOM 1202 N VAL B 18 27.632 -12.163 7.561 1.00 19.79 N
-ATOM 1203 CA VAL B 18 26.839 -11.228 8.296 1.00 15.59 C
-ATOM 1204 C VAL B 18 27.221 -11.355 9.806 1.00 24.20 C
-ATOM 1205 O VAL B 18 27.181 -12.396 10.461 1.00 22.49 O
-ATOM 1206 CB VAL B 18 25.375 -11.611 8.249 1.00 13.43 C
-ATOM 1207 CG1 VAL B 18 24.680 -10.797 9.203 1.00 20.38 C
-ATOM 1208 CG2 VAL B 18 25.124 -10.816 6.753 1.00 25.54 C
-ATOM 1209 N ASN B 19 27.508 -10.243 10.525 1.00 20.52 N
-ATOM 1210 CA ASN B 19 27.647 -10.334 12.056 1.00 15.58 C
-ATOM 1211 C ASN B 19 26.161 -10.008 12.553 1.00 13.56 C
-ATOM 1212 O ASN B 19 25.706 -8.798 12.411 1.00 14.77 O
-ATOM 1213 CB ASN B 19 28.532 -9.065 12.579 1.00 26.08 C
-ATOM 1214 CG ASN B 19 28.340 -8.916 14.065 1.00 29.11 C
-ATOM 1215 OD1 ASN B 19 27.732 -9.412 14.784 1.00 27.77 O
-ATOM 1216 ND2 ASN B 19 29.702 -8.401 14.383 1.00 33.88 N
-ATOM 1217 N VAL B 20 25.621 -11.024 13.009 1.00 18.83 N
-ATOM 1218 CA VAL B 20 24.087 -11.031 13.284 1.00 19.05 C
-ATOM 1219 C VAL B 20 23.851 -10.149 14.214 1.00 20.02 C
-ATOM 1220 O VAL B 20 22.901 -9.142 14.245 1.00 17.50 O
-ATOM 1221 CB VAL B 20 23.694 -12.517 13.598 1.00 25.16 C
-ATOM 1222 CG1 VAL B 20 22.215 -12.356 13.912 1.00 29.32 C
-ATOM 1223 CG2 VAL B 20 23.748 -13.338 12.333 1.00 21.26 C
-ATOM 1224 N ASP B 21 24.547 -9.725 15.239 1.00 19.64 N
-ATOM 1225 CA ASP B 21 24.274 -8.816 16.395 1.00 20.67 C
-ATOM 1226 C ASP B 21 24.562 -7.492 15.870 1.00 18.97 C
-ATOM 1227 O ASP B 21 23.606 -6.622 16.080 1.00 21.29 O
-ATOM 1228 CB ASP B 21 25.312 -9.108 17.415 1.00 34.10 C
-ATOM 1229 CG ASP B 21 25.029 -10.570 18.492 1.00 53.28 C
-ATOM 1230 OD1 ASP B 21 23.848 -10.805 18.323 1.00 40.86 O
-ATOM 1231 OD2 ASP B 21 25.861 -10.240 19.644 1.00 50.69 O
-ATOM 1232 N GLU B 22 25.464 -7.225 14.999 1.00 17.77 N
-ATOM 1233 CA GLU B 22 25.739 -5.702 14.538 1.00 21.32 C
-ATOM 1234 C GLU B 22 24.523 -5.287 13.546 1.00 17.53 C
-ATOM 1235 O GLU B 22 23.957 -4.290 13.703 1.00 21.51 O
-ATOM 1236 CB GLU B 22 27.018 -5.846 13.812 1.00 24.38 C
-ATOM 1237 CG GLU B 22 27.214 -4.730 13.144 1.00 38.60 C
-ATOM 1238 CD GLU B 22 28.169 -3.862 11.812 1.00 75.75 C
-ATOM 1239 OE1 GLU B 22 28.555 -5.400 11.034 1.00 53.89 O
-ATOM 1240 OE2 GLU B 22 29.808 -4.745 12.821 1.00 65.14 O
-ATOM 1241 N VAL B 23 24.347 -6.274 12.578 1.00 19.15 N
-ATOM 1242 CA VAL B 23 23.303 -6.039 11.518 1.00 16.52 C
-ATOM 1243 C VAL B 23 21.857 -5.985 12.342 1.00 19.25 C
-ATOM 1244 O VAL B 23 20.964 -5.128 11.822 1.00 16.10 O
-ATOM 1245 CB VAL B 23 23.294 -7.123 10.403 1.00 21.83 C
-ATOM 1246 CG1 VAL B 23 22.065 -7.019 9.672 1.00 26.98 C
-ATOM 1247 CG2 VAL B 23 24.689 -6.722 9.825 1.00 24.14 C
-ATOM 1248 N GLY B 24 21.684 -6.753 13.284 1.00 11.83 N
-ATOM 1249 CA GLY B 24 20.512 -6.666 14.003 1.00 15.96 C
-ATOM 1250 C GLY B 24 20.131 -5.391 14.689 1.00 15.32 C
-ATOM 1251 O GLY B 24 19.133 -4.694 14.628 1.00 13.59 O
-ATOM 1252 N GLY B 25 21.093 -4.853 15.395 1.00 19.52 N
-ATOM 1253 CA GLY B 25 21.202 -3.549 15.972 1.00 15.79 C
-ATOM 1254 C GLY B 25 20.921 -2.401 14.917 1.00 12.82 C
-ATOM 1255 O GLY B 25 20.200 -1.481 15.135 1.00 18.05 O
-ATOM 1256 N GLU B 26 21.598 -2.510 13.849 1.00 12.16 N
-ATOM 1257 CA GLU B 26 21.567 -1.493 12.736 1.00 11.32 C
-ATOM 1258 C GLU B 26 20.042 -1.534 12.176 1.00 13.79 C
-ATOM 1259 O GLU B 26 19.605 -0.362 11.944 1.00 14.59 O
-ATOM 1260 CB GLU B 26 22.564 -1.757 11.778 1.00 13.18 C
-ATOM 1261 CG GLU B 26 23.022 -0.301 10.974 1.00 29.90 C
-ATOM 1262 CD GLU B 26 23.535 0.894 10.508 1.00 51.34 C
-ATOM 1263 OE1 GLU B 26 23.767 -0.209 7.916 1.00 54.93 O
-ATOM 1264 OE2 GLU B 26 24.549 -1.302 10.298 1.00 37.93 O
-ATOM 1265 N ALA B 27 19.659 -2.698 11.904 1.00 13.14 N
-ATOM 1266 CA ALA B 27 18.339 -2.622 11.197 1.00 9.05 C
-ATOM 1267 C ALA B 27 17.188 -2.188 12.064 1.00 10.83 C
-ATOM 1268 O ALA B 27 16.247 -1.538 11.698 1.00 11.12 O
-ATOM 1269 CB ALA B 27 18.124 -4.039 10.850 1.00 14.07 C
-ATOM 1270 N LEU B 28 17.097 -2.654 13.364 1.00 11.19 N
-ATOM 1271 CA LEU B 28 16.289 -2.225 14.403 1.00 14.47 C
-ATOM 1272 C LEU B 28 16.216 -0.842 14.498 1.00 12.13 C
-ATOM 1273 O LEU B 28 15.292 -0.024 14.599 1.00 12.32 O
-ATOM 1274 CB LEU B 28 16.089 -3.101 15.599 1.00 9.21 C
-ATOM 1275 CG LEU B 28 14.602 -2.613 16.344 1.00 20.67 C
-ATOM 1276 CD1 LEU B 28 13.558 -3.287 15.723 1.00 17.60 C
-ATOM 1277 CD2 LEU B 28 15.036 -3.349 17.556 1.00 34.99 C
-ATOM 1278 N GLY B 29 17.488 -0.244 14.733 1.00 10.00 N
-ATOM 1279 CA GLY B 29 17.555 1.107 14.942 1.00 15.27 C
-ATOM 1280 C GLY B 29 17.147 1.979 13.686 1.00 10.88 C
-ATOM 1281 O GLY B 29 16.406 2.945 13.855 1.00 14.42 O
-ATOM 1282 N ARG B 30 17.503 1.503 12.514 1.00 11.39 N
-ATOM 1283 CA ARG B 30 17.138 2.392 11.410 1.00 14.49 C
-ATOM 1284 C ARG B 30 15.517 2.168 11.180 1.00 10.79 C
-ATOM 1285 O ARG B 30 14.997 3.218 10.749 1.00 13.81 O
-ATOM 1286 CB ARG B 30 17.883 1.854 10.134 1.00 19.88 C
-ATOM 1287 CG ARG B 30 19.264 2.550 9.848 1.00 16.11 C
-ATOM 1288 CD ARG B 30 19.816 1.919 8.615 1.00 14.71 C
-ATOM 1289 NE ARG B 30 21.229 2.190 8.567 1.00 21.05 N
-ATOM 1290 CZ ARG B 30 21.899 3.048 7.943 1.00 18.56 C
-ATOM 1291 NH1 ARG B 30 21.169 3.859 7.078 1.00 19.13 N
-ATOM 1292 NH2 ARG B 30 23.126 3.441 7.930 1.00 19.91 N
-ATOM 1293 N LEU B 31 14.954 1.034 11.546 1.00 12.04 N
-ATOM 1294 CA LEU B 31 13.557 0.954 11.581 1.00 10.54 C
-ATOM 1295 C LEU B 31 13.079 2.129 12.312 1.00 13.93 C
-ATOM 1296 O LEU B 31 12.053 2.837 11.993 1.00 14.67 O
-ATOM 1297 CB LEU B 31 12.999 -0.394 11.933 1.00 12.99 C
-ATOM 1298 CG LEU B 31 11.476 -0.524 12.150 1.00 10.97 C
-ATOM 1299 CD1 LEU B 31 11.036 -0.535 10.722 1.00 19.46 C
-ATOM 1300 CD2 LEU B 31 11.106 -1.700 13.040 1.00 13.98 C
-ATOM 1301 N LEU B 32 13.531 2.329 13.530 1.00 10.13 N
-ATOM 1302 CA LEU B 32 12.882 3.156 14.401 1.00 11.52 C
-ATOM 1303 C LEU B 32 13.149 4.616 14.057 1.00 12.11 C
-ATOM 1304 O LEU B 32 12.467 5.633 14.438 1.00 15.31 O
-ATOM 1305 CB LEU B 32 13.453 3.038 15.919 1.00 11.75 C
-ATOM 1306 CG LEU B 32 12.805 1.940 16.581 1.00 16.68 C
-ATOM 1307 CD1 LEU B 32 12.104 0.941 16.260 1.00 22.26 C
-ATOM 1308 CD2 LEU B 32 13.566 1.603 17.835 1.00 28.90 C
-ATOM 1309 N VAL B 33 14.250 4.899 13.351 1.00 10.32 N
-ATOM 1310 CA VAL B 33 14.628 6.174 12.868 1.00 11.98 C
-ATOM 1311 C VAL B 33 13.704 6.548 11.535 1.00 12.10 C
-ATOM 1312 O VAL B 33 13.345 7.771 11.481 1.00 13.28 O
-ATOM 1313 CB VAL B 33 16.139 6.304 12.522 1.00 14.87 C
-ATOM 1314 CG1 VAL B 33 16.518 7.591 11.880 1.00 11.54 C
-ATOM 1315 CG2 VAL B 33 16.745 6.275 13.788 1.00 16.57 C
-ATOM 1316 N VAL B 34 13.820 5.650 10.638 1.00 13.66 N
-ATOM 1317 CA VAL B 34 13.156 6.096 9.258 1.00 9.59 C
-ATOM 1318 C VAL B 34 11.591 6.042 9.368 1.00 8.72 C
-ATOM 1319 O VAL B 34 11.052 6.910 8.763 1.00 9.42 O
-ATOM 1320 CB VAL B 34 13.681 5.042 8.326 1.00 9.09 C
-ATOM 1321 CG1 VAL B 34 13.079 5.328 6.958 1.00 9.82 C
-ATOM 1322 CG2 VAL B 34 15.076 5.133 8.253 1.00 17.00 C
-ATOM 1323 N TYR B 35 11.088 5.155 10.260 1.00 10.80 N
-ATOM 1324 CA TYR B 35 9.613 5.019 10.405 1.00 13.73 C
-ATOM 1325 C TYR B 35 9.249 5.241 11.959 1.00 14.87 C
-ATOM 1326 O TYR B 35 9.056 4.156 12.514 1.00 16.30 O
-ATOM 1327 CB TYR B 35 9.162 3.628 9.962 1.00 14.97 C
-ATOM 1328 CG TYR B 35 9.590 3.397 8.554 1.00 16.57 C
-ATOM 1329 CD1 TYR B 35 9.059 4.138 7.400 1.00 17.11 C
-ATOM 1330 CD2 TYR B 35 10.495 2.446 8.096 1.00 21.02 C
-ATOM 1331 CE1 TYR B 35 9.473 3.862 6.085 1.00 16.53 C
-ATOM 1332 CE2 TYR B 35 10.987 2.455 6.905 1.00 21.07 C
-ATOM 1333 CZ TYR B 35 10.434 2.948 5.860 1.00 16.91 C
-ATOM 1334 OH TYR B 35 11.073 2.851 4.537 1.00 21.07 O
-ATOM 1335 N PRO B 36 9.337 6.384 12.381 1.00 18.32 N
-ATOM 1336 CA PRO B 36 9.299 6.665 13.797 1.00 15.72 C
-ATOM 1337 C PRO B 36 8.010 6.232 14.403 1.00 27.07 C
-ATOM 1338 O PRO B 36 8.028 5.977 15.694 1.00 15.67 O
-ATOM 1339 CB PRO B 36 9.448 8.143 14.056 1.00 16.26 C
-ATOM 1340 CG PRO B 36 9.504 8.813 12.839 1.00 21.27 C
-ATOM 1341 CD PRO B 36 9.498 7.681 11.841 1.00 25.93 C
-ATOM 1342 N TRP B 37 6.917 5.884 13.840 1.00 14.10 N
-ATOM 1343 CA TRP B 37 5.821 5.395 14.601 1.00 12.74 C
-ATOM 1344 C TRP B 37 5.965 3.976 15.036 1.00 15.06 C
-ATOM 1345 O TRP B 37 5.268 3.465 15.926 1.00 15.27 O
-ATOM 1346 CB TRP B 37 4.670 5.475 13.490 1.00 19.41 C
-ATOM 1347 CG TRP B 37 4.766 4.831 12.253 1.00 14.79 C
-ATOM 1348 CD1 TRP B 37 4.298 3.513 11.774 1.00 18.82 C
-ATOM 1349 CD2 TRP B 37 5.265 5.442 10.984 1.00 18.23 C
-ATOM 1350 NE1 TRP B 37 4.669 3.435 10.535 1.00 23.72 N
-ATOM 1351 CE2 TRP B 37 5.184 4.400 9.923 1.00 22.13 C
-ATOM 1352 CE3 TRP B 37 5.947 6.691 10.672 1.00 21.52 C
-ATOM 1353 CZ2 TRP B 37 5.584 4.556 8.589 1.00 18.19 C
-ATOM 1354 CZ3 TRP B 37 6.183 6.773 9.398 1.00 31.71 C
-ATOM 1355 CH2 TRP B 37 6.069 5.844 8.520 1.00 14.12 C
-ATOM 1356 N THR B 38 7.039 3.221 14.646 1.00 14.17 N
-ATOM 1357 CA THR B 38 7.466 1.912 14.979 1.00 13.46 C
-ATOM 1358 C THR B 38 7.760 1.960 16.519 1.00 16.65 C
-ATOM 1359 O THR B 38 8.073 0.918 17.118 1.00 18.86 O
-ATOM 1360 CB THR B 38 8.456 1.107 14.212 1.00 12.74 C
-ATOM 1361 OG1 THR B 38 9.507 1.962 14.105 1.00 14.09 O
-ATOM 1362 CG2 THR B 38 7.863 1.128 12.798 1.00 15.42 C
-ATOM 1363 N GLN B 39 8.203 3.108 16.922 1.00 19.91 N
-ATOM 1364 CA GLN B 39 8.656 3.567 18.379 1.00 23.22 C
-ATOM 1365 C GLN B 39 7.604 3.201 19.358 1.00 19.19 C
-ATOM 1366 O GLN B 39 7.968 2.987 20.495 1.00 19.29 O
-ATOM 1367 CB GLN B 39 9.277 4.878 18.529 1.00 24.35 C
-ATOM 1368 CG GLN B 39 10.405 5.137 17.759 1.00 25.27 C
-ATOM 1369 CD GLN B 39 10.983 6.633 17.918 1.00 24.35 C
-ATOM 1370 OE1 GLN B 39 10.480 7.189 18.922 1.00 26.75 O
-ATOM 1371 NE2 GLN B 39 11.852 7.006 16.956 1.00 30.18 N
-ATOM 1372 N ARG B 40 6.347 3.079 18.900 1.00 20.02 N
-ATOM 1373 CA ARG B 40 5.184 2.850 19.816 1.00 21.80 C
-ATOM 1374 C ARG B 40 5.511 1.455 20.630 1.00 29.36 C
-ATOM 1375 O ARG B 40 4.888 1.619 21.749 1.00 24.42 O
-ATOM 1376 CB ARG B 40 3.944 2.700 18.938 1.00 16.52 C
-ATOM 1377 CG ARG B 40 3.694 1.420 18.404 1.00 20.34 C
-ATOM 1378 CD ARG B 40 2.451 1.519 17.302 1.00 25.31 C
-ATOM 1379 NE ARG B 40 1.370 1.856 17.810 1.00 29.70 N
-ATOM 1380 CZ ARG B 40 0.400 1.022 18.648 1.00 34.46 C
-ATOM 1381 NH1 ARG B 40 0.678 -0.097 18.556 1.00 31.34 N
-ATOM 1382 NH2 ARG B 40 -0.783 2.010 18.877 1.00 39.12 N
-ATOM 1383 N PHE B 41 6.149 0.541 20.453 1.00 19.21 N
-ATOM 1384 CA PHE B 41 6.133 -0.730 21.151 1.00 16.53 C
-ATOM 1385 C PHE B 41 7.442 -0.621 22.343 1.00 21.34 C
-ATOM 1386 O PHE B 41 7.412 -1.538 22.897 1.00 23.45 O
-ATOM 1387 CB PHE B 41 6.675 -1.804 20.080 1.00 10.39 C
-ATOM 1388 CG PHE B 41 5.553 -1.984 19.152 1.00 13.84 C
-ATOM 1389 CD1 PHE B 41 5.763 -1.448 17.828 1.00 17.38 C
-ATOM 1390 CD2 PHE B 41 4.239 -2.655 19.578 1.00 25.55 C
-ATOM 1391 CE1 PHE B 41 4.713 -1.720 16.922 1.00 15.72 C
-ATOM 1392 CE2 PHE B 41 3.272 -2.680 18.459 1.00 21.40 C
-ATOM 1393 CZ PHE B 41 3.586 -2.146 17.207 1.00 13.46 C
-ATOM 1394 N PHE B 42 8.072 0.397 22.159 1.00 18.41 N
-ATOM 1395 CA PHE B 42 9.433 0.476 22.639 1.00 17.88 C
-ATOM 1396 C PHE B 42 9.683 1.552 23.631 1.00 26.28 C
-ATOM 1397 O PHE B 42 10.712 1.963 24.025 1.00 30.16 O
-ATOM 1398 CB PHE B 42 10.561 0.553 21.602 1.00 16.57 C
-ATOM 1399 CG PHE B 42 10.524 -0.621 20.906 1.00 18.87 C
-ATOM 1400 CD1 PHE B 42 10.208 -0.431 19.261 1.00 17.08 C
-ATOM 1401 CD2 PHE B 42 10.804 -1.937 21.065 1.00 17.75 C
-ATOM 1402 CE1 PHE B 42 10.137 -1.716 18.672 1.00 12.34 C
-ATOM 1403 CE2 PHE B 42 10.625 -2.998 20.314 1.00 16.32 C
-ATOM 1404 CZ PHE B 42 10.370 -2.870 18.826 1.00 14.29 C
-ATOM 1405 N GLU B 43 8.703 2.022 24.176 1.00 32.94 N
-ATOM 1406 CA GLU B 43 9.021 3.274 25.060 1.00 42.17 C
-ATOM 1407 C GLU B 43 9.315 2.924 26.617 1.00 21.09 C
-ATOM 1408 O GLU B 43 10.204 3.362 27.291 1.00 37.55 O
-ATOM 1409 CB GLU B 43 7.798 3.586 25.059 1.00 73.91 C
-ATOM 1410 CG GLU B 43 6.528 3.291 25.915 1.00 61.81 C
-ATOM 1411 CD GLU B 43 4.777 4.930 25.558 1.00 78.77 C
-ATOM 1412 OE1 GLU B 43 5.276 5.543 25.252 1.00 63.33 O
-ATOM 1413 OE2 GLU B 43 4.274 3.783 26.403 1.00 59.41 O
-ATOM 1414 N SER B 44 9.424 1.477 26.805 1.00 22.68 N
-ATOM 1415 CA SER B 44 10.261 0.951 28.039 1.00 28.45 C
-ATOM 1416 C SER B 44 11.527 1.680 27.935 1.00 36.10 C
-ATOM 1417 O SER B 44 12.578 0.776 28.511 1.00 25.24 O
-ATOM 1418 CB SER B 44 9.957 -0.409 28.119 1.00 27.61 C
-ATOM 1419 OG SER B 44 10.204 -1.503 27.766 1.00 37.26 O
-ATOM 1420 N PHE B 45 12.292 1.349 26.626 1.00 28.36 N
-ATOM 1421 CA PHE B 45 13.648 1.329 26.186 1.00 25.47 C
-ATOM 1422 C PHE B 45 14.197 2.590 26.508 1.00 26.28 C
-ATOM 1423 O PHE B 45 15.451 2.670 26.190 1.00 31.39 O
-ATOM 1424 CB PHE B 45 13.618 0.947 24.623 1.00 22.10 C
-ATOM 1425 CG PHE B 45 13.541 -0.652 24.249 1.00 18.85 C
-ATOM 1426 CD1 PHE B 45 13.939 -0.880 22.983 1.00 29.27 C
-ATOM 1427 CD2 PHE B 45 12.982 -1.450 24.626 1.00 31.57 C
-ATOM 1428 CE1 PHE B 45 13.682 -2.441 22.618 1.00 29.02 C
-ATOM 1429 CE2 PHE B 45 12.642 -2.810 24.625 1.00 30.34 C
-ATOM 1430 CZ PHE B 45 13.202 -2.999 23.312 1.00 36.33 C
-ATOM 1431 N GLY B 46 13.772 3.730 26.937 1.00 39.28 N
-ATOM 1432 CA GLY B 46 14.529 4.785 27.301 1.00 46.90 C
-ATOM 1433 C GLY B 46 14.720 5.977 26.137 1.00 45.06 C
-ATOM 1434 O GLY B 46 13.492 6.152 25.410 1.00 36.42 O
-ATOM 1435 N ASP B 47 15.717 6.365 26.037 1.00 38.00 N
-ATOM 1436 CA ASP B 47 15.729 7.801 25.184 1.00 38.15 C
-ATOM 1437 C ASP B 47 16.096 7.362 23.534 1.00 25.86 C
-ATOM 1438 O ASP B 47 16.860 6.380 23.281 1.00 25.46 O
-ATOM 1439 CB ASP B 47 17.237 8.136 25.516 1.00 44.07 C
-ATOM 1440 CG ASP B 47 17.345 9.494 25.209 1.00 52.06 C
-ATOM 1441 OD1 ASP B 47 18.506 10.069 24.917 1.00 44.54 O
-ATOM 1442 OD2 ASP B 47 16.192 10.248 24.076 1.00 35.33 O
-ATOM 1443 N LEU B 48 14.758 7.696 22.981 1.00 25.27 N
-ATOM 1444 CA LEU B 48 14.475 7.473 21.435 1.00 28.75 C
-ATOM 1445 C LEU B 48 14.468 8.903 20.740 1.00 27.19 C
-ATOM 1446 O LEU B 48 13.953 8.921 19.724 1.00 27.20 O
-ATOM 1447 CB LEU B 48 13.484 6.505 21.317 1.00 23.96 C
-ATOM 1448 CG LEU B 48 13.754 5.148 21.718 1.00 24.35 C
-ATOM 1449 CD1 LEU B 48 12.414 4.237 21.541 1.00 34.74 C
-ATOM 1450 CD2 LEU B 48 14.775 4.377 21.408 1.00 34.58 C
-ATOM 1451 N SER B 49 15.103 9.812 21.342 1.00 41.94 N
-ATOM 1452 CA SER B 49 14.421 11.168 20.634 1.00 46.28 C
-ATOM 1453 C SER B 49 15.582 11.613 20.219 1.00 38.86 C
-ATOM 1454 O SER B 49 14.817 12.605 18.942 1.00 41.94 O
-ATOM 1455 CB SER B 49 14.717 12.244 22.089 1.00 37.98 C
-ATOM 1456 OG SER B 49 16.403 12.088 22.302 1.00 37.71 O
-ATOM 1457 N THR B 50 16.507 11.264 19.343 1.00 28.29 N
-ATOM 1458 CA THR B 50 17.236 11.360 18.289 1.00 30.77 C
-ATOM 1459 C THR B 50 17.885 10.175 17.455 1.00 28.12 C
-ATOM 1460 O THR B 50 17.899 9.107 18.221 1.00 25.38 O
-ATOM 1461 CB THR B 50 18.076 12.160 18.824 1.00 33.39 C
-ATOM 1462 OG1 THR B 50 19.415 11.795 19.160 1.00 37.96 O
-ATOM 1463 CG2 THR B 50 18.083 13.812 19.397 1.00 29.64 C
-ATOM 1464 N PRO B 51 18.477 10.443 16.283 1.00 28.96 N
-ATOM 1465 CA PRO B 51 18.840 9.268 15.580 1.00 22.25 C
-ATOM 1466 C PRO B 51 20.003 8.659 16.259 1.00 19.80 C
-ATOM 1467 O PRO B 51 20.229 7.322 16.651 1.00 21.55 O
-ATOM 1468 CB PRO B 51 19.279 9.752 14.257 1.00 27.29 C
-ATOM 1469 CG PRO B 51 18.236 10.849 14.019 1.00 23.54 C
-ATOM 1470 CD PRO B 51 18.120 11.592 15.204 1.00 26.04 C
-ATOM 1471 N ASP B 52 20.955 9.490 16.887 1.00 21.99 N
-ATOM 1472 CA ASP B 52 22.107 9.063 17.596 1.00 20.50 C
-ATOM 1473 C ASP B 52 21.711 8.282 18.816 1.00 16.32 C
-ATOM 1474 O ASP B 52 22.264 7.261 19.307 1.00 25.55 O
-ATOM 1475 CB ASP B 52 22.971 10.246 17.966 1.00 32.17 C
-ATOM 1476 CG ASP B 52 24.234 10.367 16.728 1.00 47.24 C
-ATOM 1477 OD1 ASP B 52 24.140 9.731 15.886 1.00 41.78 O
-ATOM 1478 OD2 ASP B 52 24.041 11.689 16.359 1.00 62.08 O
-ATOM 1479 N ALA B 53 20.654 8.843 19.515 1.00 23.18 N
-ATOM 1480 CA ALA B 53 20.143 8.181 20.776 1.00 24.60 C
-ATOM 1481 C ALA B 53 19.728 6.737 20.669 1.00 20.91 C
-ATOM 1482 O ALA B 53 19.736 5.693 21.187 1.00 20.19 O
-ATOM 1483 CB ALA B 53 19.176 8.937 21.371 1.00 23.45 C
-ATOM 1484 N VAL B 54 18.925 6.610 19.428 1.00 19.02 N
-ATOM 1485 CA VAL B 54 18.396 5.367 18.970 1.00 17.30 C
-ATOM 1486 C VAL B 54 19.363 4.542 18.660 1.00 15.03 C
-ATOM 1487 O VAL B 54 19.429 3.266 19.120 1.00 19.06 O
-ATOM 1488 CB VAL B 54 17.268 5.613 17.733 1.00 27.63 C
-ATOM 1489 CG1 VAL B 54 17.019 4.214 17.213 1.00 22.46 C
-ATOM 1490 CG2 VAL B 54 16.224 6.564 17.992 1.00 27.27 C
-ATOM 1491 N MET B 55 20.370 4.888 17.834 1.00 21.73 N
-ATOM 1492 CA MET B 55 21.262 3.920 17.351 1.00 17.86 C
-ATOM 1493 C MET B 55 22.215 3.437 18.454 1.00 32.16 C
-ATOM 1494 O MET B 55 22.701 2.355 18.174 1.00 26.15 O
-ATOM 1495 CB MET B 55 22.167 4.509 16.152 1.00 19.12 C
-ATOM 1496 CG MET B 55 21.367 4.924 14.914 1.00 18.10 C
-ATOM 1497 SD MET B 55 20.328 3.573 14.221 1.00 21.28 S
-ATOM 1498 CE MET B 55 21.373 2.471 13.659 1.00 20.66 C
-ATOM 1499 N GLY B 56 22.406 4.339 19.361 1.00 24.42 N
-ATOM 1500 CA GLY B 56 23.329 3.841 20.456 1.00 36.79 C
-ATOM 1501 C GLY B 56 22.514 3.565 21.746 1.00 33.28 C
-ATOM 1502 O GLY B 56 23.093 2.903 22.699 1.00 24.94 O
-ATOM 1503 N ASN B 57 21.348 2.997 21.778 1.00 22.01 N
-ATOM 1504 CA ASN B 57 20.559 2.685 22.827 1.00 15.71 C
-ATOM 1505 C ASN B 57 20.755 1.267 22.976 1.00 17.88 C
-ATOM 1506 O ASN B 57 20.502 0.300 22.098 1.00 18.04 O
-ATOM 1507 CB ASN B 57 19.144 2.920 22.701 1.00 21.80 C
-ATOM 1508 CG ASN B 57 18.247 2.358 23.776 1.00 18.78 C
-ATOM 1509 OD1 ASN B 57 18.261 1.376 24.212 1.00 23.41 O
-ATOM 1510 ND2 ASN B 57 17.583 3.338 24.270 1.00 26.53 N
-ATOM 1511 N PRO B 58 21.174 0.662 24.086 1.00 24.81 N
-ATOM 1512 CA PRO B 58 21.379 -0.699 24.384 1.00 24.38 C
-ATOM 1513 C PRO B 58 20.320 -1.707 24.238 1.00 16.45 C
-ATOM 1514 O PRO B 58 20.621 -2.865 23.942 1.00 22.03 O
-ATOM 1515 CB PRO B 58 22.199 -0.585 25.810 1.00 41.00 C
-ATOM 1516 CG PRO B 58 21.985 0.546 26.007 1.00 36.46 C
-ATOM 1517 CD PRO B 58 21.572 1.751 25.438 1.00 41.75 C
-ATOM 1518 N LYS B 59 19.129 -1.092 24.601 1.00 16.03 N
-ATOM 1519 CA LYS B 59 17.877 -2.002 24.599 1.00 22.04 C
-ATOM 1520 C LYS B 59 17.389 -2.185 23.113 1.00 13.98 C
-ATOM 1521 O LYS B 59 17.132 -3.370 22.712 1.00 15.67 O
-ATOM 1522 CB LYS B 59 16.893 -1.439 25.346 1.00 22.22 C
-ATOM 1523 CG LYS B 59 17.003 -1.840 26.817 1.00 45.70 C
-ATOM 1524 CD LYS B 59 17.133 -0.988 27.329 1.00 44.05 C
-ATOM 1525 CE LYS B 59 17.311 -2.126 29.392 1.00 71.22 C
-ATOM 1526 NZ LYS B 59 16.304 -0.516 29.672 1.00 61.54 N
-ATOM 1527 N VAL B 60 17.762 -1.228 22.435 1.00 17.28 N
-ATOM 1528 CA VAL B 60 17.489 -1.267 20.987 1.00 18.21 C
-ATOM 1529 C VAL B 60 18.198 -2.383 20.467 1.00 17.60 C
-ATOM 1530 O VAL B 60 18.065 -3.331 19.597 1.00 19.11 O
-ATOM 1531 CB VAL B 60 17.415 0.000 20.196 1.00 19.15 C
-ATOM 1532 CG1 VAL B 60 17.700 -0.242 18.743 1.00 20.44 C
-ATOM 1533 CG2 VAL B 60 16.452 0.957 20.699 1.00 20.64 C
-ATOM 1534 N LYS B 61 19.612 -2.162 20.575 1.00 16.19 N
-ATOM 1535 CA LYS B 61 20.529 -3.146 20.062 1.00 15.00 C
-ATOM 1536 C LYS B 61 20.399 -4.610 20.622 1.00 17.90 C
-ATOM 1537 O LYS B 61 20.213 -5.649 19.890 1.00 20.52 O
-ATOM 1538 CB LYS B 61 21.934 -2.794 20.686 1.00 23.50 C
-ATOM 1539 CG LYS B 61 22.389 -1.790 20.123 1.00 34.21 C
-ATOM 1540 CD LYS B 61 23.914 -1.121 21.095 1.00 48.05 C
-ATOM 1541 CE LYS B 61 24.659 -0.514 19.697 1.00 65.12 C
-ATOM 1542 NZ LYS B 61 25.928 0.153 20.694 1.00 66.26 N
-ATOM 1543 N ALA B 62 19.935 -4.789 21.817 1.00 18.99 N
-ATOM 1544 CA ALA B 62 19.613 -6.179 22.281 1.00 20.11 C
-ATOM 1545 C ALA B 62 18.327 -6.740 21.532 1.00 23.44 C
-ATOM 1546 O ALA B 62 18.260 -7.852 21.400 1.00 21.26 O
-ATOM 1547 CB ALA B 62 19.287 -6.023 23.792 1.00 28.90 C
-ATOM 1548 N HIS B 63 17.361 -5.800 21.608 1.00 20.40 N
-ATOM 1549 CA HIS B 63 16.190 -6.291 20.805 1.00 18.39 C
-ATOM 1550 C HIS B 63 16.516 -6.639 19.256 1.00 14.88 C
-ATOM 1551 O HIS B 63 16.111 -7.828 18.863 1.00 18.29 O
-ATOM 1552 CB HIS B 63 15.116 -5.410 20.859 1.00 22.46 C
-ATOM 1553 CG HIS B 63 13.751 -5.776 20.554 1.00 25.19 C
-ATOM 1554 ND1 HIS B 63 13.281 -7.248 21.117 1.00 24.68 N
-ATOM 1555 CD2 HIS B 63 13.005 -5.716 19.310 1.00 20.46 C
-ATOM 1556 CE1 HIS B 63 11.969 -7.447 20.274 1.00 21.48 C
-ATOM 1557 NE2 HIS B 63 11.891 -6.627 19.400 1.00 20.00 N
-ATOM 1558 N GLY B 64 17.369 -5.912 18.807 1.00 15.81 N
-ATOM 1559 CA GLY B 64 17.753 -6.266 17.372 1.00 16.57 C
-ATOM 1560 C GLY B 64 18.356 -7.523 17.041 1.00 14.05 C
-ATOM 1561 O GLY B 64 18.321 -8.353 16.306 1.00 17.38 O
-ATOM 1562 N LYS B 65 19.222 -7.845 18.080 1.00 15.77 N
-ATOM 1563 CA LYS B 65 19.749 -9.096 18.187 1.00 17.79 C
-ATOM 1564 C LYS B 65 18.945 -10.321 18.319 1.00 18.32 C
-ATOM 1565 O LYS B 65 19.205 -11.332 17.796 1.00 19.33 O
-ATOM 1566 CB LYS B 65 21.117 -9.195 19.352 1.00 34.65 C
-ATOM 1567 CG LYS B 65 20.823 -9.337 19.828 1.00 64.04 C
-ATOM 1568 CD LYS B 65 22.866 -9.404 21.254 1.00 58.77 C
-ATOM 1569 CE LYS B 65 21.591 -11.376 21.213 1.00 64.47 C
-ATOM 1570 NZ LYS B 65 22.762 -11.190 23.512 1.00 67.19 N
-ATOM 1571 N LYS B 66 17.979 -10.126 19.094 1.00 17.45 N
-ATOM 1572 CA LYS B 66 17.297 -11.071 19.293 1.00 20.10 C
-ATOM 1573 C LYS B 66 16.171 -11.403 18.033 1.00 21.06 C
-ATOM 1574 O LYS B 66 15.915 -12.596 17.725 1.00 17.84 O
-ATOM 1575 CB LYS B 66 16.183 -10.827 20.504 1.00 22.19 C
-ATOM 1576 CG LYS B 66 15.115 -11.668 20.860 1.00 40.97 C
-ATOM 1577 CD LYS B 66 14.348 -11.289 22.165 1.00 49.22 C
-ATOM 1578 CE LYS B 66 14.883 -13.426 23.031 1.00 72.58 C
-ATOM 1579 NZ LYS B 66 13.505 -13.329 24.195 1.00 70.66 N
-ATOM 1580 N VAL B 67 15.722 -10.213 17.591 1.00 16.93 N
-ATOM 1581 CA VAL B 67 14.967 -10.430 16.204 1.00 19.22 C
-ATOM 1582 C VAL B 67 15.793 -10.926 15.110 1.00 11.08 C
-ATOM 1583 O VAL B 67 15.419 -12.032 14.481 1.00 14.57 O
-ATOM 1584 CB VAL B 67 14.239 -9.056 15.913 1.00 21.56 C
-ATOM 1585 CG1 VAL B 67 13.929 -8.835 14.427 1.00 18.58 C
-ATOM 1586 CG2 VAL B 67 13.400 -8.550 17.010 1.00 21.34 C
-ATOM 1587 N LEU B 68 16.954 -10.461 14.916 1.00 11.62 N
-ATOM 1588 CA LEU B 68 17.765 -11.045 13.835 1.00 15.23 C
-ATOM 1589 C LEU B 68 18.198 -12.546 14.030 1.00 13.22 C
-ATOM 1590 O LEU B 68 18.576 -13.320 13.014 1.00 14.49 O
-ATOM 1591 CB LEU B 68 18.788 -10.157 13.424 1.00 22.80 C
-ATOM 1592 CG LEU B 68 18.947 -9.620 11.990 1.00 26.57 C
-ATOM 1593 CD1 LEU B 68 20.192 -10.323 11.868 1.00 62.38 C
-ATOM 1594 CD2 LEU B 68 17.922 -9.301 11.306 1.00 35.30 C
-ATOM 1595 N GLY B 69 18.512 -12.954 15.230 1.00 14.77 N
-ATOM 1596 CA GLY B 69 18.843 -14.169 15.499 1.00 20.29 C
-ATOM 1597 C GLY B 69 17.847 -15.440 15.178 1.00 17.59 C
-ATOM 1598 O GLY B 69 17.982 -16.324 14.534 1.00 19.02 O
-ATOM 1599 N ALA B 70 16.471 -14.870 15.541 1.00 19.76 N
-ATOM 1600 CA ALA B 70 15.432 -15.582 15.055 1.00 20.35 C
-ATOM 1601 C ALA B 70 15.296 -15.691 13.506 1.00 16.36 C
-ATOM 1602 O ALA B 70 14.996 -16.706 12.805 1.00 18.12 O
-ATOM 1603 CB ALA B 70 14.137 -15.174 15.556 1.00 18.92 C
-ATOM 1604 N PHE B 71 15.441 -14.520 12.868 1.00 14.47 N
-ATOM 1605 CA PHE B 71 15.473 -14.523 11.393 1.00 18.37 C
-ATOM 1606 C PHE B 71 16.681 -15.484 10.885 1.00 23.80 C
-ATOM 1607 O PHE B 71 16.324 -16.238 10.064 1.00 20.23 O
-ATOM 1608 CB PHE B 71 15.760 -13.050 11.104 1.00 13.73 C
-ATOM 1609 CG PHE B 71 15.796 -12.885 9.606 1.00 18.08 C
-ATOM 1610 CD1 PHE B 71 14.729 -12.558 8.930 1.00 25.10 C
-ATOM 1611 CD2 PHE B 71 17.072 -12.967 8.830 1.00 17.17 C
-ATOM 1612 CE1 PHE B 71 14.623 -12.282 7.460 1.00 19.10 C
-ATOM 1613 CE2 PHE B 71 16.901 -12.741 7.550 1.00 22.20 C
-ATOM 1614 CZ PHE B 71 15.701 -12.364 6.812 1.00 12.94 C
-ATOM 1615 N SER B 72 17.595 -15.502 11.393 1.00 20.10 N
-ATOM 1616 CA SER B 72 18.969 -16.288 11.125 1.00 20.52 C
-ATOM 1617 C SER B 72 18.446 -17.702 11.027 1.00 24.58 C
-ATOM 1618 O SER B 72 18.709 -18.593 10.064 1.00 22.06 O
-ATOM 1619 CB SER B 72 20.232 -15.732 11.864 1.00 15.28 C
-ATOM 1620 OG SER B 72 21.400 -16.267 11.544 1.00 25.10 O
-ATOM 1621 N ASP B 73 17.933 -17.999 12.102 1.00 27.59 N
-ATOM 1622 CA ASP B 73 17.456 -19.508 12.282 1.00 37.45 C
-ATOM 1623 C ASP B 73 16.631 -19.746 11.447 1.00 25.08 C
-ATOM 1624 O ASP B 73 16.306 -20.962 10.848 1.00 31.64 O
-ATOM 1625 CB ASP B 73 17.022 -19.613 13.914 1.00 36.32 C
-ATOM 1626 CG ASP B 73 18.407 -19.595 14.926 1.00 45.09 C
-ATOM 1627 OD1 ASP B 73 19.800 -19.407 14.506 1.00 37.33 O
-ATOM 1628 OD2 ASP B 73 18.096 -19.496 15.880 1.00 52.94 O
-ATOM 1629 N GLY B 74 15.535 -19.019 10.954 1.00 21.04 N
-ATOM 1630 CA GLY B 74 14.735 -19.149 9.973 1.00 15.14 C
-ATOM 1631 C GLY B 74 14.988 -19.490 8.722 1.00 22.81 C
-ATOM 1632 O GLY B 74 14.637 -20.071 7.621 1.00 25.94 O
-ATOM 1633 N LEU B 75 16.509 -18.919 8.215 1.00 20.94 N
-ATOM 1634 CA LEU B 75 17.037 -19.090 6.965 1.00 15.84 C
-ATOM 1635 C LEU B 75 17.465 -20.570 6.842 1.00 26.11 C
-ATOM 1636 O LEU B 75 17.646 -20.979 5.741 1.00 28.14 O
-ATOM 1637 CB LEU B 75 18.377 -18.389 6.691 1.00 21.09 C
-ATOM 1638 CG LEU B 75 18.160 -17.146 6.885 1.00 27.76 C
-ATOM 1639 CD1 LEU B 75 19.415 -16.065 6.621 1.00 33.03 C
-ATOM 1640 CD2 LEU B 75 17.192 -16.405 5.891 1.00 30.01 C
-ATOM 1641 N ALA B 76 17.528 -21.312 7.923 1.00 21.21 N
-ATOM 1642 CA ALA B 76 17.717 -22.609 7.710 1.00 22.79 C
-ATOM 1643 C ALA B 76 16.647 -23.681 7.464 1.00 40.88 C
-ATOM 1644 O ALA B 76 16.656 -24.527 7.123 1.00 38.44 O
-ATOM 1645 CB ALA B 76 18.164 -23.328 9.061 1.00 29.05 C
-ATOM 1646 N HIS B 77 15.219 -22.886 7.385 1.00 23.87 N
-ATOM 1647 CA HIS B 77 13.929 -23.700 7.284 1.00 21.57 C
-ATOM 1648 C HIS B 77 13.284 -22.870 6.150 1.00 18.37 C
-ATOM 1649 O HIS B 77 12.059 -22.798 6.220 1.00 23.13 O
-ATOM 1650 CB HIS B 77 13.250 -23.395 8.460 1.00 29.02 C
-ATOM 1651 CG HIS B 77 14.079 -24.146 9.683 1.00 36.16 C
-ATOM 1652 ND1 HIS B 77 14.936 -23.842 10.757 1.00 45.10 N
-ATOM 1653 CD2 HIS B 77 14.095 -25.953 9.360 1.00 41.12 C
-ATOM 1654 CE1 HIS B 77 15.178 -24.891 11.130 1.00 37.52 C
-ATOM 1655 NE2 HIS B 77 14.852 -25.983 10.561 1.00 42.04 N
-ATOM 1656 N LEU B 78 13.874 -22.553 5.099 1.00 22.31 N
-ATOM 1657 CA LEU B 78 13.302 -21.614 4.148 1.00 20.28 C
-ATOM 1658 C LEU B 78 12.283 -22.522 3.216 1.00 31.20 C
-ATOM 1659 O LEU B 78 11.288 -21.899 3.087 1.00 34.80 O
-ATOM 1660 CB LEU B 78 14.257 -21.383 2.881 1.00 19.92 C
-ATOM 1661 CG LEU B 78 14.986 -19.978 3.420 1.00 39.49 C
-ATOM 1662 CD1 LEU B 78 16.407 -19.926 2.680 1.00 34.16 C
-ATOM 1663 CD2 LEU B 78 14.406 -18.731 3.892 1.00 31.09 C
-ATOM 1664 N ASP B 79 12.097 -23.916 3.393 1.00 31.59 N
-ATOM 1665 CA ASP B 79 11.104 -24.882 2.602 1.00 37.85 C
-ATOM 1666 C ASP B 79 9.843 -24.653 3.569 1.00 38.72 C
-ATOM 1667 O ASP B 79 9.096 -25.342 3.631 1.00 37.62 O
-ATOM 1668 CB ASP B 79 11.737 -26.234 3.104 1.00 48.10 C
-ATOM 1669 CG ASP B 79 12.662 -26.319 2.384 1.00 61.60 C
-ATOM 1670 OD1 ASP B 79 13.286 -27.317 2.464 1.00 57.05 O
-ATOM 1671 OD2 ASP B 79 12.655 -25.818 0.790 1.00 50.26 O
-ATOM 1672 N ASN B 80 10.028 -24.212 4.945 1.00 35.73 N
-ATOM 1673 CA ASN B 80 8.836 -24.555 6.146 1.00 42.30 C
-ATOM 1674 C ASN B 80 9.062 -22.961 6.944 1.00 30.43 C
-ATOM 1675 O ASN B 80 8.998 -23.185 7.997 1.00 27.17 O
-ATOM 1676 CB ASN B 80 9.098 -25.723 6.800 1.00 45.64 C
-ATOM 1677 CG ASN B 80 7.793 -26.259 7.837 1.00 49.79 C
-ATOM 1678 OD1 ASN B 80 6.751 -25.228 7.493 1.00 49.18 O
-ATOM 1679 ND2 ASN B 80 8.556 -26.466 8.946 1.00 48.18 N
-ATOM 1680 N LEU B 81 8.851 -21.845 6.271 1.00 31.23 N
-ATOM 1681 CA LEU B 81 8.683 -20.637 7.429 1.00 24.59 C
-ATOM 1682 C LEU B 81 7.679 -20.724 8.281 1.00 25.32 C
-ATOM 1683 O LEU B 81 7.523 -20.208 9.309 1.00 23.54 O
-ATOM 1684 CB LEU B 81 8.987 -19.631 6.449 1.00 29.09 C
-ATOM 1685 CG LEU B 81 10.160 -19.226 5.665 1.00 21.46 C
-ATOM 1686 CD1 LEU B 81 10.084 -18.185 4.643 1.00 28.62 C
-ATOM 1687 CD2 LEU B 81 11.341 -18.875 6.546 1.00 30.82 C
-ATOM 1688 N LYS B 82 6.283 -21.136 7.490 1.00 26.15 N
-ATOM 1689 CA LYS B 82 5.156 -20.862 8.452 1.00 24.25 C
-ATOM 1690 C LYS B 82 5.202 -21.643 9.461 1.00 23.08 C
-ATOM 1691 O LYS B 82 4.869 -21.389 10.597 1.00 24.88 O
-ATOM 1692 CB LYS B 82 4.142 -21.433 7.392 1.00 40.41 C
-ATOM 1693 CG LYS B 82 3.479 -20.229 6.738 1.00 39.73 C
-ATOM 1694 CD LYS B 82 2.160 -20.747 5.755 1.00 66.91 C
-ATOM 1695 CE LYS B 82 1.685 -20.767 6.266 1.00 59.33 C
-ATOM 1696 NZ LYS B 82 -0.023 -22.087 5.346 1.00 80.12 N
-ATOM 1697 N GLY B 83 5.725 -22.942 9.358 1.00 26.18 N
-ATOM 1698 CA GLY B 83 5.798 -23.724 10.746 1.00 41.64 C
-ATOM 1699 C GLY B 83 6.819 -23.249 11.591 1.00 31.59 C
-ATOM 1700 O GLY B 83 6.621 -23.464 12.858 1.00 36.40 O
-ATOM 1701 N THR B 84 7.985 -22.864 11.019 1.00 26.72 N
-ATOM 1702 CA THR B 84 9.150 -22.242 11.744 1.00 25.47 C
-ATOM 1703 C THR B 84 8.609 -21.278 12.796 1.00 33.72 C
-ATOM 1704 O THR B 84 8.964 -20.907 13.790 1.00 27.43 O
-ATOM 1705 CB THR B 84 10.394 -21.742 11.042 1.00 25.58 C
-ATOM 1706 OG1 THR B 84 10.806 -23.108 10.337 1.00 39.04 O
-ATOM 1707 CG2 THR B 84 11.362 -21.482 11.789 1.00 30.76 C
-ATOM 1708 N PHE B 85 7.740 -20.301 12.125 1.00 23.61 N
-ATOM 1709 CA PHE B 85 7.236 -18.963 12.749 1.00 21.59 C
-ATOM 1710 C PHE B 85 5.980 -19.056 13.414 1.00 28.51 C
-ATOM 1711 O PHE B 85 5.496 -18.006 13.809 1.00 18.85 O
-ATOM 1712 CB PHE B 85 7.575 -17.733 11.855 1.00 18.34 C
-ATOM 1713 CG PHE B 85 8.914 -17.486 11.587 1.00 13.87 C
-ATOM 1714 CD1 PHE B 85 9.583 -17.701 10.358 1.00 16.61 C
-ATOM 1715 CD2 PHE B 85 9.616 -17.039 12.693 1.00 18.32 C
-ATOM 1716 CE1 PHE B 85 11.009 -17.444 10.305 1.00 27.99 C
-ATOM 1717 CE2 PHE B 85 11.013 -16.752 12.253 1.00 21.68 C
-ATOM 1718 CZ PHE B 85 11.837 -16.973 11.161 1.00 21.59 C
-ATOM 1719 N ALA B 86 5.328 -20.141 13.373 1.00 22.16 N
-ATOM 1720 CA ALA B 86 3.899 -20.242 13.948 1.00 23.14 C
-ATOM 1721 C ALA B 86 3.715 -19.788 15.246 1.00 20.99 C
-ATOM 1722 O ALA B 86 2.881 -18.975 15.595 1.00 20.07 O
-ATOM 1723 CB ALA B 86 3.272 -21.660 13.783 1.00 23.69 C
-ATOM 1724 N THR B 87 4.501 -20.280 16.157 1.00 14.82 N
-ATOM 1725 CA THR B 87 4.271 -19.764 17.443 1.00 18.61 C
-ATOM 1726 C THR B 87 4.737 -18.271 17.729 1.00 25.42 C
-ATOM 1727 O THR B 87 4.013 -17.569 18.383 1.00 23.63 O
-ATOM 1728 CB THR B 87 5.631 -20.439 18.664 1.00 36.27 C
-ATOM 1729 OG1 THR B 87 5.010 -21.597 18.659 1.00 56.82 O
-ATOM 1730 CG2 THR B 87 4.455 -20.311 20.305 1.00 60.80 C
-ATOM 1731 N LEU B 88 5.836 -17.770 16.978 1.00 19.44 N
-ATOM 1732 CA LEU B 88 5.984 -16.362 17.087 1.00 17.97 C
-ATOM 1733 C LEU B 88 4.882 -15.510 16.526 1.00 11.34 C
-ATOM 1734 O LEU B 88 4.682 -14.416 16.964 1.00 17.71 O
-ATOM 1735 CB LEU B 88 7.361 -16.058 16.476 1.00 20.20 C
-ATOM 1736 CG LEU B 88 8.654 -16.553 17.229 1.00 27.17 C
-ATOM 1737 CD1 LEU B 88 9.614 -15.962 16.454 1.00 32.32 C
-ATOM 1738 CD2 LEU B 88 8.631 -15.491 18.343 1.00 27.72 C
-ATOM 1739 N SER B 89 4.254 -16.087 15.451 1.00 12.58 N
-ATOM 1740 CA SER B 89 3.084 -15.313 14.877 1.00 15.21 C
-ATOM 1741 C SER B 89 1.999 -14.995 15.898 1.00 14.13 C
-ATOM 1742 O SER B 89 1.472 -13.894 16.189 1.00 14.29 O
-ATOM 1743 CB SER B 89 2.771 -16.248 13.670 1.00 18.34 C
-ATOM 1744 OG SER B 89 1.531 -15.441 13.107 1.00 17.85 O
-ATOM 1745 N GLU B 90 1.628 -16.201 16.484 1.00 14.25 N
-ATOM 1746 CA GLU B 90 0.931 -16.070 17.617 1.00 20.50 C
-ATOM 1747 C GLU B 90 0.876 -15.142 18.820 1.00 13.47 C
-ATOM 1748 O GLU B 90 0.179 -14.243 19.122 1.00 16.05 O
-ATOM 1749 CB GLU B 90 0.387 -17.706 18.270 1.00 21.76 C
-ATOM 1750 CG GLU B 90 0.049 -18.266 17.145 1.00 48.13 C
-ATOM 1751 CD GLU B 90 -0.726 -20.095 17.710 1.00 78.64 C
-ATOM 1752 OE1 GLU B 90 -1.132 -19.837 18.495 1.00 55.55 O
-ATOM 1753 OE2 GLU B 90 0.235 -20.950 17.492 1.00 74.37 O
-ATOM 1754 N LEU B 91 2.312 -15.215 19.185 1.00 13.36 N
-ATOM 1755 CA LEU B 91 2.718 -14.253 20.128 1.00 14.20 C
-ATOM 1756 C LEU B 91 2.527 -12.831 19.767 1.00 8.80 C
-ATOM 1757 O LEU B 91 2.160 -11.906 20.481 1.00 10.74 O
-ATOM 1758 CB LEU B 91 4.110 -14.807 20.432 1.00 12.00 C
-ATOM 1759 CG LEU B 91 4.669 -13.801 21.348 1.00 18.50 C
-ATOM 1760 CD1 LEU B 91 4.127 -14.212 22.834 1.00 20.79 C
-ATOM 1761 CD2 LEU B 91 5.943 -13.652 21.455 1.00 37.40 C
-ATOM 1762 N HIS B 92 3.059 -12.662 18.493 1.00 10.78 N
-ATOM 1763 CA HIS B 92 3.032 -11.268 18.253 1.00 11.85 C
-ATOM 1764 C HIS B 92 1.536 -10.600 17.895 1.00 11.06 C
-ATOM 1765 O HIS B 92 1.291 -9.431 18.158 1.00 13.45 O
-ATOM 1766 CB HIS B 92 3.754 -11.078 16.807 1.00 9.95 C
-ATOM 1767 CG HIS B 92 5.289 -10.900 17.051 1.00 15.50 C
-ATOM 1768 ND1 HIS B 92 6.099 -12.172 17.134 1.00 15.27 N
-ATOM 1769 CD2 HIS B 92 6.215 -9.905 16.994 1.00 23.76 C
-ATOM 1770 CE1 HIS B 92 7.432 -11.572 17.375 1.00 16.99 C
-ATOM 1771 NE2 HIS B 92 7.367 -10.337 17.129 1.00 14.76 N
-ATOM 1772 N CYS B 93 0.636 -11.512 17.534 1.00 14.83 N
-ATOM 1773 CA CYS B 93 -0.706 -11.057 17.499 1.00 12.23 C
-ATOM 1774 C CYS B 93 -1.360 -10.953 18.986 1.00 10.49 C
-ATOM 1775 O CYS B 93 -1.843 -9.987 19.222 1.00 18.01 O
-ATOM 1776 CB CYS B 93 -1.330 -12.054 16.605 1.00 15.43 C
-ATOM 1777 SG CYS B 93 -3.259 -11.741 16.494 1.00 18.37 S
-ATOM 1778 N ASP B 94 -1.338 -12.094 19.598 1.00 13.11 N
-ATOM 1779 CA ASP B 94 -2.308 -12.076 20.721 1.00 15.32 C
-ATOM 1780 C ASP B 94 -1.586 -11.449 21.803 1.00 25.71 C
-ATOM 1781 O ASP B 94 -2.319 -10.827 22.800 1.00 21.65 O
-ATOM 1782 CB ASP B 94 -2.522 -13.477 21.183 1.00 21.65 C
-ATOM 1783 CG ASP B 94 -3.443 -14.553 20.246 1.00 42.42 C
-ATOM 1784 OD1 ASP B 94 -3.967 -13.792 19.626 1.00 30.02 O
-ATOM 1785 OD2 ASP B 94 -3.094 -15.441 20.443 1.00 43.30 O
-ATOM 1786 N LYS B 95 -0.348 -11.361 22.144 1.00 18.55 N
-ATOM 1787 CA LYS B 95 0.080 -10.591 23.184 1.00 19.10 C
-ATOM 1788 C LYS B 95 0.803 -9.499 23.130 1.00 19.57 C
-ATOM 1789 O LYS B 95 0.736 -8.565 23.699 1.00 21.87 O
-ATOM 1790 CB LYS B 95 1.151 -11.737 23.890 1.00 25.95 C
-ATOM 1791 CG LYS B 95 0.477 -13.054 24.377 1.00 24.86 C
-ATOM 1792 CD LYS B 95 -0.659 -12.473 25.407 1.00 36.14 C
-ATOM 1793 CE LYS B 95 -1.063 -13.745 26.122 1.00 47.76 C
-ATOM 1794 NZ LYS B 95 -2.126 -13.501 26.952 1.00 55.91 N
-ATOM 1795 N LEU B 96 1.669 -9.358 21.897 1.00 12.40 N
-ATOM 1796 CA LEU B 96 2.264 -8.159 21.581 1.00 11.86 C
-ATOM 1797 C LEU B 96 1.626 -7.005 20.824 1.00 15.10 C
-ATOM 1798 O LEU B 96 2.002 -5.926 20.849 1.00 17.50 O
-ATOM 1799 CB LEU B 96 3.645 -8.491 21.134 1.00 14.08 C
-ATOM 1800 CG LEU B 96 4.528 -9.722 21.739 1.00 12.34 C
-ATOM 1801 CD1 LEU B 96 5.778 -9.939 20.848 1.00 13.78 C
-ATOM 1802 CD2 LEU B 96 4.863 -8.876 23.113 1.00 22.81 C
-ATOM 1803 N HIS B 97 0.616 -7.508 20.069 1.00 15.44 N
-ATOM 1804 CA HIS B 97 -0.223 -6.510 19.374 1.00 18.15 C
-ATOM 1805 C HIS B 97 0.581 -5.736 18.319 1.00 12.24 C
-ATOM 1806 O HIS B 97 0.337 -4.532 18.056 1.00 15.82 O
-ATOM 1807 CB HIS B 97 -1.053 -5.508 20.203 1.00 17.74 C
-ATOM 1808 CG HIS B 97 -1.716 -6.273 21.483 1.00 16.77 C
-ATOM 1809 ND1 HIS B 97 -2.602 -7.310 21.250 1.00 19.56 N
-ATOM 1810 CD2 HIS B 97 -1.189 -6.197 22.703 1.00 23.33 C
-ATOM 1811 CE1 HIS B 97 -2.759 -7.812 22.476 1.00 19.82 C
-ATOM 1812 NE2 HIS B 97 -2.056 -7.104 23.341 1.00 20.39 N
-ATOM 1813 N VAL B 98 1.359 -6.524 17.506 1.00 13.81 N
-ATOM 1814 CA VAL B 98 2.284 -5.763 16.567 1.00 9.22 C
-ATOM 1815 C VAL B 98 1.443 -5.905 15.109 1.00 9.86 C
-ATOM 1816 O VAL B 98 1.420 -7.012 14.615 1.00 12.90 O
-ATOM 1817 CB VAL B 98 3.592 -6.460 16.393 1.00 9.87 C
-ATOM 1818 CG1 VAL B 98 4.438 -5.824 15.405 1.00 14.91 C
-ATOM 1819 CG2 VAL B 98 4.444 -6.258 17.798 1.00 11.36 C
-ATOM 1820 N ASP B 99 1.147 -4.763 14.513 1.00 11.46 N
-ATOM 1821 CA ASP B 99 0.360 -4.723 13.272 1.00 9.02 C
-ATOM 1822 C ASP B 99 1.555 -5.328 12.375 1.00 15.41 C
-ATOM 1823 O ASP B 99 2.744 -4.931 12.235 1.00 10.63 O
-ATOM 1824 CB ASP B 99 0.336 -3.327 12.907 1.00 9.79 C
-ATOM 1825 CG ASP B 99 -0.231 -3.002 11.431 1.00 10.69 C
-ATOM 1826 OD1 ASP B 99 -0.535 -1.748 11.309 1.00 15.04 O
-ATOM 1827 OD2 ASP B 99 -0.299 -4.052 10.734 1.00 11.07 O
-ATOM 1828 N PRO B 100 1.274 -6.350 11.556 1.00 10.46 N
-ATOM 1829 CA PRO B 100 2.264 -7.099 10.669 1.00 11.87 C
-ATOM 1830 C PRO B 100 2.744 -6.170 9.522 1.00 13.04 C
-ATOM 1831 O PRO B 100 3.883 -6.627 8.995 1.00 13.79 O
-ATOM 1832 CB PRO B 100 1.545 -8.233 10.081 1.00 17.03 C
-ATOM 1833 CG PRO B 100 0.234 -8.243 10.793 1.00 17.33 C
-ATOM 1834 CD PRO B 100 -0.030 -7.028 11.592 1.00 9.97 C
-ATOM 1835 N GLU B 101 2.300 -4.973 9.393 1.00 9.66 N
-ATOM 1836 CA GLU B 101 2.927 -3.983 8.469 1.00 11.29 C
-ATOM 1837 C GLU B 101 4.322 -3.633 8.825 1.00 17.59 C
-ATOM 1838 O GLU B 101 5.293 -3.640 8.196 1.00 16.98 O
-ATOM 1839 CB GLU B 101 2.178 -2.819 8.156 1.00 18.71 C
-ATOM 1840 CG GLU B 101 2.755 -1.760 7.270 1.00 30.25 C
-ATOM 1841 CD GLU B 101 2.569 -2.612 5.445 1.00 26.27 C
-ATOM 1842 OE1 GLU B 101 1.725 -3.411 5.564 1.00 25.29 O
-ATOM 1843 OE2 GLU B 101 3.441 -1.765 5.293 1.00 34.30 O
-ATOM 1844 N ASN B 102 4.601 -3.752 10.314 1.00 12.60 N
-ATOM 1845 CA ASN B 102 5.969 -3.548 10.721 1.00 9.48 C
-ATOM 1846 C ASN B 102 6.861 -4.572 10.309 1.00 8.44 C
-ATOM 1847 O ASN B 102 8.118 -4.224 10.106 1.00 13.92 O
-ATOM 1848 CB ASN B 102 5.901 -3.665 12.265 1.00 18.27 C
-ATOM 1849 CG ASN B 102 5.284 -2.285 12.825 1.00 26.18 C
-ATOM 1850 OD1 ASN B 102 5.641 -1.422 12.815 1.00 20.87 O
-ATOM 1851 ND2 ASN B 102 4.003 -2.618 13.502 1.00 25.76 N
-ATOM 1852 N PHE B 103 6.584 -5.846 10.057 1.00 11.66 N
-ATOM 1853 CA PHE B 103 7.332 -6.920 9.605 1.00 11.79 C
-ATOM 1854 C PHE B 103 7.931 -6.435 8.177 1.00 19.35 C
-ATOM 1855 O PHE B 103 8.997 -6.751 7.762 1.00 16.06 O
-ATOM 1856 CB PHE B 103 6.816 -8.253 9.574 1.00 12.75 C
-ATOM 1857 CG PHE B 103 6.173 -8.727 10.951 1.00 17.48 C
-ATOM 1858 CD1 PHE B 103 6.884 -8.372 12.079 1.00 13.65 C
-ATOM 1859 CD2 PHE B 103 5.035 -9.335 10.925 1.00 13.36 C
-ATOM 1860 CE1 PHE B 103 6.240 -8.652 13.315 1.00 14.94 C
-ATOM 1861 CE2 PHE B 103 4.498 -9.665 12.273 1.00 14.24 C
-ATOM 1862 CZ PHE B 103 5.298 -9.364 13.368 1.00 19.61 C
-ATOM 1863 N ARG B 104 6.970 -5.873 7.380 1.00 13.60 N
-ATOM 1864 CA ARG B 104 7.430 -5.624 6.005 1.00 17.00 C
-ATOM 1865 C ARG B 104 8.326 -4.499 5.935 1.00 13.66 C
-ATOM 1866 O ARG B 104 9.337 -4.368 5.141 1.00 13.41 O
-ATOM 1867 CB ARG B 104 6.018 -5.177 5.223 1.00 18.62 C
-ATOM 1868 CG ARG B 104 5.137 -6.280 4.965 1.00 31.60 C
-ATOM 1869 CD ARG B 104 3.494 -6.093 4.370 1.00 44.99 C
-ATOM 1870 NE ARG B 104 2.810 -7.429 5.065 1.00 53.69 N
-ATOM 1871 CZ ARG B 104 1.600 -6.829 3.420 1.00 80.12 C
-ATOM 1872 NH1 ARG B 104 0.761 -5.157 3.344 1.00 72.76 N
-ATOM 1873 NH2 ARG B 104 1.186 -8.540 2.528 1.00 80.07 N
-ATOM 1874 N LEU B 105 8.064 -3.438 6.831 1.00 12.29 N
-ATOM 1875 CA LEU B 105 8.899 -2.275 6.982 1.00 11.07 C
-ATOM 1876 C LEU B 105 10.327 -2.808 7.482 1.00 13.91 C
-ATOM 1877 O LEU B 105 11.317 -2.347 6.887 1.00 14.94 O
-ATOM 1878 CB LEU B 105 8.443 -1.409 8.005 1.00 12.50 C
-ATOM 1879 CG LEU B 105 7.121 -0.514 7.549 1.00 17.21 C
-ATOM 1880 CD1 LEU B 105 6.747 0.236 8.813 1.00 19.52 C
-ATOM 1881 CD2 LEU B 105 7.420 0.384 6.353 1.00 25.82 C
-ATOM 1882 N LEU B 106 10.302 -3.738 8.415 1.00 16.16 N
-ATOM 1883 CA LEU B 106 11.679 -4.227 8.855 1.00 11.19 C
-ATOM 1884 C LEU B 106 12.325 -4.914 7.713 1.00 11.49 C
-ATOM 1885 O LEU B 106 13.544 -4.734 7.492 1.00 14.59 O
-ATOM 1886 CB LEU B 106 11.615 -5.043 10.074 1.00 9.57 C
-ATOM 1887 CG LEU B 106 12.904 -5.567 10.740 1.00 14.52 C
-ATOM 1888 CD1 LEU B 106 13.738 -4.483 11.015 1.00 20.21 C
-ATOM 1889 CD2 LEU B 106 12.609 -6.504 11.567 1.00 25.23 C
-ATOM 1890 N GLY B 107 11.728 -5.699 6.854 1.00 8.80 N
-ATOM 1891 CA GLY B 107 12.297 -6.476 5.851 1.00 11.35 C
-ATOM 1892 C GLY B 107 12.781 -5.426 4.844 1.00 11.83 C
-ATOM 1893 O GLY B 107 13.958 -5.700 4.332 1.00 14.42 O
-ATOM 1894 N ASN B 108 12.187 -4.243 4.553 1.00 11.55 N
-ATOM 1895 CA ASN B 108 12.802 -3.506 3.538 1.00 9.47 C
-ATOM 1896 C ASN B 108 14.026 -2.647 4.184 1.00 9.85 C
-ATOM 1897 O ASN B 108 14.983 -2.466 3.460 1.00 13.16 O
-ATOM 1898 CB ASN B 108 11.824 -2.458 3.182 1.00 16.47 C
-ATOM 1899 CG ASN B 108 10.727 -3.234 1.924 1.00 25.36 C
-ATOM 1900 OD1 ASN B 108 11.335 -4.320 1.398 1.00 28.00 O
-ATOM 1901 ND2 ASN B 108 10.036 -2.270 2.100 1.00 42.45 N
-ATOM 1902 N VAL B 109 14.008 -2.327 5.491 1.00 11.97 N
-ATOM 1903 CA VAL B 109 15.193 -1.717 6.001 1.00 8.99 C
-ATOM 1904 C VAL B 109 16.259 -2.676 6.124 1.00 12.55 C
-ATOM 1905 O VAL B 109 17.518 -2.304 5.902 1.00 13.71 O
-ATOM 1906 CB VAL B 109 14.853 -1.250 7.488 1.00 15.07 C
-ATOM 1907 CG1 VAL B 109 16.100 -0.810 8.069 1.00 19.91 C
-ATOM 1908 CG2 VAL B 109 13.852 0.066 7.393 1.00 15.78 C
-ATOM 1909 N LEU B 110 16.030 -4.023 6.388 1.00 9.97 N
-ATOM 1910 CA LEU B 110 17.059 -5.101 6.357 1.00 9.78 C
-ATOM 1911 C LEU B 110 17.764 -5.056 5.040 1.00 13.14 C
-ATOM 1912 O LEU B 110 18.980 -5.187 4.895 1.00 11.97 O
-ATOM 1913 CB LEU B 110 16.410 -6.369 6.847 1.00 11.11 C
-ATOM 1914 CG LEU B 110 17.490 -7.596 6.862 1.00 18.59 C
-ATOM 1915 CD1 LEU B 110 18.696 -7.290 7.723 1.00 24.07 C
-ATOM 1916 CD2 LEU B 110 17.031 -8.897 7.193 1.00 21.67 C
-ATOM 1917 N VAL B 111 17.015 -5.083 3.938 1.00 10.25 N
-ATOM 1918 CA VAL B 111 17.517 -5.121 2.535 1.00 8.08 C
-ATOM 1919 C VAL B 111 18.459 -3.959 2.465 1.00 10.10 C
-ATOM 1920 O VAL B 111 19.605 -3.960 1.822 1.00 14.18 O
-ATOM 1921 CB VAL B 111 16.320 -5.216 1.576 1.00 11.95 C
-ATOM 1922 CG1 VAL B 111 16.949 -4.942 0.196 1.00 16.64 C
-ATOM 1923 CG2 VAL B 111 15.888 -6.643 1.659 1.00 12.92 C
-ATOM 1924 N CYS B 112 18.155 -2.685 2.811 1.00 10.01 N
-ATOM 1925 CA CYS B 112 18.863 -1.400 2.699 1.00 9.19 C
-ATOM 1926 C CYS B 112 20.143 -1.657 3.581 1.00 14.92 C
-ATOM 1927 O CYS B 112 21.199 -1.284 3.015 1.00 13.93 O
-ATOM 1928 CB CYS B 112 18.369 -0.230 3.207 1.00 15.04 C
-ATOM 1929 SG CYS B 112 16.911 0.308 2.042 1.00 18.10 S
-ATOM 1930 N VAL B 113 19.969 -2.202 4.651 1.00 9.52 N
-ATOM 1931 CA VAL B 113 21.202 -2.512 5.398 1.00 11.92 C
-ATOM 1932 C VAL B 113 22.035 -3.532 4.865 1.00 15.57 C
-ATOM 1933 O VAL B 113 23.397 -3.138 4.862 1.00 13.38 O
-ATOM 1934 CB VAL B 113 20.888 -2.948 6.932 1.00 12.70 C
-ATOM 1935 CG1 VAL B 113 22.031 -3.383 7.663 1.00 17.23 C
-ATOM 1936 CG2 VAL B 113 20.282 -1.893 7.694 1.00 17.43 C
-ATOM 1937 N LEU B 114 21.768 -4.615 4.224 1.00 10.74 N
-ATOM 1938 CA LEU B 114 22.632 -5.454 3.485 1.00 10.20 C
-ATOM 1939 C LEU B 114 23.346 -4.641 2.455 1.00 10.87 C
-ATOM 1940 O LEU B 114 24.522 -5.071 2.156 1.00 12.76 O
-ATOM 1941 CB LEU B 114 21.856 -6.600 3.242 1.00 6.84 C
-ATOM 1942 CG LEU B 114 21.362 -7.530 4.328 1.00 10.74 C
-ATOM 1943 CD1 LEU B 114 20.435 -8.554 3.798 1.00 15.38 C
-ATOM 1944 CD2 LEU B 114 22.500 -8.141 5.077 1.00 21.35 C
-ATOM 1945 N ALA B 115 22.472 -3.897 1.677 1.00 9.28 N
-ATOM 1946 CA ALA B 115 23.134 -3.206 0.546 1.00 9.22 C
-ATOM 1947 C ALA B 115 24.284 -2.278 1.091 1.00 9.44 C
-ATOM 1948 O ALA B 115 25.320 -2.142 0.446 1.00 12.10 O
-ATOM 1949 CB ALA B 115 21.930 -2.539 -0.036 1.00 12.15 C
-ATOM 1950 N HIS B 116 23.975 -1.612 2.171 1.00 13.11 N
-ATOM 1951 CA HIS B 116 25.023 -0.593 2.641 1.00 12.81 C
-ATOM 1952 C HIS B 116 26.176 -1.395 3.061 1.00 18.85 C
-ATOM 1953 O HIS B 116 27.357 -0.986 2.878 1.00 16.05 O
-ATOM 1954 CB HIS B 116 24.442 0.070 3.767 1.00 17.43 C
-ATOM 1955 CG HIS B 116 25.164 1.158 4.279 1.00 27.80 C
-ATOM 1956 ND1 HIS B 116 25.567 1.157 5.736 1.00 27.30 N
-ATOM 1957 CD2 HIS B 116 25.793 2.195 3.793 1.00 25.62 C
-ATOM 1958 CE1 HIS B 116 26.226 2.480 5.818 1.00 29.22 C
-ATOM 1959 NE2 HIS B 116 26.570 2.986 4.660 1.00 26.05 N
-ATOM 1960 N HIS B 117 26.066 -2.490 3.850 1.00 11.35 N
-ATOM 1961 CA HIS B 117 27.064 -3.366 4.194 1.00 18.75 C
-ATOM 1962 C HIS B 117 27.881 -3.985 3.242 1.00 20.53 C
-ATOM 1963 O HIS B 117 29.104 -4.114 3.403 1.00 17.07 O
-ATOM 1964 CB HIS B 117 26.621 -4.637 5.175 1.00 19.57 C
-ATOM 1965 CG HIS B 117 27.096 -4.621 6.444 1.00 39.90 C
-ATOM 1966 ND1 HIS B 117 26.039 -3.036 6.824 1.00 47.73 N
-ATOM 1967 CD2 HIS B 117 28.146 -5.329 7.512 1.00 38.82 C
-ATOM 1968 CE1 HIS B 117 26.295 -2.928 8.550 1.00 27.38 C
-ATOM 1969 NE2 HIS B 117 26.763 -4.335 8.924 1.00 51.83 N
-ATOM 1970 N PHE B 118 27.367 -4.628 2.104 1.00 13.44 N
-ATOM 1971 CA PHE B 118 27.888 -5.419 1.096 1.00 13.47 C
-ATOM 1972 C PHE B 118 28.280 -4.574 -0.126 1.00 14.52 C
-ATOM 1973 O PHE B 118 29.082 -5.219 -0.874 1.00 15.85 O
-ATOM 1974 CB PHE B 118 27.174 -6.618 0.947 1.00 14.99 C
-ATOM 1975 CG PHE B 118 27.310 -7.470 1.980 1.00 22.65 C
-ATOM 1976 CD1 PHE B 118 26.224 -7.666 2.855 1.00 28.61 C
-ATOM 1977 CD2 PHE B 118 28.549 -8.159 2.601 1.00 34.26 C
-ATOM 1978 CE1 PHE B 118 26.242 -8.675 3.981 1.00 29.50 C
-ATOM 1979 CE2 PHE B 118 28.351 -9.080 3.277 1.00 36.60 C
-ATOM 1980 CZ PHE B 118 27.627 -9.130 4.417 1.00 30.15 C
-ATOM 1981 N GLY B 119 27.701 -3.412 -0.335 1.00 13.81 N
-ATOM 1982 CA GLY B 119 28.107 -2.567 -1.533 1.00 14.28 C
-ATOM 1983 C GLY B 119 27.814 -3.353 -2.686 1.00 17.07 C
-ATOM 1984 O GLY B 119 26.808 -4.212 -2.888 1.00 16.48 O
-ATOM 1985 N LYS B 120 28.740 -3.472 -3.465 1.00 19.17 N
-ATOM 1986 CA LYS B 120 28.535 -4.059 -4.848 1.00 27.00 C
-ATOM 1987 C LYS B 120 28.486 -5.640 -4.886 1.00 25.94 C
-ATOM 1988 O LYS B 120 27.868 -6.039 -5.935 1.00 20.66 O
-ATOM 1989 CB LYS B 120 29.863 -3.838 -5.852 1.00 31.85 C
-ATOM 1990 CG LYS B 120 30.960 -4.510 -5.562 1.00 36.58 C
-ATOM 1991 CD LYS B 120 32.161 -4.170 -6.625 1.00 49.76 C
-ATOM 1992 CE LYS B 120 33.201 -5.292 -5.966 1.00 55.47 C
-ATOM 1993 NZ LYS B 120 34.292 -5.686 -6.589 1.00 71.03 N
-ATOM 1994 N GLU B 121 28.720 -6.302 -3.902 1.00 20.26 N
-ATOM 1995 CA GLU B 121 28.393 -7.556 -3.778 1.00 15.17 C
-ATOM 1996 C GLU B 121 26.786 -7.871 -3.622 1.00 13.63 C
-ATOM 1997 O GLU B 121 26.362 -9.055 -3.923 1.00 17.16 O
-ATOM 1998 CB GLU B 121 29.233 -8.318 -2.533 1.00 29.40 C
-ATOM 1999 CG GLU B 121 29.541 -9.342 -2.700 1.00 50.25 C
-ATOM 2000 CD GLU B 121 30.241 -9.882 -0.830 1.00 42.74 C
-ATOM 2001 OE1 GLU B 121 29.786 -11.667 -1.141 1.00 47.83 O
-ATOM 2002 OE2 GLU B 121 31.217 -9.425 -1.168 1.00 34.52 O
-ATOM 2003 N PHE B 122 26.054 -6.831 -3.241 1.00 14.63 N
-ATOM 2004 CA PHE B 122 24.581 -7.077 -3.075 1.00 15.34 C
-ATOM 2005 C PHE B 122 24.015 -6.737 -4.532 1.00 13.61 C
-ATOM 2006 O PHE B 122 23.478 -5.701 -4.760 1.00 14.29 O
-ATOM 2007 CB PHE B 122 24.133 -6.005 -1.987 1.00 12.07 C
-ATOM 2008 CG PHE B 122 22.750 -6.466 -1.525 1.00 11.02 C
-ATOM 2009 CD1 PHE B 122 22.540 -7.652 -0.894 1.00 16.65 C
-ATOM 2010 CD2 PHE B 122 21.790 -5.593 -1.747 1.00 10.83 C
-ATOM 2011 CE1 PHE B 122 21.288 -8.069 -0.329 1.00 13.73 C
-ATOM 2012 CE2 PHE B 122 20.427 -5.937 -1.325 1.00 12.97 C
-ATOM 2013 CZ PHE B 122 20.322 -7.247 -0.672 1.00 16.05 C
-ATOM 2014 N THR B 123 24.216 -7.664 -5.332 1.00 18.07 N
-ATOM 2015 CA THR B 123 23.866 -7.444 -6.796 1.00 21.03 C
-ATOM 2016 C THR B 123 22.176 -7.347 -6.888 1.00 27.18 C
-ATOM 2017 O THR B 123 21.678 -7.911 -6.078 1.00 14.31 O
-ATOM 2018 CB THR B 123 24.352 -8.535 -7.622 1.00 19.82 C
-ATOM 2019 OG1 THR B 123 24.030 -9.746 -7.305 1.00 17.47 O
-ATOM 2020 CG2 THR B 123 25.945 -8.568 -7.681 1.00 22.67 C
-ATOM 2021 N PRO B 124 21.821 -7.033 -7.981 1.00 19.47 N
-ATOM 2022 CA PRO B 124 20.309 -7.060 -8.306 1.00 20.19 C
-ATOM 2023 C PRO B 124 19.874 -8.457 -8.199 1.00 20.69 C
-ATOM 2024 O PRO B 124 18.738 -8.543 -7.455 1.00 13.34 O
-ATOM 2025 CB PRO B 124 20.074 -6.480 -9.678 1.00 17.09 C
-ATOM 2026 CG PRO B 124 21.308 -5.510 -9.842 1.00 18.87 C
-ATOM 2027 CD PRO B 124 22.649 -6.190 -9.202 1.00 24.42 C
-ATOM 2028 N PRO B 125 20.354 -9.489 -8.576 1.00 16.20 N
-ATOM 2029 CA PRO B 125 19.952 -10.892 -8.433 1.00 16.84 C
-ATOM 2030 C PRO B 125 19.925 -11.341 -6.992 1.00 14.92 C
-ATOM 2031 O PRO B 125 18.950 -11.983 -6.530 1.00 16.05 O
-ATOM 2032 CB PRO B 125 20.675 -11.924 -9.198 1.00 19.48 C
-ATOM 2033 CG PRO B 125 21.240 -11.056 -10.143 1.00 21.56 C
-ATOM 2034 CD PRO B 125 21.611 -9.723 -9.654 1.00 25.73 C
-ATOM 2035 N VAL B 126 20.904 -10.923 -6.329 1.00 13.83 N
-ATOM 2036 CA VAL B 126 20.919 -11.183 -4.904 1.00 19.80 C
-ATOM 2037 C VAL B 126 20.061 -10.295 -4.143 1.00 14.89 C
-ATOM 2038 O VAL B 126 19.229 -10.946 -3.203 1.00 13.92 O
-ATOM 2039 CB VAL B 126 22.424 -10.769 -4.382 1.00 19.55 C
-ATOM 2040 CG1 VAL B 126 22.408 -11.156 -2.912 1.00 21.55 C
-ATOM 2041 CG2 VAL B 126 23.366 -11.841 -4.809 1.00 27.82 C
-ATOM 2042 N GLN B 127 19.711 -9.155 -4.321 1.00 13.64 N
-ATOM 2043 CA GLN B 127 18.607 -8.382 -3.880 1.00 9.72 C
-ATOM 2044 C GLN B 127 17.397 -9.130 -3.899 1.00 16.14 C
-ATOM 2045 O GLN B 127 16.431 -9.272 -3.189 1.00 12.24 O
-ATOM 2046 CB GLN B 127 18.574 -6.951 -4.292 1.00 13.15 C
-ATOM 2047 CG GLN B 127 17.258 -6.340 -3.818 1.00 13.42 C
-ATOM 2048 CD GLN B 127 17.180 -5.056 -4.465 1.00 16.28 C
-ATOM 2049 OE1 GLN B 127 17.979 -4.488 -5.247 1.00 16.20 O
-ATOM 2050 NE2 GLN B 127 16.107 -4.400 -4.118 1.00 19.47 N
-ATOM 2051 N ALA B 128 17.014 -9.478 -5.230 1.00 15.15 N
-ATOM 2052 CA ALA B 128 15.847 -10.225 -5.543 1.00 15.02 C
-ATOM 2053 C ALA B 128 15.496 -11.450 -4.737 1.00 11.97 C
-ATOM 2054 O ALA B 128 14.413 -11.642 -4.228 1.00 16.35 O
-ATOM 2055 CB ALA B 128 15.759 -10.403 -7.092 1.00 17.08 C
-ATOM 2056 N ALA B 129 16.462 -12.287 -4.461 1.00 13.66 N
-ATOM 2057 CA ALA B 129 16.408 -13.427 -3.647 1.00 13.76 C
-ATOM 2058 C ALA B 129 16.208 -12.966 -2.160 1.00 10.22 C
-ATOM 2059 O ALA B 129 15.192 -13.627 -1.584 1.00 10.46 O
-ATOM 2060 CB ALA B 129 17.632 -14.165 -3.702 1.00 13.23 C
-ATOM 2061 N TYR B 130 16.867 -11.953 -1.693 1.00 10.66 N
-ATOM 2062 CA TYR B 130 16.462 -11.629 -0.331 1.00 13.05 C
-ATOM 2063 C TYR B 130 15.102 -10.929 -0.163 1.00 11.70 C
-ATOM 2064 O TYR B 130 14.473 -11.012 0.813 1.00 11.83 O
-ATOM 2065 CB TYR B 130 17.543 -10.575 0.161 1.00 11.97 C
-ATOM 2066 CG TYR B 130 18.623 -11.287 0.924 1.00 13.90 C
-ATOM 2067 CD1 TYR B 130 18.650 -11.526 2.272 1.00 15.61 C
-ATOM 2068 CD2 TYR B 130 19.782 -11.574 0.237 1.00 14.18 C
-ATOM 2069 CE1 TYR B 130 19.630 -12.272 2.811 1.00 19.97 C
-ATOM 2070 CE2 TYR B 130 20.865 -12.543 0.889 1.00 19.65 C
-ATOM 2071 CZ TYR B 130 20.770 -12.571 2.260 1.00 22.28 C
-ATOM 2072 OH TYR B 130 21.731 -13.339 2.902 1.00 21.52 O
-ATOM 2073 N GLN B 131 14.606 -10.236 -1.202 1.00 12.03 N
-ATOM 2074 CA GLN B 131 13.282 -9.830 -1.214 1.00 12.03 C
-ATOM 2075 C GLN B 131 12.216 -10.851 -1.125 1.00 12.76 C
-ATOM 2076 O GLN B 131 11.369 -10.664 -0.189 1.00 15.09 O
-ATOM 2077 CB GLN B 131 12.944 -9.078 -2.464 1.00 14.85 C
-ATOM 2078 CG GLN B 131 13.735 -7.716 -2.449 1.00 19.57 C
-ATOM 2079 CD GLN B 131 13.251 -6.548 -1.638 1.00 22.82 C
-ATOM 2080 OE1 GLN B 131 13.981 -5.553 -1.833 1.00 18.44 O
-ATOM 2081 NE2 GLN B 131 12.251 -6.415 -0.990 1.00 16.43 N
-ATOM 2082 N LYS B 132 12.503 -11.991 -1.746 1.00 12.50 N
-ATOM 2083 CA LYS B 132 11.644 -13.098 -1.708 1.00 14.23 C
-ATOM 2084 C LYS B 132 11.592 -13.603 -0.224 1.00 17.46 C
-ATOM 2085 O LYS B 132 10.599 -13.851 0.497 1.00 14.87 O
-ATOM 2086 CB LYS B 132 11.937 -14.147 -2.452 1.00 19.74 C
-ATOM 2087 CG LYS B 132 11.561 -13.879 -3.966 1.00 26.28 C
-ATOM 2088 CD LYS B 132 11.989 -15.031 -4.739 1.00 31.58 C
-ATOM 2089 CE LYS B 132 11.660 -14.274 -6.180 1.00 32.98 C
-ATOM 2090 NZ LYS B 132 12.119 -15.998 -6.779 1.00 37.48 N
-ATOM 2091 N VAL B 133 12.856 -13.702 0.483 1.00 17.22 N
-ATOM 2092 CA VAL B 133 13.038 -14.205 1.805 1.00 11.45 C
-ATOM 2093 C VAL B 133 12.401 -13.319 2.840 1.00 11.90 C
-ATOM 2094 O VAL B 133 11.556 -13.799 3.731 1.00 13.71 O
-ATOM 2095 CB VAL B 133 14.459 -14.401 2.160 1.00 16.41 C
-ATOM 2096 CG1 VAL B 133 14.632 -14.683 3.511 1.00 36.18 C
-ATOM 2097 CG2 VAL B 133 15.014 -15.541 1.250 1.00 15.51 C
-ATOM 2098 N VAL B 134 12.512 -11.981 2.749 1.00 13.21 N
-ATOM 2099 CA VAL B 134 12.091 -11.081 3.574 1.00 12.26 C
-ATOM 2100 C VAL B 134 10.632 -11.128 3.483 1.00 16.19 C
-ATOM 2101 O VAL B 134 9.763 -10.888 4.517 1.00 17.40 O
-ATOM 2102 CB VAL B 134 12.356 -9.643 3.780 1.00 11.96 C
-ATOM 2103 CG1 VAL B 134 13.841 -9.777 4.082 1.00 18.38 C
-ATOM 2104 CG2 VAL B 134 12.314 -8.873 2.475 1.00 14.78 C
-ATOM 2105 N ALA B 135 9.938 -11.113 2.262 1.00 13.32 N
-ATOM 2106 CA ALA B 135 8.505 -11.237 2.119 1.00 21.37 C
-ATOM 2107 C ALA B 135 7.942 -12.494 2.777 1.00 17.09 C
-ATOM 2108 O ALA B 135 6.829 -12.512 3.348 1.00 17.43 O
-ATOM 2109 CB ALA B 135 8.135 -10.953 0.769 1.00 28.77 C
-ATOM 2110 N GLY B 136 8.572 -13.635 2.636 1.00 18.26 N
-ATOM 2111 CA GLY B 136 8.219 -15.058 3.189 1.00 19.82 C
-ATOM 2112 C GLY B 136 8.146 -14.912 4.633 1.00 16.67 C
-ATOM 2113 O GLY B 136 7.260 -15.405 5.231 1.00 15.34 O
-ATOM 2114 N VAL B 137 9.300 -14.354 5.275 1.00 19.06 N
-ATOM 2115 CA VAL B 137 9.275 -14.229 6.676 1.00 13.40 C
-ATOM 2116 C VAL B 137 8.222 -13.320 7.172 1.00 14.98 C
-ATOM 2117 O VAL B 137 7.448 -13.726 8.127 1.00 15.32 O
-ATOM 2118 CB VAL B 137 10.681 -13.683 7.141 1.00 12.05 C
-ATOM 2119 CG1 VAL B 137 10.587 -13.517 8.589 1.00 24.37 C
-ATOM 2120 CG2 VAL B 137 11.663 -14.723 6.701 1.00 11.44 C
-ATOM 2121 N ALA B 138 7.830 -12.223 6.567 1.00 14.63 N
-ATOM 2122 CA ALA B 138 6.739 -11.343 6.960 1.00 14.97 C
-ATOM 2123 C ALA B 138 5.477 -12.035 7.025 1.00 14.00 C
-ATOM 2124 O ALA B 138 4.520 -11.965 7.766 1.00 15.18 O
-ATOM 2125 CB ALA B 138 6.733 -10.129 6.135 1.00 21.60 C
-ATOM 2126 N ASN B 139 5.257 -12.632 5.801 1.00 14.76 N
-ATOM 2127 CA ASN B 139 3.965 -13.443 5.693 1.00 19.56 C
-ATOM 2128 C ASN B 139 3.788 -14.741 6.508 1.00 16.64 C
-ATOM 2129 O ASN B 139 2.773 -14.813 7.122 1.00 15.66 O
-ATOM 2130 CB ASN B 139 3.915 -14.281 4.273 1.00 32.30 C
-ATOM 2131 CG ASN B 139 3.642 -13.817 3.893 1.00 58.46 C
-ATOM 2132 OD1 ASN B 139 3.350 -12.337 3.410 1.00 49.38 O
-ATOM 2133 ND2 ASN B 139 4.138 -13.358 1.997 1.00 59.02 N
-ATOM 2134 N ALA B 140 4.975 -15.279 6.996 1.00 12.53 N
-ATOM 2135 CA ALA B 140 4.880 -16.341 7.880 1.00 19.39 C
-ATOM 2136 C ALA B 140 4.686 -15.725 9.225 1.00 15.37 C
-ATOM 2137 O ALA B 140 3.890 -16.337 10.107 1.00 15.92 O
-ATOM 2138 CB ALA B 140 6.298 -17.186 7.962 1.00 22.20 C
-ATOM 2139 N LEU B 141 5.135 -14.663 9.697 1.00 12.47 N
-ATOM 2140 CA LEU B 141 4.897 -13.957 10.913 1.00 15.63 C
-ATOM 2141 C LEU B 141 3.480 -13.697 11.034 1.00 21.66 C
-ATOM 2142 O LEU B 141 2.905 -13.294 12.092 1.00 17.40 O
-ATOM 2143 CB LEU B 141 5.926 -12.962 11.275 1.00 15.12 C
-ATOM 2144 CG LEU B 141 7.158 -13.407 11.868 1.00 17.02 C
-ATOM 2145 CD1 LEU B 141 8.083 -12.226 12.076 1.00 19.94 C
-ATOM 2146 CD2 LEU B 141 7.122 -13.935 13.238 1.00 21.74 C
-ATOM 2147 N ALA B 142 2.836 -13.244 9.876 1.00 12.86 N
-ATOM 2148 CA ALA B 142 1.608 -12.628 9.849 1.00 14.61 C
-ATOM 2149 C ALA B 142 0.405 -13.995 9.823 1.00 20.31 C
-ATOM 2150 O ALA B 142 -0.813 -13.424 10.022 1.00 18.06 O
-ATOM 2151 CB ALA B 142 1.282 -11.676 8.702 1.00 21.40 C
-ATOM 2152 N HIS B 143 0.842 -15.030 9.582 1.00 17.95 N
-ATOM 2153 CA HIS B 143 0.024 -16.256 9.074 1.00 26.37 C
-ATOM 2154 C HIS B 143 -1.200 -16.456 10.329 1.00 19.76 C
-ATOM 2155 O HIS B 143 -2.306 -16.886 9.956 1.00 21.59 O
-ATOM 2156 CB HIS B 143 0.773 -17.382 8.911 1.00 35.96 C
-ATOM 2157 CG HIS B 143 -0.236 -18.629 8.237 1.00 57.59 C
-ATOM 2158 ND1 HIS B 143 0.057 -19.594 9.608 1.00 48.44 N
-ATOM 2159 CD2 HIS B 143 -0.841 -18.281 7.293 1.00 54.87 C
-ATOM 2160 CE1 HIS B 143 -0.983 -20.316 8.077 1.00 74.03 C
-ATOM 2161 NE2 HIS B 143 -1.640 -19.381 7.013 1.00 57.99 N
-ATOM 2162 N LYS B 144 -0.804 -16.302 11.559 1.00 18.69 N
-ATOM 2163 CA LYS B 144 -1.735 -16.737 12.588 1.00 14.86 C
-ATOM 2164 C LYS B 144 -2.396 -15.617 12.962 1.00 16.55 C
-ATOM 2165 O LYS B 144 -3.129 -15.705 14.113 1.00 18.03 O
-ATOM 2166 CB LYS B 144 -0.819 -17.365 13.621 1.00 17.13 C
-ATOM 2167 CG LYS B 144 -0.392 -18.897 13.123 1.00 20.99 C
-ATOM 2168 CD LYS B 144 -1.238 -19.970 13.316 1.00 34.56 C
-ATOM 2169 CE LYS B 144 -2.035 -21.775 13.683 1.00 62.41 C
-ATOM 2170 NZ LYS B 144 -0.955 -22.424 15.226 1.00 62.40 N
-ATOM 2171 N TYR B 145 -2.408 -14.424 12.668 1.00 19.33 N
-ATOM 2172 CA TYR B 145 -3.111 -13.193 12.851 1.00 25.80 C
-ATOM 2173 C TYR B 145 -4.833 -13.485 12.942 1.00 37.10 C
-ATOM 2174 O TYR B 145 -4.989 -14.273 11.858 1.00 25.59 O
-ATOM 2175 CB TYR B 145 -2.815 -11.990 12.502 1.00 20.19 C
-ATOM 2176 CG TYR B 145 -1.513 -11.202 13.062 1.00 16.11 C
-ATOM 2177 CD1 TYR B 145 -1.713 -10.043 13.732 1.00 13.84 C
-ATOM 2178 CD2 TYR B 145 -0.444 -12.052 12.964 1.00 19.35 C
-ATOM 2179 CE1 TYR B 145 -0.716 -9.470 14.306 1.00 14.00 C
-ATOM 2180 CE2 TYR B 145 0.824 -11.431 13.760 1.00 16.15 C
-ATOM 2181 CZ TYR B 145 0.705 -10.123 14.396 1.00 11.23 C
-ATOM 2182 OH TYR B 145 1.824 -9.505 14.779 1.00 11.07 O
-ATOM 2183 N HIS B 146 -5.455 -13.156 13.610 1.00 22.40 N
-ATOM 2184 CA HIS B 146 -7.082 -13.260 13.817 1.00 24.36 C
-ATOM 2185 C HIS B 146 -7.642 -12.243 14.547 1.00 19.29 C
-ATOM 2186 O HIS B 146 -6.896 -11.423 15.229 1.00 20.20 O
-ATOM 2187 CB HIS B 146 -7.319 -14.676 14.251 1.00 17.91 C
-ATOM 2188 CG HIS B 146 -7.349 -14.408 16.278 1.00 30.29 C
-ATOM 2189 ND1 HIS B 146 -7.504 -15.329 16.577 1.00 56.02 N
-ATOM 2190 CD2 HIS B 146 -5.754 -14.700 16.400 1.00 32.02 C
-ATOM 2191 CE1 HIS B 146 -6.763 -15.571 18.243 1.00 45.40 C
-ATOM 2192 NE2 HIS B 146 -6.023 -14.569 17.782 1.00 35.25 N
-ATOM 2193 OXT HIS B 146 -8.867 -12.118 14.478 1.00 28.98 O
-TER 2194 HIS B 146
-ATOM 2195 N VAL C 1 -6.932 15.801 -4.736 1.00 53.78 N
-ATOM 2196 CA VAL C 1 -6.986 18.132 -4.726 1.00 39.83 C
-ATOM 2197 C VAL C 1 -8.725 18.013 -5.289 1.00 29.73 C
-ATOM 2198 O VAL C 1 -9.322 17.317 -6.202 1.00 31.20 O
-ATOM 2199 CB VAL C 1 -6.406 17.702 -5.747 1.00 52.94 C
-ATOM 2200 CG1 VAL C 1 -7.045 19.788 -6.149 1.00 47.73 C
-ATOM 2201 CG2 VAL C 1 -5.138 19.765 -5.197 1.00 67.01 C
-ATOM 2202 N LEU C 2 -9.481 18.489 -4.357 1.00 33.50 N
-ATOM 2203 CA LEU C 2 -10.829 18.318 -4.244 1.00 35.54 C
-ATOM 2204 C LEU C 2 -11.593 19.461 -5.392 1.00 25.83 C
-ATOM 2205 O LEU C 2 -11.224 20.587 -4.763 1.00 37.30 O
-ATOM 2206 CB LEU C 2 -11.320 18.570 -2.993 1.00 38.49 C
-ATOM 2207 CG LEU C 2 -11.368 17.191 -2.068 1.00 34.89 C
-ATOM 2208 CD1 LEU C 2 -11.559 17.406 -0.855 1.00 40.00 C
-ATOM 2209 CD2 LEU C 2 -11.556 16.072 -2.571 1.00 36.30 C
-ATOM 2210 N SER C 3 -12.051 19.126 -6.445 1.00 20.82 N
-ATOM 2211 CA SER C 3 -12.764 20.102 -7.265 1.00 16.99 C
-ATOM 2212 C SER C 3 -13.851 20.641 -6.492 1.00 19.86 C
-ATOM 2213 O SER C 3 -14.562 20.118 -5.605 1.00 23.30 O
-ATOM 2214 CB SER C 3 -12.915 19.412 -8.479 1.00 21.69 C
-ATOM 2215 OG SER C 3 -14.045 18.617 -8.438 1.00 24.96 O
-ATOM 2216 N PRO C 4 -14.614 21.747 -7.040 1.00 27.73 N
-ATOM 2217 CA PRO C 4 -15.686 22.248 -6.606 1.00 18.30 C
-ATOM 2218 C PRO C 4 -16.940 21.185 -6.683 1.00 21.79 C
-ATOM 2219 O PRO C 4 -17.669 21.118 -5.776 1.00 30.78 O
-ATOM 2220 CB PRO C 4 -16.024 23.555 -7.534 1.00 35.17 C
-ATOM 2221 CG PRO C 4 -14.548 23.940 -7.997 1.00 39.10 C
-ATOM 2222 CD PRO C 4 -13.753 22.599 -7.931 1.00 33.69 C
-ATOM 2223 N ALA C 5 -16.700 20.569 -7.707 1.00 20.53 N
-ATOM 2224 CA ALA C 5 -17.694 19.448 -7.877 1.00 15.17 C
-ATOM 2225 C ALA C 5 -17.668 18.427 -6.566 1.00 17.36 C
-ATOM 2226 O ALA C 5 -18.567 17.818 -6.161 1.00 18.86 O
-ATOM 2227 CB ALA C 5 -17.845 18.678 -9.144 1.00 14.70 C
-ATOM 2228 N ASP C 6 -16.408 17.997 -6.530 1.00 17.28 N
-ATOM 2229 CA ASP C 6 -16.090 17.056 -5.440 1.00 13.65 C
-ATOM 2230 C ASP C 6 -16.737 17.558 -4.126 1.00 16.19 C
-ATOM 2231 O ASP C 6 -17.234 16.746 -3.292 1.00 18.77 O
-ATOM 2232 CB ASP C 6 -14.589 16.808 -5.234 1.00 14.90 C
-ATOM 2233 CG ASP C 6 -14.039 15.955 -6.391 1.00 15.46 C
-ATOM 2234 OD1 ASP C 6 -14.772 14.926 -6.958 1.00 20.59 O
-ATOM 2235 OD2 ASP C 6 -12.866 16.168 -6.605 1.00 19.80 O
-ATOM 2236 N LYS C 7 -16.400 18.816 -3.902 1.00 17.95 N
-ATOM 2237 CA LYS C 7 -17.103 19.561 -2.483 1.00 25.53 C
-ATOM 2238 C LYS C 7 -18.248 19.426 -2.208 1.00 19.12 C
-ATOM 2239 O LYS C 7 -18.931 19.046 -1.371 1.00 19.71 O
-ATOM 2240 CB LYS C 7 -16.318 20.793 -2.391 1.00 27.50 C
-ATOM 2241 CG LYS C 7 -14.901 20.741 -2.614 1.00 53.71 C
-ATOM 2242 CD LYS C 7 -13.993 22.186 -1.677 1.00 60.72 C
-ATOM 2243 CE LYS C 7 -13.186 22.490 -2.528 1.00 63.74 C
-ATOM 2244 NZ LYS C 7 -12.305 23.225 -2.858 1.00 80.12 N
-ATOM 2245 N THR C 8 -18.940 19.776 -3.501 1.00 18.59 N
-ATOM 2246 CA THR C 8 -20.439 19.567 -3.523 1.00 17.68 C
-ATOM 2247 C THR C 8 -21.010 18.410 -3.219 1.00 15.92 C
-ATOM 2248 O THR C 8 -21.956 18.189 -2.497 1.00 18.11 O
-ATOM 2249 CB THR C 8 -21.005 20.281 -5.121 1.00 18.41 C
-ATOM 2250 OG1 THR C 8 -20.596 21.570 -4.936 1.00 22.00 O
-ATOM 2251 CG2 THR C 8 -22.332 20.382 -5.020 1.00 19.72 C
-ATOM 2252 N ASN C 9 -20.389 17.337 -3.881 1.00 14.52 N
-ATOM 2253 CA ASN C 9 -20.679 15.854 -3.720 1.00 11.76 C
-ATOM 2254 C ASN C 9 -20.524 15.368 -2.372 1.00 13.43 C
-ATOM 2255 O ASN C 9 -21.452 14.760 -1.788 1.00 14.77 O
-ATOM 2256 CB ASN C 9 -19.952 14.978 -4.802 1.00 15.52 C
-ATOM 2257 CG ASN C 9 -20.502 14.902 -6.224 1.00 21.23 C
-ATOM 2258 OD1 ASN C 9 -21.551 15.460 -6.366 1.00 17.78 O
-ATOM 2259 ND2 ASN C 9 -19.655 14.764 -7.036 1.00 16.93 N
-ATOM 2260 N VAL C 10 -19.456 15.819 -1.845 1.00 15.37 N
-ATOM 2261 CA VAL C 10 -19.214 15.430 -0.511 1.00 15.09 C
-ATOM 2262 C VAL C 10 -20.248 16.151 0.791 1.00 19.82 C
-ATOM 2263 O VAL C 10 -20.653 15.344 1.499 1.00 21.55 O
-ATOM 2264 CB VAL C 10 -17.776 15.740 -0.056 1.00 23.83 C
-ATOM 2265 CG1 VAL C 10 -17.369 15.319 1.491 1.00 26.38 C
-ATOM 2266 CG2 VAL C 10 -16.835 14.843 -0.837 1.00 22.96 C
-ATOM 2267 N LYS C 11 -20.423 17.395 0.515 1.00 19.06 N
-ATOM 2268 CA LYS C 11 -21.545 18.040 1.267 1.00 21.27 C
-ATOM 2269 C LYS C 11 -22.705 17.621 1.194 1.00 24.36 C
-ATOM 2270 O LYS C 11 -23.497 17.219 2.050 1.00 26.88 O
-ATOM 2271 CB LYS C 11 -21.200 19.455 1.180 1.00 24.11 C
-ATOM 2272 CG LYS C 11 -19.982 20.187 1.471 1.00 39.96 C
-ATOM 2273 CD LYS C 11 -20.184 21.708 1.326 1.00 36.60 C
-ATOM 2274 CE LYS C 11 -19.119 22.424 1.599 1.00 40.99 C
-ATOM 2275 NZ LYS C 11 -18.303 23.379 0.156 1.00 57.68 N
-ATOM 2276 N ALA C 12 -23.071 17.255 -0.098 1.00 26.89 N
-ATOM 2277 CA ALA C 12 -24.190 16.574 -0.166 1.00 22.80 C
-ATOM 2278 C ALA C 12 -24.709 15.466 0.479 1.00 22.96 C
-ATOM 2279 O ALA C 12 -25.641 14.894 1.303 1.00 25.17 O
-ATOM 2280 CB ALA C 12 -24.758 16.354 -1.436 1.00 30.68 C
-ATOM 2281 N ALA C 13 -23.698 14.326 0.213 1.00 19.81 N
-ATOM 2282 CA ALA C 13 -23.581 12.980 0.775 1.00 20.52 C
-ATOM 2283 C ALA C 13 -23.620 13.074 2.219 1.00 17.10 C
-ATOM 2284 O ALA C 13 -24.459 12.346 2.958 1.00 22.70 O
-ATOM 2285 CB ALA C 13 -22.559 12.176 0.137 1.00 20.00 C
-ATOM 2286 N TRP C 14 -22.646 13.784 2.878 1.00 18.93 N
-ATOM 2287 CA TRP C 14 -22.430 13.732 4.346 1.00 19.61 C
-ATOM 2288 C TRP C 14 -23.567 14.473 4.894 1.00 29.50 C
-ATOM 2289 O TRP C 14 -24.277 14.100 6.022 1.00 22.89 O
-ATOM 2290 CB TRP C 14 -21.334 14.670 4.695 1.00 20.94 C
-ATOM 2291 CG TRP C 14 -20.803 14.092 5.924 1.00 20.44 C
-ATOM 2292 CD1 TRP C 14 -21.097 15.028 7.151 1.00 25.06 C
-ATOM 2293 CD2 TRP C 14 -20.135 12.848 6.216 1.00 19.23 C
-ATOM 2294 NE1 TRP C 14 -20.337 14.117 8.027 1.00 26.03 N
-ATOM 2295 CE2 TRP C 14 -19.941 12.969 7.773 1.00 27.20 C
-ATOM 2296 CE3 TRP C 14 -19.861 11.878 5.555 1.00 24.26 C
-ATOM 2297 CZ2 TRP C 14 -19.510 11.822 8.284 1.00 29.42 C
-ATOM 2298 CZ3 TRP C 14 -19.277 10.605 6.015 1.00 27.47 C
-ATOM 2299 CH2 TRP C 14 -19.230 10.798 7.728 1.00 31.11 C
-ATOM 2300 N GLY C 15 -24.359 15.298 4.516 1.00 39.26 N
-ATOM 2301 CA GLY C 15 -25.631 16.086 4.525 1.00 27.60 C
-ATOM 2302 C GLY C 15 -26.650 15.043 4.748 1.00 35.88 C
-ATOM 2303 O GLY C 15 -27.292 14.929 6.180 1.00 44.35 O
-ATOM 2304 N LYS C 16 -26.927 14.192 4.125 1.00 34.61 N
-ATOM 2305 CA LYS C 16 -27.870 13.141 3.632 1.00 36.98 C
-ATOM 2306 C LYS C 16 -27.538 12.020 5.023 1.00 26.09 C
-ATOM 2307 O LYS C 16 -28.345 11.313 5.635 1.00 33.01 O
-ATOM 2308 CB LYS C 16 -28.251 12.406 2.440 1.00 27.30 C
-ATOM 2309 CG LYS C 16 -30.036 12.836 1.831 1.00 50.84 C
-ATOM 2310 CD LYS C 16 -30.158 11.081 2.262 1.00 68.28 C
-ATOM 2311 CE LYS C 16 -32.371 10.866 2.370 1.00 73.16 C
-ATOM 2312 NZ LYS C 16 -32.038 9.453 3.272 1.00 69.52 N
-ATOM 2313 N VAL C 17 -26.252 12.133 5.573 1.00 35.88 N
-ATOM 2314 CA VAL C 17 -25.770 11.297 6.645 1.00 27.62 C
-ATOM 2315 C VAL C 17 -26.612 11.695 7.685 1.00 30.67 C
-ATOM 2316 O VAL C 17 -27.281 11.042 8.701 1.00 29.27 O
-ATOM 2317 CB VAL C 17 -24.169 10.853 6.795 1.00 24.84 C
-ATOM 2318 CG1 VAL C 17 -23.946 10.589 8.064 1.00 24.66 C
-ATOM 2319 CG2 VAL C 17 -23.794 9.916 5.483 1.00 36.95 C
-ATOM 2320 N GLY C 18 -26.104 13.085 7.958 1.00 37.42 N
-ATOM 2321 CA GLY C 18 -26.962 13.614 9.161 1.00 36.79 C
-ATOM 2322 C GLY C 18 -26.609 13.344 10.447 1.00 35.54 C
-ATOM 2323 O GLY C 18 -25.379 12.833 10.941 1.00 34.05 O
-ATOM 2324 N ALA C 19 -27.875 13.044 10.943 1.00 30.07 N
-ATOM 2325 CA ALA C 19 -27.686 12.652 12.207 1.00 42.34 C
-ATOM 2326 C ALA C 19 -27.441 11.246 12.497 1.00 38.75 C
-ATOM 2327 O ALA C 19 -27.016 10.579 13.697 1.00 34.11 O
-ATOM 2328 CB ALA C 19 -28.889 12.929 12.875 1.00 49.98 C
-ATOM 2329 N HIS C 20 -27.337 10.243 11.555 1.00 27.23 N
-ATOM 2330 CA HIS C 20 -26.912 8.767 11.705 1.00 31.96 C
-ATOM 2331 C HIS C 20 -25.296 8.716 11.689 1.00 24.34 C
-ATOM 2332 O HIS C 20 -24.833 7.499 11.716 1.00 23.07 O
-ATOM 2333 CB HIS C 20 -27.281 8.149 10.528 1.00 47.99 C
-ATOM 2334 CG HIS C 20 -28.926 8.104 10.076 1.00 49.70 C
-ATOM 2335 ND1 HIS C 20 -29.432 7.280 11.405 1.00 46.00 N
-ATOM 2336 CD2 HIS C 20 -29.730 9.020 9.630 1.00 46.72 C
-ATOM 2337 CE1 HIS C 20 -31.098 7.852 11.111 1.00 49.28 C
-ATOM 2338 NE2 HIS C 20 -30.830 8.671 9.800 1.00 51.94 N
-ATOM 2339 N ALA C 21 -24.619 9.813 11.399 1.00 28.71 N
-ATOM 2340 CA ALA C 21 -23.098 9.802 11.331 1.00 32.59 C
-ATOM 2341 C ALA C 21 -22.391 9.015 12.473 1.00 33.22 C
-ATOM 2342 O ALA C 21 -21.700 8.030 11.964 1.00 25.05 O
-ATOM 2343 CB ALA C 21 -22.805 11.312 11.238 1.00 28.99 C
-ATOM 2344 N GLY C 22 -22.670 8.973 13.605 1.00 30.50 N
-ATOM 2345 CA GLY C 22 -22.269 8.117 14.625 1.00 25.20 C
-ATOM 2346 C GLY C 22 -22.605 6.970 14.498 1.00 28.87 C
-ATOM 2347 O GLY C 22 -21.738 5.901 14.583 1.00 21.09 O
-ATOM 2348 N GLU C 23 -23.752 6.203 14.168 1.00 19.95 N
-ATOM 2349 CA GLU C 23 -24.151 4.976 13.969 1.00 21.38 C
-ATOM 2350 C GLU C 23 -23.181 4.329 12.723 1.00 15.02 C
-ATOM 2351 O GLU C 23 -22.815 3.097 12.742 1.00 16.54 O
-ATOM 2352 CB GLU C 23 -25.689 4.819 13.452 1.00 29.82 C
-ATOM 2353 CG GLU C 23 -26.106 3.452 13.736 1.00 36.93 C
-ATOM 2354 CD GLU C 23 -28.202 3.924 13.602 1.00 80.12 C
-ATOM 2355 OE1 GLU C 23 -27.795 2.922 11.489 1.00 66.02 O
-ATOM 2356 OE2 GLU C 23 -27.964 4.694 13.267 1.00 59.79 O
-ATOM 2357 N TYR C 24 -23.207 5.173 11.697 1.00 21.28 N
-ATOM 2358 CA TYR C 24 -22.418 4.812 10.585 1.00 19.46 C
-ATOM 2359 C TYR C 24 -20.849 4.466 10.860 1.00 15.33 C
-ATOM 2360 O TYR C 24 -20.148 3.754 10.360 1.00 13.77 O
-ATOM 2361 CB TYR C 24 -22.651 5.606 9.406 1.00 16.14 C
-ATOM 2362 CG TYR C 24 -24.080 5.727 8.793 1.00 13.71 C
-ATOM 2363 CD1 TYR C 24 -24.170 6.732 7.640 1.00 24.76 C
-ATOM 2364 CD2 TYR C 24 -25.002 4.824 9.337 1.00 21.84 C
-ATOM 2365 CE1 TYR C 24 -25.645 6.832 7.377 1.00 25.66 C
-ATOM 2366 CE2 TYR C 24 -26.453 4.934 8.784 1.00 17.49 C
-ATOM 2367 CZ TYR C 24 -26.325 5.877 7.791 1.00 27.32 C
-ATOM 2368 OH TYR C 24 -27.810 6.069 7.401 1.00 31.23 O
-ATOM 2369 N GLY C 25 -20.290 5.421 11.638 1.00 18.29 N
-ATOM 2370 CA GLY C 25 -19.027 5.388 12.069 1.00 15.33 C
-ATOM 2371 C GLY C 25 -18.807 4.272 12.918 1.00 12.64 C
-ATOM 2372 O GLY C 25 -17.733 3.304 12.661 1.00 15.23 O
-ATOM 2373 N ALA C 26 -19.542 3.599 13.820 1.00 16.00 N
-ATOM 2374 CA ALA C 26 -19.471 2.386 14.471 1.00 11.42 C
-ATOM 2375 C ALA C 26 -19.307 1.193 13.564 1.00 10.94 C
-ATOM 2376 O ALA C 26 -18.739 0.230 13.578 1.00 13.65 O
-ATOM 2377 CB ALA C 26 -20.512 2.232 15.656 1.00 11.99 C
-ATOM 2378 N GLU C 27 -20.425 1.260 12.521 1.00 12.87 N
-ATOM 2379 CA GLU C 27 -20.638 0.028 11.636 1.00 15.51 C
-ATOM 2380 C GLU C 27 -19.412 0.022 10.785 1.00 12.84 C
-ATOM 2381 O GLU C 27 -18.849 -1.119 10.534 1.00 15.95 O
-ATOM 2382 CB GLU C 27 -21.715 0.427 10.623 1.00 15.50 C
-ATOM 2383 CG GLU C 27 -21.926 -0.710 9.772 1.00 17.08 C
-ATOM 2384 CD GLU C 27 -23.164 -0.586 8.872 1.00 30.48 C
-ATOM 2385 OE1 GLU C 27 -23.095 -0.770 7.588 1.00 18.71 O
-ATOM 2386 OE2 GLU C 27 -24.194 0.119 9.312 1.00 24.16 O
-ATOM 2387 N ALA C 28 -18.789 1.258 10.332 1.00 11.36 N
-ATOM 2388 CA ALA C 28 -17.460 1.158 9.500 1.00 9.58 C
-ATOM 2389 C ALA C 28 -16.340 0.418 10.332 1.00 9.29 C
-ATOM 2390 O ALA C 28 -15.677 -0.370 9.760 1.00 12.64 O
-ATOM 2391 CB ALA C 28 -17.171 2.523 9.159 1.00 13.35 C
-ATOM 2392 N LEU C 29 -16.325 0.834 11.666 1.00 12.01 N
-ATOM 2393 CA LEU C 29 -15.240 0.036 12.460 1.00 9.42 C
-ATOM 2394 C LEU C 29 -15.351 -1.296 12.531 1.00 8.04 C
-ATOM 2395 O LEU C 29 -14.557 -2.221 12.462 1.00 11.27 O
-ATOM 2396 CB LEU C 29 -15.253 0.792 13.944 1.00 13.39 C
-ATOM 2397 CG LEU C 29 -14.671 2.120 14.000 1.00 14.28 C
-ATOM 2398 CD1 LEU C 29 -15.060 2.641 15.229 1.00 21.17 C
-ATOM 2399 CD2 LEU C 29 -13.328 2.186 13.586 1.00 17.52 C
-ATOM 2400 N GLU C 30 -16.582 -1.891 12.768 1.00 12.13 N
-ATOM 2401 CA GLU C 30 -17.039 -3.158 12.830 1.00 15.15 C
-ATOM 2402 C GLU C 30 -16.575 -3.834 11.597 1.00 15.74 C
-ATOM 2403 O GLU C 30 -16.144 -4.973 11.643 1.00 15.15 O
-ATOM 2404 CB GLU C 30 -18.512 -3.390 13.241 1.00 16.95 C
-ATOM 2405 CG GLU C 30 -18.749 -4.796 13.397 1.00 22.01 C
-ATOM 2406 CD GLU C 30 -20.492 -5.310 14.125 1.00 33.25 C
-ATOM 2407 OE1 GLU C 30 -20.859 -4.170 14.215 1.00 33.78 O
-ATOM 2408 OE2 GLU C 30 -20.298 -6.063 14.309 1.00 40.59 O
-ATOM 2409 N ARG C 31 -17.016 -3.172 10.500 1.00 9.68 N
-ATOM 2410 CA ARG C 31 -16.706 -3.791 9.173 1.00 8.70 C
-ATOM 2411 C ARG C 31 -15.092 -4.029 9.070 1.00 13.62 C
-ATOM 2412 O ARG C 31 -14.706 -5.080 8.618 1.00 13.67 O
-ATOM 2413 CB ARG C 31 -17.211 -2.898 8.144 1.00 12.42 C
-ATOM 2414 CG ARG C 31 -18.743 -3.121 7.942 1.00 11.84 C
-ATOM 2415 CD ARG C 31 -19.136 -2.201 6.911 1.00 15.20 C
-ATOM 2416 NE ARG C 31 -20.701 -2.256 6.631 1.00 14.19 N
-ATOM 2417 CZ ARG C 31 -21.363 -3.224 5.977 1.00 11.42 C
-ATOM 2418 NH1 ARG C 31 -20.645 -4.259 5.462 1.00 11.92 N
-ATOM 2419 NH2 ARG C 31 -22.607 -3.167 6.110 1.00 15.15 N
-ATOM 2420 N MET C 32 -14.391 -2.999 9.390 1.00 10.57 N
-ATOM 2421 CA MET C 32 -12.880 -2.985 9.431 1.00 8.16 C
-ATOM 2422 C MET C 32 -12.304 -4.106 10.303 1.00 7.80 C
-ATOM 2423 O MET C 32 -11.482 -4.880 9.804 1.00 11.64 O
-ATOM 2424 CB MET C 32 -12.387 -1.587 9.793 1.00 8.09 C
-ATOM 2425 CG MET C 32 -10.949 -1.623 9.744 1.00 11.10 C
-ATOM 2426 SD MET C 32 -10.226 -0.081 10.328 1.00 18.02 S
-ATOM 2427 CE MET C 32 -10.638 -0.209 12.043 1.00 20.04 C
-ATOM 2428 N PHE C 33 -12.802 -4.206 11.603 1.00 13.50 N
-ATOM 2429 CA PHE C 33 -12.271 -5.320 12.432 1.00 12.85 C
-ATOM 2430 C PHE C 33 -12.547 -6.578 11.951 1.00 15.05 C
-ATOM 2431 O PHE C 33 -11.717 -7.551 12.143 1.00 13.38 O
-ATOM 2432 CB PHE C 33 -12.756 -5.046 13.817 1.00 12.45 C
-ATOM 2433 CG PHE C 33 -12.568 -3.710 14.467 1.00 10.81 C
-ATOM 2434 CD1 PHE C 33 -11.266 -3.320 14.428 1.00 14.60 C
-ATOM 2435 CD2 PHE C 33 -13.526 -3.151 15.305 1.00 15.15 C
-ATOM 2436 CE1 PHE C 33 -10.894 -2.155 15.062 1.00 15.80 C
-ATOM 2437 CE2 PHE C 33 -13.010 -1.947 15.768 1.00 13.43 C
-ATOM 2438 CZ PHE C 33 -11.786 -1.494 15.661 1.00 22.23 C
-ATOM 2439 N LEU C 34 -13.672 -6.909 11.292 1.00 11.85 N
-ATOM 2440 CA LEU C 34 -14.025 -8.262 10.744 1.00 12.31 C
-ATOM 2441 C LEU C 34 -13.308 -8.546 9.433 1.00 15.72 C
-ATOM 2442 O LEU C 34 -12.814 -9.634 9.197 1.00 19.67 O
-ATOM 2443 CB LEU C 34 -15.490 -8.519 10.506 1.00 16.89 C
-ATOM 2444 CG LEU C 34 -16.308 -8.523 11.809 1.00 26.21 C
-ATOM 2445 CD1 LEU C 34 -17.801 -8.703 11.585 1.00 26.59 C
-ATOM 2446 CD2 LEU C 34 -15.886 -9.544 12.837 1.00 38.34 C
-ATOM 2447 N SER C 35 -13.287 -7.520 8.527 1.00 12.82 N
-ATOM 2448 CA SER C 35 -12.594 -7.794 7.329 1.00 10.93 C
-ATOM 2449 C SER C 35 -11.162 -7.828 7.166 1.00 14.27 C
-ATOM 2450 O SER C 35 -10.505 -8.327 6.376 1.00 16.71 O
-ATOM 2451 CB SER C 35 -13.015 -6.732 6.237 1.00 13.98 C
-ATOM 2452 OG SER C 35 -14.406 -6.851 5.967 1.00 18.75 O
-ATOM 2453 N PHE C 36 -10.441 -6.974 8.104 1.00 11.09 N
-ATOM 2454 CA PHE C 36 -9.024 -6.696 8.153 1.00 10.70 C
-ATOM 2455 C PHE C 36 -8.606 -6.742 9.707 1.00 13.97 C
-ATOM 2456 O PHE C 36 -8.344 -5.778 10.402 1.00 16.32 O
-ATOM 2457 CB PHE C 36 -8.759 -5.327 7.682 1.00 12.71 C
-ATOM 2458 CG PHE C 36 -9.244 -5.034 6.227 1.00 14.13 C
-ATOM 2459 CD1 PHE C 36 -10.405 -4.227 6.071 1.00 14.98 C
-ATOM 2460 CD2 PHE C 36 -8.716 -5.826 5.029 1.00 21.47 C
-ATOM 2461 CE1 PHE C 36 -10.962 -3.950 4.805 1.00 23.41 C
-ATOM 2462 CE2 PHE C 36 -9.304 -5.498 3.966 1.00 24.62 C
-ATOM 2463 CZ PHE C 36 -10.428 -4.612 3.839 1.00 15.55 C
-ATOM 2464 N PRO C 37 -8.487 -8.050 9.947 1.00 18.65 N
-ATOM 2465 CA PRO C 37 -8.320 -8.334 11.359 1.00 17.35 C
-ATOM 2466 C PRO C 37 -6.962 -7.708 12.012 1.00 18.35 C
-ATOM 2467 O PRO C 37 -6.854 -7.465 13.248 1.00 14.04 O
-ATOM 2468 CB PRO C 37 -8.349 -9.870 11.562 1.00 27.87 C
-ATOM 2469 CG PRO C 37 -8.429 -10.372 10.373 1.00 37.42 C
-ATOM 2470 CD PRO C 37 -8.767 -9.192 9.450 1.00 22.48 C
-ATOM 2471 N THR C 38 -6.066 -7.410 11.173 1.00 12.63 N
-ATOM 2472 CA THR C 38 -4.834 -6.636 11.753 1.00 17.25 C
-ATOM 2473 C THR C 38 -5.049 -5.478 12.414 1.00 15.32 C
-ATOM 2474 O THR C 38 -4.264 -5.001 13.219 1.00 11.09 O
-ATOM 2475 CB THR C 38 -3.639 -7.011 10.452 1.00 12.40 C
-ATOM 2476 OG1 THR C 38 -4.178 -5.757 9.596 1.00 15.33 O
-ATOM 2477 CG2 THR C 38 -4.507 -7.126 9.385 1.00 80.12 C
-ATOM 2478 N THR C 39 -6.072 -4.797 11.866 1.00 10.35 N
-ATOM 2479 CA THR C 39 -6.458 -3.530 12.499 1.00 11.60 C
-ATOM 2480 C THR C 39 -6.867 -3.675 13.987 1.00 11.25 C
-ATOM 2481 O THR C 39 -6.719 -2.683 14.751 1.00 15.31 O
-ATOM 2482 CB THR C 39 -7.618 -2.839 11.782 1.00 10.41 C
-ATOM 2483 OG1 THR C 39 -8.902 -3.535 11.780 1.00 8.43 O
-ATOM 2484 CG2 THR C 39 -7.110 -2.694 10.278 1.00 7.27 C
-ATOM 2485 N LYS C 40 -7.142 -4.800 14.416 1.00 12.10 N
-ATOM 2486 CA LYS C 40 -7.571 -4.948 15.946 1.00 12.37 C
-ATOM 2487 C LYS C 40 -6.340 -4.815 16.822 1.00 12.69 C
-ATOM 2488 O LYS C 40 -6.554 -4.646 17.995 1.00 13.50 O
-ATOM 2489 CB LYS C 40 -8.135 -6.441 16.142 1.00 13.01 C
-ATOM 2490 CG LYS C 40 -9.508 -6.644 15.446 1.00 16.35 C
-ATOM 2491 CD LYS C 40 -9.585 -8.284 15.551 1.00 21.60 C
-ATOM 2492 CE LYS C 40 -10.395 -8.518 15.432 1.00 41.58 C
-ATOM 2493 NZ LYS C 40 -10.104 -10.161 15.709 1.00 24.62 N
-ATOM 2494 N THR C 41 -5.213 -4.883 16.231 1.00 15.39 N
-ATOM 2495 CA THR C 41 -3.858 -4.878 17.048 1.00 15.24 C
-ATOM 2496 C THR C 41 -3.895 -3.538 17.513 1.00 24.53 C
-ATOM 2497 O THR C 41 -3.052 -3.276 18.625 1.00 20.94 O
-ATOM 2498 CB THR C 41 -2.611 -5.058 16.204 1.00 10.27 C
-ATOM 2499 OG1 THR C 41 -2.473 -4.084 15.265 1.00 10.56 O
-ATOM 2500 CG2 THR C 41 -2.649 -6.370 15.637 1.00 13.16 C
-ATOM 2501 N TYR C 42 -4.559 -2.347 17.313 1.00 15.74 N
-ATOM 2502 CA TYR C 42 -4.420 -1.045 17.757 1.00 10.60 C
-ATOM 2503 C TYR C 42 -5.479 -0.829 18.921 1.00 12.75 C
-ATOM 2504 O TYR C 42 -5.553 0.201 19.530 1.00 15.68 O
-ATOM 2505 CB TYR C 42 -4.800 0.068 16.774 1.00 16.68 C
-ATOM 2506 CG TYR C 42 -3.607 -0.087 15.746 1.00 10.99 C
-ATOM 2507 CD1 TYR C 42 -2.328 0.661 16.011 1.00 17.16 C
-ATOM 2508 CD2 TYR C 42 -3.699 -0.743 14.478 1.00 12.51 C
-ATOM 2509 CE1 TYR C 42 -1.337 0.521 15.154 1.00 15.83 C
-ATOM 2510 CE2 TYR C 42 -2.696 -0.758 13.617 1.00 12.91 C
-ATOM 2511 CZ TYR C 42 -1.386 -0.114 13.943 1.00 12.97 C
-ATOM 2512 OH TYR C 42 -0.401 -0.078 12.976 1.00 13.25 O
-ATOM 2513 N PHE C 43 -6.271 -1.850 19.113 1.00 15.49 N
-ATOM 2514 CA PHE C 43 -7.459 -1.760 20.167 1.00 17.75 C
-ATOM 2515 C PHE C 43 -7.514 -3.016 21.053 1.00 20.04 C
-ATOM 2516 O PHE C 43 -8.605 -3.535 21.334 1.00 17.05 O
-ATOM 2517 CB PHE C 43 -8.817 -1.519 19.333 1.00 26.70 C
-ATOM 2518 CG PHE C 43 -8.906 -0.392 18.437 1.00 14.42 C
-ATOM 2519 CD1 PHE C 43 -8.473 -0.554 17.054 1.00 15.73 C
-ATOM 2520 CD2 PHE C 43 -9.700 0.777 18.998 1.00 15.90 C
-ATOM 2521 CE1 PHE C 43 -8.663 0.579 16.317 1.00 16.99 C
-ATOM 2522 CE2 PHE C 43 -9.585 1.781 18.059 1.00 19.76 C
-ATOM 2523 CZ PHE C 43 -9.193 1.883 16.726 1.00 10.96 C
-ATOM 2524 N PRO C 44 -6.303 -3.266 21.758 1.00 17.51 N
-ATOM 2525 CA PRO C 44 -6.430 -4.575 22.577 1.00 22.01 C
-ATOM 2526 C PRO C 44 -7.021 -4.034 23.952 1.00 23.34 C
-ATOM 2527 O PRO C 44 -7.479 -5.004 24.549 1.00 23.67 O
-ATOM 2528 CB PRO C 44 -4.725 -4.600 22.823 1.00 28.76 C
-ATOM 2529 CG PRO C 44 -4.302 -3.265 22.722 1.00 30.00 C
-ATOM 2530 CD PRO C 44 -5.000 -2.496 21.564 1.00 18.17 C
-ATOM 2531 N HIS C 45 -7.313 -2.986 24.170 1.00 23.82 N
-ATOM 2532 CA HIS C 45 -8.129 -2.454 25.363 1.00 24.33 C
-ATOM 2533 C HIS C 45 -9.774 -2.425 25.223 1.00 36.67 C
-ATOM 2534 O HIS C 45 -10.201 -1.856 26.159 1.00 32.61 O
-ATOM 2535 CB HIS C 45 -7.724 -1.122 25.714 1.00 29.73 C
-ATOM 2536 CG HIS C 45 -7.512 0.207 24.830 1.00 29.43 C
-ATOM 2537 ND1 HIS C 45 -6.904 -0.240 23.536 1.00 26.84 N
-ATOM 2538 CD2 HIS C 45 -8.212 1.313 24.765 1.00 33.54 C
-ATOM 2539 CE1 HIS C 45 -7.241 0.770 23.119 1.00 37.75 C
-ATOM 2540 NE2 HIS C 45 -7.901 1.880 23.651 1.00 39.11 N
-ATOM 2541 N PHE C 46 -10.097 -2.588 23.981 1.00 19.71 N
-ATOM 2542 CA PHE C 46 -11.427 -2.447 23.784 1.00 16.71 C
-ATOM 2543 C PHE C 46 -11.984 -3.704 23.878 1.00 21.27 C
-ATOM 2544 O PHE C 46 -11.601 -4.890 23.408 1.00 23.84 O
-ATOM 2545 CB PHE C 46 -11.721 -1.909 22.223 1.00 21.57 C
-ATOM 2546 CG PHE C 46 -11.812 -0.571 22.355 1.00 17.89 C
-ATOM 2547 CD1 PHE C 46 -12.584 0.134 21.407 1.00 29.22 C
-ATOM 2548 CD2 PHE C 46 -11.092 0.466 22.932 1.00 29.35 C
-ATOM 2549 CE1 PHE C 46 -12.539 1.579 21.231 1.00 23.51 C
-ATOM 2550 CE2 PHE C 46 -11.283 1.342 22.737 1.00 34.19 C
-ATOM 2551 CZ PHE C 46 -11.794 2.381 21.680 1.00 30.38 C
-ATOM 2552 N ASP C 47 -13.484 -3.924 24.123 1.00 21.22 N
-ATOM 2553 CA ASP C 47 -14.200 -5.093 23.710 1.00 21.17 C
-ATOM 2554 C ASP C 47 -14.972 -4.945 22.231 1.00 15.44 C
-ATOM 2555 O ASP C 47 -15.394 -3.747 22.085 1.00 19.22 O
-ATOM 2556 CB ASP C 47 -15.564 -4.912 24.743 1.00 26.87 C
-ATOM 2557 CG ASP C 47 -16.291 -6.456 24.524 1.00 44.60 C
-ATOM 2558 OD1 ASP C 47 -16.314 -6.539 23.491 1.00 38.14 O
-ATOM 2559 OD2 ASP C 47 -17.247 -6.397 25.386 1.00 35.16 O
-ATOM 2560 N LEU C 48 -14.283 -5.744 21.445 1.00 20.23 N
-ATOM 2561 CA LEU C 48 -14.738 -5.455 19.945 1.00 22.13 C
-ATOM 2562 C LEU C 48 -15.716 -6.250 19.550 1.00 26.79 C
-ATOM 2563 O LEU C 48 -16.269 -6.380 18.272 1.00 28.79 O
-ATOM 2564 CB LEU C 48 -13.468 -5.863 19.207 1.00 20.10 C
-ATOM 2565 CG LEU C 48 -12.283 -5.143 19.138 1.00 22.13 C
-ATOM 2566 CD1 LEU C 48 -10.976 -5.443 18.455 1.00 30.66 C
-ATOM 2567 CD2 LEU C 48 -12.440 -3.412 19.024 1.00 21.27 C
-ATOM 2568 N SER C 49 -16.750 -6.795 20.348 1.00 29.67 N
-ATOM 2569 CA SER C 49 -17.996 -7.682 20.348 1.00 26.45 C
-ATOM 2570 C SER C 49 -18.688 -6.784 19.661 1.00 19.97 C
-ATOM 2571 O SER C 49 -18.950 -5.536 19.662 1.00 20.96 O
-ATOM 2572 CB SER C 49 -18.391 -8.577 21.574 1.00 26.72 C
-ATOM 2573 OG SER C 49 -18.238 -7.994 22.499 1.00 34.29 O
-ATOM 2574 N HIS C 50 -19.776 -7.581 18.833 1.00 28.23 N
-ATOM 2575 CA HIS C 50 -20.784 -6.859 18.155 1.00 26.06 C
-ATOM 2576 C HIS C 50 -21.742 -6.003 19.283 1.00 24.81 C
-ATOM 2577 O HIS C 50 -21.976 -6.730 20.143 1.00 27.33 O
-ATOM 2578 CB HIS C 50 -21.772 -7.860 17.171 1.00 33.58 C
-ATOM 2579 CG HIS C 50 -22.495 -6.997 16.501 1.00 21.75 C
-ATOM 2580 ND1 HIS C 50 -24.098 -7.224 16.903 1.00 37.61 N
-ATOM 2581 CD2 HIS C 50 -22.721 -6.030 15.749 1.00 24.11 C
-ATOM 2582 CE1 HIS C 50 -24.713 -6.289 16.301 1.00 35.12 C
-ATOM 2583 NE2 HIS C 50 -23.972 -5.305 15.362 1.00 42.35 N
-ATOM 2584 N GLY C 51 -21.911 -4.827 19.019 1.00 24.42 N
-ATOM 2585 CA GLY C 51 -22.633 -4.098 19.831 1.00 26.56 C
-ATOM 2586 C GLY C 51 -22.082 -3.387 20.930 1.00 23.39 C
-ATOM 2587 O GLY C 51 -22.536 -2.501 21.731 1.00 25.53 O
-ATOM 2588 N SER C 52 -20.724 -3.498 20.885 1.00 22.06 N
-ATOM 2589 CA SER C 52 -19.739 -2.846 21.982 1.00 25.03 C
-ATOM 2590 C SER C 52 -19.903 -1.593 22.193 1.00 31.37 C
-ATOM 2591 O SER C 52 -19.945 -0.663 21.200 1.00 22.94 O
-ATOM 2592 CB SER C 52 -18.376 -3.162 21.704 1.00 30.26 C
-ATOM 2593 OG SER C 52 -17.567 -2.497 22.631 1.00 21.66 O
-ATOM 2594 N ALA C 53 -20.311 -0.885 23.302 1.00 22.15 N
-ATOM 2595 CA ALA C 53 -20.223 0.561 23.639 1.00 29.32 C
-ATOM 2596 C ALA C 53 -19.008 1.341 23.195 1.00 23.50 C
-ATOM 2597 O ALA C 53 -19.144 2.489 22.964 1.00 19.56 O
-ATOM 2598 CB ALA C 53 -21.016 0.770 24.778 1.00 46.37 C
-ATOM 2599 N GLN C 54 -18.075 0.456 23.565 1.00 20.69 N
-ATOM 2600 CA GLN C 54 -16.671 1.124 23.388 1.00 22.13 C
-ATOM 2601 C GLN C 54 -16.498 1.625 21.724 1.00 21.00 C
-ATOM 2602 O GLN C 54 -15.986 2.677 21.452 1.00 19.66 O
-ATOM 2603 CB GLN C 54 -15.533 0.388 23.780 1.00 23.01 C
-ATOM 2604 CG GLN C 54 -15.387 0.264 25.146 1.00 26.98 C
-ATOM 2605 CD GLN C 54 -14.244 -0.704 25.751 1.00 17.64 C
-ATOM 2606 OE1 GLN C 54 -14.213 -1.867 25.317 1.00 23.97 O
-ATOM 2607 NE2 GLN C 54 -13.269 -0.029 26.343 1.00 35.16 N
-ATOM 2608 N VAL C 55 -16.998 0.495 20.976 1.00 18.58 N
-ATOM 2609 CA VAL C 55 -16.782 0.728 19.397 1.00 18.23 C
-ATOM 2610 C VAL C 55 -17.788 1.835 19.121 1.00 15.73 C
-ATOM 2611 O VAL C 55 -17.557 2.638 18.250 1.00 16.15 O
-ATOM 2612 CB VAL C 55 -17.023 -0.655 18.769 1.00 16.13 C
-ATOM 2613 CG1 VAL C 55 -17.141 -0.282 17.289 1.00 22.56 C
-ATOM 2614 CG2 VAL C 55 -15.953 -1.526 19.088 1.00 16.34 C
-ATOM 2615 N LYS C 56 -19.064 1.844 19.638 1.00 17.00 N
-ATOM 2616 CA LYS C 56 -20.011 2.798 19.335 1.00 18.57 C
-ATOM 2617 C LYS C 56 -19.657 4.015 19.595 1.00 20.36 C
-ATOM 2618 O LYS C 56 -19.638 5.117 18.950 1.00 20.10 O
-ATOM 2619 CB LYS C 56 -21.306 2.565 20.099 1.00 27.04 C
-ATOM 2620 CG LYS C 56 -22.017 1.239 19.517 1.00 42.35 C
-ATOM 2621 CD LYS C 56 -23.983 2.334 19.796 1.00 43.36 C
-ATOM 2622 CE LYS C 56 -24.238 -0.016 19.420 1.00 48.38 C
-ATOM 2623 NZ LYS C 56 -25.547 0.420 20.454 1.00 67.70 N
-ATOM 2624 N GLY C 57 -18.873 4.239 20.758 1.00 16.00 N
-ATOM 2625 CA GLY C 57 -18.397 5.432 21.231 1.00 21.54 C
-ATOM 2626 C GLY C 57 -17.299 6.086 20.387 1.00 18.61 C
-ATOM 2627 O GLY C 57 -17.174 7.416 20.069 1.00 24.59 O
-ATOM 2628 N HIS C 58 -16.421 5.133 20.063 1.00 15.81 N
-ATOM 2629 CA HIS C 58 -15.259 5.492 19.163 1.00 16.10 C
-ATOM 2630 C HIS C 58 -15.968 5.977 17.705 1.00 21.16 C
-ATOM 2631 O HIS C 58 -15.334 6.873 17.165 1.00 17.74 O
-ATOM 2632 CB HIS C 58 -14.298 4.450 19.037 1.00 15.43 C
-ATOM 2633 CG HIS C 58 -13.084 4.816 18.336 1.00 18.98 C
-ATOM 2634 ND1 HIS C 58 -12.377 5.886 18.887 1.00 21.14 N
-ATOM 2635 CD2 HIS C 58 -12.537 4.339 17.359 1.00 16.95 C
-ATOM 2636 CE1 HIS C 58 -11.397 5.896 17.811 1.00 21.77 C
-ATOM 2637 NE2 HIS C 58 -11.418 4.951 16.789 1.00 17.45 N
-ATOM 2638 N GLY C 59 -16.820 5.155 17.321 1.00 20.04 N
-ATOM 2639 CA GLY C 59 -17.341 5.505 16.148 1.00 24.32 C
-ATOM 2640 C GLY C 59 -18.005 6.810 15.949 1.00 16.44 C
-ATOM 2641 O GLY C 59 -17.768 7.655 14.926 1.00 16.63 O
-ATOM 2642 N LYS C 60 -18.641 7.304 17.045 1.00 14.40 N
-ATOM 2643 CA LYS C 60 -19.047 8.674 17.195 1.00 14.87 C
-ATOM 2644 C LYS C 60 -18.066 9.704 17.103 1.00 17.20 C
-ATOM 2645 O LYS C 60 -18.083 10.725 16.452 1.00 19.10 O
-ATOM 2646 CB LYS C 60 -20.090 8.722 18.417 1.00 20.14 C
-ATOM 2647 CG LYS C 60 -20.474 10.102 18.286 1.00 36.22 C
-ATOM 2648 CD LYS C 60 -21.736 10.498 19.120 1.00 67.45 C
-ATOM 2649 CE LYS C 60 -22.281 11.583 18.549 1.00 61.41 C
-ATOM 2650 NZ LYS C 60 -21.104 12.754 19.691 1.00 67.02 N
-ATOM 2651 N LYS C 61 -16.927 9.423 17.774 1.00 17.79 N
-ATOM 2652 CA LYS C 61 -15.858 10.357 17.767 1.00 21.13 C
-ATOM 2653 C LYS C 61 -15.164 10.595 16.162 1.00 16.24 C
-ATOM 2654 O LYS C 61 -14.881 11.695 15.808 1.00 15.80 O
-ATOM 2655 CB LYS C 61 -14.696 9.830 18.603 1.00 23.05 C
-ATOM 2656 CG LYS C 61 -15.062 10.074 19.860 1.00 29.48 C
-ATOM 2657 CD LYS C 61 -14.168 9.693 20.841 1.00 35.76 C
-ATOM 2658 CE LYS C 61 -14.859 10.184 22.437 1.00 58.26 C
-ATOM 2659 NZ LYS C 61 -13.290 9.055 22.853 1.00 59.87 N
-ATOM 2660 N VAL C 62 -15.053 9.278 15.522 1.00 15.31 N
-ATOM 2661 CA VAL C 62 -14.623 9.355 14.153 1.00 17.56 C
-ATOM 2662 C VAL C 62 -15.371 10.194 13.113 1.00 16.25 C
-ATOM 2663 O VAL C 62 -15.014 11.087 12.455 1.00 13.61 O
-ATOM 2664 CB VAL C 62 -14.380 7.809 13.720 1.00 18.84 C
-ATOM 2665 CG1 VAL C 62 -14.183 7.763 12.290 1.00 17.19 C
-ATOM 2666 CG2 VAL C 62 -13.252 7.305 14.521 1.00 18.33 C
-ATOM 2667 N ALA C 63 -16.701 9.866 13.495 1.00 13.67 N
-ATOM 2668 CA ALA C 63 -17.818 10.501 12.645 1.00 21.56 C
-ATOM 2669 C ALA C 63 -17.715 11.855 12.728 1.00 19.04 C
-ATOM 2670 O ALA C 63 -17.832 12.775 11.974 1.00 17.01 O
-ATOM 2671 CB ALA C 63 -19.206 9.890 12.827 1.00 17.02 C
-ATOM 2672 N ASP C 64 -17.653 12.417 13.991 1.00 16.51 N
-ATOM 2673 CA ASP C 64 -17.709 13.830 14.243 1.00 19.49 C
-ATOM 2674 C ASP C 64 -16.540 14.535 13.748 1.00 14.91 C
-ATOM 2675 O ASP C 64 -16.584 15.604 13.224 1.00 19.95 O
-ATOM 2676 CB ASP C 64 -17.991 14.096 15.799 1.00 24.76 C
-ATOM 2677 CG ASP C 64 -19.393 13.818 16.643 1.00 34.25 C
-ATOM 2678 OD1 ASP C 64 -20.152 13.414 15.899 1.00 28.85 O
-ATOM 2679 OD2 ASP C 64 -19.056 13.688 17.650 1.00 27.13 O
-ATOM 2680 N ALA C 65 -15.369 13.857 13.860 1.00 16.65 N
-ATOM 2681 CA ALA C 65 -14.163 14.481 13.291 1.00 16.32 C
-ATOM 2682 C ALA C 65 -14.252 14.735 11.694 1.00 13.95 C
-ATOM 2683 O ALA C 65 -13.994 15.689 11.048 1.00 16.33 O
-ATOM 2684 CB ALA C 65 -13.017 13.593 13.359 1.00 16.15 C
-ATOM 2685 N LEU C 66 -15.064 13.712 10.969 1.00 17.13 N
-ATOM 2686 CA LEU C 66 -15.337 13.726 9.525 1.00 13.55 C
-ATOM 2687 C LEU C 66 -16.272 14.810 9.233 1.00 14.32 C
-ATOM 2688 O LEU C 66 -16.159 15.647 8.296 1.00 15.99 O
-ATOM 2689 CB LEU C 66 -15.780 12.400 8.970 1.00 12.37 C
-ATOM 2690 CG LEU C 66 -14.557 11.353 8.900 1.00 14.22 C
-ATOM 2691 CD1 LEU C 66 -15.162 10.177 8.798 1.00 25.53 C
-ATOM 2692 CD2 LEU C 66 -13.636 11.641 7.894 1.00 14.43 C
-ATOM 2693 N THR C 67 -17.292 14.977 10.145 1.00 14.80 N
-ATOM 2694 CA THR C 67 -18.300 16.119 9.983 1.00 15.27 C
-ATOM 2695 C THR C 67 -17.479 17.374 10.100 1.00 19.15 C
-ATOM 2696 O THR C 67 -17.741 18.262 9.274 1.00 21.53 O
-ATOM 2697 CB THR C 67 -19.282 15.886 11.189 1.00 13.22 C
-ATOM 2698 OG1 THR C 67 -20.066 14.785 10.961 1.00 17.30 O
-ATOM 2699 CG2 THR C 67 -20.207 17.226 11.132 1.00 30.44 C
-ATOM 2700 N ASN C 68 -16.541 17.536 11.125 1.00 19.52 N
-ATOM 2701 CA ASN C 68 -15.765 18.613 11.088 1.00 21.49 C
-ATOM 2702 C ASN C 68 -14.901 18.833 9.858 1.00 19.25 C
-ATOM 2703 O ASN C 68 -14.653 20.197 9.353 1.00 22.73 O
-ATOM 2704 CB ASN C 68 -14.964 18.621 12.362 1.00 16.47 C
-ATOM 2705 CG ASN C 68 -13.974 19.880 12.584 1.00 43.34 C
-ATOM 2706 OD1 ASN C 68 -14.128 20.746 12.326 1.00 49.22 O
-ATOM 2707 ND2 ASN C 68 -12.524 19.654 13.058 1.00 50.67 N
-ATOM 2708 N ALA C 69 -14.378 17.793 9.402 1.00 16.22 N
-ATOM 2709 CA ALA C 69 -13.526 17.929 8.006 1.00 15.27 C
-ATOM 2710 C ALA C 69 -14.531 18.551 6.897 1.00 20.32 C
-ATOM 2711 O ALA C 69 -13.858 19.250 6.103 1.00 22.38 O
-ATOM 2712 CB ALA C 69 -12.891 16.615 7.759 1.00 15.52 C
-ATOM 2713 N VAL C 70 -15.649 17.853 6.837 1.00 18.62 N
-ATOM 2714 CA VAL C 70 -16.708 18.432 5.673 1.00 21.72 C
-ATOM 2715 C VAL C 70 -16.947 20.121 6.025 1.00 33.94 C
-ATOM 2716 O VAL C 70 -16.795 20.608 4.872 1.00 26.93 O
-ATOM 2717 CB VAL C 70 -17.884 17.598 5.765 1.00 16.50 C
-ATOM 2718 CG1 VAL C 70 -18.759 18.120 4.709 1.00 19.06 C
-ATOM 2719 CG2 VAL C 70 -17.623 16.139 5.358 1.00 16.14 C
-ATOM 2720 N ALA C 71 -17.135 20.362 6.965 1.00 27.30 N
-ATOM 2721 CA ALA C 71 -17.392 21.922 7.494 1.00 22.92 C
-ATOM 2722 C ALA C 71 -16.435 22.534 6.896 1.00 25.79 C
-ATOM 2723 O ALA C 71 -16.374 23.836 6.718 1.00 24.88 O
-ATOM 2724 CB ALA C 71 -17.865 21.980 8.684 1.00 26.73 C
-ATOM 2725 N HIS C 72 -15.134 22.254 6.980 1.00 25.11 N
-ATOM 2726 CA HIS C 72 -13.948 22.613 6.662 1.00 31.54 C
-ATOM 2727 C HIS C 72 -13.174 22.493 5.762 1.00 23.73 C
-ATOM 2728 O HIS C 72 -11.739 22.306 5.638 1.00 26.60 O
-ATOM 2729 CB HIS C 72 -12.834 22.798 8.133 1.00 34.18 C
-ATOM 2730 CG HIS C 72 -13.458 23.235 9.080 1.00 46.84 C
-ATOM 2731 ND1 HIS C 72 -13.546 24.937 9.646 1.00 41.84 N
-ATOM 2732 CD2 HIS C 72 -14.636 22.949 10.155 1.00 36.64 C
-ATOM 2733 CE1 HIS C 72 -14.088 24.896 10.559 1.00 46.81 C
-ATOM 2734 NE2 HIS C 72 -14.920 23.926 11.193 1.00 49.65 N
-ATOM 2735 N VAL C 73 -13.783 21.917 4.647 1.00 19.28 N
-ATOM 2736 CA VAL C 73 -13.123 21.287 3.673 1.00 19.45 C
-ATOM 2737 C VAL C 73 -11.827 22.122 2.987 1.00 29.84 C
-ATOM 2738 O VAL C 73 -10.987 21.361 2.509 1.00 35.51 O
-ATOM 2739 CB VAL C 73 -14.122 20.427 2.448 1.00 30.11 C
-ATOM 2740 CG1 VAL C 73 -14.780 21.629 2.180 1.00 33.72 C
-ATOM 2741 CG2 VAL C 73 -13.307 19.397 1.916 1.00 28.74 C
-ATOM 2742 N ASP C 74 -12.046 23.454 3.145 1.00 28.51 N
-ATOM 2743 CA ASP C 74 -10.850 24.295 2.500 1.00 28.33 C
-ATOM 2744 C ASP C 74 -9.537 24.483 3.294 1.00 41.00 C
-ATOM 2745 O ASP C 74 -8.999 25.130 2.953 1.00 39.68 O
-ATOM 2746 CB ASP C 74 -11.641 25.551 2.038 1.00 34.16 C
-ATOM 2747 CG ASP C 74 -12.636 25.691 1.138 1.00 52.11 C
-ATOM 2748 OD1 ASP C 74 -12.809 24.845 -0.109 1.00 41.95 O
-ATOM 2749 OD2 ASP C 74 -13.725 26.027 1.050 1.00 57.27 O
-ATOM 2750 N ASP C 75 -9.900 24.071 4.497 1.00 29.36 N
-ATOM 2751 CA ASP C 75 -8.638 24.283 5.628 1.00 35.73 C
-ATOM 2752 C ASP C 75 -9.022 23.128 6.558 1.00 33.10 C
-ATOM 2753 O ASP C 75 -8.649 23.257 7.697 1.00 33.04 O
-ATOM 2754 CB ASP C 75 -9.160 25.604 6.376 1.00 60.97 C
-ATOM 2755 CG ASP C 75 -8.310 26.492 7.214 1.00 66.84 C
-ATOM 2756 OD1 ASP C 75 -7.090 26.471 6.833 1.00 48.92 O
-ATOM 2757 OD2 ASP C 75 -9.269 26.482 8.164 1.00 62.98 O
-ATOM 2758 N MET C 76 -8.644 21.799 5.775 1.00 27.58 N
-ATOM 2759 CA MET C 76 -8.452 20.656 6.738 1.00 27.89 C
-ATOM 2760 C MET C 76 -7.374 20.534 7.506 1.00 27.58 C
-ATOM 2761 O MET C 76 -7.529 20.166 8.646 1.00 20.50 O
-ATOM 2762 CB MET C 76 -8.792 19.438 5.724 1.00 26.12 C
-ATOM 2763 CG MET C 76 -10.257 19.383 5.400 1.00 43.36 C
-ATOM 2764 SD MET C 76 -10.271 17.473 4.652 1.00 37.03 S
-ATOM 2765 CE MET C 76 -9.415 17.721 3.291 1.00 44.39 C
-ATOM 2766 N PRO C 77 -6.212 20.856 6.950 1.00 20.45 N
-ATOM 2767 CA PRO C 77 -5.120 20.876 8.013 1.00 25.45 C
-ATOM 2768 C PRO C 77 -5.008 21.386 9.255 1.00 36.43 C
-ATOM 2769 O PRO C 77 -4.686 20.931 10.357 1.00 30.57 O
-ATOM 2770 CB PRO C 77 -3.910 21.274 7.011 1.00 26.13 C
-ATOM 2771 CG PRO C 77 -4.232 21.298 5.608 1.00 24.41 C
-ATOM 2772 CD PRO C 77 -5.794 21.507 5.765 1.00 18.39 C
-ATOM 2773 N ASN C 78 -5.556 22.597 9.438 1.00 27.78 N
-ATOM 2774 CA ASN C 78 -6.067 23.245 10.604 1.00 53.47 C
-ATOM 2775 C ASN C 78 -6.714 22.831 11.450 1.00 25.06 C
-ATOM 2776 O ASN C 78 -6.836 22.551 12.629 1.00 27.11 O
-ATOM 2777 CB ASN C 78 -5.848 24.913 10.378 1.00 49.62 C
-ATOM 2778 CG ASN C 78 -5.937 25.817 11.891 1.00 27.09 C
-ATOM 2779 OD1 ASN C 78 -5.094 25.489 12.673 1.00 25.78 O
-ATOM 2780 ND2 ASN C 78 -7.164 26.163 12.327 1.00 30.98 N
-ATOM 2781 N ALA C 79 -8.038 22.510 10.822 1.00 21.32 N
-ATOM 2782 CA ALA C 79 -9.063 21.943 11.591 1.00 21.47 C
-ATOM 2783 C ALA C 79 -8.803 20.510 12.317 1.00 24.81 C
-ATOM 2784 O ALA C 79 -9.440 20.242 13.323 1.00 25.13 O
-ATOM 2785 CB ALA C 79 -10.333 21.459 10.764 1.00 25.42 C
-ATOM 2786 N LEU C 80 -8.034 19.757 11.542 1.00 14.71 N
-ATOM 2787 CA LEU C 80 -7.693 18.364 12.080 1.00 14.80 C
-ATOM 2788 C LEU C 80 -6.147 18.320 12.632 1.00 13.69 C
-ATOM 2789 O LEU C 80 -5.765 17.251 13.012 1.00 17.02 O
-ATOM 2790 CB LEU C 80 -7.618 17.425 10.975 1.00 23.31 C
-ATOM 2791 CG LEU C 80 -9.017 17.241 10.096 1.00 28.90 C
-ATOM 2792 CD1 LEU C 80 -8.888 16.179 9.066 1.00 22.59 C
-ATOM 2793 CD2 LEU C 80 -9.912 16.862 11.126 1.00 28.24 C
-ATOM 2794 N SER C 81 -5.642 19.595 13.022 1.00 15.20 N
-ATOM 2795 CA SER C 81 -4.176 19.598 13.532 1.00 16.69 C
-ATOM 2796 C SER C 81 -4.082 18.751 14.821 1.00 15.66 C
-ATOM 2797 O SER C 81 -3.121 18.036 14.913 1.00 18.30 O
-ATOM 2798 CB SER C 81 -4.200 21.212 13.927 1.00 20.04 C
-ATOM 2799 OG SER C 81 -2.662 21.194 13.956 1.00 27.86 O
-ATOM 2800 N ALA C 82 -4.975 18.951 15.740 1.00 16.14 N
-ATOM 2801 CA ALA C 82 -4.666 18.152 16.940 1.00 27.63 C
-ATOM 2802 C ALA C 82 -4.666 16.766 16.844 1.00 26.48 C
-ATOM 2803 O ALA C 82 -4.201 15.804 17.443 1.00 22.53 O
-ATOM 2804 CB ALA C 82 -5.631 18.625 18.033 1.00 26.01 C
-ATOM 2805 N LEU C 83 -5.794 16.171 15.738 1.00 16.69 N
-ATOM 2806 CA LEU C 83 -5.833 14.767 15.713 1.00 11.24 C
-ATOM 2807 C LEU C 83 -4.721 14.342 14.699 1.00 14.18 C
-ATOM 2808 O LEU C 83 -4.218 13.107 15.018 1.00 18.82 O
-ATOM 2809 CB LEU C 83 -7.049 14.621 14.641 1.00 19.57 C
-ATOM 2810 CG LEU C 83 -8.323 14.343 15.598 1.00 31.08 C
-ATOM 2811 CD1 LEU C 83 -9.453 13.945 14.510 1.00 37.56 C
-ATOM 2812 CD2 LEU C 83 -8.174 13.408 16.783 1.00 31.25 C
-ATOM 2813 N SER C 84 -4.154 15.133 13.918 1.00 17.80 N
-ATOM 2814 CA SER C 84 -2.888 14.776 13.267 1.00 16.31 C
-ATOM 2815 C SER C 84 -1.740 14.590 14.181 1.00 16.72 C
-ATOM 2816 O SER C 84 -0.882 13.728 14.196 1.00 20.08 O
-ATOM 2817 CB SER C 84 -1.928 15.701 12.069 1.00 25.74 C
-ATOM 2818 OG SER C 84 -2.988 16.059 11.690 1.00 36.74 O
-ATOM 2819 N ASP C 85 -1.671 15.596 15.245 1.00 14.56 N
-ATOM 2820 CA ASP C 85 -0.682 15.299 16.354 1.00 16.51 C
-ATOM 2821 C ASP C 85 -0.794 14.103 17.109 1.00 12.46 C
-ATOM 2822 O ASP C 85 0.064 13.405 17.411 1.00 15.88 O
-ATOM 2823 CB ASP C 85 -0.758 16.459 17.195 1.00 24.70 C
-ATOM 2824 CG ASP C 85 -0.167 17.721 16.629 1.00 34.11 C
-ATOM 2825 OD1 ASP C 85 0.446 17.900 15.796 1.00 25.15 O
-ATOM 2826 OD2 ASP C 85 -0.625 18.754 17.406 1.00 33.76 O
-ATOM 2827 N LEU C 86 -2.190 13.771 17.337 1.00 12.70 N
-ATOM 2828 CA LEU C 86 -2.467 12.693 18.111 1.00 16.53 C
-ATOM 2829 C LEU C 86 -2.015 11.303 17.695 1.00 14.13 C
-ATOM 2830 O LEU C 86 -1.425 10.432 18.116 1.00 17.79 O
-ATOM 2831 CB LEU C 86 -3.980 12.638 18.447 1.00 18.93 C
-ATOM 2832 CG LEU C 86 -4.506 11.657 19.521 1.00 29.36 C
-ATOM 2833 CD1 LEU C 86 -3.802 11.791 20.879 1.00 25.18 C
-ATOM 2834 CD2 LEU C 86 -5.938 11.585 19.602 1.00 37.62 C
-ATOM 2835 N HIS C 87 -2.350 11.290 16.308 1.00 15.64 N
-ATOM 2836 CA HIS C 87 -2.196 9.988 15.684 1.00 15.27 C
-ATOM 2837 C HIS C 87 -0.432 9.776 15.294 1.00 11.96 C
-ATOM 2838 O HIS C 87 -0.010 8.655 15.509 1.00 15.54 O
-ATOM 2839 CB HIS C 87 -2.877 9.761 14.248 1.00 15.31 C
-ATOM 2840 CG HIS C 87 -4.370 9.569 14.496 1.00 12.16 C
-ATOM 2841 ND1 HIS C 87 -5.204 10.514 14.931 1.00 15.96 N
-ATOM 2842 CD2 HIS C 87 -5.162 8.339 14.571 1.00 14.58 C
-ATOM 2843 CE1 HIS C 87 -6.508 9.921 15.132 1.00 13.46 C
-ATOM 2844 NE2 HIS C 87 -6.403 8.796 14.850 1.00 17.27 N
-ATOM 2845 N ALA C 88 0.106 11.030 15.024 1.00 14.25 N
-ATOM 2846 CA ALA C 88 1.440 11.027 14.747 1.00 15.37 C
-ATOM 2847 C ALA C 88 2.402 10.439 15.994 1.00 19.72 C
-ATOM 2848 O ALA C 88 3.419 9.888 15.742 1.00 18.60 O
-ATOM 2849 CB ALA C 88 2.009 12.263 14.095 1.00 17.41 C
-ATOM 2850 N HIS C 89 2.139 11.270 17.065 1.00 17.52 N
-ATOM 2851 CA HIS C 89 2.856 11.246 18.393 1.00 20.01 C
-ATOM 2852 C HIS C 89 2.445 10.295 19.376 1.00 19.52 C
-ATOM 2853 O HIS C 89 3.400 9.856 20.127 1.00 22.69 O
-ATOM 2854 CB HIS C 89 3.204 12.750 18.766 1.00 26.82 C
-ATOM 2855 CG HIS C 89 3.898 13.462 17.550 1.00 23.76 C
-ATOM 2856 ND1 HIS C 89 5.028 13.110 16.879 1.00 28.14 N
-ATOM 2857 CD2 HIS C 89 3.344 14.574 17.213 1.00 25.55 C
-ATOM 2858 CE1 HIS C 89 4.845 14.030 16.064 1.00 32.36 C
-ATOM 2859 NE2 HIS C 89 4.173 15.010 16.064 1.00 29.26 N
-ATOM 2860 N LYS C 90 1.340 9.800 19.443 1.00 16.72 N
-ATOM 2861 CA LYS C 90 0.718 9.223 20.440 1.00 20.32 C
-ATOM 2862 C LYS C 90 0.299 7.707 20.002 1.00 20.91 C
-ATOM 2863 O LYS C 90 0.862 6.631 20.320 1.00 23.22 O
-ATOM 2864 CB LYS C 90 -0.138 9.844 21.447 1.00 20.81 C
-ATOM 2865 CG LYS C 90 -0.560 8.580 22.285 1.00 29.14 C
-ATOM 2866 CD LYS C 90 -1.751 9.734 23.205 1.00 67.74 C
-ATOM 2867 CE LYS C 90 -1.793 8.441 24.607 1.00 66.29 C
-ATOM 2868 NZ LYS C 90 -1.676 10.047 25.898 1.00 56.99 N
-ATOM 2869 N LEU C 91 -0.852 7.689 19.140 1.00 13.37 N
-ATOM 2870 CA LEU C 91 -1.388 6.384 18.683 1.00 10.47 C
-ATOM 2871 C LEU C 91 -0.395 5.670 17.757 1.00 15.87 C
-ATOM 2872 O LEU C 91 -0.337 4.504 17.810 1.00 17.45 O
-ATOM 2873 CB LEU C 91 -2.734 6.916 18.060 1.00 11.80 C
-ATOM 2874 CG LEU C 91 -3.503 7.677 18.936 1.00 14.59 C
-ATOM 2875 CD1 LEU C 91 -4.817 8.063 18.135 1.00 18.31 C
-ATOM 2876 CD2 LEU C 91 -3.927 6.656 20.006 1.00 19.42 C
-ATOM 2877 N ARG C 92 0.163 6.386 16.757 1.00 17.30 N
-ATOM 2878 CA ARG C 92 1.225 5.888 15.973 1.00 16.69 C
-ATOM 2879 C ARG C 92 0.801 4.590 15.144 1.00 18.80 C
-ATOM 2880 O ARG C 92 1.289 3.690 14.985 1.00 19.26 O
-ATOM 2881 CB ARG C 92 2.462 5.556 16.835 1.00 13.64 C
-ATOM 2882 CG ARG C 92 3.207 6.871 17.042 1.00 14.42 C
-ATOM 2883 CD ARG C 92 4.320 6.680 18.089 1.00 27.16 C
-ATOM 2884 NE ARG C 92 4.955 7.507 17.826 1.00 44.94 N
-ATOM 2885 CZ ARG C 92 5.808 6.749 20.563 1.00 38.22 C
-ATOM 2886 NH1 ARG C 92 4.053 6.376 21.084 1.00 33.94 N
-ATOM 2887 NH2 ARG C 92 6.026 7.349 19.817 1.00 48.21 N
-ATOM 2888 N VAL C 93 -0.511 4.844 14.546 1.00 13.36 N
-ATOM 2889 CA VAL C 93 -1.122 3.790 13.672 1.00 14.31 C
-ATOM 2890 C VAL C 93 -0.425 3.861 12.310 1.00 12.63 C
-ATOM 2891 O VAL C 93 -0.266 4.875 11.618 1.00 14.78 O
-ATOM 2892 CB VAL C 93 -2.622 4.322 13.422 1.00 8.72 C
-ATOM 2893 CG1 VAL C 93 -3.298 3.413 12.409 1.00 14.83 C
-ATOM 2894 CG2 VAL C 93 -3.256 4.402 14.761 1.00 15.34 C
-ATOM 2895 N ASP C 94 -0.069 2.672 11.865 1.00 14.84 N
-ATOM 2896 CA ASP C 94 0.516 2.634 10.645 1.00 17.19 C
-ATOM 2897 C ASP C 94 -0.337 3.187 9.492 1.00 13.94 C
-ATOM 2898 O ASP C 94 -1.496 2.844 9.436 1.00 13.55 O
-ATOM 2899 CB ASP C 94 1.001 1.175 10.166 1.00 19.19 C
-ATOM 2900 CG ASP C 94 2.066 1.114 9.015 1.00 25.98 C
-ATOM 2901 OD1 ASP C 94 3.132 1.101 9.167 1.00 23.44 O
-ATOM 2902 OD2 ASP C 94 1.457 1.246 7.818 1.00 20.10 O
-ATOM 2903 N PRO C 95 0.336 3.997 8.656 1.00 13.43 N
-ATOM 2904 CA PRO C 95 -0.533 4.680 7.482 1.00 16.10 C
-ATOM 2905 C PRO C 95 -1.120 3.788 6.667 1.00 11.12 C
-ATOM 2906 O PRO C 95 -2.331 4.229 6.243 1.00 14.55 O
-ATOM 2907 CB PRO C 95 0.512 5.399 6.750 1.00 19.09 C
-ATOM 2908 CG PRO C 95 1.437 5.610 7.677 1.00 18.28 C
-ATOM 2909 CD PRO C 95 1.704 4.489 8.616 1.00 15.64 C
-ATOM 2910 N VAL C 96 -0.975 2.426 6.418 1.00 15.60 N
-ATOM 2911 CA VAL C 96 -1.688 1.553 5.597 1.00 13.24 C
-ATOM 2912 C VAL C 96 -3.093 1.373 6.108 1.00 11.50 C
-ATOM 2913 O VAL C 96 -4.125 1.168 5.337 1.00 13.19 O
-ATOM 2914 CB VAL C 96 -0.963 0.166 5.595 1.00 20.64 C
-ATOM 2915 CG1 VAL C 96 0.380 0.545 5.130 1.00 37.75 C
-ATOM 2916 CG2 VAL C 96 -0.986 -0.723 6.614 1.00 28.85 C
-ATOM 2917 N ASN C 97 -3.362 1.525 7.446 1.00 9.54 N
-ATOM 2918 CA ASN C 97 -4.626 1.297 7.971 1.00 11.68 C
-ATOM 2919 C ASN C 97 -5.641 2.261 7.562 1.00 9.63 C
-ATOM 2920 O ASN C 97 -6.898 1.950 7.745 1.00 9.95 O
-ATOM 2921 CB ASN C 97 -4.431 1.174 9.336 1.00 13.42 C
-ATOM 2922 CG ASN C 97 -3.599 -0.084 9.836 1.00 14.06 C
-ATOM 2923 OD1 ASN C 97 -3.997 -1.327 9.652 1.00 8.45 O
-ATOM 2924 ND2 ASN C 97 -2.374 0.157 10.197 1.00 18.92 N
-ATOM 2925 N PHE C 98 -5.236 3.438 7.306 1.00 11.20 N
-ATOM 2926 CA PHE C 98 -6.082 4.528 6.931 1.00 10.00 C
-ATOM 2927 C PHE C 98 -6.998 4.116 5.628 1.00 12.29 C
-ATOM 2928 O PHE C 98 -8.203 4.405 5.580 1.00 11.85 O
-ATOM 2929 CB PHE C 98 -5.520 5.917 6.784 1.00 11.84 C
-ATOM 2930 CG PHE C 98 -4.966 6.392 8.161 1.00 10.85 C
-ATOM 2931 CD1 PHE C 98 -5.796 7.234 8.908 1.00 20.50 C
-ATOM 2932 CD2 PHE C 98 -3.900 5.913 8.688 1.00 15.66 C
-ATOM 2933 CE1 PHE C 98 -5.555 7.714 10.141 1.00 25.62 C
-ATOM 2934 CE2 PHE C 98 -3.735 6.528 10.021 1.00 23.17 C
-ATOM 2935 CZ PHE C 98 -4.378 7.442 10.790 1.00 16.17 C
-ATOM 2936 N LYS C 99 -6.268 3.417 4.783 1.00 12.40 N
-ATOM 2937 CA LYS C 99 -6.999 2.958 3.593 1.00 16.89 C
-ATOM 2938 C LYS C 99 -8.208 2.150 3.790 1.00 16.36 C
-ATOM 2939 O LYS C 99 -9.081 1.954 3.131 1.00 12.00 O
-ATOM 2940 CB LYS C 99 -5.965 2.519 2.404 1.00 37.75 C
-ATOM 2941 CG LYS C 99 -5.634 1.867 2.299 1.00 60.42 C
-ATOM 2942 CD LYS C 99 -4.523 1.328 0.960 1.00 80.12 C
-ATOM 2943 CE LYS C 99 -5.145 -0.811 1.345 1.00 54.41 C
-ATOM 2944 NZ LYS C 99 -4.072 -1.896 0.975 1.00 73.17 N
-ATOM 2945 N LEU C 100 -7.771 1.248 4.812 1.00 11.58 N
-ATOM 2946 CA LEU C 100 -8.668 0.083 5.298 1.00 10.08 C
-ATOM 2947 C LEU C 100 -9.923 0.739 5.824 1.00 15.81 C
-ATOM 2948 O LEU C 100 -11.033 0.328 5.495 1.00 12.64 O
-ATOM 2949 CB LEU C 100 -7.919 -0.962 6.095 1.00 11.52 C
-ATOM 2950 CG LEU C 100 -6.700 -1.456 5.659 1.00 12.29 C
-ATOM 2951 CD1 LEU C 100 -6.140 -2.487 6.602 1.00 13.43 C
-ATOM 2952 CD2 LEU C 100 -6.937 -2.037 4.366 1.00 20.82 C
-ATOM 2953 N LEU C 101 -9.764 1.698 6.763 1.00 9.97 N
-ATOM 2954 CA LEU C 101 -10.983 2.177 7.355 1.00 11.48 C
-ATOM 2955 C LEU C 101 -11.756 3.062 6.216 1.00 15.63 C
-ATOM 2956 O LEU C 101 -12.976 2.978 6.299 1.00 14.14 O
-ATOM 2957 CB LEU C 101 -10.599 3.208 8.498 1.00 14.89 C
-ATOM 2958 CG LEU C 101 -11.670 3.902 9.072 1.00 22.22 C
-ATOM 2959 CD1 LEU C 101 -12.818 2.883 9.487 1.00 22.49 C
-ATOM 2960 CD2 LEU C 101 -11.241 4.642 10.285 1.00 23.89 C
-ATOM 2961 N SER C 102 -11.033 3.737 5.313 1.00 13.80 N
-ATOM 2962 CA SER C 102 -11.714 4.605 4.376 1.00 7.27 C
-ATOM 2963 C SER C 102 -12.532 3.565 3.508 1.00 8.13 C
-ATOM 2964 O SER C 102 -13.716 4.048 3.196 1.00 14.48 O
-ATOM 2965 CB SER C 102 -10.627 5.223 3.513 1.00 12.53 C
-ATOM 2966 OG SER C 102 -9.908 6.246 4.205 1.00 16.99 O
-ATOM 2967 N HIS C 103 -12.013 2.448 3.076 1.00 9.47 N
-ATOM 2968 CA HIS C 103 -12.856 1.553 2.231 1.00 7.87 C
-ATOM 2969 C HIS C 103 -13.969 1.179 3.005 1.00 9.96 C
-ATOM 2970 O HIS C 103 -15.145 1.064 2.463 1.00 11.06 O
-ATOM 2971 CB HIS C 103 -12.045 0.334 2.007 1.00 13.28 C
-ATOM 2972 CG HIS C 103 -12.687 -0.723 1.251 1.00 12.69 C
-ATOM 2973 ND1 HIS C 103 -12.940 -2.084 2.021 1.00 13.59 N
-ATOM 2974 CD2 HIS C 103 -13.286 -0.768 0.111 1.00 11.80 C
-ATOM 2975 CE1 HIS C 103 -13.607 -2.702 0.895 1.00 18.03 C
-ATOM 2976 NE2 HIS C 103 -13.846 -2.052 -0.281 1.00 12.75 N
-ATOM 2977 N CYS C 104 -13.956 0.809 4.281 1.00 11.32 N
-ATOM 2978 CA CYS C 104 -15.102 0.402 5.220 1.00 10.36 C
-ATOM 2979 C CYS C 104 -16.128 1.576 5.312 1.00 10.40 C
-ATOM 2980 O CYS C 104 -17.326 1.230 5.408 1.00 13.45 O
-ATOM 2981 CB CYS C 104 -14.679 -0.210 6.511 1.00 10.60 C
-ATOM 2982 SG CYS C 104 -13.758 -1.766 6.256 1.00 14.84 S
-ATOM 2983 N LEU C 105 -15.610 2.759 5.400 1.00 7.19 N
-ATOM 2984 CA LEU C 105 -16.550 3.718 5.401 1.00 7.94 C
-ATOM 2985 C LEU C 105 -17.308 3.811 4.064 1.00 12.20 C
-ATOM 2986 O LEU C 105 -18.557 4.127 4.121 1.00 10.34 O
-ATOM 2987 CB LEU C 105 -15.878 5.040 5.656 1.00 21.49 C
-ATOM 2988 CG LEU C 105 -16.527 6.202 6.207 1.00 44.61 C
-ATOM 2989 CD1 LEU C 105 -16.548 5.934 7.976 1.00 29.90 C
-ATOM 2990 CD2 LEU C 105 -14.638 7.055 6.645 1.00 67.41 C
-ATOM 2991 N LEU C 106 -16.563 3.801 3.055 1.00 12.01 N
-ATOM 2992 CA LEU C 106 -17.399 3.653 1.720 1.00 11.59 C
-ATOM 2993 C LEU C 106 -18.331 2.701 1.716 1.00 13.18 C
-ATOM 2994 O LEU C 106 -19.445 3.007 1.174 1.00 13.67 O
-ATOM 2995 CB LEU C 106 -16.393 3.784 0.463 1.00 15.01 C
-ATOM 2996 CG LEU C 106 -15.665 4.920 0.043 1.00 26.98 C
-ATOM 2997 CD1 LEU C 106 -14.786 4.477 -0.938 1.00 27.15 C
-ATOM 2998 CD2 LEU C 106 -16.427 6.222 -0.197 1.00 28.82 C
-ATOM 2999 N VAL C 107 -18.135 1.497 2.015 1.00 9.69 N
-ATOM 3000 CA VAL C 107 -18.836 0.268 2.127 1.00 13.59 C
-ATOM 3001 C VAL C 107 -20.197 0.605 2.883 1.00 17.84 C
-ATOM 3002 O VAL C 107 -21.451 0.519 2.577 1.00 16.17 O
-ATOM 3003 CB VAL C 107 -18.247 -1.024 2.534 1.00 6.66 C
-ATOM 3004 CG1 VAL C 107 -19.313 -1.975 2.757 1.00 10.41 C
-ATOM 3005 CG2 VAL C 107 -17.243 -1.377 1.493 1.00 9.95 C
-ATOM 3006 N THR C 108 -20.022 1.317 4.069 1.00 12.50 N
-ATOM 3007 CA THR C 108 -21.156 1.586 4.961 1.00 12.00 C
-ATOM 3008 C THR C 108 -22.004 2.672 4.235 1.00 8.53 C
-ATOM 3009 O THR C 108 -23.266 2.600 4.430 1.00 13.95 O
-ATOM 3010 CB THR C 108 -20.489 2.175 6.313 1.00 10.15 C
-ATOM 3011 OG1 THR C 108 -19.618 1.211 6.782 1.00 10.65 O
-ATOM 3012 CG2 THR C 108 -21.574 2.581 7.303 1.00 9.30 C
-ATOM 3013 N LEU C 109 -21.432 3.696 3.675 1.00 9.01 N
-ATOM 3014 CA LEU C 109 -22.256 4.765 2.941 1.00 9.31 C
-ATOM 3015 C LEU C 109 -23.120 4.001 2.078 1.00 15.85 C
-ATOM 3016 O LEU C 109 -24.157 4.405 1.752 1.00 14.26 O
-ATOM 3017 CB LEU C 109 -21.296 5.848 2.566 1.00 11.02 C
-ATOM 3018 CG LEU C 109 -20.716 6.843 3.619 1.00 19.91 C
-ATOM 3019 CD1 LEU C 109 -19.558 7.677 2.954 1.00 29.96 C
-ATOM 3020 CD2 LEU C 109 -21.630 7.225 4.484 1.00 27.29 C
-ATOM 3021 N ALA C 110 -22.355 3.185 1.097 1.00 14.51 N
-ATOM 3022 CA ALA C 110 -22.975 2.438 -0.100 1.00 13.69 C
-ATOM 3023 C ALA C 110 -24.179 1.916 0.467 1.00 24.66 C
-ATOM 3024 O ALA C 110 -25.339 1.691 -0.205 1.00 18.31 O
-ATOM 3025 CB ALA C 110 -21.958 1.541 -0.721 1.00 13.14 C
-ATOM 3026 N ALA C 111 -24.108 1.069 1.636 1.00 17.30 N
-ATOM 3027 CA ALA C 111 -25.131 0.205 2.227 1.00 14.98 C
-ATOM 3028 C ALA C 111 -26.406 1.141 2.649 1.00 17.59 C
-ATOM 3029 O ALA C 111 -27.374 0.392 2.964 1.00 18.70 O
-ATOM 3030 CB ALA C 111 -24.528 -0.603 3.334 1.00 14.01 C
-ATOM 3031 N HIS C 112 -26.145 2.311 3.092 1.00 17.57 N
-ATOM 3032 CA HIS C 112 -27.157 3.218 3.684 1.00 17.81 C
-ATOM 3033 C HIS C 112 -27.592 4.143 2.662 1.00 23.35 C
-ATOM 3034 O HIS C 112 -28.643 4.846 3.027 1.00 25.70 O
-ATOM 3035 CB HIS C 112 -26.632 3.907 4.985 1.00 19.09 C
-ATOM 3036 CG HIS C 112 -26.731 2.953 5.878 1.00 25.33 C
-ATOM 3037 ND1 HIS C 112 -25.315 2.095 6.535 1.00 35.05 N
-ATOM 3038 CD2 HIS C 112 -27.507 2.446 6.914 1.00 26.57 C
-ATOM 3039 CE1 HIS C 112 -25.696 1.397 7.484 1.00 18.65 C
-ATOM 3040 NE2 HIS C 112 -27.041 1.550 7.786 1.00 32.92 N
-ATOM 3041 N LEU C 113 -27.112 4.669 1.736 1.00 23.20 N
-ATOM 3042 CA LEU C 113 -27.336 5.646 0.694 1.00 19.73 C
-ATOM 3043 C LEU C 113 -27.527 4.917 -0.780 1.00 24.44 C
-ATOM 3044 O LEU C 113 -26.931 5.709 -1.436 1.00 27.49 O
-ATOM 3045 CB LEU C 113 -26.346 6.534 0.722 1.00 30.36 C
-ATOM 3046 CG LEU C 113 -26.291 7.305 1.871 1.00 29.78 C
-ATOM 3047 CD1 LEU C 113 -24.949 8.197 1.187 1.00 35.69 C
-ATOM 3048 CD2 LEU C 113 -27.165 7.743 2.593 1.00 47.79 C
-ATOM 3049 N PRO C 114 -28.533 4.269 -1.071 1.00 23.63 N
-ATOM 3050 CA PRO C 114 -28.972 3.222 -2.364 1.00 26.62 C
-ATOM 3051 C PRO C 114 -29.185 4.694 -3.555 1.00 35.32 C
-ATOM 3052 O PRO C 114 -28.033 5.030 -4.238 1.00 38.93 O
-ATOM 3053 CB PRO C 114 -29.692 2.344 -1.692 1.00 32.82 C
-ATOM 3054 CG PRO C 114 -30.705 3.466 -1.031 1.00 48.45 C
-ATOM 3055 CD PRO C 114 -29.572 3.964 0.093 1.00 44.41 C
-ATOM 3056 N ALA C 115 -29.614 5.816 -3.110 1.00 34.13 N
-ATOM 3057 CA ALA C 115 -29.733 6.788 -3.943 1.00 25.13 C
-ATOM 3058 C ALA C 115 -28.814 7.547 -4.176 1.00 23.70 C
-ATOM 3059 O ALA C 115 -28.484 8.189 -5.293 1.00 28.59 O
-ATOM 3060 CB ALA C 115 -31.178 7.688 -4.040 1.00 49.66 C
-ATOM 3061 N GLU C 116 -27.955 7.979 -3.256 1.00 19.87 N
-ATOM 3062 CA GLU C 116 -26.996 9.192 -3.337 1.00 15.46 C
-ATOM 3063 C GLU C 116 -25.546 8.615 -3.591 1.00 17.63 C
-ATOM 3064 O GLU C 116 -24.903 9.456 -4.305 1.00 21.65 O
-ATOM 3065 CB GLU C 116 -26.603 9.453 -1.769 1.00 24.21 C
-ATOM 3066 CG GLU C 116 -28.465 8.862 -0.493 1.00 64.07 C
-ATOM 3067 CD GLU C 116 -28.940 10.160 -0.964 1.00 64.09 C
-ATOM 3068 OE1 GLU C 116 -28.783 10.922 -1.780 1.00 59.54 O
-ATOM 3069 OE2 GLU C 116 -30.228 9.634 -0.550 1.00 58.51 O
-ATOM 3070 N PHE C 117 -25.343 7.424 -3.452 1.00 18.06 N
-ATOM 3071 CA PHE C 117 -24.055 6.750 -3.919 1.00 15.96 C
-ATOM 3072 C PHE C 117 -23.837 6.451 -5.366 1.00 17.62 C
-ATOM 3073 O PHE C 117 -23.697 5.333 -5.682 1.00 20.40 O
-ATOM 3074 CB PHE C 117 -23.795 5.597 -3.019 1.00 11.69 C
-ATOM 3075 CG PHE C 117 -22.482 5.073 -2.755 1.00 15.94 C
-ATOM 3076 CD1 PHE C 117 -21.516 5.939 -2.024 1.00 20.23 C
-ATOM 3077 CD2 PHE C 117 -21.879 3.939 -3.352 1.00 18.29 C
-ATOM 3078 CE1 PHE C 117 -20.010 5.429 -1.856 1.00 21.74 C
-ATOM 3079 CE2 PHE C 117 -20.499 3.543 -3.388 1.00 15.69 C
-ATOM 3080 CZ PHE C 117 -19.734 4.357 -2.542 1.00 19.08 C
-ATOM 3081 N THR C 118 -23.888 7.554 -6.187 1.00 16.36 N
-ATOM 3082 CA THR C 118 -23.750 7.200 -7.579 1.00 24.73 C
-ATOM 3083 C THR C 118 -22.162 7.085 -7.979 1.00 20.24 C
-ATOM 3084 O THR C 118 -21.404 7.258 -6.938 1.00 17.57 O
-ATOM 3085 CB THR C 118 -23.989 8.809 -8.229 1.00 24.50 C
-ATOM 3086 OG1 THR C 118 -25.423 9.053 -8.024 1.00 43.24 O
-ATOM 3087 CG2 THR C 118 -23.399 9.727 -8.021 1.00 20.86 C
-ATOM 3088 N PRO C 119 -21.965 6.771 -8.980 1.00 16.01 N
-ATOM 3089 CA PRO C 119 -20.523 6.700 -9.434 1.00 19.05 C
-ATOM 3090 C PRO C 119 -19.780 7.932 -9.012 1.00 19.72 C
-ATOM 3091 O PRO C 119 -18.600 7.893 -8.606 1.00 14.74 O
-ATOM 3092 CB PRO C 119 -20.464 6.235 -10.815 1.00 21.12 C
-ATOM 3093 CG PRO C 119 -21.872 5.425 -11.078 1.00 19.58 C
-ATOM 3094 CD PRO C 119 -22.940 6.131 -10.122 1.00 19.86 C
-ATOM 3095 N ALA C 120 -20.252 9.094 -9.502 1.00 19.86 N
-ATOM 3096 CA ALA C 120 -19.548 10.276 -9.334 1.00 18.74 C
-ATOM 3097 C ALA C 120 -19.388 10.637 -7.832 1.00 10.87 C
-ATOM 3098 O ALA C 120 -18.248 11.251 -7.450 1.00 14.38 O
-ATOM 3099 CB ALA C 120 -20.260 11.491 -9.979 1.00 23.51 C
-ATOM 3100 N VAL C 121 -20.385 10.350 -7.040 1.00 15.38 N
-ATOM 3101 CA VAL C 121 -20.425 10.526 -5.562 1.00 17.86 C
-ATOM 3102 C VAL C 121 -19.282 9.640 -4.960 1.00 13.56 C
-ATOM 3103 O VAL C 121 -18.551 10.181 -4.182 1.00 14.98 O
-ATOM 3104 CB VAL C 121 -21.712 10.598 -4.961 1.00 16.82 C
-ATOM 3105 CG1 VAL C 121 -21.586 10.574 -3.474 1.00 15.23 C
-ATOM 3106 CG2 VAL C 121 -22.399 11.837 -5.508 1.00 18.21 C
-ATOM 3107 N HIS C 122 -19.274 8.429 -5.423 1.00 13.62 N
-ATOM 3108 CA HIS C 122 -18.258 7.352 -4.974 1.00 13.41 C
-ATOM 3109 C HIS C 122 -16.927 7.953 -5.183 1.00 19.70 C
-ATOM 3110 O HIS C 122 -16.069 7.929 -4.270 1.00 15.94 O
-ATOM 3111 CB HIS C 122 -18.661 6.175 -5.608 1.00 13.44 C
-ATOM 3112 CG HIS C 122 -17.896 4.996 -5.506 1.00 11.42 C
-ATOM 3113 ND1 HIS C 122 -18.152 3.694 -5.975 1.00 16.43 N
-ATOM 3114 CD2 HIS C 122 -16.677 4.952 -4.678 1.00 17.04 C
-ATOM 3115 CE1 HIS C 122 -17.175 2.906 -5.621 1.00 20.17 C
-ATOM 3116 NE2 HIS C 122 -16.333 3.490 -4.734 1.00 16.87 N
-ATOM 3117 N ALA C 123 -16.663 8.527 -6.359 1.00 13.94 N
-ATOM 3118 CA ALA C 123 -15.263 8.979 -6.644 1.00 17.63 C
-ATOM 3119 C ALA C 123 -14.878 10.124 -5.801 1.00 15.63 C
-ATOM 3120 O ALA C 123 -13.855 10.169 -5.195 1.00 16.32 O
-ATOM 3121 CB ALA C 123 -15.304 9.355 -8.200 1.00 21.15 C
-ATOM 3122 N SER C 124 -15.845 11.044 -5.588 1.00 11.75 N
-ATOM 3123 CA SER C 124 -15.443 12.245 -4.719 1.00 15.01 C
-ATOM 3124 C SER C 124 -15.332 11.744 -3.177 1.00 15.67 C
-ATOM 3125 O SER C 124 -14.471 12.374 -2.655 1.00 13.45 O
-ATOM 3126 CB SER C 124 -16.754 13.206 -4.754 1.00 14.78 C
-ATOM 3127 OG SER C 124 -17.033 13.770 -6.107 1.00 17.64 O
-ATOM 3128 N LEU C 125 -16.158 10.923 -2.823 1.00 10.43 N
-ATOM 3129 CA LEU C 125 -15.983 10.431 -1.427 1.00 12.66 C
-ATOM 3130 C LEU C 125 -14.705 9.708 -1.135 1.00 12.01 C
-ATOM 3131 O LEU C 125 -13.873 9.973 -0.196 1.00 10.58 O
-ATOM 3132 CB LEU C 125 -17.093 9.515 -1.060 1.00 10.32 C
-ATOM 3133 CG LEU C 125 -18.393 10.264 -0.600 1.00 16.01 C
-ATOM 3134 CD1 LEU C 125 -19.493 9.231 -0.642 1.00 21.31 C
-ATOM 3135 CD2 LEU C 125 -18.244 11.194 0.645 1.00 19.17 C
-ATOM 3136 N ASP C 126 -14.179 8.973 -2.132 1.00 15.23 N
-ATOM 3137 CA ASP C 126 -12.896 8.220 -2.060 1.00 15.01 C
-ATOM 3138 C ASP C 126 -11.877 9.262 -2.029 1.00 17.34 C
-ATOM 3139 O ASP C 126 -10.873 9.161 -1.311 1.00 17.16 O
-ATOM 3140 CB ASP C 126 -12.829 7.258 -3.164 1.00 14.23 C
-ATOM 3141 CG ASP C 126 -11.630 6.072 -2.962 1.00 15.33 C
-ATOM 3142 OD1 ASP C 126 -11.594 5.816 -1.849 1.00 21.18 O
-ATOM 3143 OD2 ASP C 126 -10.723 6.195 -3.670 1.00 18.49 O
-ATOM 3144 N LYS C 127 -11.889 10.369 -2.865 1.00 10.51 N
-ATOM 3145 CA LYS C 127 -10.843 11.346 -2.937 1.00 9.26 C
-ATOM 3146 C LYS C 127 -10.985 12.090 -1.550 1.00 10.60 C
-ATOM 3147 O LYS C 127 -9.736 12.501 -1.011 1.00 13.38 O
-ATOM 3148 CB LYS C 127 -11.128 12.473 -4.012 1.00 12.57 C
-ATOM 3149 CG LYS C 127 -10.837 11.844 -5.259 1.00 21.03 C
-ATOM 3150 CD LYS C 127 -11.084 12.905 -6.433 1.00 27.03 C
-ATOM 3151 CE LYS C 127 -10.200 14.180 -6.287 1.00 36.89 C
-ATOM 3152 NZ LYS C 127 -10.401 15.128 -7.495 1.00 25.75 N
-ATOM 3153 N PHE C 128 -12.089 12.351 -1.096 1.00 12.44 N
-ATOM 3154 CA PHE C 128 -12.150 13.112 0.060 1.00 14.73 C
-ATOM 3155 C PHE C 128 -11.573 12.159 1.379 1.00 19.70 C
-ATOM 3156 O PHE C 128 -10.742 12.890 2.141 1.00 15.58 O
-ATOM 3157 CB PHE C 128 -13.559 13.504 0.502 1.00 11.17 C
-ATOM 3158 CG PHE C 128 -13.873 13.981 2.080 1.00 11.86 C
-ATOM 3159 CD1 PHE C 128 -13.416 15.303 2.300 1.00 15.77 C
-ATOM 3160 CD2 PHE C 128 -14.468 13.060 2.611 1.00 23.89 C
-ATOM 3161 CE1 PHE C 128 -13.803 15.496 3.630 1.00 14.00 C
-ATOM 3162 CE2 PHE C 128 -14.618 13.544 4.103 1.00 26.48 C
-ATOM 3163 CZ PHE C 128 -14.347 14.715 4.443 1.00 15.47 C
-ATOM 3164 N LEU C 129 -11.958 10.929 1.410 1.00 14.00 N
-ATOM 3165 CA LEU C 129 -11.373 10.116 2.580 1.00 13.04 C
-ATOM 3166 C LEU C 129 -9.834 9.957 2.377 1.00 17.30 C
-ATOM 3167 O LEU C 129 -8.955 10.001 3.360 1.00 14.75 O
-ATOM 3168 CB LEU C 129 -11.850 8.796 2.608 1.00 12.12 C
-ATOM 3169 CG LEU C 129 -13.240 8.898 3.000 1.00 20.92 C
-ATOM 3170 CD1 LEU C 129 -14.044 7.674 2.880 1.00 26.64 C
-ATOM 3171 CD2 LEU C 129 -13.522 9.300 4.355 1.00 35.02 C
-ATOM 3172 N ALA C 130 -9.238 9.941 1.192 1.00 16.20 N
-ATOM 3173 CA ALA C 130 -7.860 10.006 0.893 1.00 14.56 C
-ATOM 3174 C ALA C 130 -7.216 11.214 1.438 1.00 19.27 C
-ATOM 3175 O ALA C 130 -5.982 11.322 1.999 1.00 14.14 O
-ATOM 3176 CB ALA C 130 -7.442 9.870 -0.423 1.00 17.10 C
-ATOM 3177 N SER C 131 -7.839 12.284 1.109 1.00 18.74 N
-ATOM 3178 CA SER C 131 -7.158 13.685 1.577 1.00 19.45 C
-ATOM 3179 C SER C 131 -7.424 13.831 3.307 1.00 14.53 C
-ATOM 3180 O SER C 131 -6.317 14.261 3.681 1.00 12.58 O
-ATOM 3181 CB SER C 131 -8.220 14.954 1.086 1.00 22.90 C
-ATOM 3182 OG SER C 131 -8.002 14.782 -0.395 1.00 37.64 O
-ATOM 3183 N VAL C 132 -8.436 13.257 3.800 1.00 12.03 N
-ATOM 3184 CA VAL C 132 -8.508 13.199 5.238 1.00 13.41 C
-ATOM 3185 C VAL C 132 -7.272 12.425 5.809 1.00 19.42 C
-ATOM 3186 O VAL C 132 -6.491 12.809 6.794 1.00 14.00 O
-ATOM 3187 CB VAL C 132 -9.726 12.697 5.713 1.00 15.91 C
-ATOM 3188 CG1 VAL C 132 -9.619 12.379 7.255 1.00 17.14 C
-ATOM 3189 CG2 VAL C 132 -11.022 13.817 5.553 1.00 19.41 C
-ATOM 3190 N SER C 133 -7.133 11.157 5.180 1.00 14.01 N
-ATOM 3191 CA SER C 133 -6.066 10.266 5.421 1.00 13.12 C
-ATOM 3192 C SER C 133 -4.733 10.965 5.281 1.00 21.83 C
-ATOM 3193 O SER C 133 -3.772 10.686 6.325 1.00 18.12 O
-ATOM 3194 CB SER C 133 -5.938 8.996 4.603 1.00 13.61 C
-ATOM 3195 OG SER C 133 -7.161 8.346 5.111 1.00 18.98 O
-ATOM 3196 N THR C 134 -4.427 11.617 4.350 1.00 17.53 N
-ATOM 3197 CA THR C 134 -3.144 12.409 4.136 1.00 15.95 C
-ATOM 3198 C THR C 134 -2.914 13.473 5.177 1.00 16.97 C
-ATOM 3199 O THR C 134 -1.750 13.477 5.831 1.00 20.39 O
-ATOM 3200 CB THR C 134 -3.269 13.086 2.683 1.00 18.28 C
-ATOM 3201 OG1 THR C 134 -3.148 12.134 1.784 1.00 22.72 O
-ATOM 3202 CG2 THR C 134 -2.059 13.978 2.401 1.00 22.70 C
-ATOM 3203 N VAL C 135 -3.965 14.094 5.504 1.00 15.13 N
-ATOM 3204 CA VAL C 135 -3.754 15.191 6.579 1.00 16.51 C
-ATOM 3205 C VAL C 135 -3.260 14.323 7.873 1.00 16.40 C
-ATOM 3206 O VAL C 135 -2.487 14.902 8.617 1.00 15.94 O
-ATOM 3207 CB VAL C 135 -5.059 16.100 6.780 1.00 18.21 C
-ATOM 3208 CG1 VAL C 135 -5.021 16.981 8.022 1.00 17.40 C
-ATOM 3209 CG2 VAL C 135 -5.230 16.888 5.569 1.00 19.71 C
-ATOM 3210 N LEU C 136 -4.222 13.312 8.307 1.00 12.10 N
-ATOM 3211 CA LEU C 136 -4.023 12.675 9.630 1.00 15.98 C
-ATOM 3212 C LEU C 136 -2.564 12.099 9.666 1.00 16.04 C
-ATOM 3213 O LEU C 136 -2.112 11.725 10.867 1.00 16.42 O
-ATOM 3214 CB LEU C 136 -5.060 11.690 9.725 1.00 16.86 C
-ATOM 3215 CG LEU C 136 -6.464 12.340 9.949 1.00 24.99 C
-ATOM 3216 CD1 LEU C 136 -7.273 11.133 10.442 1.00 18.69 C
-ATOM 3217 CD2 LEU C 136 -6.479 13.221 11.104 1.00 43.05 C
-ATOM 3218 N THR C 137 -1.948 11.875 8.493 1.00 14.30 N
-ATOM 3219 CA THR C 137 -0.644 11.078 8.570 1.00 16.72 C
-ATOM 3220 C THR C 137 0.600 12.250 8.229 1.00 20.27 C
-ATOM 3221 O THR C 137 1.641 11.779 8.219 1.00 19.99 O
-ATOM 3222 CB THR C 137 -0.616 9.898 7.452 1.00 21.82 C
-ATOM 3223 OG1 THR C 137 -0.747 10.397 6.348 1.00 20.00 O
-ATOM 3224 CG2 THR C 137 -1.429 8.802 8.131 1.00 20.00 C
-ATOM 3225 N SER C 138 0.217 13.432 7.965 1.00 21.45 N
-ATOM 3226 CA SER C 138 1.195 14.450 7.576 1.00 24.00 C
-ATOM 3227 C SER C 138 2.427 14.664 8.641 1.00 26.98 C
-ATOM 3228 O SER C 138 3.195 15.345 8.032 1.00 21.99 O
-ATOM 3229 CB SER C 138 0.001 16.139 8.122 1.00 21.69 C
-ATOM 3230 OG SER C 138 0.377 15.823 6.927 1.00 42.20 O
-ATOM 3231 N LYS C 139 2.133 14.403 9.912 1.00 22.73 N
-ATOM 3232 CA LYS C 139 3.191 14.934 10.883 1.00 27.59 C
-ATOM 3233 C LYS C 139 3.975 13.581 11.372 1.00 19.22 C
-ATOM 3234 O LYS C 139 4.646 13.643 12.389 1.00 14.35 O
-ATOM 3235 CB LYS C 139 2.358 15.487 11.974 1.00 19.55 C
-ATOM 3236 CG LYS C 139 2.071 17.001 11.340 1.00 22.79 C
-ATOM 3237 CD LYS C 139 1.307 17.445 12.283 1.00 42.21 C
-ATOM 3238 CE LYS C 139 1.086 19.324 11.798 1.00 36.26 C
-ATOM 3239 NZ LYS C 139 -0.244 18.940 13.010 1.00 30.87 N
-ATOM 3240 N TYR C 140 3.750 12.465 10.738 1.00 18.17 N
-ATOM 3241 CA TYR C 140 4.409 11.291 11.242 1.00 17.49 C
-ATOM 3242 C TYR C 140 5.879 11.300 11.241 1.00 19.10 C
-ATOM 3243 O TYR C 140 6.366 10.507 12.197 1.00 22.35 O
-ATOM 3244 CB TYR C 140 3.865 10.055 10.357 1.00 16.87 C
-ATOM 3245 CG TYR C 140 2.674 9.300 10.891 1.00 12.61 C
-ATOM 3246 CD1 TYR C 140 2.521 8.093 11.003 1.00 19.13 C
-ATOM 3247 CD2 TYR C 140 1.410 10.025 11.225 1.00 16.63 C
-ATOM 3248 CE1 TYR C 140 1.365 7.496 11.459 1.00 21.26 C
-ATOM 3249 CE2 TYR C 140 0.269 9.420 11.748 1.00 17.45 C
-ATOM 3250 CZ TYR C 140 0.153 8.203 11.775 1.00 14.84 C
-ATOM 3251 OH TYR C 140 -0.838 7.429 12.277 1.00 15.53 O
-ATOM 3252 N ARG C 141 6.450 11.994 10.246 1.00 20.34 N
-ATOM 3253 CA ARG C 141 7.886 11.986 10.168 1.00 25.59 C
-ATOM 3254 C ARG C 141 8.484 13.451 9.626 1.00 21.46 C
-ATOM 3255 O ARG C 141 7.587 13.891 9.012 1.00 24.60 O
-ATOM 3256 CB ARG C 141 8.511 10.698 9.627 1.00 27.67 C
-ATOM 3257 CG ARG C 141 8.124 10.586 8.132 1.00 20.44 C
-ATOM 3258 CD ARG C 141 8.972 9.192 7.851 1.00 27.35 C
-ATOM 3259 NE ARG C 141 8.521 8.970 6.409 1.00 21.57 N
-ATOM 3260 CZ ARG C 141 9.349 8.234 5.557 1.00 17.72 C
-ATOM 3261 NH1 ARG C 141 10.182 7.400 5.980 1.00 16.11 N
-ATOM 3262 NH2 ARG C 141 8.583 8.168 4.338 1.00 19.55 N
-ATOM 3263 OXT ARG C 141 9.695 13.488 9.645 1.00 22.97 O
-TER 3264 ARG C 141
-ATOM 3265 N VAL D 1 -8.916 -20.986 -1.208 1.00 44.53 N
-ATOM 3266 CA VAL D 1 -8.728 -19.973 0.230 1.00 40.54 C
-ATOM 3267 C VAL D 1 -9.597 -21.119 1.649 1.00 54.57 C
-ATOM 3268 O VAL D 1 -10.511 -21.747 0.927 1.00 46.03 O
-ATOM 3269 CB VAL D 1 -9.741 -18.620 0.365 1.00 59.62 C
-ATOM 3270 CG1 VAL D 1 -8.976 -17.356 -0.533 1.00 56.25 C
-ATOM 3271 CG2 VAL D 1 -10.766 -18.689 -0.199 1.00 44.49 C
-ATOM 3272 N HIS D 2 -9.359 -20.204 2.359 1.00 54.55 N
-ATOM 3273 CA HIS D 2 -10.028 -20.478 3.617 1.00 76.16 C
-ATOM 3274 C HIS D 2 -11.503 -19.997 4.189 1.00 40.79 C
-ATOM 3275 O HIS D 2 -10.949 -18.900 5.117 1.00 42.23 O
-ATOM 3276 CB HIS D 2 -8.550 -21.746 4.671 1.00 61.25 C
-ATOM 3277 CG HIS D 2 -9.111 -22.384 5.289 1.00 73.35 C
-ATOM 3278 ND1 HIS D 2 -9.292 -20.744 7.139 1.00 63.32 N
-ATOM 3279 CD2 HIS D 2 -10.298 -23.586 6.052 1.00 68.03 C
-ATOM 3280 CE1 HIS D 2 -10.663 -21.227 8.362 1.00 55.48 C
-ATOM 3281 NE2 HIS D 2 -10.906 -22.743 7.235 1.00 54.14 N
-ATOM 3282 N LEU D 3 -12.538 -20.903 4.013 1.00 31.51 N
-ATOM 3283 CA LEU D 3 -13.638 -20.047 4.223 1.00 32.74 C
-ATOM 3284 C LEU D 3 -13.624 -20.741 5.723 1.00 43.55 C
-ATOM 3285 O LEU D 3 -14.592 -22.168 5.344 1.00 38.09 O
-ATOM 3286 CB LEU D 3 -14.958 -19.886 3.451 1.00 39.97 C
-ATOM 3287 CG LEU D 3 -14.306 -18.748 2.457 1.00 33.25 C
-ATOM 3288 CD1 LEU D 3 -15.545 -18.399 1.653 1.00 35.36 C
-ATOM 3289 CD2 LEU D 3 -14.311 -17.477 2.906 1.00 43.98 C
-ATOM 3290 N THR D 4 -14.873 -20.575 6.573 1.00 40.52 N
-ATOM 3291 CA THR D 4 -15.571 -21.118 7.446 1.00 35.01 C
-ATOM 3292 C THR D 4 -16.965 -21.835 7.057 1.00 36.50 C
-ATOM 3293 O THR D 4 -17.217 -21.032 5.924 1.00 26.93 O
-ATOM 3294 CB THR D 4 -15.866 -20.187 8.979 1.00 42.32 C
-ATOM 3295 OG1 THR D 4 -16.874 -19.360 8.569 1.00 35.61 O
-ATOM 3296 CG2 THR D 4 -14.805 -19.826 9.491 1.00 41.74 C
-ATOM 3297 N PRO D 5 -17.421 -22.638 7.348 1.00 38.01 N
-ATOM 3298 CA PRO D 5 -18.819 -22.801 6.165 1.00 45.26 C
-ATOM 3299 C PRO D 5 -19.967 -21.905 6.477 1.00 40.88 C
-ATOM 3300 O PRO D 5 -20.833 -21.591 5.783 1.00 35.71 O
-ATOM 3301 CB PRO D 5 -19.489 -24.074 7.971 1.00 80.12 C
-ATOM 3302 CG PRO D 5 -18.622 -24.429 8.450 1.00 36.53 C
-ATOM 3303 CD PRO D 5 -17.099 -23.867 8.283 1.00 38.83 C
-ATOM 3304 N GLU D 6 -19.807 -20.993 7.524 1.00 38.95 N
-ATOM 3305 CA GLU D 6 -20.826 -20.251 7.892 1.00 54.36 C
-ATOM 3306 C GLU D 6 -20.257 -18.491 6.516 1.00 29.53 C
-ATOM 3307 O GLU D 6 -21.186 -18.231 6.189 1.00 34.33 O
-ATOM 3308 CB GLU D 6 -20.808 -19.128 9.200 1.00 67.37 C
-ATOM 3309 CG GLU D 6 -20.143 -19.295 9.841 1.00 68.32 C
-ATOM 3310 CD GLU D 6 -19.833 -20.908 10.929 1.00 80.07 C
-ATOM 3311 OE1 GLU D 6 -19.263 -21.552 10.554 1.00 62.33 O
-ATOM 3312 OE2 GLU D 6 -17.422 -20.947 9.979 1.00 75.27 O
-ATOM 3313 N GLU D 7 -19.046 -18.647 6.494 1.00 32.30 N
-ATOM 3314 CA GLU D 7 -18.571 -17.615 5.450 1.00 26.92 C
-ATOM 3315 C GLU D 7 -19.016 -18.399 3.955 1.00 36.61 C
-ATOM 3316 O GLU D 7 -19.572 -17.530 3.297 1.00 31.61 O
-ATOM 3317 CB GLU D 7 -17.035 -17.606 5.380 1.00 22.74 C
-ATOM 3318 CG GLU D 7 -16.644 -16.558 6.886 1.00 25.68 C
-ATOM 3319 CD GLU D 7 -15.325 -16.832 6.956 1.00 21.07 C
-ATOM 3320 OE1 GLU D 7 -14.977 -15.445 7.269 1.00 41.17 O
-ATOM 3321 OE2 GLU D 7 -14.302 -17.526 6.337 1.00 26.19 O
-ATOM 3322 N LYS D 8 -18.754 -19.547 3.890 1.00 24.35 N
-ATOM 3323 CA LYS D 8 -19.098 -20.158 2.364 1.00 27.18 C
-ATOM 3324 C LYS D 8 -20.384 -20.203 2.052 1.00 23.43 C
-ATOM 3325 O LYS D 8 -21.074 -19.662 1.178 1.00 23.08 O
-ATOM 3326 CB LYS D 8 -18.527 -21.857 2.829 1.00 28.41 C
-ATOM 3327 CG LYS D 8 -18.698 -21.991 1.053 1.00 48.31 C
-ATOM 3328 CD LYS D 8 -18.147 -23.072 0.880 1.00 69.34 C
-ATOM 3329 CE LYS D 8 -18.957 -23.705 -0.872 1.00 38.29 C
-ATOM 3330 NZ LYS D 8 -17.931 -25.269 -1.374 1.00 72.55 N
-ATOM 3331 N SER D 9 -21.307 -20.301 3.110 1.00 21.45 N
-ATOM 3332 CA SER D 9 -22.632 -20.010 2.800 1.00 23.49 C
-ATOM 3333 C SER D 9 -23.050 -18.608 2.651 1.00 32.73 C
-ATOM 3334 O SER D 9 -24.111 -18.558 1.973 1.00 27.24 O
-ATOM 3335 CB SER D 9 -23.425 -20.879 3.815 1.00 48.80 C
-ATOM 3336 OG SER D 9 -24.248 -20.636 4.597 1.00 54.12 O
-ATOM 3337 N ALA D 10 -22.340 -17.847 3.521 1.00 26.97 N
-ATOM 3338 CA ALA D 10 -23.067 -16.421 3.397 1.00 27.01 C
-ATOM 3339 C ALA D 10 -22.551 -15.974 1.781 1.00 23.29 C
-ATOM 3340 O ALA D 10 -23.475 -15.280 1.185 1.00 20.87 O
-ATOM 3341 CB ALA D 10 -22.056 -15.660 3.934 1.00 28.42 C
-ATOM 3342 N VAL D 11 -21.472 -16.449 1.276 1.00 31.33 N
-ATOM 3343 CA VAL D 11 -21.016 -15.993 -0.163 1.00 25.10 C
-ATOM 3344 C VAL D 11 -21.923 -16.557 -1.184 1.00 18.64 C
-ATOM 3345 O VAL D 11 -22.347 -15.774 -1.949 1.00 19.73 O
-ATOM 3346 CB VAL D 11 -19.580 -16.599 -0.312 1.00 18.52 C
-ATOM 3347 CG1 VAL D 11 -19.332 -16.430 -1.555 1.00 28.45 C
-ATOM 3348 CG2 VAL D 11 -18.563 -15.544 0.540 1.00 21.05 C
-ATOM 3349 N THR D 12 -22.095 -17.881 -0.865 1.00 19.99 N
-ATOM 3350 CA THR D 12 -23.012 -18.659 -2.043 1.00 26.25 C
-ATOM 3351 C THR D 12 -24.298 -18.196 -1.973 1.00 24.29 C
-ATOM 3352 O THR D 12 -25.087 -17.804 -3.054 1.00 26.52 O
-ATOM 3353 CB THR D 12 -23.024 -20.432 -1.285 1.00 24.72 C
-ATOM 3354 OG1 THR D 12 -21.642 -20.629 -1.920 1.00 32.38 O
-ATOM 3355 CG2 THR D 12 -24.127 -20.769 -2.067 1.00 56.05 C
-ATOM 3356 N ALA D 13 -24.939 -17.863 -0.966 1.00 25.46 N
-ATOM 3357 CA ALA D 13 -26.249 -17.368 -0.697 1.00 25.21 C
-ATOM 3358 C ALA D 13 -26.716 -16.016 -1.505 1.00 24.39 C
-ATOM 3359 O ALA D 13 -27.502 -15.783 -2.239 1.00 27.12 O
-ATOM 3360 CB ALA D 13 -26.840 -17.284 0.237 1.00 40.91 C
-ATOM 3361 N LEU D 14 -25.588 -15.038 -1.202 1.00 21.51 N
-ATOM 3362 CA LEU D 14 -25.805 -13.895 -1.844 1.00 19.28 C
-ATOM 3363 C LEU D 14 -25.557 -13.900 -3.355 1.00 20.58 C
-ATOM 3364 O LEU D 14 -26.325 -13.141 -4.012 1.00 19.87 O
-ATOM 3365 CB LEU D 14 -24.748 -12.802 -1.037 1.00 18.39 C
-ATOM 3366 CG LEU D 14 -24.944 -11.344 -1.539 1.00 32.12 C
-ATOM 3367 CD1 LEU D 14 -25.966 -10.962 -0.374 1.00 41.26 C
-ATOM 3368 CD2 LEU D 14 -23.927 -10.587 -1.223 1.00 34.27 C
-ATOM 3369 N TRP D 15 -24.663 -14.787 -3.692 1.00 16.79 N
-ATOM 3370 CA TRP D 15 -24.253 -14.609 -5.178 1.00 13.47 C
-ATOM 3371 C TRP D 15 -25.414 -15.354 -5.958 1.00 22.23 C
-ATOM 3372 O TRP D 15 -25.691 -14.922 -7.051 1.00 22.75 O
-ATOM 3373 CB TRP D 15 -23.003 -15.504 -5.278 1.00 17.27 C
-ATOM 3374 CG TRP D 15 -22.390 -15.264 -6.607 1.00 18.39 C
-ATOM 3375 CD1 TRP D 15 -22.417 -16.024 -7.714 1.00 29.85 C
-ATOM 3376 CD2 TRP D 15 -21.683 -13.937 -6.966 1.00 19.14 C
-ATOM 3377 NE1 TRP D 15 -21.775 -15.472 -8.770 1.00 25.67 N
-ATOM 3378 CE2 TRP D 15 -21.205 -14.132 -8.458 1.00 18.90 C
-ATOM 3379 CE3 TRP D 15 -21.251 -12.883 -6.227 1.00 24.35 C
-ATOM 3380 CZ2 TRP D 15 -20.568 -13.098 -9.104 1.00 22.83 C
-ATOM 3381 CZ3 TRP D 15 -20.364 -11.928 -6.894 1.00 24.62 C
-ATOM 3382 CH2 TRP D 15 -20.127 -12.198 -8.397 1.00 30.44 C
-ATOM 3383 N GLY D 16 -26.279 -16.244 -5.358 1.00 23.06 N
-ATOM 3384 CA GLY D 16 -27.474 -16.657 -6.225 1.00 23.16 C
-ATOM 3385 C GLY D 16 -28.300 -15.570 -6.485 1.00 26.54 C
-ATOM 3386 O GLY D 16 -29.203 -15.791 -7.472 1.00 26.11 O
-ATOM 3387 N LYS D 17 -28.475 -14.360 -5.980 1.00 18.84 N
-ATOM 3388 CA LYS D 17 -29.272 -13.270 -5.974 1.00 24.96 C
-ATOM 3389 C LYS D 17 -29.000 -12.271 -6.961 1.00 22.00 C
-ATOM 3390 O LYS D 17 -29.037 -11.079 -7.508 1.00 24.63 O
-ATOM 3391 CB LYS D 17 -29.587 -12.449 -4.588 1.00 28.33 C
-ATOM 3392 CG LYS D 17 -30.108 -13.362 -3.795 1.00 27.71 C
-ATOM 3393 CD LYS D 17 -30.415 -12.422 -2.822 1.00 33.37 C
-ATOM 3394 CE LYS D 17 -30.390 -12.386 -1.399 1.00 43.68 C
-ATOM 3395 NZ LYS D 17 -31.873 -11.072 -1.369 1.00 36.22 N
-ATOM 3396 N VAL D 18 -27.474 -12.385 -7.448 1.00 33.39 N
-ATOM 3397 CA VAL D 18 -26.489 -11.309 -8.320 1.00 24.51 C
-ATOM 3398 C VAL D 18 -27.096 -11.570 -9.917 1.00 27.24 C
-ATOM 3399 O VAL D 18 -26.940 -12.785 -10.011 1.00 26.54 O
-ATOM 3400 CB VAL D 18 -25.245 -11.428 -8.185 1.00 31.98 C
-ATOM 3401 CG1 VAL D 18 -24.320 -10.896 -8.917 1.00 31.25 C
-ATOM 3402 CG2 VAL D 18 -24.647 -11.020 -6.542 1.00 22.12 C
-ATOM 3403 N ASN D 19 -27.428 -10.545 -10.401 1.00 25.81 N
-ATOM 3404 CA ASN D 19 -27.299 -10.403 -11.802 1.00 27.55 C
-ATOM 3405 C ASN D 19 -26.159 -10.452 -12.333 1.00 24.31 C
-ATOM 3406 O ASN D 19 -25.632 -9.111 -12.336 1.00 20.67 O
-ATOM 3407 CB ASN D 19 -28.399 -9.524 -12.285 1.00 40.49 C
-ATOM 3408 CG ASN D 19 -28.856 -10.175 -13.808 1.00 44.62 C
-ATOM 3409 OD1 ASN D 19 -27.731 -9.601 -14.786 1.00 45.68 O
-ATOM 3410 ND2 ASN D 19 -29.658 -8.823 -14.484 1.00 50.78 N
-ATOM 3411 N VAL D 20 -25.460 -11.215 -12.835 1.00 22.82 N
-ATOM 3412 CA VAL D 20 -23.926 -10.940 -13.321 1.00 40.38 C
-ATOM 3413 C VAL D 20 -23.628 -9.968 -13.933 1.00 37.93 C
-ATOM 3414 O VAL D 20 -22.741 -9.105 -14.256 1.00 32.18 O
-ATOM 3415 CB VAL D 20 -22.926 -12.781 -13.318 1.00 54.80 C
-ATOM 3416 CG1 VAL D 20 -22.524 -12.140 -14.217 1.00 63.33 C
-ATOM 3417 CG2 VAL D 20 -23.373 -13.095 -12.306 1.00 34.72 C
-ATOM 3418 N ASP D 21 -24.469 -9.996 -15.091 1.00 36.66 N
-ATOM 3419 CA ASP D 21 -24.588 -8.635 -15.872 1.00 54.12 C
-ATOM 3420 C ASP D 21 -24.717 -7.685 -15.749 1.00 46.84 C
-ATOM 3421 O ASP D 21 -23.610 -6.686 -15.937 1.00 32.53 O
-ATOM 3422 CB ASP D 21 -25.603 -8.934 -17.011 1.00 60.03 C
-ATOM 3423 CG ASP D 21 -25.523 -10.565 -17.717 1.00 75.30 C
-ATOM 3424 OD1 ASP D 21 -24.242 -11.481 -17.893 1.00 51.52 O
-ATOM 3425 OD2 ASP D 21 -25.948 -10.502 -18.826 1.00 64.70 O
-ATOM 3426 N GLU D 22 -25.623 -7.162 -14.906 1.00 27.09 N
-ATOM 3427 CA GLU D 22 -25.919 -5.886 -14.386 1.00 23.15 C
-ATOM 3428 C GLU D 22 -24.427 -5.530 -13.395 1.00 19.08 C
-ATOM 3429 O GLU D 22 -24.197 -4.407 -13.172 1.00 21.80 O
-ATOM 3430 CB GLU D 22 -27.280 -5.934 -13.774 1.00 35.52 C
-ATOM 3431 CG GLU D 22 -27.211 -5.635 -13.083 1.00 68.74 C
-ATOM 3432 CD GLU D 22 -28.960 -4.398 -12.033 1.00 80.12 C
-ATOM 3433 OE1 GLU D 22 -29.624 -5.184 -11.024 1.00 61.13 O
-ATOM 3434 OE2 GLU D 22 -29.463 -4.100 -13.136 1.00 73.88 O
-ATOM 3435 N VAL D 23 -24.426 -6.315 -12.392 1.00 20.94 N
-ATOM 3436 CA VAL D 23 -23.348 -6.099 -11.326 1.00 17.82 C
-ATOM 3437 C VAL D 23 -21.966 -6.004 -12.061 1.00 15.07 C
-ATOM 3438 O VAL D 23 -21.155 -5.154 -11.664 1.00 21.11 O
-ATOM 3439 CB VAL D 23 -23.341 -7.268 -10.216 1.00 18.64 C
-ATOM 3440 CG1 VAL D 23 -22.169 -7.160 -9.566 1.00 21.45 C
-ATOM 3441 CG2 VAL D 23 -24.676 -6.892 -9.537 1.00 21.02 C
-ATOM 3442 N GLY D 24 -21.629 -6.780 -12.936 1.00 12.96 N
-ATOM 3443 CA GLY D 24 -20.442 -6.846 -13.669 1.00 18.39 C
-ATOM 3444 C GLY D 24 -20.261 -5.559 -14.312 1.00 16.60 C
-ATOM 3445 O GLY D 24 -19.233 -4.768 -14.272 1.00 15.31 O
-ATOM 3446 N GLY D 25 -21.132 -4.866 -15.117 1.00 17.32 N
-ATOM 3447 CA GLY D 25 -21.127 -3.499 -15.792 1.00 16.45 C
-ATOM 3448 C GLY D 25 -21.008 -2.525 -14.804 1.00 12.17 C
-ATOM 3449 O GLY D 25 -20.114 -1.633 -15.055 1.00 21.20 O
-ATOM 3450 N GLU D 26 -21.690 -2.622 -13.683 1.00 15.97 N
-ATOM 3451 CA GLU D 26 -21.600 -1.628 -12.730 1.00 13.66 C
-ATOM 3452 C GLU D 26 -20.044 -1.546 -12.031 1.00 11.75 C
-ATOM 3453 O GLU D 26 -19.572 -0.450 -11.864 1.00 13.88 O
-ATOM 3454 CB GLU D 26 -22.662 -1.686 -11.514 1.00 18.62 C
-ATOM 3455 CG GLU D 26 -23.979 0.008 -11.890 1.00 39.81 C
-ATOM 3456 CD GLU D 26 -22.700 -0.395 -10.542 1.00 31.77 C
-ATOM 3457 OE1 GLU D 26 -23.368 1.259 -10.392 1.00 34.99 O
-ATOM 3458 OE2 GLU D 26 -24.210 -0.810 -9.865 1.00 54.79 O
-ATOM 3459 N ALA D 27 -19.673 -2.710 -11.707 1.00 12.60 N
-ATOM 3460 CA ALA D 27 -18.269 -2.901 -11.078 1.00 17.85 C
-ATOM 3461 C ALA D 27 -17.180 -2.341 -11.937 1.00 15.51 C
-ATOM 3462 O ALA D 27 -16.331 -1.489 -11.550 1.00 14.90 O
-ATOM 3463 CB ALA D 27 -18.048 -4.225 -10.534 1.00 15.58 C
-ATOM 3464 N LEU D 28 -17.183 -2.729 -13.203 1.00 16.04 N
-ATOM 3465 CA LEU D 28 -16.186 -2.309 -14.163 1.00 11.08 C
-ATOM 3466 C LEU D 28 -16.248 -0.897 -14.292 1.00 13.51 C
-ATOM 3467 O LEU D 28 -15.238 -0.124 -14.487 1.00 14.05 O
-ATOM 3468 CB LEU D 28 -16.275 -3.066 -15.497 1.00 12.20 C
-ATOM 3469 CG LEU D 28 -14.973 -2.764 -16.433 1.00 28.52 C
-ATOM 3470 CD1 LEU D 28 -13.779 -3.087 -15.679 1.00 36.95 C
-ATOM 3471 CD2 LEU D 28 -15.242 -3.401 -17.606 1.00 34.25 C
-ATOM 3472 N GLY D 29 -17.518 -0.283 -14.622 1.00 12.33 N
-ATOM 3473 CA GLY D 29 -17.751 1.088 -14.735 1.00 13.25 C
-ATOM 3474 C GLY D 29 -17.136 1.954 -13.603 1.00 12.50 C
-ATOM 3475 O GLY D 29 -16.531 3.012 -13.890 1.00 16.69 O
-ATOM 3476 N ARG D 30 -17.539 1.491 -12.441 1.00 15.15 N
-ATOM 3477 CA ARG D 30 -17.026 2.243 -11.337 1.00 17.77 C
-ATOM 3478 C ARG D 30 -15.527 2.171 -11.160 1.00 14.35 C
-ATOM 3479 O ARG D 30 -14.968 3.218 -10.798 1.00 14.59 O
-ATOM 3480 CB ARG D 30 -17.892 1.792 -10.040 1.00 15.53 C
-ATOM 3481 CG ARG D 30 -19.275 2.313 -9.820 1.00 16.65 C
-ATOM 3482 CD ARG D 30 -19.931 1.839 -8.709 1.00 28.01 C
-ATOM 3483 NE ARG D 30 -21.099 2.164 -8.522 1.00 23.10 N
-ATOM 3484 CZ ARG D 30 -21.731 3.109 -7.922 1.00 16.06 C
-ATOM 3485 NH1 ARG D 30 -22.965 3.397 -7.723 1.00 17.46 N
-ATOM 3486 NH2 ARG D 30 -21.050 3.807 -6.871 1.00 10.32 N
-ATOM 3487 N LEU D 31 -14.961 1.160 -11.442 1.00 15.53 N
-ATOM 3488 CA LEU D 31 -13.554 1.103 -11.546 1.00 14.63 C
-ATOM 3489 C LEU D 31 -12.894 2.305 -12.254 1.00 16.67 C
-ATOM 3490 O LEU D 31 -11.964 2.890 -11.986 1.00 15.33 O
-ATOM 3491 CB LEU D 31 -12.961 -0.342 -11.951 1.00 12.02 C
-ATOM 3492 CG LEU D 31 -11.524 -0.502 -11.963 1.00 17.81 C
-ATOM 3493 CD1 LEU D 31 -10.867 -0.718 -10.607 1.00 18.94 C
-ATOM 3494 CD2 LEU D 31 -11.112 -1.549 -12.889 1.00 18.38 C
-ATOM 3495 N LEU D 32 -13.461 2.265 -13.601 1.00 8.95 N
-ATOM 3496 CA LEU D 32 -13.016 3.232 -14.475 1.00 13.61 C
-ATOM 3497 C LEU D 32 -13.249 4.589 -14.109 1.00 13.07 C
-ATOM 3498 O LEU D 32 -12.457 5.593 -14.562 1.00 15.98 O
-ATOM 3499 CB LEU D 32 -13.512 2.944 -15.805 1.00 14.00 C
-ATOM 3500 CG LEU D 32 -12.943 1.707 -16.403 1.00 23.55 C
-ATOM 3501 CD1 LEU D 32 -13.857 1.407 -17.761 1.00 25.80 C
-ATOM 3502 CD2 LEU D 32 -11.759 1.263 -16.551 1.00 26.67 C
-ATOM 3503 N VAL D 33 -14.340 4.892 -13.280 1.00 13.83 N
-ATOM 3504 CA VAL D 33 -14.717 6.296 -12.776 1.00 13.13 C
-ATOM 3505 C VAL D 33 -13.702 6.655 -11.697 1.00 16.82 C
-ATOM 3506 O VAL D 33 -13.288 7.735 -11.589 1.00 15.10 O
-ATOM 3507 CB VAL D 33 -16.181 6.271 -12.468 1.00 11.59 C
-ATOM 3508 CG1 VAL D 33 -16.396 7.592 -11.833 1.00 21.42 C
-ATOM 3509 CG2 VAL D 33 -16.955 6.215 -13.830 1.00 18.60 C
-ATOM 3510 N VAL D 34 -13.788 5.741 -10.696 1.00 12.61 N
-ATOM 3511 CA VAL D 34 -13.205 6.102 -9.422 1.00 13.03 C
-ATOM 3512 C VAL D 34 -11.709 6.268 -9.501 1.00 15.88 C
-ATOM 3513 O VAL D 34 -11.074 6.862 -8.702 1.00 16.40 O
-ATOM 3514 CB VAL D 34 -13.754 5.224 -8.226 1.00 15.07 C
-ATOM 3515 CG1 VAL D 34 -13.038 5.375 -6.973 1.00 13.90 C
-ATOM 3516 CG2 VAL D 34 -15.220 5.422 -8.063 1.00 18.23 C
-ATOM 3517 N TYR D 35 -11.136 5.248 -10.266 1.00 11.62 N
-ATOM 3518 CA TYR D 35 -9.629 5.095 -10.409 1.00 14.47 C
-ATOM 3519 C TYR D 35 -9.420 5.204 -11.973 1.00 16.31 C
-ATOM 3520 O TYR D 35 -9.060 4.177 -12.606 1.00 17.14 O
-ATOM 3521 CB TYR D 35 -9.241 3.705 -9.961 1.00 14.04 C
-ATOM 3522 CG TYR D 35 -9.664 3.371 -8.620 1.00 16.50 C
-ATOM 3523 CD1 TYR D 35 -9.076 4.102 -7.605 1.00 16.28 C
-ATOM 3524 CD2 TYR D 35 -10.520 2.540 -8.304 1.00 21.92 C
-ATOM 3525 CE1 TYR D 35 -9.315 3.966 -6.162 1.00 18.51 C
-ATOM 3526 CE2 TYR D 35 -10.873 2.362 -6.966 1.00 25.13 C
-ATOM 3527 CZ TYR D 35 -10.254 3.015 -5.920 1.00 19.91 C
-ATOM 3528 OH TYR D 35 -10.861 2.820 -4.629 1.00 21.91 O
-ATOM 3529 N PRO D 36 -9.392 6.463 -12.417 1.00 14.59 N
-ATOM 3530 CA PRO D 36 -9.346 6.600 -14.037 1.00 16.73 C
-ATOM 3531 C PRO D 36 -8.099 6.185 -14.723 1.00 13.23 C
-ATOM 3532 O PRO D 36 -8.183 5.907 -15.944 1.00 15.17 O
-ATOM 3533 CB PRO D 36 -9.750 8.096 -14.119 1.00 24.30 C
-ATOM 3534 CG PRO D 36 -9.458 8.680 -12.746 1.00 25.67 C
-ATOM 3535 CD PRO D 36 -9.575 7.632 -11.872 1.00 17.58 C
-ATOM 3536 N TRP D 37 -6.974 5.929 -13.940 1.00 13.75 N
-ATOM 3537 CA TRP D 37 -5.897 5.496 -14.615 1.00 15.13 C
-ATOM 3538 C TRP D 37 -5.961 4.094 -15.089 1.00 14.32 C
-ATOM 3539 O TRP D 37 -5.292 3.617 -16.098 1.00 19.70 O
-ATOM 3540 CB TRP D 37 -4.642 5.522 -13.687 1.00 13.13 C
-ATOM 3541 CG TRP D 37 -4.793 4.873 -12.298 1.00 8.65 C
-ATOM 3542 CD1 TRP D 37 -4.494 3.633 -11.929 1.00 13.10 C
-ATOM 3543 CD2 TRP D 37 -5.201 5.532 -10.999 1.00 14.59 C
-ATOM 3544 NE1 TRP D 37 -4.604 3.407 -10.644 1.00 17.65 N
-ATOM 3545 CE2 TRP D 37 -5.232 4.530 -10.117 1.00 16.05 C
-ATOM 3546 CE3 TRP D 37 -5.786 6.762 -10.728 1.00 11.20 C
-ATOM 3547 CZ2 TRP D 37 -5.541 4.775 -8.606 1.00 26.88 C
-ATOM 3548 CZ3 TRP D 37 -6.287 7.021 -9.443 1.00 11.28 C
-ATOM 3549 CH2 TRP D 37 -5.996 6.001 -8.551 1.00 16.90 C
-ATOM 3550 N THR D 38 -6.984 3.333 -14.581 1.00 16.64 N
-ATOM 3551 CA THR D 38 -7.362 1.995 -14.995 1.00 14.14 C
-ATOM 3552 C THR D 38 -7.792 2.033 -16.539 1.00 18.16 C
-ATOM 3553 O THR D 38 -7.920 0.930 -17.161 1.00 16.15 O
-ATOM 3554 CB THR D 38 -8.440 1.318 -14.155 1.00 11.09 C
-ATOM 3555 OG1 THR D 38 -9.618 2.008 -14.130 1.00 14.48 O
-ATOM 3556 CG2 THR D 38 -7.730 1.043 -12.892 1.00 16.14 C
-ATOM 3557 N GLN D 39 -8.345 3.275 -16.962 1.00 12.07 N
-ATOM 3558 CA GLN D 39 -8.833 3.256 -18.352 1.00 10.72 C
-ATOM 3559 C GLN D 39 -7.732 3.116 -19.349 1.00 16.84 C
-ATOM 3560 O GLN D 39 -7.933 2.801 -20.471 1.00 21.52 O
-ATOM 3561 CB GLN D 39 -9.205 4.786 -18.517 1.00 13.63 C
-ATOM 3562 CG GLN D 39 -10.419 4.929 -17.639 1.00 17.04 C
-ATOM 3563 CD GLN D 39 -10.861 6.282 -17.855 1.00 23.47 C
-ATOM 3564 OE1 GLN D 39 -10.432 7.200 -18.833 1.00 25.04 O
-ATOM 3565 NE2 GLN D 39 -11.740 6.840 -16.888 1.00 28.38 N
-ATOM 3566 N ARG D 40 -6.331 2.999 -19.002 1.00 12.32 N
-ATOM 3567 CA ARG D 40 -5.095 2.844 -19.730 1.00 16.79 C
-ATOM 3568 C ARG D 40 -5.433 1.605 -20.411 1.00 17.58 C
-ATOM 3569 O ARG D 40 -4.682 1.315 -21.633 1.00 20.86 O
-ATOM 3570 CB ARG D 40 -3.966 2.461 -18.813 1.00 22.83 C
-ATOM 3571 CG ARG D 40 -3.694 1.460 -18.189 1.00 37.26 C
-ATOM 3572 CD ARG D 40 -2.418 1.834 -17.304 1.00 23.75 C
-ATOM 3573 NE ARG D 40 -1.279 2.091 -17.831 1.00 28.71 N
-ATOM 3574 CZ ARG D 40 -0.609 1.176 -18.760 1.00 41.77 C
-ATOM 3575 NH1 ARG D 40 -0.700 0.067 -18.486 1.00 31.05 N
-ATOM 3576 NH2 ARG D 40 0.625 1.911 -19.038 1.00 37.79 N
-ATOM 3577 N PHE D 41 -6.207 0.540 -20.107 1.00 15.17 N
-ATOM 3578 CA PHE D 41 -6.336 -0.770 -20.711 1.00 16.55 C
-ATOM 3579 C PHE D 41 -7.612 -0.691 -21.880 1.00 20.00 C
-ATOM 3580 O PHE D 41 -7.651 -1.868 -22.265 1.00 23.52 O
-ATOM 3581 CB PHE D 41 -6.568 -1.995 -19.811 1.00 13.75 C
-ATOM 3582 CG PHE D 41 -5.344 -2.033 -18.714 1.00 12.41 C
-ATOM 3583 CD1 PHE D 41 -5.592 -1.379 -17.449 1.00 16.97 C
-ATOM 3584 CD2 PHE D 41 -4.233 -2.496 -19.084 1.00 18.05 C
-ATOM 3585 CE1 PHE D 41 -4.371 -1.693 -16.818 1.00 23.07 C
-ATOM 3586 CE2 PHE D 41 -3.008 -2.505 -18.298 1.00 24.82 C
-ATOM 3587 CZ PHE D 41 -3.359 -2.006 -17.025 1.00 25.09 C
-ATOM 3588 N PHE D 42 -8.192 0.386 -21.832 1.00 15.21 N
-ATOM 3589 CA PHE D 42 -9.461 0.148 -22.436 1.00 14.18 C
-ATOM 3590 C PHE D 42 -9.645 1.104 -23.586 1.00 19.41 C
-ATOM 3591 O PHE D 42 -10.690 1.871 -23.828 1.00 18.71 O
-ATOM 3592 CB PHE D 42 -10.613 0.298 -21.592 1.00 21.58 C
-ATOM 3593 CG PHE D 42 -10.602 -1.034 -20.710 1.00 17.63 C
-ATOM 3594 CD1 PHE D 42 -10.145 -0.545 -19.164 1.00 20.37 C
-ATOM 3595 CD2 PHE D 42 -11.012 -2.318 -21.048 1.00 20.14 C
-ATOM 3596 CE1 PHE D 42 -10.225 -1.848 -18.434 1.00 27.02 C
-ATOM 3597 CE2 PHE D 42 -10.887 -3.301 -20.223 1.00 27.08 C
-ATOM 3598 CZ PHE D 42 -10.474 -2.972 -18.757 1.00 18.28 C
-ATOM 3599 N GLU D 43 -8.375 1.400 -24.058 1.00 32.32 N
-ATOM 3600 CA GLU D 43 -8.561 2.747 -24.914 1.00 33.61 C
-ATOM 3601 C GLU D 43 -9.574 2.656 -26.563 1.00 12.75 C
-ATOM 3602 O GLU D 43 -9.904 3.604 -26.926 1.00 26.94 O
-ATOM 3603 CB GLU D 43 -7.590 2.897 -25.572 1.00 65.31 C
-ATOM 3604 CG GLU D 43 -6.882 2.859 -25.890 1.00 43.00 C
-ATOM 3605 CD GLU D 43 -6.060 4.011 -24.596 1.00 32.00 C
-ATOM 3606 OE1 GLU D 43 -6.764 5.450 -24.611 1.00 29.89 O
-ATOM 3607 OE2 GLU D 43 -4.721 4.728 -24.142 1.00 58.55 O
-ATOM 3608 N SER D 44 -9.605 1.289 -26.702 1.00 19.02 N
-ATOM 3609 CA SER D 44 -10.333 0.707 -27.924 1.00 25.67 C
-ATOM 3610 C SER D 44 -11.604 0.898 -27.554 1.00 26.66 C
-ATOM 3611 O SER D 44 -12.646 0.619 -28.203 1.00 32.13 O
-ATOM 3612 CB SER D 44 -10.139 -0.585 -28.237 1.00 42.87 C
-ATOM 3613 OG SER D 44 -10.504 -1.572 -27.556 1.00 44.29 O
-ATOM 3614 N PHE D 45 -12.328 1.230 -26.297 1.00 27.34 N
-ATOM 3615 CA PHE D 45 -13.753 1.140 -25.852 1.00 24.93 C
-ATOM 3616 C PHE D 45 -14.575 2.593 -26.282 1.00 23.30 C
-ATOM 3617 O PHE D 45 -15.815 2.187 -25.861 1.00 31.71 O
-ATOM 3618 CB PHE D 45 -13.703 0.919 -24.328 1.00 26.07 C
-ATOM 3619 CG PHE D 45 -13.645 -0.527 -24.075 1.00 19.10 C
-ATOM 3620 CD1 PHE D 45 -14.209 -0.901 -22.815 1.00 43.96 C
-ATOM 3621 CD2 PHE D 45 -13.155 -1.495 -24.645 1.00 26.17 C
-ATOM 3622 CE1 PHE D 45 -14.066 -2.469 -22.506 1.00 29.49 C
-ATOM 3623 CE2 PHE D 45 -12.912 -2.782 -24.307 1.00 32.75 C
-ATOM 3624 CZ PHE D 45 -13.459 -3.397 -23.316 1.00 28.04 C
-ATOM 3625 N GLY D 46 -14.104 3.279 -26.525 1.00 35.08 N
-ATOM 3626 CA GLY D 46 -14.935 4.262 -26.788 1.00 34.51 C
-ATOM 3627 C GLY D 46 -15.024 5.841 -25.884 1.00 32.00 C
-ATOM 3628 O GLY D 46 -13.703 5.710 -25.436 1.00 42.65 O
-ATOM 3629 N ASP D 47 -16.270 6.088 -25.501 1.00 33.75 N
-ATOM 3630 CA ASP D 47 -15.315 7.928 -25.257 1.00 43.29 C
-ATOM 3631 C ASP D 47 -15.918 7.002 -23.097 1.00 24.69 C
-ATOM 3632 O ASP D 47 -17.090 6.340 -23.091 1.00 33.08 O
-ATOM 3633 CB ASP D 47 -17.246 8.111 -25.348 1.00 48.49 C
-ATOM 3634 CG ASP D 47 -17.316 9.636 -24.481 1.00 50.77 C
-ATOM 3635 OD1 ASP D 47 -18.624 9.821 -24.553 1.00 57.75 O
-ATOM 3636 OD2 ASP D 47 -16.233 10.163 -24.247 1.00 45.03 O
-ATOM 3637 N LEU D 48 -14.887 7.498 -22.782 1.00 25.73 N
-ATOM 3638 CA LEU D 48 -14.700 7.013 -21.145 1.00 29.97 C
-ATOM 3639 C LEU D 48 -14.723 8.417 -20.213 1.00 32.06 C
-ATOM 3640 O LEU D 48 -13.912 8.444 -19.219 1.00 36.43 O
-ATOM 3641 CB LEU D 48 -13.472 6.468 -21.109 1.00 41.80 C
-ATOM 3642 CG LEU D 48 -13.862 5.004 -21.634 1.00 22.03 C
-ATOM 3643 CD1 LEU D 48 -12.363 4.146 -21.342 1.00 37.56 C
-ATOM 3644 CD2 LEU D 48 -15.085 4.189 -21.243 1.00 29.67 C
-ATOM 3645 N SER D 49 -15.191 9.523 -21.130 1.00 38.40 N
-ATOM 3646 CA SER D 49 -14.387 10.788 -20.677 1.00 43.30 C
-ATOM 3647 C SER D 49 -15.473 11.721 -19.486 1.00 46.97 C
-ATOM 3648 O SER D 49 -14.763 12.145 -18.356 1.00 46.32 O
-ATOM 3649 CB SER D 49 -14.644 11.939 -21.771 1.00 47.25 C
-ATOM 3650 OG SER D 49 -16.017 12.123 -22.081 1.00 49.74 O
-ATOM 3651 N THR D 50 -16.621 11.041 -19.530 1.00 43.91 N
-ATOM 3652 CA THR D 50 -16.855 11.313 -17.860 1.00 36.95 C
-ATOM 3653 C THR D 50 -18.023 10.172 -17.341 1.00 36.10 C
-ATOM 3654 O THR D 50 -18.171 9.157 -18.076 1.00 28.99 O
-ATOM 3655 CB THR D 50 -18.590 12.293 -18.547 1.00 37.26 C
-ATOM 3656 OG1 THR D 50 -19.750 11.618 -19.297 1.00 36.38 O
-ATOM 3657 CG2 THR D 50 -18.025 13.508 -19.178 1.00 56.40 C
-ATOM 3658 N PRO D 51 -18.501 10.284 -16.193 1.00 37.42 N
-ATOM 3659 CA PRO D 51 -19.225 9.303 -15.560 1.00 32.59 C
-ATOM 3660 C PRO D 51 -20.269 8.625 -16.174 1.00 29.25 C
-ATOM 3661 O PRO D 51 -20.632 7.313 -16.333 1.00 26.15 O
-ATOM 3662 CB PRO D 51 -19.687 9.933 -14.153 1.00 37.41 C
-ATOM 3663 CG PRO D 51 -18.587 10.776 -13.939 1.00 36.57 C
-ATOM 3664 CD PRO D 51 -18.147 11.586 -15.357 1.00 42.54 C
-ATOM 3665 N ASP D 52 -21.166 9.545 -16.896 1.00 30.65 N
-ATOM 3666 CA ASP D 52 -22.575 8.738 -17.587 1.00 39.40 C
-ATOM 3667 C ASP D 52 -21.861 8.056 -18.864 1.00 56.69 C
-ATOM 3668 O ASP D 52 -22.611 7.193 -19.113 1.00 40.69 O
-ATOM 3669 CB ASP D 52 -23.192 10.048 -17.807 1.00 43.19 C
-ATOM 3670 CG ASP D 52 -24.003 11.080 -16.646 1.00 63.04 C
-ATOM 3671 OD1 ASP D 52 -23.975 10.324 -15.803 1.00 49.71 O
-ATOM 3672 OD2 ASP D 52 -21.902 12.263 -16.248 1.00 60.40 O
-ATOM 3673 N ALA D 53 -21.035 8.713 -19.489 1.00 26.05 N
-ATOM 3674 CA ALA D 53 -20.460 8.256 -20.648 1.00 33.75 C
-ATOM 3675 C ALA D 53 -19.850 6.612 -20.478 1.00 42.76 C
-ATOM 3676 O ALA D 53 -20.052 5.785 -20.744 1.00 38.58 O
-ATOM 3677 CB ALA D 53 -19.424 8.739 -21.252 1.00 40.18 C
-ATOM 3678 N VAL D 54 -18.829 6.696 -19.306 1.00 27.10 N
-ATOM 3679 CA VAL D 54 -18.358 5.224 -18.836 1.00 25.12 C
-ATOM 3680 C VAL D 54 -19.446 4.410 -18.467 1.00 26.50 C
-ATOM 3681 O VAL D 54 -19.614 3.128 -18.953 1.00 24.76 O
-ATOM 3682 CB VAL D 54 -17.388 5.607 -17.705 1.00 26.67 C
-ATOM 3683 CG1 VAL D 54 -17.066 4.042 -17.246 1.00 25.19 C
-ATOM 3684 CG2 VAL D 54 -16.359 6.289 -17.975 1.00 31.48 C
-ATOM 3685 N MET D 55 -20.628 4.739 -17.700 1.00 25.87 N
-ATOM 3686 CA MET D 55 -21.589 3.767 -17.229 1.00 29.84 C
-ATOM 3687 C MET D 55 -22.865 3.307 -18.556 1.00 35.52 C
-ATOM 3688 O MET D 55 -23.112 2.208 -18.285 1.00 32.07 O
-ATOM 3689 CB MET D 55 -22.456 4.472 -15.982 1.00 26.28 C
-ATOM 3690 CG MET D 55 -21.631 4.626 -15.056 1.00 36.16 C
-ATOM 3691 SD MET D 55 -20.389 3.558 -14.111 1.00 25.36 S
-ATOM 3692 CE MET D 55 -21.479 2.431 -13.702 1.00 19.21 C
-ATOM 3693 N GLY D 56 -22.639 4.442 -19.311 1.00 30.97 N
-ATOM 3694 CA GLY D 56 -23.658 3.737 -20.126 1.00 35.09 C
-ATOM 3695 C GLY D 56 -22.967 3.067 -21.283 1.00 44.75 C
-ATOM 3696 O GLY D 56 -23.331 2.815 -22.514 1.00 34.49 O
-ATOM 3697 N ASN D 57 -21.558 3.094 -21.617 1.00 25.90 N
-ATOM 3698 CA ASN D 57 -20.747 2.578 -22.658 1.00 29.86 C
-ATOM 3699 C ASN D 57 -21.034 1.130 -22.652 1.00 26.15 C
-ATOM 3700 O ASN D 57 -20.989 0.128 -21.968 1.00 26.55 O
-ATOM 3701 CB ASN D 57 -19.324 2.902 -22.444 1.00 30.42 C
-ATOM 3702 CG ASN D 57 -18.502 2.332 -23.503 1.00 23.49 C
-ATOM 3703 OD1 ASN D 57 -18.423 1.194 -24.009 1.00 31.02 O
-ATOM 3704 ND2 ASN D 57 -17.712 3.179 -23.808 1.00 27.30 N
-ATOM 3705 N PRO D 58 -21.467 0.671 -23.926 1.00 29.25 N
-ATOM 3706 CA PRO D 58 -21.926 -0.726 -24.096 1.00 25.97 C
-ATOM 3707 C PRO D 58 -20.503 -1.629 -24.124 1.00 16.05 C
-ATOM 3708 O PRO D 58 -20.837 -2.940 -23.655 1.00 24.61 O
-ATOM 3709 CB PRO D 58 -22.522 -0.927 -25.620 1.00 33.18 C
-ATOM 3710 CG PRO D 58 -21.947 0.977 -25.418 1.00 59.49 C
-ATOM 3711 CD PRO D 58 -21.892 1.180 -25.502 1.00 43.36 C
-ATOM 3712 N LYS D 59 -19.460 -1.283 -24.501 1.00 21.03 N
-ATOM 3713 CA LYS D 59 -18.361 -2.042 -24.450 1.00 25.38 C
-ATOM 3714 C LYS D 59 -17.715 -2.407 -22.856 1.00 17.84 C
-ATOM 3715 O LYS D 59 -17.308 -3.569 -22.731 1.00 21.39 O
-ATOM 3716 CB LYS D 59 -17.227 -1.661 -25.270 1.00 32.15 C
-ATOM 3717 CG LYS D 59 -17.383 -1.768 -26.732 1.00 48.59 C
-ATOM 3718 CD LYS D 59 -16.823 -1.145 -27.228 1.00 53.12 C
-ATOM 3719 CE LYS D 59 -15.877 -1.703 -28.754 1.00 53.54 C
-ATOM 3720 NZ LYS D 59 -16.728 -0.847 -29.838 1.00 62.98 N
-ATOM 3721 N VAL D 60 -18.099 -1.250 -22.201 1.00 18.98 N
-ATOM 3722 CA VAL D 60 -17.893 -1.490 -20.566 1.00 19.06 C
-ATOM 3723 C VAL D 60 -18.582 -2.535 -20.118 1.00 17.34 C
-ATOM 3724 O VAL D 60 -18.311 -3.436 -19.262 1.00 23.46 O
-ATOM 3725 CB VAL D 60 -17.740 -0.068 -19.973 1.00 21.26 C
-ATOM 3726 CG1 VAL D 60 -17.894 -0.452 -18.381 1.00 33.14 C
-ATOM 3727 CG2 VAL D 60 -16.838 0.852 -20.547 1.00 22.06 C
-ATOM 3728 N LYS D 61 -20.037 -2.374 -20.306 1.00 22.59 N
-ATOM 3729 CA LYS D 61 -21.055 -3.383 -19.935 1.00 26.15 C
-ATOM 3730 C LYS D 61 -20.810 -4.741 -20.319 1.00 17.30 C
-ATOM 3731 O LYS D 61 -20.683 -5.728 -19.595 1.00 21.45 O
-ATOM 3732 CB LYS D 61 -22.507 -2.996 -20.257 1.00 26.85 C
-ATOM 3733 CG LYS D 61 -22.914 -1.601 -19.668 1.00 38.21 C
-ATOM 3734 CD LYS D 61 -23.980 -1.298 -20.293 1.00 63.66 C
-ATOM 3735 CE LYS D 61 -25.073 -0.202 -19.530 1.00 68.06 C
-ATOM 3736 NZ LYS D 61 -26.116 0.022 -20.150 1.00 60.84 N
-ATOM 3737 N ALA D 62 -20.349 -4.906 -21.599 1.00 19.16 N
-ATOM 3738 CA ALA D 62 -20.005 -6.284 -22.177 1.00 20.58 C
-ATOM 3739 C ALA D 62 -18.862 -7.045 -21.486 1.00 20.27 C
-ATOM 3740 O ALA D 62 -18.872 -8.142 -21.107 1.00 20.37 O
-ATOM 3741 CB ALA D 62 -19.803 -6.090 -23.619 1.00 22.88 C
-ATOM 3742 N HIS D 63 -17.847 -6.087 -21.291 1.00 19.01 N
-ATOM 3743 CA HIS D 63 -16.655 -6.703 -20.657 1.00 22.19 C
-ATOM 3744 C HIS D 63 -16.866 -6.900 -19.133 1.00 18.77 C
-ATOM 3745 O HIS D 63 -16.263 -7.930 -18.702 1.00 19.91 O
-ATOM 3746 CB HIS D 63 -15.613 -5.996 -20.822 1.00 33.38 C
-ATOM 3747 CG HIS D 63 -13.969 -6.285 -20.598 1.00 22.34 C
-ATOM 3748 ND1 HIS D 63 -13.645 -7.369 -21.205 1.00 25.81 N
-ATOM 3749 CD2 HIS D 63 -13.423 -5.898 -19.324 1.00 33.81 C
-ATOM 3750 CE1 HIS D 63 -12.413 -7.623 -20.166 1.00 24.99 C
-ATOM 3751 NE2 HIS D 63 -12.303 -6.521 -19.735 1.00 32.42 N
-ATOM 3752 N GLY D 64 -17.554 -5.957 -18.637 1.00 15.38 N
-ATOM 3753 CA GLY D 64 -17.922 -6.237 -17.300 1.00 18.66 C
-ATOM 3754 C GLY D 64 -18.656 -7.558 -16.822 1.00 23.30 C
-ATOM 3755 O GLY D 64 -18.361 -8.374 -16.052 1.00 21.27 O
-ATOM 3756 N LYS D 65 -19.546 -7.946 -17.963 1.00 22.12 N
-ATOM 3757 CA LYS D 65 -20.149 -9.350 -17.810 1.00 26.40 C
-ATOM 3758 C LYS D 65 -19.206 -10.475 -18.054 1.00 25.29 C
-ATOM 3759 O LYS D 65 -19.376 -11.449 -17.320 1.00 24.58 O
-ATOM 3760 CB LYS D 65 -21.237 -9.249 -19.016 1.00 42.10 C
-ATOM 3761 CG LYS D 65 -21.741 -10.662 -18.763 1.00 41.04 C
-ATOM 3762 CD LYS D 65 -22.779 -10.191 -20.722 1.00 41.66 C
-ATOM 3763 CE LYS D 65 -22.954 -12.381 -20.558 1.00 58.61 C
-ATOM 3764 NZ LYS D 65 -24.294 -12.168 -21.421 1.00 49.59 N
-ATOM 3765 N LYS D 66 -18.192 -10.318 -18.949 1.00 22.59 N
-ATOM 3766 CA LYS D 66 -17.187 -11.342 -19.305 1.00 23.91 C
-ATOM 3767 C LYS D 66 -16.648 -11.569 -17.853 1.00 25.32 C
-ATOM 3768 O LYS D 66 -16.190 -12.713 -17.500 1.00 23.23 O
-ATOM 3769 CB LYS D 66 -16.360 -10.927 -20.397 1.00 18.18 C
-ATOM 3770 CG LYS D 66 -15.506 -11.226 -21.025 1.00 49.93 C
-ATOM 3771 CD LYS D 66 -15.452 -11.136 -23.086 1.00 31.44 C
-ATOM 3772 CE LYS D 66 -14.594 -13.236 -23.101 1.00 50.83 C
-ATOM 3773 NZ LYS D 66 -13.105 -13.073 -24.350 1.00 53.30 N
-ATOM 3774 N VAL D 67 -16.012 -10.379 -17.238 1.00 17.89 N
-ATOM 3775 CA VAL D 67 -15.129 -10.761 -16.039 1.00 17.07 C
-ATOM 3776 C VAL D 67 -15.858 -11.174 -14.995 1.00 11.37 C
-ATOM 3777 O VAL D 67 -15.392 -12.090 -14.267 1.00 18.26 O
-ATOM 3778 CB VAL D 67 -14.485 -9.126 -15.950 1.00 18.16 C
-ATOM 3779 CG1 VAL D 67 -14.204 -9.183 -14.372 1.00 22.61 C
-ATOM 3780 CG2 VAL D 67 -13.683 -8.637 -17.078 1.00 19.30 C
-ATOM 3781 N LEU D 68 -17.081 -10.772 -14.714 1.00 12.24 N
-ATOM 3782 CA LEU D 68 -17.709 -11.246 -13.544 1.00 14.83 C
-ATOM 3783 C LEU D 68 -18.294 -12.710 -13.662 1.00 13.25 C
-ATOM 3784 O LEU D 68 -18.430 -13.575 -12.845 1.00 18.25 O
-ATOM 3785 CB LEU D 68 -18.960 -10.522 -12.977 1.00 23.35 C
-ATOM 3786 CG LEU D 68 -19.065 -9.950 -11.782 1.00 32.52 C
-ATOM 3787 CD1 LEU D 68 -18.211 -10.021 -10.888 1.00 40.78 C
-ATOM 3788 CD2 LEU D 68 -20.119 -9.201 -11.516 1.00 39.22 C
-ATOM 3789 N GLY D 69 -18.532 -13.001 -15.044 1.00 22.38 N
-ATOM 3790 CA GLY D 69 -18.677 -14.387 -15.364 1.00 27.48 C
-ATOM 3791 C GLY D 69 -17.639 -15.482 -15.016 1.00 17.57 C
-ATOM 3792 O GLY D 69 -17.849 -16.416 -14.366 1.00 21.01 O
-ATOM 3793 N ALA D 70 -16.381 -14.966 -15.333 1.00 17.61 N
-ATOM 3794 CA ALA D 70 -15.237 -15.816 -14.969 1.00 17.42 C
-ATOM 3795 C ALA D 70 -15.098 -15.818 -13.537 1.00 19.59 C
-ATOM 3796 O ALA D 70 -14.642 -16.873 -12.761 1.00 18.72 O
-ATOM 3797 CB ALA D 70 -14.109 -15.221 -15.702 1.00 18.83 C
-ATOM 3798 N PHE D 71 -15.369 -14.689 -12.922 1.00 18.97 N
-ATOM 3799 CA PHE D 71 -15.352 -14.546 -11.295 1.00 24.55 C
-ATOM 3800 C PHE D 71 -16.405 -15.564 -10.716 1.00 22.73 C
-ATOM 3801 O PHE D 71 -15.988 -16.296 -9.916 1.00 26.00 O
-ATOM 3802 CB PHE D 71 -15.526 -13.076 -10.943 1.00 18.78 C
-ATOM 3803 CG PHE D 71 -15.587 -12.889 -9.418 1.00 15.63 C
-ATOM 3804 CD1 PHE D 71 -14.330 -12.356 -8.913 1.00 23.81 C
-ATOM 3805 CD2 PHE D 71 -16.955 -13.108 -8.941 1.00 34.86 C
-ATOM 3806 CE1 PHE D 71 -14.431 -12.324 -7.507 1.00 19.91 C
-ATOM 3807 CE2 PHE D 71 -16.645 -13.000 -7.472 1.00 36.36 C
-ATOM 3808 CZ PHE D 71 -15.423 -12.584 -6.796 1.00 26.08 C
-ATOM 3809 N SER D 72 -17.526 -15.632 -11.448 1.00 19.94 N
-ATOM 3810 CA SER D 72 -18.560 -16.484 -11.205 1.00 23.38 C
-ATOM 3811 C SER D 72 -18.098 -17.836 -10.814 1.00 24.72 C
-ATOM 3812 O SER D 72 -18.305 -18.802 -9.908 1.00 26.53 O
-ATOM 3813 CB SER D 72 -20.212 -16.588 -11.400 1.00 29.23 C
-ATOM 3814 OG SER D 72 -20.268 -15.282 -11.624 1.00 41.11 O
-ATOM 3815 N ASP D 73 -17.601 -18.307 -12.047 1.00 28.33 N
-ATOM 3816 CA ASP D 73 -16.810 -19.464 -12.087 1.00 41.54 C
-ATOM 3817 C ASP D 73 -16.106 -20.105 -11.342 1.00 28.94 C
-ATOM 3818 O ASP D 73 -15.997 -21.061 -10.645 1.00 34.21 O
-ATOM 3819 CB ASP D 73 -16.190 -20.100 -13.720 1.00 46.96 C
-ATOM 3820 CG ASP D 73 -17.426 -20.027 -14.053 1.00 54.92 C
-ATOM 3821 OD1 ASP D 73 -18.701 -19.481 -14.810 1.00 44.49 O
-ATOM 3822 OD2 ASP D 73 -16.811 -19.333 -16.112 1.00 50.27 O
-ATOM 3823 N GLY D 74 -15.211 -19.059 -10.501 1.00 26.75 N
-ATOM 3824 CA GLY D 74 -14.376 -19.390 -9.473 1.00 22.69 C
-ATOM 3825 C GLY D 74 -14.851 -19.537 -8.039 1.00 23.14 C
-ATOM 3826 O GLY D 74 -14.419 -20.191 -7.094 1.00 29.20 O
-ATOM 3827 N LEU D 75 -16.177 -18.924 -8.005 1.00 21.18 N
-ATOM 3828 CA LEU D 75 -16.870 -19.385 -6.815 1.00 34.17 C
-ATOM 3829 C LEU D 75 -17.117 -20.780 -6.565 1.00 37.46 C
-ATOM 3830 O LEU D 75 -17.563 -21.063 -5.534 1.00 40.90 O
-ATOM 3831 CB LEU D 75 -18.078 -18.207 -6.714 1.00 36.63 C
-ATOM 3832 CG LEU D 75 -17.957 -16.908 -6.209 1.00 28.96 C
-ATOM 3833 CD1 LEU D 75 -16.674 -16.783 -5.652 1.00 54.84 C
-ATOM 3834 CD2 LEU D 75 -18.450 -15.831 -6.570 1.00 41.72 C
-ATOM 3835 N ALA D 76 -17.372 -21.329 -7.689 1.00 36.74 N
-ATOM 3836 CA ALA D 76 -17.490 -23.239 -8.009 1.00 46.27 C
-ATOM 3837 C ALA D 76 -16.460 -23.394 -7.753 1.00 39.68 C
-ATOM 3838 O ALA D 76 -16.371 -24.793 -7.251 1.00 39.55 O
-ATOM 3839 CB ALA D 76 -18.034 -22.779 -9.158 1.00 52.59 C
-ATOM 3840 N HIS D 77 -15.221 -22.931 -7.252 1.00 34.88 N
-ATOM 3841 CA HIS D 77 -14.175 -23.705 -7.014 1.00 37.75 C
-ATOM 3842 C HIS D 77 -12.911 -22.947 -6.253 1.00 36.30 C
-ATOM 3843 O HIS D 77 -11.715 -22.807 -6.207 1.00 30.91 O
-ATOM 3844 CB HIS D 77 -13.016 -23.968 -8.303 1.00 35.95 C
-ATOM 3845 CG HIS D 77 -13.662 -24.672 -9.381 1.00 39.15 C
-ATOM 3846 ND1 HIS D 77 -14.327 -23.756 -10.232 1.00 58.22 N
-ATOM 3847 CD2 HIS D 77 -13.455 -26.062 -9.566 1.00 48.66 C
-ATOM 3848 CE1 HIS D 77 -15.214 -25.034 -11.337 1.00 49.77 C
-ATOM 3849 NE2 HIS D 77 -14.945 -25.798 -10.683 1.00 36.55 N
-ATOM 3850 N LEU D 78 -13.652 -22.590 -4.941 1.00 30.38 N
-ATOM 3851 CA LEU D 78 -13.049 -22.225 -3.904 1.00 35.53 C
-ATOM 3852 C LEU D 78 -11.853 -22.307 -3.241 1.00 31.52 C
-ATOM 3853 O LEU D 78 -11.095 -21.930 -2.681 1.00 30.87 O
-ATOM 3854 CB LEU D 78 -14.166 -21.218 -2.929 1.00 35.71 C
-ATOM 3855 CG LEU D 78 -14.517 -19.696 -3.089 1.00 42.09 C
-ATOM 3856 CD1 LEU D 78 -16.000 -19.812 -2.269 1.00 40.33 C
-ATOM 3857 CD2 LEU D 78 -14.206 -18.936 -3.409 1.00 43.79 C
-ATOM 3858 N ASP D 79 -11.841 -23.798 -3.366 1.00 27.09 N
-ATOM 3859 CA ASP D 79 -10.671 -24.163 -2.603 1.00 39.93 C
-ATOM 3860 C ASP D 79 -9.351 -24.818 -3.691 1.00 38.31 C
-ATOM 3861 O ASP D 79 -8.220 -24.950 -3.380 1.00 37.24 O
-ATOM 3862 CB ASP D 79 -11.204 -25.807 -2.720 1.00 49.19 C
-ATOM 3863 CG ASP D 79 -12.348 -25.806 -2.280 1.00 60.14 C
-ATOM 3864 OD1 ASP D 79 -12.747 -27.563 -1.436 1.00 58.54 O
-ATOM 3865 OD2 ASP D 79 -11.720 -25.378 -0.450 1.00 49.76 O
-ATOM 3866 N ASN D 80 -9.928 -24.165 -4.813 1.00 33.30 N
-ATOM 3867 CA ASN D 80 -8.432 -24.074 -5.725 1.00 41.52 C
-ATOM 3868 C ASN D 80 -8.757 -22.972 -7.024 1.00 29.72 C
-ATOM 3869 O ASN D 80 -8.410 -23.186 -8.009 1.00 26.63 O
-ATOM 3870 CB ASN D 80 -8.335 -25.027 -6.387 1.00 65.88 C
-ATOM 3871 CG ASN D 80 -8.226 -26.006 -7.178 1.00 79.70 C
-ATOM 3872 OD1 ASN D 80 -6.646 -26.141 -7.665 1.00 64.12 O
-ATOM 3873 ND2 ASN D 80 -9.445 -26.052 -7.340 1.00 80.04 N
-ATOM 3874 N LEU D 81 -8.454 -21.884 -6.206 1.00 24.36 N
-ATOM 3875 CA LEU D 81 -8.539 -20.715 -7.081 1.00 25.83 C
-ATOM 3876 C LEU D 81 -7.273 -20.637 -8.041 1.00 31.94 C
-ATOM 3877 O LEU D 81 -7.415 -20.270 -9.214 1.00 25.17 O
-ATOM 3878 CB LEU D 81 -8.579 -19.629 -6.126 1.00 20.37 C
-ATOM 3879 CG LEU D 81 -9.997 -19.259 -5.589 1.00 25.65 C
-ATOM 3880 CD1 LEU D 81 -9.956 -18.414 -4.674 1.00 40.59 C
-ATOM 3881 CD2 LEU D 81 -11.103 -19.225 -6.396 1.00 23.30 C
-ATOM 3882 N LYS D 82 -6.051 -20.893 -7.415 1.00 30.20 N
-ATOM 3883 CA LYS D 82 -4.933 -20.852 -8.394 1.00 28.24 C
-ATOM 3884 C LYS D 82 -5.124 -21.707 -9.528 1.00 33.91 C
-ATOM 3885 O LYS D 82 -4.821 -21.459 -10.648 1.00 25.48 O
-ATOM 3886 CB LYS D 82 -3.611 -21.239 -7.521 1.00 33.73 C
-ATOM 3887 CG LYS D 82 -3.123 -20.210 -6.921 1.00 40.61 C
-ATOM 3888 CD LYS D 82 -1.453 -20.533 -6.100 1.00 64.29 C
-ATOM 3889 CE LYS D 82 -2.245 -18.592 -4.901 1.00 50.61 C
-ATOM 3890 NZ LYS D 82 -1.640 -20.210 -4.012 1.00 57.77 N
-ATOM 3891 N GLY D 83 -5.684 -23.133 -9.543 1.00 30.21 N
-ATOM 3892 CA GLY D 83 -5.556 -24.039 -10.631 1.00 23.41 C
-ATOM 3893 C GLY D 83 -6.710 -23.708 -11.373 1.00 31.79 C
-ATOM 3894 O GLY D 83 -6.545 -23.384 -12.827 1.00 27.38 O
-ATOM 3895 N THR D 84 -7.929 -22.850 -10.943 1.00 27.06 N
-ATOM 3896 CA THR D 84 -8.896 -22.475 -11.769 1.00 31.17 C
-ATOM 3897 C THR D 84 -8.254 -21.368 -12.862 1.00 35.08 C
-ATOM 3898 O THR D 84 -9.023 -21.163 -13.732 1.00 26.93 O
-ATOM 3899 CB THR D 84 -10.186 -21.934 -10.990 1.00 26.68 C
-ATOM 3900 OG1 THR D 84 -10.450 -22.939 -10.341 1.00 41.82 O
-ATOM 3901 CG2 THR D 84 -11.436 -21.350 -11.615 1.00 32.36 C
-ATOM 3902 N PHE D 85 -7.713 -20.405 -12.026 1.00 23.78 N
-ATOM 3903 CA PHE D 85 -7.538 -18.984 -12.806 1.00 17.94 C
-ATOM 3904 C PHE D 85 -6.138 -19.115 -13.564 1.00 20.32 C
-ATOM 3905 O PHE D 85 -5.528 -18.116 -14.137 1.00 18.46 O
-ATOM 3906 CB PHE D 85 -7.425 -17.913 -11.819 1.00 16.82 C
-ATOM 3907 CG PHE D 85 -8.885 -17.567 -11.680 1.00 15.41 C
-ATOM 3908 CD1 PHE D 85 -9.422 -17.861 -10.346 1.00 21.43 C
-ATOM 3909 CD2 PHE D 85 -9.605 -16.833 -12.552 1.00 29.52 C
-ATOM 3910 CE1 PHE D 85 -10.820 -17.512 -9.993 1.00 27.35 C
-ATOM 3911 CE2 PHE D 85 -11.060 -16.678 -12.198 1.00 23.38 C
-ATOM 3912 CZ PHE D 85 -11.788 -16.979 -10.988 1.00 20.96 C
-ATOM 3913 N ALA D 86 -5.306 -20.190 -13.510 1.00 16.78 N
-ATOM 3914 CA ALA D 86 -3.786 -20.129 -13.990 1.00 21.66 C
-ATOM 3915 C ALA D 86 -3.859 -19.751 -15.592 1.00 13.70 C
-ATOM 3916 O ALA D 86 -2.977 -18.900 -15.942 1.00 16.83 O
-ATOM 3917 CB ALA D 86 -3.276 -21.717 -14.150 1.00 23.60 C
-ATOM 3918 N THR D 87 -4.799 -20.235 -16.291 1.00 17.09 N
-ATOM 3919 CA THR D 87 -4.700 -19.770 -17.696 1.00 15.85 C
-ATOM 3920 C THR D 87 -4.913 -18.223 -17.934 1.00 17.61 C
-ATOM 3921 O THR D 87 -4.226 -17.589 -18.665 1.00 21.97 O
-ATOM 3922 CB THR D 87 -5.803 -20.551 -18.552 1.00 23.34 C
-ATOM 3923 OG1 THR D 87 -5.495 -21.943 -18.388 1.00 26.37 O
-ATOM 3924 CG2 THR D 87 -5.595 -20.344 -19.930 1.00 26.08 C
-ATOM 3925 N LEU D 88 -5.980 -17.807 -17.359 1.00 19.60 N
-ATOM 3926 CA LEU D 88 -6.271 -16.457 -17.415 1.00 18.18 C
-ATOM 3927 C LEU D 88 -5.187 -15.518 -16.684 1.00 15.66 C
-ATOM 3928 O LEU D 88 -4.841 -14.368 -17.168 1.00 16.54 O
-ATOM 3929 CB LEU D 88 -7.631 -16.058 -16.725 1.00 24.93 C
-ATOM 3930 CG LEU D 88 -8.806 -16.413 -17.604 1.00 29.68 C
-ATOM 3931 CD1 LEU D 88 -9.913 -16.362 -16.626 1.00 33.11 C
-ATOM 3932 CD2 LEU D 88 -8.780 -15.785 -18.779 1.00 21.96 C
-ATOM 3933 N SER D 89 -4.550 -16.190 -15.577 1.00 21.20 N
-ATOM 3934 CA SER D 89 -3.384 -15.545 -14.950 1.00 17.78 C
-ATOM 3935 C SER D 89 -2.295 -15.067 -15.986 1.00 16.70 C
-ATOM 3936 O SER D 89 -1.619 -14.055 -16.257 1.00 15.86 O
-ATOM 3937 CB SER D 89 -2.725 -16.272 -13.880 1.00 19.29 C
-ATOM 3938 OG SER D 89 -1.733 -15.529 -13.240 1.00 14.95 O
-ATOM 3939 N GLU D 90 -1.806 -16.218 -16.719 1.00 15.58 N
-ATOM 3940 CA GLU D 90 -0.961 -16.101 -17.900 1.00 21.65 C
-ATOM 3941 C GLU D 90 -1.319 -15.129 -19.030 1.00 13.57 C
-ATOM 3942 O GLU D 90 -0.576 -14.403 -19.451 1.00 18.38 O
-ATOM 3943 CB GLU D 90 -0.700 -17.640 -18.253 1.00 19.08 C
-ATOM 3944 CG GLU D 90 0.585 -17.390 -19.009 1.00 38.09 C
-ATOM 3945 CD GLU D 90 0.916 -19.788 -19.196 1.00 62.85 C
-ATOM 3946 OE1 GLU D 90 0.495 -19.279 -20.696 1.00 54.38 O
-ATOM 3947 OE2 GLU D 90 -0.172 -20.134 -18.632 1.00 49.69 O
-ATOM 3948 N LEU D 91 -2.614 -15.260 -19.279 1.00 12.64 N
-ATOM 3949 CA LEU D 91 -2.918 -14.282 -20.199 1.00 11.29 C
-ATOM 3950 C LEU D 91 -2.769 -12.767 -19.975 1.00 14.82 C
-ATOM 3951 O LEU D 91 -2.486 -11.814 -20.708 1.00 14.36 O
-ATOM 3952 CB LEU D 91 -4.443 -14.616 -20.526 1.00 13.30 C
-ATOM 3953 CG LEU D 91 -5.325 -13.643 -21.412 1.00 17.13 C
-ATOM 3954 CD1 LEU D 91 -4.702 -13.618 -23.000 1.00 25.95 C
-ATOM 3955 CD2 LEU D 91 -6.752 -13.787 -21.472 1.00 20.87 C
-ATOM 3956 N HIS D 92 -3.278 -12.509 -18.598 1.00 14.55 N
-ATOM 3957 CA HIS D 92 -3.429 -10.968 -18.356 1.00 18.41 C
-ATOM 3958 C HIS D 92 -1.750 -10.659 -17.942 1.00 25.22 C
-ATOM 3959 O HIS D 92 -1.542 -9.487 -18.276 1.00 15.09 O
-ATOM 3960 CB HIS D 92 -3.870 -11.061 -16.956 1.00 16.94 C
-ATOM 3961 CG HIS D 92 -5.443 -10.779 -17.044 1.00 14.87 C
-ATOM 3962 ND1 HIS D 92 -6.226 -12.088 -17.324 1.00 14.65 N
-ATOM 3963 CD2 HIS D 92 -6.494 -9.930 -17.027 1.00 12.93 C
-ATOM 3964 CE1 HIS D 92 -7.513 -11.488 -17.344 1.00 12.97 C
-ATOM 3965 NE2 HIS D 92 -7.794 -10.264 -17.456 1.00 18.10 N
-ATOM 3966 N CYS D 93 -0.853 -11.610 -17.750 1.00 16.12 N
-ATOM 3967 CA CYS D 93 0.671 -11.156 -17.799 1.00 16.35 C
-ATOM 3968 C CYS D 93 1.184 -10.895 -19.303 1.00 18.55 C
-ATOM 3969 O CYS D 93 1.616 -9.948 -19.471 1.00 17.22 O
-ATOM 3970 CB CYS D 93 1.177 -12.201 -16.844 1.00 20.93 C
-ATOM 3971 SG CYS D 93 3.106 -11.680 -16.838 1.00 18.90 S
-ATOM 3972 N ASP D 94 1.071 -12.148 -19.853 1.00 14.32 N
-ATOM 3973 CA ASP D 94 2.076 -12.170 -21.195 1.00 16.01 C
-ATOM 3974 C ASP D 94 1.351 -11.461 -22.242 1.00 19.68 C
-ATOM 3975 O ASP D 94 1.981 -11.016 -23.089 1.00 27.14 O
-ATOM 3976 CB ASP D 94 2.163 -13.661 -21.334 1.00 20.44 C
-ATOM 3977 CG ASP D 94 3.220 -14.533 -20.409 1.00 36.43 C
-ATOM 3978 OD1 ASP D 94 3.523 -13.728 -19.788 1.00 32.86 O
-ATOM 3979 OD2 ASP D 94 2.735 -15.960 -20.657 1.00 40.09 O
-ATOM 3980 N LYS D 95 0.079 -11.509 -22.378 1.00 14.90 N
-ATOM 3981 CA LYS D 95 -0.657 -10.830 -23.618 1.00 16.76 C
-ATOM 3982 C LYS D 95 -1.037 -9.542 -23.369 1.00 18.82 C
-ATOM 3983 O LYS D 95 -1.025 -8.517 -23.887 1.00 19.72 O
-ATOM 3984 CB LYS D 95 -1.739 -11.719 -24.171 1.00 24.57 C
-ATOM 3985 CG LYS D 95 -1.405 -13.254 -24.270 1.00 49.61 C
-ATOM 3986 CD LYS D 95 0.033 -12.822 -25.830 1.00 60.17 C
-ATOM 3987 CE LYS D 95 0.875 -13.698 -26.541 1.00 57.82 C
-ATOM 3988 NZ LYS D 95 1.951 -12.652 -27.842 1.00 59.53 N
-ATOM 3989 N LEU D 96 -1.816 -9.347 -21.943 1.00 16.80 N
-ATOM 3990 CA LEU D 96 -2.489 -8.095 -21.711 1.00 16.58 C
-ATOM 3991 C LEU D 96 -1.557 -6.998 -20.981 1.00 16.01 C
-ATOM 3992 O LEU D 96 -2.025 -5.870 -20.986 1.00 15.73 O
-ATOM 3993 CB LEU D 96 -3.813 -8.447 -21.040 1.00 21.01 C
-ATOM 3994 CG LEU D 96 -4.799 -9.421 -21.657 1.00 22.06 C
-ATOM 3995 CD1 LEU D 96 -6.039 -9.748 -20.763 1.00 15.50 C
-ATOM 3996 CD2 LEU D 96 -5.152 -8.823 -22.921 1.00 34.04 C
-ATOM 3997 N HIS D 97 -0.781 -7.579 -20.217 1.00 18.03 N
-ATOM 3998 CA HIS D 97 0.244 -6.637 -19.580 1.00 18.48 C
-ATOM 3999 C HIS D 97 -0.432 -5.796 -18.443 1.00 13.60 C
-ATOM 4000 O HIS D 97 -0.253 -4.620 -18.215 1.00 15.07 O
-ATOM 4001 CB HIS D 97 0.990 -5.653 -20.400 1.00 24.24 C
-ATOM 4002 CG HIS D 97 1.776 -6.391 -21.656 1.00 28.24 C
-ATOM 4003 ND1 HIS D 97 2.554 -7.432 -21.385 1.00 26.25 N
-ATOM 4004 CD2 HIS D 97 1.271 -6.244 -22.910 1.00 35.10 C
-ATOM 4005 CE1 HIS D 97 3.136 -7.961 -22.703 1.00 25.85 C
-ATOM 4006 NE2 HIS D 97 2.325 -7.208 -23.322 1.00 28.28 N
-ATOM 4007 N VAL D 98 -1.455 -6.545 -17.703 1.00 15.21 N
-ATOM 4008 CA VAL D 98 -2.210 -5.794 -16.736 1.00 14.55 C
-ATOM 4009 C VAL D 98 -1.489 -5.841 -15.285 1.00 10.52 C
-ATOM 4010 O VAL D 98 -1.368 -7.002 -14.827 1.00 11.77 O
-ATOM 4011 CB VAL D 98 -3.549 -6.468 -16.502 1.00 15.30 C
-ATOM 4012 CG1 VAL D 98 -4.339 -5.933 -15.325 1.00 15.30 C
-ATOM 4013 CG2 VAL D 98 -4.285 -6.152 -17.968 1.00 17.14 C
-ATOM 4014 N ASP D 99 -1.167 -4.730 -14.701 1.00 9.86 N
-ATOM 4015 CA ASP D 99 -0.610 -4.765 -13.282 1.00 10.99 C
-ATOM 4016 C ASP D 99 -1.652 -5.465 -12.445 1.00 12.34 C
-ATOM 4017 O ASP D 99 -2.837 -4.921 -12.433 1.00 15.90 O
-ATOM 4018 CB ASP D 99 -0.421 -3.334 -12.976 1.00 12.59 C
-ATOM 4019 CG ASP D 99 0.231 -3.018 -11.481 1.00 12.64 C
-ATOM 4020 OD1 ASP D 99 0.529 -1.770 -11.464 1.00 11.35 O
-ATOM 4021 OD2 ASP D 99 0.421 -4.097 -10.818 1.00 14.04 O
-ATOM 4022 N PRO D 100 -1.293 -6.422 -11.755 1.00 16.57 N
-ATOM 4023 CA PRO D 100 -2.075 -7.130 -10.712 1.00 11.14 C
-ATOM 4024 C PRO D 100 -2.767 -6.164 -9.672 1.00 11.03 C
-ATOM 4025 O PRO D 100 -3.730 -6.728 -9.131 1.00 12.40 O
-ATOM 4026 CB PRO D 100 -1.455 -8.509 -10.454 1.00 18.57 C
-ATOM 4027 CG PRO D 100 -0.120 -8.351 -10.644 1.00 16.52 C
-ATOM 4028 CD PRO D 100 0.008 -7.085 -11.678 1.00 15.61 C
-ATOM 4029 N GLU D 101 -2.120 -5.022 -9.432 1.00 9.29 N
-ATOM 4030 CA GLU D 101 -2.721 -4.184 -8.535 1.00 12.45 C
-ATOM 4031 C GLU D 101 -4.150 -3.766 -8.894 1.00 20.07 C
-ATOM 4032 O GLU D 101 -5.139 -3.640 -8.044 1.00 15.47 O
-ATOM 4033 CB GLU D 101 -1.898 -2.971 -8.352 1.00 18.48 C
-ATOM 4034 CG GLU D 101 -2.751 -1.912 -7.301 1.00 30.49 C
-ATOM 4035 CD GLU D 101 -2.928 -2.595 -5.361 1.00 32.99 C
-ATOM 4036 OE1 GLU D 101 -1.814 -3.251 -5.501 1.00 22.72 O
-ATOM 4037 OE2 GLU D 101 -3.790 -1.433 -5.275 1.00 37.16 O
-ATOM 4038 N ASN D 102 -4.416 -3.866 -10.222 1.00 14.86 N
-ATOM 4039 CA ASN D 102 -5.827 -3.553 -10.820 1.00 14.38 C
-ATOM 4040 C ASN D 102 -6.730 -4.706 -10.375 1.00 12.83 C
-ATOM 4041 O ASN D 102 -8.073 -4.305 -10.051 1.00 15.98 O
-ATOM 4042 CB ASN D 102 -5.825 -3.726 -12.202 1.00 15.85 C
-ATOM 4043 CG ASN D 102 -5.178 -2.418 -12.728 1.00 20.86 C
-ATOM 4044 OD1 ASN D 102 -5.594 -1.386 -12.707 1.00 17.49 O
-ATOM 4045 ND2 ASN D 102 -3.900 -2.610 -13.401 1.00 22.52 N
-ATOM 4046 N PHE D 103 -6.450 -5.902 -10.088 1.00 11.06 N
-ATOM 4047 CA PHE D 103 -7.223 -7.062 -9.594 1.00 11.10 C
-ATOM 4048 C PHE D 103 -7.838 -6.627 -8.138 1.00 14.83 C
-ATOM 4049 O PHE D 103 -9.038 -6.926 -7.755 1.00 12.07 O
-ATOM 4050 CB PHE D 103 -6.641 -8.378 -9.453 1.00 14.26 C
-ATOM 4051 CG PHE D 103 -5.978 -8.685 -10.884 1.00 14.43 C
-ATOM 4052 CD1 PHE D 103 -6.722 -8.442 -12.150 1.00 22.91 C
-ATOM 4053 CD2 PHE D 103 -4.777 -9.418 -10.920 1.00 19.84 C
-ATOM 4054 CE1 PHE D 103 -6.285 -8.812 -13.376 1.00 22.48 C
-ATOM 4055 CE2 PHE D 103 -4.350 -9.752 -12.200 1.00 13.44 C
-ATOM 4056 CZ PHE D 103 -4.988 -9.426 -13.435 1.00 16.91 C
-ATOM 4057 N ARG D 104 -6.979 -6.041 -7.313 1.00 14.96 N
-ATOM 4058 CA ARG D 104 -7.236 -5.640 -5.946 1.00 18.64 C
-ATOM 4059 C ARG D 104 -8.352 -4.439 -5.984 1.00 17.76 C
-ATOM 4060 O ARG D 104 -9.251 -4.482 -5.206 1.00 14.29 O
-ATOM 4061 CB ARG D 104 -5.925 -5.205 -5.097 1.00 19.67 C
-ATOM 4062 CG ARG D 104 -5.188 -6.366 -5.055 1.00 39.66 C
-ATOM 4063 CD ARG D 104 -3.686 -6.042 -4.324 1.00 67.99 C
-ATOM 4064 NE ARG D 104 -3.285 -7.833 -4.405 1.00 67.11 N
-ATOM 4065 CZ ARG D 104 -0.829 -7.130 -4.074 1.00 80.12 C
-ATOM 4066 NH1 ARG D 104 -1.228 -5.714 -3.904 1.00 77.56 N
-ATOM 4067 NH2 ARG D 104 -1.024 -7.904 -3.149 1.00 80.12 N
-ATOM 4068 N LEU D 105 -8.019 -3.490 -6.857 1.00 14.78 N
-ATOM 4069 CA LEU D 105 -8.933 -2.377 -6.997 1.00 11.66 C
-ATOM 4070 C LEU D 105 -10.366 -2.815 -7.384 1.00 13.52 C
-ATOM 4071 O LEU D 105 -11.325 -2.484 -6.781 1.00 12.56 O
-ATOM 4072 CB LEU D 105 -8.385 -1.463 -7.865 1.00 16.32 C
-ATOM 4073 CG LEU D 105 -7.155 -0.533 -7.691 1.00 23.61 C
-ATOM 4074 CD1 LEU D 105 -6.564 0.347 -8.601 1.00 25.65 C
-ATOM 4075 CD2 LEU D 105 -7.175 -0.008 -6.272 1.00 30.28 C
-ATOM 4076 N LEU D 106 -10.388 -3.731 -8.359 1.00 11.11 N
-ATOM 4077 CA LEU D 106 -11.776 -4.169 -8.774 1.00 10.81 C
-ATOM 4078 C LEU D 106 -12.425 -4.909 -7.735 1.00 7.04 C
-ATOM 4079 O LEU D 106 -13.596 -4.860 -7.508 1.00 8.65 O
-ATOM 4080 CB LEU D 106 -11.565 -5.136 -9.996 1.00 12.84 C
-ATOM 4081 CG LEU D 106 -12.908 -5.591 -10.559 1.00 16.25 C
-ATOM 4082 CD1 LEU D 106 -13.855 -4.506 -11.046 1.00 16.77 C
-ATOM 4083 CD2 LEU D 106 -12.516 -6.548 -11.540 1.00 20.04 C
-ATOM 4084 N GLY D 107 -11.735 -5.688 -6.939 1.00 12.52 N
-ATOM 4085 CA GLY D 107 -12.179 -6.516 -5.777 1.00 16.15 C
-ATOM 4086 C GLY D 107 -12.899 -5.574 -4.792 1.00 14.99 C
-ATOM 4087 O GLY D 107 -14.015 -5.773 -4.332 1.00 12.81 O
-ATOM 4088 N ASN D 108 -12.285 -4.436 -4.514 1.00 12.36 N
-ATOM 4089 CA ASN D 108 -12.802 -3.491 -3.621 1.00 14.00 C
-ATOM 4090 C ASN D 108 -13.963 -2.724 -4.098 1.00 11.43 C
-ATOM 4091 O ASN D 108 -15.056 -2.507 -3.385 1.00 12.39 O
-ATOM 4092 CB ASN D 108 -11.844 -2.454 -3.053 1.00 18.57 C
-ATOM 4093 CG ASN D 108 -10.617 -3.293 -1.988 1.00 22.26 C
-ATOM 4094 OD1 ASN D 108 -11.199 -4.293 -1.311 1.00 22.78 O
-ATOM 4095 ND2 ASN D 108 -9.853 -2.344 -1.843 1.00 30.03 N
-ATOM 4096 N VAL D 109 -13.924 -2.387 -5.385 1.00 10.09 N
-ATOM 4097 CA VAL D 109 -15.064 -1.848 -6.032 1.00 8.21 C
-ATOM 4098 C VAL D 109 -16.234 -2.783 -6.101 1.00 9.89 C
-ATOM 4099 O VAL D 109 -17.335 -2.321 -5.728 1.00 11.76 O
-ATOM 4100 CB VAL D 109 -14.656 -1.351 -7.492 1.00 11.59 C
-ATOM 4101 CG1 VAL D 109 -15.861 -0.846 -8.320 1.00 17.96 C
-ATOM 4102 CG2 VAL D 109 -13.771 -0.178 -7.377 1.00 17.98 C
-ATOM 4103 N LEU D 110 -15.952 -4.083 -6.403 1.00 9.62 N
-ATOM 4104 CA LEU D 110 -17.024 -5.059 -6.369 1.00 14.08 C
-ATOM 4105 C LEU D 110 -17.831 -5.035 -5.141 1.00 11.97 C
-ATOM 4106 O LEU D 110 -19.008 -5.257 -4.826 1.00 10.97 O
-ATOM 4107 CB LEU D 110 -16.600 -6.309 -6.770 1.00 15.34 C
-ATOM 4108 CG LEU D 110 -17.478 -7.458 -6.761 1.00 14.97 C
-ATOM 4109 CD1 LEU D 110 -18.670 -7.282 -7.592 1.00 23.21 C
-ATOM 4110 CD2 LEU D 110 -16.862 -8.829 -7.132 1.00 26.92 C
-ATOM 4111 N VAL D 111 -16.932 -5.013 -3.909 1.00 14.50 N
-ATOM 4112 CA VAL D 111 -17.557 -5.003 -2.482 1.00 11.82 C
-ATOM 4113 C VAL D 111 -18.496 -3.835 -2.339 1.00 14.01 C
-ATOM 4114 O VAL D 111 -19.560 -3.938 -1.746 1.00 12.03 O
-ATOM 4115 CB VAL D 111 -16.468 -5.174 -1.423 1.00 12.62 C
-ATOM 4116 CG1 VAL D 111 -17.105 -4.887 -0.077 1.00 15.85 C
-ATOM 4117 CG2 VAL D 111 -15.845 -6.615 -1.505 1.00 10.77 C
-ATOM 4118 N CYS D 112 -17.954 -2.598 -2.876 1.00 13.62 N
-ATOM 4119 CA CYS D 112 -18.674 -1.428 -2.875 1.00 13.72 C
-ATOM 4120 C CYS D 112 -20.245 -1.545 -3.397 1.00 20.10 C
-ATOM 4121 O CYS D 112 -21.199 -1.153 -2.984 1.00 16.56 O
-ATOM 4122 CB CYS D 112 -18.077 -0.213 -3.441 1.00 12.95 C
-ATOM 4123 SG CYS D 112 -16.890 0.371 -2.238 1.00 15.21 S
-ATOM 4124 N VAL D 113 -20.090 -2.259 -4.565 1.00 17.02 N
-ATOM 4125 CA VAL D 113 -21.229 -2.476 -5.537 1.00 12.28 C
-ATOM 4126 C VAL D 113 -22.216 -3.415 -4.943 1.00 12.56 C
-ATOM 4127 O VAL D 113 -23.393 -3.166 -4.833 1.00 15.84 O
-ATOM 4128 CB VAL D 113 -20.819 -3.012 -6.914 1.00 17.85 C
-ATOM 4129 CG1 VAL D 113 -22.007 -3.440 -7.657 1.00 18.74 C
-ATOM 4130 CG2 VAL D 113 -20.123 -1.688 -7.807 1.00 21.41 C
-ATOM 4131 N LEU D 114 -21.799 -4.480 -4.273 1.00 10.75 N
-ATOM 4132 CA LEU D 114 -22.611 -5.453 -3.526 1.00 10.78 C
-ATOM 4133 C LEU D 114 -23.336 -4.689 -2.455 1.00 19.00 C
-ATOM 4134 O LEU D 114 -24.454 -4.811 -2.196 1.00 11.46 O
-ATOM 4135 CB LEU D 114 -21.815 -6.582 -3.114 1.00 14.56 C
-ATOM 4136 CG LEU D 114 -21.183 -7.401 -4.241 1.00 17.11 C
-ATOM 4137 CD1 LEU D 114 -20.368 -8.591 -3.652 1.00 17.06 C
-ATOM 4138 CD2 LEU D 114 -22.473 -8.135 -5.021 1.00 20.86 C
-ATOM 4139 N ALA D 115 -22.573 -3.965 -1.677 1.00 11.71 N
-ATOM 4140 CA ALA D 115 -23.177 -3.124 -0.512 1.00 11.69 C
-ATOM 4141 C ALA D 115 -24.286 -2.193 -1.056 1.00 15.12 C
-ATOM 4142 O ALA D 115 -25.190 -2.078 -0.405 1.00 15.47 O
-ATOM 4143 CB ALA D 115 -22.014 -2.336 0.283 1.00 12.28 C
-ATOM 4144 N HIS D 116 -23.996 -1.420 -2.116 1.00 15.03 N
-ATOM 4145 CA HIS D 116 -24.955 -0.497 -2.730 1.00 12.09 C
-ATOM 4146 C HIS D 116 -26.163 -1.244 -3.183 1.00 12.50 C
-ATOM 4147 O HIS D 116 -27.367 -0.733 -2.977 1.00 15.93 O
-ATOM 4148 CB HIS D 116 -24.260 0.137 -3.930 1.00 20.66 C
-ATOM 4149 CG HIS D 116 -25.177 1.236 -4.511 1.00 27.72 C
-ATOM 4150 ND1 HIS D 116 -25.302 1.194 -5.752 1.00 29.99 N
-ATOM 4151 CD2 HIS D 116 -25.633 2.207 -3.823 1.00 30.96 C
-ATOM 4152 CE1 HIS D 116 -26.002 2.415 -6.103 1.00 27.26 C
-ATOM 4153 NE2 HIS D 116 -26.344 3.000 -4.762 1.00 28.89 N
-ATOM 4154 N HIS D 117 -26.018 -2.363 -3.828 1.00 13.33 N
-ATOM 4155 CA HIS D 117 -27.076 -3.136 -4.425 1.00 15.24 C
-ATOM 4156 C HIS D 117 -27.870 -3.712 -3.255 1.00 17.50 C
-ATOM 4157 O HIS D 117 -29.133 -3.855 -3.315 1.00 16.06 O
-ATOM 4158 CB HIS D 117 -26.496 -4.135 -5.434 1.00 17.22 C
-ATOM 4159 CG HIS D 117 -27.385 -4.774 -6.024 1.00 54.91 C
-ATOM 4160 ND1 HIS D 117 -28.250 -3.991 -7.312 1.00 47.40 N
-ATOM 4161 CD2 HIS D 117 -28.517 -5.901 -5.930 1.00 49.34 C
-ATOM 4162 CE1 HIS D 117 -29.253 -5.278 -7.522 1.00 48.36 C
-ATOM 4163 NE2 HIS D 117 -29.230 -6.041 -6.924 1.00 37.10 N
-ATOM 4164 N PHE D 118 -27.360 -4.464 -2.297 1.00 14.50 N
-ATOM 4165 CA PHE D 118 -28.031 -5.299 -1.218 1.00 19.30 C
-ATOM 4166 C PHE D 118 -28.313 -4.501 -0.028 1.00 20.52 C
-ATOM 4167 O PHE D 118 -29.066 -5.081 0.915 1.00 18.09 O
-ATOM 4168 CB PHE D 118 -27.213 -6.481 -0.908 1.00 18.97 C
-ATOM 4169 CG PHE D 118 -27.223 -7.413 -2.204 1.00 18.93 C
-ATOM 4170 CD1 PHE D 118 -26.304 -7.801 -3.109 1.00 24.34 C
-ATOM 4171 CD2 PHE D 118 -28.509 -8.118 -2.367 1.00 26.48 C
-ATOM 4172 CE1 PHE D 118 -26.170 -8.548 -4.227 1.00 20.81 C
-ATOM 4173 CE2 PHE D 118 -28.524 -8.992 -3.636 1.00 22.90 C
-ATOM 4174 CZ PHE D 118 -27.563 -8.928 -4.575 1.00 38.52 C
-ATOM 4175 N GLY D 119 -27.754 -3.376 0.316 1.00 12.95 N
-ATOM 4176 CA GLY D 119 -28.196 -2.563 1.458 1.00 17.60 C
-ATOM 4177 C GLY D 119 -27.642 -3.404 2.740 1.00 22.58 C
-ATOM 4178 O GLY D 119 -26.745 -4.123 2.946 1.00 17.60 O
-ATOM 4179 N LYS D 120 -28.738 -3.418 3.697 1.00 21.46 N
-ATOM 4180 CA LYS D 120 -28.403 -3.844 5.025 1.00 20.05 C
-ATOM 4181 C LYS D 120 -28.472 -5.257 5.045 1.00 21.98 C
-ATOM 4182 O LYS D 120 -27.730 -5.889 5.925 1.00 18.57 O
-ATOM 4183 CB LYS D 120 -29.674 -3.273 5.899 1.00 27.28 C
-ATOM 4184 CG LYS D 120 -30.525 -4.321 5.995 1.00 44.07 C
-ATOM 4185 CD LYS D 120 -31.907 -4.631 6.867 1.00 48.21 C
-ATOM 4186 CE LYS D 120 -33.041 -5.118 5.873 1.00 53.23 C
-ATOM 4187 NZ LYS D 120 -34.578 -6.152 7.224 1.00 62.54 N
-ATOM 4188 N GLU D 121 -28.504 -6.080 4.008 1.00 25.88 N
-ATOM 4189 CA GLU D 121 -28.273 -7.343 3.934 1.00 20.02 C
-ATOM 4190 C GLU D 121 -26.675 -7.822 3.749 1.00 18.96 C
-ATOM 4191 O GLU D 121 -26.335 -8.975 4.074 1.00 16.05 O
-ATOM 4192 CB GLU D 121 -29.032 -8.153 2.527 1.00 28.13 C
-ATOM 4193 CG GLU D 121 -28.995 -9.238 2.561 1.00 40.20 C
-ATOM 4194 CD GLU D 121 -30.346 -10.237 1.461 1.00 49.97 C
-ATOM 4195 OE1 GLU D 121 -29.357 -11.293 1.004 1.00 36.73 O
-ATOM 4196 OE2 GLU D 121 -30.336 -9.346 0.552 1.00 38.86 O
-ATOM 4197 N PHE D 122 -26.073 -6.783 3.271 1.00 14.83 N
-ATOM 4198 CA PHE D 122 -24.573 -7.060 3.133 1.00 20.37 C
-ATOM 4199 C PHE D 122 -23.961 -6.641 4.530 1.00 15.94 C
-ATOM 4200 O PHE D 122 -23.307 -5.592 4.698 1.00 17.73 O
-ATOM 4201 CB PHE D 122 -24.256 -6.093 2.128 1.00 14.63 C
-ATOM 4202 CG PHE D 122 -22.862 -6.484 1.494 1.00 12.39 C
-ATOM 4203 CD1 PHE D 122 -22.569 -7.575 0.927 1.00 14.73 C
-ATOM 4204 CD2 PHE D 122 -21.593 -5.712 1.717 1.00 15.96 C
-ATOM 4205 CE1 PHE D 122 -21.227 -8.021 0.354 1.00 19.03 C
-ATOM 4206 CE2 PHE D 122 -20.268 -6.011 1.383 1.00 16.31 C
-ATOM 4207 CZ PHE D 122 -20.290 -7.145 0.714 1.00 19.86 C
-ATOM 4208 N THR D 123 -24.154 -7.525 5.413 1.00 12.54 N
-ATOM 4209 CA THR D 123 -23.654 -7.132 6.808 1.00 13.34 C
-ATOM 4210 C THR D 123 -22.221 -7.283 6.854 1.00 15.73 C
-ATOM 4211 O THR D 123 -21.546 -7.802 6.060 1.00 13.84 O
-ATOM 4212 CB THR D 123 -24.160 -8.212 7.778 1.00 17.72 C
-ATOM 4213 OG1 THR D 123 -23.892 -9.520 7.414 1.00 19.04 O
-ATOM 4214 CG2 THR D 123 -25.951 -8.264 7.657 1.00 20.06 C
-ATOM 4215 N PRO D 124 -21.722 -6.789 8.010 1.00 17.46 N
-ATOM 4216 CA PRO D 124 -20.251 -6.940 8.311 1.00 14.41 C
-ATOM 4217 C PRO D 124 -19.706 -8.259 8.132 1.00 12.05 C
-ATOM 4218 O PRO D 124 -18.668 -8.405 7.486 1.00 13.28 O
-ATOM 4219 CB PRO D 124 -20.088 -6.243 9.615 1.00 14.54 C
-ATOM 4220 CG PRO D 124 -21.223 -5.227 9.715 1.00 15.93 C
-ATOM 4221 CD PRO D 124 -22.358 -6.045 9.113 1.00 14.57 C
-ATOM 4222 N PRO D 125 -20.257 -9.372 8.599 1.00 11.40 N
-ATOM 4223 CA PRO D 125 -19.807 -10.596 8.366 1.00 17.87 C
-ATOM 4224 C PRO D 125 -19.690 -11.236 6.993 1.00 15.21 C
-ATOM 4225 O PRO D 125 -18.781 -11.857 6.488 1.00 14.41 O
-ATOM 4226 CB PRO D 125 -20.651 -11.465 9.240 1.00 23.30 C
-ATOM 4227 CG PRO D 125 -21.148 -10.683 10.183 1.00 26.37 C
-ATOM 4228 CD PRO D 125 -21.413 -9.462 9.802 1.00 17.49 C
-ATOM 4229 N VAL D 126 -20.833 -10.714 6.263 1.00 17.66 N
-ATOM 4230 CA VAL D 126 -20.828 -11.114 4.812 1.00 21.55 C
-ATOM 4231 C VAL D 126 -19.574 -10.424 3.938 1.00 16.49 C
-ATOM 4232 O VAL D 126 -19.053 -10.988 3.156 1.00 13.46 O
-ATOM 4233 CB VAL D 126 -22.452 -10.640 4.161 1.00 13.98 C
-ATOM 4234 CG1 VAL D 126 -22.335 -11.055 2.842 1.00 20.70 C
-ATOM 4235 CG2 VAL D 126 -23.218 -11.661 4.994 1.00 18.54 C
-ATOM 4236 N GLN D 127 -19.567 -8.990 4.377 1.00 10.60 N
-ATOM 4237 CA GLN D 127 -18.404 -8.336 3.872 1.00 12.83 C
-ATOM 4238 C GLN D 127 -17.168 -9.034 3.964 1.00 13.74 C
-ATOM 4239 O GLN D 127 -16.333 -9.154 3.044 1.00 12.71 O
-ATOM 4240 CB GLN D 127 -18.494 -6.875 4.230 1.00 11.73 C
-ATOM 4241 CG GLN D 127 -17.167 -6.142 3.667 1.00 13.68 C
-ATOM 4242 CD GLN D 127 -16.957 -4.845 4.400 1.00 11.81 C
-ATOM 4243 OE1 GLN D 127 -17.847 -4.243 5.015 1.00 13.99 O
-ATOM 4244 NE2 GLN D 127 -15.920 -4.250 3.871 1.00 15.96 N
-ATOM 4245 N ALA D 128 -16.860 -9.470 5.254 1.00 12.61 N
-ATOM 4246 CA ALA D 128 -15.629 -10.118 5.636 1.00 9.64 C
-ATOM 4247 C ALA D 128 -15.294 -11.332 4.779 1.00 7.66 C
-ATOM 4248 O ALA D 128 -14.216 -11.498 4.302 1.00 11.68 O
-ATOM 4249 CB ALA D 128 -15.618 -10.468 7.105 1.00 13.80 C
-ATOM 4250 N ALA D 129 -16.442 -11.965 4.516 1.00 13.18 N
-ATOM 4251 CA ALA D 129 -16.351 -13.231 3.750 1.00 11.17 C
-ATOM 4252 C ALA D 129 -15.929 -12.840 2.277 1.00 11.52 C
-ATOM 4253 O ALA D 129 -15.098 -13.537 1.657 1.00 13.56 O
-ATOM 4254 CB ALA D 129 -17.591 -14.039 3.811 1.00 14.35 C
-ATOM 4255 N TYR D 130 -16.661 -11.959 1.697 1.00 13.36 N
-ATOM 4256 CA TYR D 130 -16.475 -11.445 0.343 1.00 13.72 C
-ATOM 4257 C TYR D 130 -15.053 -10.791 0.256 1.00 15.10 C
-ATOM 4258 O TYR D 130 -14.355 -11.020 -0.750 1.00 13.21 O
-ATOM 4259 CB TYR D 130 -17.422 -10.440 -0.057 1.00 13.30 C
-ATOM 4260 CG TYR D 130 -18.539 -11.158 -0.682 1.00 15.19 C
-ATOM 4261 CD1 TYR D 130 -18.456 -11.539 -1.989 1.00 16.58 C
-ATOM 4262 CD2 TYR D 130 -19.661 -11.646 -0.093 1.00 11.73 C
-ATOM 4263 CE1 TYR D 130 -19.348 -12.381 -2.950 1.00 20.28 C
-ATOM 4264 CE2 TYR D 130 -20.692 -12.412 -0.867 1.00 14.90 C
-ATOM 4265 CZ TYR D 130 -20.584 -12.824 -2.071 1.00 22.05 C
-ATOM 4266 OH TYR D 130 -21.522 -13.470 -2.725 1.00 20.92 O
-ATOM 4267 N GLN D 131 -14.583 -10.235 1.300 1.00 12.24 N
-ATOM 4268 CA GLN D 131 -13.174 -9.715 1.275 1.00 13.72 C
-ATOM 4269 C GLN D 131 -12.128 -10.656 1.064 1.00 20.69 C
-ATOM 4270 O GLN D 131 -11.251 -10.668 0.401 1.00 17.83 O
-ATOM 4271 CB GLN D 131 -12.830 -8.708 2.421 1.00 13.45 C
-ATOM 4272 CG GLN D 131 -13.616 -7.579 2.534 1.00 20.19 C
-ATOM 4273 CD GLN D 131 -13.161 -6.166 1.573 1.00 18.43 C
-ATOM 4274 OE1 GLN D 131 -14.035 -5.385 1.692 1.00 14.48 O
-ATOM 4275 NE2 GLN D 131 -12.233 -6.377 0.841 1.00 16.06 N
-ATOM 4276 N LYS D 132 -12.389 -11.876 1.744 1.00 12.67 N
-ATOM 4277 CA LYS D 132 -11.377 -12.991 1.725 1.00 15.63 C
-ATOM 4278 C LYS D 132 -11.407 -13.587 0.293 1.00 18.80 C
-ATOM 4279 O LYS D 132 -10.481 -13.843 -0.328 1.00 14.05 O
-ATOM 4280 CB LYS D 132 -11.780 -14.083 2.621 1.00 24.81 C
-ATOM 4281 CG LYS D 132 -11.356 -13.759 4.081 1.00 25.97 C
-ATOM 4282 CD LYS D 132 -11.952 -14.985 5.007 1.00 26.81 C
-ATOM 4283 CE LYS D 132 -12.396 -14.023 6.345 1.00 50.23 C
-ATOM 4284 NZ LYS D 132 -12.099 -16.364 7.125 1.00 63.38 N
-ATOM 4285 N VAL D 133 -12.646 -13.574 -0.320 1.00 13.42 N
-ATOM 4286 CA VAL D 133 -12.819 -14.186 -1.656 1.00 18.27 C
-ATOM 4287 C VAL D 133 -12.113 -13.235 -2.641 1.00 19.39 C
-ATOM 4288 O VAL D 133 -11.376 -13.757 -3.529 1.00 15.06 O
-ATOM 4289 CB VAL D 133 -14.347 -14.459 -2.009 1.00 17.40 C
-ATOM 4290 CG1 VAL D 133 -14.482 -14.527 -3.527 1.00 22.79 C
-ATOM 4291 CG2 VAL D 133 -14.897 -15.429 -1.020 1.00 19.90 C
-ATOM 4292 N VAL D 134 -12.419 -12.044 -2.631 1.00 14.66 N
-ATOM 4293 CA VAL D 134 -11.817 -11.184 -3.697 1.00 17.41 C
-ATOM 4294 C VAL D 134 -10.205 -10.998 -3.622 1.00 17.93 C
-ATOM 4295 O VAL D 134 -9.555 -11.088 -4.632 1.00 17.13 O
-ATOM 4296 CB VAL D 134 -12.523 -9.795 -3.826 1.00 16.69 C
-ATOM 4297 CG1 VAL D 134 -13.942 -9.809 -3.996 1.00 22.42 C
-ATOM 4298 CG2 VAL D 134 -12.135 -9.012 -2.596 1.00 16.30 C
-ATOM 4299 N ALA D 135 -9.754 -11.116 -2.425 1.00 16.25 N
-ATOM 4300 CA ALA D 135 -8.338 -11.031 -2.088 1.00 14.79 C
-ATOM 4301 C ALA D 135 -7.743 -12.494 -2.790 1.00 21.70 C
-ATOM 4302 O ALA D 135 -6.667 -12.571 -3.342 1.00 16.89 O
-ATOM 4303 CB ALA D 135 -7.946 -11.087 -0.719 1.00 18.34 C
-ATOM 4304 N GLY D 136 -8.430 -13.631 -2.593 1.00 17.40 N
-ATOM 4305 CA GLY D 136 -8.238 -14.854 -2.994 1.00 16.77 C
-ATOM 4306 C GLY D 136 -8.046 -14.863 -4.547 1.00 21.35 C
-ATOM 4307 O GLY D 136 -7.103 -15.386 -5.248 1.00 16.80 O
-ATOM 4308 N VAL D 137 -9.061 -14.287 -5.106 1.00 23.70 N
-ATOM 4309 CA VAL D 137 -9.117 -14.207 -6.516 1.00 26.49 C
-ATOM 4310 C VAL D 137 -8.271 -13.386 -7.311 1.00 33.07 C
-ATOM 4311 O VAL D 137 -7.434 -13.729 -8.023 1.00 30.90 O
-ATOM 4312 CB VAL D 137 -10.635 -13.731 -7.203 1.00 15.94 C
-ATOM 4313 CG1 VAL D 137 -10.606 -13.355 -8.722 1.00 21.57 C
-ATOM 4314 CG2 VAL D 137 -11.540 -14.757 -6.690 1.00 21.46 C
-ATOM 4315 N ALA D 138 -7.804 -12.254 -6.635 1.00 14.66 N
-ATOM 4316 CA ALA D 138 -6.688 -11.339 -7.074 1.00 18.95 C
-ATOM 4317 C ALA D 138 -5.417 -12.079 -7.070 1.00 18.17 C
-ATOM 4318 O ALA D 138 -4.593 -11.997 -7.851 1.00 14.81 O
-ATOM 4319 CB ALA D 138 -6.540 -10.040 -6.183 1.00 19.78 C
-ATOM 4320 N ASN D 139 -5.187 -12.811 -5.928 1.00 15.30 N
-ATOM 4321 CA ASN D 139 -3.937 -13.374 -5.586 1.00 18.41 C
-ATOM 4322 C ASN D 139 -3.703 -14.483 -6.697 1.00 25.63 C
-ATOM 4323 O ASN D 139 -2.635 -14.913 -7.329 1.00 23.38 O
-ATOM 4324 CB ASN D 139 -3.989 -14.050 -4.592 1.00 50.89 C
-ATOM 4325 CG ASN D 139 -3.194 -13.790 -3.503 1.00 63.06 C
-ATOM 4326 OD1 ASN D 139 -2.135 -15.017 -3.938 1.00 52.41 O
-ATOM 4327 ND2 ASN D 139 -3.072 -12.228 -3.482 1.00 29.84 N
-ATOM 4328 N ALA D 140 -4.873 -15.260 -6.949 1.00 19.40 N
-ATOM 4329 CA ALA D 140 -5.005 -16.402 -7.986 1.00 23.09 C
-ATOM 4330 C ALA D 140 -4.740 -15.710 -9.403 1.00 18.16 C
-ATOM 4331 O ALA D 140 -3.930 -16.420 -10.089 1.00 16.51 O
-ATOM 4332 CB ALA D 140 -6.303 -16.997 -8.071 1.00 18.14 C
-ATOM 4333 N LEU D 141 -5.172 -14.659 -9.775 1.00 14.97 N
-ATOM 4334 CA LEU D 141 -4.899 -14.068 -11.011 1.00 14.94 C
-ATOM 4335 C LEU D 141 -3.434 -13.602 -11.198 1.00 11.73 C
-ATOM 4336 O LEU D 141 -2.840 -13.285 -12.242 1.00 15.21 O
-ATOM 4337 CB LEU D 141 -6.006 -12.939 -11.311 1.00 15.16 C
-ATOM 4338 CG LEU D 141 -7.325 -13.394 -11.757 1.00 17.87 C
-ATOM 4339 CD1 LEU D 141 -7.836 -12.121 -12.278 1.00 24.86 C
-ATOM 4340 CD2 LEU D 141 -6.860 -13.940 -13.382 1.00 16.07 C
-ATOM 4341 N ALA D 142 -2.826 -13.097 -10.036 1.00 14.26 N
-ATOM 4342 CA ALA D 142 -1.439 -12.718 -10.054 1.00 17.21 C
-ATOM 4343 C ALA D 142 -0.379 -13.783 -9.991 1.00 18.46 C
-ATOM 4344 O ALA D 142 0.751 -13.412 -10.228 1.00 18.92 O
-ATOM 4345 CB ALA D 142 -1.279 -11.774 -8.892 1.00 19.11 C
-ATOM 4346 N HIS D 143 -0.748 -15.020 -9.767 1.00 19.75 N
-ATOM 4347 CA HIS D 143 0.079 -16.200 -9.518 1.00 26.63 C
-ATOM 4348 C HIS D 143 1.176 -16.436 -10.670 1.00 23.72 C
-ATOM 4349 O HIS D 143 2.224 -16.803 -10.136 1.00 24.41 O
-ATOM 4350 CB HIS D 143 -0.669 -17.339 -8.942 1.00 25.89 C
-ATOM 4351 CG HIS D 143 0.097 -18.406 -8.683 1.00 56.45 C
-ATOM 4352 ND1 HIS D 143 0.122 -19.475 -9.292 1.00 44.25 N
-ATOM 4353 CD2 HIS D 143 1.035 -18.261 -7.098 1.00 48.81 C
-ATOM 4354 CE1 HIS D 143 1.293 -20.089 -8.356 1.00 56.93 C
-ATOM 4355 NE2 HIS D 143 1.407 -19.517 -7.123 1.00 49.27 N
-ATOM 4356 N LYS D 144 0.773 -16.313 -11.824 1.00 19.26 N
-ATOM 4357 CA LYS D 144 1.442 -16.574 -13.172 1.00 33.94 C
-ATOM 4358 C LYS D 144 2.421 -15.633 -13.479 1.00 32.28 C
-ATOM 4359 O LYS D 144 2.996 -15.637 -14.654 1.00 23.60 O
-ATOM 4360 CB LYS D 144 1.055 -17.526 -13.968 1.00 31.20 C
-ATOM 4361 CG LYS D 144 0.220 -18.870 -13.388 1.00 40.85 C
-ATOM 4362 CD LYS D 144 1.002 -19.972 -13.512 1.00 59.03 C
-ATOM 4363 CE LYS D 144 0.888 -21.048 -13.306 1.00 56.19 C
-ATOM 4364 NZ LYS D 144 1.510 -22.846 -14.338 1.00 70.96 N
-ATOM 4365 N TYR D 145 2.435 -14.424 -12.946 1.00 24.92 N
-ATOM 4366 CA TYR D 145 3.207 -13.372 -13.244 1.00 29.13 C
-ATOM 4367 C TYR D 145 4.717 -13.524 -13.102 1.00 38.17 C
-ATOM 4368 O TYR D 145 5.061 -14.114 -12.139 1.00 27.99 O
-ATOM 4369 CB TYR D 145 2.744 -12.016 -12.590 1.00 17.99 C
-ATOM 4370 CG TYR D 145 1.621 -11.268 -13.262 1.00 17.42 C
-ATOM 4371 CD1 TYR D 145 1.523 -10.110 -13.925 1.00 16.93 C
-ATOM 4372 CD2 TYR D 145 0.375 -12.020 -13.134 1.00 18.60 C
-ATOM 4373 CE1 TYR D 145 0.498 -9.521 -14.492 1.00 17.99 C
-ATOM 4374 CE2 TYR D 145 -0.813 -11.356 -13.802 1.00 14.96 C
-ATOM 4375 CZ TYR D 145 -0.763 -10.275 -14.381 1.00 12.85 C
-ATOM 4376 OH TYR D 145 -1.813 -9.580 -14.987 1.00 13.31 O
-ATOM 4377 N HIS D 146 5.428 -13.165 -14.072 1.00 26.11 N
-ATOM 4378 CA HIS D 146 7.054 -13.167 -14.050 1.00 31.89 C
-ATOM 4379 C HIS D 146 7.429 -12.153 -15.048 1.00 21.33 C
-ATOM 4380 O HIS D 146 6.931 -11.249 -15.530 1.00 27.92 O
-ATOM 4381 CB HIS D 146 7.223 -14.769 -14.665 1.00 30.13 C
-ATOM 4382 CG HIS D 146 6.497 -14.789 -15.882 1.00 40.51 C
-ATOM 4383 ND1 HIS D 146 7.552 -14.702 -17.398 1.00 47.51 N
-ATOM 4384 CD2 HIS D 146 5.784 -14.325 -16.776 1.00 45.49 C
-ATOM 4385 CE1 HIS D 146 7.188 -14.800 -17.949 1.00 56.67 C
-ATOM 4386 NE2 HIS D 146 5.714 -14.339 -18.353 1.00 37.33 N
-ATOM 4387 OXT HIS D 146 8.812 -12.134 -14.847 1.00 21.61 O
-TER 4388 HIS D 146
-HETATM 4389 FE HEM A 142 8.116 7.403 -15.045 1.00 18.07 FE
-HETATM 4390 CHA HEM A 142 8.585 7.902 -18.282 1.00 16.31 C
-HETATM 4391 CHB HEM A 142 10.355 9.805 -14.208 1.00 26.27 C
-HETATM 4392 CHC HEM A 142 8.341 6.363 -11.589 1.00 13.23 C
-HETATM 4393 CHD HEM A 142 6.988 4.088 -15.744 1.00 14.77 C
-HETATM 4394 NA HEM A 142 9.397 8.686 -16.211 1.00 16.46 N
-HETATM 4395 C1A HEM A 142 9.141 8.725 -17.504 1.00 17.40 C
-HETATM 4396 C2A HEM A 142 10.098 9.952 -17.887 1.00 18.53 C
-HETATM 4397 C3A HEM A 142 10.636 10.499 -16.796 1.00 18.36 C
-HETATM 4398 C4A HEM A 142 10.137 9.679 -15.611 1.00 16.88 C
-HETATM 4399 CMA HEM A 142 11.613 11.590 -16.732 1.00 21.20 C
-HETATM 4400 CAA HEM A 142 10.403 10.367 -19.312 1.00 25.54 C
-HETATM 4401 CBA HEM A 142 9.552 11.270 -19.659 1.00 31.38 C
-HETATM 4402 CGA HEM A 142 10.793 12.286 -21.342 1.00 44.82 C
-HETATM 4403 O1A HEM A 142 9.887 11.345 -21.943 1.00 39.10 O
-HETATM 4404 O2A HEM A 142 9.308 12.698 -21.487 1.00 54.71 O
-HETATM 4405 NB HEM A 142 9.343 8.012 -13.298 1.00 12.29 N
-HETATM 4406 C1B HEM A 142 9.938 9.271 -13.145 1.00 23.63 C
-HETATM 4407 C2B HEM A 142 10.318 9.380 -11.838 1.00 11.67 C
-HETATM 4408 C3B HEM A 142 9.660 8.341 -11.052 1.00 17.41 C
-HETATM 4409 C4B HEM A 142 9.028 7.467 -11.975 1.00 14.84 C
-HETATM 4410 CMB HEM A 142 11.048 10.634 -11.389 1.00 12.32 C
-HETATM 4411 CAB HEM A 142 9.567 8.336 -9.634 1.00 24.30 C
-HETATM 4412 CBB HEM A 142 10.576 8.441 -8.785 1.00 28.40 C
-HETATM 4413 NC HEM A 142 7.604 5.533 -13.949 1.00 15.07 N
-HETATM 4414 C1C HEM A 142 7.680 5.498 -12.499 1.00 13.39 C
-HETATM 4415 C2C HEM A 142 7.270 4.198 -12.170 1.00 11.20 C
-HETATM 4416 C3C HEM A 142 6.975 3.441 -13.304 1.00 8.94 C
-HETATM 4417 C4C HEM A 142 7.207 4.445 -14.517 1.00 10.29 C
-HETATM 4418 CMC HEM A 142 7.098 3.618 -10.845 1.00 13.77 C
-HETATM 4419 CAC HEM A 142 6.342 2.184 -13.525 1.00 13.45 C
-HETATM 4420 CBC HEM A 142 6.722 1.153 -12.766 1.00 11.27 C
-HETATM 4421 ND HEM A 142 7.715 6.202 -16.788 1.00 13.07 N
-HETATM 4422 C1D HEM A 142 7.302 4.989 -16.733 1.00 11.32 C
-HETATM 4423 C2D HEM A 142 7.141 4.644 -18.240 1.00 16.69 C
-HETATM 4424 C3D HEM A 142 7.540 5.718 -18.887 1.00 20.49 C
-HETATM 4425 C4D HEM A 142 8.172 6.582 -18.158 1.00 16.46 C
-HETATM 4426 CMD HEM A 142 6.354 3.385 -18.817 1.00 19.45 C
-HETATM 4427 CAD HEM A 142 7.621 5.740 -20.408 1.00 21.31 C
-HETATM 4428 CBD HEM A 142 8.764 5.354 -20.767 1.00 38.22 C
-HETATM 4429 CGD HEM A 142 9.138 5.049 -22.798 1.00 41.21 C
-HETATM 4430 O1D HEM A 142 9.998 5.836 -22.703 1.00 42.81 O
-HETATM 4431 O2D HEM A 142 8.349 4.920 -23.144 1.00 40.12 O
-HETATM 4432 P PO4 B 147 5.931 -21.573 3.319 1.00 32.97 P
-HETATM 4433 FE HEM B 148 9.333 -9.335 17.389 1.00 15.00 FE
-HETATM 4434 CHA HEM B 148 9.659 -10.155 20.773 1.00 21.59 C
-HETATM 4435 CHB HEM B 148 11.121 -12.190 16.575 1.00 16.50 C
-HETATM 4436 CHC HEM B 148 9.762 -8.175 14.122 1.00 16.82 C
-HETATM 4437 CHD HEM B 148 8.223 -6.187 18.294 1.00 16.19 C
-HETATM 4438 NA HEM B 148 10.260 -10.823 18.453 1.00 15.64 N
-HETATM 4439 C1A HEM B 148 10.199 -10.977 19.856 1.00 24.57 C
-HETATM 4440 C2A HEM B 148 10.940 -12.186 20.114 1.00 17.10 C
-HETATM 4441 C3A HEM B 148 11.529 -12.852 19.028 1.00 13.46 C
-HETATM 4442 C4A HEM B 148 10.911 -11.942 17.916 1.00 18.78 C
-HETATM 4443 CMA HEM B 148 12.211 -14.084 18.855 1.00 20.21 C
-HETATM 4444 CAA HEM B 148 11.171 -12.750 21.554 1.00 21.16 C
-HETATM 4445 CBA HEM B 148 10.089 -13.674 21.941 1.00 27.78 C
-HETATM 4446 CGA HEM B 148 9.936 -14.643 23.585 1.00 59.12 C
-HETATM 4447 O1A HEM B 148 10.040 -13.299 24.151 1.00 44.32 O
-HETATM 4448 O2A HEM B 148 9.582 -15.171 23.405 1.00 46.16 O
-HETATM 4449 NB HEM B 148 10.199 -10.051 15.722 1.00 12.71 N
-HETATM 4450 C1B HEM B 148 10.820 -11.284 15.524 1.00 10.36 C
-HETATM 4451 C2B HEM B 148 11.247 -11.528 14.048 1.00 7.33 C
-HETATM 4452 C3B HEM B 148 10.827 -10.448 13.495 1.00 15.63 C
-HETATM 4453 C4B HEM B 148 10.176 -9.458 14.534 1.00 15.33 C
-HETATM 4454 CMB HEM B 148 11.793 -12.748 13.802 1.00 14.96 C
-HETATM 4455 CAB HEM B 148 10.965 -10.083 11.934 1.00 19.63 C
-HETATM 4456 CBB HEM B 148 12.063 -10.466 11.288 1.00 39.39 C
-HETATM 4457 NC HEM B 148 9.104 -7.643 16.544 1.00 11.22 N
-HETATM 4458 C1C HEM B 148 9.223 -7.280 15.193 1.00 14.39 C
-HETATM 4459 C2C HEM B 148 8.943 -5.947 14.698 1.00 10.78 C
-HETATM 4460 C3C HEM B 148 8.461 -5.188 15.934 1.00 10.68 C
-HETATM 4461 C4C HEM B 148 8.575 -6.422 16.809 1.00 8.70 C
-HETATM 4462 CMC HEM B 148 9.067 -5.306 13.381 1.00 13.95 C
-HETATM 4463 CAC HEM B 148 7.915 -3.899 16.132 1.00 11.87 C
-HETATM 4464 CBC HEM B 148 8.359 -2.863 15.599 1.00 12.63 C
-HETATM 4465 ND HEM B 148 9.090 -8.239 19.067 1.00 16.72 N
-HETATM 4466 C1D HEM B 148 8.576 -7.046 19.346 1.00 18.32 C
-HETATM 4467 C2D HEM B 148 8.195 -6.791 20.753 1.00 15.48 C
-HETATM 4468 C3D HEM B 148 8.512 -8.051 21.256 1.00 14.57 C
-HETATM 4469 C4D HEM B 148 9.290 -8.905 20.340 1.00 20.76 C
-HETATM 4470 CMD HEM B 148 7.722 -5.449 21.269 1.00 27.50 C
-HETATM 4471 CAD HEM B 148 8.696 -7.989 22.865 1.00 13.85 C
-HETATM 4472 CBD HEM B 148 10.051 -7.739 23.453 1.00 17.11 C
-HETATM 4473 CGD HEM B 148 10.333 -8.222 25.219 1.00 27.09 C
-HETATM 4474 O1D HEM B 148 11.372 -7.572 25.386 1.00 27.49 O
-HETATM 4475 O2D HEM B 148 9.169 -8.132 25.625 1.00 23.65 O
-HETATM 4476 FE HEM C 142 -8.129 7.348 15.002 1.00 16.89 FE
-HETATM 4477 CHA HEM C 142 -8.630 7.776 18.352 1.00 18.96 C
-HETATM 4478 CHB HEM C 142 -10.320 10.048 14.384 1.00 20.49 C
-HETATM 4479 CHC HEM C 142 -8.304 6.446 11.794 1.00 15.25 C
-HETATM 4480 CHD HEM C 142 -6.900 4.052 15.698 1.00 14.70 C
-HETATM 4481 NA HEM C 142 -9.276 8.702 16.089 1.00 16.55 N
-HETATM 4482 C1A HEM C 142 -9.195 8.664 17.417 1.00 16.72 C
-HETATM 4483 C2A HEM C 142 -10.045 9.791 17.916 1.00 15.73 C
-HETATM 4484 C3A HEM C 142 -10.613 10.462 16.942 1.00 17.27 C
-HETATM 4485 C4A HEM C 142 -10.077 9.749 15.710 1.00 12.07 C
-HETATM 4486 CMA HEM C 142 -11.422 11.658 16.756 1.00 31.88 C
-HETATM 4487 CAA HEM C 142 -10.321 10.351 19.308 1.00 24.60 C
-HETATM 4488 CBA HEM C 142 -9.201 11.341 19.696 1.00 36.28 C
-HETATM 4489 CGA HEM C 142 -10.014 12.024 21.724 1.00 43.70 C
-HETATM 4490 O1A HEM C 142 -9.511 10.786 22.089 1.00 38.93 O
-HETATM 4491 O2A HEM C 142 -9.503 12.583 21.415 1.00 46.28 O
-HETATM 4492 NB HEM C 142 -9.138 8.185 13.333 1.00 12.79 N
-HETATM 4493 C1B HEM C 142 -9.882 9.419 13.260 1.00 18.45 C
-HETATM 4494 C2B HEM C 142 -10.342 9.474 11.782 1.00 12.95 C
-HETATM 4495 C3B HEM C 142 -9.631 8.558 11.160 1.00 12.49 C
-HETATM 4496 C4B HEM C 142 -8.945 7.665 12.157 1.00 8.33 C
-HETATM 4497 CMB HEM C 142 -11.015 10.631 11.441 1.00 15.16 C
-HETATM 4498 CAB HEM C 142 -9.701 8.335 9.552 1.00 21.83 C
-HETATM 4499 CBB HEM C 142 -10.742 8.875 9.052 1.00 33.11 C
-HETATM 4500 NC HEM C 142 -7.518 5.627 13.990 1.00 12.28 N
-HETATM 4501 C1C HEM C 142 -7.751 5.629 12.596 1.00 15.97 C
-HETATM 4502 C2C HEM C 142 -7.320 4.232 12.130 1.00 9.41 C
-HETATM 4503 C3C HEM C 142 -6.879 3.543 13.304 1.00 11.73 C
-HETATM 4504 C4C HEM C 142 -7.009 4.441 14.484 1.00 15.36 C
-HETATM 4505 CMC HEM C 142 -7.210 3.774 10.722 1.00 13.23 C
-HETATM 4506 CAC HEM C 142 -6.459 2.233 13.437 1.00 19.55 C
-HETATM 4507 CBC HEM C 142 -6.761 1.082 12.572 1.00 14.52 C
-HETATM 4508 ND HEM C 142 -7.740 6.303 16.793 1.00 12.30 N
-HETATM 4509 C1D HEM C 142 -7.305 4.996 16.751 1.00 11.54 C
-HETATM 4510 C2D HEM C 142 -6.959 4.620 18.250 1.00 12.94 C
-HETATM 4511 C3D HEM C 142 -7.527 5.654 18.907 1.00 11.38 C
-HETATM 4512 C4D HEM C 142 -7.947 6.663 18.081 1.00 11.29 C
-HETATM 4513 CMD HEM C 142 -6.299 3.375 18.648 1.00 13.29 C
-HETATM 4514 CAD HEM C 142 -7.594 5.618 20.504 1.00 15.84 C
-HETATM 4515 CBD HEM C 142 -8.833 5.076 20.877 1.00 21.27 C
-HETATM 4516 CGD HEM C 142 -9.085 5.314 22.774 1.00 26.94 C
-HETATM 4517 O1D HEM C 142 -10.036 5.486 22.824 1.00 30.21 O
-HETATM 4518 O2D HEM C 142 -8.326 4.541 23.113 1.00 25.95 O
-HETATM 4519 P PO4 D 147 -6.147 -21.111 -3.332 1.00 31.17 P
-HETATM 4520 FE HEM D 148 -9.504 -9.265 -17.387 1.00 15.46 FE
-HETATM 4521 CHA HEM D 148 -9.813 -9.884 -20.599 1.00 19.84 C
-HETATM 4522 CHB HEM D 148 -11.252 -11.989 -16.610 1.00 16.61 C
-HETATM 4523 CHC HEM D 148 -9.951 -8.302 -14.119 1.00 13.93 C
-HETATM 4524 CHD HEM D 148 -8.200 -5.985 -18.127 1.00 15.88 C
-HETATM 4525 NA HEM D 148 -10.454 -10.804 -18.459 1.00 15.98 N
-HETATM 4526 C1A HEM D 148 -10.428 -10.865 -19.783 1.00 28.09 C
-HETATM 4527 C2A HEM D 148 -11.318 -12.071 -20.258 1.00 22.30 C
-HETATM 4528 C3A HEM D 148 -11.693 -12.664 -19.188 1.00 22.59 C
-HETATM 4529 C4A HEM D 148 -11.051 -11.756 -18.004 1.00 25.38 C
-HETATM 4530 CMA HEM D 148 -12.566 -13.772 -18.973 1.00 20.23 C
-HETATM 4531 CAA HEM D 148 -11.486 -12.464 -21.884 1.00 19.24 C
-HETATM 4532 CBA HEM D 148 -10.405 -12.971 -22.194 1.00 50.08 C
-HETATM 4533 CGA HEM D 148 -9.805 -13.296 -24.484 1.00 47.00 C
-HETATM 4534 O1A HEM D 148 -11.117 -13.581 -24.158 1.00 49.99 O
-HETATM 4535 O2A HEM D 148 -9.172 -14.946 -24.346 1.00 55.24 O
-HETATM 4536 NB HEM D 148 -10.364 -9.999 -15.688 1.00 14.27 N
-HETATM 4537 C1B HEM D 148 -10.937 -11.332 -15.462 1.00 14.32 C
-HETATM 4538 C2B HEM D 148 -11.232 -11.509 -14.176 1.00 15.75 C
-HETATM 4539 C3B HEM D 148 -10.801 -10.525 -13.479 1.00 14.95 C
-HETATM 4540 C4B HEM D 148 -10.217 -9.585 -14.421 1.00 12.78 C
-HETATM 4541 CMB HEM D 148 -11.799 -12.726 -13.757 1.00 18.74 C
-HETATM 4542 CAB HEM D 148 -10.869 -10.291 -11.895 1.00 16.19 C
-HETATM 4543 CBB HEM D 148 -11.756 -10.396 -11.494 1.00 34.22 C
-HETATM 4544 NC HEM D 148 -9.228 -7.489 -16.235 1.00 12.21 N
-HETATM 4545 C1C HEM D 148 -9.469 -7.417 -14.891 1.00 14.15 C
-HETATM 4546 C2C HEM D 148 -8.915 -5.898 -14.609 1.00 16.84 C
-HETATM 4547 C3C HEM D 148 -8.353 -5.322 -15.741 1.00 13.21 C
-HETATM 4548 C4C HEM D 148 -8.605 -6.360 -16.751 1.00 15.07 C
-HETATM 4549 CMC HEM D 148 -9.128 -5.229 -13.166 1.00 18.77 C
-HETATM 4550 CAC HEM D 148 -7.843 -4.077 -15.916 1.00 13.84 C
-HETATM 4551 CBC HEM D 148 -8.331 -3.032 -15.408 1.00 20.77 C
-HETATM 4552 ND HEM D 148 -9.282 -8.209 -19.162 1.00 12.94 N
-HETATM 4553 C1D HEM D 148 -8.465 -7.065 -19.281 1.00 18.28 C
-HETATM 4554 C2D HEM D 148 -8.394 -6.595 -20.574 1.00 20.40 C
-HETATM 4555 C3D HEM D 148 -8.861 -7.841 -21.341 1.00 19.16 C
-HETATM 4556 C4D HEM D 148 -9.573 -8.702 -20.531 1.00 19.80 C
-HETATM 4557 CMD HEM D 148 -7.686 -5.397 -21.106 1.00 25.65 C
-HETATM 4558 CAD HEM D 148 -8.956 -7.733 -22.890 1.00 23.94 C
-HETATM 4559 CBD HEM D 148 -10.040 -6.949 -23.304 1.00 45.78 C
-HETATM 4560 CGD HEM D 148 -10.579 -7.365 -25.200 1.00 48.49 C
-HETATM 4561 O1D HEM D 148 -9.907 -5.916 -25.395 1.00 40.71 O
-HETATM 4562 O2D HEM D 148 -9.982 -7.978 -25.490 1.00 45.79 O
-HETATM 4563 O HOH A 143 27.864 0.667 0.584 1.00 21.15 O
-HETATM 4564 O HOH A 144 10.459 5.072 -14.201 1.00 29.96 O
-HETATM 4565 O HOH A 145 17.782 -1.325 -26.109 1.00 23.65 O
-HETATM 4566 O HOH A 146 13.825 2.114 3.861 1.00 23.17 O
-HETATM 4567 O HOH A 147 16.741 12.813 9.083 1.00 26.86 O
-HETATM 4568 O HOH A 148 22.374 9.235 11.515 1.00 30.53 O
-HETATM 4569 O HOH A 149 25.903 -1.921 -7.245 1.00 27.68 O
-HETATM 4570 O HOH A 150 11.472 3.167 0.508 1.00 27.27 O
-HETATM 4571 O HOH A 151 30.661 6.822 -0.101 1.00 29.31 O
-HETATM 4572 O HOH A 152 -3.585 1.717 -5.969 1.00 29.54 O
-HETATM 4573 O HOH A 153 32.341 10.298 6.014 1.00 35.74 O
-HETATM 4574 O HOH A 154 34.406 10.442 4.080 1.00 31.58 O
-HETATM 4575 O HOH A 155 30.017 0.297 -1.177 1.00 37.73 O
-HETATM 4576 O HOH A 156 21.428 14.396 -13.024 1.00 37.58 O
-HETATM 4577 O HOH A 157 10.103 6.463 -0.224 1.00 29.83 O
-HETATM 4578 O HOH A 158 28.011 -0.672 -5.493 1.00 34.75 O
-HETATM 4579 O HOH A 159 12.221 6.676 -21.742 1.00 35.95 O
-HETATM 4580 O HOH A 160 0.070 13.369 -11.506 1.00 27.36 O
-HETATM 4581 O HOH A 161 6.073 -7.542 -8.224 1.00 27.80 O
-HETATM 4582 O HOH A 162 0.959 -1.910 -19.919 1.00 29.65 O
-HETATM 4583 O HOH A 163 -5.435 9.067 -14.288 1.00 30.27 O
-HETATM 4584 O HOH A 164 3.108 18.897 -10.351 1.00 37.13 O
-HETATM 4585 O HOH A 165 9.253 2.690 -0.595 1.00 31.92 O
-HETATM 4586 O HOH A 166 3.509 1.516 -20.390 1.00 30.86 O
-HETATM 4587 O HOH A 167 7.323 6.472 -2.528 1.00 34.91 O
-HETATM 4588 O HOH A 168 8.069 21.100 -2.836 1.00 34.13 O
-HETATM 4589 O HOH A 169 22.069 5.076 -17.599 1.00 36.10 O
-HETATM 4590 O HOH A 170 12.511 23.031 -13.238 1.00 37.77 O
-HETATM 4591 O HOH A 171 27.846 5.439 7.283 1.00 39.01 O
-HETATM 4592 O HOH A 172 16.593 -6.697 -7.432 1.00 35.74 O
-HETATM 4593 O HOH A 173 19.969 -3.554 -17.319 1.00 36.03 O
-HETATM 4594 O HOH A 174 14.440 13.918 -17.292 1.00 34.06 O
-HETATM 4595 O HOH A 175 30.151 3.417 -5.741 1.00 35.04 O
-HETATM 4596 O HOH A 176 8.360 5.321 2.557 1.00 38.02 O
-HETATM 4597 O HOH A 177 -6.479 11.748 -17.967 1.00 39.72 O
-HETATM 4598 O HOH A 178 8.608 18.432 -15.341 1.00 36.40 O
-HETATM 4599 O HOH A 179 13.827 13.620 8.994 1.00 37.52 O
-HETATM 4600 O HOH A 180 16.070 12.039 11.262 1.00 38.53 O
-HETATM 4601 O HOH A 181 2.747 5.937 -4.128 1.00 42.85 O
-HETATM 4602 O HOH A 182 7.523 20.881 -15.648 1.00 39.27 O
-HETATM 4603 O HOH A 183 11.712 -10.960 -5.769 1.00 38.61 O
-HETATM 4604 O HOH A 184 30.119 4.139 -8.587 1.00 34.80 O
-HETATM 4605 O HOH A 185 25.533 1.205 -11.184 1.00 42.30 O
-HETATM 4606 O HOH A 186 -4.812 12.384 -7.265 1.00 38.29 O
-HETATM 4607 O HOH A 187 23.809 19.925 1.758 1.00 39.37 O
-HETATM 4608 O HOH A 188 26.015 11.766 5.159 1.00 40.95 O
-HETATM 4609 O HOH A 189 14.639 24.823 -4.300 1.00 41.35 O
-HETATM 4610 O HOH A 190 14.903 5.393 -23.047 1.00 37.45 O
-HETATM 4611 O HOH A 191 16.650 -5.137 -16.717 1.00 39.12 O
-HETATM 4612 O HOH A 192 7.424 -6.700 -20.085 1.00 38.62 O
-HETATM 4613 O HOH A 193 23.120 -3.118 -12.992 1.00 37.05 O
-HETATM 4614 O HOH A 194 23.664 0.968 -14.389 1.00 36.25 O
-HETATM 4615 O HOH A 195 25.698 7.981 -15.362 1.00 35.85 O
-HETATM 4616 O HOH A 196 30.009 16.347 -6.794 1.00 37.62 O
-HETATM 4617 O HOH A 197 27.728 16.677 -1.376 1.00 42.54 O
-HETATM 4618 O HOH A 198 8.142 18.836 1.041 1.00 39.90 O
-HETATM 4619 O HOH B 149 0.093 -2.470 16.222 1.00 21.64 O
-HETATM 4620 O HOH B 150 -5.404 -9.289 14.863 1.00 29.94 O
-HETATM 4621 O HOH B 151 17.543 -13.863 -8.044 1.00 26.33 O
-HETATM 4622 O HOH B 152 10.126 -8.396 -0.639 1.00 27.87 O
-HETATM 4623 O HOH B 153 25.765 -4.888 -7.482 1.00 33.60 O
-HETATM 4624 O HOH B 154 31.028 -6.924 -0.005 1.00 27.86 O
-HETATM 4625 O HOH B 155 10.572 -9.505 7.329 1.00 34.89 O
-HETATM 4626 O HOH B 156 2.908 -19.221 10.523 1.00 29.82 O
-HETATM 4627 O HOH B 157 27.245 -11.383 -5.263 1.00 34.30 O
-HETATM 4628 O HOH B 158 5.726 -17.664 4.076 1.00 29.36 O
-HETATM 4629 O HOH B 159 30.677 -1.382 -3.264 1.00 34.23 O
-HETATM 4630 O HOH B 160 21.396 -19.202 9.299 1.00 34.06 O
-HETATM 4631 O HOH B 161 3.400 -4.625 22.878 1.00 34.98 O
-HETATM 4632 O HOH B 162 23.029 7.858 13.868 1.00 34.02 O
-HETATM 4633 O HOH B 163 10.054 0.537 2.970 1.00 33.29 O
-HETATM 4634 O HOH B 164 16.523 -14.815 19.144 1.00 32.12 O
-HETATM 4635 O HOH B 165 -3.521 -7.996 18.788 1.00 35.56 O
-HETATM 4636 O HOH B 166 9.429 -6.067 3.140 1.00 34.98 O
-HETATM 4637 O HOH B 167 25.800 -14.208 -2.740 1.00 37.65 O
-HETATM 4638 O HOH B 168 0.313 -14.430 5.859 1.00 34.45 O
-HETATM 4639 O HOH B 169 25.879 -15.224 10.033 1.00 33.37 O
-HETATM 4640 O HOH B 170 35.602 -4.153 -9.289 1.00 35.71 O
-HETATM 4641 O HOH B 171 20.781 6.254 23.632 1.00 38.68 O
-HETATM 4642 O HOH B 172 21.800 -18.543 12.994 1.00 40.56 O
-HETATM 4643 O HOH B 173 7.807 -19.735 16.230 1.00 34.56 O
-HETATM 4644 O HOH B 174 -2.047 -12.487 30.048 1.00 36.28 O
-HETATM 4645 O HOH B 175 13.681 -7.349 23.790 1.00 31.60 O
-HETATM 4646 O HOH B 176 24.831 -18.968 5.896 1.00 34.00 O
-HETATM 4647 O HOH B 177 5.475 -5.297 23.977 1.00 36.71 O
-HETATM 4648 O HOH B 178 15.904 -5.466 24.689 1.00 34.84 O
-HETATM 4649 O HOH B 179 22.123 0.182 16.584 1.00 33.20 O
-HETATM 4650 O HOH B 180 19.207 -15.705 -9.408 1.00 37.19 O
-HETATM 4651 O HOH B 181 25.174 -12.029 -8.381 1.00 35.87 O
-HETATM 4652 O HOH B 182 -10.362 -13.333 12.465 1.00 36.08 O
-HETATM 4653 O HOH B 183 12.092 8.997 23.297 1.00 38.22 O
-HETATM 4654 O HOH B 184 7.727 5.204 22.116 1.00 43.17 O
-HETATM 4655 O HOH B 185 30.137 -14.006 10.129 1.00 36.03 O
-HETATM 4656 O HOH B 186 13.730 -18.833 14.202 1.00 39.57 O
-HETATM 4657 O HOH B 187 22.379 8.870 23.585 1.00 37.45 O
-HETATM 4658 O HOH B 188 -4.205 -14.646 8.671 1.00 38.65 O
-HETATM 4659 O HOH B 189 12.589 14.261 19.653 1.00 36.93 O
-HETATM 4660 O HOH B 190 24.652 6.230 17.996 1.00 42.01 O
-HETATM 4661 O HOH B 191 8.775 -23.438 16.055 1.00 42.33 O
-HETATM 4662 O HOH B 192 -7.480 -10.898 17.998 1.00 38.06 O
-HETATM 4663 O HOH B 193 11.388 -11.044 24.763 1.00 39.34 O
-HETATM 4664 O HOH B 194 3.735 -3.643 2.734 1.00 42.17 O
-HETATM 4665 O HOH B 195 3.149 -0.692 2.083 1.00 41.40 O
-HETATM 4666 O HOH B 196 4.511 -25.886 13.006 1.00 39.83 O
-HETATM 4667 O HOH B 197 8.712 -21.655 3.577 1.00 43.08 O
-HETATM 4668 O HOH B 198 22.926 -4.304 24.079 1.00 38.10 O
-HETATM 4669 O HOH B 199 11.435 9.654 20.618 1.00 40.23 O
-HETATM 4670 O HOH B 200 18.099 5.542 27.744 1.00 39.03 O
-HETATM 4671 O HOH B 201 12.174 9.951 9.804 1.00 44.34 O
-HETATM 4672 O HOH B 202 24.745 -2.501 15.270 1.00 39.78 O
-HETATM 4673 O HOH B 203 24.231 0.100 14.764 1.00 42.94 O
-HETATM 4674 O HOH B 204 23.324 -18.136 10.981 1.00 53.60 O
-HETATM 4675 O HOH B 205 25.576 -22.211 6.309 1.00 45.18 O
-HETATM 4676 O HOH C 143 -2.661 -3.608 9.261 1.00 21.26 O
-HETATM 4677 O HOH C 144 0.111 13.200 11.373 1.00 21.54 O
-HETATM 4678 O HOH C 145 -16.704 12.691 -9.201 1.00 23.30 O
-HETATM 4679 O HOH C 146 -13.774 2.466 -4.032 1.00 22.15 O
-HETATM 4680 O HOH C 147 5.273 9.077 14.193 1.00 28.02 O
-HETATM 4681 O HOH C 148 -11.466 3.494 -0.405 1.00 32.97 O
-HETATM 4682 O HOH C 149 -10.454 4.898 14.327 1.00 33.04 O
-HETATM 4683 O HOH C 150 -7.824 6.701 2.273 1.00 27.40 O
-HETATM 4684 O HOH C 151 -1.248 -1.596 20.098 1.00 29.84 O
-HETATM 4685 O HOH C 152 2.150 -0.244 14.446 1.00 30.74 O
-HETATM 4686 O HOH C 153 -2.060 18.771 19.773 1.00 29.22 O
-HETATM 4687 O HOH C 154 -21.154 14.002 13.362 1.00 32.40 O
-HETATM 4688 O HOH C 155 -9.105 3.030 0.663 1.00 28.46 O
-HETATM 4689 O HOH C 156 0.739 12.802 4.676 1.00 38.51 O
-HETATM 4690 O HOH C 157 -8.549 18.107 15.436 1.00 35.20 O
-HETATM 4691 O HOH C 158 -3.358 1.489 20.400 1.00 39.88 O
-HETATM 4692 O HOH C 159 -2.351 -4.643 6.766 1.00 36.39 O
-HETATM 4693 O HOH C 160 -9.995 6.820 0.255 1.00 29.81 O
-HETATM 4694 O HOH C 161 -1.621 21.259 16.530 1.00 33.74 O
-HETATM 4695 O HOH C 162 -5.469 23.850 15.062 1.00 31.03 O
-HETATM 4696 O HOH C 163 3.572 1.751 6.044 1.00 29.72 O
-HETATM 4697 O HOH C 164 -12.295 6.520 21.611 1.00 31.11 O
-HETATM 4698 O HOH C 165 -14.251 13.845 17.234 1.00 30.77 O
-HETATM 4699 O HOH C 166 -17.414 -5.952 27.962 1.00 34.94 O
-HETATM 4700 O HOH C 167 -3.547 16.435 20.027 1.00 34.58 O
-HETATM 4701 O HOH C 168 -16.355 -6.652 7.174 1.00 37.69 O
-HETATM 4702 O HOH C 169 -7.541 12.855 -2.773 1.00 34.39 O
-HETATM 4703 O HOH C 170 -4.225 9.070 1.455 1.00 35.72 O
-HETATM 4704 O HOH C 171 -25.974 -1.828 7.173 1.00 32.50 O
-HETATM 4705 O HOH C 172 -9.581 -6.364 21.942 1.00 37.91 O
-HETATM 4706 O HOH C 173 -14.874 4.521 23.126 1.00 36.81 O
-HETATM 4707 O HOH C 174 -15.534 20.875 -10.339 1.00 37.83 O
-HETATM 4708 O HOH C 175 -8.242 21.385 2.969 1.00 35.70 O
-HETATM 4709 O HOH C 176 -5.634 24.523 6.954 1.00 37.22 O
-HETATM 4710 O HOH C 177 -22.981 14.501 -8.660 1.00 34.30 O
-HETATM 4711 O HOH C 178 -13.871 16.688 -10.143 1.00 36.92 O
-HETATM 4712 O HOH C 179 -20.275 19.235 8.097 1.00 34.30 O
-HETATM 4713 O HOH C 180 1.720 15.273 3.670 1.00 39.46 O
-HETATM 4714 O HOH C 181 -2.824 18.993 10.315 1.00 37.49 O
-HETATM 4715 O HOH C 182 -2.160 0.091 22.111 1.00 39.39 O
-HETATM 4716 O HOH C 183 7.922 12.037 14.216 1.00 34.40 O
-HETATM 4717 O HOH C 184 -2.698 5.986 4.174 1.00 37.01 O
-HETATM 4718 O HOH C 185 6.321 10.115 3.931 1.00 35.17 O
-HETATM 4719 O HOH C 186 -7.096 21.140 15.539 1.00 35.39 O
-HETATM 4720 O HOH C 187 -10.581 17.364 16.459 1.00 39.95 O
-HETATM 4721 O HOH C 188 -4.668 13.050 -0.747 1.00 39.36 O
-HETATM 4722 O HOH C 189 -4.764 -6.228 5.515 1.00 40.89 O
-HETATM 4723 O HOH C 190 4.693 12.083 7.558 1.00 40.24 O
-HETATM 4724 O HOH C 191 -4.731 16.453 2.295 1.00 36.37 O
-HETATM 4725 O HOH C 192 -1.055 11.866 -0.448 1.00 43.19 O
-HETATM 4726 O HOH C 193 -18.517 -8.355 15.267 1.00 35.55 O
-HETATM 4727 O HOH C 194 6.547 9.706 16.296 1.00 41.86 O
-HETATM 4728 O HOH C 195 0.029 22.606 14.164 1.00 43.02 O
-HETATM 4729 O HOH C 196 -11.367 0.306 28.463 1.00 44.30 O
-HETATM 4730 O HOH C 197 -19.950 -10.635 14.301 1.00 40.17 O
-HETATM 4731 O HOH C 198 -7.047 -6.324 20.098 1.00 36.98 O
-HETATM 4732 O HOH C 199 -23.876 1.108 14.102 1.00 33.31 O
-HETATM 4733 O HOH C 200 -34.199 8.033 11.037 1.00 40.72 O
-HETATM 4734 O HOH C 201 -14.173 13.393 -8.778 1.00 43.21 O
-HETATM 4735 O HOH D 149 0.061 -2.494 -16.397 1.00 18.64 O
-HETATM 4736 O HOH D 150 -8.041 -19.581 -16.153 1.00 26.28 O
-HETATM 4737 O HOH D 151 2.825 -3.769 -9.602 1.00 23.08 O
-HETATM 4738 O HOH D 152 -2.494 -0.118 -14.151 1.00 25.33 O
-HETATM 4739 O HOH D 153 -9.792 -8.060 0.750 1.00 30.48 O
-HETATM 4740 O HOH D 154 -6.518 -22.534 -15.665 1.00 34.60 O
-HETATM 4741 O HOH D 155 -17.398 -13.549 8.357 1.00 35.82 O
-HETATM 4742 O HOH D 156 5.350 -9.378 -15.018 1.00 27.68 O
-HETATM 4743 O HOH D 157 -6.300 -24.347 -19.100 1.00 35.93 O
-HETATM 4744 O HOH D 158 -9.520 7.447 -21.130 1.00 40.04 O
-HETATM 4745 O HOH D 159 -16.425 -5.250 -24.764 1.00 32.57 O
-HETATM 4746 O HOH D 160 -7.987 -14.493 1.146 1.00 34.30 O
-HETATM 4747 O HOH D 161 -3.890 0.572 -11.856 1.00 34.78 O
-HETATM 4748 O HOH D 162 -29.504 -0.198 -4.474 1.00 38.63 O
-HETATM 4749 O HOH D 163 -25.631 -15.732 -9.906 1.00 33.22 O
-HETATM 4750 O HOH D 164 -2.623 -18.453 -21.128 1.00 35.47 O
-HETATM 4751 O HOH D 165 -2.780 -19.130 -10.800 1.00 30.23 O
-HETATM 4752 O HOH D 166 -25.734 -4.456 7.605 1.00 34.33 O
-HETATM 4753 O HOH D 167 -11.771 -10.816 5.496 1.00 38.68 O
-HETATM 4754 O HOH D 168 -9.924 0.291 -2.970 1.00 38.71 O
-HETATM 4755 O HOH D 169 -25.514 -14.066 2.449 1.00 36.60 O
-HETATM 4756 O HOH D 170 -5.455 -17.392 -4.316 1.00 34.43 O
-HETATM 4757 O HOH D 171 2.688 -11.418 -8.564 1.00 35.73 O
-HETATM 4758 O HOH D 172 7.091 -10.993 -18.224 1.00 32.39 O
-HETATM 4759 O HOH D 173 -9.377 -6.399 -3.029 1.00 35.44 O
-HETATM 4760 O HOH D 174 -16.565 -17.782 -17.506 1.00 41.02 O
-HETATM 4761 O HOH D 175 -8.141 -3.463 -24.390 1.00 37.14 O
-HETATM 4762 O HOH D 176 -16.560 -15.177 -19.016 1.00 34.89 O
-HETATM 4763 O HOH D 177 3.477 -8.048 -19.033 1.00 35.94 O
-HETATM 4764 O HOH D 178 -24.698 -11.573 8.724 1.00 38.01 O
-HETATM 4765 O HOH D 179 2.193 -4.435 -6.557 1.00 38.51 O
-HETATM 4766 O HOH D 180 -29.898 -16.926 -2.135 1.00 36.37 O
-HETATM 4767 O HOH D 181 -7.374 8.034 -17.831 1.00 34.05 O
-HETATM 4768 O HOH D 182 -24.015 0.401 -15.301 1.00 39.14 O
-HETATM 4769 O HOH D 183 -12.141 9.790 -10.238 1.00 38.30 O
-HETATM 4770 O HOH D 184 -5.765 -3.569 -23.682 1.00 36.68 O
-HETATM 4771 O HOH D 185 -4.860 -9.811 -2.967 1.00 37.10 O
-HETATM 4772 O HOH D 186 -23.107 -4.490 -24.359 1.00 37.97 O
-HETATM 4773 O HOH D 187 -10.377 -9.632 -7.043 1.00 38.85 O
-HETATM 4774 O HOH D 188 -7.871 -9.078 2.406 1.00 43.37 O
-HETATM 4775 O HOH D 189 -27.610 -10.991 5.353 1.00 43.46 O
-HETATM 4776 O HOH D 190 -14.034 2.806 -30.367 1.00 41.77 O
-HETATM 4777 O HOH D 191 -32.905 -9.033 0.480 1.00 43.68 O
-HETATM 4778 O HOH D 192 -28.749 -13.315 1.938 1.00 45.36 O
-HETATM 4779 O HOH D 193 0.516 -8.074 -26.354 1.00 41.53 O
-HETATM 4780 O HOH D 194 -20.080 -9.873 -22.862 1.00 36.25 O
-HETATM 4781 O HOH D 195 -13.442 9.778 -13.572 1.00 39.70 O
-HETATM 4782 O HOH D 196 -24.804 -2.608 -15.488 1.00 37.79 O
-HETATM 4783 O HOH D 197 -1.263 -2.837 -21.251 1.00 45.10 O
-CONECT 650 4389
-CONECT 1771 4433
-CONECT 2844 4476
-CONECT 3965 4520
-CONECT 4389 650 4394 4405 4413
-CONECT 4389 4421
-CONECT 4390 4395 4425
-CONECT 4391 4398 4406
-CONECT 4392 4409 4414
-CONECT 4393 4417 4422
-CONECT 4394 4389 4395 4398
-CONECT 4395 4390 4394 4396
-CONECT 4396 4395 4397 4400
-CONECT 4397 4396 4398 4399
-CONECT 4398 4391 4394 4397
-CONECT 4399 4397
-CONECT 4400 4396 4401
-CONECT 4401 4400 4402
-CONECT 4402 4401 4403 4404
-CONECT 4403 4402
-CONECT 4404 4402
-CONECT 4405 4389 4406 4409
-CONECT 4406 4391 4405 4407
-CONECT 4407 4406 4408 4410
-CONECT 4408 4407 4409 4411
-CONECT 4409 4392 4405 4408
-CONECT 4410 4407
-CONECT 4411 4408 4412
-CONECT 4412 4411
-CONECT 4413 4389 4414 4417
-CONECT 4414 4392 4413 4415
-CONECT 4415 4414 4416 4418
-CONECT 4416 4415 4417 4419
-CONECT 4417 4393 4413 4416
-CONECT 4418 4415
-CONECT 4419 4416 4420
-CONECT 4420 4419
-CONECT 4421 4389 4422 4425
-CONECT 4422 4393 4421 4423
-CONECT 4423 4422 4424 4426
-CONECT 4424 4423 4425 4427
-CONECT 4425 4390 4421 4424
-CONECT 4426 4423
-CONECT 4427 4424 4428
-CONECT 4428 4427 4429
-CONECT 4429 4428 4430 4431
-CONECT 4430 4429
-CONECT 4431 4429
-CONECT 4433 1771 4438 4449 4457
-CONECT 4433 4465
-CONECT 4434 4439 4469
-CONECT 4435 4442 4450
-CONECT 4436 4453 4458
-CONECT 4437 4461 4466
-CONECT 4438 4433 4439 4442
-CONECT 4439 4434 4438 4440
-CONECT 4440 4439 4441 4444
-CONECT 4441 4440 4442 4443
-CONECT 4442 4435 4438 4441
-CONECT 4443 4441
-CONECT 4444 4440 4445
-CONECT 4445 4444 4446
-CONECT 4446 4445 4447 4448
-CONECT 4447 4446
-CONECT 4448 4446
-CONECT 4449 4433 4450 4453
-CONECT 4450 4435 4449 4451
-CONECT 4451 4450 4452 4454
-CONECT 4452 4451 4453 4455
-CONECT 4453 4436 4449 4452
-CONECT 4454 4451
-CONECT 4455 4452 4456
-CONECT 4456 4455
-CONECT 4457 4433 4458 4461
-CONECT 4458 4436 4457 4459
-CONECT 4459 4458 4460 4462
-CONECT 4460 4459 4461 4463
-CONECT 4461 4437 4457 4460
-CONECT 4462 4459
-CONECT 4463 4460 4464
-CONECT 4464 4463
-CONECT 4465 4433 4466 4469
-CONECT 4466 4437 4465 4467
-CONECT 4467 4466 4468 4470
-CONECT 4468 4467 4469 4471
-CONECT 4469 4434 4465 4468
-CONECT 4470 4467
-CONECT 4471 4468 4472
-CONECT 4472 4471 4473
-CONECT 4473 4472 4474 4475
-CONECT 4474 4473
-CONECT 4475 4473
-CONECT 4476 2844 4481 4492 4500
-CONECT 4476 4508
-CONECT 4477 4482 4512
-CONECT 4478 4485 4493
-CONECT 4479 4496 4501
-CONECT 4480 4504 4509
-CONECT 4481 4476 4482 4485
-CONECT 4482 4477 4481 4483
-CONECT 4483 4482 4484 4487
-CONECT 4484 4483 4485 4486
-CONECT 4485 4478 4481 4484
-CONECT 4486 4484
-CONECT 4487 4483 4488
-CONECT 4488 4487 4489
-CONECT 4489 4488 4490 4491
-CONECT 4490 4489
-CONECT 4491 4489
-CONECT 4492 4476 4493 4496
-CONECT 4493 4478 4492 4494
-CONECT 4494 4493 4495 4497
-CONECT 4495 4494 4496 4498
-CONECT 4496 4479 4492 4495
-CONECT 4497 4494
-CONECT 4498 4495 4499
-CONECT 4499 4498
-CONECT 4500 4476 4501 4504
-CONECT 4501 4479 4500 4502
-CONECT 4502 4501 4503 4505
-CONECT 4503 4502 4504 4506
-CONECT 4504 4480 4500 4503
-CONECT 4505 4502
-CONECT 4506 4503 4507
-CONECT 4507 4506
-CONECT 4508 4476 4509 4512
-CONECT 4509 4480 4508 4510
-CONECT 4510 4509 4511 4513
-CONECT 4511 4510 4512 4514
-CONECT 4512 4477 4508 4511
-CONECT 4513 4510
-CONECT 4514 4511 4515
-CONECT 4515 4514 4516
-CONECT 4516 4515 4517 4518
-CONECT 4517 4516
-CONECT 4518 4516
-CONECT 4520 3965 4525 4536 4544
-CONECT 4520 4552
-CONECT 4521 4526 4556
-CONECT 4522 4529 4537
-CONECT 4523 4540 4545
-CONECT 4524 4548 4553
-CONECT 4525 4520 4526 4529
-CONECT 4526 4521 4525 4527
-CONECT 4527 4526 4528 4531
-CONECT 4528 4527 4529 4530
-CONECT 4529 4522 4525 4528
-CONECT 4530 4528
-CONECT 4531 4527 4532
-CONECT 4532 4531 4533
-CONECT 4533 4532 4534 4535
-CONECT 4534 4533
-CONECT 4535 4533
-CONECT 4536 4520 4537 4540
-CONECT 4537 4522 4536 4538
-CONECT 4538 4537 4539 4541
-CONECT 4539 4538 4540 4542
-CONECT 4540 4523 4536 4539
-CONECT 4541 4538
-CONECT 4542 4539 4543
-CONECT 4543 4542
-CONECT 4544 4520 4545 4548
-CONECT 4545 4523 4544 4546
-CONECT 4546 4545 4547 4549
-CONECT 4547 4546 4548 4550
-CONECT 4548 4524 4544 4547
-CONECT 4549 4546
-CONECT 4550 4547 4551
-CONECT 4551 4550
-CONECT 4552 4520 4553 4556
-CONECT 4553 4524 4552 4554
-CONECT 4554 4553 4555 4557
-CONECT 4555 4554 4556 4558
-CONECT 4556 4521 4552 4555
-CONECT 4557 4554
-CONECT 4558 4555 4559
-CONECT 4559 4558 4560
-CONECT 4560 4559 4561 4562
-CONECT 4561 4560
-CONECT 4562 4560
-MASTER 868 1 6 32 0 0 16 9 4779 4 180 46
-END
diff --git a/android/examples/Demos/Graphics/RotatingArcs/RotatingArcs.pde b/android/examples/Demos/Graphics/RotatingArcs/RotatingArcs.pde
deleted file mode 100644
index b51b74f389..0000000000
--- a/android/examples/Demos/Graphics/RotatingArcs/RotatingArcs.pde
+++ /dev/null
@@ -1,162 +0,0 @@
-/**
- * Geometry
- * by Marius Watz.
- *
- * Using sin/cos lookup tables, blends colors, and draws a series of
- * rotating arcs on the screen.
-*/
-
-// Trig lookup tables borrowed from Toxi; cryptic but effective.
-float sinLUT[];
-float cosLUT[];
-float SINCOS_PRECISION=1.0;
-int SINCOS_LENGTH= int((360.0/SINCOS_PRECISION));
-
-// System data
-boolean dosave=false;
-int num;
-float pt[];
-int style[];
-
-
-void setup() {
- size(displayWidth, displayHeight, P3D);
- background(255);
-
- // Fill the tables
- sinLUT=new float[SINCOS_LENGTH];
- cosLUT=new float[SINCOS_LENGTH];
- for (int i = 0; i < SINCOS_LENGTH; i++) {
- sinLUT[i]= (float)Math.sin(i*DEG_TO_RAD*SINCOS_PRECISION);
- cosLUT[i]= (float)Math.cos(i*DEG_TO_RAD*SINCOS_PRECISION);
- }
-
- num = 50;
- pt = new float[6*num]; // rotx, roty, deg, rad, w, speed
- style = new int[2*num]; // color, render style
-
- // Set up arc shapes
- int index=0;
- float prob;
- for (int i=0; i90) pt[index]=(int)random(8,27)*10;
-
- pt[index++] = int(random(2,50)*5); // Radius. Space them out nicely
-
- pt[index++] = random(4,32); // Width of band
- if(random(100)>90) pt[index]=random(40,60); // Width of band
-
- pt[index++] = radians(random(5,30))/5; // Speed of rotation
-
- // get colors
- prob = random(100);
- if(prob<30) style[i*2]=colorBlended(random(1), 255,0,100, 255,0,0, 210);
- else if(prob<70) style[i*2]=colorBlended(random(1), 0,153,255, 170,225,255, 210);
- else if(prob<90) style[i*2]=colorBlended(random(1), 200,255,0, 150,255,0, 210);
- else style[i*2]=color(255,255,255, 220);
-
- if(prob<50) style[i*2]=colorBlended(random(1), 200,255,0, 50,120,0, 210);
- else if(prob<90) style[i*2]=colorBlended(random(1), 255,100,0, 255,255,0, 210);
- else style[i*2]=color(255,255,255, 220);
-
- style[i*2+1]=(int)(random(100))%3;
- }
-}
-
-void draw() {
-
- background(0);
-
- int index=0;
- translate(width/2, height/2, 0);
- rotateX(PI/6);
- rotateY(PI/6);
-
- for (int i = 0; i < num; i++) {
- pushMatrix();
-
- rotateX(pt[index++]);
- rotateY(pt[index++]);
-
- if(style[i*2+1]==0) {
- stroke(style[i*2]);
- noFill();
- strokeWeight(1);
- arcLine(0,0, pt[index++],pt[index++],pt[index++]);
- }
- else if(style[i*2+1]==1) {
- fill(style[i*2]);
- noStroke();
- arcLineBars(0,0, pt[index++],pt[index++],pt[index++]);
- }
- else {
- fill(style[i*2]);
- noStroke();
- arc(0,0, pt[index++],pt[index++],pt[index++]);
- }
-
- // increase rotation
- pt[index-5]+=pt[index]/10;
- pt[index-4]+=pt[index++]/20;
-
- popMatrix();
- }
-}
-
-
-// Get blend of two colors
-int colorBlended(float fract,
-float r, float g, float b,
-float r2, float g2, float b2, float a) {
-
- r2 = (r2 - r);
- g2 = (g2 - g);
- b2 = (b2 - b);
- return color(r + r2 * fract, g + g2 * fract, b + b2 * fract, a);
-}
-
-
-// Draw arc line
-void arcLine(float x,float y,float deg,float rad,float w) {
- int a=(int)(min (deg/SINCOS_PRECISION,SINCOS_LENGTH-1));
- int numlines=(int)(w/2);
-
- for (int j=0; j= capacity) {
- // there are all sorts of possible solutions here,
- // but for abject simplicity, I don't do anything.
- }
- else {
- float v = distToLast(x, y);
- float p = getPressureFromVelocity(v);
- path[nPoints++].set(x,y,p);
-
- if (nPoints > 1) {
- exists = true;
- jumpDx = path[nPoints-1].x - path[0].x;
- jumpDy = path[nPoints-1].y - path[0].y;
- }
- }
-
- }
-
- float getPressureFromVelocity(float v) {
- final float scale = 18;
- final float minP = 0.02;
- final float oldP = (nPoints > 0) ? path[nPoints-1].p : 0;
- return ((minP + max(0, 1.0 - v/scale)) + (damp1*oldP))*dampInv;
- }
-
- void setPressures() {
- // pressures vary from 0...1
- float pressure;
- Vec3f tmp;
- float t = 0;
- float u = 1.0 / (nPoints - 1)*TWO_PI;
- for (int i = 0; i < nPoints; i++) {
- pressure = sqrt((1.0 - cos(t))*0.5);
- path[i].p = pressure;
- t += u;
- }
- }
-
- float distToLast(float ix, float iy) {
- if (nPoints > 0) {
- Vec3f v = path[nPoints-1];
- float dx = v.x - ix;
- float dy = v.y - iy;
- return mag(dx, dy);
- }
- else {
- return 30;
- }
- }
-
- void compile() {
- // compute the polygons from the path of Vec3f's
- if (exists) {
- clearPolys();
-
- Vec3f p0, p1, p2;
- float radius0, radius1;
- float ax, bx, cx, dx;
- float ay, by, cy, dy;
- int axi, bxi, cxi, dxi, axip, axid;
- int ayi, byi, cyi, dyi, ayip, ayid;
- float p1x, p1y;
- float dx01, dy01, hp01, si01, co01;
- float dx02, dy02, hp02, si02, co02;
- float dx13, dy13, hp13, si13, co13;
- float taper = 1.0;
-
- int nPathPoints = nPoints - 1;
- int lastPolyIndex = nPathPoints - 1;
- float npm1finv = 1.0 / max(1, nPathPoints - 1);
-
- // handle the first point
- p0 = path[0];
- p1 = path[1];
- radius0 = p0.p * thickness;
- dx01 = p1.x - p0.x;
- dy01 = p1.y - p0.y;
- hp01 = sqrt(dx01*dx01 + dy01*dy01);
- if (hp01 == 0) {
- hp02 = 0.0001;
- }
- co01 = radius0 * dx01 / hp01;
- si01 = radius0 * dy01 / hp01;
- ax = p0.x - si01;
- ay = p0.y + co01;
- bx = p0.x + si01;
- by = p0.y - co01;
-
- int xpts[];
- int ypts[];
-
- int LC = 20;
- int RC = w-LC;
- int TC = 20;
- int BC = h-TC;
- float mint = 0.618;
- float tapow = 0.4;
-
- // handle the middle points
- int i = 1;
- Polygon apoly;
- for (i = 1; i < nPathPoints; i++) {
- taper = pow((lastPolyIndex-i)*npm1finv,tapow);
-
- p0 = path[i-1];
- p1 = path[i ];
- p2 = path[i+1];
- p1x = p1.x;
- p1y = p1.y;
- radius1 = Math.max(mint,taper*p1.p*thickness);
-
- // assumes all segments are roughly the same length...
- dx02 = p2.x - p0.x;
- dy02 = p2.y - p0.y;
- hp02 = (float) Math.sqrt(dx02*dx02 + dy02*dy02);
- if (hp02 != 0) {
- hp02 = radius1/hp02;
- }
- co02 = dx02 * hp02;
- si02 = dy02 * hp02;
-
- // translate the integer coordinates to the viewing rectangle
- axi = axip = (int)ax;
- ayi = ayip = (int)ay;
- axi=(axi<0)?(w-((-axi)%w)):axi%w;
- axid = axi-axip;
- ayi=(ayi<0)?(h-((-ayi)%h)):ayi%h;
- ayid = ayi-ayip;
-
- // set the vertices of the polygon
- apoly = polygons[nPolys++];
- xpts = apoly.xpoints;
- ypts = apoly.ypoints;
- xpts[0] = axi = axid + axip;
- xpts[1] = bxi = axid + (int) bx;
- xpts[2] = cxi = axid + (int)(cx = p1x + si02);
- xpts[3] = dxi = axid + (int)(dx = p1x - si02);
- ypts[0] = ayi = ayid + ayip;
- ypts[1] = byi = ayid + (int) by;
- ypts[2] = cyi = ayid + (int)(cy = p1y - co02);
- ypts[3] = dyi = ayid + (int)(dy = p1y + co02);
-
- // keep a record of where we cross the edge of the screen
- crosses[i] = 0;
- if ((axi<=LC)||(bxi<=LC)||(cxi<=LC)||(dxi<=LC)) {
- crosses[i]|=1;
- }
- if ((axi>=RC)||(bxi>=RC)||(cxi>=RC)||(dxi>=RC)) {
- crosses[i]|=2;
- }
- if ((ayi<=TC)||(byi<=TC)||(cyi<=TC)||(dyi<=TC)) {
- crosses[i]|=4;
- }
- if ((ayi>=BC)||(byi>=BC)||(cyi>=BC)||(dyi>=BC)) {
- crosses[i]|=8;
- }
-
- //swap data for next time
- ax = dx;
- ay = dy;
- bx = cx;
- by = cy;
- }
-
- // handle the last point
- p2 = path[nPathPoints];
- apoly = polygons[nPolys++];
- xpts = apoly.xpoints;
- ypts = apoly.ypoints;
-
- xpts[0] = (int)ax;
- xpts[1] = (int)bx;
- xpts[2] = (int)(p2.x);
- xpts[3] = (int)(p2.x);
-
- ypts[0] = (int)ay;
- ypts[1] = (int)by;
- ypts[2] = (int)(p2.y);
- ypts[3] = (int)(p2.y);
-
- }
- }
-
- void smooth() {
- // average neighboring points
-
- final float weight = 18;
- final float scale = 1.0 / (weight + 2);
- int nPointsMinusTwo = nPoints - 2;
- Vec3f lower, upper, center;
-
- for (int i = 1; i < nPointsMinusTwo; i++) {
- lower = path[i-1];
- center = path[i];
- upper = path[i+1];
-
- center.x = (lower.x + weight*center.x + upper.x)*scale;
- center.y = (lower.y + weight*center.y + upper.y)*scale;
- }
- }
-}
-
diff --git a/android/examples/Demos/Graphics/Yellowtail/Polygon.pde b/android/examples/Demos/Graphics/Yellowtail/Polygon.pde
deleted file mode 100644
index f00d538753..0000000000
--- a/android/examples/Demos/Graphics/Yellowtail/Polygon.pde
+++ /dev/null
@@ -1,12 +0,0 @@
-public class Polygon {
- int npoints;
- int[] xpoints;
- int[] ypoints;
-
- public Polygon(int n) {
- npoints = n;
- xpoints = new int[n];
- ypoints = new int[n];
- }
-}
-
diff --git a/android/examples/Demos/Graphics/Yellowtail/Vec3f.pde b/android/examples/Demos/Graphics/Yellowtail/Vec3f.pde
deleted file mode 100644
index 865d3c32ff..0000000000
--- a/android/examples/Demos/Graphics/Yellowtail/Vec3f.pde
+++ /dev/null
@@ -1,19 +0,0 @@
-class Vec3f {
- float x;
- float y;
- float p; // Pressure
-
- Vec3f() {
- set(0, 0, 0);
- }
-
- Vec3f(float ix, float iy, float ip) {
- set(ix, iy, ip);
- }
-
- void set(float ix, float iy, float ip) {
- x = ix;
- y = iy;
- p = ip;
- }
-}
diff --git a/android/examples/Demos/Graphics/Yellowtail/Yellowtail.pde b/android/examples/Demos/Graphics/Yellowtail/Yellowtail.pde
deleted file mode 100644
index a26cba3fc2..0000000000
--- a/android/examples/Demos/Graphics/Yellowtail/Yellowtail.pde
+++ /dev/null
@@ -1,186 +0,0 @@
-/**
- * Yellowtail
- * by Golan Levin (www.flong.com).
- *
- * Click, drag, and release to create a kinetic gesture.
- *
- * Yellowtail (1998-2000) is an interactive software system for the gestural
- * creation and performance of real-time abstract animation. Yellowtail repeats
- * a user's strokes end-over-end, enabling simultaneous specification of a
- * line's shape and quality of movement. Each line repeats according to its
- * own period, producing an ever-changing and responsive display of lively,
- * worm-like textures.
- */
-
-Gesture gestureArray[];
-final int nGestures = 36; // Number of gestures
-final int minMove = 3; // Minimum travel for a new point
-int currentGestureID;
-
-Polygon tempP;
-int tmpXp[];
-int tmpYp[];
-
-
-void setup() {
- size(displayWidth, displayHeight, P2D);
- background(0, 0, 0);
- noStroke();
-
- currentGestureID = -1;
- gestureArray = new Gesture[nGestures];
- for (int i = 0; i < nGestures; i++) {
- gestureArray[i] = new Gesture(width, height);
- }
- clearGestures();
-}
-
-
-void draw() {
- background(0);
-
- updateGeometry();
- fill(255, 255, 245);
- for (int i = 0; i < nGestures; i++) {
- renderGesture(gestureArray[i], width, height);
- }
-}
-
-void mousePressed() {
- currentGestureID = (currentGestureID+1) % nGestures;
- Gesture G = gestureArray[currentGestureID];
- G.clear();
- G.clearPolys();
- G.addPoint(mouseX, mouseY);
-}
-
-
-void mouseDragged() {
- if (currentGestureID >= 0) {
- Gesture G = gestureArray[currentGestureID];
- if (G.distToLast(mouseX, mouseY) > minMove) {
- G.addPoint(mouseX, mouseY);
- G.smooth();
- G.compile();
- }
- }
-}
-
-
-void keyPressed() {
- if (key == '+' || key == '=') {
- if (currentGestureID >= 0) {
- float th = gestureArray[currentGestureID].thickness;
- gestureArray[currentGestureID].thickness = min(96, th+1);
- gestureArray[currentGestureID].compile();
- }
- } else if (key == '-') {
- if (currentGestureID >= 0) {
- float th = gestureArray[currentGestureID].thickness;
- gestureArray[currentGestureID].thickness = max(2, th-1);
- gestureArray[currentGestureID].compile();
- }
- } else if (key == ' ') {
- clearGestures();
- }
-}
-
-
-void renderGesture(Gesture gesture, int w, int h) {
- if (gesture.exists) {
- if (gesture.nPolys > 0) {
- Polygon polygons[] = gesture.polygons;
- int crosses[] = gesture.crosses;
-
- int xpts[];
- int ypts[];
- Polygon p;
- int cr;
-
- beginShape(QUADS);
- int gnp = gesture.nPolys;
- for (int i=0; i 0) {
- if ((cr & 3)>0) {
- vertex(xpts[0]+w, ypts[0]);
- vertex(xpts[1]+w, ypts[1]);
- vertex(xpts[2]+w, ypts[2]);
- vertex(xpts[3]+w, ypts[3]);
-
- vertex(xpts[0]-w, ypts[0]);
- vertex(xpts[1]-w, ypts[1]);
- vertex(xpts[2]-w, ypts[2]);
- vertex(xpts[3]-w, ypts[3]);
- }
- if ((cr & 12)>0) {
- vertex(xpts[0], ypts[0]+h);
- vertex(xpts[1], ypts[1]+h);
- vertex(xpts[2], ypts[2]+h);
- vertex(xpts[3], ypts[3]+h);
-
- vertex(xpts[0], ypts[0]-h);
- vertex(xpts[1], ypts[1]-h);
- vertex(xpts[2], ypts[2]-h);
- vertex(xpts[3], ypts[3]-h);
- }
-
- // I have knowingly retained the small flaw of not
- // completely dealing with the corner conditions
- // (the case in which both of the above are true).
- }
- }
- endShape();
- }
- }
-}
-
-void updateGeometry() {
- Gesture J;
- for (int g=0; g 0) {
- path = gesture.path;
- for (int i = nPts1; i > 0; i--) {
- path[i].x = path[i-1].x;
- path[i].y = path[i-1].y;
- }
- path[0].x = path[nPts1].x - jx;
- path[0].y = path[nPts1].y - jy;
- gesture.compile();
- }
- }
-}
-
-void clearGestures() {
- for (int i = 0; i < nGestures; i++) {
- gestureArray[i].clear();
- }
-}
diff --git a/android/examples/Demos/Performance/CubicGridImmediate/CubicGridImmediate.pde b/android/examples/Demos/Performance/CubicGridImmediate/CubicGridImmediate.pde
deleted file mode 100644
index 1faa0bcb42..0000000000
--- a/android/examples/Demos/Performance/CubicGridImmediate/CubicGridImmediate.pde
+++ /dev/null
@@ -1,66 +0,0 @@
-/**
- * Cubic Grid
- * by Ira Greenberg.
- *
- * 3D translucent colored grid uses nested pushMatrix()
- * and popMatrix() functions.
- */
-
-float boxSize = 50;
-float margin = boxSize*2;
-float depth = 400;
-color boxFill;
-
-int fcount, lastm;
-float frate;
-int fint = 3;
-
-void setup() {
- size(640, 360, P3D);
- orientation(LANDSCAPE);
- frameRate(60);
- noSmooth();
- noStroke();
-}
-
-void draw() {
- background(255);
-
- hint(DISABLE_DEPTH_TEST);
-
- // Center and spin grid
- pushMatrix();
- translate(width/2, height/2, -depth);
- rotateY(frameCount * 0.01);
- rotateX(frameCount * 0.01);
-
- // Build grid using multiple translations
- for (float i =- depth/2+margin; i <= depth/2-margin; i += boxSize){
- for (float j =- height+margin; j <= height-margin; j += boxSize){
- for (float k =- width+margin; k <= width-margin; k += boxSize){
- // Base fill color on counter values, abs function
- // ensures values stay within legal range
- boxFill = color(abs(i), abs(j), abs(k), 50);
- pushMatrix();
- translate(k, j, i);
- fill(boxFill);
- box(boxSize, boxSize, boxSize);
- popMatrix();
- }
- }
- }
- popMatrix();
-
- hint(ENABLE_DEPTH_TEST);
-
- fcount += 1;
- int m = millis();
- if (m - lastm > 1000 * fint) {
- frate = float(fcount) / fint;
- fcount = 0;
- lastm = m;
- println("fps: " + frate);
- }
- fill(0);
- text("fps: " + frate, 10, 20);
-}
diff --git a/android/examples/Demos/Performance/CubicGridRetained/CubicGridRetained.pde b/android/examples/Demos/Performance/CubicGridRetained/CubicGridRetained.pde
deleted file mode 100644
index 86ce457205..0000000000
--- a/android/examples/Demos/Performance/CubicGridRetained/CubicGridRetained.pde
+++ /dev/null
@@ -1,63 +0,0 @@
-float boxSize = 50;
-float margin = boxSize*2;
-float depth = 400;
-color boxFill;
-
-PShape grid;
-
-int fcount, lastm;
-float frate;
-int fint = 3;
-
-void setup() {
- size(640, 360, P3D);
- orientation(LANDSCAPE);
- frameRate(60);
- noSmooth();
- noStroke();
-
- grid = createShape(GROUP);
-
- // Build grid using multiple translations
- for (float i =- depth/2+margin; i <= depth/2-margin; i += boxSize){
- for (float j =- height+margin; j <= height-margin; j += boxSize){
- for (float k =- width+margin; k <= width-margin; k += boxSize){
- // Base fill color on counter values, abs function
- // ensures values stay within legal range
- boxFill = color(abs(i), abs(j), abs(k), 50);
- PShape cube = createShape(BOX, boxSize, boxSize, boxSize);
- cube.setFill(boxFill);
- cube.translate(k, j, i);
- grid.addChild(cube);
- }
- }
- }
-}
-
-void draw() {
- background(255);
-
- hint(DISABLE_DEPTH_TEST);
-
- // Center and spin grid
- pushMatrix();
- translate(width/2, height/2, -depth);
- rotateY(frameCount * 0.01);
- rotateX(frameCount * 0.01);
-
- shape(grid);
- popMatrix();
-
- hint(ENABLE_DEPTH_TEST);
-
- fcount += 1;
- int m = millis();
- if (m - lastm > 1000 * fint) {
- frate = float(fcount) / fint;
- fcount = 0;
- lastm = m;
- println("fps: " + frate);
- }
- fill(0);
- text("fps: " + frate, 10, 20);
-}
diff --git a/android/examples/Demos/Performance/DynamicParticlesImmediate/DynamicParticlesImmediate.pde b/android/examples/Demos/Performance/DynamicParticlesImmediate/DynamicParticlesImmediate.pde
deleted file mode 100644
index f7e9c9cac4..0000000000
--- a/android/examples/Demos/Performance/DynamicParticlesImmediate/DynamicParticlesImmediate.pde
+++ /dev/null
@@ -1,119 +0,0 @@
-PImage sprite;
-
-int npartTotal = 1000;
-int npartPerFrame = 10;
-float speed = 1.0;
-float gravity = 0.05;
-float partSize = 20;
-
-int partLifetime;
-PVector positions[];
-PVector velocities[];
-int lifetimes[];
-
-int fcount, lastm;
-float frate;
-int fint = 3;
-
-void setup() {
- size(640, 480, P3D);
- orientation(LANDSCAPE);
- frameRate(60);
-
- sprite = loadImage("sprite.png");
-
- partLifetime = npartTotal / npartPerFrame;
- initPositions();
- initVelocities();
- initLifetimes();
-
- // Writing to the depth buffer is disabled to avoid rendering
- // artifacts due to the fact that the particles are semi-transparent
- // but not z-sorted.
- hint(DISABLE_DEPTH_MASK);
-
- // Testing some hints
- //hint(DISABLE_TRANSFORM_CACHE);
- //hint(ENABLE_ACCURATE_2D);
-}
-
-void draw () {
- background(0);
-
- for (int n = 0; n < npartTotal; n++) {
- lifetimes[n]++;
- if (lifetimes[n] == partLifetime) {
- lifetimes[n] = 0;
- }
-
- if (0 <= lifetimes[n]) {
- float opacity = 1.0 - float(lifetimes[n]) / partLifetime;
-
- if (lifetimes[n] == 0) {
- // Re-spawn dead particle
- positions[n].x = mouseX;
- positions[n].y = mouseY;
-
- float angle = random(0, TWO_PI);
- float s = random(0.5 * speed, 0.5 * speed);
- velocities[n].x = s * cos(angle);
- velocities[n].y = s * sin(angle);
- } else {
- positions[n].x += velocities[n].x;
- positions[n].y += velocities[n].y;
-
- velocities[n].y += gravity;
- }
- drawParticle(positions[n], opacity);
- }
- }
-
- fcount += 1;
- int m = millis();
- if (m - lastm > 1000 * fint) {
- frate = float(fcount) / fint;
- fcount = 0;
- lastm = m;
- println("fps: " + frate);
- }
-}
-
-void drawParticle(PVector center, float opacity) {
- beginShape(QUAD);
- noStroke();
- tint(255, opacity * 255);
- texture(sprite);
- normal(0, 0, 1);
- vertex(center.x - partSize/2, center.y - partSize/2, 0, 0);
- vertex(center.x + partSize/2, center.y - partSize/2, sprite.width, 0);
- vertex(center.x + partSize/2, center.y + partSize/2, sprite.width, sprite.height);
- vertex(center.x - partSize/2, center.y + partSize/2, 0, sprite.height);
- endShape();
-}
-
-void initPositions() {
- positions = new PVector[npartTotal];
- for (int n = 0; n < positions.length; n++) {
- positions[n] = new PVector();
- }
-}
-
-void initVelocities() {
- velocities = new PVector[npartTotal];
- for (int n = 0; n < velocities.length; n++) {
- velocities[n] = new PVector();
- }
-}
-
-void initLifetimes() {
- // Initializing particles with negative lifetimes so they are added
- // progressively into the screen during the first frames of the sketch
- lifetimes = new int[npartTotal];
- int t = -1;
- for (int n = 0; n < lifetimes.length; n++) {
- if (n % npartPerFrame == 0) {
- t++;
- }
- lifetimes[n] = -t;
- }
-}
diff --git a/android/examples/Demos/Performance/DynamicParticlesImmediate/data/sprite.png b/android/examples/Demos/Performance/DynamicParticlesImmediate/data/sprite.png
deleted file mode 100644
index cc0f45cba1..0000000000
Binary files a/android/examples/Demos/Performance/DynamicParticlesImmediate/data/sprite.png and /dev/null differ
diff --git a/android/examples/Demos/Performance/DynamicParticlesRetained/DynamicParticlesRetained.pde b/android/examples/Demos/Performance/DynamicParticlesRetained/DynamicParticlesRetained.pde
deleted file mode 100644
index 10f312e978..0000000000
--- a/android/examples/Demos/Performance/DynamicParticlesRetained/DynamicParticlesRetained.pde
+++ /dev/null
@@ -1,112 +0,0 @@
-PShape particles;
-PImage sprite;
-
-int npartTotal = 1000;
-int npartPerFrame = 10;
-float speed = 1.0;
-float gravity = 0.05;
-float partSize = 20;
-
-int partLifetime;
-PVector velocities[];
-int lifetimes[];
-
-int fcount, lastm;
-float frate;
-int fint = 3;
-
-void setup() {
- size(640, 480, P3D);
- orientation(LANDSCAPE);
- frameRate(60);
-
- particles = createShape(PShape.GROUP);
- sprite = loadImage("sprite.png");
-
- for (int n = 0; n < npartTotal; n++) {
- PShape part = createShape();
- part.beginShape(QUAD);
- part.noStroke();
- part.texture(sprite);
- part.normal(0, 0, 1);
- part.vertex(-partSize/2, -partSize/2, 0, 0);
- part.vertex(+partSize/2, -partSize/2, sprite.width, 0);
- part.vertex(+partSize/2, +partSize/2, sprite.width, sprite.height);
- part.vertex(-partSize/2, +partSize/2, 0, sprite.height);
- part.endShape();
- particles.addChild(part);
- }
-
- partLifetime = npartTotal / npartPerFrame;
- initVelocities();
- initLifetimes();
-
- // Writing to the depth buffer is disabled to avoid rendering
- // artifacts due to the fact that the particles are semi-transparent
- // but not z-sorted.
- hint(DISABLE_DEPTH_MASK);
-}
-
-void draw () {
- background(0);
-
- for (int n = 0; n < particles.getChildCount(); n++) {
- PShape part = particles.getChild(n);
-
- lifetimes[n]++;
- if (lifetimes[n] == partLifetime) {
- lifetimes[n] = 0;
- }
-
- if (0 <= lifetimes[n]) {
- float opacity = 1.0 - float(lifetimes[n]) / partLifetime;
- part.setTint(color(255, opacity * 255));
-
- if (lifetimes[n] == 0) {
- // Re-spawn dead particle
- part.resetMatrix();
- part.translate(mouseX, mouseY);
- float angle = random(0, TWO_PI);
- float s = random(0.5 * speed, 0.5 * speed);
- velocities[n].x = s * cos(angle);
- velocities[n].y = s * sin(angle);
- } else {
- part.translate(velocities[n].x, velocities[n].y);
- velocities[n].y += gravity;
- }
- } else {
- part.setTint(color(0));
- }
- }
-
- shape(particles);
-
- fcount += 1;
- int m = millis();
- if (m - lastm > 1000 * fint) {
- frate = float(fcount) / fint;
- fcount = 0;
- lastm = m;
- println("fps: " + frate);
- }
-}
-
-void initVelocities() {
- velocities = new PVector[npartTotal];
- for (int n = 0; n < velocities.length; n++) {
- velocities[n] = new PVector();
- }
-}
-
-void initLifetimes() {
- // Initializing particles with negative lifetimes so they are added
- // progressively into the screen during the first frames of the sketch
- lifetimes = new int[npartTotal];
- int t = -1;
- for (int n = 0; n < lifetimes.length; n++) {
- if (n % npartPerFrame == 0) {
- t++;
- }
- lifetimes[n] = -t;
- }
-}
diff --git a/android/examples/Demos/Performance/DynamicParticlesRetained/data/sprite.png b/android/examples/Demos/Performance/DynamicParticlesRetained/data/sprite.png
deleted file mode 100644
index cc0f45cba1..0000000000
Binary files a/android/examples/Demos/Performance/DynamicParticlesRetained/data/sprite.png and /dev/null differ
diff --git a/android/examples/Demos/Performance/Esfera/Esfera.pde b/android/examples/Demos/Performance/Esfera/Esfera.pde
deleted file mode 100644
index b28463573e..0000000000
--- a/android/examples/Demos/Performance/Esfera/Esfera.pde
+++ /dev/null
@@ -1,89 +0,0 @@
-/**
- * Esfera
- * by David Pena.
- *
- * Distribucion aleatoria uniforme sobre la superficie de una esfera.
- */
-
-int cuantos = 1600;
-pelo[] lista ;
-float[] z = new float[cuantos];
-float[] phi = new float[cuantos];
-float[] largos = new float[cuantos];
-float radio = 200;
-float rx = 0;
-float ry =0;
-
-void setup() {
- size(displayWidth, displayHeight, P3D);
- noSmooth();
- frameRate(120);
- radio = height/3.5;
-
- lista = new pelo[cuantos];
- for (int i=0; i 1000 * fint) {
- frate = float(fcount) / fint;
- fcount = 0;
- lastm = m;
- println("fps: " + frate);
- }
-}
-
-void drawParticle(PVector center) {
- beginShape(QUAD);
- noStroke();
- tint(255);
- texture(sprite);
- normal(0, 0, 1);
- vertex(center.x - partSize/2, center.y - partSize/2, center.z, 0, 0);
- vertex(center.x + partSize/2, center.y - partSize/2, center.z, sprite.width, 0);
- vertex(center.x + partSize/2, center.y + partSize/2, center.z, sprite.width, sprite.height);
- vertex(center.x - partSize/2, center.y + partSize/2, center.z, 0, sprite.height);
- endShape();
-}
-
-void initPositions() {
- positions = new PVector[npartTotal];
- for (int n = 0; n < positions.length; n++) {
- positions[n] = new PVector(random(-500, +500), random(-500, +500), random(-500, +500));
- }
-}
-
diff --git a/android/examples/Demos/Performance/StaticParticlesImmediate/data/sprite.png b/android/examples/Demos/Performance/StaticParticlesImmediate/data/sprite.png
deleted file mode 100644
index cc0f45cba1..0000000000
Binary files a/android/examples/Demos/Performance/StaticParticlesImmediate/data/sprite.png and /dev/null differ
diff --git a/android/examples/Demos/Performance/StaticParticlesRetained/StaticParticlesRetained.pde b/android/examples/Demos/Performance/StaticParticlesRetained/StaticParticlesRetained.pde
deleted file mode 100644
index dbc29a0826..0000000000
--- a/android/examples/Demos/Performance/StaticParticlesRetained/StaticParticlesRetained.pde
+++ /dev/null
@@ -1,61 +0,0 @@
-PShape particles;
-PImage sprite;
-
-int npartTotal = 5000;
-float partSize = 20;
-
-int fcount, lastm;
-float frate;
-int fint = 3;
-
-void setup() {
- size(displayWidth, displayHeight, P3D);
- orientation(LANDSCAPE);
- frameRate(60);
-
- particles = createShape(PShape.GROUP);
- sprite = loadImage("sprite.png");
-
- for (int n = 0; n < npartTotal; n++) {
- float cx = random(-500, +500);
- float cy = random(-500, +500);
- float cz = random(-500, +500);
-
- PShape part = createShape();
- part.beginShape(QUAD);
- part.noStroke();
- part.tint(255);
- part.texture(sprite);
- part.normal(0, 0, 1);
- part.vertex(cx - partSize/2, cy - partSize/2, cz, 0, 0);
- part.vertex(cx + partSize/2, cy - partSize/2, cz, sprite.width, 0);
- part.vertex(cx + partSize/2, cy + partSize/2, cz, sprite.width, sprite.height);
- part.vertex(cx - partSize/2, cy + partSize/2, cz, 0, sprite.height);
- part.endShape();
- particles.addChild(part);
- }
-
- // Writing to the depth buffer is disabled to avoid rendering
- // artifacts due to the fact that the particles are semi-transparent
- // but not z-sorted.
- hint(DISABLE_DEPTH_MASK);
-}
-
-void draw () {
- background(0);
-
- translate(width/2, height/2);
- rotateY(frameCount * 0.01);
-
- shape(particles);
-
- fcount += 1;
- int m = millis();
- if (m - lastm > 1000 * fint) {
- frate = float(fcount) / fint;
- fcount = 0;
- lastm = m;
- println("fps: " + frate);
- }
-}
-
diff --git a/android/examples/Demos/Performance/StaticParticlesRetained/data/sprite.png b/android/examples/Demos/Performance/StaticParticlesRetained/data/sprite.png
deleted file mode 100644
index cc0f45cba1..0000000000
Binary files a/android/examples/Demos/Performance/StaticParticlesRetained/data/sprite.png and /dev/null differ
diff --git a/android/examples/Demos/Performance/TextRendering/TextRendering.pde b/android/examples/Demos/Performance/TextRendering/TextRendering.pde
deleted file mode 100644
index 36ae280a68..0000000000
--- a/android/examples/Demos/Performance/TextRendering/TextRendering.pde
+++ /dev/null
@@ -1,17 +0,0 @@
-import processing.opengl.*;
-
-public void setup() {
- size(800, 600, OPENGL);
- orientation(LANDSCAPE);
- fill(0);
-}
-
-public void draw() {
- background(255);
- for (int i = 0; i < 1000; i++) {
- float x = random(width);
- float y = random(height);
- text("HELLO", x, y);
- }
- if (frameCount % 10 == 0) println(frameRate);
-}
diff --git a/android/examples/Demos/Tests/NoBackgroundTest/NoBackgroundTest.pde b/android/examples/Demos/Tests/NoBackgroundTest/NoBackgroundTest.pde
deleted file mode 100644
index a5a1d5aa00..0000000000
--- a/android/examples/Demos/Tests/NoBackgroundTest/NoBackgroundTest.pde
+++ /dev/null
@@ -1,10 +0,0 @@
-void setup() {
- size(400, 400, P2D);
- background(255, 0, 0);
- fill(255, 150);
-}
-
-void draw() {
- ellipse(mouseX, mouseY, 100, 100);
-}
-
diff --git a/android/examples/Demos/Tests/OffscreenTest/OffscreenTest.pde b/android/examples/Demos/Tests/OffscreenTest/OffscreenTest.pde
deleted file mode 100644
index 0244b35215..0000000000
--- a/android/examples/Demos/Tests/OffscreenTest/OffscreenTest.pde
+++ /dev/null
@@ -1,19 +0,0 @@
-PGraphics pg;
-
-void setup() {
- size(400, 400, P3D);
-
- pg = createGraphics(400, 400, P3D);
-}
-
-void draw() {
- background(0);
-
- pg.beginDraw();
- pg.background(255, 0, 0);
- pg.ellipse(mouseX, mouseY, 100, 100);
- pg.endDraw();
-
- image(pg, 0, 0, 400, 400);
-}
-
diff --git a/android/examples/Demos/Tests/RedrawTest/RedrawTest.pde b/android/examples/Demos/Tests/RedrawTest/RedrawTest.pde
deleted file mode 100644
index 9a6c4c16c0..0000000000
--- a/android/examples/Demos/Tests/RedrawTest/RedrawTest.pde
+++ /dev/null
@@ -1,16 +0,0 @@
-// Issues: doesn't redraw
-
-void setup() {
- size(400, 400, P3D);
- noLoop();
-}
-
-void draw() {
- background(255, 0, 0);
- ellipse(mouseX, mouseY, 100, 50);
- println("draw");
-}
-
-void keyPressed() {
- redraw();
-}
diff --git a/android/examples/Sensors/Accelerometer/Accelerometer.pde b/android/examples/Sensors/Accelerometer/Accelerometer.pde
deleted file mode 100644
index e4524fc499..0000000000
--- a/android/examples/Sensors/Accelerometer/Accelerometer.pde
+++ /dev/null
@@ -1,49 +0,0 @@
-AccelerometerManager accel;
-float ax, ay, az;
-
-
-void setup() {
- accel = new AccelerometerManager(this);
- orientation(PORTRAIT);
- noLoop();
-}
-
-
-void draw() {
- background(0);
- fill(255);
- textSize(70);
- textAlign(CENTER, CENTER);
- text("x: " + nf(ax, 1, 2) + "\n" +
- "y: " + nf(ay, 1, 2) + "\n" +
- "z: " + nf(az, 1, 2),
- 0, 0, width, height);
-}
-
-
-public void resume() {
- if (accel != null) {
- accel.resume();
- }
-}
-
-
-public void pause() {
- if (accel != null) {
- accel.pause();
- }
-}
-
-
-public void shakeEvent(float force) {
- println("shake : " + force);
-}
-
-
-public void accelerationEvent(float x, float y, float z) {
-// println("acceleration: " + x + ", " + y + ", " + z);
- ax = x;
- ay = y;
- az = z;
- redraw();
-}
diff --git a/android/examples/Sensors/Accelerometer/AccelerometerManager.java b/android/examples/Sensors/Accelerometer/AccelerometerManager.java
deleted file mode 100644
index b4340fc2b9..0000000000
--- a/android/examples/Sensors/Accelerometer/AccelerometerManager.java
+++ /dev/null
@@ -1,242 +0,0 @@
-import java.lang.reflect.*;
-import java.util.List;
-
-import android.content.Context;
-import android.hardware.Sensor;
-import android.hardware.SensorEvent;
-import android.hardware.SensorEventListener;
-import android.hardware.SensorManager;
-
-
-/**
- * Android Accelerometer Sensor Manager Archetype
- * @author antoine vianey
- * under GPL v3 : http://www.gnu.org/licenses/gpl-3.0.html
- */
-public class AccelerometerManager {
- /** Accuracy configuration */
- private float threshold = 0.2f;
- private int interval = 1000;
-
- private Sensor sensor;
- private SensorManager sensorManager;
- // you could use an OrientationListener array instead
- // if you plans to use more than one listener
-// private AccelerometerListener listener;
-
- Method shakeEventMethod;
- Method accelerationEventMethod;
-
- /** indicates whether or not Accelerometer Sensor is supported */
- private Boolean supported;
- /** indicates whether or not Accelerometer Sensor is running */
- private boolean running = false;
-
- Context context;
-
-
- public AccelerometerManager(Context parent) {
- this.context = parent;
-
- try {
- shakeEventMethod =
- parent.getClass().getMethod("shakeEvent", new Class[] { Float.TYPE });
- } catch (Exception e) {
- // no such method, or an error.. which is fine, just ignore
- }
-
- try {
- accelerationEventMethod =
- parent.getClass().getMethod("accelerationEvent", new Class[] { Float.TYPE, Float.TYPE, Float.TYPE });
- } catch (Exception e) {
- // no such method, or an error.. which is fine, just ignore
- }
-// System.out.println("shakeEventMethod is " + shakeEventMethod);
-// System.out.println("accelerationEventMethod is " + accelerationEventMethod);
- resume();
- }
-
-
- public AccelerometerManager(Context context, int threshold, int interval) {
- this(context);
- this.threshold = threshold;
- this.interval = interval;
- }
-
-
- public void resume() {
- if (isSupported()) {
- startListening();
- }
- }
-
-
- public void pause() {
- if (isListening()) {
- stopListening();
- }
- }
-
-
- /**
- * Returns true if the manager is listening to orientation changes
- */
- public boolean isListening() {
- return running;
- }
-
-
- /**
- * Unregisters listeners
- */
- public void stopListening() {
- running = false;
- try {
- if (sensorManager != null && sensorEventListener != null) {
- sensorManager.unregisterListener(sensorEventListener);
- }
- }
- catch (Exception e) {
- }
- }
-
-
- /**
- * Returns true if at least one Accelerometer sensor is available
- */
- public boolean isSupported() {
- if (supported == null) {
- sensorManager = (SensorManager) context.getSystemService(Context.SENSOR_SERVICE);
- List sensors = sensorManager.getSensorList(Sensor.TYPE_ACCELEROMETER);
- supported = new Boolean(sensors.size() > 0);
- }
- return supported;
- }
-
-
-// /**
-// * Configure the listener for shaking
-// * @param threshold
-// * minimum acceleration variation for considering shaking
-// * @param interval
-// * minimum interval between to shake events
-// */
-// public static void configure(int threshold, int interval) {
-// AccelerometerManager.threshold = threshold;
-// AccelerometerManager.interval = interval;
-// }
-
-
- /**
- * Registers a listener and start listening
- * @param accelerometerListener callback for accelerometer events
- */
- public void startListening() {
-// AccelerometerListener accelerometerListener = (AccelerometerListener) context;
- sensorManager = (SensorManager) context.getSystemService(Context.SENSOR_SERVICE);
- List sensors = sensorManager.getSensorList(Sensor.TYPE_ACCELEROMETER);
- if (sensors.size() > 0) {
- sensor = sensors.get(0);
- running = sensorManager.registerListener(sensorEventListener, sensor, SensorManager.SENSOR_DELAY_GAME);
-// listener = accelerometerListener;
- }
- }
-
-
-// /**
-// * Configures threshold and interval
-// * And registers a listener and start listening
-// * @param accelerometerListener
-// * callback for accelerometer events
-// * @param threshold
-// * minimum acceleration variation for considering shaking
-// * @param interval
-// * minimum interval between to shake events
-// */
-// public void startListening(int threshold, int interval) {
-// configure(threshold, interval);
-// startListening();
-// }
-
-
- /**
- * The listener that listen to events from the accelerometer listener
- */
- //private static SensorEventListener sensorEventListener = new SensorEventListener() {
- private SensorEventListener sensorEventListener = new SensorEventListener() {
- private long now = 0;
- private long timeDiff = 0;
- private long lastUpdate = 0;
- private long lastShake = 0;
-
- private float x = 0;
- private float y = 0;
- private float z = 0;
- private float lastX = 0;
- private float lastY = 0;
- private float lastZ = 0;
- private float force = 0;
-
- public void onAccuracyChanged(Sensor sensor, int accuracy) {
- }
-
- public void onSensorChanged(SensorEvent event) {
- // use the event timestamp as reference
- // so the manager precision won't depends
- // on the AccelerometerListener implementation
- // processing time
- now = event.timestamp;
-
- x = event.values[0];
- y = event.values[1];
- z = event.values[2];
-
- // if not interesting in shake events
- // just remove the whole if then else bloc
- if (lastUpdate == 0) {
- lastUpdate = now;
- lastShake = now;
- lastX = x;
- lastY = y;
- lastZ = z;
-
- } else {
- timeDiff = now - lastUpdate;
- if (timeDiff > 0) {
- force = Math.abs(x + y + z - lastX - lastY - lastZ)
- / timeDiff;
- if (force > threshold) {
- if (now - lastShake >= interval) {
- // trigger shake event
-// listener.onShake(force);
- if (shakeEventMethod != null) {
- try {
- shakeEventMethod.invoke(context, new Object[] { new Float(force) });
- } catch (Exception e) {
- e.printStackTrace();
- shakeEventMethod = null;
- }
- }
- }
- lastShake = now;
- }
- lastX = x;
- lastY = y;
- lastZ = z;
- lastUpdate = now;
- }
- }
- // trigger change event
-// listener.onAccelerationChanged(x, y, z);
- if (accelerationEventMethod != null) {
- try {
- accelerationEventMethod.invoke(context, new Object[] { x, y, z });
- } catch (Exception e) {
- e.printStackTrace();
- accelerationEventMethod = null;
- }
- }
- }
- };
-}
-
diff --git a/android/examples/Sensors/Compass/Compass.pde b/android/examples/Sensors/Compass/Compass.pde
deleted file mode 100644
index d227f8ef5d..0000000000
--- a/android/examples/Sensors/Compass/Compass.pde
+++ /dev/null
@@ -1,39 +0,0 @@
-CompassManager compass;
-float direction;
-
-
-void setup() {
- compass = new CompassManager(this);
-}
-
-
-void pause() {
- if (compass != null) compass.pause();
-}
-
-
-void resume() {
- if (compass != null) compass.resume();
-}
-
-
-void draw() {
- background(255);
- fill(192, 0, 0);
- noStroke();
-
- translate(width/2, height/2);
- scale(2);
- rotate(direction);
- beginShape();
- vertex(0, -50);
- vertex(-20, 60);
- vertex(0, 50);
- vertex(20, 60);
- endShape(CLOSE);
-}
-
-
-void directionEvent(float newDirection) {
- direction = newDirection;
-}
diff --git a/android/examples/Sensors/Compass/CompassManager.java b/android/examples/Sensors/Compass/CompassManager.java
deleted file mode 100644
index c45238f8d1..0000000000
--- a/android/examples/Sensors/Compass/CompassManager.java
+++ /dev/null
@@ -1,139 +0,0 @@
-import java.lang.reflect.*;
-import java.util.List;
-
-import android.content.Context;
-import android.hardware.Sensor;
-import android.hardware.SensorEvent;
-import android.hardware.SensorEventListener;
-import android.hardware.SensorManager;
-
-
-public class CompassManager {
- private Sensor sensor;
- private SensorManager sensorManager;
-
- Method compassEventMethod;
- Method directionEventMethod;
-
- private Boolean supported;
- private boolean running = false;
-
- Context context;
-
-
- public CompassManager(Context parent) {
- this.context = parent;
-
- try {
- compassEventMethod =
- parent.getClass().getMethod("compassEvent", new Class[] { Float.TYPE, Float.TYPE, Float.TYPE });
- } catch (Exception e) {
- // no such method, or an error.. which is fine, just ignore
- }
- try {
- directionEventMethod =
- parent.getClass().getMethod("directionEvent", new Class[] { Float.TYPE });
- } catch (Exception e) {
- // no such method, or an error.. which is fine, just ignore
- }
-// System.out.println("directionEventMethod is " + directionEventMethod);
-
- resume();
- }
-
-
- public void resume() {
- if (isSupported()) {
- startListening();
- }
- }
-
-
- public void pause() {
- if (isListening()) {
- stopListening();
- }
- }
-
-
- /**
- * Returns true if the manager is listening to orientation changes
- */
- public boolean isListening() {
- return running;
- }
-
-
- /**
- * Unregisters listeners
- */
- public void stopListening() {
- running = false;
- try {
- if (sensorManager != null && sensorEventListener != null) {
- sensorManager.unregisterListener(sensorEventListener);
- }
- }
- catch (Exception e) {
- }
- }
-
-
- /**
- * Returns true if at least one Accelerometer sensor is available
- */
- public boolean isSupported() {
- if (supported == null) {
- sensorManager = (SensorManager) context.getSystemService(Context.SENSOR_SERVICE);
- List sensors = sensorManager.getSensorList(Sensor.TYPE_ORIENTATION);
- supported = new Boolean(sensors.size() > 0);
- }
- return supported;
- }
-
-
- public void startListening() {
- sensorManager = (SensorManager) context.getSystemService(Context.SENSOR_SERVICE);
- List sensors = sensorManager.getSensorList(Sensor.TYPE_ORIENTATION);
- if (sensors.size() > 0) {
- sensor = sensors.get(0);
- running = sensorManager.registerListener(sensorEventListener, sensor, SensorManager.SENSOR_DELAY_GAME);
- }
- }
-
-
- /**
- * The listener that listen to events from the accelerometer listener
- */
- private SensorEventListener sensorEventListener = new SensorEventListener() {
-
- public void onAccuracyChanged(Sensor sensor, int accuracy) {
- // ignored for now
- }
-
- public void onSensorChanged(SensorEvent event) {
- float x = event.values[0];
- float y = event.values[1];
- float z = event.values[2];
-
- if (compassEventMethod != null) {
- try {
- compassEventMethod.invoke(context, new Object[] { x, y, z });
- } catch (Exception e) {
- e.printStackTrace();
- compassEventMethod = null;
- }
- }
-
- if (directionEventMethod != null) {
- try {
- directionEventMethod.invoke(context, new Object[] { (float) (-x * Math.PI / 180) });
- } catch (Exception e) {
- e.printStackTrace();
- directionEventMethod = null;
- }
- }
- }
- };
-}
-
diff --git a/android/examples/Topics/Advanced Data/ArrayListClass/ArrayListClass.pde b/android/examples/Topics/Advanced Data/ArrayListClass/ArrayListClass.pde
deleted file mode 100644
index 09521cb17a..0000000000
--- a/android/examples/Topics/Advanced Data/ArrayListClass/ArrayListClass.pde
+++ /dev/null
@@ -1,52 +0,0 @@
-/**
- * ArrayList of objects
- * by Daniel Shiffman.
- *
- * This example demonstrates how to use a Java ArrayList to store
- * a variable number of objects. Items can be added and removed
- * from the ArrayList.
- *
- * Click the mouse to add bouncing balls.
- */
-
-ArrayList balls;
-int ballWidth = 48;
-
-void setup() {
- size(200, 200);
- smooth();
- noStroke();
-
- // Create an empty ArrayList
- balls = new ArrayList();
-
- // Start by adding one element
- balls.add(new Ball(width/2, 0, ballWidth));
-}
-
-void draw() {
- background(255);
-
- // With an array, we say balls.length, with an ArrayList, we say balls.size()
- // The length of an ArrayList is dynamic
- // Notice how we are looping through the ArrayList backwards
- // This is because we are deleting elements from the list
- for (int i = balls.size()-1; i >= 0; i--) {
- // An ArrayList doesn't know what it is storing so we have to cast the object coming out
- Ball ball = (Ball) balls.get(i);
- ball.move();
- ball.display();
- if (ball.finished()) {
- // Items can be deleted with remove()
- balls.remove(i);
- }
-
- }
-
-}
-
-void mousePressed() {
- // A new ball object is added to the ArrayList (by default to the end)
- balls.add(new Ball(mouseX, mouseY, ballWidth));
-}
-
diff --git a/android/examples/Topics/Advanced Data/ArrayListClass/Ball.pde b/android/examples/Topics/Advanced Data/ArrayListClass/Ball.pde
deleted file mode 100644
index 3f613b7870..0000000000
--- a/android/examples/Topics/Advanced Data/ArrayListClass/Ball.pde
+++ /dev/null
@@ -1,50 +0,0 @@
-// Simple bouncing ball class
-
-class Ball {
-
- float x;
- float y;
- float speed;
- float gravity;
- float w;
- float life = 255;
-
- Ball(float tempX, float tempY, float tempW) {
- x = tempX;
- y = tempY;
- w = tempW;
- speed = 0;
- gravity = 0.1;
- }
-
- void move() {
- // Add gravity to speed
- speed = speed + gravity;
- // Add speed to y location
- y = y + speed;
- // If square reaches the bottom
- // Reverse speed
- if (y > height) {
- // Dampening
- speed = speed * -0.8;
- y = height;
- }
- }
-
- boolean finished() {
- // Balls fade out
- life--;
- if (life < 0) {
- return true;
- } else {
- return false;
- }
- }
-
- void display() {
- // Display the circle
- fill(0,life);
- //stroke(0,life);
- ellipse(x,y,w,w);
- }
-}
diff --git a/android/examples/Topics/Advanced Data/DirectoryList/DirectoryList.pde b/android/examples/Topics/Advanced Data/DirectoryList/DirectoryList.pde
deleted file mode 100644
index bb8c364d2f..0000000000
--- a/android/examples/Topics/Advanced Data/DirectoryList/DirectoryList.pde
+++ /dev/null
@@ -1,105 +0,0 @@
-/**
- * Listing files in directories and subdirectories
- * by Daniel Shiffman.
- *
- * This example has three functions:
- * 1) List the names of files in a directory
- * 2) List the names along with metadata (size, lastModified)
- * of files in a directory
- * 3) List the names along with metadata (size, lastModified)
- * of files in a directory and all subdirectories (using recursion)
- */
-
-
-void setup() {
-
- // Path
- String path = sketchPath;
-
- println("Listing all filenames in a directory: ");
- String[] filenames = listFileNames(path);
- println(filenames);
-
- println("\nListing info about all files in a directory: ");
- File[] files = listFiles(path);
- for (int i = 0; i < files.length; i++) {
- File f = files[i];
- println("Name: " + f.getName());
- println("Is directory: " + f.isDirectory());
- println("Size: " + f.length());
- String lastModified = new Date(f.lastModified()).toString();
- println("Last Modified: " + lastModified);
- println("-----------------------");
- }
-
- println("\nListing info about all files in a directory and all subdirectories: ");
- ArrayList allFiles = listFilesRecursive(path);
-
- for (int i = 0; i < allFiles.size(); i++) {
- File f = (File) allFiles.get(i);
- println("Name: " + f.getName());
- println("Full path: " + f.getAbsolutePath());
- println("Is directory: " + f.isDirectory());
- println("Size: " + f.length());
- String lastModified = new Date(f.lastModified()).toString();
- println("Last Modified: " + lastModified);
- println("-----------------------");
- }
-
- noLoop();
-}
-
-// Nothing is drawn in this program and the draw() doesn't loop because
-// of the noLoop() in setup()
-void draw() {
-
-}
-
-
-// This function returns all the files in a directory as an array of Strings
-String[] listFileNames(String dir) {
- File file = new File(dir);
- if (file.isDirectory()) {
- String names[] = file.list();
- return names;
- } else {
- // If it's not a directory
- return null;
- }
-}
-
-// This function returns all the files in a directory as an array of File objects
-// This is useful if you want more info about the file
-File[] listFiles(String dir) {
- File file = new File(dir);
- if (file.isDirectory()) {
- File[] files = file.listFiles();
- return files;
- } else {
- // If it's not a directory
- return null;
- }
-}
-
-// Function to get a list ofall files in a directory and all subdirectories
-ArrayList listFilesRecursive(String dir) {
- ArrayList fileList = new ArrayList();
- recurseDir(fileList,dir);
- return fileList;
-}
-
-// Recursive function to traverse subdirectories
-void recurseDir(ArrayList a, String dir) {
- File file = new File(dir);
- if (file.isDirectory()) {
- // If you want to include directories in the list
- a.add(file);
- File[] subfiles = file.listFiles();
- for (int i = 0; i < subfiles.length; i++) {
- // Call this function on all files in this directory
- recurseDir(a,subfiles[i].getAbsolutePath());
- }
- } else {
- a.add(file);
- }
-}
diff --git a/android/examples/Topics/Advanced Data/HashMapClass/HashMapClass.pde b/android/examples/Topics/Advanced Data/HashMapClass/HashMapClass.pde
deleted file mode 100644
index b19c30c607..0000000000
--- a/android/examples/Topics/Advanced Data/HashMapClass/HashMapClass.pde
+++ /dev/null
@@ -1,89 +0,0 @@
-/**
- * HashMap example
- * by Daniel Shiffman.
- *
- * This example demonstrates how to use a HashMap to store
- * a collection of objects referenced by a key.
- * This is much like an array, only instead of accessing elements
- * with a numeric index, we use a String.
- * If you are familiar with associative arrays from other languages,
- * this is the same idea.
- *
- * This example uses the HashMap to perform a simple concordance
- * http://en.wikipedia.org/wiki/Concordance_(publishing)
- */
-
-
-HashMap words; // HashMap object
-
-String[] tokens; // Array of all words from input file
-int counter;
-
-PFont f;
-
-void setup() {
- size(640, 360);
- words = new HashMap();
-
- // Load file and chop it up
- String[] lines = loadStrings("dracula.txt");
- String allText = join(lines, " ");
- tokens = splitTokens(allText, " ,.?!:;[]-");
- f = createFont("Georgia", 36, true);
-}
-
-void draw() {
- background(255);
- fill(0);
-
- // Look at words one at a time
- String s = tokens[counter];
- counter = (counter + 1) % tokens.length;
-
- // Is the word in the HashMap
- if (words.containsKey(s)) {
- // Get the word object and increase the count
- // We access objects from a HashMap via its key, the String
- Word w = (Word) words.get(s);
- w.count();
- } else {
- // Otherwise make a new word
- Word w = new Word(s);
- // And add to the HashMap
- // put() takes two arguments, "key" and "value"
- // The key for us is the String and the value is the Word object
- words.put(s, w);
- }
-
- // Make an iterator to look at all the things in the HashMap
- Iterator i = words.values().iterator();
-
- // x and y will be used to locate each word
- float x = 0;
- float y = height-10;
-
- while (i.hasNext()) {
- // Look at each word
- Word w = (Word) i.next();
-
- // Only display words that appear 3 times
- if (w.count > 3) {
- // The size is the count
- int fsize = constrain(w.count, 0, 100);
- textFont(f, fsize);
- text(w.word, x, y);
- // Move along the x-axis
- x += textWidth(w.word + " ");
- }
-
- // If x gets to the end, move Y
- if (x > width) {
- x = 0;
- y -= 100;
- // If y gets to the end, we're done
- if (y < 0) {
- break;
- }
- }
- }
-}
diff --git a/android/examples/Topics/Advanced Data/HashMapClass/Word.pde b/android/examples/Topics/Advanced Data/HashMapClass/Word.pde
deleted file mode 100644
index cc8568491b..0000000000
--- a/android/examples/Topics/Advanced Data/HashMapClass/Word.pde
+++ /dev/null
@@ -1,15 +0,0 @@
-class Word {
-
- int count;
- String word;
-
- Word(String s) {
- word = s;
- count = 1;
- }
-
- void count() {
- count++;
- }
-
-}
diff --git a/android/examples/Topics/Advanced Data/HashMapClass/data/dracula.txt b/android/examples/Topics/Advanced Data/HashMapClass/data/dracula.txt
deleted file mode 100644
index 7fb73f5687..0000000000
--- a/android/examples/Topics/Advanced Data/HashMapClass/data/dracula.txt
+++ /dev/null
@@ -1,16624 +0,0 @@
-The Project Gutenberg EBook of Dracula, by Bram Stoker
-
-This eBook is for the use of anyone anywhere at no cost and with
-almost no restrictions whatsoever. You may copy it, give it away or
-re-use it under the terms of the Project Gutenberg License included
-with this eBook or online at www.gutenberg.net
-
-
-Title: Dracula
-
-Author: Bram Stoker
-
-Release Date: May 9, 2008 [EBook #345]
-
-Language: English
-
-Character set encoding: ASCII
-
-*** START OF THIS PROJECT GUTENBERG EBOOK DRACULA ***
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-DRACULA
-
-by
-
-Bram Stoker
-
-
-1897 edition
-
-
-
-
-TABLE OF CONTENTS
-
-
-CHAPTER
-
- 1 Jonathan Harker's Journal
- 2 Jonathan Harker's Journal
- 3 Jonathan Harker's Journal
- 4 Jonathan Harker's Journal
- 5 Letter From Miss Mina Murray To Miss Lucy Westenra
- 6 Mina Murray's Journal
- 7 Cutting From "The Dailygraph", 8 August
- 8 Mina Murray's Journal
- 9 Letter, Mina Harker To Lucy Westenra
- 10 Letter, Dr. Seward To Hon. Arthur Holmwood
- 11 Lucy Westenra's Diary
- 12 Dr. Seward's Diary
- 13 Dr. Seward's Diary
- 14 Mina Harker's Journal
- 15 Dr. Seward's Diary
- 16 Dr. Seward's Diary
- 17 Dr. Seward's Diary
- 18 Dr. Seward's Diary
- 19 Jonathan Harker's Journal
- 20 Jonathan Harker's Journal
- 21 Dr. Seward's Diary
- 22 Jonathan Harker's Journal
- 23 Dr. Seward's Diary
- 24 Dr. Seward's Phonograph Diary
- 25 Dr. Seward's Diary
- 26 Dr. Seward's Diary
- 27 Mina Harker's Journal
-
-
-
-
-CHAPTER 1
-
-
-Jonathan Harker's Journal
-
-3 May. Bistritz.--Left Munich at 8:35 P.M., on 1st May, arriving at
-Vienna early next morning; should have arrived at 6:46, but train was
-an hour late. Buda-Pesth seems a wonderful place, from the glimpse
-which I got of it from the train and the little I could walk through
-the streets. I feared to go very far from the station, as we had
-arrived late and would start as near the correct time as possible.
-
-The impression I had was that we were leaving the West and entering the
-East; the most western of splendid bridges over the Danube, which is
-here of noble width and depth, took us among the traditions of Turkish
-rule.
-
-We left in pretty good time, and came after nightfall to Klausenburgh.
-Here I stopped for the night at the Hotel Royale. I had for dinner,
-or rather supper, a chicken done up some way with red pepper, which
-was very good but thirsty. (Mem. get recipe for Mina.) I asked the
-waiter, and he said it was called "paprika hendl," and that, as it was
-a national dish, I should be able to get it anywhere along the
-Carpathians.
-
-I found my smattering of German very useful here, indeed, I don't know
-how I should be able to get on without it.
-
-Having had some time at my disposal when in London, I had visited the
-British Museum, and made search among the books and maps in the
-library regarding Transylvania; it had struck me that some
-foreknowledge of the country could hardly fail to have some importance
-in dealing with a nobleman of that country.
-
-
-I find that the district he named is in the extreme east of the
-country, just on the borders of three states, Transylvania, Moldavia,
-and Bukovina, in the midst of the Carpathian mountains; one of the
-wildest and least known portions of Europe.
-
-I was not able to light on any map or work giving the exact locality
-of the Castle Dracula, as there are no maps of this country as yet to
-compare with our own Ordance Survey Maps; but I found that Bistritz,
-the post town named by Count Dracula, is a fairly well-known place. I
-shall enter here some of my notes, as they may refresh my memory when
-I talk over my travels with Mina.
-
-In the population of Transylvania there are four distinct
-nationalities: Saxons in the South, and mixed with them the Wallachs,
-who are the descendants of the Dacians; Magyars in the West, and
-Szekelys in the East and North. I am going among the latter, who
-claim to be descended from Attila and the Huns. This may be so, for
-when the Magyars conquered the country in the eleventh century they
-found the Huns settled in it.
-
-I read that every known superstition in the world is gathered into the
-horseshoe of the Carpathians, as if it were the centre of some sort of
-imaginative whirlpool; if so my stay may be very interesting. (Mem.,
-I must ask the Count all about them.)
-
-I did not sleep well, though my bed was comfortable enough, for I had
-all sorts of queer dreams. There was a dog howling all night under my
-window, which may have had something to do with it; or it may have
-been the paprika, for I had to drink up all the water in my carafe,
-and was still thirsty. Towards morning I slept and was wakened by the
-continuous knocking at my door, so I guess I must have been sleeping
-soundly then.
-
-I had for breakfast more paprika, and a sort of porridge of maize
-flour which they said was "mamaliga", and egg-plant stuffed with
-forcemeat, a very excellent dish, which they call "impletata". (Mem.,
-get recipe for this also.)
-
-I had to hurry breakfast, for the train started a little before eight,
-or rather it ought to have done so, for after rushing to the station
-at 7:30 I had to sit in the carriage for more than an hour before we
-began to move.
-
-It seems to me that the further east you go the more unpunctual are
-the trains. What ought they to be in China?
-
-All day long we seemed to dawdle through a country which was full of
-beauty of every kind. Sometimes we saw little towns or castles on the
-top of steep hills such as we see in old missals; sometimes we ran by
-rivers and streams which seemed from the wide stony margin on each
-side of them to be subject to great floods. It takes a lot of water,
-and running strong, to sweep the outside edge of a river clear.
-
-At every station there were groups of people, sometimes crowds, and in
-all sorts of attire. Some of them were just like the peasants at home
-or those I saw coming through France and Germany, with short jackets,
-and round hats, and home-made trousers; but others were very
-picturesque.
-
-The women looked pretty, except when you got near them, but they were
-very clumsy about the waist. They had all full white sleeves of some
-kind or other, and most of them had big belts with a lot of strips of
-something fluttering from them like the dresses in a ballet, but of
-course there were petticoats under them.
-
-The strangest figures we saw were the Slovaks, who were more barbarian
-than the rest, with their big cow-boy hats, great baggy dirty-white
-trousers, white linen shirts, and enormous heavy leather belts, nearly
-a foot wide, all studded over with brass nails. They wore high boots,
-with their trousers tucked into them, and had long black hair and
-heavy black moustaches. They are very picturesque, but do not look
-prepossessing. On the stage they would be set down at once as some
-old Oriental band of brigands. They are, however, I am told, very
-harmless and rather wanting in natural self-assertion.
-
-It was on the dark side of twilight when we got to Bistritz, which is
-a very interesting old place. Being practically on the frontier--for
-the Borgo Pass leads from it into Bukovina--it has had a very stormy
-existence, and it certainly shows marks of it. Fifty years ago a
-series of great fires took place, which made terrible havoc on five
-separate occasions. At the very beginning of the seventeenth century
-it underwent a siege of three weeks and lost 13,000 people, the
-casualties of war proper being assisted by famine and disease.
-
-Count Dracula had directed me to go to the Golden Krone Hotel, which I
-found, to my great delight, to be thoroughly old-fashioned, for of
-course I wanted to see all I could of the ways of the country.
-
-I was evidently expected, for when I got near the door I faced a
-cheery-looking elderly woman in the usual peasant dress--white
-undergarment with a long double apron, front, and back, of coloured
-stuff fitting almost too tight for modesty. When I came close she
-bowed and said, "The Herr Englishman?"
-
-"Yes," I said, "Jonathan Harker."
-
-She smiled, and gave some message to an elderly man in white
-shirtsleeves, who had followed her to the door.
-
-He went, but immediately returned with a letter:
-
-"My friend.--Welcome to the Carpathians. I am anxiously expecting
-you. Sleep well tonight. At three tomorrow the diligence will
-start for Bukovina; a place on it is kept for you. At the Borgo
-Pass my carriage will await you and will bring you to me. I trust
-that your journey from London has been a happy one, and that you
-will enjoy your stay in my beautiful land.--Your friend, Dracula."
-
-
-4 May--I found that my landlord had got a letter from the Count,
-directing him to secure the best place on the coach for me; but on
-making inquiries as to details he seemed somewhat reticent, and
-pretended that he could not understand my German.
-
-This could not be true, because up to then he had understood it
-perfectly; at least, he answered my questions exactly as if he did.
-
-He and his wife, the old lady who had received me, looked at each
-other in a frightened sort of way. He mumbled out that the money had
-been sent in a letter, and that was all he knew. When I asked him if
-he knew Count Dracula, and could tell me anything of his castle, both
-he and his wife crossed themselves, and, saying that they knew nothing
-at all, simply refused to speak further. It was so near the time of
-starting that I had no time to ask anyone else, for it was all very
-mysterious and not by any means comforting.
-
-Just before I was leaving, the old lady came up to my room and said in
-a hysterical way: "Must you go? Oh! Young Herr, must you go?" She
-was in such an excited state that she seemed to have lost her grip of
-what German she knew, and mixed it all up with some other language
-which I did not know at all. I was just able to follow her by asking
-many questions. When I told her that I must go at once, and that I
-was engaged on important business, she asked again:
-
-"Do you know what day it is?" I answered that it was the fourth of
-May. She shook her head as she said again:
-
-"Oh, yes! I know that! I know that, but do you know what day it is?"
-
-On my saying that I did not understand, she went on:
-
-"It is the eve of St. George's Day. Do you not know that tonight,
-when the clock strikes midnight, all the evil things in the world will
-have full sway? Do you know where you are going, and what you are
-going to?" She was in such evident distress that I tried to comfort
-her, but without effect. Finally, she went down on her knees and
-implored me not to go; at least to wait a day or two before starting.
-
-It was all very ridiculous but I did not feel comfortable. However,
-there was business to be done, and I could allow nothing to interfere
-with it.
-
-I tried to raise her up, and said, as gravely as I could, that I
-thanked her, but my duty was imperative, and that I must go.
-
-She then rose and dried her eyes, and taking a crucifix from her neck
-offered it to me.
-
-I did not know what to do, for, as an English Churchman, I have been
-taught to regard such things as in some measure idolatrous, and yet it
-seemed so ungracious to refuse an old lady meaning so well and in such
-a state of mind.
-
-She saw, I suppose, the doubt in my face, for she put the rosary round
-my neck and said, "For your mother's sake," and went out of the room.
-
-I am writing up this part of the diary whilst I am waiting for the
-coach, which is, of course, late; and the crucifix is still round my
-neck.
-
-Whether it is the old lady's fear, or the many ghostly traditions of
-this place, or the crucifix itself, I do not know, but I am not
-feeling nearly as easy in my mind as usual.
-
-If this book should ever reach Mina before I do, let it bring my
-goodbye. Here comes the coach!
-
-
-5 May. The Castle.--The gray of the morning has passed, and the sun
-is high over the distant horizon, which seems jagged, whether with
-trees or hills I know not, for it is so far off that big things and
-little are mixed.
-
-I am not sleepy, and, as I am not to be called till I awake, naturally
-I write till sleep comes.
-
-There are many odd things to put down, and, lest who reads them may
-fancy that I dined too well before I left Bistritz, let me put down my
-dinner exactly.
-
-I dined on what they called "robber steak"--bits of bacon, onion, and
-beef, seasoned with red pepper, and strung on sticks, and roasted over
-the fire, in simple style of the London cat's meat!
-
-The wine was Golden Mediasch, which produces a queer sting on the
-tongue, which is, however, not disagreeable.
-
-I had only a couple of glasses of this, and nothing else.
-
-When I got on the coach, the driver had not taken his seat, and I saw
-him talking to the landlady.
-
-They were evidently talking of me, for every now and then they looked
-at me, and some of the people who were sitting on the bench outside
-the door--came and listened, and then looked at me, most of them
-pityingly. I could hear a lot of words often repeated, queer words,
-for there were many nationalities in the crowd, so I quietly got my
-polyglot dictionary from my bag and looked them out.
-
-I must say they were not cheering to me, for amongst them were
-"Ordog"--Satan, "Pokol"--hell, "stregoica"--witch, "vrolok" and
-"vlkoslak"--both mean the same thing, one being Slovak and the other
-Servian for something that is either werewolf or vampire. (Mem., I
-must ask the Count about these superstitions.)
-
-When we started, the crowd round the inn door, which had by this time
-swelled to a considerable size, all made the sign of the cross and
-pointed two fingers towards me.
-
-With some difficulty, I got a fellow passenger to tell me what they
-meant. He would not answer at first, but on learning that I was
-English, he explained that it was a charm or guard against the evil
-eye.
-
-This was not very pleasant for me, just starting for an unknown place
-to meet an unknown man. But everyone seemed so kind-hearted, and so
-sorrowful, and so sympathetic that I could not but be touched.
-
-I shall never forget the last glimpse which I had of the inn yard and
-its crowd of picturesque figures, all crossing themselves, as they
-stood round the wide archway, with its background of rich foliage of
-oleander and orange trees in green tubs clustered in the centre of the
-yard.
-
-Then our driver, whose wide linen drawers covered the whole front of
-the boxseat,--"gotza" they call them--cracked his big whip over his
-four small horses, which ran abreast, and we set off on our journey.
-
-I soon lost sight and recollection of ghostly fears in the beauty of
-the scene as we drove along, although had I known the language, or
-rather languages, which my fellow-passengers were speaking, I might
-not have been able to throw them off so easily. Before us lay a green
-sloping land full of forests and woods, with here and there steep
-hills, crowned with clumps of trees or with farmhouses, the blank
-gable end to the road. There was everywhere a bewildering mass of
-fruit blossom--apple, plum, pear, cherry. And as we drove by I could
-see the green grass under the trees spangled with the fallen petals.
-In and out amongst these green hills of what they call here the
-"Mittel Land" ran the road, losing itself as it swept round the grassy
-curve, or was shut out by the straggling ends of pine woods, which
-here and there ran down the hillsides like tongues of flame. The road
-was rugged, but still we seemed to fly over it with a feverish haste.
-I could not understand then what the haste meant, but the driver was
-evidently bent on losing no time in reaching Borgo Prund. I was told
-that this road is in summertime excellent, but that it had not yet
-been put in order after the winter snows. In this respect it is
-different from the general run of roads in the Carpathians, for it is
-an old tradition that they are not to be kept in too good order. Of
-old the Hospadars would not repair them, lest the Turk should think
-that they were preparing to bring in foreign troops, and so hasten the
-war which was always really at loading point.
-
-Beyond the green swelling hills of the Mittel Land rose mighty slopes
-of forest up to the lofty steeps of the Carpathians themselves. Right
-and left of us they towered, with the afternoon sun falling full upon
-them and bringing out all the glorious colours of this beautiful
-range, deep blue and purple in the shadows of the peaks, green and
-brown where grass and rock mingled, and an endless perspective of
-jagged rock and pointed crags, till these were themselves lost in the
-distance, where the snowy peaks rose grandly. Here and there seemed
-mighty rifts in the mountains, through which, as the sun began to
-sink, we saw now and again the white gleam of falling water. One of
-my companions touched my arm as we swept round the base of a hill and
-opened up the lofty, snow-covered peak of a mountain, which seemed, as
-we wound on our serpentine way, to be right before us.
-
-"Look! Isten szek!"--"God's seat!"--and he crossed himself reverently.
-
-As we wound on our endless way, and the sun sank lower and lower
-behind us, the shadows of the evening began to creep round us. This
-was emphasized by the fact that the snowy mountain-top still held the
-sunset, and seemed to glow out with a delicate cool pink. Here and
-there we passed Cszeks and slovaks, all in picturesque attire, but I
-noticed that goitre was painfully prevalent. By the roadside were
-many crosses, and as we swept by, my companions all crossed
-themselves. Here and there was a peasant man or woman kneeling before
-a shrine, who did not even turn round as we approached, but seemed in
-the self-surrender of devotion to have neither eyes nor ears for the
-outer world. There were many things new to me. For instance,
-hay-ricks in the trees, and here and there very beautiful masses of
-weeping birch, their white stems shining like silver through the
-delicate green of the leaves.
-
-Now and again we passed a leiter-wagon--the ordinary peasants's
-cart--with its long, snakelike vertebra, calculated to suit the
-inequalities of the road. On this were sure to be seated quite a
-group of homecoming peasants, the Cszeks with their white, and the
-Slovaks with their coloured sheepskins, the latter carrying
-lance-fashion their long staves, with axe at end. As the evening fell
-it began to get very cold, and the growing twilight seemed to merge
-into one dark mistiness the gloom of the trees, oak, beech, and pine,
-though in the valleys which ran deep between the spurs of the hills,
-as we ascended through the Pass, the dark firs stood out here and
-there against the background of late-lying snow. Sometimes, as the
-road was cut through the pine woods that seemed in the darkness to be
-closing down upon us, great masses of greyness which here and there
-bestrewed the trees, produced a peculiarly weird and solemn effect,
-which carried on the thoughts and grim fancies engendered earlier in
-the evening, when the falling sunset threw into strange relief the
-ghost-like clouds which amongst the Carpathians seem to wind
-ceaselessly through the valleys. Sometimes the hills were so steep
-that, despite our driver's haste, the horses could only go slowly. I
-wished to get down and walk up them, as we do at home, but the driver
-would not hear of it. "No, no," he said. "You must not walk here.
-The dogs are too fierce." And then he added, with what he evidently
-meant for grim pleasantry--for he looked round to catch the approving
-smile of the rest--"And you may have enough of such matters before you
-go to sleep." The only stop he would make was a moment's pause to
-light his lamps.
-
-When it grew dark there seemed to be some excitement amongst the
-passengers, and they kept speaking to him, one after the other, as
-though urging him to further speed. He lashed the horses unmercifully
-with his long whip, and with wild cries of encouragement urged them on
-to further exertions. Then through the darkness I could see a sort of
-patch of grey light ahead of us, as though there were a cleft in the
-hills. The excitement of the passengers grew greater. The crazy
-coach rocked on its great leather springs, and swayed like a boat
-tossed on a stormy sea. I had to hold on. The road grew more level,
-and we appeared to fly along. Then the mountains seemed to come
-nearer to us on each side and to frown down upon us. We were entering
-on the Borgo Pass. One by one several of the passengers offered me
-gifts, which they pressed upon me with an earnestness which would take
-no denial. These were certainly of an odd and varied kind, but each
-was given in simple good faith, with a kindly word, and a blessing,
-and that same strange mixture of fear-meaning movements which I had
-seen outside the hotel at Bistritz--the sign of the cross and the
-guard against the evil eye. Then, as we flew along, the driver leaned
-forward, and on each side the passengers, craning over the edge of the
-coach, peered eagerly into the darkness. It was evident that
-something very exciting was either happening or expected, but though I
-asked each passenger, no one would give me the slightest explanation.
-This state of excitement kept on for some little time. And at last we
-saw before us the Pass opening out on the eastern side. There were
-dark, rolling clouds overhead, and in the air the heavy, oppressive
-sense of thunder. It seemed as though the mountain range had
-separated two atmospheres, and that now we had got into the thunderous
-one. I was now myself looking out for the conveyance which was to
-take me to the Count. Each moment I expected to see the glare of
-lamps through the blackness, but all was dark. The only light was the
-flickering rays of our own lamps, in which the steam from our
-hard-driven horses rose in a white cloud. We could see now the sandy
-road lying white before us, but there was on it no sign of a vehicle.
-The passengers drew back with a sigh of gladness, which seemed to mock
-my own disappointment. I was already thinking what I had best do,
-when the driver, looking at his watch, said to the others something
-which I could hardly hear, it was spoken so quietly and in so low a
-tone, I thought it was "An hour less than the time." Then turning to
-me, he spoke in German worse than my own.
-
-"There is no carriage here. The Herr is not expected after all. He
-will now come on to Bukovina, and return tomorrow or the next day,
-better the next day." Whilst he was speaking the horses began to
-neigh and snort and plunge wildly, so that the driver had to hold them
-up. Then, amongst a chorus of screams from the peasants and a
-universal crossing of themselves, a caleche, with four horses, drove
-up behind us, overtook us, and drew up beside the coach. I could see
-from the flash of our lamps as the rays fell on them, that the horses
-were coal-black and splendid animals. They were driven by a tall man,
-with a long brown beard and a great black hat, which seemed to hide
-his face from us. I could only see the gleam of a pair of very bright
-eyes, which seemed red in the lamplight, as he turned to us.
-
-He said to the driver, "You are early tonight, my friend."
-
-The man stammered in reply, "The English Herr was in a hurry."
-
-To which the stranger replied, "That is why, I suppose, you wished him
-to go on to Bukovina. You cannot deceive me, my friend. I know too
-much, and my horses are swift."
-
-As he spoke he smiled, and the lamplight fell on a hard-looking mouth,
-with very red lips and sharp-looking teeth, as white as ivory. One of
-my companions whispered to another the line from Burger's "Lenore".
-
-"Denn die Todten reiten Schnell." ("For the dead travel fast.")
-
-The strange driver evidently heard the words, for he looked up with a
-gleaming smile. The passenger turned his face away, at the same time
-putting out his two fingers and crossing himself. "Give me the Herr's
-luggage," said the driver, and with exceeding alacrity my bags were
-handed out and put in the caleche. Then I descended from the side of
-the coach, as the caleche was close alongside, the driver helping me
-with a hand which caught my arm in a grip of steel. His strength must
-have been prodigious.
-
-Without a word he shook his reins, the horses turned, and we swept
-into the darkness of the pass. As I looked back I saw the steam from
-the horses of the coach by the light of the lamps, and projected
-against it the figures of my late companions crossing themselves.
-Then the driver cracked his whip and called to his horses, and off
-they swept on their way to Bukovina. As they sank into the darkness I
-felt a strange chill, and a lonely feeling come over me. But a cloak
-was thrown over my shoulders, and a rug across my knees, and the
-driver said in excellent German--"The night is chill, mein Herr, and
-my master the Count bade me take all care of you. There is a flask of
-slivovitz (the plum brandy of the country) underneath the seat, if you
-should require it."
-
-I did not take any, but it was a comfort to know it was there all the
-same. I felt a little strangely, and not a little frightened. I
-think had there been any alternative I should have taken it, instead
-of prosecuting that unknown night journey. The carriage went at a
-hard pace straight along, then we made a complete turn and went along
-another straight road. It seemed to me that we were simply going over
-and over the same ground again, and so I took note of some salient
-point, and found that this was so. I would have liked to have asked
-the driver what this all meant, but I really feared to do so, for I
-thought that, placed as I was, any protest would have had no effect in
-case there had been an intention to delay.
-
-By-and-by, however, as I was curious to know how time was passing, I
-struck a match, and by its flame looked at my watch. It was within a
-few minutes of midnight. This gave me a sort of shock, for I suppose
-the general superstition about midnight was increased by my recent
-experiences. I waited with a sick feeling of suspense.
-
-Then a dog began to howl somewhere in a farmhouse far down the road, a
-long, agonized wailing, as if from fear. The sound was taken up by
-another dog, and then another and another, till, borne on the wind
-which now sighed softly through the Pass, a wild howling began, which
-seemed to come from all over the country, as far as the imagination
-could grasp it through the gloom of the night.
-
-At the first howl the horses began to strain and rear, but the driver
-spoke to them soothingly, and they quieted down, but shivered and
-sweated as though after a runaway from sudden fright. Then, far off
-in the distance, from the mountains on each side of us began a louder
-and a sharper howling, that of wolves, which affected both the horses
-and myself in the same way. For I was minded to jump from the caleche
-and run, whilst they reared again and plunged madly, so that the
-driver had to use all his great strength to keep them from bolting.
-In a few minutes, however, my own ears got accustomed to the sound,
-and the horses so far became quiet that the driver was able to descend
-and to stand before them.
-
-He petted and soothed them, and whispered something in their ears, as
-I have heard of horse-tamers doing, and with extraordinary effect, for
-under his caresses they became quite manageable again, though they
-still trembled. The driver again took his seat, and shaking his
-reins, started off at a great pace. This time, after going to the far
-side of the Pass, he suddenly turned down a narrow roadway which ran
-sharply to the right.
-
-Soon we were hemmed in with trees, which in places arched right over
-the roadway till we passed as through a tunnel. And again great
-frowning rocks guarded us boldly on either side. Though we were in
-shelter, we could hear the rising wind, for it moaned and whistled
-through the rocks, and the branches of the trees crashed together as
-we swept along. It grew colder and colder still, and fine, powdery
-snow began to fall, so that soon we and all around us were covered
-with a white blanket. The keen wind still carried the howling of the
-dogs, though this grew fainter as we went on our way. The baying of
-the wolves sounded nearer and nearer, as though they were closing
-round on us from every side. I grew dreadfully afraid, and the horses
-shared my fear. The driver, however, was not in the least disturbed.
-He kept turning his head to left and right, but I could not see
-anything through the darkness.
-
-Suddenly, away on our left I saw a faint flickering blue flame. The
-driver saw it at the same moment. He at once checked the horses, and,
-jumping to the ground, disappeared into the darkness. I did not know
-what to do, the less as the howling of the wolves grew closer. But
-while I wondered, the driver suddenly appeared again, and without a
-word took his seat, and we resumed our journey. I think I must have
-fallen asleep and kept dreaming of the incident, for it seemed to be
-repeated endlessly, and now looking back, it is like a sort of awful
-nightmare. Once the flame appeared so near the road, that even in the
-darkness around us I could watch the driver's motions. He went
-rapidly to where the blue flame arose, it must have been very faint,
-for it did not seem to illumine the place around it at all, and
-gathering a few stones, formed them into some device.
-
-Once there appeared a strange optical effect. When he stood between
-me and the flame he did not obstruct it, for I could see its ghostly
-flicker all the same. This startled me, but as the effect was only
-momentary, I took it that my eyes deceived me straining through the
-darkness. Then for a time there were no blue flames, and we sped
-onwards through the gloom, with the howling of the wolves around us,
-as though they were following in a moving circle.
-
-At last there came a time when the driver went further afield than he
-had yet gone, and during his absence, the horses began to tremble
-worse than ever and to snort and scream with fright. I could not see
-any cause for it, for the howling of the wolves had ceased altogether.
-But just then the moon, sailing through the black clouds, appeared
-behind the jagged crest of a beetling, pine-clad rock, and by its
-light I saw around us a ring of wolves, with white teeth and lolling
-red tongues, with long, sinewy limbs and shaggy hair. They were a
-hundred times more terrible in the grim silence which held them than
-even when they howled. For myself, I felt a sort of paralysis of
-fear. It is only when a man feels himself face to face with such
-horrors that he can understand their true import.
-
-All at once the wolves began to howl as though the moonlight had had
-some peculiar effect on them. The horses jumped about and reared, and
-looked helplessly round with eyes that rolled in a way painful to
-see. But the living ring of terror encompassed them on every side,
-and they had perforce to remain within it. I called to the coachman
-to come, for it seemed to me that our only chance was to try to break
-out through the ring and to aid his approach, I shouted and beat the
-side of the caleche, hoping by the noise to scare the wolves from the
-side, so as to give him a chance of reaching the trap. How he came
-there, I know not, but I heard his voice raised in a tone of imperious
-command, and looking towards the sound, saw him stand in the roadway.
-As he swept his long arms, as though brushing aside some impalpable
-obstacle, the wolves fell back and back further still. Just then a
-heavy cloud passed across the face of the moon, so that we were again
-in darkness.
-
-When I could see again the driver was climbing into the caleche, and
-the wolves disappeared. This was all so strange and uncanny that a
-dreadful fear came upon me, and I was afraid to speak or move. The
-time seemed interminable as we swept on our way, now in almost
-complete darkness, for the rolling clouds obscured the moon.
-
-We kept on ascending, with occasional periods of quick descent, but in
-the main always ascending. Suddenly, I became conscious of the fact
-that the driver was in the act of pulling up the horses in the
-courtyard of a vast ruined castle, from whose tall black windows came
-no ray of light, and whose broken battlements showed a jagged line
-against the sky.
-
-
-
-
-CHAPTER 2
-
-
-Jonathan Harker's Journal Continued
-
-5 May.--I must have been asleep, for certainly if I had been fully
-awake I must have noticed the approach of such a remarkable place. In
-the gloom the courtyard looked of considerable size, and as several
-dark ways led from it under great round arches, it perhaps seemed
-bigger than it really is. I have not yet been able to see it by
-daylight.
-
-When the caleche stopped, the driver jumped down and held out his hand
-to assist me to alight. Again I could not but notice his prodigious
-strength. His hand actually seemed like a steel vice that could have
-crushed mine if he had chosen. Then he took my traps, and placed them
-on the ground beside me as I stood close to a great door, old and
-studded with large iron nails, and set in a projecting doorway of
-massive stone. I could see even in the dim light that the stone was
-massively carved, but that the carving had been much worn by time and
-weather. As I stood, the driver jumped again into his seat and shook
-the reins. The horses started forward, and trap and all disappeared
-down one of the dark openings.
-
-I stood in silence where I was, for I did not know what to do. Of
-bell or knocker there was no sign. Through these frowning walls and
-dark window openings it was not likely that my voice could penetrate.
-The time I waited seemed endless, and I felt doubts and fears crowding
-upon me. What sort of place had I come to, and among what kind of
-people? What sort of grim adventure was it on which I had embarked?
-Was this a customary incident in the life of a solicitor's clerk sent
-out to explain the purchase of a London estate to a foreigner?
-Solicitor's clerk! Mina would not like that. Solicitor, for just
-before leaving London I got word that my examination was successful,
-and I am now a full-blown solicitor! I began to rub my eyes and pinch
-myself to see if I were awake. It all seemed like a horrible
-nightmare to me, and I expected that I should suddenly awake, and find
-myself at home, with the dawn struggling in through the windows, as I
-had now and again felt in the morning after a day of overwork. But my
-flesh answered the pinching test, and my eyes were not to be
-deceived. I was indeed awake and among the Carpathians. All I could
-do now was to be patient, and to wait the coming of morning.
-
-Just as I had come to this conclusion I heard a heavy step approaching
-behind the great door, and saw through the chinks the gleam of a
-coming light. Then there was the sound of rattling chains and the
-clanking of massive bolts drawn back. A key was turned with the loud
-grating noise of long disuse, and the great door swung back.
-
-Within, stood a tall old man, clean shaven save for a long white
-moustache, and clad in black from head to foot, without a single speck
-of colour about him anywhere. He held in his hand an antique silver
-lamp, in which the flame burned without a chimney or globe of any
-kind, throwing long quivering shadows as it flickered in the draught
-of the open door. The old man motioned me in with his right hand with
-a courtly gesture, saying in excellent English, but with a strange
-intonation.
-
-"Welcome to my house! Enter freely and of your own free will!" He
-made no motion of stepping to meet me, but stood like a statue, as
-though his gesture of welcome had fixed him into stone. The instant,
-however, that I had stepped over the threshold, he moved impulsively
-forward, and holding out his hand grasped mine with a strength which
-made me wince, an effect which was not lessened by the fact that it
-seemed cold as ice, more like the hand of a dead than a living man.
-Again he said,
-
-"Welcome to my house! Enter freely. Go safely, and leave something
-of the happiness you bring!" The strength of the handshake was so
-much akin to that which I had noticed in the driver, whose face I had
-not seen, that for a moment I doubted if it were not the same person
-to whom I was speaking. So to make sure, I said interrogatively,
-"Count Dracula?"
-
-He bowed in a courtly way as he replied, "I am Dracula, and I bid you
-welcome, Mr. Harker, to my house. Come in, the night air is chill,
-and you must need to eat and rest." As he was speaking, he put the lamp
-on a bracket on the wall, and stepping out, took my luggage. He had
-carried it in before I could forestall him. I protested, but he
-insisted.
-
-"Nay, sir, you are my guest. It is late, and my people are not
-available. Let me see to your comfort myself." He insisted on carrying
-my traps along the passage, and then up a great winding stair, and
-along another great passage, on whose stone floor our steps rang
-heavily. At the end of this he threw open a heavy door, and I
-rejoiced to see within a well-lit room in which a table was spread for
-supper, and on whose mighty hearth a great fire of logs, freshly
-replenished, flamed and flared.
-
-The Count halted, putting down my bags, closed the door, and crossing
-the room, opened another door, which led into a small octagonal room
-lit by a single lamp, and seemingly without a window of any sort.
-Passing through this, he opened another door, and motioned me to
-enter. It was a welcome sight. For here was a great bedroom well
-lighted and warmed with another log fire, also added to but lately,
-for the top logs were fresh, which sent a hollow roar up the wide
-chimney. The Count himself left my luggage inside and withdrew,
-saying, before he closed the door.
-
-"You will need, after your journey, to refresh yourself by making your
-toilet. I trust you will find all you wish. When you are ready, come
-into the other room, where you will find your supper prepared."
-
-The light and warmth and the Count's courteous welcome seemed to have
-dissipated all my doubts and fears. Having then reached my normal
-state, I discovered that I was half famished with hunger. So making a
-hasty toilet, I went into the other room.
-
-I found supper already laid out. My host, who stood on one side of
-the great fireplace, leaning against the stonework, made a graceful
-wave of his hand to the table, and said,
-
-"I pray you, be seated and sup how you please. You will I trust,
-excuse me that I do not join you, but I have dined already, and I do
-not sup."
-
-I handed to him the sealed letter which Mr. Hawkins had entrusted to
-me. He opened it and read it gravely. Then, with a charming smile,
-he handed it to me to read. One passage of it, at least, gave me a
-thrill of pleasure.
-
-"I must regret that an attack of gout, from which malady I am a
-constant sufferer, forbids absolutely any travelling on my part for
-some time to come. But I am happy to say I can send a sufficient
-substitute, one in whom I have every possible confidence. He is a
-young man, full of energy and talent in his own way, and of a very
-faithful disposition. He is discreet and silent, and has grown into
-manhood in my service. He shall be ready to attend on you when you
-will during his stay, and shall take your instructions in all
-matters."
-
-The count himself came forward and took off the cover of a dish, and I
-fell to at once on an excellent roast chicken. This, with some cheese
-and a salad and a bottle of old tokay, of which I had two glasses, was
-my supper. During the time I was eating it the Count asked me many
-questions as to my journey, and I told him by degrees all I had
-experienced.
-
-By this time I had finished my supper, and by my host's desire had
-drawn up a chair by the fire and begun to smoke a cigar which he
-offered me, at the same time excusing himself that he did not smoke.
-I had now an opportunity of observing him, and found him of a very
-marked physiognomy.
-
-His face was a strong, a very strong, aquiline, with high bridge of
-the thin nose and peculiarly arched nostrils, with lofty domed
-forehead, and hair growing scantily round the temples but profusely
-elsewhere. His eyebrows were very massive, almost meeting over the
-nose, and with bushy hair that seemed to curl in its own profusion.
-The mouth, so far as I could see it under the heavy moustache, was
-fixed and rather cruel-looking, with peculiarly sharp white teeth.
-These protruded over the lips, whose remarkable ruddiness showed
-astonishing vitality in a man of his years. For the rest, his ears
-were pale, and at the tops extremely pointed. The chin was broad and
-strong, and the cheeks firm though thin. The general effect was one
-of extraordinary pallor.
-
-Hitherto I had noticed the backs of his hands as they lay on his knees
-in the firelight, and they had seemed rather white and fine. But
-seeing them now close to me, I could not but notice that they were
-rather coarse, broad, with squat fingers. Strange to say, there were
-hairs in the centre of the palm. The nails were long and fine, and
-cut to a sharp point. As the Count leaned over me and his hands
-touched me, I could not repress a shudder. It may have been that his
-breath was rank, but a horrible feeling of nausea came over me, which,
-do what I would, I could not conceal.
-
-The Count, evidently noticing it, drew back. And with a grim sort of
-smile, which showed more than he had yet done his protruberant teeth,
-sat himself down again on his own side of the fireplace. We were both
-silent for a while, and as I looked towards the window I saw the first
-dim streak of the coming dawn. There seemed a strange stillness over
-everything. But as I listened, I heard as if from down below in the
-valley the howling of many wolves. The Count's eyes gleamed, and he
-said.
-
-"Listen to them, the children of the night. What music they make!"
-Seeing, I suppose, some expression in my face strange to him, he
-added, "Ah, sir, you dwellers in the city cannot enter into the
-feelings of the hunter." Then he rose and said.
-
-"But you must be tired. Your bedroom is all ready, and tomorrow you
-shall sleep as late as you will. I have to be away till the
-afternoon, so sleep well and dream well!" With a courteous bow, he
-opened for me himself the door to the octagonal room, and I entered my
-bedroom.
-
-I am all in a sea of wonders. I doubt. I fear. I think strange
-things, which I dare not confess to my own soul. God keep me, if only
-for the sake of those dear to me!
-
-
-7 May.--It is again early morning, but I have rested and enjoyed the
-last twenty-four hours. I slept till late in the day, and awoke of my
-own accord. When I had dressed myself I went into the room where we
-had supped, and found a cold breakfast laid out, with coffee kept hot
-by the pot being placed on the hearth. There was a card on the table,
-on which was written--"I have to be absent for a while. Do not wait
-for me. D." I set to and enjoyed a hearty meal. When I had done, I
-looked for a bell, so that I might let the servants know I had
-finished, but I could not find one. There are certainly odd
-deficiencies in the house, considering the extraordinary evidences of
-wealth which are round me. The table service is of gold, and so
-beautifully wrought that it must be of immense value. The curtains
-and upholstery of the chairs and sofas and the hangings of my bed are
-of the costliest and most beautiful fabrics, and must have been of
-fabulous value when they were made, for they are centuries old, though
-in excellent order. I saw something like them in Hampton Court, but
-they were worn and frayed and moth-eaten. But still in none of the
-rooms is there a mirror. There is not even a toilet glass on my
-table, and I had to get the little shaving glass from my bag before I
-could either shave or brush my hair. I have not yet seen a servant
-anywhere, or heard a sound near the castle except the howling of
-wolves. Some time after I had finished my meal, I do not know whether
-to call it breakfast or dinner, for it was between five and six
-o'clock when I had it, I looked about for something to read, for I did
-not like to go about the castle until I had asked the Count's
-permission. There was absolutely nothing in the room, book,
-newspaper, or even writing materials, so I opened another door in the
-room and found a sort of library. The door opposite mine I tried, but
-found locked.
-
-In the library I found, to my great delight, a vast number of English
-books, whole shelves full of them, and bound volumes of magazines and
-newspapers. A table in the centre was littered with English magazines
-and newspapers, though none of them were of very recent date. The
-books were of the most varied kind, history, geography, politics,
-political economy, botany, geology, law, all relating to England and
-English life and customs and manners. There were even such books of
-reference as the London Directory, the "Red" and "Blue" books,
-Whitaker's Almanac, the Army and Navy Lists, and it somehow gladdened
-my heart to see it, the Law List.
-
-Whilst I was looking at the books, the door opened, and the Count
-entered. He saluted me in a hearty way, and hoped that I had had a
-good night's rest. Then he went on.
-
-"I am glad you found your way in here, for I am sure there is much
-that will interest you. These companions," and he laid his hand on
-some of the books, "have been good friends to me, and for some years
-past, ever since I had the idea of going to London, have given me
-many, many hours of pleasure. Through them I have come to know your
-great England, and to know her is to love her. I long to go through
-the crowded streets of your mighty London, to be in the midst of the
-whirl and rush of humanity, to share its life, its change, its death,
-and all that makes it what it is. But alas! As yet I only know your
-tongue through books. To you, my friend, I look that I know it to
-speak."
-
-"But, Count," I said, "You know and speak English thoroughly!" He
-bowed gravely.
-
-"I thank you, my friend, for your all too-flattering estimate, but yet
-I fear that I am but a little way on the road I would travel. True, I
-know the grammar and the words, but yet I know not how to speak them."
-
-"Indeed," I said, "You speak excellently."
-
-"Not so," he answered. "Well, I know that, did I move and speak in
-your London, none there are who would not know me for a stranger. That
-is not enough for me. Here I am noble. I am a Boyar. The common
-people know me, and I am master. But a stranger in a strange land, he
-is no one. Men know him not, and to know not is to care not for. I
-am content if I am like the rest, so that no man stops if he sees me,
-or pauses in his speaking if he hears my words, 'Ha, ha! A stranger!'
-I have been so long master that I would be master still, or at least
-that none other should be master of me. You come to me not alone as
-agent of my friend Peter Hawkins, of Exeter, to tell me all about my
-new estate in London. You shall, I trust, rest here with me a while,
-so that by our talking I may learn the English intonation. And I
-would that you tell me when I make error, even of the smallest, in my
-speaking. I am sorry that I had to be away so long today, but you
-will, I know forgive one who has so many important affairs in hand."
-
-Of course I said all I could about being willing, and asked if I might
-come into that room when I chose. He answered, "Yes, certainly," and
-added.
-
-"You may go anywhere you wish in the castle, except where the doors
-are locked, where of course you will not wish to go. There is reason
-that all things are as they are, and did you see with my eyes and know
-with my knowledge, you would perhaps better understand." I said I was
-sure of this, and then he went on.
-
-"We are in Transylvania, and Transylvania is not England. Our ways
-are not your ways, and there shall be to you many strange things. Nay,
-from what you have told me of your experiences already, you know
-something of what strange things there may be."
-
-This led to much conversation, and as it was evident that he wanted to
-talk, if only for talking's sake, I asked him many questions regarding
-things that had already happened to me or come within my notice.
-Sometimes he sheered off the subject, or turned the conversation by
-pretending not to understand, but generally he answered all I asked
-most frankly. Then as time went on, and I had got somewhat bolder, I
-asked him of some of the strange things of the preceding night, as for
-instance, why the coachman went to the places where he had seen the
-blue flames. He then explained to me that it was commonly believed
-that on a certain night of the year, last night, in fact, when all
-evil spirits are supposed to have unchecked sway, a blue flame is seen
-over any place where treasure has been concealed.
-
-"That treasure has been hidden," he went on, "in the region through
-which you came last night, there can be but little doubt. For it was
-the ground fought over for centuries by the Wallachian, the Saxon, and
-the Turk. Why, there is hardly a foot of soil in all this region that
-has not been enriched by the blood of men, patriots or invaders. In
-the old days there were stirring times, when the Austrian and the
-Hungarian came up in hordes, and the patriots went out to meet them,
-men and women, the aged and the children too, and waited their coming
-on the rocks above the passes, that they might sweep destruction on
-them with their artificial avalanches. When the invader was
-triumphant he found but little, for whatever there was had been
-sheltered in the friendly soil."
-
-"But how," said I, "can it have remained so long undiscovered, when
-there is a sure index to it if men will but take the trouble to look?"
-The Count smiled, and as his lips ran back over his gums, the long,
-sharp, canine teeth showed out strangely. He answered:
-
-"Because your peasant is at heart a coward and a fool! Those flames
-only appear on one night, and on that night no man of this land will,
-if he can help it, stir without his doors. And, dear sir, even if he
-did he would not know what to do. Why, even the peasant that you tell
-me of who marked the place of the flame would not know where to look
-in daylight even for his own work. Even you would not, I dare be
-sworn, be able to find these places again?"
-
-"There you are right," I said. "I know no more than the dead where
-even to look for them." Then we drifted into other matters.
-
-"Come," he said at last, "tell me of London and of the house which you
-have procured for me." With an apology for my remissness, I went into
-my own room to get the papers from my bag. Whilst I was placing them
-in order I heard a rattling of china and silver in the next room, and
-as I passed through, noticed that the table had been cleared and the
-lamp lit, for it was by this time deep into the dark. The lamps were
-also lit in the study or library, and I found the Count lying on the
-sofa, reading, of all things in the world, an English Bradshaw's
-Guide. When I came in he cleared the books and papers from the table,
-and with him I went into plans and deeds and figures of all sorts. He
-was interested in everything, and asked me a myriad questions about
-the place and its surroundings. He clearly had studied beforehand all
-he could get on the subject of the neighbourhood, for he evidently at
-the end knew very much more than I did. When I remarked this, he
-answered.
-
-"Well, but, my friend, is it not needful that I should? When I go
-there I shall be all alone, and my friend Harker Jonathan, nay, pardon
-me. I fall into my country's habit of putting your patronymic first,
-my friend Jonathan Harker will not be by my side to correct and aid
-me. He will be in Exeter, miles away, probably working at papers of
-the law with my other friend, Peter Hawkins. So!"
-
-We went thoroughly into the business of the purchase of the estate at
-Purfleet. When I had told him the facts and got his signature to the
-necessary papers, and had written a letter with them ready to post to
-Mr. Hawkins, he began to ask me how I had come across so suitable a
-place. I read to him the notes which I had made at the time, and
-which I inscribe here.
-
-"At Purfleet, on a byroad, I came across just such a place as seemed
-to be required, and where was displayed a dilapidated notice that the
-place was for sale. It was surrounded by a high wall, of ancient
-structure, built of heavy stones, and has not been repaired for a
-large number of years. The closed gates are of heavy old oak and
-iron, all eaten with rust.
-
-"The estate is called Carfax, no doubt a corruption of the old Quatre
-Face, as the house is four sided, agreeing with the cardinal points of
-the compass. It contains in all some twenty acres, quite surrounded
-by the solid stone wall above mentioned. There are many trees on it,
-which make it in places gloomy, and there is a deep, dark-looking pond
-or small lake, evidently fed by some springs, as the water is clear
-and flows away in a fair-sized stream. The house is very large and of
-all periods back, I should say, to mediaeval times, for one part is of
-stone immensely thick, with only a few windows high up and heavily
-barred with iron. It looks like part of a keep, and is close to an
-old chapel or church. I could not enter it, as I had not the key of
-the door leading to it from the house, but I have taken with my Kodak
-views of it from various points. The house had been added to, but in
-a very straggling way, and I can only guess at the amount of ground it
-covers, which must be very great. There are but few houses close at
-hand, one being a very large house only recently added to and formed
-into a private lunatic asylum. It is not, however, visible from the
-grounds."
-
-When I had finished, he said, "I am glad that it is old and big. I
-myself am of an old family, and to live in a new house would kill me.
-A house cannot be made habitable in a day, and after all, how few days
-go to make up a century. I rejoice also that there is a chapel of old
-times. We Transylvanian nobles love not to think that our bones may
-lie amongst the common dead. I seek not gaiety nor mirth, not the
-bright voluptuousness of much sunshine and sparkling waters which
-please the young and gay. I am no longer young, and my heart, through
-weary years of mourning over the dead, is not attuned to mirth. Moreover,
-the walls of my castle are broken. The shadows are many, and the wind
-breathes cold through the broken battlements and casements. I love
-the shade and the shadow, and would be alone with my thoughts when I
-may." Somehow his words and his look did not seem to accord, or else
-it was that his cast of face made his smile look malignant and
-saturnine.
-
-Presently, with an excuse, he left me, asking me to pull my papers
-together. He was some little time away, and I began to look at some
-of the books around me. One was an atlas, which I found opened
-naturally to England, as if that map had been much used. On looking
-at it I found in certain places little rings marked, and on examining
-these I noticed that one was near London on the east side, manifestly
-where his new estate was situated. The other two were Exeter, and
-Whitby on the Yorkshire coast.
-
-It was the better part of an hour when the Count returned. "Aha!" he
-said. "Still at your books? Good! But you must not work always.
-Come! I am informed that your supper is ready." He took my arm, and
-we went into the next room, where I found an excellent supper ready on
-the table. The Count again excused himself, as he had dined out on
-his being away from home. But he sat as on the previous night, and
-chatted whilst I ate. After supper I smoked, as on the last evening,
-and the Count stayed with me, chatting and asking questions on every
-conceivable subject, hour after hour. I felt that it was getting very
-late indeed, but I did not say anything, for I felt under obligation
-to meet my host's wishes in every way. I was not sleepy, as the long
-sleep yesterday had fortified me, but I could not help experiencing
-that chill which comes over one at the coming of the dawn, which is
-like, in its way, the turn of the tide. They say that people who are
-near death die generally at the change to dawn or at the turn of the
-tide. Anyone who has when tired, and tied as it were to his post,
-experienced this change in the atmosphere can well believe it. All at
-once we heard the crow of the cock coming up with preternatural
-shrillness through the clear morning air.
-
-Count Dracula, jumping to his feet, said, "Why there is the morning
-again! How remiss I am to let you stay up so long. You must make
-your conversation regarding my dear new country of England less
-interesting, so that I may not forget how time flies by us," and with
-a courtly bow, he quickly left me.
-
-I went into my room and drew the curtains, but there was little to
-notice. My window opened into the courtyard, all I could see was the
-warm grey of quickening sky. So I pulled the curtains again, and have
-written of this day.
-
-
-8 May.--I began to fear as I wrote in this book that I was getting too
-diffuse. But now I am glad that I went into detail from the first,
-for there is something so strange about this place and all in it that
-I cannot but feel uneasy. I wish I were safe out of it, or that I had
-never come. It may be that this strange night existence is telling on
-me, but would that that were all! If there were any one to talk to I
-could bear it, but there is no one. I have only the Count to speak
-with, and he--I fear I am myself the only living soul within the
-place. Let me be prosaic so far as facts can be. It will help me to
-bear up, and imagination must not run riot with me. If it does I am
-lost. Let me say at once how I stand, or seem to.
-
-I only slept a few hours when I went to bed, and feeling that I could
-not sleep any more, got up. I had hung my shaving glass by the
-window, and was just beginning to shave. Suddenly I felt a hand on my
-shoulder, and heard the Count's voice saying to me, "Good morning." I
-started, for it amazed me that I had not seen him, since the
-reflection of the glass covered the whole room behind me. In starting
-I had cut myself slightly, but did not notice it at the moment. Having
-answered the Count's salutation, I turned to the glass again to see
-how I had been mistaken. This time there could be no error, for the
-man was close to me, and I could see him over my shoulder. But there
-was no reflection of him in the mirror! The whole room behind me was
-displayed, but there was no sign of a man in it, except myself.
-
-This was startling, and coming on the top of so many strange things,
-was beginning to increase that vague feeling of uneasiness which I
-always have when the Count is near. But at the instant I saw that the
-cut had bled a little, and the blood was trickling over my chin. I
-laid down the razor, turning as I did so half round to look for some
-sticking plaster. When the Count saw my face, his eyes blazed with a
-sort of demoniac fury, and he suddenly made a grab at my throat. I
-drew away and his hand touched the string of beads which held the
-crucifix. It made an instant change in him, for the fury passed so
-quickly that I could hardly believe that it was ever there.
-
-"Take care," he said, "take care how you cut yourself. It is more
-dangerous that you think in this country." Then seizing the shaving
-glass, he went on, "And this is the wretched thing that has done the
-mischief. It is a foul bauble of man's vanity. Away with it!" And
-opening the window with one wrench of his terrible hand, he flung out
-the glass, which was shattered into a thousand pieces on the stones of
-the courtyard far below. Then he withdrew without a word. It is very
-annoying, for I do not see how I am to shave, unless in my watch-case
-or the bottom of the shaving pot, which is fortunately of metal.
-
-When I went into the dining room, breakfast was prepared, but I could
-not find the Count anywhere. So I breakfasted alone. It is strange
-that as yet I have not seen the Count eat or drink. He must be a very
-peculiar man! After breakfast I did a little exploring in the
-castle. I went out on the stairs, and found a room looking towards
-the South.
-
-The view was magnificent, and from where I stood there was every
-opportunity of seeing it. The castle is on the very edge of a
-terrific precipice. A stone falling from the window would fall a
-thousand feet without touching anything! As far as the eye can reach
-is a sea of green tree tops, with occasionally a deep rift where there
-is a chasm. Here and there are silver threads where the rivers wind
-in deep gorges through the forests.
-
-But I am not in heart to describe beauty, for when I had seen the view
-I explored further. Doors, doors, doors everywhere, and all locked
-and bolted. In no place save from the windows in the castle walls is
-there an available exit. The castle is a veritable prison, and I am a
-prisoner!
-
-
-
-
-CHAPTER 3
-
-
-Jonathan Harker's Journal Continued
-
-When I found that I was a prisoner a sort of wild feeling came over
-me. I rushed up and down the stairs, trying every door and peering
-out of every window I could find, but after a little the conviction of
-my helplessness overpowered all other feelings. When I look back
-after a few hours I think I must have been mad for the time, for I
-behaved much as a rat does in a trap. When, however, the conviction
-had come to me that I was helpless I sat down quietly, as quietly as I
-have ever done anything in my life, and began to think over what was
-best to be done. I am thinking still, and as yet have come to no
-definite conclusion. Of one thing only am I certain. That it is no
-use making my ideas known to the Count. He knows well that I am
-imprisoned, and as he has done it himself, and has doubtless his own
-motives for it, he would only deceive me if I trusted him fully with
-the facts. So far as I can see, my only plan will be to keep my
-knowledge and my fears to myself, and my eyes open. I am, I know,
-either being deceived, like a baby, by my own fears, or else I am in
-desperate straits, and if the latter be so, I need, and shall need,
-all my brains to get through.
-
-I had hardly come to this conclusion when I heard the great door below
-shut, and knew that the Count had returned. He did not come at once
-into the library, so I went cautiously to my own room and found him
-making the bed. This was odd, but only confirmed what I had all along
-thought, that there are no servants in the house. When later I saw
-him through the chink of the hinges of the door laying the table in
-the dining room, I was assured of it. For if he does himself all
-these menial offices, surely it is proof that there is no one else in
-the castle, it must have been the Count himself who was the driver of
-the coach that brought me here. This is a terrible thought, for if
-so, what does it mean that he could control the wolves, as he did, by
-only holding up his hand for silence? How was it that all the people
-at Bistritz and on the coach had some terrible fear for me? What
-meant the giving of the crucifix, of the garlic, of the wild rose, of
-the mountain ash?
-
-Bless that good, good woman who hung the crucifix round my neck! For
-it is a comfort and a strength to me whenever I touch it. It is odd
-that a thing which I have been taught to regard with disfavour and as
-idolatrous should in a time of loneliness and trouble be of help. Is
-it that there is something in the essence of the thing itself, or that
-it is a medium, a tangible help, in conveying memories of sympathy and
-comfort? Some time, if it may be, I must examine this matter and try
-to make up my mind about it. In the meantime I must find out all I
-can about Count Dracula, as it may help me to understand. Tonight he
-may talk of himself, if I turn the conversation that way. I must be
-very careful, however, not to awake his suspicion.
-
-
-Midnight.--I have had a long talk with the Count. I asked him a few
-questions on Transylvania history, and he warmed up to the subject
-wonderfully. In his speaking of things and people, and especially of
-battles, he spoke as if he had been present at them all. This he
-afterwards explained by saying that to a Boyar the pride of his house
-and name is his own pride, that their glory is his glory, that their
-fate is his fate. Whenever he spoke of his house he always said "we",
-and spoke almost in the plural, like a king speaking. I wish I could
-put down all he said exactly as he said it, for to me it was most
-fascinating. It seemed to have in it a whole history of the country.
-He grew excited as he spoke, and walked about the room pulling his
-great white moustache and grasping anything on which he laid his hands
-as though he would crush it by main strength. One thing he said which
-I shall put down as nearly as I can, for it tells in its way the story
-of his race.
-
-"We Szekelys have a right to be proud, for in our veins flows the
-blood of many brave races who fought as the lion fights, for lordship.
-Here, in the whirlpool of European races, the Ugric tribe bore down
-from Iceland the fighting spirit which Thor and Wodin gave them, which
-their Berserkers displayed to such fell intent on the seaboards of
-Europe, aye, and of Asia and Africa too, till the peoples thought that
-the werewolves themselves had come. Here, too, when they came, they
-found the Huns, whose warlike fury had swept the earth like a living
-flame, till the dying peoples held that in their veins ran the blood
-of those old witches, who, expelled from Scythia had mated with the
-devils in the desert. Fools, fools! What devil or what witch was
-ever so great as Attila, whose blood is in these veins?" He held up
-his arms. "Is it a wonder that we were a conquering race, that we
-were proud, that when the Magyar, the Lombard, the Avar, the Bulgar,
-or the Turk poured his thousands on our frontiers, we drove them back?
-Is it strange that when Arpad and his legions swept through the
-Hungarian fatherland he found us here when he reached the frontier,
-that the Honfoglalas was completed there? And when the Hungarian
-flood swept eastward, the Szekelys were claimed as kindred by the
-victorious Magyars, and to us for centuries was trusted the guarding
-of the frontier of Turkeyland. Aye, and more than that, endless duty
-of the frontier guard, for as the Turks say, 'water sleeps, and the
-enemy is sleepless.' Who more gladly than we throughout the Four
-Nations received the 'bloody sword,' or at its warlike call flocked
-quicker to the standard of the King? When was redeemed that great
-shame of my nation, the shame of Cassova, when the flags of the
-Wallach and the Magyar went down beneath the Crescent? Who was it but
-one of my own race who as Voivode crossed the Danube and beat the Turk
-on his own ground? This was a Dracula indeed! Woe was it that his
-own unworthy brother, when he had fallen, sold his people to the Turk
-and brought the shame of slavery on them! Was it not this Dracula,
-indeed, who inspired that other of his race who in a later age again
-and again brought his forces over the great river into Turkeyland,
-who, when he was beaten back, came again, and again, though he had to
-come alone from the bloody field where his troops were being
-slaughtered, since he knew that he alone could ultimately triumph!
-They said that he thought only of himself. Bah! What good are
-peasants without a leader? Where ends the war without a brain and
-heart to conduct it? Again, when, after the battle of Mohacs, we
-threw off the Hungarian yoke, we of the Dracula blood were amongst
-their leaders, for our spirit would not brook that we were not free.
-Ah, young sir, the Szekelys, and the Dracula as their heart's blood,
-their brains, and their swords, can boast a record that mushroom
-growths like the Hapsburgs and the Romanoffs can never reach. The
-warlike days are over. Blood is too precious a thing in these days of
-dishonourable peace, and the glories of the great races are as a tale
-that is told."
-
-It was by this time close on morning, and we went to bed. (Mem., this
-diary seems horribly like the beginning of the "Arabian Nights," for
-everything has to break off at cockcrow, or like the ghost of Hamlet's
-father.)
-
-
-12 May.--Let me begin with facts, bare, meager facts, verified by
-books and figures, and of which there can be no doubt. I must not
-confuse them with experiences which will have to rest on my own
-observation, or my memory of them. Last evening when the Count came
-from his room he began by asking me questions on legal matters and on
-the doing of certain kinds of business. I had spent the day wearily
-over books, and, simply to keep my mind occupied, went over some of
-the matters I had been examined in at Lincoln's Inn. There was a
-certain method in the Count's inquiries, so I shall try to put them
-down in sequence. The knowledge may somehow or some time be useful to
-me.
-
-First, he asked if a man in England might have two solicitors or more.
-I told him he might have a dozen if he wished, but that it would not
-be wise to have more than one solicitor engaged in one transaction, as
-only one could act at a time, and that to change would be certain to
-militate against his interest. He seemed thoroughly to understand,
-and went on to ask if there would be any practical difficulty in having
-one man to attend, say, to banking, and another to look after
-shipping, in case local help were needed in a place far from the home
-of the banking solicitor. I asked to explain more fully, so that I
-might not by any chance mislead him, so he said,
-
-"I shall illustrate. Your friend and mine, Mr. Peter Hawkins, from
-under the shadow of your beautiful cathedral at Exeter, which is far
-from London, buys for me through your good self my place at London.
-Good! Now here let me say frankly, lest you should think it strange
-that I have sought the services of one so far off from London instead
-of some one resident there, that my motive was that no local interest
-might be served save my wish only, and as one of London residence
-might, perhaps, have some purpose of himself or friend to serve, I
-went thus afield to seek my agent, whose labours should be only to my
-interest. Now, suppose I, who have much of affairs, wish to ship
-goods, say, to Newcastle, or Durham, or Harwich, or Dover, might it
-not be that it could with more ease be done by consigning to one in
-these ports?"
-
-I answered that certainly it would be most easy, but that we
-solicitors had a system of agency one for the other, so that local
-work could be done locally on instruction from any solicitor, so that
-the client, simply placing himself in the hands of one man, could have
-his wishes carried out by him without further trouble.
-
-"But," said he, "I could be at liberty to direct myself. Is it not
-so?"
-
-"Of course," I replied, and "Such is often done by men of business,
-who do not like the whole of their affairs to be known by any one
-person."
-
-"Good!" he said, and then went on to ask about the means of making
-consignments and the forms to be gone through, and of all sorts of
-difficulties which might arise, but by forethought could be guarded
-against. I explained all these things to him to the best of my
-ability, and he certainly left me under the impression that he would
-have made a wonderful solicitor, for there was nothing that he did not
-think of or foresee. For a man who was never in the country, and who
-did not evidently do much in the way of business, his knowledge and
-acumen were wonderful. When he had satisfied himself on these points
-of which he had spoken, and I had verified all as well as I could by
-the books available, he suddenly stood up and said, "Have you written
-since your first letter to our friend Mr. Peter Hawkins, or to any
-other?"
-
-It was with some bitterness in my heart that I answered that I had
-not, that as yet I had not seen any opportunity of sending letters to
-anybody.
-
-"Then write now, my young friend," he said, laying a heavy hand on my
-shoulder, "write to our friend and to any other, and say, if it will
-please you, that you shall stay with me until a month from now."
-
-"Do you wish me to stay so long?" I asked, for my heart grew cold at
-the thought.
-
-"I desire it much, nay I will take no refusal. When your master,
-employer, what you will, engaged that someone should come on his
-behalf, it was understood that my needs only were to be consulted. I
-have not stinted. Is it not so?"
-
-What could I do but bow acceptance? It was Mr. Hawkins' interest, not
-mine, and I had to think of him, not myself, and besides, while Count
-Dracula was speaking, there was that in his eyes and in his bearing
-which made me remember that I was a prisoner, and that if I wished it
-I could have no choice. The Count saw his victory in my bow, and his
-mastery in the trouble of my face, for he began at once to use them,
-but in his own smooth, resistless way.
-
-"I pray you, my good young friend, that you will not discourse of
-things other than business in your letters. It will doubtless please
-your friends to know that you are well, and that you look forward to
-getting home to them. Is it not so?" As he spoke he handed me three
-sheets of note paper and three envelopes. They were all of the
-thinnest foreign post, and looking at them, then at him, and noticing
-his quiet smile, with the sharp, canine teeth lying over the red
-underlip, I understood as well as if he had spoken that I should be
-more careful what I wrote, for he would be able to read it. So I
-determined to write only formal notes now, but to write fully to Mr.
-Hawkins in secret, and also to Mina, for to her I could write
-shorthand, which would puzzle the Count, if he did see it. When I had
-written my two letters I sat quiet, reading a book whilst the Count
-wrote several notes, referring as he wrote them to some books on his
-table. Then he took up my two and placed them with his own, and put
-by his writing materials, after which, the instant the door had closed
-behind him, I leaned over and looked at the letters, which were face
-down on the table. I felt no compunction in doing so for under the
-circumstances I felt that I should protect myself in every way I
-could.
-
-One of the letters was directed to Samuel F. Billington, No. 7, The
-Crescent, Whitby, another to Herr Leutner, Varna. The third was to
-Coutts & Co., London, and the fourth to Herren Klopstock & Billreuth,
-bankers, Buda Pesth. The second and fourth were unsealed. I was just
-about to look at them when I saw the door handle move. I sank back in
-my seat, having just had time to resume my book before the Count,
-holding still another letter in his hand, entered the room. He took
-up the letters on the table and stamped them carefully, and then
-turning to me, said,
-
-"I trust you will forgive me, but I have much work to do in private
-this evening. You will, I hope, find all things as you wish." At the
-door he turned, and after a moment's pause said, "Let me advise you,
-my dear young friend. Nay, let me warn you with all seriousness, that
-should you leave these rooms you will not by any chance go to sleep in
-any other part of the castle. It is old, and has many memories, and
-there are bad dreams for those who sleep unwisely. Be warned! Should
-sleep now or ever overcome you, or be like to do, then haste to your
-own chamber or to these rooms, for your rest will then be safe. But
-if you be not careful in this respect, then," He finished his speech
-in a gruesome way, for he motioned with his hands as if he were washing
-them. I quite understood. My only doubt was as to whether any dream
-could be more terrible than the unnatural, horrible net of gloom and
-mystery which seemed closing around me.
-
-
-Later.--I endorse the last words written, but this time there is no
-doubt in question. I shall not fear to sleep in any place where he is
-not. I have placed the crucifix over the head of my bed, I imagine
-that my rest is thus freer from dreams, and there it shall remain.
-
-When he left me I went to my room. After a little while, not hearing
-any sound, I came out and went up the stone stair to where I could
-look out towards the South. There was some sense of freedom in the
-vast expanse, inaccessible though it was to me, as compared with the
-narrow darkness of the courtyard. Looking out on this, I felt that I
-was indeed in prison, and I seemed to want a breath of fresh air,
-though it were of the night. I am beginning to feel this nocturnal
-existence tell on me. It is destroying my nerve. I start at my own
-shadow, and am full of all sorts of horrible imaginings. God knows
-that there is ground for my terrible fear in this accursed place! I
-looked out over the beautiful expanse, bathed in soft yellow moonlight
-till it was almost as light as day. In the soft light the distant
-hills became melted, and the shadows in the valleys and gorges of
-velvety blackness. The mere beauty seemed to cheer me. There was
-peace and comfort in every breath I drew. As I leaned from the window
-my eye was caught by something moving a storey below me, and somewhat
-to my left, where I imagined, from the order of the rooms, that the
-windows of the Count's own room would look out. The window at which I
-stood was tall and deep, stone-mullioned, and though weatherworn, was
-still complete. But it was evidently many a day since the case had
-been there. I drew back behind the stonework, and looked carefully
-out.
-
-What I saw was the Count's head coming out from the window. I did not
-see the face, but I knew the man by the neck and the movement of his
-back and arms. In any case I could not mistake the hands which I had
-had some many opportunities of studying. I was at first interested
-and somewhat amused, for it is wonderful how small a matter will
-interest and amuse a man when he is a prisoner. But my very feelings
-changed to repulsion and terror when I saw the whole man slowly emerge
-from the window and begin to crawl down the castle wall over the
-dreadful abyss, face down with his cloak spreading out around him like
-great wings. At first I could not believe my eyes. I thought it was
-some trick of the moonlight, some weird effect of shadow, but I kept
-looking, and it could be no delusion. I saw the fingers and toes
-grasp the corners of the stones, worn clear of the mortar by the
-stress of years, and by thus using every projection and inequality
-move downwards with considerable speed, just as a lizard moves along a
-wall.
-
-What manner of man is this, or what manner of creature, is it in the
-semblance of man? I feel the dread of this horrible place
-overpowering me. I am in fear, in awful fear, and there is no escape
-for me. I am encompassed about with terrors that I dare not think of.
-
-
-15 May.--Once more I have seen the count go out in his lizard fashion.
-He moved downwards in a sidelong way, some hundred feet down, and a
-good deal to the left. He vanished into some hole or window. When
-his head had disappeared, I leaned out to try and see more, but
-without avail. The distance was too great to allow a proper angle of
-sight. I knew he had left the castle now, and thought to use the
-opportunity to explore more than I had dared to do as yet. I went
-back to the room, and taking a lamp, tried all the doors. They were
-all locked, as I had expected, and the locks were comparatively new.
-But I went down the stone stairs to the hall where I had entered
-originally. I found I could pull back the bolts easily enough and
-unhook the great chains. But the door was locked, and the key was
-gone! That key must be in the Count's room. I must watch should his
-door be unlocked, so that I may get it and escape. I went on to make
-a thorough examination of the various stairs and passages, and to try
-the doors that opened from them. One or two small rooms near the hall
-were open, but there was nothing to see in them except old furniture,
-dusty with age and moth-eaten. At last, however, I found one door at
-the top of the stairway which, though it seemed locked, gave a little
-under pressure. I tried it harder, and found that it was not really
-locked, but that the resistance came from the fact that the hinges had
-fallen somewhat, and the heavy door rested on the floor. Here was an
-opportunity which I might not have again, so I exerted myself, and
-with many efforts forced it back so that I could enter. I was now in
-a wing of the castle further to the right than the rooms I knew and a
-storey lower down. From the windows I could see that the suite of
-rooms lay along to the south of the castle, the windows of the end
-room looking out both west and south. On the latter side, as well as
-to the former, there was a great precipice. The castle was built on
-the corner of a great rock, so that on three sides it was quite
-impregnable, and great windows were placed here where sling, or bow,
-or culverin could not reach, and consequently light and comfort,
-impossible to a position which had to be guarded, were secured. To
-the west was a great valley, and then, rising far away, great jagged
-mountain fastnesses, rising peak on peak, the sheer rock studded with
-mountain ash and thorn, whose roots clung in cracks and crevices and
-crannies of the stone. This was evidently the portion of the castle
-occupied by the ladies in bygone days, for the furniture had more an
-air of comfort than any I had seen.
-
-The windows were curtainless, and the yellow moonlight, flooding in
-through the diamond panes, enabled one to see even colours, whilst it
-softened the wealth of dust which lay over all and disguised in some
-measure the ravages of time and moth. My lamp seemed to be of little
-effect in the brilliant moonlight, but I was glad to have it with me,
-for there was a dread loneliness in the place which chilled my heart
-and made my nerves tremble. Still, it was better than living alone in
-the rooms which I had come to hate from the presence of the Count, and
-after trying a little to school my nerves, I found a soft quietude
-come over me. Here I am, sitting at a little oak table where in old
-times possibly some fair lady sat to pen, with much thought and many
-blushes, her ill-spelt love letter, and writing in my diary in
-shorthand all that has happened since I closed it last. It is the
-nineteenth century up-to-date with a vengeance. And yet, unless my
-senses deceive me, the old centuries had, and have, powers of their
-own which mere "modernity" cannot kill.
-
-
-Later: The morning of 16 May.--God preserve my sanity, for to this I
-am reduced. Safety and the assurance of safety are things of the
-past. Whilst I live on here there is but one thing to hope for, that
-I may not go mad, if, indeed, I be not mad already. If I be sane,
-then surely it is maddening to think that of all the foul things that
-lurk in this hateful place the Count is the least dreadful to me, that
-to him alone I can look for safety, even though this be only whilst I
-can serve his purpose. Great God! Merciful God, let me be calm, for
-out of that way lies madness indeed. I begin to get new lights on
-certain things which have puzzled me. Up to now I never quite knew
-what Shakespeare meant when he made Hamlet say, "My tablets! Quick,
-my tablets! 'tis meet that I put it down," etc., For now, feeling as
-though my own brain were unhinged or as if the shock had come which
-must end in its undoing, I turn to my diary for repose. The habit of
-entering accurately must help to soothe me.
-
-The Count's mysterious warning frightened me at the time. It frightens
-me more not when I think of it, for in the future he has a fearful
-hold upon me. I shall fear to doubt what he may say!
-
-When I had written in my diary and had fortunately replaced the book
-and pen in my pocket I felt sleepy. The Count's warning came into my
-mind, but I took pleasure in disobeying it. The sense of sleep was
-upon me, and with it the obstinacy which sleep brings as outrider. The
-soft moonlight soothed, and the wide expanse without gave a sense of
-freedom which refreshed me. I determined not to return tonight to the
-gloom-haunted rooms, but to sleep here, where, of old, ladies had sat
-and sung and lived sweet lives whilst their gentle breasts were sad
-for their menfolk away in the midst of remorseless wars. I drew a
-great couch out of its place near the corner, so that as I lay, I
-could look at the lovely view to east and south, and unthinking of and
-uncaring for the dust, composed myself for sleep. I suppose I must
-have fallen asleep. I hope so, but I fear, for all that followed was
-startlingly real, so real that now sitting here in the broad, full
-sunlight of the morning, I cannot in the least believe that it was all
-sleep.
-
-I was not alone. The room was the same, unchanged in any way since I
-came into it. I could see along the floor, in the brilliant
-moonlight, my own footsteps marked where I had disturbed the long
-accumulation of dust. In the moonlight opposite me were three young
-women, ladies by their dress and manner. I thought at the time that I
-must be dreaming when I saw them, they threw no shadow on the floor.
-They came close to me, and looked at me for some time, and then
-whispered together. Two were dark, and had high aquiline noses, like
-the Count, and great dark, piercing eyes, that seemed to be almost red
-when contrasted with the pale yellow moon. The other was fair, as
-fair as can be, with great masses of golden hair and eyes like pale
-sapphires. I seemed somehow to know her face, and to know it in
-connection with some dreamy fear, but I could not recollect at the
-moment how or where. All three had brilliant white teeth that shone
-like pearls against the ruby of their voluptuous lips. There was
-something about them that made me uneasy, some longing and at the same
-time some deadly fear. I felt in my heart a wicked, burning desire
-that they would kiss me with those red lips. It is not good to note
-this down, lest some day it should meet Mina's eyes and cause her
-pain, but it is the truth. They whispered together, and then they all
-three laughed, such a silvery, musical laugh, but as hard as though
-the sound never could have come through the softness of human lips.
-It was like the intolerable, tingling sweetness of waterglasses when
-played on by a cunning hand. The fair girl shook her head
-coquettishly, and the other two urged her on.
-
-One said, "Go on! You are first, and we shall follow. Yours is the
-right to begin."
-
-The other added, "He is young and strong. There are kisses for us
-all."
-
-I lay quiet, looking out from under my eyelashes in an agony of
-delightful anticipation. The fair girl advanced and bent over me till
-I could feel the movement of her breath upon me. Sweet it was in one
-sense, honey-sweet, and sent the same tingling through the nerves as
-her voice, but with a bitter underlying the sweet, a bitter
-offensiveness, as one smells in blood.
-
-I was afraid to raise my eyelids, but looked out and saw perfectly
-under the lashes. The girl went on her knees, and bent over me,
-simply gloating. There was a deliberate voluptuousness which was both
-thrilling and repulsive, and as she arched her neck she actually
-licked her lips like an animal, till I could see in the moonlight the
-moisture shining on the scarlet lips and on the red tongue as it
-lapped the white sharp teeth. Lower and lower went her head as the
-lips went below the range of my mouth and chin and seemed to fasten on
-my throat. Then she paused, and I could hear the churning sound of
-her tongue as it licked her teeth and lips, and I could feel the hot
-breath on my neck. Then the skin of my throat began to tingle as
-one's flesh does when the hand that is to tickle it approaches nearer,
-nearer. I could feel the soft, shivering touch of the lips on the
-super sensitive skin of my throat, and the hard dents of two sharp
-teeth, just touching and pausing there. I closed my eyes in
-languorous ecstasy and waited, waited with beating heart.
-
-But at that instant, another sensation swept through me as quick as
-lightning. I was conscious of the presence of the Count, and of his
-being as if lapped in a storm of fury. As my eyes opened
-involuntarily I saw his strong hand grasp the slender neck of the fair
-woman and with giant's power draw it back, the blue eyes transformed
-with fury, the white teeth champing with rage, and the fair cheeks
-blazing red with passion. But the Count! Never did I imagine such
-wrath and fury, even to the demons of the pit. His eyes were
-positively blazing. The red light in them was lurid, as if the flames
-of hell fire blazed behind them. His face was deathly pale, and the
-lines of it were hard like drawn wires. The thick eyebrows that met
-over the nose now seemed like a heaving bar of white-hot metal. With
-a fierce sweep of his arm, he hurled the woman from him, and then
-motioned to the others, as though he were beating them back. It was
-the same imperious gesture that I had seen used to the wolves. In a
-voice which, though low and almost in a whisper seemed to cut through
-the air and then ring in the room he said,
-
-"How dare you touch him, any of you? How dare you cast eyes on him
-when I had forbidden it? Back, I tell you all! This man belongs to
-me! Beware how you meddle with him, or you'll have to deal with me."
-
-The fair girl, with a laugh of ribald coquetry, turned to answer him.
-"You yourself never loved. You never love!" On this the other women
-joined, and such a mirthless, hard, soulless laughter rang through the
-room that it almost made me faint to hear. It seemed like the
-pleasure of fiends.
-
-Then the Count turned, after looking at my face attentively, and said
-in a soft whisper, "Yes, I too can love. You yourselves can tell it
-from the past. Is it not so? Well, now I promise you that when I am
-done with him you shall kiss him at your will. Now go! Go! I must
-awaken him, for there is work to be done."
-
-"Are we to have nothing tonight?" said one of them, with a low laugh,
-as she pointed to the bag which he had thrown upon the floor, and
-which moved as though there were some living thing within it. For
-answer he nodded his head. One of the women jumped forward and opened
-it. If my ears did not deceive me there was a gasp and a low wail, as
-of a half smothered child. The women closed round, whilst I was
-aghast with horror. But as I looked, they disappeared, and with them
-the dreadful bag. There was no door near them, and they could not
-have passed me without my noticing. They simply seemed to fade into
-the rays of the moonlight and pass out through the window, for I could
-see outside the dim, shadowy forms for a moment before they entirely
-faded away.
-
-Then the horror overcame me, and I sank down unconscious.
-
-
-
-
-CHAPTER 4
-
-
-Jonathan Harker's Journal Continued
-
-I awoke in my own bed. If it be that I had not dreamt, the Count must
-have carried me here. I tried to satisfy myself on the subject, but
-could not arrive at any unquestionable result. To be sure, there were
-certain small evidences, such as that my clothes were folded and laid
-by in a manner which was not my habit. My watch was still unwound,
-and I am rigorously accustomed to wind it the last thing before going
-to bed, and many such details. But these things are no proof, for
-they may have been evidences that my mind was not as usual, and, for
-some cause or another, I had certainly been much upset. I must watch
-for proof. Of one thing I am glad. If it was that the Count carried
-me here and undressed me, he must have been hurried in his task, for
-my pockets are intact. I am sure this diary would have been a mystery
-to him which he would not have brooked. He would have taken or
-destroyed it. As I look round this room, although it has been to me
-so full of fear, it is now a sort of sanctuary, for nothing can be
-more dreadful than those awful women, who were, who are, waiting to
-suck my blood.
-
-
-18 May.--I have been down to look at that room again in daylight, for
-I must know the truth. When I got to the doorway at the top of the
-stairs I found it closed. It had been so forcibly driven against the
-jamb that part of the woodwork was splintered. I could see that the
-bolt of the lock had not been shot, but the door is fastened from the
-inside. I fear it was no dream, and must act on this surmise.
-
-
-19 May.--I am surely in the toils. Last night the Count asked me in
-the suavest tones to write three letters, one saying that my work here
-was nearly done, and that I should start for home within a few days,
-another that I was starting on the next morning from the time of the
-letter, and the third that I had left the castle and arrived at
-Bistritz. I would fain have rebelled, but felt that in the present
-state of things it would be madness to quarrel openly with the Count
-whilst I am so absolutely in his power. And to refuse would be to
-excite his suspicion and to arouse his anger. He knows that I know
-too much, and that I must not live, lest I be dangerous to him. My
-only chance is to prolong my opportunities. Something may occur which
-will give me a chance to escape. I saw in his eyes something of that
-gathering wrath which was manifest when he hurled that fair woman from
-him. He explained to me that posts were few and uncertain, and that
-my writing now would ensure ease of mind to my friends. And he
-assured me with so much impressiveness that he would countermand the
-later letters, which would be held over at Bistritz until due time in
-case chance would admit of my prolonging my stay, that to oppose him
-would have been to create new suspicion. I therefore pretended to
-fall in with his views, and asked him what dates I should put on the
-letters.
-
-He calculated a minute, and then said, "The first should be June 12,
-the second June 19, and the third June 29."
-
-I know now the span of my life. God help me!
-
-
-28 May.--There is a chance of escape, or at any rate of being able to
-send word home. A band of Szgany have come to the castle, and are
-encamped in the courtyard. These are gipsies. I have notes of them
-in my book. They are peculiar to this part of the world, though
-allied to the ordinary gipsies all the world over. There are
-thousands of them in Hungary and Transylvania, who are almost outside
-all law. They attach themselves as a rule to some great noble or
-boyar, and call themselves by his name. They are fearless and without
-religion, save superstition, and they talk only their own varieties of
-the Romany tongue.
-
-I shall write some letters home, and shall try to get them to have
-them posted. I have already spoken to them through my window to begin
-acquaintanceship. They took their hats off and made obeisance and
-many signs, which however, I could not understand any more than I
-could their spoken language . . .
-
-I have written the letters. Mina's is in shorthand, and I simply ask
-Mr. Hawkins to communicate with her. To her I have explained my
-situation, but without the horrors which I may only surmise. It would
-shock and frighten her to death were I to expose my heart to her.
-Should the letters not carry, then the Count shall not yet know my
-secret or the extent of my knowledge. . . .
-
-
-I have given the letters. I threw them through the bars of my window
-with a gold piece, and made what signs I could to have them posted.
-The man who took them pressed them to his heart and bowed, and then
-put them in his cap. I could do no more. I stole back to the study,
-and began to read. As the Count did not come in, I have written
-here . . .
-
-
-The Count has come. He sat down beside me, and said in his smoothest
-voice as he opened two letters, "The Szgany has given me these, of
-which, though I know not whence they come, I shall, of course, take
-care. See!"--He must have looked at it.--"One is from you, and to my
-friend Peter Hawkins. The other,"--here he caught sight of the
-strange symbols as he opened the envelope, and the dark look came into
-his face, and his eyes blazed wickedly,--"The other is a vile thing,
-an outrage upon friendship and hospitality! It is not signed. Well!
-So it cannot matter to us." And he calmly held letter and envelope in
-the flame of the lamp till they were consumed.
-
-Then he went on, "The letter to Hawkins, that I shall, of course send
-on, since it is yours. Your letters are sacred to me. Your pardon,
-my friend, that unknowingly I did break the seal. Will you not cover
-it again?" He held out the letter to me, and with a courteous bow
-handed me a clean envelope.
-
-I could only redirect it and hand it to him in silence. When he went
-out of the room I could hear the key turn softly. A minute later I
-went over and tried it, and the door was locked.
-
-When, an hour or two after, the Count came quietly into the room, his
-coming awakened me, for I had gone to sleep on the sofa. He was very
-courteous and very cheery in his manner, and seeing that I had been
-sleeping, he said, "So, my friend, you are tired? Get to bed. There
-is the surest rest. I may not have the pleasure of talk tonight,
-since there are many labours to me, but you will sleep, I pray."
-
-I passed to my room and went to bed, and, strange to say, slept
-without dreaming. Despair has its own calms.
-
-31 May.--This morning when I woke I thought I would provide myself
-with some papers and envelopes from my bag and keep them in my pocket,
-so that I might write in case I should get an opportunity, but again a
-surprise, again a shock!
-
-Every scrap of paper was gone, and with it all my notes, my memoranda,
-relating to railways and travel, my letter of credit, in fact all that
-might be useful to me were I once outside the castle. I sat and
-pondered awhile, and then some thought occurred to me, and I made
-search of my portmanteau and in the wardrobe where I had placed my
-clothes.
-
-The suit in which I had travelled was gone, and also my overcoat and
-rug. I could find no trace of them anywhere. This looked like some
-new scheme of villainy . . .
-
-
-17 June.--This morning, as I was sitting on the edge of my bed
-cudgelling my brains, I heard without a crackling of whips and
-pounding and scraping of horses' feet up the rocky path beyond the
-courtyard. With joy I hurried to the window, and saw drive into the
-yard two great leiter-wagons, each drawn by eight sturdy horses, and
-at the head of each pair a Slovak, with his wide hat, great
-nail-studded belt, dirty sheepskin, and high boots. They had also
-their long staves in hand. I ran to the door, intending to descend
-and try and join them through the main hall, as I thought that way
-might be opened for them. Again a shock, my door was fastened on the
-outside.
-
-Then I ran to the window and cried to them. They looked up at me
-stupidly and pointed, but just then the "hetman" of the Szgany came
-out, and seeing them pointing to my window, said something, at which
-they laughed.
-
-Henceforth no effort of mine, no piteous cry or agonized entreaty,
-would make them even look at me. They resolutely turned away. The
-leiter-wagons contained great, square boxes, with handles of thick
-rope. These were evidently empty by the ease with which the Slovaks
-handled them, and by their resonance as they were roughly moved.
-
-When they were all unloaded and packed in a great heap in one corner
-of the yard, the Slovaks were given some money by the Szgany, and
-spitting on it for luck, lazily went each to his horse's head.
-Shortly afterwards, I heard the crackling of their whips die away in
-the distance.
-
-
-24 June.--Last night the Count left me early, and locked himself into
-his own room. As soon as I dared I ran up the winding stair, and
-looked out of the window, which opened South. I thought I would watch
-for the Count, for there is something going on. The Szgany are
-quartered somewhere in the castle and are doing work of some kind. I
-know it, for now and then, I hear a far-away muffled sound as of
-mattock and spade, and, whatever it is, it must be the end of some
-ruthless villainy.
-
-I had been at the window somewhat less than half an hour, when I saw
-something coming out of the Count's window. I drew back and watched
-carefully, and saw the whole man emerge. It was a new shock to me to
-find that he had on the suit of clothes which I had worn whilst
-travelling here, and slung over his shoulder the terrible bag which I
-had seen the women take away. There could be no doubt as to his
-quest, and in my garb, too! This, then, is his new scheme of evil,
-that he will allow others to see me, as they think, so that he may
-both leave evidence that I have been seen in the towns or villages
-posting my own letters, and that any wickedness which he may do shall
-by the local people be attributed to me.
-
-It makes me rage to think that this can go on, and whilst I am shut up
-here, a veritable prisoner, but without that protection of the law
-which is even a criminal's right and consolation.
-
-I thought I would watch for the Count's return, and for a long time
-sat doggedly at the window. Then I began to notice that there were
-some quaint little specks floating in the rays of the moonlight. They
-were like the tiniest grains of dust, and they whirled round and
-gathered in clusters in a nebulous sort of way. I watched them with a
-sense of soothing, and a sort of calm stole over me. I leaned back in
-the embrasure in a more comfortable position, so that I could enjoy
-more fully the aerial gambolling.
-
-Something made me start up, a low, piteous howling of dogs somewhere
-far below in the valley, which was hidden from my sight. Louder it
-seemed to ring in my ears, and the floating moats of dust to take new
-shapes to the sound as they danced in the moonlight. I felt myself
-struggling to awake to some call of my instincts. Nay, my very soul
-was struggling, and my half-remembered sensibilities were striving to
-answer the call. I was becoming hypnotised!
-
-Quicker and quicker danced the dust. The moonbeams seemed to quiver
-as they went by me into the mass of gloom beyond. More and more they
-gathered till they seemed to take dim phantom shapes. And then I
-started, broad awake and in full possession of my senses, and ran
-screaming from the place.
-
-The phantom shapes, which were becoming gradually materialised from
-the moonbeams, were those three ghostly women to whom I was doomed.
-
-I fled, and felt somewhat safer in my own room, where there was no
-moonlight, and where the lamp was burning brightly.
-
-When a couple of hours had passed I heard something stirring in the
-Count's room, something like a sharp wail quickly suppressed. And
-then there was silence, deep, awful silence, which chilled me. With a
-beating heart, I tried the door, but I was locked in my prison, and
-could do nothing. I sat down and simply cried.
-
-As I sat I heard a sound in the courtyard without, the agonised cry of
-a woman. I rushed to the window, and throwing it up, peered between
-the bars.
-
-There, indeed, was a woman with dishevelled hair, holding her hands
-over her heart as one distressed with running. She was leaning
-against the corner of the gateway. When she saw my face at the window
-she threw herself forward, and shouted in a voice laden with menace,
-"Monster, give me my child!"
-
-She threw herself on her knees, and raising up her hands, cried the
-same words in tones which wrung my heart. Then she tore her hair and
-beat her breast, and abandoned herself to all the violences of
-extravagant emotion. Finally, she threw herself forward, and though I
-could not see her, I could hear the beating of her naked hands against
-the door.
-
-Somewhere high overhead, probably on the tower, I heard the voice of
-the Count calling in his harsh, metallic whisper. His call seemed to
-be answered from far and wide by the howling of wolves. Before many
-minutes had passed a pack of them poured, like a pent-up dam when
-liberated, through the wide entrance into the courtyard.
-
-There was no cry from the woman, and the howling of the wolves was but
-short. Before long they streamed away singly, licking their lips.
-
-I could not pity her, for I knew now what had become of her child, and
-she was better dead.
-
-What shall I do? What can I do? How can I escape from this dreadful
-thing of night, gloom, and fear?
-
-
-25 June.--No man knows till he has suffered from the night how sweet
-and dear to his heart and eye the morning can be. When the sun grew
-so high this morning that it struck the top of the great gateway
-opposite my window, the high spot which it touched seemed to me as if
-the dove from the ark had lighted there. My fear fell from me as if
-it had been a vaporous garment which dissolved in the warmth.
-
-I must take action of some sort whilst the courage of the day is upon
-me. Last night one of my post-dated letters went to post, the first
-of that fatal series which is to blot out the very traces of my
-existence from the earth.
-
-Let me not think of it. Action!
-
-It has always been at night-time that I have been molested or
-threatened, or in some way in danger or in fear. I have not yet seen
-the Count in the daylight. Can it be that he sleeps when others wake,
-that he may be awake whilst they sleep? If I could only get into his
-room! But there is no possible way. The door is always locked, no
-way for me.
-
-Yes, there is a way, if one dares to take it. Where his body has gone
-why may not another body go? I have seen him myself crawl from his
-window. Why should not I imitate him, and go in by his window? The
-chances are desperate, but my need is more desperate still. I shall
-risk it. At the worst it can only be death, and a man's death is not
-a calf's, and the dreaded Hereafter may still be open to me. God help
-me in my task! Goodbye, Mina, if I fail. Goodbye, my faithful friend
-and second father. Goodbye, all, and last of all Mina!
-
-
-Same day, later.--I have made the effort, and God helping me, have
-come safely back to this room. I must put down every detail in order.
-I went whilst my courage was fresh straight to the window on the south
-side, and at once got outside on this side. The stones are big and
-roughly cut, and the mortar has by process of time been washed away
-between them. I took off my boots, and ventured out on the desperate
-way. I looked down once, so as to make sure that a sudden glimpse of
-the awful depth would not overcome me, but after that kept my eyes
-away from it. I know pretty well the direction and distance of the
-Count's window, and made for it as well as I could, having regard to
-the opportunities available. I did not feel dizzy, I suppose I was
-too excited, and the time seemed ridiculously short till I found
-myself standing on the window sill and trying to raise up the sash. I
-was filled with agitation, however, when I bent down and slid feet
-foremost in through the window. Then I looked around for the Count,
-but with surprise and gladness, made a discovery. The room was
-empty! It was barely furnished with odd things, which seemed to have
-never been used.
-
-The furniture was something the same style as that in the south rooms,
-and was covered with dust. I looked for the key, but it was not in
-the lock, and I could not find it anywhere. The only thing I found
-was a great heap of gold in one corner, gold of all kinds, Roman, and
-British, and Austrian, and Hungarian, and Greek and Turkish money,
-covered with a film of dust, as though it had lain long in the ground.
-None of it that I noticed was less than three hundred years old.
-There were also chains and ornaments, some jewelled, but all of them
-old and stained.
-
-At one corner of the room was a heavy door. I tried it, for, since I
-could not find the key of the room or the key of the outer door, which
-was the main object of my search, I must make further examination, or
-all my efforts would be in vain. It was open, and led through a stone
-passage to a circular stairway, which went steeply down.
-
-I descended, minding carefully where I went for the stairs were dark,
-being only lit by loopholes in the heavy masonry. At the bottom there
-was a dark, tunnel-like passage, through which came a deathly, sickly
-odour, the odour of old earth newly turned. As I went through the
-passage the smell grew closer and heavier. At last I pulled open a
-heavy door which stood ajar, and found myself in an old ruined chapel,
-which had evidently been used as a graveyard. The roof was broken,
-and in two places were steps leading to vaults, but the ground had
-recently been dug over, and the earth placed in great wooden boxes,
-manifestly those which had been brought by the Slovaks.
-
-There was nobody about, and I made a search over every inch of the
-ground, so as not to lose a chance. I went down even into the vaults,
-where the dim light struggled, although to do so was a dread to my
-very soul. Into two of these I went, but saw nothing except fragments
-of old coffins and piles of dust. In the third, however, I made a
-discovery.
-
-There, in one of the great boxes, of which there were fifty in all, on
-a pile of newly dug earth, lay the Count! He was either dead or
-asleep. I could not say which, for eyes were open and stony, but
-without the glassiness of death, and the cheeks had the warmth of life
-through all their pallor. The lips were as red as ever. But there
-was no sign of movement, no pulse, no breath, no beating of the heart.
-
-I bent over him, and tried to find any sign of life, but in vain. He
-could not have lain there long, for the earthy smell would have passed
-away in a few hours. By the side of the box was its cover, pierced
-with holes here and there. I thought he might have the keys on him,
-but when I went to search I saw the dead eyes, and in them dead though
-they were, such a look of hate, though unconscious of me or my
-presence, that I fled from the place, and leaving the Count's room by
-the window, crawled again up the castle wall. Regaining my room, I
-threw myself panting upon the bed and tried to think.
-
-
-29 June.--Today is the date of my last letter, and the Count has taken
-steps to prove that it was genuine, for again I saw him leave the
-castle by the same window, and in my clothes. As he went down the
-wall, lizard fashion, I wished I had a gun or some lethal weapon, that
-I might destroy him. But I fear that no weapon wrought along by man's
-hand would have any effect on him. I dared not wait to see him
-return, for I feared to see those weird sisters. I came back to the
-library, and read there till I fell asleep.
-
-I was awakened by the Count, who looked at me as grimly as a man could
-look as he said, "Tomorrow, my friend, we must part. You return to
-your beautiful England, I to some work which may have such an end that
-we may never meet. Your letter home has been despatched. Tomorrow I
-shall not be here, but all shall be ready for your journey. In the
-morning come the Szgany, who have some labours of their own here, and
-also come some Slovaks. When they have gone, my carriage shall come
-for you, and shall bear you to the Borgo Pass to meet the diligence
-from Bukovina to Bistritz. But I am in hopes that I shall see more of
-you at Castle Dracula."
-
-I suspected him, and determined to test his sincerity. Sincerity! It
-seems like a profanation of the word to write it in connection with
-such a monster, so I asked him point-blank, "Why may I not go
-tonight?"
-
-"Because, dear sir, my coachman and horses are away on a mission."
-
-"But I would walk with pleasure. I want to get away at once."
-
-He smiled, such a soft, smooth, diabolical smile that I knew there was
-some trick behind his smoothness. He said, "And your baggage?"
-
-"I do not care about it. I can send for it some other time."
-
-The Count stood up, and said, with a sweet courtesy which made me rub
-my eyes, it seemed so real, "You English have a saying which is close
-to my heart, for its spirit is that which rules our boyars, 'Welcome
-the coming, speed the parting guest.' Come with me, my dear young
-friend. Not an hour shall you wait in my house against your will,
-though sad am I at your going, and that you so suddenly desire it.
-Come!" With a stately gravity, he, with the lamp, preceded me down
-the stairs and along the hall. Suddenly he stopped. "Hark!"
-
-Close at hand came the howling of many wolves. It was almost as if
-the sound sprang up at the rising of his hand, just as the music of a
-great orchestra seems to leap under the baton of the conductor. After
-a pause of a moment, he proceeded, in his stately way, to the door,
-drew back the ponderous bolts, unhooked the heavy chains, and began to
-draw it open.
-
-To my intense astonishment I saw that it was unlocked. Suspiciously,
-I looked all round, but could see no key of any kind.
-
-As the door began to open, the howling of the wolves without grew
-louder and angrier. Their red jaws, with champing teeth, and their
-blunt-clawed feet as they leaped, came in through the opening door. I
-knew than that to struggle at the moment against the Count was
-useless. With such allies as these at his command, I could do
-nothing.
-
-But still the door continued slowly to open, and only the Count's body
-stood in the gap. Suddenly it struck me that this might be the moment
-and means of my doom. I was to be given to the wolves, and at my own
-instigation. There was a diabolical wickedness in the idea great
-enough for the Count, and as the last chance I cried out, "Shut the
-door! I shall wait till morning." And I covered my face with my
-hands to hide my tears of bitter disappointment.
-
-With one sweep of his powerful arm, the Count threw the door shut, and
-the great bolts clanged and echoed through the hall as they shot back
-into their places.
-
-In silence we returned to the library, and after a minute or two I went
-to my own room. The last I saw of Count Dracula was his kissing his
-hand to me, with a red light of triumph in his eyes, and with a smile
-that Judas in hell might be proud of.
-
-When I was in my room and about to lie down, I thought I heard a
-whispering at my door. I went to it softly and listened. Unless my
-ears deceived me, I heard the voice of the Count.
-
-"Back! Back to your own place! Your time is not yet come. Wait!
-Have patience! Tonight is mine. Tomorrow night is yours!"
-
-There was a low, sweet ripple of laughter, and in a rage I threw open
-the door, and saw without the three terrible women licking their lips.
-As I appeared, they all joined in a horrible laugh, and ran away.
-
-I came back to my room and threw myself on my knees. It is then so
-near the end? Tomorrow! Tomorrow! Lord, help me, and those to whom
-I am dear!
-
-
-30 June.--These may be the last words I ever write in this diary. I
-slept till just before the dawn, and when I woke threw myself on my
-knees, for I determined that if Death came he should find me ready.
-
-At last I felt that subtle change in the air, and knew that the
-morning had come. Then came the welcome cockcrow, and I felt that I
-was safe. With a glad heart, I opened the door and ran down the hall.
-I had seen that the door was unlocked, and now escape was before me.
-With hands that trembled with eagerness, I unhooked the chains and
-threw back the massive bolts.
-
-But the door would not move. Despair seized me. I pulled and pulled
-at the door, and shook it till, massive as it was, it rattled in its
-casement. I could see the bolt shot. It had been locked after I left
-the Count.
-
-Then a wild desire took me to obtain the key at any risk, and I
-determined then and there to scale the wall again, and gain the
-Count's room. He might kill me, but death now seemed the happier
-choice of evils. Without a pause I rushed up to the east window, and
-scrambled down the wall, as before, into the Count's room. It was
-empty, but that was as I expected. I could not see a key anywhere,
-but the heap of gold remained. I went through the door in the corner
-and down the winding stair and along the dark passage to the old
-chapel. I knew now well enough where to find the monster I sought.
-
-The great box was in the same place, close against the wall, but the
-lid was laid on it, not fastened down, but with the nails ready in
-their places to be hammered home.
-
-I knew I must reach the body for the key, so I raised the lid, and
-laid it back against the wall. And then I saw something which filled
-my very soul with horror. There lay the Count, but looking as if his
-youth had been half restored. For the white hair and moustache were
-changed to dark iron-grey. The cheeks were fuller, and the white skin
-seemed ruby-red underneath. The mouth was redder than ever, for on
-the lips were gouts of fresh blood, which trickled from the corners of
-the mouth and ran down over the chin and neck. Even the deep, burning
-eyes seemed set amongst swollen flesh, for the lids and pouches
-underneath were bloated. It seemed as if the whole awful creature
-were simply gorged with blood. He lay like a filthy leech, exhausted
-with his repletion.
-
-I shuddered as I bent over to touch him, and every sense in me
-revolted at the contact, but I had to search, or I was lost. The
-coming night might see my own body a banquet in a similar war to those
-horrid three. I felt all over the body, but no sign could I find of
-the key. Then I stopped and looked at the Count. There was a mocking
-smile on the bloated face which seemed to drive me mad. This was the
-being I was helping to transfer to London, where, perhaps, for
-centuries to come he might, amongst its teeming millions, satiate his
-lust for blood, and create a new and ever-widening circle of
-semi-demons to batten on the helpless.
-
-The very thought drove me mad. A terrible desire came upon me to rid
-the world of such a monster. There was no lethal weapon at hand, but
-I seized a shovel which the workmen had been using to fill the cases,
-and lifting it high, struck, with the edge downward, at the hateful
-face. But as I did so the head turned, and the eyes fell upon me,
-with all their blaze of basilisk horror. The sight seemed to paralyze
-me, and the shovel turned in my hand and glanced from the face, merely
-making a deep gash above the forehead. The shovel fell from my hand
-across the box, and as I pulled it away the flange of the blade caught
-the edge of the lid which fell over again, and hid the horrid thing
-from my sight. The last glimpse I had was of the bloated face,
-blood-stained and fixed with a grin of malice which would have held
-its own in the nethermost hell.
-
-I thought and thought what should be my next move, but my brain seemed
-on fire, and I waited with a despairing feeling growing over me. As I
-waited I heard in the distance a gipsy song sung by merry voices
-coming closer, and through their song the rolling of heavy wheels and
-the cracking of whips. The Szgany and the Slovaks of whom the Count
-had spoken were coming. With a last look around and at the box which
-contained the vile body, I ran from the place and gained the Count's
-room, determined to rush out at the moment the door should be opened.
-With strained ears, I listened, and heard downstairs the grinding of
-the key in the great lock and the falling back of the heavy door.
-There must have been some other means of entry, or some one had a key
-for one of the locked doors.
-
-Then there came the sound of many feet tramping and dying away in some
-passage which sent up a clanging echo. I turned to run down again
-towards the vault, where I might find the new entrance, but at the
-moment there seemed to come a violent puff of wind, and the door to
-the winding stair blew to with a shock that set the dust from the
-lintels flying. When I ran to push it open, I found that it was
-hopelessly fast. I was again a prisoner, and the net of doom was
-closing round me more closely.
-
-As I write there is in the passage below a sound of many tramping feet
-and the crash of weights being set down heavily, doubtless the boxes,
-with their freight of earth. There was a sound of hammering. It is
-the box being nailed down. Now I can hear the heavy feet tramping
-again along the hall, with many other idle feet coming behind them.
-
-The door is shut, the chains rattle. There is a grinding of the key
-in the lock. I can hear the key withdrawn, then another door opens
-and shuts. I hear the creaking of lock and bolt.
-
-Hark! In the courtyard and down the rocky way the roll of heavy
-wheels, the crack of whips, and the chorus of the Szgany as they pass
-into the distance.
-
-I am alone in the castle with those horrible women. Faugh! Mina is a
-woman, and there is nought in common. They are devils of the Pit!
-
-I shall not remain alone with them. I shall try to scale the castle
-wall farther than I have yet attempted. I shall take some of the gold
-with me, lest I want it later. I may find a way from this dreadful
-place.
-
-And then away for home! Away to the quickest and nearest train! Away
-from the cursed spot, from this cursed land, where the devil and his
-children still walk with earthly feet!
-
-At least God's mercy is better than that of those monsters, and the
-precipice is steep and high. At its foot a man may sleep, as a man.
-Goodbye, all. Mina!
-
-
-
-
-CHAPTER 5
-
-
-LETTER FROM MISS MINA MURRAY TO MISS LUCY WESTENRA
-
-9 May.
-
-My dearest Lucy,
-
-Forgive my long delay in writing, but I have been simply overwhelmed
-with work. The life of an assistant schoolmistress is sometimes
-trying. I am longing to be with you, and by the sea, where we can
-talk together freely and build our castles in the air. I have been
-working very hard lately, because I want to keep up with Jonathan's
-studies, and I have been practicing shorthand very assiduously.
-When we are married I shall be able to be useful to Jonathan, and if
-I can stenograph well enough I can take down what he wants to say in
-this way and write it out for him on the typewriter, at which also I
-am practicing very hard.
-
-He and I sometimes write letters in shorthand, and he is
-keeping a stenographic journal of his travels abroad. When
-I am with you I shall keep a diary in the same way. I don't
-mean one of those two-pages-to-the-week-with-Sunday-squeezed-
-in-a-corner diaries, but a sort of journal which I can write
-in whenever I feel inclined.
-
-I do not suppose there will be much of interest to other people, but
-it is not intended for them. I may show it to Jonathan some day if
-there is in it anything worth sharing, but it is really an exercise
-book. I shall try to do what I see lady journalists do,
-interviewing and writing descriptions and trying to remember
-conversations. I am told that, with a little practice, one can
-remember all that goes on or that one hears said during a day.
-
-However, we shall see. I will tell you of my little plans when we
-meet. I have just had a few hurried lines from Jonathan from
-Transylvania. He is well, and will be returning in about a week. I
-am longing to hear all his news. It must be nice to see strange
-countries. I wonder if we, I mean Jonathan and I, shall ever see
-them together. There is the ten o'clock bell ringing. Goodbye.
-
-Your loving
-
-Mina
-
-
-Tell me all the news when you write. You have not told me
-anything for a long time. I hear rumours, and especially
-of a tall, handsome, curly-haired man???
-
-
-
-LETTER, LUCY WESTENRA TO MINA MURRAY
-
-
-17, Chatham Street
-
-Wednesday
-
-My dearest Mina,
-
-
-I must say you tax me very unfairly with being a bad correspondent.
-I wrote you twice since we parted, and your last letter was only
-your second. Besides, I have nothing to tell you. There is really
-nothing to interest you.
-
-Town is very pleasant just now, and we go a great deal to
-picture-galleries and for walks and rides in the park. As
-to the tall, curly-haired man, I suppose it was the one who
-was with me at the last Pop. Someone has evidently been
-telling tales.
-
-That was Mr. Holmwood. He often comes to see us, and he and
-Mamma get on very well together, they have so many things
-to talk about in common.
-
-We met some time ago a man that would just do for you, if you were
-not already engaged to Jonathan. He is an excellent parti, being
-handsome, well off, and of good birth. He is a doctor and really
-clever. Just fancy! He is only nine-and twenty, and he has an
-immense lunatic asylum all under his own care. Mr. Holmwood
-introduced him to me, and he called here to see us, and often comes
-now. I think he is one of the most resolute men I ever saw, and yet
-the most calm. He seems absolutely imperturbable. I can fancy what
-a wonderful power he must have over his patients. He has a curious
-habit of looking one straight in the face, as if trying to read
-one's thoughts. He tries this on very much with me, but I flatter
-myself he has got a tough nut to crack. I know that from my glass.
-
-Do you ever try to read your own face? I do, and I can
-tell you it is not a bad study, and gives you more trouble
-than you can well fancy if you have never tried it.
-
-He says that I afford him a curious psychological study, and
-I humbly think I do. I do not, as you know, take sufficient
-interest in dress to be able to describe the new fashions.
-Dress is a bore. That is slang again, but never mind. Arthur
-says that every day.
-
-There, it is all out, Mina, we have told all our secrets to
-each other since we were children. We have slept together
-and eaten together, and laughed and cried together, and
-now, though I have spoken, I would like to speak more. Oh,
-Mina, couldn't you guess? I love him. I am blushing as I
-write, for although I think he loves me, he has not told me
-so in words. But, oh, Mina, I love him. I love him! There,
-that does me good.
-
-I wish I were with you, dear, sitting by the fire undressing, as we
-used to sit, and I would try to tell you what I feel. I do not know
-how I am writing this even to you. I am afraid to stop, or I should
-tear up the letter, and I don't want to stop, for I do so want to
-tell you all. Let me hear from you at once, and tell me all that you
-think about it. Mina, pray for my happiness.
-
-Lucy
-
-
-P.S.--I need not tell you this is a secret.
-Goodnight again. L.
-
-
-
-
-LETTER, LUCY WESTENRA TO MINA MURRAY
-
-24 May
-
-My dearest Mina,
-
-Thanks, and thanks, and thanks again for your sweet letter. It
-was so nice to be able to tell you and to have your sympathy.
-
-My dear, it never rains but it pours. How true the old proverbs
-are. Here am I, who shall be twenty in September, and yet I never
-had a proposal till today, not a real proposal, and today I had
-three. Just fancy! Three proposals in one day! Isn't it awful! I
-feel sorry, really and truly sorry, for two of the poor fellows.
-Oh, Mina, I am so happy that I don't know what to do with myself.
-And three proposals! But, for goodness' sake, don't tell any of the
-girls, or they would be getting all sorts of extravagant ideas, and
-imagining themselves injured and slighted if in their very first day
-at home they did not get six at least. Some girls are so vain! You
-and I, Mina dear, who are engaged and are going to settle down soon
-soberly into old married women, can despise vanity. Well, I must
-tell you about the three, but you must keep it a secret, dear, from
-every one except, of course, Jonathan. You will tell him, because I
-would, if I were in your place, certainly tell Arthur. A woman
-ought to tell her husband everything. Don't you think so, dear? And
-I must be fair. Men like women, certainly their wives, to be quite
-as fair as they are. And women, I am afraid, are not always quite
-as fair as they should be.
-
-Well, my dear, number One came just before lunch. I told you of
-him, Dr. John Seward, the lunatic asylum man, with the strong jaw
-and the good forehead. He was very cool outwardly, but was nervous
-all the same. He had evidently been schooling himself as to all
-sorts of little things, and remembered them, but he almost managed
-to sit down on his silk hat, which men don't generally do when they
-are cool, and then when he wanted to appear at ease he kept playing
-with a lancet in a way that made me nearly scream. He spoke to me,
-Mina, very straightforwardly. He told me how dear I was to him,
-though he had known me so little, and what his life would be with me
-to help and cheer him. He was going to tell me how unhappy he would
-be if I did not care for him, but when he saw me cry he said he was
-a brute and would not add to my present trouble. Then he broke off
-and asked if I could love him in time, and when I shook my head his
-hands trembled, and then with some hesitation he asked me if I cared
-already for any one else. He put it very nicely, saying that he did
-not want to wring my confidence from me, but only to know, because
-if a woman's heart was free a man might have hope. And then, Mina,
-I felt a sort of duty to tell him that there was some one. I only
-told him that much, and then he stood up, and he looked very strong
-and very grave as he took both my hands in his and said he hoped I
-would be happy, and that If I ever wanted a friend I must count him
-one of my best.
-
-Oh, Mina dear, I can't help crying, and you must excuse this letter
-being all blotted. Being proposed to is all very nice and all that
-sort of thing, but it isn't at all a happy thing when you have to
-see a poor fellow, whom you know loves you honestly, going away and
-looking all broken hearted, and to know that, no matter what he may
-say at the moment, you are passing out of his life. My dear, I must
-stop here at present, I feel so miserable, though I am so happy.
-
-Evening.
-
-Arthur has just gone, and I feel in better spirits than when I
-left off, so I can go on telling you about the day.
-
-Well, my dear, number Two came after lunch. He is such a nice
-fellow, an American from Texas, and he looks so young and so fresh
-that it seems almost impossible that he has been to so many places
-and has such adventures. I sympathize with poor Desdemona when she
-had such a stream poured in her ear, even by a black man. I suppose
-that we women are such cowards that we think a man will save us from
-fears, and we marry him. I know now what I would do if I were a man
-and wanted to make a girl love me. No, I don't, for there was Mr.
-Morris telling us his stories, and Arthur never told any, and
-yet . . .
-
-My dear, I am somewhat previous. Mr. Quincy P. Morris found me
-alone. It seems that a man always does find a girl alone. No, he
-doesn't, for Arthur tried twice to make a chance, and I helping him
-all I could, I am not ashamed to say it now. I must tell you
-beforehand that Mr. Morris doesn't always speak slang, that is to
-say, he never does so to strangers or before them, for he is really
-well educated and has exquisite manners, but he found out that it
-amused me to hear him talk American slang, and whenever I was
-present, and there was no one to be shocked, he said such funny
-things. I am afraid, my dear, he has to invent it all, for it fits
-exactly into whatever else he has to say. But this is a way slang
-has. I do not know myself if I shall ever speak slang. I do not
-know if Arthur likes it, as I have never heard him use any as yet.
-
-Well, Mr. Morris sat down beside me and looked as happy and jolly as
-he could, but I could see all the same that he was very nervous. He
-took my hand in his, and said ever so sweetly . . .
-
-"Miss Lucy, I know I ain't good enough to regulate the fixin's of
-your little shoes, but I guess if you wait till you find a man that
-is you will go join them seven young women with the lamps when you
-quit. Won't you just hitch up alongside of me and let us go down
-the long road together, driving in double harness?"
-
-Well, he did look so good humoured and so jolly that it didn't seem
-half so hard to refuse him as it did poor Dr. Seward. So I said, as
-lightly as I could, that I did not know anything of hitching, and
-that I wasn't broken to harness at all yet. Then he said that he
-had spoken in a light manner, and he hoped that if he had made a
-mistake in doing so on so grave, so momentous, and occasion for him,
-I would forgive him. He really did look serious when he was saying
-it, and I couldn't help feeling a sort of exultation that he was
-number Two in one day. And then, my dear, before I could say a word
-he began pouring out a perfect torrent of love-making, laying his
-very heart and soul at my feet. He looked so earnest over it that I
-shall never again think that a man must be playful always, and never
-earnest, because he is merry at times. I suppose he saw something
-in my face which checked him, for he suddenly stopped, and said with
-a sort of manly fervour that I could have loved him for if I had
-been free . . .
-
-"Lucy, you are an honest hearted girl, I know. I should not be here
-speaking to you as I am now if I did not believe you clean grit,
-right through to the very depths of your soul. Tell me, like one
-good fellow to another, is there any one else that you care for?
-And if there is I'll never trouble you a hair's breadth again, but
-will be, if you will let me, a very faithful friend."
-
-My dear Mina, why are men so noble when we women are so little
-worthy of them? Here was I almost making fun of this great hearted,
-true gentleman. I burst into tears, I am afraid, my dear, you will
-think this a very sloppy letter in more ways than one, and I really
-felt very badly.
-
-Why can't they let a girl marry three men, or as many as
-want her, and save all this trouble? But this is heresy,
-and I must not say it. I am glad to say that, though I was
-crying, I was able to look into Mr. Morris' brave eyes, and
-I told him out straight . . .
-
-"Yes, there is some one I love, though he has not told me
-yet that he even loves me." I was right to speak to him so
-frankly, for quite a light came into his face, and he put
-out both his hands and took mine, I think I put them into
-his, and said in a hearty way . . .
-
-"That's my brave girl. It's better worth being late for a chance of
-winning you than being in time for any other girl in the world.
-Don't cry, my dear. If it's for me, I'm a hard nut to crack, and I
-take it standing up. If that other fellow doesn't know his
-happiness, well, he'd better look for it soon, or he'll have to deal
-with me. Little girl, your honesty and pluck have made me a friend,
-and that's rarer than a lover, it's more selfish anyhow. My dear,
-I'm going to have a pretty lonely walk between this and Kingdom
-Come. Won't you give me one kiss? It'll be something to keep off
-the darkness now and then. You can, you know, if you like, for that
-other good fellow, or you could not love him, hasn't spoken yet."
-
-That quite won me, Mina, for it was brave and sweet of him,
-and noble too, to a rival, wasn't it? And he so sad, so I
-leant over and kissed him.
-
-He stood up with my two hands in his, and as he looked down into my
-face, I am afraid I was blushing very much, he said, "Little girl, I
-hold your hand, and you've kissed me, and if these things don't make
-us friends nothing ever will. Thank you for your sweet honesty to
-me, and goodbye."
-
-He wrung my hand, and taking up his hat, went straight out of the
-room without looking back, without a tear or a quiver or a pause,
-and I am crying like a baby.
-
-Oh, why must a man like that be made unhappy when there are lots of
-girls about who would worship the very ground he trod on? I know I
-would if I were free, only I don't want to be free. My dear, this
-quite upset me, and I feel I cannot write of happiness just at once,
-after telling you of it, and I don't wish to tell of the number
-Three until it can be all happy. Ever your loving . . .
-
-Lucy
-
-
-P.S.--Oh, about number Three, I needn't tell you of number
-Three, need I? Besides, it was all so confused. It seemed
-only a moment from his coming into the room till both his
-arms were round me, and he was kissing me. I am very, very
-happy, and I don't know what I have done to deserve it. I
-must only try in the future to show that I am not ungrateful
-to God for all His goodness to me in sending to me such a
-lover, such a husband, and such a friend.
-
-Goodbye.
-
-
-
-DR. SEWARD'S DIARY (Kept in phonograph)
-
-25 May.--Ebb tide in appetite today. Cannot eat, cannot rest, so
-diary instead. Since my rebuff of yesterday I have a sort of empty
-feeling. Nothing in the world seems of sufficient importance to be
-worth the doing. As I knew that the only cure for this sort of thing
-was work, I went amongst the patients. I picked out one who has
-afforded me a study of much interest. He is so quaint that I am
-determined to understand him as well as I can. Today I seemed to get
-nearer than ever before to the heart of his mystery.
-
-I questioned him more fully than I had ever done, with a view to
-making myself master of the facts of his hallucination. In my manner
-of doing it there was, I now see, something of cruelty. I seemed to
-wish to keep him to the point of his madness, a thing which I avoid
-with the patients as I would the mouth of hell.
-
-(Mem., Under what circumstances would I not avoid the pit of hell?)
-Omnia Romae venalia sunt. Hell has its price! If there be anything
-behind this instinct it will be valuable to trace it afterwards
-accurately, so I had better commence to do so, therefore . . .
-
-R. M, Renfield, age 59. Sanguine temperament, great physical
-strength, morbidly excitable, periods of gloom, ending in some fixed
-idea which I cannot make out. I presume that the sanguine temperament
-itself and the disturbing influence end in a mentally-accomplished
-finish, a possibly dangerous man, probably dangerous if unselfish. In
-selfish men caution is as secure an armour for their foes as for
-themselves. What I think of on this point is, when self is the fixed
-point the centripetal force is balanced with the centrifugal. When
-duty, a cause, etc., is the fixed point, the latter force is
-paramount, and only accident or a series of accidents can balance it.
-
-
-
-LETTER, QUINCEY P. MORRIS TO HON. ARTHUR HOLMOOD
-
-25 May.
-
-My dear Art,
-
-We've told yarns by the campfire in the prairies, and dressed one
-another's wounds after trying a landing at the Marquesas, and drunk
-healths on the shore of Titicaca. There are more yarns to be told,
-and other wounds to be healed, and another health to be drunk.
-Won't you let this be at my campfire tomorrow night? I have no
-hesitation in asking you, as I know a certain lady is engaged to a
-certain dinner party, and that you are free. There will only be one
-other, our old pal at the Korea, Jack Seward. He's coming, too, and
-we both want to mingle our weeps over the wine cup, and to drink a
-health with all our hearts to the happiest man in all the wide
-world, who has won the noblest heart that God has made and best
-worth winning. We promise you a hearty welcome, and a loving
-greeting, and a health as true as your own right hand. We shall
-both swear to leave you at home if you drink too deep to a certain
-pair of eyes. Come!
-
-Yours, as ever and always,
-
-Quincey P. Morris
-
-
-
-
-
-TELEGRAM FROM ARTHUR HOLMWOOD TO QUINCEY P. MORRIS
-
-26 May
-
-
-Count me in every time. I bear messages which will make both
-your ears tingle.
-
-Art
-
-
-
-
-CHAPTER 6
-
-
-MINA MURRAY'S JOURNAL
-
-24 July. Whitby.--Lucy met me at the station, looking sweeter and
-lovelier than ever, and we drove up to the house at the Crescent in
-which they have rooms. This is a lovely place. The little river, the
-Esk, runs through a deep valley, which broadens out as it comes near
-the harbour. A great viaduct runs across, with high piers, through
-which the view seems somehow further away than it really is. The
-valley is beautifully green, and it is so steep that when you are on
-the high land on either side you look right across it, unless you are
-near enough to see down. The houses of the old town--the side away
-from us, are all red-roofed, and seem piled up one over the other
-anyhow, like the pictures we see of Nuremberg. Right over the town is
-the ruin of Whitby Abbey, which was sacked by the Danes, and which is
-the scene of part of "Marmion," where the girl was built up in the
-wall. It is a most noble ruin, of immense size, and full of beautiful
-and romantic bits. There is a legend that a white lady is seen in one
-of the windows. Between it and the town there is another church, the
-parish one, round which is a big graveyard, all full of tombstones.
-This is to my mind the nicest spot in Whitby, for it lies right over
-the town, and has a full view of the harbour and all up the bay to
-where the headland called Kettleness stretches out into the sea. It
-descends so steeply over the harbour that part of the bank has fallen
-away, and some of the graves have been destroyed.
-
-In one place part of the stonework of the graves stretches out over
-the sandy pathway far below. There are walks, with seats beside them,
-through the churchyard, and people go and sit there all day long
-looking at the beautiful view and enjoying the breeze.
-
-I shall come and sit here often myself and work. Indeed, I am writing
-now, with my book on my knee, and listening to the talk of three old
-men who are sitting beside me. They seem to do nothing all day but
-sit here and talk.
-
-The harbour lies below me, with, on the far side, one long granite
-wall stretching out into the sea, with a curve outwards at the end of
-it, in the middle of which is a lighthouse. A heavy seawall runs
-along outside of it. On the near side, the seawall makes an elbow
-crooked inversely, and its end too has a lighthouse. Between the two
-piers there is a narrow opening into the harbour, which then suddenly
-widens.
-
-It is nice at high water, but when the tide is out it shoals away to
-nothing, and there is merely the stream of the Esk, running between
-banks of sand, with rocks here and there. Outside the harbour on this
-side there rises for about half a mile a great reef, the sharp of
-which runs straight out from behind the south lighthouse. At the end
-of it is a buoy with a bell, which swings in bad weather, and sends in
-a mournful sound on the wind.
-
-They have a legend here that when a ship is lost bells are heard out at
-sea. I must ask the old man about this. He is coming this way . . .
-
-He is a funny old man. He must be awfully old, for his face is
-gnarled and twisted like the bark of a tree. He tells me that he is
-nearly a hundred, and that he was a sailor in the Greenland fishing
-fleet when Waterloo was fought. He is, I am afraid, a very sceptical
-person, for when I asked him about the bells at sea and the White Lady
-at the abbey he said very brusquely,
-
-"I wouldn't fash masel' about them, miss. Them things be all wore
-out. Mind, I don't say that they never was, but I do say that they
-wasn't in my time. They be all very well for comers and trippers, an'
-the like, but not for a nice young lady like you. Them feet-folks
-from York and Leeds that be always eatin' cured herrin's and drinkin'
-tea an' lookin' out to buy cheap jet would creed aught. I wonder
-masel' who'd be bothered tellin' lies to them, even the newspapers,
-which is full of fool-talk."
-
-I thought he would be a good person to learn interesting things from,
-so I asked him if he would mind telling me something about the whale
-fishing in the old days. He was just settling himself to begin when
-the clock struck six, whereupon he laboured to get up, and said,
-
-"I must gang ageeanwards home now, miss. My grand-daughter doesn't
-like to be kept waitin' when the tea is ready, for it takes me time to
-crammle aboon the grees, for there be a many of 'em, and miss, I lack
-belly-timber sairly by the clock."
-
-He hobbled away, and I could see him hurrying, as well as he could,
-down the steps. The steps are a great feature on the place. They
-lead from the town to the church, there are hundreds of them, I do not
-know how many, and they wind up in a delicate curve. The slope is so
-gentle that a horse could easily walk up and down them.
-
-I think they must originally have had something to do with the abbey.
-I shall go home too. Lucy went out, visiting with her mother, and as
-they were only duty calls, I did not go.
-
-
-1 August.--I came up here an hour ago with Lucy, and we had a most
-interesting talk with my old friend and the two others who always come
-and join him. He is evidently the Sir Oracle of them, and I should
-think must have been in his time a most dictatorial person.
-
-He will not admit anything, and down faces everybody. If he can't
-out-argue them he bullies them, and then takes their silence for
-agreement with his views.
-
-Lucy was looking sweetly pretty in her white lawn frock. She has got
-a beautiful colour since she has been here.
-
-I noticed that the old men did not lose any time in coming and sitting
-near her when we sat down. She is so sweet with old people, I think
-they all fell in love with her on the spot. Even my old man succumbed
-and did not contradict her, but gave me double share instead. I got
-him on the subject of the legends, and he went off at once into a sort
-of sermon. I must try to remember it and put it down.
-
-"It be all fool-talk, lock, stock, and barrel, that's what it be and
-nowt else. These bans an' wafts an' boh-ghosts an' bar-guests an'
-bogles an' all anent them is only fit to set bairns an' dizzy women
-a'belderin'. They be nowt but air-blebs. They, an' all grims an' signs
-an' warnin's, be all invented by parsons an' illsome berk-bodies an'
-railway touters to skeer an' scunner hafflin's, an' to get folks to do
-somethin' that they don't other incline to. It makes me ireful to
-think o' them. Why, it's them that, not content with printin' lies on
-paper an' preachin' them out of pulpits, does want to be cuttin' them
-on the tombstones. Look here all around you in what airt ye will. All
-them steans, holdin' up their heads as well as they can out of their
-pride, is acant, simply tumblin' down with the weight o' the lies
-wrote on them, 'Here lies the body' or 'Sacred to the memory' wrote on
-all of them, an' yet in nigh half of them there bean't no bodies at
-all, an' the memories of them bean't cared a pinch of snuff about,
-much less sacred. Lies all of them, nothin' but lies of one kind or
-another! My gog, but it'll be a quare scowderment at the Day of
-Judgment when they come tumblin' up in their death-sarks, all jouped
-together an' trying' to drag their tombsteans with them to prove how
-good they was, some of them trimmlin' an' dithering, with their hands
-that dozzened an' slippery from lyin' in the sea that they can't even
-keep their gurp o' them."
-
-I could see from the old fellow's self-satisfied air and the way in
-which he looked round for the approval of his cronies that he was
-"showing off," so I put in a word to keep him going.
-
-"Oh, Mr. Swales, you can't be serious. Surely these tombstones are
-not all wrong?"
-
-"Yabblins! There may be a poorish few not wrong, savin' where they
-make out the people too good, for there be folk that do think a
-balm-bowl be like the sea, if only it be their own. The whole thing
-be only lies. Now look you here. You come here a stranger, an' you
-see this kirkgarth."
-
-I nodded, for I thought it better to assent, though I did not quite
-understand his dialect. I knew it had something to do with the
-church.
-
-He went on, "And you consate that all these steans be aboon folk that
-be haped here, snod an' snog?" I assented again. "Then that be just
-where the lie comes in. Why, there be scores of these laybeds that be
-toom as old Dun's 'baccabox on Friday night."
-
-He nudged one of his companions, and they all laughed. "And, my gog!
-How could they be otherwise? Look at that one, the aftest abaft the
-bier-bank, read it!"
-
-I went over and read, "Edward Spencelagh, master mariner, murdered by
-pirates off the coast of Andres, April, 1854, age 30." When I came
-back Mr. Swales went on,
-
-"Who brought him home, I wonder, to hap him here? Murdered off the
-coast of Andres! An' you consated his body lay under! Why, I could
-name ye a dozen whose bones lie in the Greenland seas above," he
-pointed northwards, "or where the currants may have drifted them.
-There be the steans around ye. Ye can, with your young eyes, read the
-small print of the lies from here. This Braithwaite Lowery, I knew
-his father, lost in the Lively off Greenland in '20, or Andrew
-Woodhouse, drowned in the same seas in 1777, or John Paxton, drowned
-off Cape Farewell a year later, or old John Rawlings, whose
-grandfather sailed with me, drowned in the Gulf of Finland in '50. Do
-ye think that all these men will have to make a rush to Whitby when
-the trumpet sounds? I have me antherums aboot it! I tell ye that
-when they got here they'd be jommlin' and jostlin' one another that
-way that it 'ud be like a fight up on the ice in the old days, when
-we'd be at one another from daylight to dark, an' tryin' to tie up our
-cuts by the aurora borealis." This was evidently local pleasantry, for
-the old man cackled over it, and his cronies joined in with gusto.
-
-"But," I said, "surely you are not quite correct, for you start on the
-assumption that all the poor people, or their spirits, will have to
-take their tombstones with them on the Day of Judgment. Do you think
-that will be really necessary?"
-
-"Well, what else be they tombstones for? Answer me that, miss!"
-
-"To please their relatives, I suppose."
-
-"To please their relatives, you suppose!" This he said with intense
-scorn. "How will it pleasure their relatives to know that lies is
-wrote over them, and that everybody in the place knows that they be
-lies?"
-
-He pointed to a stone at our feet which had been laid down as a slab,
-on which the seat was rested, close to the edge of the cliff. "Read
-the lies on that thruff-stone," he said.
-
-The letters were upside down to me from where I sat, but Lucy was more
-opposite to them, so she leant over and read, "Sacred to the memory of
-George Canon, who died, in the hope of a glorious resurrection, on
-July 29, 1873, falling from the rocks at Kettleness. This tomb was
-erected by his sorrowing mother to her dearly beloved son. 'He was the
-only son of his mother, and she was a widow.' Really, Mr. Swales, I
-don't see anything very funny in that!" She spoke her comment very
-gravely and somewhat severely.
-
-"Ye don't see aught funny! Ha-ha! But that's because ye don't gawm
-the sorrowin' mother was a hell-cat that hated him because he was
-acrewk'd, a regular lamiter he was, an' he hated her so that he
-committed suicide in order that she mightn't get an insurance she put
-on his life. He blew nigh the top of his head off with an old musket
-that they had for scarin' crows with. 'Twarn't for crows then, for it
-brought the clegs and the dowps to him. That's the way he fell off
-the rocks. And, as to hopes of a glorious resurrection, I've often
-heard him say masel' that he hoped he'd go to hell, for his mother was
-so pious that she'd be sure to go to heaven, an' he didn't want to
-addle where she was. Now isn't that stean at any rate," he hammered
-it with his stick as he spoke, "a pack of lies? And won't it make
-Gabriel keckle when Geordie comes pantin' ut the grees with the
-tompstean balanced on his hump, and asks to be took as evidence!"
-
-I did not know what to say, but Lucy turned the conversation as she
-said, rising up, "Oh, why did you tell us of this? It is my favourite
-seat, and I cannot leave it, and now I find I must go on sitting over
-the grave of a suicide."
-
-"That won't harm ye, my pretty, an' it may make poor Geordie gladsome
-to have so trim a lass sittin' on his lap. That won't hurt ye. Why,
-I've sat here off an' on for nigh twenty years past, an' it hasn't
-done me no harm. Don't ye fash about them as lies under ye, or that
-doesn' lie there either! It'll be time for ye to be getting scart
-when ye see the tombsteans all run away with, and the place as bare as
-a stubble-field. There's the clock, and I must gang. My service to
-ye, ladies!" And off he hobbled.
-
-Lucy and I sat awhile, and it was all so beautiful before us that we
-took hands as we sat, and she told me all over again about Arthur and
-their coming marriage. That made me just a little heart-sick, for I
-haven't heard from Jonathan for a whole month.
-
-
-The same day. I came up here alone, for I am very sad. There was no
-letter for me. I hope there cannot be anything the matter with
-Jonathan. The clock has just struck nine. I see the lights scattered
-all over the town, sometimes in rows where the streets are, and
-sometimes singly. They run right up the Esk and die away in the curve
-of the valley. To my left the view is cut off by a black line of roof
-of the old house next to the abbey. The sheep and lambs are bleating
-in the fields away behind me, and there is a clatter of donkeys' hoofs
-up the paved road below. The band on the pier is playing a harsh
-waltz in good time, and further along the quay there is a Salvation
-Army meeting in a back street. Neither of the bands hears the other,
-but up here I hear and see them both. I wonder where Jonathan is and
-if he is thinking of me! I wish he were here.
-
-
-
-DR. SEWARD'S DIARY
-
-5 June.--The case of Renfield grows more interesting the more I get to
-understand the man. He has certain qualities very largely developed,
-selfishness, secrecy, and purpose.
-
-I wish I could get at what is the object of the latter. He seems to
-have some settled scheme of his own, but what it is I do not know.
-His redeeming quality is a love of animals, though, indeed, he has
-such curious turns in it that I sometimes imagine he is only
-abnormally cruel. His pets are of odd sorts.
-
-Just now his hobby is catching flies. He has at present such a
-quantity that I have had myself to expostulate. To my astonishment,
-he did not break out into a fury, as I expected, but took the matter
-in simple seriousness. He thought for a moment, and then said, "May I
-have three days? I shall clear them away." Of course, I said that
-would do. I must watch him.
-
-
-18 June.--He has turned his mind now to spiders, and has got several
-very big fellows in a box. He keeps feeding them his flies, and the
-number of the latter is becoming sensibly diminished, although he has
-used half his food in attracting more flies from outside to his room.
-
-
-1 July.--His spiders are now becoming as great a nuisance as his
-flies, and today I told him that he must get rid of them.
-
-He looked very sad at this, so I said that he must some of them, at
-all events. He cheerfully acquiesced in this, and I gave him the same
-time as before for reduction.
-
-He disgusted me much while with him, for when a horrid blowfly,
-bloated with some carrion food, buzzed into the room, he caught it,
-held it exultantly for a few moments between his finger and thumb, and
-before I knew what he was going to do, put it in his mouth and ate it.
-
-I scolded him for it, but he argued quietly that it was very good and
-very wholesome, that it was life, strong life, and gave life to him.
-This gave me an idea, or the rudiment of one. I must watch how he
-gets rid of his spiders.
-
-He has evidently some deep problem in his mind, for he keeps a little
-notebook in which he is always jotting down something. Whole pages of
-it are filled with masses of figures, generally single numbers added
-up in batches, and then the totals added in batches again, as though
-he were focussing some account, as the auditors put it.
-
-
-8 July.--There is a method in his madness, and the rudimentary idea in
-my mind is growing. It will be a whole idea soon, and then, oh,
-unconscious cerebration, you will have to give the wall to your
-conscious brother.
-
-I kept away from my friend for a few days, so that I might notice if
-there were any change. Things remain as they were except that he has
-parted with some of his pets and got a new one.
-
-He has managed to get a sparrow, and has already partially tamed it.
-His means of taming is simple, for already the spiders have
-diminished. Those that do remain, however, are well fed, for he still
-brings in the flies by tempting them with his food.
-
-19 July--We are progressing. My friend has now a whole colony of
-sparrows, and his flies and spiders are almost obliterated. When I
-came in he ran to me and said he wanted to ask me a great favour, a
-very, very great favour. And as he spoke, he fawned on me like a dog.
-
-I asked him what it was, and he said, with a sort of rapture in his
-voice and bearing, "A kitten, a nice, little, sleek playful kitten,
-that I can play with, and teach, and feed, and feed, and feed!"
-
-I was not unprepared for this request, for I had noticed how his pets
-went on increasing in size and vivacity, but I did not care that his
-pretty family of tame sparrows should be wiped out in the same manner
-as the flies and spiders. So I said I would see about it, and asked
-him if he would not rather have a cat than a kitten.
-
-His eagerness betrayed him as he answered, "Oh, yes, I would like a
-cat! I only asked for a kitten lest you should refuse me a cat. No
-one would refuse me a kitten, would they?"
-
-I shook my head, and said that at present I feared it would not be
-possible, but that I would see about it. His face fell, and I could
-see a warning of danger in it, for there was a sudden fierce, sidelong
-look which meant killing. The man is an undeveloped homicidal
-maniac. I shall test him with his present craving and see how it will
-work out, then I shall know more.
-
-
-10 pm.--I have visited him again and found him sitting in a corner
-brooding. When I came in he threw himself on his knees before me and
-implored me to let him have a cat, that his salvation depended upon
-it.
-
-I was firm, however, and told him that he could not have it, whereupon
-he went without a word, and sat down, gnawing his fingers, in the
-corner where I had found him. I shall see him in the morning early.
-
-
-20 July.--Visited Renfield very early, before attendant went his
-rounds. Found him up and humming a tune. He was spreading out his
-sugar, which he had saved, in the window, and was manifestly beginning
-his fly catching again, and beginning it cheerfully and with a good
-grace.
-
-I looked around for his birds, and not seeing them, asked him where
-they were. He replied, without turning round, that they had all flown
-away. There were a few feathers about the room and on his pillow a
-drop of blood. I said nothing, but went and told the keeper to report
-to me if there were anything odd about him during the day.
-
-
-11 am.--The attendant has just been to see me to say that Renfield has
-been very sick and has disgorged a whole lot of feathers. "My belief
-is, doctor," he said, "that he has eaten his birds, and that he just
-took and ate them raw!"
-
-
-11 pm.--I gave Renfield a strong opiate tonight, enough to make even
-him sleep, and took away his pocketbook to look at it. The thought
-that has been buzzing about my brain lately is complete, and the
-theory proved.
-
-My homicidal maniac is of a peculiar kind. I shall have to invent a
-new classification for him, and call him a zoophagous (life-eating)
-maniac. What he desires is to absorb as many lives as he can, and he
-has laid himself out to achieve it in a cumulative way. He gave many
-flies to one spider and many spiders to one bird, and then wanted a
-cat to eat the many birds. What would have been his later steps?
-
-It would almost be worth while to complete the experiment. It might
-be done if there were only a sufficient cause. Men sneered at
-vivisection, and yet look at its results today! Why not advance
-science in its most difficult and vital aspect, the knowledge of the
-brain?
-
-Had I even the secret of one such mind, did I hold the key to the
-fancy of even one lunatic, I might advance my own branch of science to
-a pitch compared with which Burdon-Sanderson's physiology or Ferrier's
-brain knowledge would be as nothing. If only there were a sufficient
-cause! I must not think too much of this, or I may be tempted. A
-good cause might turn the scale with me, for may not I too be of an
-exceptional brain, congenitally?
-
-How well the man reasoned. Lunatics always do within their own scope.
-I wonder at how many lives he values a man, or if at only one. He has
-closed the account most accurately, and today begun a new record. How
-many of us begin a new record with each day of our lives?
-
-To me it seems only yesterday that my whole life ended with my new
-hope, and that truly I began a new record. So it shall be until the
-Great Recorder sums me up and closes my ledger account with a balance
-to profit or loss.
-
-Oh, Lucy, Lucy, I cannot be angry with you, nor can I be angry with my
-friend whose happiness is yours, but I must only wait on hopeless and
-work. Work! Work!
-
-If I could have as strong a cause as my poor mad friend there, a good,
-unselfish cause to make me work, that would be indeed happiness.
-
-
-
-MINA MURRAY'S JOURNAL
-
-26 July.--I am anxious, and it soothes me to express myself here. It
-is like whispering to one's self and listening at the same time. And
-there is also something about the shorthand symbols that makes it
-different from writing. I am unhappy about Lucy and about Jonathan.
-I had not heard from Jonathan for some time, and was very concerned,
-but yesterday dear Mr. Hawkins, who is always so kind, sent me a
-letter from him. I had written asking him if he had heard, and he
-said the enclosed had just been received. It is only a line dated
-from Castle Dracula, and says that he is just starting for home. That
-is not like Jonathan. I do not understand it, and it makes me uneasy.
-
-Then, too, Lucy, although she is so well, has lately taken to her old
-habit of walking in her sleep. Her mother has spoken to me about it,
-and we have decided that I am to lock the door of our room every
-night.
-
-Mrs. Westenra has got an idea that sleep-walkers always go out on
-roofs of houses and along the edges of cliffs and then get suddenly
-wakened and fall over with a despairing cry that echoes all over the
-place.
-
-Poor dear, she is naturally anxious about Lucy, and she tells me that
-her husband, Lucy's father, had the same habit, that he would get up
-in the night and dress himself and go out, if he were not stopped.
-
-Lucy is to be married in the autumn, and she is already planning out
-her dresses and how her house is to be arranged. I sympathise with
-her, for I do the same, only Jonathan and I will start in life in a
-very simple way, and shall have to try to make both ends meet.
-
-Mr. Holmwood, he is the Hon. Arthur Holmwood, only son of Lord
-Godalming, is coming up here very shortly, as soon as he can leave
-town, for his father is not very well, and I think dear Lucy is
-counting the moments till he comes.
-
-She wants to take him up in the seat on the churchyard cliff and show
-him the beauty of Whitby. I daresay it is the waiting which disturbs
-her. She will be all right when he arrives.
-
-
-27 July.--No news from Jonathan. I am getting quite uneasy about him,
-though why I should I do not know, but I do wish that he would write,
-if it were only a single line.
-
-Lucy walks more than ever, and each night I am awakened by her moving
-about the room. Fortunately, the weather is so hot that she cannot
-get cold. But still, the anxiety and the perpetually being awakened
-is beginning to tell on me, and I am getting nervous and wakeful
-myself. Thank God, Lucy's health keeps up. Mr. Holmwood has been
-suddenly called to Ring to see his father, who has been taken
-seriously ill. Lucy frets at the postponement of seeing him, but it
-does not touch her looks. She is a trifle stouter, and her cheeks are
-a lovely rose-pink. She has lost the anemic look which she had. I
-pray it will all last.
-
-
-3 August.--Another week gone by, and no news from Jonathan, not even
-to Mr. Hawkins, from whom I have heard. Oh, I do hope he is not ill.
-He surely would have written. I look at that last letter of his, but
-somehow it does not satisfy me. It does not read like him, and yet it
-is his writing. There is no mistake of that.
-
-Lucy has not walked much in her sleep the last week, but there is an
-odd concentration about her which I do not understand, even in her
-sleep she seems to be watching me. She tries the door, and finding it
-locked, goes about the room searching for the key.
-
-
-6 August.--Another three days, and no news. This suspense is getting
-dreadful. If I only knew where to write to or where to go to, I
-should feel easier. But no one has heard a word of Jonathan since
-that last letter. I must only pray to God for patience.
-
-Lucy is more excitable than ever, but is otherwise well. Last night
-was very threatening, and the fishermen say that we are in for a
-storm. I must try to watch it and learn the weather signs.
-
-Today is a gray day, and the sun as I write is hidden in thick clouds,
-high over Kettleness. Everything is gray except the green grass,
-which seems like emerald amongst it, gray earthy rock, gray clouds,
-tinged with the sunburst at the far edge, hang over the gray sea, into
-which the sandpoints stretch like gray figures. The sea is tumbling
-in over the shallows and the sandy flats with a roar, muffled in the
-sea-mists drifting inland. The horizon is lost in a gray mist. All
-vastness, the clouds are piled up like giant rocks, and there is a
-'brool' over the sea that sounds like some passage of doom. Dark
-figures are on the beach here and there, sometimes half shrouded in
-the mist, and seem 'men like trees walking'. The fishing boats are
-racing for home, and rise and dip in the ground swell as they sweep
-into the harbour, bending to the scuppers. Here comes old Mr. Swales.
-He is making straight for me, and I can see, by the way he lifts his
-hat, that he wants to talk.
-
-I have been quite touched by the change in the poor old man. When he
-sat down beside me, he said in a very gentle way, "I want to say
-something to you, miss."
-
-I could see he was not at ease, so I took his poor old wrinkled hand in
-mine and asked him to speak fully.
-
-So he said, leaving his hand in mine, "I'm afraid, my deary, that I
-must have shocked you by all the wicked things I've been sayin' about
-the dead, and such like, for weeks past, but I didn't mean them, and I
-want ye to remember that when I'm gone. We aud folks that be daffled,
-and with one foot abaft the krok-hooal, don't altogether like to think
-of it, and we don't want to feel scart of it, and that's why I've took
-to makin' light of it, so that I'd cheer up my own heart a bit. But,
-Lord love ye, miss, I ain't afraid of dyin', not a bit, only I don't
-want to die if I can help it. My time must be nigh at hand now, for I
-be aud, and a hundred years is too much for any man to expect. And
-I'm so nigh it that the Aud Man is already whettin' his scythe. Ye
-see, I can't get out o' the habit of caffin' about it all at once.
-The chafts will wag as they be used to. Some day soon the Angel of
-Death will sound his trumpet for me. But don't ye dooal an' greet, my
-deary!"--for he saw that I was crying--"if he should come this very
-night I'd not refuse to answer his call. For life be, after all, only
-a waitin' for somethin' else than what we're doin', and death be all
-that we can rightly depend on. But I'm content, for it's comin' to
-me, my deary, and comin' quick. It may be comin' while we be lookin'
-and wonderin'. Maybe it's in that wind out over the sea that's
-bringin' with it loss and wreck, and sore distress, and sad hearts.
-Look! Look!" he cried suddenly. "There's something in that wind and
-in the hoast beyont that sounds, and looks, and tastes, and smells
-like death. It's in the air. I feel it comin'. Lord, make me answer
-cheerful, when my call comes!" He held up his arms devoutly, and
-raised his hat. His mouth moved as though he were praying. After a
-few minutes' silence, he got up, shook hands with me, and blessed me,
-and said goodbye, and hobbled off. It all touched me, and upset me
-very much.
-
-I was glad when the coastguard came along, with his spyglass under his
-arm. He stopped to talk with me, as he always does, but all the time
-kept looking at a strange ship.
-
-"I can't make her out," he said. "She's a Russian, by the look of
-her. But she's knocking about in the queerest way. She doesn't know
-her mind a bit. She seems to see the storm coming, but can't decide
-whether to run up north in the open, or to put in here. Look there
-again! She is steered mighty strangely, for she doesn't mind the hand
-on the wheel, changes about with every puff of wind. We'll hear more
-of her before this time tomorrow."
-
-
-
-
-CHAPTER 7
-
-
-CUTTING FROM "THE DAILYGRAPH", 8 AUGUST
-
-
-(PASTED IN MINA MURRAY'S JOURNAL)
-
-
-From a correspondent.
-
-Whitby.
-
-One of the greatest and suddenest storms on record has just been
-experienced here, with results both strange and unique. The weather
-had been somewhat sultry, but not to any degree uncommon in the
-month of August. Saturday evening was as fine as was ever known,
-and the great body of holiday-makers laid out yesterday for visits
-to Mulgrave Woods, Robin Hood's Bay, Rig Mill, Runswick, Staithes,
-and the various trips in the neighborhood of Whitby. The steamers
-Emma and Scarborough made trips up and down the coast, and there was
-an unusual amount of 'tripping' both to and from Whitby. The day
-was unusually fine till the afternoon, when some of the gossips who
-frequent the East Cliff churchyard, and from the commanding eminence
-watch the wide sweep of sea visible to the north and east, called
-attention to a sudden show of 'mares tails' high in the sky to the
-northwest. The wind was then blowing from the south-west in the
-mild degree which in barometrical language is ranked 'No. 2, light
-breeze.'
-
-The coastguard on duty at once made report, and one old fisherman,
-who for more than half a century has kept watch on weather signs
-from the East Cliff, foretold in an emphatic manner the coming of a
-sudden storm. The approach of sunset was so very beautiful, so
-grand in its masses of splendidly coloured clouds, that there was
-quite an assemblage on the walk along the cliff in the old
-churchyard to enjoy the beauty. Before the sun dipped below the
-black mass of Kettleness, standing boldly athwart the western sky,
-its downward way was marked by myriad clouds of every sunset colour,
-flame, purple, pink, green, violet, and all the tints of gold, with
-here and there masses not large, but of seemingly absolute
-blackness, in all sorts of shapes, as well outlined as colossal
-silhouettes. The experience was not lost on the painters, and
-doubtless some of the sketches of the 'Prelude to the Great Storm'
-will grace the R. A and R. I. walls in May next.
-
-More than one captain made up his mind then and there that his
-'cobble' or his 'mule', as they term the different classes of boats,
-would remain in the harbour till the storm had passed. The wind
-fell away entirely during the evening, and at midnight there was a
-dead calm, a sultry heat, and that prevailing intensity which, on
-the approach of thunder, affects persons of a sensitive nature.
-
-There were but few lights in sight at sea, for even the coasting
-steamers, which usually hug the shore so closely, kept well to
-seaward, and but few fishing boats were in sight. The only sail
-noticeable was a foreign schooner with all sails set, which was
-seemingly going westwards. The foolhardiness or ignorance of her
-officers was a prolific theme for comment whilst she remained in
-sight, and efforts were made to signal her to reduce sail in the
-face of her danger. Before the night shut down she was seen with
-sails idly flapping as she gently rolled on the undulating swell of
-the sea.
-
-"As idle as a painted ship upon a painted ocean."
-
-Shortly before ten o'clock the stillness of the air grew quite
-oppressive, and the silence was so marked that the bleating of a
-sheep inland or the barking of a dog in the town was distinctly
-heard, and the band on the pier, with its lively French air, was
-like a dischord in the great harmony of nature's silence. A little
-after midnight came a strange sound from over the sea, and high
-overhead the air began to carry a strange, faint, hollow booming.
-
-Then without warning the tempest broke. With a rapidity which, at
-the time, seemed incredible, and even afterwards is impossible to
-realize, the whole aspect of nature at once became convulsed. The
-waves rose in growing fury, each over-topping its fellow, till in a
-very few minutes the lately glassy sea was like a roaring and
-devouring monster. White-crested waves beat madly on the level
-sands and rushed up the shelving cliffs. Others broke over the
-piers, and with their spume swept the lanthorns of the lighthouses
-which rise from the end of either pier of Whitby Harbour.
-
-The wind roared like thunder, and blew with such force that it was
-with difficulty that even strong men kept their feet, or clung with
-grim clasp to the iron stanchions. It was found necessary to clear
-the entire pier from the mass of onlookers, or else the fatalities
-of the night would have increased manifold. To add to the
-difficulties and dangers of the time, masses of sea-fog came
-drifting inland. White, wet clouds, which swept by in ghostly
-fashion, so dank and damp and cold that it needed but little effort
-of imagination to think that the spirits of those lost at sea were
-touching their living brethren with the clammy hands of death, and
-many a one shuddered as the wreaths of sea-mist swept by.
-
-At times the mist cleared, and the sea for some distance could be
-seen in the glare of the lightning, which came thick and fast,
-followed by such peals of thunder that the whole sky overhead seemed
-trembling under the shock of the footsteps of the storm.
-
-Some of the scenes thus revealed were of immeasurable grandeur and
-of absorbing interest. The sea, running mountains high, threw
-skywards with each wave mighty masses of white foam, which the
-tempest seemed to snatch at and whirl away into space. Here and
-there a fishing boat, with a rag of sail, running madly for shelter
-before the blast, now and again the white wings of a storm-tossed
-seabird. On the summit of the East Cliff the new searchlight was
-ready for experiment, but had not yet been tried. The officers in
-charge of it got it into working order, and in the pauses of
-onrushing mist swept with it the surface of the sea. Once or twice
-its service was most effective, as when a fishing boat, with gunwale
-under water, rushed into the harbour, able, by the guidance of the
-sheltering light, to avoid the danger of dashing against the piers.
-As each boat achieved the safety of the port there was a shout of
-joy from the mass of people on the shore, a shout which for a moment
-seemed to cleave the gale and was then swept away in its rush.
-
-Before long the searchlight discovered some distance away a schooner
-with all sails set, apparently the same vessel which had been
-noticed earlier in the evening. The wind had by this time backed to
-the east, and there was a shudder amongst the watchers on the cliff
-as they realized the terrible danger in which she now was.
-
-Between her and the port lay the great flat reef on which so many
-good ships have from time to time suffered, and, with the wind
-blowing from its present quarter, it would be quite impossible that
-she should fetch the entrance of the harbour.
-
-It was now nearly the hour of high tide, but the waves were so great
-that in their troughs the shallows of the shore were almost visible,
-and the schooner, with all sails set, was rushing with such speed
-that, in the words of one old salt, "she must fetch up somewhere, if
-it was only in hell". Then came another rush of sea-fog, greater
-than any hitherto, a mass of dank mist, which seemed to close on all
-things like a gray pall, and left available to men only the organ of
-hearing, for the roar of the tempest, and the crash of the thunder,
-and the booming of the mighty billows came through the damp oblivion
-even louder than before. The rays of the searchlight were kept fixed
-on the harbour mouth across the East Pier, where the shock was
-expected, and men waited breathless.
-
-The wind suddenly shifted to the northeast, and the remnant of the
-sea fog melted in the blast. And then, mirabile dictu, between the
-piers, leaping from wave to wave as it rushed at headlong speed,
-swept the strange schooner before the blast, with all sail set, and
-gained the safety of the harbour. The searchlight followed her, and
-a shudder ran through all who saw her, for lashed to the helm was a
-corpse, with drooping head, which swung horribly to and fro at each
-motion of the ship. No other form could be seen on the deck at all.
-
-A great awe came on all as they realised that the ship, as if by a
-miracle, had found the harbour, unsteered save by the hand of a dead
-man! However, all took place more quickly than it takes to write
-these words. The schooner paused not, but rushing across the
-harbour, pitched herself on that accumulation of sand and gravel
-washed by many tides and many storms into the southeast corner of
-the pier jutting under the East Cliff, known locally as Tate Hill
-Pier.
-
-There was of course a considerable concussion as the vessel drove up
-on the sand heap. Every spar, rope, and stay was strained, and some
-of the 'top-hammer' came crashing down. But, strangest of all, the
-very instant the shore was touched, an immense dog sprang up on deck
-from below, as if shot up by the concussion, and running forward,
-jumped from the bow on the sand.
-
-Making straight for the steep cliff, where the churchyard hangs over
-the laneway to the East Pier so steeply that some of the flat
-tombstones, thruffsteans or through-stones, as they call them in
-Whitby vernacular, actually project over where the sustaining cliff
-has fallen away, it disappeared in the darkness, which seemed
-intensified just beyond the focus of the searchlight.
-
-It so happened that there was no one at the moment on Tate Hill
-Pier, as all those whose houses are in close proximity were either
-in bed or were out on the heights above. Thus the coastguard on
-duty on the eastern side of the harbour, who at once ran down to the
-little pier, was the first to climb aboard. The men working the
-searchlight, after scouring the entrance of the harbour without
-seeing anything, then turned the light on the derelict and kept it
-there. The coastguard ran aft, and when he came beside the wheel,
-bent over to examine it, and recoiled at once as though under some
-sudden emotion. This seemed to pique general curiosity, and quite a
-number of people began to run.
-
-It is a good way round from the West Cliff by the Draw-bridge to
-Tate Hill Pier, but your correspondent is a fairly good runner, and
-came well ahead of the crowd. When I arrived, however, I found
-already assembled on the pier a crowd, whom the coastguard and
-police refused to allow to come on board. By the courtesy of the
-chief boatman, I was, as your correspondent, permitted to climb on
-deck, and was one of a small group who saw the dead seaman whilst
-actually lashed to the wheel.
-
-It was no wonder that the coastguard was surprised, or even awed,
-for not often can such a sight have been seen. The man was simply
-fastened by his hands, tied one over the other, to a spoke of the
-wheel. Between the inner hand and the wood was a crucifix, the set
-of beads on which it was fastened being around both wrists and
-wheel, and all kept fast by the binding cords. The poor fellow may
-have been seated at one time, but the flapping and buffeting of the
-sails had worked through the rudder of the wheel and had dragged him
-to and fro, so that the cords with which he was tied had cut the
-flesh to the bone.
-
-Accurate note was made of the state of things, and a doctor, Surgeon
-J. M. Caffyn, of 33, East Elliot Place, who came immediately after
-me, declared, after making examination, that the man must have been
-dead for quite two days.
-
-In his pocket was a bottle, carefully corked, empty save for
-a little roll of paper, which proved to be the addendum to
-the log.
-
-The coastguard said the man must have tied up his own hands,
-fastening the knots with his teeth. The fact that a coastguard was
-the first on board may save some complications later on, in the
-Admiralty Court, for coastguards cannot claim the salvage which is
-the right of the first civilian entering on a derelict. Already,
-however, the legal tongues are wagging, and one young law student is
-loudly asserting that the rights of the owner are already completely
-sacrificed, his property being held in contravention of the statues
-of mortmain, since the tiller, as emblemship, if not proof, of
-delegated possession, is held in a dead hand.
-
-It is needless to say that the dead steersman has been reverently
-removed from the place where he held his honourable watch and ward
-till death, a steadfastness as noble as that of the young
-Casabianca, and placed in the mortuary to await inquest.
-
-Already the sudden storm is passing, and its fierceness is
-abating. Crowds are scattering backward, and the sky is
-beginning to redden over the Yorkshire wolds.
-
-I shall send, in time for your next issue, further details
-of the derelict ship which found her way so miraculously
-into harbour in the storm.
-
-
-9 August.--The sequel to the strange arrival of the derelict in the
-storm last night is almost more startling than the thing itself. It
-turns out that the schooner is Russian from Varna, and is called the
-Demeter. She is almost entirely in ballast of silver sand, with
-only a small amount of cargo, a number of great wooden boxes filled
-with mould.
-
-This cargo was consigned to a Whitby solicitor, Mr. S.F. Billington,
-of 7, The Crescent, who this morning went aboard and took formal
-possession of the goods consigned to him.
-
-The Russian consul, too, acting for the charter-party, took formal
-possession of the ship, and paid all harbour dues, etc.
-
-Nothing is talked about here today except the strange coincidence.
-The officials of the Board of Trade have been most exacting in
-seeing that every compliance has been made with existing
-regulations. As the matter is to be a 'nine days wonder', they are
-evidently determined that there shall be no cause of other
-complaint.
-
-A good deal of interest was abroad concerning the dog which landed
-when the ship struck, and more than a few of the members of the
-S.P.C.A., which is very strong in Whitby, have tried to befriend the
-animal. To the general disappointment, however, it was not to be
-found. It seems to have disappeared entirely from the town. It may
-be that it was frightened and made its way on to the moors, where it
-is still hiding in terror.
-
-There are some who look with dread on such a possibility, lest later
-on it should in itself become a danger, for it is evidently a fierce
-brute. Early this morning a large dog, a half-bred mastiff
-belonging to a coal merchant close to Tate Hill Pier, was found dead
-in the roadway opposite its master's yard. It had been fighting,
-and manifestly had had a savage opponent, for its throat was torn
-away, and its belly was slit open as if with a savage claw.
-
-Later.--By the kindness of the Board of Trade inspector, I have been
-permitted to look over the log book of the Demeter, which was in
-order up to within three days, but contained nothing of special
-interest except as to facts of missing men. The greatest interest,
-however, is with regard to the paper found in the bottle, which was
-today produced at the inquest. And a more strange narrative than
-the two between them unfold it has not been my lot to come across.
-
-As there is no motive for concealment, I am permitted to use them,
-and accordingly send you a transcript, simply omitting technical
-details of seamanship and supercargo. It almost seems as though the
-captain had been seized with some kind of mania before he had got
-well into blue water, and that this had developed persistently
-throughout the voyage. Of course my statement must be taken cum
-grano, since I am writing from the dictation of a clerk of the
-Russian consul, who kindly translated for me, time being short.
-
-
-
- LOG OF THE "DEMETER" Varna to Whitby
-
-
- Written 18 July, things so strange happening, that I shall
- keep accurate note henceforth till we land.
-
-
- On 6 July we finished taking in cargo, silver sand and boxes
- of earth. At noon set sail. East wind, fresh. Crew, five
- hands . . . two mates, cook, and myself, (captain).
-
-
- On 11 July at dawn entered Bosphorus. Boarded by Turkish
- Customs officers. Backsheesh. All correct. Under way at
- 4 p.m.
-
-
- On 12 July through Dardanelles. More Customs officers and
- flagboat of guarding squadron. Backsheesh again. Work of
- officers thorough, but quick. Want us off soon. At dark
- passed into Archipelago.
-
-
- On 13 July passed Cape Matapan. Crew dissatisfied about
- something. Seemed scared, but would not speak out.
-
-
- On 14 July was somewhat anxious about crew. Men all steady
- fellows, who sailed with me before. Mate could not make out what
- was wrong. They only told him there was SOMETHING, and crossed
- themselves. Mate lost temper with one of them that day and struck
- him. Expected fierce quarrel, but all was quiet.
-
-
- On 16 July mate reported in the morning that one of the
- crew, Petrofsky, was missing. Could not account for it.
- Took larboard watch eight bells last night, was relieved by
- Amramoff, but did not go to bunk. Men more downcast than
- ever. All said they expected something of the kind, but
- would not say more than there was SOMETHING aboard. Mate
- getting very impatient with them. Feared some trouble
- ahead.
-
-
- On 17 July, yesterday, one of the men, Olgaren, came to my cabin,
- and in an awestruck way confided to me that he thought there was a
- strange man aboard the ship. He said that in his watch he had
- been sheltering behind the deckhouse, as there was a rain storm,
- when he saw a tall, thin man, who was not like any of the crew,
- come up the companionway, and go along the deck forward and
- disappear. He followed cautiously, but when he got to bows found
- no one, and the hatchways were all closed. He was in a panic of
- superstitious fear, and I am afraid the panic may spread. To
- allay it, I shall today search the entire ship carefully from stem
- to stern.
-
-
- Later in the day I got together the whole crew, and told them, as
- they evidently thought there was some one in the ship, we would
- search from stem to stern. First mate angry, said it was folly,
- and to yield to such foolish ideas would demoralise the men, said
- he would engage to keep them out of trouble with the handspike. I
- let him take the helm, while the rest began a thorough search, all
- keeping abreast, with lanterns. We left no corner unsearched. As
- there were only the big wooden boxes, there were no odd corners
- where a man could hide. Men much relieved when search over, and
- went back to work cheerfully. First mate scowled, but said
- nothing.
-
-
- 22 July.--Rough weather last three days, and all hands busy
- with sails, no time to be frightened. Men seem to have
- forgotten their dread. Mate cheerful again, and all on
- good terms. Praised men for work in bad weather. Passed
- Gibraltar and out through Straits. All well.
-
-
- 24 July.--There seems some doom over this ship. Already a hand
- short, and entering the Bay of Biscay with wild weather ahead, and
- yet last night another man lost, disappeared. Like the first, he
- came off his watch and was not seen again. Men all in a panic of
- fear, sent a round robin, asking to have double watch, as they
- fear to be alone. Mate angry. Fear there will be some trouble,
- as either he or the men will do some violence.
-
-
- 28 July.--Four days in hell, knocking about in a sort of
- maelstrom, and the wind a tempest. No sleep for any one.
- Men all worn out. Hardly know how to set a watch, since no
- one fit to go on. Second mate volunteered to steer and
- watch, and let men snatch a few hours sleep. Wind abating,
- seas still terrific, but feel them less, as ship is
- steadier.
-
-
- 29 July.--Another tragedy. Had single watch tonight, as crew too
- tired to double. When morning watch came on deck could find no
- one except steersman. Raised outcry, and all came on deck.
- Thorough search, but no one found. Are now without second mate,
- and crew in a panic. Mate and I agreed to go armed henceforth and
- wait for any sign of cause.
-
-
- 30 July.--Last night. Rejoiced we are nearing England. Weather
- fine, all sails set. Retired worn out, slept soundly, awakened by
- mate telling me that both man of watch and steersman missing.
- Only self and mate and two hands left to work ship.
-
- 1 August.--Two days of fog, and not a sail sighted. Had hoped
- when in the English Channel to be able to signal for help or get
- in somewhere. Not having power to work sails, have to run before
- wind. Dare not lower, as could not raise them again. We seem to
- be drifting to some terrible doom. Mate now more demoralised than
- either of men. His stronger nature seems to have worked inwardly
- against himself. Men are beyond fear, working stolidly and
- patiently, with minds made up to worst. They are Russian, he
- Roumanian.
-
- 2 August, midnight.--Woke up from few minutes sleep by hearing a
- cry, seemingly outside my port. Could see nothing in fog. Rushed
- on deck, and ran against mate. Tells me he heard cry and ran, but
- no sign of man on watch. One more gone. Lord, help us! Mate
- says we must be past Straits of Dover, as in a moment of fog
- lifting he saw North Foreland, just as he heard the man cry out.
- If so we are now off in the North Sea, and only God can guide us
- in the fog, which seems to move with us, and God seems to have
- deserted us.
-
-
- 3 August.--At midnight I went to relieve the man at the
- wheel and when I got to it found no one there. The wind
- was steady, and as we ran before it there was no yawing. I
- dared not leave it, so shouted for the mate. After a few
- seconds, he rushed up on deck in his flannels. He looked
- wild-eyed and haggard, and I greatly fear his reason has
- given way. He came close to me and whispered hoarsely,
- with his mouth to my ear, as though fearing the very air
- might hear. "It is here. I know it now. On the watch
- last night I saw It, like a man, tall and thin, and ghastly
- pale. It was in the bows, and looking out. I crept behind
- It, and gave it my knife, but the knife went through It,
- empty as the air." And as he spoke he took the knife and
- drove it savagely into space. Then he went on, "But It is
- here, and I'll find It. It is in the hold, perhaps in one
- of those boxes. I'll unscrew them one by one and see. You
- work the helm." And with a warning look and his finger on
- his lip, he went below. There was springing up a choppy
- wind, and I could not leave the helm. I saw him come out
- on deck again with a tool chest and lantern, and go down
- the forward hatchway. He is mad, stark, raving mad, and
- it's no use my trying to stop him. He can't hurt those big
- boxes, they are invoiced as clay, and to pull them about is
- as harmless a thing as he can do. So here I stay and mind
- the helm, and write these notes. I can only trust in God
- and wait till the fog clears. Then, if I can't steer to
- any harbour with the wind that is, I shall cut down sails,
- and lie by, and signal for help . . .
-
- It is nearly all over now. Just as I was beginning to hope
- that the mate would come out calmer, for I heard him
- knocking away at something in the hold, and work is good
- for him, there came up the hatchway a sudden, startled
- scream, which made my blood run cold, and up on the deck he
- came as if shot from a gun, a raging madman, with his eyes
- rolling and his face convulsed with fear. "Save me! Save
- me!" he cried, and then looked round on the blanket of fog.
- His horror turned to despair, and in a steady voice he
- said, "You had better come too, captain, before it is too
- late. He is there! I know the secret now. The sea will
- save me from Him, and it is all that is left!" Before I
- could say a word, or move forward to seize him, he sprang
- on the bulwark and deliberately threw himself into the sea.
- I suppose I know the secret too, now. It was this madman
- who had got rid of the men one by one, and now he has
- followed them himself. God help me! How am I to account
- for all these horrors when I get to port? When I get to
- port! Will that ever be?
-
-
- 4 August.--Still fog, which the sunrise cannot pierce, I
- know there is sunrise because I am a sailor, why else I
- know not. I dared not go below, I dared not leave the
- helm, so here all night I stayed, and in the dimness of the
- night I saw it, Him! God, forgive me, but the mate was
- right to jump overboard. It was better to die like a man.
- To die like a sailor in blue water, no man can object. But
- I am captain, and I must not leave my ship. But I shall
- baffle this fiend or monster, for I shall tie my hands to
- the wheel when my strength begins to fail, and along with
- them I shall tie that which He, It, dare not touch. And
- then, come good wind or foul, I shall save my soul, and my
- honour as a captain. I am growing weaker, and the night is
- coming on. If He can look me in the face again, I may not
- have time to act. . . If we are wrecked, mayhap this bottle
- may be found, and those who find it may understand. If
- not . . . well, then all men shall know that I have been
- true to my trust. God and the Blessed Virgin and the
- Saints help a poor ignorant soul trying to do his duty . . .
-
-
-Of course the verdict was an open one. There is no evidence
-to adduce, and whether or not the man himself committed the
-murders there is now none to say. The folk here hold almost
-universally that the captain is simply a hero, and he is to be
-given a public funeral. Already it is arranged that his body
-is to be taken with a train of boats up the Esk for a piece
-and then brought back to Tate Hill Pier and up the abbey steps,
-for he is to be buried in the churchyard on the cliff. The
-owners of more than a hundred boats have already given in their
-names as wishing to follow him to the grave.
-
-No trace has ever been found of the great dog, at which there is
-much mourning, for, with public opinion in its present state, he
-would, I believe, be adopted by the town. Tomorrow will see the
-funeral, and so will end this one more 'mystery of the sea'.
-
-
-
-MINA MURRAY'S JOURNAL
-
-8 August.--Lucy was very restless all night, and I too, could not
-sleep. The storm was fearful, and as it boomed loudly among the
-chimney pots, it made me shudder. When a sharp puff came it seemed to
-be like a distant gun. Strangely enough, Lucy did not wake, but she
-got up twice and dressed herself. Fortunately, each time I awoke in
-time and managed to undress her without waking her, and got her back to
-bed. It is a very strange thing, this sleep-walking, for as soon as
-her will is thwarted in any physical way, her intention, if there be
-any, disappears, and she yields herself almost exactly to the routine
-of her life.
-
-Early in the morning we both got up and went down to the harbour to see
-if anything had happened in the night. There were very few people
-about, and though the sun was bright, and the air clear and fresh, the
-big, grim-looking waves, that seemed dark themselves because the foam
-that topped them was like snow, forced themselves in through the mouth
-of the harbour, like a bullying man going through a crowd. Somehow I
-felt glad that Jonathan was not on the sea last night, but on land.
-But, oh, is he on land or sea? Where is he, and how? I am getting
-fearfully anxious about him. If I only knew what to do, and could do
-anything!
-
-
-10 August.--The funeral of the poor sea captain today was most
-touching. Every boat in the harbour seemed to be there, and the coffin
-was carried by captains all the way from Tate Hill Pier up to the
-churchyard. Lucy came with me, and we went early to our old seat,
-whilst the cortege of boats went up the river to the Viaduct and came
-down again. We had a lovely view, and saw the procession nearly all
-the way. The poor fellow was laid to rest near our seat so that we
-stood on it, when the time came and saw everything.
-
-Poor Lucy seemed much upset. She was restless and uneasy all the time,
-and I cannot but think that her dreaming at night is telling on her.
-She is quite odd in one thing. She will not admit to me that there is
-any cause for restlessness, or if there be, she does not understand it
-herself.
-
-There is an additional cause in that poor Mr. Swales was found dead
-this morning on our seat, his neck being broken. He had evidently, as
-the doctor said, fallen back in the seat in some sort of fright, for
-there was a look of fear and horror on his face that the men said made
-them shudder. Poor dear old man!
-
-Lucy is so sweet and sensitive that she feels influences more acutely
-than other people do. Just now she was quite upset by a little thing
-which I did not much heed, though I am myself very fond of animals.
-
-One of the men who came up here often to look for the boats was
-followed by his dog. The dog is always with him. They are both quiet
-persons, and I never saw the man angry, nor heard the dog bark. During
-the service the dog would not come to its master, who was on the seat
-with us, but kept a few yards off, barking and howling. Its master
-spoke to it gently, and then harshly, and then angrily. But it would
-neither come nor cease to make a noise. It was in a fury, with its
-eyes savage, and all its hair bristling out like a cat's tail when puss
-is on the war path.
-
-Finally the man too got angry, and jumped down and kicked the dog, and
-then took it by the scruff of the neck and half dragged and half threw
-it on the tombstone on which the seat is fixed. The moment it touched
-the stone the poor thing began to tremble. It did not try to get away,
-but crouched down, quivering and cowering, and was in such a pitiable
-state of terror that I tried, though without effect, to comfort it.
-
-Lucy was full of pity, too, but she did not attempt to touch the dog,
-but looked at it in an agonised sort of way. I greatly fear that she
-is of too super sensitive a nature to go through the world without
-trouble. She will be dreaming of this tonight, I am sure. The whole
-agglomeration of things, the ship steered into port by a dead man, his
-attitude, tied to the wheel with a crucifix and beads, the touching
-funeral, the dog, now furious and now in terror, will all afford
-material for her dreams.
-
-I think it will be best for her to go to bed tired out physically, so I
-shall take her for a long walk by the cliffs to Robin Hood's Bay and
-back. She ought not to have much inclination for sleep-walking then.
-
-
-
-
-CHAPTER 8
-
-
-MINA MURRAY'S JOURNAL
-
-Same day, 11 o'clock P.M.--Oh, but I am tired! If it were not that I
-had made my diary a duty I should not open it tonight. We had a lovely
-walk. Lucy, after a while, was in gay spirits, owing, I think, to some
-dear cows who came nosing towards us in a field close to the
-lighthouse, and frightened the wits out of us. I believe we forgot
-everything, except of course, personal fear, and it seemed to wipe the
-slate clean and give us a fresh start. We had a capital 'severe tea'
-at Robin Hood's Bay in a sweet little old-fashioned inn, with a bow
-window right over the seaweed-covered rocks of the strand. I believe
-we should have shocked the 'New Woman' with our appetites. Men are
-more tolerant, bless them! Then we walked home with some, or rather
-many, stoppages to rest, and with our hearts full of a constant dread
-of wild bulls.
-
-Lucy was really tired, and we intended to creep off to bed as soon as
-we could. The young curate came in, however, and Mrs. Westenra asked
-him to stay for supper. Lucy and I had both a fight for it with the
-dusty miller. I know it was a hard fight on my part, and I am quite
-heroic. I think that some day the bishops must get together and see
-about breeding up a new class of curates, who don't take supper, no
-matter how hard they may be pressed to, and who will know when girls
-are tired.
-
-Lucy is asleep and breathing softly. She has more colour in her cheeks
-than usual, and looks, oh so sweet. If Mr. Holmwood fell in love with
-her seeing her only in the drawing room, I wonder what he would say if
-he saw her now. Some of the 'New Women' writers will some day start an
-idea that men and women should be allowed to see each other asleep
-before proposing or accepting. But I suppose the 'New Woman' won't
-condescend in future to accept. She will do the proposing herself. And
-a nice job she will make of it too! There's some consolation in that.
-I am so happy tonight, because dear Lucy seems better. I really
-believe she has turned the corner, and that we are over her troubles
-with dreaming. I should be quite happy if I only knew if Jonathan . . .
-God bless and keep him.
-
-
-11 August.--Diary again. No sleep now, so I may as well write. I am
-too agitated to sleep. We have had such an adventure, such an
-agonizing experience. I fell asleep as soon as I had closed my diary.
-. . . Suddenly I became broad awake, and sat up, with a horrible sense
-of fear upon me, and of some feeling of emptiness around me. The room
-was dark, so I could not see Lucy's bed. I stole across and felt for
-her. The bed was empty. I lit a match and found that she was not in
-the room. The door was shut, but not locked, as I had left it. I feared
-to wake her mother, who has been more than usually ill lately, so threw
-on some clothes and got ready to look for her. As I was leaving the
-room it struck me that the clothes she wore might give me some clue to
-her dreaming intention. Dressing-gown would mean house, dress outside.
-Dressing-gown and dress were both in their places. "Thank God," I said
-to myself, "she cannot be far, as she is only in her nightdress."
-
-I ran downstairs and looked in the sitting room. Not there! Then I
-looked in all the other rooms of the house, with an ever-growing fear
-chilling my heart. Finally, I came to the hall door and found it open.
-It was not wide open, but the catch of the lock had not caught. The
-people of the house are careful to lock the door every night, so I
-feared that Lucy must have gone out as she was. There was no time to
-think of what might happen. A vague over-mastering fear obscured all
-details.
-
-I took a big, heavy shawl and ran out. The clock was striking one as I
-was in the Crescent, and there was not a soul in sight. I ran along
-the North Terrace, but could see no sign of the white figure which I
-expected. At the edge of the West Cliff above the pier I looked across
-the harbour to the East Cliff, in the hope or fear, I don't know which,
-of seeing Lucy in our favourite seat.
-
-There was a bright full moon, with heavy black, driving clouds, which
-threw the whole scene into a fleeting diorama of light and shade as
-they sailed across. For a moment or two I could see nothing, as the
-shadow of a cloud obscured St. Mary's Church and all around it. Then
-as the cloud passed I could see the ruins of the abbey coming into
-view, and as the edge of a narrow band of light as sharp as a sword-cut
-moved along, the church and churchyard became gradually visible.
-Whatever my expectation was, it was not disappointed, for there, on our
-favourite seat, the silver light of the moon struck a half-reclining
-figure, snowy white. The coming of the cloud was too quick for me to
-see much, for shadow shut down on light almost immediately, but it
-seemed to me as though something dark stood behind the seat where the
-white figure shone, and bent over it. What it was, whether man or
-beast, I could not tell.
-
-I did not wait to catch another glance, but flew down the steep steps
-to the pier and along by the fish-market to the bridge, which was the
-only way to reach the East Cliff. The town seemed as dead, for not a
-soul did I see. I rejoiced that it was so, for I wanted no witness of
-poor Lucy's condition. The time and distance seemed endless, and my
-knees trembled and my breath came laboured as I toiled up the endless
-steps to the abbey. I must have gone fast, and yet it seemed to me as
-if my feet were weighted with lead, and as though every joint in my
-body were rusty.
-
-When I got almost to the top I could see the seat and the white figure,
-for I was now close enough to distinguish it even through the spells of
-shadow. There was undoubtedly something, long and black, bending over
-the half-reclining white figure. I called in fright, "Lucy! Lucy!"
-and something raised a head, and from where I was I could see a white
-face and red, gleaming eyes.
-
-Lucy did not answer, and I ran on to the entrance of the churchyard.
-As I entered, the church was between me and the seat, and for a minute
-or so I lost sight of her. When I came in view again the cloud had
-passed, and the moonlight struck so brilliantly that I could see Lucy
-half reclining with her head lying over the back of the seat. She was
-quite alone, and there was not a sign of any living thing about.
-
-When I bent over her I could see that she was still asleep. Her lips
-were parted, and she was breathing, not softly as usual with her, but
-in long, heavy gasps, as though striving to get her lungs full at every
-breath. As I came close, she put up her hand in her sleep and pulled
-the collar of her nightdress close around her, as though she felt the
-cold. I flung the warm shawl over her, and drew the edges tight around
-her neck, for I dreaded lest she should get some deadly chill from the
-night air, unclad as she was. I feared to wake her all at once, so, in
-order to have my hands free to help her, I fastened the shawl at her
-throat with a big safety pin. But I must have been clumsy in my
-anxiety and pinched or pricked her with it, for by-and-by, when her
-breathing became quieter, she put her hand to her throat again and
-moaned. When I had her carefully wrapped up I put my shoes on her
-feet, and then began very gently to wake her.
-
-At first she did not respond, but gradually she became more and more
-uneasy in her sleep, moaning and sighing occasionally. At last, as
-time was passing fast, and for many other reasons, I wished to get her
-home at once, I shook her forcibly, till finally she opened her eyes
-and awoke. She did not seem surprised to see me, as, of course, she
-did not realize all at once where she was.
-
-Lucy always wakes prettily, and even at such a time, when her body must
-have been chilled with cold, and her mind somewhat appalled at waking
-unclad in a churchyard at night, she did not lose her grace. She
-trembled a little, and clung to me. When I told her to come at once
-with me home, she rose without a word, with the obedience of a child.
-As we passed along, the gravel hurt my feet, and Lucy noticed me wince.
-She stopped and wanted to insist upon my taking my shoes, but I would
-not. However, when we got to the pathway outside the chruchyard, where
-there was a puddle of water, remaining from the storm, I daubed my feet
-with mud, using each foot in turn on the other, so that as we went
-home, no one, in case we should meet any one, should notice my bare
-feet.
-
-Fortune favoured us, and we got home without meeting a soul. Once we
-saw a man, who seemed not quite sober, passing along a street in front
-of us. But we hid in a door till he had disappeared up an opening such
-as there are here, steep little closes, or 'wynds', as they call them
-in Scotland. My heart beat so loud all the time sometimes I thought I
-should faint. I was filled with anxiety about Lucy, not only for her
-health, lest she should suffer from the exposure, but for her
-reputation in case the story should get wind. When we got in, and had
-washed our feet, and had said a prayer of thankfulness together, I
-tucked her into bed. Before falling asleep she asked, even implored,
-me not to say a word to any one, even her mother, about her
-sleep-walking adventure.
-
-I hesitated at first, to promise, but on thinking of the state of her
-mother's health, and how the knowledge of such a thing would fret her,
-and think too, of how such a story might become distorted, nay,
-infallibly would, in case it should leak out, I thought it wiser to do
-so. I hope I did right. I have locked the door, and the key is tied
-to my wrist, so perhaps I shall not be again disturbed. Lucy is
-sleeping soundly. The reflex of the dawn is high and far over the
-sea . . .
-
-
-Same day, noon.--All goes well. Lucy slept till I woke her and seemed
-not to have even changed her side. The adventure of the night does not
-seem to have harmed her, on the contrary, it has benefited her, for she
-looks better this morning than she has done for weeks. I was sorry to
-notice that my clumsiness with the safety-pin hurt her. Indeed, it
-might have been serious, for the skin of her throat was pierced. I
-must have pinched up a piece of loose skin and have transfixed it, for
-there are two little red points like pin-pricks, and on the band of her
-nightdress was a drop of blood. When I apologised and was concerned
-about it, she laughed and petted me, and said she did not even feel it.
-Fortunately it cannot leave a scar, as it is so tiny.
-
-
-Same day, night.--We passed a happy day. The air was clear, and the
-sun bright, and there was a cool breeze. We took our lunch to Mulgrave
-Woods, Mrs. Westenra driving by the road and Lucy and I walking by the
-cliff-path and joining her at the gate. I felt a little sad myself,
-for I could not but feel how absolutely happy it would have been had
-Jonathan been with me. But there! I must only be patient. In the
-evening we strolled in the Casino Terrace, and heard some good music by
-Spohr and Mackenzie, and went to bed early. Lucy seems more restful
-than she has been for some time, and fell asleep at once. I shall lock
-the door and secure the key the same as before, though I do not expect
-any trouble tonight.
-
-
-12 August.--My expectations were wrong, for twice during the night I
-was wakened by Lucy trying to get out. She seemed, even in her sleep,
-to be a little impatient at finding the door shut, and went back to bed
-under a sort of protest. I woke with the dawn, and heard the birds
-chirping outside of the window. Lucy woke, too, and I was glad to see,
-was even better than on the previous morning. All her old gaiety of
-manner seemed to have come back, and she came and snuggled in beside me
-and told me all about Arthur. I told her how anxious I was about
-Jonathan, and then she tried to comfort me. Well, she succeeded
-somewhat, for, though sympathy can't alter facts, it can make them more
-bearable.
-
-
-13 August.--Another quiet day, and to bed with the key on my wrist as
-before. Again I awoke in the night, and found Lucy sitting up in bed,
-still asleep, pointing to the window. I got up quietly, and pulling
-aside the blind, looked out. It was brilliant moonlight, and the soft
-effect of the light over the sea and sky, merged together in one great
-silent mystery, was beautiful beyond words. Between me and the
-moonlight flitted a great bat, coming and going in great whirling
-circles. Once or twice it came quite close, but was, I suppose,
-frightened at seeing me, and flitted away across the harbour towards
-the abbey. When I came back from the window Lucy had lain down again,
-and was sleeping peacefully. She did not stir again all night.
-
-
-14 August.--On the East Cliff, reading and writing all day. Lucy seems
-to have become as much in love with the spot as I am, and it is hard to
-get her away from it when it is time to come home for lunch or tea or
-dinner. This afternoon she made a funny remark. We were coming home
-for dinner, and had come to the top of the steps up from the West Pier
-and stopped to look at the view, as we generally do. The setting sun,
-low down in the sky, was just dropping behind Kettleness. The red
-light was thrown over on the East Cliff and the old abbey, and seemed
-to bathe everything in a beautiful rosy glow. We were silent for a
-while, and suddenly Lucy murmured as if to herself . . .
-
-"His red eyes again! They are just the same." It was such an odd
-expression, coming apropos of nothing, that it quite startled me. I
-slewed round a little, so as to see Lucy well without seeming to stare
-at her, and saw that she was in a half dreamy state, with an odd look
-on her face that I could not quite make out, so I said nothing, but
-followed her eyes. She appeared to be looking over at our own seat,
-whereon was a dark figure seated alone. I was quite a little startled
-myself, for it seemed for an instant as if the stranger had great eyes
-like burning flames, but a second look dispelled the illusion. The red
-sunlight was shining on the windows of St. Mary's Church behind our
-seat, and as the sun dipped there was just sufficient change in the
-refraction and reflection to make it appear as if the light moved. I
-called Lucy's attention to the peculiar effect, and she became herself
-with a start, but she looked sad all the same. It may have been that
-she was thinking of that terrible night up there. We never refer to
-it, so I said nothing, and we went home to dinner. Lucy had a headache
-and went early to bed. I saw her asleep, and went out for a little
-stroll myself.
-
-I walked along the cliffs to the westward, and was full of sweet
-sadness, for I was thinking of Jonathan. When coming home, it was then
-bright moonlight, so bright that, though the front of our part of the
-Crescent was in shadow, everything could be well seen, I threw a glance
-up at our window, and saw Lucy's head leaning out. I opened my
-handkerchief and waved it. She did not notice or make any movement
-whatever. Just then, the moonlight crept round an angle of the
-building, and the light fell on the window. There distinctly was Lucy
-with her head lying up against the side of the window sill and her eyes
-shut. She was fast asleep, and by her, seated on the window sill, was
-something that looked like a good-sized bird. I was afraid she might
-get a chill, so I ran upstairs, but as I came into the room she was
-moving back to her bed, fast asleep, and breathing heavily. She was
-holding her hand to her throat, as though to protect if from the cold.
-
-I did not wake her, but tucked her up warmly. I have taken care that
-the door is locked and the window securely fastened.
-
-She looks so sweet as she sleeps, but she is paler than is her wont,
-and there is a drawn, haggard look under her eyes which I do not like.
-I fear she is fretting about something. I wish I could find out what it
-is.
-
-
-15 August.--Rose later than usual. Lucy was languid and tired, and
-slept on after we had been called. We had a happy surprise at
-breakfast. Arthur's father is better, and wants the marriage to come
-off soon. Lucy is full of quiet joy, and her mother is glad and sorry
-at once. Later on in the day she told me the cause. She is grieved to
-lose Lucy as her very own, but she is rejoiced that she is soon to have
-some one to protect her. Poor dear, sweet lady! She confided to me
-that she has got her death warrant. She has not told Lucy, and made me
-promise secrecy. Her doctor told her that within a few months, at
-most, she must die, for her heart is weakening. At any time, even now,
-a sudden shock would be almost sure to kill her. Ah, we were wise to
-keep from her the affair of the dreadful night of Lucy's sleep-walking.
-
-
-17 August.--No diary for two whole days. I have not had the heart to
-write. Some sort of shadowy pall seems to be coming over our
-happiness. No news from Jonathan, and Lucy seems to be growing weaker,
-whilst her mother's hours are numbering to a close. I do not
-understand Lucy's fading away as she is doing. She eats well and
-sleeps well, and enjoys the fresh air, but all the time the roses in
-her cheeks are fading, and she gets weaker and more languid day by day.
-At night I hear her gasping as if for air.
-
-I keep the key of our door always fastened to my wrist at night, but
-she gets up and walks about the room, and sits at the open window.
-Last night I found her leaning out when I woke up, and when I tried to
-wake her I could not.
-
-She was in a faint. When I managed to restore her, she was weak as
-water, and cried silently between long, painful struggles for breath.
-When I asked her how she came to be at the window she shook her head
-and turned away.
-
-I trust her feeling ill may not be from that unlucky prick of the
-safety-pin. I looked at her throat just now as she lay asleep, and the
-tiny wounds seem not to have healed. They are still open, and, if
-anything, larger than before, and the edges of them are faintly white.
-They are like little white dots with red centres. Unless they heal
-within a day or two, I shall insist on the doctor seeing about them.
-
-
-
-LETTER, SAMUEL F. BILLINGTON & SON, SOLICITORS WHITBY,
-TO MESSRS. CARTER, PATERSON & CO., LONDON.
-
-17 August
-
-"Dear Sirs,--Herewith please receive invoice of goods sent by Great
-Northern Railway. Same are to be delivered at Carfax, near
-Purfleet, immediately on receipt at goods station King's Cross. The
-house is at present empty, but enclosed please find keys, all of
-which are labelled.
-
-"You will please deposit the boxes, fifty in number, which form the
-consignment, in the partially ruined building forming part of the
-house and marked 'A' on rough diagrams enclosed. Your agent will
-easily recognize the locality, as it is the ancient chapel of the
-mansion. The goods leave by the train at 9:30 tonight, and will be
-due at King's Cross at 4:30 tomorrow afternoon. As our client
-wishes the delivery made as soon as possible, we shall be obliged by
-your having teams ready at King's Cross at the time named and
-forthwith conveying the goods to destination. In order to obviate
-any delays possible through any routine requirements as to payment
-in your departments, we enclose cheque herewith for ten pounds,
-receipt of which please acknowledge. Should the charge be less than
-this amount, you can return balance, if greater, we shall at once
-send cheque for difference on hearing from you. You are to leave
-the keys on coming away in the main hall of the house, where the
-proprietor may get them on his entering the house by means of his
-duplicate key.
-
-"Pray do not take us as exceeding the bounds of business courtesy
-in pressing you in all ways to use the utmost expedition.
-
-"We are, dear Sirs,
-Faithfully yours,
-SAMUEL F. BILLINGTON & SON"
-
-
-
-LETTER, MESSRS. CARTER, PATERSON & CO., LONDON,
-TO MESSRS. BILLINGTON & SON, WHITBY.
-
-21 August.
-
-"Dear Sirs,--We beg to acknowledge 10 pounds received and to return
-cheque of 1 pound, 17s, 9d, amount of overplus, as shown in
-receipted account herewith. Goods are delivered in exact accordance
-with instructions, and keys left in parcel in main hall, as
-directed.
-
-"We are, dear Sirs,
-Yours respectfully,
-Pro CARTER, PATERSON & CO."
-
-
-
-MINA MURRAY'S JOURNAL.
-
-18 August.--I am happy today, and write sitting on the seat in the
-churchyard. Lucy is ever so much better. Last night she slept well
-all night, and did not disturb me once.
-
-The roses seem coming back already to her cheeks, though she is still
-sadly pale and wan-looking. If she were in any way anemic I could
-understand it, but she is not. She is in gay spirits and full of life
-and cheerfulness. All the morbid reticence seems to have passed from
-her, and she has just reminded me, as if I needed any reminding, of
-that night, and that it was here, on this very seat, I found her
-asleep.
-
-As she told me she tapped playfully with the heel of her boot on the
-stone slab and said,
-
-"My poor little feet didn't make much noise then! I daresay poor old
-Mr. Swales would have told me that it was because I didn't want to wake
-up Geordie."
-
-As she was in such a communicative humour, I asked her if she had
-dreamed at all that night.
-
-Before she answered, that sweet, puckered look came into her forehead,
-which Arthur, I call him Arthur from her habit, says he loves, and
-indeed, I don't wonder that he does. Then she went on in a
-half-dreaming kind of way, as if trying to recall it to herself.
-
-"I didn't quite dream, but it all seemed to be real. I only wanted to
-be here in this spot. I don't know why, for I was afraid of something,
-I don't know what. I remember, though I suppose I was asleep, passing
-through the streets and over the bridge. A fish leaped as I went by,
-and I leaned over to look at it, and I heard a lot of dogs howling. The
-whole town seemed as if it must be full of dogs all howling at once, as
-I went up the steps. Then I had a vague memory of something long and
-dark with red eyes, just as we saw in the sunset, and something very
-sweet and very bitter all around me at once. And then I seemed sinking
-into deep green water, and there was a singing in my ears, as I have
-heard there is to drowning men, and then everything seemed passing away
-from me. My soul seemed to go out from my body and float about the
-air. I seem to remember that once the West Lighthouse was right under
-me, and then there was a sort of agonizing feeling, as if I were in an
-earthquake, and I came back and found you shaking my body. I saw you
-do it before I felt you."
-
-Then she began to laugh. It seemed a little uncanny to me, and I
-listened to her breathlessly. I did not quite like it, and thought it
-better not to keep her mind on the subject, so we drifted on to another
-subject, and Lucy was like her old self again. When we got home the
-fresh breeze had braced her up, and her pale cheeks were really more
-rosy. Her mother rejoiced when she saw her, and we all spent a very
-happy evening together.
-
-
-19 August.--Joy, joy, joy! Although not all joy. At last, news of
-Jonathan. The dear fellow has been ill, that is why he did not write.
-I am not afraid to think it or to say it, now that I know. Mr. Hawkins
-sent me on the letter, and wrote himself, oh so kindly. I am to leave
-in the morning and go over to Jonathan, and to help to nurse him if
-necessary, and to bring him home. Mr. Hawkins says it would not be a
-bad thing if we were to be married out there. I have cried over the
-good Sister's letter till I can feel it wet against my bosom, where it
-lies. It is of Jonathan, and must be near my heart, for he is in my
-heart. My journey is all mapped out, and my luggage ready. I am only
-taking one change of dress. Lucy will bring my trunk to London and
-keep it till I send for it, for it may be that . . . I must write no
-more. I must keep it to say to Jonathan, my husband. The letter that
-he has seen and touched must comfort me till we meet.
-
-
-
-LETTER, SISTER AGATHA, HOSPITAL OF ST. JOSEPH AND
-STE. MARY BUDA-PESTH, TO MISS WILLHELMINA MURRAY
-
-12 August,
-
-"Dear Madam.
-
-"I write by desire of Mr. Jonathan Harker, who is himself not strong
-enough to write, though progressing well, thanks to God and St.
-Joseph and Ste. Mary. He has been under our care for nearly six
-weeks, suffering from a violent brain fever. He wishes me to convey
-his love, and to say that by this post I write for him to Mr. Peter
-Hawkins, Exeter, to say, with his dutiful respects, that he is sorry
-for his delay, and that all of his work is completed. He will
-require some few weeks' rest in our sanatorium in the hills, but
-will then return. He wishes me to say that he has not sufficient
-money with him, and that he would like to pay for his staying here,
-so that others who need shall not be wanting for help.
-
-"Believe me,
-
-"Yours, with sympathy
-and all blessings.
-Sister Agatha
-
-"P.S.--My patient being asleep, I open this to let you know
-something more. He has told me all about you, and that you are
-shortly to be his wife. All blessings to you both! He has had some
-fearful shock, so says our doctor, and in his delirium his ravings
-have been dreadful, of wolves and poison and blood, of ghosts and
-demons, and I fear to say of what. Be careful of him always that
-there may be nothing to excite him of this kind for a long time to
-come. The traces of such an illness as his do not lightly die away.
-We should have written long ago, but we knew nothing of his friends,
-and there was nothing on him, nothing that anyone could understand.
-He came in the train from Klausenburg, and the guard was told by the
-station master there that he rushed into the station shouting for a
-ticket for home. Seeing from his violent demeanour that he was
-English, they gave him a ticket for the furthest station on the way
-thither that the train reached.
-
-"Be assured that he is well cared for. He has won all hearts by his
-sweetness and gentleness. He is truly getting on well, and I have
-no doubt will in a few weeks be all himself. But be careful of him
-for safety's sake. There are, I pray God and St. Joseph and Ste.
-Mary, many, many, happy years for you both."
-
-
-
-DR. SEWARD'S DIARY
-
-19 August.--Strange and sudden change in Renfield last night. About
-eight o'clock he began to get excited and sniff about as a dog does
-when setting. The attendant was struck by his manner, and knowing my
-interest in him, encouraged him to talk. He is usually respectful to
-the attendant and at times servile, but tonight, the man tells me, he
-was quite haughty. Would not condescend to talk with him at all.
-
-All he would say was, "I don't want to talk to you. You don't count
-now. The master is at hand."
-
-The attendant thinks it is some sudden form of religious mania which
-has seized him. If so, we must look out for squalls, for a strong man
-with homicidal and religious mania at once might be dangerous. The
-combination is a dreadful one.
-
-At nine o'clock I visited him myself. His attitude to me was the same
-as that to the attendant. In his sublime self-feeling the difference
-between myself and the attendant seemed to him as nothing. It looks
-like religious mania, and he will soon think that he himself is God.
-
-These infinitesimal distinctions between man and man are too paltry for
-an Omnipotent Being. How these madmen give themselves away! The real
-God taketh heed lest a sparrow fall. But the God created from human
-vanity sees no difference between an eagle and a sparrow. Oh, if men
-only knew!
-
-For half an hour or more Renfield kept getting excited in greater and
-greater degree. I did not pretend to be watching him, but I kept
-strict observation all the same. All at once that shifty look came
-into his eyes which we always see when a madman has seized an idea, and
-with it the shifty movement of the head and back which asylum
-attendants come to know so well. He became quite quiet, and went and
-sat on the edge of his bed resignedly, and looked into space with
-lack-luster eyes.
-
-I thought I would find out if his apathy were real or only assumed, and
-tried to lead him to talk of his pets, a theme which had never failed
-to excite his attention.
-
-At first he made no reply, but at length said testily, "Bother them
-all! I don't care a pin about them."
-
-"What?" I said. "You don't mean to tell me you don't care about
-spiders?" (Spiders at present are his hobby and the notebook is filling
-up with columns of small figures.)
-
-To this he answered enigmatically, "The Bride maidens rejoice the eyes
-that wait the coming of the bride. But when the bride draweth nigh,
-then the maidens shine not to the eyes that are filled."
-
-He would not explain himself, but remained obstinately seated on his
-bed all the time I remained with him.
-
-I am weary tonight and low in spirits. I cannot but think of Lucy, and
-how different things might have been. If I don't sleep at once,
-chloral, the modern Morpheus! I must be careful not to let it grow
-into a habit. No, I shall take none tonight! I have thought of Lucy,
-and I shall not dishonour her by mixing the two. If need be, tonight
-shall be sleepless.
-
-
-Later.--Glad I made the resolution, gladder that I kept to it. I had
-lain tossing about, and had heard the clock strike only twice, when the
-night watchman came to me, sent up from the ward, to say that Renfield
-had escaped. I threw on my clothes and ran down at once. My patient
-is too dangerous a person to be roaming about. Those ideas of his
-might work out dangerously with strangers.
-
-The attendant was waiting for me. He said he had seen him not ten
-minutes before, seemingly asleep in his bed, when he had looked through
-the observation trap in the door. His attention was called by the
-sound of the window being wrenched out. He ran back and saw his feet
-disappear through the window, and had at once sent up for me. He was
-only in his night gear, and cannot be far off.
-
-The attendant thought it would be more useful to watch where he should
-go than to follow him, as he might lose sight of him whilst getting out
-of the building by the door. He is a bulky man, and couldn't get
-through the window.
-
-I am thin, so, with his aid, I got out, but feet foremost, and as we
-were only a few feet above ground landed unhurt.
-
-The attendant told me the patient had gone to the left, and had taken a
-straight line, so I ran as quickly as I could. As I got through the
-belt of trees I saw a white figure scale the high wall which separates
-our grounds from those of the deserted house.
-
-I ran back at once, told the watchman to get three or four men
-immediately and follow me into the grounds of Carfax, in case our
-friend might be dangerous. I got a ladder myself, and crossing the
-wall, dropped down on the other side. I could see Renfield's figure
-just disappearing behind the angle of the house, so I ran after him. On
-the far side of the house I found him pressed close against the old
-iron-bound oak door of the chapel.
-
-He was talking, apparently to some one, but I was afraid to go near
-enough to hear what he was saying, lest I might frighten him, and he
-should run off.
-
-Chasing an errant swarm of bees is nothing to following a naked
-lunatic, when the fit of escaping is upon him! After a few minutes,
-however, I could see that he did not take note of anything around him,
-and so ventured to draw nearer to him, the more so as my men had now
-crossed the wall and were closing him in. I heard him say . . .
-
-"I am here to do your bidding, Master. I am your slave, and you will
-reward me, for I shall be faithful. I have worshipped you long and afar
-off. Now that you are near, I await your commands, and you will not
-pass me by, will you, dear Master, in your distribution of good
-things?"
-
-He is a selfish old beggar anyhow. He thinks of the loaves and fishes
-even when he believes his is in a real Presence. His manias make a
-startling combination. When we closed in on him he fought like a
-tiger. He is immensely strong, for he was more like a wild beast than
-a man.
-
-I never saw a lunatic in such a paroxysm of rage before, and I hope I
-shall not again. It is a mercy that we have found out his strength and
-his danger in good time. With strength and determination like his, he
-might have done wild work before he was caged.
-
-He is safe now, at any rate. Jack Sheppard himself couldn't get free
-from the strait waistcoat that keeps him restrained, and he's chained
-to the wall in the padded room.
-
-His cries are at times awful, but the silences that follow are more
-deadly still, for he means murder in every turn and movement.
-
-Just now he spoke coherent words for the first time. "I shall be
-patient, Master. It is coming, coming, coming!"
-
-So I took the hint, and came too. I was too excited to sleep, but this
-diary has quieted me, and I feel I shall get some sleep tonight.
-
-
-
-
-CHAPTER 9
-
-
-LETTER, MINA HARKER TO LUCY WESTENRA
-
-
-Buda-Pesth, 24 August.
-
-"My dearest Lucy,
-
-"I know you will be anxious to hear all that has happened
-since we parted at the railway station at Whitby.
-
-"Well, my dear, I got to Hull all right, and caught the boat to
-Hamburg, and then the train on here. I feel that I can hardly
-recall anything of the journey, except that I knew I was coming to
-Jonathan, and that as I should have to do some nursing, I had better
-get all the sleep I could. I found my dear one, oh, so thin and
-pale and weak-looking. All the resolution has gone out of his dear
-eyes, and that quiet dignity which I told you was in his face has
-vanished. He is only a wreck of himself, and he does not remember
-anything that has happened to him for a long time past. At least,
-he wants me to believe so, and I shall never ask.
-
-"He has had some terrible shock, and I fear it might tax his poor
-brain if he were to try to recall it. Sister Agatha, who is a good
-creature and a born nurse, tells me that he wanted her to tell me
-what they were, but she would only cross herself, and say she would
-never tell. That the ravings of the sick were the secrets of God,
-and that if a nurse through her vocation should hear them, she
-should respect her trust.
-
-"She is a sweet, good soul, and the next day, when she saw I was
-troubled, she opened up the subject my poor dear raved about, added,
-'I can tell you this much, my dear. That it was not about anything
-which he has done wrong himself, and you, as his wife to be, have no
-cause to be concerned. He has not forgotten you or what he owes to
-you. His fear was of great and terrible things, which no mortal can
-treat of.'
-
-"I do believe the dear soul thought I might be jealous lest my poor
-dear should have fallen in love with any other girl. The idea of my
-being jealous about Jonathan! And yet, my dear, let me whisper, I
-felt a thrill of joy through me when I knew that no other woman was
-a cause for trouble. I am now sitting by his bedside, where I can
-see his face while he sleeps. He is waking!
-
-"When he woke he asked me for his coat, as he wanted to get
-something from the pocket. I asked Sister Agatha, and she brought
-all his things. I saw amongst them was his notebook, and was
-going to ask him to let me look at it, for I knew that I might find
-some clue to his trouble, but I suppose he must have seen my wish in
-my eyes, for he sent me over to the window, saying he wanted to be
-quite alone for a moment.
-
-"Then he called me back, and he said to me very solemnly,
-'Wilhelmina', I knew then that he was in deadly earnest, for he has
-never called me by that name since he asked me to marry him, 'You
-know, dear, my ideas of the trust between husband and wife. There
-should be no secret, no concealment. I have had a great shock, and
-when I try to think of what it is I feel my head spin round, and I
-do not know if it was real of the dreaming of a madman. You know I
-had brain fever, and that is to be mad. The secret is here, and I
-do not want to know it. I want to take up my life here, with our
-marriage.' For, my dear, we had decided to be married as soon as
-the formalities are complete. 'Are you willing, Wilhelmina, to
-share my ignorance? Here is the book. Take it and keep it, read it
-if you will, but never let me know unless, indeed, some solemn duty
-should come upon me to go back to the bitter hours, asleep or awake,
-sane or mad, recorded here.' He fell back exhausted, and I put the
-book under his pillow, and kissed him. I have asked Sister Agatha
-to beg the Superior to let our wedding be this afternoon, and am
-waiting her reply . . ."
-
-
-"She has come and told me that the Chaplain of the English mission
-church has been sent for. We are to be married in an hour, or as
-soon after as Jonathan awakes."
-
-"Lucy, the time has come and gone. I feel very solemn, but very,
-very happy. Jonathan woke a little after the hour, and all was
-ready, and he sat up in bed, propped up with pillows. He answered
-his 'I will' firmly and strong. I could hardly speak. My heart was
-so full that even those words seemed to choke me.
-
-"The dear sisters were so kind. Please, God, I shall never, never
-forget them, nor the grave and sweet responsibilities I have taken
-upon me. I must tell you of my wedding present. When the chaplain
-and the sisters had left me alone with my husband--oh, Lucy, it is
-the first time I have written the words 'my husband'--left me alone
-with my husband, I took the book from under his pillow, and wrapped
-it up in white paper, and tied it with a little bit of pale blue
-ribbon which was round my neck, and sealed it over the knot with
-sealing wax, and for my seal I used my wedding ring. Then I kissed
-it and showed it to my husband, and told him that I would keep it
-so, and then it would be an outward and visible sign for us all our
-lives that we trusted each other, that I would never open it unless
-it were for his own dear sake or for the sake of some stern duty.
-Then he took my hand in his, and oh, Lucy, it was the first time he
-took his wife's hand, and said that it was the dearest thing in all
-the wide world, and that he would go through all the past again to
-win it, if need be. The poor dear meant to have said a part of the
-past, but he cannot think of time yet, and I shall not wonder if at
-first he mixes up not only the month, but the year.
-
-"Well, my dear, what could I say? I could only tell him that I was
-the happiest woman in all the wide world, and that I had nothing to
-give him except myself, my life, and my trust, and that with these
-went my love and duty for all the days of my life. And, my dear,
-when he kissed me, and drew me to him with his poor weak hands, it
-was like a solemn pledge between us.
-
-"Lucy dear, do you know why I tell you all this? It is not only
-because it is all sweet to me, but because you have been, and are,
-very dear to me. It was my privilege to be your friend and guide
-when you came from the schoolroom to prepare for the world of life.
-I want you to see now, and with the eyes of a very happy wife,
-whither duty has led me, so that in your own married life you too
-may be all happy, as I am. My dear, please Almighty God, your life
-may be all it promises, a long day of sunshine, with no harsh wind,
-no forgetting duty, no distrust. I must not wish you no pain, for
-that can never be, but I do hope you will be always as happy as I am
-now. Goodbye, my dear. I shall post this at once, and perhaps,
-write you very soon again. I must stop, for Jonathan is waking. I
-must attend my husband!
-
-"Your ever-loving
-Mina Harker."
-
-
-
-LETTER, LUCY WESTENRA TO MINA HARKER.
-
-Whitby, 30 August.
-
-"My dearest Mina,
-
-"Oceans of love and millions of kisses, and may you soon be in your
-own home with your husband. I wish you were coming home soon enough
-to stay with us here. The strong air would soon restore Jonathan.
-It has quite restored me. I have an appetite like a cormorant, am
-full of life, and sleep well. You will be glad to know that I have
-quite given up walking in my sleep. I think I have not stirred out
-of my bed for a week, that is when I once got into it at night.
-Arthur says I am getting fat. By the way, I forgot to tell you that
-Arthur is here. We have such walks and drives, and rides, and
-rowing, and tennis, and fishing together, and I love him more than
-ever. He tells me that he loves me more, but I doubt that, for at
-first he told me that he couldn't love me more than he did then.
-But this is nonsense. There he is, calling to me. So no more just
-at present from your loving,
-
-"Lucy.
-
-"P.S.--Mother sends her love. She seems better, poor dear.
-
-"P.P.S.--We are to be married on 28 September."
-
-
-
-DR. SEWARDS DIARY
-
-20 August.--The case of Renfield grows even more interesting. He has
-now so far quieted that there are spells of cessation from his
-passion. For the first week after his attack he was perpetually
-violent. Then one night, just as the moon rose, he grew quiet, and
-kept murmuring to himself. "Now I can wait. Now I can wait."
-
-The attendant came to tell me, so I ran down at once to have a look at
-him. He was still in the strait waistcoat and in the padded room, but
-the suffused look had gone from his face, and his eyes had something
-of their old pleading. I might almost say, cringing, softness. I was
-satisfied with his present condition, and directed him to be relieved.
-The attendants hesitated, but finally carried out my wishes without
-protest.
-
-It was a strange thing that the patient had humour enough to see their
-distrust, for, coming close to me, he said in a whisper, all the while
-looking furtively at them, "They think I could hurt you! Fancy me
-hurting you! The fools!"
-
-It was soothing, somehow, to the feelings to find myself disassociated
-even in the mind of this poor madman from the others, but all the same
-I do not follow his thought. Am I to take it that I have anything in
-common with him, so that we are, as it were, to stand together. Or
-has he to gain from me some good so stupendous that my well being is
-needful to Him? I must find out later on. Tonight he will not speak.
-Even the offer of a kitten or even a full-grown cat will not tempt
-him.
-
-He will only say, "I don't take any stock in cats. I have more to
-think of now, and I can wait. I can wait."
-
-After a while I left him. The attendant tells me that he was quiet
-until just before dawn, and that then he began to get uneasy, and at
-length violent, until at last he fell into a paroxysm which exhausted
-him so that he swooned into a sort of coma.
-
-
-. . . Three nights has the same thing happened, violent all day then
-quiet from moonrise to sunrise. I wish I could get some clue to the
-cause. It would almost seem as if there was some influence which came
-and went. Happy thought! We shall tonight play sane wits against mad
-ones. He escaped before without our help. Tonight he shall escape
-with it. We shall give him a chance, and have the men ready to follow
-in case they are required.
-
-
-23 August.--"The expected always happens." How well Disraeli knew
-life. Our bird when he found the cage open would not fly, so all our
-subtle arrangements were for nought. At any rate, we have proved one
-thing, that the spells of quietness last a reasonable time. We shall
-in future be able to ease his bonds for a few hours each day. I have
-given orders to the night attendant merely to shut him in the padded
-room, when once he is quiet, until the hour before sunrise. The poor
-soul's body will enjoy the relief even if his mind cannot appreciate
-it. Hark! The unexpected again! I am called. The patient has once
-more escaped.
-
-
-Later.--Another night adventure. Renfield artfully waited until the
-attendant was entering the room to inspect. Then he dashed out past
-him and flew down the passage. I sent word for the attendants to
-follow. Again he went into the grounds of the deserted house, and we
-found him in the same place, pressed against the old chapel door.
-When he saw me he became furious, and had not the attendants seized
-him in time, he would have tried to kill me. As we were holding him a
-strange thing happened. He suddenly redoubled his efforts, and then
-as suddenly grew calm. I looked round instinctively, but could see
-nothing. Then I caught the patient's eye and followed it, but could
-trace nothing as it looked into the moonlight sky, except a big bat,
-which was flapping its silent and ghostly way to the west. Bats
-usually wheel about, but this one seemed to go straight on, as if it
-knew where it was bound for or had some intention of its own.
-
-The patient grew calmer every instant, and presently said, "You
-needn't tie me. I shall go quietly!" Without trouble, we came back
-to the house. I feel there is something ominous in his calm, and
-shall not forget this night.
-
-
-
-LUCY WESTENRA'S DIARY
-
-Hillingham, 24 August.--I must imitate Mina, and keep writing things
-down. Then we can have long talks when we do meet. I wonder when it
-will be. I wish she were with me again, for I feel so unhappy. Last
-night I seemed to be dreaming again just as I was at Whitby. Perhaps
-it is the change of air, or getting home again. It is all dark and
-horrid to me, for I can remember nothing. But I am full of vague
-fear, and I feel so weak and worn out. When Arthur came to lunch he
-looked quite grieved when he saw me, and I hadn't the spirit to try to
-be cheerful. I wonder if I could sleep in mother's room tonight. I
-shall make an excuse to try.
-
-
-25 August.--Another bad night. Mother did not seem to take to my
-proposal. She seems not too well herself, and doubtless she fears to
-worry me. I tried to keep awake, and succeeded for a while, but when
-the clock struck twelve it waked me from a doze, so I must have been
-falling asleep. There was a sort of scratching or flapping at the
-window, but I did not mind it, and as I remember no more, I suppose I
-must have fallen asleep. More bad dreams. I wish I could remember
-them. This morning I am horribly weak. My face is ghastly pale, and
-my throat pains me. It must be something wrong with my lungs, for I
-don't seem to be getting air enough. I shall try to cheer up when
-Arthur comes, or else I know he will be miserable to see me so.
-
-
-
-LETTER, ARTHUR TO DR. SEWARD
-
-"Albemarle Hotel, 31 August
-
-"My dear Jack,
-
-"I want you to do me a favour. Lucy is ill, that is she has no
-special disease, but she looks awful, and is getting worse every
-day. I have asked her if there is any cause, I not dare to ask her
-mother, for to disturb the poor lady's mind about her daughter in
-her present state of health would be fatal. Mrs. Westenra has
-confided to me that her doom is spoken, disease of the heart, though
-poor Lucy does not know it yet. I am sure that there is something
-preying on my dear girl's mind. I am almost distracted when I think
-of her. To look at her gives me a pang. I told her I should ask
-you to see her, and though she demurred at first, I know why, old
-fellow, she finally consented. It will be a painful task for you, I
-know, old friend, but it is for her sake, and I must not hesitate to
-ask, or you to act. You are to come to lunch at Hillingham
-tomorrow, two o'clock, so as not to arouse any suspicion in Mrs.
-Westenra, and after lunch Lucy will take an opportunity of being
-alone with you. I am filled with anxiety, and want to consult with
-you alone as soon as I can after you have seen her. Do not fail!
-
-"Arthur."
-
-
-
-TELEGRAM, ARTHUR HOLMWOOD TO SEWARD
-
-1 September
-
-"Am summoned to see my father, who is worse. Am writing. Write
-me fully by tonight's post to Ring. Wire me if necessary."
-
-
-
-LETTER FROM DR. SEWARD TO ARTHUR HOLMWOOD
-
-2 September
-
-"My dear old fellow,
-
-"With regard to Miss Westenra's health I hasten to let you know at
-once that in my opinion there is not any functional disturbance or
-any malady that I know of. At the same time, I am not by any means
-satisfied with her appearance. She is woefully different from what
-she was when I saw her last. Of course you must bear in mind that I
-did not have full opportunity of examination such as I should wish.
-Our very friendship makes a little difficulty which not even medical
-science or custom can bridge over. I had better tell you exactly
-what happened, leaving you to draw, in a measure, your own
-conclusions. I shall then say what I have done and propose doing.
-
-"I found Miss Westenra in seemingly gay spirits. Her mother was
-present, and in a few seconds I made up my mind that she was trying
-all she knew to mislead her mother and prevent her from being
-anxious. I have no doubt she guesses, if she does not know, what
-need of caution there is.
-
-"We lunched alone, and as we all exerted ourselves to be cheerful,
-we got, as some kind of reward for our labours, some real
-cheerfulness amongst us. Then Mrs. Westenra went to lie down, and
-Lucy was left with me. We went into her boudoir, and till we got
-there her gaiety remained, for the servants were coming and going.
-
-"As soon as the door was closed, however, the mask fell from her
-face, and she sank down into a chair with a great sigh, and hid her
-eyes with her hand. When I saw that her high spirits had failed, I
-at once took advantage of her reaction to make a diagnosis.
-
-"She said to me very sweetly, 'I cannot tell you how I loathe
-talking about myself.' I reminded her that a doctor's confidence
-was sacred, but that you were grievously anxious about her. She
-caught on to my meaning at once, and settled that matter in a word.
-'Tell Arthur everything you choose. I do not care for myself, but
-for him!' So I am quite free.
-
-"I could easily see that she was somewhat bloodless, but I could not
-see the usual anemic signs, and by the chance, I was able to test
-the actual quality of her blood, for in opening a window which was
-stiff a cord gave way, and she cut her hand slightly with broken
-glass. It was a slight matter in itself, but it gave me an evident
-chance, and I secured a few drops of the blood and have analysed
-them.
-
-"The qualitative analysis give a quite normal condition, and shows,
-I should infer, in itself a vigorous state of health. In other
-physical matters I was quite satisfied that there is no need for
-anxiety, but as there must be a cause somewhere, I have come to the
-conclusion that it must be something mental.
-
-"She complains of difficulty breathing satisfactorily at times, and
-of heavy, lethargic sleep, with dreams that frighten her, but
-regarding which she can remember nothing. She says that as a child,
-she used to walk in her sleep, and that when in Whitby the habit
-came back, and that once she walked out in the night and went to
-East Cliff, where Miss Murray found her. But she assures me that of
-late the habit has not returned.
-
-"I am in doubt, and so have done the best thing I know of. I have
-written to my old friend and master, Professor Van Helsing, of
-Amsterdam, who knows as much about obscure diseases as any one in
-the world. I have asked him to come over, and as you told me that
-all things were to be at your charge, I have mentioned to him who
-you are and your relations to Miss Westenra. This, my dear fellow,
-is in obedience to your wishes, for I am only too proud and happy to
-do anything I can for her.
-
-"Van Helsing would, I know, do anything for me for a personal
-reason, so no matter on what ground he comes, we must accept his
-wishes. He is a seemingly arbitrary man, this is because he knows
-what he is talking about better than any one else. He is a
-philosopher and a metaphysician, and one of the most advanced
-scientists of his day, and he has, I believe, an absolutely open
-mind. This, with an iron nerve, a temper of the ice-brook, and
-indomitable resolution, self-command, and toleration exalted from
-virtues to blessings, and the kindliest and truest heart that beats,
-these form his equipment for the noble work that he is doing for
-mankind, work both in theory and practice, for his views are as wide
-as his all-embracing sympathy. I tell you these facts that you may
-know why I have such confidence in him. I have asked him to come at
-once. I shall see Miss Westenra tomorrow again. She is to meet me
-at the Stores, so that I may not alarm her mother by too early a
-repetition of my call.
-
-"Yours always."
-
-John Seward
-
-
-
-
-LETTER, ABRAHAM VAN HELSING, MD, DPh, D. Lit, ETC, ETC, TO DR. SEWARD
-
-2 September.
-
-"My good Friend,
-
-"When I received your letter I am already coming to you. By good
-fortune I can leave just at once, without wrong to any of those who
-have trusted me. Were fortune other, then it were bad for those who
-have trusted, for I come to my friend when he call me to aid those
-he holds dear. Tell your friend that when that time you suck from
-my wound so swiftly the poison of the gangrene from that knife that
-our other friend, too nervous, let slip, you did more for him when
-he wants my aids and you call for them than all his great fortune
-could do. But it is pleasure added to do for him, your friend, it
-is to you that I come. Have near at hand, and please it so arrange
-that we may see the young lady not too late on tomorrow, for it is
-likely that I may have to return here that night. But if need be I
-shall come again in three days, and stay longer if it must. Till
-then goodbye, my friend John.
-
-"Van Helsing."
-
-
-
-LETTER, DR. SEWARD TO HON. ARTHUR HOLMWOOD
-
-3 September
-
-"My dear Art,
-
-"Van Helsing has come and gone. He came on with me to Hillingham,
-and found that, by Lucy's discretion, her mother was lunching out,
-so that we were alone with her.
-
-"Van Helsing made a very careful examination of the patient. He is
-to report to me, and I shall advise you, for of course I was not
-present all the time. He is, I fear, much concerned, but says he
-must think. When I told him of our friendship and how you trust to
-me in the matter, he said, 'You must tell him all you think. Tell
-him what I think, if you can guess it, if you will. Nay, I am
-not jesting. This is no jest, but life and death, perhaps more.' I
-asked what he meant by that, for he was very serious. This was when
-we had come back to town, and he was having a cup of tea before
-starting on his return to Amsterdam. He would not give me any
-further clue. You must not be angry with me, Art, because his very
-reticence means that all his brains are working for her good. He
-will speak plainly enough when the time comes, be sure. So I told
-him I would simply write an account of our visit, just as if I were
-doing a descriptive special article for THE DAILY TELEGRAPH. He
-seemed not to notice, but remarked that the smuts of London were not
-quite so bad as they used to be when he was a student here. I am to
-get his report tomorrow if he can possibly make it. In any case I
-am to have a letter.
-
-"Well, as to the visit, Lucy was more cheerful than on the day I
-first saw her, and certainly looked better. She had lost something
-of the ghastly look that so upset you, and her breathing was normal.
-She was very sweet to the Professor (as she always is), and tried to
-make him feel at ease, though I could see the poor girl was making a
-hard struggle for it.
-
-"I believe Van Helsing saw it, too, for I saw the quick look
-under his bushy brows that I knew of old. Then he began to
-chat of all things except ourselves and diseases and with
-such an infinite geniality that I could see poor Lucy's
-pretense of animation merge into reality. Then, without
-any seeming change, he brought the conversation gently round
-to his visit, and suavely said,
-
-"'My dear young miss, I have the so great pleasure because you are
-so much beloved. That is much, my dear, even were there that which
-I do not see. They told me you were down in the spirit, and that
-you were of a ghastly pale. To them I say "Pouf!"' And he snapped
-his fingers at me and went on. 'But you and I shall show them how
-wrong they are. How can he,' and he pointed at me with the same
-look and gesture as that with which he pointed me out in his class,
-on, or rather after, a particular occasion which he never fails to
-remind me of, 'know anything of a young ladies? He has his madmen
-to play with, and to bring them back to happiness, and to those that
-love them. It is much to do, and, oh, but there are rewards in that
-we can bestow such happiness. But the young ladies! He has no wife
-nor daughter, and the young do not tell themselves to the young, but
-to the old, like me, who have known so many sorrows and the causes
-of them. So, my dear, we will send him away to smoke the cigarette
-in the garden, whiles you and I have little talk all to ourselves.'
-I took the hint, and strolled about, and presently the professor
-came to the window and called me in. He looked grave, but said, 'I
-have made careful examination, but there is no functional cause.
-With you I agree that there has been much blood lost, it has been
-but is not. But the conditions of her are in no way anemic. I have
-asked her to send me her maid, that I may ask just one or two
-questions, that so I may not chance to miss nothing. I know well
-what she will say. And yet there is cause. There is always cause
-for everything. I must go back home and think. You must send me
-the telegram every day, and if there be cause I shall come again.
-The disease, for not to be well is a disease, interest me, and the
-sweet, young dear, she interest me too. She charm me, and for her,
-if not for you or disease, I come.'
-
-"As I tell you, he would not say a word more, even when we were
-alone. And so now, Art, you know all I know. I shall keep stern
-watch. I trust your poor father is rallying. It must be a terrible
-thing to you, my dear old fellow, to be placed in such a position
-between two people who are both so dear to you. I know your idea of
-duty to your father, and you are right to stick to it. But if need
-be, I shall send you word to come at once to Lucy, so do not be
-over-anxious unless you hear from me."
-
-
-
-DR. SEWARD'S DIARY
-
-4 September.--Zoophagous patient still keeps up our interest in him.
-He had only one outburst and that was yesterday at an unusual time.
-Just before the stroke of noon he began to grow restless. The
-attendant knew the symptoms, and at once summoned aid. Fortunately
-the men came at a run, and were just in time, for at the stroke of
-noon he became so violent that it took all their strength to hold him.
-In about five minutes, however, he began to get more quiet, and
-finally sank into a sort of melancholy, in which state he has remained
-up to now. The attendant tells me that his screams whilst in the
-paroxysm were really appalling. I found my hands full when I got in,
-attending to some of the other patients who were frightened by him.
-Indeed, I can quite understand the effect, for the sounds disturbed
-even me, though I was some distance away. It is now after the dinner
-hour of the asylum, and as yet my patient sits in a corner brooding,
-with a dull, sullen, woe-begone look in his face, which seems rather
-to indicate than to show something directly. I cannot quite
-understand it.
-
-
-Later.--Another change in my patient. At five o'clock I looked in on
-him, and found him seemingly as happy and contented as he used to be.
-He was catching flies and eating them, and was keeping note of his
-capture by making nailmarks on the edge of the door between the ridges
-of padding. When he saw me, he came over and apologized for his bad
-conduct, and asked me in a very humble, cringing way to be led back to
-his own room, and to have his notebook again. I thought it well to
-humour him, so he is back in his room with the window open. He has
-the sugar of his tea spread out on the window sill, and is reaping
-quite a harvest of flies. He is not now eating them, but putting them
-into a box, as of old, and is already examining the corners of his
-room to find a spider. I tried to get him to talk about the past few
-days, for any clue to his thoughts would be of immense help to me, but
-he would not rise. For a moment or two he looked very sad, and said
-in a sort of far away voice, as though saying it rather to himself
-than to me.
-
-"All over! All over! He has deserted me. No hope for me now unless
-I do it myself!" Then suddenly turning to me in a resolute way, he
-said, "Doctor, won't you be very good to me and let me have a little
-more sugar? I think it would be very good for me."
-
-"And the flies?" I said.
-
-"Yes! The flies like it, too, and I like the flies, therefore I like
-it." And there are people who know so little as to think that madmen do
-not argue. I procured him a double supply, and left him as happy a
-man as, I suppose, any in the world. I wish I could fathom his mind.
-
-
-Midnight.--Another change in him. I had been to see Miss Westenra,
-whom I found much better, and had just returned, and was standing at
-our own gate looking at the sunset, when once more I heard him
-yelling. As his room is on this side of the house, I could hear it
-better than in the morning. It was a shock to me to turn from the
-wonderful smoky beauty of a sunset over London, with its lurid lights
-and inky shadows and all the marvellous tints that come on foul clouds
-even as on foul water, and to realize all the grim sternness of my own
-cold stone building, with its wealth of breathing misery, and my own
-desolate heart to endure it all. I reached him just as the sun was
-going down, and from his window saw the red disc sink. As it sank he
-became less and less frenzied, and just as it dipped he slid from the
-hands that held him, an inert mass, on the floor. It is wonderful,
-however, what intellectual recuperative power lunatics have, for
-within a few minutes he stood up quite calmly and looked around him. I
-signalled to the attendants not to hold him, for I was anxious to see
-what he would do. He went straight over to the window and brushed out
-the crumbs of sugar. Then he took his fly box, and emptied it
-outside, and threw away the box. Then he shut the window, and
-crossing over, sat down on his bed. All this surprised me, so I asked
-him, "Are you going to keep flies any more?"
-
-"No," said he. "I am sick of all that rubbish!" He certainly is a
-wonderfully interesting study. I wish I could get some glimpse of his
-mind or of the cause of his sudden passion. Stop. There may be a
-clue after all, if we can find why today his paroxysms came on at high
-noon and at sunset. Can it be that there is a malign influence of the
-sun at periods which affects certain natures, as at times the moon
-does others? We shall see.
-
-
-
-TELEGRAM. SEWARD, LONDON, TO VAN HELSING, AMSTERDAM
-
-"4 September.--Patient still better today."
-
-
-
-TELEGRAM, SEWARD, LONDON, TO VAN HELSING, AMSTERDAM
-
-"5 September.--Patient greatly improved. Good appetite, sleeps
-naturally, good spirits, colour coming back."
-
-
-
-TELEGRAM, SEWARD, LONDON, TO VAN HELSING, AMSTERDAM
-
-"6 September.--Terrible change for the worse. Come at once.
-Do not lose an hour. I hold over telegram to Holmwood till
-have seen you."
-
-
-
-
-CHAPTER 10
-
-
-LETTER, DR. SEWARD TO HON. ARTHUR HOLMWOOD
-
-
-6 September
-
-"My dear Art,
-
-"My news today is not so good. Lucy this morning had gone back a
-bit. There is, however, one good thing which has arisen from it.
-Mrs. Westenra was naturally anxious concerning Lucy, and has
-consulted me professionally about her. I took advantage of the
-opportunity, and told her that my old master, Van Helsing, the great
-specialist, was coming to stay with me, and that I would put her in
-his charge conjointly with myself. So now we can come and go
-without alarming her unduly, for a shock to her would mean sudden
-death, and this, in Lucy's weak condition, might be disastrous to
-her. We are hedged in with difficulties, all of us, my poor fellow,
-but, please God, we shall come through them all right. If any need
-I shall write, so that, if you do not hear from me, take it for
-granted that I am simply waiting for news, In haste,
-
-"Yours ever,"
-
-John Seward
-
-
-
-DR. SEWARD'S DIARY
-
-7 September.--The first thing Van Helsing said to me when we met at
-Liverpool Street was, "Have you said anything to our young friend, to
-lover of her?"
-
-"No," I said. "I waited till I had seen you, as I said in my
-telegram. I wrote him a letter simply telling him that you were
-coming, as Miss Westenra was not so well, and that I should let him
-know if need be."
-
-"Right, my friend," he said. "Quite right! Better he not know as
-yet. Perhaps he will never know. I pray so, but if it be needed,
-then he shall know all. And, my good friend John, let me caution you.
-You deal with the madmen. All men are mad in some way or the other,
-and inasmuch as you deal discreetly with your madmen, so deal with
-God's madmen too, the rest of the world. You tell not your madmen
-what you do nor why you do it. You tell them not what you think. So
-you shall keep knowledge in its place, where it may rest, where it may
-gather its kind around it and breed. You and I shall keep as yet what
-we know here, and here." He touched me on the heart and on the
-forehead, and then touched himself the same way. "I have for myself
-thoughts at the present. Later I shall unfold to you."
-
-"Why not now?" I asked. "It may do some good. We may arrive at some
-decision." He looked at me and said, "My friend John, when the corn is
-grown, even before it has ripened, while the milk of its mother earth
-is in him, and the sunshine has not yet begun to paint him with his
-gold, the husbandman he pull the ear and rub him between his rough
-hands, and blow away the green chaff, and say to you, 'Look! He's
-good corn, he will make a good crop when the time comes.'"
-
-I did not see the application and told him so. For reply he reached
-over and took my ear in his hand and pulled it playfully, as he used
-long ago to do at lectures, and said, "The good husbandman tell you so
-then because he knows, but not till then. But you do not find the
-good husbandman dig up his planted corn to see if he grow. That is
-for the children who play at husbandry, and not for those who take it
-as of the work of their life. See you now, friend John? I have sown
-my corn, and Nature has her work to do in making it sprout, if he
-sprout at all, there's some promise, and I wait till the ear begins to
-swell." He broke off, for he evidently saw that I understood. Then he
-went on gravely, "You were always a careful student, and your case
-book was ever more full than the rest. And I trust that good habit
-have not fail. Remember, my friend, that knowledge is stronger than
-memory, and we should not trust the weaker. Even if you have not kept
-the good practice, let me tell you that this case of our dear miss is
-one that may be, mind, I say may be, of such interest to us and others
-that all the rest may not make him kick the beam, as your people say.
-Take then good note of it. Nothing is too small. I counsel you, put
-down in record even your doubts and surmises. Hereafter it may be of
-interest to you to see how true you guess. We learn from failure, not
-from success!"
-
-When I described Lucy's symptoms, the same as before, but infinitely
-more marked, he looked very grave, but said nothing. He took with him
-a bag in which were many instruments and drugs, "the ghastly
-paraphernalia of our beneficial trade," as he once called, in one of
-his lectures, the equipment of a professor of the healing craft.
-
-When we were shown in, Mrs. Westenra met us. She was alarmed, but not
-nearly so much as I expected to find her. Nature in one of her
-beneficient moods has ordained that even death has some antidote to
-its own terrors. Here, in a case where any shock may prove fatal,
-matters are so ordered that, from some cause or other, the things not
-personal, even the terrible change in her daughter to whom she is so
-attached, do not seem to reach her. It is something like the way dame
-Nature gathers round a foreign body an envelope of some insensitive
-tissue which can protect from evil that which it would otherwise harm
-by contact. If this be an ordered selfishness, then we should pause
-before we condemn any one for the vice of egoism, for there may be
-deeper root for its causes than we have knowledge of.
-
-I used my knowledge of this phase of spiritual pathology, and set down
-a rule that she should not be present with Lucy, or think of her
-illness more than was absolutely required. She assented readily, so
-readily that I saw again the hand of Nature fighting for life. Van
-Helsing and I were shown up to Lucy's room. If I was shocked when I
-saw her yesterday, I was horrified when I saw her today.
-
-She was ghastly, chalkily pale. The red seemed to have gone even from
-her lips and gums, and the bones of her face stood out prominently.
-Her breathing was painful to see or hear. Van Helsing's face grew set
-as marble, and his eyebrows converged till they almost touched over his
-nose. Lucy lay motionless, and did not seem to have strength to
-speak, so for a while we were all silent. Then Van Helsing beckoned
-to me, and we went gently out of the room. The instant we had closed
-the door he stepped quickly along the passage to the next door, which
-was open. Then he pulled me quickly in with him and closed the door.
-"My god!" he said. "This is dreadful. There is not time to be lost.
-She will die for sheer want of blood to keep the heart's action as it
-should be. There must be a transfusion of blood at once. Is it you
-or me?"
-
-"I am younger and stronger, Professor. It must be me."
-
-"Then get ready at once. I will bring up my bag. I am prepared."
-
-I went downstairs with him, and as we were going there was a knock at
-the hall door. When we reached the hall, the maid had just opened the
-door, and Arthur was stepping quickly in. He rushed up to me, saying
-in an eager whisper,
-
-"Jack, I was so anxious. I read between the lines of your letter, and
-have been in an agony. The dad was better, so I ran down here to see
-for myself. Is not that gentleman Dr. Van Helsing? I am so thankful
-to you, sir, for coming."
-
-When first the Professor's eye had lit upon him, he had been angry at
-his interruption at such a time, but now, as he took in his stalwart
-proportions and recognized the strong young manhood which seemed to
-emanate from him, his eyes gleamed. Without a pause he said to him as
-he held out his hand,
-
-"Sir, you have come in time. You are the lover of our dear miss. She
-is bad, very, very bad. Nay, my child, do not go like that." For he
-suddenly grew pale and sat down in a chair almost fainting. "You are
-to help her. You can do more than any that live, and your courage is
-your best help."
-
-"What can I do?" asked Arthur hoarsely. "Tell me, and I shall do it.
-My life is hers, and I would give the last drop of blood in my body for
-her."
-
-The Professor has a strongly humorous side, and I could from old
-knowledge detect a trace of its origin in his answer.
-
-"My young sir, I do not ask so much as that, not the last!"
-
-"What shall I do?" There was fire in his eyes, and his open nostrils
-quivered with intent. Van Helsing slapped him on the shoulder.
-
-"Come!" he said. "You are a man, and it is a man we want. You are
-better than me, better than my friend John." Arthur looked bewildered,
-and the Professor went on by explaining in a kindly way.
-
-"Young miss is bad, very bad. She wants blood, and blood she must
-have or die. My friend John and I have consulted, and we are about to
-perform what we call transfusion of blood, to transfer from full veins
-of one to the empty veins which pine for him. John was to give his
-blood, as he is the more young and strong than me."--Here Arthur took
-my hand and wrung it hard in silence.--"But now you are here, you are
-more good than us, old or young, who toil much in the world of
-thought. Our nerves are not so calm and our blood so bright than
-yours!"
-
-Arthur turned to him and said, "If you only knew how gladly I would
-die for her you would understand . . ." He stopped with a sort of
-choke in his voice.
-
-"Good boy!" said Van Helsing. "In the not-so-far-off you will be
-happy that you have done all for her you love. Come now and be
-silent. You shall kiss her once before it is done, but then you must
-go, and you must leave at my sign. Say no word to Madame. You know
-how it is with her. There must be no shock, any knowledge of this
-would be one. Come!"
-
-We all went up to Lucy's room. Arthur by direction remained outside.
-Lucy turned her head and looked at us, but said nothing. She was not
-asleep, but she was simply too weak to make the effort. Her eyes
-spoke to us, that was all.
-
-Van Helsing took some things from his bag and laid them on a little
-table out of sight. Then he mixed a narcotic, and coming over to the
-bed, said cheerily, "Now, little miss, here is your medicine. Drink
-it off, like a good child. See, I lift you so that to swallow is
-easy. Yes." She had made the effort with success.
-
-It astonished me how long the drug took to act. This, in fact, marked
-the extent of her weakness. The time seemed endless until sleep began
-to flicker in her eyelids. At last, however, the narcotic began to
-manifest its potency, and she fell into a deep sleep. When the
-Professor was satisfied, he called Arthur into the room, and bade him
-strip off his coat. Then he added, "You may take that one little kiss
-whiles I bring over the table. Friend John, help to me!" So neither
-of us looked whilst he bent over her.
-
-Van Helsing, turning to me, said, "He is so young and strong, and of
-blood so pure that we need not defibrinate it."
-
-Then with swiftness, but with absolute method, Van Helsing performed
-the operation. As the transfusion went on, something like life seemed
-to come back to poor Lucy's cheeks, and through Arthur's growing
-pallor the joy of his face seemed absolutely to shine. After a bit I
-began to grow anxious, for the loss of blood was telling on Arthur,
-strong man as he was. It gave me an idea of what a terrible strain
-Lucy's system must have undergone that what weakened Arthur only
-partially restored her.
-
-But the Professor's face was set, and he stood watch in hand, and with
-his eyes fixed now on the patient and now on Arthur. I could hear my
-own heart beat. Presently, he said in a soft voice, "Do not stir an
-instant. It is enough. You attend him. I will look to her."
-
-When all was over, I could see how much Arthur was weakened. I
-dressed the wound and took his arm to bring him away, when Van Helsing
-spoke without turning round, the man seems to have eyes in the back of
-his head, "The brave lover, I think, deserve another kiss, which he
-shall have presently." And as he had now finished his operation, he
-adjusted the pillow to the patient's head. As he did so the narrow
-black velvet band which she seems always to wear round her throat,
-buckled with an old diamond buckle which her lover had given her, was
-dragged a little up, and showed a red mark on her throat.
-
-Arthur did not notice it, but I could hear the deep hiss of indrawn
-breath which is one of Van Helsing's ways of betraying emotion. He
-said nothing at the moment, but turned to me, saying, "Now take down
-our brave young lover, give him of the port wine, and let him lie down
-a while. He must then go home and rest, sleep much and eat much, that
-he may be recruited of what he has so given to his love. He must not
-stay here. Hold a moment! I may take it, sir, that you are anxious
-of result. Then bring it with you, that in all ways the operation is
-successful. You have saved her life this time, and you can go home
-and rest easy in mind that all that can be is. I shall tell her all
-when she is well. She shall love you none the less for what you have
-done. Goodbye."
-
-When Arthur had gone I went back to the room. Lucy was sleeping
-gently, but her breathing was stronger. I could see the counterpane
-move as her breast heaved. By the bedside sat Van Helsing, looking at
-her intently. The velvet band again covered the red mark. I asked
-the Professor in a whisper, "What do you make of that mark on her
-throat?"
-
-"What do you make of it?"
-
-"I have not examined it yet," I answered, and then and there proceeded
-to loose the band. Just over the external jugular vein there were two
-punctures, not large, but not wholesome looking. There was no sign of
-disease, but the edges were white and worn looking, as if by some
-trituration. It at once occurred to me that that this wound, or
-whatever it was, might be the means of that manifest loss of blood.
-But I abandoned the idea as soon as it formed, for such a thing could
-not be. The whole bed would have been drenched to a scarlet with the
-blood which the girl must have lost to leave such a pallor as she had
-before the transfusion.
-
-"Well?" said Van Helsing.
-
-"Well," said I. "I can make nothing of it."
-
-The Professor stood up. "I must go back to Amsterdam tonight," he
-said "There are books and things there which I want. You must remain
-here all night, and you must not let your sight pass from her."
-
-"Shall I have a nurse?" I asked.
-
-"We are the best nurses, you and I. You keep watch all night. See
-that she is well fed, and that nothing disturbs her. You must not
-sleep all the night. Later on we can sleep, you and I. I shall be
-back as soon as possible. And then we may begin."
-
-"May begin?" I said. "What on earth do you mean?"
-
-"We shall see!" he answered, as he hurried out. He came back a moment
-later and put his head inside the door and said with a warning finger
-held up, "Remember, she is your charge. If you leave her, and harm
-befall, you shall not sleep easy hereafter!"
-
-
-
-DR. SEWARD'S DIARY--CONTINUED
-
-8 September.--I sat up all night with Lucy. The opiate worked itself
-off towards dusk, and she waked naturally. She looked a different
-being from what she had been before the operation. Her spirits even
-were good, and she was full of a happy vivacity, but I could see
-evidences of the absolute prostration which she had undergone. When I
-told Mrs. Westenra that Dr. Van Helsing had directed that I should sit
-up with her, she almost pooh-poohed the idea, pointing out her
-daughter's renewed strength and excellent spirits. I was firm,
-however, and made preparations for my long vigil. When her maid had
-prepared her for the night I came in, having in the meantime had
-supper, and took a seat by the bedside.
-
-She did not in any way make objection, but looked at me gratefully
-whenever I caught her eye. After a long spell she seemed sinking off
-to sleep, but with an effort seemed to pull herself together and shook
-it off. It was apparent that she did not want to sleep, so I tackled
-the subject at once.
-
-"You do not want to sleep?"
-
-"No. I am afraid."
-
-"Afraid to go to sleep! Why so? It is the boon we all crave for."
-
-"Ah, not if you were like me, if sleep was to you a presage of
-horror!"
-
-"A presage of horror! What on earth do you mean?"
-
-"I don't know. Oh, I don't know. And that is what is so terrible.
-All this weakness comes to me in sleep, until I dread the very
-thought."
-
-"But, my dear girl, you may sleep tonight. I am here watching you,
-and I can promise that nothing will happen."
-
-"Ah, I can trust you!" she said.
-
-I seized the opportunity, and said, "I promise that if I see any
-evidence of bad dreams I will wake you at once."
-
-"You will? Oh, will you really? How good you are to me. Then I will
-sleep!" And almost at the word she gave a deep sigh of relief, and
-sank back, asleep.
-
-All night long I watched by her. She never stirred, but slept on and
-on in a deep, tranquil, life-giving, health-giving sleep. Her lips
-were slightly parted, and her breast rose and fell with the regularity
-of a pendulum. There was a smile on her face, and it was evident that
-no bad dreams had come to disturb her peace of mind.
-
-In the early morning her maid came, and I left her in her care and took
-myself back home, for I was anxious about many things. I sent a short
-wire to Van Helsing and to Arthur, telling them of the excellent
-result of the operation. My own work, with its manifold arrears, took
-me all day to clear off. It was dark when I was able to inquire about
-my zoophagous patient. The report was good. He had been quite quiet
-for the past day and night. A telegram came from Van Helsing at
-Amsterdam whilst I was at dinner, suggesting that I should be at
-Hillingham tonight, as it might be well to be at hand, and stating
-that he was leaving by the night mail and would join me early in the
-morning.
-
-
-9 September.--I was pretty tired and worn out when I got to
-Hillingham. For two nights I had hardly had a wink of sleep, and my
-brain was beginning to feel that numbness which marks cerebral
-exhaustion. Lucy was up and in cheerful spirits. When she shook
-hands with me she looked sharply in my face and said,
-
-"No sitting up tonight for you. You are worn out. I am quite well
-again. Indeed, I am, and if there is to be any sitting up, it is I
-who will sit up with you."
-
-I would not argue the point, but went and had my supper. Lucy came
-with me, and, enlivened by her charming presence, I made an excellent
-meal, and had a couple of glasses of the more than excellent port.
-Then Lucy took me upstairs, and showed me a room next her own, where a
-cozy fire was burning.
-
-"Now," she said. "You must stay here. I shall leave this door open
-and my door too. You can lie on the sofa for I know that nothing
-would induce any of you doctors to go to bed whilst there is a patient
-above the horizon. If I want anything I shall call out, and you can
-come to me at once."
-
-I could not but acquiesce, for I was dog tired, and could not have sat
-up had I tried. So, on her renewing her promise to call me if she
-should want anything, I lay on the sofa, and forgot all about
-everything.
-
-
-
-LUCY WESTENRA'S DIARY
-
-9 September.--I feel so happy tonight. I have been so miserably weak,
-that to be able to think and move about is like feeling sunshine after
-a long spell of east wind out of a steel sky. Somehow Arthur feels
-very, very close to me. I seem to feel his presence warm about me. I
-suppose it is that sickness and weakness are selfish things and turn
-our inner eyes and sympathy on ourselves, whilst health and strength
-give love rein, and in thought and feeling he can wander where he
-wills. I know where my thoughts are. If only Arthur knew! My dear,
-my dear, your ears must tingle as you sleep, as mine do waking. Oh,
-the blissful rest of last night! How I slept, with that dear, good
-Dr. Seward watching me. And tonight I shall not fear to sleep, since
-he is close at hand and within call. Thank everybody for being so
-good to me. Thank God! Goodnight Arthur.
-
-
-
-DR. SEWARD'S DIARY
-
-10 September.--I was conscious of the Professor's hand on my head, and
-started awake all in a second. That is one of the things that we
-learn in an asylum, at any rate.
-
-"And how is our patient?"
-
-"Well, when I left her, or rather when she left me," I answered.
-
-"Come, let us see," he said. And together we went into the room.
-
-The blind was down, and I went over to raise it gently, whilst Van
-Helsing stepped, with his soft, cat-like tread, over to the bed.
-
-As I raised the blind, and the morning sunlight flooded the room, I
-heard the Professor's low hiss of inspiration, and knowing its rarity,
-a deadly fear shot through my heart. As I passed over he moved back,
-and his exclamation of horror, "Gott in Himmel!" needed no enforcement
-from his agonized face. He raised his hand and pointed to the bed,
-and his iron face was drawn and ashen white. I felt my knees begin to
-tremble.
-
-There on the bed, seemingly in a swoon, lay poor Lucy, more horribly
-white and wan-looking than ever. Even the lips were white, and the
-gums seemed to have shrunken back from the teeth, as we sometimes see
-in a corpse after a prolonged illness.
-
-Van Helsing raised his foot to stamp in anger, but the instinct of his
-life and all the long years of habit stood to him, and he put it down
-again softly.
-
-"Quick!" he said. "Bring the brandy."
-
-I flew to the dining room, and returned with the decanter. He wetted
-the poor white lips with it, and together we rubbed palm and wrist and
-heart. He felt her heart, and after a few moments of agonizing
-suspense said,
-
-"It is not too late. It beats, though but feebly. All our work is
-undone. We must begin again. There is no young Arthur here now. I
-have to call on you yourself this time, friend John." As he spoke, he
-was dipping into his bag, and producing the instruments of
-transfusion. I had taken off my coat and rolled up my shirt sleeve.
-There was no possibility of an opiate just at present, and no need of
-one; and so, without a moment's delay, we began the operation.
-
-After a time, it did not seem a short time either, for the draining
-away of one's blood, no matter how willingly it be given, is a
-terrible feeling, Van Helsing held up a warning finger. "Do not
-stir," he said. "But I fear that with growing strength she may wake,
-and that would make danger, oh, so much danger. But I shall
-precaution take. I shall give hypodermic injection of morphia." He
-proceeded then, swiftly and deftly, to carry out his intent.
-
-The effect on Lucy was not bad, for the faint seemed to merge subtly
-into the narcotic sleep. It was with a feeling of personal pride that
-I could see a faint tinge of colour steal back into the pallid cheeks
-and lips. No man knows, till he experiences it, what it is to feel
-his own lifeblood drawn away into the veins of the woman he loves.
-
-The Professor watched me critically. "That will do," he said.
-"Already?" I remonstrated. "You took a great deal more from Art." To
-which he smiled a sad sort of smile as he replied,
-
-"He is her lover, her fiance. You have work, much work to do for her
-and for others, and the present will suffice."
-
-When we stopped the operation, he attended to Lucy, whilst I applied
-digital pressure to my own incision. I laid down, while I waited his
-leisure to attend to me, for I felt faint and a little sick. By and
-by he bound up my wound, and sent me downstairs to get a glass of wine
-for myself. As I was leaving the room, he came after me, and half
-whispered.
-
-"Mind, nothing must be said of this. If our young lover should turn
-up unexpected, as before, no word to him. It would at once frighten
-him and enjealous him, too. There must be none. So!"
-
-When I came back he looked at me carefully, and then said, "You are
-not much the worse. Go into the room, and lie on your sofa, and rest
-awhile, then have much breakfast and come here to me."
-
-I followed out his orders, for I knew how right and wise they were. I
-had done my part, and now my next duty was to keep up my strength. I
-felt very weak, and in the weakness lost something of the amazement at
-what had occurred. I fell asleep on the sofa, however, wondering over
-and over again how Lucy had made such a retrograde movement, and how
-she could have been drained of so much blood with no sign any where to
-show for it. I think I must have continued my wonder in my dreams,
-for, sleeping and waking my thoughts always came back to the little
-punctures in her throat and the ragged, exhausted appearance of their
-edges, tiny though they were.
-
-Lucy slept well into the day, and when she woke she was fairly well
-and strong, though not nearly so much so as the day before. When Van
-Helsing had seen her, he went out for a walk, leaving me in charge,
-with strict injunctions that I was not to leave her for a moment. I
-could hear his voice in the hall, asking the way to the nearest
-telegraph office.
-
-Lucy chatted with me freely, and seemed quite unconscious that
-anything had happened. I tried to keep her amused and interested.
-When her mother came up to see her, she did not seem to notice any
-change whatever, but said to me gratefully,
-
-"We owe you so much, Dr. Seward, for all you have done, but you really
-must now take care not to overwork yourself. You are looking pale
-yourself. You want a wife to nurse and look after you a bit, that you
-do!" As she spoke, Lucy turned crimson, though it was only
-momentarily, for her poor wasted veins could not stand for long an
-unwonted drain to the head. The reaction came in excessive pallor as
-she turned imploring eyes on me. I smiled and nodded, and laid my
-finger on my lips. With a sigh, she sank back amid her pillows.
-
-Van Helsing returned in a couple of hours, and presently said to me:
-"Now you go home, and eat much and drink enough. Make yourself
-strong. I stay here tonight, and I shall sit up with little miss
-myself. You and I must watch the case, and we must have none other to
-know. I have grave reasons. No, do not ask me. Think what you will.
-Do not fear to think even the most not-improbable. Goodnight."
-
-In the hall two of the maids came to me, and asked if they or either
-of them might not sit up with Miss Lucy. They implored me to let
-them, and when I said it was Dr. Van Helsing's wish that either he or
-I should sit up, they asked me quite piteously to intercede with
-the 'foreign gentleman'. I was much touched by their kindness. Perhaps
-it is because I am weak at present, and perhaps because it was on
-Lucy's account, that their devotion was manifested. For over and over
-again have I seen similar instances of woman's kindness. I got back
-here in time for a late dinner, went my rounds, all well, and set this
-down whilst waiting for sleep. It is coming.
-
-
-11 September.--This afternoon I went over to Hillingham. Found Van
-Helsing in excellent spirits, and Lucy much better. Shortly after I
-had arrived, a big parcel from abroad came for the Professor. He
-opened it with much impressment, assumed, of course, and showed a
-great bundle of white flowers.
-
-"These are for you, Miss Lucy," he said.
-
-"For me? Oh, Dr. Van Helsing!"
-
-"Yes, my dear, but not for you to play with. These are medicines."
-Here Lucy made a wry face. "Nay, but they are not to take in a
-decoction or in nauseous form, so you need not snub that so charming
-nose, or I shall point out to my friend Arthur what woes he may have
-to endure in seeing so much beauty that he so loves so much distort.
-Aha, my pretty miss, that bring the so nice nose all straight again.
-This is medicinal, but you do not know how. I put him in your window,
-I make pretty wreath, and hang him round your neck, so you sleep well.
-Oh, yes! They, like the lotus flower, make your trouble forgotten.
-It smell so like the waters of Lethe, and of that fountain of youth
-that the Conquistadores sought for in the Floridas, and find him all
-too late."
-
-Whilst he was speaking, Lucy had been examining the flowers and
-smelling them. Now she threw them down saying, with half laughter,
-and half disgust,
-
-"Oh, Professor, I believe you are only putting up a joke on me. Why,
-these flowers are only common garlic."
-
-To my surprise, Van Helsing rose up and said with all his sternness,
-his iron jaw set and his bushy eyebrows meeting,
-
-"No trifling with me! I never jest! There is grim purpose in what I
-do, and I warn you that you do not thwart me. Take care, for the sake
-of others if not for your own." Then seeing poor Lucy scared, as she
-might well be, he went on more gently, "Oh, little miss, my dear, do
-not fear me. I only do for your good, but there is much virtue to you
-in those so common flowers. See, I place them myself in your room. I
-make myself the wreath that you are to wear. But hush! No telling to
-others that make so inquisitive questions. We must obey, and silence
-is a part of obedience, and obedience is to bring you strong and well
-into loving arms that wait for you. Now sit still a while. Come with
-me, friend John, and you shall help me deck the room with my garlic,
-which is all the way from Haarlem, where my friend Vanderpool raise
-herb in his glass houses all the year. I had to telegraph yesterday,
-or they would not have been here."
-
-We went into the room, taking the flowers with us. The Professor's
-actions were certainly odd and not to be found in any pharmacopeia
-that I ever heard of. First he fastened up the windows and latched
-them securely. Next, taking a handful of the flowers, he rubbed them
-all over the sashes, as though to ensure that every whiff of air that
-might get in would be laden with the garlic smell. Then with the wisp
-he rubbed all over the jamb of the door, above, below, and at each
-side, and round the fireplace in the same way. It all seemed
-grotesque to me, and presently I said, "Well, Professor, I know you
-always have a reason for what you do, but this certainly puzzles me.
-It is well we have no sceptic here, or he would say that you were
-working some spell to keep out an evil spirit."
-
-"Perhaps I am!" he answered quietly as he began to make the wreath
-which Lucy was to wear round her neck.
-
-We then waited whilst Lucy made her toilet for the night, and when she
-was in bed he came and himself fixed the wreath of garlic round her
-neck. The last words he said to her were,
-
-"Take care you do not disturb it, and even if the room feel close, do
-not tonight open the window or the door."
-
-"I promise," said Lucy. "And thank you both a thousand times for all
-your kindness to me! Oh, what have I done to be blessed with such
-friends?"
-
-As we left the house in my fly, which was waiting, Van Helsing said,
-"Tonight I can sleep in peace, and sleep I want, two nights of travel,
-much reading in the day between, and much anxiety on the day to
-follow, and a night to sit up, without to wink. Tomorrow in the
-morning early you call for me, and we come together to see our pretty
-miss, so much more strong for my 'spell' which I have work. Ho, ho!"
-
-He seemed so confident that I, remembering my own confidence two
-nights before and with the baneful result, felt awe and vague terror.
-It must have been my weakness that made me hesitate to tell it to my
-friend, but I felt it all the more, like unshed tears.
-
-
-
-
-CHAPTER 11
-
-
-LUCY WESTENRA'S DIARY
-
-12 September.--How good they all are to me. I quite love that dear
-Dr. Van Helsing. I wonder why he was so anxious about these flowers.
-He positively frightened me, he was so fierce. And yet he must have
-been right, for I feel comfort from them already. Somehow, I do not
-dread being alone tonight, and I can go to sleep without fear. I
-shall not mind any flapping outside the window. Oh, the terrible
-struggle that I have had against sleep so often of late, the pain of
-sleeplessness, or the pain of the fear of sleep, and with such unknown
-horrors as it has for me! How blessed are some people, whose lives
-have no fears, no dreads, to whom sleep is a blessing that comes
-nightly, and brings nothing but sweet dreams. Well, here I am
-tonight, hoping for sleep, and lying like Ophelia in the play, with
-'virgin crants and maiden strewments.' I never liked garlic before,
-but tonight it is delightful! There is peace in its smell. I feel
-sleep coming already. Goodnight, everybody.
-
-
-
-DR. SEWARD'S DIARY
-
-13 September.--Called at the Berkeley and found Van Helsing, as usual,
-up to time. The carriage ordered from the hotel was waiting. The
-Professor took his bag, which he always brings with him now.
-
-Let all be put down exactly. Van Helsing and I arrived at Hillingham
-at eight o'clock. It was a lovely morning. The bright sunshine and
-all the fresh feeling of early autumn seemed like the completion of
-nature's annual work. The leaves were turning to all kinds of
-beautiful colours, but had not yet begun to drop from the trees. When
-we entered we met Mrs. Westenra coming out of the morning room. She
-is always an early riser. She greeted us warmly and said,
-
-"You will be glad to know that Lucy is better. The dear child is
-still asleep. I looked into her room and saw her, but did not go in,
-lest I should disturb her." The Professor smiled, and looked quite
-jubilant. He rubbed his hands together, and said, "Aha! I thought I
-had diagnosed the case. My treatment is working."
-
-To which she replied, "You must not take all the credit to yourself,
-doctor. Lucy's state this morning is due in part to me."
-
-"How do you mean, ma'am?" asked the Professor.
-
-"Well, I was anxious about the dear child in the night, and went into
-her room. She was sleeping soundly, so soundly that even my coming
-did not wake her. But the room was awfully stuffy. There were a lot
-of those horrible, strong-smelling flowers about everywhere, and she
-had actually a bunch of them round her neck. I feared that the heavy
-odour would be too much for the dear child in her weak state, so I took
-them all away and opened a bit of the window to let in a little fresh
-air. You will be pleased with her, I am sure."
-
-She moved off into her boudoir, where she usually breakfasted early.
-As she had spoken, I watched the Professor's face, and saw it turn
-ashen gray. He had been able to retain his self-command whilst the
-poor lady was present, for he knew her state and how mischievous a
-shock would be. He actually smiled on her as he held open the door
-for her to pass into her room. But the instant she had disappeared he
-pulled me, suddenly and forcibly, into the dining room and closed the
-door.
-
-Then, for the first time in my life, I saw Van Helsing break down. He
-raised his hands over his head in a sort of mute despair, and then
-beat his palms together in a helpless way. Finally he sat down on a
-chair, and putting his hands before his face, began to sob, with loud,
-dry sobs that seemed to come from the very racking of his heart.
-
-Then he raised his arms again, as though appealing to the whole
-universe. "God! God! God!" he said. "What have we done, what has
-this poor thing done, that we are so sore beset? Is there fate
-amongst us still, send down from the pagan world of old, that such
-things must be, and in such way? This poor mother, all unknowing, and
-all for the best as she think, does such thing as lose her daughter
-body and soul, and we must not tell her, we must not even warn her, or
-she die, then both die. Oh, how we are beset! How are all the powers
-of the devils against us!"
-
-Suddenly he jumped to his feet. "Come," he said, "come, we must see and
-act. Devils or no devils, or all the devils at once, it matters not.
-We must fight him all the same." He went to the hall door for his
-bag, and together we went up to Lucy's room.
-
-Once again I drew up the blind, whilst Van Helsing went towards the
-bed. This time he did not start as he looked on the poor face with
-the same awful, waxen pallor as before. He wore a look of stern
-sadness and infinite pity.
-
-"As I expected," he murmured, with that hissing inspiration of his
-which meant so much. Without a word he went and locked the door, and
-then began to set out on the little table the instruments for yet
-another operation of transfusion of blood. I had long ago recognized
-the necessity, and begun to take off my coat, but he stopped me with a
-warning hand. "No!" he said. "Today you must operate. I shall
-provide. You are weakened already." As he spoke he took off his coat
-and rolled up his shirtsleeve.
-
-Again the operation. Again the narcotic. Again some return of colour
-to the ashy cheeks, and the regular breathing of healthy sleep. This
-time I watched whilst Van Helsing recruited himself and rested.
-
-Presently he took an opportunity of telling Mrs. Westenra that she
-must not remove anything from Lucy's room without consulting him.
-That the flowers were of medicinal value, and that the breathing of
-their odour was a part of the system of cure. Then he took over the
-care of the case himself, saying that he would watch this night and
-the next, and would send me word when to come.
-
-After another hour Lucy waked from her sleep, fresh and bright and
-seemingly not much the worse for her terrible ordeal.
-
-What does it all mean? I am beginning to wonder if my long habit of
-life amongst the insane is beginning to tell upon my own brain.
-
-
-
-LUCY WESTENRA'S DIARY
-
-17 September.--Four days and nights of peace. I am getting so strong
-again that I hardly know myself. It is as if I had passed through
-some long nightmare, and had just awakened to see the beautiful
-sunshine and feel the fresh air of the morning around me. I have a
-dim half remembrance of long, anxious times of waiting and fearing,
-darkness in which there was not even the pain of hope to make present
-distress more poignant. And then long spells of oblivion, and the
-rising back to life as a diver coming up through a great press of
-water. Since, however, Dr. Van Helsing has been with me, all this bad
-dreaming seems to have passed away. The noises that used to frighten
-me out of my wits, the flapping against the windows, the distant
-voices which seemed so close to me, the harsh sounds that came from I
-know not where and commanded me to do I know not what, have all
-ceased. I go to bed now without any fear of sleep. I do not even try
-to keep awake. I have grown quite fond of the garlic, and a boxful
-arrives for me every day from Haarlem. Tonight Dr. Van Helsing is
-going away, as he has to be for a day in Amsterdam. But I need not be
-watched. I am well enough to be left alone.
-
-Thank God for Mother's sake, and dear Arthur's, and for all our
-friends who have been so kind! I shall not even feel the change, for
-last night Dr. Van Helsing slept in his chair a lot of the time. I
-found him asleep twice when I awoke. But I did not fear to go to
-sleep again, although the boughs or bats or something flapped almost
-angrily against the window panes.
-
-
-
-
-THE PALL MALL GAZETTE 18 September.
-
-THE ESCAPED WOLF PERILOUS ADVENTURE OF OUR INTERVIEWER
-
-INTERVIEW WITH THE KEEPER IN THE ZOOLOGICAL GARDENS
-
-After many inquiries and almost as many refusals, and perpetually
-using the words 'PALL MALL GAZETTE' as a sort of talisman, I managed
-to find the keeper of the section of the Zoological Gardens in which
-the wolf department is included. Thomas Bilder lives in one of the
-cottages in the enclosure behind the elephant house, and was just
-sitting down to his tea when I found him. Thomas and his wife are
-hospitable folk, elderly, and without children, and if the specimen
-I enjoyed of their hospitality be of the average kind, their lives
-must be pretty comfortable. The keeper would not enter on what he
-called business until the supper was over, and we were all
-satisfied. Then when the table was cleared, and he had lit his
-pipe, he said,
-
-"Now, Sir, you can go on and arsk me what you want. You'll excoose
-me refoosin' to talk of perfeshunal subjucts afore meals. I gives
-the wolves and the jackals and the hyenas in all our section their
-tea afore I begins to arsk them questions."
-
-"How do you mean, ask them questions?" I queried, wishful to get him
-into a talkative humor.
-
-"'Ittin' of them over the 'ead with a pole is one way. Scratchin' of
-their ears in another, when gents as is flush wants a bit of a show-orf
-to their gals. I don't so much mind the fust, the 'ittin of the
-pole part afore I chucks in their dinner, but I waits till they've
-'ad their sherry and kawffee, so to speak, afore I tries on with the
-ear scratchin'. Mind you," he added philosophically, "there's a
-deal of the same nature in us as in them theer animiles. Here's you
-a-comin' and arskin' of me questions about my business, and I that
-grump-like that only for your bloomin' 'arf-quid I'd 'a' seen you
-blowed fust 'fore I'd answer. Not even when you arsked me sarcastic
-like if I'd like you to arsk the Superintendent if you might arsk me
-questions. Without offence did I tell yer to go to 'ell?"
-
-"You did."
-
-"An' when you said you'd report me for usin' obscene language that
-was 'ittin' me over the 'ead. But the 'arf-quid made that all
-right. I weren't a-goin' to fight, so I waited for the food, and
-did with my 'owl as the wolves and lions and tigers does. But, lor'
-love yer 'art, now that the old 'ooman has stuck a chunk of her
-tea-cake in me, an' rinsed me out with her bloomin' old teapot, and I've
-lit hup, you may scratch my ears for all you're worth, and won't
-even get a growl out of me. Drive along with your questions. I
-know what yer a-comin' at, that 'ere escaped wolf."
-
-"Exactly. I want you to give me your view of it. Just tell me how
-it happened, and when I know the facts I'll get you to say what you
-consider was the cause of it, and how you think the whole affair
-will end."
-
-"All right, guv'nor. This 'ere is about the 'ole story.
-That 'ere wolf what we called Bersicker was one of three gray
-ones that came from Norway to Jamrach's, which we bought
-off him four years ago. He was a nice well-behaved wolf,
-that never gave no trouble to talk of. I'm more surprised
-at 'im for wantin' to get out nor any other animile in the
-place. But, there, you can't trust wolves no more nor women."
-
-"Don't you mind him, Sir!" broke in Mrs. Tom, with a cheery
-laugh. "'E's got mindin' the animiles so long that blest
-if he ain't like a old wolf 'isself! But there ain't no
-'arm in 'im."
-
-"Well, Sir, it was about two hours after feedin' yesterday when I
-first hear my disturbance. I was makin' up a litter in the monkey
-house for a young puma which is ill. But when I heard the yelpin'
-and 'owlin' I kem away straight. There was Bersicker a-tearin' like
-a mad thing at the bars as if he wanted to get out. There wasn't
-much people about that day, and close at hand was only one man, a
-tall, thin chap, with a 'ook nose and a pointed beard, with a few
-white hairs runnin' through it. He had a 'ard, cold look and red
-eyes, and I took a sort of mislike to him, for it seemed as if it
-was 'im as they was hirritated at. He 'ad white kid gloves on 'is
-'ands, and he pointed out the animiles to me and says, 'Keeper,
-these wolves seem upset at something.'
-
-"'Maybe it's you,' says I, for I did not like the airs as he
-give 'isself. He didn't get angry, as I 'oped he would, but
-he smiled a kind of insolent smile, with a mouth full of white,
-sharp teeth. 'Oh no, they wouldn't like me,' 'e says.
-
-"'Ow yes, they would,' says I, a-imitatin' of him. 'They
-always like a bone or two to clean their teeth on about tea
-time, which you 'as a bagful.'
-
-"Well, it was a odd thing, but when the animiles see us
-a-talkin' they lay down, and when I went over to Bersicker
-he let me stroke his ears same as ever. That there man kem
-over, and blessed but if he didn't put in his hand and stroke
-the old wolf's ears too!
-
-"'Tyke care,' says I. 'Bersicker is quick.'
-
-"'Never mind,' he says. I'm used to 'em!'
-
-"'Are you in the business yourself?' I says, tyking off my
-'at, for a man what trades in wolves, anceterer, is a good
-friend to keepers.
-
-"'Nom,' says he, 'not exactly in the business, but I 'ave made pets
-of several.' And with that he lifts his 'at as perlite as a lord,
-and walks away. Old Bersicker kep' a-lookin' arter 'im till 'e was
-out of sight, and then went and lay down in a corner and wouldn't
-come hout the 'ole hevening. Well, larst night, so soon as the moon
-was hup, the wolves here all began a-'owling. There warn't nothing
-for them to 'owl at. There warn't no one near, except some one that
-was evidently a-callin' a dog somewheres out back of the gardings in
-the Park road. Once or twice I went out to see that all was right,
-and it was, and then the 'owling stopped. Just before twelve
-o'clock I just took a look round afore turnin' in, an', bust me, but
-when I kem opposite to old Bersicker's cage I see the rails broken
-and twisted about and the cage empty. And that's all I know for
-certing."
-
-"Did any one else see anything?"
-
-"One of our gard'ners was a-comin' 'ome about that time from a
-'armony, when he sees a big gray dog comin' out through the garding
-'edges. At least, so he says, but I don't give much for it myself,
-for if he did 'e never said a word about it to his missis when 'e
-got 'ome, and it was only after the escape of the wolf was made
-known, and we had been up all night a-huntin' of the Park for
-Bersicker, that he remembered seein' anything. My own belief was
-that the 'armony 'ad got into his 'ead."
-
-"Now, Mr. Bilder, can you account in any way for the escape
-of the wolf?"
-
-"Well, Sir," he said, with a suspicious sort of modesty, "I think I
-can, but I don't know as 'ow you'd be satisfied with the theory."
-
-"Certainly I shall. If a man like you, who knows the animals from
-experience, can't hazard a good guess at any rate, who is even to
-try?"
-
-"Well then, Sir, I accounts for it this way. It seems to me that
-'ere wolf escaped--simply because he wanted to get out."
-
-From the hearty way that both Thomas and his wife laughed at the
-joke I could see that it had done service before, and that the whole
-explanation was simply an elaborate sell. I couldn't cope in
-badinage with the worthy Thomas, but I thought I knew a surer way to
-his heart, so I said, "Now, Mr. Bilder, we'll consider that first
-half-sovereign worked off, and this brother of his is waiting to be
-claimed when you've told me what you think will happen."
-
-"Right y'are, Sir," he said briskly. "Ye'll excoose me, I
-know, for a-chaffin' of ye, but the old woman here winked at
-me, which was as much as telling me to go on."
-
-"Well, I never!" said the old lady.
-
-"My opinion is this: that 'ere wolf is a'idin' of, somewheres. The
-gard'ner wot didn't remember said he was a-gallopin' northward
-faster than a horse could go, but I don't believe him, for, yer see,
-Sir, wolves don't gallop no more nor dogs does, they not bein' built
-that way. Wolves is fine things in a storybook, and I dessay when
-they gets in packs and does be chivyin' somethin' that's more
-afeared than they is they can make a devil of a noise and chop it
-up, whatever it is. But, Lor' bless you, in real life a wolf is
-only a low creature, not half so clever or bold as a good dog, and
-not half a quarter so much fight in 'im. This one ain't been used
-to fightin' or even to providin' for hisself, and more like he's
-somewhere round the Park a'hidin' an' a'shiverin' of, and if he
-thinks at all, wonderin' where he is to get his breakfast from. Or
-maybe he's got down some area and is in a coal cellar. My eye,
-won't some cook get a rum start when she sees his green eyes
-a-shinin' at her out of the dark! If he can't get food he's bound to
-look for it, and mayhap he may chance to light on a butcher's shop
-in time. If he doesn't, and some nursemaid goes out walkin' or orf
-with a soldier, leavin' of the hinfant in the perambulator--well,
-then I shouldn't be surprised if the census is one babby the less.
-That's all."
-
-I was handing him the half-sovereign, when something came bobbing up
-against the window, and Mr. Bilder's face doubled its natural length
-with surprise.
-
-"God bless me!" he said. "If there ain't old Bersicker come back by
-'isself!"
-
-He went to the door and opened it, a most unnecessary proceeding it
-seemed to me. I have always thought that a wild animal never looks
-so well as when some obstacle of pronounced durability is between
-us. A personal experience has intensified rather than diminished
-that idea.
-
-After all, however, there is nothing like custom, for neither Bilder
-nor his wife thought any more of the wolf than I should of a dog.
-The animal itself was a peaceful and well-behaved as that father of
-all picture-wolves, Red Riding Hood's quondam friend, whilst moving
-her confidence in masquerade.
-
-The whole scene was a unutterable mixture of comedy and
-pathos. The wicked wolf that for a half a day had
-paralyzed London and set all the children in town shivering
-in their shoes, was there in a sort of penitent mood, and
-was received and petted like a sort of vulpine prodigal
-son. Old Bilder examined him all over with most tender
-solicitude, and when he had finished with his penitent
-said,
-
-"There, I knew the poor old chap would get into some kind of
-trouble. Didn't I say it all along? Here's his head all
-cut and full of broken glass. 'E's been a-gettin' over
-some bloomin' wall or other. It's a shyme that people are
-allowed to top their walls with broken bottles. This 'ere's
-what comes of it. Come along, Bersicker."
-
-He took the wolf and locked him up in a cage, with a piece
-of meat that satisfied, in quantity at any rate, the elementary
-conditions of the fatted calf, and went off to report.
-
-I came off too, to report the only exclusive information
-that is given today regarding the strange escapade at the
-Zoo.
-
-
-
-DR. SEWARD'S DIARY
-
-17 September.--I was engaged after dinner in my study posting up my
-books, which, through press of other work and the many visits to Lucy,
-had fallen sadly into arrear. Suddenly the door was burst open, and
-in rushed my patient, with his face distorted with passion. I was
-thunderstruck, for such a thing as a patient getting of his own accord
-into the Superintendent's study is almost unknown.
-
-Without an instant's notice he made straight at me. He had a dinner
-knife in his hand, and as I saw he was dangerous, I tried to keep the
-table between us. He was too quick and too strong for me, however,
-for before I could get my balance he had struck at me and cut my left
-wrist rather severely.
-
-Before he could strike again, however, I got in my right hand and he
-was sprawling on his back on the floor. My wrist bled freely, and
-quite a little pool trickled on to the carpet. I saw that my friend
-was not intent on further effort, and occupied myself binding up my
-wrist, keeping a wary eye on the prostrate figure all the time. When
-the attendants rushed in, and we turned our attention to him, his
-employment positively sickened me. He was lying on his belly on the
-floor licking up, like a dog, the blood which had fallen from my
-wounded wrist. He was easily secured, and to my surprise, went with
-the attendants quite placidly, simply repeating over and over again,
-"The blood is the life! The blood is the life!"
-
-I cannot afford to lose blood just at present. I have lost too much
-of late for my physical good, and then the prolonged strain of Lucy's
-illness and its horrible phases is telling on me. I am over excited
-and weary, and I need rest, rest, rest. Happily Van Helsing has not
-summoned me, so I need not forego my sleep. Tonight I could not well
-do without it.
-
-
-
-TELEGRAM, VAN HELSING, ANTWERP, TO SEWARD, CARFAX
-
-(Sent to Carfax, Sussex, as no county given, delivered late
-by twenty-two hours.)
-
-17 September.--Do not fail to be at Hilllingham tonight.
-If not watching all the time, frequently visit and see that
-flowers are as placed, very important, do not fail. Shall
-be with you as soon as possible after arrival.
-
-
-
-DR. SEWARD'S DIARY
-
-18 September.--Just off train to London. The arrival of Van
-Helsing's telegram filled me with dismay. A whole night lost,
-and I know by bitter experience what may happen in a night.
-Of course it is possible that all may be well, but what may
-have happened? Surely there is some horrible doom hanging over us
-that every possible accident should thwart us in all we try to do.
-I shall take this cylinder with me, and then I can complete
-my entry on Lucy's phonograph.
-
-
-
-
-MEMORANDUM LEFT BY LUCY WESTENRA
-
-17 September, Night.--I write this and leave it to be seen,
-so that no one may by any chance get into trouble through
-me. This is an exact record of what took place tonight. I
-feel I am dying of weakness, and have barely strength to
-write, but it must be done if I die in the doing.
-
-I went to bed as usual, taking care that the flowers were
-placed as Dr. Van Helsing directed, and soon fell asleep.
-
-I was waked by the flapping at the window, which had begun after
-that sleep-walking on the cliff at Whitby when Mina saved me, and
-which now I know so well. I was not afraid, but I did wish that
-Dr. Seward was in the next room, as Dr. Van Helsing said he would
-be, so that I might have called him. I tried to sleep, but I
-could not. Then there came to me the old fear of sleep, and I
-determined to keep awake. Perversely sleep would try to come then
-when I did not want it. So, as I feared to be alone, I opened my
-door and called out, "Is there anybody there?" There was no
-answer. I was afraid to wake mother, and so closed my door
-again. Then outside in the shrubbery I heard a sort of howl like
-a dog's, but more fierce and deeper. I went to the window and
-looked out, but could see nothing, except a big bat, which had
-evidently been buffeting its wings against the window. So I went
-back to bed again, but determined not to go to sleep. Presently
-the door opened, and mother looked in. Seeing by my moving that
-I was not asleep, she came in and sat by me. She said to me even
-more sweetly and softly than her wont,
-
-"I was uneasy about you, darling, and came in to see that
-you were all right."
-
-I feared she might catch cold sitting there, and asked her
-to come in and sleep with me, so she came into bed, and lay
-down beside me. She did not take off her dressing gown,
-for she said she would only stay a while and then go back
-to her own bed. As she lay there in my arms, and I in hers
-the flapping and buffeting came to the window again. She
-was startled and a little frightened, and cried out, "What
-is that?"
-
-I tried to pacify her, and at last succeeded, and she lay
-quiet. But I could hear her poor dear heart still beating
-terribly. After a while there was the howl again out in
-the shrubbery, and shortly after there was a crash at the
-window, and a lot of broken glass was hurled on the floor.
-The window blind blew back with the wind that rushed in,
-and in the aperture of the broken panes there was the head
-of a great, gaunt gray wolf.
-
-Mother cried out in a fright, and struggled up into a
-sitting posture, and clutched wildly at anything that would
-help her. Amongst other things, she clutched the wreath of
-flowers that Dr. Van Helsing insisted on my wearing round
-my neck, and tore it away from me. For a second or two she
-sat up, pointing at the wolf, and there was a strange and
-horrible gurgling in her throat. Then she fell over, as if
-struck with lightning, and her head hit my forehead and
-made me dizzy for a moment or two.
-
-The room and all round seemed to spin round. I kept my eyes
-fixed on the window, but the wolf drew his head back, and a whole
-myriad of little specks seems to come blowing in through the
-broken window, and wheeling and circling round like the pillar of
-dust that travellers describe when there is a simoon in the
-desert. I tried to stir, but there was some spell upon me, and
-dear Mother's poor body, which seemed to grow cold already, for
-her dear heart had ceased to beat, weighed me down, and I
-remembered no more for a while.
-
-The time did not seem long, but very, very awful, till I
-recovered consciousness again. Somewhere near, a passing
-bell was tolling. The dogs all round the neighbourhood were
-howling, and in our shrubbery, seemingly just outside, a
-nightingale was singing. I was dazed and stupid with pain
-and terror and weakness, but the sound of the nightingale
-seemed like the voice of my dead mother come back to comfort me.
-The sounds seemed to have awakened the maids, too, for I could
-hear their bare feet pattering outside my door. I called to
-them, and they came in, and when they saw what had happened, and
-what it was that lay over me on the bed, they screamed out. The
-wind rushed in through the broken window, and the door slammed
-to. They lifted off the body of my dear mother, and laid her,
-covered up with a sheet, on the bed after I had got up. They
-were all so frightened and nervous that I directed them to go to
-the dining room and each have a glass of wine. The door flew
-open for an instant and closed again. The maids shrieked, and
-then went in a body to the dining room, and I laid what flowers I
-had on my dear mother's breast. When they were there I
-remembered what Dr. Van Helsing had told me, but I didn't like to
-remove them, and besides, I would have some of the servants to
-sit up with me now. I was surprised that the maids did not come
-back. I called them, but got no answer, so I went to the dining
-room to look for them.
-
-My heart sank when I saw what had happened. They all four
-lay helpless on the floor, breathing heavily. The decanter
-of sherry was on the table half full, but there was a queer,
-acrid smell about. I was suspicious, and examined the decanter.
-It smelt of laudanum, and looking on the sideboard, I found that
-the bottle which Mother's doctor uses for her--oh! did use--was
-empty. What am I to do? What am I to do? I am back in the room
-with Mother. I cannot leave her, and I am alone, save for the
-sleeping servants, whom some one has drugged. Alone with the
-dead! I dare not go out, for I can hear the low howl of the wolf
-through the broken window.
-
-The air seems full of specks, floating and circling in the
-draught from the window, and the lights burn blue and dim.
-What am I to do? God shield me from harm this night! I
-shall hide this paper in my breast, where they shall find
-it when they come to lay me out. My dear mother gone! It
-is time that I go too. Goodbye, dear Arthur, if I should
-not survive this night. God keep you, dear, and God help
-me!
-
-
-
-
-CHAPTER 12
-
-
-DR. SEWARD'S DIARY
-
-18 September.--I drove at once to Hillingham and arrived early.
-Keeping my cab at the gate, I went up the avenue alone. I knocked
-gently and rang as quietly as possible, for I feared to disturb Lucy
-or her mother, and hoped to only bring a servant to the door. After a
-while, finding no response, I knocked and rang again, still no
-answer. I cursed the laziness of the servants that they should lie
-abed at such an hour, for it was now ten o'clock, and so rang and
-knocked again, but more impatiently, but still without response.
-Hitherto I had blamed only the servants, but now a terrible fear began
-to assail me. Was this desolation but another link in the chain of
-doom which seemed drawing tight round us? Was it indeed a house of
-death to which I had come, too late? I know that minutes, even
-seconds of delay, might mean hours of danger to Lucy, if she had had
-again one of those frightful relapses, and I went round the house to
-try if I could find by chance an entry anywhere.
-
-I could find no means of ingress. Every window and door was fastened
-and locked, and I returned baffled to the porch. As I did so, I heard
-the rapid pit-pat of a swiftly driven horse's feet. They stopped at
-the gate, and a few seconds later I met Van Helsing running up the
-avenue. When he saw me, he gasped out, "Then it was you, and just
-arrived. How is she? Are we too late? Did you not get my telegram?"
-
-I answered as quickly and coherently as I could that I had only got
-his telegram early in the morning, and had not a minute in coming
-here, and that I could not make any one in the house hear me. He
-paused and raised his hat as he said solemnly, "Then I fear we are too
-late. God's will be done!"
-
-With his usual recuperative energy, he went on, "Come. If there be no
-way open to get in, we must make one. Time is all in all to us now."
-
-We went round to the back of the house, where there was a kitchen
-window. The Professor took a small surgical saw from his case, and
-handing it to me, pointed to the iron bars which guarded the window.
-I attacked them at once and had very soon cut through three of them.
-Then with a long, thin knife we pushed back the fastening of the
-sashes and opened the window. I helped the Professor in, and followed
-him. There was no one in the kitchen or in the servants' rooms, which
-were close at hand. We tried all the rooms as we went along, and in
-the dining room, dimly lit by rays of light through the shutters,
-found four servant women lying on the floor. There was no need to
-think them dead, for their stertorous breathing and the acrid smell of
-laudanum in the room left no doubt as to their condition.
-
-Van Helsing and I looked at each other, and as we moved away he said,
-"We can attend to them later." Then we ascended to Lucy's room. For an
-instant or two we paused at the door to listen, but there was no sound
-that we could hear. With white faces and trembling hands, we opened
-the door gently, and entered the room.
-
-How shall I describe what we saw? On the bed lay two women, Lucy and
-her mother. The latter lay farthest in, and she was covered with a
-white sheet, the edge of which had been blown back by the drought
-through the broken window, showing the drawn, white, face, with a look
-of terror fixed upon it. By her side lay Lucy, with face white and
-still more drawn. The flowers which had been round her neck we found
-upon her mother's bosom, and her throat was bare, showing the two
-little wounds which we had noticed before, but looking horribly white
-and mangled. Without a word the Professor bent over the bed, his head
-almost touching poor Lucy's breast. Then he gave a quick turn of his
-head, as of one who listens, and leaping to his feet, he cried out to
-me, "It is not yet too late! Quick! Quick! Bring the brandy!"
-
-I flew downstairs and returned with it, taking care to smell and taste
-it, lest it, too, were drugged like the decanter of sherry which I
-found on the table. The maids were still breathing, but more
-restlessly, and I fancied that the narcotic was wearing off. I did
-not stay to make sure, but returned to Van Helsing. He rubbed the
-brandy, as on another occasion, on her lips and gums and on her wrists
-and the palms of her hands. He said to me, "I can do this, all that
-can be at the present. You go wake those maids. Flick them in the
-face with a wet towel, and flick them hard. Make them get heat and
-fire and a warm bath. This poor soul is nearly as cold as that beside
-her. She will need be heated before we can do anything more."
-
-I went at once, and found little difficulty in waking three of the
-women. The fourth was only a young girl, and the drug had evidently
-affected her more strongly so I lifted her on the sofa and let her
-sleep.
-
-The others were dazed at first, but as remembrance came back to them
-they cried and sobbed in a hysterical manner. I was stern with them,
-however, and would not let them talk. I told them that one life was
-bad enough to lose, and if they delayed they would sacrifice Miss
-Lucy. So, sobbing and crying they went about their way, half clad as
-they were, and prepared fire and water. Fortunately, the kitchen and
-boiler fires were still alive, and there was no lack of hot water. We
-got a bath and carried Lucy out as she was and placed her in it.
-Whilst we were busy chafing her limbs there was a knock at the hall
-door. One of the maids ran off, hurried on some more clothes, and
-opened it. Then she returned and whispered to us that there was a
-gentleman who had come with a message from Mr. Holmwood. I bade her
-simply tell him that he must wait, for we could see no one now. She
-went away with the message, and, engrossed with our work, I clean
-forgot all about him.
-
-I never saw in all my experience the Professor work in such deadly
-earnest. I knew, as he knew, that it was a stand-up fight with death,
-and in a pause told him so. He answered me in a way that I did not
-understand, but with the sternest look that his face could wear.
-
-"If that were all, I would stop here where we are now, and let her
-fade away into peace, for I see no light in life over her horizon." He
-went on with his work with, if possible, renewed and more frenzied
-vigour.
-
-Presently we both began to be conscious that the heat was beginning to
-be of some effect. Lucy's heart beat a trifle more audibly to the
-stethoscope, and her lungs had a perceptible movement. Van Helsing's
-face almost beamed, and as we lifted her from the bath and rolled her
-in a hot sheet to dry her he said to me, "The first gain is ours!
-Check to the King!"
-
-We took Lucy into another room, which had by now been prepared, and
-laid her in bed and forced a few drops of brandy down her throat. I
-noticed that Van Helsing tied a soft silk handkerchief round her
-throat. She was still unconscious, and was quite as bad as, if not
-worse than, we had ever seen her.
-
-Van Helsing called in one of the women, and told her to stay with her
-and not to take her eyes off her till we returned, and then beckoned
-me out of the room.
-
-"We must consult as to what is to be done," he said as we descended
-the stairs. In the hall he opened the dining room door, and we passed
-in, he closing the door carefully behind him. The shutters had been
-opened, but the blinds were already down, with that obedience to the
-etiquette of death which the British woman of the lower classes always
-rigidly observes. The room was, therefore, dimly dark. It was,
-however, light enough for our purposes. Van Helsing's sternness was
-somewhat relieved by a look of perplexity. He was evidently torturing
-his mind about something, so I waited for an instant, and he spoke.
-
-"What are we to do now? Where are we to turn for help? We must have
-another transfusion of blood, and that soon, or that poor girl's life
-won't be worth an hour's purchase. You are exhausted already. I am
-exhausted too. I fear to trust those women, even if they would have
-courage to submit. What are we to do for some one who will open his
-veins for her?"
-
-"What's the matter with me, anyhow?"
-
-The voice came from the sofa across the room, and its tones brought
-relief and joy to my heart, for they were those of Quincey Morris.
-
-Van Helsing started angrily at the first sound, but his face softened
-and a glad look came into his eyes as I cried out, "Quincey Morris!"
-and rushed towards him with outstretched hands.
-
-"What brought you here?" I cried as our hands met.
-
-"I guess Art is the cause."
-
-He handed me a telegram.--'Have not heard from Seward for three days,
-and am terribly anxious. Cannot leave. Father still in same
-condition. Send me word how Lucy is. Do not delay.--Holmwood.'
-
-"I think I came just in the nick of time. You know you have only to
-tell me what to do."
-
-Van Helsing strode forward, and took his hand, looking him straight in
-the eyes as he said, "A brave man's blood is the best thing on this
-earth when a woman is in trouble. You're a man and no mistake. Well,
-the devil may work against us for all he's worth, but God sends us men
-when we want them."
-
-Once again we went through that ghastly operation. I have not the
-heart to go through with the details. Lucy had got a terrible shock
-and it told on her more than before, for though plenty of blood went
-into her veins, her body did not respond to the treatment as well as
-on the other occasions. Her struggle back into life was something
-frightful to see and hear. However, the action of both heart and
-lungs improved, and Van Helsing made a sub-cutaneous injection of
-morphia, as before, and with good effect. Her faint became a profound
-slumber. The Professor watched whilst I went downstairs with Quincey
-Morris, and sent one of the maids to pay off one of the cabmen who
-were waiting.
-
-I left Quincey lying down after having a glass of wine, and told the
-cook to get ready a good breakfast. Then a thought struck me, and I
-went back to the room where Lucy now was. When I came softly in, I
-found Van Helsing with a sheet or two of note paper in his hand. He
-had evidently read it, and was thinking it over as he sat with his
-hand to his brow. There was a look of grim satisfaction in his face,
-as of one who has had a doubt solved. He handed me the paper saying
-only, "It dropped from Lucy's breast when we carried her to the bath."
-
-When I had read it, I stood looking at the Professor, and after a
-pause asked him, "In God's name, what does it all mean? Was she, or
-is she, mad, or what sort of horrible danger is it?" I was so
-bewildered that I did not know what to say more. Van Helsing put out
-his hand and took the paper, saying,
-
-"Do not trouble about it now. Forget it for the present. You shall
-know and understand it all in good time, but it will be later. And
-now what is it that you came to me to say?" This brought me back to
-fact, and I was all myself again.
-
-"I came to speak about the certificate of death. If we do not act
-properly and wisely, there may be an inquest, and that paper would
-have to be produced. I am in hopes that we need have no inquest, for
-if we had it would surely kill poor Lucy, if nothing else did. I
-know, and you know, and the other doctor who attended her knows, that
-Mrs. Westenra had disease of the heart, and we can certify that she
-died of it. Let us fill up the certificate at once, and I shall take
-it myself to the registrar and go on to the undertaker."
-
-"Good, oh my friend John! Well thought of! Truly Miss Lucy, if she
-be sad in the foes that beset her, is at least happy in the friends
-that love her. One, two, three, all open their veins for her, besides
-one old man. Ah, yes, I know, friend John. I am not blind! I love
-you all the more for it! Now go."
-
-In the hall I met Quincey Morris, with a telegram for Arthur telling
-him that Mrs. Westenra was dead, that Lucy also had been ill, but was
-now going on better, and that Van Helsing and I were with her. I told
-him where I was going, and he hurried me out, but as I was going said,
-
-"When you come back, Jack, may I have two words with you all to
-ourselves?" I nodded in reply and went out. I found no difficulty
-about the registration, and arranged with the local undertaker to come
-up in the evening to measure for the coffin and to make arrangements.
-
-When I got back Quincey was waiting for me. I told him I would see
-him as soon as I knew about Lucy, and went up to her room. She was
-still sleeping, and the Professor seemingly had not moved from his
-seat at her side. From his putting his finger to his lips, I gathered
-that he expected her to wake before long and was afraid of
-fore-stalling nature. So I went down to Quincey and took him into the
-breakfast room, where the blinds were not drawn down, and which was a
-little more cheerful, or rather less cheerless, than the other rooms.
-
-When we were alone, he said to me, "Jack Seward, I don't want to shove
-myself in anywhere where I've no right to be, but this is no ordinary
-case. You know I loved that girl and wanted to marry her, but
-although that's all past and gone, I can't help feeling anxious about
-her all the same. What is it that's wrong with her? The Dutchman,
-and a fine old fellow he is, I can see that, said that time you two
-came into the room, that you must have another transfusion of blood,
-and that both you and he were exhausted. Now I know well that you
-medical men speak in camera, and that a man must not expect to know
-what they consult about in private. But this is no common matter, and
-whatever it is, I have done my part. Is not that so?"
-
-"That's so," I said, and he went on.
-
-"I take it that both you and Van Helsing had done already what I did
-today. Is not that so?"
-
-"That's so."
-
-"And I guess Art was in it too. When I saw him four days ago down at
-his own place he looked queer. I have not seen anything pulled down
-so quick since I was on the Pampas and had a mare that I was fond of
-go to grass all in a night. One of those big bats that they call
-vampires had got at her in the night, and what with his gorge and the
-vein left open, there wasn't enough blood in her to let her stand up,
-and I had to put a bullet through her as she lay. Jack, if you may
-tell me without betraying confidence, Arthur was the first, is not
-that so?"
-
-As he spoke the poor fellow looked terribly anxious. He was in a
-torture of suspense regarding the woman he loved, and his utter
-ignorance of the terrible mystery which seemed to surround her
-intensified his pain. His very heart was bleeding, and it took all
-the manhood of him, and there was a royal lot of it, too, to keep him
-from breaking down. I paused before answering, for I felt that I must
-not betray anything which the Professor wished kept secret, but
-already he knew so much, and guessed so much, that there could be no
-reason for not answering, so I answered in the same phrase.
-
-"That's so."
-
-"And how long has this been going on?"
-
-"About ten days."
-
-"Ten days! Then I guess, Jack Seward, that that poor pretty creature
-that we all love has had put into her veins within that time the blood
-of four strong men. Man alive, her whole body wouldn't hold it." Then
-coming close to me, he spoke in a fierce half-whisper. "What took it
-out?"
-
-I shook my head. "That," I said, "is the crux. Van Helsing is simply
-frantic about it, and I am at my wits' end. I can't even hazard a
-guess. There has been a series of little circumstances which have
-thrown out all our calculations as to Lucy being properly watched.
-But these shall not occur again. Here we stay until all be well, or
-ill."
-
-Quincey held out his hand. "Count me in," he said. "You and the
-Dutchman will tell me what to do, and I'll do it."
-
-When she woke late in the afternoon, Lucy's first movement was to feel
-in her breast, and to my surprise, produced the paper which Van
-Helsing had given me to read. The careful Professor had replaced it
-where it had come from, lest on waking she should be alarmed. Her
-eyes then lit on Van Helsing and on me too, and gladdened. Then she
-looked round the room, and seeing where she was, shuddered. She gave
-a loud cry, and put her poor thin hands before her pale face.
-
-We both understood what was meant, that she had realized to the full
-her mother's death. So we tried what we could to comfort her.
-Doubtless sympathy eased her somewhat, but she was very low in thought
-and spirit, and wept silently and weakly for a long time. We told her
-that either or both of us would now remain with her all the time, and
-that seemed to comfort her. Towards dusk she fell into a doze. Here
-a very odd thing occurred. Whilst still asleep she took the paper
-from her breast and tore it in two. Van Helsing stepped over and took
-the pieces from her. All the same, however, she went on with the
-action of tearing, as though the material were still in her hands.
-Finally she lifted her hands and opened them as though scattering the
-fragments. Van Helsing seemed surprised, and his brows gathered as if
-in thought, but he said nothing.
-
-
-19 September.--All last night she slept fitfully, being always afraid
-to sleep, and something weaker when she woke from it. The Professor
-and I took in turns to watch, and we never left her for a moment
-unattended. Quincey Morris said nothing about his intention, but I
-knew that all night long he patrolled round and round the house.
-
-When the day came, its searching light showed the ravages in poor
-Lucy's strength. She was hardly able to turn her head, and the little
-nourishment which she could take seemed to do her no good. At times
-she slept, and both Van Helsing and I noticed the difference in her,
-between sleeping and waking. Whilst asleep she looked stronger,
-although more haggard, and her breathing was softer. Her open mouth
-showed the pale gums drawn back from the teeth, which looked
-positively longer and sharper than usual. When she woke the softness
-of her eyes evidently changed the expression, for she looked her own
-self, although a dying one. In the afternoon she asked for Arthur,
-and we telegraphed for him. Quincey went off to meet him at the
-station.
-
-When he arrived it was nearly six o'clock, and the sun was setting
-full and warm, and the red light streamed in through the window and
-gave more colour to the pale cheeks. When he saw her, Arthur was
-simply choking with emotion, and none of us could speak. In the hours
-that had passed, the fits of sleep, or the comatose condition that
-passed for it, had grown more frequent, so that the pauses when
-conversation was possible were shortened. Arthur's presence, however,
-seemed to act as a stimulant. She rallied a little, and spoke to him
-more brightly than she had done since we arrived. He too pulled
-himself together, and spoke as cheerily as he could, so that the best
-was made of everything.
-
-It is now nearly one o'clock, and he and Van Helsing are sitting with
-her. I am to relieve them in a quarter of an hour, and I am entering
-this on Lucy's phonograph. Until six o'clock they are to try to rest.
-I fear that tomorrow will end our watching, for the shock has been too
-great. The poor child cannot rally. God help us all.
-
-
-
-
-LETTER MINA HARKER TO LUCY WESTENRA
-
-(Unopened by her)
-
-17 September
-
-My dearest Lucy,
-
-"It seems an age since I heard from you, or indeed since I
-wrote. You will pardon me, I know, for all my faults when
-you have read all my budget of news. Well, I got my husband back
-all right. When we arrived at Exeter there was a carriage
-waiting for us, and in it, though he had an attack of gout, Mr.
-Hawkins. He took us to his house, where there were rooms for us
-all nice and comfortable, and we dined together. After dinner
-Mr. Hawkins said,
-
-"'My dears, I want to drink your health and prosperity, and
-may every blessing attend you both. I know you both from
-children, and have, with love and pride, seen you grow up.
-Now I want you to make your home here with me. I have left
-to me neither chick nor child. All are gone, and in my
-will I have left you everything.' I cried, Lucy dear, as
-Jonathan and the old man clasped hands. Our evening was a
-very, very happy one.
-
-"So here we are, installed in this beautiful old house, and
-from both my bedroom and the drawing room I can see the
-great elms of the cathedral close, with their great black
-stems standing out against the old yellow stone of the cathedral,
-and I can hear the rooks overhead cawing and cawing and
-chattering and chattering and gossiping all day, after the manner
-of rooks--and humans. I am busy, I need not tell you, arranging
-things and housekeeping. Jonathan and Mr. Hawkins are busy all
-day, for now that Jonathan is a partner, Mr. Hawkins wants to
-tell him all about the clients.
-
-"How is your dear mother getting on? I wish I could run up
-to town for a day or two to see you, dear, but I dare not
-go yet, with so much on my shoulders, and Jonathan wants
-looking after still. He is beginning to put some flesh on
-his bones again, but he was terribly weakened by the long
-illness. Even now he sometimes starts out of his sleep in
-a sudden way and awakes all trembling until I can coax him
-back to his usual placidity. However, thank God, these
-occasions grow less frequent as the days go on, and they
-will in time pass away altogether, I trust. And now I have
-told you my news, let me ask yours. When are you to be
-married, and where, and who is to perform the ceremony, and
-what are you to wear, and is it to be a public or private
-wedding? Tell me all about it, dear, tell me all about
-everything, for there is nothing which interests you which
-will not be dear to me. Jonathan asks me to send his 'respectful
-duty', but I do not think that is good enough from the junior
-partner of the important firm Hawkins & Harker. And so, as you
-love me, and he loves me, and I love you with all the moods and
-tenses of the verb, I send you simply his 'love' instead.
-Goodbye, my dearest Lucy, and blessings on you.
-
-"Yours,
-
-"Mina Harker"
-
-
-
-REPORT FROM PATRICK HENNESSEY, MD, MRCSLK, QCPI, ETC, ETC,
-TO JOHN SEWARD, MD
-
-20 September
-
-My dear Sir:
-
-"In accordance with your wishes, I enclose report of the
-conditions of everything left in my charge. With regard to
-patient, Renfield, there is more to say. He has had another
-outbreak, which might have had a dreadful ending, but which, as
-it fortunately happened, was unattended with any unhappy results.
-This afternoon a carrier's cart with two men made a call at the
-empty house whose grounds abut on ours, the house to which, you
-will remember, the patient twice ran away. The men stopped at
-our gate to ask the porter their way, as they were strangers.
-
-"I was myself looking out of the study window, having a
-smoke after dinner, and saw one of them come up to the
-house. As he passed the window of Renfield's room, the
-patient began to rate him from within, and called him all
-the foul names he could lay his tongue to. The man, who
-seemed a decent fellow enough, contented himself by telling
-him to 'shut up for a foul-mouthed beggar', whereon our man
-accused him of robbing him and wanting to murder him and
-said that he would hinder him if he were to swing for it.
-I opened the window and signed to the man not to notice, so
-he contented himself after looking the place over and making up
-his mind as to what kind of place he had got to by saying, 'Lor'
-bless yer, sir, I wouldn't mind what was said to me in a bloomin'
-madhouse. I pity ye and the guv'nor for havin' to live in the
-house with a wild beast like that.'
-
-"Then he asked his way civilly enough, and I told him where
-the gate of the empty house was. He went away followed by
-threats and curses and revilings from our man. I went down
-to see if I could make out any cause for his anger, since
-he is usually such a well-behaved man, and except his violent
-fits nothing of the kind had ever occurred. I found him, to my
-astonishment, quite composed and most genial in his manner. I
-tried to get him to talk of the incident, but he blandly asked me
-questions as to what I meant, and led me to believe that he was
-completely oblivious of the affair. It was, I am sorry to say,
-however, only another instance of his cunning, for within half an
-hour I heard of him again. This time he had broken out through
-the window of his room, and was running down the avenue. I
-called to the attendants to follow me, and ran after him, for I
-feared he was intent on some mischief. My fear was justified
-when I saw the same cart which had passed before coming down the
-road, having on it some great wooden boxes. The men were wiping
-their foreheads, and were flushed in the face, as if with violent
-exercise. Before I could get up to him, the patient rushed at
-them, and pulling one of them off the cart, began to knock his
-head against the ground. If I had not seized him just at the
-moment, I believe he would have killed the man there and then.
-The other fellow jumped down and struck him over the head with
-the butt end of his heavy whip. It was a horrible blow, but he
-did not seem to mind it, but seized him also, and struggled with
-the three of us, pulling us to and fro as if we were kittens.
-You know I am no lightweight, and the others were both burly men.
-At first he was silent in his fighting, but as we began to master
-him, and the attendants were putting a strait waistcoat on him,
-he began to shout, 'I'll frustrate them! They shan't rob me!
-They shan't murder me by inches! I'll fight for my Lord and
-Master!' and all sorts of similar incoherent ravings. It was
-with very considerable difficulty that they got him back to the
-house and put him in the padded room. One of the attendants,
-Hardy, had a finger broken. However, I set it all right, and he
-is going on well.
-
-"The two carriers were at first loud in their threats of
-actions for damages, and promised to rain all the penalties
-of the law on us. Their threats were, however, mingled
-with some sort of indirect apology for the defeat of the
-two of them by a feeble madman. They said that if it had
-not been for the way their strength had been spent in carrying
-and raising the heavy boxes to the cart they would have made
-short work of him. They gave as another reason for their defeat
-the extraordinary state of drouth to which they had been reduced
-by the dusty nature of their occupation and the reprehensible
-distance from the scene of their labors of any place of public
-entertainment. I quite understood their drift, and after a stiff
-glass of strong grog, or rather more of the same, and with each a
-sovereign in hand, they made light of the attack, and swore that
-they would encounter a worse madman any day for the pleasure of
-meeting so 'bloomin' good a bloke' as your correspondent. I took
-their names and addresses, in case they might be needed. They
-are as follows: Jack Smollet, of Dudding's Rents, King George's
-Road, Great Walworth, and Thomas Snelling, Peter Farley's Row,
-Guide Court, Bethnal Green. They are both in the employment of
-Harris & Sons, Moving and Shipment Company, Orange Master's Yard,
-Soho.
-
-"I shall report to you any matter of interest occurring here, and
-shall wire you at once if there is anything of importance.
-
-"Believe me, dear Sir,
-
-"Yours faithfully,
-
-"Patrick Hennessey."
-
-
-
-LETTER, MINA HARKER TO LUCY WESTENRA (Unopened by her)
-
-18 September
-
-"My dearest Lucy,
-
-"Such a sad blow has befallen us. Mr. Hawkins has died very
-suddenly. Some may not think it so sad for us, but we had
-both come to so love him that it really seems as though we
-had lost a father. I never knew either father or mother,
-so that the dear old man's death is a real blow to me. Jonathan
-is greatly distressed. It is not only that he feels sorrow, deep
-sorrow, for the dear, good man who has befriended him all his
-life, and now at the end has treated him like his own son and
-left him a fortune which to people of our modest bringing up is
-wealth beyond the dream of avarice, but Jonathan feels it on
-another account. He says the amount of responsibility which it
-puts upon him makes him nervous. He begins to doubt himself. I
-try to cheer him up, and my belief in him helps him to have a
-belief in himself. But it is here that the grave shock that he
-experienced tells upon him the most. Oh, it is too hard that a
-sweet, simple, noble, strong nature such as his, a nature which
-enabled him by our dear, good friend's aid to rise from clerk to
-master in a few years, should be so injured that the very essence
-of its strength is gone. Forgive me, dear, if I worry you with my
-troubles in the midst of your own happiness, but Lucy dear, I
-must tell someone, for the strain of keeping up a brave and
-cheerful appearance to Jonathan tries me, and I have no one here
-that I can confide in. I dread coming up to London, as we must
-do that day after tomorrow, for poor Mr. Hawkins left in his will
-that he was to be buried in the grave with his father. As there
-are no relations at all, Jonathan will have to be chief mourner.
-I shall try to run over to see you, dearest, if only for a few
-minutes. Forgive me for troubling you. With all blessings,
-
-"Your loving
-
-"Mina Harker"
-
-
-
-DR. SEWARD'S DIARY
-
-20 September.--Only resolution and habit can let me make an entry
-tonight. I am too miserable, too low spirited, too sick of the world
-and all in it, including life itself, that I would not care if I heard
-this moment the flapping of the wings of the angel of death. And he
-has been flapping those grim wings to some purpose of late, Lucy's
-mother and Arthur's father, and now . . . Let me get on with my work.
-
-I duly relieved Van Helsing in his watch over Lucy. We wanted Arthur
-to go to rest also, but he refused at first. It was only when I told
-him that we should want him to help us during the day, and that we
-must not all break down for want of rest, lest Lucy should suffer,
-that he agreed to go.
-
-Van Helsing was very kind to him. "Come, my child," he said. "Come
-with me. You are sick and weak, and have had much sorrow and much
-mental pain, as well as that tax on your strength that we know of.
-You must not be alone, for to be alone is to be full of fears and
-alarms. Come to the drawing room, where there is a big fire, and
-there are two sofas. You shall lie on one, and I on the other, and
-our sympathy will be comfort to each other, even though we do not
-speak, and even if we sleep."
-
-Arthur went off with him, casting back a longing look on Lucy's face,
-which lay in her pillow, almost whiter than the lawn. She lay quite
-still, and I looked around the room to see that all was as it should
-be. I could see that the Professor had carried out in this room, as
-in the other, his purpose of using the garlic. The whole of the
-window sashes reeked with it, and round Lucy's neck, over the silk
-handkerchief which Van Helsing made her keep on, was a rough chaplet
-of the same odorous flowers.
-
-Lucy was breathing somewhat stertorously, and her face was at its
-worst, for the open mouth showed the pale gums. Her teeth, in the
-dim, uncertain light, seemed longer and sharper than they had been in
-the morning. In particular, by some trick of the light, the canine
-teeth looked longer and sharper than the rest.
-
-I sat down beside her, and presently she moved uneasily. At the same
-moment there came a sort of dull flapping or buffeting at the window.
-I went over to it softly, and peeped out by the corner of the blind.
-There was a full moonlight, and I could see that the noise was made by
-a great bat, which wheeled around, doubtless attracted by the light,
-although so dim, and every now and again struck the window with its
-wings. When I came back to my seat, I found that Lucy had moved
-slightly, and had torn away the garlic flowers from her throat. I
-replaced them as well as I could, and sat watching her.
-
-Presently she woke, and I gave her food, as Van Helsing had
-prescribed. She took but a little, and that languidly. There did not
-seem to be with her now the unconscious struggle for life and strength
-that had hitherto so marked her illness. It struck me as curious that
-the moment she became conscious she pressed the garlic flowers close
-to her. It was certainly odd that whenever she got into that
-lethargic state, with the stertorous breathing, she put the flowers
-from her, but that when she waked she clutched them close. There was
-no possibility of making any mistake about this, for in the long hours
-that followed, she had many spells of sleeping and waking and repeated
-both actions many times.
-
-At six o'clock Van Helsing came to relieve me. Arthur had then fallen
-into a doze, and he mercifully let him sleep on. When he saw Lucy's
-face I could hear the hissing indraw of breath, and he said to me in a
-sharp whisper. "Draw up the blind. I want light!" Then he bent down,
-and, with his face almost touching Lucy's, examined her carefully. He
-removed the flowers and lifted the silk handkerchief from her throat.
-As he did so he started back and I could hear his ejaculation, "Mein
-Gott!" as it was smothered in his throat. I bent over and looked,
-too, and as I noticed some queer chill came over me. The wounds on
-the throat had absolutely disappeared.
-
-For fully five minutes Van Helsing stood looking at her, with his face
-at its sternest. Then he turned to me and said calmly, "She is
-dying. It will not be long now. It will be much difference, mark me,
-whether she dies conscious or in her sleep. Wake that poor boy, and
-let him come and see the last. He trusts us, and we have promised
-him."
-
-I went to the dining room and waked him. He was dazed for a moment,
-but when he saw the sunlight streaming in through the edges of the
-shutters he thought he was late, and expressed his fear. I assured
-him that Lucy was still asleep, but told him as gently as I could that
-both Van Helsing and I feared that the end was near. He covered his
-face with his hands, and slid down on his knees by the sofa, where he
-remained, perhaps a minute, with his head buried, praying, whilst his
-shoulders shook with grief. I took him by the hand and raised him up.
-"Come," I said, "my dear old fellow, summon all your fortitude. It
-will be best and easiest for her."
-
-When we came into Lucy's room I could see that Van Helsing had, with
-his usual forethought, been putting matters straight and making
-everything look as pleasing as possible. He had even brushed Lucy's
-hair, so that it lay on the pillow in its usual sunny ripples. When
-we came into the room she opened her eyes, and seeing him, whispered
-softly, "Arthur! Oh, my love, I am so glad you have come!"
-
-He was stooping to kiss her, when Van Helsing motioned him back.
-"No," he whispered, "not yet! Hold her hand, it will comfort her
-more."
-
-So Arthur took her hand and knelt beside her, and she looked her best,
-with all the soft lines matching the angelic beauty of her eyes. Then
-gradually her eyes closed, and she sank to sleep. For a little bit
-her breast heaved softly, and her breath came and went like a tired
-child's.
-
-And then insensibly there came the strange change which I had noticed
-in the night. Her breathing grew stertorous, the mouth opened, and
-the pale gums, drawn back, made the teeth look longer and sharper than
-ever. In a sort of sleep-waking, vague, unconscious way she opened
-her eyes, which were now dull and hard at once, and said in a soft,
-voluptuous voice, such as I had never heard from her lips, "Arthur!
-Oh, my love, I am so glad you have come! Kiss me!"
-
-Arthur bent eagerly over to kiss her, but at that instant Van Helsing,
-who, like me, had been startled by her voice, swooped upon him, and
-catching him by the neck with both hands, dragged him back with a fury
-of strength which I never thought he could have possessed, and
-actually hurled him almost across the room.
-
-"Not on your life!" he said, "not for your living soul and hers!" And
-he stood between them like a lion at bay.
-
-Arthur was so taken aback that he did not for a moment know what to do
-or say, and before any impulse of violence could seize him he realized
-the place and the occasion, and stood silent, waiting.
-
-I kept my eyes fixed on Lucy, as did Van Helsing, and we saw a spasm
-as of rage flit like a shadow over her face. The sharp teeth clamped
-together. Then her eyes closed, and she breathed heavily.
-
-Very shortly after she opened her eyes in all their softness, and
-putting out her poor, pale, thin hand, took Van Helsing's great brown
-one, drawing it close to her, she kissed it. "My true friend," she
-said, in a faint voice, but with untellable pathos, "My true friend,
-and his! Oh, guard him, and give me peace!"
-
-"I swear it!" he said solemnly, kneeling beside her and holding up his
-hand, as one who registers an oath. Then he turned to Arthur, and
-said to him, "Come, my child, take her hand in yours, and kiss her on
-the forehead, and only once."
-
-Their eyes met instead of their lips, and so they parted. Lucy's eyes
-closed, and Van Helsing, who had been watching closely, took Arthur's
-arm, and drew him away.
-
-And then Lucy's breathing became stertorous again, and all at once it
-ceased.
-
-"It is all over," said Van Helsing. "She is dead!"
-
-I took Arthur by the arm, and led him away to the drawing room, where
-he sat down, and covered his face with his hands, sobbing in a way
-that nearly broke me down to see.
-
-I went back to the room, and found Van Helsing looking at poor Lucy,
-and his face was sterner than ever. Some change had come over her
-body. Death had given back part of her beauty, for her brow and
-cheeks had recovered some of their flowing lines. Even the lips had
-lost their deadly pallor. It was as if the blood, no longer needed
-for the working of the heart, had gone to make the harshness of death
-as little rude as might be.
-
-"We thought her dying whilst she slept, and sleeping when she died."
-
-
-I stood beside Van Helsing, and said, "Ah well, poor girl, there is
-peace for her at last. It is the end!"
-
-He turned to me, and said with grave solemnity, "Not so, alas! Not
-so. It is only the beginning!"
-
-When I asked him what he meant, he only shook his head and answered,
-"We can do nothing as yet. Wait and see."
-
-
-
-
-CHAPTER 13
-
-
-DR. SEWARD'S DIARY--cont.
-
-The funeral was arranged for the next succeeding day, so that Lucy and
-her mother might be buried together. I attended to all the ghastly
-formalities, and the urbane undertaker proved that his staff was
-afflicted, or blessed, with something of his own obsequious suavity.
-Even the woman who performed the last offices for the dead remarked to
-me, in a confidential, brother-professional way, when she had come out
-from the death chamber,
-
-"She makes a very beautiful corpse, sir. It's quite a privilege to
-attend on her. It's not too much to say that she will do credit to
-our establishment!"
-
-I noticed that Van Helsing never kept far away. This was possible
-from the disordered state of things in the household. There were no
-relatives at hand, and as Arthur had to be back the next day to attend
-at his father's funeral, we were unable to notify any one who should
-have been bidden. Under the circumstances, Van Helsing and I took it
-upon ourselves to examine papers, etc. He insisted upon looking over
-Lucy's papers himself. I asked him why, for I feared that he, being a
-foreigner, might not be quite aware of English legal requirements, and
-so might in ignorance make some unnecessary trouble.
-
-He answered me, "I know, I know. You forget that I am a lawyer as
-well as a doctor. But this is not altogether for the law. You knew
-that, when you avoided the coroner. I have more than him to avoid.
-There may be papers more, such as this."
-
-As he spoke he took from his pocket book the memorandum which had been
-in Lucy's breast, and which she had torn in her sleep.
-
-"When you find anything of the solicitor who is for the late Mrs.
-Westenra, seal all her papers, and write him tonight. For me, I watch
-here in the room and in Miss Lucy's old room all night, and I myself
-search for what may be. It is not well that her very thoughts go into
-the hands of strangers."
-
-I went on with my part of the work, and in another half hour had found
-the name and address of Mrs. Westenra's solicitor and had written to
-him. All the poor lady's papers were in order. Explicit directions
-regarding the place of burial were given. I had hardly sealed the
-letter, when, to my surprise, Van Helsing walked into the room,
-saying,
-
-"Can I help you friend John? I am free, and if I may, my service is
-to you."
-
-"Have you got what you looked for?" I asked.
-
-To which he replied, "I did not look for any specific thing. I only
-hoped to find, and find I have, all that there was, only some letters
-and a few memoranda, and a diary new begun. But I have them here, and
-we shall for the present say nothing of them. I shall see that poor
-lad tomorrow evening, and, with his sanction, I shall use some."
-
-When we had finished the work in hand, he said to me, "And now, friend
-John, I think we may to bed. We want sleep, both you and I, and rest
-to recuperate. Tomorrow we shall have much to do, but for the tonight
-there is no need of us. Alas!"
-
-Before turning in we went to look at poor Lucy. The undertaker had
-certainly done his work well, for the room was turned into a small
-chapelle ardente. There was a wilderness of beautiful white flowers,
-and death was made as little repulsive as might be. The end of the
-winding sheet was laid over the face. When the Professor bent over
-and turned it gently back, we both started at the beauty before us.
-The tall wax candles showing a sufficient light to note it well. All
-Lucy's loveliness had come back to her in death, and the hours that
-had passed, instead of leaving traces of 'decay's effacing fingers',
-had but restored the beauty of life, till positively I could not
-believe my eyes that I was looking at a corpse.
-
-The Professor looked sternly grave. He had not loved her as I had,
-and there was no need for tears in his eyes. He said to me, "Remain
-till I return," and left the room. He came back with a handful of
-wild garlic from the box waiting in the hall, but which had not been
-opened, and placed the flowers amongst the others on and around the
-bed. Then he took from his neck, inside his collar, a little gold
-crucifix, and placed it over the mouth. He restored the sheet to its
-place, and we came away.
-
-I was undressing in my own room, when, with a premonitory tap at the
-door, he entered, and at once began to speak.
-
-"Tomorrow I want you to bring me, before night, a set of post-mortem
-knives."
-
-"Must we make an autopsy?" I asked.
-
-"Yes and no. I want to operate, but not what you think. Let me tell
-you now, but not a word to another. I want to cut off her head and
-take out her heart. Ah! You a surgeon, and so shocked! You, whom I
-have seen with no tremble of hand or heart, do operations of life and
-death that make the rest shudder. Oh, but I must not forget, my dear
-friend John, that you loved her, and I have not forgotten it for is I
-that shall operate, and you must not help. I would like to do it
-tonight, but for Arthur I must not. He will be free after his
-father's funeral tomorrow, and he will want to see her, to see it.
-Then, when she is coffined ready for the next day, you and I shall
-come when all sleep. We shall unscrew the coffin lid, and shall do
-our operation, and then replace all, so that none know, save we
-alone."
-
-"But why do it at all? The girl is dead. Why mutilate her poor body
-without need? And if there is no necessity for a post-mortem and
-nothing to gain by it, no good to her, to us, to science, to human
-knowledge, why do it? Without such it is monstrous."
-
-For answer he put his hand on my shoulder, and said, with infinite
-tenderness, "Friend John, I pity your poor bleeding heart, and I love
-you the more because it does so bleed. If I could, I would take on
-myself the burden that you do bear. But there are things that you
-know not, but that you shall know, and bless me for knowing, though
-they are not pleasant things. John, my child, you have been my friend
-now many years, and yet did you ever know me to do any without good
-cause? I may err, I am but man, but I believe in all I do. Was it
-not for these causes that you send for me when the great trouble
-came? Yes! Were you not amazed, nay horrified, when I would not let
-Arthur kiss his love, though she was dying, and snatched him away by
-all my strength? Yes! And yet you saw how she thanked me, with her
-so beautiful dying eyes, her voice, too, so weak, and she kiss my
-rough old hand and bless me? Yes! And did you not hear me swear
-promise to her, that so she closed her eyes grateful? Yes!
-
-"Well, I have good reason now for all I want to do. You have for many
-years trust me. You have believe me weeks past, when there be things
-so strange that you might have well doubt. Believe me yet a little,
-friend John. If you trust me not, then I must tell what I think, and
-that is not perhaps well. And if I work, as work I shall, no matter
-trust or no trust, without my friend trust in me, I work with heavy
-heart and feel oh so lonely when I want all help and courage that may
-be!" He paused a moment and went on solemnly, "Friend John, there are
-strange and terrible days before us. Let us not be two, but one, that
-so we work to a good end. Will you not have faith in me?"
-
-I took his hand, and promised him. I held my door open as he went
-away, and watched him go to his room and close the door. As I stood
-without moving, I saw one of the maids pass silently along the
-passage, she had her back to me, so did not see me, and go into the
-room where Lucy lay. The sight touched me. Devotion is so rare, and
-we are so grateful to those who show it unasked to those we love. Here
-was a poor girl putting aside the terrors which she naturally had of
-death to go watch alone by the bier of the mistress whom she loved, so
-that the poor clay might not be lonely till laid to eternal rest.
-
-I must have slept long and soundly, for it was broad daylight when Van
-Helsing waked me by coming into my room. He came over to my bedside
-and said, "You need not trouble about the knives. We shall not do
-it."
-
-"Why not?" I asked. For his solemnity of the night before had
-greatly impressed me.
-
-"Because," he said sternly, "it is too late, or too early. See!"
-Here he held up the little golden crucifix.
-
-"This was stolen in the night."
-
-"How stolen," I asked in wonder, "since you have it now?"
-
-"Because I get it back from the worthless wretch who stole it, from
-the woman who robbed the dead and the living. Her punishment will
-surely come, but not through me. She knew not altogether what she
-did, and thus unknowing, she only stole. Now we must wait." He went
-away on the word, leaving me with a new mystery to think of, a new
-puzzle to grapple with.
-
-The forenoon was a dreary time, but at noon the solicitor came, Mr.
-Marquand, of Wholeman, Sons, Marquand & Lidderdale. He was very
-genial and very appreciative of what we had done, and took off our
-hands all cares as to details. During lunch he told us that Mrs.
-Westenra had for some time expected sudden death from her heart, and
-had put her affairs in absolute order. He informed us that, with the
-exception of a certain entailed property of Lucy's father which now,
-in default of direct issue, went back to a distant branch of the
-family, the whole estate, real and personal, was left absolutely to
-Arthur Holmwood. When he had told us so much he went on,
-
-"Frankly we did our best to prevent such a testamentary disposition,
-and pointed out certain contingencies that might leave her daughter
-either penniless or not so free as she should be to act regarding a
-matrimonial alliance. Indeed, we pressed the matter so far that we
-almost came into collision, for she asked us if we were or were not
-prepared to carry out her wishes. Of course, we had then no
-alternative but to accept. We were right in principle, and
-ninety-nine times out of a hundred we should have proved, by the logic
-of events, the accuracy of our judgment.
-
-"Frankly, however, I must admit that in this case any other form of
-disposition would have rendered impossible the carrying out of her
-wishes. For by her predeceasing her daughter the latter would have
-come into possession of the property, and, even had she only survived
-her mother by five minutes, her property would, in case there were no
-will, and a will was a practical impossibility in such a case, have
-been treated at her decease as under intestacy. In which case Lord
-Godalming, though so dear a friend, would have had no claim in the
-world. And the inheritors, being remote, would not be likely to
-abandon their just rights, for sentimental reasons regarding an entire
-stranger. I assure you, my dear sirs, I am rejoiced at the result,
-perfectly rejoiced."
-
-He was a good fellow, but his rejoicing at the one little part, in
-which he was officially interested, of so great a tragedy, was an
-object-lesson in the limitations of sympathetic understanding.
-
-He did not remain long, but said he would look in later in the day and
-see Lord Godalming. His coming, however, had been a certain comfort
-to us, since it assured us that we should not have to dread hostile
-criticism as to any of our acts. Arthur was expected at five o'clock,
-so a little before that time we visited the death chamber. It was so
-in very truth, for now both mother and daughter lay in it. The
-undertaker, true to his craft, had made the best display he could of
-his goods, and there was a mortuary air about the place that lowered
-our spirits at once.
-
-Van Helsing ordered the former arrangement to be adhered to,
-explaining that, as Lord Godalming was coming very soon, it would be
-less harrowing to his feelings to see all that was left of his fiancee
-quite alone.
-
-The undertaker seemed shocked at his own stupidity and exerted himself
-to restore things to the condition in which we left them the night
-before, so that when Arthur came such shocks to his feelings as we
-could avoid were saved.
-
-Poor fellow! He looked desperately sad and broken. Even his stalwart
-manhood seemed to have shrunk somewhat under the strain of his
-much-tried emotions. He had, I knew, been very genuinely and
-devotedly attached to his father, and to lose him, and at such a time,
-was a bitter blow to him. With me he was warm as ever, and to Van
-Helsing he was sweetly courteous. But I could not help seeing that
-there was some constraint with him. The professor noticed it too, and
-motioned me to bring him upstairs. I did so, and left him at the door
-of the room, as I felt he would like to be quite alone with her, but
-he took my arm and led me in, saying huskily,
-
-"You loved her too, old fellow. She told me all about it, and there
-was no friend had a closer place in her heart than you. I don't know
-how to thank you for all you have done for her. I can't think
-yet . . ."
-
-Here he suddenly broke down, and threw his arms round my shoulders and
-laid his head on my breast, crying, "Oh, Jack! Jack! What shall I
-do? The whole of life seems gone from me all at once, and there is
-nothing in the wide world for me to live for."
-
-I comforted him as well as I could. In such cases men do not need
-much expression. A grip of the hand, the tightening of an arm over
-the shoulder, a sob in unison, are expressions of sympathy dear to a
-man's heart. I stood still and silent till his sobs died away, and
-then I said softly to him, "Come and look at her."
-
-Together we moved over to the bed, and I lifted the lawn from her
-face. God! How beautiful she was. Every hour seemed to be enhancing
-her loveliness. It frightened and amazed me somewhat. And as for
-Arthur, he fell to trembling, and finally was shaken with doubt as
-with an ague. At last, after a long pause, he said to me in a faint
-whisper, "Jack, is she really dead?"
-
-I assured him sadly that it was so, and went on to suggest, for I felt
-that such a horrible doubt should not have life for a moment longer
-than I could help, that it often happened that after death faces
-become softened and even resolved into their youthful beauty, that
-this was especially so when death had been preceded by any acute or
-prolonged suffering. I seemed to quite do away with any doubt, and
-after kneeling beside the couch for a while and looking at her
-lovingly and long, he turned aside. I told him that that must be
-goodbye, as the coffin had to be prepared, so he went back and took
-her dead hand in his and kissed it, and bent over and kissed her
-forehead. He came away, fondly looking back over his shoulder at her
-as he came.
-
-I left him in the drawing room, and told Van Helsing that he had said
-goodbye, so the latter went to the kitchen to tell the undertaker's
-men to proceed with the preparations and to screw up the coffin. When
-he came out of the room again I told him of Arthur's question, and he
-replied, "I am not surprised. Just now I doubted for a moment
-myself!"
-
-We all dined together, and I could see that poor Art was trying to
-make the best of things. Van Helsing had been silent all dinner time,
-but when we had lit our cigars he said, "Lord . . ." but Arthur
-interrupted him.
-
-"No, no, not that, for God's sake! Not yet at any rate. Forgive me,
-sir. I did not mean to speak offensively. It is only because my loss
-is so recent."
-
-The Professor answered very sweetly, "I only used that name because I
-was in doubt. I must not call you 'Mr.' and I have grown to love you,
-yes, my dear boy, to love you, as Arthur."
-
-Arthur held out his hand, and took the old man's warmly. "Call me
-what you will," he said. "I hope I may always have the title of a
-friend. And let me say that I am at a loss for words to thank you for
-your goodness to my poor dear." He paused a moment, and went on, "I
-know that she understood your goodness even better than I do. And if
-I was rude or in any way wanting at that time you acted so, you
-remember"--the Professor nodded--"you must forgive me."
-
-He answered with a grave kindness, "I know it was hard for you to
-quite trust me then, for to trust such violence needs to understand,
-and I take it that you do not, that you cannot, trust me now, for you
-do not yet understand. And there may be more times when I shall want
-you to trust when you cannot, and may not, and must not yet
-understand. But the time will come when your trust shall be whole and
-complete in me, and when you shall understand as though the sunlight
-himself shone through. Then you shall bless me from first to last for
-your own sake, and for the sake of others, and for her dear sake to
-whom I swore to protect."
-
-"And indeed, indeed, sir," said Arthur warmly. "I shall in all ways
-trust you. I know and believe you have a very noble heart, and you
-are Jack's friend, and you were hers. You shall do what you like."
-
-The Professor cleared his throat a couple of times, as though about to
-speak, and finally said, "May I ask you something now?"
-
-"Certainly."
-
-"You know that Mrs. Westenra left you all her property?"
-
-"No, poor dear. I never thought of it."
-
-"And as it is all yours, you have a right to deal with it as you will.
-I want you to give me permission to read all Miss Lucy's papers and
-letters. Believe me, it is no idle curiosity. I have a motive of
-which, be sure, she would have approved. I have them all here. I
-took them before we knew that all was yours, so that no strange hand
-might touch them, no strange eye look through words into her soul. I
-shall keep them, if I may. Even you may not see them yet, but I shall
-keep them safe. No word shall be lost, and in the good time I shall
-give them back to you. It is a hard thing that I ask, but you will do
-it, will you not, for Lucy's sake?"
-
-Arthur spoke out heartily, like his old self, "Dr. Van Helsing, you
-may do what you will. I feel that in saying this I am doing what my
-dear one would have approved. I shall not trouble you with questions
-till the time comes."
-
-The old Professor stood up as he said solemnly, "And you are right.
-There will be pain for us all, but it will not be all pain, nor will
-this pain be the last. We and you too, you most of all, dear boy,
-will have to pass through the bitter water before we reach the sweet.
-But we must be brave of heart and unselfish, and do our duty, and all
-will be well!"
-
-I slept on a sofa in Arthur's room that night. Van Helsing did not go
-to bed at all. He went to and fro, as if patroling the house, and was
-never out of sight of the room where Lucy lay in her coffin, strewn
-with the wild garlic flowers, which sent through the odour of lily and
-rose, a heavy, overpowering smell into the night.
-
-
-
-
-MINA HARKER'S JOURNAL
-
-22 September.--In the train to Exeter. Jonathan sleeping. It seems
-only yesterday that the last entry was made, and yet how much between
-then, in Whitby and all the world before me, Jonathan away and no news
-of him, and now, married to Jonathan, Jonathan a solicitor, a partner,
-rich, master of his business, Mr. Hawkins dead and buried, and
-Jonathan with another attack that may harm him. Some day he may ask
-me about it. Down it all goes. I am rusty in my shorthand, see what
-unexpected prosperity does for us, so it may be as well to freshen it
-up again with an exercise anyhow.
-
-The service was very simple and very solemn. There were only
-ourselves and the servants there, one or two old friends of his from
-Exeter, his London agent, and a gentleman representing Sir John
-Paxton, the President of the Incorporated Law Society. Jonathan and I
-stood hand in hand, and we felt that our best and dearest friend was
-gone from us.
-
-We came back to town quietly, taking a bus to Hyde Park Corner.
-Jonathan thought it would interest me to go into the Row for a while,
-so we sat down. But there were very few people there, and it was
-sad-looking and desolate to see so many empty chairs. It made us
-think of the empty chair at home. So we got up and walked down
-Piccadilly. Jonathan was holding me by the arm, the way he used to in
-the old days before I went to school. I felt it very improper, for
-you can't go on for some years teaching etiquette and decorum to other
-girls without the pedantry of it biting into yourself a bit. But it
-was Jonathan, and he was my husband, and we didn't know anybody who
-saw us, and we didn't care if they did, so on we walked. I was
-looking at a very beautiful girl, in a big cart-wheel hat, sitting in
-a victoria outside Guiliano's, when I felt Jonathan clutch my arm so
-tight that he hurt me, and he said under his breath, "My God!"
-
-I am always anxious about Jonathan, for I fear that some nervous fit
-may upset him again. So I turned to him quickly, and asked him what
-it was that disturbed him.
-
-He was very pale, and his eyes seemed bulging out as, half in terror
-and half in amazement, he gazed at a tall, thin man, with a beaky nose
-and black moustache and pointed beard, who was also observing the
-pretty girl. He was looking at her so hard that he did not see either
-of us, and so I had a good view of him. His face was not a good
-face. It was hard, and cruel, and sensual, and big white teeth, that
-looked all the whiter because his lips were so red, were pointed like
-an animal's. Jonathan kept staring at him, till I was afraid he would
-notice. I feared he might take it ill, he looked so fierce and nasty.
-I asked Jonathan why he was disturbed, and he answered, evidently
-thinking that I knew as much about it as he did, "Do you see who it
-is?"
-
-"No, dear," I said. "I don't know him, who is it?" His answer seemed
-to shock and thrill me, for it was said as if he did not know that it
-was me, Mina, to whom he was speaking. "It is the man himself!"
-
-The poor dear was evidently terrified at something, very greatly
-terrified. I do believe that if he had not had me to lean on and to
-support him he would have sunk down. He kept staring. A man came out
-of the shop with a small parcel, and gave it to the lady, who then
-drove off. The dark man kept his eyes fixed on her, and when the
-carriage moved up Piccadilly he followed in the same direction, and
-hailed a hansom. Jonathan kept looking after him, and said, as if to
-himself,
-
-"I believe it is the Count, but he has grown young. My God, if this
-be so! Oh, my God! My God! If only I knew! If only I knew!" He was
-distressing himself so much that I feared to keep his mind on the
-subject by asking him any questions, so I remained silent. I drew
-away quietly, and he, holding my arm, came easily. We walked a little
-further, and then went in and sat for a while in the Green Park. It
-was a hot day for autumn, and there was a comfortable seat in a shady
-place. After a few minutes' staring at nothing, Jonathan's eyes
-closed, and he went quickly into a sleep, with his head on my
-shoulder. I thought it was the best thing for him, so did not disturb
-him. In about twenty minutes he woke up, and said to me quite
-cheerfully,
-
-"Why, Mina, have I been asleep! Oh, do forgive me for being so rude.
-Come, and we'll have a cup of tea somewhere."
-
-He had evidently forgotten all about the dark stranger, as in his
-illness he had forgotten all that this episode had reminded him of. I
-don't like this lapsing into forgetfulness. It may make or continue
-some injury to the brain. I must not ask him, for fear I shall do
-more harm than good, but I must somehow learn the facts of his journey
-abroad. The time is come, I fear, when I must open the parcel, and
-know what is written. Oh, Jonathan, you will, I know, forgive me if I
-do wrong, but it is for your own dear sake.
-
-
-Later.--A sad homecoming in every way, the house empty of the dear
-soul who was so good to us. Jonathan still pale and dizzy under a
-slight relapse of his malady, and now a telegram from Van Helsing,
-whoever he may be. "You will be grieved to hear that Mrs. Westenra
-died five days ago, and that Lucy died the day before yesterday. They
-were both buried today."
-
-Oh, what a wealth of sorrow in a few words! Poor Mrs. Westenra! Poor
-Lucy! Gone, gone, never to return to us! And poor, poor Arthur, to
-have lost such a sweetness out of his life! God help us all to bear
-our troubles.
-
-
-
-DR. SEWARD'S DIARY-CONT.
-
-22 September.--It is all over. Arthur has gone back to Ring, and has
-taken Quincey Morris with him. What a fine fellow is Quincey! I
-believe in my heart of hearts that he suffered as much about Lucy's
-death as any of us, but he bore himself through it like a moral
-Viking. If America can go on breeding men like that, she will be a
-power in the world indeed. Van Helsing is lying down, having a rest
-preparatory to his journey. He goes to Amsterdam tonight, but says he
-returns tomorrow night, that he only wants to make some arrangements
-which can only be made personally. He is to stop with me then, if he
-can. He says he has work to do in London which may take him some
-time. Poor old fellow! I fear that the strain of the past week has
-broken down even his iron strength. All the time of the burial he
-was, I could see, putting some terrible restraint on himself. When it
-was all over, we were standing beside Arthur, who, poor fellow, was
-speaking of his part in the operation where his blood had been
-transfused to his Lucy's veins. I could see Van Helsing's face grow
-white and purple by turns. Arthur was saying that he felt since then
-as if they two had been really married, and that she was his wife in
-the sight of God. None of us said a word of the other operations, and
-none of us ever shall. Arthur and Quincey went away together to the
-station, and Van Helsing and I came on here. The moment we were alone
-in the carriage he gave way to a regular fit of hysterics. He has
-denied to me since that it was hysterics, and insisted that it was
-only his sense of humor asserting itself under very terrible
-conditions. He laughed till he cried, and I had to draw down the
-blinds lest any one should see us and misjudge. And then he cried,
-till he laughed again, and laughed and cried together, just as a woman
-does. I tried to be stern with him, as one is to a woman under the
-circumstances, but it had no effect. Men and women are so different
-in manifestations of nervous strength or weakness! Then when his face
-grew grave and stern again I asked him why his mirth, and why at such
-a time. His reply was in a way characteristic of him, for it was
-logical and forceful and mysterious. He said,
-
-"Ah, you don't comprehend, friend John. Do not think that I am not
-sad, though I laugh. See, I have cried even when the laugh did choke
-me. But no more think that I am all sorry when I cry, for the laugh
-he come just the same. Keep it always with you that laughter who
-knock at your door and say, 'May I come in?' is not true laughter.
-No! He is a king, and he come when and how he like. He ask no
-person, he choose no time of suitability. He say, 'I am here.'
-Behold, in example I grieve my heart out for that so sweet young
-girl. I give my blood for her, though I am old and worn. I give my
-time, my skill, my sleep. I let my other sufferers want that she may
-have all. And yet I can laugh at her very grave, laugh when the clay
-from the spade of the sexton drop upon her coffin and say 'Thud,
-thud!' to my heart, till it send back the blood from my cheek. My
-heart bleed for that poor boy, that dear boy, so of the age of mine
-own boy had I been so blessed that he live, and with his hair and eyes
-the same.
-
-"There, you know now why I love him so. And yet when he say things
-that touch my husband-heart to the quick, and make my father-heart
-yearn to him as to no other man, not even you, friend John, for we are
-more level in experiences than father and son, yet even at such a
-moment King Laugh he come to me and shout and bellow in my ear, 'Here I
-am! Here I am!' till the blood come dance back and bring some of the
-sunshine that he carry with him to my cheek. Oh, friend John, it is a
-strange world, a sad world, a world full of miseries, and woes, and
-troubles. And yet when King Laugh come, he make them all dance to the
-tune he play. Bleeding hearts, and dry bones of the churchyard, and
-tears that burn as they fall, all dance together to the music that he
-make with that smileless mouth of him. And believe me, friend John,
-that he is good to come, and kind. Ah, we men and women are like
-ropes drawn tight with strain that pull us different ways. Then tears
-come, and like the rain on the ropes, they brace us up, until perhaps
-the strain become too great, and we break. But King Laugh he come
-like the sunshine, and he ease off the strain again, and we bear to go
-on with our labor, what it may be."
-
-I did not like to wound him by pretending not to see his idea, but as
-I did not yet understand the cause of his laughter, I asked him. As
-he answered me his face grew stern, and he said in quite a different
-tone,
-
-"Oh, it was the grim irony of it all, this so lovely lady garlanded
-with flowers, that looked so fair as life, till one by one we wondered
-if she were truly dead, she laid in that so fine marble house in that
-lonely churchyard, where rest so many of her kin, laid there with the
-mother who loved her, and whom she loved, and that sacred bell going
-'Toll! Toll! Toll!' so sad and slow, and those holy men, with the
-white garments of the angel, pretending to read books, and yet all the
-time their eyes never on the page, and all of us with the bowed head.
-And all for what? She is dead, so! Is it not?"
-
-"Well, for the life of me, Professor," I said, "I can't see anything
-to laugh at in all that. Why, your expression makes it a harder
-puzzle than before. But even if the burial service was comic, what
-about poor Art and his trouble? Why his heart was simply breaking."
-
-"Just so. Said he not that the transfusion of his blood to her veins
-had made her truly his bride?"
-
-"Yes, and it was a sweet and comforting idea for him."
-
-"Quite so. But there was a difficulty, friend John. If so that, then
-what about the others? Ho, ho! Then this so sweet maid is a
-polyandrist, and me, with my poor wife dead to me, but alive by
-Church's law, though no wits, all gone, even I, who am faithful
-husband to this now-no-wife, am bigamist."
-
-"I don't see where the joke comes in there either!" I said, and I did
-not feel particularly pleased with him for saying such things. He
-laid his hand on my arm, and said,
-
-"Friend John, forgive me if I pain. I showed not my feeling to others
-when it would wound, but only to you, my old friend, whom I can trust.
-If you could have looked into my heart then when I want to laugh, if
-you could have done so when the laugh arrived, if you could do so now,
-when King Laugh have pack up his crown, and all that is to him, for he
-go far, far away from me, and for a long, long time, maybe you would
-perhaps pity me the most of all."
-
-I was touched by the tenderness of his tone, and asked why.
-
-"Because I know!"
-
-And now we are all scattered, and for many a long day loneliness will
-sit over our roofs with brooding wings. Lucy lies in the tomb of her
-kin, a lordly death house in a lonely churchyard, away from teeming
-London, where the air is fresh, and the sun rises over Hampstead Hill,
-and where wild flowers grow of their own accord.
-
-So I can finish this diary, and God only knows if I shall ever begin
-another. If I do, or if I even open this again, it will be to deal
-with different people and different themes, for here at the end, where
-the romance of my life is told, ere I go back to take up the thread of
-my life-work, I say sadly and without hope, "FINIS".
-
-
-
-
-THE WESTMINSTER GAZETTE, 25 SEPTEMBER A HAMPSTEAD MYSTERY
-
-The neighborhood of Hampstead is just at present exercised
-with a series of events which seem to run on lines parallel
-to those of what was known to the writers of headlines as
-"The Kensington Horror," or "The Stabbing Woman," or "The
-Woman in Black." During the past two or three days several
-cases have occurred of young children straying from home or
-neglecting to return from their playing on the Heath. In
-all these cases the children were too young to give any
-properly intelligible account of themselves, but the
-consensus of their excuses is that they had been with a
-"bloofer lady." It has always been late in the evening when
-they have been missed, and on two occasions the children
-have not been found until early in the following morning.
-It is generally supposed in the neighborhood that, as the
-first child missed gave as his reason for being away that a
-"bloofer lady" had asked him to come for a walk, the others
-had picked up the phrase and used it as occasion served. This
-is the more natural as the favourite game of the little ones
-at present is luring each other away by wiles. A correspondent
-writes us that to see some of the tiny tots pretending to be the
-"bloofer lady" is supremely funny. Some of our caricaturists
-might, he says, take a lesson in the irony of grotesque by
-comparing the reality and the picture. It is only in accordance
-with general principles of human nature that the "bloofer lady"
-should be the popular role at these al fresco performances. Our
-correspondent naively says that even Ellen Terry could not be so
-winningly attractive as some of these grubby-faced little
-children pretend, and even imagine themselves, to be.
-
-There is, however, possibly a serious side to the question,
-for some of the children, indeed all who have been missed
-at night, have been slightly torn or wounded in the throat.
-The wounds seem such as might be made by a rat or a small
-dog, and although of not much importance individually, would tend
-to show that whatever animal inflicts them has a system or method
-of its own. The police of the division have been instructed to
-keep a sharp lookout for straying children, especially when very
-young, in and around Hampstead Heath, and for any stray dog which
-may be about.
-
-
-
-
-THE WESTMINSTER GAZETTE, 25 SEPTEMBER EXTRA SPECIAL
-
-THE HAMPSTEAD HORROR
-
-
-ANOTHER CHILD INJURED
-
-THE "BLOOFER LADY"
-
-We have just received intelligence that another child,
-missed last night, was only discovered late in the morning
-under a furze bush at the Shooter's Hill side of Hampstead
-Heath, which is perhaps, less frequented than the other
-parts. It has the same tiny wound in the throat as has
-been noticed in other cases. It was terribly weak, and
-looked quite emaciated. It too, when partially restored,
-had the common story to tell of being lured away by the
-"bloofer lady".
-
-
-
-
-CHAPTER 14
-
-
-MINA HARKER'S JOURNAL
-
-23 September.--Jonathan is better after a bad night. I am so glad
-that he has plenty of work to do, for that keeps his mind off the
-terrible things, and oh, I am rejoiced that he is not now weighed down
-with the responsibility of his new position. I knew he would be true
-to himself, and now how proud I am to see my Jonathan rising to the
-height of his advancement and keeping pace in all ways with the duties
-that come upon him. He will be away all day till late, for he said he
-could not lunch at home. My household work is done, so I shall take
-his foreign journal, and lock myself up in my room and read it.
-
-
-24 September.--I hadn't the heart to write last night, that terrible
-record of Jonathan's upset me so. Poor dear! How he must have
-suffered, whether it be true or only imagination. I wonder if there
-is any truth in it at all. Did he get his brain fever, and then write
-all those terrible things, or had he some cause for it all? I suppose
-I shall never know, for I dare not open the subject to him. And yet
-that man we saw yesterday! He seemed quite certain of him, poor
-fellow! I suppose it was the funeral upset him and sent his mind back
-on some train of thought.
-
-He believes it all himself. I remember how on our wedding day he said
-"Unless some solemn duty come upon me to go back to the bitter hours,
-asleep or awake, mad or sane . . ." There seems to be through it all
-some thread of continuity. That fearful Count was coming to London.
-If it should be, and he came to London, with its teeming millions . . .
-There may be a solemn duty, and if it come we must not shrink from
-it. I shall be prepared. I shall get my typewriter this very hour
-and begin transcribing. Then we shall be ready for other eyes if
-required. And if it be wanted, then, perhaps, if I am ready, poor
-Jonathan may not be upset, for I can speak for him and never let him
-be troubled or worried with it at all. If ever Jonathan quite gets
-over the nervousness he may want to tell me of it all, and I can ask
-him questions and find out things, and see how I may comfort him.
-
-
-
-
-LETTER, VAN HELSING TO MRS. HARKER
-
-24 September
-
-(Confidence)
-
-"Dear Madam,
-
-"I pray you to pardon my writing, in that I am so far
-friend as that I sent to you sad news of Miss Lucy
-Westenra's death. By the kindness of Lord Godalming, I am
-empowered to read her letters and papers, for I am deeply
-concerned about certain matters vitally important. In them
-I find some letters from you, which show how great friends
-you were and how you love her. Oh, Madam Mina, by that
-love, I implore you, help me. It is for others' good that
-I ask, to redress great wrong, and to lift much and terrible
-troubles, that may be more great than you can know. May it be
-that I see you? You can trust me. I am friend of Dr. John
-Seward and of Lord Godalming (that was Arthur of Miss Lucy). I
-must keep it private for the present from all. I should come to
-Exeter to see you at once if you tell me I am privilege to come,
-and where and when. I implore your pardon, Madam. I have read
-your letters to poor Lucy, and know how good you are and how your
-husband suffer. So I pray you, if it may be, enlighten him not,
-least it may harm. Again your pardon, and forgive me.
-
-"VAN HELSING"
-
-
-
-
-TELEGRAM, MRS. HARKER TO VAN HELSING
-
-25 September.--Come today by quarter past ten train if you
-can catch it. Can see you any time you call.
-
-"WILHELMINA HARKER"
-
-
-
-
-MINA HARKER'S JOURNAL
-
-25 September.--I cannot help feeling terribly excited as the time
-draws near for the visit of Dr. Van Helsing, for somehow I expect that
-it will throw some light upon Jonathan's sad experience, and as he
-attended poor dear Lucy in her last illness, he can tell me all about
-her. That is the reason of his coming. It is concerning Lucy and her
-sleep-walking, and not about Jonathan. Then I shall never know the
-real truth now! How silly I am. That awful journal gets hold of my
-imagination and tinges everything with something of its own colour. Of
-course it is about Lucy. That habit came back to the poor dear, and
-that awful night on the cliff must have made her ill. I had almost
-forgotten in my own affairs how ill she was afterwards. She must have
-told him of her sleep-walking adventure on the cliff, and that I knew
-all about it, and now he wants me to tell him what I know, so that he
-may understand. I hope I did right in not saying anything of it to
-Mrs. Westenra. I should never forgive myself if any act of mine, were
-it even a negative one, brought harm on poor dear Lucy. I hope too,
-Dr. Van Helsing will not blame me. I have had so much trouble and
-anxiety of late that I feel I cannot bear more just at present.
-
-I suppose a cry does us all good at times, clears the air as other
-rain does. Perhaps it was reading the journal yesterday that upset
-me, and then Jonathan went away this morning to stay away from me a
-whole day and night, the first time we have been parted since our
-marriage. I do hope the dear fellow will take care of himself, and
-that nothing will occur to upset him. It is two o'clock, and the
-doctor will be here soon now. I shall say nothing of Jonathan's
-journal unless he asks me. I am so glad I have typewritten out my own
-journal, so that, in case he asks about Lucy, I can hand it to him.
-It will save much questioning.
-
-Later.--He has come and gone. Oh, what a strange meeting, and how it
-all makes my head whirl round. I feel like one in a dream. Can it be
-all possible, or even a part of it? If I had not read Jonathan's
-journal first, I should never have accepted even a possibility. Poor,
-poor, dear Jonathan! How he must have suffered. Please the good God,
-all this may not upset him again. I shall try to save him from it.
-But it may be even a consolation and a help to him, terrible though it
-be and awful in its consequences, to know for certain that his eyes
-and ears and brain did not deceive him, and that it is all true. It
-may be that it is the doubt which haunts him, that when the doubt is
-removed, no matter which, waking or dreaming, may prove the truth, he
-will be more satisfied and better able to bear the shock. Dr. Van
-Helsing must be a good man as well as a clever one if he is Arthur's
-friend and Dr. Seward's, and if they brought him all the way from
-Holland to look after Lucy. I feel from having seen him that he is
-good and kind and of a noble nature. When he comes tomorrow I shall
-ask him about Jonathan. And then, please God, all this sorrow and
-anxiety may lead to a good end. I used to think I would like to
-practice interviewing. Jonathan's friend on "The Exeter News" told
-him that memory is everything in such work, that you must be able to
-put down exactly almost every word spoken, even if you had to refine
-some of it afterwards. Here was a rare interview. I shall try to
-record it verbatim.
-
-It was half-past two o'clock when the knock came. I took my courage a
-deux mains and waited. In a few minutes Mary opened the door, and
-announced "Dr. Van Helsing".
-
-I rose and bowed, and he came towards me, a man of medium weight,
-strongly built, with his shoulders set back over a broad, deep chest
-and a neck well balanced on the trunk as the head is on the neck. The
-poise of the head strikes me at once as indicative of thought and
-power. The head is noble, well-sized, broad, and large behind the
-ears. The face, clean-shaven, shows a hard, square chin, a large
-resolute, mobile mouth, a good-sized nose, rather straight, but with
-quick, sensitive nostrils, that seem to broaden as the big bushy brows
-come down and the mouth tightens. The forehead is broad and fine,
-rising at first almost straight and then sloping back above two bumps
-or ridges wide apart, such a forehead that the reddish hair cannot
-possibly tumble over it, but falls naturally back and to the sides.
-Big, dark blue eyes are set widely apart, and are quick and tender or
-stern with the man's moods. He said to me,
-
-"Mrs. Harker, is it not?" I bowed assent.
-
-"That was Miss Mina Murray?" Again I assented.
-
-"It is Mina Murray that I came to see that was friend of that poor dear
-child Lucy Westenra. Madam Mina, it is on account of the dead that I
-come."
-
-"Sir," I said, "you could have no better claim on me than that you
-were a friend and helper of Lucy Westenra." And I held out my hand.
-He took it and said tenderly,
-
-"Oh, Madam Mina, I know that the friend of that poor little girl must
-be good, but I had yet to learn . . ." He finished his speech with a
-courtly bow. I asked him what it was that he wanted to see me about,
-so he at once began.
-
-"I have read your letters to Miss Lucy. Forgive me, but I had to
-begin to inquire somewhere, and there was none to ask. I know that
-you were with her at Whitby. She sometimes kept a diary, you need not
-look surprised, Madam Mina. It was begun after you had left, and was
-an imitation of you, and in that diary she traces by inference certain
-things to a sleep-walking in which she puts down that you saved her.
-In great perplexity then I come to you, and ask you out of your so
-much kindness to tell me all of it that you can remember."
-
-"I can tell you, I think, Dr. Van Helsing, all about it."
-
-"Ah, then you have good memory for facts, for details? It is not
-always so with young ladies."
-
-"No, doctor, but I wrote it all down at the time. I can show it to
-you if you like."
-
-"Oh, Madam Mina, I well be grateful. You will do me much favour."
-
-I could not resist the temptation of mystifying him a bit, I suppose
-it is some taste of the original apple that remains still in our
-mouths, so I handed him the shorthand diary. He took it with a
-grateful bow, and said, "May I read it?"
-
-"If you wish," I answered as demurely as I could. He opened it, and
-for an instant his face fell. Then he stood up and bowed.
-
-"Oh, you so clever woman!" he said. "I knew long that Mr. Jonathan
-was a man of much thankfulness, but see, his wife have all the good
-things. And will you not so much honour me and so help me as to read
-it for me? Alas! I know not the shorthand."
-
-By this time my little joke was over, and I was almost ashamed. So I
-took the typewritten copy from my work basket and handed it to him.
-
-"Forgive me," I said. "I could not help it, but I had been thinking
-that it was of dear Lucy that you wished to ask, and so that you might
-not have time to wait, not on my account, but because I know your time
-must be precious, I have written it out on the typewriter for you."
-
-He took it and his eyes glistened. "You are so good," he said. "And
-may I read it now? I may want to ask you some things when I have
-read."
-
-"By all means," I said, "read it over whilst I order lunch, and then
-you can ask me questions whilst we eat."
-
-He bowed and settled himself in a chair with his back to the light,
-and became so absorbed in the papers, whilst I went to see after lunch
-chiefly in order that he might not be disturbed. When I came back, I
-found him walking hurriedly up and down the room, his face all ablaze
-with excitement. He rushed up to me and took me by both hands.
-
-"Oh, Madam Mina," he said, "how can I say what I owe to you? This
-paper is as sunshine. It opens the gate to me. I am dazed, I am
-dazzled, with so much light, and yet clouds roll in behind the light
-every time. But that you do not, cannot comprehend. Oh, but I am
-grateful to you, you so clever woman. Madame," he said this very
-solemnly, "if ever Abraham Van Helsing can do anything for you or
-yours, I trust you will let me know. It will be pleasure and delight
-if I may serve you as a friend, as a friend, but all I have ever
-learned, all I can ever do, shall be for you and those you love. There
-are darknesses in life, and there are lights. You are one of the
-lights. You will have a happy life and a good life, and your husband
-will be blessed in you."
-
-"But, doctor, you praise me too much, and you do not know me."
-
-"Not know you, I, who am old, and who have studied all my life men and
-women, I who have made my specialty the brain and all that belongs to
-him and all that follow from him! And I have read your diary that you
-have so goodly written for me, and which breathes out truth in every
-line. I, who have read your so sweet letter to poor Lucy of your
-marriage and your trust, not know you! Oh, Madam Mina, good women
-tell all their lives, and by day and by hour and by minute, such
-things that angels can read. And we men who wish to know have in us
-something of angels' eyes. Your husband is noble nature, and you are
-noble too, for you trust, and trust cannot be where there is mean
-nature. And your husband, tell me of him. Is he quite well? Is all
-that fever gone, and is he strong and hearty?"
-
-I saw here an opening to ask him about Jonathan, so I said, "He was
-almost recovered, but he has been greatly upset by Mr. Hawkins death."
-
-He interrupted, "Oh, yes. I know. I know. I have read your last two
-letters."
-
-I went on, "I suppose this upset him, for when we were in town on
-Thursday last he had a sort of shock."
-
-"A shock, and after brain fever so soon! That is not good. What kind
-of shock was it?"
-
-"He thought he saw some one who recalled something terrible, something
-which led to his brain fever." And here the whole thing seemed to
-overwhelm me in a rush. The pity for Jonathan, the horror which he
-experienced, the whole fearful mystery of his diary, and the fear that
-has been brooding over me ever since, all came in a tumult. I suppose
-I was hysterical, for I threw myself on my knees and held up my hands
-to him, and implored him to make my husband well again. He took my
-hands and raised me up, and made me sit on the sofa, and sat by me. He
-held my hand in his, and said to me with, oh, such infinite sweetness,
-
-"My life is a barren and lonely one, and so full of work that I have
-not had much time for friendships, but since I have been summoned to
-here by my friend John Seward I have known so many good people and
-seen such nobility that I feel more than ever, and it has grown with
-my advancing years, the loneliness of my life. Believe me, then, that
-I come here full of respect for you, and you have given me hope, hope,
-not in what I am seeking of, but that there are good women still left
-to make life happy, good women, whose lives and whose truths may make
-good lesson for the children that are to be. I am glad, glad, that I
-may here be of some use to you. For if your husband suffer, he suffer
-within the range of my study and experience. I promise you that I
-will gladly do all for him that I can, all to make his life strong and
-manly, and your life a happy one. Now you must eat. You are
-overwrought and perhaps over-anxious. Husband Jonathan would not like
-to see you so pale, and what he like not where he love, is not to his
-good. Therefore for his sake you must eat and smile. You have told
-me about Lucy, and so now we shall not speak of it, lest it distress.
-I shall stay in Exeter tonight, for I want to think much over what you
-have told me, and when I have thought I will ask you questions, if I
-may. And then too, you will tell me of husband Jonathan's trouble so
-far as you can, but not yet. You must eat now, afterwards you shall
-tell me all."
-
-After lunch, when we went back to the drawing room, he said to me,
-"And now tell me all about him."
-
-When it came to speaking to this great learned man, I began to fear
-that he would think me a weak fool, and Jonathan a madman, that
-journal is all so strange, and I hesitated to go on. But he was so
-sweet and kind, and he had promised to help, and I trusted him, so I
-said,
-
-"Dr. Van Helsing, what I have to tell you is so queer that you must
-not laugh at me or at my husband. I have been since yesterday in a
-sort of fever of doubt. You must be kind to me, and not think me
-foolish that I have even half believed some very strange things."
-
-He reassured me by his manner as well as his words when he said, "Oh,
-my dear, if you only know how strange is the matter regarding which I
-am here, it is you who would laugh. I have learned not to think
-little of any one's belief, no matter how strange it may be. I have
-tried to keep an open mind, and it is not the ordinary things of life
-that could close it, but the strange things, the extraordinary things,
-the things that make one doubt if they be mad or sane."
-
-"Thank you, thank you a thousand times! You have taken a weight off my
-mind. If you will let me, I shall give you a paper to read. It is
-long, but I have typewritten it out. It will tell you my trouble and
-Jonathan's. It is the copy of his journal when abroad, and all that
-happened. I dare not say anything of it. You will read for yourself
-and judge. And then when I see you, perhaps, you will be very kind
-and tell me what you think."
-
-"I promise," he said as I gave him the papers. "I shall in the
-morning, as soon as I can, come to see you and your husband, if I
-may."
-
-"Jonathan will be here at half-past eleven, and you must come to lunch
-with us and see him then. You could catch the quick 3:34 train, which
-will leave you at Paddington before eight." He was surprised at my
-knowledge of the trains offhand, but he does not know that I have made
-up all the trains to and from Exeter, so that I may help Jonathan in
-case he is in a hurry.
-
-So he took the papers with him and went away, and I sit here thinking,
-thinking I don't know what.
-
-
-
-
-LETTER (by hand), VAN HELSING TO MRS. HARKER
-
-25 September, 6 o'clock
-
-"Dear Madam Mina,
-
-"I have read your husband's so wonderful diary. You may
-sleep without doubt. Strange and terrible as it is, it is
-true! I will pledge my life on it. It may be worse for
-others, but for him and you there is no dread. He is a
-noble fellow, and let me tell you from experience of men,
-that one who would do as he did in going down that wall and
-to that room, aye, and going a second time, is not one to
-be injured in permanence by a shock. His brain and his
-heart are all right, this I swear, before I have even seen
-him, so be at rest. I shall have much to ask him of other
-things. I am blessed that today I come to see you, for I
-have learn all at once so much that again I am dazzled,
-dazzled more than ever, and I must think.
-
-"Yours the most faithful,
-
-"Abraham Van Helsing."
-
-
-LETTER, MRS. HARKER TO VAN HELSING
-
-25 September, 6:30 P.M.
-
-"My dear Dr. Van Helsing,
-
-"A thousand thanks for your kind letter, which has taken a
-great weight off my mind. And yet, if it be true, what
-terrible things there are in the world, and what an awful
-thing if that man, that monster, be really in London! I
-fear to think. I have this moment, whilst writing, had a
-wire from Jonathan, saying that he leaves by the 6:25 tonight
-from Launceston and will be here at 10:18, so that I shall have
-no fear tonight. Will you, therefore, instead of lunching with
-us, please come to breakfast at eight o'clock, if this be not too
-early for you? You can get away, if you are in a hurry, by the
-10:30 train, which will bring you to Paddington by 2:35. Do not
-answer this, as I shall take it that, if I do not hear, you will
-come to breakfast.
-
-"Believe me,
-
-"Your faithful and grateful friend,
-
-"Mina Harker."
-
-
-
-
-
-JONATHAN HARKER'S JOURNAL
-
-26 September.--I thought never to write in this diary again, but the
-time has come. When I got home last night Mina had supper ready, and
-when we had supped she told me of Van Helsing's visit, and of her
-having given him the two diaries copied out, and of how anxious she
-has been about me. She showed me in the doctor's letter that all I
-wrote down was true. It seems to have made a new man of me. It was
-the doubt as to the reality of the whole thing that knocked me over.
-I felt impotent, and in the dark, and distrustful. But, now that I
-know, I am not afraid, even of the Count. He has succeeded after all,
-then, in his design in getting to London, and it was he I saw. He has
-got younger, and how? Van Helsing is the man to unmask him and hunt
-him out, if he is anything like what Mina says. We sat late, and
-talked it over. Mina is dressing, and I shall call at the hotel in a
-few minutes and bring him over.
-
-
-He was, I think, surprised to see me. When I came into the room where
-he was, and introduced myself, he took me by the shoulder, and turned
-my face round to the light, and said, after a sharp scrutiny,
-
-"But Madam Mina told me you were ill, that you had had a shock."
-
-It was so funny to hear my wife called 'Madam Mina' by this kindly,
-strong-faced old man. I smiled, and said, "I was ill, I have had a
-shock, but you have cured me already."
-
-"And how?"
-
-"By your letter to Mina last night. I was in doubt, and then
-everything took a hue of unreality, and I did not know what to trust,
-even the evidence of my own senses. Not knowing what to trust, I did
-not know what to do, and so had only to keep on working in what had
-hitherto been the groove of my life. The groove ceased to avail me,
-and I mistrusted myself. Doctor, you don't know what it is to doubt
-everything, even yourself. No, you don't, you couldn't with eyebrows
-like yours."
-
-He seemed pleased, and laughed as he said, "So! You are a
-physiognomist. I learn more here with each hour. I am with so much
-pleasure coming to you to breakfast, and, oh, sir, you will pardon
-praise from an old man, but you are blessed in your wife."
-
-I would listen to him go on praising Mina for a day, so I simply
-nodded and stood silent.
-
-"She is one of God's women, fashioned by His own hand to show us men
-and other women that there is a heaven where we can enter, and that
-its light can be here on earth. So true, so sweet, so noble, so
-little an egoist, and that, let me tell you, is much in this age, so
-sceptical and selfish. And you, sir . . . I have read all the letters
-to poor Miss Lucy, and some of them speak of you, so I know you since
-some days from the knowing of others, but I have seen your true self
-since last night. You will give me your hand, will you not? And let
-us be friends for all our lives."
-
-We shook hands, and he was so earnest and so kind that it made me
-quite choky.
-
-"And now," he said, "may I ask you for some more help? I have a great
-task to do, and at the beginning it is to know. You can help me
-here. Can you tell me what went before your going to Transylvania?
-Later on I may ask more help, and of a different kind, but at first
-this will do."
-
-"Look here, Sir," I said, "does what you have to do concern the
-Count?"
-
-"It does," he said solemnly.
-
-"Then I am with you heart and soul. As you go by the 10:30 train, you
-will not have time to read them, but I shall get the bundle of papers.
-You can take them with you and read them in the train."
-
-After breakfast I saw him to the station. When we were parting he
-said, "Perhaps you will come to town if I send for you, and take Madam
-Mina too."
-
-"We shall both come when you will," I said.
-
-I had got him the morning papers and the London papers of the previous
-night, and while we were talking at the carriage window, waiting for
-the train to start, he was turning them over. His eyes suddenly
-seemed to catch something in one of them, "The Westminster Gazette", I
-knew it by the colour, and he grew quite white. He read something
-intently, groaning to himself, "Mein Gott! Mein Gott! So soon! So
-soon!" I do not think he remembered me at the moment. Just then the
-whistle blew, and the train moved off. This recalled him to himself,
-and he leaned out of the window and waved his hand, calling out, "Love
-to Madam Mina. I shall write so soon as ever I can."
-
-
-
-
-DR. SEWARD'S DIARY
-
-26 September.--Truly there is no such thing as finality. Not a week
-since I said "Finis," and yet here I am starting fresh again, or
-rather going on with the record. Until this afternoon I had no cause
-to think of what is done. Renfield had become, to all intents, as
-sane as he ever was. He was already well ahead with his fly business,
-and he had just started in the spider line also, so he had not been of
-any trouble to me. I had a letter from Arthur, written on Sunday, and
-from it I gather that he is bearing up wonderfully well. Quincey
-Morris is with him, and that is much of a help, for he himself is a
-bubbling well of good spirits. Quincey wrote me a line too, and from
-him I hear that Arthur is beginning to recover something of his old
-buoyancy, so as to them all my mind is at rest. As for myself, I was
-settling down to my work with the enthusiasm which I used to have for
-it, so that I might fairly have said that the wound which poor Lucy
-left on me was becoming cicatrised.
-
-Everything is, however, now reopened, and what is to be the end God
-only knows. I have an idea that Van Helsing thinks he knows, too, but
-he will only let out enough at a time to whet curiosity. He went to
-Exeter yesterday, and stayed there all night. Today he came back, and
-almost bounded into the room at about half-past five o'clock, and
-thrust last night's "Westminster Gazette" into my hand.
-
-"What do you think of that?" he asked as he stood back and folded his
-arms.
-
-I looked over the paper, for I really did not know what he meant, but
-he took it from me and pointed out a paragraph about children being
-decoyed away at Hampstead. It did not convey much to me, until I
-reached a passage where it described small puncture wounds on their
-throats. An idea struck me, and I looked up.
-
-"Well?" he said.
-
-"It is like poor Lucy's."
-
-"And what do you make of it?"
-
-"Simply that there is some cause in common. Whatever it was that
-injured her has injured them." I did not quite understand his answer.
-
-"That is true indirectly, but not directly."
-
-"How do you mean, Professor?" I asked. I was a little inclined to
-take his seriousness lightly, for, after all, four days of rest and
-freedom from burning, harrowing, anxiety does help to restore one's
-spirits, but when I saw his face, it sobered me. Never, even in the
-midst of our despair about poor Lucy, had he looked more stern.
-
-"Tell me!" I said. "I can hazard no opinion. I do not know what to
-think, and I have no data on which to found a conjecture."
-
-"Do you mean to tell me, friend John, that you have no suspicion as to
-what poor Lucy died of, not after all the hints given, not only by
-events, but by me?"
-
-"Of nervous prostration following a great loss or waste of blood."
-
-"And how was the blood lost or wasted?" I shook my head.
-
-He stepped over and sat down beside me, and went on, "You are a clever
-man, friend John. You reason well, and your wit is bold, but you are
-too prejudiced. You do not let your eyes see nor your ears hear, and
-that which is outside your daily life is not of account to you. Do
-you not think that there are things which you cannot understand, and
-yet which are, that some people see things that others cannot? But
-there are things old and new which must not be contemplated by men's
-eyes, because they know, or think they know, some things which other
-men have told them. Ah, it is the fault of our science that it wants
-to explain all, and if it explain not, then it says there is nothing
-to explain. But yet we see around us every day the growth of new
-beliefs, which think themselves new, and which are yet but the old,
-which pretend to be young, like the fine ladies at the opera. I
-suppose now you do not believe in corporeal transference. No? Nor in
-materialization. No? Nor in astral bodies. No? Nor in the reading
-of thought. No? Nor in hypnotism . . ."
-
-"Yes," I said. "Charcot has proved that pretty well."
-
-He smiled as he went on, "Then you are satisfied as to it. Yes? And
-of course then you understand how it act, and can follow the mind of
-the great Charcot, alas that he is no more, into the very soul of the
-patient that he influence. No? Then, friend John, am I to take it
-that you simply accept fact, and are satisfied to let from premise to
-conclusion be a blank? No? Then tell me, for I am a student of the
-brain, how you accept hypnotism and reject the thought reading. Let
-me tell you, my friend, that there are things done today in electrical
-science which would have been deemed unholy by the very man who
-discovered electricity, who would themselves not so long before been
-burned as wizards. There are always mysteries in life. Why was it
-that Methuselah lived nine hundred years, and 'Old Parr' one hundred
-and sixty-nine, and yet that poor Lucy, with four men's blood in her
-poor veins, could not live even one day? For, had she live one more
-day, we could save her. Do you know all the mystery of life and
-death? Do you know the altogether of comparative anatomy and can say
-wherefore the qualities of brutes are in some men, and not in others?
-Can you tell me why, when other spiders die small and soon, that one
-great spider lived for centuries in the tower of the old Spanish
-church and grew and grew, till, on descending, he could drink the oil
-of all the church lamps? Can you tell me why in the Pampas, ay and
-elsewhere, there are bats that come out at night and open the veins of
-cattle and horses and suck dry their veins, how in some islands of the
-Western seas there are bats which hang on the trees all day, and those
-who have seen describe as like giant nuts or pods, and that when the
-sailors sleep on the deck, because that it is hot, flit down on them
-and then, and then in the morning are found dead men, white as even
-Miss Lucy was?"
-
-"Good God, Professor!" I said, starting up. "Do you mean to tell me
-that Lucy was bitten by such a bat, and that such a thing is here in
-London in the nineteenth century?"
-
-He waved his hand for silence, and went on, "Can you tell me why the
-tortoise lives more long than generations of men, why the elephant
-goes on and on till he have sees dynasties, and why the parrot never
-die only of bite of cat of dog or other complaint? Can you tell me
-why men believe in all ages and places that there are men and women
-who cannot die? We all know, because science has vouched for the
-fact, that there have been toads shut up in rocks for thousands of
-years, shut in one so small hole that only hold him since the youth of
-the world. Can you tell me how the Indian fakir can make himself to
-die and have been buried, and his grave sealed and corn sowed on it,
-and the corn reaped and be cut and sown and reaped and cut again, and
-then men come and take away the unbroken seal and that there lie the
-Indian fakir, not dead, but that rise up and walk amongst them as
-before?"
-
-Here I interrupted him. I was getting bewildered. He so crowded on
-my mind his list of nature's eccentricities and possible
-impossibilities that my imagination was getting fired. I had a dim
-idea that he was teaching me some lesson, as long ago he used to do in
-his study at Amsterdam. But he used them to tell me the thing, so
-that I could have the object of thought in mind all the time. But now
-I was without his help, yet I wanted to follow him, so I said,
-
-"Professor, let me be your pet student again. Tell me the thesis, so
-that I may apply your knowledge as you go on. At present I am going
-in my mind from point to point as a madman, and not a sane one,
-follows an idea. I feel like a novice lumbering through a bog in a
-midst, jumping from one tussock to another in the mere blind effort to
-move on without knowing where I am going."
-
-"That is a good image," he said. "Well, I shall tell you. My thesis
-is this, I want you to believe."
-
-"To believe what?"
-
-"To believe in things that you cannot. Let me illustrate. I heard
-once of an American who so defined faith, 'that faculty which enables
-us to believe things which we know to be untrue.' For one, I follow
-that man. He meant that we shall have an open mind, and not let a
-little bit of truth check the rush of the big truth, like a small rock
-does a railway truck. We get the small truth first. Good! We keep
-him, and we value him, but all the same we must not let him think
-himself all the truth in the universe."
-
-"Then you want me not to let some previous conviction inure the
-receptivity of my mind with regard to some strange matter. Do I read
-your lesson aright?"
-
-"Ah, you are my favourite pupil still. It is worth to teach you. Now
-that you are willing to understand, you have taken the first step to
-understand. You think then that those so small holes in the
-children's throats were made by the same that made the holes in Miss
-Lucy?"
-
-"I suppose so."
-
-He stood up and said solemnly, "Then you are wrong. Oh, would it were
-so! But alas! No. It is worse, far, far worse."
-
-"In God's name, Professor Van Helsing, what do you mean?" I cried.
-
-He threw himself with a despairing gesture into a chair, and placed
-his elbows on the table, covering his face with his hands as he spoke.
-
-"They were made by Miss Lucy!"
-
-
-
-
-CHAPTER 15
-
-
-DR. SEWARD'S DIARY--cont.
-
-For a while sheer anger mastered me. It was as if he had during her
-life struck Lucy on the face. I smote the table hard and rose up as I
-said to him, "Dr. Van Helsing, are you mad?"
-
-He raised his head and looked at me, and somehow the tenderness of his
-face calmed me at once. "Would I were!" he said. "Madness were easy
-to bear compared with truth like this. Oh, my friend, why, think
-you, did I go so far round, why take so long to tell so simple a
-thing? Was it because I hate you and have hated you all my life? Was
-it because I wished to give you pain? Was it that I wanted, now so
-late, revenge for that time when you saved my life, and from a fearful
-death? Ah no!"
-
-"Forgive me," said I.
-
-He went on, "My friend, it was because I wished to be gentle in the
-breaking to you, for I know you have loved that so sweet lady. But
-even yet I do not expect you to believe. It is so hard to accept at
-once any abstract truth, that we may doubt such to be possible when we
-have always believed the 'no' of it. It is more hard still to accept
-so sad a concrete truth, and of such a one as Miss Lucy. Tonight I go
-to prove it. Dare you come with me?"
-
-This staggered me. A man does not like to prove such a truth, Byron
-excepted from the category, jealousy.
-
- "And prove the very truth he most abhorred."
-
-He saw my hesitation, and spoke, "The logic is simple, no madman's
-logic this time, jumping from tussock to tussock in a misty bog. If
-it not be true, then proof will be relief. At worst it will not harm.
-If it be true! Ah, there is the dread. Yet every dread should help my
-cause, for in it is some need of belief. Come, I tell you what I
-propose. First, that we go off now and see that child in the
-hospital. Dr. Vincent, of the North Hospital, where the papers say
-the child is, is a friend of mine, and I think of yours since you were
-in class at Amsterdam. He will let two scientists see his case, if he
-will not let two friends. We shall tell him nothing, but only that we
-wish to learn. And then . . ."
-
-"And then?"
-
-He took a key from his pocket and held it up. "And then we spend the
-night, you and I, in the churchyard where Lucy lies. This is the key
-that lock the tomb. I had it from the coffin man to give to Arthur."
-
-My heart sank within me, for I felt that there was some fearful ordeal
-before us. I could do nothing, however, so I plucked up what heart I
-could and said that we had better hasten, as the afternoon was
-passing.
-
-We found the child awake. It had had a sleep and taken some food, and
-altogether was going on well. Dr. Vincent took the bandage from its
-throat, and showed us the punctures. There was no mistaking the
-similarity to those which had been on Lucy's throat. They were
-smaller, and the edges looked fresher, that was all. We asked Vincent
-to what he attributed them, and he replied that it must have been a
-bite of some animal, perhaps a rat, but for his own part, he was
-inclined to think it was one of the bats which are so numerous on the
-northern heights of London. "Out of so many harmless ones," he said,
-"there may be some wild specimen from the South of a more malignant
-species. Some sailor may have brought one home, and it managed to
-escape, or even from the Zoological Gardens a young one may have got
-loose, or one be bred there from a vampire. These things do occur,
-you, know. Only ten days ago a wolf got out, and was, I believe,
-traced up in this direction. For a week after, the children were
-playing nothing but Red Riding Hood on the Heath and in every alley in
-the place until this 'bloofer lady' scare came along, since then it
-has been quite a gala time with them. Even this poor little mite,
-when he woke up today, asked the nurse if he might go away. When she
-asked him why he wanted to go, he said he wanted to play with the
-'bloofer lady'."
-
-"I hope," said Van Helsing, "that when you are sending the child home
-you will caution its parents to keep strict watch over it. These
-fancies to stray are most dangerous, and if the child were to remain
-out another night, it would probably be fatal. But in any case I
-suppose you will not let it away for some days?"
-
-"Certainly not, not for a week at least, longer if the wound is not
-healed."
-
-Our visit to the hospital took more time than we had reckoned on, and
-the sun had dipped before we came out. When Van Helsing saw how dark
-it was, he said,
-
-"There is not hurry. It is more late than I thought. Come, let us
-seek somewhere that we may eat, and then we shall go on our way."
-
-We dined at 'Jack Straw's Castle' along with a little crowd of
-bicyclists and others who were genially noisy. About ten o'clock we
-started from the inn. It was then very dark, and the scattered lamps
-made the darkness greater when we were once outside their individual
-radius. The Professor had evidently noted the road we were to go, for
-he went on unhesitatingly, but, as for me, I was in quite a mixup as
-to locality. As we went further, we met fewer and fewer people, till
-at last we were somewhat surprised when we met even the patrol of
-horse police going their usual suburban round. At last we reached the
-wall of the churchyard, which we climbed over. With some little
-difficulty, for it was very dark, and the whole place seemed so
-strange to us, we found the Westenra tomb. The Professor took the
-key, opened the creaky door, and standing back, politely, but quite
-unconsciously, motioned me to precede him. There was a delicious
-irony in the offer, in the courtliness of giving preference on such a
-ghastly occasion. My companion followed me quickly, and cautiously
-drew the door to, after carefully ascertaining that the lock was a
-falling, and not a spring one. In the latter case we should have been
-in a bad plight. Then he fumbled in his bag, and taking out a
-matchbox and a piece of candle, proceeded to make a light. The tomb
-in the daytime, and when wreathed with fresh flowers, had looked grim
-and gruesome enough, but now, some days afterwards, when the flowers
-hung lank and dead, their whites turning to rust and their greens to
-browns, when the spider and the beetle had resumed their accustomed
-dominance, when the time-discoloured stone, and dust-encrusted mortar,
-and rusty, dank iron, and tarnished brass, and clouded silver-plating
-gave back the feeble glimmer of a candle, the effect was more
-miserable and sordid than could have been imagined. It conveyed
-irresistibly the idea that life, animal life, was not the only thing
-which could pass away.
-
-Van Helsing went about his work systematically. Holding his candle so
-that he could read the coffin plates, and so holding it that the sperm
-dropped in white patches which congealed as they touched the metal, he
-made assurance of Lucy's coffin. Another search in his bag, and he
-took out a turnscrew.
-
-"What are you going to do?" I asked.
-
-"To open the coffin. You shall yet be convinced."
-
-Straightway he began taking out the screws, and finally lifted off the
-lid, showing the casing of lead beneath. The sight was almost too
-much for me. It seemed to be as much an affront to the dead as it
-would have been to have stripped off her clothing in her sleep whilst
-living. I actually took hold of his hand to stop him.
-
-He only said, "You shall see," and again fumbling in his bag took out
-a tiny fret saw. Striking the turnscrew through the lead with a swift
-downward stab, which made me wince, he made a small hole, which was,
-however, big enough to admit the point of the saw. I had expected a
-rush of gas from the week-old corpse. We doctors, who have had to
-study our dangers, have to become accustomed to such things, and I
-drew back towards the door. But the Professor never stopped for a
-moment. He sawed down a couple of feet along one side of the lead
-coffin, and then across, and down the other side. Taking the edge of
-the loose flange, he bent it back towards the foot of the coffin, and
-holding up the candle into the aperture, motioned to me to look.
-
-I drew near and looked. The coffin was empty. It was certainly a
-surprise to me, and gave me a considerable shock, but Van Helsing was
-unmoved. He was now more sure than ever of his ground, and so
-emboldened to proceed in his task. "Are you satisfied now, friend
-John?" he asked.
-
-I felt all the dogged argumentativeness of my nature awake within me as
-I answered him, "I am satisfied that Lucy's body is not in that
-coffin, but that only proves one thing."
-
-"And what is that, friend John?"
-
-"That it is not there."
-
-"That is good logic," he said, "so far as it goes. But how do you,
-how can you, account for it not being there?"
-
-"Perhaps a body-snatcher," I suggested. "Some of the undertaker's
-people may have stolen it." I felt that I was speaking folly, and yet
-it was the only real cause which I could suggest.
-
-The Professor sighed. "Ah well!" he said, "we must have more proof.
-Come with me."
-
-He put on the coffin lid again, gathered up all his things and placed
-them in the bag, blew out the light, and placed the candle also in the
-bag. We opened the door, and went out. Behind us he closed the door
-and locked it. He handed me the key, saying, "Will you keep it? You
-had better be assured."
-
-I laughed, it was not a very cheerful laugh, I am bound to say, as I
-motioned him to keep it. "A key is nothing," I said, "there are many
-duplicates, and anyhow it is not difficult to pick a lock of this
-kind."
-
-He said nothing, but put the key in his pocket. Then he told me to
-watch at one side of the churchyard whilst he would watch at the
-other.
-
-I took up my place behind a yew tree, and I saw his dark figure move
-until the intervening headstones and trees hid it from my sight.
-
-It was a lonely vigil. Just after I had taken my place I heard a
-distant clock strike twelve, and in time came one and two. I was
-chilled and unnerved, and angry with the Professor for taking me on
-such an errand and with myself for coming. I was too cold and too
-sleepy to be keenly observant, and not sleepy enough to betray my
-trust, so altogether I had a dreary, miserable time.
-
-Suddenly, as I turned round, I thought I saw something like a white
-streak, moving between two dark yew trees at the side of the
-churchyard farthest from the tomb. At the same time a dark mass moved
-from the Professor's side of the ground, and hurriedly went towards
-it. Then I too moved, but I had to go round headstones and railed-off
-tombs, and I stumbled over graves. The sky was overcast, and
-somewhere far off an early cock crew. A little ways off, beyond a
-line of scattered juniper trees, which marked the pathway to the
-church, a white dim figure flitted in the direction of the tomb. The
-tomb itself was hidden by trees, and I could not see where the figure
-had disappeared. I heard the rustle of actual movement where I had
-first seen the white figure, and coming over, found the Professor
-holding in his arms a tiny child. When he saw me he held it out to
-me, and said, "Are you satisfied now?"
-
-"No," I said, in a way that I felt was aggressive.
-
-"Do you not see the child?"
-
-"Yes, it is a child, but who brought it here? And is it wounded?"
-
-"We shall see," said the Professor, and with one impulse we took our
-way out of the churchyard, he carrying the sleeping child.
-
-When we had got some little distance away, we went into a clump of
-trees, and struck a match, and looked at the child's throat. It was
-without a scratch or scar of any kind.
-
-"Was I right?" I asked triumphantly.
-
-"We were just in time," said the Professor thankfully.
-
-We had now to decide what we were to do with the child, and so
-consulted about it. If we were to take it to a police station we
-should have to give some account of our movements during the night.
-At least, we should have had to make some statement as to how we had
-come to find the child. So finally we decided that we would take it
-to the Heath, and when we heard a policeman coming, would leave it
-where he could not fail to find it. We would then seek our way home
-as quickly as we could. All fell out well. At the edge of Hampstead
-Heath we heard a policeman's heavy tramp, and laying the child on the
-pathway, we waited and watched until he saw it as he flashed his
-lantern to and fro. We heard his exclamation of astonishment, and
-then we went away silently. By good chance we got a cab near the
-'Spainiards,' and drove to town.
-
-I cannot sleep, so I make this entry. But I must try to get a few
-hours' sleep, as Van Helsing is to call for me at noon. He insists
-that I go with him on another expedition.
-
-
-27 September.--It was two o'clock before we found a suitable
-opportunity for our attempt. The funeral held at noon was all
-completed, and the last stragglers of the mourners had taken
-themselves lazily away, when, looking carefully from behind a clump of
-alder trees, we saw the sexton lock the gate after him. We knew that
-we were safe till morning did we desire it, but the Professor told me
-that we should not want more than an hour at most. Again I felt that
-horrid sense of the reality of things, in which any effort of
-imagination seemed out of place, and I realized distinctly the perils
-of the law which we were incurring in our unhallowed work. Besides, I
-felt it was all so useless. Outrageous as it was to open a leaden
-coffin, to see if a woman dead nearly a week were really dead, it now
-seemed the height of folly to open the tomb again, when we knew, from
-the evidence of our own eyesight, that the coffin was empty. I
-shrugged my shoulders, however, and rested silent, for Van Helsing had
-a way of going on his own road, no matter who remonstrated. He took
-the key, opened the vault, and again courteously motioned me to
-precede. The place was not so gruesome as last night, but oh, how
-unutterably mean looking when the sunshine streamed in. Van Helsing
-walked over to Lucy's coffin, and I followed. He bent over and again
-forced back the leaden flange, and a shock of surprise and dismay shot
-through me.
-
-There lay Lucy, seemingly just as we had seen her the night before her
-funeral. She was, if possible, more radiantly beautiful than ever,
-and I could not believe that she was dead. The lips were red, nay
-redder than before, and on the cheeks was a delicate bloom.
-
-"Is this a juggle?" I said to him.
-
-"Are you convinced now?" said the Professor, in response, and as he
-spoke he put over his hand, and in a way that made me shudder, pulled
-back the dead lips and showed the white teeth. "See," he went on,
-"they are even sharper than before. With this and this," and he
-touched one of the canine teeth and that below it, "the little
-children can be bitten. Are you of belief now, friend John?"
-
-Once more argumentative hostility woke within me. I could not accept
-such an overwhelming idea as he suggested. So, with an attempt to
-argue of which I was even at the moment ashamed, I said, "She may have
-been placed here since last night."
-
-"Indeed? That is so, and by whom?"
-
-"I do not know. Someone has done it."
-
-"And yet she has been dead one week. Most peoples in that time would
-not look so."
-
-I had no answer for this, so was silent. Van Helsing did not seem to
-notice my silence. At any rate, he showed neither chagrin nor
-triumph. He was looking intently at the face of the dead woman,
-raising the eyelids and looking at the eyes, and once more opening the
-lips and examining the teeth. Then he turned to me and said,
-
-"Here, there is one thing which is different from all recorded. Here
-is some dual life that is not as the common. She was bitten by the
-vampire when she was in a trance, sleep-walking, oh, you start. You
-do not know that, friend John, but you shall know it later, and in
-trance could he best come to take more blood. In trance she dies, and
-in trance she is UnDead, too. So it is that she differ from all
-other. Usually when the UnDead sleep at home," as he spoke he made a
-comprehensive sweep of his arm to designate what to a vampire was
-'home', "their face show what they are, but this so sweet that was
-when she not UnDead she go back to the nothings of the common dead.
-There is no malign there, see, and so it make hard that I must kill
-her in her sleep."
-
-This turned my blood cold, and it began to dawn upon me that I was
-accepting Van Helsing's theories. But if she were really dead, what
-was there of terror in the idea of killing her?
-
-He looked up at me, and evidently saw the change in my face, for he
-said almost joyously, "Ah, you believe now?"
-
-I answered, "Do not press me too hard all at once. I am willing to
-accept. How will you do this bloody work?"
-
-"I shall cut off her head and fill her mouth with garlic, and I shall
-drive a stake through her body."
-
-It made me shudder to think of so mutilating the body of the woman
-whom I had loved. And yet the feeling was not so strong as I had
-expected. I was, in fact, beginning to shudder at the presence of
-this being, this UnDead, as Van Helsing called it, and to loathe it.
-Is it possible that love is all subjective, or all objective?
-
-I waited a considerable time for Van Helsing to begin, but he stood as
-if wrapped in thought. Presently he closed the catch of his bag with
-a snap, and said,
-
-"I have been thinking, and have made up my mind as to what is best.
-If I did simply follow my inclining I would do now, at this moment,
-what is to be done. But there are other things to follow, and things
-that are thousand times more difficult in that them we do not know.
-This is simple. She have yet no life taken, though that is of time,
-and to act now would be to take danger from her forever. But then we
-may have to want Arthur, and how shall we tell him of this? If you,
-who saw the wounds on Lucy's throat, and saw the wounds so similar on
-the child's at the hospital, if you, who saw the coffin empty last
-night and full today with a woman who have not change only to be more
-rose and more beautiful in a whole week, after she die, if you know of
-this and know of the white figure last night that brought the child to
-the churchyard, and yet of your own senses you did not believe, how
-then, can I expect Arthur, who know none of those things, to believe?
-
-"He doubted me when I took him from her kiss when she was dying. I
-know he has forgiven me because in some mistaken idea I have done
-things that prevent him say goodbye as he ought, and he may think that
-in some more mistaken idea this woman was buried alive, and that in
-most mistake of all we have killed her. He will then argue back that
-it is we, mistaken ones, that have killed her by our ideas, and so he
-will be much unhappy always. Yet he never can be sure, and that is
-the worst of all. And he will sometimes think that she he loved was
-buried alive, and that will paint his dreams with horrors of what she
-must have suffered, and again, he will think that we may be right, and
-that his so beloved was, after all, an UnDead. No! I told him once,
-and since then I learn much. Now, since I know it is all true, a
-hundred thousand times more do I know that he must pass through the
-bitter waters to reach the sweet. He, poor fellow, must have one hour
-that will make the very face of heaven grow black to him, then we can
-act for good all round and send him peace. My mind is made up. Let
-us go. You return home for tonight to your asylum, and see that all
-be well. As for me, I shall spend the night here in this churchyard
-in my own way. Tomorrow night you will come to me to the Berkeley
-Hotel at ten of the clock. I shall send for Arthur to come too, and
-also that so fine young man of America that gave his blood. Later we
-shall all have work to do. I come with you so far as Piccadilly and
-there dine, for I must be back here before the sun set."
-
-So we locked the tomb and came away, and got over the wall of the
-churchyard, which was not much of a task, and drove back to
-Piccadilly.
-
-
-
-
-NOTE LEFT BY VAN HELSING IN HIS PORTMANTEAU, BERKELEY HOTEL DIRECTED TO
-JOHN SEWARD, M. D. (Not Delivered)
-
-27 September
-
-"Friend John,
-
-"I write this in case anything should happen. I go alone to
-watch in that churchyard. It pleases me that the UnDead,
-Miss Lucy, shall not leave tonight, that so on the morrow
-night she may be more eager. Therefore I shall fix some
-things she like not, garlic and a crucifix, and so seal up
-the door of the tomb. She is young as UnDead, and will
-heed. Moreover, these are only to prevent her coming out.
-They may not prevail on her wanting to get in, for then the
-UnDead is desperate, and must find the line of least resistance,
-whatsoever it may be. I shall be at hand all the night from
-sunset till after sunrise, and if there be aught that may be
-learned I shall learn it. For Miss Lucy or from her, I have no
-fear, but that other to whom is there that she is UnDead, he have
-not the power to seek her tomb and find shelter. He is cunning,
-as I know from Mr. Jonathan and from the way that all along he
-have fooled us when he played with us for Miss Lucy's life, and
-we lost, and in many ways the UnDead are strong. He have always
-the strength in his hand of twenty men, even we four who gave our
-strength to Miss Lucy it also is all to him. Besides, he can
-summon his wolf and I know not what. So if it be that he came
-thither on this night he shall find me. But none other shall,
-until it be too late. But it may be that he will not attempt the
-place. There is no reason why he should. His hunting ground is
-more full of game than the churchyard where the UnDead woman
-sleeps, and the one old man watch.
-
-"Therefore I write this in case . . . Take the papers that
-are with this, the diaries of Harker and the rest, and read
-them, and then find this great UnDead, and cut off his head
-and burn his heart or drive a stake through it, so that the
-world may rest from him.
-
-"If it be so, farewell.
-
-"VAN HELSING."
-
-
-
-
-DR. SEWARD'S DIARY
-
-28 September.--It is wonderful what a good night's sleep will do for
-one. Yesterday I was almost willing to accept Van Helsing's monstrous
-ideas, but now they seem to start out lurid before me as outrages on
-common sense. I have no doubt that he believes it all. I wonder if
-his mind can have become in any way unhinged. Surely there must be
-some rational explanation of all these mysterious things. Is it
-possible that the Professor can have done it himself? He is so
-abnormally clever that if he went off his head he would carry out his
-intent with regard to some fixed idea in a wonderful way. I am loathe
-to think it, and indeed it would be almost as great a marvel as the
-other to find that Van Helsing was mad, but anyhow I shall watch him
-carefully. I may get some light on the mystery.
-
-
-29 September.--Last night, at a little before ten o'clock, Arthur and
-Quincey came into Van Helsing's room. He told us all what he wanted
-us to do, but especially addressing himself to Arthur, as if all our
-wills were centred in his. He began by saying that he hoped we would
-all come with him too, "for," he said, "there is a grave duty to be
-done there. You were doubtless surprised at my letter?" This query
-was directly addressed to Lord Godalming.
-
-"I was. It rather upset me for a bit. There has been so much trouble
-around my house of late that I could do without any more. I have been
-curious, too, as to what you mean.
-
-"Quincey and I talked it over, but the more we talked, the more
-puzzled we got, till now I can say for myself that I'm about up a tree
-as to any meaning about anything."
-
-"Me too," said Quincey Morris laconically.
-
-"Oh," said the Professor, "then you are nearer the beginning, both of
-you, than friend John here, who has to go a long way back before he
-can even get so far as to begin."
-
-It was evident that he recognized my return to my old doubting frame
-of mind without my saying a word. Then, turning to the other two, he
-said with intense gravity,
-
-"I want your permission to do what I think good this night. It is, I
-know, much to ask, and when you know what it is I propose to do you
-will know, and only then how much. Therefore may I ask that you
-promise me in the dark, so that afterwards, though you may be angry
-with me for a time, I must not disguise from myself the possibility
-that such may be, you shall not blame yourselves for anything."
-
-"That's frank anyhow," broke in Quincey. "I'll answer for the
-Professor. I don't quite see his drift, but I swear he's honest, and
-that's good enough for me."
-
-"I thank you, Sir," said Van Helsing proudly. "I have done myself the
-honour of counting you one trusting friend, and such endorsement is
-dear to me." He held out a hand, which Quincey took.
-
-Then Arthur spoke out, "Dr. Van Helsing, I don't quite like to 'buy a
-pig in a poke', as they say in Scotland, and if it be anything in
-which my honour as a gentleman or my faith as a Christian is
-concerned, I cannot make such a promise. If you can assure me that
-what you intend does not violate either of these two, then I give my
-consent at once, though for the life of me, I cannot understand what
-you are driving at."
-
-"I accept your limitation," said Van Helsing, "and all I ask of you is
-that if you feel it necessary to condemn any act of mine, you will
-first consider it well and be satisfied that it does not violate your
-reservations."
-
-"Agreed!" said Arthur. "That is only fair. And now that the
-pourparlers are over, may I ask what it is we are to do?"
-
-"I want you to come with me, and to come in secret, to the churchyard
-at Kingstead."
-
-Arthur's face fell as he said in an amazed sort of way,
-
-"Where poor Lucy is buried?"
-
-The Professor bowed.
-
-Arthur went on, "And when there?"
-
-"To enter the tomb!"
-
-Arthur stood up. "Professor, are you in earnest, or is it some
-monstrous joke? Pardon me, I see that you are in earnest." He sat
-down again, but I could see that he sat firmly and proudly, as one who
-is on his dignity. There was silence until he asked again, "And when
-in the tomb?"
-
-"To open the coffin."
-
-"This is too much!" he said, angrily rising again. "I am willing to
-be patient in all things that are reasonable, but in this, this
-desecration of the grave, of one who . . ." He fairly choked with
-indignation.
-
-The Professor looked pityingly at him. "If I could spare you one pang,
-my poor friend," he said, "God knows I would. But this night our feet
-must tread in thorny paths, or later, and for ever, the feet you love
-must walk in paths of flame!"
-
-Arthur looked up with set white face and said, "Take care, sir, take
-care!"
-
-"Would it not be well to hear what I have to say?" said Van Helsing.
-"And then you will at least know the limit of my purpose. Shall I go
-on?"
-
-"That's fair enough," broke in Morris.
-
-After a pause Van Helsing went on, evidently with an effort, "Miss
-Lucy is dead, is it not so? Yes! Then there can be no wrong to her.
-But if she be not dead . . ."
-
-Arthur jumped to his feet, "Good God!" he cried. "What do you mean?
-Has there been any mistake, has she been buried alive?" He groaned in
-anguish that not even hope could soften.
-
-"I did not say she was alive, my child. I did not think it. I go no
-further than to say that she might be UnDead."
-
-"UnDead! Not alive! What do you mean? Is this all a nightmare, or
-what is it?"
-
-"There are mysteries which men can only guess at, which age by age
-they may solve only in part. Believe me, we are now on the verge of
-one. But I have not done. May I cut off the head of dead Miss Lucy?"
-
-"Heavens and earth, no!" cried Arthur in a storm of passion. "Not for
-the wide world will I consent to any mutilation of her dead body. Dr.
-Van Helsing, you try me too far. What have I done to you that you
-should torture me so? What did that poor, sweet girl do that you
-should want to cast such dishonour on her grave? Are you mad, that you
-speak of such things, or am I mad to listen to them? Don't dare think
-more of such a desecration. I shall not give my consent to anything
-you do. I have a duty to do in protecting her grave from outrage, and
-by God, I shall do it!"
-
-Van Helsing rose up from where he had all the time been seated, and
-said, gravely and sternly, "My Lord Godalming, I too, have a duty to
-do, a duty to others, a duty to you, a duty to the dead, and by God, I
-shall do it! All I ask you now is that you come with me, that you
-look and listen, and if when later I make the same request you do not
-be more eager for its fulfillment even than I am, then, I shall do my
-duty, whatever it may seem to me. And then, to follow your Lordship's
-wishes I shall hold myself at your disposal to render an account to
-you, when and where you will." His voice broke a little, and he went
-on with a voice full of pity.
-
-"But I beseech you, do not go forth in anger with me. In a long life
-of acts which were often not pleasant to do, and which sometimes did
-wring my heart, I have never had so heavy a task as now. Believe me
-that if the time comes for you to change your mind towards me, one
-look from you will wipe away all this so sad hour, for I would do what
-a man can to save you from sorrow. Just think. For why should I give
-myself so much labor and so much of sorrow? I have come here from my
-own land to do what I can of good, at the first to please my friend
-John, and then to help a sweet young lady, whom too, I come to love.
-For her, I am ashamed to say so much, but I say it in kindness, I gave
-what you gave, the blood of my veins. I gave it, I who was not, like
-you, her lover, but only her physician and her friend. I gave her my
-nights and days, before death, after death, and if my death can do her
-good even now, when she is the dead UnDead, she shall have it freely."
-He said this with a very grave, sweet pride, and Arthur was much
-affected by it.
-
-He took the old man's hand and said in a broken voice, "Oh, it is hard
-to think of it, and I cannot understand, but at least I shall go with
-you and wait."
-
-
-
-
-CHAPTER 16
-
-
-DR. SEWARD'S DIARY--cont.
-
-It was just a quarter before twelve o'clock when we got into the
-churchyard over the low wall. The night was dark with occasional
-gleams of moonlight between the dents of the heavy clouds that scudded
-across the sky. We all kept somehow close together, with Van Helsing
-slightly in front as he led the way. When we had come close to the
-tomb I looked well at Arthur, for I feared the proximity to a place
-laden with so sorrowful a memory would upset him, but he bore himself
-well. I took it that the very mystery of the proceeding was in some
-way a counteractant to his grief. The Professor unlocked the door,
-and seeing a natural hesitation amongst us for various reasons, solved
-the difficulty by entering first himself. The rest of us followed,
-and he closed the door. He then lit a dark lantern and pointed to a
-coffin. Arthur stepped forward hesitatingly. Van Helsing said to me,
-"You were with me here yesterday. Was the body of Miss Lucy in that
-coffin?"
-
-"It was."
-
-The Professor turned to the rest saying, "You hear, and yet there is
-no one who does not believe with me."
-
-He took his screwdriver and again took off the lid of the coffin.
-Arthur looked on, very pale but silent. When the lid was removed he
-stepped forward. He evidently did not know that there was a leaden
-coffin, or at any rate, had not thought of it. When he saw the rent
-in the lead, the blood rushed to his face for an instant, but as
-quickly fell away again, so that he remained of a ghastly whiteness.
-He was still silent. Van Helsing forced back the leaden flange, and
-we all looked in and recoiled.
-
-The coffin was empty!
-
-For several minutes no one spoke a word. The silence was broken by
-Quincey Morris, "Professor, I answered for you. Your word is all I
-want. I wouldn't ask such a thing ordinarily, I wouldn't so dishonour
-you as to imply a doubt, but this is a mystery that goes beyond any
-honour or dishonour. Is this your doing?"
-
-"I swear to you by all that I hold sacred that I have not removed or
-touched her. What happened was this. Two nights ago my friend Seward
-and I came here, with good purpose, believe me. I opened that coffin,
-which was then sealed up, and we found it as now, empty. We then
-waited, and saw something white come through the trees. The next day
-we came here in daytime and she lay there. Did she not, friend John?
-
-"Yes."
-
-"That night we were just in time. One more so small child was
-missing, and we find it, thank God, unharmed amongst the graves.
-Yesterday I came here before sundown, for at sundown the UnDead can
-move. I waited here all night till the sun rose, but I saw nothing.
-It was most probable that it was because I had laid over the clamps of
-those doors garlic, which the UnDead cannot bear, and other things
-which they shun. Last night there was no exodus, so tonight before
-the sundown I took away my garlic and other things. And so it is we
-find this coffin empty. But bear with me. So far there is much that
-is strange. Wait you with me outside, unseen and unheard, and things
-much stranger are yet to be. So," here he shut the dark slide of his
-lantern, "now to the outside." He opened the door, and we filed out,
-he coming last and locking the door behind him.
-
-Oh! But it seemed fresh and pure in the night air after the terror of
-that vault. How sweet it was to see the clouds race by, and the
-passing gleams of the moonlight between the scudding clouds crossing
-and passing, like the gladness and sorrow of a man's life. How sweet
-it was to breathe the fresh air, that had no taint of death and decay.
-How humanizing to see the red lighting of the sky beyond the hill, and
-to hear far away the muffled roar that marks the life of a great
-city. Each in his own way was solemn and overcome. Arthur was
-silent, and was, I could see, striving to grasp the purpose and the
-inner meaning of the mystery. I was myself tolerably patient, and
-half inclined again to throw aside doubt and to accept Van Helsing's
-conclusions. Quincey Morris was phlegmatic in the way of a man who
-accepts all things, and accepts them in the spirit of cool bravery,
-with hazard of all he has at stake. Not being able to smoke, he cut
-himself a good-sized plug of tobacco and began to chew. As to Van
-Helsing, he was employed in a definite way. First he took from his
-bag a mass of what looked like thin, wafer-like biscuit, which was
-carefully rolled up in a white napkin. Next he took out a double
-handful of some whitish stuff, like dough or putty. He crumbled the
-wafer up fine and worked it into the mass between his hands. This he
-then took, and rolling it into thin strips, began to lay them into the
-crevices between the door and its setting in the tomb. I was somewhat
-puzzled at this, and being close, asked him what it was that he was
-doing. Arthur and Quincey drew near also, as they too were curious.
-
-He answered, "I am closing the tomb so that the UnDead may not enter."
-
-"And is that stuff you have there going to do it?"
-
-"It is."
-
-"What is that which you are using?" This time the question was by
-Arthur. Van Helsing reverently lifted his hat as he answered.
-
-"The Host. I brought it from Amsterdam. I have an Indulgence."
-
-It was an answer that appalled the most sceptical of us, and we felt
-individually that in the presence of such earnest purpose as the
-Professor's, a purpose which could thus use the to him most sacred of
-things, it was impossible to distrust. In respectful silence we took
-the places assigned to us close round the tomb, but hidden from the
-sight of any one approaching. I pitied the others, especially Arthur.
-I had myself been apprenticed by my former visits to this watching
-horror, and yet I, who had up to an hour ago repudiated the proofs,
-felt my heart sink within me. Never did tombs look so ghastly white.
-Never did cypress, or yew, or juniper so seem the embodiment of
-funeral gloom. Never did tree or grass wave or rustle so ominously.
-Never did bough creak so mysteriously, and never did the far-away
-howling of dogs send such a woeful presage through the night.
-
-There was a long spell of silence, big, aching, void, and then from
-the Professor a keen "S-s-s-s!" He pointed, and far down the avenue of
-yews we saw a white figure advance, a dim white figure, which held
-something dark at its breast. The figure stopped, and at the moment a
-ray of moonlight fell upon the masses of driving clouds, and showed in
-startling prominence a dark-haired woman, dressed in the cerements of
-the grave. We could not see the face, for it was bent down over what
-we saw to be a fair-haired child. There was a pause and a sharp
-little cry, such as a child gives in sleep, or a dog as it lies before
-the fire and dreams. We were starting forward, but the Professor's
-warning hand, seen by us as he stood behind a yew tree, kept us back.
-And then as we looked the white figure moved forwards again. It was
-now near enough for us to see clearly, and the moonlight still held.
-My own heart grew cold as ice, and I could hear the gasp of Arthur, as
-we recognized the features of Lucy Westenra. Lucy Westenra, but yet
-how changed. The sweetness was turned to adamantine, heartless
-cruelty, and the purity to voluptuous wantonness.
-
-Van Helsing stepped out, and obedient to his gesture, we all advanced
-too. The four of us ranged in a line before the door of the tomb. Van
-Helsing raised his lantern and drew the slide. By the concentrated
-light that fell on Lucy's face we could see that the lips were crimson
-with fresh blood, and that the stream had trickled over her chin and
-stained the purity of her lawn death-robe.
-
-We shuddered with horror. I could see by the tremulous light that
-even Van Helsing's iron nerve had failed. Arthur was next to me, and
-if I had not seized his arm and held him up, he would have fallen.
-
-When Lucy, I call the thing that was before us Lucy because it bore
-her shape, saw us she drew back with an angry snarl, such as a cat
-gives when taken unawares, then her eyes ranged over us. Lucy's eyes
-in form and colour, but Lucy's eyes unclean and full of hell fire,
-instead of the pure, gentle orbs we knew. At that moment the remnant
-of my love passed into hate and loathing. Had she then to be killed,
-I could have done it with savage delight. As she looked, her eyes
-blazed with unholy light, and the face became wreathed with a
-voluptuous smile. Oh, God, how it made me shudder to see it! With a
-careless motion, she flung to the ground, callous as a devil, the
-child that up to now she had clutched strenuously to her breast,
-growling over it as a dog growls over a bone. The child gave a sharp
-cry, and lay there moaning. There was a cold-bloodedness in the act
-which wrung a groan from Arthur. When she advanced to him with
-outstretched arms and a wanton smile he fell back and hid his face in
-his hands.
-
-She still advanced, however, and with a languorous, voluptuous grace,
-said, "Come to me, Arthur. Leave these others and come to me. My
-arms are hungry for you. Come, and we can rest together. Come, my
-husband, come!"
-
-There was something diabolically sweet in her tones, something of the
-tinkling of glass when struck, which rang through the brains even of
-us who heard the words addressed to another.
-
-As for Arthur, he seemed under a spell, moving his hands from his
-face, he opened wide his arms. She was leaping for them, when Van
-Helsing sprang forward and held between them his little golden
-crucifix. She recoiled from it, and, with a suddenly distorted face,
-full of rage, dashed past him as if to enter the tomb.
-
-When within a foot or two of the door, however, she stopped, as if
-arrested by some irresistible force. Then she turned, and her face
-was shown in the clear burst of moonlight and by the lamp, which had
-now no quiver from Van Helsing's nerves. Never did I see such baffled
-malice on a face, and never, I trust, shall such ever be seen again by
-mortal eyes. The beautiful colour became livid, the eyes seemed to
-throw out sparks of hell fire, the brows were wrinkled as though the
-folds of flesh were the coils of Medusa's snakes, and the lovely,
-blood-stained mouth grew to an open square, as in the passion masks of
-the Greeks and Japanese. If ever a face meant death, if looks could
-kill, we saw it at that moment.
-
-And so for full half a minute, which seemed an eternity, she remained
-between the lifted crucifix and the sacred closing of her means of
-entry.
-
-Van Helsing broke the silence by asking Arthur, "Answer me, oh my
-friend! Am I to proceed in my work?"
-
-"Do as you will, friend. Do as you will. There can be no horror like
-this ever any more." And he groaned in spirit.
-
-Quincey and I simultaneously moved towards him, and took his arms. We
-could hear the click of the closing lantern as Van Helsing held it
-down. Coming close to the tomb, he began to remove from the chinks
-some of the sacred emblem which he had placed there. We all looked on
-with horrified amazement as we saw, when he stood back, the woman,
-with a corporeal body as real at that moment as our own, pass through
-the interstice where scarce a knife blade could have gone. We all
-felt a glad sense of relief when we saw the Professor calmly restoring
-the strings of putty to the edges of the door.
-
-When this was done, he lifted the child and said, "Come now, my
-friends. We can do no more till tomorrow. There is a funeral at
-noon, so here we shall all come before long after that. The friends
-of the dead will all be gone by two, and when the sexton locks the
-gate we shall remain. Then there is more to do, but not like this of
-tonight. As for this little one, he is not much harmed, and by
-tomorrow night he shall be well. We shall leave him where the police
-will find him, as on the other night, and then to home."
-
-Coming close to Arthur, he said, "My friend Arthur, you have had a sore
-trial, but after, when you look back, you will see how it was
-necessary. You are now in the bitter waters, my child. By this time
-tomorrow you will, please God, have passed them, and have drunk of the
-sweet waters. So do not mourn over-much. Till then I shall not ask
-you to forgive me."
-
-Arthur and Quincey came home with me, and we tried to cheer each other
-on the way. We had left behind the child in safety, and were tired.
-So we all slept with more or less reality of sleep.
-
-
-29 September, night.--A little before twelve o'clock we three, Arthur,
-Quincey Morris, and myself, called for the Professor. It was odd to
-notice that by common consent we had all put on black clothes. Of
-course, Arthur wore black, for he was in deep mourning, but the rest
-of us wore it by instinct. We got to the graveyard by half-past one,
-and strolled about, keeping out of official observation, so that when
-the gravediggers had completed their task and the sexton, under the
-belief that every one had gone, had locked the gate, we had the place
-all to ourselves. Van Helsing, instead of his little black bag, had
-with him a long leather one, something like a cricketing bag. It was
-manifestly of fair weight.
-
-When we were alone and had heard the last of the footsteps die out up
-the road, we silently, and as if by ordered intention, followed the
-Professor to the tomb. He unlocked the door, and we entered, closing
-it behind us. Then he took from his bag the lantern, which he lit,
-and also two wax candles, which, when lighted, he stuck by melting
-their own ends, on other coffins, so that they might give light
-sufficient to work by. When he again lifted the lid off Lucy's coffin
-we all looked, Arthur trembling like an aspen, and saw that the corpse
-lay there in all its death beauty. But there was no love in my own
-heart, nothing but loathing for the foul Thing which had taken Lucy's
-shape without her soul. I could see even Arthur's face grow hard as
-he looked. Presently he said to Van Helsing, "Is this really Lucy's
-body, or only a demon in her shape?"
-
-"It is her body, and yet not it. But wait a while, and you shall see
-her as she was, and is."
-
-She seemed like a nightmare of Lucy as she lay there, the pointed
-teeth, the blood stained, voluptuous mouth, which made one shudder to
-see, the whole carnal and unspirited appearance, seeming like a
-devilish mockery of Lucy's sweet purity. Van Helsing, with his usual
-methodicalness, began taking the various contents from his bag and
-placing them ready for use. First he took out a soldering iron and
-some plumbing solder, and then small oil lamp, which gave out, when
-lit in a corner of the tomb, gas which burned at a fierce heat with a
-blue flame, then his operating knives, which he placed to hand, and
-last a round wooden stake, some two and a half or three inches thick
-and about three feet long. One end of it was hardened by charring in
-the fire, and was sharpened to a fine point. With this stake came a
-heavy hammer, such as in households is used in the coal cellar for
-breaking the lumps. To me, a doctor's preparations for work of any
-kind are stimulating and bracing, but the effect of these things on
-both Arthur and Quincey was to cause them a sort of consternation.
-They both, however, kept their courage, and remained silent and quiet.
-
-When all was ready, Van Helsing said, "Before we do anything, let me
-tell you this. It is out of the lore and experience of the ancients
-and of all those who have studied the powers of the UnDead. When they
-become such, there comes with the change the curse of immortality.
-They cannot die, but must go on age after age adding new victims and
-multiplying the evils of the world. For all that die from the preying
-of the Undead become themselves Undead, and prey on their kind. And
-so the circle goes on ever widening, like as the ripples from a stone
-thrown in the water. Friend Arthur, if you had met that kiss which
-you know of before poor Lucy die, or again, last night when you open
-your arms to her, you would in time, when you had died, have become
-nosferatu, as they call it in Eastern Europe, and would for all time
-make more of those Un-Deads that so have filled us with horror. The
-career of this so unhappy dear lady is but just begun. Those children
-whose blood she sucked are not as yet so much the worse, but if she
-lives on, UnDead, more and more they lose their blood and by her power
-over them they come to her, and so she draw their blood with that so
-wicked mouth. But if she die in truth, then all cease. The tiny
-wounds of the throats disappear, and they go back to their play
-unknowing ever of what has been. But of the most blessed of all, when
-this now UnDead be made to rest as true dead, then the soul of the
-poor lady whom we love shall again be free. Instead of working
-wickedness by night and growing more debased in the assimilating of it
-by day, she shall take her place with the other Angels. So that, my
-friend, it will be a blessed hand for her that shall strike the blow
-that sets her free. To this I am willing, but is there none amongst
-us who has a better right? Will it be no joy to think of hereafter in
-the silence of the night when sleep is not, 'It was my hand that sent
-her to the stars. It was the hand of him that loved her best, the
-hand that of all she would herself have chosen, had it been to her to
-choose?' Tell me if there be such a one amongst us?"
-
-We all looked at Arthur. He saw too, what we all did, the infinite
-kindness which suggested that his should be the hand which would
-restore Lucy to us as a holy, and not an unholy, memory. He stepped
-forward and said bravely, though his hand trembled, and his face was
-as pale as snow, "My true friend, from the bottom of my broken heart I
-thank you. Tell me what I am to do, and I shall not falter!"
-
-Van Helsing laid a hand on his shoulder, and said, "Brave lad! A
-moment's courage, and it is done. This stake must be driven through
-her. It well be a fearful ordeal, be not deceived in that, but it
-will be only a short time, and you will then rejoice more than your
-pain was great. From this grim tomb you will emerge as though you
-tread on air. But you must not falter when once you have begun. Only
-think that we, your true friends, are round you, and that we pray for
-you all the time."
-
-"Go on," said Arthur hoarsely. "Tell me what I am to do."
-
-"Take this stake in your left hand, ready to place to the point over
-the heart, and the hammer in your right. Then when we begin our
-prayer for the dead, I shall read him, I have here the book, and the
-others shall follow, strike in God's name, that so all may be well
-with the dead that we love and that the UnDead pass away."
-
-Arthur took the stake and the hammer, and when once his mind was set
-on action his hands never trembled nor even quivered. Van Helsing
-opened his missal and began to read, and Quincey and I followed as
-well as we could.
-
-Arthur placed the point over the heart, and as I looked I could see its
-dint in the white flesh. Then he struck with all his might.
-
-The thing in the coffin writhed, and a hideous, blood-curdling screech
-came from the opened red lips. The body shook and quivered and
-twisted in wild contortions. The sharp white teeth champed together till
-the lips were cut, and the mouth was smeared with a crimson foam. But
-Arthur never faltered. He looked like a figure of Thor as his
-untrembling arm rose and fell, driving deeper and deeper the
-mercy-bearing stake, whilst the blood from the pierced heart welled
-and spurted up around it. His face was set, and high duty seemed to
-shine through it. The sight of it gave us courage so that our voices
-seemed to ring through the little vault.
-
-And then the writhing and quivering of the body became less, and the
-teeth seemed to champ, and the face to quiver. Finally it lay still.
-The terrible task was over.
-
-The hammer fell from Arthur's hand. He reeled and would have fallen
-had we not caught him. The great drops of sweat sprang from his
-forehead, and his breath came in broken gasps. It had indeed been an
-awful strain on him, and had he not been forced to his task by more
-than human considerations he could never have gone through with it.
-For a few minutes we were so taken up with him that we did not look
-towards the coffin. When we did, however, a murmur of startled
-surprise ran from one to the other of us. We gazed so eagerly that
-Arthur rose, for he had been seated on the ground, and came and looked
-too, and then a glad strange light broke over his face and dispelled
-altogether the gloom of horror that lay upon it.
-
-There, in the coffin lay no longer the foul Thing that we had so
-dreaded and grown to hate that the work of her destruction was yielded
-as a privilege to the one best entitled to it, but Lucy as we had seen
-her in life, with her face of unequalled sweetness and purity. True
-that there were there, as we had seen them in life, the traces of care
-and pain and waste. But these were all dear to us, for they marked
-her truth to what we knew. One and all we felt that the holy calm
-that lay like sunshine over the wasted face and form was only an
-earthly token and symbol of the calm that was to reign for ever.
-
-Van Helsing came and laid his hand on Arthur's shoulder, and said to
-him, "And now, Arthur my friend, dear lad, am I not forgiven?"
-
-The reaction of the terrible strain came as he took the old man's hand
-in his, and raising it to his lips, pressed it, and said, "Forgiven!
-God bless you that you have given my dear one her soul again, and me
-peace." He put his hands on the Professor's shoulder, and laying his
-head on his breast, cried for a while silently, whilst we stood
-unmoving.
-
-When he raised his head Van Helsing said to him, "And now, my child,
-you may kiss her. Kiss her dead lips if you will, as she would have
-you to, if for her to choose. For she is not a grinning devil now,
-not any more a foul Thing for all eternity. No longer she is the
-devil's UnDead. She is God's true dead, whose soul is with Him!"
-
-Arthur bent and kissed her, and then we sent him and Quincey out of the
-tomb. The Professor and I sawed the top off the stake, leaving the
-point of it in the body. Then we cut off the head and filled the
-mouth with garlic. We soldered up the leaden coffin, screwed on the
-coffin lid, and gathering up our belongings, came away. When the
-Professor locked the door he gave the key to Arthur.
-
-Outside the air was sweet, the sun shone, and the birds sang, and it
-seemed as if all nature were tuned to a different pitch. There was
-gladness and mirth and peace everywhere, for we were at rest ourselves
-on one account, and we were glad, though it was with a tempered joy.
-
-Before we moved away Van Helsing said, "Now, my friends, one step of
-our work is done, one the most harrowing to ourselves. But there
-remains a greater task: to find out the author of all this our sorrow
-and to stamp him out. I have clues which we can follow, but it is a
-long task, and a difficult one, and there is danger in it, and pain.
-Shall you not all help me? We have learned to believe, all of us, is
-it not so? And since so, do we not see our duty? Yes! And do we not
-promise to go on to the bitter end?"
-
-Each in turn, we took his hand, and the promise was made. Then said
-the Professor as we moved off, "Two nights hence you shall meet with
-me and dine together at seven of the clock with friend John. I shall
-entreat two others, two that you know not as yet, and I shall be ready
-to all our work show and our plans unfold. Friend John, you come with
-me home, for I have much to consult you about, and you can help me.
-Tonight I leave for Amsterdam, but shall return tomorrow night. And
-then begins our great quest. But first I shall have much to say, so
-that you may know what to do and to dread. Then our promise shall be
-made to each other anew. For there is a terrible task before us, and
-once our feet are on the ploughshare we must not draw back."
-
-
-
-
-CHAPTER 17
-
-
-DR. SEWARD'S DIARY--cont.
-
-When we arrived at the Berkely Hotel, Van Helsing found a telegram
-waiting for him.
-
-"Am coming up by train. Jonathan at Whitby. Important news. Mina
-Harker."
-
-
-The Professor was delighted. "Ah, that wonderful Madam Mina," he
-said, "pearl among women! She arrive, but I cannot stay. She must go
-to your house, friend John. You must meet her at the station.
-Telegraph her en route so that she may be prepared."
-
-When the wire was dispatched he had a cup of tea. Over it he told me
-of a diary kept by Jonathan Harker when abroad, and gave me a
-typewritten copy of it, as also of Mrs. Harker's diary at Whitby.
-"Take these," he said, "and study them well. When I have returned you
-will be master of all the facts, and we can then better enter on our
-inquisition. Keep them safe, for there is in them much of treasure.
-You will need all your faith, even you who have had such an experience
-as that of today. What is here told," he laid his hand heavily and
-gravely on the packet of papers as he spoke, "may be the beginning of
-the end to you and me and many another, or it may sound the knell of
-the UnDead who walk the earth. Read all, I pray you, with the open
-mind, and if you can add in any way to the story here told do so, for
-it is all important. You have kept a diary of all these so strange
-things, is it not so? Yes! Then we shall go through all these
-together when we meet." He then made ready for his departure and
-shortly drove off to Liverpool Street. I took my way to Paddington,
-where I arrived about fifteen minutes before the train came in.
-
-The crowd melted away, after the bustling fashion common to arrival
-platforms, and I was beginning to feel uneasy, lest I might miss my
-guest, when a sweet-faced, dainty looking girl stepped up to me, and
-after a quick glance said, "Dr. Seward, is it not?"
-
-"And you are Mrs. Harker!" I answered at once, whereupon she held out
-her hand.
-
-"I knew you from the description of poor dear Lucy, but . . ." She
-stopped suddenly, and a quick blush overspread her face.
-
-The blush that rose to my own cheeks somehow set us both at ease, for
-it was a tacit answer to her own. I got her luggage, which included a
-typewriter, and we took the Underground to Fenchurch Street, after I
-had sent a wire to my housekeeper to have a sitting room and a bedroom
-prepared at once for Mrs. Harker.
-
-In due time we arrived. She knew, of course, that the place was a
-lunatic asylum, but I could see that she was unable to repress a
-shudder when we entered.
-
-She told me that, if she might, she would come presently to my study,
-as she had much to say. So here I am finishing my entry in my
-phonograph diary whilst I await her. As yet I have not had the chance
-of looking at the papers which Van Helsing left with me, though they
-lie open before me. I must get her interested in something, so that I
-may have an opportunity of reading them. She does not know how
-precious time is, or what a task we have in hand. I must be careful
-not to frighten her. Here she is!
-
-
-
-
-MINA HARKER'S JOURNAL
-
-29 September.--After I had tidied myself, I went down to Dr. Seward's
-study. At the door I paused a moment, for I thought I heard him
-talking with some one. As, however, he had pressed me to be quick, I
-knocked at the door, and on his calling out, "Come in," I entered.
-
-To my intense surprise, there was no one with him. He was quite
-alone, and on the table opposite him was what I knew at once from the
-description to be a phonograph. I had never seen one, and was much
-interested.
-
-"I hope I did not keep you waiting," I said, "but I stayed at the door
-as I heard you talking, and thought there was someone with you."
-
-"Oh," he replied with a smile, "I was only entering my diary."
-
-"Your diary?" I asked him in surprise.
-
-"Yes," he answered. "I keep it in this." As he spoke he laid his
-hand on the phonograph. I felt quite excited over it, and blurted
-out, "Why, this beats even shorthand! May I hear it say something?"
-
-"Certainly," he replied with alacrity, and stood up to put it in train
-for speaking. Then he paused, and a troubled look overspread his
-face.
-
-"The fact is," he began awkwardly, "I only keep my diary in it, and as
-it is entirely, almost entirely, about my cases it may be awkward,
-that is, I mean . . ." He stopped, and I tried to help him out of his
-embarrassment.
-
-"You helped to attend dear Lucy at the end. Let me hear how she died,
-for all that I know of her, I shall be very grateful. She was very,
-very dear to me."
-
-To my surprise, he answered, with a horrorstruck look in his face,
-"Tell you of her death? Not for the wide world!"
-
-"Why not?" I asked, for some grave, terrible feeling was coming over me.
-
-Again he paused, and I could see that he was trying to invent an
-excuse. At length, he stammered out, "You see, I do not know how to
-pick out any particular part of the diary."
-
-Even while he was speaking an idea dawned upon him, and he said with
-unconscious simplicity, in a different voice, and with the naivete of
-a child, "that's quite true, upon my honour. Honest Indian!"
-
-I could not but smile, at which he grimaced. "I gave myself away that
-time!" he said. "But do you know that, although I have kept the diary
-for months past, it never once struck me how I was going to find any
-particular part of it in case I wanted to look it up?"
-
-By this time my mind was made up that the diary of a doctor who
-attended Lucy might have something to add to the sum of our knowledge
-of that terrible Being, and I said boldly, "Then, Dr. Seward, you had
-better let me copy it out for you on my typewriter."
-
-He grew to a positively deathly pallor as he said, "No! No! No! For
-all the world. I wouldn't let you know that terrible story!"
-
-Then it was terrible. My intuition was right! For a moment, I
-thought, and as my eyes ranged the room, unconsciously looking for
-something or some opportunity to aid me, they lit on a great batch of
-typewriting on the table. His eyes caught the look in mine, and
-without his thinking, followed their direction. As they saw the
-parcel he realized my meaning.
-
-"You do not know me," I said. "When you have read those papers, my
-own diary and my husband's also, which I have typed, you will know me
-better. I have not faltered in giving every thought of my own heart
-in this cause. But, of course, you do not know me, yet, and I must
-not expect you to trust me so far."
-
-He is certainly a man of noble nature. Poor dear Lucy was right about
-him. He stood up and opened a large drawer, in which were arranged in
-order a number of hollow cylinders of metal covered with dark wax, and
-said,
-
-"You are quite right. I did not trust you because I did not know
-you. But I know you now, and let me say that I should have known you
-long ago. I know that Lucy told you of me. She told me of you too.
-May I make the only atonement in my power? Take the cylinders and
-hear them. The first half-dozen of them are personal to me, and they
-will not horrify you. Then you will know me better. Dinner will by
-then be ready. In the meantime I shall read over some of these
-documents, and shall be better able to understand certain things."
-
-He carried the phonograph himself up to my sitting room and adjusted
-it for me. Now I shall learn something pleasant, I am sure. For it
-will tell me the other side of a true love episode of which I know one
-side already.
-
-
-
-
-DR. SEWARD'S DIARY
-
-29 September.--I was so absorbed in that wonderful diary of Jonathan
-Harker and that other of his wife that I let the time run on without
-thinking. Mrs. Harker was not down when the maid came to announce
-dinner, so I said, "She is possibly tired. Let dinner wait an hour,"
-and I went on with my work. I had just finished Mrs. Harker's diary,
-when she came in. She looked sweetly pretty, but very sad, and her
-eyes were flushed with crying. This somehow moved me much. Of late I
-have had cause for tears, God knows! But the relief of them was
-denied me, and now the sight of those sweet eyes, brightened by recent
-tears, went straight to my heart. So I said as gently as I could, "I
-greatly fear I have distressed you."
-
-"Oh, no, not distressed me," she replied. "But I have been more
-touched than I can say by your grief. That is a wonderful machine,
-but it is cruelly true. It told me, in its very tones, the anguish of
-your heart. It was like a soul crying out to Almighty God. No one
-must hear them spoken ever again! See, I have tried to be useful. I
-have copied out the words on my typewriter, and none other need now
-hear your heart beat, as I did."
-
-"No one need ever know, shall ever know," I said in a low voice. She
-laid her hand on mine and said very gravely, "Ah, but they must!"
-
-"Must! But why?" I asked.
-
-"Because it is a part of the terrible story, a part of poor Lucy's
-death and all that led to it. Because in the struggle which we have
-before us to rid the earth of this terrible monster we must have all
-the knowledge and all the help which we can get. I think that the
-cylinders which you gave me contained more than you intended me to
-know. But I can see that there are in your record many lights to this
-dark mystery. You will let me help, will you not? I know all up to a
-certain point, and I see already, though your diary only took me to 7
-September, how poor Lucy was beset, and how her terrible doom was
-being wrought out. Jonathan and I have been working day and night
-since Professor Van Helsing saw us. He is gone to Whitby to get more
-information, and he will be here tomorrow to help us. We need have no
-secrets amongst us. Working together and with absolute trust, we can
-surely be stronger than if some of us were in the dark."
-
-She looked at me so appealingly, and at the same time manifested such
-courage and resolution in her bearing, that I gave in at once to her
-wishes. "You shall," I said, "do as you like in the matter. God
-forgive me if I do wrong! There are terrible things yet to learn of,
-but if you have so far traveled on the road to poor Lucy's death, you
-will not be content, I know, to remain in the dark. Nay, the end, the
-very end, may give you a gleam of peace. Come, there is dinner. We
-must keep one another strong for what is before us. We have a cruel
-and dreadful task. When you have eaten you shall learn the rest, and
-I shall answer any questions you ask, if there be anything which you
-do not understand, though it was apparent to us who were present."
-
-
-
-MINA HARKER'S JOURNAL
-
-29 September.--After dinner I came with Dr. Seward to his study. He
-brought back the phonograph from my room, and I took a chair, and
-arranged the phonograph so that I could touch it without getting up,
-and showed me how to stop it in case I should want to pause. Then he
-very thoughtfully took a chair, with his back to me, so that I might
-be as free as possible, and began to read. I put the forked metal to
-my ears and listened.
-
-When the terrible story of Lucy's death, and all that followed, was
-done, I lay back in my chair powerless. Fortunately I am not of a
-fainting disposition. When Dr. Seward saw me he jumped up with a
-horrified exclamation, and hurriedly taking a case bottle from the
-cupboard, gave me some brandy, which in a few minutes somewhat
-restored me. My brain was all in a whirl, and only that there came
-through all the multitude of horrors, the holy ray of light that my
-dear Lucy was at last at peace, I do not think I could have borne it
-without making a scene. It is all so wild and mysterious, and strange
-that if I had not known Jonathan's experience in Transylvania I could
-not have believed. As it was, I didn't know what to believe, and so
-got out of my difficulty by attending to something else. I took the
-cover off my typewriter, and said to Dr. Seward,
-
-"Let me write this all out now. We must be ready for Dr. Van Helsing
-when he comes. I have sent a telegram to Jonathan to come on here
-when he arrives in London from Whitby. In this matter dates are
-everything, and I think that if we get all of our material ready, and
-have every item put in chronological order, we shall have done much.
-
-"You tell me that Lord Godalming and Mr. Morris are coming too. Let
-us be able to tell them when they come."
-
-He accordingly set the phonograph at a slow pace, and I began to
-typewrite from the beginning of the seventeenth cylinder. I used
-manifold, and so took three copies of the diary, just as I had done
-with the rest. It was late when I got through, but Dr. Seward went
-about his work of going his round of the patients. When he had
-finished he came back and sat near me, reading, so that I did not feel
-too lonely whilst I worked. How good and thoughtful he is. The world
-seems full of good men, even if there are monsters in it.
-
-Before I left him I remembered what Jonathan put in his diary of the
-Professor's perturbation at reading something in an evening paper at
-the station at Exeter, so, seeing that Dr. Seward keeps his
-newspapers, I borrowed the files of 'The Westminster Gazette' and 'The
-Pall Mall Gazette' and took them to my room. I remember how much the
-'Dailygraph' and 'The Whitby Gazette', of which I had made cuttings,
-had helped us to understand the terrible events at Whitby when Count
-Dracula landed, so I shall look through the evening papers since then,
-and perhaps I shall get some new light. I am not sleepy, and the work
-will help to keep me quiet.
-
-
-
-
-DR. SEWARD'S DIARY
-
-30 September.--Mr. Harker arrived at nine o'clock. He got his wife's
-wire just before starting. He is uncommonly clever, if one can judge
-from his face, and full of energy. If this journal be true, and
-judging by one's own wonderful experiences, it must be, he is also a
-man of great nerve. That going down to the vault a second time was a
-remarkable piece of daring. After reading his account of it I was
-prepared to meet a good specimen of manhood, but hardly the quiet,
-businesslike gentleman who came here today.
-
-
-LATER.--After lunch Harker and his wife went back to their own room,
-and as I passed a while ago I heard the click of the typewriter. They
-are hard at it. Mrs. Harker says that they are knitting together in
-chronological order every scrap of evidence they have. Harker has got
-the letters between the consignee of the boxes at Whitby and the
-carriers in London who took charge of them. He is now reading his
-wife's transcript of my diary. I wonder what they make out of it.
-Here it is . . .
-
-Strange that it never struck me that the very next house might be the
-Count's hiding place! Goodness knows that we had enough clues from
-the conduct of the patient Renfield! The bundle of letters relating
-to the purchase of the house were with the transcript. Oh, if we had
-only had them earlier we might have saved poor Lucy! Stop! That way
-madness lies! Harker has gone back, and is again collecting material.
-He says that by dinner time they will be able to show a whole
-connected narrative. He thinks that in the meantime I should see
-Renfield, as hitherto he has been a sort of index to the coming and
-going of the Count. I hardly see this yet, but when I get at the
-dates I suppose I shall. What a good thing that Mrs. Harker put my
-cylinders into type! We never could have found the dates otherwise.
-
-I found Renfield sitting placidly in his room with his hands folded,
-smiling benignly. At the moment he seemed as sane as any one I ever
-saw. I sat down and talked with him on a lot of subjects, all of
-which he treated naturally. He then, of his own accord, spoke of
-going home, a subject he has never mentioned to my knowledge during
-his sojourn here. In fact, he spoke quite confidently of getting his
-discharge at once. I believe that, had I not had the chat with Harker
-and read the letters and the dates of his outbursts, I should have
-been prepared to sign for him after a brief time of observation. As
-it is, I am darkly suspicious. All those out-breaks were in some way
-linked with the proximity of the Count. What then does this absolute
-content mean? Can it be that his instinct is satisfied as to the
-vampire's ultimate triumph? Stay. He is himself zoophagous, and in
-his wild ravings outside the chapel door of the deserted house he
-always spoke of 'master'. This all seems confirmation of our idea.
-However, after a while I came away. My friend is just a little too
-sane at present to make it safe to probe him too deep with questions.
-He might begin to think, and then . . . So I came away. I mistrust
-these quiet moods of his, so I have given the attendant a hint to
-look closely after him, and to have a strait waistcoat ready in case
-of need.
-
-
-
-
-
-JOHNATHAN HARKER'S JOURNAL
-
-29 September, in train to London.--When I received Mr. Billington's
-courteous message that he would give me any information in his power I
-thought it best to go down to Whitby and make, on the spot, such
-inquiries as I wanted. It was now my object to trace that horrid
-cargo of the Count's to its place in London. Later, we may be able to
-deal with it. Billington junior, a nice lad, met me at the station,
-and brought me to his father's house, where they had decided that I
-must spend the night. They are hospitable, with true Yorkshire
-hospitality, give a guest everything and leave him to do as he likes.
-They all knew that I was busy, and that my stay was short, and Mr.
-Billington had ready in his office all the papers concerning the
-consignment of boxes. It gave me almost a turn to see again one of
-the letters which I had seen on the Count's table before I knew of his
-diabolical plans. Everything had been carefully thought out, and done
-systematically and with precision. He seemed to have been prepared
-for every obstacle which might be placed by accident in the way of his
-intentions being carried out. To use an Americanism, he had 'taken no
-chances', and the absolute accuracy with which his instructions were
-fulfilled was simply the logical result of his care. I saw the
-invoice, and took note of it. 'Fifty cases of common earth, to be used
-for experimental purposes'. Also the copy of the letter to Carter
-Paterson, and their reply. Of both these I got copies. This was all
-the information Mr. Billington could give me, so I went down to the
-port and saw the coastguards, the Customs Officers and the harbour
-master, who kindly put me in communication with the men who had
-actually received the boxes. Their tally was exact with the list, and
-they had nothing to add to the simple description 'fifty cases of
-common earth', except that the boxes were 'main and mortal heavy', and
-that shifting them was dry work. One of them added that it was hard
-lines that there wasn't any gentleman 'such like as like yourself,
-squire', to show some sort of appreciation of their efforts in a
-liquid form. Another put in a rider that the thirst then generated
-was such that even the time which had elapsed had not completely
-allayed it. Needless to add, I took care before leaving to lift,
-forever and adequately, this source of reproach.
-
-30 September.--The station master was good enough to give me a line to
-his old companion the station master at King's Cross, so that when I
-arrived there in the morning I was able to ask him about the arrival
-of the boxes. He, too put me at once in communication with the proper
-officials, and I saw that their tally was correct with the original
-invoice. The opportunities of acquiring an abnormal thirst had been
-here limited. A noble use of them had, however, been made, and again
-I was compelled to deal with the result in ex post facto manner.
-
-From thence I went to Carter Paterson's central office, where I met
-with the utmost courtesy. They looked up the transaction in their day
-book and letter book, and at once telephoned to their King's Cross
-office for more details. By good fortune, the men who did the teaming
-were waiting for work, and the official at once sent them over,
-sending also by one of them the way-bill and all the papers connected
-with the delivery of the boxes at Carfax. Here again I found the
-tally agreeing exactly. The carriers' men were able to supplement the
-paucity of the written words with a few more details. These were, I
-shortly found, connected almost solely with the dusty nature of the
-job, and the consequent thirst engendered in the operators. On my
-affording an opportunity, through the medium of the currency of the
-realm, of the allaying, at a later period, this beneficial evil, one
-of the men remarked,
-
-"That 'ere 'ouse, guv'nor, is the rummiest I ever was in. Blyme! But
-it ain't been touched sence a hundred years. There was dust that
-thick in the place that you might have slep' on it without 'urtin' of
-yer bones. An' the place was that neglected that yer might 'ave
-smelled ole Jerusalem in it. But the old chapel, that took the cike,
-that did! Me and my mate, we thort we wouldn't never git out quick
-enough. Lor', I wouldn't take less nor a quid a moment to stay there
-arter dark."
-
-Having been in the house, I could well believe him, but if he knew
-what I know, he would, I think have raised his terms.
-
-Of one thing I am now satisfied. That all those boxes which arrived at
-Whitby from Varna in the Demeter were safely deposited in the old
-chapel at Carfax. There should be fifty of them there, unless any
-have since been removed, as from Dr. Seward's diary I fear.
-
-
-Later.--Mina and I have worked all day, and we have put all the papers
-into order.
-
-
-
-
-MINA HARKER'S JOURNAL
-
-30 September.--I am so glad that I hardly know how to contain myself.
-It is, I suppose, the reaction from the haunting fear which I have
-had, that this terrible affair and the reopening of his old wound
-might act detrimentally on Jonathan. I saw him leave for Whitby with
-as brave a face as could, but I was sick with apprehension. The
-effort has, however, done him good. He was never so resolute, never
-so strong, never so full of volcanic energy, as at present. It is
-just as that dear, good Professor Van Helsing said, he is true grit,
-and he improves under strain that would kill a weaker nature. He came
-back full of life and hope and determination. We have got everything
-in order for tonight. I feel myself quite wild with excitement. I
-suppose one ought to pity anything so hunted as the Count. That is
-just it. This thing is not human, not even a beast. To read Dr.
-Seward's account of poor Lucy's death, and what followed, is enough to
-dry up the springs of pity in one's heart.
-
-
-Later.--Lord Godalming and Mr. Morris arrived earlier than we
-expected. Dr. Seward was out on business, and had taken Jonathan with
-him, so I had to see them. It was to me a painful meeting, for it
-brought back all poor dear Lucy's hopes of only a few months ago. Of
-course they had heard Lucy speak of me, and it seemed that Dr. Van
-Helsing, too, had been quite 'blowing my trumpet', as Mr. Morris
-expressed it. Poor fellows, neither of them is aware that I know all
-about the proposals they made to Lucy. They did not quite know what
-to say or do, as they were ignorant of the amount of my knowledge. So
-they had to keep on neutral subjects. However, I thought the matter
-over, and came to the conclusion that the best thing I could do would
-be to post them on affairs right up to date. I knew from Dr. Seward's
-diary that they had been at Lucy's death, her real death, and that I
-need not fear to betray any secret before the time. So I told them,
-as well as I could, that I had read all the papers and diaries, and
-that my husband and I, having typewritten them, had just finished
-putting them in order. I gave them each a copy to read in the
-library. When Lord Godalming got his and turned it over, it does make
-a pretty good pile, he said, "Did you write all this, Mrs. Harker?"
-
-I nodded, and he went on.
-
-"I don't quite see the drift of it, but you people are all so good and
-kind, and have been working so earnestly and so energetically, that
-all I can do is to accept your ideas blindfold and try to help you. I
-have had one lesson already in accepting facts that should make a man
-humble to the last hour of his life. Besides, I know you loved my
-Lucy . . ."
-
-Here he turned away and covered his face with his hands. I could hear
-the tears in his voice. Mr. Morris, with instinctive delicacy, just
-laid a hand for a moment on his shoulder, and then walked quietly out
-of the room. I suppose there is something in a woman's nature that
-makes a man free to break down before her and express his feelings on
-the tender or emotional side without feeling it derogatory to his
-manhood. For when Lord Godalming found himself alone with me he sat
-down on the sofa and gave way utterly and openly. I sat down beside
-him and took his hand. I hope he didn't think it forward of me, and
-that if he ever thinks of it afterwards he never will have such a
-thought. There I wrong him. I know he never will. He is too true a
-gentleman. I said to him, for I could see that his heart was
-breaking, "I loved dear Lucy, and I know what she was to you, and what
-you were to her. She and I were like sisters, and now she is gone,
-will you not let me be like a sister to you in your trouble? I know
-what sorrows you have had, though I cannot measure the depth of them.
-If sympathy and pity can help in your affliction, won't you let me be
-of some little service, for Lucy's sake?"
-
-In an instant the poor dear fellow was overwhelmed with grief. It
-seemed to me that all that he had of late been suffering in silence
-found a vent at once. He grew quite hysterical, and raising his open
-hands, beat his palms together in a perfect agony of grief. He stood
-up and then sat down again, and the tears rained down his cheeks. I
-felt an infinite pity for him, and opened my arms unthinkingly. With
-a sob he laid his head on my shoulder and cried like a wearied child,
-whilst he shook with emotion.
-
-We women have something of the mother in us that makes us rise above
-smaller matters when the mother spirit is invoked. I felt this big
-sorrowing man's head resting on me, as though it were that of a baby
-that some day may lie on my bosom, and I stroked his hair as though he
-were my own child. I never thought at the time how strange it all
-was.
-
-After a little bit his sobs ceased, and he raised himself with an
-apology, though he made no disguise of his emotion. He told me that
-for days and nights past, weary days and sleepless nights, he had been
-unable to speak with any one, as a man must speak in his time of
-sorrow. There was no woman whose sympathy could be given to him, or
-with whom, owing to the terrible circumstance with which his sorrow
-was surrounded, he could speak freely.
-
-"I know now how I suffered," he said, as he dried his eyes, "but I do
-not know even yet, and none other can ever know, how much your sweet
-sympathy has been to me today. I shall know better in time, and
-believe me that, though I am not ungrateful now, my gratitude will
-grow with my understanding. You will let me be like a brother, will
-you not, for all our lives, for dear Lucy's sake?"
-
-"For dear Lucy's sake," I said as we clasped hands. "Ay, and for your
-own sake," he added, "for if a man's esteem and gratitude are ever
-worth the winning, you have won mine today. If ever the future should
-bring to you a time when you need a man's help, believe me, you will
-not call in vain. God grant that no such time may ever come to you to
-break the sunshine of your life, but if it should ever come, promise
-me that you will let me know."
-
-He was so earnest, and his sorrow was so fresh, that I felt it would
-comfort him, so I said, "I promise."
-
-As I came along the corridor I saw Mr. Morris looking out of a window.
-He turned as he heard my footsteps. "How is Art?" he said. Then
-noticing my red eyes, he went on, "Ah, I see you have been comforting
-him. Poor old fellow! He needs it. No one but a woman can help a
-man when he is in trouble of the heart, and he had no one to comfort
-him."
-
-He bore his own trouble so bravely that my heart bled for him. I saw
-the manuscript in his hand, and I knew that when he read it he would
-realize how much I knew, so I said to him, "I wish I could comfort all
-who suffer from the heart. Will you let me be your friend, and will
-you come to me for comfort if you need it? You will know later why I
-speak."
-
-He saw that I was in earnest, and stooping, took my hand, and raising
-it to his lips, kissed it. It seemed but poor comfort to so brave and
-unselfish a soul, and impulsively I bent over and kissed him. The
-tears rose in his eyes, and there was a momentary choking in his
-throat. He said quite calmly, "Little girl, you will never forget
-that true hearted kindness, so long as ever you live!" Then he went
-into the study to his friend.
-
-"Little girl!" The very words he had used to Lucy, and, oh, but he
-proved himself a friend.
-
-
-
-
-CHAPTER 18
-
-
-DR. SEWARD'S DIARY
-
-30 September.--I got home at five o'clock, and found that Godalming
-and Morris had not only arrived, but had already studied the
-transcript of the various diaries and letters which Harker had not yet
-returned from his visit to the carriers' men, of whom Dr. Hennessey
-had written to me. Mrs. Harker gave us a cup of tea, and I can
-honestly say that, for the first time since I have lived in it, this
-old house seemed like home. When we had finished, Mrs. Harker said,
-
-"Dr. Seward, may I ask a favour? I want to see your patient, Mr.
-Renfield. Do let me see him. What you have said of him in your diary
-interests me so much!"
-
-She looked so appealing and so pretty that I could not refuse her, and
-there was no possible reason why I should, so I took her with me.
-When I went into the room, I told the man that a lady would like to see
-him, to which he simply answered, "Why?"
-
-"She is going through the house, and wants to see every one in it," I
-answered.
-
-"Oh, very well," he said, "let her come in, by all means, but just
-wait a minute till I tidy up the place."
-
-His method of tidying was peculiar, he simply swallowed all the flies
-and spiders in the boxes before I could stop him. It was quite
-evident that he feared, or was jealous of, some interference. When he
-had got through his disgusting task, he said cheerfully, "Let the lady
-come in," and sat down on the edge of his bed with his head down, but
-with his eyelids raised so that he could see her as she entered. For
-a moment I thought that he might have some homicidal intent. I
-remembered how quiet he had been just before he attacked me in my own
-study, and I took care to stand where I could seize him at once if he
-attempted to make a spring at her.
-
-She came into the room with an easy gracefulness which would at once
-command the respect of any lunatic, for easiness is one of the
-qualities mad people most respect. She walked over to him, smiling
-pleasantly, and held out her hand.
-
-"Good evening, Mr. Renfield," said she. "You see, I know you, for Dr.
-Seward has told me of you." He made no immediate reply, but eyed her
-all over intently with a set frown on his face. This look gave way to
-one of wonder, which merged in doubt, then to my intense astonishment
-he said, "You're not the girl the doctor wanted to marry, are you? You
-can't be, you know, for she's dead."
-
-Mrs. Harker smiled sweetly as she replied, "Oh no! I have a husband
-of my own, to whom I was married before I ever saw Dr. Seward, or he
-me. I am Mrs. Harker."
-
-"Then what are you doing here?"
-
-"My husband and I are staying on a visit with Dr. Seward."
-
-"Then don't stay."
-
-"But why not?"
-
-I thought that this style of conversation might not be pleasant to
-Mrs. Harker, any more than it was to me, so I joined in, "How did you
-know I wanted to marry anyone?"
-
-His reply was simply contemptuous, given in a pause in which he turned
-his eyes from Mrs. Harker to me, instantly turning them back again,
-"What an asinine question!"
-
-"I don't see that at all, Mr. Renfield," said Mrs. Harker, at once
-championing me.
-
-He replied to her with as much courtesy and respect as he had shown
-contempt to me, "You will, of course, understand, Mrs. Harker, that
-when a man is so loved and honoured as our host is, everything
-regarding him is of interest in our little community. Dr. Seward is
-loved not only by his household and his friends, but even by his
-patients, who, being some of them hardly in mental equilibrium, are
-apt to distort causes and effects. Since I myself have been an inmate
-of a lunatic asylum, I cannot but notice that the sophistic tendencies
-of some of its inmates lean towards the errors of non causa and
-ignoratio elenche."
-
-I positively opened my eyes at this new development. Here was my own
-pet lunatic, the most pronounced of his type that I had ever met with,
-talking elemental philosophy, and with the manner of a polished
-gentleman. I wonder if it was Mrs. Harker's presence which had
-touched some chord in his memory. If this new phase was spontaneous,
-or in any way due to her unconscious influence, she must have some
-rare gift or power.
-
-We continued to talk for some time, and seeing that he was seemingly
-quite reasonable, she ventured, looking at me questioningly as she
-began, to lead him to his favourite topic. I was again astonished,
-for he addressed himself to the question with the impartiality of
-the completest sanity. He even took himself as an example when he
-mentioned certain things.
-
-"Why, I myself am an instance of a man who had a strange belief.
-Indeed, it was no wonder that my friends were alarmed, and insisted on
-my being put under control. I used to fancy that life was a positive
-and perpetual entity, and that by consuming a multitude of live
-things, no matter how low in the scale of creation, one might
-indefinitely prolong life. At times I held the belief so strongly
-that I actually tried to take human life. The doctor here will bear
-me out that on one occasion I tried to kill him for the purpose of
-strengthening my vital powers by the assimilation with my own body of
-his life through the medium of his blood, relying of course, upon the
-Scriptural phrase, 'For the blood is the life.' Though, indeed, the
-vendor of a certain nostrum has vulgarized the truism to the very
-point of contempt. Isn't that true, doctor?"
-
-I nodded assent, for I was so amazed that I hardly knew what to either
-think or say, it was hard to imagine that I had seen him eat up his
-spiders and flies not five minutes before. Looking at my watch, I saw
-that I should go to the station to meet Van Helsing, so I told Mrs.
-Harker that it was time to leave.
-
-She came at once, after saying pleasantly to Mr. Renfield, "Goodbye,
-and I hope I may see you often, under auspices pleasanter to
-yourself."
-
-To which, to my astonishment, he replied, "Goodbye, my dear. I pray
-God I may never see your sweet face again. May He bless and keep
-you!"
-
-When I went to the station to meet Van Helsing I left the boys behind
-me. Poor Art seemed more cheerful than he has been since Lucy first
-took ill, and Quincey is more like his own bright self than he has
-been for many a long day.
-
-Van Helsing stepped from the carriage with the eager nimbleness of a
-boy. He saw me at once, and rushed up to me, saying, "Ah, friend
-John, how goes all? Well? So! I have been busy, for I come here to
-stay if need be. All affairs are settled with me, and I have much to
-tell. Madam Mina is with you? Yes. And her so fine husband? And
-Arthur and my friend Quincey, they are with you, too? Good!"
-
-As I drove to the house I told him of what had passed, and of how my
-own diary had come to be of some use through Mrs. Harker's suggestion,
-at which the Professor interrupted me.
-
-"Ah, that wonderful Madam Mina! She has man's brain, a brain that a
-man should have were he much gifted, and a woman's heart. The good
-God fashioned her for a purpose, believe me, when He made that so good
-combination. Friend John, up to now fortune has made that woman of
-help to us, after tonight she must not have to do with this so
-terrible affair. It is not good that she run a risk so great. We men
-are determined, nay, are we not pledged, to destroy this monster? But
-it is no part for a woman. Even if she be not harmed, her heart may
-fail her in so much and so many horrors and hereafter she may suffer,
-both in waking, from her nerves, and in sleep, from her dreams. And,
-besides, she is young woman and not so long married, there may be
-other things to think of some time, if not now. You tell me she has
-wrote all, then she must consult with us, but tomorrow she say goodbye
-to this work, and we go alone."
-
-I agreed heartily with him, and then I told him what we had found in
-his absence, that the house which Dracula had bought was the very next
-one to my own. He was amazed, and a great concern seemed to come on
-him.
-
-"Oh that we had known it before!" he said, "for then we might have
-reached him in time to save poor Lucy. However, 'the milk that is
-spilt cries not out afterwards,' as you say. We shall not think of
-that, but go on our way to the end." Then he fell into a silence that
-lasted till we entered my own gateway. Before we went to prepare for
-dinner he said to Mrs. Harker, "I am told, Madam Mina, by my friend
-John that you and your husband have put up in exact order all things
-that have been, up to this moment."
-
-"Not up to this moment, Professor," she said impulsively, "but up to
-this morning."
-
-"But why not up to now? We have seen hitherto how good light all the
-little things have made. We have told our secrets, and yet no one who
-has told is the worse for it."
-
-Mrs. Harker began to blush, and taking a paper from her pockets, she
-said, "Dr. Van Helsing, will you read this, and tell me if it must go
-in. It is my record of today. I too have seen the need of putting
-down at present everything, however trivial, but there is little in
-this except what is personal. Must it go in?"
-
-The Professor read it over gravely, and handed it back, saying, "It
-need not go in if you do not wish it, but I pray that it may. It can
-but make your husband love you the more, and all us, your friends,
-more honour you, as well as more esteem and love." She took it back
-with another blush and a bright smile.
-
-And so now, up to this very hour, all the records we have are complete
-and in order. The Professor took away one copy to study after dinner,
-and before our meeting, which is fixed for nine o'clock. The rest of
-us have already read everything, so when we meet in the study we shall
-all be informed as to facts, and can arrange our plan of battle with
-this terrible and mysterious enemy.
-
-
-
-
-
-MINA HARKER'S JOURNAL
-
-30 September.--When we met in Dr. Seward's study two hours after
-dinner, which had been at six o'clock, we unconsciously formed a sort
-of board or committee. Professor Van Helsing took the head of the
-table, to which Dr. Seward motioned him as he came into the room. He
-made me sit next to him on his right, and asked me to act as
-secretary. Jonathan sat next to me. Opposite us were Lord Godalming,
-Dr. Seward, and Mr. Morris, Lord Godalming being next the Professor,
-and Dr. Seward in the centre.
-
-The Professor said, "I may, I suppose, take it that we are all
-acquainted with the facts that are in these papers." We all expressed
-assent, and he went on, "Then it were, I think, good that I tell you
-something of the kind of enemy with which we have to deal. I shall
-then make known to you something of the history of this man, which has
-been ascertained for me. So we then can discuss how we shall act, and
-can take our measure according.
-
-"There are such beings as vampires, some of us have evidence that they
-exist. Even had we not the proof of our own unhappy experience, the
-teachings and the records of the past give proof enough for sane
-peoples. I admit that at the first I was sceptic. Were it not that
-through long years I have trained myself to keep an open mind, I could
-not have believed until such time as that fact thunder on my ear. 'See!
-See! I prove, I prove.' Alas! Had I known at first what now I know,
-nay, had I even guess at him, one so precious life had been spared to
-many of us who did love her. But that is gone, and we must so work,
-that other poor souls perish not, whilst we can save. The nosferatu
-do not die like the bee when he sting once. He is only stronger, and
-being stronger, have yet more power to work evil. This vampire which
-is amongst us is of himself so strong in person as twenty men, he is
-of cunning more than mortal, for his cunning be the growth of ages, he
-have still the aids of necromancy, which is, as his etymology imply,
-the divination by the dead, and all the dead that he can come nigh to
-are for him at command; he is brute, and more than brute; he is devil
-in callous, and the heart of him is not; he can, within his range,
-direct the elements, the storm, the fog, the thunder; he can command
-all the meaner things, the rat, and the owl, and the bat, the moth,
-and the fox, and the wolf, he can grow and become small; and he can at
-times vanish and come unknown. How then are we to begin our strike to
-destroy him? How shall we find his where, and having found it, how
-can we destroy? My friends, this is much, it is a terrible task that
-we undertake, and there may be consequence to make the brave shudder.
-For if we fail in this our fight he must surely win, and then where
-end we? Life is nothings, I heed him not. But to fail here, is not
-mere life or death. It is that we become as him, that we henceforward
-become foul things of the night like him, without heart or conscience,
-preying on the bodies and the souls of those we love best. To us
-forever are the gates of heaven shut, for who shall open them to us
-again? We go on for all time abhorred by all, a blot on the face of
-God's sunshine, an arrow in the side of Him who died for man. But we
-are face to face with duty, and in such case must we shrink? For me,
-I say no, but then I am old, and life, with his sunshine, his fair
-places, his song of birds, his music and his love, lie far behind. You
-others are young. Some have seen sorrow, but there are fair days yet
-in store. What say you?"
-
-Whilst he was speaking, Jonathan had taken my hand. I feared, oh so
-much, that the appalling nature of our danger was overcoming him when
-I saw his hand stretch out, but it was life to me to feel its touch,
-so strong, so self reliant, so resolute. A brave man's hand can speak
-for itself, it does not even need a woman's love to hear its music.
-
-When the Professor had done speaking my husband looked in my eyes, and
-I in his, there was no need for speaking between us.
-
-"I answer for Mina and myself," he said.
-
-"Count me in, Professor," said Mr. Quincey Morris, laconically as
-usual.
-
-"I am with you," said Lord Godalming, "for Lucy's sake, if for no
-other reason."
-
-Dr. Seward simply nodded.
-
-The Professor stood up and, after laying his golden crucifix on the
-table, held out his hand on either side. I took his right hand, and
-Lord Godalming his left, Jonathan held my right with his left and
-stretched across to Mr. Morris. So as we all took hands our solemn
-compact was made. I felt my heart icy cold, but it did not even occur
-to me to draw back. We resumed our places, and Dr. Van Helsing went
-on with a sort of cheerfulness which showed that the serious work had
-begun. It was to be taken as gravely, and in as businesslike a way,
-as any other transaction of life.
-
-"Well, you know what we have to contend against, but we too, are not
-without strength. We have on our side power of combination, a power
-denied to the vampire kind, we have sources of science, we are free to
-act and think, and the hours of the day and the night are ours
-equally. In fact, so far as our powers extend, they are unfettered,
-and we are free to use them. We have self devotion in a cause and an
-end to achieve which is not a selfish one. These things are much.
-
-"Now let us see how far the general powers arrayed against us are
-restrict, and how the individual cannot. In fine, let us consider the
-limitations of the vampire in general, and of this one in particular.
-
-"All we have to go upon are traditions and superstitions. These do
-not at the first appear much, when the matter is one of life and
-death, nay of more than either life or death. Yet must we be
-satisfied, in the first place because we have to be, no other means is
-at our control, and secondly, because, after all these things,
-tradition and superstition, are everything. Does not the belief in
-vampires rest for others, though not, alas! for us, on them? A year
-ago which of us would have received such a possibility, in the midst
-of our scientific, sceptical, matter-of-fact nineteenth century? We
-even scouted a belief that we saw justified under our very eyes. Take
-it, then, that the vampire, and the belief in his limitations and his
-cure, rest for the moment on the same base. For, let me tell you, he
-is known everywhere that men have been. In old Greece, in old Rome,
-he flourish in Germany all over, in France, in India, even in the
-Chermosese, and in China, so far from us in all ways, there even is
-he, and the peoples for him at this day. He have follow the wake of
-the berserker Icelander, the devil-begotten Hun, the Slav, the Saxon,
-the Magyar.
-
-"So far, then, we have all we may act upon, and let me tell you that
-very much of the beliefs are justified by what we have seen in our own
-so unhappy experience. The vampire live on, and cannot die by mere
-passing of the time, he can flourish when that he can fatten on the
-blood of the living. Even more, we have seen amongst us that he can
-even grow younger, that his vital faculties grow strenuous, and seem
-as though they refresh themselves when his special pabulum is plenty.
-
-"But he cannot flourish without this diet, he eat not as others. Even
-friend Jonathan, who lived with him for weeks, did never see him eat,
-never! He throws no shadow, he make in the mirror no reflect, as
-again Jonathan observe. He has the strength of many of his hand,
-witness again Jonathan when he shut the door against the wolves, and
-when he help him from the diligence too. He can transform himself to
-wolf, as we gather from the ship arrival in Whitby, when he tear open
-the dog, he can be as bat, as Madam Mina saw him on the window at
-Whitby, and as friend John saw him fly from this so near house, and as
-my friend Quincey saw him at the window of Miss Lucy.
-
-"He can come in mist which he create, that noble ship's captain proved
-him of this, but, from what we know, the distance he can make this
-mist is limited, and it can only be round himself.
-
-"He come on moonlight rays as elemental dust, as again Jonathan saw
-those sisters in the castle of Dracula. He become so small, we
-ourselves saw Miss Lucy, ere she was at peace, slip through a
-hairbreadth space at the tomb door. He can, when once he find his
-way, come out from anything or into anything, no matter how close it
-be bound or even fused up with fire, solder you call it. He can see
-in the dark, no small power this, in a world which is one half shut
-from the light. Ah, but hear me through.
-
-"He can do all these things, yet he is not free. Nay, he is even more
-prisoner than the slave of the galley, than the madman in his cell.
-He cannot go where he lists, he who is not of nature has yet to obey
-some of nature's laws, why we know not. He may not enter anywhere at
-the first, unless there be some one of the household who bid him to
-come, though afterwards he can come as he please. His power ceases,
-as does that of all evil things, at the coming of the day.
-
-"Only at certain times can he have limited freedom. If he be not at
-the place whither he is bound, he can only change himself at noon or
-at exact sunrise or sunset. These things we are told, and in this
-record of ours we have proof by inference. Thus, whereas he can do as
-he will within his limit, when he have his earth-home, his
-coffin-home, his hell-home, the place unhallowed, as we saw when he
-went to the grave of the suicide at Whitby, still at other time he can
-only change when the time come. It is said, too, that he can only
-pass running water at the slack or the flood of the tide. Then there
-are things which so afflict him that he has no power, as the garlic
-that we know of, and as for things sacred, as this symbol, my
-crucifix, that was amongst us even now when we resolve, to them he is
-nothing, but in their presence he take his place far off and silent
-with respect. There are others, too, which I shall tell you of, lest
-in our seeking we may need them.
-
-"The branch of wild rose on his coffin keep him that he move not from
-it, a sacred bullet fired into the coffin kill him so that he be true
-dead, and as for the stake through him, we know already of its peace,
-or the cut off head that giveth rest. We have seen it with our eyes.
-
-"Thus when we find the habitation of this man-that-was, we can confine
-him to his coffin and destroy him, if we obey what we know. But he is
-clever. I have asked my friend Arminius, of Buda-Pesth University, to
-make his record, and from all the means that are, he tell me of what
-he has been. He must, indeed, have been that Voivode Dracula who won
-his name against the Turk, over the great river on the very frontier
-of Turkeyland. If it be so, then was he no common man, for in that
-time, and for centuries after, he was spoken of as the cleverest and
-the most cunning, as well as the bravest of the sons of the 'land
-beyond the forest.' That mighty brain and that iron resolution went
-with him to his grave, and are even now arrayed against us. The
-Draculas were, says Arminius, a great and noble race, though now and
-again were scions who were held by their coevals to have had dealings
-with the Evil One. They learned his secrets in the Scholomance,
-amongst the mountains over Lake Hermanstadt, where the devil claims
-the tenth scholar as his due. In the records are such words as
-'stregoica' witch, 'ordog' and 'pokol' Satan and hell, and in one
-manuscript this very Dracula is spoken of as 'wampyr,' which we all
-understand too well. There have been from the loins of this very one
-great men and good women, and their graves make sacred the earth where
-alone this foulness can dwell. For it is not the least of its terrors
-that this evil thing is rooted deep in all good, in soil barren of
-holy memories it cannot rest."
-
-Whilst they were talking Mr. Morris was looking steadily at the
-window, and he now got up quietly, and went out of the room. There
-was a little pause, and then the Professor went on.
-
-"And now we must settle what we do. We have here much data, and we
-must proceed to lay out our campaign. We know from the inquiry of
-Jonathan that from the castle to Whitby came fifty boxes of earth, all
-of which were delivered at Carfax, we also know that at least some of
-these boxes have been removed. It seems to me, that our first step
-should be to ascertain whether all the rest remain in the house beyond
-that wall where we look today, or whether any more have been removed.
-If the latter, we must trace . . ."
-
-Here we were interrupted in a very startling way. Outside the house
-came the sound of a pistol shot, the glass of the window was shattered
-with a bullet, which ricochetting from the top of the embrasure,
-struck the far wall of the room. I am afraid I am at heart a coward,
-for I shrieked out. The men all jumped to their feet, Lord Godalming
-flew over to the window and threw up the sash. As he did so we heard
-Mr. Morris' voice without, "Sorry! I fear I have alarmed you. I
-shall come in and tell you about it."
-
-A minute later he came in and said, "It was an idiotic thing of me to
-do, and I ask your pardon, Mrs. Harker, most sincerely, I fear I must
-have frightened you terribly. But the fact is that whilst the
-Professor was talking there came a big bat and sat on the window sill.
-I have got such a horror of the damned brutes from recent events that
-I cannot stand them, and I went out to have a shot, as I have been
-doing of late of evenings, whenever I have seen one. You used to
-laugh at me for it then, Art."
-
-"Did you hit it?" asked Dr. Van Helsing.
-
-"I don't know, I fancy not, for it flew away into the wood." Without
-saying any more he took his seat, and the Professor began to resume
-his statement.
-
-"We must trace each of these boxes, and when we are ready, we must
-either capture or kill this monster in his lair, or we must, so to
-speak, sterilize the earth, so that no more he can seek safety in it.
-Thus in the end we may find him in his form of man between the hours
-of noon and sunset, and so engage with him when he is at his most
-weak.
-
-"And now for you, Madam Mina, this night is the end until all be well.
-You are too precious to us to have such risk. When we part tonight,
-you no more must question. We shall tell you all in good time. We
-are men and are able to bear, but you must be our star and our hope,
-and we shall act all the more free that you are not in the danger,
-such as we are."
-
-All the men, even Jonathan, seemed relieved, but it did not seem to me
-good that they should brave danger and, perhaps lessen their safety,
-strength being the best safety, through care of me, but their minds
-were made up, and though it was a bitter pill for me to swallow, I
-could say nothing, save to accept their chivalrous care of me.
-
-Mr. Morris resumed the discussion, "As there is no time to lose, I
-vote we have a look at his house right now. Time is everything with
-him, and swift action on our part may save another victim."
-
-I own that my heart began to fail me when the time for action came so
-close, but I did not say anything, for I had a greater fear that if I
-appeared as a drag or a hindrance to their work, they might even leave
-me out of their counsels altogether. They have now gone off to
-Carfax, with means to get into the house.
-
-Manlike, they had told me to go to bed and sleep, as if a woman can
-sleep when those she loves are in danger! I shall lie down, and
-pretend to sleep, lest Jonathan have added anxiety about me when he
-returns.
-
-
-
-
-DR. SEWARD'S DIARY
-
-1 October, 4 A.M.--Just as we were about to leave the house, an urgent
-message was brought to me from Renfield to know if I would see him at
-once, as he had something of the utmost importance to say to me. I
-told the messenger to say that I would attend to his wishes in the
-morning, I was busy just at the moment.
-
-The attendant added, "He seems very importunate, sir. I have never
-seen him so eager. I don't know but what, if you don't see him soon,
-he will have one of his violent fits." I knew the man would not have
-said this without some cause, so I said, "All right, I'll go now," and
-I asked the others to wait a few minutes for me, as I had to go and
-see my patient.
-
-"Take me with you, friend John," said the Professor. "His case in your
-diary interest me much, and it had bearing, too, now and again on our
-case. I should much like to see him, and especial when his mind is
-disturbed."
-
-"May I come also?" asked Lord Godalming.
-
-"Me too?" said Quincey Morris. "May I come?" said Harker. I nodded,
-and we all went down the passage together.
-
-We found him in a state of considerable excitement, but far more
-rational in his speech and manner than I had ever seen him. There was
-an unusual understanding of himself, which was unlike anything I had
-ever met with in a lunatic, and he took it for granted that his
-reasons would prevail with others entirely sane. We all five went
-into the room, but none of the others at first said anything. His
-request was that I would at once release him from the asylum and send
-him home. This he backed up with arguments regarding his complete
-recovery, and adduced his own existing sanity.
-
-"I appeal to your friends," he said, "they will, perhaps, not mind
-sitting in judgement on my case. By the way, you have not introduced
-me."
-
-I was so much astonished, that the oddness of introducing a madman in
-an asylum did not strike me at the moment, and besides, there was a
-certain dignity in the man's manner, so much of the habit of equality,
-that I at once made the introduction, "Lord Godalming, Professor Van
-Helsing, Mr. Quincey Morris, of Texas, Mr. Jonathan Harker, Mr.
-Renfield."
-
-He shook hands with each of them, saying in turn, "Lord Godalming, I
-had the honour of seconding your father at the Windham; I grieve to
-know, by your holding the title, that he is no more. He was a man
-loved and honoured by all who knew him, and in his youth was, I have
-heard, the inventor of a burnt rum punch, much patronized on Derby
-night. Mr. Morris, you should be proud of your great state. Its
-reception into the Union was a precedent which may have far-reaching
-effects hereafter, when the Pole and the Tropics may hold alliance to
-the Stars and Stripes. The power of Treaty may yet prove a vast
-engine of enlargement, when the Monroe doctrine takes its true place
-as a political fable. What shall any man say of his pleasure at
-meeting Van Helsing? Sir, I make no apology for dropping all forms of
-conventional prefix. When an individual has revolutionized
-therapeutics by his discovery of the continuous evolution of brain
-matter, conventional forms are unfitting, since they would seem to
-limit him to one of a class. You, gentlemen, who by nationality, by
-heredity, or by the possession of natural gifts, are fitted to hold
-your respective places in the moving world, I take to witness that I
-am as sane as at least the majority of men who are in full possession
-of their liberties. And I am sure that you, Dr. Seward, humanitarian
-and medico-jurist as well as scientist, will deem it a moral duty to
-deal with me as one to be considered as under exceptional
-circumstances." He made this last appeal with a courtly air of
-conviction which was not without its own charm.
-
-I think we were all staggered. For my own part, I was under the
-conviction, despite my knowledge of the man's character and history,
-that his reason had been restored, and I felt under a strong impulse
-to tell him that I was satisfied as to his sanity, and would see about
-the necessary formalities for his release in the morning. I thought
-it better to wait, however, before making so grave a statement, for of
-old I knew the sudden changes to which this particular patient was
-liable. So I contented myself with making a general statement that he
-appeared to be improving very rapidly, that I would have a longer chat
-with him in the morning, and would then see what I could do in the
-direction of meeting his wishes.
-
-This did not at all satisfy him, for he said quickly, "But I fear, Dr.
-Seward, that you hardly apprehend my wish. I desire to go at once,
-here, now, this very hour, this very moment, if I may. Time presses,
-and in our implied agreement with the old scytheman it is of the
-essence of the contract. I am sure it is only necessary to put before
-so admirable a practitioner as Dr. Seward so simple, yet so momentous
-a wish, to ensure its fulfilment."
-
-He looked at me keenly, and seeing the negative in my face, turned to
-the others, and scrutinized them closely. Not meeting any sufficient
-response, he went on, "Is it possible that I have erred in my
-supposition?"
-
-"You have," I said frankly, but at the same time, as I felt, brutally.
-
-There was a considerable pause, and then he said slowly, "Then I
-suppose I must only shift my ground of request. Let me ask for this
-concession, boon, privilege, what you will. I am content to implore
-in such a case, not on personal grounds, but for the sake of others. I
-am not at liberty to give you the whole of my reasons, but you may, I
-assure you, take it from me that they are good ones, sound and
-unselfish, and spring from the highest sense of duty.
-
-"Could you look, sir, into my heart, you would approve to the full the
-sentiments which animate me. Nay, more, you would count me amongst
-the best and truest of your friends."
-
-Again he looked at us all keenly. I had a growing conviction that
-this sudden change of his entire intellectual method was but yet
-another phase of his madness, and so determined to let him go on a
-little longer, knowing from experience that he would, like all
-lunatics, give himself away in the end. Van Helsing was gazing at him
-with a look of utmost intensity, his bushy eyebrows almost meeting
-with the fixed concentration of his look. He said to Renfield in a
-tone which did not surprise me at the time, but only when I thought of
-it afterwards, for it was as of one addressing an equal, "Can you not
-tell frankly your real reason for wishing to be free tonight? I will
-undertake that if you will satisfy even me, a stranger, without
-prejudice, and with the habit of keeping an open mind, Dr. Seward will
-give you, at his own risk and on his own responsibility, the privilege
-you seek."
-
-He shook his head sadly, and with a look of poignant regret on his
-face. The Professor went on, "Come, sir, bethink yourself. You claim
-the privilege of reason in the highest degree, since you seek to
-impress us with your complete reasonableness. You do this, whose
-sanity we have reason to doubt, since you are not yet released from
-medical treatment for this very defect. If you will not help us in
-our effort to choose the wisest course, how can we perform the duty
-which you yourself put upon us? Be wise, and help us, and if we can
-we shall aid you to achieve your wish."
-
-He still shook his head as he said, "Dr. Van Helsing, I have nothing to
-say. Your argument is complete, and if I were free to speak I should
-not hesitate a moment, but I am not my own master in the matter. I
-can only ask you to trust me. If I am refused, the responsibility
-does not rest with me."
-
-I thought it was now time to end the scene, which was becoming too
-comically grave, so I went towards the door, simply saying, "Come, my
-friends, we have work to do. Goodnight."
-
-As, however, I got near the door, a new change came over the patient.
-He moved towards me so quickly that for the moment I feared that he
-was about to make another homicidal attack. My fears, however, were
-groundless, for he held up his two hands imploringly, and made his
-petition in a moving manner. As he saw that the very excess of his
-emotion was militating against him, by restoring us more to our old
-relations, he became still more demonstrative. I glanced at Van
-Helsing, and saw my conviction reflected in his eyes, so I became a
-little more fixed in my manner, if not more stern, and motioned to him
-that his efforts were unavailing. I had previously seen something of
-the same constantly growing excitement in him when he had to make some
-request of which at the time he had thought much, such for instance,
-as when he wanted a cat, and I was prepared to see the collapse into
-the same sullen acquiescence on this occasion.
-
-My expectation was not realized, for when he found that his appeal
-would not be successful, he got into quite a frantic condition. He
-threw himself on his knees, and held up his hands, wringing them in
-plaintive supplication, and poured forth a torrent of entreaty, with
-the tears rolling down his cheeks, and his whole face and form
-expressive of the deepest emotion.
-
-"Let me entreat you, Dr. Seward, oh, let me implore you, to let me out
-of this house at once. Send me away how you will and where you will,
-send keepers with me with whips and chains, let them take me in a
-strait waistcoat, manacled and leg-ironed, even to gaol, but let me go
-out of this. You don't know what you do by keeping me here. I am
-speaking from the depths of my heart, of my very soul. You don't know
-whom you wrong, or how, and I may not tell. Woe is me! I may not
-tell. By all you hold sacred, by all you hold dear, by your love that
-is lost, by your hope that lives, for the sake of the Almighty, take
-me out of this and save my soul from guilt! Can't you hear me, man?
-Can't you understand? Will you never learn? Don't you know that I am
-sane and earnest now, that I am no lunatic in a mad fit, but a sane
-man fighting for his soul? Oh, hear me! Hear me! Let me go, let me
-go, let me go!"
-
-I thought that the longer this went on the wilder he would get, and so
-would bring on a fit, so I took him by the hand and raised him up.
-
-"Come," I said sternly, "no more of this, we have had quite enough
-already. Get to your bed and try to behave more discreetly."
-
-He suddenly stopped and looked at me intently for several moments.
-Then, without a word, he rose and moving over, sat down on the side of
-the bed. The collapse had come, as on former occasions, just as I had
-expected.
-
-When I was leaving the room, last of our party, he said to me in a
-quiet, well-bred voice, "You will, I trust, Dr. Seward, do me the
-justice to bear in mind, later on, that I did what I could to convince
-you tonight."
-
-
-
-
-CHAPTER 19
-
-
-JONATHAN HARKER'S JOURNAL
-
-1 October, 5 A.M.--I went with the party to the search with an easy
-mind, for I think I never saw Mina so absolutely strong and well. I
-am so glad that she consented to hold back and let us men do the work.
-Somehow, it was a dread to me that she was in this fearful business at
-all, but now that her work is done, and that it is due to her energy
-and brains and foresight that the whole story is put together in such
-a way that every point tells, she may well feel that her part is
-finished, and that she can henceforth leave the rest to us. We were,
-I think, all a little upset by the scene with Mr. Renfield. When we
-came away from his room we were silent till we got back to the study.
-
-Then Mr. Morris said to Dr. Seward, "Say, Jack, if that man wasn't
-attempting a bluff, he is about the sanest lunatic I ever saw. I'm
-not sure, but I believe that he had some serious purpose, and if he
-had, it was pretty rough on him not to get a chance."
-
-Lord Godalming and I were silent, but Dr. Van Helsing added, "Friend
-John, you know more lunatics than I do, and I'm glad of it, for I fear
-that if it had been to me to decide I would before that last
-hysterical outburst have given him free. But we live and learn, and
-in our present task we must take no chance, as my friend Quincey would
-say. All is best as they are."
-
-Dr. Seward seemed to answer them both in a dreamy kind of way, "I
-don't know but that I agree with you. If that man had been an
-ordinary lunatic I would have taken my chance of trusting him, but he
-seems so mixed up with the Count in an indexy kind of way that I am
-afraid of doing anything wrong by helping his fads. I can't forget
-how he prayed with almost equal fervor for a cat, and then tried to
-tear my throat out with his teeth. Besides, he called the Count 'lord
-and master', and he may want to get out to help him in some diabolical
-way. That horrid thing has the wolves and the rats and his own kind
-to help him, so I suppose he isn't above trying to use a respectable
-lunatic. He certainly did seem earnest, though. I only hope we have
-done what is best. These things, in conjunction with the wild work we
-have in hand, help to unnerve a man."
-
-The Professor stepped over, and laying his hand on his shoulder, said
-in his grave, kindly way, "Friend John, have no fear. We are trying
-to do our duty in a very sad and terrible case, we can only do as we
-deem best. What else have we to hope for, except the pity of the good
-God?"
-
-Lord Godalming had slipped away for a few minutes, but now he
-returned. He held up a little silver whistle as he remarked, "That
-old place may be full of rats, and if so, I've got an antidote on
-call."
-
-Having passed the wall, we took our way to the house, taking care to
-keep in the shadows of the trees on the lawn when the moonlight shone
-out. When we got to the porch the Professor opened his bag and took
-out a lot of things, which he laid on the step, sorting them into four
-little groups, evidently one for each. Then he spoke.
-
-"My friends, we are going into a terrible danger, and we need arms of
-many kinds. Our enemy is not merely spiritual. Remember that he has
-the strength of twenty men, and that, though our necks or our
-windpipes are of the common kind, and therefore breakable or
-crushable, his are not amenable to mere strength. A stronger man, or
-a body of men more strong in all than him, can at certain times hold
-him, but they cannot hurt him as we can be hurt by him. We must,
-therefore, guard ourselves from his touch. Keep this near your
-heart." As he spoke he lifted a little silver crucifix and held it
-out to me, I being nearest to him, "put these flowers round your
-neck," here he handed to me a wreath of withered garlic blossoms, "for
-other enemies more mundane, this revolver and this knife, and for aid
-in all, these so small electric lamps, which you can fasten to your
-breast, and for all, and above all at the last, this, which we must
-not desecrate needless."
-
-This was a portion of Sacred Wafer, which he put in an envelope and
-handed to me. Each of the others was similarly equipped.
-
-"Now," he said, "friend John, where are the skeleton keys? If so that
-we can open the door, we need not break house by the window, as before
-at Miss Lucy's."
-
-Dr. Seward tried one or two skeleton keys, his mechanical dexterity as
-a surgeon standing him in good stead. Presently he got one to suit,
-after a little play back and forward the bolt yielded, and with a
-rusty clang, shot back. We pressed on the door, the rusty hinges
-creaked, and it slowly opened. It was startlingly like the image
-conveyed to me in Dr. Seward's diary of the opening of Miss Westenra's
-tomb, I fancy that the same idea seemed to strike the others, for with
-one accord they shrank back. The Professor was the first to move
-forward, and stepped into the open door.
-
-"In manus tuas, Domine!" he said, crossing himself as he passed over
-the threshold. We closed the door behind us, lest when we should have
-lit our lamps we should possibly attract attention from the road. The
-Professor carefully tried the lock, lest we might not be able to open
-it from within should we be in a hurry making our exit. Then we all
-lit our lamps and proceeded on our search.
-
-The light from the tiny lamps fell in all sorts of odd forms, as the
-rays crossed each other, or the opacity of our bodies threw great
-shadows. I could not for my life get away from the feeling that there
-was someone else amongst us. I suppose it was the recollection, so
-powerfully brought home to me by the grim surroundings, of that
-terrible experience in Transylvania. I think the feeling was common
-to us all, for I noticed that the others kept looking over their
-shoulders at every sound and every new shadow, just as I felt myself
-doing.
-
-The whole place was thick with dust. The floor was seemingly inches
-deep, except where there were recent footsteps, in which on holding
-down my lamp I could see marks of hobnails where the dust was cracked.
-The walls were fluffy and heavy with dust, and in the corners were
-masses of spider's webs, whereon the dust had gathered till they
-looked like old tattered rags as the weight had torn them partly down.
-On a table in the hall was a great bunch of keys, with a time-yellowed
-label on each. They had been used several times, for on the table
-were several similar rents in the blanket of dust, similar to that
-exposed when the Professor lifted them.
-
-He turned to me and said, "You know this place, Jonathan. You have
-copied maps of it, and you know it at least more than we do. Which is
-the way to the chapel?"
-
-I had an idea of its direction, though on my former visit I had not
-been able to get admission to it, so I led the way, and after a few
-wrong turnings found myself opposite a low, arched oaken door, ribbed
-with iron bands.
-
-"This is the spot," said the Professor as he turned his lamp on a
-small map of the house, copied from the file of my original
-correspondence regarding the purchase. With a little trouble we found
-the key on the bunch and opened the door. We were prepared for some
-unpleasantness, for as we were opening the door a faint, malodorous
-air seemed to exhale through the gaps, but none of us ever expected
-such an odour as we encountered. None of the others had met the Count
-at all at close quarters, and when I had seen him he was either in the
-fasting stage of his existence in his rooms or, when he was bloated
-with fresh blood, in a ruined building open to the air, but here the
-place was small and close, and the long disuse had made the air
-stagnant and foul. There was an earthy smell, as of some dry miasma,
-which came through the fouler air. But as to the odour itself, how
-shall I describe it? It was not alone that it was composed of all the
-ills of mortality and with the pungent, acrid smell of blood, but it
-seemed as though corruption had become itself corrupt. Faugh! It
-sickens me to think of it. Every breath exhaled by that monster
-seemed to have clung to the place and intensified its loathsomeness.
-
-Under ordinary circumstances such a stench would have brought our
-enterprise to an end, but this was no ordinary case, and the high and
-terrible purpose in which we were involved gave us a strength which
-rose above merely physical considerations. After the involuntary
-shrinking consequent on the first nauseous whiff, we one and all set
-about our work as though that loathsome place were a garden of roses.
-
-We made an accurate examination of the place, the Professor saying as
-we began, "The first thing is to see how many of the boxes are left,
-we must then examine every hole and corner and cranny and see if we
-cannot get some clue as to what has become of the rest."
-
-A glance was sufficient to show how many remained, for the great earth
-chests were bulky, and there was no mistaking them.
-
-There were only twenty-nine left out of the fifty! Once I got a
-fright, for, seeing Lord Godalming suddenly turn and look out of the
-vaulted door into the dark passage beyond, I looked too, and for an
-instant my heart stood still. Somewhere, looking out from the shadow,
-I seemed to see the high lights of the Count's evil face, the ridge of
-the nose, the red eyes, the red lips, the awful pallor. It was only
-for a moment, for, as Lord Godalming said, "I thought I saw a face,
-but it was only the shadows," and resumed his inquiry, I turned my
-lamp in the direction, and stepped into the passage. There was no
-sign of anyone, and as there were no corners, no doors, no aperture of
-any kind, but only the solid walls of the passage, there could be no
-hiding place even for him. I took it that fear had helped
-imagination, and said nothing.
-
-A few minutes later I saw Morris step suddenly back from a corner,
-which he was examining. We all followed his movements with our eyes,
-for undoubtedly some nervousness was growing on us, and we saw a whole
-mass of phosphorescence, which twinkled like stars. We all
-instinctively drew back. The whole place was becoming alive with
-rats.
-
-For a moment or two we stood appalled, all save Lord Godalming, who
-was seemingly prepared for such an emergency. Rushing over to the
-great iron-bound oaken door, which Dr. Seward had described from the
-outside, and which I had seen myself, he turned the key in the lock,
-drew the huge bolts, and swung the door open. Then, taking his little
-silver whistle from his pocket, he blew a low, shrill call. It was
-answered from behind Dr. Seward's house by the yelping of dogs, and
-after about a minute three terriers came dashing round the corner of
-the house. Unconsciously we had all moved towards the door, and as we
-moved I noticed that the dust had been much disturbed. The boxes
-which had been taken out had been brought this way. But even in the
-minute that had elapsed the number of the rats had vastly increased.
-They seemed to swarm over the place all at once, till the lamplight,
-shining on their moving dark bodies and glittering, baleful eyes, made
-the place look like a bank of earth set with fireflies. The dogs
-dashed on, but at the threshold suddenly stopped and snarled, and
-then, simultaneously lifting their noses, began to howl in most
-lugubrious fashion. The rats were multiplying in thousands, and we
-moved out.
-
-Lord Godalming lifted one of the dogs, and carrying him in, placed him
-on the floor. The instant his feet touched the ground he seemed to
-recover his courage, and rushed at his natural enemies. They fled
-before him so fast that before he had shaken the life out of a score,
-the other dogs, who had by now been lifted in the same manner, had but
-small prey ere the whole mass had vanished.
-
-With their going it seemed as if some evil presence had departed, for
-the dogs frisked about and barked merrily as they made sudden darts at
-their prostrate foes, and turned them over and over and tossed them in
-the air with vicious shakes. We all seemed to find our spirits rise.
-Whether it was the purifying of the deadly atmosphere by the opening
-of the chapel door, or the relief which we experienced by finding
-ourselves in the open I know not, but most certainly the shadow of
-dread seemed to slip from us like a robe, and the occasion of our
-coming lost something of its grim significance, though we did not
-slacken a whit in our resolution. We closed the outer door and barred
-and locked it, and bringing the dogs with us, began our search of the
-house. We found nothing throughout except dust in extraordinary
-proportions, and all untouched save for my own footsteps when I had
-made my first visit. Never once did the dogs exhibit any symptom of
-uneasiness, and even when we returned to the chapel they frisked about
-as though they had been rabbit hunting in a summer wood.
-
-The morning was quickening in the east when we emerged from the front.
-Dr. Van Helsing had taken the key of the hall door from the bunch, and
-locked the door in orthodox fashion, putting the key into his pocket
-when he had done.
-
-"So far," he said, "our night has been eminently successful. No harm
-has come to us such as I feared might be and yet we have ascertained
-how many boxes are missing. More than all do I rejoice that this, our
-first, and perhaps our most difficult and dangerous, step has been
-accomplished without the bringing thereinto our most sweet Madam Mina
-or troubling her waking or sleeping thoughts with sights and sounds
-and smells of horror which she might never forget. One lesson, too,
-we have learned, if it be allowable to argue a particulari, that the
-brute beasts which are to the Count's command are yet themselves not
-amenable to his spiritual power, for look, these rats that would come
-to his call, just as from his castle top he summon the wolves to your
-going and to that poor mother's cry, though they come to him, they run
-pell-mell from the so little dogs of my friend Arthur. We have other
-matters before us, other dangers, other fears, and that monster . . .
-He has not used his power over the brute world for the only or the
-last time tonight. So be it that he has gone elsewhere. Good! It
-has given us opportunity to cry 'check' in some ways in this chess
-game, which we play for the stake of human souls. And now let us go
-home. The dawn is close at hand, and we have reason to be content
-with our first night's work. It may be ordained that we have many
-nights and days to follow, if full of peril, but we must go on, and
-from no danger shall we shrink."
-
-The house was silent when we got back, save for some poor creature who
-was screaming away in one of the distant wards, and a low, moaning
-sound from Renfield's room. The poor wretch was doubtless torturing
-himself, after the manner of the insane, with needless thoughts of
-pain.
-
-I came tiptoe into our own room, and found Mina asleep, breathing so
-softly that I had to put my ear down to hear it. She looks paler than
-usual. I hope the meeting tonight has not upset her. I am truly
-thankful that she is to be left out of our future work, and even of
-our deliberations. It is too great a strain for a woman to bear. I
-did not think so at first, but I know better now. Therefore I am glad
-that it is settled. There may be things which would frighten her to
-hear, and yet to conceal them from her might be worse than to tell her
-if once she suspected that there was any concealment. Henceforth our
-work is to be a sealed book to her, till at least such time as we can
-tell her that all is finished, and the earth free from a monster of
-the nether world. I daresay it will be difficult to begin to keep
-silence after such confidence as ours, but I must be resolute, and
-tomorrow I shall keep dark over tonight's doings, and shall refuse to
-speak of anything that has happened. I rest on the sofa, so as not to
-disturb her.
-
-
-1 October, later.--I suppose it was natural that we should have all
-overslept ourselves, for the day was a busy one, and the night had no
-rest at all. Even Mina must have felt its exhaustion, for though I
-slept till the sun was high, I was awake before her, and had to call
-two or three times before she awoke. Indeed, she was so sound asleep
-that for a few seconds she did not recognize me, but looked at me with
-a sort of blank terror, as one looks who has been waked out of a bad
-dream. She complained a little of being tired, and I let her rest
-till later in the day. We now know of twenty-one boxes having been
-removed, and if it be that several were taken in any of these removals
-we may be able to trace them all. Such will, of course, immensely
-simplify our labor, and the sooner the matter is attended to the
-better. I shall look up Thomas Snelling today.
-
-
-
-DR. SEWARD'S DIARY
-
-1 October.--It was towards noon when I was awakened by the Professor
-walking into my room. He was more jolly and cheerful than usual, and
-it is quite evident that last night's work has helped to take some of
-the brooding weight off his mind.
-
-After going over the adventure of the night he suddenly said, "Your
-patient interests me much. May it be that with you I visit him this
-morning? Or if that you are too occupy, I can go alone if it may be.
-It is a new experience to me to find a lunatic who talk philosophy,
-and reason so sound."
-
-I had some work to do which pressed, so I told him that if he would go
-alone I would be glad, as then I should not have to keep him waiting,
-so I called an attendant and gave him the necessary instructions.
-Before the Professor left the room I cautioned him against getting any
-false impression from my patient.
-
-"But," he answered, "I want him to talk of himself and of his delusion
-as to consuming live things. He said to Madam Mina, as I see in your
-diary of yesterday, that he had once had such a belief. Why do you
-smile, friend John?"
-
-"Excuse me," I said, "but the answer is here." I laid my hand on the
-typewritten matter. "When our sane and learned lunatic made that very
-statement of how he used to consume life, his mouth was actually
-nauseous with the flies and spiders which he had eaten just before
-Mrs. Harker entered the room."
-
-Van Helsing smiled in turn. "Good!" he said. "Your memory is true,
-friend John. I should have remembered. And yet it is this very
-obliquity of thought and memory which makes mental disease such a
-fascinating study. Perhaps I may gain more knowledge out of the folly
-of this madman than I shall from the teaching of the most wise. Who
-knows?"
-
-I went on with my work, and before long was through that in hand. It
-seemed that the time had been very short indeed, but there was Van
-Helsing back in the study.
-
-"Do I interrupt?" he asked politely as he stood at the door.
-
-"Not at all," I answered. "Come in. My work is finished, and I am
-free. I can go with you now, if you like."
-
-"It is needless, I have seen him!"
-
-"Well?"
-
-"I fear that he does not appraise me at much. Our interview was
-short. When I entered his room he was sitting on a stool in the
-centre, with his elbows on his knees, and his face was the picture of
-sullen discontent. I spoke to him as cheerfully as I could, and with
-such a measure of respect as I could assume. He made no reply
-whatever. 'Don't you know me?' I asked. His answer was not
-reassuring: 'I know you well enough; you are the old fool Van
-Helsing. I wish you would take yourself and your idiotic brain
-theories somewhere else. Damn all thick-headed Dutchmen!' Not a word
-more would he say, but sat in his implacable sullenness as indifferent
-to me as though I had not been in the room at all. Thus departed for
-this time my chance of much learning from this so clever lunatic, so I
-shall go, if I may, and cheer myself with a few happy words with that
-sweet soul Madam Mina. Friend John, it does rejoice me unspeakable
-that she is no more to be pained, no more to be worried with our
-terrible things. Though we shall much miss her help, it is better
-so."
-
-"I agree with you with all my heart," I answered earnestly, for I did
-not want him to weaken in this matter. "Mrs. Harker is better out of
-it. Things are quite bad enough for us, all men of the world, and who
-have been in many tight places in our time, but it is no place for a
-woman, and if she had remained in touch with the affair, it would in
-time infallibly have wrecked her."
-
-So Van Helsing has gone to confer with Mrs. Harker and Harker, Quincey
-and Art are all out following up the clues as to the earth boxes. I
-shall finish my round of work and we shall meet tonight.
-
-
-
-
-
-MINA HARKER'S JOURNAL
-
-1 October.--It is strange to me to be kept in the dark as I am today,
-after Jonathan's full confidence for so many years, to see him
-manifestly avoid certain matters, and those the most vital of all.
-This morning I slept late after the fatigues of yesterday, and though
-Jonathan was late too, he was the earlier. He spoke to me before he
-went out, never more sweetly or tenderly, but he never mentioned a
-word of what had happened in the visit to the Count's house. And yet
-he must have known how terribly anxious I was. Poor dear fellow! I
-suppose it must have distressed him even more than it did me. They
-all agreed that it was best that I should not be drawn further into
-this awful work, and I acquiesced. But to think that he keeps
-anything from me! And now I am crying like a silly fool, when I know
-it comes from my husband's great love and from the good, good wishes
-of those other strong men.
-
-That has done me good. Well, some day Jonathan will tell me all. And
-lest it should ever be that he should think for a moment that I kept
-anything from him, I still keep my journal as usual. Then if he has
-feared of my trust I shall show it to him, with every thought of my
-heart put down for his dear eyes to read. I feel strangely sad and
-low-spirited today. I suppose it is the reaction from the terrible
-excitement.
-
-Last night I went to bed when the men had gone, simply because they
-told me to. I didn't feel sleepy, and I did feel full of devouring
-anxiety. I kept thinking over everything that has been ever since
-Jonathan came to see me in London, and it all seems like a horrible
-tragedy, with fate pressing on relentlessly to some destined end.
-Everything that one does seems, no matter how right it may be, to bring
-on the very thing which is most to be deplored. If I hadn't gone to
-Whitby, perhaps poor dear Lucy would be with us now. She hadn't taken
-to visiting the churchyard till I came, and if she hadn't come there
-in the day time with me she wouldn't have walked in her sleep. And if
-she hadn't gone there at night and asleep, that monster couldn't have
-destroyed her as he did. Oh, why did I ever go to Whitby? There now,
-crying again! I wonder what has come over me today. I must hide it
-from Jonathan, for if he knew that I had been crying twice in one
-morning . . . I, who never cried on my own account, and whom he has
-never caused to shed a tear, the dear fellow would fret his heart out.
-I shall put a bold face on, and if I do feel weepy, he shall never see
-it. I suppose it is just one of the lessons that we poor women have
-to learn . . .
-
-I can't quite remember how I fell asleep last night. I remember
-hearing the sudden barking of the dogs and a lot of queer sounds, like
-praying on a very tumultuous scale, from Mr. Renfield's room, which is
-somewhere under this. And then there was silence over everything,
-silence so profound that it startled me, and I got up and looked out
-of the window. All was dark and silent, the black shadows thrown by
-the moonlight seeming full of a silent mystery of their own. Not a
-thing seemed to be stirring, but all to be grim and fixed as death or
-fate, so that a thin streak of white mist, that crept with almost
-imperceptible slowness across the grass towards the house, seemed to
-have a sentience and a vitality of its own. I think that the
-digression of my thoughts must have done me good, for when I got back
-to bed I found a lethargy creeping over me. I lay a while, but could
-not quite sleep, so I got out and looked out of the window again. The
-mist was spreading, and was now close up to the house, so that I could
-see it lying thick against the wall, as though it were stealing up to
-the windows. The poor man was more loud than ever, and though I could
-not distinguish a word he said, I could in some way recognize in his
-tones some passionate entreaty on his part. Then there was the sound
-of a struggle, and I knew that the attendants were dealing with him.
-I was so frightened that I crept into bed, and pulled the clothes over
-my head, putting my fingers in my ears. I was not then a bit sleepy,
-at least so I thought, but I must have fallen asleep, for except
-dreams, I do not remember anything until the morning, when Jonathan
-woke me. I think that it took me an effort and a little time to
-realize where I was, and that it was Jonathan who was bending over me.
-My dream was very peculiar, and was almost typical of the way that
-waking thoughts become merged in, or continued in, dreams.
-
-I thought that I was asleep, and waiting for Jonathan to come back. I
-was very anxious about him, and I was powerless to act, my feet, and
-my hands, and my brain were weighted, so that nothing could proceed at
-the usual pace. And so I slept uneasily and thought. Then it began
-to dawn upon me that the air was heavy, and dank, and cold. I put
-back the clothes from my face, and found, to my surprise, that all was
-dim around. The gaslight which I had left lit for Jonathan, but
-turned down, came only like a tiny red spark through the fog, which
-had evidently grown thicker and poured into the room. Then it
-occurred to me that I had shut the window before I had come to bed. I
-would have got out to make certain on the point, but some leaden
-lethargy seemed to chain my limbs and even my will. I lay still and
-endured, that was all. I closed my eyes, but could still see through
-my eyelids. (It is wonderful what tricks our dreams play us, and how
-conveniently we can imagine.) The mist grew thicker and thicker and I
-could see now how it came in, for I could see it like smoke, or with
-the white energy of boiling water, pouring in, not through the window,
-but through the joinings of the door. It got thicker and thicker,
-till it seemed as if it became concentrated into a sort of pillar of
-cloud in the room, through the top of which I could see the light of
-the gas shining like a red eye. Things began to whirl through my
-brain just as the cloudy column was now whirling in the room, and
-through it all came the scriptural words "a pillar of cloud by day and
-of fire by night." Was it indeed such spiritual guidance that was
-coming to me in my sleep? But the pillar was composed of both the day
-and the night guiding, for the fire was in the red eye, which at the
-thought got a new fascination for me, till, as I looked, the fire
-divided, and seemed to shine on me through the fog like two red eyes,
-such as Lucy told me of in her momentary mental wandering when, on the
-cliff, the dying sunlight struck the windows of St. Mary's Church.
-Suddenly the horror burst upon me that it was thus that Jonathan had
-seen those awful women growing into reality through the whirling mist
-in the moonlight, and in my dream I must have fainted, for all became
-black darkness. The last conscious effort which imagination made was
-to show me a livid white face bending over me out of the mist.
-
-I must be careful of such dreams, for they would unseat one's reason if
-there were too much of them. I would get Dr. Van Helsing or Dr.
-Seward to prescribe something for me which would make me sleep, only
-that I fear to alarm them. Such a dream at the present time would
-become woven into their fears for me. Tonight I shall strive hard to
-sleep naturally. If I do not, I shall tomorrow night get them to give
-me a dose of chloral, that cannot hurt me for once, and it will give
-me a good night's sleep. Last night tired me more than if I had not
-slept at all.
-
-
-2 October 10 P.M.--Last night I slept, but did not dream. I must have
-slept soundly, for I was not waked by Jonathan coming to bed, but the
-sleep has not refreshed me, for today I feel terribly weak and
-spiritless. I spent all yesterday trying to read, or lying down
-dozing. In the afternoon, Mr. Renfield asked if he might see me. Poor
-man, he was very gentle, and when I came away he kissed my hand and
-bade God bless me. Some way it affected me much. I am crying when I
-think of him. This is a new weakness, of which I must be careful.
-Jonathan would be miserable if he knew I had been crying. He and the
-others were out till dinner time, and they all came in tired. I did
-what I could to brighten them up, and I suppose that the effort did me
-good, for I forgot how tired I was. After dinner they sent me to bed,
-and all went off to smoke together, as they said, but I knew that they
-wanted to tell each other of what had occurred to each during the day.
-I could see from Jonathan's manner that he had something important to
-communicate. I was not so sleepy as I should have been, so before
-they went I asked Dr. Seward to give me a little opiate of some kind,
-as I had not slept well the night before. He very kindly made me up a
-sleeping draught, which he gave to me, telling me that it would do me
-no harm, as it was very mild . . . I have taken it, and am waiting for
-sleep, which still keeps aloof. I hope I have not done wrong, for as
-sleep begins to flirt with me, a new fear comes: that I may have been
-foolish in thus depriving myself of the power of waking. I might want
-it. Here comes sleep. Goodnight.
-
-
-
-
-CHAPTER 20
-
-
-JONATHAN HARKER'S JOURNAL
-
-1 October, evening.--I found Thomas Snelling in his house at Bethnal
-Green, but unhappily he was not in a condition to remember anything.
-The very prospect of beer which my expected coming had opened to him
-had proved too much, and he had begun too early on his expected
-debauch. I learned, however, from his wife, who seemed a decent, poor
-soul, that he was only the assistant of Smollet, who of the two mates
-was the responsible person. So off I drove to Walworth, and found Mr.
-Joseph Smollet at home and in his shirtsleeves, taking a late tea out
-of a saucer. He is a decent, intelligent fellow, distinctly a good,
-reliable type of workman, and with a headpiece of his own. He
-remembered all about the incident of the boxes, and from a wonderful
-dog-eared notebook, which he produced from some mysterious receptacle
-about the seat of his trousers, and which had hieroglyphical entries
-in thick, half-obliterated pencil, he gave me the destinations of the
-boxes. There were, he said, six in the cartload which he took from
-Carfax and left at 197 Chicksand Street, Mile End New Town, and
-another six which he deposited at Jamaica Lane, Bermondsey. If then
-the Count meant to scatter these ghastly refuges of his over London,
-these places were chosen as the first of delivery, so that later he
-might distribute more fully. The systematic manner in which this was
-done made me think that he could not mean to confine himself to two
-sides of London. He was now fixed on the far east on the northern
-shore, on the east of the southern shore, and on the south. The north
-and west were surely never meant to be left out of his diabolical
-scheme, let alone the City itself and the very heart of fashionable
-London in the south-west and west. I went back to Smollet, and asked
-him if he could tell us if any other boxes had been taken from Carfax.
-
-He replied, "Well guv'nor, you've treated me very 'an'some", I had
-given him half a sovereign, "an I'll tell yer all I know. I heard a
-man by the name of Bloxam say four nights ago in the 'Are an' 'Ounds,
-in Pincher's Alley, as 'ow he an' his mate 'ad 'ad a rare dusty job in
-a old 'ouse at Purfleet. There ain't a many such jobs as this 'ere,
-an' I'm thinkin' that maybe Sam Bloxam could tell ye summut."
-
-I asked if he could tell me where to find him. I told him that if he
-could get me the address it would be worth another half sovereign to
-him. So he gulped down the rest of his tea and stood up, saying that
-he was going to begin the search then and there.
-
-At the door he stopped, and said, "Look 'ere, guv'nor, there ain't no
-sense in me a keepin' you 'ere. I may find Sam soon, or I mayn't, but
-anyhow he ain't like to be in a way to tell ye much tonight. Sam is a
-rare one when he starts on the booze. If you can give me a envelope
-with a stamp on it, and put yer address on it, I'll find out where Sam
-is to be found and post it ye tonight. But ye'd better be up arter
-'im soon in the mornin', never mind the booze the night afore."
-
-This was all practical, so one of the children went off with a penny
-to buy an envelope and a sheet of paper, and to keep the change. When
-she came back, I addressed the envelope and stamped it, and when
-Smollet had again faithfully promised to post the address when found,
-I took my way to home. We're on the track anyhow. I am tired
-tonight, and I want to sleep. Mina is fast asleep, and looks a little
-too pale. Her eyes look as though she had been crying. Poor dear,
-I've no doubt it frets her to be kept in the dark, and it may make her
-doubly anxious about me and the others. But it is best as it is. It
-is better to be disappointed and worried in such a way now than to
-have her nerve broken. The doctors were quite right to insist on her
-being kept out of this dreadful business. I must be firm, for on me
-this particular burden of silence must rest. I shall not ever enter
-on the subject with her under any circumstances. Indeed, It may not
-be a hard task, after all, for she herself has become reticent on the
-subject, and has not spoken of the Count or his doings ever since we
-told her of our decision.
-
-
-2 October, evening--A long and trying and exciting day. By the first
-post I got my directed envelope with a dirty scrap of paper enclosed,
-on which was written with a carpenter's pencil in a sprawling hand,
-"Sam Bloxam, Korkrans, 4 Poters Cort, Bartel Street, Walworth. Arsk
-for the depite."
-
-I got the letter in bed, and rose without waking Mina. She looked
-heavy and sleepy and pale, and far from well. I determined not to
-wake her, but that when I should return from this new search, I would
-arrange for her going back to Exeter. I think she would be happier in
-our own home, with her daily tasks to interest her, than in being here
-amongst us and in ignorance. I only saw Dr. Seward for a moment, and
-told him where I was off to, promising to come back and tell the rest
-so soon as I should have found out anything. I drove to Walworth and
-found, with some difficulty, Potter's Court. Mr. Smollet's spelling
-misled me, as I asked for Poter's Court instead of Potter's Court.
-However, when I had found the court, I had no difficulty in
-discovering Corcoran's lodging house.
-
-When I asked the man who came to the door for the "depite," he shook
-his head, and said, "I dunno 'im. There ain't no such a person 'ere.
-I never 'eard of 'im in all my bloomin' days. Don't believe there
-ain't nobody of that kind livin' 'ere or anywheres."
-
-I took out Smollet's letter, and as I read it it seemed to me that the
-lesson of the spelling of the name of the court might guide me. "What
-are you?" I asked.
-
-"I'm the depity," he answered.
-
-I saw at once that I was on the right track. Phonetic spelling had
-again misled me. A half crown tip put the deputy's knowledge at my
-disposal, and I learned that Mr. Bloxam, who had slept off the remains
-of his beer on the previous night at Corcoran's, had left for his work
-at Poplar at five o'clock that morning. He could not tell me where
-the place of work was situated, but he had a vague idea that it was
-some kind of a "new-fangled ware'us," and with this slender clue I had
-to start for Poplar. It was twelve o'clock before I got any
-satisfactory hint of such a building, and this I got at a coffee shop,
-where some workmen were having their dinner. One of them suggested
-that there was being erected at Cross Angel Street a new "cold
-storage" building, and as this suited the condition of a "new-fangled
-ware'us," I at once drove to it. An interview with a surly gatekeeper
-and a surlier foreman, both of whom were appeased with the coin of the
-realm, put me on the track of Bloxam. He was sent for on my
-suggestion that I was willing to pay his days wages to his foreman for
-the privilege of asking him a few questions on a private matter. He
-was a smart enough fellow, though rough of speech and bearing. When I
-had promised to pay for his information and given him an earnest, he
-told me that he had made two journeys between Carfax and a house in
-Piccadilly, and had taken from this house to the latter nine great
-boxes, "main heavy ones," with a horse and cart hired by him for this
-purpose.
-
-I asked him if he could tell me the number of the house in Piccadilly,
-to which he replied, "Well, guv'nor, I forgits the number, but it was
-only a few door from a big white church, or somethink of the kind, not
-long built. It was a dusty old 'ouse, too, though nothin' to the
-dustiness of the 'ouse we tooked the bloomin' boxes from."
-
-"How did you get in if both houses were empty?"
-
-"There was the old party what engaged me a waitin' in the 'ouse at
-Purfleet. He 'elped me to lift the boxes and put them in the dray.
-Curse me, but he was the strongest chap I ever struck, an' him a old
-feller, with a white moustache, one that thin you would think he
-couldn't throw a shadder."
-
-How this phrase thrilled through me!
-
-"Why, 'e took up 'is end o' the boxes like they was pounds of tea, and
-me a puffin' an' a blowin' afore I could upend mine anyhow, an' I'm no
-chicken, neither."
-
-"How did you get into the house in Piccadilly?" I asked.
-
-"He was there too. He must 'a started off and got there afore me, for
-when I rung of the bell he kem an' opened the door 'isself an' 'elped
-me carry the boxes into the 'all."
-
-"The whole nine?" I asked.
-
-"Yus, there was five in the first load an' four in the second. It was
-main dry work, an' I don't so well remember 'ow I got 'ome."
-
-I interrupted him, "Were the boxes left in the hall?"
-
-"Yus, it was a big 'all, an' there was nothin' else in it."
-
-I made one more attempt to further matters. "You didn't have any
-key?"
-
-"Never used no key nor nothink. The old gent, he opened the door
-'isself an' shut it again when I druv off. I don't remember the last
-time, but that was the beer."
-
-"And you can't remember the number of the house?"
-
-"No, sir. But ye needn't have no difficulty about that. It's a 'igh
-'un with a stone front with a bow on it, an' 'igh steps up to the
-door. I know them steps, 'avin' 'ad to carry the boxes up with three
-loafers what come round to earn a copper. The old gent give them
-shillin's, an' they seein' they got so much, they wanted more. But 'e
-took one of them by the shoulder and was like to throw 'im down the
-steps, till the lot of them went away cussin'."
-
-I thought that with this description I could find the house, so having
-paid my friend for his information, I started off for Piccadilly. I
-had gained a new painful experience. The Count could, it was evident,
-handle the earth boxes himself. If so, time was precious, for now
-that he had achieved a certain amount of distribution, he could, by
-choosing his own time, complete the task unobserved. At Piccadilly
-Circus I discharged my cab, and walked westward. Beyond the Junior
-Constitutional I came across the house described and was satisfied
-that this was the next of the lairs arranged by Dracula. The house
-looked as though it had been long untenanted. The windows were
-encrusted with dust, and the shutters were up. All the framework was
-black with time, and from the iron the paint had mostly scaled away.
-It was evident that up to lately there had been a large notice board
-in front of the balcony. It had, however, been roughly torn away, the
-uprights which had supported it still remaining. Behind the rails of
-the balcony I saw there were some loose boards, whose raw edges looked
-white. I would have given a good deal to have been able to see the
-notice board intact, as it would, perhaps, have given some clue to the
-ownership of the house. I remembered my experience of the investigation
-and purchase of Carfax, and I could not but feel that if I could find
-the former owner there might be some means discovered of gaining access
-to the house.
-
-There was at present nothing to be learned from the Piccadilly side,
-and nothing could be done, so I went around to the back to see if
-anything could be gathered from this quarter. The mews were active,
-the Piccadilly houses being mostly in occupation. I asked one or two
-of the grooms and helpers whom I saw around if they could tell me
-anything about the empty house. One of them said that he heard it had
-lately been taken, but he couldn't say from whom. He told me,
-however, that up to very lately there had been a notice board of "For
-Sale" up, and that perhaps Mitchell, Sons, & Candy the house agents
-could tell me something, as he thought he remembered seeing the name
-of that firm on the board. I did not wish to seem too eager, or to
-let my informant know or guess too much, so thanking him in the usual
-manner, I strolled away. It was now growing dusk, and the autumn
-night was closing in, so I did not lose any time. Having learned the
-address of Mitchell, Sons, & Candy from a directory at the Berkeley, I
-was soon at their office in Sackville Street.
-
-The gentleman who saw me was particularly suave in manner, but
-uncommunicative in equal proportion. Having once told me that the
-Piccadilly house, which throughout our interview he called a
-"mansion," was sold, he considered my business as concluded. When I
-asked who had purchased it, he opened his eyes a thought wider, and
-paused a few seconds before replying, "It is sold, sir."
-
-"Pardon me," I said, with equal politeness, "but I have a special
-reason for wishing to know who purchased it."
-
-Again he paused longer, and raised his eyebrows still more. "It is
-sold, sir," was again his laconic reply.
-
-"Surely," I said, "you do not mind letting me know so much."
-
-"But I do mind," he answered. "The affairs of their clients are
-absolutely safe in the hands of Mitchell, Sons, & Candy."
-
-This was manifestly a prig of the first water, and there was no use
-arguing with him. I thought I had best meet him on his own ground, so
-I said, "Your clients, sir, are happy in having so resolute a guardian
-of their confidence. I am myself a professional man."
-
-Here I handed him my card. "In this instance I am not prompted by
-curiosity, I act on the part of Lord Godalming, who wishes to know
-something of the property which was, he understood, lately for sale."
-
-These words put a different complexion on affairs. He said, "I would
-like to oblige you if I could, Mr. Harker, and especially would I like
-to oblige his lordship. We once carried out a small matter of renting
-some chambers for him when he was the honourable Arthur Holmwood. If
-you will let me have his lordship's address I will consult the House
-on the subject, and will, in any case, communicate with his lordship
-by tonight's post. It will be a pleasure if we can so far deviate
-from our rules as to give the required information to his lordship."
-
-I wanted to secure a friend, and not to make an enemy, so I thanked
-him, gave the address at Dr. Seward's and came away. It was now dark,
-and I was tired and hungry. I got a cup of tea at the Aerated Bread
-Company and came down to Purfleet by the next train.
-
-I found all the others at home. Mina was looking tired and pale, but
-she made a gallant effort to be bright and cheerful. It wrung my
-heart to think that I had had to keep anything from her and so caused
-her inquietude. Thank God, this will be the last night of her looking
-on at our conferences, and feeling the sting of our not showing our
-confidence. It took all my courage to hold to the wise resolution of
-keeping her out of our grim task. She seems somehow more reconciled,
-or else the very subject seems to have become repugnant to her, for
-when any accidental allusion is made she actually shudders. I am glad
-we made our resolution in time, as with such a feeling as this, our
-growing knowledge would be torture to her.
-
-I could not tell the others of the day's discovery till we were alone,
-so after dinner, followed by a little music to save appearances even
-amongst ourselves, I took Mina to her room and left her to go to bed.
-The dear girl was more affectionate with me than ever, and clung to me
-as though she would detain me, but there was much to be talked of and
-I came away. Thank God, the ceasing of telling things has made no
-difference between us.
-
-When I came down again I found the others all gathered round the fire
-in the study. In the train I had written my diary so far, and simply
-read it off to them as the best means of letting them get abreast of
-my own information.
-
-When I had finished Van Helsing said, "This has been a great day's
-work, friend Jonathan. Doubtless we are on the track of the missing
-boxes. If we find them all in that house, then our work is near the
-end. But if there be some missing, we must search until we find them.
-Then shall we make our final coup, and hunt the wretch to his real
-death."
-
-We all sat silent awhile and all at once Mr. Morris spoke, "Say! How
-are we going to get into that house?"
-
-"We got into the other," answered Lord Godalming quickly.
-
-"But, Art, this is different. We broke house at Carfax, but we had
-night and a walled park to protect us. It will be a mighty different
-thing to commit burglary in Piccadilly, either by day or night. I
-confess I don't see how we are going to get in unless that agency duck
-can find us a key of some sort."
-
-Lord Godalming's brows contracted, and he stood up and walked about the
-room. By-and-by he stopped and said, turning from one to another of
-us, "Quincey's head is level. This burglary business is getting
-serious. We got off once all right, but we have now a rare job on
-hand. Unless we can find the Count's key basket."
-
-As nothing could well be done before morning, and as it would be at
-least advisable to wait till Lord Godalming should hear from
-Mitchell's, we decided not to take any active step before breakfast
-time. For a good while we sat and smoked, discussing the matter in
-its various lights and bearings. I took the opportunity of bringing
-this diary right up to the moment. I am very sleepy and shall go to
-bed . . .
-
-Just a line. Mina sleeps soundly and her breathing is regular. Her
-forehead is puckered up into little wrinkles, as though she thinks
-even in her sleep. She is still too pale, but does not look so
-haggard as she did this morning. Tomorrow will, I hope, mend all
-this. She will be herself at home in Exeter. Oh, but I am sleepy!
-
-
-
-
-DR. SEWARD'S DIARY
-
-1 October.--I am puzzled afresh about Renfield. His moods change so
-rapidly that I find it difficult to keep touch of them, and as they
-always mean something more than his own well-being, they form a more
-than interesting study. This morning, when I went to see him after
-his repulse of Van Helsing, his manner was that of a man commanding
-destiny. He was, in fact, commanding destiny, subjectively. He did
-not really care for any of the things of mere earth, he was in the
-clouds and looked down on all the weaknesses and wants of us poor
-mortals.
-
-I thought I would improve the occasion and learn something, so I asked
-him, "What about the flies these times?"
-
-He smiled on me in quite a superior sort of way, such a smile as would
-have become the face of Malvolio, as he answered me, "The fly, my dear
-sir, has one striking feature. It's wings are typical of the aerial
-powers of the psychic faculties. The ancients did well when they
-typified the soul as a butterfly!"
-
-I thought I would push his analogy to its utmost logically, so I said
-quickly, "Oh, it is a soul you are after now, is it?"
-
-His madness foiled his reason, and a puzzled look spread over his face
-as, shaking his head with a decision which I had but seldom seen in
-him.
-
-He said, "Oh, no, oh no! I want no souls. Life is all I want." Here
-he brightened up. "I am pretty indifferent about it at present. Life
-is all right. I have all I want. You must get a new patient, doctor,
-if you wish to study zoophagy!"
-
-This puzzled me a little, so I drew him on. "Then you command life.
-You are a god, I suppose?"
-
-He smiled with an ineffably benign superiority. "Oh no! Far be it
-from me to arrogate to myself the attributes of the Deity. I am not
-even concerned in His especially spiritual doings. If I may state my
-intellectual position I am, so far as concerns things purely
-terrestrial, somewhat in the position which Enoch occupied
-spiritually!"
-
-This was a poser to me. I could not at the moment recall Enoch's
-appositeness, so I had to ask a simple question, though I felt that by
-so doing I was lowering myself in the eyes of the lunatic. "And why
-with Enoch?"
-
-"Because he walked with God."
-
-I could not see the analogy, but did not like to admit it, so I harked
-back to what he had denied. "So you don't care about life and you
-don't want souls. Why not?" I put my question quickly and somewhat
-sternly, on purpose to disconcert him.
-
-The effort succeeded, for an instant he unconsciously relapsed into
-his old servile manner, bent low before me, and actually fawned upon
-me as he replied. "I don't want any souls, indeed, indeed! I don't.
-I couldn't use them if I had them. They would be no manner of use to
-me. I couldn't eat them or . . ."
-
-He suddenly stopped and the old cunning look spread over his face,
-like a wind sweep on the surface of the water.
-
-"And doctor, as to life, what is it after all? When you've got all
-you require, and you know that you will never want, that is all. I
-have friends, good friends, like you, Dr. Seward." This was said with
-a leer of inexpressible cunning. "I know that I shall never lack the
-means of life!"
-
-I think that through the cloudiness of his insanity he saw some
-antagonism in me, for he at once fell back on the last refuge of such
-as he, a dogged silence. After a short time I saw that for the
-present it was useless to speak to him. He was sulky, and so I came
-away.
-
-Later in the day he sent for me. Ordinarily I would not have come
-without special reason, but just at present I am so interested in him
-that I would gladly make an effort. Besides, I am glad to have
-anything to help pass the time. Harker is out, following up clues,
-and so are Lord Godalming and Quincey. Van Helsing sits in my study
-poring over the record prepared by the Harkers. He seems to think
-that by accurate knowledge of all details he will light up on some
-clue. He does not wish to be disturbed in the work, without cause. I
-would have taken him with me to see the patient, only I thought that
-after his last repulse he might not care to go again. There was also
-another reason. Renfield might not speak so freely before a third
-person as when he and I were alone.
-
-I found him sitting in the middle of the floor on his stool, a pose
-which is generally indicative of some mental energy on his part. When
-I came in, he said at once, as though the question had been waiting on
-his lips. "What about souls?"
-
-It was evident then that my surmise had been correct. Unconscious
-cerebration was doing its work, even with the lunatic. I determined
-to have the matter out.
-
-"What about them yourself?" I asked.
-
-He did not reply for a moment but looked all around him, and up and
-down, as though he expected to find some inspiration for an answer.
-
-"I don't want any souls!" he said in a feeble, apologetic way. The
-matter seemed preying on his mind, and so I determined to use it, to
-"be cruel only to be kind." So I said, "You like life, and you want
-life?"
-
-"Oh yes! But that is all right. You needn't worry about that!"
-
-"But," I asked, "how are we to get the life without getting the soul
-also?"
-
-This seemed to puzzle him, so I followed it up, "A nice time you'll
-have some time when you're flying out here, with the souls of
-thousands of flies and spiders and birds and cats buzzing and
-twittering and moaning all around you. You've got their lives, you
-know, and you must put up with their souls!"
-
-Something seemed to affect his imagination, for he put his fingers to
-his ears and shut his eyes, screwing them up tightly just as a small
-boy does when his face is being soaped. There was something pathetic
-in it that touched me. It also gave me a lesson, for it seemed that
-before me was a child, only a child, though the features were worn,
-and the stubble on the jaws was white. It was evident that he was
-undergoing some process of mental disturbance, and knowing how his
-past moods had interpreted things seemingly foreign to himself, I
-thought I would enter into his mind as well as I could and go with him.
-
-The first step was to restore confidence, so I asked him, speaking
-pretty loud so that he would hear me through his closed ears, "Would
-you like some sugar to get your flies around again?"
-
-He seemed to wake up all at once, and shook his head. With a laugh he
-replied, "Not much! Flies are poor things, after all!" After a pause
-he added, "But I don't want their souls buzzing round me, all the
-same."
-
-"Or spiders?" I went on.
-
-"Blow spiders! What's the use of spiders? There isn't anything in
-them to eat or . . ." He stopped suddenly as though reminded of a
-forbidden topic.
-
-"So, so!" I thought to myself, "this is the second time he has
-suddenly stopped at the word 'drink'. What does it mean?"
-
-Renfield seemed himself aware of having made a lapse, for he hurried
-on, as though to distract my attention from it, "I don't take any
-stock at all in such matters. 'Rats and mice and such small deer,' as
-Shakespeare has it, 'chicken feed of the larder' they might be called.
-I'm past all that sort of nonsense. You might as well ask a man to
-eat molecules with a pair of chopsticks, as to try to interest me
-about the less carnivora, when I know of what is before me."
-
-"I see," I said. "You want big things that you can make your teeth
-meet in? How would you like to breakfast on an elephant?"
-
-"What ridiculous nonsense you are talking?" He was getting too wide
-awake, so I thought I would press him hard.
-
-"I wonder," I said reflectively, "what an elephant's soul is like!"
-
-The effect I desired was obtained, for he at once fell from his
-high-horse and became a child again.
-
-"I don't want an elephant's soul, or any soul at all!" he said. For a
-few moments he sat despondently. Suddenly he jumped to his feet, with
-his eyes blazing and all the signs of intense cerebral excitement.
-"To hell with you and your souls!" he shouted. "Why do you plague me
-about souls? Haven't I got enough to worry, and pain, to distract me
-already, without thinking of souls?"
-
-He looked so hostile that I thought he was in for another homicidal
-fit, so I blew my whistle.
-
-The instant, however, that I did so he became calm, and said
-apologetically, "Forgive me, Doctor. I forgot myself. You do not
-need any help. I am so worried in my mind that I am apt to be
-irritable. If you only knew the problem I have to face, and that I am
-working out, you would pity, and tolerate, and pardon me. Pray do not
-put me in a strait waistcoat. I want to think and I cannot think
-freely when my body is confined. I am sure you will understand!"
-
-He had evidently self-control, so when the attendants came I told them
-not to mind, and they withdrew. Renfield watched them go. When the
-door was closed he said with considerable dignity and sweetness, "Dr.
-Seward, you have been very considerate towards me. Believe me that I
-am very, very grateful to you!"
-
-I thought it well to leave him in this mood, and so I came away.
-There is certainly something to ponder over in this man's state.
-Several points seem to make what the American interviewer calls "a
-story," if one could only get them in proper order. Here they are:
-
- Will not mention "drinking."
-
- Fears the thought of being burdened with the "soul" of anything.
-
- Has no dread of wanting "life" in the future.
-
- Despises the meaner forms of life altogether, though he dreads
- being haunted by their souls.
-
- Logically all these things point one way! He has assurance of
- some kind that he will acquire some higher life.
-
- He dreads the consequence, the burden of a soul. Then it is a
- human life he looks to!
-
- And the assurance . . .?
-
-Merciful God! The Count has been to him, and there is some new scheme
-of terror afoot!
-
-
-Later.--I went after my round to Van Helsing and told him my
-suspicion. He grew very grave, and after thinking the matter over for
-a while asked me to take him to Renfield. I did so. As we came to
-the door we heard the lunatic within singing gaily, as he used to do
-in the time which now seems so long ago.
-
-When we entered we saw with amazement that he had spread out his sugar
-as of old. The flies, lethargic with the autumn, were beginning to
-buzz into the room. We tried to make him talk of the subject of our
-previous conversation, but he would not attend. He went on with his
-singing, just as though we had not been present. He had got a scrap
-of paper and was folding it into a notebook. We had to come away as
-ignorant as we went in.
-
-His is a curious case indeed. We must watch him tonight.
-
-
-
-
-
-LETTER, MITCHELL, SONS & CANDY TO LORD GODALMING.
-
-"1 October.
-
-"My Lord,
-
-"We are at all times only too happy to meet your wishes. We beg,
-with regard to the desire of your Lordship, expressed by Mr.
-Harker on your behalf, to supply the following information
-concerning the sale and purchase of No. 347, Piccadilly. The
-original vendors are the executors of the late Mr. Archibald
-Winter-Suffield. The purchaser is a foreign nobleman, Count de
-Ville, who effected the purchase himself paying the purchase
-money in notes 'over the counter,' if your Lordship will pardon
-us using so vulgar an expression. Beyond this we know nothing
-whatever of him.
-
-"We are, my Lord,
-
-"Your Lordship's humble servants,
-
-"MITCHELL, SONS & CANDY."
-
-
-
-
-DR. SEWARD'S DIARY
-
-2 October.--I placed a man in the corridor last night, and told him to
-make an accurate note of any sound he might hear from Renfield's room,
-and gave him instructions that if there should be anything strange he
-was to call me. After dinner, when we had all gathered round the fire
-in the study, Mrs. Harker having gone to bed, we discussed the
-attempts and discoveries of the day. Harker was the only one who had
-any result, and we are in great hopes that his clue may be an
-important one.
-
-Before going to bed I went round to the patient's room and looked in
-through the observation trap. He was sleeping soundly, his heart rose
-and fell with regular respiration.
-
-This morning the man on duty reported to me that a little after
-midnight he was restless and kept saying his prayers somewhat loudly.
-I asked him if that was all. He replied that it was all he heard.
-There was something about his manner, so suspicious that I asked him
-point blank if he had been asleep. He denied sleep, but admitted to
-having "dozed" for a while. It is too bad that men cannot be trusted
-unless they are watched.
-
-Today Harker is out following up his clue, and Art and Quincey are
-looking after horses. Godalming thinks that it will be well to have
-horses always in readiness, for when we get the information which we
-seek there will be no time to lose. We must sterilize all the
-imported earth between sunrise and sunset. We shall thus catch the
-Count at his weakest, and without a refuge to fly to. Van Helsing is
-off to the British Museum looking up some authorities on ancient
-medicine. The old physicians took account of things which their
-followers do not accept, and the Professor is searching for witch and
-demon cures which may be useful to us later.
-
-I sometimes think we must be all mad and that we shall wake to sanity
-in strait waistcoats.
-
-Later.--We have met again. We seem at last to be on the track, and
-our work of tomorrow may be the beginning of the end. I wonder if
-Renfield's quiet has anything to do with this. His moods have so
-followed the doings of the Count, that the coming destruction of the
-monster may be carried to him some subtle way. If we could only get
-some hint as to what passed in his mind, between the time of my
-argument with him today and his resumption of fly-catching, it might
-afford us a valuable clue. He is now seemingly quiet for a spell . . .
-Is he? That wild yell seemed to come from his room . . .
-
-The attendant came bursting into my room and told me that Renfield had
-somehow met with some accident. He had heard him yell, and when he
-went to him found him lying on his face on the floor, all covered with
-blood. I must go at once . . .
-
-
-
-
-CHAPTER 21
-
-
-DR. SEWARD'S DIARY
-
-3 October.--Let me put down with exactness all that happened, as well
-as I can remember, since last I made an entry. Not a detail that I
-can recall must be forgotten. In all calmness I must proceed.
-
-When I came to Renfield's room I found him lying on the floor on his
-left side in a glittering pool of blood. When I went to move him, it
-became at once apparent that he had received some terrible injuries.
-There seemed none of the unity of purpose between the parts of the
-body which marks even lethargic sanity. As the face was exposed I
-could see that it was horribly bruised, as though it had been beaten
-against the floor. Indeed it was from the face wounds that the pool
-of blood originated.
-
-The attendant who was kneeling beside the body said to me as we turned
-him over, "I think, sir, his back is broken. See, both his right arm
-and leg and the whole side of his face are paralysed." How such a
-thing could have happened puzzled the attendant beyond measure. He
-seemed quite bewildered, and his brows were gathered in as he said, "I
-can't understand the two things. He could mark his face like that by
-beating his own head on the floor. I saw a young woman do it once at
-the Eversfield Asylum before anyone could lay hands on her. And I
-suppose he might have broken his neck by falling out of bed, if he got
-in an awkward kink. But for the life of me I can't imagine how the
-two things occurred. If his back was broke, he couldn't beat his
-head, and if his face was like that before the fall out of bed, there
-would be marks of it."
-
-I said to him, "Go to Dr. Van Helsing, and ask him to kindly come here
-at once. I want him without an instant's delay."
-
-The man ran off, and within a few minutes the Professor, in his
-dressing gown and slippers, appeared. When he saw Renfield on the
-ground, he looked keenly at him a moment, and then turned to me. I
-think he recognized my thought in my eyes, for he said very quietly,
-manifestly for the ears of the attendant, "Ah, a sad accident! He
-will need very careful watching, and much attention. I shall stay
-with you myself, but I shall first dress myself. If you will remain I
-shall in a few minutes join you."
-
-The patient was now breathing stertorously and it was easy to see that
-he had suffered some terrible injury.
-
-Van Helsing returned with extraordinary celerity, bearing with him a
-surgical case. He had evidently been thinking and had his mind made
-up, for almost before he looked at the patient, he whispered to me,
-"Send the attendant away. We must be alone with him when he becomes
-conscious, after the operation."
-
-I said, "I think that will do now, Simmons. We have done all that we
-can at present. You had better go your round, and Dr. Van Helsing
-will operate. Let me know instantly if there be anything unusual
-anywhere."
-
-The man withdrew, and we went into a strict examination of the
-patient. The wounds of the face were superficial. The real injury
-was a depressed fracture of the skull, extending right up through the
-motor area.
-
-The Professor thought a moment and said, "We must reduce the pressure
-and get back to normal conditions, as far as can be. The rapidity of
-the suffusion shows the terrible nature of his injury. The whole
-motor area seems affected. The suffusion of the brain will increase
-quickly, so we must trephine at once or it may be too late."
-
-As he was speaking there was a soft tapping at the door. I went over
-and opened it and found in the corridor without, Arthur and Quincey in
-pajamas and slippers; the former spoke, "I heard your man call up Dr.
-Van Helsing and tell him of an accident. So I woke Quincey or rather
-called for him as he was not asleep. Things are moving too quickly
-and too strangely for sound sleep for any of us these times. I've
-been thinking that tomorrow night will not see things as they have
-been. We'll have to look back, and forward a little more than we have
-done. May we come in?"
-
-I nodded, and held the door open till they had entered, then I closed
-it again. When Quincey saw the attitude and state of the patient, and
-noted the horrible pool on the floor, he said softly, "My God! What
-has happened to him? Poor, poor devil!"
-
-I told him briefly, and added that we expected he would recover
-consciousness after the operation, for a short time, at all events.
-He went at once and sat down on the edge of the bed, with Godalming
-beside him. We all watched in patience.
-
-"We shall wait," said Van Helsing, "just long enough to fix the best
-spot for trephining, so that we may most quickly and perfectly remove
-the blood clot, for it is evident that the haemorrhage is increasing."
-
-The minutes during which we waited passed with fearful slowness. I
-had a horrible sinking in my heart, and from Van Helsing's face I
-gathered that he felt some fear or apprehension as to what was to
-come. I dreaded the words Renfield might speak. I was positively
-afraid to think. But the conviction of what was coming was on me, as
-I have read of men who have heard the death watch. The poor man's
-breathing came in uncertain gasps. Each instant he seemed as though
-he would open his eyes and speak, but then would follow a prolonged
-stertorous breath, and he would relapse into a more fixed
-insensibility. Inured as I was to sick beds and death, this suspense
-grew and grew upon me. I could almost hear the beating of my own
-heart, and the blood surging through my temples sounded like blows
-from a hammer. The silence finally became agonizing. I looked at my
-companions, one after another, and saw from their flushed faces and
-damp brows that they were enduring equal torture. There was a nervous
-suspense over us all, as though overhead some dread bell would peal
-out powerfully when we should least expect it.
-
-At last there came a time when it was evident that the patient was
-sinking fast. He might die at any moment. I looked up at the
-Professor and caught his eyes fixed on mine. His face was sternly set
-as he spoke, "There is no time to lose. His words may be worth many
-lives. I have been thinking so, as I stood here. It may be there is
-a soul at stake! We shall operate just above the ear."
-
-Without another word he made the operation. For a few moments the
-breathing continued to be stertorous. Then there came a breath so
-prolonged that it seemed as though it would tear open his chest.
-Suddenly his eyes opened, and became fixed in a wild, helpless stare.
-This was continued for a few moments, then it was softened into a glad
-surprise, and from his lips came a sigh of relief. He moved
-convulsively, and as he did so, said, "I'll be quiet, Doctor. Tell
-them to take off the strait waistcoat. I have had a terrible dream,
-and it has left me so weak that I cannot move. What's wrong with my
-face? It feels all swollen, and it smarts dreadfully."
-
-He tried to turn his head, but even with the effort his eyes seemed to
-grow glassy again so I gently put it back. Then Van Helsing said in a
-quiet grave tone, "Tell us your dream, Mr. Renfield."
-
-As he heard the voice his face brightened, through its mutilation, and
-he said, "That is Dr. Van Helsing. How good it is of you to be here.
-Give me some water, my lips are dry, and I shall try to tell you. I
-dreamed . . ."
-
-He stopped and seemed fainting. I called quietly to Quincey, "The
-brandy, it is in my study, quick!" He flew and returned with a glass,
-the decanter of brandy and a carafe of water. We moistened the
-parched lips, and the patient quickly revived.
-
-It seemed, however, that his poor injured brain had been working in
-the interval, for when he was quite conscious, he looked at me
-piercingly with an agonized confusion which I shall never forget, and
-said, "I must not deceive myself. It was no dream, but all a grim
-reality." Then his eyes roved round the room. As they caught sight
-of the two figures sitting patiently on the edge of the bed he went
-on, "If I were not sure already, I would know from them."
-
-For an instant his eyes closed, not with pain or sleep but
-voluntarily, as though he were bringing all his faculties to bear.
-When he opened them he said, hurriedly, and with more energy than he
-had yet displayed, "Quick, Doctor, quick, I am dying! I feel that I
-have but a few minutes, and then I must go back to death, or worse!
-Wet my lips with brandy again. I have something that I must say
-before I die. Or before my poor crushed brain dies anyhow. Thank
-you! It was that night after you left me, when I implored you to let
-me go away. I couldn't speak then, for I felt my tongue was tied.
-But I was as sane then, except in that way, as I am now. I was in an
-agony of despair for a long time after you left me, it seemed hours.
-Then there came a sudden peace to me. My brain seemed to become cool
-again, and I realized where I was. I heard the dogs bark behind our
-house, but not where He was!"
-
-As he spoke, Van Helsing's eyes never blinked, but his hand came out
-and met mine and gripped it hard. He did not, however, betray
-himself. He nodded slightly and said, "Go on," in a low voice.
-
-Renfield proceeded. "He came up to the window in the mist, as I had
-seen him often before, but he was solid then, not a ghost, and his
-eyes were fierce like a man's when angry. He was laughing with his
-red mouth, the sharp white teeth glinted in the moonlight when he
-turned to look back over the belt of trees, to where the dogs were
-barking. I wouldn't ask him to come in at first, though I knew he
-wanted to, just as he had wanted all along. Then he began promising
-me things, not in words but by doing them."
-
-He was interrupted by a word from the Professor, "How?"
-
-"By making them happen. Just as he used to send in the flies when the
-sun was shining. Great big fat ones with steel and sapphire on their
-wings. And big moths, in the night, with skull and cross-bones on
-their backs."
-
-Van Helsing nodded to him as he whispered to me unconsciously, "The
-Acherontia Atropos of the Sphinges, what you call the 'Death's-head
-Moth'?"
-
-The patient went on without stopping, "Then he began to whisper. 'Rats,
-rats, rats! Hundreds, thousands, millions of them, and every one a
-life. And dogs to eat them, and cats too. All lives! All red blood,
-with years of life in it, and not merely buzzing flies!' I laughed at
-him, for I wanted to see what he could do. Then the dogs howled, away
-beyond the dark trees in His house. He beckoned me to the window. I
-got up and looked out, and He raised his hands, and seemed to call out
-without using any words. A dark mass spread over the grass, coming on
-like the shape of a flame of fire. And then He moved the mist to the
-right and left, and I could see that there were thousands of rats with
-their eyes blazing red, like His only smaller. He held up his hand,
-and they all stopped, and I thought he seemed to be saying, 'All these
-lives will I give you, ay, and many more and greater, through
-countless ages, if you will fall down and worship me!' And then a red
-cloud, like the colour of blood, seemed to close over my eyes, and
-before I knew what I was doing, I found myself opening the sash and
-saying to Him, 'Come in, Lord and Master!' The rats were all gone, but
-He slid into the room through the sash, though it was only open an
-inch wide, just as the Moon herself has often come in through the
-tiniest crack and has stood before me in all her size and splendour."
-
-His voice was weaker, so I moistened his lips with the brandy again,
-and he continued, but it seemed as though his memory had gone on
-working in the interval for his story was further advanced. I was
-about to call him back to the point, but Van Helsing whispered to me,
-"Let him go on. Do not interrupt him. He cannot go back, and maybe
-could not proceed at all if once he lost the thread of his thought."
-
-He proceeded, "All day I waited to hear from him, but he did not send
-me anything, not even a blowfly, and when the moon got up I was pretty
-angry with him. When he did slide in through the window, though it
-was shut, and did not even knock, I got mad with him. He sneered at
-me, and his white face looked out of the mist with his red eyes
-gleaming, and he went on as though he owned the whole place, and I was
-no one. He didn't even smell the same as he went by me. I couldn't
-hold him. I thought that, somehow, Mrs. Harker had come into the
-room."
-
-The two men sitting on the bed stood up and came over, standing behind
-him so that he could not see them, but where they could hear better.
-They were both silent, but the Professor started and quivered. His
-face, however, grew grimmer and sterner still. Renfield went on
-without noticing, "When Mrs. Harker came in to see me this afternoon
-she wasn't the same. It was like tea after the teapot has been
-watered." Here we all moved, but no one said a word.
-
-He went on, "I didn't know that she was here till she spoke, and she
-didn't look the same. I don't care for the pale people. I like them
-with lots of blood in them, and hers all seemed to have run out. I
-didn't think of it at the time, but when she went away I began to
-think, and it made me mad to know that He had been taking the life out
-of her." I could feel that the rest quivered, as I did; but we
-remained otherwise still. "So when He came tonight I was ready for
-Him. I saw the mist stealing in, and I grabbed it tight. I had heard
-that madmen have unnatural strength. And as I knew I was a madman, at
-times anyhow, I resolved to use my power. Ay, and He felt it too, for
-He had to come out of the mist to struggle with me. I held tight, and
-I thought I was going to win, for I didn't mean Him to take any more
-of her life, till I saw His eyes. They burned into me, and my
-strength became like water. He slipped through it, and when I tried
-to cling to Him, He raised me up and flung me down. There was a red
-cloud before me, and a noise like thunder, and the mist seemed to
-steal away under the door."
-
-His voice was becoming fainter and his breath more stertorous. Van
-Helsing stood up instinctively.
-
-"We know the worst now," he said. "He is here, and we know his
-purpose. It may not be too late. Let us be armed, the same as we
-were the other night, but lose no time, there is not an instant to
-spare."
-
-There was no need to put our fear, nay our conviction, into words, we
-shared them in common. We all hurried and took from our rooms the
-same things that we had when we entered the Count's house. The
-Professor had his ready, and as we met in the corridor he pointed to
-them significantly as he said, "They never leave me, and they shall
-not till this unhappy business is over. Be wise also, my friends. It
-is no common enemy that we deal with Alas! Alas! That dear Madam
-Mina should suffer!" He stopped, his voice was breaking, and I do not
-know if rage or terror predominated in my own heart.
-
-Outside the Harkers' door we paused. Art and Quincey held back, and
-the latter said, "Should we disturb her?"
-
-"We must," said Van Helsing grimly. "If the door be locked, I shall
-break it in."
-
-"May it not frighten her terribly? It is unusual to break into a
-lady's room!"
-
-Van Helsing said solemnly, "You are always right. But this is life
-and death. All chambers are alike to the doctor. And even were they
-not they are all as one to me tonight. Friend John, when I turn the
-handle, if the door does not open, do you put your shoulder down and
-shove; and you too, my friends. Now!"
-
-He turned the handle as he spoke, but the door did not yield. We
-threw ourselves against it. With a crash it burst open, and we almost
-fell headlong into the room. The Professor did actually fall, and I
-saw across him as he gathered himself up from hands and knees. What I
-saw appalled me. I felt my hair rise like bristles on the back of my
-neck, and my heart seemed to stand still.
-
-The moonlight was so bright that through the thick yellow blind the
-room was light enough to see. On the bed beside the window lay
-Jonathan Harker, his face flushed and breathing heavily as though in a
-stupor. Kneeling on the near edge of the bed facing outwards was the
-white-clad figure of his wife. By her side stood a tall, thin man,
-clad in black. His face was turned from us, but the instant we saw we
-all recognized the Count, in every way, even to the scar on his
-forehead. With his left hand he held both Mrs. Harker's hands,
-keeping them away with her arms at full tension. His right hand
-gripped her by the back of the neck, forcing her face down on his
-bosom. Her white nightdress was smeared with blood, and a thin stream
-trickled down the man's bare chest which was shown by his torn-open
-dress. The attitude of the two had a terrible resemblance to a child
-forcing a kitten's nose into a saucer of milk to compel it to drink.
-As we burst into the room, the Count turned his face, and the hellish
-look that I had heard described seemed to leap into it. His eyes
-flamed red with devilish passion. The great nostrils of the white
-aquiline nose opened wide and quivered at the edge, and the white
-sharp teeth, behind the full lips of the blood dripping mouth, clamped
-together like those of a wild beast. With a wrench, which threw his
-victim back upon the bed as though hurled from a height, he turned and
-sprang at us. But by this time the Professor had gained his feet, and
-was holding towards him the envelope which contained the Sacred Wafer.
-The Count suddenly stopped, just as poor Lucy had done outside the
-tomb, and cowered back. Further and further back he cowered, as we,
-lifting our crucifixes, advanced. The moonlight suddenly failed, as a
-great black cloud sailed across the sky. And when the gaslight sprang
-up under Quincey's match, we saw nothing but a faint vapour. This, as
-we looked, trailed under the door, which with the recoil from its
-bursting open, had swung back to its old position. Van Helsing, Art,
-and I moved forward to Mrs. Harker, who by this time had drawn her
-breath and with it had given a scream so wild, so ear-piercing, so
-despairing that it seems to me now that it will ring in my ears till
-my dying day. For a few seconds she lay in her helpless attitude and
-disarray. Her face was ghastly, with a pallor which was accentuated
-by the blood which smeared her lips and cheeks and chin. From her
-throat trickled a thin stream of blood. Her eyes were mad with
-terror. Then she put before her face her poor crushed hands, which
-bore on their whiteness the red mark of the Count's terrible grip, and
-from behind them came a low desolate wail which made the terrible
-scream seem only the quick expression of an endless grief. Van
-Helsing stepped forward and drew the coverlet gently over her body,
-whilst Art, after looking at her face for an instant despairingly, ran
-out of the room.
-
-Van Helsing whispered to me, "Jonathan is in a stupor such as we know
-the Vampire can produce. We can do nothing with poor Madam Mina for a
-few moments till she recovers herself. I must wake him!"
-
-He dipped the end of a towel in cold water and with it began to flick
-him on the face, his wife all the while holding her face between her
-hands and sobbing in a way that was heart breaking to hear. I raised
-the blind, and looked out of the window. There was much moonshine,
-and as I looked I could see Quincey Morris run across the lawn and
-hide himself in the shadow of a great yew tree. It puzzled me to
-think why he was doing this. But at the instant I heard Harker's
-quick exclamation as he woke to partial consciousness, and turned to
-the bed. On his face, as there might well be, was a look of wild
-amazement. He seemed dazed for a few seconds, and then full
-consciousness seemed to burst upon him all at once, and he started up.
-
-His wife was aroused by the quick movement, and turned to him with her
-arms stretched out, as though to embrace him. Instantly, however, she
-drew them in again, and putting her elbows together, held her hands
-before her face, and shuddered till the bed beneath her shook.
-
-"In God's name what does this mean?" Harker cried out. "Dr. Seward,
-Dr. Van Helsing, what is it? What has happened? What is wrong? Mina,
-dear what is it? What does that blood mean? My God, my God! Has it
-come to this!" And, raising himself to his knees, he beat his hands
-wildly together. "Good God help us! Help her! Oh, help her!"
-
-With a quick movement he jumped from bed, and began to pull on his
-clothes, all the man in him awake at the need for instant exertion.
-"What has happened? Tell me all about it!" he cried without pausing.
-"Dr. Van Helsing, you love Mina, I know. Oh, do something to save her.
-It cannot have gone too far yet. Guard her while I look for him!"
-
-His wife, through her terror and horror and distress, saw some sure
-danger to him. Instantly forgetting her own grief, she seized hold of
-him and cried out.
-
-"No! No! Jonathan, you must not leave me. I have suffered enough
-tonight, God knows, without the dread of his harming you. You must
-stay with me. Stay with these friends who will watch over you!" Her
-expression became frantic as she spoke. And, he yielding to her, she
-pulled him down sitting on the bedside, and clung to him fiercely.
-
-Van Helsing and I tried to calm them both. The Professor held up his
-golden crucifix, and said with wonderful calmness, "Do not fear, my
-dear. We are here, and whilst this is close to you no foul thing can
-approach. You are safe for tonight, and we must be calm and take
-counsel together."
-
-She shuddered and was silent, holding down her head on her husband's
-breast. When she raised it, his white nightrobe was stained with
-blood where her lips had touched, and where the thin open wound in the
-neck had sent forth drops. The instant she saw it she drew back, with
-a low wail, and whispered, amidst choking sobs.
-
-"Unclean, unclean! I must touch him or kiss him no more. Oh, that it
-should be that it is I who am now his worst enemy, and whom he may
-have most cause to fear."
-
-To this he spoke out resolutely, "Nonsense, Mina. It is a shame to me
-to hear such a word. I would not hear it of you. And I shall not
-hear it from you. May God judge me by my deserts, and punish me with
-more bitter suffering than even this hour, if by any act or will of
-mine anything ever come between us!"
-
-He put out his arms and folded her to his breast. And for a while she
-lay there sobbing. He looked at us over her bowed head, with eyes
-that blinked damply above his quivering nostrils. His mouth was set
-as steel.
-
-After a while her sobs became less frequent and more faint, and then
-he said to me, speaking with a studied calmness which I felt tried his
-nervous power to the utmost.
-
-"And now, Dr. Seward, tell me all about it. Too well I know the broad
-fact. Tell me all that has been."
-
-I told him exactly what had happened and he listened with seeming
-impassiveness, but his nostrils twitched and his eyes blazed as I told
-how the ruthless hands of the Count had held his wife in that terrible
-and horrid position, with her mouth to the open wound in his breast.
-It interested me, even at that moment, to see that whilst the face of
-white set passion worked convulsively over the bowed head, the hands
-tenderly and lovingly stroked the ruffled hair. Just as I had
-finished, Quincey and Godalming knocked at the door. They entered in
-obedience to our summons. Van Helsing looked at me questioningly. I
-understood him to mean if we were to take advantage of their coming to
-divert if possible the thoughts of the unhappy husband and wife from
-each other and from themselves. So on nodding acquiescence to him he
-asked them what they had seen or done. To which Lord Godalming
-answered.
-
-"I could not see him anywhere in the passage, or in any of our rooms.
-I looked in the study but, though he had been there, he had gone. He
-had, however . . ." He stopped suddenly, looking at the poor drooping
-figure on the bed.
-
-Van Helsing said gravely, "Go on, friend Arthur. We want here no more
-concealments. Our hope now is in knowing all. Tell freely!"
-
-So Art went on, "He had been there, and though it could only have been
-for a few seconds, he made rare hay of the place. All the manuscript
-had been burned, and the blue flames were flickering amongst the white
-ashes. The cylinders of your phonograph too were thrown on the fire,
-and the wax had helped the flames."
-
-Here I interrupted. "Thank God there is the other copy in the safe!"
-
-His face lit for a moment, but fell again as he went on. "I ran
-downstairs then, but could see no sign of him. I looked into
-Renfield's room, but there was no trace there except . . ." Again he
-paused.
-
-"Go on," said Harker hoarsely. So he bowed his head and moistening his
-lips with his tongue, added, "except that the poor fellow is dead."
-
-Mrs. Harker raised her head, looking from one to the other of us she
-said solemnly, "God's will be done!"
-
-I could not but feel that Art was keeping back something. But, as I
-took it that it was with a purpose, I said nothing.
-
-Van Helsing turned to Morris and asked, "And you, friend Quincey, have
-you any to tell?"
-
-"A little," he answered. "It may be much eventually, but at present I
-can't say. I thought it well to know if possible where the Count
-would go when he left the house. I did not see him, but I saw a bat
-rise from Renfield's window, and flap westward. I expected to see him
-in some shape go back to Carfax, but he evidently sought some other
-lair. He will not be back tonight, for the sky is reddening in the
-east, and the dawn is close. We must work tomorrow!"
-
-He said the latter words through his shut teeth. For a space of
-perhaps a couple of minutes there was silence, and I could fancy that
-I could hear the sound of our hearts beating.
-
-Then Van Helsing said, placing his hand tenderly on Mrs. Harker's
-head, "And now, Madam Mina, poor dear, dear, Madam Mina, tell us
-exactly what happened. God knows that I do not want that you be
-pained, but it is need that we know all. For now more than ever has
-all work to be done quick and sharp, and in deadly earnest. The day
-is close to us that must end all, if it may be so, and now is the
-chance that we may live and learn."
-
-The poor dear lady shivered, and I could see the tension of her nerves
-as she clasped her husband closer to her and bent her head lower and
-lower still on his breast. Then she raised her head proudly, and held
-out one hand to Van Helsing who took it in his, and after stooping and
-kissing it reverently, held it fast. The other hand was locked in
-that of her husband, who held his other arm thrown round her
-protectingly. After a pause in which she was evidently ordering her
-thoughts, she began.
-
-"I took the sleeping draught which you had so kindly given me, but for
-a long time it did not act. I seemed to become more wakeful, and
-myriads of horrible fancies began to crowd in upon my mind. All of
-them connected with death, and vampires, with blood, and pain, and
-trouble." Her husband involuntarily groaned as she turned to him and
-said lovingly, "Do not fret, dear. You must be brave and strong, and
-help me through the horrible task. If you only knew what an effort it
-is to me to tell of this fearful thing at all, you would understand
-how much I need your help. Well, I saw I must try to help the
-medicine to its work with my will, if it was to do me any good, so I
-resolutely set myself to sleep. Sure enough sleep must soon have come
-to me, for I remember no more. Jonathan coming in had not waked me,
-for he lay by my side when next I remember. There was in the room the
-same thin white mist that I had before noticed. But I forget now if
-you know of this. You will find it in my diary which I shall show you
-later. I felt the same vague terror which had come to me before and
-the same sense of some presence. I turned to wake Jonathan, but found
-that he slept so soundly that it seemed as if it was he who had taken
-the sleeping draught, and not I. I tried, but I could not wake him.
-This caused me a great fear, and I looked around terrified. Then
-indeed, my heart sank within me. Beside the bed, as if he had stepped
-out of the mist, or rather as if the mist had turned into his figure,
-for it had entirely disappeared, stood a tall, thin man, all in
-black. I knew him at once from the description of the others. The
-waxen face, the high aquiline nose, on which the light fell in a thin
-white line, the parted red lips, with the sharp white teeth showing
-between, and the red eyes that I had seemed to see in the sunset on
-the windows of St. Mary's Church at Whitby. I knew, too, the red scar
-on his forehead where Jonathan had struck him. For an instant my
-heart stood still, and I would have screamed out, only that I was
-paralyzed. In the pause he spoke in a sort of keen, cutting whisper,
-pointing as he spoke to Jonathan.
-
-"'Silence! If you make a sound I shall take him and dash his brains
-out before your very eyes.' I was appalled and was too bewildered to
-do or say anything. With a mocking smile, he placed one hand upon my
-shoulder and, holding me tight, bared my throat with the other, saying
-as he did so, 'First, a little refreshment to reward my exertions.
-You may as well be quiet. It is not the first time, or the second,
-that your veins have appeased my thirst!' I was bewildered, and
-strangely enough, I did not want to hinder him. I suppose it is a
-part of the horrible curse that such is, when his touch is on his
-victim. And oh, my God, my God, pity me! He placed his reeking lips
-upon my throat!" Her husband groaned again. She clasped his hand
-harder, and looked at him pityingly, as if he were the injured one,
-and went on.
-
-"I felt my strength fading away, and I was in a half swoon. How long
-this horrible thing lasted I know not, but it seemed that a long time
-must have passed before he took his foul, awful, sneering mouth away.
-I saw it drip with the fresh blood!" The remembrance seemed for a while
-to overpower her, and she drooped and would have sunk down but for her
-husband's sustaining arm. With a great effort she recovered herself
-and went on.
-
-"Then he spoke to me mockingly, 'And so you, like the others, would
-play your brains against mine. You would help these men to hunt me
-and frustrate me in my design! You know now, and they know in part
-already, and will know in full before long, what it is to cross my
-path. They should have kept their energies for use closer to home.
-Whilst they played wits against me, against me who commanded nations,
-and intrigued for them, and fought for them, hundreds of years before
-they were born, I was countermining them. And you, their best beloved
-one, are now to me, flesh of my flesh, blood of my blood, kin of my
-kin, my bountiful wine-press for a while, and shall be later on my
-companion and my helper. You shall be avenged in turn, for not one of
-them but shall minister to your needs. But as yet you are to be
-punished for what you have done. You have aided in thwarting me. Now
-you shall come to my call. When my brain says "Come!" to you, you
-shall cross land or sea to do my bidding. And to that end this!'
-
-"With that he pulled open his shirt, and with his long sharp nails
-opened a vein in his breast. When the blood began to spurt out, he
-took my hands in one of his, holding them tight, and with the other
-seized my neck and pressed my mouth to the wound, so that I must
-either suffocate or swallow some to the . . . Oh, my God! My God!
-What have I done? What have I done to deserve such a fate, I who have
-tried to walk in meekness and righteousness all my days. God pity
-me! Look down on a poor soul in worse than mortal peril. And in
-mercy pity those to whom she is dear!" Then she began to rub her lips
-as though to cleanse them from pollution.
-
-As she was telling her terrible story, the eastern sky began to
-quicken, and everything became more and more clear. Harker was still
-and quiet; but over his face, as the awful narrative went on, came a
-grey look which deepened and deepened in the morning light, till when
-the first red streak of the coming dawn shot up, the flesh stood
-darkly out against the whitening hair.
-
-We have arranged that one of us is to stay within call of the unhappy
-pair till we can meet together and arrange about taking action.
-
-Of this I am sure. The sun rises today on no more miserable house in
-all the great round of its daily course.
-
-
-
-
-CHAPTER 22
-
-
-JONATHAN HARKER'S JOURNAL
-
-3 October.--As I must do something or go mad, I write this diary. It
-is now six o'clock, and we are to meet in the study in half an hour
-and take something to eat, for Dr. Van Helsing and Dr. Seward are
-agreed that if we do not eat we cannot work our best. Our best will
-be, God knows, required today. I must keep writing at every chance,
-for I dare not stop to think. All, big and little, must go down.
-Perhaps at the end the little things may teach us most. The teaching,
-big or little, could not have landed Mina or me anywhere worse than we
-are today. However, we must trust and hope. Poor Mina told me just
-now, with the tears running down her dear cheeks, that it is in
-trouble and trial that our faith is tested. That we must keep on
-trusting, and that God will aid us up to the end. The end! Oh my
-God! What end? . . . To work! To work!
-
-When Dr. Van Helsing and Dr. Seward had come back from seeing poor
-Renfield, we went gravely into what was to be done. First, Dr. Seward
-told us that when he and Dr. Van Helsing had gone down to the room
-below they had found Renfield lying on the floor, all in a heap. His
-face was all bruised and crushed in, and the bones of the neck were
-broken.
-
-Dr. Seward asked the attendant who was on duty in the passage if he
-had heard anything. He said that he had been sitting down, he
-confessed to half dozing, when he heard loud voices in the room, and
-then Renfield had called out loudly several times, "God! God! God!"
-After that there was a sound of falling, and when he entered the room
-he found him lying on the floor, face down, just as the doctors had
-seen him. Van Helsing asked if he had heard "voices" or "a voice,"
-and he said he could not say. That at first it had seemed to him as
-if there were two, but as there was no one in the room it could have
-been only one. He could swear to it, if required, that the word "God"
-was spoken by the patient.
-
-Dr. Seward said to us, when we were alone, that he did not wish to go
-into the matter. The question of an inquest had to be considered, and
-it would never do to put forward the truth, as no one would believe
-it. As it was, he thought that on the attendant's evidence he could
-give a certificate of death by misadventure in falling from bed. In
-case the coroner should demand it, there would be a formal inquest,
-necessarily to the same result.
-
-When the question began to be discussed as to what should be our next
-step, the very first thing we decided was that Mina should be in full
-confidence. That nothing of any sort, no matter how painful, should
-be kept from her. She herself agreed as to its wisdom, and it was
-pitiful to see her so brave and yet so sorrowful, and in such a depth
-of despair.
-
-"There must be no concealment," she said. "Alas! We have had too
-much already. And besides there is nothing in all the world that can
-give me more pain than I have already endured, than I suffer now!
-Whatever may happen, it must be of new hope or of new courage to me!"
-
-Van Helsing was looking at her fixedly as she spoke, and said,
-suddenly but quietly, "But dear Madam Mina, are you not afraid. Not
-for yourself, but for others from yourself, after what has happened?"
-
-Her face grew set in its lines, but her eyes shone with the devotion
-of a martyr as she answered, "Ah no! For my mind is made up!"
-
-"To what?" he asked gently, whilst we were all very still, for each in
-our own way we had a sort of vague idea of what she meant.
-
-Her answer came with direct simplicity, as though she was simply
-stating a fact, "Because if I find in myself, and I shall watch keenly
-for it, a sign of harm to any that I love, I shall die!"
-
-"You would not kill yourself?" he asked, hoarsely.
-
-"I would. If there were no friend who loved me, who would save me
-such a pain, and so desperate an effort!" She looked at him meaningly
-as she spoke.
-
-He was sitting down, but now he rose and came close to her and put his
-hand on her head as he said solemnly. "My child, there is such an one
-if it were for your good. For myself I could hold it in my account
-with God to find such an euthanasia for you, even at this moment if it
-were best. Nay, were it safe! But my child . . ."
-
-For a moment he seemed choked, and a great sob rose in his throat. He
-gulped it down and went on, "There are here some who would stand
-between you and death. You must not die. You must not die by any
-hand, but least of all your own. Until the other, who has fouled your
-sweet life, is true dead you must not die. For if he is still with
-the quick Undead, your death would make you even as he is. No, you
-must live! You must struggle and strive to live, though death would
-seem a boon unspeakable. You must fight Death himself, though he come
-to you in pain or in joy. By the day, or the night, in safety or in
-peril! On your living soul I charge you that you do not die. Nay,
-nor think of death, till this great evil be past."
-
-The poor dear grew white as death, and shook and shivered, as I have
-seen a quicksand shake and shiver at the incoming of the tide. We
-were all silent. We could do nothing. At length she grew more calm
-and turning to him said sweetly, but oh so sorrowfully, as she held
-out her hand, "I promise you, my dear friend, that if God will let me
-live, I shall strive to do so. Till, if it may be in His good time,
-this horror may have passed away from me."
-
-She was so good and brave that we all felt that our hearts were
-strengthened to work and endure for her, and we began to discuss what
-we were to do. I told her that she was to have all the papers in the
-safe, and all the papers or diaries and phonographs we might hereafter
-use, and was to keep the record as she had done before. She was
-pleased with the prospect of anything to do, if "pleased" could be
-used in connection with so grim an interest.
-
-As usual Van Helsing had thought ahead of everyone else, and was
-prepared with an exact ordering of our work.
-
-"It is perhaps well," he said, "that at our meeting after our visit to
-Carfax we decided not to do anything with the earth boxes that lay
-there. Had we done so, the Count must have guessed our purpose, and
-would doubtless have taken measures in advance to frustrate such an
-effort with regard to the others. But now he does not know our
-intentions. Nay, more, in all probability, he does not know that such
-a power exists to us as can sterilize his lairs, so that he cannot use
-them as of old.
-
-"We are now so much further advanced in our knowledge as to their
-disposition that, when we have examined the house in Piccadilly, we may
-track the very last of them. Today then, is ours, and in it rests our
-hope. The sun that rose on our sorrow this morning guards us in its
-course. Until it sets tonight, that monster must retain whatever form
-he now has. He is confined within the limitations of his earthly
-envelope. He cannot melt into thin air nor disappear through cracks
-or chinks or crannies. If he go through a doorway, he must open the
-door like a mortal. And so we have this day to hunt out all his lairs
-and sterilize them. So we shall, if we have not yet catch him and
-destroy him, drive him to bay in some place where the catching and the
-destroying shall be, in time, sure."
-
-Here I started up for I could not contain myself at the thought that
-the minutes and seconds so preciously laden with Mina's life and
-happiness were flying from us, since whilst we talked action was
-impossible. But Van Helsing held up his hand warningly.
-
-"Nay, friend Jonathan," he said, "in this, the quickest way home is
-the longest way, so your proverb say. We shall all act and act with
-desperate quick, when the time has come. But think, in all probable
-the key of the situation is in that house in Piccadilly. The Count
-may have many houses which he has bought. Of them he will have deeds
-of purchase, keys and other things. He will have paper that he write
-on. He will have his book of cheques. There are many belongings that
-he must have somewhere. Why not in this place so central, so quiet,
-where he come and go by the front or the back at all hours, when in
-the very vast of the traffic there is none to notice. We shall go
-there and search that house. And when we learn what it holds, then we
-do what our friend Arthur call, in his phrases of hunt 'stop the
-earths' and so we run down our old fox, so? Is it not?"
-
-"Then let us come at once," I cried, "we are wasting the precious,
-precious time!"
-
-The Professor did not move, but simply said, "And how are we to get
-into that house in Piccadilly?"
-
-"Any way!" I cried. "We shall break in if need be."
-
-"And your police? Where will they be, and what will they say?"
-
-I was staggered, but I knew that if he wished to delay he had a good
-reason for it. So I said, as quietly as I could, "Don't wait more
-than need be. You know, I am sure, what torture I am in."
-
-"Ah, my child, that I do. And indeed there is no wish of me to add to
-your anguish. But just think, what can we do, until all the world be
-at movement. Then will come our time. I have thought and thought,
-and it seems to me that the simplest way is the best of all. Now we
-wish to get into the house, but we have no key. Is it not so?" I
-nodded.
-
-"Now suppose that you were, in truth, the owner of that house, and
-could not still get in. And think there was to you no conscience of
-the housebreaker, what would you do?"
-
-"I should get a respectable locksmith, and set him to work to pick the
-lock for me."
-
-"And your police, they would interfere, would they not?"
-
-"Oh no! Not if they knew the man was properly employed."
-
-"Then," he looked at me as keenly as he spoke, "all that is in doubt
-is the conscience of the employer, and the belief of your policemen as
-to whether or not that employer has a good conscience or a bad one.
-Your police must indeed be zealous men and clever, oh so clever, in
-reading the heart, that they trouble themselves in such matter. No,
-no, my friend Jonathan, you go take the lock off a hundred empty
-houses in this your London, or of any city in the world, and if you do
-it as such things are rightly done, and at the time such things are
-rightly done, no one will interfere. I have read of a gentleman who
-owned a so fine house in London, and when he went for months of summer
-to Switzerland and lock up his house, some burglar come and broke
-window at back and got in. Then he went and made open the shutters in
-front and walk out and in through the door, before the very eyes of
-the police. Then he have an auction in that house, and advertise it,
-and put up big notice. And when the day come he sell off by a great
-auctioneer all the goods of that other man who own them. Then he go
-to a builder, and he sell him that house, making an agreement that he
-pull it down and take all away within a certain time. And your police
-and other authority help him all they can. And when that owner come
-back from his holiday in Switzerland he find only an empty hole where
-his house had been. This was all done en regle, and in our work we
-shall be en regle too. We shall not go so early that the policemen
-who have then little to think of, shall deem it strange. But we shall
-go after ten o'clock, when there are many about, and such things would
-be done were we indeed owners of the house."
-
-I could not but see how right he was and the terrible despair of
-Mina's face became relaxed in thought. There was hope in such good
-counsel.
-
-Van Helsing went on, "When once within that house we may find more
-clues. At any rate some of us can remain there whilst the rest find
-the other places where there be more earth boxes, at Bermondsey and
-Mile End."
-
-Lord Godalming stood up. "I can be of some use here," he said. "I
-shall wire to my people to have horses and carriages where they will
-be most convenient."
-
-"Look here, old fellow," said Morris, "it is a capital idea to have
-all ready in case we want to go horse backing, but don't you think
-that one of your snappy carriages with its heraldic adornments in a
-byway of Walworth or Mile End would attract too much attention for our
-purpose? It seems to me that we ought to take cabs when we go south
-or east. And even leave them somewhere near the neighbourhood we are
-going to."
-
-"Friend Quincey is right!" said the Professor. "His head is what you
-call in plane with the horizon. It is a difficult thing that we go to
-do, and we do not want no peoples to watch us if so it may."
-
-Mina took a growing interest in everything and I was rejoiced to see
-that the exigency of affairs was helping her to forget for a time the
-terrible experience of the night. She was very, very pale, almost
-ghastly, and so thin that her lips were drawn away, showing her teeth
-in somewhat of prominence. I did not mention this last, lest it
-should give her needless pain, but it made my blood run cold in my
-veins to think of what had occurred with poor Lucy when the Count had
-sucked her blood. As yet there was no sign of the teeth growing
-sharper, but the time as yet was short, and there was time for fear.
-
-When we came to the discussion of the sequence of our efforts and of
-the disposition of our forces, there were new sources of doubt. It
-was finally agreed that before starting for Piccadilly we should
-destroy the Count's lair close at hand. In case he should find it out
-too soon, we should thus be still ahead of him in our work of
-destruction. And his presence in his purely material shape, and at
-his weakest, might give us some new clue.
-
-As to the disposal of forces, it was suggested by the Professor that,
-after our visit to Carfax, we should all enter the house in
-Piccadilly. That the two doctors and I should remain there, whilst
-Lord Godalming and Quincey found the lairs at Walworth and Mile End
-and destroyed them. It was possible, if not likely, the Professor
-urged, that the Count might appear in Piccadilly during the day, and
-that if so we might be able to cope with him then and there. At any
-rate, we might be able to follow him in force. To this plan I
-strenuously objected, and so far as my going was concerned, for I said
-that I intended to stay and protect Mina. I thought that my mind was
-made up on the subject, but Mina would not listen to my objection. She
-said that there might be some law matter in which I could be useful.
-That amongst the Count's papers might be some clue which I could
-understand out of my experience in Transylvania. And that, as it was,
-all the strength we could muster was required to cope with the Count's
-extraordinary power. I had to give in, for Mina's resolution was
-fixed. She said that it was the last hope for her that we should all
-work together.
-
-"As for me," she said, "I have no fear. Things have been as bad as
-they can be. And whatever may happen must have in it some element of
-hope or comfort. Go, my husband! God can, if He wishes it, guard me
-as well alone as with any one present."
-
-So I started up crying out, "Then in God's name let us come at once,
-for we are losing time. The Count may come to Piccadilly earlier than
-we think."
-
-"Not so!" said Van Helsing, holding up his hand.
-
-"But why?" I asked.
-
-"Do you forget," he said, with actually a smile, "that last night he
-banqueted heavily, and will sleep late?"
-
-Did I forget! Shall I ever . . . can I ever! Can any of us ever
-forget that terrible scene! Mina struggled hard to keep her brave
-countenance, but the pain overmastered her and she put her hands
-before her face, and shuddered whilst she moaned. Van Helsing had not
-intended to recall her frightful experience. He had simply lost sight
-of her and her part in the affair in his intellectual effort.
-
-When it struck him what he said, he was horrified at his
-thoughtlessness and tried to comfort her.
-
-"Oh, Madam Mina," he said, "dear, dear, Madam Mina, alas! That I of
-all who so reverence you should have said anything so forgetful. These
-stupid old lips of mine and this stupid old head do not deserve so,
-but you will forget it, will you not?" He bent low beside her as he
-spoke.
-
-She took his hand, and looking at him through her tears, said
-hoarsely, "No, I shall not forget, for it is well that I remember.
-And with it I have so much in memory of you that is sweet, that I take
-it all together. Now, you must all be going soon. Breakfast is
-ready, and we must all eat that we may be strong."
-
-Breakfast was a strange meal to us all. We tried to be cheerful and
-encourage each other, and Mina was the brightest and most cheerful of
-us. When it was over, Van Helsing stood up and said, "Now, my dear
-friends, we go forth to our terrible enterprise. Are we all armed, as
-we were on that night when first we visited our enemy's lair. Armed
-against ghostly as well as carnal attack?"
-
-We all assured him.
-
-"Then it is well. Now, Madam Mina, you are in any case quite safe
-here until the sunset. And before then we shall return . . . if . . .
-We shall return! But before we go let me see you armed against personal
-attack. I have myself, since you came down, prepared your chamber by
-the placing of things of which we know, so that He may not enter. Now
-let me guard yourself. On your forehead I touch this piece of Sacred
-Wafer in the name of the Father, the Son, and . . ."
-
-There was a fearful scream which almost froze our hearts to hear. As
-he had placed the Wafer on Mina's forehead, it had seared it . . . had
-burned into the flesh as though it had been a piece of white-hot metal.
-My poor darling's brain had told her the significance of the fact as
-quickly as her nerves received the pain of it, and the two so
-overwhelmed her that her overwrought nature had its voice in that
-dreadful scream.
-
-But the words to her thought came quickly. The echo of the scream had
-not ceased to ring on the air when there came the reaction, and she
-sank on her knees on the floor in an agony of abasement. Pulling her
-beautiful hair over her face, as the leper of old his mantle, she
-wailed out.
-
-"Unclean! Unclean! Even the Almighty shuns my polluted flesh! I
-must bear this mark of shame upon my forehead until the Judgement
-Day."
-
-They all paused. I had thrown myself beside her in an agony of
-helpless grief, and putting my arms around held her tight. For a few
-minutes our sorrowful hearts beat together, whilst the friends around
-us turned away their eyes that ran tears silently. Then Van Helsing
-turned and said gravely. So gravely that I could not help feeling
-that he was in some way inspired, and was stating things outside
-himself.
-
-"It may be that you may have to bear that mark till God himself see
-fit, as He most surely shall, on the Judgement Day, to redress all
-wrongs of the earth and of His children that He has placed thereon.
-And oh, Madam Mina, my dear, my dear, may we who love you be there to
-see, when that red scar, the sign of God's knowledge of what has been,
-shall pass away, and leave your forehead as pure as the heart we know.
-For so surely as we live, that scar shall pass away when God sees
-right to lift the burden that is hard upon us. Till then we bear our
-Cross, as His Son did in obedience to His Will. It may be that we are
-chosen instruments of His good pleasure, and that we ascend to His
-bidding as that other through stripes and shame. Through tears and
-blood. Through doubts and fear, and all that makes the difference
-between God and man."
-
-There was hope in his words, and comfort. And they made for
-resignation. Mina and I both felt so, and simultaneously we each took
-one of the old man's hands and bent over and kissed it. Then without
-a word we all knelt down together, and all holding hands, swore to be
-true to each other. We men pledged ourselves to raise the veil of
-sorrow from the head of her whom, each in his own way, we loved. And
-we prayed for help and guidance in the terrible task which lay before
-us. It was then time to start. So I said farewell to Mina, a parting
-which neither of us shall forget to our dying day, and we set out.
-
-To one thing I have made up my mind. If we find out that Mina must be
-a vampire in the end, then she shall not go into that unknown and
-terrible land alone. I suppose it is thus that in old times one
-vampire meant many. Just as their hideous bodies could only rest in
-sacred earth, so the holiest love was the recruiting sergeant for
-their ghastly ranks.
-
-We entered Carfax without trouble and found all things the same as on
-the first occasion. It was hard to believe that amongst so prosaic
-surroundings of neglect and dust and decay there was any ground for
-such fear as already we knew. Had not our minds been made up, and had
-there not been terrible memories to spur us on, we could hardly have
-proceeded with our task. We found no papers, or any sign of use in
-the house. And in the old chapel the great boxes looked just as we
-had seen them last.
-
-Dr. Van Helsing said to us solemnly as we stood before him, "And now,
-my friends, we have a duty here to do. We must sterilize this earth,
-so sacred of holy memories, that he has brought from a far distant
-land for such fell use. He has chosen this earth because it has been
-holy. Thus we defeat him with his own weapon, for we make it more
-holy still. It was sanctified to such use of man, now we sanctify it
-to God."
-
-As he spoke he took from his bag a screwdriver and a wrench, and very
-soon the top of one of the cases was thrown open. The earth smelled
-musty and close, but we did not somehow seem to mind, for our
-attention was concentrated on the Professor. Taking from his box a
-piece of the Sacred Wafer he laid it reverently on the earth, and then
-shutting down the lid began to screw it home, we aiding him as he
-worked.
-
-One by one we treated in the same way each of the great boxes, and
-left them as we had found them to all appearance. But in each was a
-portion of the Host. When we closed the door behind us, the Professor
-said solemnly, "So much is already done. It may be that with all the
-others we can be so successful, then the sunset of this evening may
-shine of Madam Mina's forehead all white as ivory and with no stain!"
-
-As we passed across the lawn on our way to the station to catch our
-train we could see the front of the asylum. I looked eagerly, and in
-the window of my own room saw Mina. I waved my hand to her, and
-nodded to tell that our work there was successfully accomplished. She
-nodded in reply to show that she understood. The last I saw, she was
-waving her hand in farewell. It was with a heavy heart that we sought
-the station and just caught the train, which was steaming in as we
-reached the platform. I have written this in the train.
-
-
-Piccadilly, 12:30 o'clock.--Just before we reached Fenchurch Street
-Lord Godalming said to me, "Quincey and I will find a locksmith. You
-had better not come with us in case there should be any difficulty.
-For under the circumstances it wouldn't seem so bad for us to break
-into an empty house. But you are a solicitor and the Incorporated Law
-Society might tell you that you should have known better."
-
-I demurred as to my not sharing any danger even of odium, but he went
-on, "Besides, it will attract less attention if there are not too many
-of us. My title will make it all right with the locksmith, and with
-any policeman that may come along. You had better go with Jack and
-the Professor and stay in the Green Park. Somewhere in sight of the
-house, and when you see the door opened and the smith has gone away,
-do you all come across. We shall be on the lookout for you, and shall
-let you in."
-
-"The advice is good!" said Van Helsing, so we said no more. Godalming
-and Morris hurried off in a cab, we following in another. At the
-corner of Arlington Street our contingent got out and strolled into
-the Green Park. My heart beat as I saw the house on which so much of
-our hope was centred, looming up grim and silent in its deserted
-condition amongst its more lively and spruce-looking neighbours. We
-sat down on a bench within good view, and began to smoke cigars so as
-to attract as little attention as possible. The minutes seemed to
-pass with leaden feet as we waited for the coming of the others.
-
-At length we saw a four-wheeler drive up. Out of it, in leisurely
-fashion, got Lord Godalming and Morris. And down from the box
-descended a thick-set working man with his rush-woven basket of tools.
-Morris paid the cabman, who touched his hat and drove away. Together
-the two ascended the steps, and Lord Godalming pointed out what he
-wanted done. The workman took off his coat leisurely and hung it on
-one of the spikes of the rail, saying something to a policeman who
-just then sauntered along. The policeman nodded acquiescence, and the
-man kneeling down placed his bag beside him. After searching through
-it, he took out a selection of tools which he proceeded to lay beside
-him in orderly fashion. Then he stood up, looked in the keyhole, blew
-into it, and turning to his employers, made some remark. Lord
-Godalming smiled, and the man lifted a good sized bunch of keys.
-Selecting one of them, he began to probe the lock, as if feeling his
-way with it. After fumbling about for a bit he tried a second, and
-then a third. All at once the door opened under a slight push from
-him, and he and the two others entered the hall. We sat still. My
-own cigar burnt furiously, but Van Helsing's went cold altogether. We
-waited patiently as we saw the workman come out and bring his bag.
-Then he held the door partly open, steadying it with his knees, whilst
-he fitted a key to the lock. This he finally handed to Lord
-Godalming, who took out his purse and gave him something. The man
-touched his hat, took his bag, put on his coat and departed. Not a
-soul took the slightest notice of the whole transaction.
-
-When the man had fairly gone, we three crossed the street and knocked
-at the door. It was immediately opened by Quincey Morris, beside whom
-stood Lord Godalming lighting a cigar.
-
-"The place smells so vilely," said the latter as we came in. It did
-indeed smell vilely. Like the old chapel at Carfax. And with our
-previous experience it was plain to us that the Count had been using
-the place pretty freely. We moved to explore the house, all keeping
-together in case of attack, for we knew we had a strong and wily enemy
-to deal with, and as yet we did not know whether the Count might not
-be in the house.
-
-In the dining room, which lay at the back of the hall, we found eight
-boxes of earth. Eight boxes only out of the nine which we sought!
-Our work was not over, and would never be until we should have found
-the missing box.
-
-First we opened the shutters of the window which looked out across a
-narrow stone flagged yard at the blank face of a stable, pointed to
-look like the front of a miniature house. There were no windows in
-it, so we were not afraid of being overlooked. We did not lose any
-time in examining the chests. With the tools which we had brought
-with us we opened them, one by one, and treated them as we had treated
-those others in the old chapel. It was evident to us that the Count
-was not at present in the house, and we proceeded to search for any of
-his effects.
-
-After a cursory glance at the rest of the rooms, from basement to
-attic, we came to the conclusion that the dining room contained any
-effects which might belong to the Count. And so we proceeded to
-minutely examine them. They lay in a sort of orderly disorder on the
-great dining room table.
-
-There were title deeds of the Piccadilly house in a great bundle,
-deeds of the purchase of the houses at Mile End and Bermondsey,
-notepaper, envelopes, and pens and ink. All were covered up in thin
-wrapping paper to keep them from the dust. There were also a clothes
-brush, a brush and comb, and a jug and basin. The latter containing
-dirty water which was reddened as if with blood. Last of all was a
-little heap of keys of all sorts and sizes, probably those belonging
-to the other houses.
-
-When we had examined this last find, Lord Godalming and Quincey Morris
-taking accurate notes of the various addresses of the houses in the
-East and the South, took with them the keys in a great bunch, and set
-out to destroy the boxes in these places. The rest of us are, with
-what patience we can, waiting their return, or the coming of the
-Count.
-
-
-
-
-CHAPTER 23
-
-
-DR. SEWARD'S DIARY
-
-3 October.--The time seemed terribly long whilst we were waiting for
-the coming of Godalming and Quincey Morris. The Professor tried to
-keep our minds active by using them all the time. I could see his
-beneficent purpose, by the side glances which he threw from time to
-time at Harker. The poor fellow is overwhelmed in a misery that is
-appalling to see. Last night he was a frank, happy-looking man, with
-strong, youthful face, full of energy, and with dark brown hair.
-Today he is a drawn, haggard old man, whose white hair matches well
-with the hollow burning eyes and grief-written lines of his face. His
-energy is still intact. In fact, he is like a living flame. This may
-yet be his salvation, for if all go well, it will tide him over the
-despairing period. He will then, in a kind of way, wake again to the
-realities of life. Poor fellow, I thought my own trouble was bad
-enough, but his . . . !
-
-The Professor knows this well enough, and is doing his best to keep
-his mind active. What he has been saying was, under the
-circumstances, of absorbing interest. So well as I can remember, here
-it is:
-
-"I have studied, over and over again since they came into my hands,
-all the papers relating to this monster, and the more I have studied,
-the greater seems the necessity to utterly stamp him out. All through
-there are signs of his advance. Not only of his power, but of his
-knowledge of it. As I learned from the researches of my friend
-Arminius of Buda-Pesth, he was in life a most wonderful man. Soldier,
-statesman, and alchemist--which latter was the highest development of
-the science knowledge of his time. He had a mighty brain, a learning
-beyond compare, and a heart that knew no fear and no remorse. He
-dared even to attend the Scholomance, and there was no branch of
-knowledge of his time that he did not essay.
-
-"Well, in him the brain powers survived the physical death. Though it
-would seem that memory was not all complete. In some faculties of
-mind he has been, and is, only a child. But he is growing, and some
-things that were childish at the first are now of man's stature. He
-is experimenting, and doing it well. And if it had not been that we
-have crossed his path he would be yet, he may be yet if we fail, the
-father or furtherer of a new order of beings, whose road must lead
-through Death, not Life."
-
-Harker groaned and said, "And this is all arrayed against my darling!
-But how is he experimenting? The knowledge may help us to defeat
-him!"
-
-"He has all along, since his coming, been trying his power, slowly but
-surely. That big child-brain of his is working. Well for us, it is
-as yet a child-brain. For had he dared, at the first, to attempt
-certain things he would long ago have been beyond our power. However,
-he means to succeed, and a man who has centuries before him can afford
-to wait and to go slow. Festina lente may well be his motto."
-
-"I fail to understand," said Harker wearily. "Oh, do be more plain to
-me! Perhaps grief and trouble are dulling my brain."
-
-The Professor laid his hand tenderly on his shoulder as he spoke, "Ah,
-my child, I will be plain. Do you not see how, of late, this monster
-has been creeping into knowledge experimentally. How he has been
-making use of the zoophagous patient to effect his entry into friend
-John's home. For your Vampire, though in all afterwards he can come
-when and how he will, must at the first make entry only when asked
-thereto by an inmate. But these are not his most important
-experiments. Do we not see how at the first all these so great boxes
-were moved by others. He knew not then but that must be so. But all
-the time that so great child-brain of his was growing, and he began to
-consider whether he might not himself move the box. So he began to
-help. And then, when he found that this be all right, he try to move
-them all alone. And so he progress, and he scatter these graves of
-him. And none but he know where they are hidden.
-
-"He may have intend to bury them deep in the ground. So that only he
-use them in the night, or at such time as he can change his form, they
-do him equal well, and none may know these are his hiding place! But,
-my child, do not despair, this knowledge came to him just too late!
-Already all of his lairs but one be sterilize as for him. And before
-the sunset this shall be so. Then he have no place where he can move
-and hide. I delayed this morning that so we might be sure. Is there
-not more at stake for us than for him? Then why not be more careful
-than him? By my clock it is one hour and already, if all be well,
-friend Arthur and Quincey are on their way to us. Today is our day,
-and we must go sure, if slow, and lose no chance. See! There are
-five of us when those absent ones return."
-
-Whilst we were speaking we were startled by a knock at the hall door,
-the double postman's knock of the telegraph boy. We all moved out to
-the hall with one impulse, and Van Helsing, holding up his hand to us
-to keep silence, stepped to the door and opened it. The boy handed in
-a dispatch. The Professor closed the door again, and after looking at
-the direction, opened it and read aloud.
-
-"Look out for D. He has just now, 12:45, come from Carfax
-hurriedly and hastened towards the South. He seems to be
-going the round and may want to see you: Mina."
-
-There was a pause, broken by Jonathan Harker's voice, "Now, God be
-thanked, we shall soon meet!"
-
-Van Helsing turned to him quickly and said, "God will act in His own
-way and time. Do not fear, and do not rejoice as yet. For what we
-wish for at the moment may be our own undoings."
-
-"I care for nothing now," he answered hotly, "except to wipe out this
-brute from the face of creation. I would sell my soul to do it!"
-
-"Oh, hush, hush, my child!" said Van Helsing. "God does not purchase
-souls in this wise, and the Devil, though he may purchase, does not
-keep faith. But God is merciful and just, and knows your pain and
-your devotion to that dear Madam Mina. Think you, how her pain would
-be doubled, did she but hear your wild words. Do not fear any of us,
-we are all devoted to this cause, and today shall see the end. The
-time is coming for action. Today this Vampire is limit to the powers
-of man, and till sunset he may not change. It will take him time to
-arrive here, see it is twenty minutes past one, and there are yet some
-times before he can hither come, be he never so quick. What we must
-hope for is that my Lord Arthur and Quincey arrive first."
-
-About half an hour after we had received Mrs. Harker's telegram, there
-came a quiet, resolute knock at the hall door. It was just an
-ordinary knock, such as is given hourly by thousands of gentlemen, but
-it made the Professor's heart and mine beat loudly. We looked at each
-other, and together moved out into the hall. We each held ready to
-use our various armaments, the spiritual in the left hand, the mortal
-in the right. Van Helsing pulled back the latch, and holding the door
-half open, stood back, having both hands ready for action. The
-gladness of our hearts must have shown upon our faces when on the
-step, close to the door, we saw Lord Godalming and Quincey Morris.
-They came quickly in and closed the door behind them, the former
-saying, as they moved along the hall:
-
-"It is all right. We found both places. Six boxes in each and we
-destroyed them all."
-
-"Destroyed?" asked the Professor.
-
-"For him!" We were silent for a minute, and then Quincey said,
-"There's nothing to do but to wait here. If, however, he doesn't turn
-up by five o'clock, we must start off. For it won't do to leave Mrs.
-Harker alone after sunset."
-
-"He will be here before long now," said Van Helsing, who had been
-consulting his pocketbook. "Nota bene, in Madam's telegram he went
-south from Carfax. That means he went to cross the river, and he
-could only do so at slack of tide, which should be something before
-one o'clock. That he went south has a meaning for us. He is as yet
-only suspicious, and he went from Carfax first to the place where he
-would suspect interference least. You must have been at Bermondsey
-only a short time before him. That he is not here already shows that
-he went to Mile End next. This took him some time, for he would then
-have to be carried over the river in some way. Believe me, my
-friends, we shall not have long to wait now. We should have ready
-some plan of attack, so that we may throw away no chance. Hush, there
-is no time now. Have all your arms! Be ready!" He held up a warning
-hand as he spoke, for we all could hear a key softly inserted in the
-lock of the hall door.
-
-I could not but admire, even at such a moment, the way in which a
-dominant spirit asserted itself. In all our hunting parties and
-adventures in different parts of the world, Quincey Morris had always
-been the one to arrange the plan of action, and Arthur and I had been
-accustomed to obey him implicitly. Now, the old habit seemed to be
-renewed instinctively. With a swift glance around the room, he at
-once laid out our plan of attack, and without speaking a word, with a
-gesture, placed us each in position. Van Helsing, Harker, and I were
-just behind the door, so that when it was opened the Professor could
-guard it whilst we two stepped between the incomer and the door.
-Godalming behind and Quincey in front stood just out of sight ready to
-move in front of the window. We waited in a suspense that made the
-seconds pass with nightmare slowness. The slow, careful steps came
-along the hall. The Count was evidently prepared for some surprise,
-at least he feared it.
-
-Suddenly with a single bound he leaped into the room. Winning a way
-past us before any of us could raise a hand to stay him. There was
-something so pantherlike in the movement, something so unhuman, that
-it seemed to sober us all from the shock of his coming. The first to
-act was Harker, who with a quick movement, threw himself before the
-door leading into the room in the front of the house. As the Count
-saw us, a horrible sort of snarl passed over his face, showing the
-eyeteeth long and pointed. But the evil smile as quickly passed into
-a cold stare of lion-like disdain. His expression again changed as,
-with a single impulse, we all advanced upon him. It was a pity that
-we had not some better organized plan of attack, for even at the
-moment I wondered what we were to do. I did not myself know whether
-our lethal weapons would avail us anything.
-
-Harker evidently meant to try the matter, for he had ready his great
-Kukri knife and made a fierce and sudden cut at him. The blow was a
-powerful one; only the diabolical quickness of the Count's leap back
-saved him. A second less and the trenchant blade had shorn through
-his heart. As it was, the point just cut the cloth of his coat,
-making a wide gap whence a bundle of bank notes and a stream
-of gold fell out. The expression of the Count's face was so hellish,
-that for a moment I feared for Harker, though I saw him throw the
-terrible knife aloft again for another stroke. Instinctively I moved
-forward with a protective impulse, holding the Crucifix and Wafer in
-my left hand. I felt a mighty power fly along my arm, and it was
-without surprise that I saw the monster cower back before a similar
-movement made spontaneously by each one of us. It would be impossible
-to describe the expression of hate and baffled malignity, of anger and
-hellish rage, which came over the Count's face. His waxen hue became
-greenish-yellow by the contrast of his burning eyes, and the red scar
-on the forehead showed on the pallid skin like a palpitating wound.
-The next instant, with a sinuous dive he swept under Harker's arm, ere
-his blow could fall, and grasping a handful of the money from the
-floor, dashed across the room, threw himself at the window. Amid the
-crash and glitter of the falling glass, he tumbled into the flagged
-area below. Through the sound of the shivering glass I could hear the
-"ting" of the gold, as some of the sovereigns fell on the flagging.
-
-We ran over and saw him spring unhurt from the ground. He, rushing up
-the steps, crossed the flagged yard, and pushed open the stable door.
-There he turned and spoke to us.
-
-"You think to baffle me, you with your pale faces all in a row, like
-sheep in a butcher's. You shall be sorry yet, each one of you! You
-think you have left me without a place to rest, but I have more. My
-revenge is just begun! I spread it over centuries, and time is on my
-side. Your girls that you all love are mine already. And through
-them you and others shall yet be mine, my creatures, to do my bidding
-and to be my jackals when I want to feed. Bah!"
-
-With a contemptuous sneer, he passed quickly through the door, and we
-heard the rusty bolt creak as he fastened it behind him. A door
-beyond opened and shut. The first of us to speak was the Professor.
-Realizing the difficulty of following him through the stable, we moved
-toward the hall.
-
-"We have learnt something . . . much! Notwithstanding his brave words,
-he fears us. He fears time, he fears want! For if not, why he hurry
-so? His very tone betray him, or my ears deceive. Why take that
-money? You follow quick. You are hunters of the wild beast, and
-understand it so. For me, I make sure that nothing here may be of use
-to him, if so that he returns."
-
-As he spoke he put the money remaining in his pocket, took the title
-deeds in the bundle as Harker had left them, and swept the remaining
-things into the open fireplace, where he set fire to them with a
-match.
-
-Godalming and Morris had rushed out into the yard, and Harker had
-lowered himself from the window to follow the Count. He had, however,
-bolted the stable door, and by the time they had forced it open there
-was no sign of him. Van Helsing and I tried to make inquiry at the
-back of the house. But the mews was deserted and no one had seen him
-depart.
-
-It was now late in the afternoon, and sunset was not far off. We had
-to recognize that our game was up. With heavy hearts we agreed with
-the Professor when he said, "Let us go back to Madam Mina. Poor, poor
-dear Madam Mina. All we can do just now is done, and we can there, at
-least, protect her. But we need not despair. There is but one more
-earth box, and we must try to find it. When that is done all may yet
-be well."
-
-I could see that he spoke as bravely as he could to comfort Harker.
-The poor fellow was quite broken down, now and again he gave a low
-groan which he could not suppress. He was thinking of his wife.
-
-With sad hearts we came back to my house, where we found Mrs. Harker
-waiting us, with an appearance of cheerfulness which did honour to her
-bravery and unselfishness. When she saw our faces, her own became as
-pale as death. For a second or two her eyes were closed as if she
-were in secret prayer.
-
-And then she said cheerfully, "I can never thank you all enough. Oh,
-my poor darling!"
-
-As she spoke, she took her husband's grey head in her hands and kissed
-it.
-
-"Lay your poor head here and rest it. All will yet be well, dear! God
-will protect us if He so will it in His good intent." The poor fellow
-groaned. There was no place for words in his sublime misery.
-
-We had a sort of perfunctory supper together, and I think it cheered
-us all up somewhat. It was, perhaps, the mere animal heat of food to
-hungry people, for none of us had eaten anything since breakfast, or
-the sense of companionship may have helped us, but anyhow we were all
-less miserable, and saw the morrow as not altogether without hope.
-
-True to our promise, we told Mrs. Harker everything which had passed.
-And although she grew snowy white at times when danger had seemed to
-threaten her husband, and red at others when his devotion to her was
-manifested, she listened bravely and with calmness. When we came to
-the part where Harker had rushed at the Count so recklessly, she clung
-to her husband's arm, and held it tight as though her clinging could
-protect him from any harm that might come. She said nothing, however,
-till the narration was all done, and matters had been brought up to
-the present time.
-
-Then without letting go her husband's hand she stood up amongst us and
-spoke. Oh, that I could give any idea of the scene. Of that sweet,
-sweet, good, good woman in all the radiant beauty of her youth and
-animation, with the red scar on her forehead, of which she was
-conscious, and which we saw with grinding of our teeth, remembering
-whence and how it came. Her loving kindness against our grim hate.
-Her tender faith against all our fears and doubting. And we, knowing
-that so far as symbols went, she with all her goodness and purity and
-faith, was outcast from God.
-
-"Jonathan," she said, and the word sounded like music on her lips it
-was so full of love and tenderness, "Jonathan dear, and you all my
-true, true friends, I want you to bear something in mind through all
-this dreadful time. I know that you must fight. That you must
-destroy even as you destroyed the false Lucy so that the true Lucy
-might live hereafter. But it is not a work of hate. That poor soul
-who has wrought all this misery is the saddest case of all. Just
-think what will be his joy when he, too, is destroyed in his worser
-part that his better part may have spiritual immortality. You must be
-pitiful to him, too, though it may not hold your hands from his
-destruction."
-
-As she spoke I could see her husband's face darken and draw together,
-as though the passion in him were shriveling his being to its core.
-Instinctively the clasp on his wife's hand grew closer, till his
-knuckles looked white. She did not flinch from the pain which I knew
-she must have suffered, but looked at him with eyes that were more
-appealing than ever.
-
-As she stopped speaking he leaped to his feet, almost tearing his hand
-from hers as he spoke.
-
-"May God give him into my hand just for long enough to destroy that
-earthly life of him which we are aiming at. If beyond it I could send
-his soul forever and ever to burning hell I would do it!"
-
-"Oh, hush! Oh, hush in the name of the good God. Don't say such
-things, Jonathan, my husband, or you will crush me with fear and
-horror. Just think, my dear . . . I have been thinking all this long,
-long day of it . . . that . . . perhaps . . . some day . . . I, too, may
-need such pity, and that some other like you, and with equal cause for
-anger, may deny it to me! Oh, my husband! My husband, indeed I would
-have spared you such a thought had there been another way. But I pray
-that God may not have treasured your wild words, except as the
-heart-broken wail of a very loving and sorely stricken man. Oh, God,
-let these poor white hairs go in evidence of what he has suffered, who
-all his life has done no wrong, and on whom so many sorrows have
-come."
-
-We men were all in tears now. There was no resisting them, and we
-wept openly. She wept, too, to see that her sweeter counsels had
-prevailed. Her husband flung himself on his knees beside her, and
-putting his arms round her, hid his face in the folds of her dress.
-Van Helsing beckoned to us and we stole out of the room, leaving the
-two loving hearts alone with their God.
-
-Before they retired the Professor fixed up the room against any coming
-of the Vampire, and assured Mrs. Harker that she might rest in peace.
-She tried to school herself to the belief, and manifestly for her
-husband's sake, tried to seem content. It was a brave struggle, and
-was, I think and believe, not without its reward. Van Helsing had
-placed at hand a bell which either of them was to sound in case of any
-emergency. When they had retired, Quincey, Godalming, and I arranged
-that we should sit up, dividing the night between us, and watch over
-the safety of the poor stricken lady. The first watch falls to
-Quincey, so the rest of us shall be off to bed as soon as we can.
-
-Godalming has already turned in, for his is the second watch. Now
-that my work is done I, too, shall go to bed.
-
-
-
-JONATHAN HARKER'S JOURNAL
-
-3-4 October, close to midnight.--I thought yesterday would never end.
-There was over me a yearning for sleep, in some sort of blind belief
-that to wake would be to find things changed, and that any change must
-now be for the better. Before we parted, we discussed what our next
-step was to be, but we could arrive at no result. All we knew was
-that one earth box remained, and that the Count alone knew where it
-was. If he chooses to lie hidden, he may baffle us for years. And in
-the meantime, the thought is too horrible, I dare not think of it even
-now. This I know, that if ever there was a woman who was all
-perfection, that one is my poor wronged darling. I loved her a
-thousand times more for her sweet pity of last night, a pity that made
-my own hate of the monster seem despicable. Surely God will not
-permit the world to be the poorer by the loss of such a creature. This
-is hope to me. We are all drifting reefwards now, and faith is our
-only anchor. Thank God! Mina is sleeping, and sleeping without
-dreams. I fear what her dreams might be like, with such terrible
-memories to ground them in. She has not been so calm, within my
-seeing, since the sunset. Then, for a while, there came over her face
-a repose which was like spring after the blasts of March. I thought
-at the time that it was the softness of the red sunset on her face,
-but somehow now I think it has a deeper meaning. I am not sleepy
-myself, though I am weary . . . weary to death. However, I must try
-to sleep. For there is tomorrow to think of, and there is no rest for
-me until . . .
-
-
-Later--I must have fallen asleep, for I was awakened by Mina, who was
-sitting up in bed, with a startled look on her face. I could see
-easily, for we did not leave the room in darkness. She had placed a
-warning hand over my mouth, and now she whispered in my ear, "Hush!
-There is someone in the corridor!" I got up softly, and crossing the
-room, gently opened the door.
-
-Just outside, stretched on a mattress, lay Mr. Morris, wide awake. He
-raised a warning hand for silence as he whispered to me, "Hush! Go
-back to bed. It is all right. One of us will be here all night. We
-don't mean to take any chances!"
-
-His look and gesture forbade discussion, so I came back and told Mina.
-She sighed and positively a shadow of a smile stole over her poor,
-pale face as she put her arms round me and said softly, "Oh, thank God
-for good brave men!" With a sigh she sank back again to sleep. I
-write this now as I am not sleepy, though I must try again.
-
-
-4 October, morning.--Once again during the night I was wakened by
-Mina. This time we had all had a good sleep, for the grey of the
-coming dawn was making the windows into sharp oblongs, and the gas
-flame was like a speck rather than a disc of light.
-
-She said to me hurriedly, "Go, call the Professor. I want to see him
-at once."
-
-"Why?" I asked.
-
-"I have an idea. I suppose it must have come in the night, and
-matured without my knowing it. He must hypnotize me before the dawn,
-and then I shall be able to speak. Go quick, dearest, the time is
-getting close."
-
-I went to the door. Dr. Seward was resting on the mattress, and
-seeing me, he sprang to his feet.
-
-"Is anything wrong?" he asked, in alarm.
-
-"No," I replied. "But Mina wants to see Dr. Van Helsing at once."
-
-"I will go," he said, and hurried into the Professor's room.
-
-Two or three minutes later Van Helsing was in the room in his dressing
-gown, and Mr. Morris and Lord Godalming were with Dr. Seward at the
-door asking questions. When the Professor saw Mina a smile, a
-positive smile ousted the anxiety of his face.
-
-He rubbed his hands as he said, "Oh, my dear Madam Mina, this is
-indeed a change. See! Friend Jonathan, we have got our dear Madam
-Mina, as of old, back to us today!" Then turning to her, he said
-cheerfully, "And what am I to do for you? For at this hour you do not
-want me for nothing."
-
-"I want you to hypnotize me!" she said. "Do it before the dawn, for I
-feel that then I can speak, and speak freely. Be quick, for the time
-is short!" Without a word he motioned her to sit up in bed.
-
-Looking fixedly at her, he commenced to make passes in front of her,
-from over the top of her head downward, with each hand in turn. Mina
-gazed at him fixedly for a few minutes, during which my own heart beat
-like a trip hammer, for I felt that some crisis was at hand.
-Gradually her eyes closed, and she sat, stock still. Only by the
-gentle heaving of her bosom could one know that she was alive. The
-Professor made a few more passes and then stopped, and I could see
-that his forehead was covered with great beads of perspiration. Mina
-opened her eyes, but she did not seem the same woman. There was a
-far-away look in her eyes, and her voice had a sad dreaminess which
-was new to me. Raising his hand to impose silence, the Professor
-motioned to me to bring the others in. They came on tiptoe, closing
-the door behind them, and stood at the foot of the bed, looking on.
-Mina appeared not to see them. The stillness was broken by Van
-Helsing's voice speaking in a low level tone which would not break the
-current of her thoughts.
-
-"Where are you?" The answer came in a neutral way.
-
-"I do not know. Sleep has no place it can call its own." For several
-minutes there was silence. Mina sat rigid, and the Professor stood
-staring at her fixedly.
-
-The rest of us hardly dared to breathe. The room was growing lighter.
-Without taking his eyes from Mina's face, Dr. Van Helsing motioned me
-to pull up the blind. I did so, and the day seemed just upon us. A
-red streak shot up, and a rosy light seemed to diffuse itself through
-the room. On the instant the Professor spoke again.
-
-"Where are you now?"
-
-The answer came dreamily, but with intention. It were as though she
-were interpreting something. I have heard her use the same tone when
-reading her shorthand notes.
-
-"I do not know. It is all strange to me!"
-
-"What do you see?"
-
-"I can see nothing. It is all dark."
-
-"What do you hear?" I could detect the strain in the Professor's
-patient voice.
-
-"The lapping of water. It is gurgling by, and little waves leap. I
-can hear them on the outside."
-
-"Then you are on a ship?'"
-
-We all looked at each other, trying to glean something each from the
-other. We were afraid to think.
-
-The answer came quick, "Oh, yes!"
-
-"What else do you hear?"
-
-"The sound of men stamping overhead as they run about. There is the
-creaking of a chain, and the loud tinkle as the check of the capstan
-falls into the ratchet."
-
-"What are you doing?"
-
-"I am still, oh so still. It is like death!" The voice faded away
-into a deep breath as of one sleeping, and the open eyes closed again.
-
-By this time the sun had risen, and we were all in the full light of
-day. Dr. Van Helsing placed his hands on Mina's shoulders, and laid
-her head down softly on her pillow. She lay like a sleeping child for
-a few moments, and then, with a long sigh, awoke and stared in wonder
-to see us all around her.
-
-"Have I been talking in my sleep?" was all she said. She seemed,
-however, to know the situation without telling, though she was eager
-to know what she had told. The Professor repeated the conversation,
-and she said, "Then there is not a moment to lose. It may not be yet
-too late!"
-
-Mr. Morris and Lord Godalming started for the door but the Professor's
-calm voice called them back.
-
-"Stay, my friends. That ship, wherever it was, was weighing anchor at
-the moment in your so great Port of London. Which of them is it that
-you seek? God be thanked that we have once again a clue, though
-whither it may lead us we know not. We have been blind somewhat.
-Blind after the manner of men, since we can look back we see what we
-might have seen looking forward if we had been able to see what we
-might have seen! Alas, but that sentence is a puddle, is it not? We
-can know now what was in the Count's mind, when he seize that money,
-though Jonathan's so fierce knife put him in the danger that even he
-dread. He meant escape. Hear me, ESCAPE! He saw that with but one
-earth box left, and a pack of men following like dogs after a fox,
-this London was no place for him. He have take his last earth box on
-board a ship, and he leave the land. He think to escape, but no! We
-follow him. Tally Ho! As friend Arthur would say when he put on his
-red frock! Our old fox is wily. Oh! So wily, and we must follow
-with wile. I, too, am wily and I think his mind in a little while.
-In meantime we may rest and in peace, for there are between us which
-he do not want to pass, and which he could not if he would. Unless
-the ship were to touch the land, and then only at full or slack tide.
-See, and the sun is just rose, and all day to sunset is us. Let us
-take bath, and dress, and have breakfast which we all need, and which
-we can eat comfortably since he be not in the same land with us."
-
-Mina looked at him appealingly as she asked, "But why need we seek him
-further, when he is gone away from us?"
-
-He took her hand and patted it as he replied, "Ask me nothing as yet.
-When we have breakfast, then I answer all questions." He would say no
-more, and we separated to dress.
-
-After breakfast Mina repeated her question. He looked at her gravely
-for a minute and then said sorrowfully, "Because my dear, dear Madam
-Mina, now more than ever must we find him even if we have to follow
-him to the jaws of Hell!"
-
-She grew paler as she asked faintly, "Why?"
-
-"Because," he answered solemnly, "he can live for centuries, and you
-are but mortal woman. Time is now to be dreaded, since once he put
-that mark upon your throat."
-
-I was just in time to catch her as she fell forward in a faint.
-
-
-
-
-CHAPTER 24
-
-
-DR. SEWARD'S PHONOGRAPH DIARY
-
-SPOKEN BY VAN HELSING
-
-This to Jonathan Harker.
-
-You are to stay with your dear Madam Mina. We shall go to make our
-search, if I can call it so, for it is not search but knowing, and we
-seek confirmation only. But do you stay and take care of her today.
-This is your best and most holiest office. This day nothing can find
-him here.
-
-Let me tell you that so you will know what we four know already, for I
-have tell them. He, our enemy, have gone away. He have gone back to
-his Castle in Transylvania. I know it so well, as if a great hand of
-fire wrote it on the wall. He have prepare for this in some way, and
-that last earth box was ready to ship somewheres. For this he took
-the money. For this he hurry at the last, lest we catch him before
-the sun go down. It was his last hope, save that he might hide in the
-tomb that he think poor Miss Lucy, being as he thought like him, keep
-open to him. But there was not of time. When that fail he make
-straight for his last resource, his last earth-work I might say did I
-wish double entente. He is clever, oh so clever! He know that his
-game here was finish. And so he decide he go back home. He find ship
-going by the route he came, and he go in it.
-
-We go off now to find what ship, and whither bound. When we have
-discover that, we come back and tell you all. Then we will comfort
-you and poor Madam Mina with new hope. For it will be hope when you
-think it over, that all is not lost. This very creature that we
-pursue, he take hundreds of years to get so far as London. And yet in
-one day, when we know of the disposal of him we drive him out. He is
-finite, though he is powerful to do much harm and suffers not as we
-do. But we are strong, each in our purpose, and we are all more
-strong together. Take heart afresh, dear husband of Madam Mina. This
-battle is but begun and in the end we shall win. So sure as that God
-sits on high to watch over His children. Therefore be of much comfort
-till we return.
-
-VAN HELSING.
-
-
-
-
-
-JONATHAN HARKER'S JOURNAL
-
-4 October.--When I read to Mina, Van Helsing's message in the
-phonograph, the poor girl brightened up considerably. Already the
-certainty that the Count is out of the country has given her comfort.
-And comfort is strength to her. For my own part, now that his
-horrible danger is not face to face with us, it seems almost
-impossible to believe in it. Even my own terrible experiences in
-Castle Dracula seem like a long forgotten dream. Here in the crisp
-autumn air in the bright sunlight.
-
-Alas! How can I disbelieve! In the midst of my thought my eye fell
-on the red scar on my poor darling's white forehead. Whilst that
-lasts, there can be no disbelief. Mina and I fear to be idle, so we
-have been over all the diaries again and again. Somehow, although the
-reality seem greater each time, the pain and the fear seem less. There
-is something of a guiding purpose manifest throughout, which is
-comforting. Mina says that perhaps we are the instruments of ultimate
-good. It may be! I shall try to think as she does. We have never
-spoken to each other yet of the future. It is better to wait till we
-see the Professor and the others after their investigations.
-
-The day is running by more quickly than I ever thought a day could run
-for me again. It is now three o'clock.
-
-
-
-
-
-MINA HARKER'S JOURNAL
-
-5 October, 5 P.M.--Our meeting for report. Present: Professor Van
-Helsing, Lord Godalming, Dr. Seward, Mr. Quincey Morris, Jonathan
-Harker, Mina Harker.
-
-Dr. Van Helsing described what steps were taken during the day to
-discover on what boat and whither bound Count Dracula made his escape.
-
-"As I knew that he wanted to get back to Transylvania, I felt sure
-that he must go by the Danube mouth, or by somewhere in the Black Sea,
-since by that way he come. It was a dreary blank that was before us.
-Omme ignotum pro magnifico, and so with heavy hearts we start to find
-what ships leave for the Black Sea last night. He was in sailing
-ship, since Madam Mina tell of sails being set. These not so
-important as to go in your list of the shipping in the Times, and so
-we go, by suggestion of Lord Godalming, to your Lloyd's, where are
-note of all ships that sail, however so small. There we find that
-only one Black Sea bound ship go out with the tide. She is the
-Czarina Catherine, and she sail from Doolittle's Wharf for Varna, and
-thence to other ports and up the Danube. 'So!' said I, 'this is the
-ship whereon is the Count.' So off we go to Doolittle's Wharf, and
-there we find a man in an office. From him we inquire of the goings
-of the Czarina Catherine. He swear much, and he red face and loud of
-voice, but he good fellow all the same. And when Quincey give him
-something from his pocket which crackle as he roll it up, and put it
-in a so small bag which he have hid deep in his clothing, he still
-better fellow and humble servant to us. He come with us, and ask many
-men who are rough and hot. These be better fellows too when they have
-been no more thirsty. They say much of blood and bloom, and of others
-which I comprehend not, though I guess what they mean. But
-nevertheless they tell us all things which we want to know.
-
-"They make known to us among them, how last afternoon at about five
-o'clock comes a man so hurry. A tall man, thin and pale, with high
-nose and teeth so white, and eyes that seem to be burning. That he be
-all in black, except that he have a hat of straw which suit not him or
-the time. That he scatter his money in making quick inquiry as to
-what ship sails for the Black Sea and for where. Some took him to the
-office and then to the ship, where he will not go aboard but halt at
-shore end of gangplank, and ask that the captain come to him. The
-captain come, when told that he will be pay well, and though he swear
-much at the first he agree to term. Then the thin man go and some one
-tell him where horse and cart can be hired. He go there and soon he
-come again, himself driving cart on which a great box. This he
-himself lift down, though it take several to put it on truck for the
-ship. He give much talk to captain as to how and where his box is to
-be place. But the captain like it not and swear at him in many
-tongues, and tell him that if he like he can come and see where it
-shall be. But he say 'no,' that he come not yet, for that he have
-much to do. Whereupon the captain tell him that he had better be
-quick, with blood, for that his ship will leave the place, of blood,
-before the turn of the tide, with blood. Then the thin man smile and
-say that of course he must go when he think fit, but he will be
-surprise if he go quite so soon. The captain swear again, polyglot,
-and the thin man make him bow, and thank him, and say that he will so
-far intrude on his kindness as to come aboard before the sailing.
-Final the captain, more red than ever, and in more tongues, tell him
-that he doesn't want no Frenchmen, with bloom upon them and also with
-blood, in his ship, with blood on her also. And so, after asking
-where he might purchase ship forms, he departed.
-
-"No one knew where he went 'or bloomin' well cared' as they said, for
-they had something else to think of, well with blood again. For it
-soon became apparent to all that the Czarina Catherine would not sail
-as was expected. A thin mist began to creep up from the river, and it
-grew, and grew. Till soon a dense fog enveloped the ship and all
-around her. The captain swore polyglot, very polyglot, polyglot with
-bloom and blood, but he could do nothing. The water rose and rose,
-and he began to fear that he would lose the tide altogether. He was
-in no friendly mood, when just at full tide, the thin man came up the
-gangplank again and asked to see where his box had been stowed. Then
-the captain replied that he wished that he and his box, old and with
-much bloom and blood, were in hell. But the thin man did not be
-offend, and went down with the mate and saw where it was place, and
-came up and stood awhile on deck in fog. He must have come off by
-himself, for none notice him. Indeed they thought not of him, for
-soon the fog begin to melt away, and all was clear again. My friends
-of the thirst and the language that was of bloom and blood laughed, as
-they told how the captain's swears exceeded even his usual polyglot,
-and was more than ever full of picturesque, when on questioning other
-mariners who were on movement up and down the river that hour, he
-found that few of them had seen any of fog at all, except where it lay
-round the wharf. However, the ship went out on the ebb tide, and was
-doubtless by morning far down the river mouth. She was then, when
-they told us, well out to sea.
-
-"And so, my dear Madam Mina, it is that we have to rest for a time,
-for our enemy is on the sea, with the fog at his command, on his way
-to the Danube mouth. To sail a ship takes time, go she never so
-quick. And when we start to go on land more quick, and we meet him
-there. Our best hope is to come on him when in the box between
-sunrise and sunset. For then he can make no struggle, and we may deal
-with him as we should. There are days for us, in which we can make
-ready our plan. We know all about where he go. For we have seen the
-owner of the ship, who have shown us invoices and all papers that can
-be. The box we seek is to be landed in Varna, and to be given to an
-agent, one Ristics who will there present his credentials. And so our
-merchant friend will have done his part. When he ask if there be any
-wrong, for that so, he can telegraph and have inquiry made at Varna,
-we say 'no,' for what is to be done is not for police or of the
-customs. It must be done by us alone and in our own way."
-
-When Dr. Van Helsing had done speaking, I asked him if he were certain
-that the Count had remained on board the ship. He replied, "We have
-the best proof of that, your own evidence, when in the hypnotic trance
-this morning."
-
-I asked him again if it were really necessary that they should pursue
-the Count, for oh! I dread Jonathan leaving me, and I know that he
-would surely go if the others went. He answered in growing passion,
-at first quietly. As he went on, however, he grew more angry and more
-forceful, till in the end we could not but see wherein was at least
-some of that personal dominance which made him so long a master
-amongst men.
-
-"Yes, it is necessary, necessary, necessary! For your sake in the
-first, and then for the sake of humanity. This monster has done much
-harm already, in the narrow scope where he find himself, and in the
-short time when as yet he was only as a body groping his so small
-measure in darkness and not knowing. All this have I told these
-others. You, my dear Madam Mina, will learn it in the phonograph of
-my friend John, or in that of your husband. I have told them how the
-measure of leaving his own barren land, barren of peoples, and coming
-to a new land where life of man teems till they are like the multitude
-of standing corn, was the work of centuries. Were another of the
-Undead, like him, to try to do what he has done, perhaps not all the
-centuries of the world that have been, or that will be, could aid him.
-With this one, all the forces of nature that are occult and deep and
-strong must have worked together in some wonderous way. The very
-place, where he have been alive, Undead for all these centuries, is
-full of strangeness of the geologic and chemical world. There are
-deep caverns and fissures that reach none know whither. There have
-been volcanoes, some of whose openings still send out waters of
-strange properties, and gases that kill or make to vivify. Doubtless,
-there is something magnetic or electric in some of these combinations
-of occult forces which work for physical life in strange way, and in
-himself were from the first some great qualities. In a hard and
-warlike time he was celebrate that he have more iron nerve, more
-subtle brain, more braver heart, than any man. In him some vital
-principle have in strange way found their utmost. And as his body
-keep strong and grow and thrive, so his brain grow too. All this
-without that diabolic aid which is surely to him. For it have to
-yield to the powers that come from, and are, symbolic of good. And
-now this is what he is to us. He have infect you, oh forgive me, my
-dear, that I must say such, but it is for good of you that I speak. He
-infect you in such wise, that even if he do no more, you have only to
-live, to live in your own old, sweet way, and so in time, death, which
-is of man's common lot and with God's sanction, shall make you like to
-him. This must not be! We have sworn together that it must not.
-Thus are we ministers of God's own wish. That the world, and men for
-whom His Son die, will not be given over to monsters, whose very
-existence would defame Him. He have allowed us to redeem one soul
-already, and we go out as the old knights of the Cross to redeem
-more. Like them we shall travel towards the sunrise. And like them,
-if we fall, we fall in good cause."
-
-He paused and I said, "But will not the Count take his rebuff wisely?
-Since he has been driven from England, will he not avoid it, as a
-tiger does the village from which he has been hunted?"
-
-"Aha!" he said, "your simile of the tiger good, for me, and I shall
-adopt him. Your maneater, as they of India call the tiger who has
-once tasted blood of the human, care no more for the other prey, but
-prowl unceasing till he get him. This that we hunt from our village
-is a tiger, too, a maneater, and he never cease to prowl. Nay, in
-himself he is not one to retire and stay afar. In his life, his
-living life, he go over the Turkey frontier and attack his enemy on
-his own ground. He be beaten back, but did he stay? No! He come
-again, and again, and again. Look at his persistence and endurance.
-With the child-brain that was to him he have long since conceive the
-idea of coming to a great city. What does he do? He find out the
-place of all the world most of promise for him. Then he deliberately
-set himself down to prepare for the task. He find in patience just
-how is his strength, and what are his powers. He study new tongues.
-He learn new social life, new environment of old ways, the politics,
-the law, the finance, the science, the habit of a new land and a new
-people who have come to be since he was. His glimpse that he have
-had, whet his appetite only and enkeen his desire. Nay, it help him
-to grow as to his brain. For it all prove to him how right he was at
-the first in his surmises. He have done this alone, all alone! From
-a ruin tomb in a forgotten land. What more may he not do when the
-greater world of thought is open to him. He that can smile at death,
-as we know him. Who can flourish in the midst of diseases that kill
-off whole peoples. Oh! If such an one was to come from God, and not
-the Devil, what a force for good might he not be in this old world of
-ours. But we are pledged to set the world free. Our toil must be in
-silence, and our efforts all in secret. For in this enlightened age,
-when men believe not even what they see, the doubting of wise men
-would be his greatest strength. It would be at once his sheath and
-his armor, and his weapons to destroy us, his enemies, who are willing
-to peril even our own souls for the safety of one we love. For the
-good of mankind, and for the honour and glory of God."
-
-After a general discussion it was determined that for tonight nothing
-be definitely settled. That we should all sleep on the facts, and try
-to think out the proper conclusions. Tomorrow, at breakfast, we are
-to meet again, and after making our conclusions known to one another,
-we shall decide on some definite cause of action . . .
-
-I feel a wonderful peace and rest tonight. It is as if some haunting
-presence were removed from me. Perhaps . . .
-
-My surmise was not finished, could not be, for I caught sight in the
-mirror of the red mark upon my forehead, and I knew that I was still
-unclean.
-
-
-
-
-DR. SEWARD'S DIARY
-
-5 October.--We all arose early, and I think that sleep did much for
-each and all of us. When we met at early breakfast there was more
-general cheerfulness than any of us had ever expected to experience
-again.
-
-It is really wonderful how much resilience there is in human nature.
-Let any obstructing cause, no matter what, be removed in any way, even
-by death, and we fly back to first principles of hope and enjoyment.
-More than once as we sat around the table, my eyes opened in wonder
-whether the whole of the past days had not been a dream. It was only
-when I caught sight of the red blotch on Mrs. Harker's forehead that I
-was brought back to reality. Even now, when I am gravely revolving
-the matter, it is almost impossible to realize that the cause of all
-our trouble is still existent. Even Mrs. Harker seems to lose sight
-of her trouble for whole spells. It is only now and again, when
-something recalls it to her mind, that she thinks of her terrible
-scar. We are to meet here in my study in half an hour and decide on
-our course of action. I see only one immediate difficulty, I know it
-by instinct rather than reason. We shall all have to speak frankly.
-And yet I fear that in some mysterious way poor Mrs. Harker's tongue
-is tied. I know that she forms conclusions of her own, and from all
-that has been I can guess how brilliant and how true they must be.
-But she will not, or cannot, give them utterance. I have mentioned
-this to Van Helsing, and he and I are to talk it over when we are
-alone. I suppose it is some of that horrid poison which has got into
-her veins beginning to work. The Count had his own purposes when he
-gave her what Van Helsing called "the Vampire's baptism of blood."
-Well, there may be a poison that distills itself out of good things.
-In an age when the existence of ptomaines is a mystery we should not
-wonder at anything! One thing I know, that if my instinct be true
-regarding poor Mrs. Harker's silences, then there is a terrible
-difficulty, an unknown danger, in the work before us. The same power
-that compels her silence may compel her speech. I dare not think
-further, for so I should in my thoughts dishonour a noble woman!
-
-
-Later.--When the Professor came in, we talked over the state of
-things. I could see that he had something on his mind, which he
-wanted to say, but felt some hesitancy about broaching the subject.
-After beating about the bush a little, he said, "Friend John, there is
-something that you and I must talk of alone, just at the first at any
-rate. Later, we may have to take the others into our confidence."
-
-Then he stopped, so I waited. He went on, "Madam Mina, our poor, dear
-Madam Mina is changing."
-
-A cold shiver ran through me to find my worst fears thus endorsed.
-Van Helsing continued.
-
-"With the sad experience of Miss Lucy, we must this time be warned
-before things go too far. Our task is now in reality more difficult
-than ever, and this new trouble makes every hour of the direst
-importance. I can see the characteristics of the vampire coming in
-her face. It is now but very, very slight. But it is to be seen if
-we have eyes to notice without prejudge. Her teeth are sharper, and
-at times her eyes are more hard. But these are not all, there is to
-her the silence now often, as so it was with Miss Lucy. She did not
-speak, even when she wrote that which she wished to be known later.
-Now my fear is this. If it be that she can, by our hypnotic trance,
-tell what the Count see and hear, is it not more true that he who have
-hypnotize her first, and who have drink of her very blood and make her
-drink of his, should if he will, compel her mind to disclose to him
-that which she know?"
-
-I nodded acquiescence. He went on, "Then, what we must do is to
-prevent this. We must keep her ignorant of our intent, and so she
-cannot tell what she know not. This is a painful task! Oh, so
-painful that it heartbreak me to think of it, but it must be. When
-today we meet, I must tell her that for reason which we will not to
-speak she must not more be of our council, but be simply guarded by
-us."
-
-He wiped his forehead, which had broken out in profuse perspiration at
-the thought of the pain which he might have to inflict upon the poor
-soul already so tortured. I knew that it would be some sort of
-comfort to him if I told him that I also had come to the same
-conclusion. For at any rate it would take away the pain of doubt. I
-told him, and the effect was as I expected.
-
-It is now close to the time of our general gathering. Van Helsing has
-gone away to prepare for the meeting, and his painful part of it. I
-really believe his purpose is to be able to pray alone.
-
-
-Later.--At the very outset of our meeting a great personal relief was
-experienced by both Van Helsing and myself. Mrs. Harker had sent a
-message by her husband to say that she would not join us at present,
-as she thought it better that we should be free to discuss our
-movements without her presence to embarrass us. The Professor and I
-looked at each other for an instant, and somehow we both seemed
-relieved. For my own part, I thought that if Mrs. Harker realized the
-danger herself, it was much pain as well as much danger averted.
-Under the circumstances we agreed, by a questioning look and answer,
-with finger on lip, to preserve silence in our suspicions, until we
-should have been able to confer alone again. We went at once into our
-Plan of Campaign.
-
-Van Helsing roughly put the facts before us first, "The Czarina
-Catherine left the Thames yesterday morning. It will take her at the
-quickest speed she has ever made at least three weeks to reach Varna.
-But we can travel overland to the same place in three days. Now, if
-we allow for two days less for the ship's voyage, owing to such
-weather influences as we know that the Count can bring to bear, and if
-we allow a whole day and night for any delays which may occur to us,
-then we have a margin of nearly two weeks.
-
-"Thus, in order to be quite safe, we must leave here on 17th at
-latest. Then we shall at any rate be in Varna a day before the ship
-arrives, and able to make such preparations as may be necessary. Of
-course we shall all go armed, armed against evil things, spiritual as
-well as physical."
-
-Here Quincey Morris added, "I understand that the Count comes from a
-wolf country, and it may be that he shall get there before us. I
-propose that we add Winchesters to our armament. I have a kind of
-belief in a Winchester when there is any trouble of that sort around.
-Do you remember, Art, when we had the pack after us at Tobolsk? What
-wouldn't we have given then for a repeater apiece!"
-
-"Good!" said Van Helsing, "Winchesters it shall be. Quincey's head is
-level at times, but most so when there is to hunt, metaphor be more
-dishonour to science than wolves be of danger to man. In the meantime
-we can do nothing here. And as I think that Varna is not familiar to
-any of us, why not go there more soon? It is as long to wait here as
-there. Tonight and tomorrow we can get ready, and then if all be
-well, we four can set out on our journey."
-
-"We four?" said Harker interrogatively, looking from one to another of
-us.
-
-"Of course!" answered the Professor quickly. "You must remain to take
-care of your so sweet wife!"
-
-Harker was silent for awhile and then said in a hollow voice, "Let us
-talk of that part of it in the morning. I want to consult with Mina."
-
-I thought that now was the time for Van Helsing to warn him not to
-disclose our plan to her, but he took no notice. I looked at him
-significantly and coughed. For answer he put his finger to his lips
-and turned away.
-
-
-
-JONATHAN HARKER'S JOURNAL
-
-5 October, afternoon.--For some time after our meeting this morning I
-could not think. The new phases of things leave my mind in a state of
-wonder which allows no room for active thought. Mina's determination
-not to take any part in the discussion set me thinking. And as I
-could not argue the matter with her, I could only guess. I am as far
-as ever from a solution now. The way the others received it, too
-puzzled me. The last time we talked of the subject we agreed that
-there was to be no more concealment of anything amongst us. Mina is
-sleeping now, calmly and sweetly like a little child. Her lips are
-curved and her face beams with happiness. Thank God, there are such
-moments still for her.
-
-
-Later.--How strange it all is. I sat watching Mina's happy sleep, and
-I came as near to being happy myself as I suppose I shall ever be. As
-the evening drew on, and the earth took its shadows from the sun
-sinking lower, the silence of the room grew more and more solemn to
-me.
-
-All at once Mina opened her eyes, and looking at me tenderly said,
-"Jonathan, I want you to promise me something on your word of honour.
-A promise made to me, but made holily in God's hearing, and not to be
-broken though I should go down on my knees and implore you with bitter
-tears. Quick, you must make it to me at once."
-
-"Mina," I said, "a promise like that, I cannot make at once. I may
-have no right to make it."
-
-"But, dear one," she said, with such spiritual intensity that her eyes
-were like pole stars, "it is I who wish it. And it is not for myself.
-You can ask Dr. Van Helsing if I am not right. If he disagrees you
-may do as you will. Nay, more if you all agree, later you are
-absolved from the promise."
-
-"I promise!" I said, and for a moment she looked supremely happy.
-Though to me all happiness for her was denied by the red scar on her
-forehead.
-
-She said, "Promise me that you will not tell me anything of the plans
-formed for the campaign against the Count. Not by word, or inference,
-or implication, not at any time whilst this remains to me!" And she
-solemnly pointed to the scar. I saw that she was in earnest, and said
-solemnly, "I promise!" and as I said it I felt that from that instant
-a door had been shut between us.
-
-
-Later, midnight.--Mina has been bright and cheerful all the evening.
-So much so that all the rest seemed to take courage, as if infected
-somewhat with her gaiety. As a result even I myself felt as if the
-pall of gloom which weighs us down were somewhat lifted. We all
-retired early. Mina is now sleeping like a little child. It is
-wonderful thing that her faculty of sleep remains to her in the midst
-of her terrible trouble. Thank God for it, for then at least she can
-forget her care. Perhaps her example may affect me as her gaiety did
-tonight. I shall try it. Oh! For a dreamless sleep.
-
-6 October, morning.--Another surprise. Mina woke me early, about the
-same time as yesterday, and asked me to bring Dr. Van Helsing. I
-thought that it was another occasion for hypnotism, and without
-question went for the Professor. He had evidently expected some such
-call, for I found him dressed in his room. His door was ajar, so that
-he could hear the opening of the door of our room. He came at once.
-As he passed into the room, he asked Mina if the others might come,
-too.
-
-"No," she said quite simply, "it will not be necessary. You can tell
-them just as well. I must go with you on your journey."
-
-Dr. Van Helsing was as startled as I was. After a moment's pause he
-asked, "But why?"
-
-"You must take me with you. I am safer with you, and you shall be
-safer, too."
-
-"But why, dear Madam Mina? You know that your safety is our solemnest
-duty. We go into danger, to which you are, or may be, more liable
-than any of us from . . . from circumstances . . . things that have
-been." He paused embarrassed.
-
-As she replied, she raised her finger and pointed to her forehead. "I
-know. That is why I must go. I can tell you now, whilst the sun is
-coming up. I may not be able again. I know that when the Count wills
-me I must go. I know that if he tells me to come in secret, I must by
-wile. By any device to hoodwink, even Jonathan." God saw the look
-that she turned on me as she spoke, and if there be indeed a Recording
-Angel that look is noted to her ever-lasting honour. I could only
-clasp her hand. I could not speak. My emotion was too great for even
-the relief of tears.
-
-She went on. "You men are brave and strong. You are strong in your
-numbers, for you can defy that which would break down the human
-endurance of one who had to guard alone. Besides, I may be of
-service, since you can hypnotize me and so learn that which even I
-myself do not know."
-
-Dr. Van Helsing said gravely, "Madam Mina, you are, as always, most
-wise. You shall with us come. And together we shall do that which we
-go forth to achieve."
-
-When he had spoken, Mina's long spell of silence made me look at her.
-She had fallen back on her pillow asleep. She did not even wake when
-I had pulled up the blind and let in the sunlight which flooded the
-room. Van Helsing motioned to me to come with him quietly. We went
-to his room, and within a minute Lord Godalming, Dr. Seward, and Mr.
-Morris were with us also.
-
-He told them what Mina had said, and went on. "In the morning we
-shall leave for Varna. We have now to deal with a new factor, Madam
-Mina. Oh, but her soul is true. It is to her an agony to tell us so
-much as she has done. But it is most right, and we are warned in
-time. There must be no chance lost, and in Varna we must be ready to
-act the instant when that ship arrives."
-
-"What shall we do exactly?" asked Mr. Morris laconically.
-
-The Professor paused before replying, "We shall at the first board
-that ship. Then, when we have identified the box, we shall place a
-branch of the wild rose on it. This we shall fasten, for when it is
-there none can emerge, so that at least says the superstition. And to
-superstition must we trust at the first. It was man's faith in the
-early, and it have its root in faith still. Then, when we get the
-opportunity that we seek, when none are near to see, we shall open the
-box, and . . . and all will be well."
-
-"I shall not wait for any opportunity," said Morris. "When I see the
-box I shall open it and destroy the monster, though there were a
-thousand men looking on, and if I am to be wiped out for it the next
-moment!" I grasped his hand instinctively and found it as firm as a
-piece of steel. I think he understood my look. I hope he did.
-
-"Good boy," said Dr. Van Helsing. "Brave boy. Quincey is all man.
-God bless him for it. My child, believe me none of us shall lag
-behind or pause from any fear. I do but say what we may do . . . what
-we must do. But, indeed, indeed we cannot say what we may do. There
-are so many things which may happen, and their ways and their ends are
-so various that until the moment we may not say. We shall all be
-armed, in all ways. And when the time for the end has come, our
-effort shall not be lack. Now let us today put all our affairs in
-order. Let all things which touch on others dear to us, and who on us
-depend, be complete. For none of us can tell what, or when, or how,
-the end may be. As for me, my own affairs are regulate, and as I have
-nothing else to do, I shall go make arrangements for the travel. I
-shall have all tickets and so forth for our journey."
-
-There was nothing further to be said, and we parted. I shall now
-settle up all my affairs of earth, and be ready for whatever may come.
-
-
-Later.--It is done. My will is made, and all complete. Mina if she
-survive is my sole heir. If it should not be so, then the others who
-have been so good to us shall have remainder.
-
-It is now drawing towards the sunset. Mina's uneasiness calls my
-attention to it. I am sure that there is something on her mind which
-the time of exact sunset will reveal. These occasions are becoming
-harrowing times for us all. For each sunrise and sunset opens up some
-new danger, some new pain, which however, may in God's will be means
-to a good end. I write all these things in the diary since my darling
-must not hear them now. But if it may be that she can see them again,
-they shall be ready. She is calling to me.
-
-
-
-
-CHAPTER 25
-
-
-DR. SEWARD'S DIARY
-
-11 October, Evening.--Jonathan Harker has asked me to note this, as he
-says he is hardly equal to the task, and he wants an exact record
-kept.
-
-I think that none of us were surprised when we were asked to see Mrs.
-Harker a little before the time of sunset. We have of late come to
-understand that sunrise and sunset are to her times of peculiar
-freedom. When her old self can be manifest without any controlling
-force subduing or restraining her, or inciting her to action. This
-mood or condition begins some half hour or more before actual sunrise
-or sunset, and lasts till either the sun is high, or whilst the clouds
-are still aglow with the rays streaming above the horizon. At first
-there is a sort of negative condition, as if some tie were loosened,
-and then the absolute freedom quickly follows. When, however, the
-freedom ceases the change back or relapse comes quickly, preceded
-only by a spell of warning silence.
-
-Tonight, when we met, she was somewhat constrained, and bore all the
-signs of an internal struggle. I put it down myself to her making a
-violent effort at the earliest instant she could do so.
-
-A very few minutes, however, gave her complete control of herself.
-Then, motioning her husband to sit beside her on the sofa where she
-was half reclining, she made the rest of us bring chairs up close.
-
-Taking her husband's hand in hers, she began, "We are all here
-together in freedom, for perhaps the last time! I know that you will
-always be with me to the end." This was to her husband whose hand had,
-as we could see, tightened upon her. "In the morning we go out upon
-our task, and God alone knows what may be in store for any of us. You
-are going to be so good to me to take me with you. I know that all
-that brave earnest men can do for a poor weak woman, whose soul
-perhaps is lost, no, no, not yet, but is at any rate at stake, you
-will do. But you must remember that I am not as you are. There is a
-poison in my blood, in my soul, which may destroy me, which must
-destroy me, unless some relief comes to us. Oh, my friends, you know
-as well as I do, that my soul is at stake. And though I know there is
-one way out for me, you must not and I must not take it!" She looked
-appealingly to us all in turn, beginning and ending with her husband.
-
-"What is that way?" asked Van Helsing in a hoarse voice. "What is
-that way, which we must not, may not, take?"
-
-"That I may die now, either by my own hand or that of another, before
-the greater evil is entirely wrought. I know, and you know, that were
-I once dead you could and would set free my immortal spirit, even as
-you did my poor Lucy's. Were death, or the fear of death, the only
-thing that stood in the way I would not shrink to die here now, amidst
-the friends who love me. But death is not all. I cannot believe that
-to die in such a case, when there is hope before us and a bitter task
-to be done, is God's will. Therefore, I on my part, give up here the
-certainty of eternal rest, and go out into the dark where may be the
-blackest things that the world or the nether world holds!"
-
-We were all silent, for we knew instinctively that this was only a
-prelude. The faces of the others were set, and Harker's grew ashen
-grey. Perhaps, he guessed better than any of us what was coming.
-
-She continued, "This is what I can give into the hotch-pot." I could
-not but note the quaint legal phrase which she used in such a place,
-and with all seriousness. "What will each of you give? Your lives I
-know," she went on quickly, "that is easy for brave men. Your lives
-are God's, and you can give them back to Him, but what will you give
-to me?" She looked again questioningly, but this time avoided her
-husband's face. Quincey seemed to understand, he nodded, and her face
-lit up. "Then I shall tell you plainly what I want, for there must be
-no doubtful matter in this connection between us now. You must
-promise me, one and all, even you, my beloved husband, that should the
-time come, you will kill me."
-
-"What is that time?" The voice was Quincey's, but it was low and
-strained.
-
-"When you shall be convinced that I am so changed that it is better
-that I die that I may live. When I am thus dead in the flesh, then
-you will, without a moment's delay, drive a stake through me and cut
-off my head, or do whatever else may be wanting to give me rest!"
-
-Quincey was the first to rise after the pause. He knelt down before
-her and taking her hand in his said solemnly, "I'm only a rough
-fellow, who hasn't, perhaps, lived as a man should to win such a
-distinction, but I swear to you by all that I hold sacred and dear
-that, should the time ever come, I shall not flinch from the duty that
-you have set us. And I promise you, too, that I shall make all
-certain, for if I am only doubtful I shall take it that the time has
-come!"
-
-"My true friend!" was all she could say amid her fast-falling tears,
-as bending over, she kissed his hand.
-
-"I swear the same, my dear Madam Mina!" said Van Helsing. "And I!"
-said Lord Godalming, each of them in turn kneeling to her to take the
-oath. I followed, myself.
-
-Then her husband turned to her wan-eyed and with a greenish pallor
-which subdued the snowy whiteness of his hair, and asked, "And must I,
-too, make such a promise, oh, my wife?"
-
-"You too, my dearest," she said, with infinite yearning of pity in her
-voice and eyes. "You must not shrink. You are nearest and dearest
-and all the world to me. Our souls are knit into one, for all life
-and all time. Think, dear, that there have been times when brave men
-have killed their wives and their womenkind, to keep them from falling
-into the hands of the enemy. Their hands did not falter any the more
-because those that they loved implored them to slay them. It is men's
-duty towards those whom they love, in such times of sore trial! And
-oh, my dear, if it is to be that I must meet death at any hand, let it
-be at the hand of him that loves me best. Dr. Van Helsing, I have not
-forgotten your mercy in poor Lucy's case to him who loved." She
-stopped with a flying blush, and changed her phrase, "to him who had
-best right to give her peace. If that time shall come again, I look
-to you to make it a happy memory of my husband's life that it was his
-loving hand which set me free from the awful thrall upon me."
-
-"Again I swear!" came the Professor's resonant voice.
-
-Mrs. Harker smiled, positively smiled, as with a sigh of relief she
-leaned back and said, "And now one word of warning, a warning which
-you must never forget. This time, if it ever come, may come quickly
-and unexpectedly, and in such case you must lose no time in using your
-opportunity. At such a time I myself might be . . . nay! If the time
-ever come, shall be, leagued with your enemy against you.
-
-"One more request," she became very solemn as she said this, "it is
-not vital and necessary like the other, but I want you to do one thing
-for me, if you will."
-
-We all acquiesced, but no one spoke. There was no need to speak.
-
-"I want you to read the Burial Service." She was interrupted by a
-deep groan from her husband. Taking his hand in hers, she held it
-over her heart, and continued. "You must read it over me some day.
-Whatever may be the issue of all this fearful state of things, it will
-be a sweet thought to all or some of us. You, my dearest, will I hope
-read it, for then it will be in your voice in my memory forever, come
-what may!"
-
-"But oh, my dear one," he pleaded, "death is afar off from you."
-
-"Nay," she said, holding up a warning hand. "I am deeper in death at
-this moment than if the weight of an earthly grave lay heavy upon me!"
-
-"Oh, my wife, must I read it?" he said, before he began.
-
-"It would comfort me, my husband!" was all she said, and he began to
-read when she had got the book ready.
-
-How can I, how could anyone, tell of that strange scene, its
-solemnity, its gloom, its sadness, its horror, and withal, its
-sweetness. Even a sceptic, who can see nothing but a travesty of
-bitter truth in anything holy or emotional, would have been melted to
-the heart had he seen that little group of loving and devoted friends
-kneeling round that stricken and sorrowing lady; or heard the tender
-passion of her husband's voice, as in tones so broken and emotional
-that often he had to pause, he read the simple and beautiful service
-from the Burial of the Dead. I cannot go on . . . words . . . and
-v-voices . . . f-fail m-me!
-
-She was right in her instinct. Strange as it was, bizarre as it may
-hereafter seem even to us who felt its potent influence at the time,
-it comforted us much. And the silence, which showed Mrs. Harker's
-coming relapse from her freedom of soul, did not seem so full of
-despair to any of us as we had dreaded.
-
-
-
-
-
-JONATHAN HARKER'S JOURNAL
-
-15 October, Varna.--We left Charing Cross on the morning of the 12th,
-got to Paris the same night, and took the places secured for us in the
-Orient Express. We traveled night and day, arriving here at about
-five o'clock. Lord Godalming went to the Consulate to see if any
-telegram had arrived for him, whilst the rest of us came on to this
-hotel, "the Odessus." The journey may have had incidents. I was,
-however, too eager to get on, to care for them. Until the Czarina
-Catherine comes into port there will be no interest for me in anything
-in the wide world. Thank God! Mina is well, and looks to be getting
-stronger. Her colour is coming back. She sleeps a great deal.
-Throughout the journey she slept nearly all the time. Before sunrise
-and sunset, however, she is very wakeful and alert. And it has become
-a habit for Van Helsing to hypnotize her at such times. At first,
-some effort was needed, and he had to make many passes. But now, she
-seems to yield at once, as if by habit, and scarcely any action is
-needed. He seems to have power at these particular moments to simply
-will, and her thoughts obey him. He always asks her what she can see
-and hear.
-
-She answers to the first, "Nothing, all is dark."
-
-And to the second, "I can hear the waves lapping against the ship, and
-the water rushing by. Canvas and cordage strain and masts and yards
-creak. The wind is high . . . I can hear it in the shrouds, and the
-bow throws back the foam."
-
-It is evident that the Czarina Catherine is still at sea, hastening on
-her way to Varna. Lord Godalming has just returned. He had four
-telegrams, one each day since we started, and all to the same effect.
-That the Czarina Catherine had not been reported to Lloyd's from
-anywhere. He had arranged before leaving London that his agent should
-send him every day a telegram saying if the ship had been reported.
-He was to have a message even if she were not reported, so that he
-might be sure that there was a watch being kept at the other end of
-the wire.
-
-We had dinner and went to bed early. Tomorrow we are to see the Vice
-Consul, and to arrange, if we can, about getting on board the ship as
-soon as she arrives. Van Helsing says that our chance will be to get
-on the boat between sunrise and sunset. The Count, even if he takes
-the form of a bat, cannot cross the running water of his own volition,
-and so cannot leave the ship. As he dare not change to man's form
-without suspicion, which he evidently wishes to avoid, he must remain
-in the box. If, then, we can come on board after sunrise, he is at
-our mercy, for we can open the box and make sure of him, as we did of
-poor Lucy, before he wakes. What mercy he shall get from us all will
-not count for much. We think that we shall not have much trouble with
-officials or the seamen. Thank God! This is the country where
-bribery can do anything, and we are well supplied with money. We have
-only to make sure that the ship cannot come into port between sunset
-and sunrise without our being warned, and we shall be safe. Judge
-Moneybag will settle this case, I think!
-
-
-16 October.--Mina's report still the same. Lapping waves and rushing
-water, darkness and favouring winds. We are evidently in good time,
-and when we hear of the Czarina Catherine we shall be ready. As she
-must pass the Dardanelles we are sure to have some report.
-
-
-17 October.--Everything is pretty well fixed now, I think, to welcome
-the Count on his return from his tour. Godalming told the shippers
-that he fancied that the box sent aboard might contain something
-stolen from a friend of his, and got a half consent that he might open
-it at his own risk. The owner gave him a paper telling the Captain to
-give him every facility in doing whatever he chose on board the ship,
-and also a similar authorization to his agent at Varna. We have seen
-the agent, who was much impressed with Godalming's kindly manner to
-him, and we are all satisfied that whatever he can do to aid our
-wishes will be done.
-
-We have already arranged what to do in case we get the box open. If
-the Count is there, Van Helsing and Seward will cut off his head at
-once and drive a stake through his heart. Morris and Godalming and I
-shall prevent interference, even if we have to use the arms which we
-shall have ready. The Professor says that if we can so treat the
-Count's body, it will soon after fall into dust. In such case there
-would be no evidence against us, in case any suspicion of murder were
-aroused. But even if it were not, we should stand or fall by our act,
-and perhaps some day this very script may be evidence to come between
-some of us and a rope. For myself, I should take the chance only too
-thankfully if it were to come. We mean to leave no stone unturned to
-carry out our intent. We have arranged with certain officials that
-the instant the Czarina Catherine is seen, we are to be informed by a
-special messenger.
-
-
-24 October.--A whole week of waiting. Daily telegrams to Godalming,
-but only the same story. "Not yet reported." Mina's morning and
-evening hypnotic answer is unvaried. Lapping waves, rushing water,
-and creaking masts.
-
-
-
-
-TELEGRAM, OCTOBER 24TH RUFUS SMITH, LLOYD'S, LONDON,
-TO LORD GODALMING, CARE OF H. B. M. VICE CONSUL, VARNA
-
-"Czarina Catherine reported this morning from Dardanelles."
-
-
-
-DR. SEWARD'S DIARY
-
-25 October.--How I miss my phonograph! To write a diary with a pen is
-irksome to me! But Van Helsing says I must. We were all wild with
-excitement yesterday when Godalming got his telegram from Lloyd's. I
-know now what men feel in battle when the call to action is heard.
-Mrs. Harker, alone of our party, did not show any signs of emotion.
-After all, it is not strange that she did not, for we took special
-care not to let her know anything about it, and we all tried not to
-show any excitement when we were in her presence. In old days she
-would, I am sure, have noticed, no matter how we might have tried to
-conceal it. But in this way she is greatly changed during the past
-three weeks. The lethargy grows upon her, and though she seems strong
-and well, and is getting back some of her colour, Van Helsing and I are
-not satisfied. We talk of her often. We have not, however, said a
-word to the others. It would break poor Harker's heart, certainly his
-nerve, if he knew that we had even a suspicion on the subject. Van
-Helsing examines, he tells me, her teeth very carefully, whilst she is
-in the hypnotic condition, for he says that so long as they do not
-begin to sharpen there is no active danger of a change in her. If
-this change should come, it would be necessary to take steps! We both
-know what those steps would have to be, though we do not mention our
-thoughts to each other. We should neither of us shrink from the task,
-awful though it be to contemplate. "Euthanasia" is an excellent and a
-comforting word! I am grateful to whoever invented it.
-
-It is only about 24 hours' sail from the Dardanelles to here, at the
-rate the Czarina Catherine has come from London. She should therefore
-arrive some time in the morning, but as she cannot possibly get in
-before noon, we are all about to retire early. We shall get up at one
-o'clock, so as to be ready.
-
-
-25 October, Noon.--No news yet of the ship's arrival. Mrs. Harker's
-hypnotic report this morning was the same as usual, so it is possible
-that we may get news at any moment. We men are all in a fever of
-excitement, except Harker, who is calm. His hands are cold as ice,
-and an hour ago I found him whetting the edge of the great Ghoorka
-knife which he now always carries with him. It will be a bad lookout
-for the Count if the edge of that "Kukri" ever touches his throat,
-driven by that stern, ice-cold hand!
-
-Van Helsing and I were a little alarmed about Mrs. Harker today.
-About noon she got into a sort of lethargy which we did not like.
-Although we kept silence to the others, we were neither of us happy
-about it. She had been restless all the morning, so that we were at
-first glad to know that she was sleeping. When, however, her husband
-mentioned casually that she was sleeping so soundly that he could not
-wake her, we went to her room to see for ourselves. She was breathing
-naturally and looked so well and peaceful that we agreed that the
-sleep was better for her than anything else. Poor girl, she has so
-much to forget that it is no wonder that sleep, if it brings oblivion
-to her, does her good.
-
-
-Later.--Our opinion was justified, for when after a refreshing sleep
-of some hours she woke up, she seemed brighter and better than she had
-been for days. At sunset she made the usual hypnotic report.
-Wherever he may be in the Black Sea, the Count is hurrying to his
-destination. To his doom, I trust!
-
-
-
-26 October.--Another day and no tidings of the Czarina Catherine. She
-ought to be here by now. That she is still journeying somewhere is
-apparent, for Mrs. Harker's hypnotic report at sunrise was still the
-same. It is possible that the vessel may be lying by, at times, for
-fog. Some of the steamers which came in last evening reported patches
-of fog both to north and south of the port. We must continue our
-watching, as the ship may now be signalled any moment.
-
-
-27 October, Noon.--Most strange. No news yet of the ship we wait for.
-Mrs. Harker reported last night and this morning as usual. "Lapping
-waves and rushing water," though she added that "the waves were very
-faint." The telegrams from London have been the same, "no further
-report." Van Helsing is terribly anxious, and told me just now that he
-fears the Count is escaping us.
-
-He added significantly, "I did not like that lethargy of Madam Mina's.
-Souls and memories can do strange things during trance." I was about
-to ask him more, but Harker just then came in, and he held up a
-warning hand. We must try tonight at sunset to make her speak more
-fully when in her hypnotic state.
-
-
-28 October.--Telegram. Rufus Smith, London, to Lord Godalming, care
-H. B. M. Vice Consul, Varna
-
-"Czarina Catherine reported entering Galatz at one o'clock today."
-
-
-
-
-DR. SEWARD'S DIARY
-
-28 October.--When the telegram came announcing the arrival in Galatz I
-do not think it was such a shock to any of us as might have been
-expected. True, we did not know whence, or how, or when, the bolt
-would come. But I think we all expected that something strange would
-happen. The day of arrival at Varna made us individually satisfied
-that things would not be just as we had expected. We only waited to
-learn where the change would occur. None the less, however, it was a
-surprise. I suppose that nature works on such a hopeful basis that we
-believe against ourselves that things will be as they ought to be, not
-as we should know that they will be. Transcendentalism is a beacon to
-the angels, even if it be a will-o'-the-wisp to man. Van Helsing
-raised his hand over his head for a moment, as though in remonstrance
-with the Almighty. But he said not a word, and in a few seconds stood
-up with his face sternly set.
-
-Lord Godalming grew very pale, and sat breathing heavily. I was
-myself half stunned and looked in wonder at one after another.
-Quincey Morris tightened his belt with that quick movement which I
-knew so well. In our old wandering days it meant "action." Mrs.
-Harker grew ghastly white, so that the scar on her forehead seemed to
-burn, but she folded her hands meekly and looked up in prayer. Harker
-smiled, actually smiled, the dark, bitter smile of one who is without
-hope, but at the same time his action belied his words, for his hands
-instinctively sought the hilt of the great Kukri knife and rested
-there.
-
-"When does the next train start for Galatz?" said Van Helsing to us
-generally.
-
-"At 6:30 tomorrow morning!" We all started, for the answer came from
-Mrs. Harker.
-
-"How on earth do you know?" said Art.
-
-"You forget, or perhaps you do not know, though Jonathan does and so
-does Dr. Van Helsing, that I am the train fiend. At home in Exeter I
-always used to make up the time tables, so as to be helpful to my
-husband. I found it so useful sometimes, that I always make a study
-of the time tables now. I knew that if anything were to take us to
-Castle Dracula we should go by Galatz, or at any rate through
-Bucharest, so I learned the times very carefully. Unhappily there are
-not many to learn, as the only train tomorrow leaves as I say."
-
-"Wonderful woman!" murmured the Professor.
-
-"Can't we get a special?" asked Lord Godalming.
-
-Van Helsing shook his head, "I fear not. This land is very different
-from yours or mine. Even if we did have a special, it would probably
-not arrive as soon as our regular train. Moreover, we have something
-to prepare. We must think. Now let us organize. You, friend Arthur,
-go to the train and get the tickets and arrange that all be ready for
-us to go in the morning. Do you, friend Jonathan, go to the agent of
-the ship and get from him letters to the agent in Galatz, with
-authority to make a search of the ship just as it was here. Quincey
-Morris, you see the Vice Consul, and get his aid with his fellow in
-Galatz and all he can do to make our way smooth, so that no times be
-lost when over the Danube. John will stay with Madam Mina and me, and
-we shall consult. For so if time be long you may be delayed. And it
-will not matter when the sun set, since I am here with Madam to make
-report."
-
-"And I," said Mrs. Harker brightly, and more like her old self than
-she had been for many a long day, "shall try to be of use in all ways,
-and shall think and write for you as I used to do. Something is
-shifting from me in some strange way, and I feel freer than I have
-been of late!"
-
-The three younger men looked happier at the moment as they seemed to
-realize the significance of her words. But Van Helsing and I, turning
-to each other, met each a grave and troubled glance. We said nothing
-at the time, however.
-
-When the three men had gone out to their tasks Van Helsing asked Mrs.
-Harker to look up the copy of the diaries and find him the part of
-Harker's journal at the Castle. She went away to get it.
-
-When the door was shut upon her he said to me, "We mean the same!
-Speak out!"
-
-"Here is some change. It is a hope that makes me sick, for it may
-deceive us."
-
-"Quite so. Do you know why I asked her to get the manuscript?"
-
-"No!" said I, "unless it was to get an opportunity of seeing me
-alone."
-
-"You are in part right, friend John, but only in part. I want to tell
-you something. And oh, my friend, I am taking a great, a terrible,
-risk. But I believe it is right. In the moment when Madam Mina said
-those words that arrest both our understanding, an inspiration came to
-me. In the trance of three days ago the Count sent her his spirit to
-read her mind. Or more like he took her to see him in his earth box
-in the ship with water rushing, just as it go free at rise and set of
-sun. He learn then that we are here, for she have more to tell in her
-open life with eyes to see ears to hear than he, shut as he is, in his
-coffin box. Now he make his most effort to escape us. At present he
-want her not.
-
-"He is sure with his so great knowledge that she will come at his
-call. But he cut her off, take her, as he can do, out of his own
-power, that so she come not to him. Ah! There I have hope that our
-man brains that have been of man so long and that have not lost the
-grace of God, will come higher than his child-brain that lie in his
-tomb for centuries, that grow not yet to our stature, and that do only
-work selfish and therefore small. Here comes Madam Mina. Not a word
-to her of her trance! She knows it not, and it would overwhelm her
-and make despair just when we want all her hope, all her courage, when
-most we want all her great brain which is trained like man's brain,
-but is of sweet woman and have a special power which the Count give
-her, and which he may not take away altogether, though he think not
-so. Hush! Let me speak, and you shall learn. Oh, John, my friend,
-we are in awful straits. I fear, as I never feared before. We can
-only trust the good God. Silence! Here she comes!"
-
-I thought that the Professor was going to break down and have
-hysterics, just as he had when Lucy died, but with a great effort he
-controlled himself and was at perfect nervous poise when Mrs. Harker
-tripped into the room, bright and happy looking and, in the doing of
-work, seemingly forgetful of her misery. As she came in, she handed a
-number of sheets of typewriting to Van Helsing. He looked over them
-gravely, his face brightening up as he read.
-
-Then holding the pages between his finger and thumb he said, "Friend
-John, to you with so much experience already, and you too, dear Madam
-Mina, that are young, here is a lesson. Do not fear ever to think. A
-half thought has been buzzing often in my brain, but I fear to let him
-loose his wings. Here now, with more knowledge, I go back to where
-that half thought come from and I find that he be no half thought at
-all. That be a whole thought, though so young that he is not yet
-strong to use his little wings. Nay, like the 'Ugly Duck' of my
-friend Hans Andersen, he be no duck thought at all, but a big swan
-thought that sail nobly on big wings, when the time come for him to
-try them. See I read here what Jonathan have written.
-
-"That other of his race who, in a later age, again and again, brought
-his forces over The Great River into Turkey Land, who when he was
-beaten back, came again, and again, and again, though he had to come
-alone from the bloody field where his troops were being slaughtered,
-since he knew that he alone could ultimately triumph.
-
-"What does this tell us? Not much? No! The Count's child thought
-see nothing, therefore he speak so free. Your man thought see
-nothing. My man thought see nothing, till just now. No! But there
-comes another word from some one who speak without thought because
-she, too, know not what it mean, what it might mean. Just as there
-are elements which rest, yet when in nature's course they move on
-their way and they touch, the pouf! And there comes a flash of light,
-heaven wide, that blind and kill and destroy some. But that show up
-all earth below for leagues and leagues. Is it not so? Well, I shall
-explain. To begin, have you ever study the philosophy of crime?
-'Yes' and 'No.' You, John, yes, for it is a study of insanity. You,
-no, Madam Mina, for crime touch you not, not but once. Still, your
-mind works true, and argues not a particulari ad universale. There is
-this peculiarity in criminals. It is so constant, in all countries
-and at all times, that even police, who know not much from philosophy,
-come to know it empirically, that it is. That is to be empiric. The
-criminal always work at one crime, that is the true criminal who seems
-predestinate to crime, and who will of none other. This criminal has
-not full man brain. He is clever and cunning and resourceful, but he
-be not of man stature as to brain. He be of child brain in much. Now
-this criminal of ours is predestinate to crime also. He, too, have
-child brain, and it is of the child to do what he have done. The
-little bird, the little fish, the little animal learn not by
-principle, but empirically. And when he learn to do, then there is to
-him the ground to start from to do more. 'Dos pou sto,' said
-Archimedes. 'Give me a fulcrum, and I shall move the world!' To do
-once, is the fulcrum whereby child brain become man brain. And until
-he have the purpose to do more, he continue to do the same again every
-time, just as he have done before! Oh, my dear, I see that your eyes
-are opened, and that to you the lightning flash show all the leagues,"
-for Mrs. Harker began to clap her hands and her eyes sparkled.
-
-He went on, "Now you shall speak. Tell us two dry men of science what
-you see with those so bright eyes." He took her hand and held it
-whilst he spoke. His finger and thumb closed on her pulse, as I
-thought instinctively and unconsciously, as she spoke.
-
-"The Count is a criminal and of criminal type. Nordau and Lombroso
-would so classify him, and qua criminal he is of an imperfectly formed
-mind. Thus, in a difficulty he has to seek resource in habit. His
-past is a clue, and the one page of it that we know, and that from his
-own lips, tells that once before, when in what Mr. Morris would call
-a 'tight place,' he went back to his own country from the land he had
-tried to invade, and thence, without losing purpose, prepared himself
-for a new effort. He came again better equipped for his work, and
-won. So he came to London to invade a new land. He was beaten, and
-when all hope of success was lost, and his existence in danger, he
-fled back over the sea to his home. Just as formerly he had fled back
-over the Danube from Turkey Land."
-
-"Good, good! Oh, you so clever lady!" said Van Helsing,
-enthusiastically, as he stooped and kissed her hand. A moment later
-he said to me, as calmly as though we had been having a sick room
-consultation, "Seventy-two only, and in all this excitement. I have
-hope."
-
-Turning to her again, he said with keen expectation, "But go on. Go
-on! There is more to tell if you will. Be not afraid. John and I
-know. I do in any case, and shall tell you if you are right. Speak,
-without fear!"
-
-"I will try to. But you will forgive me if I seem too egotistical."
-
-"Nay! Fear not, you must be egotist, for it is of you that we think."
-
-"Then, as he is criminal he is selfish. And as his intellect is small
-and his action is based on selfishness, he confines himself to one
-purpose. That purpose is remorseless. As he fled back over the
-Danube, leaving his forces to be cut to pieces, so now he is intent on
-being safe, careless of all. So his own selfishness frees my soul
-somewhat from the terrible power which he acquired over me on that
-dreadful night. I felt it! Oh, I felt it! Thank God, for His great
-mercy! My soul is freer than it has been since that awful hour. And
-all that haunts me is a fear lest in some trance or dream he may have
-used my knowledge for his ends."
-
-The Professor stood up, "He has so used your mind, and by it he has
-left us here in Varna, whilst the ship that carried him rushed through
-enveloping fog up to Galatz, where, doubtless, he had made preparation
-for escaping from us. But his child mind only saw so far. And it may
-be that as ever is in God's Providence, the very thing that the evil
-doer most reckoned on for his selfish good, turns out to be his
-chiefest harm. The hunter is taken in his own snare, as the great
-Psalmist says. For now that he think he is free from every trace of
-us all, and that he has escaped us with so many hours to him, then his
-selfish child brain will whisper him to sleep. He think, too, that as
-he cut himself off from knowing your mind, there can be no knowledge
-of him to you. There is where he fail! That terrible baptism of
-blood which he give you makes you free to go to him in spirit, as you
-have as yet done in your times of freedom, when the sun rise and set.
-At such times you go by my volition and not by his. And this power to
-good of you and others, you have won from your suffering at his hands.
-This is now all more precious that he know it not, and to guard
-himself have even cut himself off from his knowledge of our where.
-We, however, are not selfish, and we believe that God is with us
-through all this blackness, and these many dark hours. We shall
-follow him, and we shall not flinch, even if we peril ourselves that
-we become like him. Friend John, this has been a great hour, and it
-have done much to advance us on our way. You must be scribe and write
-him all down, so that when the others return from their work you can
-give it to them, then they shall know as we do."
-
-And so I have written it whilst we wait their return, and Mrs. Harker
-has written with the typewriter all since she brought the MS to us.
-
-
-
-
-CHAPTER 26
-
-
-DR. SEWARD'S DIARY
-
-29 October.--This is written in the train from Varna to Galatz. Last
-night we all assembled a little before the time of sunset. Each of us
-had done his work as well as he could, so far as thought, and
-endeavour, and opportunity go, we are prepared for the whole of our
-journey, and for our work when we get to Galatz. When the usual time
-came round Mrs. Harker prepared herself for her hypnotic effort, and
-after a longer and more serious effort on the part of Van Helsing than
-has been usually necessary, she sank into the trance. Usually she
-speaks on a hint, but this time the Professor had to ask her
-questions, and to ask them pretty resolutely, before we could learn
-anything. At last her answer came.
-
-"I can see nothing. We are still. There are no waves lapping, but
-only a steady swirl of water softly running against the hawser. I can
-hear men's voices calling, near and far, and the roll and creak of
-oars in the rowlocks. A gun is fired somewhere, the echo of it seems
-far away. There is tramping of feet overhead, and ropes and chains
-are dragged along. What is this? There is a gleam of light. I can
-feel the air blowing upon me."
-
-Here she stopped. She had risen, as if impulsively, from where she
-lay on the sofa, and raised both her hands, palms upwards, as if
-lifting a weight. Van Helsing and I looked at each other with
-understanding. Quincey raised his eyebrows slightly and looked at her
-intently, whilst Harker's hand instinctively closed round the hilt of
-his Kukri. There was a long pause. We all knew that the time when
-she could speak was passing, but we felt that it was useless to say
-anything.
-
-Suddenly she sat up, and as she opened her eyes said sweetly, "Would
-none of you like a cup of tea? You must all be so tired!"
-
-We could only make her happy, and so acqueisced. She bustled off to
-get tea. When she had gone Van Helsing said, "You see, my friends. He
-is close to land. He has left his earth chest. But he has yet to get
-on shore. In the night he may lie hidden somewhere, but if he be not
-carried on shore, or if the ship do not touch it, he cannot achieve
-the land. In such case he can, if it be in the night, change his form
-and jump or fly on shore, then, unless he be carried he cannot escape.
-And if he be carried, then the customs men may discover what the box
-contain. Thus, in fine, if he escape not on shore tonight, or before
-dawn, there will be the whole day lost to him. We may then arrive in
-time. For if he escape not at night we shall come on him in daytime,
-boxed up and at our mercy. For he dare not be his true self, awake
-and visible, lest he be discovered."
-
-There was no more to be said, so we waited in patience until the dawn,
-at which time we might learn more from Mrs. Harker.
-
-Early this morning we listened, with breathless anxiety, for her
-response in her trance. The hypnotic stage was even longer in coming
-than before, and when it came the time remaining until full sunrise
-was so short that we began to despair. Van Helsing seemed to throw
-his whole soul into the effort. At last, in obedience to his will she
-made reply.
-
-"All is dark. I hear lapping water, level with me, and some creaking
-as of wood on wood." She paused, and the red sun shot up. We must
-wait till tonight.
-
-And so it is that we are travelling towards Galatz in an agony of
-expectation. We are due to arrive between two and three in the
-morning. But already, at Bucharest, we are three hours late, so we
-cannot possibly get in till well after sunup. Thus we shall have two
-more hypnotic messages from Mrs. Harker! Either or both may possibly
-throw more light on what is happening.
-
-
-Later.--Sunset has come and gone. Fortunately it came at a time when
-there was no distraction. For had it occurred whilst we were at a
-station, we might not have secured the necessary calm and isolation.
-Mrs. Harker yielded to the hypnotic influence even less readily than
-this morning. I am in fear that her power of reading the Count's
-sensations may die away, just when we want it most. It seems to me
-that her imagination is beginning to work. Whilst she has been in the
-trance hitherto she has confined herself to the simplest of facts. If
-this goes on it may ultimately mislead us. If I thought that the
-Count's power over her would die away equally with her power of
-knowledge it would be a happy thought. But I am afraid that it may
-not be so.
-
-When she did speak, her words were enigmatical, "Something is going
-out. I can feel it pass me like a cold wind. I can hear, far off,
-confused sounds, as of men talking in strange tongues, fierce falling
-water, and the howling of wolves." She stopped and a shudder ran
-through her, increasing in intensity for a few seconds, till at the
-end, she shook as though in a palsy. She said no more, even in answer
-to the Professor's imperative questioning. When she woke from the
-trance, she was cold, and exhausted, and languid, but her mind was all
-alert. She could not remember anything, but asked what she had said.
-When she was told, she pondered over it deeply for a long time and in
-silence.
-
-
-30 October, 7 A.M.--We are near Galatz now, and I may not have time to
-write later. Sunrise this morning was anxiously looked for by us all.
-Knowing of the increasing difficulty of procuring the hypnotic trance,
-Van Helsing began his passes earlier than usual. They produced no
-effect, however, until the regular time, when she yielded with a still
-greater difficulty, only a minute before the sun rose. The Professor
-lost no time in his questioning.
-
-Her answer came with equal quickness, "All is dark. I hear water
-swirling by, level with my ears, and the creaking of wood on wood.
-Cattle low far off. There is another sound, a queer one like . . ."
-She stopped and grew white, and whiter still.
-
-"Go on, go on! Speak, I command you!" said Van Helsing in an agonized
-voice. At the same time there was despair in his eyes, for the risen
-sun was reddening even Mrs. Harker's pale face. She opened her eyes,
-and we all started as she said, sweetly and seemingly with the utmost
-unconcern.
-
-"Oh, Professor, why ask me to do what you know I can't? I don't
-remember anything." Then, seeing the look of amazement on our faces,
-she said, turning from one to the other with a troubled look, "What
-have I said? What have I done? I know nothing, only that I was lying
-here, half asleep, and heard you say 'go on! speak, I command you!' It
-seemed so funny to hear you order me about, as if I were a bad child!"
-
-"Oh, Madam Mina," he said, sadly, "it is proof, if proof be needed, of
-how I love and honour you, when a word for your good, spoken more
-earnest than ever, can seem so strange because it is to order her whom
-I am proud to obey!"
-
-The whistles are sounding. We are nearing Galatz. We are on fire
-with anxiety and eagerness.
-
-
-
-MINA HARKER'S JOURNAL
-
-30 October.--Mr. Morris took me to the hotel where our rooms had been
-ordered by telegraph, he being the one who could best be spared, since
-he does not speak any foreign language. The forces were distributed
-much as they had been at Varna, except that Lord Godalming went to the
-Vice Consul, as his rank might serve as an immediate guarantee of some
-sort to the official, we being in extreme hurry. Jonathan and the two
-doctors went to the shipping agent to learn particulars of the arrival
-of the Czarina Catherine.
-
-
-Later.--Lord Godalming has returned. The Consul is away, and the Vice
-Consul sick. So the routine work has been attended to by a clerk. He
-was very obliging, and offered to do anything in his power.
-
-
-
-JONATHAN HARKER'S JOURNAL
-
-30 October.--At nine o'clock Dr. Van Helsing, Dr. Seward, and I called
-on Messrs. Mackenzie & Steinkoff, the agents of the London firm of
-Hapgood. They had received a wire from London, in answer to Lord
-Godalming's telegraphed request, asking them to show us any civility
-in their power. They were more than kind and courteous, and took us
-at once on board the Czarina Catherine, which lay at anchor out in the
-river harbor. There we saw the Captain, Donelson by name, who told us
-of his voyage. He said that in all his life he had never had so
-favourable a run.
-
-"Man!" he said, "but it made us afeard, for we expect it that we
-should have to pay for it wi' some rare piece o' ill luck, so as to
-keep up the average. It's no canny to run frae London to the Black
-Sea wi' a wind ahint ye, as though the Deil himself were blawin' on
-yer sail for his ain purpose. An' a' the time we could no speer a
-thing. Gin we were nigh a ship, or a port, or a headland, a fog fell
-on us and travelled wi' us, till when after it had lifted and we
-looked out, the deil a thing could we see. We ran by Gibraltar wi'
-oot bein' able to signal. An' til we came to the Dardanelles and had
-to wait to get our permit to pass, we never were within hail o'
-aught. At first I inclined to slack off sail and beat about till the
-fog was lifted. But whiles, I thocht that if the Deil was minded to
-get us into the Black Sea quick, he was like to do it whether we would
-or no. If we had a quick voyage it would be no to our miscredit
-wi' the owners, or no hurt to our traffic, an' the Old Mon who had
-served his ain purpose wad be decently grateful to us for no hinderin'
-him."
-
-This mixture of simplicity and cunning, of superstition and commercial
-reasoning, aroused Van Helsing, who said, "Mine friend, that Devil is
-more clever than he is thought by some, and he know when he meet his
-match!"
-
-The skipper was not displeased with the compliment, and went on, "When
-we got past the Bosphorus the men began to grumble. Some o' them, the
-Roumanians, came and asked me to heave overboard a big box which had
-been put on board by a queer lookin' old man just before we had
-started frae London. I had seen them speer at the fellow, and put out
-their twa fingers when they saw him, to guard them against the evil
-eye. Man! but the supersteetion of foreigners is pairfectly
-rideeculous! I sent them aboot their business pretty quick, but as
-just after a fog closed in on us I felt a wee bit as they did anent
-something, though I wouldn't say it was again the big box. Well, on
-we went, and as the fog didn't let up for five days I joost let the
-wind carry us, for if the Deil wanted to get somewheres, well, he
-would fetch it up a'reet. An' if he didn't, well, we'd keep a sharp
-lookout anyhow. Sure eneuch, we had a fair way and deep water all the
-time. And two days ago, when the mornin' sun came through the fog, we
-found ourselves just in the river opposite Galatz. The Roumanians
-were wild, and wanted me right or wrong to take out the box and fling
-it in the river. I had to argy wi' them aboot it wi' a handspike. An'
-when the last o' them rose off the deck wi' his head in his hand, I
-had convinced them that, evil eye or no evil eye, the property and the
-trust of my owners were better in my hands than in the river Danube.
-They had, mind ye, taken the box on the deck ready to fling in, and as
-it was marked Galatz via Varna, I thocht I'd let it lie till we
-discharged in the port an' get rid o't althegither. We didn't do much
-clearin' that day, an' had to remain the nicht at anchor. But in the
-mornin', braw an' airly, an hour before sunup, a man came aboard wi'
-an order, written to him from England, to receive a box marked for one
-Count Dracula. Sure eneuch the matter was one ready to his hand. He
-had his papers a' reet, an' glad I was to be rid o' the dam' thing,
-for I was beginnin' masel' to feel uneasy at it. If the Deil did have
-any luggage aboord the ship, I'm thinkin' it was nane ither than that
-same!"
-
-"What was the name of the man who took it?" asked Dr. Van Helsing with
-restrained eagerness.
-
-"I'll be tellin' ye quick!" he answered, and stepping down to his
-cabin, produced a receipt signed "Immanuel Hildesheim." Burgen-strasse
-16 was the address. We found out that this was all the Captain knew,
-so with thanks we came away.
-
-We found Hildesheim in his office, a Hebrew of rather the Adelphi
-Theatre type, with a nose like a sheep, and a fez. His arguments were
-pointed with specie, we doing the punctuation, and with a little
-bargaining he told us what he knew. This turned out to be simple but
-important. He had received a letter from Mr. de Ville of London,
-telling him to receive, if possible before sunrise so as to avoid
-customs, a box which would arrive at Galatz in the Czarina Catherine.
-This he was to give in charge to a certain Petrof Skinsky, who dealt
-with the Slovaks who traded down the river to the port. He had been
-paid for his work by an English bank note, which had been duly cashed
-for gold at the Danube International Bank. When Skinsky had come to
-him, he had taken him to the ship and handed over the box, so as to
-save porterage. That was all he knew.
-
-We then sought for Skinsky, but were unable to find him. One of his
-neighbors, who did not seem to bear him any affection, said that he
-had gone away two days before, no one knew whither. This was
-corroborated by his landlord, who had received by messenger the key of
-the house together with the rent due, in English money. This had been
-between ten and eleven o'clock last night. We were at a standstill
-again.
-
-Whilst we were talking one came running and breathlessly gasped out
-that the body of Skinsky had been found inside the wall of the
-churchyard of St. Peter, and that the throat had been torn open as if
-by some wild animal. Those we had been speaking with ran off to see
-the horror, the women crying out. "This is the work of a Slovak!" We
-hurried away lest we should have been in some way drawn into the
-affair, and so detained.
-
-As we came home we could arrive at no definite conclusion. We were
-all convinced that the box was on its way, by water, to somewhere, but
-where that might be we would have to discover. With heavy hearts we
-came home to the hotel to Mina.
-
-When we met together, the first thing was to consult as to taking Mina
-again into our confidence. Things are getting desperate, and it is at
-least a chance, though a hazardous one. As a preliminary step, I was
-released from my promise to her.
-
-
-
-
-
-MINA HARKER'S JOURNAL
-
-30 October, evening.--They were so tired and worn out and dispirited
-that there was nothing to be done till they had some rest, so I asked
-them all to lie down for half an hour whilst I should enter everything
-up to the moment. I feel so grateful to the man who invented the
-"Traveller's" typewriter, and to Mr. Morris for getting this one for
-me. I should have felt quite astray doing the work if I had to write
-with a pen . . .
-
-It is all done. Poor dear, dear Jonathan, what he must have suffered,
-what he must be suffering now. He lies on the sofa hardly seeming to
-breathe, and his whole body appears in collapse. His brows are knit.
-His face is drawn with pain. Poor fellow, maybe he is thinking, and I
-can see his face all wrinkled up with the concentration of his
-thoughts. Oh! if I could only help at all. I shall do what I can.
-
-I have asked Dr. Van Helsing, and he has got me all the papers that I
-have not yet seen. Whilst they are resting, I shall go over all
-carefully, and perhaps I may arrive at some conclusion. I shall try
-to follow the Professor's example, and think without prejudice on the
-facts before me . . .
-
-I do believe that under God's providence I have made a discovery. I
-shall get the maps and look over them.
-
-I am more than ever sure that I am right. My new conclusion is ready,
-so I shall get our party together and read it. They can judge it. It
-is well to be accurate, and every minute is precious.
-
-
-
-MINA HARKER'S MEMORANDUM
-
-(ENTERED IN HER JOURNAL)
-
-
-Ground of inquiry.--Count Dracula's problem is to get back
-to his own place.
-
-(a) He must be brought back by some one. This is evident;
-for had he power to move himself as he wished he could go
-either as man, or wolf, or bat, or in some other way. He
-evidently fears discovery or interference, in the state of
-helplessness in which he must be, confined as he is between
-dawn and sunset in his wooden box.
-
-(b) How is he to be taken?--Here a process of exclusions may
-help us. By road, by rail, by water?
-
-1. By Road.--There are endless difficulties, especially in
-leaving the city.
-
-(x) There are people. And people are curious, and
-investigate. A hint, a surmise, a doubt as to what might
-be in the box, would destroy him.
-
-(y) There are, or there may be, customs and octroi officers
-to pass.
-
-(z) His pursuers might follow. This is his highest fear.
-And in order to prevent his being betrayed he has repelled,
-so far as he can, even his victim, me!
-
-2. By Rail.--There is no one in charge of the box. It
-would have to take its chance of being delayed, and delay
-would be fatal, with enemies on the track. True, he might
-escape at night. But what would he be, if left in a strange
-place with no refuge that he could fly to? This is not what he
-intends, and he does not mean to risk it.
-
-3. By Water.--Here is the safest way, in one respect, but
-with most danger in another. On the water he is powerless
-except at night. Even then he can only summon fog and storm and
-snow and his wolves. But were he wrecked, the living water would
-engulf him, helpless, and he would indeed be lost. He could have
-the vessel drive to land, but if it were unfriendly land, wherein
-he was not free to move, his position would still be desperate.
-
-We know from the record that he was on the water, so what
-we have to do is to ascertain what water.
-
-The first thing is to realize exactly what he has done as
-yet. We may, then, get a light on what his task is to be.
-
-Firstly.--We must differentiate between what he did in
-London as part of his general plan of action, when he was
-pressed for moments and had to arrange as best he could.
-
-Secondly.--We must see, as well as we can surmise it from the
-facts we know of, what he has done here.
-
-As to the first, he evidently intended to arrive at Galatz,
-and sent invoice to Varna to deceive us lest we should ascertain
-his means of exit from England. His immediate and sole purpose
-then was to escape. The proof of this, is the letter of
-instructions sent to Immanuel Hildesheim to clear and take away
-the box before sunrise. There is also the instruction to Petrof
-Skinsky. These we must only guess at, but there must have been
-some letter or message, since Skinsky came to Hildesheim.
-
-That, so far, his plans were successful we know. The Czarina
-Catherine made a phenomenally quick journey. So much so that
-Captain Donelson's suspicions were aroused. But his superstition
-united with his canniness played the Count's game for him, and he
-ran with his favouring wind through fogs and all till he brought
-up blindfold at Galatz. That the Count's arrangements were well
-made, has been proved. Hildesheim cleared the box, took it off,
-and gave it to Skinsky. Skinsky took it, and here we lose the
-trail. We only know that the box is somewhere on the water,
-moving along. The customs and the octroi, if there be any, have
-been avoided.
-
-Now we come to what the Count must have done after his
-arrival, on land, at Galatz.
-
-The box was given to Skinsky before sunrise. At sunrise
-the Count could appear in his own form. Here, we ask why
-Skinsky was chosen at all to aid in the work? In my husband's
-diary, Skinsky is mentioned as dealing with the Slovaks who trade
-down the river to the port. And the man's remark, that the
-murder was the work of a Slovak, showed the general feeling
-against his class. The Count wanted isolation.
-
-My surmise is this, that in London the Count decided to get
-back to his castle by water, as the most safe and secret
-way. He was brought from the castle by Szgany, and probably they
-delivered their cargo to Slovaks who took the boxes to Varna, for
-there they were shipped to London. Thus the Count had knowledge
-of the persons who could arrange this service. When the box was
-on land, before sunrise or after sunset, he came out from his
-box, met Skinsky and instructed him what to do as to arranging
-the carriage of the box up some river. When this was done, and
-he knew that all was in train, he blotted out his traces, as he
-thought, by murdering his agent.
-
-I have examined the map and find that the river most
-suitable for the Slovaks to have ascended is either the
-Pruth or the Sereth. I read in the typescript that in my
-trance I heard cows low and water swirling level with my
-ears and the creaking of wood. The Count in his box, then,
-was on a river in an open boat, propelled probably either
-by oars or poles, for the banks are near and it is working
-against stream. There would be no such if floating down
-stream.
-
-Of course it may not be either the Sereth or the Pruth, but
-we may possibly investigate further. Now of these two, the
-Pruth is the more easily navigated, but the Sereth is, at
-Fundu, joined by the Bistritza which runs up round the Borgo
-Pass. The loop it makes is manifestly as close to Dracula's
-castle as can be got by water.
-
-
-
-MINA HARKER'S JOURNAL--CONTINUED
-
-When I had done reading, Jonathan took me in his arms and kissed me.
-The others kept shaking me by both hands, and Dr. Van Helsing said,
-"Our dear Madam Mina is once more our teacher. Her eyes have been
-where we were blinded. Now we are on the track once again, and this
-time we may succeed. Our enemy is at his most helpless. And if we
-can come on him by day, on the water, our task will be over. He has a
-start, but he is powerless to hasten, as he may not leave this box
-lest those who carry him may suspect. For them to suspect would be to
-prompt them to throw him in the stream where he perish. This he
-knows, and will not. Now men, to our Council of War, for here and
-now, we must plan what each and all shall do."
-
-"I shall get a steam launch and follow him," said Lord Godalming.
-
-"And I, horses to follow on the bank lest by chance he land," said Mr.
-Morris.
-
-"Good!" said the Professor, "both good. But neither must go alone.
-There must be force to overcome force if need be. The Slovak is
-strong and rough, and he carries rude arms." All the men smiled, for
-amongst them they carried a small arsenal.
-
-Said Mr. Morris, "I have brought some Winchesters. They are pretty
-handy in a crowd, and there may be wolves. The Count, if you
-remember, took some other precautions. He made some requisitions on
-others that Mrs. Harker could not quite hear or understand. We must
-be ready at all points."
-
-Dr. Seward said, "I think I had better go with Quincey. We have been
-accustomed to hunt together, and we two, well armed, will be a match
-for whatever may come along. You must not be alone, Art. It may be
-necessary to fight the Slovaks, and a chance thrust, for I don't
-suppose these fellows carry guns, would undo all our plans. There
-must be no chances, this time. We shall not rest until the Count's
-head and body have been separated, and we are sure that he cannot
-reincarnate."
-
-He looked at Jonathan as he spoke, and Jonathan looked at me. I could
-see that the poor dear was torn about in his mind. Of course he
-wanted to be with me. But then the boat service would, most likely,
-be the one which would destroy the . . . the . . . Vampire. (Why did
-I hesitate to write the word?)
-
-He was silent awhile, and during his silence Dr. Van Helsing spoke,
-"Friend Jonathan, this is to you for twice reasons. First, because
-you are young and brave and can fight, and all energies may be needed
-at the last. And again that it is your right to destroy him. That,
-which has wrought such woe to you and yours. Be not afraid for Madam
-Mina. She will be my care, if I may. I am old. My legs are not so
-quick to run as once. And I am not used to ride so long or to pursue
-as need be, or to fight with lethal weapons. But I can be of other
-service. I can fight in other way. And I can die, if need be, as
-well as younger men. Now let me say that what I would is this. While
-you, my Lord Godalming and friend Jonathan go in your so swift little
-steamboat up the river, and whilst John and Quincey guard the bank
-where perchance he might be landed, I will take Madam Mina right into
-the heart of the enemy's country. Whilst the old fox is tied in his
-box, floating on the running stream whence he cannot escape to land,
-where he dares not raise the lid of his coffin box lest his Slovak
-carriers should in fear leave him to perish, we shall go in the track
-where Jonathan went, from Bistritz over the Borgo, and find our way to
-the Castle of Dracula. Here, Madam Mina's hypnotic power will surely
-help, and we shall find our way, all dark and unknown otherwise, after
-the first sunrise when we are near that fateful place. There is much
-to be done, and other places to be made sanctify, so that that nest of
-vipers be obliterated."
-
-Here Jonathan interrupted him hotly, "Do you mean to say, Professor
-Van Helsing, that you would bring Mina, in her sad case and tainted as
-she is with that devil's illness, right into the jaws of his
-deathtrap? Not for the world! Not for Heaven or Hell!"
-
-He became almost speechless for a minute, and then went on, "Do you
-know what the place is? Have you seen that awful den of hellish
-infamy, with the very moonlight alive with grisly shapes, and every
-speck of dust that whirls in the wind a devouring monster in embryo?
-Have you felt the Vampire's lips upon your throat?"
-
-Here he turned to me, and as his eyes lit on my forehead he threw up
-his arms with a cry, "Oh, my God, what have we done to have this
-terror upon us?" and he sank down on the sofa in a collapse of misery.
-
-The Professor's voice, as he spoke in clear, sweet tones, which seemed
-to vibrate in the air, calmed us all.
-
-"Oh, my friend, it is because I would save Madam Mina from that awful
-place that I would go. God forbid that I should take her into that
-place. There is work, wild work, to be done before that place can be
-purify. Remember that we are in terrible straits. If the Count
-escape us this time, and he is strong and subtle and cunning, he may
-choose to sleep him for a century, and then in time our dear one," he
-took my hand, "would come to him to keep him company, and would be as
-those others that you, Jonathan, saw. You have told us of their
-gloating lips. You heard their ribald laugh as they clutched the
-moving bag that the Count threw to them. You shudder, and well may it
-be. Forgive me that I make you so much pain, but it is necessary. My
-friend, is it not a dire need for that which I am giving, possibly my
-life? If it were that any one went into that place to stay, it is I
-who would have to go to keep them company."
-
-"Do as you will," said Jonathan, with a sob that shook him all over,
-"we are in the hands of God!"
-
-
-Later.--Oh, it did me good to see the way that these brave men worked.
-How can women help loving men when they are so earnest, and so true,
-and so brave! And, too, it made me think of the wonderful power of
-money! What can it not do when basely used. I felt so thankful that
-Lord Godalming is rich, and both he and Mr. Morris, who also has
-plenty of money, are willing to spend it so freely. For if they did
-not, our little expedition could not start, either so promptly or so
-well equipped, as it will within another hour. It is not three hours
-since it was arranged what part each of us was to do. And now Lord
-Godalming and Jonathan have a lovely steam launch, with steam up ready
-to start at a moment's notice. Dr. Seward and Mr. Morris have half a
-dozen good horses, well appointed. We have all the maps and
-appliances of various kinds that can be had. Professor Van Helsing
-and I are to leave by the 11:40 train tonight for Veresti, where we
-are to get a carriage to drive to the Borgo Pass. We are bringing a
-good deal of ready money, as we are to buy a carriage and horses. We
-shall drive ourselves, for we have no one whom we can trust in the
-matter. The Professor knows something of a great many languages, so
-we shall get on all right. We have all got arms, even for me a large
-bore revolver. Jonathan would not be happy unless I was armed like
-the rest. Alas! I cannot carry one arm that the rest do, the scar on
-my forehead forbids that. Dear Dr. Van Helsing comforts me by telling
-me that I am fully armed as there may be wolves. The weather is
-getting colder every hour, and there are snow flurries which come and
-go as warnings.
-
-
-Later.--It took all my courage to say goodbye to my darling. We may
-never meet again. Courage, Mina! The Professor is looking at you
-keenly. His look is a warning. There must be no tears now, unless it
-may be that God will let them fall in gladness.
-
-
-
-JONATHAN HARKER'S JOURNAL
-
-30 October, night.--I am writing this in the light from the furnace
-door of the steam launch. Lord Godalming is firing up. He is an
-experienced hand at the work, as he has had for years a launch of his
-own on the Thames, and another on the Norfolk Broads. Regarding our
-plans, we finally decided that Mina's guess was correct, and that if
-any waterway was chosen for the Count's escape back to his Castle, the
-Sereth and then the Bistritza at its junction, would be the one. We
-took it, that somewhere about the 47th degree, north latitude, would
-be the place chosen for crossing the country between the river and the
-Carpathians. We have no fear in running at good speed up the river at
-night. There is plenty of water, and the banks are wide enough apart
-to make steaming, even in the dark, easy enough. Lord Godalming tells
-me to sleep for a while, as it is enough for the present for one to be
-on watch. But I cannot sleep, how can I with the terrible danger
-hanging over my darling, and her going out into that awful place . . .
-
-My only comfort is that we are in the hands of God. Only for that
-faith it would be easier to die than to live, and so be quit of all
-the trouble. Mr. Morris and Dr. Seward were off on their long ride
-before we started. They are to keep up the right bank, far enough off
-to get on higher lands where they can see a good stretch of river and
-avoid the following of its curves. They have, for the first stages,
-two men to ride and lead their spare horses, four in all, so as not to
-excite curiosity. When they dismiss the men, which shall be shortly,
-they shall themselves look after the horses. It may be necessary for
-us to join forces. If so they can mount our whole party. One of the
-saddles has a moveable horn, and can be easily adapted for Mina, if
-required.
-
-It is a wild adventure we are on. Here, as we are rushing along
-through the darkness, with the cold from the river seeming to rise up
-and strike us, with all the mysterious voices of the night around us,
-it all comes home. We seem to be drifting into unknown places and
-unknown ways. Into a whole world of dark and dreadful things.
-Godalming is shutting the furnace door . . .
-
-
-31 October.--Still hurrying along. The day has come, and Godalming is
-sleeping. I am on watch. The morning is bitterly cold, the furnace
-heat is grateful, though we have heavy fur coats. As yet we have
-passed only a few open boats, but none of them had on board any box or
-package of anything like the size of the one we seek. The men were
-scared every time we turned our electric lamp on them, and fell on
-their knees and prayed.
-
-
-1 November, evening.--No news all day. We have found nothing of the
-kind we seek. We have now passed into the Bistritza, and if we are
-wrong in our surmise our chance is gone. We have overhauled every
-boat, big and little. Early this morning, one crew took us for a
-Government boat, and treated us accordingly. We saw in this a way of
-smoothing matters, so at Fundu, where the Bistritza runs into the
-Sereth, we got a Roumanian flag which we now fly conspicuously. With
-every boat which we have overhauled since then this trick has
-succeeded. We have had every deference shown to us, and not once any
-objection to whatever we chose to ask or do. Some of the Slovaks tell
-us that a big boat passed them, going at more than usual speed as she
-had a double crew on board. This was before they came to Fundu, so
-they could not tell us whether the boat turned into the Bistritza or
-continued on up the Sereth. At Fundu we could not hear of any such
-boat, so she must have passed there in the night. I am feeling very
-sleepy. The cold is perhaps beginning to tell upon me, and nature
-must have rest some time. Godalming insists that he shall keep the
-first watch. God bless him for all his goodness to poor dear Mina and
-me.
-
-
-2 November, morning.--It is broad daylight. That good fellow would
-not wake me. He says it would have been a sin to, for I slept
-peacefully and was forgetting my trouble. It seems brutally selfish
-to me to have slept so long, and let him watch all night, but he was
-quite right. I am a new man this morning. And, as I sit here and
-watch him sleeping, I can do all that is necessary both as to minding
-the engine, steering, and keeping watch. I can feel that my strength
-and energy are coming back to me. I wonder where Mina is now, and Van
-Helsing. They should have got to Veresti about noon on Wednesday. It
-would take them some time to get the carriage and horses. So if they
-had started and travelled hard, they would be about now at the Borgo
-Pass. God guide and help them! I am afraid to think what may
-happen. If we could only go faster. But we cannot. The engines are
-throbbing and doing their utmost. I wonder how Dr. Seward and Mr.
-Morris are getting on. There seem to be endless streams running down
-the mountains into this river, but as none of them are very large, at
-present, at all events, though they are doubtless terrible in winter
-and when the snow melts, the horsemen may not have met much
-obstruction. I hope that before we get to Strasba we may see them.
-For if by that time we have not overtaken the Count, it may be
-necessary to take counsel together what to do next.
-
-
-
-
-
-DR. SEWARD'S DIARY
-
-2 November.--Three days on the road. No news, and no time to write it
-if there had been, for every moment is precious. We have had only the
-rest needful for the horses. But we are both bearing it wonderfully.
-Those adventurous days of ours are turning up useful. We must push
-on. We shall never feel happy till we get the launch in sight again.
-
-
-3 November.--We heard at Fundu that the launch had gone up the
-Bistritza. I wish it wasn't so cold. There are signs of snow coming.
-And if it falls heavy it will stop us. In such case we must get a
-sledge and go on, Russian fashion.
-
-4 November.--Today we heard of the launch having been detained by an
-accident when trying to force a way up the rapids. The Slovak boats
-get up all right, by aid of a rope and steering with knowledge. Some
-went up only a few hours before. Godalming is an amateur fitter
-himself, and evidently it was he who put the launch in trim again.
-
-Finally, they got up the rapids all right, with local help, and are off
-on the chase afresh. I fear that the boat is not any better for the
-accident, the peasantry tell us that after she got upon smooth water
-again, she kept stopping every now and again so long as she was in
-sight. We must push on harder than ever. Our help may be wanted
-soon.
-
-
-
-
-
-MINA HARKER'S JOURNAL
-
-31 October.--Arrived at Veresti at noon. The Professor tells me that
-this morning at dawn he could hardly hypnotize me at all, and that all
-I could say was, "dark and quiet." He is off now buying a carriage
-and horses. He says that he will later on try to buy additional
-horses, so that we may be able to change them on the way. We have
-something more than 70 miles before us. The country is lovely, and
-most interesting. If only we were under different conditions, how
-delightful it would be to see it all. If Jonathan and I were driving
-through it alone what a pleasure it would be. To stop and see people,
-and learn something of their life, and to fill our minds and memories
-with all the colour and picturesqueness of the whole wild, beautiful
-country and the quaint people! But, alas!
-
-
-Later.--Dr. Van Helsing has returned. He has got the carriage and
-horses. We are to have some dinner, and to start in an hour. The
-landlady is putting us up a huge basket of provisions. It seems
-enough for a company of soldiers. The Professor encourages her, and
-whispers to me that it may be a week before we can get any food again.
-He has been shopping too, and has sent home such a wonderful lot of
-fur coats and wraps, and all sorts of warm things. There will not be
-any chance of our being cold.
-
-We shall soon be off. I am afraid to think what may happen to us. We
-are truly in the hands of God. He alone knows what may be, and I pray
-Him, with all the strength of my sad and humble soul, that He will
-watch over my beloved husband. That whatever may happen, Jonathan may
-know that I loved him and honoured him more than I can say, and that my
-latest and truest thought will be always for him.
-
-
-
-
-CHAPTER 27
-
-
-MINA HARKER'S JOURNAL
-
-1 November.--All day long we have travelled, and at a good speed. The
-horses seem to know that they are being kindly treated, for they go
-willingly their full stage at best speed. We have now had so many
-changes and find the same thing so constantly that we are encouraged
-to think that the journey will be an easy one. Dr. Van Helsing is
-laconic, he tells the farmers that he is hurrying to Bistritz, and
-pays them well to make the exchange of horses. We get hot soup, or
-coffee, or tea, and off we go. It is a lovely country. Full of
-beauties of all imaginable kinds, and the people are brave, and
-strong, and simple, and seem full of nice qualities. They are very,
-very superstitious. In the first house where we stopped, when the
-woman who served us saw the scar on my forehead, she crossed herself
-and put out two fingers towards me, to keep off the evil eye. I
-believe they went to the trouble of putting an extra amount of garlic
-into our food, and I can't abide garlic. Ever since then I have taken
-care not to take off my hat or veil, and so have escaped their
-suspicions. We are travelling fast, and as we have no driver with us
-to carry tales, we go ahead of scandal. But I daresay that fear of
-the evil eye will follow hard behind us all the way. The Professor
-seems tireless. All day he would not take any rest, though he made me
-sleep for a long spell. At sunset time he hypnotized me, and he says
-I answered as usual, "darkness, lapping water and creaking wood." So
-our enemy is still on the river. I am afraid to think of Jonathan,
-but somehow I have now no fear for him, or for myself. I write this
-whilst we wait in a farmhouse for the horses to be ready. Dr. Van
-Helsing is sleeping. Poor dear, he looks very tired and old and grey,
-but his mouth is set as firmly as a conqueror's. Even in his sleep he
-is intense with resolution. When we have well started I must make him
-rest whilst I drive. I shall tell him that we have days before us,
-and he must not break down when most of all his strength will be
-needed . . . All is ready. We are off shortly.
-
-
-2 November, morning.--I was successful, and we took turns driving all
-night. Now the day is on us, bright though cold. There is a strange
-heaviness in the air. I say heaviness for want of a better word. I
-mean that it oppresses us both. It is very cold, and only our warm
-furs keep us comfortable. At dawn Van Helsing hypnotized me. He says
-I answered "darkness, creaking wood and roaring water," so the river
-is changing as they ascend. I do hope that my darling will not run
-any chance of danger, more than need be, but we are in God's hands.
-
-
-2 November, night.--All day long driving. The country gets wilder as
-we go, and the great spurs of the Carpathians, which at Veresti seemed
-so far from us and so low on the horizon, now seem to gather round us
-and tower in front. We both seem in good spirits. I think we make an
-effort each to cheer the other, in the doing so we cheer ourselves.
-Dr. Van Helsing says that by morning we shall reach the Borgo Pass.
-The houses are very few here now, and the Professor says that the last
-horse we got will have to go on with us, as we may not be able to
-change. He got two in addition to the two we changed, so that now we
-have a rude four-in-hand. The dear horses are patient and good, and
-they give us no trouble. We are not worried with other travellers,
-and so even I can drive. We shall get to the Pass in daylight. We do
-not want to arrive before. So we take it easy, and have each a long
-rest in turn. Oh, what will tomorrow bring to us? We go to seek the
-place where my poor darling suffered so much. God grant that we may
-be guided aright, and that He will deign to watch over my husband and
-those dear to us both, and who are in such deadly peril. As for me, I
-am not worthy in His sight. Alas! I am unclean to His eyes, and
-shall be until He may deign to let me stand forth in His sight as one
-of those who have not incurred His wrath.
-
-
-
-
-
-MEMORANDUM BY ABRAHAM VAN HELSING
-
-4 November.--This to my old and true friend John Seward, M.D.,
-of Purfleet, London, in case I may not see him. It may
-explain. It is morning, and I write by a fire which all
-the night I have kept alive, Madam Mina aiding me. It is
-cold, cold. So cold that the grey heavy sky is full of
-snow, which when it falls will settle for all winter as the
-ground is hardening to receive it. It seems to have affected
-Madam Mina. She has been so heavy of head all day that she was
-not like herself. She sleeps, and sleeps, and sleeps! She who
-is usual so alert, have done literally nothing all the day. She
-even have lost her appetite. She make no entry into her little
-diary, she who write so faithful at every pause. Something
-whisper to me that all is not well. However, tonight she is more
-_vif_. Her long sleep all day have refresh and restore her, for
-now she is all sweet and bright as ever. At sunset I try to
-hypnotize her, but alas! with no effect. The power has grown
-less and less with each day, and tonight it fail me altogether.
-Well, God's will be done, whatever it may be, and whithersoever
-it may lead!
-
-Now to the historical, for as Madam Mina write not in her
-stenography, I must, in my cumbrous old fashion, that so
-each day of us may not go unrecorded.
-
-We got to the Borgo Pass just after sunrise yesterday
-morning. When I saw the signs of the dawn I got ready for
-the hypnotism. We stopped our carriage, and got down so
-that there might be no disturbance. I made a couch with
-furs, and Madam Mina, lying down, yield herself as usual,
-but more slow and more short time than ever, to the hypnotic
-sleep. As before, came the answer, "darkness and the swirling of
-water." Then she woke, bright and radiant and we go on our way
-and soon reach the Pass. At this time and place, she become all
-on fire with zeal. Some new guiding power be in her manifested,
-for she point to a road and say, "This is the way."
-
-"How know you it?" I ask.
-
-"Of course I know it," she answer, and with a pause, add,
-"Have not my Jonathan travelled it and wrote of his travel?"
-
-At first I think somewhat strange, but soon I see that there be
-only one such byroad. It is used but little, and very different
-from the coach road from the Bukovina to Bistritz, which is more
-wide and hard, and more of use.
-
-So we came down this road. When we meet other ways, not
-always were we sure that they were roads at all, for they
-be neglect and light snow have fallen, the horses know and
-they only. I give rein to them, and they go on so patient. By
-and by we find all the things which Jonathan have note in that
-wonderful diary of him. Then we go on for long, long hours and
-hours. At the first, I tell Madam Mina to sleep. She try, and
-she succeed. She sleep all the time, till at the last, I feel
-myself to suspicious grow, and attempt to wake her. But she
-sleep on, and I may not wake her though I try. I do not wish to
-try too hard lest I harm her. For I know that she have suffer
-much, and sleep at times be all-in-all to her. I think I drowse
-myself, for all of sudden I feel guilt, as though I have done
-something. I find myself bolt up, with the reins in my hand, and
-the good horses go along jog, jog, just as ever. I look down and
-find Madam Mina still asleep. It is now not far off sunset time,
-and over the snow the light of the sun flow in big yellow flood,
-so that we throw great long shadow on where the mountain rise so
-steep. For we are going up, and up, and all is oh so wild and
-rocky, as though it were the end of the world.
-
-Then I arouse Madam Mina. This time she wake with not much
-trouble, and then I try to put her to hypnotic sleep. But
-she sleep not, being as though I were not. Still I try and
-try, till all at once I find her and myself in dark, so I
-look round, and find that the sun have gone down. Madam
-Mina laugh, and I turn and look at her. She is now quite
-awake, and look so well as I never saw her since that night
-at Carfax when we first enter the Count's house. I am amaze, and
-not at ease then. But she is so bright and tender and thoughtful
-for me that I forget all fear. I light a fire, for we have
-brought supply of wood with us, and she prepare food while I undo
-the horses and set them, tethered in shelter, to feed. Then when
-I return to the fire she have my supper ready. I go to help her,
-but she smile, and tell me that she have eat already. That she
-was so hungry that she would not wait. I like it not, and I have
-grave doubts. But I fear to affright her, and so I am silent of
-it. She help me and I eat alone, and then we wrap in fur and lie
-beside the fire, and I tell her to sleep while I watch. But
-presently I forget all of watching. And when I sudden remember
-that I watch, I find her lying quiet, but awake, and looking at
-me with so bright eyes. Once, twice more the same occur, and I
-get much sleep till before morning. When I wake I try to
-hypnotize her, but alas! though she shut her eyes obedient, she
-may not sleep. The sun rise up, and up, and up, and then sleep
-come to her too late, but so heavy that she will not wake. I
-have to lift her up, and place her sleeping in the carriage when
-I have harnessed the horses and made all ready. Madam still
-sleep, and she look in her sleep more healthy and more redder
-than before. And I like it not. And I am afraid, afraid,
-afraid! I am afraid of all things, even to think but I must go
-on my way. The stake we play for is life and death, or more than
-these, and we must not flinch.
-
-
-5 November, morning.--Let me be accurate in everything, for
-though you and I have seen some strange things together,
-you may at the first think that I, Van Helsing, am mad.
-That the many horrors and the so long strain on nerves has
-at the last turn my brain.
-
-All yesterday we travel, always getting closer to the
-mountains, and moving into a more and more wild and desert
-land. There are great, frowning precipices and much falling
-water, and Nature seem to have held sometime her carnival. Madam
-Mina still sleep and sleep. And though I did have hunger and
-appeased it, I could not waken her, even for food. I began to
-fear that the fatal spell of the place was upon her, tainted as
-she is with that Vampire baptism. "Well," said I to myself, "if
-it be that she sleep all the day, it shall also be that I do not
-sleep at night." As we travel on the rough road, for a road of
-an ancient and imperfect kind there was, I held down my head and
-slept.
-
-Again I waked with a sense of guilt and of time passed, and
-found Madam Mina still sleeping, and the sun low down. But
-all was indeed changed. The frowning mountains seemed further
-away, and we were near the top of a steep rising hill, on summit
-of which was such a castle as Jonathan tell of in his diary. At
-once I exulted and feared. For now, for good or ill, the end was
-near.
-
-I woke Madam Mina, and again tried to hypnotize her, but
-alas! unavailing till too late. Then, ere the great dark
-came upon us, for even after down sun the heavens reflected
-the gone sun on the snow, and all was for a time in a great
-twilight. I took out the horses and fed them in what shelter I
-could. Then I make a fire, and near it I make Madam Mina, now
-awake and more charming than ever, sit comfortable amid her rugs.
-I got ready food, but she would not eat, simply saying that she
-had not hunger. I did not press her, knowing her unavailingness.
-But I myself eat, for I must needs now be strong for all. Then,
-with the fear on me of what might be, I drew a ring so big for
-her comfort, round where Madam Mina sat. And over the ring I
-passed some of the wafer, and I broke it fine so that all was
-well guarded. She sat still all the time, so still as one dead.
-And she grew whiter and even whiter till the snow was not more
-pale, and no word she said. But when I drew near, she clung to
-me, and I could know that the poor soul shook her from head to
-feet with a tremor that was pain to feel.
-
-I said to her presently, when she had grown more quiet,
-"Will you not come over to the fire?" for I wished to make
-a test of what she could. She rose obedient, but when she
-have made a step she stopped, and stood as one stricken.
-
-"Why not go on?" I asked. She shook her head, and coming
-back, sat down in her place. Then, looking at me with open
-eyes, as of one waked from sleep, she said simply, "I cannot!"
-and remained silent. I rejoiced, for I knew that what she could
-not, none of those that we dreaded could. Though there might be
-danger to her body, yet her soul was safe!
-
-Presently the horses began to scream, and tore at their
-tethers till I came to them and quieted them. When they
-did feel my hands on them, they whinnied low as in joy, and
-licked at my hands and were quiet for a time. Many times
-through the night did I come to them, till it arrive to the
-cold hour when all nature is at lowest, and every time my
-coming was with quiet of them. In the cold hour the fire
-began to die, and I was about stepping forth to replenish
-it, for now the snow came in flying sweeps and with it a
-chill mist. Even in the dark there was a light of some
-kind, as there ever is over snow, and it seemed as though
-the snow flurries and the wreaths of mist took shape as of
-women with trailing garments. All was in dead, grim silence only
-that the horses whinnied and cowered, as if in terror of the
-worst. I began to fear, horrible fears. But then came to me the
-sense of safety in that ring wherein I stood. I began too, to
-think that my imaginings were of the night, and the gloom, and
-the unrest that I have gone through, and all the terrible
-anxiety. It was as though my memories of all Jonathan's horrid
-experience were befooling me. For the snow flakes and the mist
-began to wheel and circle round, till I could get as though a
-shadowy glimpse of those women that would have kissed him. And
-then the horses cowered lower and lower, and moaned in terror as
-men do in pain. Even the madness of fright was not to them, so
-that they could break away. I feared for my dear Madam Mina when
-these weird figures drew near and circled round. I looked at her,
-but she sat calm, and smiled at me. When I would have stepped to
-the fire to replenish it, she caught me and held me back, and
-whispered, like a voice that one hears in a dream, so low it was.
-
-"No! No! Do not go without. Here you are safe!"
-
-I turned to her, and looking in her eyes said, "But you?
-It is for you that I fear!"
-
-Whereat she laughed, a laugh low and unreal, and said, "Fear
-for me! Why fear for me? None safer in all the world from
-them than I am," and as I wondered at the meaning of her
-words, a puff of wind made the flame leap up, and I see the
-red scar on her forehead. Then, alas! I knew. Did I not,
-I would soon have learned, for the wheeling figures of mist
-and snow came closer, but keeping ever without the Holy
-circle. Then they began to materialize till, if God have
-not taken away my reason, for I saw it through my eyes.
-There were before me in actual flesh the same three women
-that Jonathan saw in the room, when they would have kissed
-his throat. I knew the swaying round forms, the bright
-hard eyes, the white teeth, the ruddy colour, the voluptuous
-lips. They smiled ever at poor dear Madam Mina. And as
-their laugh came through the silence of the night, they
-twined their arms and pointed to her, and said in those so
-sweet tingling tones that Jonathan said were of the intolerable
-sweetness of the water glasses, "Come, sister. Come to us.
-Come!"
-
-In fear I turned to my poor Madam Mina, and my heart with
-gladness leapt like flame. For oh! the terror in her sweet
-eyes, the repulsion, the horror, told a story to my heart
-that was all of hope. God be thanked she was not, yet, of
-them. I seized some of the firewood which was by me, and
-holding out some of the Wafer, advanced on them towards the
-fire. They drew back before me, and laughed their low horrid
-laugh. I fed the fire, and feared them not. For I knew that we
-were safe within the ring, which she could not leave no more than
-they could enter. The horses had ceased to moan, and lay still
-on the ground. The snow fell on them softly, and they grew
-whiter. I knew that there was for the poor beasts no more of
-terror.
-
-And so we remained till the red of the dawn began to fall
-through the snow gloom. I was desolate and afraid, and
-full of woe and terror. But when that beautiful sun began
-to climb the horizon life was to me again. At the first
-coming of the dawn the horrid figures melted in the whirling
-mist and snow. The wreaths of transparent gloom moved away
-towards the castle, and were lost.
-
-Instinctively, with the dawn coming, I turned to Madam Mina,
-intending to hypnotize her. But she lay in a deep and sudden
-sleep, from which I could not wake her. I tried to hypnotize
-through her sleep, but she made no response, none at all, and the
-day broke. I fear yet to stir. I have made my fire and have
-seen the horses, they are all dead. Today I have much to do here,
-and I keep waiting till the sun is up high. For there may be
-places where I must go, where that sunlight, though snow and mist
-obscure it, will be to me a safety.
-
-I will strengthen me with breakfast, and then I will do my
-terrible work. Madam Mina still sleeps, and God be thanked! She
-is calm in her sleep . . .
-
-
-
-JONATHAN HARKER'S JOURNAL
-
-4 November, evening.--The accident to the launch has been a terrible
-thing for us. Only for it we should have overtaken the boat long ago,
-and by now my dear Mina would have been free. I fear to think of her,
-off on the wolds near that horrid place. We have got horses, and we
-follow on the track. I note this whilst Godalming is getting ready.
-We have our arms. The Szgany must look out if they mean to fight. Oh,
-if only Morris and Seward were with us. We must only hope! If I
-write no more Goodby Mina! God bless and keep you.
-
-
-
-DR. SEWARD'S DIARY
-
-5 November.--With the dawn we saw the body of Szgany before us dashing
-away from the river with their leiter wagon. They surrounded it in a
-cluster, and hurried along as though beset. The snow is falling
-lightly and there is a strange excitement in the air. It may be our
-own feelings, but the depression is strange. Far off I hear the
-howling of wolves. The snow brings them down from the mountains, and
-there are dangers to all of us, and from all sides. The horses are
-nearly ready, and we are soon off. We ride to death of some one. God
-alone knows who, or where, or what, or when, or how it may be . . .
-
-
-
-
-
-DR. VAN HELSING'S MEMORANDUM
-
-5 November, afternoon.--I am at least sane. Thank God for
-that mercy at all events, though the proving it has been
-dreadful. When I left Madam Mina sleeping within the Holy
-circle, I took my way to the castle. The blacksmith hammer
-which I took in the carriage from Veresti was useful, though the
-doors were all open I broke them off the rusty hinges, lest some
-ill intent or ill chance should close them, so that being entered
-I might not get out. Jonathan's bitter experience served me
-here. By memory of his diary I found my way to the old chapel,
-for I knew that here my work lay. The air was oppressive. It
-seemed as if there was some sulphurous fume, which at times made
-me dizzy. Either there was a roaring in my ears or I heard afar
-off the howl of wolves. Then I bethought me of my dear Madam
-Mina, and I was in terrible plight. The dilemma had me between
-his horns.
-
-Her, I had not dare to take into this place, but left safe
-from the Vampire in that Holy circle. And yet even there
-would be the wolf! I resolve me that my work lay here, and
-that as to the wolves we must submit, if it were God's will. At
-any rate it was only death and freedom beyond. So did I choose
-for her. Had it but been for myself the choice had been easy,
-the maw of the wolf were better to rest in than the grave of the
-Vampire! So I make my choice to go on with my work.
-
-I knew that there were at least three graves to find, graves
-that are inhabit. So I search, and search, and I find one
-of them. She lay in her Vampire sleep, so full of life and
-voluptuous beauty that I shudder as though I have come to
-do murder. Ah, I doubt not that in the old time, when such
-things were, many a man who set forth to do such a task as
-mine, found at the last his heart fail him, and then his
-nerve. So he delay, and delay, and delay, till the mere
-beauty and the fascination of the wanton Undead have hypnotize
-him. And he remain on and on, till sunset come, and the Vampire
-sleep be over. Then the beautiful eyes of the fair woman open
-and look love, and the voluptuous mouth present to a kiss, and
-the man is weak. And there remain one more victim in the
-Vampire fold. One more to swell the grim and grisly ranks
-of the Undead! . . .
-
-There is some fascination, surely, when I am moved by the
-mere presence of such an one, even lying as she lay in a
-tomb fretted with age and heavy with the dust of centuries,
-though there be that horrid odour such as the lairs of the
-Count have had. Yes, I was moved. I, Van Helsing, with
-all my purpose and with my motive for hate. I was moved to
-a yearning for delay which seemed to paralyze my faculties
-and to clog my very soul. It may have been that the need
-of natural sleep, and the strange oppression of the air
-were beginning to overcome me. Certain it was that I was
-lapsing into sleep, the open eyed sleep of one who yields
-to a sweet fascination, when there came through the snow-stilled
-air a long, low wail, so full of woe and pity that it woke me
-like the sound of a clarion. For it was the voice of my dear
-Madam Mina that I heard.
-
-Then I braced myself again to my horrid task, and found by
-wrenching away tomb tops one other of the sisters, the other dark
-one. I dared not pause to look on her as I had on her sister,
-lest once more I should begin to be enthrall. But I go on
-searching until, presently, I find in a high great tomb as if
-made to one much beloved that other fair sister which, like
-Jonathan I had seen to gather herself out of the atoms of the
-mist. She was so fair to look on, so radiantly beautiful, so
-exquisitely voluptuous, that the very instinct of man in me,
-which calls some of my sex to love and to protect one of hers,
-made my head whirl with new emotion. But God be thanked, that
-soul wail of my dear Madam Mina had not died out of my ears.
-And, before the spell could be wrought further upon me, I had
-nerved myself to my wild work. By this time I had searched all
-the tombs in the chapel, so far as I could tell. And as there
-had been only three of these Undead phantoms around us in the
-night, I took it that there were no more of active Undead
-existent. There was one great tomb more lordly than all the
-rest. Huge it was, and nobly proportioned. On it was but one
-word.
-
-
- DRACULA
-
-
-This then was the Undead home of the King Vampire, to whom
-so many more were due. Its emptiness spoke eloquent to
-make certain what I knew. Before I began to restore these
-women to their dead selves through my awful work, I laid in
-Dracula's tomb some of the Wafer, and so banished him from
-it, Undead, for ever.
-
-Then began my terrible task, and I dreaded it. Had it been
-but one, it had been easy, comparative. But three! To
-begin twice more after I had been through a deed of horror.
-For it was terrible with the sweet Miss Lucy, what would it
-not be with these strange ones who had survived through
-centuries, and who had been strengthened by the passing of
-the years. Who would, if they could, have fought for their
-foul lives . . .
-
-Oh, my friend John, but it was butcher work. Had I not
-been nerved by thoughts of other dead, and of the living
-over whom hung such a pall of fear, I could not have gone
-on. I tremble and tremble even yet, though till all was
-over, God be thanked, my nerve did stand. Had I not seen
-the repose in the first place, and the gladness that stole
-over it just ere the final dissolution came, as realization
-that the soul had been won, I could not have gone further
-with my butchery. I could not have endured the horrid screeching
-as the stake drove home, the plunging of writhing form, and lips
-of bloody foam. I should have fled in terror and left my work
-undone. But it is over! And the poor souls, I can pity them now
-and weep, as I think of them placid each in her full sleep of
-death for a short moment ere fading. For, friend John, hardly
-had my knife severed the head of each, before the whole body
-began to melt away and crumble into its native dust, as though
-the death that should have come centuries ago had at last assert
-himself and say at once and loud, "I am here!"
-
-Before I left the castle I so fixed its entrances that never
-more can the Count enter there Undead.
-
-When I stepped into the circle where Madam Mina slept, she
-woke from her sleep and, seeing me, cried out in pain that
-I had endured too much.
-
-"Come!" she said, "come away from this awful place! Let us
-go to meet my husband who is, I know, coming towards us."
-She was looking thin and pale and weak. But her eyes were
-pure and glowed with fervour. I was glad to see her paleness and
-her illness, for my mind was full of the fresh horror of that
-ruddy vampire sleep.
-
-And so with trust and hope, and yet full of fear, we go
-eastward to meet our friends, and him, whom Madam Mina tell
-me that she know are coming to meet us.
-
-
-
-
-
-MINA HARKER'S JOURNAL
-
-6 November.--It was late in the afternoon when the Professor and I
-took our way towards the east whence I knew Jonathan was coming. We
-did not go fast, though the way was steeply downhill, for we had to
-take heavy rugs and wraps with us. We dared not face the possibility
-of being left without warmth in the cold and the snow. We had to take
-some of our provisions too, for we were in a perfect desolation, and
-so far as we could see through the snowfall, there was not even the
-sign of habitation. When we had gone about a mile, I was tired with
-the heavy walking and sat down to rest. Then we looked back and saw
-where the clear line of Dracula's castle cut the sky. For we were so
-deep under the hill whereon it was set that the angle of perspective
-of the Carpathian mountains was far below it. We saw it in all its
-grandeur, perched a thousand feet on the summit of a sheer precipice,
-and with seemingly a great gap between it and the steep of the
-adjacent mountain on any side. There was something wild and uncanny
-about the place. We could hear the distant howling of wolves. They
-were far off, but the sound, even though coming muffled through the
-deadening snowfall, was full of terror. I knew from the way Dr. Van
-Helsing was searching about that he was trying to seek some strategic
-point, where we would be less exposed in case of attack. The rough
-roadway still led downwards. We could trace it through the drifted
-snow.
-
-In a little while the Professor signalled to me, so I got up and
-joined him. He had found a wonderful spot, a sort of natural hollow
-in a rock, with an entrance like a doorway between two boulders. He
-took me by the hand and drew me in.
-
-"See!" he said, "here you will be in shelter. And if the wolves do
-come I can meet them one by one."
-
-He brought in our furs, and made a snug nest for me, and got out some
-provisions and forced them upon me. But I could not eat, to even try
-to do so was repulsive to me, and much as I would have liked to please
-him, I could not bring myself to the attempt. He looked very sad, but
-did not reproach me. Taking his field glasses from the case, he stood
-on the top of the rock, and began to search the horizon.
-
-Suddenly he called out, "Look! Madam Mina, look! Look!"
-
-I sprang up and stood beside him on the rock. He handed me his
-glasses and pointed. The snow was now falling more heavily, and
-swirled about fiercely, for a high wind was beginning to blow.
-However, there were times when there were pauses between the snow
-flurries and I could see a long way round. From the height where we
-were it was possible to see a great distance. And far off, beyond the
-white waste of snow, I could see the river lying like a black ribbon
-in kinks and curls as it wound its way. Straight in front of us and
-not far off, in fact so near that I wondered we had not noticed
-before, came a group of mounted men hurrying along. In the midst of
-them was a cart, a long leiter wagon which swept from side to side,
-like a dog's tail wagging, with each stern inequality of the road.
-Outlined against the snow as they were, I could see from the men's
-clothes that they were peasants or gypsies of some kind.
-
-On the cart was a great square chest. My heart leaped as I saw it, for
-I felt that the end was coming. The evening was now drawing close,
-and well I knew that at sunset the Thing, which was till then
-imprisoned there, would take new freedom and could in any of many
-forms elude pursuit. In fear I turned to the Professor. To my
-consternation, however, he was not there. An instant later, I saw him
-below me. Round the rock he had drawn a circle, such as we had found
-shelter in last night.
-
-When he had completed it he stood beside me again saying, "At least
-you shall be safe here from him!" He took the glasses from me, and at
-the next lull of the snow swept the whole space below us. "See," he
-said, "they come quickly. They are flogging the horses, and galloping
-as hard as they can."
-
-He paused and went on in a hollow voice, "They are racing for the
-sunset. We may be too late. God's will be done!" Down came another
-blinding rush of driving snow, and the whole landscape was blotted
-out. It soon passed, however, and once more his glasses were fixed on
-the plain.
-
-Then came a sudden cry, "Look! Look! Look! See, two horsemen follow
-fast, coming up from the south. It must be Quincey and John. Take
-the glass. Look before the snow blots it all out!" I took it and
-looked. The two men might be Dr. Seward and Mr. Morris. I knew at
-all events that neither of them was Jonathan. At the same time I knew
-that Jonathan was not far off. Looking around I saw on the north side
-of the coming party two other men, riding at breakneck speed. One of
-them I knew was Jonathan, and the other I took, of course, to be Lord
-Godalming. They too, were pursuing the party with the cart. When I
-told the Professor he shouted in glee like a schoolboy, and after
-looking intently till a snow fall made sight impossible, he laid his
-Winchester rifle ready for use against the boulder at the opening of
-our shelter.
-
-"They are all converging," he said. "When the time comes we shall have
-gypsies on all sides." I got out my revolver ready to hand, for
-whilst we were speaking the howling of wolves came louder and closer.
-When the snow storm abated a moment we looked again. It was strange
-to see the snow falling in such heavy flakes close to us, and beyond,
-the sun shining more and more brightly as it sank down towards the far
-mountain tops. Sweeping the glass all around us I could see here and
-there dots moving singly and in twos and threes and larger numbers.
-The wolves were gathering for their prey.
-
-Every instant seemed an age whilst we waited. The wind came now in
-fierce bursts, and the snow was driven with fury as it swept upon us
-in circling eddies. At times we could not see an arm's length before
-us. But at others, as the hollow sounding wind swept by us, it seemed
-to clear the air space around us so that we could see afar off. We
-had of late been so accustomed to watch for sunrise and sunset, that
-we knew with fair accuracy when it would be. And we knew that before
-long the sun would set. It was hard to believe that by our watches it
-was less than an hour that we waited in that rocky shelter before the
-various bodies began to converge close upon us. The wind came now
-with fiercer and more bitter sweeps, and more steadily from the
-north. It seemingly had driven the snow clouds from us, for with only
-occasional bursts, the snow fell. We could distinguish clearly the
-individuals of each party, the pursued and the pursuers. Strangely
-enough those pursued did not seem to realize, or at least to care,
-that they were pursued. They seemed, however, to hasten with
-redoubled speed as the sun dropped lower and lower on the mountain
-tops.
-
-Closer and closer they drew. The Professor and I crouched down behind
-our rock, and held our weapons ready. I could see that he was
-determined that they should not pass. One and all were quite unaware
-of our presence.
-
-All at once two voices shouted out to "Halt!" One was my Jonathan's,
-raised in a high key of passion. The other Mr. Morris' strong
-resolute tone of quiet command. The gypsies may not have known the
-language, but there was no mistaking the tone, in whatever tongue the
-words were spoken. Instinctively they reined in, and at the instant
-Lord Godalming and Jonathan dashed up at one side and Dr. Seward and
-Mr. Morris on the other. The leader of the gypsies, a splendid
-looking fellow who sat his horse like a centaur, waved them back, and
-in a fierce voice gave to his companions some word to proceed. They
-lashed the horses which sprang forward. But the four men raised their
-Winchester rifles, and in an unmistakable way commanded them to stop.
-At the same moment Dr. Van Helsing and I rose behind the rock and
-pointed our weapons at them. Seeing that they were surrounded the men
-tightened their reins and drew up. The leader turned to them and gave
-a word at which every man of the gypsy party drew what weapon he
-carried, knife or pistol, and held himself in readiness to attack.
-Issue was joined in an instant.
-
-The leader, with a quick movement of his rein, threw his horse out in
-front, and pointed first to the sun, now close down on the hill tops,
-and then to the castle, said something which I did not understand.
-For answer, all four men of our party threw themselves from their
-horses and dashed towards the cart. I should have felt terrible fear
-at seeing Jonathan in such danger, but that the ardor of battle must
-have been upon me as well as the rest of them. I felt no fear, but
-only a wild, surging desire to do something. Seeing the quick
-movement of our parties, the leader of the gypsies gave a command. His
-men instantly formed round the cart in a sort of undisciplined
-endeavour, each one shouldering and pushing the other in his eagerness
-to carry out the order.
-
-In the midst of this I could see that Jonathan on one side of the ring
-of men, and Quincey on the other, were forcing a way to the cart. It
-was evident that they were bent on finishing their task before the sun
-should set. Nothing seemed to stop or even to hinder them. Neither
-the levelled weapons nor the flashing knives of the gypsies in front,
-nor the howling of the wolves behind, appeared to even attract their
-attention. Jonathan's impetuosity, and the manifest singleness of his
-purpose, seemed to overawe those in front of him. Instinctively they
-cowered aside and let him pass. In an instant he had jumped upon the
-cart, and with a strength which seemed incredible, raised the great
-box, and flung it over the wheel to the ground. In the meantime, Mr.
-Morris had had to use force to pass through his side of the ring of
-Szgany. All the time I had been breathlessly watching Jonathan I had,
-with the tail of my eye, seen him pressing desperately forward, and
-had seen the knives of the gypsies flash as he won a way through them,
-and they cut at him. He had parried with his great bowie knife, and
-at first I thought that he too had come through in safety. But as he
-sprang beside Jonathan, who had by now jumped from the cart, I could
-see that with his left hand he was clutching at his side, and that the
-blood was spurting through his fingers. He did not delay
-notwithstanding this, for as Jonathan, with desperate energy, attacked
-one end of the chest, attempting to prize off the lid with his great
-Kukri knife, he attacked the other frantically with his bowie. Under
-the efforts of both men the lid began to yield. The nails drew with a
-screeching sound, and the top of the box was thrown back.
-
-By this time the gypsies, seeing themselves covered by the
-Winchesters, and at the mercy of Lord Godalming and Dr. Seward, had
-given in and made no further resistance. The sun was almost down on
-the mountain tops, and the shadows of the whole group fell upon the
-snow. I saw the Count lying within the box upon the earth, some of
-which the rude falling from the cart had scattered over him. He was
-deathly pale, just like a waxen image, and the red eyes glared with
-the horrible vindictive look which I knew so well.
-
-As I looked, the eyes saw the sinking sun, and the look of hate in
-them turned to triumph.
-
-But, on the instant, came the sweep and flash of Jonathan's great
-knife. I shrieked as I saw it shear through the throat. Whilst at
-the same moment Mr. Morris's bowie knife plunged into the heart.
-
-It was like a miracle, but before our very eyes, and almost in the
-drawing of a breath, the whole body crumbled into dust and passed from
-our sight.
-
-I shall be glad as long as I live that even in that moment of final
-dissolution, there was in the face a look of peace, such as I never
-could have imagined might have rested there.
-
-The Castle of Dracula now stood out against the red sky, and every
-stone of its broken battlements was articulated against the light of
-the setting sun.
-
-The gypsies, taking us as in some way the cause of the extraordinary
-disappearance of the dead man, turned, without a word, and rode away
-as if for their lives. Those who were unmounted jumped upon the
-leiter wagon and shouted to the horsemen not to desert them. The
-wolves, which had withdrawn to a safe distance, followed in their
-wake, leaving us alone.
-
-Mr. Morris, who had sunk to the ground, leaned on his elbow, holding
-his hand pressed to his side. The blood still gushed through his
-fingers. I flew to him, for the Holy circle did not now keep me back;
-so did the two doctors. Jonathan knelt behind him and the wounded man
-laid back his head on his shoulder. With a sigh he took, with a
-feeble effort, my hand in that of his own which was unstained.
-
-He must have seen the anguish of my heart in my face, for he smiled at
-me and said, "I am only too happy to have been of service! Oh, God!"
-he cried suddenly, struggling to a sitting posture and pointing to me.
-"It was worth for this to die! Look! Look!"
-
-The sun was now right down upon the mountain top, and the red gleams
-fell upon my face, so that it was bathed in rosy light. With one
-impulse the men sank on their knees and a deep and earnest "Amen"
-broke from all as their eyes followed the pointing of his finger.
-
-The dying man spoke, "Now God be thanked that all has not been in
-vain! See! The snow is not more stainless than her forehead! The
-curse has passed away!"
-
-And, to our bitter grief, with a smile and in silence, he died, a
-gallant gentleman.
-
-
-
-
-
-NOTE
-
-
-Seven years ago we all went through the flames. And the happiness of
-some of us since then is, we think, well worth the pain we endured.
-It is an added joy to Mina and to me that our boy's birthday is the
-same day as that on which Quincey Morris died. His mother holds, I
-know, the secret belief that some of our brave friend's spirit has
-passed into him. His bundle of names links all our little band of men
-together. But we call him Quincey.
-
-In the summer of this year we made a journey to Transylvania, and went
-over the old ground which was, and is, to us so full of vivid and
-terrible memories. It was almost impossible to believe that the
-things which we had seen with our own eyes and heard with our own ears
-were living truths. Every trace of all that had been was blotted
-out. The castle stood as before, reared high above a waste of
-desolation.
-
-When we got home we were talking of the old time, which we could all
-look back on without despair, for Godalming and Seward are both
-happily married. I took the papers from the safe where they had been
-ever since our return so long ago. We were struck with the fact, that
-in all the mass of material of which the record is composed, there is
-hardly one authentic document. Nothing but a mass of typewriting,
-except the later notebooks of Mina and Seward and myself, and Van
-Helsing's memorandum. We could hardly ask any one, even did we wish
-to, to accept these as proofs of so wild a story. Van Helsing summed
-it all up as he said, with our boy on his knee.
-
-"We want no proofs. We ask none to believe us! This boy will some
-day know what a brave and gallant woman his mother is. Already he
-knows her sweetness and loving care. Later on he will understand how
-some men so loved her, that they did dare much for her sake."
-
-JONATHAN HARKER
-
-
-
-
-
-
-
-
-
-End of the Project Gutenberg EBook of Dracula, by Bram Stoker
-
-*** END OF THIS PROJECT GUTENBERG EBOOK DRACULA ***
-
-***** This file should be named 345.txt or 345.zip *****
-This and all associated files of various formats will be found in:
- http://www.gutenberg.org/3/4/345/
-
-
-
-Updated editions will replace the previous one--the old editions
-will be renamed.
-
-Creating the works from public domain print editions means that no
-one owns a United States copyright in these works, so the Foundation
-(and you!) can copy and distribute it in the United States without
-permission and without paying copyright royalties. Special rules,
-set forth in the General Terms of Use part of this license, apply to
-copying and distributing Project Gutenberg-tm electronic works to
-protect the PROJECT GUTENBERG-tm concept and trademark. Project
-Gutenberg is a registered trademark, and may not be used if you
-charge for the eBooks, unless you receive specific permission. If you
-do not charge anything for copies of this eBook, complying with the
-rules is very easy. You may use this eBook for nearly any purpose
-such as creation of derivative works, reports, performances and
-research. They may be modified and printed and given away--you may do
-practically ANYTHING with public domain eBooks. Redistribution is
-subject to the trademark license, especially commercial
-redistribution.
-
-
-
-*** START: FULL LICENSE ***
-
-THE FULL PROJECT GUTENBERG LICENSE
-PLEASE READ THIS BEFORE YOU DISTRIBUTE OR USE THIS WORK
-
-To protect the Project Gutenberg-tm mission of promoting the free
-distribution of electronic works, by using or distributing this work
-(or any other work associated in any way with the phrase "Project
-Gutenberg"), you agree to comply with all the terms of the Full Project
-Gutenberg-tm License (available with this file or online at
-http://gutenberg.net/license).
-
-
-Section 1. General Terms of Use and Redistributing Project Gutenberg-tm
-electronic works
-
-1.A. By reading or using any part of this Project Gutenberg-tm
-electronic work, you indicate that you have read, understand, agree to
-and accept all the terms of this license and intellectual property
-(trademark/copyright) agreement. If you do not agree to abide by all
-the terms of this agreement, you must cease using and return or destroy
-all copies of Project Gutenberg-tm electronic works in your possession.
-If you paid a fee for obtaining a copy of or access to a Project
-Gutenberg-tm electronic work and you do not agree to be bound by the
-terms of this agreement, you may obtain a refund from the person or
-entity to whom you paid the fee as set forth in paragraph 1.E.8.
-
-1.B. "Project Gutenberg" is a registered trademark. It may only be
-used on or associated in any way with an electronic work by people who
-agree to be bound by the terms of this agreement. There are a few
-things that you can do with most Project Gutenberg-tm electronic works
-even without complying with the full terms of this agreement. See
-paragraph 1.C below. There are a lot of things you can do with Project
-Gutenberg-tm electronic works if you follow the terms of this agreement
-and help preserve free future access to Project Gutenberg-tm electronic
-works. See paragraph 1.E below.
-
-1.C. The Project Gutenberg Literary Archive Foundation ("the Foundation"
-or PGLAF), owns a compilation copyright in the collection of Project
-Gutenberg-tm electronic works. Nearly all the individual works in the
-collection are in the public domain in the United States. If an
-individual work is in the public domain in the United States and you are
-located in the United States, we do not claim a right to prevent you from
-copying, distributing, performing, displaying or creating derivative
-works based on the work as long as all references to Project Gutenberg
-are removed. Of course, we hope that you will support the Project
-Gutenberg-tm mission of promoting free access to electronic works by
-freely sharing Project Gutenberg-tm works in compliance with the terms of
-this agreement for keeping the Project Gutenberg-tm name associated with
-the work. You can easily comply with the terms of this agreement by
-keeping this work in the same format with its attached full Project
-Gutenberg-tm License when you share it without charge with others.
-
-1.D. The copyright laws of the place where you are located also govern
-what you can do with this work. Copyright laws in most countries are in
-a constant state of change. If you are outside the United States, check
-the laws of your country in addition to the terms of this agreement
-before downloading, copying, displaying, performing, distributing or
-creating derivative works based on this work or any other Project
-Gutenberg-tm work. The Foundation makes no representations concerning
-the copyright status of any work in any country outside the United
-States.
-
-1.E. Unless you have removed all references to Project Gutenberg:
-
-1.E.1. The following sentence, with active links to, or other immediate
-access to, the full Project Gutenberg-tm License must appear prominently
-whenever any copy of a Project Gutenberg-tm work (any work on which the
-phrase "Project Gutenberg" appears, or with which the phrase "Project
-Gutenberg" is associated) is accessed, displayed, performed, viewed,
-copied or distributed:
-
-This eBook is for the use of anyone anywhere at no cost and with
-almost no restrictions whatsoever. You may copy it, give it away or
-re-use it under the terms of the Project Gutenberg License included
-with this eBook or online at www.gutenberg.net
-
-1.E.2. If an individual Project Gutenberg-tm electronic work is derived
-from the public domain (does not contain a notice indicating that it is
-posted with permission of the copyright holder), the work can be copied
-and distributed to anyone in the United States without paying any fees
-or charges. If you are redistributing or providing access to a work
-with the phrase "Project Gutenberg" associated with or appearing on the
-work, you must comply either with the requirements of paragraphs 1.E.1
-through 1.E.7 or obtain permission for the use of the work and the
-Project Gutenberg-tm trademark as set forth in paragraphs 1.E.8 or
-1.E.9.
-
-1.E.3. If an individual Project Gutenberg-tm electronic work is posted
-with the permission of the copyright holder, your use and distribution
-must comply with both paragraphs 1.E.1 through 1.E.7 and any additional
-terms imposed by the copyright holder. Additional terms will be linked
-to the Project Gutenberg-tm License for all works posted with the
-permission of the copyright holder found at the beginning of this work.
-
-1.E.4. Do not unlink or detach or remove the full Project Gutenberg-tm
-License terms from this work, or any files containing a part of this
-work or any other work associated with Project Gutenberg-tm.
-
-1.E.5. Do not copy, display, perform, distribute or redistribute this
-electronic work, or any part of this electronic work, without
-prominently displaying the sentence set forth in paragraph 1.E.1 with
-active links or immediate access to the full terms of the Project
-Gutenberg-tm License.
-
-1.E.6. You may convert to and distribute this work in any binary,
-compressed, marked up, nonproprietary or proprietary form, including any
-word processing or hypertext form. However, if you provide access to or
-distribute copies of a Project Gutenberg-tm work in a format other than
-"Plain Vanilla ASCII" or other format used in the official version
-posted on the official Project Gutenberg-tm web site (www.gutenberg.net),
-you must, at no additional cost, fee or expense to the user, provide a
-copy, a means of exporting a copy, or a means of obtaining a copy upon
-request, of the work in its original "Plain Vanilla ASCII" or other
-form. Any alternate format must include the full Project Gutenberg-tm
-License as specified in paragraph 1.E.1.
-
-1.E.7. Do not charge a fee for access to, viewing, displaying,
-performing, copying or distributing any Project Gutenberg-tm works
-unless you comply with paragraph 1.E.8 or 1.E.9.
-
-1.E.8. You may charge a reasonable fee for copies of or providing
-access to or distributing Project Gutenberg-tm electronic works provided
-that
-
-- You pay a royalty fee of 20% of the gross profits you derive from
- the use of Project Gutenberg-tm works calculated using the method
- you already use to calculate your applicable taxes. The fee is
- owed to the owner of the Project Gutenberg-tm trademark, but he
- has agreed to donate royalties under this paragraph to the
- Project Gutenberg Literary Archive Foundation. Royalty payments
- must be paid within 60 days following each date on which you
- prepare (or are legally required to prepare) your periodic tax
- returns. Royalty payments should be clearly marked as such and
- sent to the Project Gutenberg Literary Archive Foundation at the
- address specified in Section 4, "Information about donations to
- the Project Gutenberg Literary Archive Foundation."
-
-- You provide a full refund of any money paid by a user who notifies
- you in writing (or by e-mail) within 30 days of receipt that s/he
- does not agree to the terms of the full Project Gutenberg-tm
- License. You must require such a user to return or
- destroy all copies of the works possessed in a physical medium
- and discontinue all use of and all access to other copies of
- Project Gutenberg-tm works.
-
-- You provide, in accordance with paragraph 1.F.3, a full refund of any
- money paid for a work or a replacement copy, if a defect in the
- electronic work is discovered and reported to you within 90 days
- of receipt of the work.
-
-- You comply with all other terms of this agreement for free
- distribution of Project Gutenberg-tm works.
-
-1.E.9. If you wish to charge a fee or distribute a Project Gutenberg-tm
-electronic work or group of works on different terms than are set
-forth in this agreement, you must obtain permission in writing from
-both the Project Gutenberg Literary Archive Foundation and Michael
-Hart, the owner of the Project Gutenberg-tm trademark. Contact the
-Foundation as set forth in Section 3 below.
-
-1.F.
-
-1.F.1. Project Gutenberg volunteers and employees expend considerable
-effort to identify, do copyright research on, transcribe and proofread
-public domain works in creating the Project Gutenberg-tm
-collection. Despite these efforts, Project Gutenberg-tm electronic
-works, and the medium on which they may be stored, may contain
-"Defects," such as, but not limited to, incomplete, inaccurate or
-corrupt data, transcription errors, a copyright or other intellectual
-property infringement, a defective or damaged disk or other medium, a
-computer virus, or computer codes that damage or cannot be read by
-your equipment.
-
-1.F.2. LIMITED WARRANTY, DISCLAIMER OF DAMAGES - Except for the "Right
-of Replacement or Refund" described in paragraph 1.F.3, the Project
-Gutenberg Literary Archive Foundation, the owner of the Project
-Gutenberg-tm trademark, and any other party distributing a Project
-Gutenberg-tm electronic work under this agreement, disclaim all
-liability to you for damages, costs and expenses, including legal
-fees. YOU AGREE THAT YOU HAVE NO REMEDIES FOR NEGLIGENCE, STRICT
-LIABILITY, BREACH OF WARRANTY OR BREACH OF CONTRACT EXCEPT THOSE
-PROVIDED IN PARAGRAPH F3. YOU AGREE THAT THE FOUNDATION, THE
-TRADEMARK OWNER, AND ANY DISTRIBUTOR UNDER THIS AGREEMENT WILL NOT BE
-LIABLE TO YOU FOR ACTUAL, DIRECT, INDIRECT, CONSEQUENTIAL, PUNITIVE OR
-INCIDENTAL DAMAGES EVEN IF YOU GIVE NOTICE OF THE POSSIBILITY OF SUCH
-DAMAGE.
-
-1.F.3. LIMITED RIGHT OF REPLACEMENT OR REFUND - If you discover a
-defect in this electronic work within 90 days of receiving it, you can
-receive a refund of the money (if any) you paid for it by sending a
-written explanation to the person you received the work from. If you
-received the work on a physical medium, you must return the medium with
-your written explanation. The person or entity that provided you with
-the defective work may elect to provide a replacement copy in lieu of a
-refund. If you received the work electronically, the person or entity
-providing it to you may choose to give you a second opportunity to
-receive the work electronically in lieu of a refund. If the second copy
-is also defective, you may demand a refund in writing without further
-opportunities to fix the problem.
-
-1.F.4. Except for the limited right of replacement or refund set forth
-in paragraph 1.F.3, this work is provided to you 'AS-IS' WITH NO OTHER
-WARRANTIES OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO
-WARRANTIES OF MERCHANTIBILITY OR FITNESS FOR ANY PURPOSE.
-
-1.F.5. Some states do not allow disclaimers of certain implied
-warranties or the exclusion or limitation of certain types of damages.
-If any disclaimer or limitation set forth in this agreement violates the
-law of the state applicable to this agreement, the agreement shall be
-interpreted to make the maximum disclaimer or limitation permitted by
-the applicable state law. The invalidity or unenforceability of any
-provision of this agreement shall not void the remaining provisions.
-
-1.F.6. INDEMNITY - You agree to indemnify and hold the Foundation, the
-trademark owner, any agent or employee of the Foundation, anyone
-providing copies of Project Gutenberg-tm electronic works in accordance
-with this agreement, and any volunteers associated with the production,
-promotion and distribution of Project Gutenberg-tm electronic works,
-harmless from all liability, costs and expenses, including legal fees,
-that arise directly or indirectly from any of the following which you do
-or cause to occur: (a) distribution of this or any Project Gutenberg-tm
-work, (b) alteration, modification, or additions or deletions to any
-Project Gutenberg-tm work, and (c) any Defect you cause.
-
-
-Section 2. Information about the Mission of Project Gutenberg-tm
-
-Project Gutenberg-tm is synonymous with the free distribution of
-electronic works in formats readable by the widest variety of computers
-including obsolete, old, middle-aged and new computers. It exists
-because of the efforts of hundreds of volunteers and donations from
-people in all walks of life.
-
-Volunteers and financial support to provide volunteers with the
-assistance they need, is critical to reaching Project Gutenberg-tm's
-goals and ensuring that the Project Gutenberg-tm collection will
-remain freely available for generations to come. In 2001, the Project
-Gutenberg Literary Archive Foundation was created to provide a secure
-and permanent future for Project Gutenberg-tm and future generations.
-To learn more about the Project Gutenberg Literary Archive Foundation
-and how your efforts and donations can help, see Sections 3 and 4
-and the Foundation web page at http://www.pglaf.org.
-
-
-Section 3. Information about the Project Gutenberg Literary Archive
-Foundation
-
-The Project Gutenberg Literary Archive Foundation is a non profit
-501(c)(3) educational corporation organized under the laws of the
-state of Mississippi and granted tax exempt status by the Internal
-Revenue Service. The Foundation's EIN or federal tax identification
-number is 64-6221541. Its 501(c)(3) letter is posted at
-http://pglaf.org/fundraising. Contributions to the Project Gutenberg
-Literary Archive Foundation are tax deductible to the full extent
-permitted by U.S. federal laws and your state's laws.
-
-The Foundation's principal office is located at 4557 Melan Dr. S.
-Fairbanks, AK, 99712., but its volunteers and employees are scattered
-throughout numerous locations. Its business office is located at
-809 North 1500 West, Salt Lake City, UT 84116, (801) 596-1887, email
-business@pglaf.org. Email contact links and up to date contact
-information can be found at the Foundation's web site and official
-page at http://pglaf.org
-
-For additional contact information:
- Dr. Gregory B. Newby
- Chief Executive and Director
- gbnewby@pglaf.org
-
-
-Section 4. Information about Donations to the Project Gutenberg
-Literary Archive Foundation
-
-Project Gutenberg-tm depends upon and cannot survive without wide
-spread public support and donations to carry out its mission of
-increasing the number of public domain and licensed works that can be
-freely distributed in machine readable form accessible by the widest
-array of equipment including outdated equipment. Many small donations
-($1 to $5,000) are particularly important to maintaining tax exempt
-status with the IRS.
-
-The Foundation is committed to complying with the laws regulating
-charities and charitable donations in all 50 states of the United
-States. Compliance requirements are not uniform and it takes a
-considerable effort, much paperwork and many fees to meet and keep up
-with these requirements. We do not solicit donations in locations
-where we have not received written confirmation of compliance. To
-SEND DONATIONS or determine the status of compliance for any
-particular state visit http://pglaf.org
-
-While we cannot and do not solicit contributions from states where we
-have not met the solicitation requirements, we know of no prohibition
-against accepting unsolicited donations from donors in such states who
-approach us with offers to donate.
-
-International donations are gratefully accepted, but we cannot make
-any statements concerning tax treatment of donations received from
-outside the United States. U.S. laws alone swamp our small staff.
-
-Please check the Project Gutenberg Web pages for current donation
-methods and addresses. Donations are accepted in a number of other
-ways including including checks, online payments and credit card
-donations. To donate, please visit: http://pglaf.org/donate
-
-
-Section 5. General Information About Project Gutenberg-tm electronic
-works.
-
-Professor Michael S. Hart is the originator of the Project Gutenberg-tm
-concept of a library of electronic works that could be freely shared
-with anyone. For thirty years, he produced and distributed Project
-Gutenberg-tm eBooks with only a loose network of volunteer support.
-
-
-Project Gutenberg-tm eBooks are often created from several printed
-editions, all of which are confirmed as Public Domain in the U.S.
-unless a copyright notice is included. Thus, we do not necessarily
-keep eBooks in compliance with any particular paper edition.
-
-
-Most people start at our Web site which has the main PG search facility:
-
- http://www.gutenberg.net
-
-This Web site includes information about Project Gutenberg-tm,
-including how to make donations to the Project Gutenberg Literary
-Archive Foundation, how to help produce our new eBooks, and how to
-subscribe to our email newsletter to hear about new eBooks.
diff --git a/android/examples/Topics/Advanced Data/HashMapClass/data/hamlet.txt b/android/examples/Topics/Advanced Data/HashMapClass/data/hamlet.txt
deleted file mode 100644
index eb151b8d05..0000000000
--- a/android/examples/Topics/Advanced Data/HashMapClass/data/hamlet.txt
+++ /dev/null
@@ -1,6771 +0,0 @@
-HAMLET, PRINCE OF DENMARK
-
-by William Shakespeare
-
-
-
-
-PERSONS REPRESENTED.
-
-Claudius, King of Denmark.
-Hamlet, Son to the former, and Nephew to the present King.
-Polonius, Lord Chamberlain.
-Horatio, Friend to Hamlet.
-Laertes, Son to Polonius.
-Voltimand, Courtier.
-Cornelius, Courtier.
-Rosencrantz, Courtier.
-Guildenstern, Courtier.
-Osric, Courtier.
-A Gentleman, Courtier.
-A Priest.
-Marcellus, Officer.
-Bernardo, Officer.
-Francisco, a Soldier
-Reynaldo, Servant to Polonius.
-Players.
-Two Clowns, Grave-diggers.
-Fortinbras, Prince of Norway.
-A Captain.
-English Ambassadors.
-Ghost of Hamlet's Father.
-
-Gertrude, Queen of Denmark, and Mother of Hamlet.
-Ophelia, Daughter to Polonius.
-
-Lords, Ladies, Officers, Soldiers, Sailors, Messengers, and other
-Attendants.
-
-SCENE. Elsinore.
-
-
-
-ACT I.
-
-Scene I. Elsinore. A platform before the Castle.
-
-[Francisco at his post. Enter to him Bernardo.]
-
-Ber.
-Who's there?
-
-Fran.
-Nay, answer me: stand, and unfold yourself.
-
-Ber.
-Long live the king!
-
-Fran.
-Bernardo?
-
-Ber.
-He.
-
-Fran.
-You come most carefully upon your hour.
-
-Ber.
-'Tis now struck twelve. Get thee to bed, Francisco.
-
-Fran.
-For this relief much thanks: 'tis bitter cold,
-And I am sick at heart.
-
-Ber.
-Have you had quiet guard?
-
-Fran.
-Not a mouse stirring.
-
-Ber.
-Well, good night.
-If you do meet Horatio and Marcellus,
-The rivals of my watch, bid them make haste.
-
-Fran.
-I think I hear them.--Stand, ho! Who is there?
-
-[Enter Horatio and Marcellus.]
-
-Hor.
-Friends to this ground.
-
-Mar.
-And liegemen to the Dane.
-
-Fran.
-Give you good-night.
-
-Mar.
-O, farewell, honest soldier;
-Who hath reliev'd you?
-
-Fran.
-Bernardo has my place.
-Give you good-night.
-
-[Exit.]
-
-Mar.
-Holla! Bernardo!
-
-Ber.
-Say.
-What, is Horatio there?
-
-Hor.
-A piece of him.
-
-Ber.
-Welcome, Horatio:--Welcome, good Marcellus.
-
-Mar.
-What, has this thing appear'd again to-night?
-
-Ber.
-I have seen nothing.
-
-Mar.
-Horatio says 'tis but our fantasy,
-And will not let belief take hold of him
-Touching this dreaded sight, twice seen of us:
-Therefore I have entreated him along
-With us to watch the minutes of this night;
-That, if again this apparition come
-He may approve our eyes and speak to it.
-
-Hor.
-Tush, tush, 'twill not appear.
-
-Ber.
-Sit down awhile,
-And let us once again assail your ears,
-That are so fortified against our story,
-What we two nights have seen.
-
-Hor.
-Well, sit we down,
-And let us hear Bernardo speak of this.
-
-Ber.
-Last night of all,
-When yond same star that's westward from the pole
-Had made his course to illume that part of heaven
-Where now it burns, Marcellus and myself,
-The bell then beating one,--
-
-Mar.
-Peace, break thee off; look where it comes again!
-
-[Enter Ghost, armed.]
-
-Ber.
-In the same figure, like the king that's dead.
-
-Mar.
-Thou art a scholar; speak to it, Horatio.
-
-Ber.
-Looks it not like the King? mark it, Horatio.
-
-Hor.
-Most like:--it harrows me with fear and wonder.
-
-Ber.
-It would be spoke to.
-
-Mar.
-Question it, Horatio.
-
-Hor.
-What art thou, that usurp'st this time of night,
-Together with that fair and warlike form
-In which the majesty of buried Denmark
-Did sometimes march? By heaven I charge thee, speak!
-
-Mar.
-It is offended.
-
-Ber.
-See, it stalks away!
-
-Hor.
-Stay! speak, speak! I charge thee speak!
-
-[Exit Ghost.]
-
-Mar.
-'Tis gone, and will not answer.
-
-Ber.
-How now, Horatio! You tremble and look pale:
-Is not this something more than fantasy?
-What think you on't?
-
-Hor.
-Before my God, I might not this believe
-Without the sensible and true avouch
-Of mine own eyes.
-
-Mar.
-Is it not like the King?
-
-Hor.
-As thou art to thyself:
-Such was the very armour he had on
-When he the ambitious Norway combated;
-So frown'd he once when, in an angry parle,
-He smote the sledded Polacks on the ice.
-'Tis strange.
-
-Mar.
-Thus twice before, and jump at this dead hour,
-With martial stalk hath he gone by our watch.
-
-Hor.
-In what particular thought to work I know not;
-But, in the gross and scope of my opinion,
-This bodes some strange eruption to our state.
-
-Mar.
-Good now, sit down, and tell me, he that knows,
-Why this same strict and most observant watch
-So nightly toils the subject of the land;
-And why such daily cast of brazen cannon,
-And foreign mart for implements of war;
-Why such impress of shipwrights, whose sore task
-Does not divide the Sunday from the week;
-What might be toward, that this sweaty haste
-Doth make the night joint-labourer with the day:
-Who is't that can inform me?
-
-Hor.
-That can I;
-At least, the whisper goes so. Our last king,
-Whose image even but now appear'd to us,
-Was, as you know, by Fortinbras of Norway,
-Thereto prick'd on by a most emulate pride,
-Dar'd to the combat; in which our valiant Hamlet,--
-For so this side of our known world esteem'd him,--
-Did slay this Fortinbras; who, by a seal'd compact,
-Well ratified by law and heraldry,
-Did forfeit, with his life, all those his lands,
-Which he stood seiz'd of, to the conqueror:
-Against the which, a moiety competent
-Was gaged by our king; which had return'd
-To the inheritance of Fortinbras,
-Had he been vanquisher; as by the same cov'nant,
-And carriage of the article design'd,
-His fell to Hamlet. Now, sir, young Fortinbras,
-Of unimproved mettle hot and full,
-Hath in the skirts of Norway, here and there,
-Shark'd up a list of lawless resolutes,
-For food and diet, to some enterprise
-That hath a stomach in't; which is no other,--
-As it doth well appear unto our state,--
-But to recover of us, by strong hand,
-And terms compulsatory, those foresaid lands
-So by his father lost: and this, I take it,
-Is the main motive of our preparations,
-The source of this our watch, and the chief head
-Of this post-haste and romage in the land.
-
-Ber.
-I think it be no other but e'en so:
-Well may it sort, that this portentous figure
-Comes armed through our watch; so like the king
-That was and is the question of these wars.
-
-Hor.
-A mote it is to trouble the mind's eye.
-In the most high and palmy state of Rome,
-A little ere the mightiest Julius fell,
-The graves stood tenantless, and the sheeted dead
-Did squeak and gibber in the Roman streets;
-As, stars with trains of fire and dews of blood,
-Disasters in the sun; and the moist star,
-Upon whose influence Neptune's empire stands,
-Was sick almost to doomsday with eclipse:
-And even the like precurse of fierce events,--
-As harbingers preceding still the fates,
-And prologue to the omen coming on,--
-Have heaven and earth together demonstrated
-Unto our climature and countrymen.--
-But, soft, behold! lo, where it comes again!
-
-[Re-enter Ghost.]
-
-I'll cross it, though it blast me.--Stay, illusion!
-If thou hast any sound, or use of voice,
-Speak to me:
-If there be any good thing to be done,
-That may to thee do ease, and, race to me,
-Speak to me:
-If thou art privy to thy country's fate,
-Which, happily, foreknowing may avoid,
-O, speak!
-Or if thou hast uphoarded in thy life
-Extorted treasure in the womb of earth,
-For which, they say, you spirits oft walk in death,
-[The cock crows.]
-Speak of it:--stay, and speak!--Stop it, Marcellus!
-
-Mar.
-Shall I strike at it with my partisan?
-
-Hor.
-Do, if it will not stand.
-
-Ber.
-'Tis here!
-
-Hor.
-'Tis here!
-
-Mar.
-'Tis gone!
-
-[Exit Ghost.]
-
-We do it wrong, being so majestical,
-To offer it the show of violence;
-For it is, as the air, invulnerable,
-And our vain blows malicious mockery.
-
-Ber.
-It was about to speak, when the cock crew.
-
-Hor.
-And then it started, like a guilty thing
-Upon a fearful summons. I have heard
-The cock, that is the trumpet to the morn,
-Doth with his lofty and shrill-sounding throat
-Awake the god of day; and at his warning,
-Whether in sea or fire, in earth or air,
-The extravagant and erring spirit hies
-To his confine: and of the truth herein
-This present object made probation.
-
-Mar.
-It faded on the crowing of the cock.
-Some say that ever 'gainst that season comes
-Wherein our Saviour's birth is celebrated,
-The bird of dawning singeth all night long;
-And then, they say, no spirit dare stir abroad;
-The nights are wholesome; then no planets strike,
-No fairy takes, nor witch hath power to charm;
-So hallow'd and so gracious is the time.
-
-Hor.
-So have I heard, and do in part believe it.
-But, look, the morn, in russet mantle clad,
-Walks o'er the dew of yon high eastward hill:
-Break we our watch up: and by my advice,
-Let us impart what we have seen to-night
-Unto young Hamlet; for, upon my life,
-This spirit, dumb to us, will speak to him:
-Do you consent we shall acquaint him with it,
-As needful in our loves, fitting our duty?
-
-Mar.
-Let's do't, I pray; and I this morning know
-Where we shall find him most conveniently.
-
-[Exeunt.]
-
-
-
-Scene II. Elsinore. A room of state in the Castle.
-
-[Enter the King, Queen, Hamlet, Polonius, Laertes, Voltimand,
-Cornelius, Lords, and Attendant.]
-
-King.
-Though yet of Hamlet our dear brother's death
-The memory be green, and that it us befitted
-To bear our hearts in grief, and our whole kingdom
-To be contracted in one brow of woe;
-Yet so far hath discretion fought with nature
-That we with wisest sorrow think on him,
-Together with remembrance of ourselves.
-Therefore our sometime sister, now our queen,
-Th' imperial jointress to this warlike state,
-Have we, as 'twere with a defeated joy,--
-With an auspicious and one dropping eye,
-With mirth in funeral, and with dirge in marriage,
-In equal scale weighing delight and dole,--
-Taken to wife; nor have we herein barr'd
-Your better wisdoms, which have freely gone
-With this affair along:--or all, our thanks.
-Now follows, that you know, young Fortinbras,
-Holding a weak supposal of our worth,
-Or thinking by our late dear brother's death
-Our state to be disjoint and out of frame,
-Colleagued with this dream of his advantage,
-He hath not fail'd to pester us with message,
-Importing the surrender of those lands
-Lost by his father, with all bonds of law,
-To our most valiant brother. So much for him,--
-Now for ourself and for this time of meeting:
-Thus much the business is:--we have here writ
-To Norway, uncle of young Fortinbras,--
-Who, impotent and bed-rid, scarcely hears
-Of this his nephew's purpose,--to suppress
-His further gait herein; in that the levies,
-The lists, and full proportions are all made
-Out of his subject:--and we here dispatch
-You, good Cornelius, and you, Voltimand,
-For bearers of this greeting to old Norway;
-Giving to you no further personal power
-To business with the king, more than the scope
-Of these dilated articles allow.
-Farewell; and let your haste commend your duty.
-
-Cor. and Volt.
-In that and all things will we show our duty.
-
-King.
-We doubt it nothing: heartily farewell.
-
-[Exeunt Voltimand and Cornelius.]
-
-And now, Laertes, what's the news with you?
-You told us of some suit; what is't, Laertes?
-You cannot speak of reason to the Dane,
-And lose your voice: what wouldst thou beg, Laertes,
-That shall not be my offer, not thy asking?
-The head is not more native to the heart,
-The hand more instrumental to the mouth,
-Than is the throne of Denmark to thy father.
-What wouldst thou have, Laertes?
-
-Laer.
-Dread my lord,
-Your leave and favour to return to France;
-From whence though willingly I came to Denmark,
-To show my duty in your coronation;
-Yet now, I must confess, that duty done,
-My thoughts and wishes bend again toward France,
-And bow them to your gracious leave and pardon.
-
-King.
-Have you your father's leave? What says Polonius?
-
-Pol.
-He hath, my lord, wrung from me my slow leave
-By laboursome petition; and at last
-Upon his will I seal'd my hard consent:
-I do beseech you, give him leave to go.
-
-King.
-Take thy fair hour, Laertes; time be thine,
-And thy best graces spend it at thy will!--
-But now, my cousin Hamlet, and my son--
-
-Ham.
-[Aside.] A little more than kin, and less than kind!
-
-King.
-How is it that the clouds still hang on you?
-
-Ham.
-Not so, my lord; I am too much i' the sun.
-
-Queen.
-Good Hamlet, cast thy nighted colour off,
-And let thine eye look like a friend on Denmark.
-Do not for ever with thy vailed lids
-Seek for thy noble father in the dust:
-Thou know'st 'tis common,--all that lives must die,
-Passing through nature to eternity.
-
-Ham.
-Ay, madam, it is common.
-
-Queen.
-If it be,
-Why seems it so particular with thee?
-
-Ham.
-Seems, madam! Nay, it is; I know not seems.
-'Tis not alone my inky cloak, good mother,
-Nor customary suits of solemn black,
-Nor windy suspiration of forc'd breath,
-No, nor the fruitful river in the eye,
-Nor the dejected 'havior of the visage,
-Together with all forms, moods, shows of grief,
-That can denote me truly: these, indeed, seem;
-For they are actions that a man might play;
-But I have that within which passeth show;
-These but the trappings and the suits of woe.
-
-King.
-'Tis sweet and commendable in your nature, Hamlet,
-To give these mourning duties to your father;
-But, you must know, your father lost a father;
-That father lost, lost his; and the survivor bound,
-In filial obligation, for some term
-To do obsequious sorrow: but to persevere
-In obstinate condolement is a course
-Of impious stubbornness; 'tis unmanly grief;
-It shows a will most incorrect to heaven;
-A heart unfortified, a mind impatient;
-An understanding simple and unschool'd;
-For what we know must be, and is as common
-As any the most vulgar thing to sense,
-Why should we, in our peevish opposition,
-Take it to heart? Fie! 'tis a fault to heaven,
-A fault against the dead, a fault to nature,
-To reason most absurd; whose common theme
-Is death of fathers, and who still hath cried,
-From the first corse till he that died to-day,
-'This must be so.' We pray you, throw to earth
-This unprevailing woe; and think of us
-As of a father: for let the world take note
-You are the most immediate to our throne;
-And with no less nobility of love
-Than that which dearest father bears his son
-Do I impart toward you. For your intent
-In going back to school in Wittenberg,
-It is most retrograde to our desire:
-And we beseech you bend you to remain
-Here in the cheer and comfort of our eye,
-Our chiefest courtier, cousin, and our son.
-
-Queen.
-Let not thy mother lose her prayers, Hamlet:
-I pray thee stay with us; go not to Wittenberg.
-
-Ham.
-I shall in all my best obey you, madam.
-
-King.
-Why, 'tis a loving and a fair reply:
-Be as ourself in Denmark.--Madam, come;
-This gentle and unforc'd accord of Hamlet
-Sits smiling to my heart: in grace whereof,
-No jocund health that Denmark drinks to-day
-But the great cannon to the clouds shall tell;
-And the king's rouse the heaven shall bruit again,
-Re-speaking earthly thunder. Come away.
-
-[Exeunt all but Hamlet.]
-
-Ham.
-O that this too too solid flesh would melt,
-Thaw, and resolve itself into a dew!
-Or that the Everlasting had not fix'd
-His canon 'gainst self-slaughter! O God! O God!
-How weary, stale, flat, and unprofitable
-Seem to me all the uses of this world!
-Fie on't! O fie! 'tis an unweeded garden,
-That grows to seed; things rank and gross in nature
-Possess it merely. That it should come to this!
-But two months dead!--nay, not so much, not two:
-So excellent a king; that was, to this,
-Hyperion to a satyr; so loving to my mother,
-That he might not beteem the winds of heaven
-Visit her face too roughly. Heaven and earth!
-Must I remember? Why, she would hang on him
-As if increase of appetite had grown
-By what it fed on: and yet, within a month,--
-Let me not think on't,--Frailty, thy name is woman!--
-A little month; or ere those shoes were old
-With which she followed my poor father's body
-Like Niobe, all tears;--why she, even she,--
-O God! a beast that wants discourse of reason,
-Would have mourn'd longer,--married with mine uncle,
-My father's brother; but no more like my father
-Than I to Hercules: within a month;
-Ere yet the salt of most unrighteous tears
-Had left the flushing in her galled eyes,
-She married:-- O, most wicked speed, to post
-With such dexterity to incestuous sheets!
-It is not, nor it cannot come to good;
-But break my heart,--for I must hold my tongue!
-
-[Enter Horatio, Marcellus, and Bernardo.]
-
-Hor.
-Hail to your lordship!
-
-Ham.
-I am glad to see you well:
-Horatio,--or I do forget myself.
-
-Hor.
-The same, my lord, and your poor servant ever.
-
-Ham.
-Sir, my good friend; I'll change that name with you:
-And what make you from Wittenberg, Horatio?--
-Marcellus?
-
-Mar.
-My good lord,--
-
-Ham.
-I am very glad to see you.--Good even, sir.--
-But what, in faith, make you from Wittenberg?
-
-Hor.
-A truant disposition, good my lord.
-
-Ham.
-I would not hear your enemy say so;
-Nor shall you do my ear that violence,
-To make it truster of your own report
-Against yourself: I know you are no truant.
-But what is your affair in Elsinore?
-We'll teach you to drink deep ere you depart.
-
-Hor.
-My lord, I came to see your father's funeral.
-
-Ham.
-I prithee do not mock me, fellow-student.
-I think it was to see my mother's wedding.
-
-Hor.
-Indeed, my lord, it follow'd hard upon.
-
-Ham.
-Thrift, thrift, Horatio! The funeral bak'd meats
-Did coldly furnish forth the marriage tables.
-Would I had met my dearest foe in heaven
-Or ever I had seen that day, Horatio!--
-My father,--methinks I see my father.
-
-Hor.
-Where, my lord?
-
-Ham.
-In my mind's eye, Horatio.
-
-Hor.
-I saw him once; he was a goodly king.
-
-Ham.
-He was a man, take him for all in all,
-I shall not look upon his like again.
-
-Hor.
-My lord, I think I saw him yesternight.
-
-Ham.
-Saw who?
-
-Hor.
-My lord, the king your father.
-
-Ham.
-The King my father!
-
-Hor.
-Season your admiration for awhile
-With an attent ear, till I may deliver,
-Upon the witness of these gentlemen,
-This marvel to you.
-
-Ham.
-For God's love let me hear.
-
-Hor.
-Two nights together had these gentlemen,
-Marcellus and Bernardo, on their watch
-In the dead vast and middle of the night,
-Been thus encounter'd. A figure like your father,
-Armed at point exactly, cap-a-pe,
-Appears before them and with solemn march
-Goes slow and stately by them: thrice he walk'd
-By their oppress'd and fear-surprised eyes,
-Within his truncheon's length; whilst they, distill'd
-Almost to jelly with the act of fear,
-Stand dumb, and speak not to him. This to me
-In dreadful secrecy impart they did;
-And I with them the third night kept the watch:
-Where, as they had deliver'd, both in time,
-Form of the thing, each word made true and good,
-The apparition comes: I knew your father;
-These hands are not more like.
-
-Ham.
-But where was this?
-
-Mar.
-My lord, upon the platform where we watch'd.
-
-Ham.
-Did you not speak to it?
-
-Hor.
-My lord, I did;
-But answer made it none: yet once methought
-It lifted up it head, and did address
-Itself to motion, like as it would speak:
-But even then the morning cock crew loud,
-And at the sound it shrunk in haste away,
-And vanish'd from our sight.
-
-Ham.
-'Tis very strange.
-
-Hor.
-As I do live, my honour'd lord, 'tis true;
-And we did think it writ down in our duty
-To let you know of it.
-
-Ham.
-Indeed, indeed, sirs, but this troubles me.
-Hold you the watch to-night?
-
-Mar. and Ber.
-We do, my lord.
-
-Ham.
-Arm'd, say you?
-
-Both.
-Arm'd, my lord.
-
-Ham.
-From top to toe?
-
-Both.
-My lord, from head to foot.
-
-Ham.
-Then saw you not his face?
-
-Hor.
-O, yes, my lord: he wore his beaver up.
-
-Ham.
-What, look'd he frowningly?
-
-Hor.
-A countenance more in sorrow than in anger.
-
-Ham.
-Pale or red?
-
-Hor.
-Nay, very pale.
-
-Ham.
-And fix'd his eyes upon you?
-
-Hor.
-Most constantly.
-
-Ham.
-I would I had been there.
-
-Hor.
-It would have much amaz'd you.
-
-Ham.
-Very like, very like. Stay'd it long?
-
-Hor.
-While one with moderate haste might tell a hundred.
-
-Mar. and Ber.
-Longer, longer.
-
-Hor.
-Not when I saw't.
-
-Ham.
-His beard was grizzled,--no?
-
-Hor.
-It was, as I have seen it in his life,
-A sable silver'd.
-
-Ham.
-I will watch to-night;
-Perchance 'twill walk again.
-
-Hor.
-I warr'nt it will.
-
-Ham.
-If it assume my noble father's person,
-I'll speak to it, though hell itself should gape
-And bid me hold my peace. I pray you all,
-If you have hitherto conceal'd this sight,
-Let it be tenable in your silence still;
-And whatsoever else shall hap to-night,
-Give it an understanding, but no tongue:
-I will requite your loves. So, fare ye well:
-Upon the platform, 'twixt eleven and twelve,
-I'll visit you.
-
-All.
-Our duty to your honour.
-
-Ham.
-Your loves, as mine to you: farewell.
-
-[Exeunt Horatio, Marcellus, and Bernardo.]
-
-My father's spirit in arms! All is not well;
-I doubt some foul play: would the night were come!
-Till then sit still, my soul: foul deeds will rise,
-Though all the earth o'erwhelm them, to men's eyes.
-
-[Exit.]
-
-
-
-Scene III. A room in Polonius's house.
-
-[Enter Laertes and Ophelia.]
-
-Laer.
-My necessaries are embark'd: farewell:
-And, sister, as the winds give benefit
-And convoy is assistant, do not sleep,
-But let me hear from you.
-
-Oph.
-Do you doubt that?
-
-Laer.
-For Hamlet, and the trifling of his favour,
-Hold it a fashion, and a toy in blood:
-A violet in the youth of primy nature,
-Forward, not permanent, sweet, not lasting;
-The perfume and suppliance of a minute;
-No more.
-
-Oph.
-No more but so?
-
-Laer.
-Think it no more:
-For nature, crescent, does not grow alone
-In thews and bulk; but as this temple waxes,
-The inward service of the mind and soul
-Grows wide withal. Perhaps he loves you now;
-And now no soil nor cautel doth besmirch
-The virtue of his will: but you must fear,
-His greatness weigh'd, his will is not his own;
-For he himself is subject to his birth:
-He may not, as unvalu'd persons do,
-Carve for himself; for on his choice depends
-The safety and health of this whole state;
-And therefore must his choice be circumscrib'd
-Unto the voice and yielding of that body
-Whereof he is the head. Then if he says he loves you,
-It fits your wisdom so far to believe it
-As he in his particular act and place
-May give his saying deed; which is no further
-Than the main voice of Denmark goes withal.
-Then weigh what loss your honour may sustain
-If with too credent ear you list his songs,
-Or lose your heart, or your chaste treasure open
-To his unmaster'd importunity.
-Fear it, Ophelia, fear it, my dear sister;
-And keep you in the rear of your affection,
-Out of the shot and danger of desire.
-The chariest maid is prodigal enough
-If she unmask her beauty to the moon:
-Virtue itself scopes not calumnious strokes:
-The canker galls the infants of the spring
-Too oft before their buttons be disclos'd:
-And in the morn and liquid dew of youth
-Contagious blastments are most imminent.
-Be wary then; best safety lies in fear:
-Youth to itself rebels, though none else near.
-
-Oph.
-I shall th' effect of this good lesson keep
-As watchman to my heart. But, good my brother,
-Do not, as some ungracious pastors do,
-Show me the steep and thorny way to heaven;
-Whilst, like a puff'd and reckless libertine,
-Himself the primrose path of dalliance treads
-And recks not his own read.
-
-Laer.
-O, fear me not.
-I stay too long:--but here my father comes.
-
-[Enter Polonius.]
-
-A double blessing is a double grace;
-Occasion smiles upon a second leave.
-
-Pol.
-Yet here, Laertes! aboard, aboard, for shame!
-The wind sits in the shoulder of your sail,
-And you are stay'd for. There,--my blessing with thee!
-
-[Laying his hand on Laertes's head.]
-
-And these few precepts in thy memory
-Look thou character. Give thy thoughts no tongue,
-Nor any unproportion'd thought his act.
-Be thou familiar, but by no means vulgar.
-Those friends thou hast, and their adoption tried,
-Grapple them unto thy soul with hoops of steel;
-But do not dull thy palm with entertainment
-Of each new-hatch'd, unfledg'd comrade. Beware
-Of entrance to a quarrel; but, being in,
-Bear't that the opposed may beware of thee.
-Give every man thine ear, but few thy voice:
-Take each man's censure, but reserve thy judgment.
-Costly thy habit as thy purse can buy,
-But not express'd in fancy; rich, not gaudy:
-For the apparel oft proclaims the man;
-And they in France of the best rank and station
-Are most select and generous chief in that.
-Neither a borrower nor a lender be:
-For loan oft loses both itself and friend;
-And borrowing dulls the edge of husbandry.
-This above all,--to thine own self be true;
-And it must follow, as the night the day,
-Thou canst not then be false to any man.
-Farewell: my blessing season this in thee!
-
-Laer.
-Most humbly do I take my leave, my lord.
-
-Pol.
-The time invites you; go, your servants tend.
-
-Laer.
-Farewell, Ophelia; and remember well
-What I have said to you.
-
-Oph.
-'Tis in my memory lock'd,
-And you yourself shall keep the key of it.
-
-Laer.
-Farewell.
-
-[Exit.]
-
-Pol.
-What is't, Ophelia, he hath said to you?
-
-Oph.
-So please you, something touching the Lord Hamlet.
-
-Pol.
-Marry, well bethought:
-'Tis told me he hath very oft of late
-Given private time to you; and you yourself
-Have of your audience been most free and bounteous;
-If it be so,--as so 'tis put on me,
-And that in way of caution,--I must tell you
-You do not understand yourself so clearly
-As it behooves my daughter and your honour.
-What is between you? give me up the truth.
-
-Oph.
-He hath, my lord, of late made many tenders
-Of his affection to me.
-
-Pol.
-Affection! pooh! you speak like a green girl,
-Unsifted in such perilous circumstance.
-Do you believe his tenders, as you call them?
-
-Oph.
-I do not know, my lord, what I should think.
-
-Pol.
-Marry, I'll teach you: think yourself a baby;
-That you have ta'en these tenders for true pay,
-Which are not sterling. Tender yourself more dearly;
-Or,--not to crack the wind of the poor phrase,
-Wronging it thus,--you'll tender me a fool.
-
-Oph.
-My lord, he hath importun'd me with love
-In honourable fashion.
-
-Pol.
-Ay, fashion you may call it; go to, go to.
-
-Oph.
-And hath given countenance to his speech, my lord,
-With almost all the holy vows of heaven.
-
-Pol.
-Ay, springes to catch woodcocks. I do know,
-When the blood burns, how prodigal the soul
-Lends the tongue vows: these blazes, daughter,
-Giving more light than heat,--extinct in both,
-Even in their promise, as it is a-making,--
-You must not take for fire. From this time
-Be something scanter of your maiden presence;
-Set your entreatments at a higher rate
-Than a command to parley. For Lord Hamlet,
-Believe so much in him, that he is young;
-And with a larger tether may he walk
-Than may be given you: in few, Ophelia,
-Do not believe his vows; for they are brokers,--
-Not of that dye which their investments show,
-But mere implorators of unholy suits,
-Breathing like sanctified and pious bawds,
-The better to beguile. This is for all,--
-I would not, in plain terms, from this time forth
-Have you so slander any moment leisure
-As to give words or talk with the Lord Hamlet.
-Look to't, I charge you; come your ways.
-
-Oph.
-I shall obey, my lord.
-
-[Exeunt.]
-
-
-
-Scene IV. The platform.
-
-[Enter Hamlet, Horatio, and Marcellus.]
-
-Ham.
-The air bites shrewdly; it is very cold.
-
-Hor.
-It is a nipping and an eager air.
-
-Ham.
-What hour now?
-
-Hor.
-I think it lacks of twelve.
-
-Mar.
-No, it is struck.
-
-Hor.
-Indeed? I heard it not: then draws near the season
-Wherein the spirit held his wont to walk.
-
-[A flourish of trumpets, and ordnance shot off within.]
-
-What does this mean, my lord?
-
-Ham.
-The King doth wake to-night and takes his rouse,
-Keeps wassail, and the swaggering up-spring reels;
-And, as he drains his draughts of Rhenish down,
-The kettle-drum and trumpet thus bray out
-The triumph of his pledge.
-
-Hor.
-Is it a custom?
-
-Ham.
-Ay, marry, is't;
-But to my mind,--though I am native here,
-And to the manner born,--it is a custom
-More honour'd in the breach than the observance.
-This heavy-headed revel east and west
-Makes us traduc'd and tax'd of other nations:
-They clepe us drunkards, and with swinish phrase
-Soil our addition; and, indeed, it takes
-From our achievements, though perform'd at height,
-The pith and marrow of our attribute.
-So oft it chances in particular men
-That, for some vicious mole of nature in them,
-As in their birth,--wherein they are not guilty,
-Since nature cannot choose his origin,--
-By the o'ergrowth of some complexion,
-Oft breaking down the pales and forts of reason;
-Or by some habit, that too much o'er-leavens
-The form of plausive manners;--that these men,--
-Carrying, I say, the stamp of one defect,
-Being nature's livery, or fortune's star,--
-Their virtues else,--be they as pure as grace,
-As infinite as man may undergo,--
-Shall in the general censure take corruption
-From that particular fault: the dram of eale
-Doth all the noble substance often doubt
-To his own scandal.
-
-Hor.
-Look, my lord, it comes!
-
-[Enter Ghost.]
-
-Ham.
-Angels and ministers of grace defend us!--
-Be thou a spirit of health or goblin damn'd,
-Bring with thee airs from heaven or blasts from hell,
-Be thy intents wicked or charitable,
-Thou com'st in such a questionable shape
-That I will speak to thee: I'll call thee Hamlet,
-King, father, royal Dane; O, answer me!
-Let me not burst in ignorance; but tell
-Why thy canoniz'd bones, hearsed in death,
-Have burst their cerements; why the sepulchre,
-Wherein we saw thee quietly in-urn'd,
-Hath op'd his ponderous and marble jaws
-To cast thee up again! What may this mean,
-That thou, dead corse, again in complete steel,
-Revisit'st thus the glimpses of the moon,
-Making night hideous, and we fools of nature
-So horridly to shake our disposition
-With thoughts beyond the reaches of our souls?
-Say, why is this? wherefore? what should we do?
-
-[Ghost beckons Hamlet.]
-
-Hor.
-It beckons you to go away with it,
-As if it some impartment did desire
-To you alone.
-
-Mar.
-Look with what courteous action
-It waves you to a more removed ground:
-But do not go with it!
-
-Hor.
-No, by no means.
-
-Ham.
-It will not speak; then will I follow it.
-
-Hor.
-Do not, my lord.
-
-Ham.
-Why, what should be the fear?
-I do not set my life at a pin's fee;
-And for my soul, what can it do to that,
-Being a thing immortal as itself?
-It waves me forth again;--I'll follow it.
-
-Hor.
-What if it tempt you toward the flood, my lord,
-Or to the dreadful summit of the cliff
-That beetles o'er his base into the sea,
-And there assume some other horrible form
-Which might deprive your sovereignty of reason,
-And draw you into madness? think of it:
-The very place puts toys of desperation,
-Without more motive, into every brain
-That looks so many fadoms to the sea
-And hears it roar beneath.
-
-Ham.
-It waves me still.--
-Go on; I'll follow thee.
-
-Mar.
-You shall not go, my lord.
-
-Ham.
-Hold off your hands.
-
-Hor.
-Be rul'd; you shall not go.
-
-Ham.
-My fate cries out,
-And makes each petty artery in this body
-As hardy as the Nemean lion's nerve.--
-
-[Ghost beckons.]
-
-Still am I call'd;--unhand me, gentlemen;--
-
-[Breaking free from them.]
-
-By heaven, I'll make a ghost of him that lets me!--
-I say, away!--Go on; I'll follow thee.
-
-[Exeunt Ghost and Hamlet.]
-
-Hor.
-He waxes desperate with imagination.
-
-Mar.
-Let's follow; 'tis not fit thus to obey him.
-
-Hor.
-Have after.--To what issue will this come?
-
-Mar.
-Something is rotten in the state of Denmark.
-
-Hor.
-Heaven will direct it.
-
-Mar.
-Nay, let's follow him.
-
-[Exeunt.]
-
-
-
-Scene V. A more remote part of the Castle.
-
-[Enter Ghost and Hamlet.]
-
-Ham.
-Whither wilt thou lead me? speak! I'll go no further.
-
-Ghost.
-Mark me.
-
-Ham.
-I will.
-
-Ghost.
-My hour is almost come,
-When I to sulph'uous and tormenting flames
-Must render up myself.
-
-Ham.
-Alas, poor ghost!
-
-Ghost.
-Pity me not, but lend thy serious hearing
-To what I shall unfold.
-
-Ham.
-Speak;I am bound to hear.
-
-Ghost.
-So art thou to revenge, when thou shalt hear.
-
-Ham.
-What?
-
-Ghost.
-I am thy father's spirit;
-Doom'd for a certain term to walk the night,
-And for the day confin'd to wastein fires,
-Till the foul crimes done in my days of nature
-Are burnt and purg'd away. But that I am forbid
-To tell the secrets of my prison-house,
-I could a tale unfold whose lightest word
-Would harrow up thy soul; freeze thy young blood;
-Make thy two eyes, like stars, start from their spheres;
-Thy knotted and combined locks to part,
-And each particular hair to stand on end
-Like quills upon the fretful porcupine:
-But this eternal blazon must not be
-To ears of flesh and blood.--List, list, O, list!--
-If thou didst ever thy dear father love--
-
-Ham.
-O God!
-
-Ghost.
-Revenge his foul and most unnatural murder.
-
-Ham.
-Murder!
-
-Ghost.
-Murder most foul, as in the best it is;
-But this most foul, strange, and unnatural.
-
-Ham.
-Haste me to know't, that I, with wings as swift
-As meditation or the thoughts of love,
-May sweep to my revenge.
-
-Ghost.
-I find thee apt;
-And duller shouldst thou be than the fat weed
-That rots itself in ease on Lethe wharf,
-Wouldst thou not stir in this. Now, Hamlet, hear.
-'Tis given out that, sleeping in my orchard,
-A serpent stung me; so the whole ear of Denmark
-Is by a forged process of my death
-Rankly abus'd; but know, thou noble youth,
-The serpent that did sting thy father's life
-Now wears his crown.
-
-Ham.
-O my prophetic soul!
-Mine uncle!
-
-Ghost.
-Ay, that incestuous, that adulterate beast,
-With witchcraft of his wit, with traitorous gifts,--
-O wicked wit and gifts, that have the power
-So to seduce!--won to his shameful lust
-The will of my most seeming-virtuous queen:
-O Hamlet, what a falling-off was there!
-From me, whose love was of that dignity
-That it went hand in hand even with the vow
-I made to her in marriage; and to decline
-Upon a wretch whose natural gifts were poor
-To those of mine!
-But virtue, as it never will be mov'd,
-Though lewdness court it in a shape of heaven;
-So lust, though to a radiant angel link'd,
-Will sate itself in a celestial bed
-And prey on garbage.
-But soft! methinks I scent the morning air;
-Brief let me be.--Sleeping within my orchard,
-My custom always of the afternoon,
-Upon my secure hour thy uncle stole,
-With juice of cursed hebenon in a vial,
-And in the porches of my ears did pour
-The leperous distilment; whose effect
-Holds such an enmity with blood of man
-That, swift as quicksilver, it courses through
-The natural gates and alleys of the body;
-And with a sudden vigour it doth posset
-And curd, like eager droppings into milk,
-The thin and wholesome blood; so did it mine;
-And a most instant tetter bark'd about,
-Most lazar-like, with vile and loathsome crust
-All my smooth body.
-Thus was I, sleeping, by a brother's hand,
-Of life, of crown, of queen, at once dispatch'd:
-Cut off even in the blossoms of my sin,
-Unhous'led, disappointed, unanel'd;
-No reckoning made, but sent to my account
-With all my imperfections on my head:
-O, horrible! O, horrible! most horrible!
-If thou hast nature in thee, bear it not;
-Let not the royal bed of Denmark be
-A couch for luxury and damned incest.
-But, howsoever thou pursu'st this act,
-Taint not thy mind, nor let thy soul contrive
-Against thy mother aught: leave her to heaven,
-And to those thorns that in her bosom lodge,
-To prick and sting her. Fare thee well at once!
-The glowworm shows the matin to be near,
-And 'gins to pale his uneffectual fire:
-Adieu, adieu! Hamlet, remember me.
-
-[Exit.]
-
-Ham.
-O all you host of heaven! O earth! what else?
-And shall I couple hell? O, fie!--Hold, my heart;
-And you, my sinews, grow not instant old,
-But bear me stiffly up.--Remember thee!
-Ay, thou poor ghost, while memory holds a seat
-In this distracted globe. Remember thee!
-Yea, from the table of my memory
-I'll wipe away all trivial fond records,
-All saws of books, all forms, all pressures past,
-That youth and observation copied there;
-And thy commandment all alone shall live
-Within the book and volume of my brain,
-Unmix'd with baser matter: yes, by heaven!--
-O most pernicious woman!
-O villain, villain, smiling, damned villain!
-My tables,--meet it is I set it down,
-That one may smile, and smile, and be a villain;
-At least, I am sure, it may be so in Denmark:
-
-[Writing.]
-
-So, uncle, there you are. Now to my word;
-It is 'Adieu, adieu! remember me:'
-I have sworn't.
-
-Hor.
-[Within.] My lord, my lord,--
-
-Mar.
-[Within.] Lord Hamlet,--
-
-Hor.
-[Within.] Heaven secure him!
-
-Ham.
-So be it!
-
-Mar.
-[Within.] Illo, ho, ho, my lord!
-
-Ham.
-Hillo, ho, ho, boy! Come, bird, come.
-
-[Enter Horatio and Marcellus.]
-
-Mar.
-How is't, my noble lord?
-
-Hor.
-What news, my lord?
-
-Ham.
-O, wonderful!
-
-Hor.
-Good my lord, tell it.
-
-Ham.
-No; you'll reveal it.
-
-Hor.
-Not I, my lord, by heaven.
-
-Mar.
-Nor I, my lord.
-
-Ham.
-How say you then; would heart of man once think it?--
-But you'll be secret?
-
-Hor. and Mar.
-Ay, by heaven, my lord.
-
-Ham.
-There's ne'er a villain dwelling in all Denmark
-But he's an arrant knave.
-
-Hor.
-There needs no ghost, my lord, come from the grave
-To tell us this.
-
-Ham.
-Why, right; you are i' the right;
-And so, without more circumstance at all,
-I hold it fit that we shake hands and part:
-You, as your business and desires shall point you,--
-For every man hath business and desire,
-Such as it is;--and for my own poor part,
-Look you, I'll go pray.
-
-Hor.
-These are but wild and whirling words, my lord.
-
-Ham.
-I'm sorry they offend you, heartily;
-Yes, faith, heartily.
-
-Hor.
-There's no offence, my lord.
-
-Ham.
-Yes, by Saint Patrick, but there is, Horatio,
-And much offence too. Touching this vision here,--
-It is an honest ghost, that let me tell you:
-For your desire to know what is between us,
-O'ermaster't as you may. And now, good friends,
-As you are friends, scholars, and soldiers,
-Give me one poor request.
-
-Hor.
-What is't, my lord? we will.
-
-Ham.
-Never make known what you have seen to-night.
-
-Hor. and Mar.
-My lord, we will not.
-
-Ham.
-Nay, but swear't.
-
-Hor.
-In faith,
-My lord, not I.
-
-Mar.
-Nor I, my lord, in faith.
-
-Ham.
-Upon my sword.
-
-Mar.
-We have sworn, my lord, already.
-
-Ham.
-Indeed, upon my sword, indeed.
-
-Ghost.
-[Beneath.] Swear.
-
-Ham.
-Ha, ha boy! say'st thou so? art thou there, truepenny?--
-Come on!--you hear this fellow in the cellarage,--
-Consent to swear.
-
-Hor.
-Propose the oath, my lord.
-
-Ham.
-Never to speak of this that you have seen,
-Swear by my sword.
-
-Ghost.
-[Beneath.] Swear.
-
-Ham.
-Hic et ubique? then we'll shift our ground.--
-Come hither, gentlemen,
-And lay your hands again upon my sword:
-Never to speak of this that you have heard,
-Swear by my sword.
-
-Ghost.
-[Beneath.] Swear.
-
-Ham.
-Well said, old mole! canst work i' the earth so fast?
-A worthy pioner!--Once more remove, good friends.
-
-Hor.
-O day and night, but this is wondrous strange!
-
-Ham.
-And therefore as a stranger give it welcome.
-There are more things in heaven and earth, Horatio,
-Than are dreamt of in your philosophy.
-But come;--
-Here, as before, never, so help you mercy,
-How strange or odd soe'er I bear myself,--
-As I, perchance, hereafter shall think meet
-To put an antic disposition on,--
-That you, at such times seeing me, never shall,
-With arms encumber'd thus, or this head-shake,
-Or by pronouncing of some doubtful phrase,
-As 'Well, well, we know'; or 'We could, an if we would';--
-Or 'If we list to speak'; or 'There be, an if they might';--
-Or such ambiguous giving out, to note
-That you know aught of me:--this is not to do,
-So grace and mercy at your most need help you,
-Swear.
-
-Ghost.
-[Beneath.] Swear.
-
-Ham.
-Rest, rest, perturbed spirit!--So, gentlemen,
-With all my love I do commend me to you:
-And what so poor a man as Hamlet is
-May do, to express his love and friending to you,
-God willing, shall not lack. Let us go in together;
-And still your fingers on your lips, I pray.
-The time is out of joint:--O cursed spite,
-That ever I was born to set it right!--
-Nay, come, let's go together.
-
-[Exeunt.]
-
-
-
-Act II.
-
-Scene I. A room in Polonius's house.
-
-[Enter Polonius and Reynaldo.]
-
-Pol.
-Give him this money and these notes, Reynaldo.
-
-Rey.
-I will, my lord.
-
-Pol.
-You shall do marvellous wisely, good Reynaldo,
-Before You visit him, to make inquiry
-Of his behaviour.
-
-Rey.
-My lord, I did intend it.
-
-Pol.
-Marry, well said; very well said. Look you, sir,
-Enquire me first what Danskers are in Paris;
-And how, and who, what means, and where they keep,
-What company, at what expense; and finding,
-By this encompassment and drift of question,
-That they do know my son, come you more nearer
-Than your particular demands will touch it:
-Take you, as 'twere, some distant knowledge of him;
-As thus, 'I know his father and his friends,
-And in part hi;m;--do you mark this, Reynaldo?
-
-Rey.
-Ay, very well, my lord.
-
-Pol.
-'And in part him;--but,' you may say, 'not well:
-But if't be he I mean, he's very wild;
-Addicted so and so;' and there put on him
-What forgeries you please; marry, none so rank
-As may dishonour him; take heed of that;
-But, sir, such wanton, wild, and usual slips
-As are companions noted and most known
-To youth and liberty.
-
-Rey.
-As gaming, my lord.
-
-Pol.
-Ay, or drinking, fencing, swearing, quarrelling,
-Drabbing:--you may go so far.
-
-Rey.
-My lord, that would dishonour him.
-
-Pol.
-Faith, no; as you may season it in the charge.
-You must not put another scandal on him,
-That he is open to incontinency;
-That's not my meaning: but breathe his faults so quaintly
-That they may seem the taints of liberty;
-The flash and outbreak of a fiery mind;
-A savageness in unreclaimed blood,
-Of general assault.
-
-Rey.
-But, my good lord,--
-
-Pol.
-Wherefore should you do this?
-
-Rey.
-Ay, my lord,
-I would know that.
-
-Pol.
-Marry, sir, here's my drift;
-And I believe it is a fetch of warrant:
-You laying these slight sullies on my son
-As 'twere a thing a little soil'd i' the working,
-Mark you,
-Your party in converse, him you would sound,
-Having ever seen in the prenominate crimes
-The youth you breathe of guilty, be assur'd
-He closes with you in this consequence;
-'Good sir,' or so; or 'friend,' or 'gentleman'--
-According to the phrase or the addition
-Of man and country.
-
-Rey.
-Very good, my lord.
-
-Pol.
-And then, sir, does he this,--he does--What was I about to say?--
-By the mass, I was about to say something:--Where did I leave?
-
-Rey.
-At 'closes in the consequence,' at 'friend or so,' and
-gentleman.'
-
-Pol.
-At--closes in the consequence'--ay, marry!
-He closes with you thus:--'I know the gentleman;
-I saw him yesterday, or t'other day,
-Or then, or then; with such, or such; and, as you say,
-There was he gaming; there o'ertook in's rouse;
-There falling out at tennis': or perchance,
-'I saw him enter such a house of sale,'--
-Videlicet, a brothel,--or so forth.--
-See you now;
-Your bait of falsehood takes this carp of truth:
-And thus do we of wisdom and of reach,
-With windlaces, and with assays of bias,
-By indirections find directions out:
-So, by my former lecture and advice,
-Shall you my son. You have me, have you not?
-
-Rey.
-My lord, I have.
-
-Pol.
-God b' wi' you, fare you well.
-
-Rey.
-Good my lord!
-
-Pol.
-Observe his inclination in yourself.
-
-Rey.
-I shall, my lord.
-
-Pol.
-And let him ply his music.
-
-Rey.
-Well, my lord.
-
-Pol.
-Farewell!
-
-[Exit Reynaldo.]
-
-[Enter Ophelia.]
-
-How now, Ophelia! what's the matter?
-
-Oph.
-Alas, my lord, I have been so affrighted!
-
-Pol.
-With what, i' the name of God?
-
-Oph.
-My lord, as I was sewing in my chamber,
-Lord Hamlet,--with his doublet all unbrac'd;
-No hat upon his head; his stockings foul'd,
-Ungart'red, and down-gyved to his ankle;
-Pale as his shirt; his knees knocking each other;
-And with a look so piteous in purport
-As if he had been loosed out of hell
-To speak of horrors,--he comes before me.
-
-Pol.
-Mad for thy love?
-
-Oph.
-My lord, I do not know;
-But truly I do fear it.
-
-Pol.
-What said he?
-
-Oph.
-He took me by the wrist, and held me hard;
-Then goes he to the length of all his arm;
-And with his other hand thus o'er his brow,
-He falls to such perusal of my face
-As he would draw it. Long stay'd he so;
-At last,--a little shaking of mine arm,
-And thrice his head thus waving up and down,--
-He rais'd a sigh so piteous and profound
-As it did seem to shatter all his bulk
-And end his being: that done, he lets me go:
-And, with his head over his shoulder turn'd
-He seem'd to find his way without his eyes;
-For out o' doors he went without their help,
-And to the last bended their light on me.
-
-Pol.
-Come, go with me: I will go seek the king.
-This is the very ecstasy of love;
-Whose violent property fordoes itself,
-And leads the will to desperate undertakings,
-As oft as any passion under heaven
-That does afflict our natures. I am sorry,--
-What, have you given him any hard words of late?
-
-Oph.
-No, my good lord; but, as you did command,
-I did repel his letters and denied
-His access to me.
-
-Pol.
-That hath made him mad.
-I am sorry that with better heed and judgment
-I had not quoted him: I fear'd he did but trifle,
-And meant to wreck thee; but beshrew my jealousy!
-It seems it as proper to our age
-To cast beyond ourselves in our opinions
-As it is common for the younger sort
-To lack discretion. Come, go we to the king:
-This must be known; which, being kept close, might move
-More grief to hide than hate to utter love.
-
-[Exeunt.]
-
-
-
-Scene II. A room in the Castle.
-
-[Enter King, Rosencrantz, Guildenstern, and Attendants.]
-
-King.
-Welcome, dear Rosencrantz and Guildenstern!
-Moreover that we much did long to see you,
-The need we have to use you did provoke
-Our hasty sending. Something have you heard
-Of Hamlet's transformation; so I call it,
-Since nor the exterior nor the inward man
-Resembles that it was. What it should be,
-More than his father's death, that thus hath put him
-So much from the understanding of himself,
-I cannot dream of: I entreat you both
-That, being of so young days brought up with him,
-And since so neighbour'd to his youth and humour,
-That you vouchsafe your rest here in our court
-Some little time: so by your companies
-To draw him on to pleasures, and to gather,
-So much as from occasion you may glean,
-Whether aught, to us unknown, afflicts him thus,
-That, open'd, lies within our remedy.
-
-Queen.
-Good gentlemen, he hath much talk'd of you,
-And sure I am two men there are not living
-To whom he more adheres. If it will please you
-To show us so much gentry and good-will
-As to expend your time with us awhile,
-For the supply and profit of our hope,
-Your visitation shall receive such thanks
-As fits a king's remembrance.
-
-Ros.
-Both your majesties
-Might, by the sovereign power you have of us,
-Put your dread pleasures more into command
-Than to entreaty.
-
-Guil.
-We both obey,
-And here give up ourselves, in the full bent,
-To lay our service freely at your feet,
-To be commanded.
-
-King.
-Thanks, Rosencrantz and gentle Guildenstern.
-
-Queen.
-Thanks, Guildenstern and gentle Rosencrantz:
-And I beseech you instantly to visit
-My too-much-changed son.--Go, some of you,
-And bring these gentlemen where Hamlet is.
-
-Guil.
-Heavens make our presence and our practices
-Pleasant and helpful to him!
-
-Queen.
-Ay, amen!
-
-[Exeunt Rosencrantz, Guildenstern, and some Attendants].
-
-[Enter Polonius.]
-
-Pol.
-Th' ambassadors from Norway, my good lord,
-Are joyfully return'd.
-
-King.
-Thou still hast been the father of good news.
-
-Pol.
-Have I, my lord? Assure you, my good liege,
-I hold my duty, as I hold my soul,
-Both to my God and to my gracious king:
-And I do think,--or else this brain of mine
-Hunts not the trail of policy so sure
-As it hath us'd to do,--that I have found
-The very cause of Hamlet's lunacy.
-
-King.
-O, speak of that; that do I long to hear.
-
-Pol.
-Give first admittance to the ambassadors;
-My news shall be the fruit to that great feast.
-
-King.
-Thyself do grace to them, and bring them in.
-
-[Exit Polonius.]
-
-He tells me, my sweet queen, he hath found
-The head and source of all your son's distemper.
-
-Queen.
-I doubt it is no other but the main,--
-His father's death and our o'erhasty marriage.
-
-King.
-Well, we shall sift him.
-
-[Enter Polonius, with Voltimand and Cornelius.]
-
-Welcome, my good friends!
-Say, Voltimand, what from our brother Norway?
-
-Volt.
-Most fair return of greetings and desires.
-Upon our first, he sent out to suppress
-His nephew's levies; which to him appear'd
-To be a preparation 'gainst the Polack;
-But, better look'd into, he truly found
-It was against your highness; whereat griev'd,--
-That so his sickness, age, and impotence
-Was falsely borne in hand,--sends out arrests
-On Fortinbras; which he, in brief, obeys;
-Receives rebuke from Norway; and, in fine,
-Makes vow before his uncle never more
-To give th' assay of arms against your majesty.
-Whereon old Norway, overcome with joy,
-Gives him three thousand crowns in annual fee;
-And his commission to employ those soldiers,
-So levied as before, against the Polack:
-With an entreaty, herein further shown,
-[Gives a paper.]
-That it might please you to give quiet pass
-Through your dominions for this enterprise,
-On such regards of safety and allowance
-As therein are set down.
-
-King.
-It likes us well;
-And at our more consider'd time we'll read,
-Answer, and think upon this business.
-Meantime we thank you for your well-took labour:
-Go to your rest; at night we'll feast together:
-Most welcome home!
-
-[Exeunt Voltimand and Cornelius.]
-
-Pol.
-This business is well ended.--
-My liege, and madam,--to expostulate
-What majesty should be, what duty is,
-Why day is day, night is night, and time is time.
-Were nothing but to waste night, day, and time.
-Therefore, since brevity is the soul of wit,
-And tediousness the limbs and outward flourishes,
-I will be brief:--your noble son is mad:
-Mad call I it; for to define true madness,
-What is't but to be nothing else but mad?
-But let that go.
-
-Queen.
-More matter, with less art.
-
-Pol.
-Madam, I swear I use no art at all.
-That he is mad, 'tis true: 'tis true 'tis pity;
-And pity 'tis 'tis true: a foolish figure;
-But farewell it, for I will use no art.
-Mad let us grant him then: and now remains
-That we find out the cause of this effect;
-Or rather say, the cause of this defect,
-For this effect defective comes by cause:
-Thus it remains, and the remainder thus.
-Perpend.
-I have a daughter,--have whilst she is mine,--
-Who, in her duty and obedience, mark,
-Hath given me this: now gather, and surmise.
-[Reads.]
-'To the celestial, and my soul's idol, the most beautified
-Ophelia,'--
-That's an ill phrase, a vile phrase; 'beautified' is a vile
-phrase: but you shall hear. Thus:
-[Reads.]
-'In her excellent white bosom, these, &c.'
-
-Queen.
-Came this from Hamlet to her?
-
-Pol.
-Good madam, stay awhile; I will be faithful.
-[Reads.]
- 'Doubt thou the stars are fire;
- Doubt that the sun doth move;
- Doubt truth to be a liar;
- But never doubt I love.
-'O dear Ophelia, I am ill at these numbers; I have not art to
-reckon my groans: but that I love thee best, O most best, believe
-it. Adieu.
- 'Thine evermore, most dear lady, whilst this machine is to him,
- HAMLET.'
-This, in obedience, hath my daughter show'd me;
-And more above, hath his solicitings,
-As they fell out by time, by means, and place,
-All given to mine ear.
-
-King.
-But how hath she
-Receiv'd his love?
-
-Pol.
-What do you think of me?
-
-King.
-As of a man faithful and honourable.
-
-Pol.
-I would fain prove so. But what might you think,
-When I had seen this hot love on the wing,--
-As I perceiv'd it, I must tell you that,
-Before my daughter told me,-- what might you,
-Or my dear majesty your queen here, think,
-If I had play'd the desk or table-book,
-Or given my heart a winking, mute and dumb;
-Or look'd upon this love with idle sight;--
-What might you think? No, I went round to work,
-And my young mistress thus I did bespeak:
-'Lord Hamlet is a prince, out of thy sphere;
-This must not be:' and then I precepts gave her,
-That she should lock herself from his resort,
-Admit no messengers, receive no tokens.
-Which done, she took the fruits of my advice;
-And he, repulsed,--a short tale to make,--
-Fell into a sadness; then into a fast;
-Thence to a watch; thence into a weakness;
-Thence to a lightness; and, by this declension,
-Into the madness wherein now he raves,
-And all we wail for.
-
-King.
-Do you think 'tis this?
-
-Queen.
-It may be, very likely.
-
-Pol.
-Hath there been such a time,--I'd fain know that--
-That I have positively said ''Tis so,'
-When it prov'd otherwise?
-
-King.
-Not that I know.
-
-Pol.
-Take this from this, if this be otherwise:
-[Points to his head and shoulder.]
-If circumstances lead me, I will find
-Where truth is hid, though it were hid indeed
-Within the centre.
-
-King.
-How may we try it further?
-
-Pol.
-You know sometimes he walks for hours together
-Here in the lobby.
-
-Queen.
-So he does indeed.
-
-Pol.
-At such a time I'll loose my daughter to him:
-Be you and I behind an arras then;
-Mark the encounter: if he love her not,
-And he not from his reason fall'n thereon
-Let me be no assistant for a state,
-But keep a farm and carters.
-
-King.
-We will try it.
-
-Queen.
-But look where sadly the poor wretch comes reading.
-
-Pol.
-Away, I do beseech you, both away
-I'll board him presently:--O, give me leave.
-
-[Exeunt King, Queen, and Attendants.]
-
-[Enter Hamlet, reading.]
-
-How does my good Lord Hamlet?
-
-Ham.
-Well, God-a-mercy.
-
-Pol.
-Do you know me, my lord?
-
-Ham.
-Excellent well; you're a fishmonger.
-
-Pol.
-Not I, my lord.
-
-Ham.
-Then I would you were so honest a man.
-
-Pol.
-Honest, my lord!
-
-Ham.
-Ay, sir; to be honest, as this world goes, is to be one man
-picked out of ten thousand.
-
-Pol.
-That's very true, my lord.
-
-Ham.
-For if the sun breed maggots in a dead dog, being a god-kissing
-carrion,--Have you a daughter?
-
-Pol.
-I have, my lord.
-
-Ham.
-Let her not walk i' the sun: conception is a blessing, but not
-as your daughter may conceive:--friend, look to't.
-
-Pol.
-How say you by that?--[Aside.] Still harping on my daughter:--yet
-he knew me not at first; he said I was a fishmonger: he is far
-gone, far gone: and truly in my youth I suffered much extremity
-for love; very near this. I'll speak to him again.--What do you
-read, my lord?
-
-Ham.
-Words, words, words.
-
-Pol.
-What is the matter, my lord?
-
-Ham.
-Between who?
-
-Pol.
-I mean, the matter that you read, my lord.
-
-Ham.
-Slanders, sir: for the satirical slave says here that old men
-have grey beards; that their faces are wrinkled; their eyes
-purging thick amber and plum-tree gum; and that they have a
-plentiful lack of wit, together with most weak hams: all which,
-sir, though I most powerfully and potently believe, yet I hold it
-not honesty to have it thus set down; for you yourself, sir,
-should be old as I am, if, like a crab, you could go backward.
-
-Pol.
-[Aside.] Though this be madness, yet there is a method in't.--
-Will you walk out of the air, my lord?
-
-Ham.
-Into my grave?
-
-Pol.
-Indeed, that is out o' the air. [Aside.] How pregnant sometimes
-his replies are! a happiness that often madness hits on, which
-reason and sanity could not so prosperously be delivered of. I
-will leave him and suddenly contrive the means of meeting between
-him and my daughter.--My honourable lord, I will most humbly take
-my leave of you.
-
-Ham.
-You cannot, sir, take from me anything that I will more
-willingly part withal,--except my life, except my life, except my
-life.
-
-Pol.
-Fare you well, my lord.
-
-Ham.
-These tedious old fools!
-
-[Enter Rosencrantz and Guildenstern.]
-
-Pol.
-You go to seek the Lord Hamlet; there he is.
-
-Ros.
-[To Polonius.] God save you, sir!
-
-[Exit Polonius.]
-
-Guil.
-My honoured lord!
-
-Ros.
-My most dear lord!
-
-Ham.
-My excellent good friends! How dost thou, Guildenstern? Ah,
-Rosencrantz! Good lads, how do ye both?
-
-Ros.
-As the indifferent children of the earth.
-
-Guil.
-Happy in that we are not over-happy;
-On fortune's cap we are not the very button.
-
-Ham.
-Nor the soles of her shoe?
-
-Ros.
-Neither, my lord.
-
-Ham.
-Then you live about her waist, or in the middle of her
-favours?
-
-Guil.
-Faith, her privates we.
-
-Ham.
-In the secret parts of fortune? O, most true; she is a
-strumpet. What's the news?
-
-Ros.
-None, my lord, but that the world's grown honest.
-
-Ham.
-Then is doomsday near; but your news is not true. Let me
-question more in particular: what have you, my good friends,
-deserved at the hands of fortune, that she sends you to prison
-hither?
-
-Guil.
-Prison, my lord!
-
-Ham.
-Denmark's a prison.
-
-Ros.
-Then is the world one.
-
-Ham.
-A goodly one; in which there are many confines, wards, and
-dungeons, Denmark being one o' the worst.
-
-Ros.
-We think not so, my lord.
-
-Ham.
-Why, then 'tis none to you; for there is nothing either good
-or bad but thinking makes it so: to me it is a prison.
-
-Ros.
-Why, then, your ambition makes it one; 'tis too narrow for your
-mind.
-
-Ham.
-O God, I could be bounded in a nutshell, and count myself a
-king of infinite space, were it not that I have bad dreams.
-
-Guil.
-Which dreams, indeed, are ambition; for the very substance of
-the ambitious is merely the shadow of a dream.
-
-Ham.
-A dream itself is but a shadow.
-
-Ros.
-Truly, and I hold ambition of so airy and light a quality that
-it is but a shadow's shadow.
-
-Ham.
-Then are our beggars bodies, and our monarchs and outstretch'd
-heroes the beggars' shadows. Shall we to the court? for, by my
-fay, I cannot reason.
-
-Ros. and Guild.
-We'll wait upon you.
-
-Ham.
-No such matter: I will not sort you with the rest of my
-servants; for, to speak to you like an honest man, I am most
-dreadfully attended. But, in the beaten way of friendship, what
-make you at Elsinore?
-
-Ros.
-To visit you, my lord; no other occasion.
-
-Ham.
-Beggar that I am, I am even poor in thanks; but I thank you:
-and sure, dear friends, my thanks are too dear a halfpenny. Were
-you not sent for? Is it your own inclining? Is it a free
-visitation? Come, deal justly with me: come, come; nay, speak.
-
-Guil.
-What should we say, my lord?
-
-Ham.
-Why, anything--but to the purpose. You were sent for; and
-there is a kind of confession in your looks, which your modesties
-have not craft enough to colour: I know the good king and queen
-have sent for you.
-
-Ros.
-To what end, my lord?
-
-Ham.
-That you must teach me. But let me conjure you, by the rights
-of our fellowship, by the consonancy of our youth, by the
-obligation of our ever-preserved love, and by what more dear a
-better proposer could charge you withal, be even and direct with
-me, whether you were sent for or no.
-
-Ros.
-[To Guildenstern.] What say you?
-
-Ham.
-[Aside.] Nay, then, I have an eye of you.--If you love me, hold
-not off.
-
-Guil.
-My lord, we were sent for.
-
-Ham.
-I will tell you why; so shall my anticipation prevent your
-discovery, and your secrecy to the king and queen moult no
-feather. I have of late,--but wherefore I know not,--lost all my
-mirth, forgone all custom of exercises; and indeed, it goes so
-heavily with my disposition that this goodly frame, the earth,
-seems to me a sterile promontory; this most excellent canopy, the
-air, look you, this brave o'erhanging firmament, this majestical
-roof fretted with golden fire,--why, it appears no other thing
-to me than a foul and pestilent congregation of vapours. What a
-piece of work is man! How noble in reason! how infinite in
-faculties! in form and moving, how express and admirable! in
-action how like an angel! in apprehension, how like a god! the
-beauty of the world! the paragon of animals! And yet, to me, what
-is this quintessence of dust? Man delights not me; no, nor woman
-neither, though by your smiling you seem to say so.
-
-Ros.
-My lord, there was no such stuff in my thoughts.
-
-Ham.
-Why did you laugh then, when I said 'Man delights not me'?
-
-Ros.
-To think, my lord, if you delight not in man, what lenten
-entertainment the players shall receive from you: we coted them
-on the way; and hither are they coming to offer you service.
-
-Ham.
-He that plays the king shall be welcome,--his majesty shall
-have tribute of me; the adventurous knight shall use his foil and
-target; the lover shall not sigh gratis; the humorous man shall
-end his part in peace; the clown shall make those laugh whose
-lungs are tickle o' the sere; and the lady shall say her mind
-freely, or the blank verse shall halt for't. What players are
-they?
-
-Ros.
-Even those you were wont to take such delight in,--the
-tragedians of the city.
-
-Ham.
-How chances it they travel? their residence, both in
-reputation and profit, was better both ways.
-
-Ros.
-I think their inhibition comes by the means of the late
-innovation.
-
-Ham.
-Do they hold the same estimation they did when I was in the
-city? Are they so followed?
-
-Ros.
-No, indeed, are they not.
-
-Ham.
-How comes it? do they grow rusty?
-
-Ros.
-Nay, their endeavour keeps in the wonted pace: but there is,
-sir, an aery of children, little eyases, that cry out on the top
-of question, and are most tyrannically clapped for't: these are
-now the fashion; and so berattle the common stages,--so they call
-them,--that many wearing rapiers are afraid of goose-quills and
-dare scarce come thither.
-
-Ham.
-What, are they children? who maintains 'em? How are they
-escoted? Will they pursue the quality no longer than they can
-sing? will they not say afterwards, if they should grow
-themselves to common players,--as it is most like, if their means
-are no better,--their writers do them wrong to make them exclaim
-against their own succession?
-
-Ros.
-Faith, there has been much to do on both sides; and the nation
-holds it no sin to tarre them to controversy: there was, for
-awhile, no money bid for argument unless the poet and the player
-went to cuffs in the question.
-
-Ham.
-Is't possible?
-
-Guil.
-O, there has been much throwing about of brains.
-
-Ham.
-Do the boys carry it away?
-
-Ros.
-Ay, that they do, my lord; Hercules and his load too.
-
-Ham.
-It is not very strange; for my uncle is king of Denmark, and
-those that would make mouths at him while my father lived, give
-twenty, forty, fifty, a hundred ducats a-piece for his picture in
-little. 'Sblood, there is something in this more than natural, if
-philosophy could find it out.
-
-[Flourish of trumpets within.]
-
-Guil.
-There are the players.
-
-Ham.
-Gentlemen, you are welcome to Elsinore. Your hands, come: the
-appurtenance of welcome is fashion and ceremony: let me comply
-with you in this garb; lest my extent to the players, which I
-tell you must show fairly outward, should more appear like
-entertainment than yours. You are welcome: but my uncle-father
-and aunt-mother are deceived.
-
-Guil.
-In what, my dear lord?
-
-Ham.
-I am but mad north-north-west: when the wind is southerly I
-know a hawk from a handsaw.
-
-[Enter Polonius.]
-
-Pol.
-Well be with you, gentlemen!
-
-Ham.
-Hark you, Guildenstern;--and you too;--at each ear a hearer: that
-great baby you see there is not yet out of his swaddling clouts.
-
-Ros.
-Happily he's the second time come to them; for they say an old
-man is twice a child.
-
-Ham.
-I will prophesy he comes to tell me of the players; mark it.--You
-say right, sir: o' Monday morning; 'twas so indeed.
-
-Pol.
-My lord, I have news to tell you.
-
-Ham.
-My lord, I have news to tell you. When Roscius was an actor in
-Rome,--
-
-Pol.
-The actors are come hither, my lord.
-
-Ham.
-Buzz, buzz!
-
-Pol.
-Upon my honour,--
-
-Ham.
-Then came each actor on his ass,--
-
-Pol.
-The best actors in the world, either for tragedy, comedy,
-history, pastoral, pastoral-comical, historical-pastoral,
-tragical-historical, tragical-comical-historical-pastoral, scene
-individable, or poem unlimited: Seneca cannot be too heavy nor
-Plautus too light. For the law of writ and the liberty, these are
-the only men.
-
-Ham.
-O Jephthah, judge of Israel, what a treasure hadst thou!
-
-Pol.
-What treasure had he, my lord?
-
-Ham.
-Why--
- 'One fair daughter, and no more,
- The which he loved passing well.'
-
-
-Pol.
-[Aside.] Still on my daughter.
-
-Ham.
-Am I not i' the right, old Jephthah?
-
-Pol.
-If you call me Jephthah, my lord, I have a daughter that I
-love passing well.
-
-Ham.
-Nay, that follows not.
-
-Pol.
-What follows, then, my lord?
-
-Ham.
-Why--
- 'As by lot, God wot,'
-and then, you know,
- 'It came to pass, as most like it was--'
-The first row of the pious chanson will show you more; for look
-where my abridgment comes.
-
-[Enter four or five Players.]
-
-You are welcome, masters; welcome, all:--I am glad to see thee
-well.--welcome, good friends.--O, my old friend! Thy face is
-valanc'd since I saw thee last; comest thou to beard me in
-Denmark?--What, my young lady and mistress! By'r lady, your
-ladyship is nearer to heaven than when I saw you last, by the
-altitude of a chopine. Pray God, your voice, like a piece of
-uncurrent gold, be not cracked within the ring.--Masters, you are
-all welcome. We'll e'en to't like French falconers, fly at
-anything we see: we'll have a speech straight: come, give us a
-taste of your quality: come, a passionate speech.
-
-I Play.
-What speech, my lord?
-
-Ham.
-I heard thee speak me a speech once,--but it was never acted;
-or if it was, not above once; for the play, I remember, pleased
-not the million, 'twas caviare to the general; but it was,--as I
-received it, and others, whose judgments in such matters cried in
-the top of mine,--an excellent play, well digested in the scenes,
-set down with as much modesty as cunning. I remember, one said
-there were no sallets in the lines to make the matter savoury,
-nor no matter in the phrase that might indite the author of
-affectation; but called it an honest method, as wholesome as
-sweet, and by very much more handsome than fine. One speech in it
-I chiefly loved: 'twas AEneas' tale to Dido, and thereabout of it
-especially where he speaks of Priam's slaughter: if it live in
-your memory, begin at this line;--let me see, let me see:--
-
-The rugged Pyrrhus, like th' Hyrcanian beast,--
-
-it is not so:-- it begins with Pyrrhus:--
-
- 'The rugged Pyrrhus,--he whose sable arms,
- Black as his purpose,did the night resemble
- When he lay couched in the ominous horse,--
- Hath now this dread and black complexion smear'd
- With heraldry more dismal; head to foot
- Now is be total gules; horridly trick'd
- With blood of fathers, mothers, daughters, sons,
- Bak'd and impasted with the parching streets,
- That lend a tyrannous and a damned light
- To their vile murders: roasted in wrath and fire,
- And thus o'ersized with coagulate gore,
- With eyes like carbuncles, the hellish Pyrrhus
- Old grandsire Priam seeks.'
-
-So, proceed you.
-
-Pol.
-'Fore God, my lord, well spoken, with good accent and good
-discretion.
-
-I Play.
- Anon he finds him,
- Striking too short at Greeks: his antique sword,
- Rebellious to his arm, lies where it falls,
- Repugnant to command: unequal match'd,
- Pyrrhus at Priam drives; in rage strikes wide;
- But with the whiff and wind of his fell sword
- The unnerved father falls. Then senseless Ilium,
- Seeming to feel this blow, with flaming top
- Stoops to his base; and with a hideous crash
- Takes prisoner Pyrrhus' ear: for lo! his sword,
- Which was declining on the milky head
- Of reverend Priam, seem'd i' the air to stick:
- So, as a painted tyrant, Pyrrhus stood;
- And, like a neutral to his will and matter,
- Did nothing.
- But as we often see, against some storm,
- A silence in the heavens, the rack stand still,
- The bold winds speechless, and the orb below
- As hush as death, anon the dreadful thunder
- Doth rend the region; so, after Pyrrhus' pause,
- A roused vengeance sets him new a-work;
- And never did the Cyclops' hammers fall
- On Mars's armour, forg'd for proof eterne,
- With less remorse than Pyrrhus' bleeding sword
- Now falls on Priam.--
- Out, out, thou strumpet, Fortune! All you gods,
- In general synod, take away her power;
- Break all the spokes and fellies from her wheel,
- And bowl the round nave down the hill of heaven,
- As low as to the fiends!
-
-Pol.
-This is too long.
-
-Ham.
-It shall to the barber's, with your beard.--Pr'ythee say on.--
-He's for a jig or a tale of bawdry, or he sleeps:--say on; come
-to Hecuba.
-
-I Play.
- But who, O who, had seen the mobled queen,--
-
-Ham.
-'The mobled queen'?
-
-Pol.
-That's good! 'Mobled queen' is good.
-
-I Play.
- Run barefoot up and down, threatening the flames
- With bisson rheum; a clout upon that head
- Where late the diadem stood, and for a robe,
- About her lank and all o'erteemed loins,
- A blanket, in the alarm of fear caught up;--
- Who this had seen, with tongue in venom steep'd,
- 'Gainst Fortune's state would treason have pronounc'd:
- But if the gods themselves did see her then,
- When she saw Pyrrhus make malicious sport
- In mincing with his sword her husband's limbs,
- The instant burst of clamour that she made,--
- Unless things mortal move them not at all,--
- Would have made milch the burning eyes of heaven,
- And passion in the gods.
-
-Pol.
-Look, whether he has not turn'd his colour, and has tears in's
-eyes.--Pray you, no more!
-
-Ham.
-'Tis well. I'll have thee speak out the rest of this soon.--
-Good my lord, will you see the players well bestowed? Do you
-hear? Let them be well used; for they are the abstracts and brief
-chronicles of the time; after your death you were better have a
-bad epitaph than their ill report while you live.
-
-Pol.
-My lord, I will use them according to their desert.
-
-Ham.
-Odd's bodikin, man, better: use every man after his
-desert, and who should scape whipping? Use them after your own
-honour and dignity: the less they deserve, the more merit is in
-your bounty. Take them in.
-
-Pol.
-Come, sirs.
-
-Ham.
-Follow him, friends. we'll hear a play to-morrow.
-
-[Exeunt Polonius with all the Players but the First.]
-
-Dost thou hear me, old friend? Can you play 'The Murder of
-Gonzago'?
-
-I Play.
-Ay, my lord.
-
-Ham.
-We'll ha't to-morrow night. You could, for a need, study a
-speech of some dozen or sixteen lines which I would set down and
-insert in't? could you not?
-
-I Play.
-Ay, my lord.
-
-Ham.
-Very well.--Follow that lord; and look you mock him not.
-
-[Exit First Player.]
-
---My good friends [to Ros. and Guild.], I'll leave you till
-night: you are welcome to Elsinore.
-
-Ros.
-Good my lord!
-
-[Exeunt Rosencrantz and Guildenstern.]
-
-Ham.
-Ay, so, God b' wi' ye!
-Now I am alone.
-O, what a rogue and peasant slave am I!
-Is it not monstrous that this player here,
-But in a fiction, in a dream of passion,
-Could force his soul so to his own conceit
-That from her working all his visage wan'd;
-Tears in his eyes, distraction in's aspect,
-A broken voice, and his whole function suiting
-With forms to his conceit? And all for nothing!
-For Hecuba?
-What's Hecuba to him, or he to Hecuba,
-That he should weep for her? What would he do,
-Had he the motive and the cue for passion
-That I have? He would drown the stage with tears
-And cleave the general ear with horrid speech;
-Make mad the guilty, and appal the free;
-Confound the ignorant, and amaze, indeed,
-The very faculties of eyes and ears.
-Yet I,
-A dull and muddy-mettled rascal, peak,
-Like John-a-dreams, unpregnant of my cause,
-And can say nothing; no, not for a king
-Upon whose property and most dear life
-A damn'd defeat was made. Am I a coward?
-Who calls me villain? breaks my pate across?
-Plucks off my beard and blows it in my face?
-Tweaks me by the nose? gives me the lie i' the throat
-As deep as to the lungs? who does me this, ha?
-'Swounds, I should take it: for it cannot be
-But I am pigeon-liver'd, and lack gall
-To make oppression bitter; or ere this
-I should have fatted all the region kites
-With this slave's offal: bloody, bawdy villain!
-Remorseless, treacherous, lecherous, kindless villain!
-O, vengeance!
-Why, what an ass am I! This is most brave,
-That I, the son of a dear father murder'd,
-Prompted to my revenge by heaven and hell,
-Must, like a whore, unpack my heart with words
-And fall a-cursing like a very drab,
-A scullion!
-Fie upon't! foh!--About, my brain! I have heard
-That guilty creatures, sitting at a play,
-Have by the very cunning of the scene
-Been struck so to the soul that presently
-They have proclaim'd their malefactions;
-For murder, though it have no tongue, will speak
-With most miraculous organ, I'll have these players
-Play something like the murder of my father
-Before mine uncle: I'll observe his looks;
-I'll tent him to the quick: if he but blench,
-I know my course. The spirit that I have seen
-May be the devil: and the devil hath power
-To assume a pleasing shape; yea, and perhaps
-Out of my weakness and my melancholy,--
-As he is very potent with such spirits,--
-Abuses me to damn me: I'll have grounds
-More relative than this.--the play's the thing
-Wherein I'll catch the conscience of the king.
-
-[Exit.]
-
-
-
-
-ACT III.
-
-Scene I. A room in the Castle.
-
-[Enter King, Queen, Polonius, Ophelia, Rosencrantz, and
-Guildenstern.]
-
-King.
-And can you, by no drift of circumstance,
-Get from him why he puts on this confusion,
-Grating so harshly all his days of quiet
-With turbulent and dangerous lunacy?
-
-Ros.
-He does confess he feels himself distracted,
-But from what cause he will by no means speak.
-
-Guil.
-Nor do we find him forward to be sounded,
-But, with a crafty madness, keeps aloof
-When we would bring him on to some confession
-Of his true state.
-
-Queen.
-Did he receive you well?
-
-Ros.
-Most like a gentleman.
-
-Guil.
-But with much forcing of his disposition.
-
-Ros.
-Niggard of question; but, of our demands,
-Most free in his reply.
-
-Queen.
-Did you assay him
-To any pastime?
-
-Ros.
-Madam, it so fell out that certain players
-We o'er-raught on the way: of these we told him,
-And there did seem in him a kind of joy
-To hear of it: they are about the court,
-And, as I think, they have already order
-This night to play before him.
-
-Pol.
-'Tis most true;
-And he beseech'd me to entreat your majesties
-To hear and see the matter.
-
-King.
-With all my heart; and it doth much content me
-To hear him so inclin'd.--
-Good gentlemen, give him a further edge,
-And drive his purpose on to these delights.
-
-Ros.
-We shall, my lord.
-
-[Exeunt Rosencrantz and Guildenstern.]
-
-King.
-Sweet Gertrude, leave us too;
-For we have closely sent for Hamlet hither,
-That he, as 'twere by accident, may here
-Affront Ophelia:
-Her father and myself,--lawful espials,--
-Will so bestow ourselves that, seeing, unseen,
-We may of their encounter frankly judge;
-And gather by him, as he is behav'd,
-If't be the affliction of his love or no
-That thus he suffers for.
-
-Queen.
-I shall obey you:--
-And for your part, Ophelia, I do wish
-That your good beauties be the happy cause
-Of Hamlet's wildness: so shall I hope your virtues
-Will bring him to his wonted way again,
-To both your honours.
-
-Oph.
-Madam, I wish it may.
-
-[Exit Queen.]
-
-Pol.
-Ophelia, walk you here.--Gracious, so please you,
-We will bestow ourselves.--[To Ophelia.] Read on this book;
-That show of such an exercise may colour
-Your loneliness.--We are oft to blame in this,--
-'Tis too much prov'd,--that with devotion's visage
-And pious action we do sugar o'er
-The Devil himself.
-
-King.
-[Aside.] O, 'tis too true!
-How smart a lash that speech doth give my conscience!
-The harlot's cheek, beautied with plastering art,
-Is not more ugly to the thing that helps it
-Than is my deed to my most painted word:
-O heavy burden!
-
-Pol.
-I hear him coming: let's withdraw, my lord.
-
-[Exeunt King and Polonius.]
-
-[Enter Hamlet.]
-
-Ham.
-To be, or not to be,--that is the question:--
-Whether 'tis nobler in the mind to suffer
-The slings and arrows of outrageous fortune
-Or to take arms against a sea of troubles,
-And by opposing end them?--To die,--to sleep,--
-No more; and by a sleep to say we end
-The heartache, and the thousand natural shocks
-That flesh is heir to,--'tis a consummation
-Devoutly to be wish'd. To die,--to sleep;--
-To sleep! perchance to dream:--ay, there's the rub;
-For in that sleep of death what dreams may come,
-When we have shuffled off this mortal coil,
-Must give us pause: there's the respect
-That makes calamity of so long life;
-For who would bear the whips and scorns of time,
-The oppressor's wrong, the proud man's contumely,
-The pangs of despis'd love, the law's delay,
-The insolence of office, and the spurns
-That patient merit of the unworthy takes,
-When he himself might his quietus make
-With a bare bodkin? who would these fardels bear,
-To grunt and sweat under a weary life,
-But that the dread of something after death,--
-The undiscover'd country, from whose bourn
-No traveller returns,--puzzles the will,
-And makes us rather bear those ills we have
-Than fly to others that we know not of?
-Thus conscience does make cowards of us all;
-And thus the native hue of resolution
-Is sicklied o'er with the pale cast of thought;
-And enterprises of great pith and moment,
-With this regard, their currents turn awry,
-And lose the name of action.--Soft you now!
-The fair Ophelia!--Nymph, in thy orisons
-Be all my sins remember'd.
-
-Oph.
-Good my lord,
-How does your honour for this many a day?
-
-Ham.
-I humbly thank you; well, well, well.
-
-Oph.
-My lord, I have remembrances of yours
-That I have longed long to re-deliver.
-I pray you, now receive them.
-
-Ham.
-No, not I;
-I never gave you aught.
-
-Oph.
-My honour'd lord, you know right well you did;
-And with them words of so sweet breath compos'd
-As made the things more rich; their perfume lost,
-Take these again; for to the noble mind
-Rich gifts wax poor when givers prove unkind.
-There, my lord.
-
-Ham.
-Ha, ha! are you honest?
-
-Oph.
-My lord?
-
-Ham.
-Are you fair?
-
-Oph.
-What means your lordship?
-
-Ham.
-That if you be honest and fair, your honesty should admit no
-discourse to your beauty.
-
-Oph.
-Could beauty, my lord, have better commerce than with honesty?
-
-Ham.
-Ay, truly; for the power of beauty will sooner transform
-honesty from what it is to a bawd than the force of honesty can
-translate beauty into his likeness: this was sometime a paradox,
-but now the time gives it proof. I did love you once.
-
-Oph.
-Indeed, my lord, you made me believe so.
-
-Ham.
-You should not have believ'd me; for virtue cannot so
-inoculate our old stock but we shall relish of it: I loved you
-not.
-
-Oph.
-I was the more deceived.
-
-Ham.
-Get thee to a nunnery: why wouldst thou be a breeder of
-sinners? I am myself indifferent honest; but yet I could accuse
-me of such things that it were better my mother had not borne me:
-I am very proud, revengeful, ambitious; with more offences at my
-beck than I have thoughts to put them in, imagination to give
-them shape, or time to act them in. What should such fellows as I
-do crawling between earth and heaven? We are arrant knaves, all;
-believe none of us. Go thy ways to a nunnery. Where's your
-father?
-
-Oph.
-At home, my lord.
-
-Ham.
-Let the doors be shut upon him, that he may play the fool
-nowhere but in's own house. Farewell.
-
-Oph.
-O, help him, you sweet heavens!
-
-Ham.
-If thou dost marry, I'll give thee this plague for thy dowry,--
-be thou as chaste as ice, as pure as snow, thou shalt not escape
-calumny. Get thee to a nunnery, go: farewell. Or, if thou wilt
-needs marry, marry a fool; for wise men know well enough what
-monsters you make of them. To a nunnery, go; and quickly too.
-Farewell.
-
-Oph.
-O heavenly powers, restore him!
-
-Ham.
-I have heard of your paintings too, well enough; God hath
-given you one face, and you make yourselves another: you jig, you
-amble, and you lisp, and nickname God's creatures, and make your
-wantonness your ignorance. Go to, I'll no more on't; it hath made
-me mad. I say, we will have no more marriages: those that are
-married already, all but one, shall live; the rest shall keep as
-they are. To a nunnery, go.
-
-[Exit.]
-
-Oph.
-O, what a noble mind is here o'erthrown!
-The courtier's, scholar's, soldier's, eye, tongue, sword,
-The expectancy and rose of the fair state,
-The glass of fashion and the mould of form,
-The observ'd of all observers,--quite, quite down!
-And I, of ladies most deject and wretched
-That suck'd the honey of his music vows,
-Now see that noble and most sovereign reason,
-Like sweet bells jangled, out of tune and harsh;
-That unmatch'd form and feature of blown youth
-Blasted with ecstasy: O, woe is me,
-To have seen what I have seen, see what I see!
-
-[Re-enter King and Polonius.]
-
-King.
-Love! his affections do not that way tend;
-Nor what he spake, though it lack'd form a little,
-Was not like madness. There's something in his soul
-O'er which his melancholy sits on brood;
-And I do doubt the hatch and the disclose
-Will be some danger: which for to prevent,
-I have in quick determination
-Thus set it down:--he shall with speed to England
-For the demand of our neglected tribute:
-Haply the seas, and countries different,
-With variable objects, shall expel
-This something-settled matter in his heart;
-Whereon his brains still beating puts him thus
-From fashion of himself. What think you on't?
-
-Pol.
-It shall do well: but yet do I believe
-The origin and commencement of his grief
-Sprung from neglected love.--How now, Ophelia!
-You need not tell us what Lord Hamlet said;
-We heard it all.--My lord, do as you please;
-But if you hold it fit, after the play,
-Let his queen mother all alone entreat him
-To show his grief: let her be round with him;
-And I'll be plac'd, so please you, in the ear
-Of all their conference. If she find him not,
-To England send him; or confine him where
-Your wisdom best shall think.
-
-King.
-It shall be so:
-Madness in great ones must not unwatch'd go.
-
-[Exeunt.]
-
-
-
-Scene II. A hall in the Castle.
-
-[Enter Hamlet and cartain Players.]
-
-Ham.
-Speak the speech, I pray you, as I pronounced it to you,
-trippingly on the tongue: but if you mouth it, as many of your
-players do, I had as lief the town crier spoke my lines. Nor do
-not saw the air too much with your hand, thus, but use all
-gently: for in the very torrent, tempest, and, as I may say,
-whirlwind of passion, you must acquire and beget a
-temperance that may give it smoothness. O, it offends me to the
-soul, to hear a robustious periwig-pated fellow tear a passion to
-tatters, to very rags, to split the cars of the groundlings, who,
-for the most part, are capable of nothing but inexplicable dumb
-shows and noise: I would have such a fellow whipped for o'erdoing
-Termagant; it out-herods Herod: pray you avoid it.
-
-I Player.
-I warrant your honour.
-
-Ham.
-Be not too tame neither; but let your own discretion be your
-tutor: suit the action to the word, the word to the action; with
-this special observance, that you o'erstep not the modesty of
-nature: for anything so overdone is from the purpose of playing,
-whose end, both at the first and now, was and is, to hold, as
-'twere, the mirror up to nature; to show virtue her own image,
-scorn her own image, and the very age and body of the time his
-form and pressure. Now, this overdone, or come tardy off, though
-it make the unskilful laugh, cannot but make the judicious
-grieve; the censure of the which one must in your allowance,
-o'erweigh a whole theatre of others. O, there be players that I
-have seen play,--and heard others praise, and that highly,--not
-to speak it profanely, that, neither having the accent of
-Christians, nor the gait of Christian, pagan, nor man, have so
-strutted and bellowed that I have thought some of nature's
-journeymen had made men, and not made them well, they imitated
-humanity so abominably.
-
-I Player.
-I hope we have reform'd that indifferently with us, sir.
-
-Ham.
-O, reform it altogether. And let those that play your clowns
-speak no more than is set down for them: for there be of them
-that will themselves laugh, to set on some quantity of barren
-spectators to laugh too, though in the meantime some necessary
-question of the play be then to be considered: that's villanous
-and shows a most pitiful ambition in the fool that uses it. Go
-make you ready.
-
-[Exeunt Players.]
-
-[Enter Polonius, Rosencrantz, and Guildenstern.]
-
-How now, my lord! will the king hear this piece of work?
-
-Pol.
-And the queen too, and that presently.
-
-Ham.
-Bid the players make haste.
-
-[Exit Polonius.]
-
-Will you two help to hasten them?
-
-Ros. and Guil.
-We will, my lord.
-
-[Exeunt Ros. and Guil.]
-
-Ham.
-What, ho, Horatio!
-
-[Enter Horatio.]
-
-Hor.
-Here, sweet lord, at your service.
-
-Ham.
-Horatio, thou art e'en as just a man
-As e'er my conversation cop'd withal.
-
-Hor.
-O, my dear lord,--
-
-Ham.
-Nay, do not think I flatter;
-For what advancement may I hope from thee,
-That no revenue hast, but thy good spirits,
-To feed and clothe thee? Why should the poor be flatter'd?
-No, let the candied tongue lick absurd pomp;
-And crook the pregnant hinges of the knee
-Where thrift may follow fawning. Dost thou hear?
-Since my dear soul was mistress of her choice,
-And could of men distinguish, her election
-Hath seal'd thee for herself: for thou hast been
-As one, in suffering all, that suffers nothing;
-A man that Fortune's buffets and rewards
-Hast ta'en with equal thanks: and bles'd are those
-Whose blood and judgment are so well commingled
-That they are not a pipe for Fortune's finger
-To sound what stop she please. Give me that man
-That is not passion's slave, and I will wear him
-In my heart's core, ay, in my heart of heart,
-As I do thee.--Something too much of this.--
-There is a play to-night before the king;
-One scene of it comes near the circumstance,
-Which I have told thee, of my father's death:
-I pr'ythee, when thou see'st that act a-foot,
-Even with the very comment of thy soul
-Observe mine uncle: if his occulted guilt
-Do not itself unkennel in one speech,
-It is a damned ghost that we have seen;
-And my imaginations are as foul
-As Vulcan's stithy. Give him heedful note;
-For I mine eyes will rivet to his face;
-And, after, we will both our judgments join
-In censure of his seeming.
-
-Hor.
-Well, my lord:
-If he steal aught the whilst this play is playing,
-And scape detecting, I will pay the theft.
-
-Ham.
-They are coming to the play. I must be idle:
-Get you a place.
-
-[Danish march. A flourish. Enter King, Queen, Polonius, Ophelia,
-Rosencrantz, Guildenstern, and others.]
-
-King.
-How fares our cousin Hamlet?
-
-Ham.
-Excellent, i' faith; of the chameleon's dish: I eat the air,
-promise-crammed: you cannot feed capons so.
-
-King.
-I have nothing with this answer, Hamlet; these words are not
-mine.
-
-Ham.
-No, nor mine now. My lord, you play'd once i' the university, you
-say? [To Polonius.]
-
-Pol.
-That did I, my lord, and was accounted a good actor.
-
-Ham.
-What did you enact?
-
-Pol.
-I did enact Julius Caesar; I was kill'd i' the Capitol; Brutus
-killed me.
-
-Ham.
-It was a brute part of him to kill so capital a calf there.--Be
-the players ready?
-
-Ros.
-Ay, my lord; they stay upon your patience.
-
-Queen.
-Come hither, my dear Hamlet, sit by me.
-
-Ham.
-No, good mother, here's metal more attractive.
-
-Pol.
-O, ho! do you mark that? [To the King.]
-
-Ham.
-Lady, shall I lie in your lap?
-[Lying down at Ophelia's feet.]
-
-Oph.
-No, my lord.
-
-Ham.
-I mean, my head upon your lap?
-
-Oph.
-Ay, my lord.
-
-Ham.
-Do you think I meant country matters?
-
-Oph.
-I think nothing, my lord.
-
-Ham.
-That's a fair thought to lie between maids' legs.
-
-Oph.
-What is, my lord?
-
-Ham.
-Nothing.
-
-Oph.
-You are merry, my lord.
-
-Ham.
-Who, I?
-
-Oph.
-Ay, my lord.
-
-Ham.
-O, your only jig-maker! What should a man do but be merry?
-for look you how cheerfully my mother looks, and my father died
-within 's two hours.
-
-Oph.
-Nay, 'tis twice two months, my lord.
-
-Ham.
-So long? Nay then, let the devil wear black, for I'll have a
-suit of sables. O heavens! die two months ago, and not forgotten
-yet? Then there's hope a great man's memory may outlive his life
-half a year: but, by'r lady, he must build churches then; or else
-shall he suffer not thinking on, with the hobby-horse, whose
-epitaph is 'For, O, for, O, the hobby-horse is forgot!'
-
-[Trumpets sound. The dumb show enters.]
-
-[Enter a King and a Queen very lovingly; the Queen embracing
-him and he her. She kneels, and makes show of protestation
-unto him. He takes her up, and declines his head upon her
-neck: lays him down upon a bank of flowers: she, seeing
-him asleep, leaves him. Anon comes in a fellow, takes off his
-crown, kisses it, pours poison in the king's ears, and exit. The
-Queen returns, finds the King dead, and makes passionate action.
-The Poisoner with some three or four Mutes, comes in again,
-seeming to lament with her. The dead body is carried away. The
-Poisoner wooes the Queen with gifts; she seems loth and unwilling
-awhile, but in the end accepts his love.]
-
-[Exeunt.]
-
-Oph.
-What means this, my lord?
-
-Ham.
-Marry, this is miching mallecho; it means mischief.
-
-Oph.
-Belike this show imports the argument of the play.
-
-[Enter Prologue.]
-
-Ham.
-We shall know by this fellow: the players cannot keep counsel;
-they'll tell all.
-
-Oph.
-Will he tell us what this show meant?
-
-Ham.
-Ay, or any show that you'll show him: be not you ashamed to
-show, he'll not shame to tell you what it means.
-
-Oph.
-You are naught, you are naught: I'll mark the play.
-
-Pro.
- For us, and for our tragedy,
- Here stooping to your clemency,
- We beg your hearing patiently.
-
-Ham.
-Is this a prologue, or the posy of a ring?
-
-Oph.
-'Tis brief, my lord.
-
-Ham.
-As woman's love.
-
-[Enter a King and a Queen.]
-
-P. King.
-Full thirty times hath Phoebus' cart gone round
-Neptune's salt wash and Tellus' orbed ground,
-And thirty dozen moons with borrow'd sheen
-About the world have times twelve thirties been,
-Since love our hearts, and Hymen did our hands,
-Unite commutual in most sacred bands.
-
-P. Queen.
-So many journeys may the sun and moon
-Make us again count o'er ere love be done!
-But, woe is me, you are so sick of late,
-So far from cheer and from your former state.
-That I distrust you. Yet, though I distrust,
-Discomfort you, my lord, it nothing must:
-For women's fear and love holds quantity;
-In neither aught, or in extremity.
-Now, what my love is, proof hath made you know;
-And as my love is siz'd, my fear is so:
-Where love is great, the littlest doubts are fear;
-Where little fears grow great, great love grows there.
-
-P. King.
-Faith, I must leave thee, love, and shortly too;
-My operant powers their functions leave to do:
-And thou shalt live in this fair world behind,
-Honour'd, belov'd, and haply one as kind
-For husband shalt thou,--
-
-P. Queen.
-O, confound the rest!
-Such love must needs be treason in my breast:
-In second husband let me be accurst!
-None wed the second but who kill'd the first.
-
-Ham.
-[Aside.] Wormwood, wormwood!
-
-P. Queen.
-The instances that second marriage move
-Are base respects of thrift, but none of love.
-A second time I kill my husband dead
-When second husband kisses me in bed.
-
-P. King.
-I do believe you think what now you speak;
-But what we do determine oft we break.
-Purpose is but the slave to memory;
-Of violent birth, but poor validity:
-Which now, like fruit unripe, sticks on the tree;
-But fall unshaken when they mellow be.
-Most necessary 'tis that we forget
-To pay ourselves what to ourselves is debt:
-What to ourselves in passion we propose,
-The passion ending, doth the purpose lose.
-The violence of either grief or joy
-Their own enactures with themselves destroy:
-Where joy most revels, grief doth most lament;
-Grief joys, joy grieves, on slender accident.
-This world is not for aye; nor 'tis not strange
-That even our loves should with our fortunes change;
-For 'tis a question left us yet to prove,
-Whether love lead fortune, or else fortune love.
-The great man down, you mark his favourite flies,
-The poor advanc'd makes friends of enemies;
-And hitherto doth love on fortune tend:
-For who not needs shall never lack a friend;
-And who in want a hollow friend doth try,
-Directly seasons him his enemy.
-But, orderly to end where I begun,--
-Our wills and fates do so contrary run
-That our devices still are overthrown;
-Our thoughts are ours, their ends none of our own:
-So think thou wilt no second husband wed;
-But die thy thoughts when thy first lord is dead.
-
-P. Queen.
-Nor earth to me give food, nor heaven light!
-Sport and repose lock from me day and night!
-To desperation turn my trust and hope!
-An anchor's cheer in prison be my scope!
-Each opposite that blanks the face of joy
-Meet what I would have well, and it destroy!
-Both here and hence pursue me lasting strife,
-If, once a widow, ever I be wife!
-
-Ham.
-If she should break it now! [To Ophelia.]
-
-P. King.
-'Tis deeply sworn. Sweet, leave me here awhile;
-My spirits grow dull, and fain I would beguile
-The tedious day with sleep.
-[Sleeps.]
-
-P. Queen.
-Sleep rock thy brain,
-And never come mischance between us twain!
-
-[Exit.]
-
-Ham.
-Madam, how like you this play?
-
-Queen.
-The lady protests too much, methinks.
-
-Ham.
-O, but she'll keep her word.
-
-King.
-Have you heard the argument? Is there no offence in't?
-
-Ham.
-No, no! They do but jest, poison in jest; no offence i' the
-world.
-
-King.
-What do you call the play?
-
-Ham.
-The Mouse-trap. Marry, how? Tropically. This play is the
-image of a murder done in Vienna: Gonzago is the duke's name;
-his wife, Baptista: you shall see anon; 'tis a knavish piece of
-work: but what o' that? your majesty, and we that have free
-souls, it touches us not: let the gall'd jade wince; our withers
-are unwrung.
-
-[Enter Lucianus.]
-
-This is one Lucianus, nephew to the King.
-
-Oph.
-You are a good chorus, my lord.
-
-Ham.
-I could interpret between you and your love, if I could see
-the puppets dallying.
-
-Oph.
-You are keen, my lord, you are keen.
-
-Ham.
-It would cost you a groaning to take off my edge.
-
-Oph.
-Still better, and worse.
-
-Ham.
-So you must take your husbands.--Begin, murderer; pox, leave
-thy damnable faces, and begin. Come:--'The croaking raven doth
-bellow for revenge.'
-
-Luc.
-Thoughts black, hands apt, drugs fit, and time agreeing;
-Confederate season, else no creature seeing;
-Thou mixture rank, of midnight weeds collected,
-With Hecate's ban thrice blasted, thrice infected,
-Thy natural magic and dire property
-On wholesome life usurp immediately.
-
-[Pours the poison into the sleeper's ears.]
-
-Ham.
-He poisons him i' the garden for's estate. His name's Gonzago:
-The story is extant, and written in very choice Italian; you
-shall see anon how the murderer gets the love of Gonzago's wife.
-
-Oph.
-The King rises.
-
-Ham.
-What, frighted with false fire!
-
-Queen.
-How fares my lord?
-
-Pol.
-Give o'er the play.
-
-King.
-Give me some light:--away!
-
-All.
-Lights, lights, lights!
-
-[Exeunt all but Hamlet and Horatio.]
-
-Ham.
- Why, let the strucken deer go weep,
- The hart ungalled play;
- For some must watch, while some must sleep:
- So runs the world away.--
-Would not this, sir, and a forest of feathers--if the rest of my
-fortunes turn Turk with me,--with two Provincial roses on my
-razed shoes, get me a fellowship in a cry of players, sir?
-
-Hor.
-Half a share.
-
-Ham.
- A whole one, I.
- For thou dost know, O Damon dear,
- This realm dismantled was
- Of Jove himself; and now reigns here
- A very, very--pajock.
-
-Hor.
-You might have rhymed.
-
-Ham.
-O good Horatio, I'll take the ghost's word for a thousand
-pound! Didst perceive?
-
-Hor.
-Very well, my lord.
-
-Ham.
-Upon the talk of the poisoning?--
-
-Hor.
-I did very well note him.
-
-Ham.
-Ah, ha!--Come, some music! Come, the recorders!--
- For if the king like not the comedy,
- Why then, belike he likes it not, perdy.
-Come, some music!
-
-[Enter Rosencrantz and Guildenstern.]
-
-Guil.
-Good my lord, vouchsafe me a word with you.
-
-Ham.
-Sir, a whole history.
-
-Guil.
-The king, sir--
-
-Ham.
-Ay, sir, what of him?
-
-Guil.
-Is, in his retirement, marvellous distempered.
-
-Ham.
-With drink, sir?
-
-Guil.
-No, my lord; rather with choler.
-
-Ham.
-Your wisdom should show itself more richer to signify this to
-the doctor; for me to put him to his purgation would perhaps
-plunge him into far more choler.
-
-Guil.
-Good my lord, put your discourse into some frame, and start
-not so wildly from my affair.
-
-Ham.
-I am tame, sir:--pronounce.
-
-Guil.
-The queen, your mother, in most great affliction of spirit,
-hath sent me to you.
-
-Ham.
-You are welcome.
-
-Guil.
-Nay, good my lord, this courtesy is not of the right breed.
-If it shall please you to make me a wholesome answer, I will do
-your mother's commandment: if not, your pardon and my return
-shall be the end of my business.
-
-Ham.
-Sir, I cannot.
-
-Guil.
-What, my lord?
-
-Ham.
-Make you a wholesome answer; my wit's diseased: but, sir, such
-answer as I can make, you shall command; or rather, as you say,
-my mother: therefore no more, but to the matter: my mother, you
-say,--
-
-Ros.
-Then thus she says: your behaviour hath struck her into
-amazement and admiration.
-
-Ham.
-O wonderful son, that can so stonish a mother!--But is there no
-sequel at the heels of this mother's admiration?
-
-Ros.
-She desires to speak with you in her closet ere you go to bed.
-
-Ham.
-We shall obey, were she ten times our mother. Have you any
-further trade with us?
-
-Ros.
-My lord, you once did love me.
-
-Ham.
-And so I do still, by these pickers and stealers.
-
-Ros.
-Good my lord, what is your cause of distemper? you do, surely,
-bar the door upon your own liberty if you deny your griefs to
-your friend.
-
-Ham.
-Sir, I lack advancement.
-
-Ros.
-How can that be, when you have the voice of the king himself
-for your succession in Denmark?
-
-Ham.
-Ay, sir, but 'While the grass grows'--the proverb is something
-musty.
-
-[Re-enter the Players, with recorders.]
-
-O, the recorders:--let me see one.--To withdraw with you:--why do
-you go about to recover the wind of me, as if you would drive me
-into a toil?
-
-Guil.
-O my lord, if my duty be too bold, my love is too unmannerly.
-
-Ham.
-I do not well understand that. Will you play upon this pipe?
-
-Guil.
-My lord, I cannot.
-
-Ham.
-I pray you.
-
-Guil.
-Believe me, I cannot.
-
-Ham.
-I do beseech you.
-
-Guil.
-I know, no touch of it, my lord.
-
-Ham.
-'Tis as easy as lying: govern these ventages with your
-finger and thumb, give it breath with your mouth, and it will
-discourse most eloquent music. Look you, these are the stops.
-
-Guil.
-But these cannot I command to any utterance of harmony; I
-have not the skill.
-
-Ham.
-Why, look you now, how unworthy a thing you make of me! You
-would play upon me; you would seem to know my stops; you would
-pluck out the heart of my mystery; you would sound me from my
-lowest note to the top of my compass; and there is much music,
-excellent voice, in this little organ, yet cannot you make it
-speak. 'Sblood, do you think I am easier to be played on than a
-pipe? Call me what instrument you will, though you can fret me,
-you cannot play upon me.
-
-[Enter Polonius.]
-
-God bless you, sir!
-
-Pol.
-My lord, the queen would speak with you, and presently.
-
-Ham.
-Do you see yonder cloud that's almost in shape of a camel?
-
-Pol.
-By the mass, and 'tis like a camel indeed.
-
-Ham.
-Methinks it is like a weasel.
-
-Pol.
-It is backed like a weasel.
-
-Ham.
-Or like a whale.
-
-Pol.
-Very like a whale.
-
-Ham.
-Then will I come to my mother by and by.--They fool me to the
-top of my bent.--I will come by and by.
-
-Pol.
-I will say so.
-
-[Exit.]
-
-Ham.
-By-and-by is easily said.
-
-[Exit Polonius.]
-
---Leave me, friends.
-
-[Exeunt Ros, Guil., Hor., and Players.]
-
-'Tis now the very witching time of night,
-When churchyards yawn, and hell itself breathes out
-Contagion to this world: now could I drink hot blood,
-And do such bitter business as the day
-Would quake to look on. Soft! now to my mother.--
-O heart, lose not thy nature; let not ever
-The soul of Nero enter this firm bosom:
-Let me be cruel, not unnatural;
-I will speak daggers to her, but use none;
-My tongue and soul in this be hypocrites,--
-How in my words somever she be shent,
-To give them seals never, my soul, consent!
-
-[Exit.]
-
-
-
-Scene III. A room in the Castle.
-
-[Enter King, Rosencrantz, and Guildenstern.]
-
-King.
-I like him not; nor stands it safe with us
-To let his madness range. Therefore prepare you;
-I your commission will forthwith dispatch,
-And he to England shall along with you:
-The terms of our estate may not endure
-Hazard so near us as doth hourly grow
-Out of his lunacies.
-
-Guil.
-We will ourselves provide:
-Most holy and religious fear it is
-To keep those many many bodies safe
-That live and feed upon your majesty.
-
-Ros.
-The single and peculiar life is bound,
-With all the strength and armour of the mind,
-To keep itself from 'noyance; but much more
-That spirit upon whose weal depend and rest
-The lives of many. The cease of majesty
-Dies not alone; but like a gulf doth draw
-What's near it with it: it is a massy wheel,
-Fix'd on the summit of the highest mount,
-To whose huge spokes ten thousand lesser things
-Are mortis'd and adjoin'd; which, when it falls,
-Each small annexment, petty consequence,
-Attends the boisterous ruin. Never alone
-Did the king sigh, but with a general groan.
-
-King.
-Arm you, I pray you, to this speedy voyage;
-For we will fetters put upon this fear,
-Which now goes too free-footed.
-
-Ros and Guil.
-We will haste us.
-
-[Exeunt Ros. and Guil.]
-
-[Enter Polonius.]
-
-Pol.
-My lord, he's going to his mother's closet:
-Behind the arras I'll convey myself
-To hear the process; I'll warrant she'll tax him home:
-And, as you said, and wisely was it said,
-'Tis meet that some more audience than a mother,
-Since nature makes them partial, should o'erhear
-The speech, of vantage. Fare you well, my liege:
-I'll call upon you ere you go to bed,
-And tell you what I know.
-
-King.
-Thanks, dear my lord.
-
-[Exit Polonius.]
-
-O, my offence is rank, it smells to heaven;
-It hath the primal eldest curse upon't,--
-A brother's murder!--Pray can I not,
-Though inclination be as sharp as will:
-My stronger guilt defeats my strong intent;
-And, like a man to double business bound,
-I stand in pause where I shall first begin,
-And both neglect. What if this cursed hand
-Were thicker than itself with brother's blood,--
-Is there not rain enough in the sweet heavens
-To wash it white as snow? Whereto serves mercy
-But to confront the visage of offence?
-And what's in prayer but this twofold force,--
-To be forestalled ere we come to fall,
-Or pardon'd being down? Then I'll look up;
-My fault is past. But, O, what form of prayer
-Can serve my turn? Forgive me my foul murder!--
-That cannot be; since I am still possess'd
-Of those effects for which I did the murder,--
-My crown, mine own ambition, and my queen.
-May one be pardon'd and retain the offence?
-In the corrupted currents of this world
-Offence's gilded hand may shove by justice;
-And oft 'tis seen the wicked prize itself
-Buys out the law; but 'tis not so above;
-There is no shuffling;--there the action lies
-In his true nature; and we ourselves compell'd,
-Even to the teeth and forehead of our faults,
-To give in evidence. What then? what rests?
-Try what repentance can: what can it not?
-Yet what can it when one cannot repent?
-O wretched state! O bosom black as death!
-O limed soul, that, struggling to be free,
-Art more engag'd! Help, angels! Make assay:
-Bow, stubborn knees; and, heart, with strings of steel,
-Be soft as sinews of the new-born babe!
-All may be well.
-
-[Retires and kneels.]
-
-[Enter Hamlet.]
-
-Ham.
-Now might I do it pat, now he is praying;
-And now I'll do't;--and so he goes to heaven;
-And so am I reveng'd.--that would be scann'd:
-A villain kills my father; and for that,
-I, his sole son, do this same villain send
-To heaven.
-O, this is hire and salary, not revenge.
-He took my father grossly, full of bread;
-With all his crimes broad blown, as flush as May;
-And how his audit stands, who knows save heaven?
-But in our circumstance and course of thought,
-'Tis heavy with him: and am I, then, reveng'd,
-To take him in the purging of his soul,
-When he is fit and season'd for his passage?
-No.
-Up, sword, and know thou a more horrid hent:
-When he is drunk asleep; or in his rage;
-Or in the incestuous pleasure of his bed;
-At gaming, swearing; or about some act
-That has no relish of salvation in't;--
-Then trip him, that his heels may kick at heaven;
-And that his soul may be as damn'd and black
-As hell, whereto it goes. My mother stays:
-This physic but prolongs thy sickly days.
-
-[Exit.]
-
-[The King rises and advances.]
-
-King.
-My words fly up, my thoughts remain below:
-Words without thoughts never to heaven go.
-
-[Exit.]
-
-
-
-Scene IV. Another room in the castle.
-
-[Enter Queen and Polonius.]
-
-Pol.
-He will come straight. Look you lay home to him:
-Tell him his pranks have been too broad to bear with,
-And that your grace hath screen'd and stood between
-Much heat and him. I'll silence me e'en here.
-Pray you, be round with him.
-
-Ham.
-[Within.] Mother, mother, mother!
-
-Queen.
-I'll warrant you:
-Fear me not:--withdraw; I hear him coming.
-
-[Polonius goes behind the arras.]
-
-[Enter Hamlet.]
-
-Ham.
-Now, mother, what's the matter?
-
-Queen.
-Hamlet, thou hast thy father much offended.
-
-Ham.
-Mother, you have my father much offended.
-
-Queen.
-Come, come, you answer with an idle tongue.
-
-Ham.
-Go, go, you question with a wicked tongue.
-
-Queen.
-Why, how now, Hamlet!
-
-Ham.
-What's the matter now?
-
-Queen.
-Have you forgot me?
-
-Ham.
-No, by the rood, not so:
-You are the Queen, your husband's brother's wife,
-And,--would it were not so!--you are my mother.
-
-Queen.
-Nay, then, I'll set those to you that can speak.
-
-Ham.
-Come, come, and sit you down; you shall not budge;
-You go not till I set you up a glass
-Where you may see the inmost part of you.
-
-Queen.
-What wilt thou do? thou wilt not murder me?--
-Help, help, ho!
-
-Pol.
-[Behind.] What, ho! help, help, help!
-
-Ham.
-How now? a rat? [Draws.]
-Dead for a ducat, dead!
-
-[Makes a pass through the arras.]
-
-Pol.
-[Behind.] O, I am slain!
-
-[Falls and dies.]
-
-Queen.
-O me, what hast thou done?
-
-Ham.
-Nay, I know not: is it the king?
-
-[Draws forth Polonius.]
-
-Queen.
-O, what a rash and bloody deed is this!
-
-Ham.
-A bloody deed!--almost as bad, good mother,
-As kill a king and marry with his brother.
-
-Queen.
-As kill a king!
-
-Ham.
-Ay, lady, 'twas my word.--
-Thou wretched, rash, intruding fool, farewell!
-[To Polonius.]
-I took thee for thy better: take thy fortune;
-Thou find'st to be too busy is some danger.--
-Leave wringing of your hands: peace! sit you down,
-And let me wring your heart: for so I shall,
-If it be made of penetrable stuff;
-If damned custom have not braz'd it so
-That it is proof and bulwark against sense.
-
-Queen.
-What have I done, that thou dar'st wag thy tongue
-In noise so rude against me?
-
-Ham.
-Such an act
-That blurs the grace and blush of modesty;
-Calls virtue hypocrite; takes off the rose
-From the fair forehead of an innocent love,
-And sets a blister there; makes marriage-vows
-As false as dicers' oaths: O, such a deed
-As from the body of contraction plucks
-The very soul, and sweet religion makes
-A rhapsody of words: heaven's face doth glow;
-Yea, this solidity and compound mass,
-With tristful visage, as against the doom,
-Is thought-sick at the act.
-
-Queen.
-Ah me, what act,
-That roars so loud, and thunders in the index?
-
-Ham.
-Look here upon this picture, and on this,--
-The counterfeit presentment of two brothers.
-See what a grace was seated on this brow;
-Hyperion's curls; the front of Jove himself;
-An eye like Mars, to threaten and command;
-A station like the herald Mercury
-New lighted on a heaven-kissing hill:
-A combination and a form, indeed,
-Where every god did seem to set his seal,
-To give the world assurance of a man;
-This was your husband.--Look you now what follows:
-Here is your husband, like a milldew'd ear
-Blasting his wholesome brother. Have you eyes?
-Could you on this fair mountain leave to feed,
-And batten on this moor? Ha! have you eyes?
-You cannot call it love; for at your age
-The hey-day in the blood is tame, it's humble,
-And waits upon the judgment: and what judgment
-Would step from this to this? Sense, sure, you have,
-Else could you not have motion: but sure that sense
-Is apoplex'd; for madness would not err;
-Nor sense to ecstacy was ne'er so thrall'd
-But it reserv'd some quantity of choice
-To serve in such a difference. What devil was't
-That thus hath cozen'd you at hoodman-blind?
-Eyes without feeling, feeling without sight,
-Ears without hands or eyes, smelling sans all,
-Or but a sickly part of one true sense
-Could not so mope.
-O shame! where is thy blush? Rebellious hell,
-If thou canst mutine in a matron's bones,
-To flaming youth let virtue be as wax,
-And melt in her own fire: proclaim no shame
-When the compulsive ardour gives the charge,
-Since frost itself as actively doth burn,
-And reason panders will.
-
-Queen.
-O Hamlet, speak no more:
-Thou turn'st mine eyes into my very soul;
-And there I see such black and grained spots
-As will not leave their tinct.
-
-Ham.
-Nay, but to live
-In the rank sweat of an enseamed bed,
-Stew'd in corruption, honeying and making love
-Over the nasty sty,--
-
-Queen.
-O, speak to me no more;
-These words like daggers enter in mine ears;
-No more, sweet Hamlet.
-
-Ham.
-A murderer and a villain;
-A slave that is not twentieth part the tithe
-Of your precedent lord; a vice of kings;
-A cutpurse of the empire and the rule,
-That from a shelf the precious diadem stole
-And put it in his pocket!
-
-Queen.
-No more.
-
-Ham.
-A king of shreds and patches!--
-
-[Enter Ghost.]
-
-Save me and hover o'er me with your wings,
-You heavenly guards!--What would your gracious figure?
-
-Queen.
-Alas, he's mad!
-
-Ham.
-Do you not come your tardy son to chide,
-That, laps'd in time and passion, lets go by
-The important acting of your dread command?
-O, say!
-
-Ghost.
-Do not forget. This visitation
-Is but to whet thy almost blunted purpose.
-But, look, amazement on thy mother sits:
-O, step between her and her fighting soul,--
-Conceit in weakest bodies strongest works,--
-Speak to her, Hamlet.
-
-Ham.
-How is it with you, lady?
-
-Queen.
-Alas, how is't with you,
-That you do bend your eye on vacancy,
-And with the incorporal air do hold discourse?
-Forth at your eyes your spirits wildly peep;
-And, as the sleeping soldiers in the alarm,
-Your bedded hairs, like life in excrements,
-Start up and stand an end. O gentle son,
-Upon the heat and flame of thy distemper
-Sprinkle cool patience! Whereon do you look?
-
-Ham.
-On him, on him! Look you how pale he glares!
-His form and cause conjoin'd, preaching to stones,
-Would make them capable.--Do not look upon me;
-Lest with this piteous action you convert
-My stern effects: then what I have to do
-Will want true colour; tears perchance for blood.
-
-Queen.
-To whom do you speak this?
-
-Ham.
-Do you see nothing there?
-
-Queen.
-Nothing at all; yet all that is I see.
-
-Ham.
-Nor did you nothing hear?
-
-Queen.
-No, nothing but ourselves.
-
-Ham.
-Why, look you there! look how it steals away!
-My father, in his habit as he liv'd!
-Look, where he goes, even now out at the portal!
-
-[Exit Ghost.]
-
-Queen.
-This is the very coinage of your brain:
-This bodiless creation ecstasy
-Is very cunning in.
-
-Ham.
-Ecstasy!
-My pulse, as yours, doth temperately keep time,
-And makes as healthful music: it is not madness
-That I have utter'd: bring me to the test,
-And I the matter will re-word; which madness
-Would gambol from. Mother, for love of grace,
-Lay not that flattering unction to your soul
-That not your trespass, but my madness speaks:
-It will but skin and film the ulcerous place,
-Whilst rank corruption, mining all within,
-Infects unseen. Confess yourself to heaven;
-Repent what's past; avoid what is to come;
-And do not spread the compost on the weeds,
-To make them ranker. Forgive me this my virtue;
-For in the fatness of these pursy times
-Virtue itself of vice must pardon beg,
-Yea, curb and woo for leave to do him good.
-
-Queen.
-O Hamlet, thou hast cleft my heart in twain.
-
-Ham.
-O, throw away the worser part of it,
-And live the purer with the other half.
-Good night: but go not to mine uncle's bed;
-Assume a virtue, if you have it not.
-That monster custom, who all sense doth eat,
-Of habits evil, is angel yet in this,--
-That to the use of actions fair and good
-He likewise gives a frock or livery
-That aptly is put on. Refrain to-night;
-And that shall lend a kind of easiness
-To the next abstinence: the next more easy;
-For use almost can change the stamp of nature,
-And either curb the devil, or throw him out
-With wondrous potency. Once more, good-night:
-And when you are desirous to be bles'd,
-I'll blessing beg of you.--For this same lord
-[Pointing to Polonius.]
-I do repent; but heaven hath pleas'd it so,
-To punish me with this, and this with me,
-That I must be their scourge and minister.
-I will bestow him, and will answer well
-The death I gave him. So again, good-night.--
-I must be cruel, only to be kind:
-Thus bad begins, and worse remains behind.--
-One word more, good lady.
-
-Queen.
-What shall I do?
-
-Ham.
-Not this, by no means, that I bid you do:
-Let the bloat king tempt you again to bed;
-Pinch wanton on your cheek; call you his mouse;
-And let him, for a pair of reechy kisses,
-Or paddling in your neck with his damn'd fingers,
-Make you to ravel all this matter out,
-That I essentially am not in madness,
-But mad in craft. 'Twere good you let him know;
-For who that's but a queen, fair, sober, wise,
-Would from a paddock, from a bat, a gib,
-Such dear concernings hide? who would do so?
-No, in despite of sense and secrecy,
-Unpeg the basket on the house's top,
-Let the birds fly, and, like the famous ape,
-To try conclusions, in the basket creep
-And break your own neck down.
-
-Queen.
-Be thou assur'd, if words be made of breath,
-And breath of life, I have no life to breathe
-What thou hast said to me.
-
-Ham.
-I must to England; you know that?
-
-Queen.
-Alack,
-I had forgot: 'tis so concluded on.
-
-Ham.
-There's letters seal'd: and my two schoolfellows,--
-Whom I will trust as I will adders fang'd,--
-They bear the mandate; they must sweep my way
-And marshal me to knavery. Let it work;
-For 'tis the sport to have the enginer
-Hoist with his own petard: and 't shall go hard
-But I will delve one yard below their mines
-And blow them at the moon: O, 'tis most sweet,
-When in one line two crafts directly meet.--
-This man shall set me packing:
-I'll lug the guts into the neighbour room.--
-Mother, good-night.--Indeed, this counsellor
-Is now most still, most secret, and most grave,
-Who was in life a foolish peating knave.
-Come, sir, to draw toward an end with you:--
-Good night, mother.
-
-[Exeunt severally; Hamlet, dragging out Polonius.]
-
-
-
-ACT IV.
-
-Scene I. A room in the Castle.
-
-[Enter King, Queen, Rosencrantz and Guildenstern.]
-
-King.
-There's matter in these sighs. These profound heaves
-You must translate: 'tis fit we understand them.
-Where is your son?
-
-Queen.
-Bestow this place on us a little while.
-
-[To Rosencrantz and Guildenstern, who go out.]
-
-Ah, my good lord, what have I seen to-night!
-
-King.
-What, Gertrude? How does Hamlet?
-
-Queen.
-Mad as the sea and wind, when both contend
-Which is the mightier: in his lawless fit
-Behind the arras hearing something stir,
-Whips out his rapier, cries 'A rat, a rat!'
-And in this brainish apprehension, kills
-The unseen good old man.
-
-King.
-O heavy deed!
-It had been so with us, had we been there:
-His liberty is full of threats to all;
-To you yourself, to us, to every one.
-Alas, how shall this bloody deed be answer'd?
-It will be laid to us, whose providence
-Should have kept short, restrain'd, and out of haunt
-This mad young man. But so much was our love
-We would not understand what was most fit;
-But, like the owner of a foul disease,
-To keep it from divulging, let it feed
-Even on the pith of life. Where is he gone?
-
-Queen.
-To draw apart the body he hath kill'd:
-O'er whom his very madness, like some ore
-Among a mineral of metals base,
-Shows itself pure: he weeps for what is done.
-
-King.
-O Gertrude, come away!
-The sun no sooner shall the mountains touch
-But we will ship him hence: and this vile deed
-We must with all our majesty and skill
-Both countenance and excuse.--Ho, Guildenstern!
-
-[Re-enter Rosencrantz and Guildenstern.]
-
-Friends both, go join you with some further aid:
-Hamlet in madness hath Polonius slain,
-And from his mother's closet hath he dragg'd him:
-Go seek him out; speak fair, and bring the body
-Into the chapel. I pray you, haste in this.
-
-[Exeunt Rosencrantz and Guildenstern.]
-
-Come, Gertrude, we'll call up our wisest friends;
-And let them know both what we mean to do
-And what's untimely done: so haply slander,--
-Whose whisper o'er the world's diameter,
-As level as the cannon to his blank,
-Transports his poison'd shot,--may miss our name,
-And hit the woundless air.--O, come away!
-My soul is full of discord and dismay.
-
-[Exeunt.]
-
-Scene II. Another room in the Castle.
-
-[Enter Hamlet.]
-
-Ham.
-Safely stowed.
-
-Ros. and Guil.
-[Within.] Hamlet! Lord Hamlet!
-
-Ham.
-What noise? who calls on Hamlet? O, here they come.
-
-[Enter Rosencrantz and Guildenstern.]
-
-Ros.
-What have you done, my lord, with the dead body?
-
-Ham.
-Compounded it with dust, whereto 'tis kin.
-
-Ros.
-Tell us where 'tis, that we may take it thence,
-And bear it to the chapel.
-
-Ham.
-Do not believe it.
-
-Ros.
-Believe what?
-
-Ham.
-That I can keep your counsel, and not mine own. Besides, to be
-demanded of a sponge!--what replication should be made by the son
-of a king?
-
-Ros.
-Take you me for a sponge, my lord?
-
-Ham.
-Ay, sir; that soaks up the King's countenance, his rewards,
-his authorities. But such officers do the king best service in
-the end: he keeps them, like an ape, in the corner of his jaw;
-first mouthed, to be last swallowed: when he needs what you have
-gleaned, it is but squeezing you, and, sponge, you shall be dry
-again.
-
-Ros.
-I understand you not, my lord.
-
-Ham.
-I am glad of it: a knavish speech sleeps in a foolish ear.
-
-Ros.
-My lord, you must tell us where the body is and go with us to
-the king.
-
-Ham.
-The body is with the king, but the king is not with the body.
-The king is a thing,--
-
-Guil.
-A thing, my lord!
-
-Ham.
-Of nothing: bring me to him. Hide fox, and all after.
-
-[Exeunt.]
-
-
-
-Scene III. Another room in the Castle.
-
-[Enter King,attended.]
-
-King.
-I have sent to seek him and to find the body.
-How dangerous is it that this man goes loose!
-Yet must not we put the strong law on him:
-He's lov'd of the distracted multitude,
-Who like not in their judgment, but their eyes;
-And where 'tis so, the offender's scourge is weigh'd,
-But never the offence. To bear all smooth and even,
-This sudden sending him away must seem
-Deliberate pause: diseases desperate grown
-By desperate appliance are reliev'd,
-Or not at all.
-
-[Enter Rosencrantz.]
-
-How now! what hath befall'n?
-
-Ros.
-Where the dead body is bestow'd, my lord,
-We cannot get from him.
-
-King.
-But where is he?
-
-Ros.
-Without, my lord; guarded, to know your pleasure.
-
-King.
-Bring him before us.
-
-Ros.
-Ho, Guildenstern! bring in my lord.
-
-[Enter Hamlet and Guildenstern.]
-
-King.
-Now, Hamlet, where's Polonius?
-
-Ham.
-At supper.
-
-King.
-At supper! where?
-
-Ham.
-Not where he eats, but where he is eaten: a certain
-convocation of politic worms are e'en at him. Your worm is your
-only emperor for diet: we fat all creatures else to fat us, and
-we fat ourselves for maggots: your fat king and your lean beggar
-is but variable service,--two dishes, but to one table: that's
-the end.
-
-King.
-Alas, alas!
-
-Ham.
-A man may fish with the worm that hath eat of a king, and eat
-of the fish that hath fed of that worm.
-
-King.
-What dost thou mean by this?
-
-Ham.
-Nothing but to show you how a king may go a progress through
-the guts of a beggar.
-
-King.
-Where is Polonius?
-
-Ham.
-In heaven: send thither to see: if your messenger find him not
-there, seek him i' the other place yourself. But, indeed, if you
-find him not within this month, you shall nose him as you go up
-the stairs into the lobby.
-
-King.
-Go seek him there. [To some Attendants.]
-
-Ham.
-He will stay till you come.
-
-[Exeunt Attendants.]
-
-King.
-Hamlet, this deed, for thine especial safety,--
-Which we do tender, as we dearly grieve
-For that which thou hast done,--must send thee hence
-With fiery quickness: therefore prepare thyself;
-The bark is ready, and the wind at help,
-The associates tend, and everything is bent
-For England.
-
-Ham.
-For England!
-
-King.
-Ay, Hamlet.
-
-Ham.
-Good.
-
-King.
-So is it, if thou knew'st our purposes.
-
-Ham.
-I see a cherub that sees them.--But, come; for England!--
-Farewell, dear mother.
-
-King.
-Thy loving father, Hamlet.
-
-Ham.
-My mother: father and mother is man and wife; man and wife is
-one flesh; and so, my mother.--Come, for England!
-
-[Exit.]
-
-King.
-Follow him at foot; tempt him with speed aboard;
-Delay it not; I'll have him hence to-night:
-Away! for everything is seal'd and done
-That else leans on the affair: pray you, make haste.
-
-[Exeunt Rosencrantz and Guildenstern.]
-
-And, England, if my love thou hold'st at aught,--
-As my great power thereof may give thee sense,
-Since yet thy cicatrice looks raw and red
-After the Danish sword, and thy free awe
-Pays homage to us,--thou mayst not coldly set
-Our sovereign process; which imports at full,
-By letters conjuring to that effect,
-The present death of Hamlet. Do it, England;
-For like the hectic in my blood he rages,
-And thou must cure me: till I know 'tis done,
-Howe'er my haps, my joys were ne'er begun.
-
-[Exit.]
-
-
-
-Scene IV. A plain in Denmark.
-
-[Enter Fortinbras, and Forces marching.]
-
-For.
-Go, Captain, from me greet the Danish king:
-Tell him that, by his license, Fortinbras
-Craves the conveyance of a promis'd march
-Over his kingdom. You know the rendezvous.
-If that his majesty would aught with us,
-We shall express our duty in his eye;
-And let him know so.
-
-Capt.
-I will do't, my lord.
-
-For.
-Go softly on.
-
-[Exeunt all For. and Forces.]
-
-[Enter Hamlet, Rosencrantz, Guildenstern, &c.]
-
-Ham.
-Good sir, whose powers are these?
-
-Capt.
-They are of Norway, sir.
-
-Ham.
-How purpos'd, sir, I pray you?
-
-Capt.
-Against some part of Poland.
-
-Ham.
-Who commands them, sir?
-
-Capt.
-The nephew to old Norway, Fortinbras.
-
-Ham.
-Goes it against the main of Poland, sir,
-Or for some frontier?
-
-Capt.
-Truly to speak, and with no addition,
-We go to gain a little patch of ground
-That hath in it no profit but the name.
-To pay five ducats, five, I would not farm it;
-Nor will it yield to Norway or the Pole
-A ranker rate, should it be sold in fee.
-
-Ham.
-Why, then the Polack never will defend it.
-
-Capt.
-Yes, it is already garrison'd.
-
-Ham.
-Two thousand souls and twenty thousand ducats
-Will not debate the question of this straw:
-This is the imposthume of much wealth and peace,
-That inward breaks, and shows no cause without
-Why the man dies.--I humbly thank you, sir.
-
-Capt.
-God b' wi' you, sir.
-
-[Exit.]
-
-Ros.
-Will't please you go, my lord?
-
-Ham.
-I'll be with you straight. Go a little before.
-
-[Exeunt all but Hamlet.]
-
-How all occasions do inform against me
-And spur my dull revenge! What is a man,
-If his chief good and market of his time
-Be but to sleep and feed? a beast, no more.
-Sure he that made us with such large discourse,
-Looking before and after, gave us not
-That capability and godlike reason
-To fust in us unus'd. Now, whether it be
-Bestial oblivion, or some craven scruple
-Of thinking too precisely on the event,--
-A thought which, quarter'd, hath but one part wisdom
-And ever three parts coward,--I do not know
-Why yet I live to say 'This thing's to do;'
-Sith I have cause, and will, and strength, and means
-To do't. Examples, gross as earth, exhort me:
-Witness this army, of such mass and charge,
-Led by a delicate and tender prince;
-Whose spirit, with divine ambition puff'd,
-Makes mouths at the invisible event;
-Exposing what is mortal and unsure
-To all that fortune, death, and danger dare,
-Even for an egg-shell. Rightly to be great
-Is not to stir without great argument,
-But greatly to find quarrel in a straw
-When honour's at the stake. How stand I, then,
-That have a father kill'd, a mother stain'd,
-Excitements of my reason and my blood,
-And let all sleep? while, to my shame, I see
-The imminent death of twenty thousand men
-That, for a fantasy and trick of fame,
-Go to their graves like beds; fight for a plot
-Whereon the numbers cannot try the cause,
-Which is not tomb enough and continent
-To hide the slain?--O, from this time forth,
-My thoughts be bloody, or be nothing worth!
-
-[Exit.]
-
-
-
-Scene V. Elsinore. A room in the Castle.
-
-[Enter Queen and Horatio.]
-
-Queen.
-I will not speak with her.
-
-Gent.
-She is importunate; indeed distract:
-Her mood will needs be pitied.
-
-Queen.
-What would she have?
-
-Gent.
-She speaks much of her father; says she hears
-There's tricks i' the world, and hems, and beats her heart;
-Spurns enviously at straws; speaks things in doubt,
-That carry but half sense: her speech is nothing,
-Yet the unshaped use of it doth move
-The hearers to collection; they aim at it,
-And botch the words up fit to their own thoughts;
-Which, as her winks, and nods, and gestures yield them,
-Indeed would make one think there might be thought,
-Though nothing sure, yet much unhappily.
-'Twere good she were spoken with; for she may strew
-Dangerous conjectures in ill-breeding minds.
-
-Queen.
-Let her come in.
-
-[Exit Horatio.]
-
-To my sick soul, as sin's true nature is,
-Each toy seems Prologue to some great amiss:
-So full of artless jealousy is guilt,
-It spills itself in fearing to be spilt.
-
-[Re-enter Horatio with Ophelia.]
-
-Oph.
-Where is the beauteous majesty of Denmark?
-
-Queen.
-How now, Ophelia?
-
-Oph. [Sings.]
- How should I your true love know
- From another one?
- By his cockle bat and' staff
- And his sandal shoon.
-
-Queen.
-Alas, sweet lady, what imports this song?
-
-Oph.
-Say you? nay, pray you, mark.
-[Sings.]
- He is dead and gone, lady,
- He is dead and gone;
- At his head a grass green turf,
- At his heels a stone.
-
-Queen.
-Nay, but Ophelia--
-
-Oph.
-Pray you, mark.
-[Sings.]
- White his shroud as the mountain snow,
-
-[Enter King.]
-
-Queen.
-Alas, look here, my lord!
-
-Oph.
-[Sings.]
- Larded all with sweet flowers;
- Which bewept to the grave did go
- With true-love showers.
-
-King.
-How do you, pretty lady?
-
-Oph.
-Well, God dild you! They say the owl was a baker's daughter.
-Lord, we know what we are, but know not what we may be. God be at
-your table!
-
-King.
-Conceit upon her father.
-
-Oph.
-Pray you, let's have no words of this; but when they ask you what
-it means, say you this:
-[Sings.]
- To-morrow is Saint Valentine's day
- All in the morning bedtime,
- And I a maid at your window,
- To be your Valentine.
-
- Then up he rose and donn'd his clothes,
- And dupp'd the chamber door,
- Let in the maid, that out a maid
- Never departed more.
-
-King.
-Pretty Ophelia!
-
-Oph.
-Indeed, la, without an oath, I'll make an end on't:
-[Sings.]
- By Gis and by Saint Charity,
- Alack, and fie for shame!
- Young men will do't if they come to't;
- By cock, they are to blame.
-
- Quoth she, before you tumbled me,
- You promis'd me to wed.
- So would I ha' done, by yonder sun,
- An thou hadst not come to my bed.
-
-King.
-How long hath she been thus?
-
-Oph.
-I hope all will be well. We must be patient: but I cannot
-choose but weep, to think they would lay him i' the cold ground.
-My brother shall know of it: and so I thank you for your good
-counsel.--Come, my coach!--Good night, ladies; good night, sweet
-ladies; good night, good night.
-
-[Exit.]
-
-King.
-Follow her close; give her good watch, I pray you.
-
-[Exit Horatio.]
-
-O, this is the poison of deep grief; it springs
-All from her father's death. O Gertrude, Gertrude,
-When sorrows come, they come not single spies,
-But in battalions! First, her father slain:
-Next, your son gone; and he most violent author
-Of his own just remove: the people muddied,
-Thick and and unwholesome in their thoughts and whispers
-For good Polonius' death; and we have done but greenly
-In hugger-mugger to inter him: poor Ophelia
-Divided from herself and her fair judgment,
-Without the which we are pictures or mere beasts:
-Last, and as much containing as all these,
-Her brother is in secret come from France;
-Feeds on his wonder, keeps himself in clouds,
-And wants not buzzers to infect his ear
-With pestilent speeches of his father's death;
-Wherein necessity, of matter beggar'd,
-Will nothing stick our person to arraign
-In ear and ear. O my dear Gertrude, this,
-Like to a murdering piece, in many places
-Give, me superfluous death.
-
-[A noise within.]
-
-Queen.
-Alack, what noise is this?
-
-King.
-Where are my Switzers? let them guard the door.
-
-[Enter a Gentleman.]
-
-What is the matter?
-
-Gent.
-Save yourself, my lord:
-The ocean, overpeering of his list,
-Eats not the flats with more impetuous haste
-Than young Laertes, in a riotous head,
-O'erbears your offices. The rabble call him lord;
-And, as the world were now but to begin,
-Antiquity forgot, custom not known,
-The ratifiers and props of every word,
-They cry 'Choose we! Laertes shall be king!'
-Caps, hands, and tongues applaud it to the clouds,
-'Laertes shall be king! Laertes king!'
-
-Queen.
-How cheerfully on the false trail they cry!
-O, this is counter, you false Danish dogs!
-
-[A noise within.]
-
-King.
-The doors are broke.
-
-[Enter Laertes, armed; Danes following.]
-
-Laer.
-Where is this king?--Sirs, stand you all without.
-
-Danes.
-No, let's come in.
-
-Laer.
-I pray you, give me leave.
-
-Danes.
-We will, we will.
-
-[They retire without the door.]
-
-Laer.
-I thank you:--keep the door.--O thou vile king,
-Give me my father!
-
-Queen.
-Calmly, good Laertes.
-
-Laer.
-That drop of blood that's calm proclaims me bastard;
-Cries cuckold to my father; brands the harlot
-Even here, between the chaste unsmirched brow
-Of my true mother.
-
-King.
-What is the cause, Laertes,
-That thy rebellion looks so giant-like?--
-Let him go, Gertrude; do not fear our person:
-There's such divinity doth hedge a king,
-That treason can but peep to what it would,
-Acts little of his will.--Tell me, Laertes,
-Why thou art thus incens'd.--Let him go, Gertrude:--
-Speak, man.
-
-Laer.
-Where is my father?
-
-King.
-Dead.
-
-Queen.
-But not by him.
-
-King.
-Let him demand his fill.
-
-Laer.
-How came he dead? I'll not be juggled with:
-To hell, allegiance! vows, to the blackest devil!
-Conscience and grace, to the profoundest pit!
-I dare damnation:--to this point I stand,--
-That both the worlds, I give to negligence,
-Let come what comes; only I'll be reveng'd
-Most throughly for my father.
-
-King.
-Who shall stay you?
-
-Laer.
-My will, not all the world:
-And for my means, I'll husband them so well,
-They shall go far with little.
-
-King.
-Good Laertes,
-If you desire to know the certainty
-Of your dear father's death, is't writ in your revenge
-That, sweepstake, you will draw both friend and foe,
-Winner and loser?
-
-Laer.
-None but his enemies.
-
-King.
-Will you know them then?
-
-Laer.
-To his good friends thus wide I'll ope my arms;
-And, like the kind life-rendering pelican,
-Repast them with my blood.
-
-King.
-Why, now you speak
-Like a good child and a true gentleman.
-That I am guiltless of your father's death,
-And am most sensibly in grief for it,
-It shall as level to your judgment pierce
-As day does to your eye.
-
-Danes.
-[Within] Let her come in.
-
-Laer.
-How now! What noise is that?
-
-[Re-enter Ophelia, fantastically dressed with straws and
-flowers.]
-
-O heat, dry up my brains! tears seven times salt,
-Burn out the sense and virtue of mine eye!--
-By heaven, thy madness shall be paid by weight,
-Till our scale turn the beam. O rose of May!
-Dear maid, kind sister, sweet Ophelia!--
-O heavens! is't possible a young maid's wits
-Should be as mortal as an old man's life?
-Nature is fine in love; and where 'tis fine,
-It sends some precious instance of itself
-After the thing it loves.
-
-Oph.
-[Sings.]
- They bore him barefac'd on the bier
- Hey no nonny, nonny, hey nonny
- And on his grave rain'd many a tear.--
-
-Fare you well, my dove!
-
-Laer.
-Hadst thou thy wits, and didst persuade revenge,
-It could not move thus.
-
-Oph.
-You must sing 'Down a-down, an you call him a-down-a.' O,
-how the wheel becomes it! It is the false steward, that stole his
-master's daughter.
-
-Laer.
-This nothing's more than matter.
-
-Oph.
-There's rosemary, that's for remembrance; pray, love,
-remember: and there is pansies, that's for thoughts.
-
-Laer.
-A document in madness,--thoughts and remembrance fitted.
-
-Oph.
-There's fennel for you, and columbines:--there's rue for you;
-and here's some for me:--we may call it herb of grace o'
-Sundays:--O, you must wear your rue with a difference.--There's a
-daisy:--I would give you some violets, but they wither'd all when
-my father died:--they say he made a good end,--
-[Sings.]
- For bonny sweet Robin is all my joy,--
-
-Laer.
-Thought and affliction, passion, hell itself,
-She turns to favour and to prettiness.
-
-Oph.
-[Sings.]
- And will he not come again?
- And will he not come again?
- No, no, he is dead,
- Go to thy death-bed,
- He never will come again.
-
- His beard was as white as snow,
- All flaxen was his poll:
- He is gone, he is gone,
- And we cast away moan:
- God ha' mercy on his soul!
-
-And of all Christian souls, I pray God.--God b' wi' ye.
-
-[Exit.]
-
-Laer.
-Do you see this, O God?
-
-King.
-Laertes, I must commune with your grief,
-Or you deny me right. Go but apart,
-Make choice of whom your wisest friends you will,
-And they shall hear and judge 'twixt you and me.
-If by direct or by collateral hand
-They find us touch'd, we will our kingdom give,
-Our crown, our life, and all that we call ours,
-To you in satisfaction; but if not,
-Be you content to lend your patience to us,
-And we shall jointly labour with your soul
-To give it due content.
-
-Laer.
-Let this be so;
-His means of death, his obscure burial,--
-No trophy, sword, nor hatchment o'er his bones,
-No noble rite nor formal ostentation,--
-Cry to be heard, as 'twere from heaven to earth,
-That I must call't in question.
-
-King.
-So you shall;
-And where the offence is let the great axe fall.
-I pray you go with me.
-
-[Exeunt.]
-
-
-
-Scene VI. Another room in the Castle.
-
-[Enter Horatio and a Servant.]
-
-Hor.
-What are they that would speak with me?
-
-Servant.
-Sailors, sir: they say they have letters for you.
-
-Hor.
-Let them come in.
-
-[Exit Servant.]
-
-I do not know from what part of the world
-I should be greeted, if not from Lord Hamlet.
-
-[Enter Sailors.]
-
-I Sailor.
-God bless you, sir.
-
-Hor.
-Let him bless thee too.
-
-Sailor.
-He shall, sir, an't please him. There's a letter for you,
-sir,--it comes from the ambassador that was bound for England; if
-your name be Horatio, as I am let to know it is.
-
-Hor.
-[Reads.] 'Horatio, when thou shalt have overlooked
-this, give these fellows some means to the king: they have
-letters for him. Ere we were two days old at sea, a pirate of
-very warlike appointment gave us chase. Finding ourselves too
-slow of sail, we put on a compelled valour, and in the grapple I
-boarded them: on the instant they got clear of our ship; so I
-alone became their prisoner. They have dealt with me like thieves
-of mercy: but they knew what they did; I am to do a good turn for
-them. Let the king have the letters I have sent; and repair thou
-to me with as much haste as thou wouldst fly death. I have words
-to speak in thine ear will make thee dumb; yet are they much too
-light for the bore of the matter. These good fellows will bring
-thee where I am. Rosencrantz and Guildenstern hold their course
-for England: of them I have much to tell thee. Farewell.
-He that thou knowest thine, HAMLET.'
-
-Come, I will give you way for these your letters;
-And do't the speedier, that you may direct me
-To him from whom you brought them.
-
-[Exeunt.]
-
-
-
-Scene VII. Another room in the Castle.
-
-[Enter King and Laertes.]
-
-King.
-Now must your conscience my acquittance seal,
-And you must put me in your heart for friend,
-Sith you have heard, and with a knowing ear,
-That he which hath your noble father slain
-Pursu'd my life.
-
-Laer.
-It well appears:--but tell me
-Why you proceeded not against these feats,
-So crimeful and so capital in nature,
-As by your safety, wisdom, all things else,
-You mainly were stirr'd up.
-
-King.
-O, for two special reasons;
-Which may to you, perhaps, seem much unsinew'd,
-But yet to me they are strong. The queen his mother
-Lives almost by his looks; and for myself,--
-My virtue or my plague, be it either which,--
-She's so conjunctive to my life and soul,
-That, as the star moves not but in his sphere,
-I could not but by her. The other motive,
-Why to a public count I might not go,
-Is the great love the general gender bear him;
-Who, dipping all his faults in their affection,
-Would, like the spring that turneth wood to stone,
-Convert his gyves to graces; so that my arrows,
-Too slightly timber'd for so loud a wind,
-Would have reverted to my bow again,
-And not where I had aim'd them.
-
-Laer.
-And so have I a noble father lost;
-A sister driven into desperate terms,--
-Whose worth, if praises may go back again,
-Stood challenger on mount of all the age
-For her perfections:--but my revenge will come.
-
-King.
-Break not your sleeps for that:--you must not think
-That we are made of stuff so flat and dull
-That we can let our beard be shook with danger,
-And think it pastime. You shortly shall hear more:
-I lov'd your father, and we love ourself;
-And that, I hope, will teach you to imagine,--
-
-[Enter a Messenger.]
-
-How now! What news?
-
-Mess.
-Letters, my lord, from Hamlet:
-This to your majesty; this to the queen.
-
-King.
-From Hamlet! Who brought them?
-
-Mess.
-Sailors, my lord, they say; I saw them not:
-They were given me by Claudio:--he receiv'd them
-Of him that brought them.
-
-King.
-Laertes, you shall hear them.
-Leave us.
-
-[Exit Messenger.]
-
-[Reads]'High and mighty,--You shall know I am set naked on your
-kingdom. To-morrow shall I beg leave to see your kingly eyes:
-when I shall, first asking your pardon thereunto, recount the
-occasions of my sudden and more strange return. HAMLET.'
-
-What should this mean? Are all the rest come back?
-Or is it some abuse, and no such thing?
-
-Laer.
-Know you the hand?
-
-King.
-'Tis Hamlet's character:--'Naked!'--
-And in a postscript here, he says 'alone.'
-Can you advise me?
-
-Laer.
-I am lost in it, my lord. But let him come;
-It warms the very sickness in my heart
-That I shall live and tell him to his teeth,
-'Thus didest thou.'
-
-King.
-If it be so, Laertes,--
-As how should it be so? how otherwise?--
-Will you be rul'd by me?
-
-Laer.
-Ay, my lord;
-So you will not o'errule me to a peace.
-
-King.
-To thine own peace. If he be now return'd--
-As checking at his voyage, and that he means
-No more to undertake it,--I will work him
-To exploit, now ripe in my device,
-Under the which he shall not choose but fall:
-And for his death no wind shall breathe;
-But even his mother shall uncharge the practice
-And call it accident.
-
-Laer.
-My lord, I will be rul'd;
-The rather if you could devise it so
-That I might be the organ.
-
-King.
-It falls right.
-You have been talk'd of since your travel much,
-And that in Hamlet's hearing, for a quality
-Wherein they say you shine: your sum of parts
-Did not together pluck such envy from him
-As did that one; and that, in my regard,
-Of the unworthiest siege.
-
-Laer.
-What part is that, my lord?
-
-King.
-A very riband in the cap of youth,
-Yet needful too; for youth no less becomes
-The light and careless livery that it wears
-Than settled age his sables and his weeds,
-Importing health and graveness.--Two months since,
-Here was a gentleman of Normandy,--
-I've seen myself, and serv'd against, the French,
-And they can well on horseback: but this gallant
-Had witchcraft in't: he grew unto his seat;
-And to such wondrous doing brought his horse,
-As had he been incorps'd and demi-natur'd
-With the brave beast: so far he topp'd my thought
-That I, in forgery of shapes and tricks,
-Come short of what he did.
-
-Laer.
-A Norman was't?
-
-King.
-A Norman.
-
-Laer.
-Upon my life, Lamond.
-
-King.
-The very same.
-
-Laer.
-I know him well: he is the brooch indeed
-And gem of all the nation.
-
-King.
-He made confession of you;
-And gave you such a masterly report
-For art and exercise in your defence,
-And for your rapier most especially,
-That he cried out, 'twould be a sight indeed
-If one could match you: the scrimers of their nation
-He swore, had neither motion, guard, nor eye,
-If you oppos'd them. Sir, this report of his
-Did Hamlet so envenom with his envy
-That he could nothing do but wish and beg
-Your sudden coming o'er, to play with him.
-Now, out of this,--
-
-Laer.
-What out of this, my lord?
-
-King.
-Laertes, was your father dear to you?
-Or are you like the painting of a sorrow,
-A face without a heart?
-
-Laer.
-Why ask you this?
-
-King.
-Not that I think you did not love your father;
-But that I know love is begun by time,
-And that I see, in passages of proof,
-Time qualifies the spark and fire of it.
-There lives within the very flame of love
-A kind of wick or snuff that will abate it;
-And nothing is at a like goodness still;
-For goodness, growing to a plurisy,
-Dies in his own too much: that we would do,
-We should do when we would; for this 'would' changes,
-And hath abatements and delays as many
-As there are tongues, are hands, are accidents;
-And then this 'should' is like a spendthrift sigh,
-That hurts by easing. But to the quick o' the ulcer:--
-Hamlet comes back: what would you undertake
-To show yourself your father's son in deed
-More than in words?
-
-Laer.
-To cut his throat i' the church.
-
-King.
-No place, indeed, should murder sanctuarize;
-Revenge should have no bounds. But, good Laertes,
-Will you do this, keep close within your chamber.
-Hamlet return'd shall know you are come home:
-We'll put on those shall praise your excellence
-And set a double varnish on the fame
-The Frenchman gave you; bring you in fine together
-And wager on your heads: he, being remiss,
-Most generous, and free from all contriving,
-Will not peruse the foils; so that with ease,
-Or with a little shuffling, you may choose
-A sword unbated, and, in a pass of practice,
-Requite him for your father.
-
-Laer.
-I will do't:
-And for that purpose I'll anoint my sword.
-I bought an unction of a mountebank,
-So mortal that, but dip a knife in it,
-Where it draws blood no cataplasm so rare,
-Collected from all simples that have virtue
-Under the moon, can save the thing from death
-This is but scratch'd withal: I'll touch my point
-With this contagion, that, if I gall him slightly,
-It may be death.
-
-King.
-Let's further think of this;
-Weigh what convenience both of time and means
-May fit us to our shape: if this should fail,
-And that our drift look through our bad performance.
-'Twere better not assay'd: therefore this project
-Should have a back or second, that might hold
-If this did blast in proof. Soft! let me see:--
-We'll make a solemn wager on your cunnings,--
-I ha't:
-When in your motion you are hot and dry,--
-As make your bouts more violent to that end,--
-And that he calls for drink, I'll have prepar'd him
-A chalice for the nonce; whereon but sipping,
-If he by chance escape your venom'd stuck,
-Our purpose may hold there.
-
-[Enter Queen.]
-
-How now, sweet queen!
-
-Queen.
-One woe doth tread upon another's heel,
-So fast they follow:--your sister's drown'd, Laertes.
-
-Laer.
-Drown'd! O, where?
-
-Queen.
-There is a willow grows aslant a brook,
-That shows his hoar leaves in the glassy stream;
-There with fantastic garlands did she come
-Of crowflowers, nettles, daisies, and long purples,
-That liberal shepherds give a grosser name,
-But our cold maids do dead men's fingers call them.
-There, on the pendant boughs her coronet weeds
-Clamb'ring to hang, an envious sliver broke;
-When down her weedy trophies and herself
-Fell in the weeping brook. Her clothes spread wide;
-And, mermaid-like, awhile they bore her up;
-Which time she chaunted snatches of old tunes;
-As one incapable of her own distress,
-Or like a creature native and indu'd
-Unto that element: but long it could not be
-Till that her garments, heavy with their drink,
-Pull'd the poor wretch from her melodious lay
-To muddy death.
-
-Laer.
-Alas, then she is drown'd?
-
-Queen.
-Drown'd, drown'd.
-
-Laer.
-Too much of water hast thou, poor Ophelia,
-And therefore I forbid my tears: but yet
-It is our trick; nature her custom holds,
-Let shame say what it will: when these are gone,
-The woman will be out.--Adieu, my lord:
-I have a speech of fire, that fain would blaze,
-But that this folly douts it.
-
-[Exit.]
-
-King.
-Let's follow, Gertrude;
-How much I had to do to calm his rage!
-Now fear I this will give it start again;
-Therefore let's follow.
-
-[Exeunt.]
-
-
-
-ACT V.
-
-Scene I. A churchyard.
-
-[Enter two Clowns, with spades, &c.]
-
-1 Clown.
-Is she to be buried in Christian burial when she wilfully
-seeks her own salvation?
-
-2 Clown.
-I tell thee she is; and therefore make her grave straight: the
-crowner hath sat on her, and finds it Christian burial.
-
-1 Clown.
-How can that be, unless she drowned herself in her own defence?
-
-2 Clown.
-Why, 'tis found so.
-
-1 Clown.
-It must be se offendendo; it cannot be else. For here lies
-the point: if I drown myself wittingly, it argues an act: and an
-act hath three branches; it is to act, to do, and to perform:
-argal, she drowned herself wittingly.
-
-2 Clown.
-Nay, but hear you, goodman delver,--
-
-1 Clown.
-Give me leave. Here lies the water; good: here stands the
-man; good: if the man go to this water and drown himself, it is,
-will he, nill he, he goes,--mark you that: but if the water come
-to him and drown him, he drowns not himself; argal, he that is
-not guilty of his own death shortens not his own life.
-
-2 Clown.
-But is this law?
-
-1 Clown.
-Ay, marry, is't--crowner's quest law.
-
-2 Clown.
-Will you ha' the truth on't? If this had not been a
-gentlewoman, she should have been buried out o' Christian burial.
-
-1 Clown.
-Why, there thou say'st: and the more pity that great folk
-should have countenance in this world to drown or hang themselves
-more than their even Christian.--Come, my spade. There is no
-ancient gentlemen but gardeners, ditchers, and grave-makers: they
-hold up Adam's profession.
-
-2 Clown.
-Was he a gentleman?
-
-1 Clown.
-He was the first that ever bore arms.
-
-2 Clown.
-Why, he had none.
-
-1 Clown.
-What, art a heathen? How dost thou understand the Scripture?
-The Scripture says Adam digg'd: could he dig without arms? I'll
-put another question to thee: if thou answerest me not to the
-purpose, confess thyself,--
-
-2 Clown.
-Go to.
-
-1 Clown.
-What is he that builds stronger than either the mason, the
-shipwright, or the carpenter?
-
-2 Clown.
-The gallows-maker; for that frame outlives a thousand tenants.
-
-1 Clown.
-I like thy wit well, in good faith: the gallows does well;
-but how does it well? it does well to those that do ill: now,
-thou dost ill to say the gallows is built stronger than the
-church; argal, the gallows may do well to thee. To't again, come.
-
-2 Clown.
-Who builds stronger than a mason, a shipwright, or a carpenter?
-
-1 Clown.
-Ay, tell me that, and unyoke.
-
-2 Clown.
-Marry, now I can tell.
-
-1 Clown.
-To't.
-
-2 Clown.
-Mass, I cannot tell.
-
-[Enter Hamlet and Horatio, at a distance.]
-
-1 Clown.
-Cudgel thy brains no more about it, for your dull ass will
-not mend his pace with beating; and when you are asked this
-question next, say 'a grave-maker;' the houses he makes last
-till doomsday. Go, get thee to Yaughan; fetch me a stoup of
-liquor.
-
-[Exit Second Clown.]
-
-[Digs and sings.]
-
- In youth when I did love, did love,
- Methought it was very sweet;
- To contract, O, the time for, ah, my behove,
- O, methought there was nothing meet.
-
-Ham.
-Has this fellow no feeling of his business, that he sings at
-grave-making?
-
-Hor.
-Custom hath made it in him a property of easiness.
-
-Ham.
-'Tis e'en so: the hand of little employment hath the daintier
-sense.
-
-1 Clown.
-[Sings.]
- But age, with his stealing steps,
- Hath claw'd me in his clutch,
- And hath shipp'd me intil the land,
- As if I had never been such.
-
-[Throws up a skull.]
-
-Ham.
-That skull had a tongue in it, and could sing once: how the
-knave jowls it to the ground,as if 'twere Cain's jawbone, that
-did the first murder! This might be the pate of a politician,
-which this ass now o'erreaches; one that would circumvent God,
-might it not?
-
-Hor.
-It might, my lord.
-
-Ham.
-Or of a courtier, which could say 'Good morrow, sweet lord!
-How dost thou, good lord?' This might be my lord such-a-one, that
-praised my lord such-a-one's horse when he meant to beg
-it,--might it not?
-
-Hor.
-Ay, my lord.
-
-Ham.
-Why, e'en so: and now my Lady Worm's; chapless, and knocked
-about the mazard with a sexton's spade: here's fine revolution,
-an we had the trick to see't. Did these bones cost no more the
-breeding but to play at loggets with 'em? mine ache to think
-on't.
-
-1 Clown.
-[Sings.]
- A pickaxe and a spade, a spade,
- For and a shrouding sheet;
- O, a pit of clay for to be made
- For such a guest is meet.
-
-[Throws up another skull].
-
-Ham.
-There's another: why may not that be the skull of a lawyer?
-Where be his quiddits now, his quillets, his cases, his tenures,
-and his tricks? why does he suffer this rude knave now to knock
-him about the sconce with a dirty shovel, and will not tell him
-of his action of battery? Hum! This fellow might be in's time a
-great buyer of land, with his statutes, his recognizances, his
-fines, his double vouchers, his recoveries: is this the fine of
-his fines, and the recovery of his recoveries, to have his fine
-pate full of fine dirt? will his vouchers vouch him no more of
-his purchases, and double ones too, than the length and breadth
-of a pair of indentures? The very conveyances of his lands will
-scarcely lie in this box; and must the inheritor himself have no
-more, ha?
-
-Hor.
-Not a jot more, my lord.
-
-Ham.
-Is not parchment made of sheep-skins?
-
-Hor.
-Ay, my lord, And of calf-skins too.
-
-Ham.
-They are sheep and calves which seek out assurance in that. I
-will speak to this fellow.--Whose grave's this, sir?
-
-1 Clown.
-Mine, sir.
-[Sings.]
- O, a pit of clay for to be made
- For such a guest is meet.
-
-Ham.
-I think it be thine indeed, for thou liest in't.
-
-1 Clown.
-You lie out on't, sir, and therefore 'tis not yours: for my part,
-I do not lie in't, yet it is mine.
-
-Ham.
-Thou dost lie in't, to be in't and say it is thine: 'tis for
-the dead, not for the quick; therefore thou liest.
-
-1 Clown.
-'Tis a quick lie, sir; 't will away again from me to you.
-
-Ham.
-What man dost thou dig it for?
-
-1 Clown.
-For no man, sir.
-
-Ham.
-What woman then?
-
-1 Clown.
-For none neither.
-
-Ham.
-Who is to be buried in't?
-
-1 Clown.
-One that was a woman, sir; but, rest her soul, she's dead.
-
-Ham.
-How absolute the knave is! We must speak by the card, or
-equivocation will undo us. By the Lord, Horatio, these three
-years I have taken note of it, the age is grown so picked that
-the toe of the peasant comes so near the heel of the courtier he
-galls his kibe.--How long hast thou been a grave-maker?
-
-1 Clown.
-Of all the days i' the year, I came to't that day that our
-last King Hamlet overcame Fortinbras.
-
-Ham.
-How long is that since?
-
-1 Clown.
-Cannot you tell that? every fool can tell that: it was the
-very day that young Hamlet was born,--he that is mad, and sent
-into England.
-
-Ham.
-Ay, marry, why was be sent into England?
-
-1 Clown.
-Why, because he was mad: he shall recover his wits there;
-or, if he do not, it's no great matter there.
-
-Ham.
-Why?
-
-1 Clown.
-'Twill not he seen in him there; there the men are as mad as he.
-
-Ham.
-How came he mad?
-
-1 Clown.
-Very strangely, they say.
-
-Ham.
-How strangely?
-
-1 Clown.
-Faith, e'en with losing his wits.
-
-Ham.
-Upon what ground?
-
-1 Clown.
-Why, here in Denmark: I have been sexton here, man and boy,
-thirty years.
-
-Ham.
-How long will a man lie i' the earth ere he rot?
-
-1 Clown.
-Faith, if he be not rotten before he die,--as we have many
-pocky corses now-a-days that will scarce hold the laying in,--he
-will last you some eight year or nine year: a tanner will last
-you nine year.
-
-Ham.
-Why he more than another?
-
-1 Clown.
-Why, sir, his hide is so tann'd with his trade that he will
-keep out water a great while; and your water is a sore decayer of
-your whoreson dead body. Here's a skull now; this skull hath lain
-in the earth three-and-twenty years.
-
-Ham.
-Whose was it?
-
-1 Clown.
-A whoreson, mad fellow's it was: whose do you think it was?
-
-Ham.
-Nay, I know not.
-
-1 Clown.
-A pestilence on him for a mad rogue! 'a pour'd a flagon of
-Rhenish on my head once. This same skull, sir, was Yorick's
-skull, the king's jester.
-
-Ham.
-This?
-
-1 Clown.
-E'en that.
-
-Ham.
-Let me see. [Takes the skull.] Alas, poor Yorick!--I knew him,
-Horatio; a fellow of infinite jest, of most excellent fancy: he
-hath borne me on his back a thousand times; and now, how abhorred
-in my imagination it is! my gorge rises at it. Here hung those
-lips that I have kiss'd I know not how oft. Where be your gibes
-now? your gambols? your songs? your flashes of merriment, that
-were wont to set the table on a roar? Not one now, to mock your
-own grinning? quite chap-fallen? Now, get you to my lady's
-chamber, and tell her, let her paint an inch thick, to this
-favour she must come; make her laugh at that.--Pr'ythee, Horatio,
-tell me one thing.
-
-Hor.
-What's that, my lord?
-
-Ham.
-Dost thou think Alexander looked o' this fashion i' the earth?
-
-Hor.
-E'en so.
-
-Ham.
-And smelt so? Pah!
-
-[Throws down the skull.]
-
-Hor.
-E'en so, my lord.
-
-Ham.
-To what base uses we may return, Horatio! Why may not
-imagination trace the noble dust of Alexander till he find it
-stopping a bung-hole?
-
-Hor.
-'Twere to consider too curiously to consider so.
-
-Ham.
-No, faith, not a jot; but to follow him thither with modesty
-enough, and likelihood to lead it: as thus: Alexander died,
-Alexander was buried, Alexander returneth into dust; the dust is
-earth; of earth we make loam; and why of that loam whereto he
-was converted might they not stop a beer-barrel?
- Imperious Caesar, dead and turn'd to clay,
- Might stop a hole to keep the wind away.
- O, that that earth which kept the world in awe
- Should patch a wall to expel the winter's flaw!
-But soft! but soft! aside!--Here comes the king.
-
-[Enter priests, &c, in procession; the corpse of Ophelia,
-Laertes, and Mourners following; King, Queen, their Trains, &c.]
-
-The queen, the courtiers: who is that they follow?
-And with such maimed rites? This doth betoken
-The corse they follow did with desperate hand
-Fordo it own life: 'twas of some estate.
-Couch we awhile and mark.
-
-[Retiring with Horatio.]
-
-Laer.
-What ceremony else?
-
-Ham.
-That is Laertes,
-A very noble youth: mark.
-
-Laer.
-What ceremony else?
-
-1 Priest.
-Her obsequies have been as far enlarg'd
-As we have warranties: her death was doubtful;
-And, but that great command o'ersways the order,
-She should in ground unsanctified have lodg'd
-Till the last trumpet; for charitable prayers,
-Shards, flints, and pebbles should be thrown on her,
-Yet here she is allowed her virgin rites,
-Her maiden strewments, and the bringing home
-Of bell and burial.
-
-Laer.
-Must there no more be done?
-
-1 Priest.
-No more be done;
-We should profane the service of the dead
-To sing a requiem and such rest to her
-As to peace-parted souls.
-
-Laer.
-Lay her i' the earth;--
-And from her fair and unpolluted flesh
-May violets spring!--I tell thee, churlish priest,
-A ministering angel shall my sister be
-When thou liest howling.
-
-Ham.
-What, the fair Ophelia?
-
-Queen.
-Sweets to the sweet: farewell.
-[Scattering flowers.]
-I hop'd thou shouldst have been my Hamlet's wife;
-I thought thy bride-bed to have deck'd, sweet maid,
-And not have strew'd thy grave.
-
-Laer.
-O, treble woe
-Fall ten times treble on that cursed head
-Whose wicked deed thy most ingenious sense
-Depriv'd thee of!--Hold off the earth awhile,
-Till I have caught her once more in mine arms:
-[Leaps into the grave.]
-Now pile your dust upon the quick and dead,
-Till of this flat a mountain you have made,
-To o'ertop old Pelion or the skyish head
-Of blue Olympus.
-
-Ham.
-[Advancing.]
-What is he whose grief
-Bears such an emphasis? whose phrase of sorrow
-Conjures the wandering stars, and makes them stand
-Like wonder-wounded hearers? this is I,
-Hamlet the Dane.
-[Leaps into the grave.]
-
-Laer.
-The devil take thy soul!
-[Grappling with him.]
-
-Ham.
-Thou pray'st not well.
-I pr'ythee, take thy fingers from my throat;
-For, though I am not splenetive and rash,
-Yet have I in me something dangerous,
-Which let thy wiseness fear: away thy hand!
-
-King.
-Pluck them asunder.
-
-Queen.
-Hamlet! Hamlet!
-
-All.
-Gentlemen!--
-
-Hor.
-Good my lord, be quiet.
-
-[The Attendants part them, and they come out of the grave.]
-
-Ham.
-Why, I will fight with him upon this theme
-Until my eyelids will no longer wag.
-
-Queen.
-O my son, what theme?
-
-Ham.
-I lov'd Ophelia; forty thousand brothers
-Could not, with all their quantity of love,
-Make up my sum.--What wilt thou do for her?
-
-King.
-O, he is mad, Laertes.
-
-Queen.
-For love of God, forbear him!
-
-Ham.
-'Swounds, show me what thou'lt do:
-Woul't weep? woul't fight? woul't fast? woul't tear thyself?
-Woul't drink up eisel? eat a crocodile?
-I'll do't.--Dost thou come here to whine?
-To outface me with leaping in her grave?
-Be buried quick with her, and so will I:
-And, if thou prate of mountains, let them throw
-Millions of acres on us, till our ground,
-Singeing his pate against the burning zone,
-Make Ossa like a wart! Nay, an thou'lt mouth,
-I'll rant as well as thou.
-
-Queen.
-This is mere madness:
-And thus a while the fit will work on him;
-Anon, as patient as the female dove,
-When that her golden couplets are disclos'd,
-His silence will sit drooping.
-
-Ham.
-Hear you, sir;
-What is the reason that you use me thus?
-I lov'd you ever: but it is no matter;
-Let Hercules himself do what he may,
-The cat will mew, and dog will have his day.
-
-[Exit.]
-
-King.
-I pray thee, good Horatio, wait upon him.--
-
-[Exit Horatio.]
-[To Laertes]
-Strengthen your patience in our last night's speech;
-We'll put the matter to the present push.--
-Good Gertrude, set some watch over your son.--
-This grave shall have a living monument:
-An hour of quiet shortly shall we see;
-Till then in patience our proceeding be.
-
-[Exeunt.]
-
-
-
-Scene II. A hall in the Castle.
-
-[Enter Hamlet and Horatio.]
-
-Ham.
-So much for this, sir: now let me see the other;
-You do remember all the circumstance?
-
-Hor.
-Remember it, my lord!
-
-Ham.
-Sir, in my heart there was a kind of fighting
-That would not let me sleep: methought I lay
-Worse than the mutinies in the bilboes. Rashly,
-And prais'd be rashness for it,--let us know,
-Our indiscretion sometime serves us well,
-When our deep plots do fail; and that should teach us
-There's a divinity that shapes our ends,
-Rough-hew them how we will.
-
-Hor.
-That is most certain.
-
-Ham.
-Up from my cabin,
-My sea-gown scarf'd about me, in the dark
-Grop'd I to find out them: had my desire;
-Finger'd their packet; and, in fine, withdrew
-To mine own room again: making so bold,
-My fears forgetting manners, to unseal
-Their grand commission; where I found, Horatio,
-O royal knavery! an exact command,--
-Larded with many several sorts of reasons,
-Importing Denmark's health, and England's too,
-With, ho! such bugs and goblins in my life,--
-That, on the supervise, no leisure bated,
-No, not to stay the grinding of the axe,
-My head should be struck off.
-
-Hor.
-Is't possible?
-
-Ham.
-Here's the commission: read it at more leisure.
-But wilt thou bear me how I did proceed?
-
-Hor.
-I beseech you.
-
-Ham.
-Being thus benetted round with villanies,--
-Or I could make a prologue to my brains,
-They had begun the play,--I sat me down;
-Devis'd a new commission; wrote it fair:
-I once did hold it, as our statists do,
-A baseness to write fair, and labour'd much
-How to forget that learning; but, sir, now
-It did me yeoman's service. Wilt thou know
-The effect of what I wrote?
-
-Hor.
-Ay, good my lord.
-
-Ham.
-An earnest conjuration from the king,--
-As England was his faithful tributary;
-As love between them like the palm might flourish;
-As peace should still her wheaten garland wear
-And stand a comma 'tween their amities;
-And many such-like as's of great charge,--
-That, on the view and know of these contents,
-Without debatement further, more or less,
-He should the bearers put to sudden death,
-Not shriving-time allow'd.
-
-Hor.
-How was this seal'd?
-
-Ham.
-Why, even in that was heaven ordinant.
-I had my father's signet in my purse,
-Which was the model of that Danish seal:
-Folded the writ up in the form of the other;
-Subscrib'd it: gave't the impression; plac'd it safely,
-The changeling never known. Now, the next day
-Was our sea-fight; and what to this was sequent
-Thou know'st already.
-
-Hor.
-So Guildenstern and Rosencrantz go to't.
-
-Ham.
-Why, man, they did make love to this employment;
-They are not near my conscience; their defeat
-Does by their own insinuation grow:
-'Tis dangerous when the baser nature comes
-Between the pass and fell incensed points
-Of mighty opposites.
-
-Hor.
-Why, what a king is this!
-
-Ham.
-Does it not, thinks't thee, stand me now upon,--
-He that hath kill'd my king, and whor'd my mother;
-Popp'd in between the election and my hopes;
-Thrown out his angle for my proper life,
-And with such cozenage--is't not perfect conscience
-To quit him with this arm? and is't not to be damn'd
-To let this canker of our nature come
-In further evil?
-
-Hor.
-It must be shortly known to him from England
-What is the issue of the business there.
-
-Ham.
-It will be short: the interim is mine;
-And a man's life is no more than to say One.
-But I am very sorry, good Horatio,
-That to Laertes I forgot myself;
-For by the image of my cause I see
-The portraiture of his: I'll court his favours:
-But, sure, the bravery of his grief did put me
-Into a towering passion.
-
-Hor.
-Peace; who comes here?
-
-[Enter Osric.]
-
-Osr.
-Your lordship is right welcome back to Denmark.
-
-Ham.
-I humbly thank you, sir. Dost know this water-fly?
-
-Hor.
-No, my good lord.
-
-Ham.
-Thy state is the more gracious; for 'tis a vice to know him. He
-hath much land, and fertile: let a beast be lord of beasts, and
-his crib shall stand at the king's mess; 'tis a chough; but, as I
-say, spacious in the possession of dirt.
-
-Osr.
-Sweet lord, if your lordship were at leisure, I should
-impart a thing to you from his majesty.
-
-Ham.
-I will receive it with all diligence of spirit. Put your
-bonnet to his right use; 'tis for the head.
-
-Osr.
-I thank your lordship, t'is very hot.
-
-Ham.
-No, believe me, 'tis very cold; the wind is northerly.
-
-Osr.
-It is indifferent cold, my lord, indeed.
-
-Ham.
-Methinks it is very sultry and hot for my complexion.
-
-Osr.
-Exceedingly, my lord; it is very sultry,--as 'twere--I cannot
-tell how. But, my lord, his majesty bade me signify to you that
-he has laid a great wager on your head. Sir, this is the
-matter,--
-
-Ham.
-I beseech you, remember,--
-[Hamlet moves him to put on his hat.]
-
-Osr.
-Nay, in good faith; for mine ease, in good faith. Sir, here
-is newly come to court Laertes; believe me, an absolute
-gentleman, full of most excellent differences, of very soft
-society and great showing: indeed, to speak feelingly of him, he
-is the card or calendar of gentry; for you shall find in him the
-continent of what part a gentleman would see.
-
-Ham.
-Sir, his definement suffers no perdition in you;--though, I
-know, to divide him inventorially would dizzy the arithmetic of
-memory, and yet but yaw neither, in respect of his quick sail.
-But, in the verity of extolment, I take him to be a soul of great
-article, and his infusion of such dearth and rareness as, to make
-true diction of him, his semblable is his mirror, and who else
-would trace him, his umbrage, nothing more.
-
-Osr.
-Your lordship speaks most infallibly of him.
-
-Ham.
-The concernancy, sir? why do we wrap the gentleman in our more
-rawer breath?
-
-Osr.
-Sir?
-
-Hor.
-Is't not possible to understand in another tongue? You will do't,
-sir, really.
-
-Ham.
-What imports the nomination of this gentleman?
-
-Osr.
-Of Laertes?
-
-Hor.
-His purse is empty already; all's golden words are spent.
-
-Ham.
-Of him, sir.
-
-Osr.
-I know, you are not ignorant,--
-
-Ham.
-I would you did, sir; yet, in faith, if you did, it would not
-much approve me.--Well, sir.
-
-Osr.
-You are not ignorant of what excellence Laertes is,--
-
-Ham.
-I dare not confess that, lest I should compare with him in
-excellence; but to know a man well were to know himself.
-
-Osr.
-I mean, sir, for his weapon; but in the imputation laid on
-him by them, in his meed he's unfellowed.
-
-Ham.
-What's his weapon?
-
-Osr.
-Rapier and dagger.
-
-Ham.
-That's two of his weapons:--but well.
-
-Osr.
-The king, sir, hath wager'd with him six Barbary horses:
-against the which he has imponed, as I take it, six French
-rapiers and poniards, with their assigns, as girdle, hangers, and
-so: three of the carriages, in faith, are very dear to fancy,
-very responsive to the hilts, most delicate carriages, and of
-very liberal conceit.
-
-Ham.
-What call you the carriages?
-
-Hor.
-I knew you must be edified by the margent ere you had done.
-
-Osr.
-The carriages, sir, are the hangers.
-
-Ham.
-The phrase would be more german to the matter if we could
-carry cannon by our sides. I would it might be hangers till then.
-But, on: six Barbary horses against six French swords, their
-assigns, and three liberal conceited carriages: that's the French
-bet against the Danish: why is this all imponed, as you call it?
-
-Osr.
-The king, sir, hath laid that, in a dozen passes between
-your and him, he shall not exceed you three hits: he hath
-laid on twelve for nine; and it would come to immediate trial
-if your lordship would vouchsafe the answer.
-
-Ham.
-How if I answer no?
-
-Osr.
-I mean, my lord, the opposition of your person in trial.
-
-Ham.
-Sir, I will walk here in the hall: if it please his majesty,
-it is the breathing time of day with me: let the foils be
-brought, the gentleman willing, and the king hold his purpose,
-I will win for him if I can; if not, I will gain nothing but my
-shame and the odd hits.
-
-Osr.
-Shall I re-deliver you e'en so?
-
-Ham.
-To this effect, sir; after what flourish your nature will.
-
-Osr.
-I commend my duty to your lordship.
-
-Ham.
-Yours, yours.
-
-[Exit Osric.]
-
-He does well to commend it himself; there are no tongues else
-for's turn.
-
-Hor.
-This lapwing runs away with the shell on his head.
-
-Ham.
-He did comply with his dug before he suck'd it. Thus has he,--and
-many more of the same bevy that I know the drossy age dotes on,--
-only got the tune of the time and outward habit of encounter;
-a kind of yesty collection, which carries them through and
-through the most fanned and winnowed opinions; and do but blow
-them to their trial, the bubbles are out,
-
-[Enter a Lord.]
-
-Lord.
-My lord, his majesty commended him to you by young Osric,
-who brings back to him that you attend him in the hall: he sends
-to know if your pleasure hold to play with Laertes, or that you
-will take longer time.
-
-Ham.
-I am constant to my purposes; they follow the king's pleasure:
-if his fitness speaks, mine is ready; now or whensoever, provided
-I be so able as now.
-
-Lord.
-The King and Queen and all are coming down.
-
-Ham.
-In happy time.
-
-Lord.
-The queen desires you to use some gentle entertainment to
-Laertes before you fall to play.
-
-Ham.
-She well instructs me.
-
-[Exit Lord.]
-
-Hor.
-You will lose this wager, my lord.
-
-Ham.
-I do not think so; since he went into France I have been in
-continual practice: I shall win at the odds. But thou wouldst not
-think how ill all's here about my heart: but it is no matter.
-
-Hor.
-Nay, good my lord,--
-
-Ham.
-It is but foolery; but it is such a kind of gain-giving as
-would perhaps trouble a woman.
-
-Hor.
-If your mind dislike anything, obey it: I will forestall their
-repair hither, and say you are not fit.
-
-Ham.
-Not a whit, we defy augury: there's a special providence in
-the fall of a sparrow. If it be now, 'tis not to come; if it be
-not to come, it will be now; if it be not now, yet it will come:
-the readiness is all: since no man has aught of what he leaves,
-what is't to leave betimes?
-
-[Enter King, Queen, Laertes, Lords, Osric, and Attendants with
-foils &c.]
-
-King.
-Come, Hamlet, come, and take this hand from me.
-
-[The King puts Laertes' hand into Hamlet's.]
-
-Ham.
-Give me your pardon, sir: I have done you wrong:
-But pardon't, as you are a gentleman.
-This presence knows, and you must needs have heard,
-How I am punish'd with sore distraction.
-What I have done
-That might your nature, honour, and exception
-Roughly awake, I here proclaim was madness.
-Was't Hamlet wrong'd Laertes? Never Hamlet:
-If Hamlet from himself be ta'en away,
-And when he's not himself does wrong Laertes,
-Then Hamlet does it not, Hamlet denies it.
-Who does it, then? His madness: if't be so,
-Hamlet is of the faction that is wrong'd;
-His madness is poor Hamlet's enemy.
-Sir, in this audience,
-Let my disclaiming from a purpos'd evil
-Free me so far in your most generous thoughts
-That I have shot my arrow o'er the house
-And hurt my brother.
-
-Laer.
-I am satisfied in nature,
-Whose motive, in this case, should stir me most
-To my revenge. But in my terms of honour
-I stand aloof; and will no reconcilement
-Till by some elder masters of known honour
-I have a voice and precedent of peace
-To keep my name ungor'd. But till that time
-I do receive your offer'd love like love,
-And will not wrong it.
-
-Ham.
-I embrace it freely;
-And will this brother's wager frankly play.--
-Give us the foils; come on.
-
-Laer.
-Come, one for me.
-
-Ham.
-I'll be your foil, Laertes; in mine ignorance
-Your skill shall, like a star in the darkest night,
-Stick fiery off indeed.
-
-Laer.
-You mock me, sir.
-
-Ham.
-No, by this hand.
-
-King.
-Give them the foils, young Osric. Cousin Hamlet,
-You know the wager?
-
-Ham.
-Very well, my lord;
-Your grace has laid the odds o' the weaker side.
-
-King.
-I do not fear it; I have seen you both;
-But since he's better'd, we have therefore odds.
-
-Laer.
-This is too heavy, let me see another.
-
-Ham.
-This likes me well. These foils have all a length?
-
-[They prepare to play.]
-
-Osr.
-Ay, my good lord.
-
-King.
-Set me the stoups of wine upon that table,--
-If Hamlet give the first or second hit,
-Or quit in answer of the third exchange,
-Let all the battlements their ordnance fire;
-The king shall drink to Hamlet's better breath;
-And in the cup an union shall he throw,
-Richer than that which four successive kings
-In Denmark's crown have worn. Give me the cups;
-And let the kettle to the trumpet speak,
-The trumpet to the cannoneer without,
-The cannons to the heavens, the heavens to earth,
-'Now the king drinks to Hamlet.'--Come, begin:--
-And you, the judges, bear a wary eye.
-
-Ham.
-Come on, sir.
-
-Laer.
-Come, my lord.
-
-[They play.]
-
-Ham.
-One.
-
-Laer.
-No.
-
-Ham.
-Judgment!
-
-Osr.
-A hit, a very palpable hit.
-
-Laer.
-Well;--again.
-
-King.
-Stay, give me drink.--Hamlet, this pearl is thine;
-Here's to thy health.--
-
-[Trumpets sound, and cannon shot off within.]
-
-Give him the cup.
-
-Ham.
-I'll play this bout first; set it by awhile.--
-Come.--Another hit; what say you?
-
-[They play.]
-
-Laer.
-A touch, a touch, I do confess.
-
-King.
-Our son shall win.
-
-Queen.
-He's fat, and scant of breath.--
-Here, Hamlet, take my napkin, rub thy brows:
-The queen carouses to thy fortune, Hamlet.
-
-Ham.
-Good madam!
-
-King.
-Gertrude, do not drink.
-
-Queen.
-I will, my lord; I pray you pardon me.
-
-King.
-[Aside.] It is the poison'd cup; it is too late.
-
-Ham.
-I dare not drink yet, madam; by-and-by.
-
-Queen.
-Come, let me wipe thy face.
-
-Laer.
-My lord, I'll hit him now.
-
-King.
-I do not think't.
-
-Laer.
-[Aside.] And yet 'tis almost 'gainst my conscience.
-
-Ham.
-Come, for the third, Laertes: you but dally;
-I pray you pass with your best violence:
-I am afeard you make a wanton of me.
-
-Laer.
-Say you so? come on.
-
-[They play.]
-
-Osr.
-Nothing, neither way.
-
-Laer.
-Have at you now!
-
-[Laertes wounds Hamlet; then, in scuffling, they
-change rapiers, and Hamlet wounds Laertes.]
-
-King.
-Part them; they are incens'd.
-
-Ham.
-Nay, come again!
-
-[The Queen falls.]
-
-Osr.
-Look to the queen there, ho!
-
-Hor.
-They bleed on both sides.--How is it, my lord?
-
-Osr.
-How is't, Laertes?
-
-Laer.
-Why, as a woodcock to my own springe, Osric;
-I am justly kill'd with mine own treachery.
-
-Ham.
-How does the Queen?
-
-King.
-She swoons to see them bleed.
-
-Queen.
-No, no! the drink, the drink!--O my dear Hamlet!--
-The drink, the drink!--I am poison'd.
-
-[Dies.]
-
-Ham.
-O villany!--Ho! let the door be lock'd:
-Treachery! seek it out.
-
-[Laertes falls.]
-
-Laer.
-It is here, Hamlet: Hamlet, thou art slain;
-No medicine in the world can do thee good;
-In thee there is not half an hour of life;
-The treacherous instrument is in thy hand,
-Unbated and envenom'd: the foul practice
-Hath turn'd itself on me; lo, here I lie,
-Never to rise again: thy mother's poison'd:
-I can no more:--the king, the king's to blame.
-
-Ham.
-The point envenom'd too!--
-Then, venom, to thy work.
-
-[Stabs the King.]
-
-Osric and Lords.
-Treason! treason!
-
-King.
-O, yet defend me, friends! I am but hurt.
-
-Ham.
-Here, thou incestuous, murderous, damned Dane,
-Drink off this potion.--Is thy union here?
-Follow my mother.
-
-[King dies.]
-
-Laer.
-He is justly serv'd;
-It is a poison temper'd by himself.--
-Exchange forgiveness with me, noble Hamlet:
-Mine and my father's death come not upon thee,
-Nor thine on me!
-
-[Dies.]
-
-Ham.
-Heaven make thee free of it! I follow thee.--
-I am dead, Horatio.--Wretched queen, adieu!--
-You that look pale and tremble at this chance,
-That are but mutes or audience to this act,
-Had I but time,--as this fell sergeant, death,
-Is strict in his arrest,--O, I could tell you,--
-But let it be.--Horatio, I am dead;
-Thou liv'st; report me and my cause aright
-To the unsatisfied.
-
-Hor.
-Never believe it:
-I am more an antique Roman than a Dane.--
-Here's yet some liquor left.
-
-Ham.
-As thou'rt a man,
-Give me the cup; let go; by heaven, I'll have't.--
-O good Horatio, what a wounded name,
-Things standing thus unknown, shall live behind me!
-If thou didst ever hold me in thy heart,
-Absent thee from felicity awhile,
-And in this harsh world draw thy breath in pain,
-To tell my story.--
-
-[March afar off, and shot within.]
-
-What warlike noise is this?
-
-Osr.
-Young Fortinbras, with conquest come from Poland,
-To the ambassadors of England gives
-This warlike volley.
-
-Ham.
-O, I die, Horatio;
-The potent poison quite o'er-crows my spirit:
-I cannot live to hear the news from England;
-But I do prophesy the election lights
-On Fortinbras: he has my dying voice;
-So tell him, with the occurrents, more and less,
-Which have solicited.--the rest is silence.
-
-[Dies.]
-
-Hor.
-Now cracks a noble heart.--Good night, sweet prince,
-And flights of angels sing thee to thy rest!
-Why does the drum come hither?
-
-[March within.]
-
-[Enter Fortinbras, the English Ambassadors, and others.]
-
-Fort.
-Where is this sight?
-
-Hor.
-What is it you will see?
-If aught of woe or wonder, cease your search.
-
-Fort.
-This quarry cries on havoc.--O proud death,
-What feast is toward in thine eternal cell,
-That thou so many princes at a shot
-So bloodily hast struck?
-
-1 Ambassador.
-The sight is dismal;
-And our affairs from England come too late:
-The ears are senseless that should give us hearing,
-To tell him his commandment is fulfill'd
-That Rosencrantz and Guildenstern are dead:
-Where should we have our thanks?
-
-Hor.
-Not from his mouth,
-Had it the ability of life to thank you:
-He never gave commandment for their death.
-But since, so jump upon this bloody question,
-You from the Polack wars, and you from England,
-Are here arriv'd, give order that these bodies
-High on a stage be placed to the view;
-And let me speak to the yet unknowing world
-How these things came about: so shall you hear
-Of carnal, bloody and unnatural acts;
-Of accidental judgments, casual slaughters;
-Of deaths put on by cunning and forc'd cause;
-And, in this upshot, purposes mistook
-Fall'n on the inventors' heads: all this can I
-Truly deliver.
-
-Fort.
-Let us haste to hear it,
-And call the noblest to the audience.
-For me, with sorrow I embrace my fortune:
-I have some rights of memory in this kingdom,
-Which now, to claim my vantage doth invite me.
-
-Hor.
-Of that I shall have also cause to speak,
-And from his mouth whose voice will draw on more:
-But let this same be presently perform'd,
-Even while men's minds are wild: lest more mischance
-On plots and errors happen.
-
-Fort.
-Let four captains
-Bear Hamlet like a soldier to the stage;
-For he was likely, had he been put on,
-To have prov'd most royally: and, for his passage,
-The soldiers' music and the rites of war
-Speak loudly for him.--
-Take up the bodies.--Such a sight as this
-Becomes the field, but here shows much amiss.
-Go, bid the soldiers shoot.
-
-[A dead march.]
-
-[Exeunt, bearing off the dead bodies; after the which a peal of
-ordnance is shot off.]
-
-
diff --git a/android/examples/Topics/Animation/AnimatedSprite/AnimatedSprite.pde b/android/examples/Topics/Animation/AnimatedSprite/AnimatedSprite.pde
deleted file mode 100644
index 1c13f0199f..0000000000
--- a/android/examples/Topics/Animation/AnimatedSprite/AnimatedSprite.pde
+++ /dev/null
@@ -1,39 +0,0 @@
-/**
- * Animated Sprite (Shifty + Teddy)
- * by James Patterson.
- *
- * Press the mouse button to change animations.
- * Demonstrates loading, displaying, and animating GIF images.
- * It would be easy to write a program to display
- * animated GIFs, but would not allow as much control over
- * the display sequence and rate of display.
- */
-
-Animation animation1, animation2;
-float xpos, ypos;
-float drag = 30.0;
-
-void setup() {
- size(200, 200);
- background(255, 204, 0);
- frameRate(24);
- animation1 = new Animation("PT_Shifty_", 38);
- animation2 = new Animation("PT_Teddy_", 60);
-}
-
-void draw() {
- float difx = mouseX - xpos;
- if (abs(difx) > 1.0) {
- xpos = xpos + difx/drag;
- xpos = constrain(xpos, 0, width);
- }
-
- // Display the sprite at the position xpos, ypos
- if (mousePressed) {
- background(153, 153, 0);
- animation1.display(xpos-animation1.getWidth()/2, ypos);
- } else {
- background(255, 204, 0);
- animation2.display(xpos-animation1.getWidth()/2, ypos);
- }
-}
diff --git a/android/examples/Topics/Animation/AnimatedSprite/Animation.pde b/android/examples/Topics/Animation/AnimatedSprite/Animation.pde
deleted file mode 100644
index 6c98ef20b3..0000000000
--- a/android/examples/Topics/Animation/AnimatedSprite/Animation.pde
+++ /dev/null
@@ -1,27 +0,0 @@
-// Class for animating a sequence of GIFs
-
-class Animation {
- PImage[] images;
- int imageCount;
- int frame;
-
- Animation(String imagePrefix, int count) {
- imageCount = count;
- images = new PImage[imageCount];
-
- for (int i = 0; i < imageCount; i++) {
- // Use nf() to number format 'i' into four digits
- String filename = imagePrefix + nf(i, 4) + ".gif";
- images[i] = loadImage(filename);
- }
- }
-
- void display(float xpos, float ypos) {
- frame = (frame+1) % imageCount;
- image(images[frame], xpos, ypos);
- }
-
- int getWidth() {
- return images[0].width;
- }
-}
diff --git a/android/examples/Topics/Animation/AnimatedSprite/data/PT_Shifty_0000.gif b/android/examples/Topics/Animation/AnimatedSprite/data/PT_Shifty_0000.gif
deleted file mode 100644
index 1a9893ad2b..0000000000
Binary files a/android/examples/Topics/Animation/AnimatedSprite/data/PT_Shifty_0000.gif and /dev/null differ
diff --git a/android/examples/Topics/Animation/AnimatedSprite/data/PT_Shifty_0001.gif b/android/examples/Topics/Animation/AnimatedSprite/data/PT_Shifty_0001.gif
deleted file mode 100644
index 1a9893ad2b..0000000000
Binary files a/android/examples/Topics/Animation/AnimatedSprite/data/PT_Shifty_0001.gif and /dev/null differ
diff --git a/android/examples/Topics/Animation/AnimatedSprite/data/PT_Shifty_0002.gif b/android/examples/Topics/Animation/AnimatedSprite/data/PT_Shifty_0002.gif
deleted file mode 100644
index c53edb9435..0000000000
Binary files a/android/examples/Topics/Animation/AnimatedSprite/data/PT_Shifty_0002.gif and /dev/null differ
diff --git a/android/examples/Topics/Animation/AnimatedSprite/data/PT_Shifty_0003.gif b/android/examples/Topics/Animation/AnimatedSprite/data/PT_Shifty_0003.gif
deleted file mode 100644
index b9c4fc6757..0000000000
Binary files a/android/examples/Topics/Animation/AnimatedSprite/data/PT_Shifty_0003.gif and /dev/null differ
diff --git a/android/examples/Topics/Animation/AnimatedSprite/data/PT_Shifty_0004.gif b/android/examples/Topics/Animation/AnimatedSprite/data/PT_Shifty_0004.gif
deleted file mode 100644
index b43d0b308c..0000000000
Binary files a/android/examples/Topics/Animation/AnimatedSprite/data/PT_Shifty_0004.gif and /dev/null differ
diff --git a/android/examples/Topics/Animation/AnimatedSprite/data/PT_Shifty_0005.gif b/android/examples/Topics/Animation/AnimatedSprite/data/PT_Shifty_0005.gif
deleted file mode 100644
index 36f373249d..0000000000
Binary files a/android/examples/Topics/Animation/AnimatedSprite/data/PT_Shifty_0005.gif and /dev/null differ
diff --git a/android/examples/Topics/Animation/AnimatedSprite/data/PT_Shifty_0006.gif b/android/examples/Topics/Animation/AnimatedSprite/data/PT_Shifty_0006.gif
deleted file mode 100644
index b4c6ab5e6a..0000000000
Binary files a/android/examples/Topics/Animation/AnimatedSprite/data/PT_Shifty_0006.gif and /dev/null differ
diff --git a/android/examples/Topics/Animation/AnimatedSprite/data/PT_Shifty_0007.gif b/android/examples/Topics/Animation/AnimatedSprite/data/PT_Shifty_0007.gif
deleted file mode 100644
index a53c6abc7e..0000000000
Binary files a/android/examples/Topics/Animation/AnimatedSprite/data/PT_Shifty_0007.gif and /dev/null differ
diff --git a/android/examples/Topics/Animation/AnimatedSprite/data/PT_Shifty_0008.gif b/android/examples/Topics/Animation/AnimatedSprite/data/PT_Shifty_0008.gif
deleted file mode 100644
index 1ce59b9a63..0000000000
Binary files a/android/examples/Topics/Animation/AnimatedSprite/data/PT_Shifty_0008.gif and /dev/null differ
diff --git a/android/examples/Topics/Animation/AnimatedSprite/data/PT_Shifty_0009.gif b/android/examples/Topics/Animation/AnimatedSprite/data/PT_Shifty_0009.gif
deleted file mode 100644
index 557bedf8ee..0000000000
Binary files a/android/examples/Topics/Animation/AnimatedSprite/data/PT_Shifty_0009.gif and /dev/null differ
diff --git a/android/examples/Topics/Animation/AnimatedSprite/data/PT_Shifty_0010.gif b/android/examples/Topics/Animation/AnimatedSprite/data/PT_Shifty_0010.gif
deleted file mode 100644
index 31fd776e42..0000000000
Binary files a/android/examples/Topics/Animation/AnimatedSprite/data/PT_Shifty_0010.gif and /dev/null differ
diff --git a/android/examples/Topics/Animation/AnimatedSprite/data/PT_Shifty_0011.gif b/android/examples/Topics/Animation/AnimatedSprite/data/PT_Shifty_0011.gif
deleted file mode 100644
index a690836970..0000000000
Binary files a/android/examples/Topics/Animation/AnimatedSprite/data/PT_Shifty_0011.gif and /dev/null differ
diff --git a/android/examples/Topics/Animation/AnimatedSprite/data/PT_Shifty_0012.gif b/android/examples/Topics/Animation/AnimatedSprite/data/PT_Shifty_0012.gif
deleted file mode 100644
index fe81e42ace..0000000000
Binary files a/android/examples/Topics/Animation/AnimatedSprite/data/PT_Shifty_0012.gif and /dev/null differ
diff --git a/android/examples/Topics/Animation/AnimatedSprite/data/PT_Shifty_0013.gif b/android/examples/Topics/Animation/AnimatedSprite/data/PT_Shifty_0013.gif
deleted file mode 100644
index c8ede5df6c..0000000000
Binary files a/android/examples/Topics/Animation/AnimatedSprite/data/PT_Shifty_0013.gif and /dev/null differ
diff --git a/android/examples/Topics/Animation/AnimatedSprite/data/PT_Shifty_0014.gif b/android/examples/Topics/Animation/AnimatedSprite/data/PT_Shifty_0014.gif
deleted file mode 100644
index 1f14137619..0000000000
Binary files a/android/examples/Topics/Animation/AnimatedSprite/data/PT_Shifty_0014.gif and /dev/null differ
diff --git a/android/examples/Topics/Animation/AnimatedSprite/data/PT_Shifty_0015.gif b/android/examples/Topics/Animation/AnimatedSprite/data/PT_Shifty_0015.gif
deleted file mode 100644
index de472dfe76..0000000000
Binary files a/android/examples/Topics/Animation/AnimatedSprite/data/PT_Shifty_0015.gif and /dev/null differ
diff --git a/android/examples/Topics/Animation/AnimatedSprite/data/PT_Shifty_0016.gif b/android/examples/Topics/Animation/AnimatedSprite/data/PT_Shifty_0016.gif
deleted file mode 100644
index 5bc583f0a6..0000000000
Binary files a/android/examples/Topics/Animation/AnimatedSprite/data/PT_Shifty_0016.gif and /dev/null differ
diff --git a/android/examples/Topics/Animation/AnimatedSprite/data/PT_Shifty_0017.gif b/android/examples/Topics/Animation/AnimatedSprite/data/PT_Shifty_0017.gif
deleted file mode 100644
index 8ff4386904..0000000000
Binary files a/android/examples/Topics/Animation/AnimatedSprite/data/PT_Shifty_0017.gif and /dev/null differ
diff --git a/android/examples/Topics/Animation/AnimatedSprite/data/PT_Shifty_0018.gif b/android/examples/Topics/Animation/AnimatedSprite/data/PT_Shifty_0018.gif
deleted file mode 100644
index 0b99e37279..0000000000
Binary files a/android/examples/Topics/Animation/AnimatedSprite/data/PT_Shifty_0018.gif and /dev/null differ
diff --git a/android/examples/Topics/Animation/AnimatedSprite/data/PT_Shifty_0019.gif b/android/examples/Topics/Animation/AnimatedSprite/data/PT_Shifty_0019.gif
deleted file mode 100644
index 7a9217ad37..0000000000
Binary files a/android/examples/Topics/Animation/AnimatedSprite/data/PT_Shifty_0019.gif and /dev/null differ
diff --git a/android/examples/Topics/Animation/AnimatedSprite/data/PT_Shifty_0020.gif b/android/examples/Topics/Animation/AnimatedSprite/data/PT_Shifty_0020.gif
deleted file mode 100644
index fe8fdae31c..0000000000
Binary files a/android/examples/Topics/Animation/AnimatedSprite/data/PT_Shifty_0020.gif and /dev/null differ
diff --git a/android/examples/Topics/Animation/AnimatedSprite/data/PT_Shifty_0021.gif b/android/examples/Topics/Animation/AnimatedSprite/data/PT_Shifty_0021.gif
deleted file mode 100644
index ab36afe0dd..0000000000
Binary files a/android/examples/Topics/Animation/AnimatedSprite/data/PT_Shifty_0021.gif and /dev/null differ
diff --git a/android/examples/Topics/Animation/AnimatedSprite/data/PT_Shifty_0022.gif b/android/examples/Topics/Animation/AnimatedSprite/data/PT_Shifty_0022.gif
deleted file mode 100644
index 98dc00b573..0000000000
Binary files a/android/examples/Topics/Animation/AnimatedSprite/data/PT_Shifty_0022.gif and /dev/null differ
diff --git a/android/examples/Topics/Animation/AnimatedSprite/data/PT_Shifty_0023.gif b/android/examples/Topics/Animation/AnimatedSprite/data/PT_Shifty_0023.gif
deleted file mode 100644
index a3dd7f38c5..0000000000
Binary files a/android/examples/Topics/Animation/AnimatedSprite/data/PT_Shifty_0023.gif and /dev/null differ
diff --git a/android/examples/Topics/Animation/AnimatedSprite/data/PT_Shifty_0024.gif b/android/examples/Topics/Animation/AnimatedSprite/data/PT_Shifty_0024.gif
deleted file mode 100644
index f8287855ad..0000000000
Binary files a/android/examples/Topics/Animation/AnimatedSprite/data/PT_Shifty_0024.gif and /dev/null differ
diff --git a/android/examples/Topics/Animation/AnimatedSprite/data/PT_Shifty_0025.gif b/android/examples/Topics/Animation/AnimatedSprite/data/PT_Shifty_0025.gif
deleted file mode 100644
index 0107f470c8..0000000000
Binary files a/android/examples/Topics/Animation/AnimatedSprite/data/PT_Shifty_0025.gif and /dev/null differ
diff --git a/android/examples/Topics/Animation/AnimatedSprite/data/PT_Shifty_0026.gif b/android/examples/Topics/Animation/AnimatedSprite/data/PT_Shifty_0026.gif
deleted file mode 100644
index e05a139441..0000000000
Binary files a/android/examples/Topics/Animation/AnimatedSprite/data/PT_Shifty_0026.gif and /dev/null differ
diff --git a/android/examples/Topics/Animation/AnimatedSprite/data/PT_Shifty_0027.gif b/android/examples/Topics/Animation/AnimatedSprite/data/PT_Shifty_0027.gif
deleted file mode 100644
index decdebe59c..0000000000
Binary files a/android/examples/Topics/Animation/AnimatedSprite/data/PT_Shifty_0027.gif and /dev/null differ
diff --git a/android/examples/Topics/Animation/AnimatedSprite/data/PT_Shifty_0028.gif b/android/examples/Topics/Animation/AnimatedSprite/data/PT_Shifty_0028.gif
deleted file mode 100644
index ec2bae7662..0000000000
Binary files a/android/examples/Topics/Animation/AnimatedSprite/data/PT_Shifty_0028.gif and /dev/null differ
diff --git a/android/examples/Topics/Animation/AnimatedSprite/data/PT_Shifty_0029.gif b/android/examples/Topics/Animation/AnimatedSprite/data/PT_Shifty_0029.gif
deleted file mode 100644
index 67d14b168e..0000000000
Binary files a/android/examples/Topics/Animation/AnimatedSprite/data/PT_Shifty_0029.gif and /dev/null differ
diff --git a/android/examples/Topics/Animation/AnimatedSprite/data/PT_Shifty_0030.gif b/android/examples/Topics/Animation/AnimatedSprite/data/PT_Shifty_0030.gif
deleted file mode 100644
index 619c30c949..0000000000
Binary files a/android/examples/Topics/Animation/AnimatedSprite/data/PT_Shifty_0030.gif and /dev/null differ
diff --git a/android/examples/Topics/Animation/AnimatedSprite/data/PT_Shifty_0031.gif b/android/examples/Topics/Animation/AnimatedSprite/data/PT_Shifty_0031.gif
deleted file mode 100644
index aae6bfbf30..0000000000
Binary files a/android/examples/Topics/Animation/AnimatedSprite/data/PT_Shifty_0031.gif and /dev/null differ
diff --git a/android/examples/Topics/Animation/AnimatedSprite/data/PT_Shifty_0032.gif b/android/examples/Topics/Animation/AnimatedSprite/data/PT_Shifty_0032.gif
deleted file mode 100644
index 7cdd3561b3..0000000000
Binary files a/android/examples/Topics/Animation/AnimatedSprite/data/PT_Shifty_0032.gif and /dev/null differ
diff --git a/android/examples/Topics/Animation/AnimatedSprite/data/PT_Shifty_0033.gif b/android/examples/Topics/Animation/AnimatedSprite/data/PT_Shifty_0033.gif
deleted file mode 100644
index 97fc084803..0000000000
Binary files a/android/examples/Topics/Animation/AnimatedSprite/data/PT_Shifty_0033.gif and /dev/null differ
diff --git a/android/examples/Topics/Animation/AnimatedSprite/data/PT_Shifty_0034.gif b/android/examples/Topics/Animation/AnimatedSprite/data/PT_Shifty_0034.gif
deleted file mode 100644
index 85e71dd53c..0000000000
Binary files a/android/examples/Topics/Animation/AnimatedSprite/data/PT_Shifty_0034.gif and /dev/null differ
diff --git a/android/examples/Topics/Animation/AnimatedSprite/data/PT_Shifty_0035.gif b/android/examples/Topics/Animation/AnimatedSprite/data/PT_Shifty_0035.gif
deleted file mode 100644
index 7523936735..0000000000
Binary files a/android/examples/Topics/Animation/AnimatedSprite/data/PT_Shifty_0035.gif and /dev/null differ
diff --git a/android/examples/Topics/Animation/AnimatedSprite/data/PT_Shifty_0036.gif b/android/examples/Topics/Animation/AnimatedSprite/data/PT_Shifty_0036.gif
deleted file mode 100644
index 92bf1c3dac..0000000000
Binary files a/android/examples/Topics/Animation/AnimatedSprite/data/PT_Shifty_0036.gif and /dev/null differ
diff --git a/android/examples/Topics/Animation/AnimatedSprite/data/PT_Shifty_0037.gif b/android/examples/Topics/Animation/AnimatedSprite/data/PT_Shifty_0037.gif
deleted file mode 100644
index 397590e385..0000000000
Binary files a/android/examples/Topics/Animation/AnimatedSprite/data/PT_Shifty_0037.gif and /dev/null differ
diff --git a/android/examples/Topics/Animation/AnimatedSprite/data/PT_Teddy_0000.gif b/android/examples/Topics/Animation/AnimatedSprite/data/PT_Teddy_0000.gif
deleted file mode 100644
index 2f824d4aee..0000000000
Binary files a/android/examples/Topics/Animation/AnimatedSprite/data/PT_Teddy_0000.gif and /dev/null differ
diff --git a/android/examples/Topics/Animation/AnimatedSprite/data/PT_Teddy_0001.gif b/android/examples/Topics/Animation/AnimatedSprite/data/PT_Teddy_0001.gif
deleted file mode 100644
index 08badda941..0000000000
Binary files a/android/examples/Topics/Animation/AnimatedSprite/data/PT_Teddy_0001.gif and /dev/null differ
diff --git a/android/examples/Topics/Animation/AnimatedSprite/data/PT_Teddy_0002.gif b/android/examples/Topics/Animation/AnimatedSprite/data/PT_Teddy_0002.gif
deleted file mode 100644
index 06624ab2cf..0000000000
Binary files a/android/examples/Topics/Animation/AnimatedSprite/data/PT_Teddy_0002.gif and /dev/null differ
diff --git a/android/examples/Topics/Animation/AnimatedSprite/data/PT_Teddy_0003.gif b/android/examples/Topics/Animation/AnimatedSprite/data/PT_Teddy_0003.gif
deleted file mode 100644
index ea92ccc973..0000000000
Binary files a/android/examples/Topics/Animation/AnimatedSprite/data/PT_Teddy_0003.gif and /dev/null differ
diff --git a/android/examples/Topics/Animation/AnimatedSprite/data/PT_Teddy_0004.gif b/android/examples/Topics/Animation/AnimatedSprite/data/PT_Teddy_0004.gif
deleted file mode 100644
index 4bd11209c9..0000000000
Binary files a/android/examples/Topics/Animation/AnimatedSprite/data/PT_Teddy_0004.gif and /dev/null differ
diff --git a/android/examples/Topics/Animation/AnimatedSprite/data/PT_Teddy_0005.gif b/android/examples/Topics/Animation/AnimatedSprite/data/PT_Teddy_0005.gif
deleted file mode 100644
index 35dd95adfa..0000000000
Binary files a/android/examples/Topics/Animation/AnimatedSprite/data/PT_Teddy_0005.gif and /dev/null differ
diff --git a/android/examples/Topics/Animation/AnimatedSprite/data/PT_Teddy_0006.gif b/android/examples/Topics/Animation/AnimatedSprite/data/PT_Teddy_0006.gif
deleted file mode 100644
index e031102920..0000000000
Binary files a/android/examples/Topics/Animation/AnimatedSprite/data/PT_Teddy_0006.gif and /dev/null differ
diff --git a/android/examples/Topics/Animation/AnimatedSprite/data/PT_Teddy_0007.gif b/android/examples/Topics/Animation/AnimatedSprite/data/PT_Teddy_0007.gif
deleted file mode 100644
index c64d4f836d..0000000000
Binary files a/android/examples/Topics/Animation/AnimatedSprite/data/PT_Teddy_0007.gif and /dev/null differ
diff --git a/android/examples/Topics/Animation/AnimatedSprite/data/PT_Teddy_0008.gif b/android/examples/Topics/Animation/AnimatedSprite/data/PT_Teddy_0008.gif
deleted file mode 100644
index 3ceb22ee76..0000000000
Binary files a/android/examples/Topics/Animation/AnimatedSprite/data/PT_Teddy_0008.gif and /dev/null differ
diff --git a/android/examples/Topics/Animation/AnimatedSprite/data/PT_Teddy_0009.gif b/android/examples/Topics/Animation/AnimatedSprite/data/PT_Teddy_0009.gif
deleted file mode 100644
index e641c42d8e..0000000000
Binary files a/android/examples/Topics/Animation/AnimatedSprite/data/PT_Teddy_0009.gif and /dev/null differ
diff --git a/android/examples/Topics/Animation/AnimatedSprite/data/PT_Teddy_0010.gif b/android/examples/Topics/Animation/AnimatedSprite/data/PT_Teddy_0010.gif
deleted file mode 100644
index fcf8234bdf..0000000000
Binary files a/android/examples/Topics/Animation/AnimatedSprite/data/PT_Teddy_0010.gif and /dev/null differ
diff --git a/android/examples/Topics/Animation/AnimatedSprite/data/PT_Teddy_0011.gif b/android/examples/Topics/Animation/AnimatedSprite/data/PT_Teddy_0011.gif
deleted file mode 100644
index 0a66343cc9..0000000000
Binary files a/android/examples/Topics/Animation/AnimatedSprite/data/PT_Teddy_0011.gif and /dev/null differ
diff --git a/android/examples/Topics/Animation/AnimatedSprite/data/PT_Teddy_0012.gif b/android/examples/Topics/Animation/AnimatedSprite/data/PT_Teddy_0012.gif
deleted file mode 100644
index d99ab85ab1..0000000000
Binary files a/android/examples/Topics/Animation/AnimatedSprite/data/PT_Teddy_0012.gif and /dev/null differ
diff --git a/android/examples/Topics/Animation/AnimatedSprite/data/PT_Teddy_0013.gif b/android/examples/Topics/Animation/AnimatedSprite/data/PT_Teddy_0013.gif
deleted file mode 100644
index bf83cace62..0000000000
Binary files a/android/examples/Topics/Animation/AnimatedSprite/data/PT_Teddy_0013.gif and /dev/null differ
diff --git a/android/examples/Topics/Animation/AnimatedSprite/data/PT_Teddy_0014.gif b/android/examples/Topics/Animation/AnimatedSprite/data/PT_Teddy_0014.gif
deleted file mode 100644
index 5cf39974a5..0000000000
Binary files a/android/examples/Topics/Animation/AnimatedSprite/data/PT_Teddy_0014.gif and /dev/null differ
diff --git a/android/examples/Topics/Animation/AnimatedSprite/data/PT_Teddy_0015.gif b/android/examples/Topics/Animation/AnimatedSprite/data/PT_Teddy_0015.gif
deleted file mode 100644
index 2389da3330..0000000000
Binary files a/android/examples/Topics/Animation/AnimatedSprite/data/PT_Teddy_0015.gif and /dev/null differ
diff --git a/android/examples/Topics/Animation/AnimatedSprite/data/PT_Teddy_0016.gif b/android/examples/Topics/Animation/AnimatedSprite/data/PT_Teddy_0016.gif
deleted file mode 100644
index 837b6e5330..0000000000
Binary files a/android/examples/Topics/Animation/AnimatedSprite/data/PT_Teddy_0016.gif and /dev/null differ
diff --git a/android/examples/Topics/Animation/AnimatedSprite/data/PT_Teddy_0017.gif b/android/examples/Topics/Animation/AnimatedSprite/data/PT_Teddy_0017.gif
deleted file mode 100644
index be36c20b19..0000000000
Binary files a/android/examples/Topics/Animation/AnimatedSprite/data/PT_Teddy_0017.gif and /dev/null differ
diff --git a/android/examples/Topics/Animation/AnimatedSprite/data/PT_Teddy_0018.gif b/android/examples/Topics/Animation/AnimatedSprite/data/PT_Teddy_0018.gif
deleted file mode 100644
index e2da21d31c..0000000000
Binary files a/android/examples/Topics/Animation/AnimatedSprite/data/PT_Teddy_0018.gif and /dev/null differ
diff --git a/android/examples/Topics/Animation/AnimatedSprite/data/PT_Teddy_0019.gif b/android/examples/Topics/Animation/AnimatedSprite/data/PT_Teddy_0019.gif
deleted file mode 100644
index c7125f6f26..0000000000
Binary files a/android/examples/Topics/Animation/AnimatedSprite/data/PT_Teddy_0019.gif and /dev/null differ
diff --git a/android/examples/Topics/Animation/AnimatedSprite/data/PT_Teddy_0020.gif b/android/examples/Topics/Animation/AnimatedSprite/data/PT_Teddy_0020.gif
deleted file mode 100644
index 21084a4857..0000000000
Binary files a/android/examples/Topics/Animation/AnimatedSprite/data/PT_Teddy_0020.gif and /dev/null differ
diff --git a/android/examples/Topics/Animation/AnimatedSprite/data/PT_Teddy_0021.gif b/android/examples/Topics/Animation/AnimatedSprite/data/PT_Teddy_0021.gif
deleted file mode 100644
index 5a7d2b4623..0000000000
Binary files a/android/examples/Topics/Animation/AnimatedSprite/data/PT_Teddy_0021.gif and /dev/null differ
diff --git a/android/examples/Topics/Animation/AnimatedSprite/data/PT_Teddy_0022.gif b/android/examples/Topics/Animation/AnimatedSprite/data/PT_Teddy_0022.gif
deleted file mode 100644
index aa4d8b34a4..0000000000
Binary files a/android/examples/Topics/Animation/AnimatedSprite/data/PT_Teddy_0022.gif and /dev/null differ
diff --git a/android/examples/Topics/Animation/AnimatedSprite/data/PT_Teddy_0023.gif b/android/examples/Topics/Animation/AnimatedSprite/data/PT_Teddy_0023.gif
deleted file mode 100644
index 81952946e9..0000000000
Binary files a/android/examples/Topics/Animation/AnimatedSprite/data/PT_Teddy_0023.gif and /dev/null differ
diff --git a/android/examples/Topics/Animation/AnimatedSprite/data/PT_Teddy_0024.gif b/android/examples/Topics/Animation/AnimatedSprite/data/PT_Teddy_0024.gif
deleted file mode 100644
index f0cfcd142d..0000000000
Binary files a/android/examples/Topics/Animation/AnimatedSprite/data/PT_Teddy_0024.gif and /dev/null differ
diff --git a/android/examples/Topics/Animation/AnimatedSprite/data/PT_Teddy_0025.gif b/android/examples/Topics/Animation/AnimatedSprite/data/PT_Teddy_0025.gif
deleted file mode 100644
index d3e55f4038..0000000000
Binary files a/android/examples/Topics/Animation/AnimatedSprite/data/PT_Teddy_0025.gif and /dev/null differ
diff --git a/android/examples/Topics/Animation/AnimatedSprite/data/PT_Teddy_0026.gif b/android/examples/Topics/Animation/AnimatedSprite/data/PT_Teddy_0026.gif
deleted file mode 100644
index 19aa7b6c3f..0000000000
Binary files a/android/examples/Topics/Animation/AnimatedSprite/data/PT_Teddy_0026.gif and /dev/null differ
diff --git a/android/examples/Topics/Animation/AnimatedSprite/data/PT_Teddy_0027.gif b/android/examples/Topics/Animation/AnimatedSprite/data/PT_Teddy_0027.gif
deleted file mode 100644
index 0291b3f57d..0000000000
Binary files a/android/examples/Topics/Animation/AnimatedSprite/data/PT_Teddy_0027.gif and /dev/null differ
diff --git a/android/examples/Topics/Animation/AnimatedSprite/data/PT_Teddy_0028.gif b/android/examples/Topics/Animation/AnimatedSprite/data/PT_Teddy_0028.gif
deleted file mode 100644
index 84d403c320..0000000000
Binary files a/android/examples/Topics/Animation/AnimatedSprite/data/PT_Teddy_0028.gif and /dev/null differ
diff --git a/android/examples/Topics/Animation/AnimatedSprite/data/PT_Teddy_0029.gif b/android/examples/Topics/Animation/AnimatedSprite/data/PT_Teddy_0029.gif
deleted file mode 100644
index a15ef905f2..0000000000
Binary files a/android/examples/Topics/Animation/AnimatedSprite/data/PT_Teddy_0029.gif and /dev/null differ
diff --git a/android/examples/Topics/Animation/AnimatedSprite/data/PT_Teddy_0030.gif b/android/examples/Topics/Animation/AnimatedSprite/data/PT_Teddy_0030.gif
deleted file mode 100644
index 945a0053dc..0000000000
Binary files a/android/examples/Topics/Animation/AnimatedSprite/data/PT_Teddy_0030.gif and /dev/null differ
diff --git a/android/examples/Topics/Animation/AnimatedSprite/data/PT_Teddy_0031.gif b/android/examples/Topics/Animation/AnimatedSprite/data/PT_Teddy_0031.gif
deleted file mode 100644
index f922e56519..0000000000
Binary files a/android/examples/Topics/Animation/AnimatedSprite/data/PT_Teddy_0031.gif and /dev/null differ
diff --git a/android/examples/Topics/Animation/AnimatedSprite/data/PT_Teddy_0032.gif b/android/examples/Topics/Animation/AnimatedSprite/data/PT_Teddy_0032.gif
deleted file mode 100644
index 0aff66645e..0000000000
Binary files a/android/examples/Topics/Animation/AnimatedSprite/data/PT_Teddy_0032.gif and /dev/null differ
diff --git a/android/examples/Topics/Animation/AnimatedSprite/data/PT_Teddy_0033.gif b/android/examples/Topics/Animation/AnimatedSprite/data/PT_Teddy_0033.gif
deleted file mode 100644
index 7fedb48327..0000000000
Binary files a/android/examples/Topics/Animation/AnimatedSprite/data/PT_Teddy_0033.gif and /dev/null differ
diff --git a/android/examples/Topics/Animation/AnimatedSprite/data/PT_Teddy_0034.gif b/android/examples/Topics/Animation/AnimatedSprite/data/PT_Teddy_0034.gif
deleted file mode 100644
index 19a4d20ff1..0000000000
Binary files a/android/examples/Topics/Animation/AnimatedSprite/data/PT_Teddy_0034.gif and /dev/null differ
diff --git a/android/examples/Topics/Animation/AnimatedSprite/data/PT_Teddy_0035.gif b/android/examples/Topics/Animation/AnimatedSprite/data/PT_Teddy_0035.gif
deleted file mode 100644
index 3dd6abcb74..0000000000
Binary files a/android/examples/Topics/Animation/AnimatedSprite/data/PT_Teddy_0035.gif and /dev/null differ
diff --git a/android/examples/Topics/Animation/AnimatedSprite/data/PT_Teddy_0036.gif b/android/examples/Topics/Animation/AnimatedSprite/data/PT_Teddy_0036.gif
deleted file mode 100644
index 93277ef54e..0000000000
Binary files a/android/examples/Topics/Animation/AnimatedSprite/data/PT_Teddy_0036.gif and /dev/null differ
diff --git a/android/examples/Topics/Animation/AnimatedSprite/data/PT_Teddy_0037.gif b/android/examples/Topics/Animation/AnimatedSprite/data/PT_Teddy_0037.gif
deleted file mode 100644
index c9c0a09039..0000000000
Binary files a/android/examples/Topics/Animation/AnimatedSprite/data/PT_Teddy_0037.gif and /dev/null differ
diff --git a/android/examples/Topics/Animation/AnimatedSprite/data/PT_Teddy_0038.gif b/android/examples/Topics/Animation/AnimatedSprite/data/PT_Teddy_0038.gif
deleted file mode 100644
index f0a00a1be4..0000000000
Binary files a/android/examples/Topics/Animation/AnimatedSprite/data/PT_Teddy_0038.gif and /dev/null differ
diff --git a/android/examples/Topics/Animation/AnimatedSprite/data/PT_Teddy_0039.gif b/android/examples/Topics/Animation/AnimatedSprite/data/PT_Teddy_0039.gif
deleted file mode 100644
index 4a8b14e277..0000000000
Binary files a/android/examples/Topics/Animation/AnimatedSprite/data/PT_Teddy_0039.gif and /dev/null differ
diff --git a/android/examples/Topics/Animation/AnimatedSprite/data/PT_Teddy_0040.gif b/android/examples/Topics/Animation/AnimatedSprite/data/PT_Teddy_0040.gif
deleted file mode 100644
index 88e8eb1479..0000000000
Binary files a/android/examples/Topics/Animation/AnimatedSprite/data/PT_Teddy_0040.gif and /dev/null differ
diff --git a/android/examples/Topics/Animation/AnimatedSprite/data/PT_Teddy_0041.gif b/android/examples/Topics/Animation/AnimatedSprite/data/PT_Teddy_0041.gif
deleted file mode 100644
index 0353138a5f..0000000000
Binary files a/android/examples/Topics/Animation/AnimatedSprite/data/PT_Teddy_0041.gif and /dev/null differ
diff --git a/android/examples/Topics/Animation/AnimatedSprite/data/PT_Teddy_0042.gif b/android/examples/Topics/Animation/AnimatedSprite/data/PT_Teddy_0042.gif
deleted file mode 100644
index 4ef9475094..0000000000
Binary files a/android/examples/Topics/Animation/AnimatedSprite/data/PT_Teddy_0042.gif and /dev/null differ
diff --git a/android/examples/Topics/Animation/AnimatedSprite/data/PT_Teddy_0043.gif b/android/examples/Topics/Animation/AnimatedSprite/data/PT_Teddy_0043.gif
deleted file mode 100644
index aebe10476a..0000000000
Binary files a/android/examples/Topics/Animation/AnimatedSprite/data/PT_Teddy_0043.gif and /dev/null differ
diff --git a/android/examples/Topics/Animation/AnimatedSprite/data/PT_Teddy_0044.gif b/android/examples/Topics/Animation/AnimatedSprite/data/PT_Teddy_0044.gif
deleted file mode 100644
index 96464a3cbd..0000000000
Binary files a/android/examples/Topics/Animation/AnimatedSprite/data/PT_Teddy_0044.gif and /dev/null differ
diff --git a/android/examples/Topics/Animation/AnimatedSprite/data/PT_Teddy_0045.gif b/android/examples/Topics/Animation/AnimatedSprite/data/PT_Teddy_0045.gif
deleted file mode 100644
index 35e40b8c47..0000000000
Binary files a/android/examples/Topics/Animation/AnimatedSprite/data/PT_Teddy_0045.gif and /dev/null differ
diff --git a/android/examples/Topics/Animation/AnimatedSprite/data/PT_Teddy_0046.gif b/android/examples/Topics/Animation/AnimatedSprite/data/PT_Teddy_0046.gif
deleted file mode 100644
index 8476318e9c..0000000000
Binary files a/android/examples/Topics/Animation/AnimatedSprite/data/PT_Teddy_0046.gif and /dev/null differ
diff --git a/android/examples/Topics/Animation/AnimatedSprite/data/PT_Teddy_0047.gif b/android/examples/Topics/Animation/AnimatedSprite/data/PT_Teddy_0047.gif
deleted file mode 100644
index 512c6eebc9..0000000000
Binary files a/android/examples/Topics/Animation/AnimatedSprite/data/PT_Teddy_0047.gif and /dev/null differ
diff --git a/android/examples/Topics/Animation/AnimatedSprite/data/PT_Teddy_0048.gif b/android/examples/Topics/Animation/AnimatedSprite/data/PT_Teddy_0048.gif
deleted file mode 100644
index 9fdecf6f12..0000000000
Binary files a/android/examples/Topics/Animation/AnimatedSprite/data/PT_Teddy_0048.gif and /dev/null differ
diff --git a/android/examples/Topics/Animation/AnimatedSprite/data/PT_Teddy_0049.gif b/android/examples/Topics/Animation/AnimatedSprite/data/PT_Teddy_0049.gif
deleted file mode 100644
index 5988e0ff98..0000000000
Binary files a/android/examples/Topics/Animation/AnimatedSprite/data/PT_Teddy_0049.gif and /dev/null differ
diff --git a/android/examples/Topics/Animation/AnimatedSprite/data/PT_Teddy_0050.gif b/android/examples/Topics/Animation/AnimatedSprite/data/PT_Teddy_0050.gif
deleted file mode 100644
index 2dde61ea05..0000000000
Binary files a/android/examples/Topics/Animation/AnimatedSprite/data/PT_Teddy_0050.gif and /dev/null differ
diff --git a/android/examples/Topics/Animation/AnimatedSprite/data/PT_Teddy_0051.gif b/android/examples/Topics/Animation/AnimatedSprite/data/PT_Teddy_0051.gif
deleted file mode 100644
index 24ef0346d3..0000000000
Binary files a/android/examples/Topics/Animation/AnimatedSprite/data/PT_Teddy_0051.gif and /dev/null differ
diff --git a/android/examples/Topics/Animation/AnimatedSprite/data/PT_Teddy_0052.gif b/android/examples/Topics/Animation/AnimatedSprite/data/PT_Teddy_0052.gif
deleted file mode 100644
index 132a9ad320..0000000000
Binary files a/android/examples/Topics/Animation/AnimatedSprite/data/PT_Teddy_0052.gif and /dev/null differ
diff --git a/android/examples/Topics/Animation/AnimatedSprite/data/PT_Teddy_0053.gif b/android/examples/Topics/Animation/AnimatedSprite/data/PT_Teddy_0053.gif
deleted file mode 100644
index d5ffebc030..0000000000
Binary files a/android/examples/Topics/Animation/AnimatedSprite/data/PT_Teddy_0053.gif and /dev/null differ
diff --git a/android/examples/Topics/Animation/AnimatedSprite/data/PT_Teddy_0054.gif b/android/examples/Topics/Animation/AnimatedSprite/data/PT_Teddy_0054.gif
deleted file mode 100644
index e09375aa0f..0000000000
Binary files a/android/examples/Topics/Animation/AnimatedSprite/data/PT_Teddy_0054.gif and /dev/null differ
diff --git a/android/examples/Topics/Animation/AnimatedSprite/data/PT_Teddy_0055.gif b/android/examples/Topics/Animation/AnimatedSprite/data/PT_Teddy_0055.gif
deleted file mode 100644
index e09375aa0f..0000000000
Binary files a/android/examples/Topics/Animation/AnimatedSprite/data/PT_Teddy_0055.gif and /dev/null differ
diff --git a/android/examples/Topics/Animation/AnimatedSprite/data/PT_Teddy_0056.gif b/android/examples/Topics/Animation/AnimatedSprite/data/PT_Teddy_0056.gif
deleted file mode 100644
index 80ee11d98f..0000000000
Binary files a/android/examples/Topics/Animation/AnimatedSprite/data/PT_Teddy_0056.gif and /dev/null differ
diff --git a/android/examples/Topics/Animation/AnimatedSprite/data/PT_Teddy_0057.gif b/android/examples/Topics/Animation/AnimatedSprite/data/PT_Teddy_0057.gif
deleted file mode 100644
index 9af1fbacc7..0000000000
Binary files a/android/examples/Topics/Animation/AnimatedSprite/data/PT_Teddy_0057.gif and /dev/null differ
diff --git a/android/examples/Topics/Animation/AnimatedSprite/data/PT_Teddy_0058.gif b/android/examples/Topics/Animation/AnimatedSprite/data/PT_Teddy_0058.gif
deleted file mode 100644
index 7265b9feed..0000000000
Binary files a/android/examples/Topics/Animation/AnimatedSprite/data/PT_Teddy_0058.gif and /dev/null differ
diff --git a/android/examples/Topics/Animation/AnimatedSprite/data/PT_Teddy_0059.gif b/android/examples/Topics/Animation/AnimatedSprite/data/PT_Teddy_0059.gif
deleted file mode 100644
index c4f730ef28..0000000000
Binary files a/android/examples/Topics/Animation/AnimatedSprite/data/PT_Teddy_0059.gif and /dev/null differ
diff --git a/android/examples/Topics/Animation/Sequential/Sequential.pde b/android/examples/Topics/Animation/Sequential/Sequential.pde
deleted file mode 100644
index a98b6d75b6..0000000000
--- a/android/examples/Topics/Animation/Sequential/Sequential.pde
+++ /dev/null
@@ -1,46 +0,0 @@
-/**
- * Sequential
- * by James Patterson.
- *
- * Displaying a sequence of images creates the illusion of motion.
- * Twelve images are loaded and each is displayed individually in a loop.
- */
-
-int numFrames = 12; // The number of frames in the animation
-int frame = 0;
-PImage[] images = new PImage[numFrames];
-
-void setup()
-{
- size(200, 200);
- frameRate(30);
-
- images[0] = loadImage("PT_anim0000.gif");
- images[1] = loadImage("PT_anim0001.gif");
- images[2] = loadImage("PT_anim0002.gif");
- images[3] = loadImage("PT_anim0003.gif");
- images[4] = loadImage("PT_anim0004.gif");
- images[5] = loadImage("PT_anim0005.gif");
- images[6] = loadImage("PT_anim0006.gif");
- images[7] = loadImage("PT_anim0007.gif");
- images[8] = loadImage("PT_anim0008.gif");
- images[9] = loadImage("PT_anim0009.gif");
- images[10] = loadImage("PT_anim0010.gif");
- images[11] = loadImage("PT_anim0011.gif");
-
- // If you don't want to load each image separately
- // and you know how many frames you have, you
- // can create the filenames as the program runs.
- // The nf() command does number formatting, which will
- // ensure that the number is (in this case) 4 digits.
- //for(int i=0; i 3) && world[x][y][0] == 1)
- {
- world[x][y][1] = -1;
- }
- }
- }
-}
-
-// Count the number of adjacent cells 'on'
-int neighbors(int x, int y)
-{
- return world[(x + 1) % sx][y][0] +
- world[x][(y + 1) % sy][0] +
- world[(x + sx - 1) % sx][y][0] +
- world[x][(y + sy - 1) % sy][0] +
- world[(x + 1) % sx][(y + 1) % sy][0] +
- world[(x + sx - 1) % sx][(y + 1) % sy][0] +
- world[(x + sx - 1) % sx][(y + sy - 1) % sy][0] +
- world[(x + 1) % sx][(y + sy - 1) % sy][0];
-}
diff --git a/android/examples/Topics/Cellular Automata/Spore1/Spore1.pde b/android/examples/Topics/Cellular Automata/Spore1/Spore1.pde
deleted file mode 100644
index 46ec059b1c..0000000000
--- a/android/examples/Topics/Cellular Automata/Spore1/Spore1.pde
+++ /dev/null
@@ -1,133 +0,0 @@
-/**
- * Spore 1
- * by Mike Davis.
- *
- * A short program for alife experiments. Click in the window to restart.
- * Each cell is represented by a pixel on the display as well as an entry in
- * the array 'cells'. Each cell has a run() method, which performs actions
- * based on the cell's surroundings. Cells run one at a time (to avoid conflicts
- * like wanting to move to the same space) and in random order.
- */
-
-World w;
-int numcells = 0;
-int maxcells = 6700;
-Cell[] cells = new Cell[maxcells];
-color spore_color;
-// set lower for smoother animation, higher for faster simulation
-int runs_per_loop = 10000;
-color black = color(0, 0, 0);
-
-void setup()
-{
- size(640, 200, P2D);
- frameRate(24);
- clearscr();
- w = new World();
- spore_color = color(172, 255, 128);
- seed();
-}
-
-void seed()
-{
- // Add cells at random places
- for (int i = 0; i < maxcells; i++)
- {
- int cX = (int)random(width);
- int cY = (int)random(height);
- if (w.getpix(cX, cY) == black)
- {
- w.setpix(cX, cY, spore_color);
- cells[numcells] = new Cell(cX, cY);
- numcells++;
- }
- }
-}
-
-void draw()
-{
- // Run cells in random order
- for (int i = 0; i < runs_per_loop; i++) {
- int selected = min((int)random(numcells), numcells - 1);
- cells[selected].run();
- }
-}
-
-void clearscr()
-{
- background(0);
-}
-
-class Cell
-{
- int x, y;
- Cell(int xin, int yin)
- {
- x = xin;
- y = yin;
- }
-
- // Perform action based on surroundings
- void run()
- {
- // Fix cell coordinates
- while(x < 0) {
- x+=width;
- }
- while(x > width - 1) {
- x-=width;
- }
- while(y < 0) {
- y+=height;
- }
- while(y > height - 1) {
- y-=height;
- }
-
- // Cell instructions
- if (w.getpix(x + 1, y) == black) {
- move(0, 1);
- } else if (w.getpix(x, y - 1) != black && w.getpix(x, y + 1) != black) {
- move((int)random(9) - 4, (int)random(9) - 4);
- }
- }
-
- // Will move the cell (dx, dy) units if that space is empty
- void move(int dx, int dy) {
- if (w.getpix(x + dx, y + dy) == black) {
- w.setpix(x + dx, y + dy, w.getpix(x, y));
- w.setpix(x, y, color(0));
- x += dx;
- y += dy;
- }
- }
-}
-
-// The World class simply provides two functions, get and set, which access the
-// display in the same way as getPixel and setPixel. The only difference is that
-// the World class's get and set do screen wraparound ("toroidal coordinates").
-class World
-{
- void setpix(int x, int y, int c) {
- while(x < 0) x+=width;
- while(x > width - 1) x-=width;
- while(y < 0) y+=height;
- while(y > height - 1) y-=height;
- set(x, y, c);
- }
-
- color getpix(int x, int y) {
- while(x < 0) x+=width;
- while(x > width - 1) x-=width;
- while(y < 0) y+=height;
- while(y > height - 1) y-=height;
- return get(x, y);
- }
-}
-
-void mousePressed()
-{
- numcells = 0;
- setup();
-}
-
diff --git a/android/examples/Topics/Cellular Automata/Spore2/Spore2.pde b/android/examples/Topics/Cellular Automata/Spore2/Spore2.pde
deleted file mode 100644
index ab4cc83979..0000000000
--- a/android/examples/Topics/Cellular Automata/Spore2/Spore2.pde
+++ /dev/null
@@ -1,174 +0,0 @@
-/**
- * Spore 2
- * by Mike Davis.
- *
- * A short program for alife experiments. Click in the window to restart.
- * Each cell is represented by a pixel on the display as well as an entry in
- * the array 'cells'. Each cell has a run() method, which performs actions
- * based on the cell's surroundings. Cells run one at a time (to avoid conflicts
- * like wanting to move to the same space) and in random order.
- */
-
-World w;
-int maxcells = 8000;
-int numcells;
-Cell[] cells = new Cell[maxcells];
-color spore1, spore2, spore3, spore4;
-color black = color(0, 0, 0);
-// set lower for smoother animation, higher for faster simulation
-int runs_per_loop = 10000;
-
-void setup()
-{
- size(640, 200, P2D);
- frameRate(24);
- clearscr();
- w = new World();
- spore1 = color(128, 172, 255);
- spore2 = color(64, 128, 255);
- spore3 = color(255, 128, 172);
- spore4 = color(255, 64, 128);
- numcells = 0;
- seed();
-}
-
-void seed()
-{
- // Add cells at random places
- for (int i = 0; i < maxcells; i++)
- {
- int cX = int(random(width));
- int cY = int(random(height));
- int c;
- float r = random(1);
- if (r < 0.25) c = spore1;
- else if (r < 0.5) c = spore2;
- else if (r < 0.75) c = spore3;
- else c = spore4;
- if (w.getpix(cX, cY) == black)
- {
- w.setpix(cX, cY, c);
- cells[numcells] = new Cell(cX, cY);
- numcells++;
- }
- }
-}
-
-void draw()
-{
- // Run cells in random order
- for (int i = 0; i < runs_per_loop; i++) {
- int selected = min((int)random(numcells), numcells - 1);
- cells[selected].run();
- }
-}
-
-void clearscr()
-{
- for (int y = 0; y < height; y++) {
- for (int x = 0; x < width; x++) {
- set(x, y, color(0));
- }
- }
-}
-
-class Cell
-{
- int x, y;
- Cell(int xin, int yin)
- {
- x = xin;
- y = yin;
- }
- // Perform action based on surroundings
- void run()
- {
- // Fix cell coordinates
- while(x < 0) {
- x+=width;
- }
- while(x > width - 1) {
- x-=width;
- }
- while(y < 0) {
- y+=height;
- }
- while(y > height - 1) {
- y-=height;
- }
-
- // Cell instructions
- int myColor = w.getpix(x, y);
- if (myColor == spore1) {
- if (w.getpix(x - 1, y + 1) == black && w.getpix(x + 1, y + 1) == black && w.getpix(x, y + 1) == black) move(0, 1);
- else if (w.getpix(x - 1, y) == spore2 && w.getpix(x - 1, y - 1) != black) move(0, -1);
- else if (w.getpix(x - 1, y) == spore2 && w.getpix(x - 1, y - 1) == black) move(-1, -1);
- else if (w.getpix(x + 1, y) == spore1 && w.getpix(x + 1, y - 1) != black) move(0, -1);
- else if (w.getpix(x + 1, y) == spore1 && w.getpix(x + 1, y - 1) == black) move(1, -1);
- else move((int)random(3) - 1, 0);
- } else if (myColor == spore2) {
- if (w.getpix(x - 1, y + 1) == black && w.getpix(x + 1, y + 1) == black && w.getpix(x, y + 1) == black) move(0, 1);
- else if (w.getpix(x + 1, y) == spore1 && w.getpix(x + 1, y - 1) != black) move(0, -1);
- else if (w.getpix(x + 1, y) == spore1 && w.getpix(x + 1, y - 1) == black) move(1, -1);
- else if (w.getpix(x - 1, y) == spore2 && w.getpix(x - 1, y - 1) != black) move(0, -1);
- else if (w.getpix(x - 1, y) == spore2 && w.getpix(x - 1, y - 1) == black) move(-1, -1);
- else move((int)random(3) - 1, 0);
- }
- else if (myColor == spore3)
- {
- if (w.getpix(x - 1, y - 1) == black && w.getpix(x + 1, y - 1) == black && w.getpix(x, y - 1) == black) move(0, -1);
- else if (w.getpix(x - 1, y) == spore4 && w.getpix(x - 1, y + 1) != black) move(0, 1);
- else if (w.getpix(x - 1, y) == spore4 && w.getpix(x - 1, y + 1) == black) move(-1, 1);
- else if (w.getpix(x + 1, y) == spore3 && w.getpix(x + 1, y + 1) != black) move(0, 1);
- else if (w.getpix(x + 1, y) == spore3 && w.getpix(x + 1, y + 1) == black) move(1, 1);
- else move((int)random(3) - 1, 0);
- }
- else if (myColor == spore4)
- {
- if (w.getpix(x - 1, y - 1) == black && w.getpix(x + 1, y - 1) == black && w.getpix(x, y - 1) == black) move(0, -1);
- else if (w.getpix(x + 1, y) == spore3 && w.getpix(x + 1, y + 1) != black) move(0, 1);
- else if (w.getpix(x + 1, y) == spore3 && w.getpix(x + 1, y + 1) == black) move(1, 1);
- else if (w.getpix(x - 1, y) == spore4 && w.getpix(x - 1, y + 1) != black) move(0, 1);
- else if (w.getpix(x - 1, y) == spore4 && w.getpix(x - 1, y + 1) == black) move(-1, 1);
- else move((int)random(3) - 1, 0);
- }
- }
-
- // Will move the cell (dx, dy) units if that space is empty
- void move(int dx, int dy) {
- if (w.getpix(x + dx, y + dy) == black) {
- w.setpix(x + dx, y + dy, w.getpix(x, y));
- w.setpix(x, y, color(0));
- x += dx;
- y += dy;
- }
- }
-}
-
-// The World class simply provides two functions, get and set, which access the
-// display in the same way as getPixel and setPixel. The only difference is that
-// the World class's get and set do screen wraparound ("toroidal coordinates").
-class World
-{
- void setpix(int x, int y, int c) {
- while(x < 0) x+=width;
- while(x > width - 1) x-=width;
- while(y < 0) y+=height;
- while(y > height - 1) y-=height;
- set(x, y, c);
- }
-
- color getpix(int x, int y) {
- while(x < 0) x+=width;
- while(x > width - 1) x-=width;
- while(y < 0) y+=height;
- while(y > height - 1) y-=height;
- return get(x, y);
- }
-}
-
-void mousePressed()
-{
- setup();
-}
-
diff --git a/android/examples/Topics/Cellular Automata/Wolfram/CA.pde b/android/examples/Topics/Cellular Automata/Wolfram/CA.pde
deleted file mode 100644
index 30d02a378f..0000000000
--- a/android/examples/Topics/Cellular Automata/Wolfram/CA.pde
+++ /dev/null
@@ -1,94 +0,0 @@
-class CA {
-
- int[] cells; // An array of 0s and 1s
- int generation; // How many generations?
- int scl; // How many pixels wide/high is each cell?
-
- int[] rules; // An array to store the ruleset, for example {0,1,1,0,1,1,0,1}
-
- CA(int[] r) {
- rules = r;
- scl = 1;
- cells = new int[width/scl];
- restart();
- }
-
- CA() {
- scl = 1;
- cells = new int[width/scl];
- randomize();
- restart();
- }
-
- // Set the rules of the CA
- void setRules(int[] r) {
- rules = r;
- }
-
- // Make a random ruleset
- void randomize() {
- for (int i = 0; i < 8; i++) {
- rules[i] = int(random(2));
- }
- }
-
- // Reset to generation 0
- void restart() {
- for (int i = 0; i < cells.length; i++) {
- cells[i] = 0;
- }
- cells[cells.length/2] = 1; // We arbitrarily start with just the middle cell having a state of "1"
- generation = 0;
- }
-
- // The process of creating the new generation
- void generate() {
- // First we create an empty array for the new values
- int[] nextgen = new int[cells.length];
- // For every spot, determine new state by examing current state, and neighbor states
- // Ignore edges that only have one neighor
- for (int i = 1; i < cells.length-1; i++) {
- int left = cells[i-1]; // Left neighbor state
- int me = cells[i]; // Current state
- int right = cells[i+1]; // Right neighbor state
- nextgen[i] = rules(left,me,right); // Compute next generation state based on ruleset
- }
- // Copy the array into current value
- cells = (int[]) nextgen.clone();
- generation++;
- }
-
- // This is the easy part, just draw the cells, fill 255 for '1', fill 0 for '0'
- void render() {
- for (int i = 0; i < cells.length; i++) {
- if (cells[i] == 1) fill(255);
- else fill(0);
- noStroke();
- rect(i*scl,generation*scl, scl,scl);
- }
- }
-
- // Implementing the Wolfram rules
- // Could be improved and made more concise, but here we can explicitly see what is going on for each case
- int rules (int a, int b, int c) {
- if (a == 1 && b == 1 && c == 1) return rules[0];
- if (a == 1 && b == 1 && c == 0) return rules[1];
- if (a == 1 && b == 0 && c == 1) return rules[2];
- if (a == 1 && b == 0 && c == 0) return rules[3];
- if (a == 0 && b == 1 && c == 1) return rules[4];
- if (a == 0 && b == 1 && c == 0) return rules[5];
- if (a == 0 && b == 0 && c == 1) return rules[6];
- if (a == 0 && b == 0 && c == 0) return rules[7];
- return 0;
- }
-
- // The CA is done if it reaches the bottom of the screen
- boolean finished() {
- if (generation > height/scl) {
- return true;
- } else {
- return false;
- }
- }
-}
-
diff --git a/android/examples/Topics/Cellular Automata/Wolfram/Wolfram.pde b/android/examples/Topics/Cellular Automata/Wolfram/Wolfram.pde
deleted file mode 100644
index 328e6b9b94..0000000000
--- a/android/examples/Topics/Cellular Automata/Wolfram/Wolfram.pde
+++ /dev/null
@@ -1,38 +0,0 @@
-/**
- * Wolfram Cellular Automata
- * by Daniel Shiffman.
- *
- * Simple demonstration of a Wolfram 1-dimensional cellular automata
- * When the system reaches bottom of the window, it restarts with a new ruleset
- * Mouse click restarts as well.
- */
-
-CA ca; // An instance object to describe the Wolfram basic Cellular Automata
-
-void setup() {
- size(640, 360, P2D);
- frameRate(30);
- background(0);
- int[] ruleset = {0,1,0,1,1,0,1,0}; // An initial rule system
- ca = new CA(ruleset); // Initialize CA
-}
-
-void draw() {
- ca.render(); // Draw the CA
- ca.generate(); // Generate the next level
-
- if (ca.finished()) { // If we're done, clear the screen, pick a new ruleset and restart
- background(0);
- ca.randomize();
- ca.restart();
- }
-}
-
-void mousePressed() {
- background(0);
- ca.randomize();
- ca.restart();
-}
-
-
-
diff --git a/android/examples/Topics/Create Shapes/BeginEndContour/BeginEndContour.pde b/android/examples/Topics/Create Shapes/BeginEndContour/BeginEndContour.pde
deleted file mode 100644
index 2769397e1b..0000000000
--- a/android/examples/Topics/Create Shapes/BeginEndContour/BeginEndContour.pde
+++ /dev/null
@@ -1,45 +0,0 @@
-/**
- * BeginEndContour
- *
- * How to cut a shape out of another using beginContour() and endContour()
- */
-
-PShape s;
-
-void setup() {
- size(640, 360, P2D);
- orientation(LANDSCAPE);
- smooth();
- // Make a shape
- s = createShape();
- s.beginShape();
- s.fill(0);
- s.stroke(255);
- s.strokeWeight(2);
- // Exterior part of shape
- s.vertex(-100,-100);
- s.vertex(100,-100);
- s.vertex(100,100);
- s.vertex(-100,100);
-
- // Interior part of shape
- s.beginContour();
- s.vertex(-10,-10);
- s.vertex(10,-10);
- s.vertex(10,10);
- s.vertex(-10,10);
- s.endContour();
-
- // Finishing off shape
- s.endShape(CLOSE);
-}
-
-void draw() {
- background(52);
- // Display shape
- translate(width/2, height/2);
- // Shapes can be rotated
- s.rotate(0.01);
- shape(s);
-}
-
diff --git a/android/examples/Topics/Create Shapes/GroupPShape/GroupPShape.pde b/android/examples/Topics/Create Shapes/GroupPShape/GroupPShape.pde
deleted file mode 100644
index 79007fc69d..0000000000
--- a/android/examples/Topics/Create Shapes/GroupPShape/GroupPShape.pde
+++ /dev/null
@@ -1,68 +0,0 @@
-/**
- * GroupPShape
- *
- * How to group multiple PShapes into one PShape
- */
-
-
-// A PShape that will group PShapes
-PShape group;
-
-void setup() {
- size(640, 360, P2D);
- orientation(LANDSCAPE);
- smooth();
- // Create the shape as a group
- group = createShape(GROUP);
-
- // Make a polygon PShape
- PShape star = createShape();
- star.beginShape();
- star.noFill();
- star.stroke(255);
- star.vertex(0, -50);
- star.vertex(14, -20);
- star.vertex(47, -15);
- star.vertex(23, 7);
- star.vertex(29, 40);
- star.vertex(0, 25);
- star.vertex(-29, 40);
- star.vertex(-23, 7);
- star.vertex(-47, -15);
- star.vertex(-14, -20);
- star.endShape(CLOSE);
-
- // Make a path PShape
- PShape path = createShape();
- path.beginShape();
- path.noFill();
- path.stroke(255);
- for (float a = -PI; a < 0; a += 0.1) {
- float r = random(60, 70);
- path.vertex(r*cos(a), r*sin(a));
- }
- path.endShape();
-
- // Make a primitive (Rectangle) PShape
- PShape rectangle = createShape(RECT,-10,-10,20,20);
- rectangle.setFill(false);
- rectangle.setStroke(color(255));
-
- // Add them all to the group
- group.addChild(star);
- group.addChild(path);
- group.addChild(rectangle);
-}
-
-void draw() {
- // We can access them individually via the group PShape
- PShape rectangle = group.getChild(2);
- // Shapes can be rotated
- rectangle.rotate(0.1);
-
- background(52);
- // Display the group PShape
- translate(mouseX, mouseY);
- shape(group);
-}
-
diff --git a/android/examples/Topics/Create Shapes/ParticleSystemPShape/Particle.pde b/android/examples/Topics/Create Shapes/ParticleSystemPShape/Particle.pde
deleted file mode 100644
index ccccb65092..0000000000
--- a/android/examples/Topics/Create Shapes/ParticleSystemPShape/Particle.pde
+++ /dev/null
@@ -1,82 +0,0 @@
-// An individual Particle
-
-class Particle {
-
- // Velocity
- PVector center;
- PVector velocity;
- // Lifespane is tied to alpha
- float lifespan;
-
- // The particle PShape
- PShape part;
- // The particle size
- float partSize;
-
- // A single force
- PVector gravity = new PVector(0, 0.1);
-
- Particle() {
- partSize = random(10, 60);
- // The particle is a textured quad
- part = createShape();
- part.beginShape(QUAD);
- part.noStroke();
- part.texture(sprite);
- part.normal(0, 0, 1);
- part.vertex(-partSize/2, -partSize/2, 0, 0);
- part.vertex(+partSize/2, -partSize/2, sprite.width, 0);
- part.vertex(+partSize/2, +partSize/2, sprite.width, sprite.height);
- part.vertex(-partSize/2, +partSize/2, 0, sprite.height);
- part.endShape();
-
- // Initialize center vector
- center = new PVector();
-
- // Set the particle starting location
- rebirth(width/2, height/2);
- }
-
- PShape getShape() {
- return part;
- }
-
- void rebirth(float x, float y) {
- float a = random(TWO_PI);
- float speed = random(0.5, 4);
- // A velocity with random angle and magnitude
- velocity = PVector.fromAngle(a);
- velocity.mult(speed);
- // Set lifespan
- lifespan = 255;
- // Set location using translate
- part.resetMatrix();
- part.translate(x, y);
-
- // Update center vector
- center.set(x, y, 0);
- }
-
- // Is it off the screen, or its lifespan is over?
- boolean isDead() {
- if (center.x > width || center.x < 0 ||
- center.y > height || center.y < 0 || lifespan < 0) {
- return true;
- }
- else {
- return false;
- }
- }
-
- void update() {
- // Decrease life
- lifespan = lifespan - 1;
- // Apply gravity
- velocity.add(gravity);
- part.setTint(color(255, lifespan));
- // Move the particle according to its velocity
- part.translate(velocity.x, velocity.y);
- // and also update the center
- center.add(velocity);
- }
-}
diff --git a/android/examples/Topics/Create Shapes/ParticleSystemPShape/ParticleSystem.pde b/android/examples/Topics/Create Shapes/ParticleSystemPShape/ParticleSystem.pde
deleted file mode 100644
index e2215046e0..0000000000
--- a/android/examples/Topics/Create Shapes/ParticleSystemPShape/ParticleSystem.pde
+++ /dev/null
@@ -1,43 +0,0 @@
-// The Particle System
-
-class ParticleSystem {
- // It's just an ArrayList of particle objects
- ArrayList particles;
-
- // The PShape to group all the particle PShapes
- PShape particleShape;
-
- ParticleSystem(int n) {
- particles = new ArrayList();
- // The PShape is a group
- particleShape = createShape(GROUP);
-
- // Make all the Particles
- for (int i = 0; i < n; i++) {
- Particle p = new Particle();
- particles.add(p);
- // Each particle's PShape gets added to the System PShape
- particleShape.addChild(p.getShape());
- }
- }
-
- void update() {
- for (Particle p : particles) {
- p.update();
- }
- }
-
- void setEmitter(float x, float y) {
- for (Particle p : particles) {
- // Each particle gets reborn at the emitter location
- if (p.isDead()) {
- p.rebirth(x, y);
- }
- }
- }
-
- void display() {
- shape(particleShape);
- }
-}
-
diff --git a/android/examples/Topics/Create Shapes/ParticleSystemPShape/ParticleSystemPShape.pde b/android/examples/Topics/Create Shapes/ParticleSystemPShape/ParticleSystemPShape.pde
deleted file mode 100644
index a9a30d0f5e..0000000000
--- a/android/examples/Topics/Create Shapes/ParticleSystemPShape/ParticleSystemPShape.pde
+++ /dev/null
@@ -1,42 +0,0 @@
-/**
- * ParticleSystemPShape
- *
- * A particle system optimized for drawing using PShape
- */
-
-// Particle System object
-ParticleSystem ps;
-// A PImage for particle's texture
-PImage sprite;
-
-void setup() {
- size(640, 360, P2D);
- orientation(LANDSCAPE);
- // Load the image
- sprite = loadImage("sprite.png");
- // A new particle system with 1,000 particles
- ps = new ParticleSystem(1000);
-
- // Writing to the depth buffer is disabled to avoid rendering
- // artifacts due to the fact that the particles are semi-transparent
- // but not z-sorted.
- hint(DISABLE_DEPTH_MASK);
-
-}
-
-void draw () {
- background(0);
- // Update and display system
- ps.update();
- ps.display();
-
- // Set the particle system's emitter location to the mouse
- ps.setEmitter(mouseX,mouseY);
-
- // Display frame rate
- fill(255);
- textSize(16);
- text("Frame rate: " + int(frameRate),10,20);
-
-}
-
diff --git a/android/examples/Topics/Create Shapes/ParticleSystemPShape/data/sprite.png b/android/examples/Topics/Create Shapes/ParticleSystemPShape/data/sprite.png
deleted file mode 100644
index cc0f45cba1..0000000000
Binary files a/android/examples/Topics/Create Shapes/ParticleSystemPShape/data/sprite.png and /dev/null differ
diff --git a/android/examples/Topics/Create Shapes/PathPShape/PathPShape.pde b/android/examples/Topics/Create Shapes/PathPShape/PathPShape.pde
deleted file mode 100644
index 7d650624e1..0000000000
--- a/android/examples/Topics/Create Shapes/PathPShape/PathPShape.pde
+++ /dev/null
@@ -1,38 +0,0 @@
-/**
- * PathPShape
- *
- * A simple path using PShape
- */
-
-// A PShape object
-PShape path;
-
-void setup() {
- size(640, 360, P2D);
- orientation(LANDSCAPE);
- // Create the shape
- path = createShape();
- path.beginShape();
- // Set fill and stroke
- path.noFill();
- path.stroke(255);
- path.strokeWeight(2);
-
- float x = 0;
- // Calculate the path as a sine wave
- for (float a = 0; a < TWO_PI; a+=0.1) {
- path.vertex(x,sin(a)*100);
- x+= 5;
- }
- // The path is complete
- path.endShape();
-
-}
-
-void draw() {
- background(51);
- // Draw the path at the mouse location
- translate(mouseX, mouseY);
- shape(path);
-}
-
diff --git a/android/examples/Topics/Create Shapes/PolygonPShape/PolygonPShape.pde b/android/examples/Topics/Create Shapes/PolygonPShape/PolygonPShape.pde
deleted file mode 100644
index cb0b0aba2b..0000000000
--- a/android/examples/Topics/Create Shapes/PolygonPShape/PolygonPShape.pde
+++ /dev/null
@@ -1,42 +0,0 @@
-
-/**
- * PrimitivePShape.
- *
- * Using a PShape to display a custom polygon.
- */
-
-// The PShape object
-PShape star;
-
-void setup() {
- size(640, 360, P2D);
- orientation(LANDSCAPE);
- // First create the shape
- star = createShape();
- star.beginShape();
- // You can set fill and stroke
- star.fill(102);
- star.stroke(255);
- star.strokeWeight(2);
- // Here, we are hardcoding a series of vertices
- star.vertex(0, -50);
- star.vertex(14, -20);
- star.vertex(47, -15);
- star.vertex(23, 7);
- star.vertex(29, 40);
- star.vertex(0, 25);
- star.vertex(-29, 40);
- star.vertex(-23, 7);
- star.vertex(-47, -15);
- star.vertex(-14, -20);
- star.endShape(CLOSE);
-}
-
-void draw() {
- background(51);
- // We can use translate to move the PShape
- translate(mouseX, mouseY);
- // Display the shape
- shape(star);
-}
-
diff --git a/android/examples/Topics/Create Shapes/PolygonPShapeOOP/PolygonPShapeOOP.pde b/android/examples/Topics/Create Shapes/PolygonPShapeOOP/PolygonPShapeOOP.pde
deleted file mode 100644
index 4f040adc23..0000000000
--- a/android/examples/Topics/Create Shapes/PolygonPShapeOOP/PolygonPShapeOOP.pde
+++ /dev/null
@@ -1,30 +0,0 @@
-/**
- * PolygonPShapeOOP.
- *
- * Wrapping a PShape inside a custom class
- */
-
-
-// A Star object
-Star s1, s2;
-
-void setup() {
- size(640, 360, P2D);
- orientation(LANDSCAPE);
- // Make a new Star
- s1 = new Star();
- s2 = new Star();
-
-}
-
-void draw() {
- background(51);
-
- s1.display(); // Display the first star
- s1.move(); // Move the first star
-
- s2.display(); // Display the second star
- s2.move(); // Move the second star
-
-}
-
diff --git a/android/examples/Topics/Create Shapes/PolygonPShapeOOP/Star.pde b/android/examples/Topics/Create Shapes/PolygonPShapeOOP/Star.pde
deleted file mode 100644
index d75d445ebc..0000000000
--- a/android/examples/Topics/Create Shapes/PolygonPShapeOOP/Star.pde
+++ /dev/null
@@ -1,52 +0,0 @@
-// A class to describe a Star shape
-
-class Star {
-
- // The PShape object
- PShape s;
- // The location where we will draw the shape
- float x, y;
- float speed;
-
- Star() {
- x = random(100, width-100);
- y = random(100, height-100);
- speed = random(0.5, 3);
- // First create the shape
- s = createShape();
- s.beginShape();
- // You can set fill and stroke
- s.fill(255, 204);
- s.noStroke();
- // Here, we are hardcoding a series of vertices
- s.vertex(0, -50);
- s.vertex(14, -20);
- s.vertex(47, -15);
- s.vertex(23, 7);
- s.vertex(29, 40);
- s.vertex(0, 25);
- s.vertex(-29, 40);
- s.vertex(-23, 7);
- s.vertex(-47, -15);
- s.vertex(-14, -20);
- // The shape is complete
- s.endShape(CLOSE);
- }
-
- void move() {
- // Demonstrating some simple motion
- x += speed;
- if (x > width+100) {
- x = -100;
- }
- }
-
- void display() {
- // Locating and drawing the shape
- pushMatrix();
- translate(x, y);
- shape(s);
- popMatrix();
- }
-}
-
diff --git a/android/examples/Topics/Create Shapes/PolygonPShapeOOP2/Polygon.pde b/android/examples/Topics/Create Shapes/PolygonPShapeOOP2/Polygon.pde
deleted file mode 100644
index e775fb436b..0000000000
--- a/android/examples/Topics/Create Shapes/PolygonPShapeOOP2/Polygon.pde
+++ /dev/null
@@ -1,34 +0,0 @@
-// A class to describe a Polygon (with a PShape)
-
-class Polygon {
- // The PShape object
- PShape s;
- // The location where we will draw the shape
- float x, y;
- // Variable for simple motion
- float speed;
-
- Polygon(PShape s_) {
- x = random(width);
- y = random(-500, -100);
- s = s_;
- speed = random(2, 6);
- }
-
- // Simple motion
- void move() {
- y+=speed;
- if (y > height+100) {
- y = -100;
- }
- }
-
- // Draw the object
- void display() {
- pushMatrix();
- translate(x, y);
- shape(s);
- popMatrix();
- }
-}
-
diff --git a/android/examples/Topics/Create Shapes/PolygonPShapeOOP2/PolygonPShapeOOP2.pde b/android/examples/Topics/Create Shapes/PolygonPShapeOOP2/PolygonPShapeOOP2.pde
deleted file mode 100644
index b5223310fb..0000000000
--- a/android/examples/Topics/Create Shapes/PolygonPShapeOOP2/PolygonPShapeOOP2.pde
+++ /dev/null
@@ -1,53 +0,0 @@
-/**
- * PolygonPShapeOOP.
- *
- * Wrapping a PShape inside a custom class
- * and demonstrating how we can have a multiple objects each
- * using the same PShape.
- */
-
-
-// A list of objects
-ArrayList polygons;
-
-void setup() {
- size(640, 360, P2D);
- orientation(LANDSCAPE);
- // Make a PShape
- PShape star = createShape();
- star.beginShape();
- star.noStroke();
- star.fill(0, 127);
- star.vertex(0, -50);
- star.vertex(14, -20);
- star.vertex(47, -15);
- star.vertex(23, 7);
- star.vertex(29, 40);
- star.vertex(0, 25);
- star.vertex(-29, 40);
- star.vertex(-23, 7);
- star.vertex(-47, -15);
- star.vertex(-14, -20);
- star.endShape(CLOSE);
-
- // Make an ArrayList
- polygons = new ArrayList();
-
- // Add a bunch of objects to the ArrayList
- // Pass in reference to the PShape
- // We coud make polygons with different PShapes
- for (int i = 0; i < 25; i++) {
- polygons.add(new Polygon(star));
- }
-}
-
-void draw() {
- background(255);
-
- // Display and move them all
- for (Polygon poly : polygons) {
- poly.display();
- poly.move();
- }
-}
-
diff --git a/android/examples/Topics/Create Shapes/PolygonPShapeOOP3/Polygon.pde b/android/examples/Topics/Create Shapes/PolygonPShapeOOP3/Polygon.pde
deleted file mode 100644
index e775fb436b..0000000000
--- a/android/examples/Topics/Create Shapes/PolygonPShapeOOP3/Polygon.pde
+++ /dev/null
@@ -1,34 +0,0 @@
-// A class to describe a Polygon (with a PShape)
-
-class Polygon {
- // The PShape object
- PShape s;
- // The location where we will draw the shape
- float x, y;
- // Variable for simple motion
- float speed;
-
- Polygon(PShape s_) {
- x = random(width);
- y = random(-500, -100);
- s = s_;
- speed = random(2, 6);
- }
-
- // Simple motion
- void move() {
- y+=speed;
- if (y > height+100) {
- y = -100;
- }
- }
-
- // Draw the object
- void display() {
- pushMatrix();
- translate(x, y);
- shape(s);
- popMatrix();
- }
-}
-
diff --git a/android/examples/Topics/Create Shapes/PolygonPShapeOOP3/PolygonPShapeOOP3.pde b/android/examples/Topics/Create Shapes/PolygonPShapeOOP3/PolygonPShapeOOP3.pde
deleted file mode 100644
index 5ea6acec11..0000000000
--- a/android/examples/Topics/Create Shapes/PolygonPShapeOOP3/PolygonPShapeOOP3.pde
+++ /dev/null
@@ -1,63 +0,0 @@
-/**
- * PolygonPShapeOOP.
- *
- * Wrapping a PShape inside a custom class
- * and demonstrating how we can have a multiple objects each
- * using the same PShape.
- */
-
-
-// A list of objects
-ArrayList polygons;
-
-// Three possible shapes
-PShape[] shapes = new PShape[3];
-
-void setup() {
- size(640, 360, P2D);
- orientation(LANDSCAPE);
-
- shapes[0] = createShape(ELLIPSE,0,0,100,100);
- shapes[0].setFill(color(255, 127));
- shapes[0].setStroke(false);
- shapes[1] = createShape(RECT,0,0,100,100);
- shapes[1].setFill(color(255, 127));
- shapes[1].setStroke(false);
- shapes[2] = createShape();
- shapes[2].beginShape();
- shapes[2].fill(0, 127);
- shapes[2].noStroke();
- shapes[2].vertex(0, -50);
- shapes[2].vertex(14, -20);
- shapes[2].vertex(47, -15);
- shapes[2].vertex(23, 7);
- shapes[2].vertex(29, 40);
- shapes[2].vertex(0, 25);
- shapes[2].vertex(-29, 40);
- shapes[2].vertex(-23, 7);
- shapes[2].vertex(-47, -15);
- shapes[2].vertex(-14, -20);
- shapes[2].endShape(CLOSE);
-
- // Make an ArrayList
- polygons = new ArrayList();
-
- polygons = new ArrayList();
-
- for (int i = 0; i < 25; i++) {
- int selection = int(random(shapes.length)); // Pick a random index
- Polygon p = new Polygon(shapes[selection]); // Use corresponding PShape to create Polygon
- polygons.add(p);
- }
-}
-
-void draw() {
- background(51);
-
- // Display and move them all
- for (Polygon poly : polygons) {
- poly.display();
- poly.move();
- }
-}
-
diff --git a/android/examples/Topics/Create Shapes/PrimitivePShape/PrimitivePShape.pde b/android/examples/Topics/Create Shapes/PrimitivePShape/PrimitivePShape.pde
deleted file mode 100644
index 0aa9f96107..0000000000
--- a/android/examples/Topics/Create Shapes/PrimitivePShape/PrimitivePShape.pde
+++ /dev/null
@@ -1,29 +0,0 @@
-/**
- * PrimitivePShape.
- *
- * Using a PShape to display a primitive shape (in this case, ellipse).
- */
-
-
-// The PShape object
-PShape circle;
-
-void setup() {
- size(640, 360, P2D);
- orientation(LANDSCAPE);
- // Creating the PShape as an ellipse
- // The corner is -50,-50 so that the center is at 0,0
- circle = createShape(ELLIPSE, -50, -25, 100, 50);
-}
-
-void draw() {
- background(51);
- // We can dynamically set the stroke and fill of the shape
- circle.setStroke(color(255));
- circle.setStrokeWeight(4);
- circle.setFill(color(map(mouseX, 0, width, 0, 255)));
- // We can use translate to move the PShape
- translate(mouseX, mouseY);
- // Drawing the PShape
- shape(circle);
-}
diff --git a/android/examples/Topics/Create Shapes/WigglePShape/WigglePShape.pde b/android/examples/Topics/Create Shapes/WigglePShape/WigglePShape.pde
deleted file mode 100644
index 7a2cc9f47a..0000000000
--- a/android/examples/Topics/Create Shapes/WigglePShape/WigglePShape.pde
+++ /dev/null
@@ -1,23 +0,0 @@
-/**
- * WigglePShape.
- *
- * How to move the individual vertices of a PShape
- */
-
-
-// A "Wiggler" object
-Wiggler w;
-
-void setup() {
- size(640, 360, P2D);
- orientation(LANDSCAPE);
- w = new Wiggler();
-}
-
-void draw() {
- background(255);
- w.display();
- w.wiggle();
-}
-
-
diff --git a/android/examples/Topics/Create Shapes/WigglePShape/Wiggler.pde b/android/examples/Topics/Create Shapes/WigglePShape/Wiggler.pde
deleted file mode 100644
index be4d7981f4..0000000000
--- a/android/examples/Topics/Create Shapes/WigglePShape/Wiggler.pde
+++ /dev/null
@@ -1,67 +0,0 @@
-// An object that wraps the PShape
-
-class Wiggler {
-
- // The PShape to be "wiggled"
- PShape s;
- // Its location
- float x, y;
-
- // For 2D Perlin noise
- float yoff = 0;
-
- // We are using an ArrayList to keep a duplicate copy
- // of vertices original locations.
- ArrayList original;
-
- Wiggler() {
- x = width/2;
- y = height/2;
-
- // The "original" locations of the vertices make up a circle
- original = new ArrayList();
- for (float a = 0; a < TWO_PI; a+=0.2) {
- PVector v = PVector.fromAngle(a);
- v.mult(100);
- original.add(v);
- }
-
- // Now make the PShape with those vertices
- s = createShape();
- s.beginShape();
- s.fill(127);
- s.stroke(0);
- s.strokeWeight(2);
- for (PVector v : original) {
- s.vertex(v.x, v.y);
- }
- s.endShape(CLOSE);
- }
-
- void wiggle() {
- float xoff = 0;
- // Apply an offset to each vertex
- for (int i = 0; i < s.getVertexCount(); i++) {
- // Calculate a new vertex location based on noise around "original" location
- PVector pos = original.get(i);
- float a = TWO_PI*noise(xoff,yoff);
- PVector r = PVector.fromAngle(a);
- r.mult(4);
- r.add(pos);
- // Set the location of each vertex to the new one
- s.setVertex(i, r.x, r.y);
- // increment perlin noise x value
- xoff+= 0.5;
- }
- // Increment perlin noise y value
- yoff += 0.02;
- }
-
- void display() {
- pushMatrix();
- translate(x, y);
- shape(s);
- popMatrix();
- }
-}
-
diff --git a/android/examples/Topics/Drawing/Animator/Animator.pde b/android/examples/Topics/Drawing/Animator/Animator.pde
deleted file mode 100644
index 883602eea8..0000000000
--- a/android/examples/Topics/Drawing/Animator/Animator.pde
+++ /dev/null
@@ -1,49 +0,0 @@
-/**
- * Animator.
- *
- * Click and drag to draw and start the program.
- *
- * A simple animation tool that displays a continuous cycle of
- * twenty-four images. Each image is displayed for 30 milliseconds
- * to create animation. While each image is displayed, it’s possible
- * to draw directly into it by pressing the mouse and moving the cursor.
- *
- */
-
-int currentFrame = 0;
-PImage[] frames = new PImage[24];
-int lastTime = 0;
-
-void setup()
-{
- size(640, 200);
- strokeWeight(12);
- smooth();
- background(204);
- for (int i = 0; i < frames.length; i++) {
- frames[i] = get(); // Create a blank frame
- }
-}
-
-void draw()
-{
- int currentTime = millis();
- if (currentTime > lastTime+30) {
- nextFrame();
- lastTime = currentTime;
- }
- if (mousePressed == true) {
- line(pmouseX, pmouseY, mouseX, mouseY);
- }
-}
-
-void nextFrame()
-{
- frames[currentFrame] = get(); // Get the display window
- currentFrame++; // Increment to next frame
- if (currentFrame >= frames.length) {
- currentFrame = 0;
- }
- image(frames[currentFrame], 0, 0);
-}
-
diff --git a/android/examples/Topics/Drawing/ContinuousLines/ContinuousLines.pde b/android/examples/Topics/Drawing/ContinuousLines/ContinuousLines.pde
deleted file mode 100644
index 9687331ba4..0000000000
--- a/android/examples/Topics/Drawing/ContinuousLines/ContinuousLines.pde
+++ /dev/null
@@ -1,17 +0,0 @@
-/**
- * Continuous Lines.
- *
- * Click and drag the mouse to draw a line.
- */
-
-void setup() {
- size(640, 200);
- background(102);
-}
-
-void draw() {
- stroke(255);
- if(mousePressed) {
- line(mouseX, mouseY, pmouseX, pmouseY);
- }
-}
diff --git a/android/examples/Topics/Drawing/CustomTool/CustomTool.pde b/android/examples/Topics/Drawing/CustomTool/CustomTool.pde
deleted file mode 100644
index 96c3ec67c7..0000000000
--- a/android/examples/Topics/Drawing/CustomTool/CustomTool.pde
+++ /dev/null
@@ -1,84 +0,0 @@
-/**
- * Custom Tool.
- *
- * Move the cursor across the screen to draw.
- * In addition to creating software tools to simulate pens and pencils,
- * it is possible to create unique tools to draw with.
- */
-
-int dots = 1000;
-float[] dX = new float[dots];
-float[] dY = new float[dots];
-
-float l_0 = 0.0;
-float h_0 = 0.0;
-
-float legX = 0.0;
-float legY = 0.0;
-float thighX = 0.0;
-float thighY = 0.0;
-
-float l = 60.0; // Length of the 'leg'
-float h = 90.0; // Height of the 'leg'
-
-float nmx, nmy = 0.0;
-float mx, my = 0.0;
-
-int currentValue = 0;
-int valdir = 1;
-
-void setup()
-{
- size(640, 360);
- noStroke();
- smooth();
- background(102);
-}
-
-void draw()
-{
- // Smooth the mouse
- nmx = mouseX;
- nmy = mouseY;
- if((abs(mx - nmx) > 1.0) || (abs(my - nmy) > 1.0)) {
- mx = mx - (mx-nmx)/20.0;
- my = my - (my-nmy)/20.0;
-
- // Set the drawing value
- currentValue += 1* valdir;
- if(currentValue > 255 || currentValue <= 0) {
- valdir *= -1;
- }
- }
-
- iKinematics();
- kinematics();
-
- pushMatrix();
- translate(width/2, height/2);
- stroke(currentValue);
- line(thighX, thighY, legX, legY);
- popMatrix();
-
- stroke(255);
- point(legX + width/2, legY + height/2);
-}
-
-void kinematics()
-{
- thighX = h*cos(h_0);
- thighY = h*sin(h_0);
- legX = thighX + l*cos(h_0 - l_0);
- legY = thighY + l*sin(h_0 - l_0);
-}
-
-void iKinematics()
-{
- float tx = mx - width/2.0;
- float ty = my - height/2.0;
- float c2 = (tx*tx + ty*ty - h*h - l*l)/(2*h*l); //in degrees
- float s2 = sqrt(abs(1 - c2*c2)); // the sign here determines the bend in the joint
- l_0 = -atan2(s2, c2);
- h_0 = atan2(ty, tx) - atan2(l*s2, h+l*c2);
-}
-
diff --git a/android/examples/Topics/Drawing/CustomTool/data/milan.jpg b/android/examples/Topics/Drawing/CustomTool/data/milan.jpg
deleted file mode 100644
index 41aa2713dc..0000000000
Binary files a/android/examples/Topics/Drawing/CustomTool/data/milan.jpg and /dev/null differ
diff --git a/android/examples/Topics/Drawing/CustomTool/data/paris.jpg b/android/examples/Topics/Drawing/CustomTool/data/paris.jpg
deleted file mode 100644
index a6d85ed574..0000000000
Binary files a/android/examples/Topics/Drawing/CustomTool/data/paris.jpg and /dev/null differ
diff --git a/android/examples/Topics/Drawing/Pattern/Pattern.pde b/android/examples/Topics/Drawing/Pattern/Pattern.pde
deleted file mode 100644
index 882b19d742..0000000000
--- a/android/examples/Topics/Drawing/Pattern/Pattern.pde
+++ /dev/null
@@ -1,34 +0,0 @@
-/**
- * Patterns.
- *
- * Move the cursor over the image to draw with a software tool
- * which responds to the speed of the mouse.
- */
-
-void setup()
-{
- size(640, 360);
- background(102);
- smooth();
-}
-
-void draw()
-{
- // Call the variableEllipse() method and send it the
- // parameters for the current mouse position
- // and the previous mouse position
- variableEllipse(mouseX, mouseY, pmouseX, pmouseY);
-}
-
-
-// The simple method variableEllipse() was created specifically
-// for this program. It calculates the speed of the mouse
-// and draws a small ellipse if the mouse is moving slowly
-// and draws a large ellipse if the mouse is moving quickly
-
-void variableEllipse(int x, int y, int px, int py)
-{
- float speed = abs(x-px) + abs(y-py);
- stroke(speed);
- ellipse(x, y, speed, speed);
-}
diff --git a/android/examples/Topics/Drawing/Pulses/Pulses.pde b/android/examples/Topics/Drawing/Pulses/Pulses.pde
deleted file mode 100644
index c8b07ec52b..0000000000
--- a/android/examples/Topics/Drawing/Pulses/Pulses.pde
+++ /dev/null
@@ -1,33 +0,0 @@
-/**
- * Pulses.
- *
- * Software drawing instruments can follow a rhythm or abide by rules independent
- * of drawn gestures. This is a form of collaborative drawing in which the draftsperson
- * controls some aspects of the image and the software controls others.
- */
-
-int angle = 0;
-
-void setup() {
- size(640, 360);
- background(102);
- smooth();
- noStroke();
- fill(0, 102);
-}
-
-void draw() {
- // Draw only when mouse is pressed
- if (mousePressed == true) {
- angle += 10;
- float val = cos(radians(angle)) * 6.0;
- for (int a = 0; a < 360; a += 75) {
- float xoff = cos(radians(a)) * val;
- float yoff = sin(radians(a)) * val;
- fill(0);
- ellipse(mouseX + xoff, mouseY + yoff, val, val);
- }
- fill(255);
- ellipse(mouseX, mouseY, 2, 2);
- }
-}
diff --git a/android/examples/Topics/Drawing/ScribblePlotter/ScribblePlotter.pde b/android/examples/Topics/Drawing/ScribblePlotter/ScribblePlotter.pde
deleted file mode 100644
index f5dcbf6efd..0000000000
--- a/android/examples/Topics/Drawing/ScribblePlotter/ScribblePlotter.pde
+++ /dev/null
@@ -1,91 +0,0 @@
-/**
- * Scribble Plotter
- * by Ira Greenberg.
- *
- * Using 2-dimensional arrays, record end points
- * and replot scribbles between points.
- */
-
-int SCRIBBLE = 0;
-int HATCHING = 1;
-
-void setup(){
- size(640, 360);
- background(0);
-
- // Create arrays to hold x, y coords
- float[]x = new float[4];
- float[]y = new float[4];
- // create a convenient 2-dimensional
- // array to hold x, y arrays
- float[][]xy = {x, y};
-
- // Record points
- // X positions
- xy[0][0] = 125;
- xy[0][1] = 475;
- xy[0][2] = 475;
- xy[0][3] = 125;
-
- // Y positions
- xy[1][0] = 100;
- xy[1][1] = 100;
- xy[1][2] = 260;
- xy[1][3] = 260;
-
- // Call plotting function
- makeRect(xy);
-}
-
-void makeRect(float[][]pts){
- stroke(255);
- smooth();
-
- // Scribble variables, that get passed as arguments to the scribble function
- int steps = 100;
- float scribVal = 3.0;
- for (int i = 0; i < pts[0].length; i++){
- // Plots vertices
- strokeWeight(5);
- point(pts[0][i], pts[1][i]);
-
- // Call scribble function
- strokeWeight(.5);
- if (i > 0){
- scribble(pts[0][i], pts[1][i], pts[0][i-1], pts[1][i-1], steps, scribVal, SCRIBBLE);
- }
- if (i == pts[0].length-1){
- // Show some hatching between last 2 points
- scribble(pts[0][i], pts[1][i], pts[0][0], pts[1][0], steps, scribVal*2, HATCHING);
- }
- }
-}
-
-/*
- Scribble function plots lines between end points,
- determined by steps and scribVal arguments.
- two styles are available: SCRIBBLE and HATCHING, which
- are interestingly only dependent on parentheses
- placement in the line() function calls.
-*/
-
-void scribble(float x1, float y1, float x2, float y2, int steps, float scribVal, int style){
-
- float xStep = (x2-x1)/steps;
- float yStep = (y2-y1)/steps;
- for (int i = 0; i < steps; i++){
- if(style == SCRIBBLE){
- if (i < steps-1){
- line(x1, y1, x1+=xStep+random(-scribVal, scribVal), y1+=yStep+random(-scribVal, scribVal));
- }
- else {
- // extra line needed to attach line back to point- not necessary in HATCHING style
- line(x1, y1, x2, y2);
- }
- }
- else if (style == HATCHING){
- line(x1, y1, (x1+=xStep)+random(-scribVal, scribVal), (y1+=yStep)+random(-scribVal, scribVal));
- }
- }
-}
-
diff --git a/android/examples/Topics/Effects/FireCube/FireCube.pde b/android/examples/Topics/Effects/FireCube/FireCube.pde
deleted file mode 100644
index 7c7247fc00..0000000000
--- a/android/examples/Topics/Effects/FireCube/FireCube.pde
+++ /dev/null
@@ -1,112 +0,0 @@
-/**
- * Fire Cube demo effect
- * by luis2048.
- *
- * A rotating wireframe cube with flames rising up the screen.
- * The fire effect has been used quite often for oldskool demos.
- * First you create a palette of 256 colors ranging from red to
- * yellow (including black). For every frame, calculate each row
- * of pixels based on the two rows below it: The value of each pixel,
- * becomes the sum of the 3 pixels below it (one directly below, one
- * to the left, and one to the right), and one pixel directly two
- * rows below it. Then divide the sum so that the fire dies out as
- * it rises.
- */
-
-// This will contain the pixels used to calculate the fire effect
-int[][] fire;
-
-// Flame colors
-color[] palette;
-float angle;
-int[] calc1,calc2,calc3,calc4,calc5;
-
-PGraphics pg;
-
-void setup(){
- size(640, 360, P2D);
-
- // Create buffered image for 3d cube
- pg = createGraphics(width, height, P3D);
-
- calc1 = new int[width];
- calc3 = new int[width];
- calc4 = new int[width];
- calc2 = new int[height];
- calc5 = new int[height];
-
- colorMode(HSB);
-
- fire = new int[width][height];
- palette = new color[255];
-
- // Generate the palette
- for(int x = 0; x < palette.length; x++) {
- //Hue goes from 0 to 85: red to yellow
- //Saturation is always the maximum: 255
- //Lightness is 0..255 for x=0..128, and 255 for x=128..255
- palette[x] = color(x/3, 255, constrain(x*3, 0, 255));
- }
-
- // Precalculate which pixel values to add during animation loop
- // this speeds up the effect by 10fps
- for (int x = 0; x < width; x++) {
- calc1[x] = x % width;
- calc3[x] = (x - 1 + width) % width;
- calc4[x] = (x + 1) % width;
- }
-
- for(int y = 0; y < height; y++) {
- calc2[y] = (y + 1) % height;
- calc5[y] = (y + 2) % height;
- }
-}
-
-void draw() {
- angle = angle + 0.05;
-
- // Rotating wireframe cube
- pg.beginDraw();
- pg.translate(width >> 1, height >> 1);
- pg.rotateX(sin(angle/2));
- pg.rotateY(cos(angle/2));
- pg.background(0);
- pg.stroke(128);
- pg.scale(25);
- pg.noFill();
- pg.box(4);
- pg.endDraw();
-
- // Randomize the bottom row of the fire buffer
- for(int x = 0; x < width; x++)
- {
- fire[x][height-1] = int(random(0,190)) ;
- }
-
- loadPixels();
-
- int counter = 0;
- // Do the fire calculations for every pixel, from top to bottom
- for (int y = 0; y < height; y++) {
- for(int x = 0; x < width; x++) {
- // Add pixel values around current pixel
-
- fire[x][y] =
- ((fire[calc3[x]][calc2[y]]
- + fire[calc1[x]][calc2[y]]
- + fire[calc4[x]][calc2[y]]
- + fire[calc1[x]][calc5[y]]) << 5) / 129;
-
- // Output everything to screen using our palette colors
- pixels[counter] = palette[fire[x][y]];
-
- // Extract the red value using right shift and bit mask
- // equivalent of red(pg.pixels[x+y*w])
- if ((pg.pixels[counter++] >> 16 & 0xFF) == 128) {
- // Only map 3D cube 'lit' pixels onto fire array needed for next frame
- fire[x][y] = 128;
- }
- }
- }
- updatePixels();
-}
diff --git a/android/examples/Topics/Effects/Lens/Lens.pde b/android/examples/Topics/Effects/Lens/Lens.pde
deleted file mode 100644
index 804ff14fd9..0000000000
--- a/android/examples/Topics/Effects/Lens/Lens.pde
+++ /dev/null
@@ -1,105 +0,0 @@
-/**
- * Lens Demo Effect
- * by luis2048.
- *
- * A picture is shown and it looks like a magnifying glass
- * is drawn over the picture. One of the most famous demos
- * that has a lens effect is 2nd reality by future crew.
- * The trick is to precalculate the entire effect. Just make
- * an array that for each pixel in the destination picture
- * tells which pixel to take from the source picture. This
- * array is called the transformation array. The tricky part
- * is to calculate the transformation array to make the
- * destination look like a lens is beeing held over the source
- * picture. Based on lens formula by on Abe Racadabra.
- */
-
-int lensD = 256; // Lens diameter
-int[] lensArray = new int[lensD*lensD]; // Height and width of lens
-
-PGraphics lensEffect;
-PImage lensImage;
-PImage lensImage2;
-
-int xx = 0;
-int yy = 0;
-int dx = 1;
-int dy = 1;
-
-void setup() {
-
- size(640, 360);
-
- // Create buffered image for lens effect
- lensEffect = createGraphics(width, height, P2D);
-
- // Load background image
- lensEffect.beginDraw();
- lensEffect.image(loadImage("red_smoke.jpg"), 0, 0,
- lensEffect.width, lensEffect.height);
- lensEffect.endDraw();
-
- // Create buffered image for image to warp
- lensImage = createGraphics(lensD, lensD, P2D);
- lensImage2 = createGraphics(lensD, lensD, P2D);
-
- // Lens algorithm (transformation array)
- int magFactor = 40; // Magnification factor
- int m, a, b;
-
- int r = lensD / 2;
- float s = sqrt(r*r - magFactor*magFactor);
-
- for (int y = -r; y < r; y++) {
- for (int x = -r ;x < r; x++) {
- if(x*x + y*y >= s*s) {
- a = x;
- b = y;
- }
- else {
- float z = sqrt(r*r - x*x - y*y);
- a = int(x * magFactor / z + 0.5);
- b = int(y * magFactor / z + 0.5);
- }
- lensArray[(y + r)*lensD + (x + r)] = (b + r) * lensD + (a + r);
- }
- }
-}
-
-void draw() {
-
- // Bounce lens around the screen
- if((xx+dx+lensD > lensEffect.width) || (xx+dx < 0)) {
- dx =- dx;
- }
- if((yy+dy+lensD > lensEffect.height) || (yy+dy < 0)) {
- dy =- dy;
- }
- xx += dx;
- yy += dy;
-
- lensImage = createGraphics(lensD, lensD, P2D);
-
- // save the backgrounlensD of lensHeight*lensWilensDth pixels rectangle at the coorlensDinates
- // where the lens effect will be applielensD.
- lensImage2.copy(lensEffect, xx, yy, lensD, lensD, 0, 0, lensD, lensD);
-
- // output into a bufferelensD image for reuse
- lensImage.loadPixels();
-
- // For each pixel in the destination rectangle, apply the color
- // from the appropriate pixel in the saved background. The lensArray
- // array tells the offset into the saved background.
- for (int i = 0; i < lensImage.pixels.length; i++) {
- lensImage.pixels[i] = lensImage2.pixels[lensArray[i]];
- }
- lensImage.updatePixels();
-
- // Restore the original picture
- image(lensEffect, 0, 0, width, height);
-
- // Overlay the lens square
- image(lensImage, xx, yy, lensD, lensD);
-
-}
-
diff --git a/android/examples/Topics/Effects/Lens/data/red_smoke.jpg b/android/examples/Topics/Effects/Lens/data/red_smoke.jpg
deleted file mode 100644
index 9897b595a5..0000000000
Binary files a/android/examples/Topics/Effects/Lens/data/red_smoke.jpg and /dev/null differ
diff --git a/android/examples/Topics/Effects/Metaball/Metaball.pde b/android/examples/Topics/Effects/Metaball/Metaball.pde
deleted file mode 100644
index cde5d1c4a3..0000000000
--- a/android/examples/Topics/Effects/Metaball/Metaball.pde
+++ /dev/null
@@ -1,76 +0,0 @@
-/**
- * Metaball Demo Effect
- * by luis2048.
- *
- * Organic-looking n-dimensional objects. The technique for rendering
- * metaballs was invented by Jim Blinn in the early 1980s. Each metaball
- * is defined as a function in n-dimensions.
- */
-
-int numBlobs = 3;
-
-int[] blogPx = { 0, 90, 90 };
-int[] blogPy = { 0, 120, 45 };
-
-// Movement vector for each blob
-int[] blogDx = { 1, 1, 1 };
-int[] blogDy = { 1, 1, 1 };
-
-PGraphics pg;
-int[][] vy,vx;
-
-void setup() {
- size(640, 360);
- pg = createGraphics(160, 90, P2D);
- vy = new int[numBlobs][pg.height];
- vx = new int[numBlobs][pg.width];
-}
-
-void draw() {
- for (int i=0; i pg.width) {
- blogDx[i] = -1;
- }
- if (blogPy[i] < 0) {
- blogDy[i] = 1;
- }
- if (blogPy[i] > pg.height) {
- blogDy[i]=-1;
- }
-
- for (int x = 0; x < pg.width; x++) {
- vx[i][x] = int(sq(blogPx[i]-x));
- }
-
- for (int y = 0; y < pg.height; y++) {
- vy[i][y] = int(sq(blogPy[i]-y));
- }
- }
-
- // Output into a buffered image for reuse
- pg.beginDraw();
- pg.loadPixels();
- for (int y = 0; y < pg.height; y++) {
- for (int x = 0; x < pg.width; x++) {
- int m = 1;
- for (int i = 0; i < numBlobs; i++) {
- // Increase this number to make your blobs bigger
- m += 60000/(vy[i][y] + vx[i][x]+1);
- }
- pg.pixels[x+y*pg.width] = color(0, m+x, (x+m+y)/2);
- }
- }
- pg.updatePixels();
- pg.endDraw();
-
- // Display the results
- image(pg, 0, 0, width, height);
-}
-
diff --git a/android/examples/Topics/Effects/Plasma/Plasma.pde b/android/examples/Topics/Effects/Plasma/Plasma.pde
deleted file mode 100644
index 04b20d84db..0000000000
--- a/android/examples/Topics/Effects/Plasma/Plasma.pde
+++ /dev/null
@@ -1,60 +0,0 @@
-/**
- * Plasma Demo Effect
- * by luis2048.
- *
- * Cycles of changing colours warped to give an illusion
- * of liquid, organic movement.Colors are the sum of sine
- * functions and various formulas. Based on formula by Robert Klep.
- */
-
-int pixelSize=2;
-PGraphics pg;
-
-void setup(){
- size(640, 360);
- // Create buffered image for plasma effect
- pg = createGraphics(160, 90, P2D);
- colorMode(HSB);
- noSmooth();
-}
-
-void draw()
-{
- float xc = 25;
-
- // Enable this to control the speed of animation regardless of CPU power
- // int timeDisplacement = millis()/30;
-
- // This runs plasma as fast as your computer can handle
- int timeDisplacement = frameCount;
-
- // No need to do this math for every pixel
- float calculation1 = sin( radians(timeDisplacement * 0.61655617));
- float calculation2 = sin( radians(timeDisplacement * -3.6352262));
-
- // Output into a buffered image for reuse
- pg.beginDraw();
- pg.loadPixels();
-
- // Plasma algorithm
- for (int x = 0; x < pg.width; x++, xc += pixelSize)
- {
- float yc = 25;
- float s1 = 128 + 128 * sin(radians(xc) * calculation1 );
-
- for (int y = 0; y < pg.height; y++, yc += pixelSize)
- {
- float s2 = 128 + 128 * sin(radians(yc) * calculation2 );
- float s3 = 128 + 128 * sin(radians((xc + yc + timeDisplacement * 5) / 2));
- float s = (s1+ s2 + s3) / 3;
- pg.pixels[x+y*pg.width] = color(s, 255 - s / 2.0, 255);
- }
- }
- pg.updatePixels();
- pg.endDraw();
-
- // display the results
- image(pg,0,0,width,height);
-
-}
-
diff --git a/android/examples/Topics/Effects/Tunnel/Tunnel.pde b/android/examples/Topics/Effects/Tunnel/Tunnel.pde
deleted file mode 100644
index 5e98f3e478..0000000000
--- a/android/examples/Topics/Effects/Tunnel/Tunnel.pde
+++ /dev/null
@@ -1,114 +0,0 @@
-/**
- * Tunnel Demo Effect
- * by luis2048.
- *
- * This effect shows a tunnel in which you fly while the tunnel
- * rotates, seemingly in 3D. The animation of the tunnel actually
- * isn't calculated on the fly while the animation runs, but is
- * precalculated. These calculations are stored in two tables:
- * one for the angle and one for the distance. For every frame,
- * go through every pixel (x,y) and use the angle and distance
- * tables to get which pixel of the texture it should draw at the
- * current pixel. To look like its rotating and zooming, the values
- * of the angle and distance tables are shifted.
- */
-
-int x, y, radius, l;
-PGraphics tunnelEffect;
-PImage textureImg;
-
-// build lookup table
-int[][] distanceTable;
-int[][] angleTable;
-int[][] shadeTable;
-int w, h;
-
-void setup() {
- size(640, 360);
-
- // Load texture 512 x 512
- textureImg = loadImage("red_smoke.jpg");
- textureImg.loadPixels();
-
- // Create buffer screen
- tunnelEffect = createGraphics(320, 200, P2D);
- w = tunnelEffect.width;
- h = tunnelEffect.height;
-
- float ratio = 32.0;
- int angle;
- int depth;
- int shade = 0;
-
- // Make the tables twice as big as the screen.
- // The center of the buffers is now the position (w,h).
- distanceTable= new int[2 * w][2 * h];
- angleTable= new int[2 * w][2 * h];
-
- for (int x = 0; x < w*2; x++)
- {
- for (int y = 0; y < h*2; y++)
- {
- depth = int(ratio * textureImg.height
- / sqrt(float((x - w) * (x - w) + (y - h) * (y - h)))) ;
- angle = int(0.5 * textureImg.width * atan2(float(y - h),
- float(x - w)) / PI) ;
-
- // The distance table contains for every pixel of the
- // screen, the inverse of the distance to the center of
- // the screen this pixel has.
- distanceTable[x][y] = depth ;
-
- // The angle table contains the angle of every pixel of the screen,
- // where the center of the screen represents the origin.
- angleTable[x][y] = angle ;
- }
- }
-}
-
-
-void draw() {
-
- tunnelEffect.beginDraw();
- tunnelEffect.loadPixels();
-
- float timeDisplacement = millis() / 1000.0;
-
- // Calculate the shift values out of the time value
- int shiftX = int(textureImg.width * .2 * timeDisplacement+300); // speed of zoom
- int shiftY = int(textureImg.height * .15 * timeDisplacement+300); //speed of spin
-
- // Calculate the look values out of the time value
- // by using sine functions, it'll alternate between
- // looking left/right and up/down
- int shiftLookX = w / 2 + int(w / 4 * sin(timeDisplacement));
- int shiftLookY = h / 2 + int(h / 4 * sin(timeDisplacement * 1.5));
-
- for (int y = 0; y < h; y++) {
- for (int x = 0; x < w; x++) {
-
- // Make sure that x + shiftLookX never goes outside
- // the dimensions of the table
- int texture_x = constrain((distanceTable[x + shiftLookX][y + shiftLookY]
- + shiftX) % textureImg.width ,0, textureImg.width);
-
- int texture_y = (angleTable[x + shiftLookX][y + shiftLookY]
- + shiftY) % textureImg.height;
-
- tunnelEffect.pixels[x+y*w] = textureImg.pixels[texture_y
- * textureImg.width + texture_x];
-
- // Test lookuptables
- // tunnelEffect.pixels[x+y*w] = color( 0,texture_x,texture_y);
- }
- }
-
- tunnelEffect.updatePixels();
- tunnelEffect.endDraw();
-
- // Display the results
- image(tunnelEffect, 0, 0, width, height);
-
-}
-
-
diff --git a/android/examples/Topics/Effects/Tunnel/data/red_smoke.jpg b/android/examples/Topics/Effects/Tunnel/data/red_smoke.jpg
deleted file mode 100644
index 9897b595a5..0000000000
Binary files a/android/examples/Topics/Effects/Tunnel/data/red_smoke.jpg and /dev/null differ
diff --git a/android/examples/Topics/Effects/UnlimitedSprites/UnlimitedSprites.pde b/android/examples/Topics/Effects/UnlimitedSprites/UnlimitedSprites.pde
deleted file mode 100644
index 6395eeaa1f..0000000000
--- a/android/examples/Topics/Effects/UnlimitedSprites/UnlimitedSprites.pde
+++ /dev/null
@@ -1,60 +0,0 @@
-/**
- * Unlimited Sprites Demo Effect
- * by luis2048.
- *
- * An infinate number of sprites drawn to screen. It's basically
- * a flick-book effect; you draw the same sprite in different
- * positions on different bufffer 'screens' and flip between them.
- * When you've drawn on all frames, you loop back to the beginning
- * and repeat.
- */
-
-PGraphics[] spriteFrames = new PGraphics[6];
-PImage sprite;
-
-float x, y;
-float xang = 0.0;
-float yang = 0.0;
-int surf = 0;
-
-void setup() {
- size(640, 360);
- noSmooth();
- background(0);
-
- // Create sprite
- sprite=loadImage("Aqua-Ball-48x48.png");
-
- // Create blank surfaces to draw on
- for (int i = 0; i < spriteFrames.length; i++) {
- spriteFrames[i] = createGraphics(width, height, JAVA2D);
- }
-}
-
-void draw()
-{
- background(0);
-
- // Get X, Y positions
- x = (width/2)*sin((radians(xang))*0.95);
- y = (height/2)*cos((radians(yang))*0.97);
-
- // Inc the angle of the sine
- xang += 1.17;
- yang += 1.39;
-
- // Blit our 'bob' on the 'active' surface
- spriteFrames[surf].beginDraw();
- spriteFrames[surf].image(sprite, x+(width/2)-32, y+(height/2)-32);
- spriteFrames[surf].endDraw();
-
- // Blit the active surface to the screen
- image(spriteFrames[surf], 0, 0, width, height);
-
- // Inc the active surface number
- surf = (surf+1) % spriteFrames.length;
-
- // Display the results
- //image(spriteEffect, 0, 0, width, height);
-}
-
diff --git a/android/examples/Topics/Effects/UnlimitedSprites/data/Aqua-Ball-48x48.png b/android/examples/Topics/Effects/UnlimitedSprites/data/Aqua-Ball-48x48.png
deleted file mode 100644
index f5c6a44d6f..0000000000
Binary files a/android/examples/Topics/Effects/UnlimitedSprites/data/Aqua-Ball-48x48.png and /dev/null differ
diff --git a/android/examples/Topics/Effects/Wormhole/Wormhole.pde b/android/examples/Topics/Effects/Wormhole/Wormhole.pde
deleted file mode 100644
index 9f2f8fed82..0000000000
--- a/android/examples/Topics/Effects/Wormhole/Wormhole.pde
+++ /dev/null
@@ -1,70 +0,0 @@
-/**
- * Wormhole Demo Effect
- * by luis2048.
- *
- * A funnel-shaped hole sucking its texture to the middle.
- * The effect is accomplished like the tunnel effect but with
- * a 15 x 15 texture and static lookup table. The texture is shifted
- * and mapped to the static lookup table.
- */
-
-PImage wormImg, wormTexture;
-int[] reg = new int[15];
-
-void setup() {
- size(640, 360, P2D);
- noSmooth();
-
- // Reference image used to transpose texture
- wormImg = loadImage("wormhole.png");
- wormImg.resize(width, height);
- wormImg.loadPixels();
-
- // Texture image array
- wormTexture = loadImage("texture.gif");
- wormTexture.loadPixels();
-}
-
-// Moves the bottom row of pixels to the top and shifting remaining pixels 1 over
-void shiftup() {
- for (int k = 0; k < 15; k++) {
- reg[k] = wormTexture.pixels[k];
- }
-
- for (int k = 15; k < 225; k++) {
- wormTexture.pixels[k-15] = wormTexture.pixels[k];
- }
- for (int k = 0; k < 15; k++) {
- wormTexture.pixels[k+210] = reg[k];
- }
-}
-
-// Moves left column of pixels to the right and shifting remaining pixels 1 over
-void shiftright() {
- for(int k = 0; k < 15; k++) {
- reg[k] = wormTexture.pixels[15*k+14];
- for(int i = 14;i > 0; i--) {
- wormTexture.pixels[15*k+i] = wormTexture.pixels[15*k+(i-1)];
- }
- wormTexture.pixels[15*k] = reg[k];
- }
-}
-
-void draw() {
- // Load pixel data array
- loadPixels();
-
- // Loop through all pixels
- for (int i = 0; i < pixels.length; i++){
- // Map texture to wormhole in a bit shift blue
- pixels[i] = wormTexture.pixels[constrain(wormImg.pixels[i] & 0xFF, 0, 224)];
- }
-
- updatePixels();
-
- shiftright();
- shiftup();
-}
-
-
-
diff --git a/android/examples/Topics/Effects/Wormhole/data/texture.gif b/android/examples/Topics/Effects/Wormhole/data/texture.gif
deleted file mode 100644
index 37b7eb0333..0000000000
Binary files a/android/examples/Topics/Effects/Wormhole/data/texture.gif and /dev/null differ
diff --git a/android/examples/Topics/Effects/Wormhole/data/wormhole.png b/android/examples/Topics/Effects/Wormhole/data/wormhole.png
deleted file mode 100644
index e9f78ac3aa..0000000000
Binary files a/android/examples/Topics/Effects/Wormhole/data/wormhole.png and /dev/null differ
diff --git a/android/examples/Topics/File IO/LoadFile1/LoadFile1.pde b/android/examples/Topics/File IO/LoadFile1/LoadFile1.pde
deleted file mode 100644
index ac42a81c68..0000000000
--- a/android/examples/Topics/File IO/LoadFile1/LoadFile1.pde
+++ /dev/null
@@ -1,30 +0,0 @@
-/**
- * LoadFile 1
- *
- * Loads a text file that contains two numbers separated by a tab ('\t').
- * A new pair of numbers is loaded each frame and used to draw a point on the screen.
- */
-
-String[] lines;
-int index = 0;
-
-void setup() {
- size(200, 200);
- background(0);
- stroke(255);
- frameRate(12);
- lines = loadStrings("positions.txt");
-}
-
-void draw() {
- if (index < lines.length) {
- String[] pieces = split(lines[index], '\t');
- if (pieces.length == 2) {
- int x = int(pieces[0]) * 2;
- int y = int(pieces[1]) * 2;
- point(x, y);
- }
- // Go to the next line for the next run through draw()
- index = index + 1;
- }
-}
diff --git a/android/examples/Topics/File IO/LoadFile1/data/positions.txt b/android/examples/Topics/File IO/LoadFile1/data/positions.txt
deleted file mode 100644
index 3b8ff2e23e..0000000000
--- a/android/examples/Topics/File IO/LoadFile1/data/positions.txt
+++ /dev/null
@@ -1,206 +0,0 @@
-70 35
-69 35
-68 39
-67 42
-66 47
-64 51
-64 54
-63 57
-60 60
-58 64
-51 69
-48 72
-44 73
-39 75
-35 75
-30 75
-25 75
-21 75
-17 73
-13 69
-12 66
-11 61
-11 57
-10 49
-10 45
-10 38
-12 32
-13 29
-16 23
-20 19
-24 16
-27 15
-31 13
-33 13
-37 13
-40 15
-42 16
-45 19
-46 21
-47 24
-48 26
-48 29
-48 33
-47 39
-43 45
-42 47
-38 50
-35 51
-32 51
-30 51
-27 50
-27 50
-26 46
-26 41
-29 36
-30 34
-31 33
-31 33
-32 33
-33 33
-34 33
-34 33
-35 33
-37 33
-39 33
-42 32
-44 31
-46 29
-48 29
-49 27
-52 24
-53 23
-57 19
-61 16
-63 14
-67 13
-69 12
-69 12
-77 11
-77 11
-80 11
-86 16
-90 21
-93 25
-95 29
-95 32
-95 33
-95 37
-94 41
-93 44
-92 46
-91 49
-89 51
-87 55
-85 59
-82 62
-80 64
-79 67
-77 69
-74 71
-68 72
-65 73
-63 73
-62 73
-60 72
-58 69
-57 67
-57 66
-56 60
-56 56
-56 54
-58 49
-60 47
-62 47
-63 47
-67 48
-70 52
-73 55
-74 57
-74 58
-74 60
-74 62
-73 65
-70 68
-67 69
-65 70
-63 70
-62 70
-60 68
-57 65
-55 64
-50 62
-46 61
-40 60
-38 60
-36 60
-32 61
-30 62
-27 64
-26 68
-25 71
-25 77
-25 81
-26 84
-28 86
-31 87
-33 88
-36 88
-39 86
-41 85
-43 83
-44 81
-45 76
-45 74
-45 71
-40 67
-37 65
-34 63
-33 61
-33 61
-32 60
-33 49
-37 45
-41 41
-45 39
-47 38
-51 37
-54 37
-58 38
-61 41
-63 44
-65 46
-66 49
-66 51
-67 55
-67 58
-67 60
-66 62
-64 65
-63 66
-61 67
-60 68
-58 68
-55 69
-54 69
-51 69
-48 69
-46 68
-45 66
-44 65
-44 63
-44 61
-44 59
-44 56
-44 55
-45 53
-47 52
-49 50
-50 48
-51 47
-52 46
-54 46
-55 45
-55 45
-56 44
-57 44
diff --git a/android/examples/Topics/File IO/LoadFile2/LoadFile2.pde b/android/examples/Topics/File IO/LoadFile2/LoadFile2.pde
deleted file mode 100644
index 356d8354f5..0000000000
--- a/android/examples/Topics/File IO/LoadFile2/LoadFile2.pde
+++ /dev/null
@@ -1,55 +0,0 @@
-/**
- * LoadFile 2
- *
- * This example loads a data file about cars. Each element is separated
- * with a tab and corresponds to a different aspect of each car. The file stores
- * the miles per gallon, cylinders, displacement, etc., for more than 400 different
- * makes and models. Press a mouse button to advance to the next group of entries.
- */
-
-Record[] records;
-String[] lines;
-int recordCount;
-PFont body;
-int num = 9; // Display this many entries on each screen.
-int startingEntry = 0; // Display from this entry number
-
-void setup() {
- size(200, 200);
- fill(255);
- noLoop();
-
- body = loadFont("TheSans-Plain-12.vlw");
- textFont(body);
-
- lines = loadStrings("cars2.tsv");
- records = new Record[lines.length];
- for (int i = 0; i < lines.length; i++) {
- String[] pieces = split(lines[i], TAB); // Load data into array
- if (pieces.length == 9) {
- records[recordCount] = new Record(pieces);
- recordCount++;
- }
- }
- if (recordCount != records.length) {
- records = (Record[]) subset(records, 0, recordCount);
- }
-}
-
-void draw() {
- background(0);
- for (int i = 0; i < num; i++) {
- int thisEntry = startingEntry + i;
- if (thisEntry < recordCount) {
- text(thisEntry + " > " + records[thisEntry].name, 20, 20 + i*20);
- }
- }
-}
-
-void mousePressed() {
- startingEntry += num;
- if (startingEntry > records.length) {
- startingEntry = 0; // go back to the beginning
- }
- redraw();
-}
diff --git a/android/examples/Topics/File IO/LoadFile2/Record.pde b/android/examples/Topics/File IO/LoadFile2/Record.pde
deleted file mode 100644
index 2cc836abc6..0000000000
--- a/android/examples/Topics/File IO/LoadFile2/Record.pde
+++ /dev/null
@@ -1,23 +0,0 @@
-class Record {
- String name;
- float mpg;
- int cylinders;
- float displacement;
- float horsepower;
- float weight;
- float acceleration;
- int year;
- float origin;
-
- public Record(String[] pieces) {
- name = pieces[0];
- mpg = float(pieces[1]);
- cylinders = int(pieces[2]);
- displacement = float(pieces[3]);
- horsepower = float(pieces[4]);
- weight = float(pieces[5]);
- acceleration = float(pieces[6]);
- year = int(pieces[7]);
- origin = float(pieces[8]);
- }
-}
diff --git a/android/examples/Topics/File IO/LoadFile2/data/TheSans-Plain-12.vlw b/android/examples/Topics/File IO/LoadFile2/data/TheSans-Plain-12.vlw
deleted file mode 100644
index 4fcefba6bd..0000000000
Binary files a/android/examples/Topics/File IO/LoadFile2/data/TheSans-Plain-12.vlw and /dev/null differ
diff --git a/android/examples/Topics/File IO/LoadFile2/data/cars2.tsv b/android/examples/Topics/File IO/LoadFile2/data/cars2.tsv
deleted file mode 100644
index 7f658bf203..0000000000
--- a/android/examples/Topics/File IO/LoadFile2/data/cars2.tsv
+++ /dev/null
@@ -1,406 +0,0 @@
-chevrolet chevelle malibu 18 8 307 130 3504 12 70 1
-buick skylark 320 15 8 350 165 3693 11.5 70 1
-plymouth satellite 18 8 318 150 3436 11 70 1
-amc rebel sst 16 8 304 150 3433 12 70 1
-ford torino 17 8 302 140 3449 10.5 70 1
-ford galaxie 500 15 8 429 198 4341 10 70 1
-chevrolet impala 14 8 454 220 4354 9 70 1
-plymouth fury iii 14 8 440 215 4312 8.5 70 1
-pontiac catalina 14 8 455 225 4425 10 70 1
-amc ambassador dpl 15 8 390 190 3850 8.5 70 1
-citroen ds-21 pallas NA 4 133 115 3090 17.5 70 2
-chevrolet chevelle concours (sw) NA 8 350 165 4142 11.5 70 1
-ford torino (sw) NA 8 351 153 4034 11 70 1
-plymouth satellite (sw) NA 8 383 175 4166 10.5 70 1
-amc rebel sst (sw) NA 8 360 175 3850 11 70 1
-dodge challenger se 15 8 383 170 3563 10 70 1
-plymouth 'cuda 340 14 8 340 160 3609 8 70 1
-ford mustang boss 302 NA 8 302 140 3353 8 70 1
-chevrolet monte carlo 15 8 400 150 3761 9.5 70 1
-buick estate wagon (sw) 14 8 455 225 3086 10 70 1
-toyota corona mark ii 24 4 113 95 2372 15 70 3
-plymouth duster 22 6 198 95 2833 15.5 70 1
-amc hornet 18 6 199 97 2774 15.5 70 1
-ford maverick 21 6 200 85 2587 16 70 1
-datsun pl510 27 4 97 88 2130 14.5 70 3
-volkswagen 1131 deluxe sedan 26 4 97 46 1835 20.5 70 2
-peugeot 504 25 4 110 87 2672 17.5 70 2
-audi 100 ls 24 4 107 90 2430 14.5 70 2
-saab 99e 25 4 104 95 2375 17.5 70 2
-bmw 2002 26 4 121 113 2234 12.5 70 2
-amc gremlin 21 6 199 90 2648 15 70 1
-ford f250 10 8 360 215 4615 14 70 1
-chevy c20 10 8 307 200 4376 15 70 1
-dodge d200 11 8 318 210 4382 13.5 70 1
-hi 1200d 9 8 304 193 4732 18.5 70 1
-datsun pl510 27 4 97 88 2130 14.5 71 3
-chevrolet vega 2300 28 4 140 90 2264 15.5 71 1
-toyota corona 25 4 113 95 2228 14 71 3
-ford pinto 25 4 98 NA 2046 19 71 1
-volkswagen super beetle 117 NA 4 97 48 1978 20 71 2
-amc gremlin 19 6 232 100 2634 13 71 1
-plymouth satellite custom 16 6 225 105 3439 15.5 71 1
-chevrolet chevelle malibu 17 6 250 100 3329 15.5 71 1
-ford torino 500 19 6 250 88 3302 15.5 71 1
-amc matador 18 6 232 100 3288 15.5 71 1
-chevrolet impala 14 8 350 165 4209 12 71 1
-pontiac catalina brougham 14 8 400 175 4464 11.5 71 1
-ford galaxie 500 14 8 351 153 4154 13.5 71 1
-plymouth fury iii 14 8 318 150 4096 13 71 1
-dodge monaco (sw) 12 8 383 180 4955 11.5 71 1
-ford country squire (sw) 13 8 400 170 4746 12 71 1
-pontiac safari (sw) 13 8 400 175 5140 12 71 1
-amc hornet sportabout (sw) 18 6 258 110 2962 13.5 71 1
-chevrolet vega (sw) 22 4 140 72 2408 19 71 1
-pontiac firebird 19 6 250 100 3282 15 71 1
-ford mustang 18 6 250 88 3139 14.5 71 1
-mercury capri 2000 23 4 122 86 2220 14 71 1
-opel 1900 28 4 116 90 2123 14 71 2
-peugeot 304 30 4 79 70 2074 19.5 71 2
-fiat 124b 30 4 88 76 2065 14.5 71 2
-toyota corolla 1200 31 4 71 65 1773 19 71 3
-datsun 1200 35 4 72 69 1613 18 71 3
-volkswagen model 111 27 4 97 60 1834 19 71 2
-plymouth cricket 26 4 91 70 1955 20.5 71 1
-toyota corona hardtop 24 4 113 95 2278 15.5 72 3
-dodge colt hardtop 25 4 97.5 80 2126 17 72 1
-volkswagen type 3 23 4 97 54 2254 23.5 72 2
-chevrolet vega 20 4 140 90 2408 19.5 72 1
-ford pinto runabout 21 4 122 86 2226 16.5 72 1
-chevrolet impala 13 8 350 165 4274 12 72 1
-pontiac catalina 14 8 400 175 4385 12 72 1
-plymouth fury iii 15 8 318 150 4135 13.5 72 1
-ford galaxie 500 14 8 351 153 4129 13 72 1
-amc ambassador sst 17 8 304 150 3672 11.5 72 1
-mercury marquis 11 8 429 208 4633 11 72 1
-buick lesabre custom 13 8 350 155 4502 13.5 72 1
-oldsmobile delta 88 royale 12 8 350 160 4456 13.5 72 1
-chrysler newport royal 13 8 400 190 4422 12.5 72 1
-mazda rx2 coupe 19 3 70 97 2330 13.5 72 3
-amc matador (sw) 15 8 304 150 3892 12.5 72 1
-chevrolet chevelle concours (sw) 13 8 307 130 4098 14 72 1
-ford gran torino (sw) 13 8 302 140 4294 16 72 1
-plymouth satellite custom (sw) 14 8 318 150 4077 14 72 1
-volvo 145e (sw) 18 4 121 112 2933 14.5 72 2
-volkswagen 411 (sw) 22 4 121 76 2511 18 72 2
-peugeot 504 (sw) 21 4 120 87 2979 19.5 72 2
-renault 12 (sw) 26 4 96 69 2189 18 72 2
-ford pinto (sw) 22 4 122 86 2395 16 72 1
-datsun 510 (sw) 28 4 97 92 2288 17 72 3
-toyouta corona mark ii (sw) 23 4 120 97 2506 14.5 72 3
-dodge colt (sw) 28 4 98 80 2164 15 72 1
-toyota corolla 1600 (sw) 27 4 97 88 2100 16.5 72 3
-buick century 350 13 8 350 175 4100 13 73 1
-amc matador 14 8 304 150 3672 11.5 73 1
-chevrolet malibu 13 8 350 145 3988 13 73 1
-ford gran torino 14 8 302 137 4042 14.5 73 1
-dodge coronet custom 15 8 318 150 3777 12.5 73 1
-mercury marquis brougham 12 8 429 198 4952 11.5 73 1
-chevrolet caprice classic 13 8 400 150 4464 12 73 1
-ford ltd 13 8 351 158 4363 13 73 1
-plymouth fury gran sedan 14 8 318 150 4237 14.5 73 1
-chrysler new yorker brougham 13 8 440 215 4735 11 73 1
-buick electra 225 custom 12 8 455 225 4951 11 73 1
-amc ambassador brougham 13 8 360 175 3821 11 73 1
-plymouth valiant 18 6 225 105 3121 16.5 73 1
-chevrolet nova custom 16 6 250 100 3278 18 73 1
-amc hornet 18 6 232 100 2945 16 73 1
-ford maverick 18 6 250 88 3021 16.5 73 1
-plymouth duster 23 6 198 95 2904 16 73 1
-volkswagen super beetle 26 4 97 46 1950 21 73 2
-chevrolet impala 11 8 400 150 4997 14 73 1
-ford country 12 8 400 167 4906 12.5 73 1
-plymouth custom suburb 13 8 360 170 4654 13 73 1
-oldsmobile vista cruiser 12 8 350 180 4499 12.5 73 1
-amc gremlin 18 6 232 100 2789 15 73 1
-toyota carina 20 4 97 88 2279 19 73 3
-chevrolet vega 21 4 140 72 2401 19.5 73 1
-datsun 610 22 4 108 94 2379 16.5 73 3
-maxda rx3 18 3 70 90 2124 13.5 73 3
-ford pinto 19 4 122 85 2310 18.5 73 1
-mercury capri v6 21 6 155 107 2472 14 73 1
-fiat 124 sport coupe 26 4 98 90 2265 15.5 73 2
-chevrolet monte carlo s 15 8 350 145 4082 13 73 1
-pontiac grand prix 16 8 400 230 4278 9.5 73 1
-fiat 128 29 4 68 49 1867 19.5 73 2
-opel manta 24 4 116 75 2158 15.5 73 2
-audi 100ls 20 4 114 91 2582 14 73 2
-volvo 144ea 19 4 121 112 2868 15.5 73 2
-dodge dart custom 15 8 318 150 3399 11 73 1
-saab 99le 24 4 121 110 2660 14 73 2
-toyota mark ii 20 6 156 122 2807 13.5 73 3
-oldsmobile omega 11 8 350 180 3664 11 73 1
-plymouth duster 20 6 198 95 3102 16.5 74 1
-ford maverick 21 6 200 NA 2875 17 74 1
-amc hornet 19 6 232 100 2901 16 74 1
-chevrolet nova 15 6 250 100 3336 17 74 1
-datsun b210 31 4 79 67 1950 19 74 3
-ford pinto 26 4 122 80 2451 16.5 74 1
-toyota corolla 1200 32 4 71 65 1836 21 74 3
-chevrolet vega 25 4 140 75 2542 17 74 1
-chevrolet chevelle malibu classic 16 6 250 100 3781 17 74 1
-amc matador 16 6 258 110 3632 18 74 1
-plymouth satellite sebring 18 6 225 105 3613 16.5 74 1
-ford gran torino 16 8 302 140 4141 14 74 1
-buick century luxus (sw) 13 8 350 150 4699 14.5 74 1
-dodge coronet custom (sw) 14 8 318 150 4457 13.5 74 1
-ford gran torino (sw) 14 8 302 140 4638 16 74 1
-amc matador (sw) 14 8 304 150 4257 15.5 74 1
-audi fox 29 4 98 83 2219 16.5 74 2
-volkswagen dasher 26 4 79 67 1963 15.5 74 2
-opel manta 26 4 97 78 2300 14.5 74 2
-toyota corona 31 4 76 52 1649 16.5 74 3
-datsun 710 32 4 83 61 2003 19 74 3
-dodge colt 28 4 90 75 2125 14.5 74 1
-fiat 128 24 4 90 75 2108 15.5 74 2
-fiat 124 tc 26 4 116 75 2246 14 74 2
-honda civic 24 4 120 97 2489 15 74 3
-subaru 26 4 108 93 2391 15.5 74 3
-fiat x1.9 31 4 79 67 2000 16 74 2
-plymouth valiant custom 19 6 225 95 3264 16 75 1
-chevrolet nova 18 6 250 105 3459 16 75 1
-mercury monarch 15 6 250 72 3432 21 75 1
-ford maverick 15 6 250 72 3158 19.5 75 1
-pontiac catalina 16 8 400 170 4668 11.5 75 1
-chevrolet bel air 15 8 350 145 4440 14 75 1
-plymouth grand fury 16 8 318 150 4498 14.5 75 1
-ford ltd 14 8 351 148 4657 13.5 75 1
-buick century 17 6 231 110 3907 21 75 1
-chevroelt chevelle malibu 16 6 250 105 3897 18.5 75 1
-amc matador 15 6 258 110 3730 19 75 1
-plymouth fury 18 6 225 95 3785 19 75 1
-buick skyhawk 21 6 231 110 3039 15 75 1
-chevrolet monza 2+2 20 8 262 110 3221 13.5 75 1
-ford mustang ii 13 8 302 129 3169 12 75 1
-toyota corolla 29 4 97 75 2171 16 75 3
-ford pinto 23 4 140 83 2639 17 75 1
-amc gremlin 20 6 232 100 2914 16 75 1
-pontiac astro 23 4 140 78 2592 18.5 75 1
-toyota corona 24 4 134 96 2702 13.5 75 3
-volkswagen dasher 25 4 90 71 2223 16.5 75 2
-datsun 710 24 4 119 97 2545 17 75 3
-ford pinto 18 6 171 97 2984 14.5 75 1
-volkswagen rabbit 29 4 90 70 1937 14 75 2
-amc pacer 19 6 232 90 3211 17 75 1
-audi 100ls 23 4 115 95 2694 15 75 2
-peugeot 504 23 4 120 88 2957 17 75 2
-volvo 244dl 22 4 121 98 2945 14.5 75 2
-saab 99le 25 4 121 115 2671 13.5 75 2
-honda civic cvcc 33 4 91 53 1795 17.5 75 3
-fiat 131 28 4 107 86 2464 15.5 76 2
-opel 1900 25 4 116 81 2220 16.9 76 2
-capri ii 25 4 140 92 2572 14.9 76 1
-dodge colt 26 4 98 79 2255 17.7 76 1
-renault 12tl 27 4 101 83 2202 15.3 76 2
-chevrolet chevelle malibu classic 17.5 8 305 140 4215 13 76 1
-dodge coronet brougham 16 8 318 150 4190 13 76 1
-amc matador 15.5 8 304 120 3962 13.9 76 1
-ford gran torino 14.5 8 351 152 4215 12.8 76 1
-plymouth valiant 22 6 225 100 3233 15.4 76 1
-chevrolet nova 22 6 250 105 3353 14.5 76 1
-ford maverick 24 6 200 81 3012 17.6 76 1
-amc hornet 22.5 6 232 90 3085 17.6 76 1
-chevrolet chevette 29 4 85 52 2035 22.2 76 1
-chevrolet woody 24.5 4 98 60 2164 22.1 76 1
-vw rabbit 29 4 90 70 1937 14.2 76 2
-honda civic 33 4 91 53 1795 17.4 76 3
-dodge aspen se 20 6 225 100 3651 17.7 76 1
-ford granada ghia 18 6 250 78 3574 21 76 1
-pontiac ventura sj 18.5 6 250 110 3645 16.2 76 1
-amc pacer d/l 17.5 6 258 95 3193 17.8 76 1
-volkswagen rabbit 29.5 4 97 71 1825 12.2 76 2
-datsun b-210 32 4 85 70 1990 17 76 3
-toyota corolla 28 4 97 75 2155 16.4 76 3
-ford pinto 26.5 4 140 72 2565 13.6 76 1
-volvo 245 20 4 130 102 3150 15.7 76 2
-plymouth volare premier v8 13 8 318 150 3940 13.2 76 1
-peugeot 504 19 4 120 88 3270 21.9 76 2
-toyota mark ii 19 6 156 108 2930 15.5 76 3
-mercedes-benz 280s 16.5 6 168 120 3820 16.7 76 2
-cadillac seville 16.5 8 350 180 4380 12.1 76 1
-chevy c10 13 8 350 145 4055 12 76 1
-ford f108 13 8 302 130 3870 15 76 1
-dodge d100 13 8 318 150 3755 14 76 1
-honda accord cvcc 31.5 4 98 68 2045 18.5 77 3
-buick opel isuzu deluxe 30 4 111 80 2155 14.8 77 1
-renault 5 gtl 36 4 79 58 1825 18.6 77 2
-plymouth arrow gs 25.5 4 122 96 2300 15.5 77 1
-datsun f-10 hatchback 33.5 4 85 70 1945 16.8 77 3
-chevrolet caprice classic 17.5 8 305 145 3880 12.5 77 1
-oldsmobile cutlass supreme 17 8 260 110 4060 19 77 1
-dodge monaco brougham 15.5 8 318 145 4140 13.7 77 1
-mercury cougar brougham 15 8 302 130 4295 14.9 77 1
-chevrolet concours 17.5 6 250 110 3520 16.4 77 1
-buick skylark 20.5 6 231 105 3425 16.9 77 1
-plymouth volare custom 19 6 225 100 3630 17.7 77 1
-ford granada 18.5 6 250 98 3525 19 77 1
-pontiac grand prix lj 16 8 400 180 4220 11.1 77 1
-chevrolet monte carlo landau 15.5 8 350 170 4165 11.4 77 1
-chrysler cordoba 15.5 8 400 190 4325 12.2 77 1
-ford thunderbird 16 8 351 149 4335 14.5 77 1
-volkswagen rabbit custom 29 4 97 78 1940 14.5 77 2
-pontiac sunbird coupe 24.5 4 151 88 2740 16 77 1
-toyota corolla liftback 26 4 97 75 2265 18.2 77 3
-ford mustang ii 2+2 25.5 4 140 89 2755 15.8 77 1
-chevrolet chevette 30.5 4 98 63 2051 17 77 1
-dodge colt m/m 33.5 4 98 83 2075 15.9 77 1
-subaru dl 30 4 97 67 1985 16.4 77 3
-volkswagen dasher 30.5 4 97 78 2190 14.1 77 2
-datsun 810 22 6 146 97 2815 14.5 77 3
-bmw 320i 21.5 4 121 110 2600 12.8 77 2
-mazda rx-4 21.5 3 80 110 2720 13.5 77 3
-volkswagen rabbit custom diesel 43.1 4 90 48 1985 21.5 78 2
-ford fiesta 36.1 4 98 66 1800 14.4 78 1
-mazda glc deluxe 32.8 4 78 52 1985 19.4 78 3
-datsun b210 gx 39.4 4 85 70 2070 18.6 78 3
-honda civic cvcc 36.1 4 91 60 1800 16.4 78 3
-oldsmobile cutlass salon brougham 19.9 8 260 110 3365 15.5 78 1
-dodge diplomat 19.4 8 318 140 3735 13.2 78 1
-mercury monarch ghia 20.2 8 302 139 3570 12.8 78 1
-pontiac phoenix lj 19.2 6 231 105 3535 19.2 78 1
-chevrolet malibu 20.5 6 200 95 3155 18.2 78 1
-ford fairmont (auto) 20.2 6 200 85 2965 15.8 78 1
-ford fairmont (man) 25.1 4 140 88 2720 15.4 78 1
-plymouth volare 20.5 6 225 100 3430 17.2 78 1
-amc concord 19.4 6 232 90 3210 17.2 78 1
-buick century special 20.6 6 231 105 3380 15.8 78 1
-mercury zephyr 20.8 6 200 85 3070 16.7 78 1
-dodge aspen 18.6 6 225 110 3620 18.7 78 1
-amc concord d/l 18.1 6 258 120 3410 15.1 78 1
-chevrolet monte carlo landau 19.2 8 305 145 3425 13.2 78 1
-buick regal sport coupe (turbo) 17.7 6 231 165 3445 13.4 78 1
-ford futura 18.1 8 302 139 3205 11.2 78 1
-dodge magnum xe 17.5 8 318 140 4080 13.7 78 1
-chevrolet chevette 30 4 98 68 2155 16.5 78 1
-toyota corona 27.5 4 134 95 2560 14.2 78 3
-datsun 510 27.2 4 119 97 2300 14.7 78 3
-dodge omni 30.9 4 105 75 2230 14.5 78 1
-toyota celica gt liftback 21.1 4 134 95 2515 14.8 78 3
-plymouth sapporo 23.2 4 156 105 2745 16.7 78 1
-oldsmobile starfire sx 23.8 4 151 85 2855 17.6 78 1
-datsun 200-sx 23.9 4 119 97 2405 14.9 78 3
-audi 5000 20.3 5 131 103 2830 15.9 78 2
-volvo 264gl 17 6 163 125 3140 13.6 78 2
-saab 99gle 21.6 4 121 115 2795 15.7 78 2
-peugeot 604sl 16.2 6 163 133 3410 15.8 78 2
-volkswagen scirocco 31.5 4 89 71 1990 14.9 78 2
-honda accord lx 29.5 4 98 68 2135 16.6 78 3
-pontiac lemans v6 21.5 6 231 115 3245 15.4 79 1
-mercury zephyr 6 19.8 6 200 85 2990 18.2 79 1
-ford fairmont 4 22.3 4 140 88 2890 17.3 79 1
-amc concord dl 6 20.2 6 232 90 3265 18.2 79 1
-dodge aspen 6 20.6 6 225 110 3360 16.6 79 1
-chevrolet caprice classic 17 8 305 130 3840 15.4 79 1
-ford ltd landau 17.6 8 302 129 3725 13.4 79 1
-mercury grand marquis 16.5 8 351 138 3955 13.2 79 1
-dodge st. regis 18.2 8 318 135 3830 15.2 79 1
-buick estate wagon (sw) 16.9 8 350 155 4360 14.9 79 1
-ford country squire (sw) 15.5 8 351 142 4054 14.3 79 1
-chevrolet malibu classic (sw) 19.2 8 267 125 3605 15 79 1
-chrysler lebaron town @ country (sw) 18.5 8 360 150 3940 13 79 1
-vw rabbit custom 31.9 4 89 71 1925 14 79 2
-maxda glc deluxe 34.1 4 86 65 1975 15.2 79 3
-dodge colt hatchback custom 35.7 4 98 80 1915 14.4 79 1
-amc spirit dl 27.4 4 121 80 2670 15 79 1
-mercedes benz 300d 25.4 5 183 77 3530 20.1 79 2
-cadillac eldorado 23 8 350 125 3900 17.4 79 1
-peugeot 504 27.2 4 141 71 3190 24.8 79 2
-oldsmobile cutlass salon brougham 23.9 8 260 90 3420 22.2 79 1
-plymouth horizon 34.2 4 105 70 2200 13.2 79 1
-plymouth horizon tc3 34.5 4 105 70 2150 14.9 79 1
-datsun 210 31.8 4 85 65 2020 19.2 79 3
-fiat strada custom 37.3 4 91 69 2130 14.7 79 2
-buick skylark limited 28.4 4 151 90 2670 16 79 1
-chevrolet citation 28.8 6 173 115 2595 11.3 79 1
-oldsmobile omega brougham 26.8 6 173 115 2700 12.9 79 1
-pontiac phoenix 33.5 4 151 90 2556 13.2 79 1
-vw rabbit 41.5 4 98 76 2144 14.7 80 2
-toyota corolla tercel 38.1 4 89 60 1968 18.8 80 3
-chevrolet chevette 32.1 4 98 70 2120 15.5 80 1
-datsun 310 37.2 4 86 65 2019 16.4 80 3
-chevrolet citation 28 4 151 90 2678 16.5 80 1
-ford fairmont 26.4 4 140 88 2870 18.1 80 1
-amc concord 24.3 4 151 90 3003 20.1 80 1
-dodge aspen 19.1 6 225 90 3381 18.7 80 1
-audi 4000 34.3 4 97 78 2188 15.8 80 2
-toyota corona liftback 29.8 4 134 90 2711 15.5 80 3
-mazda 626 31.3 4 120 75 2542 17.5 80 3
-datsun 510 hatchback 37 4 119 92 2434 15 80 3
-toyota corolla 32.2 4 108 75 2265 15.2 80 3
-mazda glc 46.6 4 86 65 2110 17.9 80 3
-dodge colt 27.9 4 156 105 2800 14.4 80 1
-datsun 210 40.8 4 85 65 2110 19.2 80 3
-vw rabbit c (diesel) 44.3 4 90 48 2085 21.7 80 2
-vw dasher (diesel) 43.4 4 90 48 2335 23.7 80 2
-audi 5000s (diesel) 36.4 5 121 67 2950 19.9 80 2
-mercedes-benz 240d 30 4 146 67 3250 21.8 80 2
-honda civic 1500 gl 44.6 4 91 67 1850 13.8 80 3
-renault lecar deluxe 40.9 4 85 NA 1835 17.3 80 2
-subaru dl 33.8 4 97 67 2145 18 80 3
-vokswagen rabbit 29.8 4 89 62 1845 15.3 80 2
-datsun 280-zx 32.7 6 168 132 2910 11.4 80 3
-mazda rx-7 gs 23.7 3 70 100 2420 12.5 80 3
-triumph tr7 coupe 35 4 122 88 2500 15.1 80 2
-ford mustang cobra 23.6 4 140 NA 2905 14.3 80 1
-honda accord 32.4 4 107 72 2290 17 80 3
-plymouth reliant 27.2 4 135 84 2490 15.7 81 1
-buick skylark 26.6 4 151 84 2635 16.4 81 1
-dodge aries wagon (sw) 25.8 4 156 92 2620 14.4 81 1
-chevrolet citation 23.5 6 173 110 2725 12.6 81 1
-plymouth reliant 30 4 135 84 2385 12.9 81 1
-toyota starlet 39.1 4 79 58 1755 16.9 81 3
-plymouth champ 39 4 86 64 1875 16.4 81 1
-honda civic 1300 35.1 4 81 60 1760 16.1 81 3
-subaru 32.3 4 97 67 2065 17.8 81 3
-datsun 210 mpg 37 4 85 65 1975 19.4 81 3
-toyota tercel 37.7 4 89 62 2050 17.3 81 3
-mazda glc 4 34.1 4 91 68 1985 16 81 3
-plymouth horizon 4 34.7 4 105 63 2215 14.9 81 1
-ford escort 4w 34.4 4 98 65 2045 16.2 81 1
-ford escort 2h 29.9 4 98 65 2380 20.7 81 1
-volkswagen jetta 33 4 105 74 2190 14.2 81 2
-renault 18i 34.5 4 100 NA 2320 15.8 81 2
-honda prelude 33.7 4 107 75 2210 14.4 81 3
-toyota corolla 32.4 4 108 75 2350 16.8 81 3
-datsun 200sx 32.9 4 119 100 2615 14.8 81 3
-mazda 626 31.6 4 120 74 2635 18.3 81 3
-peugeot 505s turbo diesel 28.1 4 141 80 3230 20.4 81 2
-saab 900s NA 4 121 110 2800 15.4 81 2
-volvo diesel 30.7 6 145 76 3160 19.6 81 2
-toyota cressida 25.4 6 168 116 2900 12.6 81 3
-datsun 810 maxima 24.2 6 146 120 2930 13.8 81 3
-buick century 22.4 6 231 110 3415 15.8 81 1
-oldsmobile cutlass ls 26.6 8 350 105 3725 19 81 1
-ford granada gl 20.2 6 200 88 3060 17.1 81 1
-chrysler lebaron salon 17.6 6 225 85 3465 16.6 81 1
-chevrolet cavalier 28 4 112 88 2605 19.6 82 1
-chevrolet cavalier wagon 27 4 112 88 2640 18.6 82 1
-chevrolet cavalier 2-door 34 4 112 88 2395 18 82 1
-pontiac j2000 se hatchback 31 4 112 85 2575 16.2 82 1
-dodge aries se 29 4 135 84 2525 16 82 1
-pontiac phoenix 27 4 151 90 2735 18 82 1
-ford fairmont futura 24 4 140 92 2865 16.4 82 1
-amc concord dl 23 4 151 NA 3035 20.5 82 1
-volkswagen rabbit l 36 4 105 74 1980 15.3 82 2
-mazda glc custom l 37 4 91 68 2025 18.2 82 3
-mazda glc custom 31 4 91 68 1970 17.6 82 3
-plymouth horizon miser 38 4 105 63 2125 14.7 82 1
-mercury lynx l 36 4 98 70 2125 17.3 82 1
-nissan stanza xe 36 4 120 88 2160 14.5 82 3
-honda accord 36 4 107 75 2205 14.5 82 3
-toyota corolla 34 4 108 70 2245 16.9 82 3
-honda civic 38 4 91 67 1965 15 82 3
-honda civic (auto) 32 4 91 67 1965 15.7 82 3
-datsun 310 gx 38 4 91 67 1995 16.2 82 3
-buick century limited 25 6 181 110 2945 16.4 82 1
-oldsmobile cutlass ciera (diesel) 38 6 262 85 3015 17 82 1
-chrysler lebaron medallion 26 4 156 92 2585 14.5 82 1
-ford granada l 22 6 232 112 2835 14.7 82 1
-toyota celica gt 32 4 144 96 2665 13.9 82 3
-dodge charger 2.2 36 4 135 84 2370 13 82 1
-chevrolet camaro 27 4 151 90 2950 17.3 82 1
-ford mustang gl 27 4 140 86 2790 15.6 82 1
-vw pickup 44 4 97 52 2130 24.6 82 2
-dodge rampage 32 4 135 84 2295 11.6 82 1
-ford ranger 28 4 120 79 2625 18.6 82 1
-chevy s-10 31 4 119 82 2720 19.4 82 1
\ No newline at end of file
diff --git a/android/examples/Topics/File IO/SaveFile1/SaveFile1.pde b/android/examples/Topics/File IO/SaveFile1/SaveFile1.pde
deleted file mode 100644
index 9bcdbec188..0000000000
--- a/android/examples/Topics/File IO/SaveFile1/SaveFile1.pde
+++ /dev/null
@@ -1,49 +0,0 @@
-/**
- * SaveFile 1
- *
- * Saving files is a useful way to store data so it can be viewed after a
- * program has stopped running. The saveStrings() function writes an array
- * of strings to a file, with each string written to a new line. This file
- * is saved to the sketch's folder. This example won't work in a web browser
- * because of Java security restrictions.
- */
-
-int[] x = new int[0];
-int[] y = new int[0];
-
-void setup()
-{
- size(200, 200);
-}
-
-void draw()
-{
- background(204);
- stroke(0);
- noFill();
- beginShape();
- for (int i = 0; i < x.length; i++) {
- vertex(x[i], y[i]);
- }
- endShape();
- // Show the next segment to be added
- if (x.length >= 1) {
- stroke(255);
- line(mouseX, mouseY, x[x.length-1], y[x.length-1]);
- }
-}
-
-void mousePressed() { // Click to add a line segment
- x = append(x, mouseX);
- y = append(y, mouseY);
-}
-
-void keyPressed() { // Press a key to save the data
- String[] lines = new String[x.length];
- for (int i = 0; i < x.length; i++) {
- lines[i] = x[i] + "\t" + y[i];
- }
- saveStrings("lines.txt", lines);
- exit(); // Stop the program
-}
-
diff --git a/android/examples/Topics/File IO/SaveFile2/SaveFile2.pde b/android/examples/Topics/File IO/SaveFile2/SaveFile2.pde
deleted file mode 100644
index f472650634..0000000000
--- a/android/examples/Topics/File IO/SaveFile2/SaveFile2.pde
+++ /dev/null
@@ -1,34 +0,0 @@
-/**
- * SaveFile 2
- *
- * This file a PrintWriter object to write data continuously to a file
- * while the mouse is pressed. When a key is pressed, the file closes
- * itself and the program is stopped. This example won't work in a web browser
- * because of Java security restrictions.
- */
-
-PrintWriter output;
-
-void setup()
-{
- size(200, 200);
- // Create a new file in the sketch directory
- output = createWriter("positions.txt");
- frameRate(12);
-}
-
-void draw()
-{
- if (mousePressed) {
- point(mouseX, mouseY);
- // Write the coordinate to a file with a
- // "\t" (TAB character) between each entry
- output.println(mouseX + "\t" + mouseY);
- }
-}
-
-void keyPressed() { // Press a key to save the data
- output.flush(); // Write the remaining data
- output.close(); // Finish the file
- exit(); // Stop the program
-}
diff --git a/android/examples/Topics/File IO/SaveManyImages/SaveManyImages.pde b/android/examples/Topics/File IO/SaveManyImages/SaveManyImages.pde
deleted file mode 100644
index 4a030ec71f..0000000000
--- a/android/examples/Topics/File IO/SaveManyImages/SaveManyImages.pde
+++ /dev/null
@@ -1,28 +0,0 @@
-/**
- * Save Many Images.
- *
- * The saveFrame() function allows you to save images from
- * a program while it is running. This example saves the first
- * 50 frames of a program. These images can be imported into
- * animation software or QuickTime and then saved as a movie.
- */
-
-float x = 33;
-float numFrames = 50;
-
-void setup()
-{
- size(200, 200);
- smooth();
- noStroke();
-}
-
-void draw()
-{
- background(0);
- x += random(-2, 2);
- ellipse(x, 100, 80, 80);
- if (frameCount <= numFrames) {
- saveFrame("circles-####.tif");
- }
-}
diff --git a/android/examples/Topics/File IO/SaveOneImage/SaveOneImage.pde b/android/examples/Topics/File IO/SaveOneImage/SaveOneImage.pde
deleted file mode 100644
index 81f5aa8e9d..0000000000
--- a/android/examples/Topics/File IO/SaveOneImage/SaveOneImage.pde
+++ /dev/null
@@ -1,25 +0,0 @@
-/**
- * Save One Image
- *
- * The save() function allows you to save an image from the
- * display window. In this example, save() is run when a mouse
- * button is pressed. The image "line.tif" is saved to the
- * same folder as the sketch's program file.
- */
-
-void setup()
-{
- size(200, 200);
-}
-
-void draw()
-{
- background(204);
- line(0, 0, mouseX, height);
- line(width, 0, 0, mouseY);
-}
-
-void mousePressed()
-{
- save("line.tif");
-}
diff --git a/android/examples/Topics/File IO/TileImages/TileImages.pde b/android/examples/Topics/File IO/TileImages/TileImages.pde
deleted file mode 100644
index 7b266570c7..0000000000
--- a/android/examples/Topics/File IO/TileImages/TileImages.pde
+++ /dev/null
@@ -1,39 +0,0 @@
-/**
- * Tile Images
- *
- * Draws an image larger than the screen by tiling it into small sections.
- * The scaleValue variable sets amount of scaling: 1 is 100%, 2 is 200%, etc.
- */
-
-int scaleValue = 3; // Multiplication factor
-int xoffset = 0; // x-axis offset
-int yoffset = 0; // y-axis offset
-
-void setup()
-{
- size(600, 600);
- stroke(0, 100);
-}
-
-void draw()
-{
- scale(scaleValue);
- translate(xoffset *(-width / scaleValue), yoffset *(-height / scaleValue));
- line(10, 150, 500, 50);
- line(0, 600, 600, 0);
- setOffset();
-}
-
-void setOffset()
-{
- save("lines-" + xoffset + "-" + yoffset + ".jpg");
- xoffset++;
- if (xoffset == scaleValue) {
- xoffset = 0;
- yoffset++;
- if (yoffset == scaleValue) {
- exit();
- }
- }
- background(204);
-}
diff --git a/android/examples/Topics/Fractals and L-Systems/Koch/Koch.pde b/android/examples/Topics/Fractals and L-Systems/Koch/Koch.pde
deleted file mode 100644
index 3dbc49bfc3..0000000000
--- a/android/examples/Topics/Fractals and L-Systems/Koch/Koch.pde
+++ /dev/null
@@ -1,176 +0,0 @@
-/**
- * Koch Curve
- * by Daniel Shiffman.
- *
- * Renders a simple fractal, the Koch snowflake.
- * Each recursive level is drawn in sequence.
- */
-
-
-KochFractal k;
-
-void setup() {
- size(640, 360);
- background(0);
- frameRate(1); // Animate slowly
- k = new KochFractal();
- smooth();
-}
-
-void draw() {
- background(0);
- // Draws the snowflake!
- k.render();
- // Iterate
- k.nextLevel();
- // Let's not do it more than 5 times. . .
- if (k.getCount() > 5) {
- k.restart();
- }
-
-}
-
-
-// A class to manage the list of line segments in the snowflake pattern
-
-class KochFractal {
- Point start; // A point for the start
- Point end; // A point for the end
- ArrayList lines; // A list to keep track of all the lines
- int count;
-
- public KochFractal()
- {
- start = new Point(0,height/2 + height/4);
- end = new Point(width,height/2 + height/4);
- lines = new ArrayList();
- restart();
- }
-
- void nextLevel()
- {
- // For every line that is in the arraylist
- // create 4 more lines in a new arraylist
- lines = iterate(lines);
- count++;
- }
-
- void restart()
- {
- count = 0; // Reset count
- lines.clear(); // Empty the array list
- lines.add(new KochLine(start,end)); // Add the initial line (from one end point to the other)
- }
-
- int getCount() {
- return count;
- }
-
- // This is easy, just draw all the lines
- void render()
- {
- for(int i = 0; i < lines.size(); i++) {
- KochLine l = (KochLine)lines.get(i);
- l.render();
- }
- }
-
- // This is where the **MAGIC** happens
- // Step 1: Create an empty arraylist
- // Step 2: For every line currently in the arraylist
- // - calculate 4 line segments based on Koch algorithm
- // - add all 4 line segments into the new arraylist
- // Step 3: Return the new arraylist and it becomes the list of line segments for the structure
-
- // As we do this over and over again, each line gets broken into 4 lines, which gets broken into 4 lines, and so on. . .
- ArrayList iterate(ArrayList before)
- {
- ArrayList now = new ArrayList(); //Create emtpy list
- for(int i = 0; i < before.size(); i++)
- {
- KochLine l = (KochLine)lines.get(i); // A line segment inside the list
- // Calculate 5 koch points (done for us by the line object)
- Point a = l.start();
- Point b = l.kochleft();
- Point c = l.kochmiddle();
- Point d = l.kochright();
- Point e = l.end();
- // Make line segments between all the points and add them
- now.add(new KochLine(a,b));
- now.add(new KochLine(b,c));
- now.add(new KochLine(c,d));
- now.add(new KochLine(d,e));
- }
- return now;
- }
-
-}
-
-
-// A class to describe one line segment in the fractal
-// Includes methods to calculate midpoints along the line according to the Koch algorithm
-
-class KochLine {
-
- // Two points,
- // a is the "left" point and
- // b is the "right point
- Point a,b;
-
- KochLine(Point a_, Point b_) {
- a = a_.copy();
- b = b_.copy();
- }
-
- void render() {
- stroke(255);
- line(a.x,a.y,b.x,b.y);
- }
-
- Point start() {
- return a.copy();
- }
-
- Point end() {
- return b.copy();
- }
-
- // This is easy, just 1/3 of the way
- Point kochleft()
- {
- float x = a.x + (b.x - a.x) / 3f;
- float y = a.y + (b.y - a.y) / 3f;
- return new Point(x,y);
- }
-
- // More complicated, have to use a little trig to figure out where this point is!
- Point kochmiddle()
- {
- float x = a.x + 0.5f * (b.x - a.x) + (sin(radians(60))*(b.y-a.y)) / 3;
- float y = a.y + 0.5f * (b.y - a.y) - (sin(radians(60))*(b.x-a.x)) / 3;
- return new Point(x,y);
- }
-
- // Easy, just 2/3 of the way
- Point kochright()
- {
- float x = a.x + 2*(b.x - a.x) / 3f;
- float y = a.y + 2*(b.y - a.y) / 3f;
- return new Point(x,y);
- }
-
-}
-
-class Point {
- float x,y;
-
- Point(float x_, float y_) {
- x = x_;
- y = y_;
- }
-
- Point copy() {
- return new Point(x,y);
- }
-}
-
diff --git a/android/examples/Topics/Fractals and L-Systems/Mandelbrot/Mandelbrot.pde b/android/examples/Topics/Fractals and L-Systems/Mandelbrot/Mandelbrot.pde
deleted file mode 100644
index 2f31de8fb8..0000000000
--- a/android/examples/Topics/Fractals and L-Systems/Mandelbrot/Mandelbrot.pde
+++ /dev/null
@@ -1,75 +0,0 @@
-/**
- * The Mandelbrot Set
- * by Daniel Shiffman.
- *
- * Simple rendering of the Mandelbrot set.
- */
-
-// Establish a range of values on the complex plane
-// A different range will allow us to "zoom" in or out on the fractal
-// float xmin = -1.5; float ymin = -.1; float wh = 0.15;
-float xmin = -2.5;
-float ymin = -2;
-float wh = 4;
-
-void setup() {
- size(200, 200, P2D);
- noLoop();
- background(255);
- // Make sure we can write to the pixels[] array.
- // Only need to do this once since we don't do any other drawing.
- loadPixels();
-}
-
-void draw() {
- // Maximum number of iterations for each point on the complex plane
- int maxiterations = 200;
-
- // x goes from xmin to xmax
- float xmax = xmin + wh;
- // y goes from ymin to ymax
- float ymax = ymin + wh;
-
- // Calculate amount we increment x,y for each pixel
- float dx = (xmax - xmin) / (width);
- float dy = (ymax - ymin) / (height);
-
- // Start y
- float y = ymin;
- for (int j = 0; j < height; j++) {
- // Start x
- float x = xmin;
- for (int i = 0; i < width; i++) {
-
- // Now we test, as we iterate z = z^2 + cm does z tend towards infinity?
- float a = x;
- float b = y;
- int n = 0;
- while (n < maxiterations) {
- float aa = a * a;
- float bb = b * b;
- float twoab = 2.0 * a * b;
- a = aa - bb + x;
- b = twoab + y;
- // Infinty in our finite world is simple, let's just consider it 16
- if(aa + bb > 16.0) {
- break; // Bail
- }
- n++;
- }
-
- // We color each pixel based on how long it takes to get to infinity
- // If we never got there, let's pick the color black
- if (n == maxiterations) {
- pixels[i+j*width] = 0;
- } else {
- // Gosh, we could make fancy colors here if we wanted
- pixels[i+j*width] = color(n*16 % 255);
- }
- x += dx;
- }
- y += dy;
- }
- updatePixels();
-}
-
diff --git a/android/examples/Topics/Fractals and L-Systems/PenroseSnowflake/LSystem.pde b/android/examples/Topics/Fractals and L-Systems/PenroseSnowflake/LSystem.pde
deleted file mode 100644
index 10e694d126..0000000000
--- a/android/examples/Topics/Fractals and L-Systems/PenroseSnowflake/LSystem.pde
+++ /dev/null
@@ -1,76 +0,0 @@
-class LSystem
-{
- int steps = 0;
-
- String axiom;
- String rule;
- String production;
-
- float startLength;
- float drawLength;
- float theta;
-
- int generations;
-
- LSystem() {
- axiom = "F";
- rule = "F+F-F";
- startLength = 90.0;
- theta = radians(120.0);
- reset();
- }
-
- void reset() {
- production = axiom;
- drawLength = startLength;
- generations = 0;
- }
-
- int getAge() {
- return generations;
- }
-
- void render() {
- translate(width/2, height/2);
- steps += 5;
- if (steps > production.length()) {
- steps = production.length();
- }
- for (int i = 0; i < steps; i++) {
- char step = production.charAt(i);
- if (step == 'F') {
- rect(0, 0, -drawLength, -drawLength);
- noFill();
- translate(0, -drawLength);
- }
- else if (step == '+') {
- rotate(theta);
- }
- else if (step == '-') {
- rotate(-theta);
- }
- else if (step == '[') {
- pushMatrix();
- }
- else if (step == ']') {
- popMatrix();
- }
- }
- }
-
- void simulate(int gen) {
- while (getAge() < gen) {
- production = iterate(production, rule);
- }
- }
-
- String iterate(String prod_, String rule_) {
- drawLength = drawLength * 0.6;
- generations++;
- String newProduction = prod_;
- newProduction = newProduction.replaceAll("F", rule_);
- return newProduction;
- }
-}
-
-
diff --git a/android/examples/Topics/Fractals and L-Systems/PenroseSnowflake/PenroseSnowflake.pde b/android/examples/Topics/Fractals and L-Systems/PenroseSnowflake/PenroseSnowflake.pde
deleted file mode 100644
index 8fe1c93932..0000000000
--- a/android/examples/Topics/Fractals and L-Systems/PenroseSnowflake/PenroseSnowflake.pde
+++ /dev/null
@@ -1,24 +0,0 @@
-/**
- * Penrose Snowflake L-System
- * by Geraldine Sarmiento (NYU ITP).
- *
- * This code was based on Patrick Dwyer's L-System class.
- */
-
-PenroseSnowflakeLSystem ps;
-
-void setup() {
- size(640, 360);
- stroke(255);
- noFill();
- smooth();
- ps = new PenroseSnowflakeLSystem();
- ps.simulate(4);
-}
-
-void draw() {
- background(0);
- ps.render();
-}
-
-
diff --git a/android/examples/Topics/Fractals and L-Systems/PenroseSnowflake/PenroseSnowflakeLSystem.pde b/android/examples/Topics/Fractals and L-Systems/PenroseSnowflake/PenroseSnowflakeLSystem.pde
deleted file mode 100644
index df1f775b02..0000000000
--- a/android/examples/Topics/Fractals and L-Systems/PenroseSnowflake/PenroseSnowflakeLSystem.pde
+++ /dev/null
@@ -1,100 +0,0 @@
-class PenroseSnowflakeLSystem extends LSystem {
-
- String ruleF;
-
- PenroseSnowflakeLSystem() {
- axiom = "F3-F3-F3-F3-F";
- ruleF = "F3-F3-F45-F++F3-F";
- startLength = 450.0;
- theta = radians(18);
- reset();
- }
-
- void useRule(String r_) {
- rule = r_;
- }
-
- void useAxiom(String a_) {
- axiom = a_;
- }
-
- void useLength(float l_) {
- startLength = l_;
- }
-
- void useTheta(float t_) {
- theta = radians(t_);
- }
-
- void reset() {
- production = axiom;
- drawLength = startLength;
- generations = 0;
- }
-
- int getAge() {
- return generations;
- }
-
- void render() {
- translate(width, height);
- int repeats = 1;
-
- steps += 3;
- if (steps > production.length()) {
- steps = production.length();
- }
-
- for (int i = 0; i < steps; i++) {
- char step = production.charAt(i);
- if (step == 'F') {
- for (int j = 0; j < repeats; j++) {
- line(0,0,0, -drawLength);
- translate(0, -drawLength);
- }
- repeats = 1;
- }
- else if (step == '+') {
- for (int j = 0; j < repeats; j++) {
- rotate(theta);
- }
- repeats = 1;
- }
- else if (step == '-') {
- for (int j =0; j < repeats; j++) {
- rotate(-theta);
- }
- repeats = 1;
- }
- else if (step == '[') {
- pushMatrix();
- }
- else if (step == ']') {
- popMatrix();
- }
- else if ( (step >= 48) && (step <= 57) ) {
- repeats += step - 48;
- }
- }
- }
-
-
- String iterate(String prod_, String rule_) {
- String newProduction = "";
- for (int i = 0; i < prod_.length(); i++) {
- char step = production.charAt(i);
- if (step == 'F') {
- newProduction = newProduction + ruleF;
- }
- else {
- if (step != 'F') {
- newProduction = newProduction + step;
- }
- }
- }
- drawLength = drawLength * 0.4;
- generations++;
- return newProduction;
- }
-
-}
diff --git a/android/examples/Topics/Fractals and L-Systems/PenroseTile/LSystem.pde b/android/examples/Topics/Fractals and L-Systems/PenroseTile/LSystem.pde
deleted file mode 100644
index 8f00ddaf5f..0000000000
--- a/android/examples/Topics/Fractals and L-Systems/PenroseTile/LSystem.pde
+++ /dev/null
@@ -1,74 +0,0 @@
-class LSystem
-{
- int steps = 0;
-
- String axiom;
- String rule;
- String production;
-
- float startLength;
- float drawLength;
- float theta;
-
- int generations;
-
- LSystem() {
- axiom = "F";
- rule = "F+F-F";
- startLength = 190.0;
- theta = radians(120.0);
- reset();
- }
-
- void reset() {
- production = axiom;
- drawLength = startLength;
- generations = 0;
- }
-
- int getAge() {
- return generations;
- }
-
- void render() {
- translate(width/2, height/2);
- steps += 5;
- if (steps > production.length()) {
- steps = production.length();
- }
- for (int i = 0; i < steps; i++) {
- char step = production.charAt(i);
- if (step == 'F') {
- rect(0, 0, -drawLength, -drawLength);
- noFill();
- translate(0, -drawLength);
- }
- else if (step == '+') {
- rotate(theta);
- }
- else if (step == '-') {
- rotate(-theta);
- }
- else if (step == '[') {
- pushMatrix();
- }
- else if (step == ']') {
- popMatrix();
- }
- }
- }
-
- void simulate(int gen) {
- while (getAge() < gen) {
- production = iterate(production, rule);
- }
- }
-
- String iterate(String prod_, String rule_) {
- drawLength = drawLength * 0.6;
- generations++;
- String newProduction = prod_;
- newProduction = newProduction.replaceAll("F", rule_);
- return newProduction;
- }
-}
diff --git a/android/examples/Topics/Fractals and L-Systems/PenroseTile/PenroseLSystem.pde b/android/examples/Topics/Fractals and L-Systems/PenroseTile/PenroseLSystem.pde
deleted file mode 100644
index 16a7f1c432..0000000000
--- a/android/examples/Topics/Fractals and L-Systems/PenroseTile/PenroseLSystem.pde
+++ /dev/null
@@ -1,128 +0,0 @@
-class PenroseLSystem extends LSystem {
-
- int steps = 0;
- float somestep = 0.1;
- String ruleW;
- String ruleX;
- String ruleY;
- String ruleZ;
-
- PenroseLSystem() {
- axiom = "[X]++[X]++[X]++[X]++[X]";
- ruleW = "YF++ZF4-XF[-YF4-WF]++";
- ruleX = "+YF--ZF[3-WF--XF]+";
- ruleY = "-WF++XF[+++YF++ZF]-";
- ruleZ = "--YF++++WF[+ZF++++XF]--XF";
- startLength = 460.0;
- theta = radians(36);
- reset();
- }
-
- void useRule(String r_) {
- rule = r_;
- }
-
- void useAxiom(String a_) {
- axiom = a_;
- }
-
- void useLength(float l_) {
- startLength = l_;
- }
-
- void useTheta(float t_) {
- theta = radians(t_);
- }
-
- void reset() {
- production = axiom;
- drawLength = startLength;
- generations = 0;
- }
-
- int getAge() {
- return generations;
- }
-
- void render() {
- translate(width/2, height/2);
- int pushes = 0;
- int repeats = 1;
- steps += 12;
- if (steps > production.length()) {
- steps = production.length();
- }
-
- for (int i = 0; i < steps; i++) {
- char step = production.charAt(i);
- if (step == 'F') {
- stroke(255, 60);
- for (int j = 0; j < repeats; j++) {
- line(0, 0, 0, -drawLength);
- noFill();
- translate(0, -drawLength);
- }
- repeats = 1;
- }
- else if (step == '+') {
- for (int j = 0; j < repeats; j++) {
- rotate(theta);
- }
- repeats = 1;
- }
- else if (step == '-') {
- for (int j =0; j < repeats; j++) {
- rotate(-theta);
- }
- repeats = 1;
- }
- else if (step == '[') {
- pushes++;
- pushMatrix();
- }
- else if (step == ']') {
- popMatrix();
- pushes--;
- }
- else if ( (step >= 48) && (step <= 57) ) {
- repeats = (int)step - 48;
- }
- }
-
- // Unpush if we need too
- while (pushes > 0) {
- popMatrix();
- pushes--;
- }
- }
-
- String iterate(String prod_, String rule_) {
- String newProduction = "";
- for (int i = 0; i < prod_.length(); i++) {
- char step = production.charAt(i);
- if (step == 'W') {
- newProduction = newProduction + ruleW;
- }
- else if (step == 'X') {
- newProduction = newProduction + ruleX;
- }
- else if (step == 'Y') {
- newProduction = newProduction + ruleY;
- }
- else if (step == 'Z') {
- newProduction = newProduction + ruleZ;
- }
- else {
- if (step != 'F') {
- newProduction = newProduction + step;
- }
- }
- }
-
- drawLength = drawLength * 0.5;
- generations++;
- return newProduction;
- }
-
-}
-
diff --git a/android/examples/Topics/Fractals and L-Systems/PenroseTile/PenroseTile.pde b/android/examples/Topics/Fractals and L-Systems/PenroseTile/PenroseTile.pde
deleted file mode 100644
index 1cbeb439cb..0000000000
--- a/android/examples/Topics/Fractals and L-Systems/PenroseTile/PenroseTile.pde
+++ /dev/null
@@ -1,28 +0,0 @@
-/**
- * Penrose Tile L-System
- * by Geraldine Sarmiento (NYU ITP).
- *
- * This code was based on Patrick Dwyer's L-System class.
- */
-
-PenroseLSystem ds;
-
-void setup()
-{
- size(640, 360);
- smooth();
- ds = new PenroseLSystem();
- ds.simulate(4);
-}
-
-void draw()
-{
- background(0);
- ds.render();
-}
-
-
-
-
-
-
diff --git a/android/examples/Topics/Fractals and L-Systems/Pentigree/LSystem.pde b/android/examples/Topics/Fractals and L-Systems/Pentigree/LSystem.pde
deleted file mode 100644
index 2adcabcd5b..0000000000
--- a/android/examples/Topics/Fractals and L-Systems/Pentigree/LSystem.pde
+++ /dev/null
@@ -1,76 +0,0 @@
-class LSystem {
-
- int steps = 0;
-
- String axiom;
- String rule;
- String production;
-
- float startLength;
- float drawLength;
- float theta;
-
- int generations;
-
- LSystem() {
-
- axiom = "F";
- rule = "F+F-F";
- startLength = 90.0;
- theta = radians(120.0);
- reset();
- }
-
- void reset() {
- production = axiom;
- drawLength = startLength;
- generations = 0;
- }
-
- int getAge() {
- return generations;
- }
-
- void render() {
- translate(width/2, height/2);
- steps += 5;
- if (steps > production.length()) {
- steps = production.length();
- }
- for (int i = 0; i < steps; i++) {
- char step = production.charAt(i);
- if (step == 'F') {
- rect(0, 0, -drawLength, -drawLength);
- noFill();
- translate(0, -drawLength);
- }
- else if (step == '+') {
- rotate(theta);
- }
- else if (step == '-') {
- rotate(-theta);
- }
- else if (step == '[') {
- pushMatrix();
- }
- else if (step == ']') {
- popMatrix();
- }
- }
- }
-
- void simulate(int gen) {
- while (getAge() < gen) {
- production = iterate(production, rule);
- }
- }
-
- String iterate(String prod_, String rule_) {
- drawLength = drawLength * 0.6;
- generations++;
- String newProduction = prod_;
- newProduction = newProduction.replaceAll("F", rule_);
- return newProduction;
- }
-}
-
diff --git a/android/examples/Topics/Fractals and L-Systems/Pentigree/Pentigree.pde b/android/examples/Topics/Fractals and L-Systems/Pentigree/Pentigree.pde
deleted file mode 100644
index be0d3fb779..0000000000
--- a/android/examples/Topics/Fractals and L-Systems/Pentigree/Pentigree.pde
+++ /dev/null
@@ -1,23 +0,0 @@
-/**
- * Pentigree L-System
- * by Geraldine Sarmiento (NYU ITP).
- *
- * This code was based on Patrick Dwyer's L-System class.
- */
-
-
-PentigreeLSystem ps;
-
-void setup() {
- size(640, 360);
- smooth();
- ps = new PentigreeLSystem();
- ps.simulate(3);
-}
-
-void draw() {
- background(0);
- ps.render();
-}
-
-
diff --git a/android/examples/Topics/Fractals and L-Systems/Pentigree/PentigreeLSystem.pde b/android/examples/Topics/Fractals and L-Systems/Pentigree/PentigreeLSystem.pde
deleted file mode 100644
index a377c016d5..0000000000
--- a/android/examples/Topics/Fractals and L-Systems/Pentigree/PentigreeLSystem.pde
+++ /dev/null
@@ -1,71 +0,0 @@
-class PentigreeLSystem extends LSystem {
-
- int steps = 0;
- float somestep = 0.1;
- float xoff = 0.01;
-
- PentigreeLSystem() {
- axiom = "F-F-F-F-F";
- rule = "F-F++F+F-F-F";
- startLength = 60.0;
- theta = radians(72);
- reset();
- }
-
- void useRule(String r_) {
- rule = r_;
- }
-
- void useAxiom(String a_) {
- axiom = a_;
- }
-
- void useLength(float l_) {
- startLength = l_;
- }
-
- void useTheta(float t_) {
- theta = radians(t_);
- }
-
- void reset() {
- production = axiom;
- drawLength = startLength;
- generations = 0;
- }
-
- int getAge() {
- return generations;
- }
-
- void render() {
- translate(width/4, height/2);
- steps += 3;
- if (steps > production.length()) {
- steps = production.length();
- }
-
- for (int i = 0; i < steps; i++) {
- char step = production.charAt(i);
- if (step == 'F') {
- noFill();
- stroke(255);
- line(0, 0, 0, -drawLength);
- translate(0, -drawLength);
- }
- else if (step == '+') {
- rotate(theta);
- }
- else if (step == '-') {
- rotate(-theta);
- }
- else if (step == '[') {
- pushMatrix();
- }
- else if (step == ']') {
- popMatrix();
- }
- }
- }
-
-}
diff --git a/android/examples/Topics/Fractals and L-Systems/Tree/Tree.pde b/android/examples/Topics/Fractals and L-Systems/Tree/Tree.pde
deleted file mode 100644
index e6d4d646aa..0000000000
--- a/android/examples/Topics/Fractals and L-Systems/Tree/Tree.pde
+++ /dev/null
@@ -1,61 +0,0 @@
-/**
- * Recursive Tree
- * by Daniel Shiffman.
- *
- * Renders a simple tree-like structure via recursion.
- * The branching angle is calculated as a function of
- * the horizontal mouse location. Move the mouse left
- * and right to change the angle.
- */
-
-float theta;
-
-void setup() {
- size(640, 360);
- smooth();
-}
-
-void draw() {
- background(0);
- frameRate(30);
- stroke(255);
- // Let's pick an angle 0 to 90 degrees based on the mouse position
- float a = (mouseX / (float) width) * 90f;
- // Convert it to radians
- theta = radians(a);
- // Start the tree from the bottom of the screen
- translate(width/2,height);
- // Draw a line 120 pixels
- line(0,0,0,-120);
- // Move to the end of that line
- translate(0,-120);
- // Start the recursive branching!
- branch(120);
-
-}
-
-void branch(float h) {
- // Each branch will be 2/3rds the size of the previous one
- h *= 0.66;
-
- // All recursive functions must have an exit condition!!!!
- // Here, ours is when the length of the branch is 2 pixels or less
- if (h > 2) {
- pushMatrix(); // Save the current state of transformation (i.e. where are we now)
- rotate(theta); // Rotate by theta
- line(0, 0, 0, -h); // Draw the branch
- translate(0, -h); // Move to the end of the branch
- branch(h); // Ok, now call myself to draw two new branches!!
- popMatrix(); // Whenever we get back here, we "pop" in order to restore the previous matrix state
-
- // Repeat the same thing, only branch off to the "left" this time!
- pushMatrix();
- rotate(-theta);
- line(0, 0, 0, -h);
- translate(0, -h);
- branch(h);
- popMatrix();
- }
-}
-
-
diff --git a/android/examples/Topics/GUI/Button/Button.pde b/android/examples/Topics/GUI/Button/Button.pde
deleted file mode 100644
index fe477b83fa..0000000000
--- a/android/examples/Topics/GUI/Button/Button.pde
+++ /dev/null
@@ -1,100 +0,0 @@
-/**
- * Button.
- *
- * Click on one of the colored squares in the
- * center of the image to change the color of
- * the background.
- */
-
-int rectX, rectY; // Position of square button
-int circleX, circleY; // Position of circle button
-int rectSize = 50; // Diameter of rect
-int circleSize = 53; // Diameter of circle
-color rectColor, circleColor, baseColor;
-color rectHighlight, circleHighlight;
-color currentColor;
-boolean rectOver = false;
-boolean circleOver = false;
-
-void setup()
-{
- size(200, 200);
- smooth();
- rectColor = color(0);
- rectHighlight = color(51);
- circleColor = color(255);
- circleHighlight = color(204);
- baseColor = color(102);
- currentColor = baseColor;
- circleX = width/2+circleSize/2+10;
- circleY = height/2;
- rectX = width/2-rectSize-10;
- rectY = height/2-rectSize/2;
- ellipseMode(CENTER);
-}
-
-void draw()
-{
- update(mouseX, mouseY);
- background(currentColor);
-
- if(rectOver) {
- fill(rectHighlight);
- } else {
- fill(rectColor);
- }
- stroke(255);
- rect(rectX, rectY, rectSize, rectSize);
-
- if(circleOver) {
- fill(circleHighlight);
- } else {
- fill(circleColor);
- }
- stroke(0);
- ellipse(circleX, circleY, circleSize, circleSize);
-}
-
-void update(int x, int y)
-{
- if( overCircle(circleX, circleY, circleSize) ) {
- circleOver = true;
- rectOver = false;
- } else if ( overRect(rectX, rectY, rectSize, rectSize) ) {
- rectOver = true;
- circleOver = false;
- } else {
- circleOver = rectOver = false;
- }
-}
-
-void mousePressed()
-{
- if(circleOver) {
- currentColor = circleColor;
- }
- if(rectOver) {
- currentColor = rectColor;
- }
-}
-
-boolean overRect(int x, int y, int width, int height)
-{
- if (mouseX >= x && mouseX <= x+width &&
- mouseY >= y && mouseY <= y+height) {
- return true;
- } else {
- return false;
- }
-}
-
-boolean overCircle(int x, int y, int diameter)
-{
- float disX = x - mouseX;
- float disY = y - mouseY;
- if(sqrt(sq(disX) + sq(disY)) < diameter/2 ) {
- return true;
- } else {
- return false;
- }
-}
diff --git a/android/examples/Topics/GUI/Buttons/Buttons.pde b/android/examples/Topics/GUI/Buttons/Buttons.pde
deleted file mode 100644
index 11f8b00315..0000000000
--- a/android/examples/Topics/GUI/Buttons/Buttons.pde
+++ /dev/null
@@ -1,220 +0,0 @@
-/**
- * Buttons.
- *
- * Click on one of the shapes to change
- * the background color. This example
- * demonstates a class for buttons.
- */
-
-color currentcolor;
-
-CircleButton circle1, circle2, circle3;
-RectButton rect1, rect2;
-
-boolean locked = false;
-
-void setup()
-{
- size(200, 200);
- smooth();
-
- color baseColor = color(102);
- currentcolor = baseColor;
-
- // Define and create circle button
- color buttoncolor = color(204);
- color highlight = color(153);
- ellipseMode(CENTER);
- circle1 = new CircleButton(30, 100, 100, buttoncolor, highlight);
-
- // Define and create circle button
- buttoncolor = color(204);
- highlight = color(153);
- circle2 = new CircleButton(130, 110, 24, buttoncolor, highlight);
-
- // Define and create circle button
- buttoncolor = color(153);
- highlight = color(102);
- circle3 = new CircleButton(130, 140, 24, buttoncolor, highlight);
-
- // Define and create rectangle button
- buttoncolor = color(102);
- highlight = color(51);
- rect1 = new RectButton(150, 20, 100, buttoncolor, highlight);
-
- // Define and create rectangle button
- buttoncolor = color(51);
- highlight = color(0);
- rect2 = new RectButton(90, 20, 50, buttoncolor, highlight);
-}
-
-void draw()
-{
- background(currentcolor);
- stroke(255);
- update(mouseX, mouseY);
- circle1.display();
- circle2.display();
- circle3.display();
- rect1.display();
- rect2.display();
-}
-
-void update(int x, int y)
-{
- if(locked == false) {
- circle1.update();
- circle2.update();
- circle3.update();
- rect1.update();
- rect2.update();
- }
- else {
- locked = false;
- }
-
- if(mousePressed) {
- if(circle1.pressed()) {
- currentcolor = circle1.basecolor;
- }
- else if(circle2.pressed()) {
- currentcolor = circle2.basecolor;
- }
- else if(circle3.pressed()) {
- currentcolor = circle3.basecolor;
- }
- else if(rect1.pressed()) {
- currentcolor = rect1.basecolor;
- }
- else if(rect2.pressed()) {
- currentcolor = rect2.basecolor;
- }
- }
-}
-
-
-class Button
-{
- int x, y;
- int size;
- color basecolor, highlightcolor;
- color currentcolor;
- boolean over = false;
- boolean pressed = false;
-
- void update()
- {
- if(over()) {
- currentcolor = highlightcolor;
- }
- else {
- currentcolor = basecolor;
- }
- }
-
- boolean pressed()
- {
- if(over) {
- locked = true;
- return true;
- }
- else {
- locked = false;
- return false;
- }
- }
-
- boolean over()
- {
- return true;
- }
-
- boolean overRect(int x, int y, int width, int height)
- {
- if (mouseX >= x && mouseX <= x+width &&
- mouseY >= y && mouseY <= y+height) {
- return true;
- }
- else {
- return false;
- }
- }
-
- boolean overCircle(int x, int y, int diameter)
- {
- float disX = x - mouseX;
- float disY = y - mouseY;
- if(sqrt(sq(disX) + sq(disY)) < diameter/2 ) {
- return true;
- }
- else {
- return false;
- }
- }
-
-}
-
-class CircleButton extends Button
-{
- CircleButton(int ix, int iy, int isize, color icolor, color ihighlight)
- {
- x = ix;
- y = iy;
- size = isize;
- basecolor = icolor;
- highlightcolor = ihighlight;
- currentcolor = basecolor;
- }
-
- boolean over()
- {
- if( overCircle(x, y, size) ) {
- over = true;
- return true;
- }
- else {
- over = false;
- return false;
- }
- }
-
- void display()
- {
- stroke(255);
- fill(currentcolor);
- ellipse(x, y, size, size);
- }
-}
-
-class RectButton extends Button
-{
- RectButton(int ix, int iy, int isize, color icolor, color ihighlight)
- {
- x = ix;
- y = iy;
- size = isize;
- basecolor = icolor;
- highlightcolor = ihighlight;
- currentcolor = basecolor;
- }
-
- boolean over()
- {
- if( overRect(x, y, size, size) ) {
- over = true;
- return true;
- }
- else {
- over = false;
- return false;
- }
- }
-
- void display()
- {
- stroke(255);
- fill(currentcolor);
- rect(x, y, size, size);
- }
-}
-
diff --git a/android/examples/Topics/GUI/Handles/Handles.pde b/android/examples/Topics/GUI/Handles/Handles.pde
deleted file mode 100644
index 7036f362a0..0000000000
--- a/android/examples/Topics/GUI/Handles/Handles.pde
+++ /dev/null
@@ -1,139 +0,0 @@
-/**
- * Handles.
- *
- * Click and drag the white boxes to change their position.
- */
-
-Handle[] handles;
-int num;
-
-void setup()
-{
- size(200, 200);
- num = height/15;
- handles = new Handle[num];
- int hsize = 10;
- for(int i=0; i= x && mouseX <= x+width &&
- mouseY >= y && mouseY <= y+height) {
- return true;
- } else {
- return false;
- }
-}
-
-int lock(int val, int minv, int maxv)
-{
- return min(max(val, minv), maxv);
-}
diff --git a/android/examples/Topics/GUI/ImageButton/ImageButton.pde b/android/examples/Topics/GUI/ImageButton/ImageButton.pde
deleted file mode 100644
index 338cb3d1ee..0000000000
--- a/android/examples/Topics/GUI/ImageButton/ImageButton.pde
+++ /dev/null
@@ -1,108 +0,0 @@
-/**
- * Image button.
- *
- * Loading images and using them to create a button.
- */
-
-
-ImageButtons button;
-
-void setup()
-{
- size(200, 200);
- background(102, 102, 102);
-
- // Define and create image button
- PImage b = loadImage("base.gif");
- PImage r = loadImage("roll.gif");
- PImage d = loadImage("down.gif");
- int x = width/2 - b.width/2;
- int y = height/2 - b.height/2;
- int w = b.width;
- int h = b.height;
- button = new ImageButtons(x, y, w, h, b, r, d);
-}
-
-void draw()
-{
- button.update();
- button.display();
-}
-
-class Button
-{
- int x, y;
- int w, h;
- color basecolor, highlightcolor;
- color currentcolor;
- boolean over = false;
- boolean pressed = false;
-
- void pressed() {
- if(over && mousePressed) {
- pressed = true;
- } else {
- pressed = false;
- }
- }
-
- boolean overRect(int x, int y, int width, int height) {
- if (mouseX >= x && mouseX <= x+width &&
- mouseY >= y && mouseY <= y+height) {
- return true;
- } else {
- return false;
- }
-}
-}
-
-class ImageButtons extends Button
-{
- PImage base;
- PImage roll;
- PImage down;
- PImage currentimage;
-
- ImageButtons(int ix, int iy, int iw, int ih, PImage ibase, PImage iroll, PImage idown)
- {
- x = ix;
- y = iy;
- w = iw;
- h = ih;
- base = ibase;
- roll = iroll;
- down = idown;
- currentimage = base;
- }
-
- void update()
- {
- over();
- pressed();
- if(pressed) {
- currentimage = down;
- } else if (over){
- currentimage = roll;
- } else {
- currentimage = base;
- }
- }
-
- void over()
- {
- if( overRect(x, y, w, h) ) {
- over = true;
- } else {
- over = false;
- }
- }
-
- void display()
- {
- image(currentimage, x, y);
- }
-}
-
-
-
-
diff --git a/android/examples/Topics/GUI/ImageButton/data/base.gif b/android/examples/Topics/GUI/ImageButton/data/base.gif
deleted file mode 100644
index 8d7603a018..0000000000
Binary files a/android/examples/Topics/GUI/ImageButton/data/base.gif and /dev/null differ
diff --git a/android/examples/Topics/GUI/ImageButton/data/down.gif b/android/examples/Topics/GUI/ImageButton/data/down.gif
deleted file mode 100644
index 7e4f441553..0000000000
Binary files a/android/examples/Topics/GUI/ImageButton/data/down.gif and /dev/null differ
diff --git a/android/examples/Topics/GUI/ImageButton/data/roll.gif b/android/examples/Topics/GUI/ImageButton/data/roll.gif
deleted file mode 100644
index 7e2a1bc2e3..0000000000
Binary files a/android/examples/Topics/GUI/ImageButton/data/roll.gif and /dev/null differ
diff --git a/android/examples/Topics/GUI/Rollover/Rollover.pde b/android/examples/Topics/GUI/Rollover/Rollover.pde
deleted file mode 100644
index 4785ec9acf..0000000000
--- a/android/examples/Topics/GUI/Rollover/Rollover.pde
+++ /dev/null
@@ -1,88 +0,0 @@
-/**
- * Rollover.
- *
- * Roll over the colored squares in the center of the image
- * to change the color of the outside rectangle.
- */
-
-
-int rectX, rectY; // Position of square button
-int circleX, circleY; // Position of circle button
-int rectSize = 50; // Diameter of rect
-int circleSize = 53; // Diameter of circle
-
-color rectColor;
-color circleColor;
-color baseColor;
-
-boolean rectOver = false;
-boolean circleOver = false;
-
-void setup()
-{
- size(200, 200);
- smooth();
- rectColor = color(0);
- circleColor = color(255);
- baseColor = color(102);
- circleX = width/2+circleSize/2+10;
- circleY = height/2;
- rectX = width/2-rectSize-10;
- rectY = height/2-rectSize/2;
- ellipseMode(CENTER);
-}
-
-void draw()
-{
- update(mouseX, mouseY);
-
- noStroke();
- if (rectOver) {
- background(rectColor);
- } else if (circleOver) {
- background(circleColor);
- } else {
- background(baseColor);
- }
-
- stroke(255);
- fill(rectColor);
- rect(rectX, rectY, rectSize, rectSize);
- stroke(0);
- fill(circleColor);
- ellipse(circleX, circleY, circleSize, circleSize);
-}
-
-void update(int x, int y)
-{
- if( overCircle(circleX, circleY, circleSize) ) {
- circleOver = true;
- rectOver = false;
- } else if ( overRect(rectX, rectY, rectSize, rectSize) ) {
- rectOver = true;
- circleOver = false;
- } else {
- circleOver = rectOver = false;
- }
-}
-
-boolean overRect(int x, int y, int width, int height)
-{
- if (mouseX >= x && mouseX <= x+width &&
- mouseY >= y && mouseY <= y+height) {
- return true;
- } else {
- return false;
- }
-}
-
-boolean overCircle(int x, int y, int diameter)
-{
- float disX = x - mouseX;
- float disY = y - mouseY;
- if(sqrt(sq(disX) + sq(disY)) < diameter/2 ) {
- return true;
- } else {
- return false;
- }
-}
diff --git a/android/examples/Topics/GUI/Scrollbar/Scrollbar.pde b/android/examples/Topics/GUI/Scrollbar/Scrollbar.pde
deleted file mode 100644
index 4647b60952..0000000000
--- a/android/examples/Topics/GUI/Scrollbar/Scrollbar.pde
+++ /dev/null
@@ -1,122 +0,0 @@
-/**
- * Scrollbar.
- *
- * Move the scrollbars left and right to change the positions of the images.
- */
-
-HScrollbar hs1, hs2;
-
-PImage top, bottom; // Two image to load
-int topWidth, bottomWidth; // The width of the top and bottom images
-
-
-void setup()
-{
- size(200, 200);
- noStroke();
- hs1 = new HScrollbar(0, 20, width, 10, 3*5+1);
- hs2 = new HScrollbar(0, height-20, width, 10, 3*5+1);
- top = loadImage("seedTop.jpg");
- topWidth = top.width;
- bottom = loadImage("seedBottom.jpg");
- bottomWidth = bottom.width;
-}
-
-void draw()
-{
- background(255);
-
- // Get the position of the top scrollbar
- // and convert to a value to display the top image
- float topPos = hs1.getPos()-width/2;
- fill(255);
- image(top, width/2-topWidth/2 + topPos*2, 0);
-
- // Get the position of the bottom scrollbar
- // and convert to a value to display the bottom image
- float bottomPos = hs2.getPos()-width/2;
- fill(255);
- image(bottom, width/2-bottomWidth/2 + bottomPos*2, height/2);
-
- hs1.update();
- hs2.update();
- hs1.display();
- hs2.display();
-}
-
-
-class HScrollbar
-{
- int swidth, sheight; // width and height of bar
- int xpos, ypos; // x and y position of bar
- float spos, newspos; // x position of slider
- int sposMin, sposMax; // max and min values of slider
- int loose; // how loose/heavy
- boolean over; // is the mouse over the slider?
- boolean locked;
- float ratio;
-
- HScrollbar (int xp, int yp, int sw, int sh, int l) {
- swidth = sw;
- sheight = sh;
- int widthtoheight = sw - sh;
- ratio = (float)sw / (float)widthtoheight;
- xpos = xp;
- ypos = yp-sheight/2;
- spos = xpos + swidth/2 - sheight/2;
- newspos = spos;
- sposMin = xpos;
- sposMax = xpos + swidth - sheight;
- loose = l;
- }
-
- void update() {
- if(over()) {
- over = true;
- } else {
- over = false;
- }
- if(mousePressed && over) {
- locked = true;
- }
- if(!mousePressed) {
- locked = false;
- }
- if(locked) {
- newspos = constrain(mouseX-sheight/2, sposMin, sposMax);
- }
- if(abs(newspos - spos) > 1) {
- spos = spos + (newspos-spos)/loose;
- }
- }
-
- int constrain(int val, int minv, int maxv) {
- return min(max(val, minv), maxv);
- }
-
- boolean over() {
- if(mouseX > xpos && mouseX < xpos+swidth &&
- mouseY > ypos && mouseY < ypos+sheight) {
- return true;
- } else {
- return false;
- }
- }
-
- void display() {
- fill(255);
- rect(xpos, ypos, swidth, sheight);
- if(over || locked) {
- fill(153, 102, 0);
- } else {
- fill(102, 102, 102);
- }
- rect(spos, ypos, sheight, sheight);
- }
-
- float getPos() {
- // Convert spos to be values between
- // 0 and the total width of the scrollbar
- return spos * ratio;
- }
-}
diff --git a/android/examples/Topics/GUI/Scrollbar/data/seedBottom.jpg b/android/examples/Topics/GUI/Scrollbar/data/seedBottom.jpg
deleted file mode 100644
index dd98337c95..0000000000
Binary files a/android/examples/Topics/GUI/Scrollbar/data/seedBottom.jpg and /dev/null differ
diff --git a/android/examples/Topics/GUI/Scrollbar/data/seedTop.jpg b/android/examples/Topics/GUI/Scrollbar/data/seedTop.jpg
deleted file mode 100644
index 62af546c35..0000000000
Binary files a/android/examples/Topics/GUI/Scrollbar/data/seedTop.jpg and /dev/null differ
diff --git a/android/examples/Topics/Geometry/Icosahedra/Dimension3D.pde b/android/examples/Topics/Geometry/Icosahedra/Dimension3D.pde
deleted file mode 100644
index 90c9499679..0000000000
--- a/android/examples/Topics/Geometry/Icosahedra/Dimension3D.pde
+++ /dev/null
@@ -1,10 +0,0 @@
-class Dimension3D{
- float w, h, d;
-
- Dimension3D(float w, float h, float d){
- this.w=w;
- this.h=h;
- this.d=d;
- }
-}
-
diff --git a/android/examples/Topics/Geometry/Icosahedra/Icosahedra.pde b/android/examples/Topics/Geometry/Icosahedra/Icosahedra.pde
deleted file mode 100644
index 8d318c7cee..0000000000
--- a/android/examples/Topics/Geometry/Icosahedra/Icosahedra.pde
+++ /dev/null
@@ -1,53 +0,0 @@
-/**
- * I Like Icosahedra
- * by Ira Greenberg.
- *
- * This example plots icosahedra. The Icosahdron is a regular
- * polyhedron composed of twenty equalateral triangles.
- */
-
-Icosahedron ico1;
-Icosahedron ico2;
-Icosahedron ico3;
-
-void setup(){
- size(640, 360, P3D);
- orientation(LANDSCAPE);
- ico1 = new Icosahedron(75);
- ico2 = new Icosahedron(75);
- ico3 = new Icosahedron(75);
-}
-
-void draw(){
- background(0);
- lights();
- translate(width/2, height/2);
-
- pushMatrix();
- translate(-width/3.5, 0);
- rotateX(frameCount*PI/185);
- rotateY(frameCount*PI/-200);
- stroke(170, 0, 0);
- noFill();
- ico1.create();
- popMatrix();
-
- pushMatrix();
- rotateX(frameCount*PI/200);
- rotateY(frameCount*PI/300);
- stroke(150, 0, 180);
- fill(170, 170, 0);
- ico2.create();
- popMatrix();
-
- pushMatrix();
- translate(width/3.5, 0);
- rotateX(frameCount*PI/-200);
- rotateY(frameCount*PI/200);
- noStroke();
- fill(0, 0, 185);
- ico3.create();
- popMatrix();
-}
-
-
diff --git a/android/examples/Topics/Geometry/Icosahedra/Icosahedron.pde b/android/examples/Topics/Geometry/Icosahedra/Icosahedron.pde
deleted file mode 100644
index 3a7f894530..0000000000
--- a/android/examples/Topics/Geometry/Icosahedra/Icosahedron.pde
+++ /dev/null
@@ -1,159 +0,0 @@
-class Icosahedron extends Shape3D{
-
- // icosahedron
- PVector topPoint;
- PVector[] topPent = new PVector[5];
- PVector bottomPoint;
- PVector[] bottomPent = new PVector[5];
- float angle = 0, radius = 150;
- float triDist;
- float triHt;
- float a, b, c;
-
- // constructor
- Icosahedron(float radius){
- this.radius = radius;
- init();
- }
-
- Icosahedron(PVector v, float radius){
- super(v);
- this.radius = radius;
- init();
- }
-
- // calculate geometry
- void init(){
- c = dist(cos(0)*radius, sin(0)*radius, cos(radians(72))*radius, sin(radians(72))*radius);
- b = radius;
- a = (float)(Math.sqrt(((c*c)-(b*b))));
-
- triHt = (float)(Math.sqrt((c*c)-((c/2)*(c/2))));
-
- for (int i=0; i 0.01) { xmag -= diff/4.0; }
-
- diff = ymag-newYmag;
- if (abs(diff) > 0.01) { ymag -= diff/4.0; }
-
- rotateX(-ymag);
- rotateY(-xmag);
-
- scale(90);
- beginShape(QUADS);
-
- fill(0, 1, 1); vertex(-1, 1, 1);
- fill(1, 1, 1); vertex( 1, 1, 1);
- fill(1, 0, 1); vertex( 1, -1, 1);
- fill(0, 0, 1); vertex(-1, -1, 1);
-
- fill(1, 1, 1); vertex( 1, 1, 1);
- fill(1, 1, 0); vertex( 1, 1, -1);
- fill(1, 0, 0); vertex( 1, -1, -1);
- fill(1, 0, 1); vertex( 1, -1, 1);
-
- fill(1, 1, 0); vertex( 1, 1, -1);
- fill(0, 1, 0); vertex(-1, 1, -1);
- fill(0, 0, 0); vertex(-1, -1, -1);
- fill(1, 0, 0); vertex( 1, -1, -1);
-
- fill(0, 1, 0); vertex(-1, 1, -1);
- fill(0, 1, 1); vertex(-1, 1, 1);
- fill(0, 0, 1); vertex(-1, -1, 1);
- fill(0, 0, 0); vertex(-1, -1, -1);
-
- fill(0, 1, 0); vertex(-1, 1, -1);
- fill(1, 1, 0); vertex( 1, 1, -1);
- fill(1, 1, 1); vertex( 1, 1, 1);
- fill(0, 1, 1); vertex(-1, 1, 1);
-
- fill(0, 0, 0); vertex(-1, -1, -1);
- fill(1, 0, 0); vertex( 1, -1, -1);
- fill(1, 0, 1); vertex( 1, -1, 1);
- fill(0, 0, 1); vertex(-1, -1, 1);
-
- endShape();
-
- popMatrix();
-}
diff --git a/android/examples/Topics/Geometry/ShapeTransform/ShapeTransform.pde b/android/examples/Topics/Geometry/ShapeTransform/ShapeTransform.pde
deleted file mode 100644
index 5e17a543d3..0000000000
--- a/android/examples/Topics/Geometry/ShapeTransform/ShapeTransform.pde
+++ /dev/null
@@ -1,112 +0,0 @@
-/**
- * Shape Transform
- * by Ira Greenberg.
- *
- * Illustrates the geometric relationship
- * between Cube, Pyramid, Cone and
- * Cylinder 3D primitives.
- *
- * Instructions:
- * tap rigth side of screen - increases points
- * tap left side of screen - decreases points
- * tap screen center toggles between cube/pyramid
- */
-
-int pts = 4;
-float angle = 0;
-float radius = 99;
-float cylinderLength = 95;
-
-//vertices
-PVector vertices[][];
-boolean isPyramid = false;
-
-float angleInc;
-
-void setup(){
- size(displayWidth, displayHeight, P3D);
- orientation(LANDSCAPE);
- noStroke();
- angleInc = PI/300.0;
-}
-
-void draw(){
- background(170, 95, 95);
- lights();
- fill(255, 200, 200);
- translate(width/2, height/2);
- rotateX(frameCount * angleInc);
- rotateY(frameCount * angleInc);
- rotateZ(frameCount * angleInc);
-
- // initialize vertex arrays
- vertices = new PVector[2][pts+1];
-
- // fill arrays
- for (int i = 0; i < 2; i++){
- angle = 0;
- for(int j = 0; j <= pts; j++){
- vertices[i][j] = new PVector();
- if (isPyramid){
- if (i==1){
- vertices[i][j].x = 0;
- vertices[i][j].y = 0;
- }
- else {
- vertices[i][j].x = cos(radians(angle)) * radius;
- vertices[i][j].y = sin(radians(angle)) * radius;
- }
- }
- else {
- vertices[i][j].x = cos(radians(angle)) * radius;
- vertices[i][j].y = sin(radians(angle)) * radius;
- }
- vertices[i][j].z = cylinderLength;
- // the .0 after the 360 is critical
- angle += 360.0/pts;
- }
- cylinderLength *= -1;
- }
-
- // draw cylinder tube
- beginShape(QUAD_STRIP);
- for(int j = 0; j <= pts; j++){
- vertex(vertices[0][j].x, vertices[0][j].y, vertices[0][j].z);
- vertex(vertices[1][j].x, vertices[1][j].y, vertices[1][j].z);
- }
- endShape();
-
- //draw cylinder ends
- for (int i = 0; i < 2; i++){
- beginShape();
- for(int j = 0; j < pts; j++){
- vertex(vertices[i][j].x, vertices[i][j].y, vertices[i][j].z);
- }
- endShape(CLOSE);
- }
-}
-
-
-/*
- tapping controls polygon detail.
- */
-void mousePressed(){
- if (abs(mouseX - width/2) < 50 &&
- abs(mouseY - height/2) < 50) {
- if (isPyramid){
- isPyramid = false;
- }
- else {
- isPyramid = true;
- }
- } else if (mouseX < width/2) {
- if (pts > 4){
- pts--;
- }
- } else if (mouseX > width/2) {
- if (pts < 90){
- pts++;
- }
- }
-}
-
diff --git a/android/examples/Topics/Geometry/SpaceJunk/Cube.pde b/android/examples/Topics/Geometry/SpaceJunk/Cube.pde
deleted file mode 100644
index 121b33f9b8..0000000000
--- a/android/examples/Topics/Geometry/SpaceJunk/Cube.pde
+++ /dev/null
@@ -1,67 +0,0 @@
-
-class Cube {
-
- // Properties
- int w, h, d;
- int shiftX, shiftY, shiftZ;
-
- // Constructor
- Cube(int w, int h, int d, int shiftX, int shiftY, int shiftZ){
- this.w = w;
- this.h = h;
- this.d = d;
- this.shiftX = shiftX;
- this.shiftY = shiftY;
- this.shiftZ = shiftZ;
- }
-
- // Main cube drawing method, which looks
- // more confusing than it really is. It's
- // just a bunch of rectangles drawn for
- // each cube face
- void drawCube(){
- beginShape(QUADS);
- // Front face
- vertex(-w/2 + shiftX, -h/2 + shiftY, -d/2 + shiftZ);
- vertex(w + shiftX, -h/2 + shiftY, -d/2 + shiftZ);
- vertex(w + shiftX, h + shiftY, -d/2 + shiftZ);
- vertex(-w/2 + shiftX, h + shiftY, -d/2 + shiftZ);
-
- // Back face
- vertex(-w/2 + shiftX, -h/2 + shiftY, d + shiftZ);
- vertex(w + shiftX, -h/2 + shiftY, d + shiftZ);
- vertex(w + shiftX, h + shiftY, d + shiftZ);
- vertex(-w/2 + shiftX, h + shiftY, d + shiftZ);
-
- // Left face
- vertex(-w/2 + shiftX, -h/2 + shiftY, -d/2 + shiftZ);
- vertex(-w/2 + shiftX, -h/2 + shiftY, d + shiftZ);
- vertex(-w/2 + shiftX, h + shiftY, d + shiftZ);
- vertex(-w/2 + shiftX, h + shiftY, -d/2 + shiftZ);
-
- // Right face
- vertex(w + shiftX, -h/2 + shiftY, -d/2 + shiftZ);
- vertex(w + shiftX, -h/2 + shiftY, d + shiftZ);
- vertex(w + shiftX, h + shiftY, d + shiftZ);
- vertex(w + shiftX, h + shiftY, -d/2 + shiftZ);
-
- // Top face
- vertex(-w/2 + shiftX, -h/2 + shiftY, -d/2 + shiftZ);
- vertex(w + shiftX, -h/2 + shiftY, -d/2 + shiftZ);
- vertex(w + shiftX, -h/2 + shiftY, d + shiftZ);
- vertex(-w/2 + shiftX, -h/2 + shiftY, d + shiftZ);
-
- // Bottom face
- vertex(-w/2 + shiftX, h + shiftY, -d/2 + shiftZ);
- vertex(w + shiftX, h + shiftY, -d/2 + shiftZ);
- vertex(w + shiftX, h + shiftY, d + shiftZ);
- vertex(-w/2 + shiftX, h + shiftY, d + shiftZ);
-
- endShape();
-
- // Add some rotation to each box for pizazz.
- rotateY(radians(1));
- rotateX(radians(1));
- rotateZ(radians(1));
- }
-}
diff --git a/android/examples/Topics/Geometry/SpaceJunk/SpaceJunk.pde b/android/examples/Topics/Geometry/SpaceJunk/SpaceJunk.pde
deleted file mode 100644
index 6d8bd944de..0000000000
--- a/android/examples/Topics/Geometry/SpaceJunk/SpaceJunk.pde
+++ /dev/null
@@ -1,61 +0,0 @@
-/**
- * Space Junk
- * by Ira Greenberg (zoom suggestion by Danny Greenberg).
- *
- * Rotating cubes in space using a custom Cube class.
- * Color controlled by light sources. Move the mouse left
- * and right to zoom.
- */
-
-// Used for oveall rotation
-float ang;
-
-// Cube count-lower/raise to test performance
-int limit = 100;
-
-// Array for all cubes
-Cube[]cubes = new Cube[limit];
-
-void setup() {
- size(displayWidth, displayHeight, P3D);
- background(0);
- noStroke();
-
- // Instantiate cubes, passing in random vals for size and postion
- for (int i = 0; i< cubes.length; i++){
- cubes[i] = new Cube(int(random(-10, 10)), int(random(-10, 10)),
- int(random(-10, 10)), int(random(-140, 140)),
- int(random(-140, 140)), int(random(-140, 140)));
- }
-}
-
-void draw(){
- background(0);
- fill(200);
-
- // Set up some different colored lights
- pointLight(51, 102, 255, 65, 60, 100);
- pointLight(200, 40, 60, -65, -60, -150);
-
- // Raise overall light in scene
- ambientLight(70, 70, 10);
-
- // Center geometry in display windwow.
- // you can change 3rd argument ('0')
- // to move block group closer(+)/further(-)
- translate(width/2, height/2, -200 + mouseX * 0.65);
-
- // Rotate around y and x axes
- rotateY(radians(ang));
- rotateX(radians(ang));
-
- // Draw cubes
- for (int i = 0; i < cubes.length; i++){
- cubes[i].drawCube();
- }
-
- // Used in rotate function calls above
- ang += 0.2;
-}
-
-
diff --git a/android/examples/Topics/Geometry/Toroid/Toroid.pde b/android/examples/Topics/Geometry/Toroid/Toroid.pde
deleted file mode 100644
index a085e81597..0000000000
--- a/android/examples/Topics/Geometry/Toroid/Toroid.pde
+++ /dev/null
@@ -1,183 +0,0 @@
-/**
- * Interactive Toroid
- * by Ira Greenberg.
- *
- * Illustrates the geometric relationship between Toroid, Sphere, and Helix
- * 3D primitives, as well as lathing principal.
- *
- * Instructions:
- * UP arrow key pts++
- * DOWN arrow key pts--
- * LEFT arrow key segments--
- * RIGHT arrow key segments++
- * 'a' key toroid radius--
- * 's' key toroid radius++
- * 'z' key initial polygon radius--
- * 'x' key initial polygon radius++
- * 'w' key toggle wireframe/solid shading
- * 'h' key toggle sphere/helix
- */
-
-int pts = 40;
-float angle = 0;
-float radius = 60.0;
-
-// lathe segments
-int segments = 60;
-float latheAngle = 0;
-float latheRadius = 100.0;
-
-//vertices
-PVector vertices[], vertices2[];
-
-// for shaded or wireframe rendering
-boolean isWireFrame = false;
-
-// for optional helix
-boolean isHelix = false;
-float helixOffset = 5.0;
-
-void setup(){
- size(640, 360, P3D);
- orientation(LANDSCAPE);
-}
-
-void draw(){
- background(50, 64, 42);
- // basic lighting setup
- lights();
- // 2 rendering styles
- // wireframe or solid
- if (isWireFrame){
- stroke(255, 255, 150);
- noFill();
- }
- else {
- noStroke();
- fill(150, 195, 125);
- }
- //center and spin toroid
- translate(width/2, height/2, -100);
-
- rotateX(frameCount*PI/150);
- rotateY(frameCount*PI/170);
- rotateZ(frameCount*PI/90);
-
- // initialize point arrays
- vertices = new PVector[pts+1];
- vertices2 = new PVector[pts+1];
-
- // fill arrays
- for(int i=0; i<=pts; i++){
- vertices[i] = new PVector();
- vertices2[i] = new PVector();
- vertices[i].x = latheRadius + sin(radians(angle))*radius;
- if (isHelix){
- vertices[i].z = cos(radians(angle))*radius-(helixOffset*
- segments)/2;
- }
- else{
- vertices[i].z = cos(radians(angle))*radius;
- }
- angle+=360.0/pts;
- }
-
- // draw toroid
- latheAngle = 0;
- for(int i=0; i<=segments; i++){
- beginShape(QUAD_STRIP);
- for(int j=0; j<=pts; j++){
- if (i>0){
- vertex(vertices2[j].x, vertices2[j].y, vertices2[j].z);
- }
- vertices2[j].x = cos(radians(latheAngle))*vertices[j].x;
- vertices2[j].y = sin(radians(latheAngle))*vertices[j].x;
- vertices2[j].z = vertices[j].z;
- // optional helix offset
- if (isHelix){
- vertices[j].z+=helixOffset;
- }
- vertex(vertices2[j].x, vertices2[j].y, vertices2[j].z);
- }
- // create extra rotation for helix
- if (isHelix){
- latheAngle+=720.0/segments;
- }
- else {
- latheAngle+=360.0/segments;
- }
- endShape();
- }
-}
-
-/*
- left/right arrow keys control ellipse detail
- up/down arrow keys control segment detail.
- 'a','s' keys control lathe radius
- 'z','x' keys control ellipse radius
- 'w' key toggles between wireframe and solid
- 'h' key toggles between toroid and helix
- */
-void keyPressed(){
- if(key == CODED) {
- // pts
- if (keyCode == UP) {
- if (pts<40){
- pts++;
- }
- }
- else if (keyCode == DOWN) {
- if (pts>3){
- pts--;
- }
- }
- // extrusion length
- if (keyCode == LEFT) {
- if (segments>3){
- segments--;
- }
- }
- else if (keyCode == RIGHT) {
- if (segments<80){
- segments++;
- }
- }
- }
- // lathe radius
- if (key =='a'){
- if (latheRadius>0){
- latheRadius--;
- }
- }
- else if (key == 's'){
- latheRadius++;
- }
- // ellipse radius
- if (key =='z'){
- if (radius>10){
- radius--;
- }
- }
- else if (key == 'x'){
- radius++;
- }
- // wireframe
- if (key =='w'){
- if (isWireFrame){
- isWireFrame=false;
- }
- else {
- isWireFrame=true;
- }
- }
- // helix
- if (key =='h'){
- if (isHelix){
- isHelix=false;
- }
- else {
- isHelix=true;
- }
- }
-}
-
diff --git a/android/examples/Topics/Geometry/Vertices/Vertices.pde b/android/examples/Topics/Geometry/Vertices/Vertices.pde
deleted file mode 100644
index 4aae8eb519..0000000000
--- a/android/examples/Topics/Geometry/Vertices/Vertices.pde
+++ /dev/null
@@ -1,68 +0,0 @@
-/**
- * Vertices
- * by Simon Greenwold.
- *
- * Draw a cylinder centered on the y-axis, going down
- * from y=0 to y=height. The radius at the top can be
- * different from the radius at the bottom, and the
- * number of sides drawn is variable.
- */
-
-void setup() {
- size(640, 360, P3D);
- orientation(LANDSCAPE);
-}
-
-void draw() {
- background(0);
- lights();
- translate(width / 2, height / 2);
- rotateY(map(mouseX, 0, width, 0, PI));
- rotateZ(map(mouseY, 0, height, 0, -PI));
- noStroke();
- fill(255, 255, 255);
- translate(0, -40, 0);
- drawCylinder(10, 180, 200, 16); // Draw a mix between a cylinder and a cone
- //drawCylinder(70, 70, 120, 64); // Draw a cylinder
- //drawCylinder(0, 180, 200, 4); // Draw a pyramid
-}
-
-void drawCylinder(float topRadius, float bottomRadius, float tall, int sides) {
- float angle = 0;
- float angleIncrement = TWO_PI / sides;
- beginShape(QUAD_STRIP);
- for (int i = 0; i < sides + 1; ++i) {
- vertex(topRadius*cos(angle), 0, topRadius*sin(angle));
- vertex(bottomRadius*cos(angle), tall, bottomRadius*sin(angle));
- angle += angleIncrement;
- }
- endShape();
-
- // If it is not a cone, draw the circular top cap
- if (topRadius != 0) {
- angle = 0;
- beginShape(TRIANGLE_FAN);
-
- // Center point
- vertex(0, 0, 0);
- for (int i = 0; i < sides + 1; i++) {
- vertex(topRadius * cos(angle), 0, topRadius * sin(angle));
- angle += angleIncrement;
- }
- endShape();
- }
-
- // If it is not a cone, draw the circular bottom cap
- if (bottomRadius != 0) {
- angle = 0;
- beginShape(TRIANGLE_FAN);
-
- // Center point
- vertex(0, tall, 0);
- for (int i = 0; i < sides + 1; i++) {
- vertex(bottomRadius * cos(angle), tall, bottomRadius * sin(angle));
- angle += angleIncrement;
- }
- endShape();
- }
-}
diff --git a/android/examples/Topics/Image Processing/Blur/Blur.pde b/android/examples/Topics/Image Processing/Blur/Blur.pde
deleted file mode 100644
index 67e9ef5865..0000000000
--- a/android/examples/Topics/Image Processing/Blur/Blur.pde
+++ /dev/null
@@ -1,43 +0,0 @@
-/**
- * Blur.
- *
- * Bluring half of an image by processing it through a
- * low-pass filter.
- */
-
-float v = 1.0/9.0;
-float[][] kernel = { { v, v, v },
- { v, v, v },
- { v, v, v } };
-
-size(200, 200);
-
-PImage img = loadImage("trees.jpg"); // Load the original image
-image(img, 0, 0); // Displays the image from point (0,0)
-img.loadPixels();
-
-// Create an opaque image of the same size as the original
-PImage edgeImg = createImage(img.width, img.height, RGB);
-
-// Loop through every pixel in the image.
-for (int y = 1; y < img.height-1; y++) { // Skip top and bottom edges
- for (int x = 1; x < img.width-1; x++) { // Skip left and right edges
- float sum = 0; // Kernel sum for this pixel
- for (int ky = -1; ky <= 1; ky++) {
- for (int kx = -1; kx <= 1; kx++) {
- // Calculate the adjacent pixel for this kernel point
- int pos = (y + ky)*img.width + (x + kx);
- // Image is grayscale, red/green/blue are identical
- float val = red(img.pixels[pos]);
- // Multiply adjacent pixels based on the kernel values
- sum += kernel[ky+1][kx+1] * val;
- }
- }
- // For this pixel in the new image, set the gray value
- // based on the sum from the kernel
- edgeImg.pixels[y*img.width + x] = color(sum);
- }
-}
-// State that there are changes to edgeImg.pixels[]
-edgeImg.updatePixels();
-image(edgeImg, 100, 0); // Draw the new image
diff --git a/android/examples/Topics/Image Processing/Blur/data/trees.jpg b/android/examples/Topics/Image Processing/Blur/data/trees.jpg
deleted file mode 100644
index afdcf5045e..0000000000
Binary files a/android/examples/Topics/Image Processing/Blur/data/trees.jpg and /dev/null differ
diff --git a/android/examples/Topics/Image Processing/Brightness/Brightness.pde b/android/examples/Topics/Image Processing/Brightness/Brightness.pde
deleted file mode 100644
index 62cb644ffe..0000000000
--- a/android/examples/Topics/Image Processing/Brightness/Brightness.pde
+++ /dev/null
@@ -1,49 +0,0 @@
-/**
- * Brightness
- * by Daniel Shiffman.
- *
- * Adjusts the brightness of part of the image
- * Pixels closer to the mouse will appear brighter.
- */
-
-PImage img;
-
-void setup() {
- size(200, 200);
- frameRate(30);
- img = loadImage("wires.jpg");
- img.loadPixels();
- // Only need to load the pixels[] array once, because we're only
- // manipulating pixels[] inside draw(), not drawing shapes.
- loadPixels();
-}
-
-void draw() {
- for (int x = 0; x < img.width; x++) {
- for (int y = 0; y < img.height; y++ ) {
- // Calculate the 1D location from a 2D grid
- int loc = x + y*img.width;
- // Get the R,G,B values from image
- float r,g,b;
- r = red (img.pixels[loc]);
- //g = green (img.pixels[loc]);
- //b = blue (img.pixels[loc]);
- // Calculate an amount to change brightness based on proximity to the mouse
- float maxdist = 50;//dist(0,0,width,height);
- float d = dist(x,y,mouseX,mouseY);
- float adjustbrightness = 255*(maxdist-d)/maxdist;
- r += adjustbrightness;
- //g += adjustbrightness;
- //b += adjustbrightness;
- // Constrain RGB to make sure they are within 0-255 color range
- r = constrain(r,0,255);
- //g = constrain(g,0,255);
- //b = constrain(b,0,255);
- // Make a new color and set pixel in the window
- //color c = color(r,g,b);
- color c = color(r);
- pixels[y*width + x] = c;
- }
- }
- updatePixels();
-}
diff --git a/android/examples/Topics/Image Processing/Brightness/data/wires.jpg b/android/examples/Topics/Image Processing/Brightness/data/wires.jpg
deleted file mode 100644
index a0a6e24dd8..0000000000
Binary files a/android/examples/Topics/Image Processing/Brightness/data/wires.jpg and /dev/null differ
diff --git a/android/examples/Topics/Image Processing/Convolution/Convolution.pde b/android/examples/Topics/Image Processing/Convolution/Convolution.pde
deleted file mode 100644
index bb3f7eda54..0000000000
--- a/android/examples/Topics/Image Processing/Convolution/Convolution.pde
+++ /dev/null
@@ -1,74 +0,0 @@
-/**
- * Convolution
- * by Daniel Shiffman.
- *
- * Applies a convolution matrix to a portion of the index.
- * Move mouse to apply filter to different parts of the image.
- */
-
-PImage img;
-int w = 80;
-
-// It's possible to convolve the image with
-// many different matrices
-
- float[][] matrix = { { -1, -1, -1 },
- { -1, 9, -1 },
- { -1, -1, -1 } };
-
-void setup() {
- size(200, 200);
- frameRate(30);
- img = loadImage("end.jpg");
-}
-
-void draw() {
- // We're only going to process a portion of the image
- // so let's set the whole image as the background first
- image(img,0,0);
- // Where is the small rectangle we will process
- int xstart = constrain(mouseX-w/2,0,img.width);
- int ystart = constrain(mouseY-w/2,0,img.height);
- int xend = constrain(mouseX+w/2,0,img.width);
- int yend = constrain(mouseY+w/2,0,img.height);
- int matrixsize = 3;
- loadPixels();
- // Begin our loop for every pixel
- for (int x = xstart; x < xend; x++) {
- for (int y = ystart; y < yend; y++ ) {
- color c = convolution(x,y,matrix,matrixsize,img);
- int loc = x + y*img.width;
- pixels[loc] = c;
- }
- }
- updatePixels();
-}
-
-color convolution(int x, int y, float[][] matrix,int matrixsize, PImage img)
-{
- float rtotal = 0.0;
- float gtotal = 0.0;
- float btotal = 0.0;
- int offset = matrixsize / 2;
- for (int i = 0; i < matrixsize; i++){
- for (int j= 0; j < matrixsize; j++){
- // What pixel are we testing
- int xloc = x+i-offset;
- int yloc = y+j-offset;
- int loc = xloc + img.width*yloc;
- // Make sure we haven't walked off our image, we could do better here
- loc = constrain(loc,0,img.pixels.length-1);
- // Calculate the convolution
- rtotal += (red(img.pixels[loc]) * matrix[i][j]);
- gtotal += (green(img.pixels[loc]) * matrix[i][j]);
- btotal += (blue(img.pixels[loc]) * matrix[i][j]);
- }
- }
- // Make sure RGB is within range
- rtotal = constrain(rtotal,0,255);
- gtotal = constrain(gtotal,0,255);
- btotal = constrain(btotal,0,255);
- // Return the resulting color
- return color(rtotal,gtotal,btotal);
-}
-
diff --git a/android/examples/Topics/Image Processing/Convolution/data/end.jpg b/android/examples/Topics/Image Processing/Convolution/data/end.jpg
deleted file mode 100644
index 32935763af..0000000000
Binary files a/android/examples/Topics/Image Processing/Convolution/data/end.jpg and /dev/null differ
diff --git a/android/examples/Topics/Image Processing/Convolution/data/sunflower.jpg b/android/examples/Topics/Image Processing/Convolution/data/sunflower.jpg
deleted file mode 100644
index 88398d1883..0000000000
Binary files a/android/examples/Topics/Image Processing/Convolution/data/sunflower.jpg and /dev/null differ
diff --git a/android/examples/Topics/Image Processing/EdgeDetection/EdgeDetection.pde b/android/examples/Topics/Image Processing/EdgeDetection/EdgeDetection.pde
deleted file mode 100644
index 1f1f24a439..0000000000
--- a/android/examples/Topics/Image Processing/EdgeDetection/EdgeDetection.pde
+++ /dev/null
@@ -1,39 +0,0 @@
-/**
- * Edge Detection.
- *
- * Exposing areas of contrast within an image
- * by processing it through a high-pass filter.
- */
-
-float[][] kernel = { { -1, -1, -1 },
- { -1, 9, -1 },
- { -1, -1, -1 } };
-
-size(200, 200);
-PImage img = loadImage("house.jpg"); // Load the original image
-image(img, 0, 0); // Displays the image from point (0,0)
-img.loadPixels();
-// Create an opaque image of the same size as the original
-PImage edgeImg = createImage(img.width, img.height, RGB);
-// Loop through every pixel in the image.
-for (int y = 1; y < img.height-1; y++) { // Skip top and bottom edges
- for (int x = 1; x < img.width-1; x++) { // Skip left and right edges
- float sum = 0; // Kernel sum for this pixel
- for (int ky = -1; ky <= 1; ky++) {
- for (int kx = -1; kx <= 1; kx++) {
- // Calculate the adjacent pixel for this kernel point
- int pos = (y + ky)*img.width + (x + kx);
- // Image is grayscale, red/green/blue are identical
- float val = red(img.pixels[pos]);
- // Multiply adjacent pixels based on the kernel values
- sum += kernel[ky+1][kx+1] * val;
- }
- }
- // For this pixel in the new image, set the gray value
- // based on the sum from the kernel
- edgeImg.pixels[y*img.width + x] = color(sum);
- }
-}
-// State that there are changes to edgeImg.pixels[]
-edgeImg.updatePixels();
-image(edgeImg, 100, 0); // Draw the new image
diff --git a/android/examples/Topics/Image Processing/EdgeDetection/data/house.jpg b/android/examples/Topics/Image Processing/EdgeDetection/data/house.jpg
deleted file mode 100644
index c6d311fd18..0000000000
Binary files a/android/examples/Topics/Image Processing/EdgeDetection/data/house.jpg and /dev/null differ
diff --git a/android/examples/Topics/Image Processing/Histogram/Histogram.pde b/android/examples/Topics/Image Processing/Histogram/Histogram.pde
deleted file mode 100644
index f5f7d49eb3..0000000000
--- a/android/examples/Topics/Image Processing/Histogram/Histogram.pde
+++ /dev/null
@@ -1,42 +0,0 @@
-/**
- * Histogram.
- *
- * Calculates the histogram of an image.
- * A histogram is the frequency distribution
- * of the gray levels with the number of pure black values
- * displayed on the left and number of pure white values on the right.
- *
- * Updated 28 February, 2010.
- * Note that this sketch will behave differently on Android,
- * since most images will no longer be full 24-bit color.
- */
-
-size(200, 200);
-
-// Load an image from the data directory
-// Load a different image by modifying the comments
-PImage img = loadImage("cdi01_g.jpg");
-image(img, 0, 0);
-int[] hist = new int[256];
-
-// Calculate the histogram
-for (int i = 0; i < img.width; i++) {
- for (int j = 0; j < img.height; j++) {
- int bright = int(brightness(get(i, j)));
- hist[bright]++;
- }
-}
-
-// Find the largest value in the histogram
-int histMax = max(hist);
-
-stroke(255);
-// Draw half of the histogram (skip every second value)
-for (int i = 0; i < img.width; i += 2) {
- // Map i (from 0..img.width-1) to a location in the histogram (0..255)
- int which = int(map(i, 0, img.width, 0, 255));
- // Convert the histogram value to a location between
- // the bottom and the top of the picture
- int y = int(map(hist[which], 0, histMax, img.height, 0));
- line(i, img.height, i, y);
-}
diff --git a/android/examples/Topics/Image Processing/Histogram/data/cdi01_g.jpg b/android/examples/Topics/Image Processing/Histogram/data/cdi01_g.jpg
deleted file mode 100644
index 78ce58f4ce..0000000000
Binary files a/android/examples/Topics/Image Processing/Histogram/data/cdi01_g.jpg and /dev/null differ
diff --git a/android/examples/Topics/Image Processing/Histogram/data/ystone08.jpg b/android/examples/Topics/Image Processing/Histogram/data/ystone08.jpg
deleted file mode 100644
index 5428ada881..0000000000
Binary files a/android/examples/Topics/Image Processing/Histogram/data/ystone08.jpg and /dev/null differ
diff --git a/android/examples/Topics/Image Processing/LinearImage/LinearImage.pde b/android/examples/Topics/Image Processing/LinearImage/LinearImage.pde
deleted file mode 100644
index b7c52de5e8..0000000000
--- a/android/examples/Topics/Image Processing/LinearImage/LinearImage.pde
+++ /dev/null
@@ -1,43 +0,0 @@
-/**
- * Linear Image.
- *
- * Click and drag mouse up and down to control the signal.
- * Press and hold any key to watch the scanning.
- *
- * Updated 28 February 2010.
- */
-
-PImage img;
-int direction = 1;
-
-float signal;
-
-void setup() {
- size(200, 200);
- stroke(255);
- img = loadImage("florence03.jpg");
- img.loadPixels();
- loadPixels();
-}
-
-void draw() {
- if (signal > img.height-1 || signal < 0) {
- direction = direction * -1;
- }
- if (mousePressed) {
- signal = abs(mouseY % img.height);
- } else {
- signal += (0.3*direction);
- }
-
- if (keyPressed) {
- set(0, 0, img);
- line(0, signal, img.width, signal);
- } else {
- int signalOffset = int(signal)*img.width;
- for (int y = 0; y < img.height; y++) {
- arrayCopy(img.pixels, signalOffset, pixels, y*width, img.width);
- }
- updatePixels();
- }
-}
diff --git a/android/examples/Topics/Image Processing/LinearImage/data/florence03.jpg b/android/examples/Topics/Image Processing/LinearImage/data/florence03.jpg
deleted file mode 100644
index ec33b266a5..0000000000
Binary files a/android/examples/Topics/Image Processing/LinearImage/data/florence03.jpg and /dev/null differ
diff --git a/android/examples/Topics/Image Processing/PixelArray/PixelArray.pde b/android/examples/Topics/Image Processing/PixelArray/PixelArray.pde
deleted file mode 100644
index cd133102a4..0000000000
--- a/android/examples/Topics/Image Processing/PixelArray/PixelArray.pde
+++ /dev/null
@@ -1,48 +0,0 @@
-/**
- * Pixel Array.
- *
- * Click and drag the mouse up and down to control the signal and
- * press and hold any key to see the current pixel being read.
- * This program sequentially reads the color of every pixel of an image
- * and displays this color to fill the window.
- *
- * Updated 28 February 2010.
- */
-
-PImage img;
-int direction = 1;
-float signal;
-
-void setup() {
- size(200, 200);
- noFill();
- stroke(255);
- frameRate(30);
- img = loadImage("ystone08.jpg");
-}
-
-void draw() {
- if (signal > img.width*img.height-1 || signal < 0) {
- direction = direction * -1;
- }
-
- if (mousePressed) {
- int mx = constrain(mouseX, 0, img.width-1);
- int my = constrain(mouseY, 0, img.height-1);
- signal = my*img.width + mx;
- } else {
- signal += 0.33*direction;
- }
-
- int sx = int(signal) % img.width;
- int sy = int(signal) / img.width;
-
- if (keyPressed) {
- set(0, 0, img); // fast way to draw an image
- point(sx, sy);
- rect(sx - 5, sy - 5, 10, 10);
- } else {
- color c = img.get(sx, sy);
- background(c);
- }
-}
diff --git a/android/examples/Topics/Image Processing/PixelArray/data/ystone08.jpg b/android/examples/Topics/Image Processing/PixelArray/data/ystone08.jpg
deleted file mode 100644
index 5428ada881..0000000000
Binary files a/android/examples/Topics/Image Processing/PixelArray/data/ystone08.jpg and /dev/null differ
diff --git a/android/examples/Topics/Interaction/Follow1/Follow1.pde b/android/examples/Topics/Interaction/Follow1/Follow1.pde
deleted file mode 100644
index f817d0f648..0000000000
--- a/android/examples/Topics/Interaction/Follow1/Follow1.pde
+++ /dev/null
@@ -1,39 +0,0 @@
-/**
- * Follow 1.
- * Based on code from Keith Peters (www.bit-101.com).
- *
- * A line segment is pushed and pulled by the cursor.
- */
-
-float x = 100;
-float y = 100;
-float angle1 = 0.0;
-float segLength = 50;
-
-void setup() {
- size(200, 200);
- smooth();
- strokeWeight(20.0);
- stroke(0, 100);
-}
-
-void draw() {
- background(226);
-
- float dx = mouseX - x;
- float dy = mouseY - y;
- angle1 = atan2(dy, dx);
- x = mouseX - (cos(angle1) * segLength);
- y = mouseY - (sin(angle1) * segLength);
-
- segment(x, y, angle1);
- ellipse(x, y, 20, 20);
-}
-
-void segment(float x, float y, float a) {
- pushMatrix();
- translate(x, y);
- rotate(a);
- line(0, 0, segLength, 0);
- popMatrix();
-}
diff --git a/android/examples/Topics/Interaction/Follow2/Follow2.pde b/android/examples/Topics/Interaction/Follow2/Follow2.pde
deleted file mode 100644
index a0a6f8516a..0000000000
--- a/android/examples/Topics/Interaction/Follow2/Follow2.pde
+++ /dev/null
@@ -1,42 +0,0 @@
-/**
- * Follow 2.
- * Based on code from Keith Peters (www.bit-101.com).
- *
- * A two-segmented arm follows the cursor position. The relative
- * angle between the segments is calculated with atan2() and the
- * position calculated with sin() and cos().
- */
-
-float[] x = new float[2];
-float[] y = new float[2];
-float segLength = 50;
-
-void setup() {
- size(200, 200);
- smooth();
- strokeWeight(20.0);
- stroke(0, 100);
-}
-
-void draw() {
- background(226);
- dragSegment(0, mouseX, mouseY);
- dragSegment(1, x[0], y[0]);
-}
-
-void dragSegment(int i, float xin, float yin) {
- float dx = xin - x[i];
- float dy = yin - y[i];
- float angle = atan2(dy, dx);
- x[i] = xin - cos(angle) * segLength;
- y[i] = yin - sin(angle) * segLength;
- segment(x[i], y[i], angle);
-}
-
-void segment(float x, float y, float a) {
- pushMatrix();
- translate(x, y);
- rotate(a);
- line(0, 0, segLength, 0);
- popMatrix();
-}
diff --git a/android/examples/Topics/Interaction/Follow3/Follow3.pde b/android/examples/Topics/Interaction/Follow3/Follow3.pde
deleted file mode 100644
index 1a004ccc33..0000000000
--- a/android/examples/Topics/Interaction/Follow3/Follow3.pde
+++ /dev/null
@@ -1,44 +0,0 @@
-/**
- * Follow 3.
- * Based on code from Keith Peters (www.bit-101.com).
- *
- * A segmented line follows the mouse. The relative angle from
- * each segment to the next is calculated with atan2() and the
- * position of the next is calculated with sin() and cos().
- */
-
-float[] x = new float[20];
-float[] y = new float[20];
-float segLength = 9;
-
-void setup() {
- size(200, 200);
- smooth();
- strokeWeight(5);
- stroke(0, 100);
-}
-
-void draw() {
- background(226);
- dragSegment(0, mouseX, mouseY);
- for(int i=0; i=1; i--) {
- positionSegment(i, i-1);
- }
- for(int i=0; i width-25 || ballX < 25) {
- ballXDirection *= -1;
- }
- if(ballY > height-25 || ballY < 25) {
- ballYDirection *= -1;
- }
- ellipse(ballX, ballY, 30, 30);
-
- reachSegment(0, ballX, ballY);
- for(int i=1; i=1; i--) {
- positionSegment(i, i-1);
- }
- for(int i=0; i width-size || xpos < 0) {
- xdirection *= -1;
- }
- if (ypos > height-size || ypos < 0) {
- ydirection *= -1;
- }
-
- // Draw the shape
- ellipse(xpos+size/2, ypos+size/2, size, size);
-}
diff --git a/android/examples/Topics/Motion/BouncyBubbles/BouncyBubbles.pde b/android/examples/Topics/Motion/BouncyBubbles/BouncyBubbles.pde
deleted file mode 100644
index e9dc24f289..0000000000
--- a/android/examples/Topics/Motion/BouncyBubbles/BouncyBubbles.pde
+++ /dev/null
@@ -1,97 +0,0 @@
-/**
- * Bouncy Bubbles.
- * Based on code from Keith Peters (www.bit-101.com).
- *
- * Multiple-object collision.
- */
-
-
-int numBalls = 12;
-float spring = 0.05;
-float gravity = 0.03;
-float friction = -0.9;
-Ball[] balls = new Ball[numBalls];
-
-void setup()
-{
- size(640, 200);
- noStroke();
- smooth();
- for (int i = 0; i < numBalls; i++) {
- balls[i] = new Ball(random(width), random(height), random(20, 40), i, balls);
- }
-}
-
-void draw()
-{
- background(0);
- for (int i = 0; i < numBalls; i++) {
- balls[i].collide();
- balls[i].move();
- balls[i].display();
- }
-}
-
-class Ball {
- float x, y;
- float diameter;
- float vx = 0;
- float vy = 0;
- int id;
- Ball[] others;
-
- Ball(float xin, float yin, float din, int idin, Ball[] oin) {
- x = xin;
- y = yin;
- diameter = din;
- id = idin;
- others = oin;
- }
-
- void collide() {
- for (int i = id + 1; i < numBalls; i++) {
- float dx = others[i].x - x;
- float dy = others[i].y - y;
- float distance = sqrt(dx*dx + dy*dy);
- float minDist = others[i].diameter/2 + diameter/2;
- if (distance < minDist) {
- float angle = atan2(dy, dx);
- float targetX = x + cos(angle) * minDist;
- float targetY = y + sin(angle) * minDist;
- float ax = (targetX - others[i].x) * spring;
- float ay = (targetY - others[i].y) * spring;
- vx -= ax;
- vy -= ay;
- others[i].vx += ax;
- others[i].vy += ay;
- }
- }
- }
-
- void move() {
- vy += gravity;
- x += vx;
- y += vy;
- if (x + diameter/2 > width) {
- x = width - diameter/2;
- vx *= friction;
- }
- else if (x - diameter/2 < 0) {
- x = diameter/2;
- vx *= friction;
- }
- if (y + diameter/2 > height) {
- y = height - diameter/2;
- vy *= friction;
- }
- else if (y - diameter/2 < 0) {
- y = diameter/2;
- vy *= friction;
- }
- }
-
- void display() {
- fill(255, 204);
- ellipse(x, y, diameter, diameter);
- }
-}
diff --git a/android/examples/Topics/Motion/Brownian/Brownian.pde b/android/examples/Topics/Motion/Brownian/Brownian.pde
deleted file mode 100644
index 7f8daf9789..0000000000
--- a/android/examples/Topics/Motion/Brownian/Brownian.pde
+++ /dev/null
@@ -1,48 +0,0 @@
-/**
- * Brownian motion.
- *
- * Recording random movement as a continuous line.
- */
-
-int num = 2000;
-int range = 6;
-
-float[] ax = new float[num];
-float[] ay = new float[num];
-
-
-void setup()
-{
- size(640, 360);
- for(int i = 0; i < num; i++) {
- ax[i] = width/2;
- ay[i] = height/2;
- }
- frameRate(30);
-}
-
-void draw()
-{
- background(51);
-
- // Shift all elements 1 place to the left
- for(int i = 1; i < num; i++) {
- ax[i-1] = ax[i];
- ay[i-1] = ay[i];
- }
-
- // Put a new value at the end of the array
- ax[num-1] += random(-range, range);
- ay[num-1] += random(-range, range);
-
- // Constrain all points to the screen
- ax[num-1] = constrain(ax[num-1], 0, width);
- ay[num-1] = constrain(ay[num-1], 0, height);
-
- // Draw a line connecting the points
- for(int i=1; i width-ball.r) {
- ball.x = width-ball.r;
- vel.x *= -1;
- }
- else if (ball.x < ball.r) {
- ball.x = ball.r;
- vel.x *= -1;
- }
- else if (ball.y > height-ball.r) {
- ball.y = height-ball.r;
- vel.y *= -1;
- }
- else if (ball.y < ball.r) {
- ball.y = ball.r;
- vel.y *= -1;
- }
-}
-
diff --git a/android/examples/Topics/Motion/Collision/Collision.pde b/android/examples/Topics/Motion/Collision/Collision.pde
deleted file mode 100644
index 7d5b88c2b1..0000000000
--- a/android/examples/Topics/Motion/Collision/Collision.pde
+++ /dev/null
@@ -1,85 +0,0 @@
-/**
- * Collision (Pong).
- *
- * Move the mouse up and down to move the paddle.
- */
-
-// Global variables for the ball
-float ball_x;
-float ball_y;
-float ball_dir = 1;
-float ball_size = 15; // Radius
-float dy = 0; // Direction
-
-// Global variables for the paddle
-int paddle_width = 10;
-int paddle_height = 60;
-
-int dist_wall = 15;
-
-void setup()
-{
- size(640, 360);
- rectMode(RADIUS);
- ellipseMode(RADIUS);
- noStroke();
- smooth();
- ball_y = height/2;
- ball_x = 1;
-}
-
-void draw()
-{
- background(51);
-
- ball_x += ball_dir * 1.0;
- ball_y += dy;
- if(ball_x > width+ball_size) {
- ball_x = -width/2 - ball_size;
- ball_y = random(0, height);
- dy = 0;
- }
-
- // Constrain paddle to screen
- float paddle_y = constrain(mouseY, paddle_height, height-paddle_height);
-
- // Test to see if the ball is touching the paddle
- float py = width-dist_wall-paddle_width-ball_size;
- if(ball_x == py
- && ball_y > paddle_y - paddle_height - ball_size
- && ball_y < paddle_y + paddle_height + ball_size) {
- ball_dir *= -1;
- if(mouseY != pmouseY) {
- dy = (mouseY-pmouseY)/2.0;
- if(dy > 5) { dy = 5; }
- if(dy < -5) { dy = -5; }
- }
- }
-
- // If ball hits paddle or back wall, reverse direction
- if(ball_x < ball_size && ball_dir == -1) {
- ball_dir *= -1;
- }
-
- // If the ball is touching top or bottom edge, reverse direction
- if(ball_y > height-ball_size) {
- dy = dy * -1;
- }
- if(ball_y < ball_size) {
- dy = dy * -1;
- }
-
- // Draw ball
- fill(255);
- ellipse(ball_x, ball_y, ball_size, ball_size);
-
- // Draw the paddle
- fill(153);
- rect(width-dist_wall, paddle_y, paddle_width, paddle_height);
-}
-
-
-
-
-
-
diff --git a/android/examples/Topics/Motion/Linear/Linear.pde b/android/examples/Topics/Motion/Linear/Linear.pde
deleted file mode 100644
index 246b9b05eb..0000000000
--- a/android/examples/Topics/Motion/Linear/Linear.pde
+++ /dev/null
@@ -1,26 +0,0 @@
-/**
- * Linear Motion.
- *
- * Changing a variable to create a moving line.
- * When the line moves off the edge of the window,
- * the variable is set to 0, which places the line
- * back at the bottom of the screen.
- */
-
-float a = 100;
-
-void setup()
-{
- size(640, 200);
- stroke(255);
-}
-
-void draw()
-{
- background(51);
- a = a - 0.5;
- if (a < 0) {
- a = height;
- }
- line(0, a, width, a);
-}
diff --git a/android/examples/Topics/Motion/MovingOnCurves/MovingOnCurves.pde b/android/examples/Topics/Motion/MovingOnCurves/MovingOnCurves.pde
deleted file mode 100644
index 051d6ba480..0000000000
--- a/android/examples/Topics/Motion/MovingOnCurves/MovingOnCurves.pde
+++ /dev/null
@@ -1,50 +0,0 @@
-/**
- * Moving On Curves.
- *
- * In this example, the circles moves along the curve y = x^4.
- * Click the mouse to have it move to a new position.
- */
-
-float beginX = 20.0; // Initial x-coordinate
-float beginY = 10.0; // Initial y-coordinate
-float endX = 570.0; // Final x-coordinate
-float endY = 320.0; // Final y-coordinate
-float distX; // X-axis distance to move
-float distY; // Y-axis distance to move
-float exponent = 4; // Determines the curve
-float x = 0.0; // Current x-coordinate
-float y = 0.0; // Current y-coordinate
-float step = 0.01; // Size of each step along the path
-float pct = 0.0; // Percentage traveled (0.0 to 1.0)
-
-void setup()
-{
- size(640, 360);
- noStroke();
- smooth();
- distX = endX - beginX;
- distY = endY - beginY;
-}
-
-void draw()
-{
- fill(0, 2);
- rect(0, 0, width, height);
- pct += step;
- if (pct < 1.0) {
- x = beginX + (pct * distX);
- y = beginY + (pow(pct, exponent) * distY);
- }
- fill(255);
- ellipse(x, y, 20, 20);
-}
-
-void mousePressed() {
- pct = 0.0;
- beginX = x;
- beginY = y;
- endX = mouseX;
- endY = mouseY;
- distX = endX - beginX;
- distY = endY - beginY;
-}
diff --git a/android/examples/Topics/Motion/Puff/Puff.pde b/android/examples/Topics/Motion/Puff/Puff.pde
deleted file mode 100644
index 49256b8a6d..0000000000
--- a/android/examples/Topics/Motion/Puff/Puff.pde
+++ /dev/null
@@ -1,91 +0,0 @@
-/**
- * Puff
- * by Ira Greenberg.
- *
- * Series of ellipses simulating a multi-segmented
- * organism, utilizing a follow the leader algorithm.
- * Collision detection occurs on the organism's head,
- * controlling overall direction, and on the individual
- * body segments, controlling body shape and jitter.
- */
-
-// For puff head
-float headX;
-float headY;
-float speedX = .7;
-float speedY = .9;
-
-// For puff body
-int cells = 1000;
-float[]px= new float[cells];
-float[]py= new float[cells];
-float[]radiiX = new float[cells];
-float[]radiiY = new float[cells];
-float[]angle = new float[cells];
-float[]frequency = new float[cells];
-float[]cellRadius = new float[cells];
-
-void setup(){
-
- size(640, 360);
-
- // Begin in the center
- headX = width/2;
- headY = height/2;
-
- // Fill body arrays
- for (int i=0; i< cells; i++){
- radiiX[i] = random(-7, 7);
- radiiY[i] = random(-4, 4);
- frequency[i]= random(-9, 9);
- cellRadius[i] = random(16, 30);
- }
- frameRate(30);
-}
-
-void draw(){
- background(0);
- noStroke();
- fill(255, 255, 255, 5);
-
- // Follow the leader
- for (int i =0; i< cells; i++){
- if (i==0){
- px[i] = headX+sin(radians(angle[i]))*radiiX[i];
- py[i] = headY+cos(radians(angle[i]))*radiiY[i];
- }
- else{
- px[i] = px[i-1]+cos(radians(angle[i]))*radiiX[i];
- py[i] = py[i-1]+sin(radians(angle[i]))*radiiY[i];
-
- // Check collision of body
- if (px[i] >= width-cellRadius[i]/2 || px[i] <= cellRadius[i]/2){
- radiiX[i]*=-1;
- cellRadius[i] = random(1, 40);
- frequency[i]= random(-13, 13);
- }
- if (py[i] >= height-cellRadius[i]/2 || py[i] <= cellRadius[i]/2){
- radiiY[i]*=-1;
- cellRadius[i] = random(1, 40);
- frequency[i]= random(-9, 9);
- }
- }
- // Draw puff
- ellipse(px[i], py[i], cellRadius[i], cellRadius[i]);
- // Set speed of body
- angle[i]+=frequency[i];
- }
-
- // Set velocity of head
- headX+=speedX;
- headY+=speedY;
-
- // Check boundary collision of head
- if (headX >= width-cellRadius[0]/2 || headX <=cellRadius[0]/2){
- speedX*=-1;
- }
- if (headY >= height-cellRadius[0]/2 || headY <= cellRadius[0]/2){
- speedY*=-1;
- }
-}
-
diff --git a/android/examples/Topics/Motion/Reflection1/Reflection1.pde b/android/examples/Topics/Motion/Reflection1/Reflection1.pde
deleted file mode 100644
index 9f8434c932..0000000000
--- a/android/examples/Topics/Motion/Reflection1/Reflection1.pde
+++ /dev/null
@@ -1,129 +0,0 @@
- /**
- * Non-orthogonal Reflection
- * by Ira Greenberg.
- *
- * Based on the equation (R = 2N(N*L)-L) where R is the
- * reflection vector, N is the normal, and L is the incident
- * vector.
- */
-
-float baseX1, baseY1, baseX2, baseY2;
-float baseLength;
-float[] xCoords, yCoords;
-float ellipseX, ellipseY, ellipseRadius = 6;
-float directionX, directionY;
-float ellipseSpeed = 3.5;
-float velocityX, velocityY;
-
-void setup(){
- size(640, 240);
- frameRate(30);
- fill(128);
- smooth();
- baseX1 = 0;
- baseY1 = height-150;
- baseX2 = width;
- baseY2 = height;
-
- // start ellipse at middle top of screen
- ellipseX = width/2;
-
- // calculate initial random direction
- directionX = random(0.1, 0.99);
- directionY = random(0.1, 0.99);
-
- // normalize direction vector
- float directionVectLength = sqrt(directionX*directionX +
- directionY*directionY);
- directionX /= directionVectLength;
- directionY /= directionVectLength;
-}
-
-void draw(){
- // draw background
- fill(0, 12);
- noStroke();
- rect(0, 0, width, height);
-
- // calculate length of base top
- baseLength = dist(baseX1, baseY1, baseX2, baseY2);
- xCoords = new float[ceil(baseLength)];
- yCoords = new float[ceil(baseLength)];
-
- // fill base top coordinate array
- for (int i=0; i width-ellipseRadius){
- ellipseX = width-ellipseRadius;
- directionX *= -1;
- }
- // left
- if (ellipseX < ellipseRadius){
- ellipseX = ellipseRadius;
- directionX *= -1;
- }
- // top
- if (ellipseY < ellipseRadius){
- ellipseY = ellipseRadius;
- directionY *= -1;
- // randomize base top
- baseY1 = random(height-100, height);
- baseY2 = random(height-100, height);
- }
-}
-
diff --git a/android/examples/Topics/Motion/Reflection2/Ground.pde b/android/examples/Topics/Motion/Reflection2/Ground.pde
deleted file mode 100644
index 55d8497e29..0000000000
--- a/android/examples/Topics/Motion/Reflection2/Ground.pde
+++ /dev/null
@@ -1,20 +0,0 @@
-class Ground {
- float x1, y1, x2, y2;
- float x, y, len, rot;
-
- // Default constructor
- Ground(){
- }
-
- // Constructor
- Ground(float x1, float y1, float x2, float y2) {
- this.x1 = x1;
- this.y1 = y1;
- this.x2 = x2;
- this.y2 = y2;
- x = (x1+x2)/2;
- y = (y1+y2)/2;
- len = dist(x1, y1, x2, y2);
- rot = atan2((y2-y1), (x2-x1));
- }
-}
diff --git a/android/examples/Topics/Motion/Reflection2/Orb.pde b/android/examples/Topics/Motion/Reflection2/Orb.pde
deleted file mode 100644
index 7af7ed91b1..0000000000
--- a/android/examples/Topics/Motion/Reflection2/Orb.pde
+++ /dev/null
@@ -1,14 +0,0 @@
-class Orb{
- float x, y, r;
-
- // Default constructor
- Orb() {
- }
-
- Orb(float x, float y, float r) {
- this.x = x;
- this.y = y;
- this.r = r;
- }
-}
-
diff --git a/android/examples/Topics/Motion/Reflection2/Reflection2.pde b/android/examples/Topics/Motion/Reflection2/Reflection2.pde
deleted file mode 100644
index 05f135b7f7..0000000000
--- a/android/examples/Topics/Motion/Reflection2/Reflection2.pde
+++ /dev/null
@@ -1,128 +0,0 @@
-/**
- * Non-orthogonal Collision with Multiple Ground Segments
- * by Ira Greenberg.
- *
- * Based on Keith Peter's Solution in
- * Foundation Actionscript Animation: Making Things Move!
- */
-
-Orb orb;
-PVector velocity;
-float gravity = .05, damping = 0.8;
-int segments = 40;
-Ground[] ground = new Ground[segments];
-float[] peakHeights = new float[segments+1];
-
-void setup(){
- size(640, 200);
- smooth();
- orb = new Orb(50, 50, 3);
- velocity = new PVector(.5, 0);
-
- // Calculate ground peak heights
- for (int i=0; i width-orb.r){
- orb.x = width-orb.r;
- velocity.x *= -1;
- velocity.x *= damping;
- }
- else if (orb.x < orb.r){
- orb.x = orb.r;
- velocity.x *= -1;
- velocity.x *= damping;
- }
-}
-
-
-void checkGroundCollision(Ground groundSegment) {
-
- // Get difference between orb and ground
- float deltaX = orb.x - groundSegment.x;
- float deltaY = orb.y - groundSegment.y;
-
- // Precalculate trig values
- float cosine = cos(groundSegment.rot);
- float sine = sin(groundSegment.rot);
-
- /* Rotate ground and velocity to allow
- orthogonal collision calculations */
- float groundXTemp = cosine * deltaX + sine * deltaY;
- float groundYTemp = cosine * deltaY - sine * deltaX;
- float velocityXTemp = cosine * velocity.x + sine * velocity.y;
- float velocityYTemp = cosine * velocity.y - sine * velocity.x;
-
- /* Ground collision - check for surface
- collision and also that orb is within
- left/rights bounds of ground segment */
- if (groundYTemp > -orb.r &&
- orb.x > groundSegment.x1 &&
- orb.x < groundSegment.x2 ){
- // keep orb from going into ground
- groundYTemp = -orb.r;
- // bounce and slow down orb
- velocityYTemp *= -1.0;
- velocityYTemp *= damping;
- }
-
- // Reset ground, velocity and orb
- deltaX = cosine * groundXTemp - sine * groundYTemp;
- deltaY = cosine * groundYTemp + sine * groundXTemp;
- velocity.x = cosine * velocityXTemp - sine * velocityYTemp;
- velocity.y = cosine * velocityYTemp + sine * velocityXTemp;
- orb.x = groundSegment.x + deltaX;
- orb.y = groundSegment.y + deltaY;
-}
-
-
-
-
diff --git a/android/examples/Topics/Shaders/BlurFilter/BlurFilter.pde b/android/examples/Topics/Shaders/BlurFilter/BlurFilter.pde
deleted file mode 100644
index 67b2e6ca02..0000000000
--- a/android/examples/Topics/Shaders/BlurFilter/BlurFilter.pde
+++ /dev/null
@@ -1,26 +0,0 @@
-/**
- * Blur Filter
- *
- * Change the default shader to apply a simple, custom blur filter.
- *
- * Press the mouse to switch between the custom and default shader.
- */
-
-PShader blur;
-
-void setup() {
- size(640, 360, P2D);
- orientation(LANDSCAPE);
- blur = loadShader("blur.glsl");
- stroke(255, 0, 0);
- rectMode(CENTER);
-}
-
-void draw() {
- filter(blur);
- rect(mouseX, mouseY, 150, 150);
- ellipse(mouseX, mouseY, 100, 100);
-}
-
-
-
diff --git a/android/examples/Topics/Shaders/BlurFilter/data/blur.glsl b/android/examples/Topics/Shaders/BlurFilter/data/blur.glsl
deleted file mode 100644
index 2aa9d6079d..0000000000
--- a/android/examples/Topics/Shaders/BlurFilter/data/blur.glsl
+++ /dev/null
@@ -1,42 +0,0 @@
-#ifdef GL_ES
-precision mediump float;
-precision mediump int;
-#endif
-
-#define PROCESSING_TEXTURE_SHADER
-
-uniform sampler2D texture;
-uniform vec2 texOffset;
-
-varying vec4 vertColor;
-varying vec4 vertTexCoord;
-
-void main(void) {
- // Grouping texcoord variables in order to make it work in the GMA 950. See post #13
- // in this thread:
- // http://www.idevgames.com/forums/thread-3467.html
- vec2 tc0 = vertTexCoord.st + vec2(-texOffset.s, -texOffset.t);
- vec2 tc1 = vertTexCoord.st + vec2( 0.0, -texOffset.t);
- vec2 tc2 = vertTexCoord.st + vec2(+texOffset.s, -texOffset.t);
- vec2 tc3 = vertTexCoord.st + vec2(-texOffset.s, 0.0);
- vec2 tc4 = vertTexCoord.st + vec2( 0.0, 0.0);
- vec2 tc5 = vertTexCoord.st + vec2(+texOffset.s, 0.0);
- vec2 tc6 = vertTexCoord.st + vec2(-texOffset.s, +texOffset.t);
- vec2 tc7 = vertTexCoord.st + vec2( 0.0, +texOffset.t);
- vec2 tc8 = vertTexCoord.st + vec2(+texOffset.s, +texOffset.t);
-
- vec4 col0 = texture2D(texture, tc0);
- vec4 col1 = texture2D(texture, tc1);
- vec4 col2 = texture2D(texture, tc2);
- vec4 col3 = texture2D(texture, tc3);
- vec4 col4 = texture2D(texture, tc4);
- vec4 col5 = texture2D(texture, tc5);
- vec4 col6 = texture2D(texture, tc6);
- vec4 col7 = texture2D(texture, tc7);
- vec4 col8 = texture2D(texture, tc8);
-
- vec4 sum = (1.0 * col0 + 2.0 * col1 + 1.0 * col2 +
- 2.0 * col3 + 4.0 * col4 + 2.0 * col4 +
- 1.0 * col5 + 2.0 * col6 + 1.0 * col7) / 16.0;
- gl_FragColor = vec4(sum.rgb, 1.0) * vertColor;
-}
diff --git a/android/examples/Topics/Shaders/EdgeDetect/EdgeDetect.pde b/android/examples/Topics/Shaders/EdgeDetect/EdgeDetect.pde
deleted file mode 100644
index aa3bd2695e..0000000000
--- a/android/examples/Topics/Shaders/EdgeDetect/EdgeDetect.pde
+++ /dev/null
@@ -1,32 +0,0 @@
-/**
- * Edge Detection
- *
- * Change the default shader to apply a simple, custom edge detection filter.
- *
- * Press the mouse to switch between the custom and default shader.
- */
-
-PShader edges;
-PImage img;
-boolean enabled = true;
-
-void setup() {
- size(640, 360, P2D);
- orientation(LANDSCAPE);
- img = loadImage("leaves.jpg");
- edges = loadShader("edges.glsl");
-}
-
-void draw() {
- if (enabled == true) {
- shader(edges);
- }
- image(img, 0, 0);
-}
-
-void mousePressed() {
- enabled = !enabled;
- if (!enabled == true) {
- resetShader();
- }
-}
diff --git a/android/examples/Topics/Shaders/EdgeDetect/data/edges.glsl b/android/examples/Topics/Shaders/EdgeDetect/data/edges.glsl
deleted file mode 100644
index 62109e3e3d..0000000000
--- a/android/examples/Topics/Shaders/EdgeDetect/data/edges.glsl
+++ /dev/null
@@ -1,40 +0,0 @@
-#ifdef GL_ES
-precision mediump float;
-precision mediump int;
-#endif
-
-#define PROCESSING_TEXTURE_SHADER
-
-uniform sampler2D texture;
-uniform vec2 texOffset;
-
-varying vec4 vertColor;
-varying vec4 vertTexCoord;
-
-void main(void) {
- // Grouping texcoord variables in order to make it work in the GMA 950. See post #13
- // in this thread:
- // http://www.idevgames.com/forums/thread-3467.html
- vec2 tc0 = vertTexCoord.st + vec2(-texOffset.s, -texOffset.t);
- vec2 tc1 = vertTexCoord.st + vec2( 0.0, -texOffset.t);
- vec2 tc2 = vertTexCoord.st + vec2(+texOffset.s, -texOffset.t);
- vec2 tc3 = vertTexCoord.st + vec2(-texOffset.s, 0.0);
- vec2 tc4 = vertTexCoord.st + vec2( 0.0, 0.0);
- vec2 tc5 = vertTexCoord.st + vec2(+texOffset.s, 0.0);
- vec2 tc6 = vertTexCoord.st + vec2(-texOffset.s, +texOffset.t);
- vec2 tc7 = vertTexCoord.st + vec2( 0.0, +texOffset.t);
- vec2 tc8 = vertTexCoord.st + vec2(+texOffset.s, +texOffset.t);
-
- vec4 col0 = texture2D(texture, tc0);
- vec4 col1 = texture2D(texture, tc1);
- vec4 col2 = texture2D(texture, tc2);
- vec4 col3 = texture2D(texture, tc3);
- vec4 col4 = texture2D(texture, tc4);
- vec4 col5 = texture2D(texture, tc5);
- vec4 col6 = texture2D(texture, tc6);
- vec4 col7 = texture2D(texture, tc7);
- vec4 col8 = texture2D(texture, tc8);
-
- vec4 sum = 8.0 * col4 - (col0 + col1 + col2 + col3 + col5 + col6 + col7 + col8);
- gl_FragColor = vec4(sum.rgb, 1.0) * vertColor;
-}
diff --git a/android/examples/Topics/Shaders/EdgeDetect/data/leaves.jpg b/android/examples/Topics/Shaders/EdgeDetect/data/leaves.jpg
deleted file mode 100644
index 72c86a0924..0000000000
Binary files a/android/examples/Topics/Shaders/EdgeDetect/data/leaves.jpg and /dev/null differ
diff --git a/android/examples/Topics/Shaders/EdgeFilter/EdgeFilter.pde b/android/examples/Topics/Shaders/EdgeFilter/EdgeFilter.pde
deleted file mode 100644
index c740f003da..0000000000
--- a/android/examples/Topics/Shaders/EdgeFilter/EdgeFilter.pde
+++ /dev/null
@@ -1,43 +0,0 @@
-/**
- * Edge Filter
- *
- * Apply a custom shader to the filter() function to affect the geometry drawn to the screen.
- *
- * Press the mouse to turn the filter on and off.
- */
-
-PShader edges;
-boolean applyFilter = true;
-
-void setup() {
- size(640, 360, P3D);
- orientation(LANDSCAPE);
- edges = loadShader("edges.glsl");
- noStroke();
-}
-
-void draw() {
- background(0);
- lights();
-
- translate(width/2, height/2);
- pushMatrix();
- rotateX(frameCount * 0.01);
- rotateY(frameCount * 0.01);
- box(120);
- popMatrix();
-
- if (applyFilter == true) {
- filter(edges);
- }
-
- // The sphere doesn't have the edge detection applied
- // on it because it is drawn after filter() is called.
- rotateY(frameCount * 0.02);
- translate(150, 0);
- sphere(40);
-}
-
-void mousePressed() {
- applyFilter = !applyFilter;
-}
diff --git a/android/examples/Topics/Shaders/EdgeFilter/data/edges.glsl b/android/examples/Topics/Shaders/EdgeFilter/data/edges.glsl
deleted file mode 100644
index 62109e3e3d..0000000000
--- a/android/examples/Topics/Shaders/EdgeFilter/data/edges.glsl
+++ /dev/null
@@ -1,40 +0,0 @@
-#ifdef GL_ES
-precision mediump float;
-precision mediump int;
-#endif
-
-#define PROCESSING_TEXTURE_SHADER
-
-uniform sampler2D texture;
-uniform vec2 texOffset;
-
-varying vec4 vertColor;
-varying vec4 vertTexCoord;
-
-void main(void) {
- // Grouping texcoord variables in order to make it work in the GMA 950. See post #13
- // in this thread:
- // http://www.idevgames.com/forums/thread-3467.html
- vec2 tc0 = vertTexCoord.st + vec2(-texOffset.s, -texOffset.t);
- vec2 tc1 = vertTexCoord.st + vec2( 0.0, -texOffset.t);
- vec2 tc2 = vertTexCoord.st + vec2(+texOffset.s, -texOffset.t);
- vec2 tc3 = vertTexCoord.st + vec2(-texOffset.s, 0.0);
- vec2 tc4 = vertTexCoord.st + vec2( 0.0, 0.0);
- vec2 tc5 = vertTexCoord.st + vec2(+texOffset.s, 0.0);
- vec2 tc6 = vertTexCoord.st + vec2(-texOffset.s, +texOffset.t);
- vec2 tc7 = vertTexCoord.st + vec2( 0.0, +texOffset.t);
- vec2 tc8 = vertTexCoord.st + vec2(+texOffset.s, +texOffset.t);
-
- vec4 col0 = texture2D(texture, tc0);
- vec4 col1 = texture2D(texture, tc1);
- vec4 col2 = texture2D(texture, tc2);
- vec4 col3 = texture2D(texture, tc3);
- vec4 col4 = texture2D(texture, tc4);
- vec4 col5 = texture2D(texture, tc5);
- vec4 col6 = texture2D(texture, tc6);
- vec4 col7 = texture2D(texture, tc7);
- vec4 col8 = texture2D(texture, tc8);
-
- vec4 sum = 8.0 * col4 - (col0 + col1 + col2 + col3 + col5 + col6 + col7 + col8);
- gl_FragColor = vec4(sum.rgb, 1.0) * vertColor;
-}
diff --git a/android/examples/Topics/Shaders/LowLevelGL/LowLevelGL.pde b/android/examples/Topics/Shaders/LowLevelGL/LowLevelGL.pde
deleted file mode 100644
index 5d10bbc139..0000000000
--- a/android/examples/Topics/Shaders/LowLevelGL/LowLevelGL.pde
+++ /dev/null
@@ -1,104 +0,0 @@
-// Draws a triangle using low-level OpenGL calls.
-import java.nio.*;
-
-PGL pgl;
-PShader flatShader;
-
-int vertLoc;
-int colorLoc;
-
-float[] vertices;
-float[] colors;
-
-FloatBuffer vertData;
-FloatBuffer colorData;
-
-void setup() {
- size(640, 360, P3D);
- orientation(LANDSCAPE);
-
- // Loads a shader to render geometry w/out
- // textures and lights.
- flatShader = loadShader("frag.glsl", "vert.glsl");
-
- vertices = new float[12];
- vertData = allocateDirectFloatBuffer(12);
-
- colors = new float[12];
- colorData = allocateDirectFloatBuffer(12);
-}
-
-void draw() {
- background(0);
-
- // The geometric transformations will be automatically passed
- // to the shader.
- rotate(frameCount * 0.01, width, height, 0);
-
- updateGeometry();
-
- pgl = beginPGL();
- flatShader.bind();
-
- vertLoc = pgl.getAttribLocation(flatShader.glProgram, "vertex");
- colorLoc = pgl.getAttribLocation(flatShader.glProgram, "color");
-
- pgl.enableVertexAttribArray(vertLoc);
- pgl.enableVertexAttribArray(colorLoc);
-
- pgl.vertexAttribPointer(vertLoc, 4, PGL.FLOAT, false, 0, vertData);
- pgl.vertexAttribPointer(colorLoc, 4, PGL.FLOAT, false, 0, colorData);
-
- pgl.drawArrays(PGL.TRIANGLES, 0, 3);
-
- pgl.disableVertexAttribArray(vertLoc);
- pgl.disableVertexAttribArray(colorLoc);
-
- flatShader.unbind();
-
- endPGL();
-}
-
-void updateGeometry() {
- // Vertex 1
- vertices[0] = 0;
- vertices[1] = 0;
- vertices[2] = 0;
- vertices[3] = 1;
- colors[0] = 1;
- colors[1] = 0;
- colors[2] = 0;
- colors[3] = 1;
-
- // Corner 2
- vertices[4] = width/2;
- vertices[5] = height;
- vertices[6] = 0;
- vertices[7] = 1;
- colors[4] = 0;
- colors[5] = 1;
- colors[6] = 0;
- colors[7] = 1;
-
- // Corner 3
- vertices[8] = width;
- vertices[9] = 0;
- vertices[10] = 0;
- vertices[11] = 1;
- colors[8] = 0;
- colors[9] = 0;
- colors[10] = 1;
- colors[11] = 1;
-
- vertData.rewind();
- vertData.put(vertices);
- vertData.position(0);
-
- colorData.rewind();
- colorData.put(colors);
- colorData.position(0);
-}
-
-FloatBuffer allocateDirectFloatBuffer(int n) {
- return ByteBuffer.allocateDirect(n * Float.SIZE/8).order(ByteOrder.nativeOrder()).asFloatBuffer();
-}
diff --git a/android/examples/Topics/Shaders/LowLevelGL/data/frag.glsl b/android/examples/Topics/Shaders/LowLevelGL/data/frag.glsl
deleted file mode 100644
index 16742d2bd2..0000000000
--- a/android/examples/Topics/Shaders/LowLevelGL/data/frag.glsl
+++ /dev/null
@@ -1,30 +0,0 @@
-/*
- Part of the Processing project - http://processing.org
-
- Copyright (c) 2011-12 Ben Fry and Casey Reas
-
- This library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Lesser General Public
- License version 2.1 as published by the Free Software Foundation.
-
- This library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License for more details.
-
- You should have received a copy of the GNU Lesser General
- Public License along with this library; if not, write to the
- Free Software Foundation, Inc., 59 Temple Place, Suite 330,
- Boston, MA 02111-1307 USA
- */
-
-#ifdef GL_ES
-precision mediump float;
-precision mediump int;
-#endif
-
-varying vec4 vertColor;
-
-void main() {
- gl_FragColor = vertColor;
-}
\ No newline at end of file
diff --git a/android/examples/Topics/Shaders/LowLevelGL/data/vert.glsl b/android/examples/Topics/Shaders/LowLevelGL/data/vert.glsl
deleted file mode 100644
index 1a01770089..0000000000
--- a/android/examples/Topics/Shaders/LowLevelGL/data/vert.glsl
+++ /dev/null
@@ -1,33 +0,0 @@
-/*
- Part of the Processing project - http://processing.org
-
- Copyright (c) 2011-12 Ben Fry and Casey Reas
-
- This library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Lesser General Public
- License version 2.1 as published by the Free Software Foundation.
-
- This library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License for more details.
-
- You should have received a copy of the GNU Lesser General
- Public License along with this library; if not, write to the
- Free Software Foundation, Inc., 59 Temple Place, Suite 330,
- Boston, MA 02111-1307 USA
- */
-
-#define PROCESSING_COLOR_SHADER
-
-uniform mat4 transform;
-
-attribute vec4 vertex;
-attribute vec4 color;
-
-varying vec4 vertColor;
-
-void main() {
- gl_Position = transform * vertex;
- vertColor = color;
-}
\ No newline at end of file
diff --git a/android/examples/Topics/Shaders/ToonShading/ToonShading.pde b/android/examples/Topics/Shaders/ToonShading/ToonShading.pde
deleted file mode 100644
index fd18d24b8f..0000000000
--- a/android/examples/Topics/Shaders/ToonShading/ToonShading.pde
+++ /dev/null
@@ -1,44 +0,0 @@
-/**
- * Toon Shading.
- *
- * Example showing the use of a custom lighting shader in order
- * to apply a "toon" effect on the scene. Based on the glsl tutorial
- * from lighthouse 3D:
- * http://www.lighthouse3d.com/tutorials/glsl-tutorial/toon-shader-version-ii/
- */
-
-PShader toon;
-boolean shaderEnabled = true;
-
-void setup() {
- size(640, 360, P3D);
- orientation(LANDSCAPE);
- noStroke();
- fill(204);
- toon = loadShader("ToonFrag.glsl", "ToonVert.glsl");
-}
-
-void draw() {
- if (shaderEnabled == true) {
- shader(toon);
- }
-
- noStroke();
- background(0);
- float dirY = (mouseY / float(height) - 0.5) * 2;
- float dirX = (mouseX / float(width) - 0.5) * 2;
- directionalLight(204, 204, 204, -dirX, -dirY, -1);
- translate(width/2, height/2);
- sphere(120);
-}
-
-void mousePressed() {
- if (shaderEnabled) {
- shaderEnabled = false;
- resetShader();
- }
- else {
- shaderEnabled = true;
- }
-}
-
diff --git a/android/examples/Topics/Shaders/ToonShading/data/ToonFrag.glsl b/android/examples/Topics/Shaders/ToonShading/data/ToonFrag.glsl
deleted file mode 100644
index 054bb0dfb2..0000000000
--- a/android/examples/Topics/Shaders/ToonShading/data/ToonFrag.glsl
+++ /dev/null
@@ -1,25 +0,0 @@
-#ifdef GL_ES
-precision mediump float;
-precision mediump int;
-#endif
-
-varying vec3 vertNormal;
-varying vec3 vertLightDir;
-
-void main() {
- float intensity;
- vec4 color;
- intensity = max(0.0, dot(vertLightDir, vertNormal));
-
- if (intensity > 0.95) {
- color = vec4(1.0, 0.5, 0.5, 1.0);
- } else if (intensity > 0.5) {
- color = vec4(0.6, 0.3, 0.3, 1.0);
- } else if (intensity > 0.25) {
- color = vec4(0.4, 0.2, 0.2, 1.0);
- } else {
- color = vec4(0.2, 0.1, 0.1, 1.0);
- }
-
- gl_FragColor = color;
-}
\ No newline at end of file
diff --git a/android/examples/Topics/Shaders/ToonShading/data/ToonVert.glsl b/android/examples/Topics/Shaders/ToonShading/data/ToonVert.glsl
deleted file mode 100644
index 01b77b2c92..0000000000
--- a/android/examples/Topics/Shaders/ToonShading/data/ToonVert.glsl
+++ /dev/null
@@ -1,31 +0,0 @@
-// Toon shader using per-pixel lighting. Based on the glsl
-// tutorial from lighthouse 3D:
-// http://www.lighthouse3d.com/tutorials/glsl-tutorial/toon-shader-version-ii/
-
-#define PROCESSING_LIGHT_SHADER
-
-uniform mat4 modelview;
-uniform mat4 transform;
-uniform mat3 normalMatrix;
-
-uniform vec3 lightNormal[8];
-
-attribute vec4 vertex;
-attribute vec3 normal;
-
-varying vec3 vertNormal;
-varying vec3 vertLightDir;
-
-void main() {
- // Vertex in clip coordinates
- gl_Position = transform * vertex;
-
- // Normal vector in eye coordinates is passed
- // to the fragment shader
- vertNormal = normalize(normalMatrix * normal);
-
- // Assuming that there is only one directional light.
- // Its normal vector is passed to the fragment shader
- // in order to perform per-pixel lighting calculation.
- vertLightDir = -lightNormal[0];
-}
\ No newline at end of file
diff --git a/android/examples/Topics/Simulate/Chain/Chain.pde b/android/examples/Topics/Simulate/Chain/Chain.pde
deleted file mode 100644
index f2a53006f9..0000000000
--- a/android/examples/Topics/Simulate/Chain/Chain.pde
+++ /dev/null
@@ -1,68 +0,0 @@
-/**
- * Chain.
- *
- * One mass is attached to the mouse position and the other
- * is attached the position of the other mass. The gravity
- * in the environment pulls down on both.
- */
-
-
-Spring2D s1, s2;
-
-float gravity = 6.0;
-float mass = 2.0;
-
-void setup()
-{
- size(200, 200);
- smooth();
- fill(0);
- // Inputs: x, y, mass, gravity
- s1 = new Spring2D(0.0, width/2, mass, gravity);
- s2 = new Spring2D(0.0, width/2, mass, gravity);
-}
-
-void draw()
-{
- background(204);
- s1.update(mouseX, mouseY);
- s1.display(mouseX, mouseY);
- s2.update(s1.x, s1.y);
- s2.display(s1.x, s1.y);
-}
-
-class Spring2D {
- float vx, vy; // The x- and y-axis velocities
- float x, y; // The x- and y-coordinates
- float gravity;
- float mass;
- float radius = 20;
- float stiffness = 0.2;
- float damping = 0.7;
-
- Spring2D(float xpos, float ypos, float m, float g) {
- x = xpos;
- y = ypos;
- mass = m;
- gravity = g;
- }
-
- void update(float targetX, float targetY) {
- float forceX = (targetX - x) * stiffness;
- float ax = forceX / mass;
- vx = damping * (vx + ax);
- x += vx;
- float forceY = (targetY - y) * stiffness;
- forceY += gravity;
- float ay = forceY / mass;
- vy = damping * (vy + ay);
- y += vy;
- }
-
- void display(float nx, float ny) {
- noStroke();
- ellipse(x, y, radius*2, radius*2);
- stroke(255);
- line(x, y, nx, ny);
- }
-}
diff --git a/android/examples/Topics/Simulate/Flocking/Boid.pde b/android/examples/Topics/Simulate/Flocking/Boid.pde
deleted file mode 100644
index b2bc127b6c..0000000000
--- a/android/examples/Topics/Simulate/Flocking/Boid.pde
+++ /dev/null
@@ -1,196 +0,0 @@
-// The Boid class
-
-class Boid {
-
- PVector loc;
- PVector vel;
- PVector acc;
- float r;
- float maxforce; // Maximum steering force
- float maxspeed; // Maximum speed
-
- Boid(PVector l, float ms, float mf) {
- acc = new PVector(0,0);
- vel = new PVector(random(-1,1),random(-1,1));
- loc = l.get();
- r = 2.0;
- maxspeed = ms;
- maxforce = mf;
- }
-
- void run(ArrayList boids) {
- flock(boids);
- update();
- borders();
- render();
- }
-
- // We accumulate a new acceleration each time based on three rules
- void flock(ArrayList boids) {
- PVector sep = separate(boids); // Separation
- PVector ali = align(boids); // Alignment
- PVector coh = cohesion(boids); // Cohesion
- // Arbitrarily weight these forces
- sep.mult(1.5);
- ali.mult(1.0);
- coh.mult(1.0);
- // Add the force vectors to acceleration
- acc.add(sep);
- acc.add(ali);
- acc.add(coh);
- }
-
- // Method to update location
- void update() {
- // Update velocity
- vel.add(acc);
- // Limit speed
- vel.limit(maxspeed);
- loc.add(vel);
- // Reset accelertion to 0 each cycle
- acc.mult(0);
- }
-
- void seek(PVector target) {
- acc.add(steer(target,false));
- }
-
- void arrive(PVector target) {
- acc.add(steer(target,true));
- }
-
- // A method that calculates a steering vector towards a target
- // Takes a second argument, if true, it slows down as it approaches the target
- PVector steer(PVector target, boolean slowdown) {
- PVector steer; // The steering vector
- PVector desired = target.sub(target,loc); // A vector pointing from the location to the target
- float d = desired.mag(); // Distance from the target is the magnitude of the vector
- // If the distance is greater than 0, calc steering (otherwise return zero vector)
- if (d > 0) {
- // Normalize desired
- desired.normalize();
- // Two options for desired vector magnitude (1 -- based on distance, 2 -- maxspeed)
- if ((slowdown) && (d < 100.0)) desired.mult(maxspeed*(d/100.0)); // This damping is somewhat arbitrary
- else desired.mult(maxspeed);
- // Steering = Desired minus Velocity
- steer = target.sub(desired,vel);
- steer.limit(maxforce); // Limit to maximum steering force
- }
- else {
- steer = new PVector(0,0);
- }
- return steer;
- }
-
- void render() {
- // Draw a triangle rotated in the direction of velocity
- float theta = vel.heading() + PI/2;
- fill(200,100);
- stroke(255);
- pushMatrix();
- translate(loc.x,loc.y);
- rotate(theta);
- beginShape(TRIANGLES);
- vertex(0, -r*2);
- vertex(-r, r*2);
- vertex(r, r*2);
- endShape();
- popMatrix();
- }
-
- // Wraparound
- void borders() {
- if (loc.x < -r) loc.x = width+r;
- if (loc.y < -r) loc.y = height+r;
- if (loc.x > width+r) loc.x = -r;
- if (loc.y > height+r) loc.y = -r;
- }
-
- // Separation
- // Method checks for nearby boids and steers away
- PVector separate (ArrayList boids) {
- float desiredseparation = 20.0;
- PVector steer = new PVector(0,0,0);
- int count = 0;
- // For every boid in the system, check if it's too close
- for (int i = 0 ; i < boids.size(); i++) {
- Boid other = (Boid) boids.get(i);
- float d = PVector.dist(loc,other.loc);
- // If the distance is greater than 0 and less than an arbitrary amount (0 when you are yourself)
- if ((d > 0) && (d < desiredseparation)) {
- // Calculate vector pointing away from neighbor
- PVector diff = PVector.sub(loc,other.loc);
- diff.normalize();
- diff.div(d); // Weight by distance
- steer.add(diff);
- count++; // Keep track of how many
- }
- }
- // Average -- divide by how many
- if (count > 0) {
- steer.div((float)count);
- }
-
- // As long as the vector is greater than 0
- if (steer.mag() > 0) {
- // Implement Reynolds: Steering = Desired - Velocity
- steer.normalize();
- steer.mult(maxspeed);
- steer.sub(vel);
- steer.limit(maxforce);
- }
- return steer;
- }
-
- // Alignment
- // For every nearby boid in the system, calculate the average velocity
- PVector align (ArrayList boids) {
- float neighbordist = 25.0;
- PVector steer = new PVector(0,0,0);
- int count = 0;
- for (int i = 0 ; i < boids.size(); i++) {
- Boid other = (Boid) boids.get(i);
- float d = PVector.dist(loc,other.loc);
- if ((d > 0) && (d < neighbordist)) {
- steer.add(other.vel);
- count++;
- }
- }
- if (count > 0) {
- steer.div((float)count);
- }
-
- // As long as the vector is greater than 0
- if (steer.mag() > 0) {
- // Implement Reynolds: Steering = Desired - Velocity
- steer.normalize();
- steer.mult(maxspeed);
- steer.sub(vel);
- steer.limit(maxforce);
- }
- return steer;
- }
-
- // Cohesion
- // For the average location (i.e. center) of all nearby boids, calculate steering vector towards that location
- PVector cohesion (ArrayList boids) {
- float neighbordist = 25.0;
- PVector sum = new PVector(0,0); // Start with empty vector to accumulate all locations
- int count = 0;
- for (int i = 0 ; i < boids.size(); i++) {
- Boid other = (Boid) boids.get(i);
- float d = loc.dist(other.loc);
- if ((d > 0) && (d < neighbordist)) {
- sum.add(other.loc); // Add location
- count++;
- }
- }
- if (count > 0) {
- sum.div((float)count);
- return steer(sum,false); // Steer towards the location
- }
- return sum;
- }
-}
-
-
diff --git a/android/examples/Topics/Simulate/Flocking/Flock.pde b/android/examples/Topics/Simulate/Flocking/Flock.pde
deleted file mode 100644
index 9ec1001c7d..0000000000
--- a/android/examples/Topics/Simulate/Flocking/Flock.pde
+++ /dev/null
@@ -1,22 +0,0 @@
-// The Flock (a list of Boid objects)
-
-class Flock {
- ArrayList boids; // An arraylist for all the boids
-
- Flock() {
- boids = new ArrayList(); // Initialize the arraylist
- }
-
- void run() {
- for (int i = 0; i < boids.size(); i++) {
- Boid b = (Boid) boids.get(i);
- b.run(boids); // Passing the entire list of boids to each boid individually
- }
- }
-
- void addBoid(Boid b) {
- boids.add(b);
- }
-
-}
-
diff --git a/android/examples/Topics/Simulate/Flocking/Flocking.pde b/android/examples/Topics/Simulate/Flocking/Flocking.pde
deleted file mode 100644
index ed0e7e60c7..0000000000
--- a/android/examples/Topics/Simulate/Flocking/Flocking.pde
+++ /dev/null
@@ -1,32 +0,0 @@
-/**
- * Flocking
- * by Daniel Shiffman.
- *
- * An implementation of Craig Reynold's Boids program to simulate
- * the flocking behavior of birds. Each boid steers itself based on
- * rules of avoidance, alignment, and coherence.
- *
- * Click the mouse to add a new boid.
- */
-
-Flock flock;
-
-void setup() {
- size(640, 360);
- flock = new Flock();
- // Add an initial set of boids into the system
- for (int i = 0; i < 150; i++) {
- flock.addBoid(new Boid(new PVector(width/2,height/2), 3.0, 0.05));
- }
- smooth();
-}
-
-void draw() {
- background(50);
- flock.run();
-}
-
-// Add a new boid into the System
-void mousePressed() {
- flock.addBoid(new Boid(new PVector(mouseX,mouseY),2.0f,0.05f));
-}
diff --git a/android/examples/Topics/Simulate/ForcesWithVectors/ForcesWithVectors.pde b/android/examples/Topics/Simulate/ForcesWithVectors/ForcesWithVectors.pde
deleted file mode 100644
index fccdc56589..0000000000
--- a/android/examples/Topics/Simulate/ForcesWithVectors/ForcesWithVectors.pde
+++ /dev/null
@@ -1,77 +0,0 @@
-/**
- * Forces (Gravity and Fluid Resistence) with Vectors
- * by Daniel Shiffman.
- *
- * Demonstration of multiple force acting on bodies (Mover class)
- * Bodies experience gravity continuously
- * Bodies experience fluid resistance when in "water"
- *
- * For the basics of working with PVector, see
- * http://processing.org/learning/pvector/
- * as well as examples in Topics/Vectors/
- *
- */
-
-// Five moving bodies
-Mover[] movers = new Mover[10];
-
-// Liquid
-Liquid liquid;
-
-void setup() {
- size(640, 360);
- smooth();
- reset();
- // Create liquid object
- liquid = new Liquid(0, height/2, width, height/2, 0.1);
-}
-
-void draw() {
- background(0);
-
- // Draw water
- liquid.display();
-
- for (int i = 0; i < movers.length; i++) {
-
- // Is the Mover in the liquid?
- if (liquid.contains(movers[i])) {
- // Calculate drag force
- PVector drag = liquid.drag(movers[i]);
- // Apply drag force to Mover
- movers[i].applyForce(drag);
- }
-
- // Gravity is scaled by mass here!
- PVector gravity = new PVector(0, 0.1*movers[i].mass);
- // Apply gravity
- movers[i].applyForce(gravity);
-
- // Update and display
- movers[i].update();
- movers[i].display();
- movers[i].checkEdges();
- }
-
- fill(255);
- text("click mouse to reset",10,30);
-
-}
-
-void mousePressed() {
- reset();
-}
-
-// Restart all the Mover objects randomly
-void reset() {
- for (int i = 0; i < movers.length; i++) {
- movers[i] = new Mover(random(0.5, 3), 40+i*70, 0);
- }
-}
-
-
-
-
-
-
-
diff --git a/android/examples/Topics/Simulate/ForcesWithVectors/Liquid.pde b/android/examples/Topics/Simulate/ForcesWithVectors/Liquid.pde
deleted file mode 100644
index 98ccfe34d9..0000000000
--- a/android/examples/Topics/Simulate/ForcesWithVectors/Liquid.pde
+++ /dev/null
@@ -1,60 +0,0 @@
-/**
- * Forces (Gravity and Fluid Resistence) with Vectors
- * by Daniel Shiffman.
- *
- * Demonstration of multiple force acting on bodies (Mover class)
- * Bodies experience gravity continuously
- * Bodies experience fluid resistance when in "water"
- */
-
- // Liquid class
- class Liquid {
-
-
- // Liquid is a rectangle
- float x,y,w,h;
- // Coefficient of drag
- float c;
-
- Liquid(float x_, float y_, float w_, float h_, float c_) {
- x = x_;
- y = y_;
- w = w_;
- h = h_;
- c = c_;
- }
-
- // Is the Mover in the Liquid?
- boolean contains(Mover m) {
- PVector l = m.location;
- if (l.x > x && l.x < x + w && l.y > y && l.y < y + h) {
- return true;
- }
- else {
- return false;
- }
- }
-
- // Calculate drag force
- PVector drag(Mover m) {
- // Magnitude is coefficient * speed squared
- float speed = m.velocity.mag();
- float dragMagnitude = c * speed * speed;
-
- // Direction is inverse of velocity
- PVector drag = m.velocity.get();
- drag.mult(-1);
-
- // Scale according to magnitude
- drag.setMag(dragMagnitude);
- return drag;
- }
-
- void display() {
- noStroke();
- fill(127);
- rect(x,y,w,h);
- }
-
-}
-
diff --git a/android/examples/Topics/Simulate/ForcesWithVectors/Mover.pde b/android/examples/Topics/Simulate/ForcesWithVectors/Mover.pde
deleted file mode 100644
index b14754b718..0000000000
--- a/android/examples/Topics/Simulate/ForcesWithVectors/Mover.pde
+++ /dev/null
@@ -1,64 +0,0 @@
-/**
- * Forces (Gravity and Fluid Resistence) with Vectors
- * by Daniel Shiffman.
- *
- * Demonstration of multiple force acting on bodies (Mover class)
- * Bodies experience gravity continuously
- * Bodies experience fluid resistance when in "water"
- */
-
-
-class Mover {
-
- // location, velocity, and acceleration
- PVector location;
- PVector velocity;
- PVector acceleration;
-
- // Mass is tied to size
- float mass;
-
- Mover(float m, float x, float y) {
- mass = m;
- location = new PVector(x, y);
- velocity = new PVector(0, 0);
- acceleration = new PVector(0, 0);
- }
-
- // Newton's 2nd law: F = M * A
- // or A = F / M
- void applyForce(PVector force) {
- // Divide by mass
- PVector f = PVector.div(force, mass);
- // Accumulate all forces in acceleration
- acceleration.add(f);
- }
-
- void update() {
-
- // Velocity changes according to acceleration
- velocity.add(acceleration);
- // Location changes by velocity
- location.add(velocity);
- // We must clear acceleration each frame
- acceleration.mult(0);
- }
-
- // Draw Mover
- void display() {
- stroke(255);
- strokeWeight(2);
- fill(255, 200);
- ellipse(location.x, location.y, mass*16, mass*16);
- }
-
- // Bounce off bottom of window
- void checkEdges() {
- if (location.y > height) {
- velocity.y *= -0.9; // A little dampening when hitting the bottom
- location.y = height;
- }
- }
-}
-
-
diff --git a/android/examples/Topics/Simulate/GravitationalAttraction3D/GravitationalAttraction3D.pde b/android/examples/Topics/Simulate/GravitationalAttraction3D/GravitationalAttraction3D.pde
deleted file mode 100644
index 87a7ed9ef7..0000000000
--- a/android/examples/Topics/Simulate/GravitationalAttraction3D/GravitationalAttraction3D.pde
+++ /dev/null
@@ -1,71 +0,0 @@
-/**
- * Gravitational Attraction (3D)
- * by Daniel Shiffman.
- *
- * Simulating gravitational attraction
- * G ---> universal gravitational constant
- * m1 --> mass of object #1
- * m2 --> mass of object #2
- * d ---> distance between objects
- * F = (G*m1*m2)/(d*d)
- *
- * For the basics of working with PVector, see
- * http://processing.org/learning/pvector/
- * as well as examples in Topics/Vectors/
- *
- */
-
-// A bunch of planets
-Planet[] planets = new Planet[10];
-// One sun (note sun is not attracted to planets (violation of Newton's 3rd Law)
-Sun s;
-
-// An angle to rotate around the scene
-float angle = 0;
-
-void setup() {
- size(displayWidth, displayHeight, P3D);
- orientation(LANDSCAPE);
- // Some random planets
- for (int i = 0; i < planets.length; i++) {
- planets[i] = new Planet(random(0.1, 2), random(-width/2, width/2), random(-height/2, height/2), random(-100, 100));
- }
- // A single sun
- s = new Sun();
-}
-
-void draw() {
- background(0);
- // Setup the scene
- sphereDetail(8);
- lights();
- translate(width/2, height/2);
- rotateY(angle);
-
-
- // Display the Sun
- s.display();
-
- // All the Planets
- for (int i = 0; i < planets.length; i++) {
- // Sun attracts Planets
- PVector force = s.attract(planets[i]);
- planets[i].applyForce(force);
- // Update and draw Planets
- planets[i].update();
- planets[i].display();
- }
-
- // Rotate around the scene
- angle += 0.003;
-}
-
-
-
-
-
-
-
-
-
-
diff --git a/android/examples/Topics/Simulate/GravitationalAttraction3D/Planet.pde b/android/examples/Topics/Simulate/GravitationalAttraction3D/Planet.pde
deleted file mode 100644
index ae8be25372..0000000000
--- a/android/examples/Topics/Simulate/GravitationalAttraction3D/Planet.pde
+++ /dev/null
@@ -1,45 +0,0 @@
-// Gravitational Attraction (3D)
-// Daniel Shiffman
-
-// A class for an orbiting Planet
-
-class Planet {
-
- // Basic physics model (location, velocity, acceleration, mass)
- PVector location;
- PVector velocity;
- PVector acceleration;
- float mass;
-
- Planet(float m, float x, float y, float z) {
- mass = m;
- location = new PVector(x,y,z);
- velocity = new PVector(1,0); // Arbitrary starting velocity
- acceleration = new PVector(0,0);
- }
-
- // Newton's 2nd Law (F = M*A) applied
- void applyForce(PVector force) {
- PVector f = PVector.div(force,mass);
- acceleration.add(f);
- }
-
- // Our motion algorithm (aka Euler Integration)
- void update() {
- velocity.add(acceleration); // Velocity changes according to acceleration
- location.add(velocity); // Location changes according to velocity
- acceleration.mult(0);
- }
-
- // Draw the Planet
- void display() {
- noStroke();
- fill(255);
- pushMatrix();
- translate(location.x,location.y,location.z);
- sphere(mass*8);
- popMatrix();
- }
-}
-
-
diff --git a/android/examples/Topics/Simulate/GravitationalAttraction3D/Sun.pde b/android/examples/Topics/Simulate/GravitationalAttraction3D/Sun.pde
deleted file mode 100644
index 3253bc02fe..0000000000
--- a/android/examples/Topics/Simulate/GravitationalAttraction3D/Sun.pde
+++ /dev/null
@@ -1,39 +0,0 @@
-// Gravitational Attraction (3D)
-// Daniel Shiffman
-
-// A class for an attractive body in our world
-
-class Sun {
- float mass; // Mass, tied to size
- PVector location; // Location
- float G; // Universal gravitational constant (arbitrary value)
-
- Sun() {
- location = new PVector(0,0);
- mass = 20;
- G = 0.4;
- }
-
-
- PVector attract(Planet m) {
- PVector force = PVector.sub(location,m.location); // Calculate direction of force
- float d = force.mag(); // Distance between objects
- d = constrain(d,5.0,25.0); // Limiting the distance to eliminate "extreme" results for very close or very far objects
- force.normalize(); // Normalize vector (distance doesn't matter here, we just want this vector for direction)
- float strength = (G * mass * m.mass) / (d * d); // Calculate gravitional force magnitude
- force.mult(strength); // Get force vector --> magnitude * direction
- return force;
- }
-
- // Draw Sun
- void display() {
- stroke(255);
- noFill();
- pushMatrix();
- translate(location.x,location.y,location.z);
- sphere(mass*2);
- popMatrix();
- }
-}
-
-
diff --git a/android/examples/Topics/Simulate/MultipleParticleSystems/CrazyParticle.pde b/android/examples/Topics/Simulate/MultipleParticleSystems/CrazyParticle.pde
deleted file mode 100644
index 02b2dfa970..0000000000
--- a/android/examples/Topics/Simulate/MultipleParticleSystems/CrazyParticle.pde
+++ /dev/null
@@ -1,47 +0,0 @@
-// A subclass of Particle
-
-class CrazyParticle extends Particle {
-
- // Just adding one new variable to a CrazyParticle
- // It inherits all other fields from "Particle", and we don't have to retype them!
- float theta;
-
- // The CrazyParticle constructor can call the parent class (super class) constructor
- CrazyParticle(PVector l) {
- // "super" means do everything from the constructor in Particle
- super(l);
- // One more line of code to deal with the new variable, theta
- theta = 0.0;
-
- }
-
- // Notice we don't have the method run() here; it is inherited from Particle
-
- // This update() method overrides the parent class update() method
- void update() {
- super.update();
- // Increment rotation based on horizontal velocity
- float theta_vel = (vel.x * vel.mag()) / 10.0f;
- theta += theta_vel;
- }
-
- // Override timer
- void timer() {
- timer -= 0.5;
- }
-
- // Method to display
- void render() {
- // Render the ellipse just like in a regular particle
- super.render();
-
- // Then add a rotating line
- pushMatrix();
- translate(loc.x,loc.y);
- rotate(theta);
- stroke(255,timer);
- line(0,0,25,0);
- popMatrix();
- }
-}
-
diff --git a/android/examples/Topics/Simulate/MultipleParticleSystems/MultipleParticleSystems.pde b/android/examples/Topics/Simulate/MultipleParticleSystems/MultipleParticleSystems.pde
deleted file mode 100644
index 960f7c03b6..0000000000
--- a/android/examples/Topics/Simulate/MultipleParticleSystems/MultipleParticleSystems.pde
+++ /dev/null
@@ -1,50 +0,0 @@
-/**
- * Multiple Particle Systems
- * by Daniel Shiffman.
- *
- * Click the mouse to generate a burst of particles
- * at mouse location.
- *
- * Each burst is one instance of a particle system
- * with Particles and CrazyParticles (a subclass of Particle)
- * Note use of Inheritance and Polymorphism here.
- */
-
-ArrayList psystems;
-
-void setup() {
- size(640, 360);
- colorMode(RGB, 255, 255, 255, 100);
- psystems = new ArrayList();
- smooth();
-}
-
-void draw() {
- background(0);
-
- // Cycle through all particle systems, run them and delete old ones
- for (int i = psystems.size()-1; i >= 0; i--) {
- ParticleSystem psys = (ParticleSystem) psystems.get(i);
- psys.run();
- if (psys.dead()) {
- psystems.remove(i);
- }
- }
-
-}
-
-// When the mouse is pressed, add a new particle system
-void mousePressed() {
- psystems.add(new ParticleSystem(int(random(5,25)),new PVector(mouseX,mouseY)));
-}
-
-
-
-
-
-
-
-
-
-
-
diff --git a/android/examples/Topics/Simulate/MultipleParticleSystems/Particle.pde b/android/examples/Topics/Simulate/MultipleParticleSystems/Particle.pde
deleted file mode 100644
index f06feae244..0000000000
--- a/android/examples/Topics/Simulate/MultipleParticleSystems/Particle.pde
+++ /dev/null
@@ -1,57 +0,0 @@
-// A simple Particle class
-
-class Particle {
- PVector loc;
- PVector vel;
- PVector acc;
- float r;
- float timer;
-
- // One constructor
- Particle(PVector a, PVector v, PVector l, float r_) {
- acc = a.get();
- vel = v.get();
- loc = l.get();
- r = r_;
- timer = 100.0;
- }
-
- // Another constructor (the one we are using here)
- Particle(PVector l) {
- acc = new PVector(0,0.05,0);
- vel = new PVector(random(-1,1),random(-2,0),0);
- loc = l.get();
- r = 10.0;
- timer = 100.0;
- }
-
-
- void run() {
- update();
- render();
- }
-
- // Method to update location
- void update() {
- vel.add(acc);
- loc.add(vel);
- timer -= 1.0;
- }
-
- // Method to display
- void render() {
- ellipseMode(CENTER);
- stroke(255,timer);
- fill(100,timer);
- ellipse(loc.x,loc.y,r,r);
- }
-
- // Is the particle still useful?
- boolean dead() {
- if (timer <= 0.0) {
- return true;
- } else {
- return false;
- }
- }
-}
diff --git a/android/examples/Topics/Simulate/MultipleParticleSystems/ParticleSystem.pde b/android/examples/Topics/Simulate/MultipleParticleSystems/ParticleSystem.pde
deleted file mode 100644
index 9322a70afc..0000000000
--- a/android/examples/Topics/Simulate/MultipleParticleSystems/ParticleSystem.pde
+++ /dev/null
@@ -1,51 +0,0 @@
-// An ArrayList is used to manage the list of Particles
-
-class ParticleSystem {
-
- ArrayList particles; // An arraylist for all the particles
- PVector origin; // An origin point for where particles are birthed
-
- ParticleSystem(int num, PVector v) {
- particles = new ArrayList(); // Initialize the arraylist
- origin = v.get(); // Store the origin point
- for (int i = 0; i < num; i++) {
- // We have a 50% chance of adding each kind of particle
- if (random(1) < 0.5) {
- particles.add(new CrazyParticle(origin));
- } else {
- particles.add(new Particle(origin));
- }
- }
- }
-
- void run() {
- // Cycle through the ArrayList backwards b/c we are deleting
- for (int i = particles.size()-1; i >= 0; i--) {
- Particle p = (Particle) particles.get(i);
- p.run();
- if (p.dead()) {
- particles.remove(i);
- }
- }
- }
-
- void addParticle() {
- particles.add(new Particle(origin));
- }
-
- void addParticle(Particle p) {
- particles.add(p);
- }
-
- // A method to test if the particle system still has particles
- boolean dead() {
- if (particles.isEmpty()) {
- return true;
- }
- else {
- return false;
- }
- }
-
-}
-
diff --git a/android/examples/Topics/Simulate/SimpleParticleSystem/Particle.pde b/android/examples/Topics/Simulate/SimpleParticleSystem/Particle.pde
deleted file mode 100644
index ec638a61a1..0000000000
--- a/android/examples/Topics/Simulate/SimpleParticleSystem/Particle.pde
+++ /dev/null
@@ -1,67 +0,0 @@
-// A simple Particle class
-
-class Particle {
- PVector loc;
- PVector vel;
- PVector acc;
- float r;
- float timer;
-
- // Another constructor (the one we are using here)
- Particle(PVector l) {
- acc = new PVector(0,0.05,0);
- vel = new PVector(random(-1,1),random(-2,0),0);
- loc = l.get();
- r = 10.0;
- timer = 100.0;
- }
-
- void run() {
- update();
- render();
- }
-
- // Method to update location
- void update() {
- vel.add(acc);
- loc.add(vel);
- timer -= 1.0;
- }
-
- // Method to display
- void render() {
- ellipseMode(CENTER);
- stroke(255,timer);
- fill(100,timer);
- ellipse(loc.x,loc.y,r,r);
- displayVector(vel,loc.x,loc.y,10);
- }
-
- // Is the particle still useful?
- boolean dead() {
- if (timer <= 0.0) {
- return true;
- } else {
- return false;
- }
- }
-
- void displayVector(PVector v, float x, float y, float scayl) {
- pushMatrix();
- float arrowsize = 4;
- // Translate to location to render vector
- translate(x,y);
- stroke(255);
- // Call vector heading function to get direction (note that pointing up is a heading of 0) and rotate
- rotate(v.heading());
- // Calculate length of vector & scale it to be bigger or smaller if necessary
- float len = v.mag()*scayl;
- // Draw three lines to make an arrow (draw pointing up since we've rotate to the proper direction)
- line(0,0,len,0);
- line(len,0,len-arrowsize,+arrowsize/2);
- line(len,0,len-arrowsize,-arrowsize/2);
- popMatrix();
- }
-
-}
-
diff --git a/android/examples/Topics/Simulate/SimpleParticleSystem/ParticleSystem.pde b/android/examples/Topics/Simulate/SimpleParticleSystem/ParticleSystem.pde
deleted file mode 100644
index 3d6829d833..0000000000
--- a/android/examples/Topics/Simulate/SimpleParticleSystem/ParticleSystem.pde
+++ /dev/null
@@ -1,50 +0,0 @@
-// A class to describe a group of Particles
-// An ArrayList is used to manage the list of Particles
-
-class ParticleSystem {
-
- ArrayList particles; // An arraylist for all the particles
- PVector origin; // An origin point for where particles are born
-
- ParticleSystem(int num, PVector v) {
- particles = new ArrayList(); // Initialize the arraylist
- origin = v.get(); // Store the origin point
- for (int i = 0; i < num; i++) {
- particles.add(new Particle(origin)); // Add "num" amount of particles to the arraylist
- }
- }
-
- void run() {
- // Cycle through the ArrayList backwards b/c we are deleting
- for (int i = particles.size()-1; i >= 0; i--) {
- Particle p = (Particle) particles.get(i);
- p.run();
- if (p.dead()) {
- particles.remove(i);
- }
- }
- }
-
- void addParticle() {
- particles.add(new Particle(origin));
- }
-
- void addParticle(float x, float y) {
- particles.add(new Particle(new PVector(x,y)));
- }
-
- void addParticle(Particle p) {
- particles.add(p);
- }
-
- // A method to test if the particle system still has particles
- boolean dead() {
- if (particles.isEmpty()) {
- return true;
- } else {
- return false;
- }
- }
-
-}
-
diff --git a/android/examples/Topics/Simulate/SimpleParticleSystem/SimpleParticleSystem.pde b/android/examples/Topics/Simulate/SimpleParticleSystem/SimpleParticleSystem.pde
deleted file mode 100644
index 2e01b424da..0000000000
--- a/android/examples/Topics/Simulate/SimpleParticleSystem/SimpleParticleSystem.pde
+++ /dev/null
@@ -1,27 +0,0 @@
-/**
- * Simple Particle System
- * by Daniel Shiffman.
- *
- * Particles are generated each cycle through draw(),
- * fall with gravity and fade out over time
- * A ParticleSystem object manages a variable size (ArrayList)
- * list of particles.
- */
-
-ParticleSystem ps;
-
-void setup() {
- size(640, 360);
- colorMode(RGB, 255, 255, 255, 100);
- ps = new ParticleSystem(1, new PVector(width/2,height/2,0));
- smooth();
-}
-
-void draw() {
- background(0);
- ps.run();
- ps.addParticle(mouseX,mouseY);
-}
-
-
-
diff --git a/android/examples/Topics/Simulate/SmokeParticleSystem/Particle.pde b/android/examples/Topics/Simulate/SmokeParticleSystem/Particle.pde
deleted file mode 100644
index 5e9ba9b5f3..0000000000
--- a/android/examples/Topics/Simulate/SmokeParticleSystem/Particle.pde
+++ /dev/null
@@ -1,69 +0,0 @@
-
-// A simple Particle class, renders the particle as an image
-
-class Particle {
- PVector loc;
- PVector vel;
- PVector acc;
- float timer;
- PImage img;
-
- // One constructor
- Particle(PVector a, PVector v, PVector l, PImage img_) {
- acc = a.get();
- vel = v.get();
- loc = l.get();
- timer = 100.0;
- img = img_;
- }
-
- // Another constructor (the one we are using here)
- Particle(PVector l,PImage img_) {
- acc = new PVector(0.0,0.0,0.0);
- float x = (float) generator.nextGaussian()*0.3f;
- float y = (float) generator.nextGaussian()*0.3f - 1.0f;
- vel = new PVector(x,y,0);
- loc = l.get();
- timer = 100.0;
- img = img_;
- }
-
- void run() {
- update();
- render();
- }
-
- // Method to apply a force vector to the Particle object
- // Note we are ignoring "mass" here
- void add_force(PVector f) {
- acc.add(f);
- }
-
- // Method to update location
- void update() {
- vel.add(acc);
- loc.add(vel);
- timer -= 2.5;
- acc.mult(0);
- }
-
- // Method to display
- void render() {
- imageMode(CORNER);
- tint(255,timer);
- image(img,loc.x-img.width/2,loc.y-img.height/2);
- }
-
- // Is the particle still useful?
- boolean dead() {
- if (timer <= 0.0) {
- return true;
- } else {
- return false;
- }
- }
-}
-
-
-
-
diff --git a/android/examples/Topics/Simulate/SmokeParticleSystem/ParticleSystem.pde b/android/examples/Topics/Simulate/SmokeParticleSystem/ParticleSystem.pde
deleted file mode 100644
index a937d2efe2..0000000000
--- a/android/examples/Topics/Simulate/SmokeParticleSystem/ParticleSystem.pde
+++ /dev/null
@@ -1,57 +0,0 @@
-// A class to describe a group of Particles
-// An ArrayList is used to manage the list of Particles
-
-class ParticleSystem {
-
- ArrayList particles; // An arraylist for all the particles
- PVector origin; // An origin point for where particles are birthed
- PImage img;
-
- ParticleSystem(int num, PVector v, PImage img_) {
- particles = new ArrayList(); // Initialize the arraylist
- origin = v.get(); // Store the origin point
- img = img_;
- for (int i = 0; i < num; i++) {
- particles.add(new Particle(origin, img)); // Add "num" amount of particles to the arraylist
- }
- }
-
- void run() {
- // Cycle through the ArrayList backwards b/c we are deleting
- for (int i = particles.size()-1; i >= 0; i--) {
- Particle p = (Particle) particles.get(i);
- p.run();
- if (p.dead()) {
- particles.remove(i);
- }
- }
- }
-
- // Method to add a force vector to all particles currently in the system
- void add_force(PVector dir) {
- for (int i = particles.size()-1; i >= 0; i--) {
- Particle p = (Particle) particles.get(i);
- p.add_force(dir);
- }
-
- }
-
- void addParticle() {
- particles.add(new Particle(origin,img));
- }
-
- void addParticle(Particle p) {
- particles.add(p);
- }
-
- // A method to test if the particle system still has particles
- boolean dead() {
- if (particles.isEmpty()) {
- return true;
- } else {
- return false;
- }
- }
-
-}
-
diff --git a/android/examples/Topics/Simulate/SmokeParticleSystem/SmokeParticleSystem.pde b/android/examples/Topics/Simulate/SmokeParticleSystem/SmokeParticleSystem.pde
deleted file mode 100644
index 2cf672118b..0000000000
--- a/android/examples/Topics/Simulate/SmokeParticleSystem/SmokeParticleSystem.pde
+++ /dev/null
@@ -1,69 +0,0 @@
-/**
- * Smoke Particle System
- * by Daniel Shiffman.
- *
- * A basic smoke effect using a particle system.
- * Each particle is rendered as an alpha masked image.
- */
-
-ParticleSystem ps;
-Random generator;
-
-void setup() {
-
- size(640, 200);
- colorMode(RGB, 255, 255, 255, 100);
-
- // Using a Java random number generator for Gaussian random numbers
- generator = new Random();
-
- // Create an alpha masked image to be applied as the particle's texture
- PImage msk = loadImage("texture.gif");
- PImage img = new PImage(msk.width,msk.height);
- for (int i = 0; i < img.pixels.length; i++) img.pixels[i] = color(255);
- img.mask(msk);
- ps = new ParticleSystem(0, new PVector(width/2,height-20 ),img);
-
- smooth();
-}
-
-void draw() {
- background(75);
-
- // Calculate a "wind" force based on mouse horizontal position
- float dx = (mouseX - width/2) / 1000.0;
- PVector wind = new PVector(dx,0,0);
- displayVector(wind,width/2,50,500);
- ps.add_force(wind);
- ps.run();
- for (int i = 0; i < 2; i++) {
- ps.addParticle();
- }
-}
-
- void displayVector(PVector v, float x, float y, float scayl) {
- pushMatrix();
- float arrowsize = 4;
- // Translate to location to render vector
- translate(x,y);
- stroke(255);
- // Call vector heading function to get direction (note that pointing up is a heading of 0) and rotate
- rotate(v.heading());
- // Calculate length of vector & scale it to be bigger or smaller if necessary
- float len = v.mag()*scayl;
- // Draw three lines to make an arrow (draw pointing up since we've rotate to the proper direction)
- line(0,0,len,0);
- line(len,0,len-arrowsize,+arrowsize/2);
- line(len,0,len-arrowsize,-arrowsize/2);
- popMatrix();
- }
-
-
-
-
-
-
-
-
-
-
diff --git a/android/examples/Topics/Simulate/SmokeParticleSystem/data/texture.gif b/android/examples/Topics/Simulate/SmokeParticleSystem/data/texture.gif
deleted file mode 100644
index 17e84e8067..0000000000
Binary files a/android/examples/Topics/Simulate/SmokeParticleSystem/data/texture.gif and /dev/null differ
diff --git a/android/examples/Topics/Simulate/SoftBody/SoftBody.pde b/android/examples/Topics/Simulate/SoftBody/SoftBody.pde
deleted file mode 100644
index 9372af3899..0000000000
--- a/android/examples/Topics/Simulate/SoftBody/SoftBody.pde
+++ /dev/null
@@ -1,99 +0,0 @@
-/**
- * Soft Body
- * by Ira Greenberg.
- *
- * Softbody dynamics simulation using curveVertex() and curveTightness().
- */
-
-// center point
-float centerX = 0, centerY = 0;
-
-float radius = 45, rotAngle = -90;
-float accelX, accelY;
-float springing = .0009, damping = .98;
-
-//corner nodes
-int nodes = 5;
-float nodeStartX[] = new float[nodes];
-float nodeStartY[] = new float[nodes];
-float[]nodeX = new float[nodes];
-float[]nodeY = new float[nodes];
-float[]angle = new float[nodes];
-float[]frequency = new float[nodes];
-
-// soft-body dynamics
-float organicConstant = 1;
-
-void setup() {
- size(640, 360);
- //center shape in window
- centerX = width/2;
- centerY = height/2;
- // iniitalize frequencies for corner nodes
- for (int i=0; i left && mouseX < right && mouseY > ps && mouseY < ps + s_height) {
- over = true;
- } else {
- over = false;
- }
-
- // Set and constrain the position of top bar
- if(move) {
- ps = mouseY - s_height/2;
- if (ps < min) { ps = min; }
- if (ps > max) { ps = max; }
- }
-}
-
-void mousePressed() {
- if(over) {
- move = true;
- }
-}
-
-void mouseReleased()
-{
- move = false;
-}
diff --git a/android/examples/Topics/Simulate/Springs/Springs.pde b/android/examples/Topics/Simulate/Springs/Springs.pde
deleted file mode 100644
index c615d48191..0000000000
--- a/android/examples/Topics/Simulate/Springs/Springs.pde
+++ /dev/null
@@ -1,162 +0,0 @@
-/**
- * Springs.
- *
- * Move the mouse over one of the circles and click to re-position.
- * When you release the mouse, it will snap back into position.
- * Each circle has a slightly different behavior.
- */
-
-
-int num = 3;
-Spring[] springs = new Spring[num];
-
-void setup()
-{
- size(200, 200);
- noStroke();
- smooth();
- springs[0] = new Spring( 70, 160, 20, 0.98, 8.0, 0.1, springs, 0);
- springs[1] = new Spring(150, 110, 60, 0.95, 9.0, 0.1, springs, 1);
- springs[2] = new Spring( 40, 70, 120, 0.90, 9.9, 0.1, springs, 2);
-}
-
-void draw()
-{
- background(51);
-
- for (int i = 0; i < num; i++) {
- springs[i].update();
- springs[i].display();
- }
-}
-
-void mousePressed()
-{
- for (int i = 0; i < num; i++) {
- springs[i].pressed();
- }
-}
-
-void mouseReleased()
-{
- for (int i=0; i width) || (location.x < 0)) {
- velocity.x = velocity.x * -1;
- }
- if (location.y > height) {
- // We're reducing velocity ever so slightly
- // when it hits the bottom of the window
- velocity.y = velocity.y * -0.95;
- location.y = height;
- }
-
- // Display circle at location vector
- stroke(255);
- strokeWeight(2);
- fill(127);
- ellipse(location.x,location.y,48,48);
-}
-
-
diff --git a/android/examples/Topics/Vectors/Normalize/Normalize.pde b/android/examples/Topics/Vectors/Normalize/Normalize.pde
deleted file mode 100644
index 95bd8525a8..0000000000
--- a/android/examples/Topics/Vectors/Normalize/Normalize.pde
+++ /dev/null
@@ -1,37 +0,0 @@
-/**
- * Normalize
- * by Daniel Shiffman.
- *
- * Demonstration of normalizing a vector.
- * Normalizing a vector sets its length to 1.
- */
-
-void setup() {
- size(640,360);
- smooth();
-}
-
-void draw() {
- background(0);
-
- // A vector that points to the mouse location
- PVector mouse = new PVector(mouseX,mouseY);
- // A vector that points to the center of the window
- PVector center = new PVector(width/2,height/2);
- // Subtract center from mouse which results in a vector that points from center to mouse
- mouse.sub(center);
-
- // Normalize the vector
- mouse.normalize();
-
- // Multiply its length by 50
- mouse.mult(150);
-
- translate(width/2,height/2);
- // Draw the resulting vector
- stroke(255);
- line(0,0,mouse.x,mouse.y);
-
-}
-
-
diff --git a/android/examples/Topics/Vectors/VectorMath/VectorMath.pde b/android/examples/Topics/Vectors/VectorMath/VectorMath.pde
deleted file mode 100644
index fcc609234b..0000000000
--- a/android/examples/Topics/Vectors/VectorMath/VectorMath.pde
+++ /dev/null
@@ -1,37 +0,0 @@
-/**
- * Vector
- * by Daniel Shiffman.
- *
- * Demonstration some basic vector math: subtraction, normalization, scaling
- * Normalizing a vector sets its length to 1.
- */
-
-void setup() {
- size(640,360);
- smooth();
-}
-
-void draw() {
- background(0);
-
- // A vector that points to the mouse location
- PVector mouse = new PVector(mouseX,mouseY);
- // A vector that points to the center of the window
- PVector center = new PVector(width/2,height/2);
- // Subtract center from mouse which results in a vector that points from center to mouse
- mouse.sub(center);
-
- // Normalize the vector
- mouse.normalize();
-
- // Multiply its length by 150 (Scaling its length)
- mouse.mult(150);
-
- translate(width/2,height/2);
- // Draw the resulting vector
- stroke(255);
- line(0,0,mouse.x,mouse.y);
-
-}
-
-
diff --git a/android/icons/icon-36.png b/android/icons/icon-36.png
deleted file mode 100644
index 3582c162de..0000000000
Binary files a/android/icons/icon-36.png and /dev/null differ
diff --git a/android/icons/icon-48.png b/android/icons/icon-48.png
deleted file mode 100644
index 3df054e298..0000000000
Binary files a/android/icons/icon-48.png and /dev/null differ
diff --git a/android/icons/icon-72.png b/android/icons/icon-72.png
deleted file mode 100644
index d57f1cc14c..0000000000
Binary files a/android/icons/icon-72.png and /dev/null differ
diff --git a/android/theme/buttons.gif b/android/theme/buttons.gif
deleted file mode 100644
index 0eccd6f6f5..0000000000
Binary files a/android/theme/buttons.gif and /dev/null differ
diff --git a/android/theme/tab-sel-left.gif b/android/theme/tab-sel-left.gif
deleted file mode 100644
index 426f75a11e..0000000000
Binary files a/android/theme/tab-sel-left.gif and /dev/null differ
diff --git a/android/theme/tab-sel-menu.gif b/android/theme/tab-sel-menu.gif
deleted file mode 100644
index 6b608c6e77..0000000000
Binary files a/android/theme/tab-sel-menu.gif and /dev/null differ
diff --git a/android/theme/tab-sel-mid.gif b/android/theme/tab-sel-mid.gif
deleted file mode 100644
index 3ae1ae3a74..0000000000
Binary files a/android/theme/tab-sel-mid.gif and /dev/null differ
diff --git a/android/theme/tab-sel-right.gif b/android/theme/tab-sel-right.gif
deleted file mode 100644
index 8258d441a9..0000000000
Binary files a/android/theme/tab-sel-right.gif and /dev/null differ
diff --git a/android/theme/tab-unsel-left.gif b/android/theme/tab-unsel-left.gif
deleted file mode 100644
index f36fcee083..0000000000
Binary files a/android/theme/tab-unsel-left.gif and /dev/null differ
diff --git a/android/theme/tab-unsel-menu.gif b/android/theme/tab-unsel-menu.gif
deleted file mode 100644
index 6ddc3d2e8c..0000000000
Binary files a/android/theme/tab-unsel-menu.gif and /dev/null differ
diff --git a/android/theme/tab-unsel-mid.gif b/android/theme/tab-unsel-mid.gif
deleted file mode 100644
index ea74498e57..0000000000
Binary files a/android/theme/tab-unsel-mid.gif and /dev/null differ
diff --git a/android/theme/tab-unsel-right.gif b/android/theme/tab-unsel-right.gif
deleted file mode 100644
index 53f7919cb5..0000000000
Binary files a/android/theme/tab-unsel-right.gif and /dev/null differ
diff --git a/android/theme/theme.txt b/android/theme/theme.txt
deleted file mode 100644
index e1c4c94baa..0000000000
--- a/android/theme/theme.txt
+++ /dev/null
@@ -1,80 +0,0 @@
-# GUI - STATUS
-status.notice.fgcolor = #000000
-#status.notice.bgcolor = #808080
-#status.notice.bgcolor = #819e48
-status.notice.bgcolor = #94a697
-status.error.fgcolor = #ffffff
-status.error.bgcolor = #66002c
-status.edit.fgcolor = #000000
-#status.edit.bgcolor = #cc9900
-status.edit.bgcolor = #94a697
-status.font = SansSerif,plain,12
-#status.font.macosx = Helvetica,plain,12
-
-# GUI - TABS
-# settings for the tabs at the top
-# (tab images are stored in the lib/theme folder)
-header.bgcolor = #94a697
-header.text.selected.color = #000000
-header.text.unselected.color = #ffffff
-header.text.font = SansSerif,plain,12
-#header.text.font.macosx = Helvetica,plain,12
-
-# GUI - CONSOLE
-# font is handled by preferences, since size/etc is modifiable
-console.color = #000000
-console.output.color = #cccccc
-#console.error.color = #ff3000
-console.error.color = #f2a4c6
-
-# GUI - BUTTONS
-buttons.bgcolor = #5d715f
-buttons.status.font = SansSerif,plain,12
-#buttons.status.font.macosx = Helvetica,plain,12
-buttons.status.color = #ffffff
-
-# GUI - MODE
-mode.button.bgcolor = #5d715f
-mode.button.font = SansSerif,plain,9
-#mode.button.font.macosx = Helvetica,plain,9
-mode.button.color = #acbdaf
-
-# GUI - LINESTATUS - editor line number status bar at the bottom of the screen
-linestatus.color = #ffffff
-linestatus.bgcolor = #364d39
-linestatus.font = SansSerif,plain,10
-#linestatus.font.macosx = Helvetica,plain,10
-linestatus.height = 20
-
-
-# EDITOR - DETAILS
-
-# foreground and background colors
-editor.fgcolor = #000000
-editor.bgcolor = #ffffff
-
-# highlight for the current line
-editor.linehighlight.color=#e2e2e2
-# highlight for the current line
-editor.linehighlight=true
-
-# caret blinking and caret color
-editor.caret.color = #333300
-
-# color to be used for background when 'external editor' enabled
-editor.external.bgcolor = #c8d2dc
-
-# selection color
-#editor.selection.color = #ffcc00
-editor.selection.color = #d1dbbb
-
-# area that's not in use by the text (replaced with tildes)
-editor.invalid.style = #7e7e7e,bold
-
-# little pooties at the end of lines that show where they finish
-editor.eolmarkers = false
-editor.eolmarkers.color = #999999
-
-# bracket/brace highlighting
-editor.brackethighlight = true
-editor.brackethighlight.color = #006699
diff --git a/android/todo.txt b/android/todo.txt
deleted file mode 100644
index e3b7356414..0000000000
--- a/android/todo.txt
+++ /dev/null
@@ -1,377 +0,0 @@
-0216 android
-X Update documentation and tools for Android SDK Tools revision 21
-X http://code.google.com/p/processing/issues/detail?id=1398
-X update Wiki to reflect no need for Google APIs
-o instructions on installing the usb driver for windows
-o http://developer.android.com/sdk/win-usb.html
-o need to post android examples
-o check out andres' changes for PShape
-X look into touch event code, see if there's a good way to integrate
-o make a decision on how to integrate touch event code
-X punting until later
-X add clear and close to all stream methods?
-X http://code.google.com/p/processing/issues/detail?id=244
-X check on this, fixed one, all set
-o gui stuff: http://hg.postspectacular.com/cp5magic/wiki/Home
-X OpenGL sketches crashes on older Android devices
-X http://code.google.com/p/processing/issues/detail?id=1455
-X remove mouseEvent and keyEvent variables (deprecated on desktop)
-
-earlier
-X inside AndroidPreprocessor
-X processing.mode.java.JavaBuild.scrubComments(sketch.getCode(0).getProgram())
-X PApplet.match(scrubbed, processing.mode.java.JavaBuild.SIZE_REGEX);
-X clean up earlier when size() stuff was moved up
-o test libraries on android
-X Implement a way to include the resources directory of an Android app
-X USB host and NFC reader need other changes to the app hierarchy to work
-X http://code.google.com/p/processing/issues/detail?id=767
-X Error for "android create avd" when the AVD is already installed
-X http://code.google.com/p/processing/issues/detail?id=614
-
-_ requires deleting the app before reinstalling
-_ just fix this like the others
-debug:
-Failure [INSTALL_PARSE_FAILED_INCONSISTENT_CERTIFICATES]
-Shutting down any existing adb server...
-
-_ NullPointerException in AndroidBuild.writeLocalProps(AndroidBuild.java:458)
-_ prompts for SDK, works; then after restart breaks again
-_ also refers to ANDROID_HOME and not ANDROID_SDK..
-_ are we using the right one these days?
-_ http://code.google.com/p/processing/issues/detail?id=979
-_ this one is difficult to reproduce
-
-_ implement Android version of command line tools
-_ http://code.google.com/p/processing/issues/detail?id=1323
-
-_ Android emulator doesn't always start on the first attempt
-_ emulator not starting up on OS X?
-_ http://code.google.com/p/processing/issues/detail?id=1210
-
-_ Android OPENGL renderer + JAVA2D PGraphics results in PTexture exception
-_ http://code.google.com/p/processing/issues/detail?id=1019
-
-_ focus handling note:
-_ http://android-developers.blogspot.com/2011/11/making-android-games-that-play-nice.html
-
-_ if a sketch asks for Android mode but it's not available
-_ (after a double-click)
-_ you get the "is android installed"? dialog, then it re-opens again
-_ without closing the other
-
-_ don't let the examples get overwritten with mode settings, manifest, etc
-_ the whole sketch.properties thing is yech
-
-_ add INTERNET permissions to the android net examples
-_ or other necessary permissions for other examples
-
-_ go through all basics/topics examples
-_ remove those that don't make sense with android
-_ remove size() commands from most/all
-_ (or remove ones that truly require size...)
-_ optimize for android use
-_ need to set permissions as necessary (therefore add manifest files)
-
-lifecycle/size changes/etc
-_ need to smooth out screen orientation changes
-_ g2 and g3 are no longer disposed on pause (0195), but probably should be
-_ they're deleted when dispose() is called (on exit())
-_ add registered methods again
-_ need to figure out generic event queueing first
-_ may need a different subset of methods, and introduce new ones
-_ that will be usable on both android and desktop
-_ dispose() was calling disposeMethods.handle(), but they're null
-_ possible major issue with sketches not quitting out of run() when in bg
-_ pause needs to actually kill the thread
-_ returning from pause needs to reset the clock
-_ this is currently draining batteries
-_ thread is continually running - 'inside handleDraw()' running continually
-_ inside run() it shouldn't still be going
-_ avoid sketch restart on orientation change
-_ need sizeChanged() method...
-_ also add the param to the xml file saying that it can deal w/ rotation
-_ https://github.com/processing/processing/issues/1640
-
-_ re: android libraries, from shawn van every
-The most powerful part were the libraries (and the ease with which they could be developed). Location, SMS, Camera/Video, Bluetooth (for Arduino integration) and PClient/PRequest were by far the most used. The ones that came with it, plus the ones from MJSoft were good though I ended up making a couple of very specific ones for my students: http://www.mobvcasting.com/wp/?cat=4
-
-_ process trackball events (they're only deltas)
-_ implement link()
-
-_ error in 'create avd' with "Emulator already exists" when it needs an upgrade
-_ or cannot be used with the current setup
-_ use 'android list avds' on the command line to see the problem in this case
-_ when there's a 'create avd' error, things still keep running. yay!
-
-_ need to do this for utf8: "overridable Ant javac properties: java.encoding"
-_ new for sdk tools r8, it's using ascii as the default, we're utf-8
-
-_ don't give user a "User cancelled attempt to find SDK" error message
-_ it's annoying.. they f*king know they just did that
-_ also gives an error if it unsets the sdk path itself, saying that the
-_ environment variable isn't set. which isn't true--it's set, but it doesn't
-_ think the location is valid, which is totally different.
-_ ...because it's ignoring the exception messages that come in from trying
-_ to create the new sdk object
-
-_ need to do something to make it easier to do new screen sizes.
-
-_ sketches must be removed manually if the debug keystore changes
-_ http://code.google.com/p/processing/issues/detail?id=236
-
-_ "failed to get signature key" problem
-_ Caused by: /Users/aandnota/Documents/android-sdk-mac_x86/tools/ant/ant_rules_r3.xml:209: com.android.sdklib.build.ApkCreationException: Unable to get debug signature key
-
-_ saveStream() on processing-android-core.zip breaks behind firewall
-_ downloads a 5kb html login page rather than the correct file
-
-_ salaryper crashed when connecting to ctr500 and was re-routed
-_ instead of sending back the gzip file, sent the error page
-_ unlike java, where a 404 would give us null data
-
-add to wiki
-_ add to wiki: 1MB file size is max for data folder
-_ Data exceeds UNCOMPRESS_DATA_MAX (11840328 vs 1048576)
-_ File storage = android.os.Environment.getExternalStorageDirectory();
-_ File folder = new File(storage, "awesomeapp");
-_ also check the data folder on run/export
-_ add to wiki: orientation(PORTRAIT) and orientation(LANDSCAPE)
-_ add to keywords.txt
-_ ctrl-F12 (ctrl-fn-f12 on mac) will rotate the emulator
-
-android menu
-_ something to bring up the full console window
-_ signing tool
-_ selection of which avd (emulator), or plugged-in devices (if multiple)
-
-_ throw an error if a file in the 'data' dir ends with .gz
-
-_ on export (application)
-_ increment manifest/android:versionCode each time 'export' is called
-_ Remove the android:debuggable="true" attribute from
-_ provide manifest/android:versionName ('pretty' version number)
-_ setting the default package: manifest/package
-_ application/android:label
-_ used on home screen, manage applications, my downloads, etc
-_ http://developer.android.com/guide/publishing/preparing.html
-_ implement certificates (self-signed) for distribution
-_ http://developer.android.com/guide/publishing/app-signing.html
-_ http://code.google.com/p/processing/issues/detail?id=222
-create new keystore
-location: [ ] (browse)
-password: [ ]
-confirm: [ ]
-...then asks for
-alias, password, confirm, validity (years)
-first/last name, ounit, org, city/locale, state/province, country code (xx)
-
-_ StreamPump has been quieted, but maybe this needs to be a global log setting
-
-_ seems to have problems on 64-bit windows
-_ removing local version of java helped someone fix it
-
-_ don't let the keystore message show up in red
-_ Using keystore: /Users/fry/.android/debug.keystore
-
-_ for libraries that don't work with android, don't let them export
-_ http://code.google.com/p/processing/issues/detail?id=248
-_ add line for export in libraries to say whether they're compatible
-_ even just 'android=' will be ok
-_ or 'mode=java,android,python'
-
-_ error messages in runner that are handled special (OOME) need different
-_ handling for android vs others.. argh
-
-_ clean up changes from andres
-_ what is resetLights() in PGraphics?
-_ remove model() method from end of PApplet (make it shape(PShape))
-_ PShape examples are totally broken
-
-P1 this is embarrassing, need to fix ASAP
-P2 need to fix before beta release
-P3 would like to fix before final release
-P4 not an immediate need, but very nice to have
-P5 nice to have
-
-. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
-
-
-CORE (PApplet, P2D et al)
-
-_ implement blendMode() for Android
-_ should be fairly straightforward given Java2D implementation
-_ http://code.google.com/p/processing/issues/detail?id=1386
-_ Finish implementation of OPEN and CHORD drawing modes for arc()
-_ http://code.google.com/p/processing/issues/detail?id=1405
-
-_ images resized with default renderer on Android are pixelated
-_ http://code.google.com/p/processing/issues/detail?id=552
-
-_ implement tap detection and set correct click count for mouseClicked()
-_ mouseClicked is currently not fired at all (no direct match on Android)
-_ http://code.google.com/p/processing/issues/detail?id=215
-_ keyTyped() does not exist on Android
-_ http://code.google.com/p/processing/issues/detail?id=1489
-_ implement multiple pointers and multi-touch
-_ http://code.google.com/p/processing/issues/detail?id=243
-
-_ Examples > Topics > Effects > Lens uses a ton of memory
-
-
-. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
-
-
-TOOLS
-
-_ errors in ActivityManager aren't coming through
-_ if AVD is deleted while processing still running, things flake out
-_ also no error messages, just 'giving up on launching emulator'
-
-// jdf maybedone
-_ when out of memory, need an error message to show up in the PDE
-_ show "OutOfMemoryError: bitmap size exceeds VM budget" in status area
-_ Examples > Topics > Drawing > Animator produces:
-_ Uncaught handler: thread Animation Thread exiting due to uncaught exception
-_ java.lang.OutOfMemoryError: bitmap size exceeds VM budget
-_ at android.graphics.Bitmap.nativeCreate(Native Method)
-
-// jdf maybedone
-_ stack overflow produced no error inside the PDE
-_ probably same as memory error above
-
-// jdf maybedone
-_ if hitting 'run' in p5, need to kill any sketch that's currently running
-
-_ need to make data folder copy more efficient than just copying everything
-_ right now, first copies to src inside Build.java (which then copies to bin)
-
-// jdf maybedone
-_ other exceptions coming through System.err
-W/System.err( 242): java.lang.IllegalArgumentException: File /data/data/processing.android.test.savemanyimages/files/circles-0001.tif contains a path separator
-W/System.err( 242): at android.app.ApplicationContext.makeFilename(ApplicationContext.java:1444)
-W/System.err( 242): at android.app.ApplicationContext.openFileOutput(ApplicationContext.java:386)
-W/System.err( 242): at android.content.ContextWrapper.openFileOutput(ContextWrapper.java:158)
-W/System.err( 242): at processing.core.PApplet.createOutput(PApplet.java:3677)
-
-P1
-_ no ES2 in the emulator, and no error reported in the PDE
-_ problem is probably that the error comes via E/AndroidRuntime
-_ java.lang.RuntimeException: Unable to start activity ComponentInfo{processing.test.fisheye/processing.test.fisheye.FishEye}: java.lang.RuntimeException: P3D: OpenGL ES 2.0 is not supported by this device.
-_ http://developer.android.com/tools/devices/emulator.html
-_ http://code.google.com/p/processing/issues/detail?id=1059
-
-P2
-_ move the Android tools into its own source package in SVN
-_ started, but needs proper Tool or Mode packaging
-_ http://code.google.com/p/processing/issues/detail?id=206
-_ implement method for selecting the AVD
-_ http://code.google.com/p/processing/issues/detail?id=208
-_ implement means to use Intel version of the emulator
-_ need to verify if this is much faster or not
-_ http://developer.android.com/tools/devices/emulator.html
-_ http://android-developers.blogspot.com/2012/04/faster-emulator-with-better-hardware.html
-
-P3 _ for now, only runs on the first device (findDevice()) found
-P3 _ --> implement selector to choose the default device for debugging
-P3 _ http://code.google.com/p/processing/issues/detail?id=207
-P3 _ if different machines, debug.keystore changes, requiring manual removal
-P3 _ or find a way to do it automatically with processing
-P3 _ adb -s HT91MLC00031 install -r sketchbook/Hue/android/bin/Hue-debug.apk
-P3 _ pkg: /data/local/tmp/Hue-debug.apk
-P3 _ Failure [INSTALL_PARSE_FAILED_INCONSISTENT_CERTIFICATES]
-P3 _ why does this result return 0?
-P3 _ can't keep it with the sketch, don't want to give away private key
-P3 _ with different machines, users are required to remove signature
-P3 _ add a method to remove an application if the debug key is different
-P3 _ perhaps the first time an application is installed, remove it?
-P3 _ http://code.google.com/p/processing/issues/detail?id=236
-P3 _ library support also needs android manifest changes
-P3 _ http://code.google.com/p/processing/issues/detail?id=225
-
-_ implement automatic download/install of android tools
-_ also need to install USB Driver on Windows, and set device rules on Linux
-_ http://code.google.com/p/processing/issues/detail?id=203
-
-. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
-
-
-EXAMPLES
-
-_ simple example of reading the compass (also note that won't work w/ sim)
-_ and also the gps, i assume (can do fake data w/ sim)
-
-
-. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
-
-
-SAVED FOR LATER
-
-_ may need to add screen orientation as a built-in function
-_ fairly common to use, and otherwise needs an obscure import
-
-_ possibility of doing a compile (not run) using straight javac?
-_ this would be a faster way to check for errors
-_ w/o needing to use the incredibly slow android tools
-
-_ maybe the back button shouldn't quit apps, the home button should?
-_ back button use in apps is so infuriating...
-
-_ separate "PApplet" into separate View and Activity classes
-_ http://code.google.com/p/processing/issues/detail?id=212
-_ re-implement to use Fragment API
-_ and what about daydream or widgets or whatever?
-_ http://code.google.com/p/processing/issues/detail?id=1335
-_ implement size() and createGraphics() for arbitrary renderers
-_ http://code.google.com/p/processing/issues/detail?id=241
-
-
-. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
-
-
-OPTIMIZE / ENHANCEMENTS
-
-_ don't re-calculate stroke() or fill() when it's the same value
-_ should path.reset() or path.rewind() be used for a path to be reused?
-
-_ errors that cause a crash when setting sketchPath
-_ seems to be a filesystem that got too full
-_ no real signs of what went wrong, but deleting the avd fixed it
-_ if it reappears again, trap that condition, and tell the user the fix
-
-_ show/hide the virtual keyboard
-InputMethodManager imm =
- (InputMethodManager) getSystemService(Context.INPUT_METHOD_SERVICE);
-imm.showSoftInput(surfaceView, 0);
-
-_ list contents of data folder (assets folder)
- try {
- PApplet.println(assets.list(""));
- } catch (IOException e) {
- e.printStackTrace();
- }
-
-_ excessive memory use indicator
-_ D/dalvikvm( 1205): GC freed 814 objects / 523352 bytes in 58ms
-_ could help show when lots of memory are being used
-
-try {
- File root = Environment.getExternalStorageDirectory();
- if (root.canWrite()){
- File gpxfile = new File(root, "gpxfile.gpx");
- FileWriter gpxwriter = new FileWriter(gpxfile);
- BufferedWriter out = new BufferedWriter(gpxwriter);
- out.write("Hello world");
- out.close();
- }
-} catch (IOException e) {
- Log.e(TAG, "Could not write file " + e.getMessage());
-}
-
-_ application local storage: context.getFilesDir().getPath()
-"For those of you interested, the internal 8GB of storage on the phone
-is mounted at /emmc (r/w mode, of course) and microSD cards still
-shows up normally at /sdcard as expected."
-
-_ other useful tidbits (handlers etc)
-_ http://developer.android.com/guide/appendix/faq/commontasks.html
diff --git a/app/.classpath b/app/.classpath
index 77e9753160..72c3737104 100644
--- a/app/.classpath
+++ b/app/.classpath
@@ -1,25 +1,13 @@
-
-
-
-
-
-
-
-
-
-
-
-
+
-
-
+
diff --git a/app/.gitignore b/app/.gitignore
index 51f7f5c15e..81e75864d6 100644
--- a/app/.gitignore
+++ b/app/.gitignore
@@ -1,3 +1,2 @@
bin
-generated
pde.jar
diff --git a/app/.settings/org.eclipse.jdt.core.prefs b/app/.settings/org.eclipse.jdt.core.prefs
index da7176c57b..af36b24305 100644
--- a/app/.settings/org.eclipse.jdt.core.prefs
+++ b/app/.settings/org.eclipse.jdt.core.prefs
@@ -5,9 +5,10 @@ org.eclipse.jdt.core.compiler.annotation.nonnullbydefault=org.eclipse.jdt.annota
org.eclipse.jdt.core.compiler.annotation.nullable=org.eclipse.jdt.annotation.Nullable
org.eclipse.jdt.core.compiler.annotation.nullanalysis=disabled
org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
-org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.6
+org.eclipse.jdt.core.compiler.codegen.methodParameters=do not generate
+org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.8
org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve
-org.eclipse.jdt.core.compiler.compliance=1.6
+org.eclipse.jdt.core.compiler.compliance=1.8
org.eclipse.jdt.core.compiler.debug.lineNumber=generate
org.eclipse.jdt.core.compiler.debug.localVariable=generate
org.eclipse.jdt.core.compiler.debug.sourceFile=generate
@@ -92,8 +93,13 @@ org.eclipse.jdt.core.compiler.problem.unusedParameterWhenOverridingConcrete=disa
org.eclipse.jdt.core.compiler.problem.unusedPrivateMember=warning
org.eclipse.jdt.core.compiler.problem.unusedWarningToken=warning
org.eclipse.jdt.core.compiler.problem.varargsArgumentNeedCast=warning
-org.eclipse.jdt.core.compiler.source=1.6
+org.eclipse.jdt.core.compiler.source=1.8
+org.eclipse.jdt.core.formatter.align_assignment_statements_on_columns=false
+org.eclipse.jdt.core.formatter.align_fields_grouping_blank_lines=2147483647
org.eclipse.jdt.core.formatter.align_type_members_on_columns=false
+org.eclipse.jdt.core.formatter.align_variable_declarations_on_columns=false
+org.eclipse.jdt.core.formatter.align_with_spaces=false
+org.eclipse.jdt.core.formatter.alignment_for_additive_operator=16
org.eclipse.jdt.core.formatter.alignment_for_arguments_in_allocation_expression=18
org.eclipse.jdt.core.formatter.alignment_for_arguments_in_annotation=0
org.eclipse.jdt.core.formatter.alignment_for_arguments_in_enum_constant=16
@@ -102,24 +108,39 @@ org.eclipse.jdt.core.formatter.alignment_for_arguments_in_method_invocation=18
org.eclipse.jdt.core.formatter.alignment_for_arguments_in_qualified_allocation_expression=16
org.eclipse.jdt.core.formatter.alignment_for_assignment=0
org.eclipse.jdt.core.formatter.alignment_for_binary_expression=16
+org.eclipse.jdt.core.formatter.alignment_for_bitwise_operator=16
org.eclipse.jdt.core.formatter.alignment_for_compact_if=16
+org.eclipse.jdt.core.formatter.alignment_for_compact_loops=16
org.eclipse.jdt.core.formatter.alignment_for_conditional_expression=80
+org.eclipse.jdt.core.formatter.alignment_for_conditional_expression_chain=0
org.eclipse.jdt.core.formatter.alignment_for_enum_constants=0
org.eclipse.jdt.core.formatter.alignment_for_expressions_in_array_initializer=36
+org.eclipse.jdt.core.formatter.alignment_for_expressions_in_for_loop_header=0
+org.eclipse.jdt.core.formatter.alignment_for_logical_operator=16
org.eclipse.jdt.core.formatter.alignment_for_method_declaration=0
+org.eclipse.jdt.core.formatter.alignment_for_module_statements=16
org.eclipse.jdt.core.formatter.alignment_for_multiple_fields=16
+org.eclipse.jdt.core.formatter.alignment_for_multiplicative_operator=16
+org.eclipse.jdt.core.formatter.alignment_for_parameterized_type_references=0
org.eclipse.jdt.core.formatter.alignment_for_parameters_in_constructor_declaration=18
org.eclipse.jdt.core.formatter.alignment_for_parameters_in_method_declaration=18
+org.eclipse.jdt.core.formatter.alignment_for_relational_operator=0
org.eclipse.jdt.core.formatter.alignment_for_resources_in_try=80
org.eclipse.jdt.core.formatter.alignment_for_selector_in_method_invocation=16
+org.eclipse.jdt.core.formatter.alignment_for_shift_operator=0
+org.eclipse.jdt.core.formatter.alignment_for_string_concatenation=16
org.eclipse.jdt.core.formatter.alignment_for_superclass_in_type_declaration=16
org.eclipse.jdt.core.formatter.alignment_for_superinterfaces_in_enum_declaration=16
org.eclipse.jdt.core.formatter.alignment_for_superinterfaces_in_type_declaration=16
org.eclipse.jdt.core.formatter.alignment_for_throws_clause_in_constructor_declaration=16
org.eclipse.jdt.core.formatter.alignment_for_throws_clause_in_method_declaration=16
+org.eclipse.jdt.core.formatter.alignment_for_type_arguments=0
+org.eclipse.jdt.core.formatter.alignment_for_type_parameters=0
org.eclipse.jdt.core.formatter.alignment_for_union_type_in_multicatch=16
org.eclipse.jdt.core.formatter.blank_lines_after_imports=1
+org.eclipse.jdt.core.formatter.blank_lines_after_last_class_body_declaration=0
org.eclipse.jdt.core.formatter.blank_lines_after_package=1
+org.eclipse.jdt.core.formatter.blank_lines_before_abstract_method=1
org.eclipse.jdt.core.formatter.blank_lines_before_field=1
org.eclipse.jdt.core.formatter.blank_lines_before_first_class_body_declaration=0
org.eclipse.jdt.core.formatter.blank_lines_before_imports=1
@@ -128,6 +149,7 @@ org.eclipse.jdt.core.formatter.blank_lines_before_method=1
org.eclipse.jdt.core.formatter.blank_lines_before_new_chunk=1
org.eclipse.jdt.core.formatter.blank_lines_before_package=0
org.eclipse.jdt.core.formatter.blank_lines_between_import_groups=1
+org.eclipse.jdt.core.formatter.blank_lines_between_statement_group_in_switch=0
org.eclipse.jdt.core.formatter.blank_lines_between_type_declarations=1
org.eclipse.jdt.core.formatter.brace_position_for_annotation_type_declaration=end_of_line
org.eclipse.jdt.core.formatter.brace_position_for_anonymous_type_declaration=end_of_line
@@ -137,32 +159,38 @@ org.eclipse.jdt.core.formatter.brace_position_for_block_in_case=end_of_line
org.eclipse.jdt.core.formatter.brace_position_for_constructor_declaration=end_of_line
org.eclipse.jdt.core.formatter.brace_position_for_enum_constant=end_of_line
org.eclipse.jdt.core.formatter.brace_position_for_enum_declaration=end_of_line
+org.eclipse.jdt.core.formatter.brace_position_for_lambda_body=end_of_line
org.eclipse.jdt.core.formatter.brace_position_for_method_declaration=end_of_line
org.eclipse.jdt.core.formatter.brace_position_for_switch=end_of_line
org.eclipse.jdt.core.formatter.brace_position_for_type_declaration=end_of_line
+org.eclipse.jdt.core.formatter.comment.align_tags_descriptions_grouped=false
+org.eclipse.jdt.core.formatter.comment.align_tags_names_descriptions=false
org.eclipse.jdt.core.formatter.comment.clear_blank_lines_in_block_comment=false
org.eclipse.jdt.core.formatter.comment.clear_blank_lines_in_javadoc_comment=false
+org.eclipse.jdt.core.formatter.comment.count_line_length_from_starting_position=false
org.eclipse.jdt.core.formatter.comment.format_block_comments=true
org.eclipse.jdt.core.formatter.comment.format_header=false
org.eclipse.jdt.core.formatter.comment.format_html=true
org.eclipse.jdt.core.formatter.comment.format_javadoc_comments=true
-org.eclipse.jdt.core.formatter.comment.format_line_comments=false
+org.eclipse.jdt.core.formatter.comment.format_line_comments=true
org.eclipse.jdt.core.formatter.comment.format_source_code=true
org.eclipse.jdt.core.formatter.comment.indent_parameter_description=true
org.eclipse.jdt.core.formatter.comment.indent_root_tags=true
+org.eclipse.jdt.core.formatter.comment.indent_tag_description=false
org.eclipse.jdt.core.formatter.comment.insert_new_line_before_root_tags=insert
+org.eclipse.jdt.core.formatter.comment.insert_new_line_between_different_tags=do not insert
org.eclipse.jdt.core.formatter.comment.insert_new_line_for_parameter=insert
org.eclipse.jdt.core.formatter.comment.line_length=80
org.eclipse.jdt.core.formatter.comment.new_lines_at_block_boundaries=true
org.eclipse.jdt.core.formatter.comment.new_lines_at_javadoc_boundaries=true
org.eclipse.jdt.core.formatter.comment.preserve_white_space_between_code_and_line_comments=false
org.eclipse.jdt.core.formatter.compact_else_if=true
-org.eclipse.jdt.core.formatter.continuation_indentation=1
-org.eclipse.jdt.core.formatter.continuation_indentation_for_array_initializer=1
+org.eclipse.jdt.core.formatter.continuation_indentation=2
+org.eclipse.jdt.core.formatter.continuation_indentation_for_array_initializer=2
org.eclipse.jdt.core.formatter.disabling_tag=@formatter\:off
org.eclipse.jdt.core.formatter.enabling_tag=@formatter\:on
org.eclipse.jdt.core.formatter.format_guardian_clause_on_one_line=false
-org.eclipse.jdt.core.formatter.format_line_comment_starting_on_first_column=true
+org.eclipse.jdt.core.formatter.format_line_comment_starting_on_first_column=false
org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_annotation_declaration_header=true
org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_enum_constant_header=true
org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_enum_declaration_header=true
@@ -175,6 +203,7 @@ org.eclipse.jdt.core.formatter.indent_switchstatements_compare_to_cases=true
org.eclipse.jdt.core.formatter.indent_switchstatements_compare_to_switch=false
org.eclipse.jdt.core.formatter.indentation.size=2
org.eclipse.jdt.core.formatter.insert_new_line_after_annotation=insert
+org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_enum_constant=insert
org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_field=insert
org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_local_variable=insert
org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_member=insert
@@ -184,6 +213,7 @@ org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_parameter=do
org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_type=insert
org.eclipse.jdt.core.formatter.insert_new_line_after_label=do not insert
org.eclipse.jdt.core.formatter.insert_new_line_after_opening_brace_in_array_initializer=do not insert
+org.eclipse.jdt.core.formatter.insert_new_line_after_type_annotation=do not insert
org.eclipse.jdt.core.formatter.insert_new_line_at_end_of_file_if_missing=do not insert
org.eclipse.jdt.core.formatter.insert_new_line_before_catch_in_try_statement=do not insert
org.eclipse.jdt.core.formatter.insert_new_line_before_closing_brace_in_array_initializer=do not insert
@@ -197,11 +227,15 @@ org.eclipse.jdt.core.formatter.insert_new_line_in_empty_enum_constant=insert
org.eclipse.jdt.core.formatter.insert_new_line_in_empty_enum_declaration=insert
org.eclipse.jdt.core.formatter.insert_new_line_in_empty_method_body=insert
org.eclipse.jdt.core.formatter.insert_new_line_in_empty_type_declaration=insert
+org.eclipse.jdt.core.formatter.insert_space_after_additive_operator=insert
org.eclipse.jdt.core.formatter.insert_space_after_and_in_type_parameter=insert
+org.eclipse.jdt.core.formatter.insert_space_after_arrow_in_switch_case=insert
+org.eclipse.jdt.core.formatter.insert_space_after_arrow_in_switch_default=insert
org.eclipse.jdt.core.formatter.insert_space_after_assignment_operator=insert
org.eclipse.jdt.core.formatter.insert_space_after_at_in_annotation=do not insert
org.eclipse.jdt.core.formatter.insert_space_after_at_in_annotation_type_declaration=do not insert
org.eclipse.jdt.core.formatter.insert_space_after_binary_operator=insert
+org.eclipse.jdt.core.formatter.insert_space_after_bitwise_operator=insert
org.eclipse.jdt.core.formatter.insert_space_after_closing_angle_bracket_in_type_arguments=insert
org.eclipse.jdt.core.formatter.insert_space_after_closing_angle_bracket_in_type_parameters=insert
org.eclipse.jdt.core.formatter.insert_space_after_closing_brace_in_block=insert
@@ -228,9 +262,14 @@ org.eclipse.jdt.core.formatter.insert_space_after_comma_in_multiple_field_declar
org.eclipse.jdt.core.formatter.insert_space_after_comma_in_multiple_local_declarations=insert
org.eclipse.jdt.core.formatter.insert_space_after_comma_in_parameterized_type_reference=insert
org.eclipse.jdt.core.formatter.insert_space_after_comma_in_superinterfaces=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_switch_case_expressions=insert
org.eclipse.jdt.core.formatter.insert_space_after_comma_in_type_arguments=insert
org.eclipse.jdt.core.formatter.insert_space_after_comma_in_type_parameters=insert
org.eclipse.jdt.core.formatter.insert_space_after_ellipsis=insert
+org.eclipse.jdt.core.formatter.insert_space_after_lambda_arrow=insert
+org.eclipse.jdt.core.formatter.insert_space_after_logical_operator=insert
+org.eclipse.jdt.core.formatter.insert_space_after_multiplicative_operator=insert
+org.eclipse.jdt.core.formatter.insert_space_after_not_operator=do not insert
org.eclipse.jdt.core.formatter.insert_space_after_opening_angle_bracket_in_parameterized_type_reference=do not insert
org.eclipse.jdt.core.formatter.insert_space_after_opening_angle_bracket_in_type_arguments=do not insert
org.eclipse.jdt.core.formatter.insert_space_after_opening_angle_bracket_in_type_parameters=do not insert
@@ -255,13 +294,20 @@ org.eclipse.jdt.core.formatter.insert_space_after_postfix_operator=do not insert
org.eclipse.jdt.core.formatter.insert_space_after_prefix_operator=do not insert
org.eclipse.jdt.core.formatter.insert_space_after_question_in_conditional=insert
org.eclipse.jdt.core.formatter.insert_space_after_question_in_wildcard=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_relational_operator=insert
org.eclipse.jdt.core.formatter.insert_space_after_semicolon_in_for=insert
org.eclipse.jdt.core.formatter.insert_space_after_semicolon_in_try_resources=insert
+org.eclipse.jdt.core.formatter.insert_space_after_shift_operator=insert
+org.eclipse.jdt.core.formatter.insert_space_after_string_concatenation=insert
org.eclipse.jdt.core.formatter.insert_space_after_unary_operator=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_additive_operator=insert
org.eclipse.jdt.core.formatter.insert_space_before_and_in_type_parameter=insert
+org.eclipse.jdt.core.formatter.insert_space_before_arrow_in_switch_case=insert
+org.eclipse.jdt.core.formatter.insert_space_before_arrow_in_switch_default=insert
org.eclipse.jdt.core.formatter.insert_space_before_assignment_operator=insert
org.eclipse.jdt.core.formatter.insert_space_before_at_in_annotation_type_declaration=insert
org.eclipse.jdt.core.formatter.insert_space_before_binary_operator=insert
+org.eclipse.jdt.core.formatter.insert_space_before_bitwise_operator=insert
org.eclipse.jdt.core.formatter.insert_space_before_closing_angle_bracket_in_parameterized_type_reference=do not insert
org.eclipse.jdt.core.formatter.insert_space_before_closing_angle_bracket_in_type_arguments=do not insert
org.eclipse.jdt.core.formatter.insert_space_before_closing_angle_bracket_in_type_parameters=do not insert
@@ -305,9 +351,13 @@ org.eclipse.jdt.core.formatter.insert_space_before_comma_in_multiple_field_decla
org.eclipse.jdt.core.formatter.insert_space_before_comma_in_multiple_local_declarations=do not insert
org.eclipse.jdt.core.formatter.insert_space_before_comma_in_parameterized_type_reference=do not insert
org.eclipse.jdt.core.formatter.insert_space_before_comma_in_superinterfaces=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_switch_case_expressions=do not insert
org.eclipse.jdt.core.formatter.insert_space_before_comma_in_type_arguments=do not insert
org.eclipse.jdt.core.formatter.insert_space_before_comma_in_type_parameters=do not insert
org.eclipse.jdt.core.formatter.insert_space_before_ellipsis=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_lambda_arrow=insert
+org.eclipse.jdt.core.formatter.insert_space_before_logical_operator=insert
+org.eclipse.jdt.core.formatter.insert_space_before_multiplicative_operator=insert
org.eclipse.jdt.core.formatter.insert_space_before_opening_angle_bracket_in_parameterized_type_reference=do not insert
org.eclipse.jdt.core.formatter.insert_space_before_opening_angle_bracket_in_type_arguments=do not insert
org.eclipse.jdt.core.formatter.insert_space_before_opening_angle_bracket_in_type_parameters=do not insert
@@ -344,9 +394,12 @@ org.eclipse.jdt.core.formatter.insert_space_before_postfix_operator=do not inser
org.eclipse.jdt.core.formatter.insert_space_before_prefix_operator=do not insert
org.eclipse.jdt.core.formatter.insert_space_before_question_in_conditional=insert
org.eclipse.jdt.core.formatter.insert_space_before_question_in_wildcard=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_relational_operator=insert
org.eclipse.jdt.core.formatter.insert_space_before_semicolon=do not insert
org.eclipse.jdt.core.formatter.insert_space_before_semicolon_in_for=do not insert
org.eclipse.jdt.core.formatter.insert_space_before_semicolon_in_try_resources=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_shift_operator=insert
+org.eclipse.jdt.core.formatter.insert_space_before_string_concatenation=insert
org.eclipse.jdt.core.formatter.insert_space_before_unary_operator=do not insert
org.eclipse.jdt.core.formatter.insert_space_between_brackets_in_array_type_reference=do not insert
org.eclipse.jdt.core.formatter.insert_space_between_empty_braces_in_array_initializer=do not insert
@@ -358,20 +411,59 @@ org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_method_decla
org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_method_invocation=do not insert
org.eclipse.jdt.core.formatter.join_lines_in_comments=true
org.eclipse.jdt.core.formatter.join_wrapped_lines=true
+org.eclipse.jdt.core.formatter.keep_annotation_declaration_on_one_line=one_line_never
+org.eclipse.jdt.core.formatter.keep_anonymous_type_declaration_on_one_line=one_line_never
+org.eclipse.jdt.core.formatter.keep_code_block_on_one_line=one_line_never
org.eclipse.jdt.core.formatter.keep_else_statement_on_same_line=false
org.eclipse.jdt.core.formatter.keep_empty_array_initializer_on_one_line=false
+org.eclipse.jdt.core.formatter.keep_enum_constant_declaration_on_one_line=one_line_never
+org.eclipse.jdt.core.formatter.keep_enum_declaration_on_one_line=one_line_never
+org.eclipse.jdt.core.formatter.keep_if_then_body_block_on_one_line=one_line_never
org.eclipse.jdt.core.formatter.keep_imple_if_on_one_line=false
+org.eclipse.jdt.core.formatter.keep_lambda_body_block_on_one_line=one_line_never
+org.eclipse.jdt.core.formatter.keep_loop_body_block_on_one_line=one_line_never
+org.eclipse.jdt.core.formatter.keep_method_body_on_one_line=one_line_never
+org.eclipse.jdt.core.formatter.keep_simple_do_while_body_on_same_line=false
+org.eclipse.jdt.core.formatter.keep_simple_for_body_on_same_line=false
+org.eclipse.jdt.core.formatter.keep_simple_getter_setter_on_one_line=false
+org.eclipse.jdt.core.formatter.keep_simple_while_body_on_same_line=false
org.eclipse.jdt.core.formatter.keep_then_statement_on_same_line=false
+org.eclipse.jdt.core.formatter.keep_type_declaration_on_one_line=one_line_never
org.eclipse.jdt.core.formatter.lineSplit=80
org.eclipse.jdt.core.formatter.never_indent_block_comments_on_first_column=false
-org.eclipse.jdt.core.formatter.never_indent_line_comments_on_first_column=true
+org.eclipse.jdt.core.formatter.never_indent_line_comments_on_first_column=false
+org.eclipse.jdt.core.formatter.number_of_blank_lines_after_code_block=0
+org.eclipse.jdt.core.formatter.number_of_blank_lines_at_beginning_of_code_block=0
org.eclipse.jdt.core.formatter.number_of_blank_lines_at_beginning_of_method_body=0
+org.eclipse.jdt.core.formatter.number_of_blank_lines_at_end_of_code_block=0
+org.eclipse.jdt.core.formatter.number_of_blank_lines_at_end_of_method_body=0
+org.eclipse.jdt.core.formatter.number_of_blank_lines_before_code_block=0
org.eclipse.jdt.core.formatter.number_of_empty_lines_to_preserve=1
+org.eclipse.jdt.core.formatter.parentheses_positions_in_annotation=common_lines
+org.eclipse.jdt.core.formatter.parentheses_positions_in_catch_clause=common_lines
+org.eclipse.jdt.core.formatter.parentheses_positions_in_enum_constant_declaration=common_lines
+org.eclipse.jdt.core.formatter.parentheses_positions_in_for_statment=common_lines
+org.eclipse.jdt.core.formatter.parentheses_positions_in_if_while_statement=common_lines
+org.eclipse.jdt.core.formatter.parentheses_positions_in_lambda_declaration=common_lines
+org.eclipse.jdt.core.formatter.parentheses_positions_in_method_delcaration=common_lines
+org.eclipse.jdt.core.formatter.parentheses_positions_in_method_invocation=common_lines
+org.eclipse.jdt.core.formatter.parentheses_positions_in_switch_statement=common_lines
+org.eclipse.jdt.core.formatter.parentheses_positions_in_try_clause=common_lines
org.eclipse.jdt.core.formatter.put_empty_statement_on_new_line=true
org.eclipse.jdt.core.formatter.tabulation.char=space
org.eclipse.jdt.core.formatter.tabulation.size=2
+org.eclipse.jdt.core.formatter.text_block_indentation=0
org.eclipse.jdt.core.formatter.use_on_off_tags=false
org.eclipse.jdt.core.formatter.use_tabs_only_for_leading_indentations=false
+org.eclipse.jdt.core.formatter.wrap_before_additive_operator=true
+org.eclipse.jdt.core.formatter.wrap_before_assignment_operator=false
org.eclipse.jdt.core.formatter.wrap_before_binary_operator=true
+org.eclipse.jdt.core.formatter.wrap_before_bitwise_operator=true
+org.eclipse.jdt.core.formatter.wrap_before_conditional_operator=true
+org.eclipse.jdt.core.formatter.wrap_before_logical_operator=true
+org.eclipse.jdt.core.formatter.wrap_before_multiplicative_operator=true
org.eclipse.jdt.core.formatter.wrap_before_or_operator_multicatch=true
+org.eclipse.jdt.core.formatter.wrap_before_relational_operator=true
+org.eclipse.jdt.core.formatter.wrap_before_shift_operator=true
+org.eclipse.jdt.core.formatter.wrap_before_string_concatenation=true
org.eclipse.jdt.core.formatter.wrap_outer_expressions_when_nested=true
diff --git a/app/.settings/org.eclipse.jdt.ui.prefs b/app/.settings/org.eclipse.jdt.ui.prefs
index 7f5ba1ed84..66aaa0890e 100644
--- a/app/.settings/org.eclipse.jdt.ui.prefs
+++ b/app/.settings/org.eclipse.jdt.ui.prefs
@@ -1,3 +1,3 @@
eclipse.preferences.version=1
formatter_profile=_processing
-formatter_settings_version=12
+formatter_settings_version=18
diff --git a/app/.settings/org.eclipse.ltk.core.refactoring.prefs b/app/.settings/org.eclipse.ltk.core.refactoring.prefs
new file mode 100644
index 0000000000..b196c64a34
--- /dev/null
+++ b/app/.settings/org.eclipse.ltk.core.refactoring.prefs
@@ -0,0 +1,2 @@
+eclipse.preferences.version=1
+org.eclipse.ltk.core.refactoring.enable.project.refactoring.history=false
diff --git a/app/build.xml b/app/build.xml
index e324421a0a..b6d97218ab 100644
--- a/app/build.xml
+++ b/app/build.xml
@@ -1,125 +1,51 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
-
+
+
+
+
+
+
+
+
+
+
+
-
-
-
-
-
-
+ classpath="../core/library/core.jar;
+ ../core/apple.jar;
+ lib/ant.jar;
+ lib/ant-launcher.jar;
+ lib/jna.jar;
+ lib/jna-platform.jar"
+ debug="on"
+ nowarn="true"
+ compiler="org.eclipse.jdt.core.JDTCompilerAdapter">
-
+
diff --git a/app/lib/apple.jar b/app/lib/apple.jar
deleted file mode 100644
index 160d62b669..0000000000
Binary files a/app/lib/apple.jar and /dev/null differ
diff --git a/app/lib/jna-platform.jar b/app/lib/jna-platform.jar
new file mode 100644
index 0000000000..d0fd2e4f52
Binary files /dev/null and b/app/lib/jna-platform.jar differ
diff --git a/app/lib/jna.jar b/app/lib/jna.jar
index a0e8fe576c..25243176ea 100644
Binary files a/app/lib/jna.jar and b/app/lib/jna.jar differ
diff --git a/app/lib/jna.txt b/app/lib/jna.txt
new file mode 100644
index 0000000000..4dbac83c25
--- /dev/null
+++ b/app/lib/jna.txt
@@ -0,0 +1,4 @@
+The JAR file is JNA 4.2.0
+
+You can find the corresponding file for Maven here:
+https://maven.java.net/content/repositories/releases/net/java/dev/jna/jna/4.2.0/
diff --git a/app/src/antlr/ExtendedCommonASTWithHiddenTokens.java b/app/src/antlr/ExtendedCommonASTWithHiddenTokens.java
deleted file mode 100644
index 07f4f510cd..0000000000
--- a/app/src/antlr/ExtendedCommonASTWithHiddenTokens.java
+++ /dev/null
@@ -1,132 +0,0 @@
-package antlr;
-
-/* ANTLR Translator Generator
- * Project led by Terence Parr at http://www.jGuru.com
- * Software rights: http://www.antlr.org/RIGHTS.html
- *
- * $Id$
- */
-
-import java.io.*;
-
-import antlr.collections.*;
-
-
-/** A CommonAST whose initialization copies hidden token
- * information from the Token used to create a node.
- */
-public class ExtendedCommonASTWithHiddenTokens
- extends CommonASTWithHiddenTokens {
-
- public ExtendedCommonASTWithHiddenTokens() {
- super();
- }
-
- public ExtendedCommonASTWithHiddenTokens(Token tok) {
- super(tok);
- }
-
- public void initialize(AST ast) {
- ExtendedCommonASTWithHiddenTokens a =
- (ExtendedCommonASTWithHiddenTokens)ast;
- super.initialize(a);
- hiddenBefore = a.getHiddenBefore();
- hiddenAfter = a.getHiddenAfter();
- }
-
- public String getHiddenAfterString() {
-
- CommonHiddenStreamToken t;
- StringBuffer hiddenAfterString = new StringBuffer(100);
-
- for ( t = hiddenAfter ; t != null ; t = t.getHiddenAfter() ) {
- hiddenAfterString.append(t.getText());
- }
-
- return hiddenAfterString.toString();
- }
-
- public String getHiddenBeforeString() {
-
- antlr.CommonHiddenStreamToken
- child = null,
- parent = hiddenBefore;
-
- // if there aren't any hidden tokens here, quietly return
- //
- if (parent == null) {
- return "";
- }
-
- // traverse back to the head of the list of tokens before this node
- do {
- child = parent;
- parent = child.getHiddenBefore();
- } while (parent != null);
-
- // dump that list
-
- StringBuffer hiddenBeforeString = new StringBuffer(100);
-
- for ( CommonHiddenStreamToken t = child; t != null ;
- t = t.getHiddenAfter() ) {
- hiddenBeforeString.append(t.getText());
- }
-
- return hiddenBeforeString.toString();
- }
-
- public void xmlSerializeNode(Writer out)
- throws IOException {
- StringBuffer buf = new StringBuffer(100);
- buf.append("<");
- buf.append(getClass().getName() + " ");
-
- buf.append("hiddenBeforeString=\"" +
- encode(getHiddenBeforeString()) +
- "\" text=\"" + encode(getText()) + "\" type=\"" +
- getType() + "\" hiddenAfterString=\"" +
- encode(getHiddenAfterString()) + "\"/>");
- out.write(buf.toString());
- }
-
- public void xmlSerializeRootOpen(Writer out)
- throws IOException {
- StringBuffer buf = new StringBuffer(100);
- buf.append("<");
- buf.append(getClass().getName() + " ");
- buf.append("hiddenBeforeString=\"" +
- encode(getHiddenBeforeString()) +
- "\" text=\"" + encode(getText()) + "\" type=\"" +
- getType() + "\" hiddenAfterString=\"" +
- encode(getHiddenAfterString()) + "\">\n");
- out.write(buf.toString());
- }
-
- public void xmlSerializeRootClose(Writer out)
- throws IOException {
- out.write("" + getClass().getName() + ">\n");
- }
-
- public void xmlSerialize(Writer out) throws IOException {
- // print out this node and all siblings
- for (AST node = this;
- node != null;
- node = node.getNextSibling()) {
- if (node.getFirstChild() == null) {
- // print guts (class name, attributes)
- ((BaseAST)node).xmlSerializeNode(out);
- }
- else {
- ((BaseAST)node).xmlSerializeRootOpen(out);
-
- // print children
- ((BaseAST)node.getFirstChild()).xmlSerialize(out);
-
- // print end tag
- ((BaseAST)node).xmlSerializeRootClose(out);
- }
- }
- }
-
-}
diff --git a/app/src/processing/app/Base.java b/app/src/processing/app/Base.java
index 5eb66ca64a..5d9b0a114c 100644
--- a/app/src/processing/app/Base.java
+++ b/app/src/processing/app/Base.java
@@ -3,12 +3,13 @@
/*
Part of the Processing project - http://processing.org
+ Copyright (c) 2012-19 The Processing Foundation
Copyright (c) 2004-12 Ben Fry and Casey Reas
Copyright (c) 2001-04 Massachusetts Institute of Technology
- This program is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License version 2
- as published by the Free Software Foundation.
+ This program is free software; you can redistribute it and/or
+ modify it under the terms of the GNU General Public License
+ version 2, as published by the Free Software Foundation.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
@@ -22,19 +23,28 @@
package processing.app;
-import java.awt.*;
-import java.awt.event.*;
+import java.awt.EventQueue;
+import java.awt.FileDialog;
+import java.awt.event.ActionEvent;
+import java.awt.event.ActionListener;
import java.io.*;
+import java.lang.reflect.InvocationTargetException;
import java.text.SimpleDateFormat;
import java.util.*;
-import java.util.List;
-import java.util.zip.*;
+import java.util.Map.Entry;
-import javax.swing.*;
-import javax.swing.tree.*;
+import javax.swing.JFileChooser;
+import javax.swing.JMenu;
+import javax.swing.JMenuItem;
+import javax.swing.JOptionPane;
+import javax.swing.JPopupMenu;
+import javax.swing.tree.DefaultMutableTreeNode;
import processing.app.contrib.*;
+import processing.app.tools.Tool;
+import processing.app.ui.*;
import processing.core.*;
+import processing.data.StringList;
/**
@@ -44,63 +54,27 @@
* files and images, etc) that comes from that.
*/
public class Base {
- static public final int REVISION = 216;
+ // Added accessors for 0218 because the UpdateCheck class was not properly
+ // updating the values, due to javac inlining the static final values.
+ static private final int REVISION = 271;
/** This might be replaced by main() if there's a lib/version.txt file. */
- static public String VERSION_NAME = "0216";
+ static private String VERSION_NAME = "0271"; //$NON-NLS-1$
/** Set true if this a proper release rather than a numbered revision. */
- static public boolean RELEASE = false;
-
- /** True if heavy debugging error/log messages are enabled */
- static public boolean DEBUG = false;
-// static public boolean DEBUG = true;
-
- static HashMap platformNames =
- new HashMap();
- static {
- platformNames.put(PConstants.WINDOWS, "windows");
- platformNames.put(PConstants.MACOSX, "macosx");
- platformNames.put(PConstants.LINUX, "linux");
- }
-
- static HashMap platformIndices = new HashMap();
- static {
- platformIndices.put("windows", PConstants.WINDOWS);
- platformIndices.put("macosx", PConstants.MACOSX);
- platformIndices.put("linux", PConstants.LINUX);
- }
- static Platform platform;
-
- /** How many bits this machine is */
- static int nativeBits;
- static {
- nativeBits = 32; // perhaps start with 32
- String bits = System.getProperty("sun.arch.data.model");
- if (bits != null) {
- if (bits.equals("64")) {
- nativeBits = 64;
- }
- } else {
- // if some other strange vm, maybe try this instead
- if (System.getProperty("java.vm.name").contains("64")) {
- nativeBits = 64;
- }
- }
- }
+
+ /**
+ * True if heavy debugging error/log messages are enabled. Set to true
+ * if an empty file named 'debug' is found in the settings folder.
+ * See implementation in createAndShowGUI().
+ */
+ static public boolean DEBUG;
static private boolean commandLine;
// A single instance of the preferences window
- Preferences preferencesFrame;
+ PreferencesFrame preferencesFrame;
// A single instance of the library manager window
- ContributionManagerDialog libraryManagerFrame;
- ContributionManagerDialog toolManagerFrame;
- ContributionManagerDialog modeManagerFrame;
- ContributionManagerDialog updateManagerFrame;
-
- // set to true after the first time the menu is built.
- // so that the errors while building don't show up again.
- boolean builtOnce;
+// ContributionManagerDialog contributionManagerFrame;
// Location for untitled items
static File untitledFolder;
@@ -118,14 +92,20 @@ public class Base {
*/
private Mode nextMode;
+ /** The built-in modes. coreModes[0] will be considered the 'default'. */
private Mode[] coreModes;
- //public List contribModes;
- protected ArrayList modeContribs;
+
+ protected List modeContribs;
+ protected List exampleContribs;
private JMenu sketchbookMenu;
- private Recent recent;
-// private JMenu recentMenu;
+// private Recent recent;
+
+ // Used by handleOpen(), this saves the chooser to remember the directory.
+ // Doesn't appear to be necessary with the AWT native file dialog.
+ // https://github.com/processing/processing/pull/2366
+ private JFileChooser openChooser;
static protected File sketchbookFolder;
// protected File toolsFolder;
@@ -134,7 +114,35 @@ public class Base {
static public void main(final String[] args) {
EventQueue.invokeLater(new Runnable() {
public void run() {
- createAndShowGUI(args);
+ try {
+ createAndShowGUI(args);
+
+ } catch (Throwable t) {
+ // Windows Defender has been insisting on destroying each new
+ // release by removing core.jar and other files. Yay!
+ // https://github.com/processing/processing/issues/5537
+ if (Platform.isWindows()) {
+ String mess = t.getMessage();
+ String missing = null;
+ if (mess.contains("Could not initialize class com.sun.jna.Native")) {
+ missing = "jnidispatch.dll";
+ } else if (mess.contains("NoClassDefFoundError: processing/core/PApplet")) {
+ missing = "core.jar";
+ }
+ if (missing != null) {
+ Messages.showError("Necessary files are missing",
+ "A file required by Processing (" + missing + ") is missing.\n\n" +
+ "Make sure that you're not trying to run Processing from inside\n" +
+ "the .zip file you downloaded, and check that Windows Defender\n" +
+ "hasn't removed files from the Processing folder.\n\n" +
+ "(It sometimes flags parts of Processing as a trojan or virus.\n" +
+ "It is neither, but Microsoft has ignored our pleas for help.)", t);
+ }
+ }
+ Messages.showTrace("Unknown Problem",
+ "A serious error happened during startup. Please report:\n" +
+ "http://github.com/processing/processing/issues/new", t, true);
+ }
}
});
}
@@ -142,19 +150,31 @@ public void run() {
static private void createAndShowGUI(String[] args) {
try {
- File versionFile = getContentFile("lib/version.txt");
+ File versionFile = Platform.getContentFile("lib/version.txt");
if (versionFile.exists()) {
String version = PApplet.loadStrings(versionFile)[0];
if (!version.equals(VERSION_NAME)) {
VERSION_NAME = version;
- RELEASE = true;
}
}
} catch (Exception e) {
e.printStackTrace();
}
- initPlatform();
+ Platform.init();
+ // call after Platform.init() because we need the settings folder
+ Console.startup();
+
+ // Set the debug flag based on a file being present in the settings folder
+ File debugFile = getSettingsFile("debug.txt");
+ /*
+ if (debugFile.isDirectory()) {
+ // if it's a directory, it's a leftover from older releases, clear it
+ Util.removeDir(debugFile);
+ } else*/
+ if (debugFile.exists()) {
+ DEBUG = true;
+ }
// Use native popups so they don't look so crappy on OS X
JPopupMenu.setDefaultLightWeightPopupEnabled(false);
@@ -163,218 +183,211 @@ static private void createAndShowGUI(String[] args) {
// because the platform has to be inited properly first.
// Make sure a full JDK is installed
- initRequirements();
+ //initRequirements();
+
+ // Load the languages
+ Language.init();
// run static initialization that grabs all the prefs
Preferences.init();
- // Get the sketchbook path, and make sure it's set properly
- locateSketchbookFolder();
-
-// String filename = args.length > 1 ? args[0] : null;
if (!SingleInstance.alreadyRunning(args)) {
-// SingleInstance.startServer(platform);
-
// Set the look and feel before opening the window
try {
- platform.setLookAndFeel();
+ Platform.setLookAndFeel();
} catch (Exception e) {
- String mess = e.getMessage();
- if (!mess.contains("ch.randelshofer.quaqua.QuaquaLookAndFeel")) {
- log("Could not set the Look & Feel", e);
+ Messages.loge("Could not set the Look & Feel", e); //$NON-NLS-1$
+ }
+
+ boolean sketchbookPrompt = false;
+ if (Preferences.getBoolean("welcome.show")) {
+ // only ask once about split sketchbooks
+ if (!Preferences.getBoolean("welcome.seen")) {
+ // Check if there's a 2.0 sketchbook present
+ String oldPath = Preferences.getOldSketchbookPath();
+ if (oldPath != null) {
+ String newPath = Preferences.getSketchbookPath();
+ // If newPath is null, this is the first run of any 3.x version
+ if (newPath == null) {
+ sketchbookPrompt = true;
+
+ } else if (oldPath.equals(newPath)) {
+ // If both exist and are identical, then the user has used
+ // pre-releases of 3.x and needs to be warned about the
+ // larger changes in this release.
+ sketchbookPrompt = true;
+ }
+ }
}
}
+ // Get the sketchbook path, and make sure it's set properly
+ locateSketchbookFolder();
+
// Create a location for untitled sketches
try {
- untitledFolder = Base.createTempFolder("untitled", "sketches", null);
+ untitledFolder = Util.createTempFolder("untitled", "sketches", null);
untitledFolder.deleteOnExit();
} catch (IOException e) {
- Base.showError("Trouble without a name",
- "Could not create a place to store untitled sketches.\n" +
- "That's gonna prevent us from continuing.", e);
+ Messages.showError("Trouble without a name",
+ "Could not create a place to store untitled sketches.\n" +
+ "That's gonna prevent us from continuing.", e);
}
- log("about to create base...");
- Base base = new Base(args);
- // Prevent more than one copy of the PDE from running.
- SingleInstance.startServer(base);
- log("done creating base...");
- }
- }
+ Messages.log("About to create Base..."); //$NON-NLS-1$
+ try {
+ final Base base = new Base(args);
+ Messages.log("Base() constructor succeeded");
+
+ // Prevent more than one copy of the PDE from running.
+ SingleInstance.startServer(base);
+
+ // Needs to be shown after the first editor window opens, so that it
+ // shows up on top, and doesn't prevent an editor window from opening.
+ if (Preferences.getBoolean("welcome.show")) {
+ try {
+ new Welcome(base, sketchbookPrompt);
+ } catch (IOException e) {
+ Messages.showTrace("Unwelcoming",
+ "Please report this error to\n" +
+ "https://github.com/processing/processing/issues", e, false);
+ }
+ }
+ checkDriverBug();
- public static void setCommandLine() {
- commandLine = true;
+ } catch (Throwable t) {
+ // Catch-all to pick up badness during startup.
+ if (t.getCause() != null) {
+ // Usually this is the more important piece of information. We'll
+ // show this one so that it's not truncated in the error window.
+ t = t.getCause();
+ }
+ Messages.showTrace("We're off on the wrong foot",
+ "An error occurred during startup.", t, true);
+ }
+ Messages.log("Done creating Base..."); //$NON-NLS-1$
+ }
}
- static protected boolean isCommandLine() {
- return commandLine;
+ // Remove this code in a couple months [fry 170211]
+ // https://github.com/processing/processing/issues/4853
+ // Or maybe not, if NVIDIA keeps doing this [fry 170423]
+ // https://github.com/processing/processing/issues/4997
+ static private void checkDriverBug() {
+ if (System.getProperty("os.name").contains("Windows 10")) {
+ new Thread(new Runnable() {
+ public void run() {
+ try {
+ Process p = Runtime.getRuntime().exec("powershell Get-WmiObject Win32_PnPSignedDriver| select devicename, driverversion | where {$_.devicename -like \\\"*nvidia*\\\"}");
+ BufferedReader reader = PApplet.createReader(p.getInputStream());
+ String line = null;
+ while ((line = reader.readLine()) != null) {
+ if (line.contains("3.7849")) {
+ EventQueue.invokeLater(new Runnable() {
+ public void run() {
+ Messages.showWarning("NVIDIA screwed up",
+ "Due to an NVIDIA bug, you need to update your graphics drivers,\n" +
+ "otherwise you won't be able to run any sketches. Update here:\n" +
+ "http://nvidia.custhelp.com/app/answers/detail/a_id/4378\n" +
+ "or read background about the issue at this link:\n" +
+ "https://github.com/processing/processing/issues/4853");
+ }
+ });
+ } else if (line.contains("3.8165")) {
+ EventQueue.invokeLater(new Runnable() {
+ public void run() {
+ Messages.showWarning("NVIDIA screwed up again",
+ "Due to an NVIDIA bug, you need to update your graphics drivers,\n" +
+ "otherwise you won't be able to run any sketches. Update here:\n" +
+ "http://nvidia.custhelp.com/app/answers/detail/a_id/4453/\n" +
+ "or read background about the issue at this link:\n" +
+ "https://github.com/processing/processing/issues/4997");
+ }
+ });
+ }
+ }
+ } catch (Exception e) {
+ Messages.loge("Problem checking NVIDIA driver", e);
+ }
+ }
+ }).start();
+ }
}
- static public void initPlatform() {
- try {
- Class> platformClass = Class.forName("processing.app.Platform");
- if (Base.isMacOS()) {
- platformClass = Class.forName("processing.app.macosx.Platform");
- } else if (Base.isWindows()) {
- platformClass = Class.forName("processing.app.windows.Platform");
- } else if (Base.isLinux()) {
- platformClass = Class.forName("processing.app.linux.Platform");
- }
- platform = (Platform) platformClass.newInstance();
- } catch (Exception e) {
- Base.showError("Problem Setting the Platform",
- "An unknown error occurred while trying to load\n" +
- "platform-specific code for your machine.", e);
- }
- }
+ // . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
- public static void initRequirements() {
- try {
- Class.forName("com.sun.jdi.VirtualMachine");
- } catch (ClassNotFoundException cnfe) {
- //String cp = System.getProperty("java.class.path").replace(File.pathSeparatorChar, '\n');
-// String cp = System.getProperty("sun.boot.class.path").replace(File.pathSeparatorChar, '\n');
-
- Base.openURL("http://wiki.processing.org/w/Supported_Platforms");
-// Base.showError("Please install JDK 1.6 or later",
-// "Processing requires a full JDK (not just a JRE)\n" +
-// "to run. Please install JDK 1.6 or later.\n" +
-// "More information can be found on the Wiki." +
-// "\n\nJAVA_HOME is currently\n" +
-// System.getProperty("java.home") + "\n" +
-// "And the CLASSPATH contains\n" + cp, cnfe);
- Base.showError("Missing required files",
- "Processing requires a JRE with tools.jar (or a\n" +
- "full JDK) installed in (or linked to) a folder\n" +
- "named “java” next to the Processing application.\n" +
- "More information can be found on the Wiki.", cnfe);
- }
- }
-
-
- private void buildCoreModes() {
-// Mode javaMode =
-// ModeContribution.getCoreMode(this, "processing.mode.java.JavaMode",
-// getContentFile("modes/java"));
-// Mode androidMode =
-// ModeContribution.getCoreMode(this, "processing.mode.android.AndroidMode",
-// getContentFile("modes/android"));
-// Mode javaScriptMode =
-// ModeContribution.getCoreMode(this, "processing.mode.javascript.JavaScriptMode",
-// getContentFile("modes/javascript"));
- Mode javaMode =
- ModeContribution.load(this, getContentFile("modes/java"),
- "processing.mode.java.JavaMode").getMode();
- Mode androidMode =
- ModeContribution.load(this, getContentFile("modes/android"),
- "processing.mode.android.AndroidMode").getMode();
- Mode javaScriptMode =
- ModeContribution.load(this, getContentFile("modes/javascript"),
- "processing.mode.javascript.JavaScriptMode").getMode();
-
- coreModes = new Mode[] { javaMode, androidMode, javaScriptMode };
-
- // check for the new mode in case it's available
-// try {
-// Class.forName("processing.mode.java2.DebugMode");
- ModeContribution experimentalContrib =
- ModeContribution.load(this, getContentFile("modes/experimental"),
- "processing.mode.experimental.ExperimentalMode");
- if (experimentalContrib != null) {
- Mode experimentalMode = experimentalContrib.getMode();
- coreModes = new Mode[] { javaMode, androidMode, javaScriptMode, experimentalMode };
- }
-// } catch (ClassNotFoundException e) { }
-
-// for (Mode mode : coreModes) { // already called by load() above
-// mode.setupGUI();
-// }
+ /**
+ * @return the current revision number, safe to be used for update checks
+ */
+ static public int getRevision() {
+ return REVISION;
}
/**
- * Instantiates and adds new contributed modes to the contribModes list.
- * Checks for duplicates so the same mode isn't instantiates twice. Does not
- * remove modes because modes can't be removed once they are instantiated.
+ * @return something like 2.2.1 or 3.0b4 (or 0213 if it's not a release)
*/
- void rebuildContribModes() {
- if (modeContribs == null) {
- modeContribs = new ArrayList();
- }
- ModeContribution.loadMissing(this);
+ static public String getVersionName() {
+ return VERSION_NAME;
+ }
-// ArrayList newContribs =
-// ModeContribution.loadAll(getSketchbookModesFolder());
-// for (ModeContribution contrib : newContribs) {
-// if (!contribModes.contains(contrib)) {
-// if (contrib.instantiateModeClass(this)) {
-// contribModes.add(contrib);
-// }
-// }
-// }
+
+
+ public static void setCommandLine() {
+ commandLine = true;
}
- public Base(String[] args) {
-// // Get the sketchbook path, and make sure it's set properly
-// determineSketchbookFolder();
+ static public boolean isCommandLine() {
+ return commandLine;
+ }
+
+
+ // . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
+
+
+ public Base(String[] args) throws Exception {
+ ContributionManager.init(this);
- // Delete all modes and tools that have been flagged for deletion before
- // they are initialized by an editor.
-// ArrayList contribs = new ArrayList();
-// contribs.addAll(ModeContribution.list(getSketchbookModesFolder()));
-// contribs.addAll(ToolContribution.list(getSketchbookToolsFolder(), false));
-// for (InstalledContribution contrib : contribs) {
-// if (ContributionManager.isDeletionFlagSet(contrib)) {
-// removeDir(contrib.getFolder());
-// }
-// }
- ContributionManager.deleteFlagged();
buildCoreModes();
rebuildContribModes();
+ rebuildContribExamples();
// Needs to happen after the sketchbook folder has been located.
// Also relies on the modes to be loaded so it knows what can be
// marked as an example.
- recent = new Recent(this);
+// recent = new Recent(this);
+ Recent.init(this);
- String lastModeIdentifier = Preferences.get("last.sketch.mode");
+ String lastModeIdentifier = Preferences.get("mode.last"); //$NON-NLS-1$
if (lastModeIdentifier == null) {
- nextMode = coreModes[0];
- log("Nothing set for last.sketch.mode, using coreMode[0].");
+ nextMode = getDefaultMode();
+ Messages.log("Nothing set for last.sketch.mode, using default."); //$NON-NLS-1$
} else {
for (Mode m : getModeList()) {
if (m.getIdentifier().equals(lastModeIdentifier)) {
- log("Setting next mode to " + lastModeIdentifier);
+ Messages.logf("Setting next mode to %s.", lastModeIdentifier); //$NON-NLS-1$
nextMode = m;
}
}
if (nextMode == null) {
- nextMode = coreModes[0];
- log("Could not find mode " + lastModeIdentifier + ", using default.");
+ nextMode = getDefaultMode();
+ Messages.logf("Could not find mode %s, using default.", lastModeIdentifier); //$NON-NLS-1$
}
}
- libraryManagerFrame =
- new ContributionManagerDialog(ContributionType.LIBRARY);
- toolManagerFrame =
- new ContributionManagerDialog(ContributionType.TOOL);
- modeManagerFrame =
- new ContributionManagerDialog(ContributionType.MODE);
- updateManagerFrame =
- new ContributionManagerDialog(null);
-
+ //contributionManagerFrame = new ContributionManagerDialog();
+
// Make sure ThinkDifferent has library examples too
nextMode.rebuildLibraryList();
// Put this after loading the examples, so that building the default file
// menu works on Mac OS X (since it needs examplesFolder to be set).
- platform.init(this);
+ Platform.initBase(this);
// toolsFolder = getContentFile("tools");
@@ -384,15 +397,18 @@ public Base(String[] args) {
// Check if any files were passed in on the command line
for (int i = 0; i < args.length; i++) {
+ Messages.logf("Parsing command line... args[%d] = '%s'", i, args[i]);
+
String path = args[i];
// Fix a problem with systems that use a non-ASCII languages. Paths are
// being passed in with 8.3 syntax, which makes the sketch loader code
// unhappy, since the sketch folder naming doesn't match up correctly.
// http://dev.processing.org/bugs/show_bug.cgi?id=1089
- if (isWindows()) {
+ if (Platform.isWindows()) {
try {
File file = new File(args[i]);
path = file.getCanonicalPath();
+ Messages.logf("Changing %s to canonical %s", i, args[i], path);
} catch (IOException e) {
e.printStackTrace();
}
@@ -404,176 +420,153 @@ public Base(String[] args) {
// Create a new empty window (will be replaced with any files to be opened)
if (!opened) {
-// System.out.println("opening a new window");
+ Messages.log("Calling handleNew() to open a new window");
handleNew();
-// } else {
-// System.out.println("something else was opened");
+ } else {
+ Messages.log("No handleNew(), something passed on the command line");
}
// check for updates
- if (Preferences.getBoolean("update.check")) {
- new UpdateCheck(this);
- }
+ new UpdateCheck(this);
+
+ ContributionListing cl = ContributionListing.getInstance();
+ cl.downloadAvailableList(this, new ContribProgressMonitor() { });
+ }
+
+
+ // . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
+
+
+ void buildCoreModes() {
+ Mode javaMode =
+ ModeContribution.load(this, Platform.getContentFile("modes/java"),
+ getDefaultModeIdentifier()).getMode();
+
+ // PDE X calls getModeList() while it's loading, so coreModes must be set
+ coreModes = new Mode[] { javaMode };
+
+ /*
+ Mode pdexMode =
+ ModeContribution.load(this, getContentFile("modes/ExperimentalMode"), //$NON-NLS-1$
+ "processing.mode.experimental.ExperimentalMode").getMode(); //$NON-NLS-1$
+
+ // Safe to remove the old Java mode here?
+ //coreModes = new Mode[] { pdexMode };
+ coreModes = new Mode[] { pdexMode, javaMode };
+ */
}
/**
- * Single location for the default extension, rather than hardwiring .pde
- * all over the place. While it may seem like fun to send the Arduino guys
- * on a treasure hunt, it gets old after a while.
+ * Instantiates and adds new contributed modes to the contribModes list.
+ * Checks for duplicates so the same mode isn't instantiates twice. Does not
+ * remove modes because modes can't be removed once they are instantiated.
*/
-// static protected String getExtension() {
-// return ".pde";
-// }
-
-
-// public Mode getDefaultMode() {
-// return defaultMode;
-// }
-
-
-// /**
-// * Post-constructor setup for the editor area. Loads the last
-// * sketch that was used (if any), and restores other Editor settings.
-// * The complement to "storePreferences", this is called when the
-// * application is first launched.
-// */
-// protected boolean restoreSketches() {
-//// String lastMode = Preferences.get("last.sketch.mode");
-//// log("setting mode to " + lastMode);
-//// if (lastMode != null) {
-//// for (Mode m : getModeList()) {
-//// if (m.getClass().getName().equals(lastMode)) {
-//// defaultMode = m;
-//// }
-//// }
-//// }
-//// log("default mode set to " + defaultMode.getClass().getName());
-//
-// if (Preferences.getBoolean("last.sketch.restore")) {
-// return false;
-// }
-//
-// return true;
-//
-//// // figure out window placement
-//// Dimension screen = Toolkit.getDefaultToolkit().getScreenSize();
-//// boolean windowPositionValid = true;
-////
-//// if (Preferences.get("last.screen.height") != null) {
-//// // if screen size has changed, the window coordinates no longer
-//// // make sense, so don't use them unless they're identical
-//// int screenW = Preferences.getInteger("last.screen.width");
-//// int screenH = Preferences.getInteger("last.screen.height");
-////
-//// if ((screen.width != screenW) || (screen.height != screenH)) {
-//// windowPositionValid = false;
-//// }
-//// /*
-//// int windowX = Preferences.getInteger("last.window.x");
-//// int windowY = Preferences.getInteger("last.window.y");
-//// if ((windowX < 0) || (windowY < 0) ||
-//// (windowX > screenW) || (windowY > screenH)) {
-//// windowPositionValid = false;
-//// }
-//// */
-//// } else {
-//// windowPositionValid = false;
-//// }
-////
-//// // Iterate through all sketches that were open last time p5 was running.
-//// // If !windowPositionValid, then ignore the coordinates found for each.
-////
-//// // Save the sketch path and window placement for each open sketch
-//// int count = Preferences.getInteger("last.sketch.count");
-//// int opened = 0;
-//// for (int i = 0; i < count; i++) {
-//// String path = Preferences.get("last.sketch" + i + ".path");
-//// int[] location;
-//// if (windowPositionValid) {
-//// String locationStr = Preferences.get("last.sketch" + i + ".location");
-//// location = PApplet.parseInt(PApplet.split(locationStr, ','));
-//// } else {
-//// location = nextEditorLocation();
-//// }
-//// // If file did not exist, null will be returned for the Editor
-//// if (handleOpen(path, location) != null) {
-//// opened++;
-//// }
-//// }
-//// return (opened > 0);
-// }
-
-
-// /**
-// * Store list of sketches that are currently open.
-// * Called when the application is quitting and documents are still open.
-// */
-// protected void storeSketches() {
-// // Save the width and height of the screen
-// Dimension screen = Toolkit.getDefaultToolkit().getScreenSize();
-// Preferences.setInteger("last.screen.width", screen.width);
-// Preferences.setInteger("last.screen.height", screen.height);
-//
-// String untitledPath = untitledFolder.getAbsolutePath();
-//
-// // Save the sketch path and window placement for each open sketch
-// int index = 0;
-// for (Editor editor : editors) {
-// String path = editor.getSketch().getMainFilePath();
-// // In case of a crash, save untitled sketches if they contain changes.
-// // (Added this for release 0158, may not be a good idea.)
-// if (path.startsWith(untitledPath) &&
-// !editor.getSketch().isModified()) {
-// continue;
-// }
-// Preferences.set("last.sketch" + index + ".path", path);
-//
-// int[] location = editor.getPlacement();
-// String locationStr = PApplet.join(PApplet.str(location), ",");
-// Preferences.set("last.sketch" + index + ".location", locationStr);
-// index++;
-// }
-// Preferences.setInteger("last.sketch.count", index);
-// Preferences.set("last.sketch.mode", defaultMode.getClass().getName());
-// }
-//
-//
-// // If a sketch is untitled on quit, may need to store the new name
-// // rather than the location from the temp folder.
-// protected void storeSketchPath(Editor editor, int index) {
-// String path = editor.getSketch().getMainFilePath();
-// String untitledPath = untitledFolder.getAbsolutePath();
-// if (path.startsWith(untitledPath)) {
-// path = "";
-// }
-// Preferences.set("last.sketch" + index + ".path", path);
-// }
-
+ void rebuildContribModes() {
+ if (modeContribs == null) {
+ modeContribs = new ArrayList<>();
+ }
+ File modesFolder = getSketchbookModesFolder();
+ List contribModes = getModeContribs();
+
+ Map known = new HashMap<>();
+ for (ModeContribution contrib : contribModes) {
+ known.put(contrib.getFolder(), contrib);
+ }
+ File[] potential = ContributionType.MODE.listCandidates(modesFolder);
+ // If modesFolder does not exist or is inaccessible (folks might like to
+ // mess with folders then report it as a bug) 'potential' will be null.
+ if (potential != null) {
+ for (File folder : potential) {
+ if (!known.containsKey(folder)) {
+ try {
+ contribModes.add(new ModeContribution(this, folder, null));
+ } catch (NoSuchMethodError nsme) {
+ System.err.println(folder.getName() + " is not compatible with this version of Processing");
+ if (DEBUG) nsme.printStackTrace();
+ } catch (NoClassDefFoundError ncdfe) {
+ System.err.println(folder.getName() + " is not compatible with this version of Processing");
+ if (DEBUG) ncdfe.printStackTrace();
+ } catch (InvocationTargetException ite) {
+ System.err.println(folder.getName() + " could not be loaded and may not compatible with this version of Processing");
+ if (DEBUG) ite.printStackTrace();
+ } catch (IgnorableException ig) {
+ Messages.log(ig.getMessage());
+ if (DEBUG) ig.printStackTrace();
+ } catch (Throwable e) {
+ System.err.println("Could not load Mode from " + folder);
+ e.printStackTrace();
+ }
+ } else {
+ known.remove(folder); // remove this item as already been seen
+ }
+ }
+ }
- /*
- public void storeSketch(Editor editor) {
- int index = -1;
- for (int i = 0; i < editorCount; i++) {
- if (editors[i] == editor) {
- index = i;
- break;
+ // This allows you to build and test your Mode code from Eclipse.
+ // -Dusemode=com.foo.FrobMode:/path/to/FrobMode
+ final String useMode = System.getProperty("usemode");
+ if (useMode != null) {
+ final String[] modeInfo = useMode.split(":", 2);
+ final String modeClass = modeInfo[0];
+ final String modeResourcePath = modeInfo[1];
+ System.out.println("Attempting to load " + modeClass + " with resources at " + modeResourcePath);
+ ModeContribution mc = ModeContribution.load(this, new File(modeResourcePath), modeClass);
+ contribModes.add(mc);
+ File key = getFileForContrib(mc, known);
+ if (key != null) {
+ known.remove(key);
}
}
- if (index == -1) {
- System.err.println("Problem storing sketch " + editor.sketch.name);
- } else {
- String path = editor.sketch.getMainFilePath();
- Preferences.set("last.sketch" + index + ".path", path);
+ if (known.size() != 0) {
+ for (ModeContribution mc : known.values()) {
+ System.out.println("Extraneous Mode entry: " + mc.getName());
+ }
}
}
- */
+ static private File getFileForContrib(ModeContribution contrib,
+ Map known) {
+ for (Entry entry : known.entrySet()) {
+ if (entry.getValue() == contrib) {
+ return entry.getKey();
+ }
+ }
+ return null;
+ }
+
+
+ /**
+ * Instantiates and adds new contributed modes to the contribModes list.
+ * Checks for duplicates so the same mode isn't instantiates twice. Does not
+ * remove modes because modes can't be removed once they are instantiated.
+ */
+ void rebuildContribExamples() {
+ if (exampleContribs == null) {
+ exampleContribs = new ArrayList<>();
+ }
+ ExamplesContribution.loadMissing(this);
+ }
+
// . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
+ /**
+ * Tools require an 'Editor' object when they're instantiated, but the
+ * activeEditor will be null when the first Editor that opens is creating
+ * its Tools menu. This will temporarily set the activeEditor to the one
+ * that's opening so that we don't go all NPE on startup. If there's already
+ * an active editor, then this does nothing.
+ */
+ public void checkFirstEditor(Editor editor) {
+ if (activeEditor == null) {
+ activeEditor = editor;
+ }
+ }
+
+
/** Returns the front most, active editor window. */
public Editor getActiveEditor() {
return activeEditor;
@@ -586,2356 +579,1473 @@ public List getEditors() {
}
- protected void changeMode(Mode mode) {
- if (activeEditor.getMode() != mode) {
- Sketch sketch = activeEditor.getSketch();
- if (sketch.isModified()) {
- Base.showWarning("Save",
- "Please save the sketch before changing the mode.",
- null);
- } else {
-// boolean untitled = activeEditor.untitled;
- String mainPath = sketch.getMainFilePath();
- boolean wasUntitled = sketch.isUntitled();
+ /**
+ * Called when a window is activated. Because of variations in native
+ * windowing systems, no guarantees about changes to the focused and active
+ * Windows can be made. Never assume that this Window is the focused or
+ * active Window until this Window actually receives a WINDOW_GAINED_FOCUS
+ * or WINDOW_ACTIVATED event.
+ */
+ public void handleActivated(Editor whichEditor) {
+ activeEditor = whichEditor;
- // save a mode file into this sketch folder
- File sketchProps = new File(sketch.getFolder(), "sketch.properties");
- try {
- Settings props = new Settings(sketchProps);
- // Include the pretty name for error messages to show the user
- props.set("mode", mode.getTitle());
- // Actual identifier to be used to resurrect the mode
- props.set("mode.id", mode.getIdentifier());
- props.save();
- } catch (IOException e) {
- e.printStackTrace();
- }
-// PrintWriter writer = PApplet.createWriter(sketchProps);
-// writer.println("mode=" + mode.getTitle());
-// writer.flush();
-// writer.close();
-
-// // close this sketch
-//// int[] where = activeEditor.getPlacement();
-// Rectangle bounds = activeEditor.getBounds();
-// int divider = activeEditor.getDividerLocation();
- EditorState state = activeEditor.state;
- handleClose(activeEditor, true);
+ // set the current window to be the console that's getting output
+ EditorConsole.setEditor(activeEditor);
- // re-open the sketch
-// /*Editor editor =*/ handleOpen(mainPath, untitled, state);
- /*Editor editor =*/ handleOpen(mainPath, wasUntitled, state);
- }
- }
+ // make this the next mode to be loaded
+ nextMode = whichEditor.getMode();
+ Preferences.set("mode.last", nextMode.getIdentifier()); //$NON-NLS-1$
}
- public ArrayList getModeContribs() {
- return modeContribs;
- }
+ // . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
- public ArrayList getModeList() {
- ArrayList allModes = new ArrayList();
- allModes.addAll(Arrays.asList(coreModes));
- if (modeContribs != null) {
- for (ModeContribution contrib : modeContribs) {
- allModes.add(contrib.getMode());
+ public void refreshContribs(ContributionType ct) {
+ if (ct == ContributionType.LIBRARY) {
+ for (Mode m : getModeList()) {
+ m.rebuildImportMenu();
}
- }
- return allModes;
- }
-
- // Because of variations in native windowing systems, no guarantees about
- // changes to the focused and active Windows can be made. Developers must
- // never assume that this Window is the focused or active Window until this
- // Window receives a WINDOW_GAINED_FOCUS or WINDOW_ACTIVATED event.
- protected void handleActivated(Editor whichEditor) {
- activeEditor = whichEditor;
+ } else if (ct == ContributionType.MODE) {
+ rebuildContribModes();
+ for (Editor editor : editors) {
+ editor.rebuildModePopup();
+ }
- // set the current window to be the console that's getting output
- EditorConsole.setEditor(activeEditor);
+ } else if (ct == ContributionType.TOOL) {
+ rebuildToolList();
+ for (Editor editor : editors) {
+ populateToolsMenu(editor.getToolMenu());
+ }
- // make this the next mode to be loaded
- nextMode = whichEditor.getMode();
- Preferences.set("last.sketch.mode", nextMode.getIdentifier());
+ } else if (ct == ContributionType.EXAMPLES) {
+ rebuildContribExamples();
+ for (Mode m : getModeList()) {
+ m.rebuildExamplesFrame();
+ }
+ }
}
// . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
- boolean breakTime = false;
- String[] months = {
- "jan", "feb", "mar", "apr", "may", "jun",
- "jul", "aug", "sep", "oct", "nov", "dec"
- };
+ private int updatesAvailable = 0;
- /**
- * Create a new untitled document in a new sketch window.
- */
- public void handleNew() {
- try {
- File newbieDir = null;
- String newbieName = null;
+ public void setUpdatesAvailable(int n) {
+ updatesAvailable = n;
+ synchronized (editors) {
+ for (Editor e : editors) {
+ e.setUpdatesAvailable(n);
+ }
+ }
+ }
- // In 0126, untitled sketches will begin in the temp folder,
- // and then moved to a new location because Save will default to Save As.
-// File sketchbookDir = getSketchbookFolder();
- File newbieParentDir = untitledFolder;
- String prefix = Preferences.get("editor.untitled.prefix");
+ // . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
- // Use a generic name like sketch_031008a, the date plus a char
- int index = 0;
- String format = Preferences.get("editor.untitled.suffix");
- String suffix = null;
- if (format == null) {
- Calendar cal = Calendar.getInstance();
- int day = cal.get(Calendar.DAY_OF_MONTH); // 1..31
- int month = cal.get(Calendar.MONTH); // 0..11
- suffix = months[month] + PApplet.nf(day, 2);
- } else {
- //SimpleDateFormat formatter = new SimpleDateFormat("yyMMdd");
- //SimpleDateFormat formatter = new SimpleDateFormat("MMMdd");
- //String purty = formatter.format(new Date()).toLowerCase();
- SimpleDateFormat formatter = new SimpleDateFormat(format);
- suffix = formatter.format(new Date());
- }
- do {
- if (index == 26) {
- // In 0159, avoid running past z by sending people outdoors.
- if (!breakTime) {
- Base.showWarning("Time for a Break",
- "You've reached the limit for auto naming of new sketches\n" +
- "for the day. How about going for a walk instead?", null);
- breakTime = true;
- } else {
- Base.showWarning("Sunshine",
- "No really, time for some fresh air for you.", null);
- }
- return;
- }
- newbieName = prefix + suffix + ((char) ('a' + index));
- // Also sanitize the name since it might do strange things on
- // non-English systems that don't use this sort of date format.
- // http://code.google.com/p/processing/issues/detail?id=283
- newbieName = Sketch.sanitizeName(newbieName);
- newbieDir = new File(newbieParentDir, newbieName);
- index++;
- // Make sure it's not in the temp folder *and* it's not in the sketchbook
- } while (newbieDir.exists() || new File(sketchbookFolder, newbieName).exists());
- // Make the directory for the new sketch
- newbieDir.mkdirs();
+ List internalTools;
+ List coreTools;
+ List contribTools;
- // Make an empty pde file
- File newbieFile =
- new File(newbieDir, newbieName + "." + nextMode.getDefaultExtension());
- if (!newbieFile.createNewFile()) {
- throw new IOException(newbieFile + " already exists.");
- }
- String path = newbieFile.getAbsolutePath();
- /*Editor editor =*/ handleOpen(path, true);
- } catch (IOException e) {
- Base.showWarning("That's new to me",
- "A strange and unexplainable error occurred\n" +
- "while trying to create a new sketch.", e);
- }
+ public List getCoreTools() {
+ return coreTools;
}
-// /**
-// * Replace the sketch in the current window with a new untitled document.
-// */
-// public void handleNewReplace() {
-// if (!activeEditor.checkModified()) {
-// return; // sketch was modified, and user canceled
-// }
-// // Close the running window, avoid window boogers with multiple sketches
-// activeEditor.internalCloseRunner();
-//
-// // Actually replace things
-// handleNewReplaceImpl();
-// }
+ public List getToolContribs() {
+ return contribTools;
+ }
-// protected void handleNewReplaceImpl() {
-// try {
-// String path = createNewUntitled();
-// if (path != null) {
-// activeEditor.handleOpenInternal(path);
-// activeEditor.untitled = true;
-// }
-//// return true;
-//
-// } catch (IOException e) {
-// activeEditor.statusError(e);
-//// return false;
-// }
-// }
+ public void removeToolContrib(ToolContribution tc) {
+ contribTools.remove(tc);
+ }
-// /**
-// * Open a sketch, replacing the sketch in the current window.
-// * @param path Location of the primary pde file for the sketch.
-// */
-// public void handleOpenReplace(String path) {
-// if (!activeEditor.checkModified()) {
-// return; // sketch was modified, and user canceled
-// }
-// // Close the running window, avoid window boogers with multiple sketches
-// activeEditor.internalCloseRunner();
-//
-// boolean loaded = activeEditor.handleOpenInternal(path);
-// if (!loaded) {
-// // replace the document without checking if that's ok
-// handleNewReplaceImpl();
-// } else {
-// handleRecent(activeEditor);
-// }
-// }
+ public void rebuildToolList() {
+ // Only do this once because the list of internal tools will never change
+ if (internalTools == null) {
+ internalTools = new ArrayList<>();
+ initInternalTool("processing.app.tools.CreateFont");
+ initInternalTool("processing.app.tools.ColorSelector");
+ initInternalTool("processing.app.tools.Archiver");
- /**
- * Prompt for a sketch to open, and open it in a new window.
- */
- public void handleOpenPrompt() {
- final ArrayList extensions = new ArrayList();
- for (Mode mode : getModeList()) {
- extensions.add(mode.getDefaultExtension());
+ if (Platform.isMacOS()) {
+ initInternalTool("processing.app.tools.InstallCommander");
+ }
}
- final String prompt = "Open a Processing sketch...";
- if (Preferences.getBoolean("chooser.files.native")) { // don't use native dialogs on Linux
- // get the front-most window frame for placing file dialog
- FileDialog fd = new FileDialog(activeEditor, prompt, FileDialog.LOAD);
-
- // Only show .pde files as eligible bachelors
- fd.setFilenameFilter(new FilenameFilter() {
- public boolean accept(File dir, String name) {
- // confirmed to be working properly [fry 110128]
- for (String ext : extensions) {
- if (name.toLowerCase().endsWith("." + ext)) {
- return true;
- }
- }
- return false;
- }
- });
-
- fd.setVisible(true);
-
- String directory = fd.getDirectory();
- String filename = fd.getFile();
- if (filename != null) {
- File inputFile = new File(directory, filename);
- handleOpen(inputFile.getAbsolutePath());
+ // No need to reload these either
+ if (coreTools == null) {
+ coreTools = ToolContribution.loadAll(Base.getToolsFolder());
+ for (Tool tool : coreTools) {
+ tool.init(this);
}
+ }
- } else {
- JFileChooser fc = new JFileChooser();
- fc.setDialogTitle(prompt);
-
- fc.setFileFilter(new javax.swing.filechooser.FileFilter() {
- public boolean accept(File file) {
- // JFileChooser requires you to explicitly say yes to directories
- // as well (unlike the AWT chooser). Useful, but... different.
- // http://code.google.com/p/processing/issues/detail?id=1151
- if (file.isDirectory()) {
- return true;
- }
- for (String ext : extensions) {
- if (file.getName().toLowerCase().endsWith("." + ext)) {
- return true;
- }
- }
- return false;
- }
-
- public String getDescription() {
- return "Processing Sketch";
- }
- });
- if (fc.showOpenDialog(activeEditor) == JFileChooser.APPROVE_OPTION) {
- handleOpen(fc.getSelectedFile().getAbsolutePath());
+ // Rebuilt when new tools installed, etc
+ contribTools = ToolContribution.loadAll(Base.getSketchbookToolsFolder());
+ for (Tool tool : contribTools) {
+ try {
+ tool.init(this);
+
+ // With the exceptions, we can't call statusError because the window
+ // isn't completely set up yet. Also not gonna pop up a warning because
+ // people may still be running different versions of Processing.
+
+ } catch (VerifyError ve) {
+ System.err.println("\"" + tool.getMenuTitle() + "\" is not " +
+ "compatible with this version of Processing");
+
+ } catch (NoSuchMethodError nsme) {
+ System.err.println("\"" + tool.getMenuTitle() + "\" is not " +
+ "compatible with this version of Processing");
+ System.err.println("The " + nsme.getMessage() + " method no longer exists.");
+ Messages.loge("Incompatible Tool found during tool.init()", nsme);
+
+ } catch (NoClassDefFoundError ncdfe) {
+ System.err.println("\"" + tool.getMenuTitle() + "\" is not " +
+ "compatible with this version of Processing");
+ System.err.println("The " + ncdfe.getMessage() + " class is no longer available.");
+ Messages.loge("Incompatible Tool found during tool.init()", ncdfe);
+
+ } catch (AbstractMethodError ame) {
+ System.err.println("\"" + tool.getMenuTitle() + "\" is not " +
+ "compatible with this version of Processing");
+// ame.printStackTrace();
+
+ } catch (Error err) {
+ System.err.println("An error occurred inside \"" + tool.getMenuTitle() + "\"");
+ err.printStackTrace();
+
+ } catch (Exception ex) {
+ System.err.println("An exception occurred inside \"" + tool.getMenuTitle() + "\"");
+ ex.printStackTrace();
}
}
}
- /**
- * Open a sketch from the path specified. Do not use for untitled sketches.
- */
- public Editor handleOpen(String path) {
- return handleOpen(path, false);
- }
+ protected void initInternalTool(String className) {
+ try {
+ Class> toolClass = Class.forName(className);
+ final Tool tool = (Tool)
+ toolClass.getDeclaredConstructor().newInstance();
+ tool.init(this);
+ internalTools.add(tool);
- /**
- * Open a sketch in a new window.
- * @param path Path to the pde file for the sketch in question
- * @return the Editor object, so that properties (like 'untitled')
- * can be set by the caller
- */
- public Editor handleOpen(String path, boolean untitled) {
- return handleOpen(path, untitled, new EditorState(editors));
+ } catch (Exception e) {
+ e.printStackTrace();
+ }
}
-// protected Editor handleOpen(String path, int[] location) {
-// protected Editor handleOpen(String path, Rectangle bounds, int divider) {
- protected Editor handleOpen(String path, boolean untitled, EditorState state) {
-// System.err.println("entering handleOpen " + path);
+ /*
+ Iterator editorIter = base.getEditors().iterator();
+ while (editorIter.hasNext()) {
+ Editor editor = editorIter.next();
+ List contribTools = editor.getToolContribs();
+ for (ToolContribution toolContrib : contribTools) {
+ if (toolContrib.getName().equals(this.name)) {
+ try {
+ ((URLClassLoader) toolContrib.loader).close();
+ editor.removeToolContrib(toolContrib);
+ break;
+ } catch (IOException e) {
+ e.printStackTrace();
+ }
+ }
+ }
+ */
- File file = new File(path);
- if (!file.exists()) return null;
- if (!Sketch.isSanitaryName(file.getName())) {
- Base.showWarning("You're tricky, but not tricky enough",
- file.getName() + " is not a valid name for a sketch.\n" +
- "Better to stick to ASCII, no spaces, and make sure\n" +
- "it doesn't start with a number.", null);
- return null;
+ public void clearToolMenus() {
+ for (Editor ed : editors) {
+ ed.clearToolMenu();
}
+ }
-// System.err.println(" editors: " + editors);
- // Cycle through open windows to make sure that it's not already open.
- for (Editor editor : editors) {
- if (editor.getSketch().getMainFilePath().equals(path)) {
- editor.toFront();
- // move back to the top of the recent list
- handleRecent(editor);
- return editor;
- }
+
+ public void populateToolsMenu(JMenu toolsMenu) {
+ // If this is the first run, need to build out the lists
+ if (internalTools == null) {
+ rebuildToolList();
}
+// coreTools = ToolContribution.loadAll(Base.getToolsFolder());
+// contribTools = ToolContribution.loadAll(Base.getSketchbookToolsFolder());
- // If the active editor window is an untitled, and un-modified document,
- // just replace it with the file that's being opened.
-// if (activeEditor != null) {
-// Sketch activeSketch = activeEditor.sketch;
-// if (activeSketch.isUntitled() && !activeSketch.isModified()) {
-// // if it's an untitled, unmodified document, it can be replaced.
-// // except in cases where a second blank window is being opened.
-// if (!path.startsWith(untitledFolder.getAbsolutePath())) {
-// activeEditor.handleOpenUnchecked(path, 0, 0, 0, 0);
-// return activeEditor;
-// }
+// Collections.sort(coreTools);
+// Collections.sort(contribTools);
+// Collections.sort(coreTools, new Comparator() {
+// @Override
+// public int compare(ToolContribution o1, ToolContribution o2) {
+// return o1.getMenuTitle().compareTo(o2.getMenuTitle());
// }
-// }
-
-// Mode nextMode = nextEditorMode();
- try {
- File sketchFolder = new File(path).getParentFile();
- File sketchProps = new File(sketchFolder, "sketch.properties");
- if (sketchProps.exists()) {
- Settings props = new Settings(sketchProps);
- String modeTitle = props.get("mode");
- String modeIdentifier = props.get("mode.id");
- if (modeTitle != null && modeIdentifier != null) {
-// nextMode = findMode(modeTitle);
- Mode mode = findMode(modeIdentifier);
- if (mode != null) {
- nextMode = mode;
+// });
+ toolsMenu.removeAll();
+ for (Tool tool : internalTools) {
+ toolsMenu.add(createToolItem(tool));
+ }
+ toolsMenu.addSeparator();
- } else {
- final String msg =
- "This sketch was last used in “" + modeTitle + "” mode,\n" +
- "which does not appear to be installed. The sketch will\n" +
- "be opened in “" + nextMode.getTitle() + "” mode instead.";
- Base.showWarning("Depeche Mode", msg, null);
- }
- }
+ if (coreTools.size() > 0) {
+ for (Tool tool : coreTools) {
+ toolsMenu.add(createToolItem(tool));
}
- } catch (Exception e) {
- e.printStackTrace();
+ toolsMenu.addSeparator();
}
-// Editor.State state = new Editor.State(editors);
- Editor editor = nextMode.createEditor(this, path, state);
- if (editor == null) {
- // if it's the last editor window
-// if (editors.size() == 0 && defaultFileMenu == null) {
- // if it's not mode[0] already, then don't go into an infinite loop
- // trying to recreate a window with the default mode.
- if (nextMode == coreModes[0]) {
- Base.showError("Editor Problems",
- "An error occurred while trying to change modes.\n" +
- "We'll have to quit for now because it's an\n" +
- "unfortunate bit of indigestion.",
- null);
- } else {
- editor = coreModes[0].createEditor(this, path, state);
+
+ if (contribTools.size() > 0) {
+ for (Tool tool : contribTools) {
+ toolsMenu.add(createToolItem(tool));
}
+ toolsMenu.addSeparator();
}
- // Make sure that the sketch actually loaded
- if (editor.getSketch() == null) {
-// System.err.println("sketch was null, getting out of handleOpen");
- return null; // Just walk away quietly
- }
+ JMenuItem item = new JMenuItem(Language.text("menu.tools.add_tool"));
+ item.addActionListener(new ActionListener() {
+ public void actionPerformed(ActionEvent e) {
+ ContributionManager.openTools();
+ }
+ });
+ toolsMenu.add(item);
+ }
-// editor.untitled = untitled;
- editor.getSketch().setUntitled(untitled);
- editors.add(editor);
- handleRecent(editor);
- // now that we're ready, show the window
- // (don't do earlier, cuz we might move it based on a window being closed)
- editor.setVisible(true);
+ /*
+ static public void addTools(JMenu menu, List tools) {
+ Map toolItems = new HashMap();
+
+ for (final Tool tool : tools) {
+ // If init() fails, the item won't be added to the menu
+ addToolItem(tool, toolItems);
+ }
- return editor;
+ List toolList = new ArrayList(toolItems.keySet());
+ if (toolList.size() > 0) {
+ if (menu.getItemCount() != 0) {
+ menu.addSeparator();
+ }
+ Collections.sort(toolList);
+ for (String title : toolList) {
+ menu.add(toolItems.get(title));
+ }
+ }
}
+ */
-// protected Mode findMode(String title) {
-// for (Mode mode : getModeList()) {
-// if (mode.getTitle().equals(title)) {
-// return mode;
-// }
-// }
-// return null;
-// }
+ JMenuItem createToolItem(final Tool tool) { //, Map toolItems) {
+ String title = tool.getMenuTitle();
+ final JMenuItem item = new JMenuItem(title);
+ item.addActionListener(new ActionListener() {
- protected Mode findMode(String id) {
- for (Mode mode : getModeList()) {
- if (mode.getIdentifier().equals(id)) {
- return mode;
+ public void actionPerformed(ActionEvent e) {
+ try {
+ tool.run();
+
+ } catch (NoSuchMethodError nsme) {
+ activeEditor.statusError("\"" + tool.getMenuTitle() + "\" is not" +
+ "compatible with this version of Processing");
+ //nsme.printStackTrace();
+ Messages.loge("Incompatible tool found during tool.run()", nsme);
+ item.setEnabled(false);
+
+ } catch (Exception ex) {
+ activeEditor.statusError("An error occurred inside \"" + tool.getMenuTitle() + "\"");
+ ex.printStackTrace();
+ item.setEnabled(false);
+ }
}
- }
- return null;
+ });
+ //toolItems.put(title, item);
+ return item;
}
- /**
- * Close a sketch as specified by its editor window.
- * @param editor Editor object of the sketch to be closed.
- * @return true if succeeded in closing, false if canceled.
- */
- public boolean handleClose(Editor editor, boolean modeSwitch) {
- // Check if modified
-// boolean immediate = editors.size() == 1;
- if (!editor.checkModified()) {
- return false;
- }
+ // . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
- // Close the running window, avoid window boogers with multiple sketches
- editor.internalCloseRunner();
- if (editors.size() == 1) {
- // For 0158, when closing the last window /and/ it was already an
- // untitled sketch, just give up and let the user quit.
-// if (Preferences.getBoolean("sketchbook.closing_last_window_quits") ||
-// (editor.untitled && !editor.getSketch().isModified())) {
- if (Base.isMacOS()) {
- // If the central menubar isn't supported on this OS X JVM,
- // we have to do the old behavior. Yuck!
- if (defaultFileMenu == null) {
- Object[] options = { "OK", "Cancel" };
- String prompt =
- " " +
- " " +
- "Are you sure you want to Quit? " +
- "Closing the last open sketch will quit Processing.";
+ public List getModeContribs() {
+ return modeContribs;
+ }
- int result = JOptionPane.showOptionDialog(editor,
- prompt,
- "Quit",
- JOptionPane.YES_NO_OPTION,
- JOptionPane.QUESTION_MESSAGE,
- null,
- options,
- options[0]);
- if (result == JOptionPane.NO_OPTION ||
- result == JOptionPane.CLOSED_OPTION) {
- return false;
- }
- }
+
+ public List getModeList() {
+ List allModes = new ArrayList<>();
+ allModes.addAll(Arrays.asList(coreModes));
+ if (modeContribs != null) {
+ for (ModeContribution contrib : modeContribs) {
+ allModes.add(contrib.getMode());
}
+ }
+ return allModes;
+ }
- Preferences.unset("server.port");
- Preferences.unset("server.key");
- // This will store the sketch count as zero
- editors.remove(editor);
-// storeSketches();
+ public List getExampleContribs() {
+ return exampleContribs;
+ }
- // Save out the current prefs state
- Preferences.save();
- if (defaultFileMenu == null) {
- if (modeSwitch) {
- // need to close this editor, ever so temporarily
- editor.setVisible(false);
- editor.dispose();
- activeEditor = null;
- editors.remove(editor);
- } else {
- // Since this wasn't an actual Quit event, call System.exit()
- System.exit(0);
- }
- } else {
- editor.setVisible(false);
- editor.dispose();
- defaultFileMenu.insert(sketchbookMenu, 2);
- defaultFileMenu.insert(getRecentMenu(), 3);
-// defaultFileMenu.insert(defaultMode.getExamplesMenu(), 3);
- activeEditor = null;
- editors.remove(editor);
- }
+ private List getInstalledContribs() {
+ List contributions = new ArrayList<>();
- } else {
- // More than one editor window open,
- // proceed with closing the current window.
- editor.setVisible(false);
- editor.dispose();
-// for (int i = 0; i < editorCount; i++) {
-// if (editor == editors[i]) {
-// for (int j = i; j < editorCount-1; j++) {
-// editors[j] = editors[j+1];
-// }
-// editorCount--;
-// // Set to null so that garbage collection occurs
-// editors[editorCount] = null;
-// }
-// }
- editors.remove(editor);
+ List modeContribs = getModeContribs();
+ contributions.addAll(modeContribs);
+
+ for (ModeContribution modeContrib : modeContribs) {
+ Mode mode = modeContrib.getMode();
+ contributions.addAll(new ArrayList<>(mode.contribLibraries));
}
- return true;
- }
+ // TODO this duplicates code in Editor, but it's not editor-specific
+// List toolContribs =
+// ToolContribution.loadAll(Base.getSketchbookToolsFolder());
+// contributions.addAll(toolContribs);
+ contributions.addAll(ToolContribution.loadAll(getSketchbookToolsFolder()));
- /**
- * Handler for File → Quit.
- * @return false if canceled, true otherwise.
- */
- public boolean handleQuit() {
- // If quit is canceled, this will be replaced anyway
- // by a later handleQuit() that is not canceled.
-// storeSketches();
+ contributions.addAll(getExampleContribs());
+ return contributions;
+ }
- if (handleQuitEach()) {
- // make sure running sketches close before quitting
- for (Editor editor : editors) {
- editor.internalCloseRunner();
- }
- // Save out the current prefs state
- Preferences.save();
- if (!Base.isMacOS()) {
- // If this was fired from the menu or an AppleEvent (the Finder),
- // then Mac OS X will send the terminate signal itself.
- System.exit(0);
- }
- return true;
+ public byte[] getInstalledContribsInfo() {
+ List contribs = getInstalledContribs();
+ StringList entries = new StringList();
+ for (Contribution c : contribs) {
+ String entry = c.getTypeName() + "=" +
+ PApplet.urlEncode(String.format("name=%s\nurl=%s\nrevision=%d\nversion=%s",
+ c.getName(), c.getUrl(),
+ c.getVersion(), c.getBenignVersion()));
+ entries.append(entry);
}
- return false;
+ String joined =
+ "id=" + UpdateCheck.getUpdateID() + "&" + entries.join("&");
+// StringBuilder sb = new StringBuilder();
+// try {
+// // Truly ridiculous attempt to shove everything into a GET request.
+// // More likely to be seen as part of a grand plot.
+// ByteArrayOutputStream baos = new ByteArrayOutputStream();
+// GZIPOutputStream output = new GZIPOutputStream(baos);
+// PApplet.saveStream(output, new ByteArrayInputStream(joined.getBytes()));
+// output.close();
+// byte[] b = baos.toByteArray();
+// for (int i = 0; i < b.length; i++) {
+// sb.append(PApplet.hex(b[i], 2));
+// }
+// } catch (IOException e) {
+// e.printStackTrace();
+// }
+// return sb.toString();
+ return joined.getBytes();
}
+ // . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
+
+
/**
- * Attempt to close each open sketch in preparation for quitting.
- * @return false if canceled along the way
+ * Create or modify a sketch.proprties file to specify the given Mode.
*/
- protected boolean handleQuitEach() {
-// int index = 0;
- for (Editor editor : editors) {
-// if (editor.checkModified()) {
-// // Update to the new/final sketch path for this fella
-// storeSketchPath(editor, index);
-// index++;
-//
-// } else {
-// return false;
-// }
- if (!editor.checkModified()) {
- return false;
- }
+ private void saveModeSettings(final File sketchProps, final Mode mode) {
+ try {
+ final Settings settings = new Settings(sketchProps);
+ settings.set("mode", mode.getTitle());
+ settings.set("mode.id", mode.getIdentifier());
+ settings.save();
+ } catch (IOException e) {
+ System.err.println("While creating " + sketchProps + ": " + e.getMessage());
}
- return true;
}
- // .................................................................
+ String getDefaultModeIdentifier() {
+ return "processing.mode.java.JavaMode";
+ }
- /**
- * Asynchronous version of menu rebuild to be used on save and rename
- * to prevent the interface from locking up until the menus are done.
- */
- protected void rebuildSketchbookMenusAsync() {
- //System.out.println("async enter");
- //new Exception().printStackTrace();
- EventQueue.invokeLater(new Runnable() {
- public void run() {
- rebuildSketchbookMenus();
- }
- });
+ public Mode getDefaultMode() {
+ return coreModes[0];
}
- public void thinkDifferentExamples() {
- nextMode.showExamplesFrame();
+ /** Used by ThinkDifferent so that it can have a Sketchbook menu. */
+ public Mode getNextMode() {
+ return nextMode;
}
/**
- * Synchronous version of rebuild, used when the sketchbook folder has
- * changed, so that the libraries are properly re-scanned before those menus
- * (and the examples window) are rebuilt.
+ * The call has already checked to make sure this sketch is not modified,
+ * now change the mode.
+ * @return true if mode is changed.
*/
- protected void rebuildSketchbookMenus() {
- rebuildSketchbookMenu();
- for (Mode mode : getModeList()) {
- //mode.rebuildLibraryList();
- mode.rebuildImportMenu(); // calls rebuildLibraryList
- mode.rebuildToolbarMenu();
- mode.resetExamples();
+ public boolean changeMode(Mode mode) {
+ Mode oldMode = activeEditor.getMode();
+ if (oldMode != mode) {
+ Sketch sketch = activeEditor.getSketch();
+ nextMode = mode;
+
+ if (sketch.isUntitled()) {
+ // The current sketch is empty, just close and start fresh.
+ // (Otherwise the editor would lose its 'untitled' status.)
+ handleClose(activeEditor, true);
+ handleNew();
+
+ } else {
+ // If the current editor contains file extensions that the new mode can handle, then
+ // write a sketch.properties file with the new mode specified, and reopen.
+ boolean newModeCanHandleCurrentSource = true;
+ for (final SketchCode code : sketch.getCode()) {
+ if (!mode.validExtension(code.getExtension())) {
+ newModeCanHandleCurrentSource = false;
+ break;
+ }
+ }
+ if (!newModeCanHandleCurrentSource) {
+ return false;
+ } else {
+ final File props = new File(sketch.getCodeFolder(), "sketch.properties");
+ saveModeSettings(props, nextMode);
+ handleClose(activeEditor, true);
+ Editor editor = handleOpen(sketch.getMainFilePath());
+ if (editor == null) {
+ // the Mode change failed (probably code that's out of date)
+ // re-open the sketch using the mode we were in before
+ saveModeSettings(props, oldMode);
+ handleOpen(sketch.getMainFilePath());
+ return false;
+ }
+ }
+ }
}
+ return true;
}
- protected void rebuildSketchbookMenu() {
-// System.err.println("sketchbook: " + sketchbookFolder);
- sketchbookMenu.removeAll();
- populateSketchbookMenu(sketchbookMenu);
-// boolean found = false;
-// try {
-// found = addSketches(sketchbookMenu, sketchbookFolder, false);
-// } catch (IOException e) {
-// Base.showWarning("Sketchbook Menu Error",
-// "An error occurred while trying to list the sketchbook.", e);
-// }
-// if (!found) {
-// JMenuItem empty = new JMenuItem("(empty)");
-// empty.setEnabled(false);
-// sketchbookMenu.add(empty);
-// }
+ private static class ModeInfo {
+ public final String title;
+ public final String id;
+
+ public ModeInfo(String id, String title) {
+ this.id = id;
+ this.title = title;
+ }
}
- public void populateSketchbookMenu(JMenu menu) {
- boolean found = false;
+ private static ModeInfo modeInfoFor(final File sketch) {
+ final File sketchFolder = sketch.getParentFile();
+ final File sketchProps = new File(sketchFolder, "sketch.properties");
+ if (!sketchProps.exists()) {
+ return null;
+ }
try {
- found = addSketches(menu, sketchbookFolder, false);
+ final Settings settings = new Settings(sketchProps);
+ final String title = settings.get("mode");
+ final String id = settings.get("mode.id");
+ if (title == null || id == null) {
+ return null;
+ }
+ return new ModeInfo(id, title);
} catch (IOException e) {
- Base.showWarning("Sketchbook Menu Error",
- "An error occurred while trying to list the sketchbook.", e);
- }
- if (!found) {
- JMenuItem empty = new JMenuItem("Empty Sketchbook");
- empty.setEnabled(false);
- menu.add(empty);
+ System.err.println("While trying to read " + sketchProps + ": "
+ + e.getMessage());
}
+ return null;
}
- public JMenu getSketchbookMenu() {
- if (sketchbookMenu == null) {
- sketchbookMenu = new JMenu("Sketchbook");
- rebuildSketchbookMenu();
+ private Mode promptForMode(final File sketch, final ModeInfo preferredMode) {
+ final String extension =
+ sketch.getName().substring(sketch.getName().lastIndexOf('.') + 1);
+ final List possibleModes = new ArrayList<>();
+ for (final Mode mode : getModeList()) {
+ if (mode.canEdit(sketch)) {
+ possibleModes.add(mode);
+ }
}
- return sketchbookMenu;
+ if (possibleModes.size() == 1 &&
+ possibleModes.get(0).getIdentifier().equals(getDefaultModeIdentifier())) {
+ // If default mode can open it, then do so without prompting.
+ return possibleModes.get(0);
+ }
+ if (possibleModes.size() == 0) {
+ if (preferredMode == null) {
+ final String msg =
+ "I don't know how to open a sketch with the \"" + extension + "\"\n" +
+ "file extension. You'll have to install a different\n" +
+ "Mode for that.";
+ Messages.showWarning("Modeless Dialog", msg);
+ } else {
+ Messages.showWarning("Modeless Dialog",
+ "Install " + preferredMode.title + " Mode " +
+ "to open this sketch.");
+ }
+ return null;
+ }
+ final Mode[] modes = possibleModes.toArray(new Mode[possibleModes.size()]);
+ final String message = preferredMode == null ?
+ (nextMode.getTitle() + " Mode can't open ." + extension + " files, " +
+ "but you have one or more modes\ninstalled that can. " +
+ "Would you like to try one?") :
+ ("That's a " + preferredMode.title + " Mode sketch, " +
+ "but you don't have " + preferredMode.title + " installed.\n" +
+ "Would you like to try a different mode for opening a " +
+ "." + extension + " sketch?");
+ return (Mode) JOptionPane.showInputDialog(null, message, "Choose Wisely",
+ JOptionPane.QUESTION_MESSAGE,
+ null, modes, modes[0]);
}
-// public JMenu getRecentMenu() {
-// if (recentMenu == null) {
-// recentMenu = recent.createMenu();
-// } else {
-// recent.updateMenu(recentMenu);
-// }
-// return recentMenu;
-// }
-
-
- public JMenu getRecentMenu() {
- return recent.getMenu();
+ private Mode selectMode(final File sketch) {
+ final ModeInfo modeInfo = modeInfoFor(sketch);
+ final Mode specifiedMode = modeInfo == null ? null : findMode(modeInfo.id);
+ if (specifiedMode != null) {
+ return specifiedMode;
+ }
+ return promptForMode(sketch, modeInfo);
}
- public JMenu getToolbarRecentMenu() {
- return recent.getToolbarMenu();
+ protected Mode findMode(String id) {
+ for (Mode mode : getModeList()) {
+ if (mode.getIdentifier().equals(id)) {
+ return mode;
+ }
+ }
+ return null;
}
- public void handleRecent(Editor editor) {
- recent.handle(editor);
- }
+ // . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
- /**
- * Called before a sketch is renamed so that its old name is
- * no longer in the menu.
- */
- public void removeRecent(Editor editor) {
- recent.remove(editor);
- }
+ boolean breakTime = false;
+ String[] months = {
+ "jan", "feb", "mar", "apr", "may", "jun",
+ "jul", "aug", "sep", "oct", "nov", "dec"
+ };
/**
- * Scan a folder recursively, and add any sketches found to the menu
- * specified. Set the openReplaces parameter to true when opening the sketch
- * should replace the sketch in the current window, or false when the
- * sketch should open in a new window.
+ * Create a new untitled document in a new sketch window.
*/
- protected boolean addSketches(JMenu menu, File folder,
- final boolean replaceExisting) throws IOException {
- // skip .DS_Store files, etc (this shouldn't actually be necessary)
- if (!folder.isDirectory()) {
- return false;
- }
-
- if (folder.getName().equals("libraries")) {
- return false; // let's not go there
- }
+ public void handleNew() {
+ try {
+ File newbieDir = null;
+ String newbieName = null;
- String[] list = folder.list();
- // If a bad folder or unreadable or whatever, this will come back null
- if (list == null) {
- return false;
- }
+ // In 0126, untitled sketches will begin in the temp folder,
+ // and then moved to a new location because Save will default to Save As.
+// File sketchbookDir = getSketchbookFolder();
+ File newbieParentDir = untitledFolder;
- // Alphabetize the list, since it's not always alpha order
- Arrays.sort(list, String.CASE_INSENSITIVE_ORDER);
+ String prefix = Preferences.get("editor.untitled.prefix");
- ActionListener listener = new ActionListener() {
- public void actionPerformed(ActionEvent e) {
- String path = e.getActionCommand();
- if (new File(path).exists()) {
- boolean replace = replaceExisting;
- if ((e.getModifiers() & ActionEvent.SHIFT_MASK) != 0) {
- replace = !replace;
- }
-// if (replace) {
-// handleOpenReplace(path);
-// } else {
- handleOpen(path);
-// }
+ // Use a generic name like sketch_031008a, the date plus a char
+ int index = 0;
+ String format = Preferences.get("editor.untitled.suffix");
+ String suffix = null;
+ if (format == null) {
+ Calendar cal = Calendar.getInstance();
+ int day = cal.get(Calendar.DAY_OF_MONTH); // 1..31
+ int month = cal.get(Calendar.MONTH); // 0..11
+ suffix = months[month] + PApplet.nf(day, 2);
+ } else {
+ //SimpleDateFormat formatter = new SimpleDateFormat("yyMMdd");
+ //SimpleDateFormat formatter = new SimpleDateFormat("MMMdd");
+ //String purty = formatter.format(new Date()).toLowerCase();
+ SimpleDateFormat formatter = new SimpleDateFormat(format);
+ suffix = formatter.format(new Date());
+ }
+ do {
+ if (index == 26) {
+ // In 0159, avoid running past z by sending people outdoors.
+ if (!breakTime) {
+ Messages.showWarning("Time for a Break",
+ "You've reached the limit for auto naming of new sketches\n" +
+ "for the day. How about going for a walk instead?", null);
+ breakTime = true;
} else {
- showWarning("Sketch Disappeared",
- "The selected sketch no longer exists.\n" +
- "You may need to restart Processing to update\n" +
- "the sketchbook menu.", null);
+ Messages.showWarning("Sunshine",
+ "No really, time for some fresh air for you.", null);
}
+ return;
}
- };
- // offers no speed improvement
- //menu.addActionListener(listener);
-
- boolean found = false;
-
-// for (int i = 0; i < list.length; i++) {
-// if ((list[i].charAt(0) == '.') ||
-// list[i].equals("CVS")) continue;
- for (String name : list) {
- if (name.charAt(0) == '.') {
- continue;
- }
-
- File subfolder = new File(folder, name);
- if (subfolder.isDirectory()) {
- File entry = checkSketchFolder(subfolder, name);
- if (entry != null) {
+ newbieName = prefix + suffix + ((char) ('a' + index));
+ // Also sanitize the name since it might do strange things on
+ // non-English systems that don't use this sort of date format.
+ // http://code.google.com/p/processing/issues/detail?id=283
+ newbieName = Sketch.sanitizeName(newbieName);
+ newbieDir = new File(newbieParentDir, newbieName);
+ index++;
+ // Make sure it's not in the temp folder *and* it's not in the sketchbook
+ } while (newbieDir.exists() || new File(sketchbookFolder, newbieName).exists());
-// File entry = new File(subfolder, list[i] + getExtension());
-// // if a .pde file of the same prefix as the folder exists..
-// if (entry.exists()) {
-// //String sanityCheck = sanitizedName(list[i]);
-// //if (!sanityCheck.equals(list[i])) {
-// if (!Sketch.isSanitaryName(list[i])) {
-// if (!builtOnce) {
-// String complaining =
-// "The sketch \"" + list[i] + "\" cannot be used.\n" +
-// "Sketch names must contain only basic letters and numbers\n" +
-// "(ASCII-only with no spaces, " +
-// "and it cannot start with a number).\n" +
-// "To get rid of this message, remove the sketch from\n" +
-// entry.getAbsolutePath();
-// Base.showMessage("Ignoring sketch with bad name", complaining);
-// }
-// continue;
-// }
+ // Make the directory for the new sketch
+ newbieDir.mkdirs();
- JMenuItem item = new JMenuItem(name);
- item.addActionListener(listener);
- item.setActionCommand(entry.getAbsolutePath());
- menu.add(item);
- found = true;
+ // Add any template files from the Mode itself
+ File newbieFile = nextMode.addTemplateFiles(newbieDir, newbieName);
- } else {
- // not a sketch folder, but maybe a subfolder containing sketches
- JMenu submenu = new JMenu(name);
- // needs to be separate var otherwise would set ifound to false
- boolean anything = addSketches(submenu, subfolder, replaceExisting);
- if (anything) {
- menu.add(submenu);
- found = true;
- }
- }
+ /*
+ // Make an empty pde file
+ File newbieFile =
+ new File(newbieDir, newbieName + "." + nextMode.getDefaultExtension()); //$NON-NLS-1$
+ if (!newbieFile.createNewFile()) {
+ throw new IOException(newbieFile + " already exists.");
}
- }
- return found; // actually ignored, but..
- }
-
-
- protected boolean addSketches(DefaultMutableTreeNode node, File folder) throws IOException {
- // skip .DS_Store files, etc (this shouldn't actually be necessary)
- if (!folder.isDirectory()) {
- return false;
- }
-
- if (folder.getName().equals("libraries")) {
- return false; // let's not go there
- }
-
- String[] list = folder.list();
- // If a bad folder or unreadable or whatever, this will come back null
- if (list == null) {
- return false;
- }
-
- // Alphabetize the list, since it's not always alpha order
- Arrays.sort(list, String.CASE_INSENSITIVE_ORDER);
-
-// ActionListener listener = new ActionListener() {
-// public void actionPerformed(ActionEvent e) {
-// String path = e.getActionCommand();
-// if (new File(path).exists()) {
-// handleOpen(path);
-// } else {
-// showWarning("Sketch Disappeared",
-// "The selected sketch no longer exists.\n" +
-// "You may need to restart Processing to update\n" +
-// "the sketchbook menu.", null);
-// }
-// }
-// };
- // offers no speed improvement
- //menu.addActionListener(listener);
-
- boolean found = false;
+ */
- for (String name : list) {
- if (name.charAt(0) == '.') {
- continue;
+ // Create sketch properties file if it's not the default mode.
+ if (!nextMode.equals(getDefaultMode())) {
+ saveModeSettings(new File(newbieDir, "sketch.properties"), nextMode);
}
-// JTree tree = null;
-// TreePath[] a = tree.getSelectionPaths();
-// for (TreePath path : a) {
-// Object[] o = path.getPath();
-// }
-
- File subfolder = new File(folder, name);
- if (subfolder.isDirectory()) {
- File entry = checkSketchFolder(subfolder, name);
- if (entry != null) {
-// DefaultMutableTreeNode item = new DefaultMutableTreeNode(name);
- DefaultMutableTreeNode item =
- new DefaultMutableTreeNode(new SketchReference(name, entry));
-// item.addActionListener(listener);
-// item.setActionCommand(entry.getAbsolutePath());
-// menu.add(item);
- node.add(item);
- found = true;
+ String path = newbieFile.getAbsolutePath();
+ /*Editor editor =*/ handleOpen(path, true);
- } else {
- // not a sketch folder, but maybe a subfolder containing sketches
-// JMenu submenu = new JMenu(name);
- DefaultMutableTreeNode subnode = new DefaultMutableTreeNode(name);
- // needs to be separate var otherwise would set ifound to false
- boolean anything = addSketches(subnode, subfolder);
- if (anything) {
- node.add(subnode);
- found = true;
- }
- }
- }
+ } catch (IOException e) {
+ Messages.showWarning("That's new to me",
+ "A strange and unexplainable error occurred\n" +
+ "while trying to create a new sketch.", e);
}
- return found;
}
/**
- * Check through the various modes and see if this is a legit sketch.
- * Because the default mode will be the first in the list, this will always
- * prefer that one over the others.
+ * Prompt for a sketch to open, and open it in a new window.
*/
- File checkSketchFolder(File subfolder, String item) {
+ public void handleOpenPrompt() {
+ final StringList extensions = new StringList();
for (Mode mode : getModeList()) {
- File entry = new File(subfolder, item + "." + mode.getDefaultExtension());
- // if a .pde file of the same prefix as the folder exists..
- if (entry.exists()) {
- return entry;
- }
- // for the new releases, don't bother lecturing.. just ignore the sketch
- /*
- if (!Sketch.isSanitaryName(list[i])) {
- if (!builtOnce) {
- String complaining =
- "The sketch \"" + list[i] + "\" cannot be used.\n" +
- "Sketch names must contain only basic letters and numbers\n" +
- "(ASCII-only with no spaces, " +
- "and it cannot start with a number).\n" +
- "To get rid of this message, remove the sketch from\n" +
- entry.getAbsolutePath();
- Base.showMessage("Ignoring sketch with bad name", complaining);
- }
- continue;
- }
- */
+ extensions.append(mode.getDefaultExtension());
}
- return null;
- }
- // .................................................................
+ final String prompt = Language.text("open");
+ // don't use native dialogs on Linux (or anyone else w/ override)
+ if (Preferences.getBoolean("chooser.files.native")) { //$NON-NLS-1$
+ // use the front-most window frame for placing file dialog
+ FileDialog openDialog =
+ new FileDialog(activeEditor, prompt, FileDialog.LOAD);
- /**
- * Show the About box.
- */
- public void handleAbout() {
- final Image image = Toolkit.getLibImage("about.jpg", activeEditor);
- final Window window = new Window(activeEditor) {
- public void paint(Graphics g) {
- g.drawImage(image, 0, 0, null);
-
- Graphics2D g2 = (Graphics2D) g;
- g2.setRenderingHint(RenderingHints.KEY_TEXT_ANTIALIASING,
- RenderingHints.VALUE_TEXT_ANTIALIAS_OFF);
-
- g.setFont(new Font("SansSerif", Font.PLAIN, 11));
- g.setColor(Color.white);
- g.drawString(Base.VERSION_NAME, 50, 30);
- }
- };
- window.addMouseListener(new MouseAdapter() {
- public void mousePressed(MouseEvent e) {
- window.dispose();
+ // Only show .pde files as eligible bachelors
+ openDialog.setFilenameFilter(new FilenameFilter() {
+ public boolean accept(File dir, String name) {
+ // confirmed to be working properly [fry 110128]
+ for (String ext : extensions) {
+ if (name.toLowerCase().endsWith("." + ext)) { //$NON-NLS-1$
+ return true;
+ }
+ }
+ return false;
}
});
- int w = image.getWidth(activeEditor);
- int h = image.getHeight(activeEditor);
- Dimension screen = Toolkit.getScreenSize();
- window.setBounds((screen.width-w)/2, (screen.height-h)/2, w, h);
- window.setVisible(true);
- }
+ openDialog.setVisible(true);
- /**
- * Show the Preferences window.
- */
- public void handlePrefs() {
- if (preferencesFrame == null) {
- preferencesFrame = new Preferences(this);
- }
- preferencesFrame.showFrame();
- }
-
+ String directory = openDialog.getDirectory();
+ String filename = openDialog.getFile();
+ if (filename != null) {
+ File inputFile = new File(directory, filename);
+ handleOpen(inputFile.getAbsolutePath());
+ }
- /**
- * Show the library installer window.
- */
- public void handleOpenLibraryManager() {
- libraryManagerFrame.showFrame(activeEditor);
- }
+ } else {
+ if (openChooser == null) {
+ openChooser = new JFileChooser();
+ }
+ openChooser.setDialogTitle(prompt);
+ openChooser.setFileFilter(new javax.swing.filechooser.FileFilter() {
+ public boolean accept(File file) {
+ // JFileChooser requires you to explicitly say yes to directories
+ // as well (unlike the AWT chooser). Useful, but... different.
+ // http://code.google.com/p/processing/issues/detail?id=1151
+ if (file.isDirectory()) {
+ return true;
+ }
+ for (String ext : extensions) {
+ if (file.getName().toLowerCase().endsWith("." + ext)) { //$NON-NLS-1$
+ return true;
+ }
+ }
+ return false;
+ }
- /**
- * Show the tool installer window.
- */
- public void handleOpenToolManager() {
- toolManagerFrame.showFrame(activeEditor);
+ public String getDescription() {
+ return "Processing Sketch";
+ }
+ });
+ if (openChooser.showOpenDialog(activeEditor) == JFileChooser.APPROVE_OPTION) {
+ handleOpen(openChooser.getSelectedFile().getAbsolutePath());
+ }
+ }
}
/**
- * Show the mode installer window.
+ * Open a sketch from the path specified. Do not use for untitled sketches.
*/
- public void handleOpenModeManager() {
- modeManagerFrame.showFrame(activeEditor);
- }
-
-
- public void handleShowUpdates() {
- updateManagerFrame.showFrame(activeEditor);
+ public Editor handleOpen(String path) {
+ return handleOpen(path, false);
}
- // ...................................................................
-
/**
- * Get list of platform constants.
+ * Open a sketch in a new window.
+ * @param path Path to the pde file for the sketch in question
+ * @return the Editor object, so that properties (like 'untitled')
+ * can be set by the caller
*/
-// static public int[] getPlatforms() {
-// return platforms;
-// }
-
-
-// static public int getPlatform() {
-// String osname = System.getProperty("os.name");
-//
-// if (osname.indexOf("Mac") != -1) {
-// return PConstants.MACOSX;
-//
-// } else if (osname.indexOf("Windows") != -1) {
-// return PConstants.WINDOWS;
-//
-// } else if (osname.equals("Linux")) { // true for the ibm vm
-// return PConstants.LINUX;
-//
-// } else {
-// return PConstants.OTHER;
-// }
-// }
-
-
- static public Platform getPlatform() {
- return platform;
- }
-
-
- static public String getPlatformName() {
- return PConstants.platformNames[PApplet.platform];
+ public Editor handleOpen(String path, boolean untitled) {
+ return handleOpen(path, untitled, new EditorState(editors));
}
- /**
- * Return whether sketches will run as 32- or 64-bits. On Linux and Windows,
- * this is the bit depth of the machine, while on OS X it's determined by the
- * setting from preferences, since both 32- and 64-bit are supported.
- */
- static public int getNativeBits() {
- if (Base.isMacOS()) {
- return Preferences.getInteger("run.options.bits");
- }
- return nativeBits;
- }
+ protected Editor handleOpen(String path, boolean untitled,
+ EditorState state) {
+ try {
+ // System.err.println("entering handleOpen " + path);
- /*
- static public String getPlatformName() {
- String osname = System.getProperty("os.name");
+ final File file = new File(path);
+ if (!file.exists()) {
+ return null;
+ }
- if (osname.indexOf("Mac") != -1) {
- return "macosx";
+ // Cycle through open windows to make sure that it's not already open.
+ for (Editor editor : editors) {
+ // User may have double-clicked any PDE in the sketch folder,
+ // so we have to check each open tab (not just the main one).
+ // https://github.com/processing/processing/issues/2506
+ for (SketchCode tab : editor.getSketch().getCode()) {
+ if (tab.getFile().equals(file)) {
+ editor.toFront();
+ // move back to the top of the recent list
+ Recent.append(editor);
+ return editor;
+ }
+ }
+ }
- } else if (osname.indexOf("Windows") != -1) {
- return "windows";
+ if (!Sketch.isSanitaryName(file.getName())) {
+ Messages.showWarning("You're tricky, but not tricky enough",
+ file.getName() + " is not a valid name for a sketch.\n" +
+ "Better to stick to ASCII, no spaces, and make sure\n" +
+ "it doesn't start with a number.", null);
+ return null;
+ }
- } else if (osname.equals("Linux")) { // true for the ibm vm
- return "linux";
+ if (!nextMode.canEdit(file)) {
+ final Mode mode = selectMode(file);
+ if (mode == null) {
+ return null;
+ }
+ nextMode = mode;
+ }
- } else {
- return "other";
- }
- }
- */
+ try {
+ Editor editor = nextMode.createEditor(this, path, state);
+ editor.setUpdatesAvailable(updatesAvailable);
- /**
- * Map a platform constant to its name.
- * @param which PConstants.WINDOWS, PConstants.MACOSX, PConstants.LINUX
- * @return one of "windows", "macosx", or "linux"
- */
- static public String getPlatformName(int which) {
- return platformNames.get(which);
- }
+ // opened successfully, let's go to work
+ editor.getSketch().setUntitled(untitled);
+ editors.add(editor);
+ Recent.append(editor);
+ // now that we're ready, show the window
+ // (don't do earlier, cuz we might move it based on a window being closed)
+ editor.setVisible(true);
- static public int getPlatformIndex(String what) {
- Integer entry = platformIndices.get(what);
- return (entry == null) ? -1 : entry.intValue();
- }
+ return editor;
+ } catch (EditorException ee) {
+ if (ee.getMessage() != null) { // null if the user canceled
+ Messages.showWarning("Error opening sketch", ee.getMessage(), ee);
+ }
+ } catch (NoSuchMethodError nsme) {
+ Messages.showWarning("Mode out of date",
+ nextMode.getTitle() + " is not compatible with this version of Processing.\n" +
+ "Try updating the Mode or contact its author for a new version.", nsme);
+ } catch (Throwable t) {
+ if (nextMode.equals(getDefaultMode())) {
+ Messages.showTrace("Serious Problem",
+ "An unexpected, unknown, and unrecoverable error occurred\n" +
+ "while opening a new editor window. Please report this.", t, true);
+ } else {
+ Messages.showTrace("Mode Problems",
+ "A nasty error occurred while trying to use " + nextMode.getTitle() + ".\n" +
+ "It may not be compatible with this version of Processing.\n" +
+ "Try updating the Mode or contact its author for a new version.", t, false);
+ }
+ }
+ if (editors.isEmpty()) {
+ Mode defaultMode = getDefaultMode();
+ if (nextMode == defaultMode) {
+ // unreachable? hopefully?
+ Messages.showError("Editor Problems",
+ "An error occurred while trying to change modes.\n" +
+ "We'll have to quit for now because it's an\n" +
+ "unfortunate bit of indigestion with the default Mode.",
+ null);
+ } else {
+ // Don't leave the user hanging or the PDE locked up
+ // https://github.com/processing/processing/issues/4467
+ if (untitled) {
+ nextMode = defaultMode;
+ handleNew();
+ return null; // ignored by any caller
- // These were changed to no longer rely on PApplet and PConstants because
- // of conflicts that could happen with older versions of core.jar, where
- // the MACOSX constant would instead read as the LINUX constant.
+ } else {
+ // This null response will be kicked back to changeMode(),
+ // signaling it to re-open the sketch in the default Mode.
+ return null;
+ }
+ }
+ }
+ /*
+ if (editors.isEmpty()) {
+ // if the bad mode is the default mode, don't go into an infinite loop
+ // trying to recreate a window with the default mode.
+ Mode defaultMode = getDefaultMode();
+ if (nextMode == defaultMode) {
+ Base.showError("Editor Problems",
+ "An error occurred while trying to change modes.\n" +
+ "We'll have to quit for now because it's an\n" +
+ "unfortunate bit of indigestion with the default Mode.",
+ null);
+ } else {
+ editor = defaultMode.createEditor(this, path, state);
+ }
+ }
+ */
- /**
- * returns true if Processing is running on a Mac OS X machine.
- */
- static public boolean isMacOS() {
- //return PApplet.platform == PConstants.MACOSX;
- return System.getProperty("os.name").indexOf("Mac") != -1;
+ } catch (Throwable t) {
+ Messages.showTrace("Terrible News",
+ "A serious error occurred while " +
+ "trying to create a new editor window.", t,
+ nextMode == getDefaultMode()); // quit if default
+ nextMode = getDefaultMode();
+ }
+ return null;
}
- /**
- * returns true if running on windows.
- */
- static public boolean isWindows() {
- //return PApplet.platform == PConstants.WINDOWS;
- return System.getProperty("os.name").indexOf("Windows") != -1;
- }
+ // . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
/**
- * true if running on linux.
+ * Close a sketch as specified by its editor window.
+ * @param editor Editor object of the sketch to be closed.
+ * @param modeSwitch Whether this close is being done in the context of a
+ * mode switch.
+ * @return true if succeeded in closing, false if canceled.
*/
- static public boolean isLinux() {
- //return PApplet.platform == PConstants.LINUX;
- return System.getProperty("os.name").indexOf("Linux") != -1;
- }
-
-
- // .................................................................
-
-
- static public File getSettingsFolder() {
- File settingsFolder = null;
+ public boolean handleClose(Editor editor, boolean modeSwitch) {
+ // Check if modified
+// boolean immediate = editors.size() == 1;
+ if (!editor.checkModified()) {
+ return false;
+ }
- String preferencesPath = Preferences.get("settings.path");
- if (preferencesPath != null) {
- settingsFolder = new File(preferencesPath);
+ // Close the running window, avoid window boogers with multiple sketches
+ editor.internalCloseRunner();
- } else {
- try {
- settingsFolder = platform.getSettingsFolder();
- } catch (Exception e) {
- showError("Problem getting data folder",
- "Error getting the Processing data folder.", e);
- }
- }
+// System.out.println("editors size is " + editors.size());
+ if (editors.size() == 1) {
+ // For 0158, when closing the last window /and/ it was already an
+ // untitled sketch, just give up and let the user quit.
+// if (Preferences.getBoolean("sketchbook.closing_last_window_quits") ||
+// (editor.untitled && !editor.getSketch().isModified())) {
+ if (Platform.isMacOS()) {
+ // If the central menubar isn't supported on this OS X JVM,
+ // we have to do the old behavior. Yuck!
+ if (defaultFileMenu == null) {
+ Object[] options = { Language.text("prompt.ok"), Language.text("prompt.cancel") };
+ String prompt =
+ " " +
+ " " +
+ "Are you sure you want to Quit? " +
+ "Closing the last open sketch will quit Processing.";
- // create the folder if it doesn't exist already
- if (!settingsFolder.exists()) {
- if (!settingsFolder.mkdirs()) {
- showError("Settings issues",
- "Processing cannot run because it could not\n" +
- "create a folder to store your settings.", null);
+ int result = JOptionPane.showOptionDialog(editor,
+ prompt,
+ "Quit",
+ JOptionPane.YES_NO_OPTION,
+ JOptionPane.QUESTION_MESSAGE,
+ null,
+ options,
+ options[0]);
+ if (result == JOptionPane.NO_OPTION ||
+ result == JOptionPane.CLOSED_OPTION) {
+ return false;
+ }
+ }
}
- }
- return settingsFolder;
- }
+ Preferences.unset("server.port"); //$NON-NLS-1$
+ Preferences.unset("server.key"); //$NON-NLS-1$
- /**
- * Convenience method to get a File object for the specified filename inside
- * the settings folder. Used to get preferences and recent sketch files.
- * @param filename A file inside the settings folder.
- * @return filename wrapped as a File object inside the settings folder
- */
- static public File getSettingsFile(String filename) {
- return new File(getSettingsFolder(), filename);
- }
-
+// // This will store the sketch count as zero
+// editors.remove(editor);
+// System.out.println("editors size now " + editors.size());
+// storeSketches();
- /*
- static public File getBuildFolder() {
- if (buildFolder == null) {
- String buildPath = Preferences.get("build.path");
- if (buildPath != null) {
- buildFolder = new File(buildPath);
+ // Save out the current prefs state
+ Preferences.save();
- } else {
- //File folder = new File(getTempFolder(), "build");
- //if (!folder.exists()) folder.mkdirs();
- buildFolder = createTempFolder("build");
- buildFolder.deleteOnExit();
+ if (defaultFileMenu == null) {
+ if (modeSwitch) {
+ // need to close this editor, ever so temporarily
+ editor.setVisible(false);
+ editor.dispose();
+ activeEditor = null;
+ editors.remove(editor);
+ } else {
+ // Since this wasn't an actual Quit event, call System.exit()
+ System.exit(0);
+ }
+ } else { // on OS X, update the default file menu
+ editor.setVisible(false);
+ editor.dispose();
+ defaultFileMenu.insert(Recent.getMenu(), 2);
+ activeEditor = null;
+ editors.remove(editor);
}
+
+ } else {
+ // More than one editor window open,
+ // proceed with closing the current window.
+ editor.setVisible(false);
+ editor.dispose();
+ editors.remove(editor);
}
- return buildFolder;
+ return true;
}
- */
/**
- * Create a temporary folder by using the createTempFile() mechanism,
- * deleting the file it creates, and making a folder using the location
- * that was provided.
- *
- * Unlike createTempFile(), there is no minimum size for prefix. If
- * prefix is less than 3 characters, the remaining characters will be
- * filled with underscores
+ * Handler for File → Quit.
+ * @return false if canceled, true otherwise.
*/
- static public File createTempFolder(String prefix, String suffix, File directory) throws IOException {
- int fillChars = 3 - prefix.length();
- for (int i = 0; i < fillChars; i++) {
- prefix += '_';
- }
- File folder = File.createTempFile(prefix, suffix, directory);
- // Now delete that file and create a folder in its place
- folder.delete();
- folder.mkdirs();
- // And send the folder back to your friends
- return folder;
- }
-
-
-// static public String getExamplesPath() {
-// return examplesFolder.getAbsolutePath();
-// }
-
-// public File getExamplesFolder() {
-// return examplesFolder;
-// }
-
-
-// static public String getLibrariesPath() {
-// return librariesFolder.getAbsolutePath();
-// }
-
-
-// public File getLibrariesFolder() {
-// return librariesFolder;
-// }
-
-
-// static public File getToolsFolder() {
- static public File getToolsFolder() {
-// return toolsFolder;
- return getContentFile("tools");
- }
-
+ public boolean handleQuit() {
+ // If quit is canceled, this will be replaced anyway
+ // by a later handleQuit() that is not canceled.
+// storeSketches();
-// static public String getToolsPath() {
-// return toolsFolder.getAbsolutePath();
-// }
+ if (handleQuitEach()) {
+ // make sure running sketches close before quitting
+ for (Editor editor : editors) {
+ editor.internalCloseRunner();
+ }
+ // Save out the current prefs state
+ Preferences.save();
+ // Finished with this guy
+ Console.shutdown();
- static public void locateSketchbookFolder() {
- // If a value is at least set, first check to see if the folder exists.
- // If it doesn't, warn the user that the sketchbook folder is being reset.
- String sketchbookPath = Preferences.get("sketchbook.path");
- if (sketchbookPath != null) {
- sketchbookFolder = new File(sketchbookPath);
- if (!sketchbookFolder.exists()) {
- Base.showWarning("Sketchbook folder disappeared",
- "The sketchbook folder no longer exists.\n" +
- "Processing will switch to the default sketchbook\n" +
- "location, and create a new sketchbook folder if\n" +
- "necessary. Processing will then stop talking\n" +
- "about himself in the third person.", null);
- sketchbookFolder = null;
+ if (!Platform.isMacOS()) {
+ // If this was fired from the menu or an AppleEvent (the Finder),
+ // then Mac OS X will send the terminate signal itself.
+ System.exit(0);
}
+ return true;
}
+ return false;
+ }
- // If no path is set, get the default sketchbook folder for this platform
- if (sketchbookFolder == null) {
- sketchbookFolder = getDefaultSketchbookFolder();
- Preferences.set("sketchbook.path", sketchbookFolder.getAbsolutePath());
- if (!sketchbookFolder.exists()) {
- sketchbookFolder.mkdirs();
+
+ /**
+ * Attempt to close each open sketch in preparation for quitting.
+ * @return false if canceled along the way
+ */
+ protected boolean handleQuitEach() {
+// int index = 0;
+ for (Editor editor : editors) {
+// if (editor.checkModified()) {
+// // Update to the new/final sketch path for this fella
+// storeSketchPath(editor, index);
+// index++;
+//
+// } else {
+// return false;
+// }
+ if (!editor.checkModified()) {
+ return false;
}
}
-
- getSketchbookLibrariesFolder().mkdir();
- getSketchbookToolsFolder().mkdir();
- getSketchbookModesFolder().mkdir();
-// System.err.println("sketchbook: " + sketchbookFolder);
+ return true;
}
- public void setSketchbookFolder(File folder) {
- sketchbookFolder = folder;
- Preferences.set("sketchbook.path", folder.getAbsolutePath());
- rebuildSketchbookMenus();
- }
+ // . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
- static public File getSketchbookFolder() {
-// return new File(Preferences.get("sketchbook.path"));
- return sketchbookFolder;
+ /**
+ * Asynchronous version of menu rebuild to be used on save and rename
+ * to prevent the interface from locking up until the menus are done.
+ */
+ protected void rebuildSketchbookMenusAsync() {
+ EventQueue.invokeLater(new Runnable() {
+ public void run() {
+ rebuildSketchbookMenus();
+ }
+ });
}
- static public File getSketchbookLibrariesFolder() {
-// return new File(getSketchbookFolder(), "libraries");
- return new File(sketchbookFolder, "libraries");
+ public void thinkDifferentExamples() {
+ nextMode.showExamplesFrame();
}
- static public File getSketchbookToolsFolder() {
- return new File(sketchbookFolder, "tools");
+ /**
+ * Synchronous version of rebuild, used when the sketchbook folder has
+ * changed, so that the libraries are properly re-scanned before those menus
+ * (and the examples window) are rebuilt.
+ */
+ protected void rebuildSketchbookMenus() {
+ for (Mode mode : getModeList()) {
+ mode.rebuildImportMenu(); // calls rebuildLibraryList
+ mode.rebuildToolbarMenu();
+ mode.rebuildExamplesFrame();
+ mode.rebuildSketchbookFrame();
+ }
}
- static public File getSketchbookModesFolder() {
- return new File(sketchbookFolder, "modes");
+ protected void rebuildSketchbookMenu() {
+ sketchbookMenu.removeAll();
+ populateSketchbookMenu(sketchbookMenu);
}
- static protected File getDefaultSketchbookFolder() {
- File sketchbookFolder = null;
+ public void populateSketchbookMenu(JMenu menu) {
+ boolean found = false;
try {
- sketchbookFolder = platform.getDefaultSketchbookFolder();
- } catch (Exception e) { }
-
- if (sketchbookFolder == null) {
- showError("No sketchbook",
- "Problem while trying to get the sketchbook", null);
- }
-
- // create the folder if it doesn't exist already
- boolean result = true;
- if (!sketchbookFolder.exists()) {
- result = sketchbookFolder.mkdirs();
+ found = addSketches(menu, sketchbookFolder, false);
+ } catch (IOException e) {
+ Messages.showWarning("Sketchbook Menu Error",
+ "An error occurred while trying to list the sketchbook.", e);
}
-
- if (!result) {
- showError("You forgot your sketchbook",
- "Processing cannot run because it could not\n" +
- "create a folder to store your sketchbook.", null);
+ if (!found) {
+ JMenuItem empty = new JMenuItem(Language.text("menu.file.sketchbook.empty"));
+ empty.setEnabled(false);
+ menu.add(empty);
}
-
- return sketchbookFolder;
}
-// /**
-// * Check for a new sketchbook location.
-// */
-// static protected File promptSketchbookLocation() {
-// // Most often this will happen on Linux, so default to their home dir.
-// File folder = new File(System.getProperty("user.home"), "sketchbook");
-// String prompt = "Select a folder to place sketches...";
-//
-//// FolderSelector fs = new FolderSelector(prompt, folder, new Frame());
-//// folder = fs.getFolder();
-// folder = Base.selectFolder(prompt, folder, new Frame());
-//
-//// folder = Base.selectFolder(prompt, folder, null);
-//// PApplet.selectFolder(prompt,
-//// "promptSketchbookCallback", dflt,
-//// Preferences.this, dialog);
-//
-// if (folder == null) {
-// System.exit(0);
-// }
-// // Create the folder if it doesn't exist already
-// if (!folder.exists()) {
-// folder.mkdirs();
-// return folder;
-// }
-// return folder;
-// }
-
-
- // .................................................................
-
-
- /**
- * Implements the cross-platform headache of opening URLs.
- *
- * For 2.0a8 and later, this requires the parameter to be an actual URL,
- * meaning that you can't send it a file:// path without a prefix. It also
- * just calls into Platform, which now uses java.awt.Desktop (where
- * possible, meaning not on Linux) now that we're requiring Java 6.
- * As it happens the URL must also be properly URL-encoded.
- */
- static public void openURL(String url) {
- try {
- platform.openURL(url);
-
- } catch (Exception e) {
- showWarning("Problem Opening URL",
- "Could not open the URL\n" + url, e);
- }
+ /*
+ public JMenu getRecentMenu() {
+ return recent.getMenu();
}
- /**
- * Used to determine whether to disable the "Show Sketch Folder" option.
- * @return true If a means of opening a folder is known to be available.
- */
- static protected boolean openFolderAvailable() {
- return platform.openFolderAvailable();
+ public JMenu getToolbarRecentMenu() {
+ return recent.getToolbarMenu();
}
- /**
- * Implements the other cross-platform headache of opening
- * a folder in the machine's native file browser.
- */
- static public void openFolder(File file) {
- try {
- platform.openFolder(file);
-
- } catch (Exception e) {
- showWarning("Problem Opening Folder",
- "Could not open the folder\n" + file.getAbsolutePath(), e);
- }
+ public void handleRecent(Editor editor) {
+ recent.handle(editor);
}
- // .................................................................
-
-
-// /**
-// * Prompt for a folder and return it as a File object (or null).
-// * Implementation for choosing directories that handles both the
-// * Mac OS X hack to allow the native AWT file dialog, or uses
-// * the JFileChooser on other platforms. Mac AWT trick obtained from
-// * this post
-// * on the OS X Java dev archive which explains the cryptic note in
-// * Apple's Java 1.4 release docs about the special System property.
-// */
-// static public File selectFolder(String prompt, File folder, Frame frame) {
-// if (Base.isMacOS()) {
-// if (frame == null) frame = new Frame(); //.pack();
-// FileDialog fd = new FileDialog(frame, prompt, FileDialog.LOAD);
-// if (folder != null) {
-// fd.setDirectory(folder.getParent());
-// //fd.setFile(folder.getName());
-// }
-// System.setProperty("apple.awt.fileDialogForDirectories", "true");
-// fd.setVisible(true);
-// System.setProperty("apple.awt.fileDialogForDirectories", "false");
-// if (fd.getFile() == null) {
-// return null;
-// }
-// return new File(fd.getDirectory(), fd.getFile());
-//
-// } else {
-// JFileChooser fc = new JFileChooser();
-// fc.setDialogTitle(prompt);
-// if (folder != null) {
-// fc.setSelectedFile(folder);
-// }
-// fc.setFileSelectionMode(JFileChooser.DIRECTORIES_ONLY);
-//
-// int returned = fc.showOpenDialog(new JDialog());
-// if (returned == JFileChooser.APPROVE_OPTION) {
-// return fc.getSelectedFile();
-// }
-// }
-// return null;
-// }
-
-
-// static class FolderSelector {
-// File folder;
-// boolean ready;
-//
-// FolderSelector(String prompt, File defaultFile, Frame parentFrame) {
-// PApplet.selectFolder(prompt, "callback", defaultFile, this, parentFrame);
-// }
-//
-// public void callback(File folder) {
-// this.folder = folder;
-// ready = true;
-// }
-//
-// boolean isReady() {
-// return ready;
-// }
-//
-// /** block until the folder is available */
-// File getFolder() {
-// while (!ready) {
-// try {
-// Thread.sleep(100);
-// } catch (InterruptedException e) { }
-// }
-// return folder;
-// }
-// }
-//
-//
-// /**
-// * Blocking version of folder selection. Runs and sleeps until an answer
-// * comes back. Avoid using: try to make things work with the async
-// * selectFolder inside PApplet instead.
-// */
-// static public File selectFolder(String prompt, File folder, Frame frame) {
-// return new FolderSelector(prompt, folder, frame).getFolder();
-// }
+ public void handleRecentRename(Editor editor, String oldPath) {
+ recent.handleRename(editor, oldPath);
+ }
- // .................................................................
+ // Called before a sketch is renamed so that its old name is
+ // no longer in the menu.
+ public void removeRecent(Editor editor) {
+ recent.remove(editor);
+ }
+ */
/**
- * "No cookie for you" type messages. Nothing fatal or all that
- * much of a bummer, but something to notify the user about.
+ * Scan a folder recursively, and add any sketches found to the menu
+ * specified. Set the openReplaces parameter to true when opening the sketch
+ * should replace the sketch in the current window, or false when the
+ * sketch should open in a new window.
*/
- static public void showMessage(String title, String message) {
- if (title == null) title = "Message";
+ protected boolean addSketches(JMenu menu, File folder,
+ final boolean replaceExisting) throws IOException {
+ // skip .DS_Store files, etc (this shouldn't actually be necessary)
+ if (!folder.isDirectory()) {
+ return false;
+ }
- if (commandLine) {
- System.out.println(title + ": " + message);
+ if (folder.getName().equals("libraries")) {
+ return false; // let's not go there
+ }
- } else {
- JOptionPane.showMessageDialog(new Frame(), message, title,
- JOptionPane.INFORMATION_MESSAGE);
+ if (folder.getName().equals("sdk")) {
+ // This could be Android's SDK folder. Let's double check:
+ File suspectSDKPath = new File(folder.getParent(), folder.getName());
+ File expectedSDKPath = new File(sketchbookFolder, "android" + File.separator + "sdk");
+ if (expectedSDKPath.getAbsolutePath().equals(suspectSDKPath.getAbsolutePath())) {
+ return false; // Most likely the SDK folder, skip it
+ }
}
- }
+ String[] list = folder.list();
+ // If a bad folder or unreadable or whatever, this will come back null
+ if (list == null) {
+ return false;
+ }
- /**
- * Non-fatal error message with optional stack trace side dish.
- */
- static public void showWarning(String title, String message, Exception e) {
- if (title == null) title = "Warning";
+ // Alphabetize the list, since it's not always alpha order
+ Arrays.sort(list, String.CASE_INSENSITIVE_ORDER);
- if (commandLine) {
- System.out.println(title + ": " + message);
+ ActionListener listener = new ActionListener() {
+ public void actionPerformed(ActionEvent e) {
+ String path = e.getActionCommand();
+ if (new File(path).exists()) {
+ boolean replace = replaceExisting;
+ if ((e.getModifiers() & ActionEvent.SHIFT_MASK) != 0) {
+ replace = !replace;
+ }
+// if (replace) {
+// handleOpenReplace(path);
+// } else {
+ handleOpen(path);
+// }
+ } else {
+ Messages.showWarning("Sketch Disappeared",
+ "The selected sketch no longer exists.\n" +
+ "You may need to restart Processing to update\n" +
+ "the sketchbook menu.", null);
+ }
+ }
+ };
+ // offers no speed improvement
+ //menu.addActionListener(listener);
- } else {
- JOptionPane.showMessageDialog(new Frame(), message, title,
- JOptionPane.WARNING_MESSAGE);
- }
- if (e != null) e.printStackTrace();
- }
+ boolean found = false;
+// for (int i = 0; i < list.length; i++) {
+// if ((list[i].charAt(0) == '.') ||
+// list[i].equals("CVS")) continue;
+ for (String name : list) {
+ if (name.charAt(0) == '.') {
+ continue;
+ }
- /**
- * Non-fatal error message with optional stack trace side dish.
- */
- static public void showWarningTiered(String title,
- String primary, String secondary,
- Exception e) {
- if (title == null) title = "Warning";
+ File subfolder = new File(folder, name);
+ if (subfolder.isDirectory()) {
+ File entry = checkSketchFolder(subfolder, name);
+ if (entry != null) {
- final String message = primary + "\n" + secondary;
- if (commandLine) {
- System.out.println(title + ": " + message);
+ JMenuItem item = new JMenuItem(name);
+ item.addActionListener(listener);
+ item.setActionCommand(entry.getAbsolutePath());
+ menu.add(item);
+ found = true;
- } else {
-// JOptionPane.showMessageDialog(new Frame(), message,
-// title, JOptionPane.WARNING_MESSAGE);
- if (!Base.isMacOS()) {
- JOptionPane.showMessageDialog(new JFrame(),
- "
" +
- "" + primary + " " +
- " " + secondary, title,
- JOptionPane.WARNING_MESSAGE);
- } else {
- // Pane formatting adapted from the Quaqua guide
- // http://www.randelshofer.ch/quaqua/guide/joptionpane.html
- JOptionPane pane =
- new JOptionPane(" " +
- " " +
- "" + primary + " " +
- "" + secondary + "
",
- JOptionPane.WARNING_MESSAGE);
-
-// String[] options = new String[] {
-// "Yes", "No"
-// };
-// pane.setOptions(options);
-
- // highlight the safest option ala apple hig
-// pane.setInitialValue(options[0]);
-
- JDialog dialog = pane.createDialog(new JFrame(), null);
- dialog.setVisible(true);
-
-// Object result = pane.getValue();
-// if (result == options[0]) {
-// return JOptionPane.YES_OPTION;
-// } else if (result == options[1]) {
-// return JOptionPane.NO_OPTION;
-// } else {
-// return JOptionPane.CLOSED_OPTION;
-// }
+ } else {
+ // not a sketch folder, but maybe a subfolder containing sketches
+ JMenu submenu = new JMenu(name);
+ // needs to be separate var otherwise would set ifound to false
+ boolean anything = addSketches(submenu, subfolder, replaceExisting);
+ if (anything && !name.equals("old")) { //Don't add old contributions
+ menu.add(submenu);
+ found = true;
+ }
+ }
}
}
- if (e != null) e.printStackTrace();
+ return found;
}
- /**
- * Show an error message that's actually fatal to the program.
- * This is an error that can't be recovered. Use showWarning()
- * for errors that allow P5 to continue running.
- */
- static public void showError(String title, String message, Throwable e) {
- if (title == null) title = "Error";
-
- if (commandLine) {
- System.err.println(title + ": " + message);
-
- } else {
- JOptionPane.showMessageDialog(new Frame(), message, title,
- JOptionPane.ERROR_MESSAGE);
+ public boolean addSketches(DefaultMutableTreeNode node, File folder,
+ boolean examples) throws IOException {
+ // skip .DS_Store files, etc (this shouldn't actually be necessary)
+ if (!folder.isDirectory()) {
+ return false;
}
- if (e != null) e.printStackTrace();
- System.exit(1);
- }
+ final String folderName = folder.getName();
- // ...................................................................
-
+ // Don't look inside the 'libraries' folders in the sketchbook
+ if (folderName.equals("libraries")) {
+ return false;
+ }
+ // When building the sketchbook, don't show the contributed 'examples'
+ // like it's a subfolder. But when loading examples, allow the folder
+ // to be named 'examples'.
+ if (!examples && folderName.equals("examples")) {
+ return false;
+ }
- // incomplete
- static public int showYesNoCancelQuestion(Editor editor, String title,
- String primary, String secondary) {
- if (!Base.isMacOS()) {
- int result =
- JOptionPane.showConfirmDialog(null, primary + "\n" + secondary, title,
- JOptionPane.YES_NO_CANCEL_OPTION,
- JOptionPane.QUESTION_MESSAGE);
- return result;
-// if (result == JOptionPane.YES_OPTION) {
-//
-// } else if (result == JOptionPane.NO_OPTION) {
-// return true; // ok to continue
-//
-// } else if (result == JOptionPane.CANCEL_OPTION) {
+// // Conversely, when looking for examples, ignore the other folders
+// // (to avoid going through hoops with the tree node setup).
+// if (examples && !folderName.equals("examples")) {
// return false;
-//
-// } else {
-// throw new IllegalStateException();
// }
+// // Doesn't quite work because the parent will be 'examples', and we want
+// // to walk inside that, but the folder itself will have a different name
- } else {
- // Pane formatting adapted from the Quaqua guide
- // http://www.randelshofer.ch/quaqua/guide/joptionpane.html
- JOptionPane pane =
- new JOptionPane(" " +
- " " +
- "Do you want to save changes to this sketch " +
- " before closing? " +
- "If you don't save, your changes will be lost.",
- JOptionPane.QUESTION_MESSAGE);
-
- String[] options = new String[] {
- "Save", "Cancel", "Don't Save"
- };
- pane.setOptions(options);
-
- // highlight the safest option ala apple hig
- pane.setInitialValue(options[0]);
-
- // on macosx, setting the destructive property places this option
- // away from the others at the lefthand side
- pane.putClientProperty("Quaqua.OptionPane.destructiveOption",
- new Integer(2));
-
- JDialog dialog = pane.createDialog(editor, null);
- dialog.setVisible(true);
-
- Object result = pane.getValue();
- if (result == options[0]) {
- return JOptionPane.YES_OPTION;
- } else if (result == options[1]) {
- return JOptionPane.CANCEL_OPTION;
- } else if (result == options[2]) {
- return JOptionPane.NO_OPTION;
- } else {
- return JOptionPane.CLOSED_OPTION;
- }
+ String[] fileList = folder.list();
+ // If a bad folder or unreadable or whatever, this will come back null
+ if (fileList == null) {
+ return false;
}
- }
-
-//if (result == JOptionPane.YES_OPTION) {
- //
-// } else if (result == JOptionPane.NO_OPTION) {
-// return true; // ok to continue
- //
-// } else if (result == JOptionPane.CANCEL_OPTION) {
-// return false;
- //
-// } else {
-// throw new IllegalStateException();
-// }
+ // Alphabetize the list, since it's not always alpha order
+ Arrays.sort(fileList, String.CASE_INSENSITIVE_ORDER);
- static public int showYesNoQuestion(Frame editor, String title,
- String primary, String secondary) {
- if (!Base.isMacOS()) {
- return JOptionPane.showConfirmDialog(editor,
- "
" +
- "" + primary + " " +
- " " + secondary, title,
- JOptionPane.YES_NO_OPTION,
- JOptionPane.QUESTION_MESSAGE);
- } else {
- // Pane formatting adapted from the Quaqua guide
- // http://www.randelshofer.ch/quaqua/guide/joptionpane.html
- JOptionPane pane =
- new JOptionPane(" " +
- " " +
- "" + primary + " " +
- "" + secondary + "
",
- JOptionPane.QUESTION_MESSAGE);
-
- String[] options = new String[] {
- "Yes", "No"
- };
- pane.setOptions(options);
+ boolean found = false;
+ for (String name : fileList) {
+ if (name.charAt(0) == '.') { // Skip hidden files
+ continue;
+ }
- // highlight the safest option ala apple hig
- pane.setInitialValue(options[0]);
+ File subfolder = new File(folder, name);
+ if (subfolder.isDirectory()) {
+ File entry = checkSketchFolder(subfolder, name);
+ if (entry != null) {
+ DefaultMutableTreeNode item =
+ new DefaultMutableTreeNode(new SketchReference(name, entry));
- JDialog dialog = pane.createDialog(editor, null);
- dialog.setVisible(true);
+ node.add(item);
+ found = true;
- Object result = pane.getValue();
- if (result == options[0]) {
- return JOptionPane.YES_OPTION;
- } else if (result == options[1]) {
- return JOptionPane.NO_OPTION;
- } else {
- return JOptionPane.CLOSED_OPTION;
+ } else {
+ // not a sketch folder, but maybe a subfolder containing sketches
+ DefaultMutableTreeNode subnode = new DefaultMutableTreeNode(name);
+ // needs to be separate var otherwise would set ifound to false
+ boolean anything = addSketches(subnode, subfolder, examples);
+ if (anything) {
+ node.add(subnode);
+ found = true;
+ }
+ }
}
}
+ return found;
}
/**
- * Retrieve a path to something in the Processing folder. Eventually this
- * may refer to the Contents subfolder of Processing.app, if we bundle things
- * up as a single .app file with no additional folders.
- */
-// static public String getContentsPath(String filename) {
-// String basePath = System.getProperty("user.dir");
-// /*
-// // do this later, when moving to .app package
-// if (PApplet.platform == PConstants.MACOSX) {
-// basePath = System.getProperty("processing.contents");
-// }
-// */
-// return basePath + File.separator + filename;
-// }
-
-
- /**
- * Get a path for something in the Processing lib folder.
- */
- /*
- static public String getLibContentsPath(String filename) {
- String libPath = getContentsPath("lib/" + filename);
- File libDir = new File(libPath);
- if (libDir.exists()) {
- return libPath;
- }
-// was looking into making this run from Eclipse, but still too much mess
-// libPath = getContents("build/shared/lib/" + what);
-// libDir = new File(libPath);
-// if (libDir.exists()) {
-// return libPath;
-// }
- return null;
- }
- */
-
- /**
- * Adjacent the executable on Windows and Linux,
- * or inside Contents/Resources/Java on Mac OS X.
+ * Check through the various modes and see if this is a legit sketch.
+ * Because the default mode will be the first in the list, this will always
+ * prefer that one over the others.
*/
- static protected File processingRoot;
-
- static public File getContentFile(String name) {
- if (processingRoot == null) {
- // Get the path to the .jar file that contains Base.class
- String path = Base.class.getProtectionDomain().getCodeSource().getLocation().getPath();
- // Path may have URL encoding, so remove it
- String decodedPath = PApplet.urlDecode(path);
- // The .jar file will be in the lib folder
- File libFolder = new File(decodedPath).getParentFile();
- if (libFolder.getName().equals("lib")) {
- // The main Processing installation directory
- processingRoot = libFolder.getParentFile();
- } else {
- Base.log("Could not find lib in " +
- libFolder.getAbsolutePath() + ", switching to user.dir");
- processingRoot = new File(System.getProperty("user.dir"));
- }
- }
-/*
- String path = System.getProperty("user.dir");
-
- // Get a path to somewhere inside the .app folder
- if (Base.isMacOS()) {
-// javaroot
-// $JAVAROOT
- String javaroot = System.getProperty("javaroot");
- if (javaroot != null) {
- path = javaroot;
+ File checkSketchFolder(File subfolder, String item) {
+ for (Mode mode : getModeList()) {
+ File entry = new File(subfolder, item + "." + mode.getDefaultExtension()); //$NON-NLS-1$
+ // if a .pde file of the same prefix as the folder exists..
+ if (entry.exists()) {
+ return entry;
}
}
- File working = new File(path);
- */
- return new File(processingRoot, name);
+ return null;
}
-// /**
-// * Get an image associated with the current color theme.
-// * @deprecated
-// */
-// static public Image getThemeImage(String name, Component who) {
-// return getLibImage("theme/" + name, who);
-// }
-//
-//
-// /**
-// * Return an Image object from inside the Processing lib folder.
-// * @deprecated
-// */
-// static public Image getLibImage(String name, Component who) {
-// Image image = null;
-//// Toolkit tk = Toolkit.getDefaultToolkit();
-//
-// File imageLocation = new File(getContentFile("lib"), name);
-// image = java.awt.Toolkit.getDefaultToolkit().getImage(imageLocation.getAbsolutePath());
-// MediaTracker tracker = new MediaTracker(who);
-// tracker.addImage(image, 0);
-// try {
-// tracker.waitForAll();
-// } catch (InterruptedException e) { }
-// return image;
-// }
+ // . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
/**
- * Return an InputStream for a file inside the Processing lib folder.
+ * Show the Preferences window.
*/
- static public InputStream getLibStream(String filename) throws IOException {
- return new FileInputStream(new File(getContentFile("lib"), filename));
+ public void handlePrefs() {
+ if (preferencesFrame == null) {
+ preferencesFrame = new PreferencesFrame(this);
+ }
+ preferencesFrame.showFrame();
}
- // ...................................................................
+ // . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
/**
- * Get the number of lines in a file by counting the number of newline
- * characters inside a String (and adding 1).
+ * Return a File from inside the Processing 'lib' folder.
*/
- static public int countLines(String what) {
- int count = 1;
- for (char c : what.toCharArray()) {
- if (c == '\n') count++;
- }
- return count;
+ static public File getLibFile(String filename) throws IOException {
+ return new File(Platform.getContentFile("lib"), filename);
}
/**
- * Same as PApplet.loadBytes(), however never does gzip decoding.
+ * Return an InputStream for a file inside the Processing lib folder.
*/
- static public byte[] loadBytesRaw(File file) throws IOException {
- int size = (int) file.length();
- FileInputStream input = new FileInputStream(file);
- byte buffer[] = new byte[size];
- int offset = 0;
- int bytesRead;
- while ((bytesRead = input.read(buffer, offset, size-offset)) != -1) {
- offset += bytesRead;
- if (bytesRead == 0) break;
- }
- input.close(); // weren't properly being closed
- input = null;
- return buffer;
+ static public InputStream getLibStream(String filename) throws IOException {
+ return new FileInputStream(getLibFile(filename));
}
/**
- * Read from a file with a bunch of attribute/value pairs
- * that are separated by = and ignore comments with #.
+ * Get the directory that can store settings. (Library on OS X, App Data or
+ * something similar on Windows, a dot folder on Linux.) Removed this as a
+ * preference for 3.0a3 because we need this to be stable.
*/
- static public HashMap readSettings(File inputFile) {
- HashMap outgoing = new HashMap();
- if (inputFile.exists()) {
- String lines[] = PApplet.loadStrings(inputFile);
- readSettings(inputFile.toString(), lines, outgoing);
- }
- return outgoing;
- }
-
-
- static public void readSettings(String filename, String lines[],
- HashMap settings) {
- for (int i = 0; i < lines.length; i++) {
- int hash = lines[i].indexOf('#');
- String line = (hash == -1) ?
- lines[i].trim() : lines[i].substring(0, hash).trim();
-
- if (line.length() != 0) {
- int equals = line.indexOf('=');
- if (equals == -1) {
- if (filename != null) {
- System.err.println("Ignoring illegal line in " + filename);
- System.err.println(" " + line);
- }
- } else {
- String attr = line.substring(0, equals).trim();
- String valu = line.substring(equals + 1).trim();
- settings.put(attr, valu);
+ static public File getSettingsFolder() {
+ File settingsFolder = null;
+
+ try {
+ settingsFolder = Platform.getSettingsFolder();
+
+ // create the folder if it doesn't exist already
+ if (!settingsFolder.exists()) {
+ if (!settingsFolder.mkdirs()) {
+ Messages.showError("Settings issues",
+ "Processing cannot run because it could not\n" +
+ "create a folder to store your settings.\n" +
+ settingsFolder.getAbsolutePath(), null);
}
}
+ } catch (Exception e) {
+ Messages.showTrace("An rare and unknowable thing happened",
+ "Could not get the settings folder. Please report:\n" +
+ "http://github.com/processing/processing/issues/new",
+ e, true);
}
- }
-
-
- static public void copyFile(File sourceFile,
- File targetFile) throws IOException {
- BufferedInputStream from =
- new BufferedInputStream(new FileInputStream(sourceFile));
- BufferedOutputStream to =
- new BufferedOutputStream(new FileOutputStream(targetFile));
- byte[] buffer = new byte[16 * 1024];
- int bytesRead;
- while ((bytesRead = from.read(buffer)) != -1) {
- to.write(buffer, 0, bytesRead);
- }
- from.close();
- from = null;
-
- to.flush();
- to.close();
- to = null;
-
- targetFile.setLastModified(sourceFile.lastModified());
- }
-
-
- /**
- * Grab the contents of a file as a string.
- */
- static public String loadFile(File file) throws IOException {
- String[] contents = PApplet.loadStrings(file);
- if (contents == null) return null;
- return PApplet.join(contents, "\n");
+ return settingsFolder;
}
/**
- * Spew the contents of a String object out to a file.
+ * Convenience method to get a File object for the specified filename inside
+ * the settings folder. Used to get preferences and recent sketch files.
+ * @param filename A file inside the settings folder.
+ * @return filename wrapped as a File object inside the settings folder
*/
- static public void saveFile(String str, File file) throws IOException {
- File temp = File.createTempFile(file.getName(), null, file.getParentFile());
- try{
- // fix from cjwant to prevent symlinks from being destroyed.
- File canon = file.getCanonicalFile();
- file = canon;
- } catch (IOException e) {
- throw new IOException("Could not resolve canonical representation of " +
- file.getAbsolutePath());
- }
- PApplet.saveStrings(temp, new String[] { str });
- if (file.exists()) {
- boolean result = file.delete();
- if (!result) {
- throw new IOException("Could not remove old version of " +
- file.getAbsolutePath());
- }
- }
- boolean result = temp.renameTo(file);
- if (!result) {
- throw new IOException("Could not replace " +
- file.getAbsolutePath());
- }
+ static public File getSettingsFile(String filename) {
+ return new File(getSettingsFolder(), filename);
}
- /**
- * Copy a folder from one place to another. This ignores all dot files and
- * folders found in the source directory, to avoid copying silly .DS_Store
- * files and potentially troublesome .svn folders.
- */
- static public void copyDir(File sourceDir,
- File targetDir) throws IOException {
- if (sourceDir.equals(targetDir)) {
- final String urDum = "source and target directories are identical";
- throw new IllegalArgumentException(urDum);
- }
- targetDir.mkdirs();
- String files[] = sourceDir.list();
- for (int i = 0; i < files.length; i++) {
- // Ignore dot files (.DS_Store), dot folders (.svn) while copying
- if (files[i].charAt(0) == '.') continue;
- //if (files[i].equals(".") || files[i].equals("..")) continue;
- File source = new File(sourceDir, files[i]);
- File target = new File(targetDir, files[i]);
- if (source.isDirectory()) {
- //target.mkdirs();
- copyDir(source, target);
- target.setLastModified(source.lastModified());
- } else {
- copyFile(source, target);
- }
- }
+ static public File getToolsFolder() {
+ return Platform.getContentFile("tools");
}
- /**
- * Remove all files in a directory and the directory itself.
- * TODO implement cross-platform "move to trash" instead of deleting,
- * since this is potentially scary if there's a bug.
- */
- static public void removeDir(File dir) {
- if (dir.exists()) {
- removeDescendants(dir);
- if (!dir.delete()) {
- System.err.println("Could not delete " + dir);
+ static public void locateSketchbookFolder() {
+ // If a value is at least set, first check to see if the folder exists.
+ // If it doesn't, warn the user that the sketchbook folder is being reset.
+ String sketchbookPath = Preferences.getSketchbookPath();
+ if (sketchbookPath != null) {
+ sketchbookFolder = new File(sketchbookPath);
+ if (!sketchbookFolder.exists()) {
+ Messages.showWarning("Sketchbook folder disappeared",
+ "The sketchbook folder no longer exists.\n" +
+ "Processing will switch to the default sketchbook\n" +
+ "location, and create a new sketchbook folder if\n" +
+ "necessary. Processing will then stop talking\n" +
+ "about itself in the third person.", null);
+ sketchbookFolder = null;
}
}
- }
-
- /**
- * Recursively remove all files within a directory,
- * used with removeDir(), or when the contents of a dir
- * should be removed, but not the directory itself.
- * (i.e. when cleaning temp files from lib/build)
- */
- static public void removeDescendants(File dir) {
- if (!dir.exists()) return;
-
- String files[] = dir.list();
- for (int i = 0; i < files.length; i++) {
- if (files[i].equals(".") || files[i].equals("..")) continue;
- File dead = new File(dir, files[i]);
- if (!dead.isDirectory()) {
- if (!Preferences.getBoolean("compiler.save_build_files")) {
- if (!dead.delete()) {
- // temporarily disabled
- System.err.println("Could not delete " + dead);
- }
- }
- } else {
- removeDir(dead);
- //dead.delete();
+ // If no path is set, get the default sketchbook folder for this platform
+ if (sketchbookFolder == null) {
+ sketchbookFolder = getDefaultSketchbookFolder();
+ Preferences.setSketchbookPath(sketchbookFolder.getAbsolutePath());
+ if (!sketchbookFolder.exists()) {
+ sketchbookFolder.mkdirs();
}
}
+ makeSketchbookSubfolders();
}
- /**
- * Calculate the size of the contents of a folder.
- * Used to determine whether sketches are empty or not.
- * Note that the function calls itself recursively.
- */
- static public int calcFolderSize(File folder) {
- int size = 0;
-
- String files[] = folder.list();
- // null if folder doesn't exist, happens when deleting sketch
- if (files == null) return -1;
-
- for (int i = 0; i < files.length; i++) {
- if (files[i].equals(".") || (files[i].equals("..")) ||
- files[i].equals(".DS_Store")) continue;
- File fella = new File(folder, files[i]);
- if (fella.isDirectory()) {
- size += calcFolderSize(fella);
- } else {
- size += (int) fella.length();
- }
- }
- return size;
+ public void setSketchbookFolder(File folder) {
+ sketchbookFolder = folder;
+ Preferences.setSketchbookPath(folder.getAbsolutePath());
+ rebuildSketchbookMenus();
+ makeSketchbookSubfolders();
}
/**
- * Recursively creates a list of all files within the specified folder,
- * and returns a list of their relative paths.
- * Ignores any files/folders prefixed with a dot.
+ * Create the libraries, modes, tools, examples folders in the sketchbook.
*/
-// static public String[] listFiles(String path, boolean relative) {
-// return listFiles(new File(path), relative);
-// }
-
-
- static public String[] listFiles(File folder, boolean relative) {
- String path = folder.getAbsolutePath();
- Vector vector = new Vector();
- listFiles(relative ? (path + File.separator) : "", path, null, vector);
- String outgoing[] = new String[vector.size()];
- vector.copyInto(outgoing);
- return outgoing;
+ static protected void makeSketchbookSubfolders() {
+ getSketchbookLibrariesFolder().mkdirs();
+ getSketchbookToolsFolder().mkdirs();
+ getSketchbookModesFolder().mkdirs();
+ getSketchbookExamplesFolder().mkdirs();
+ getSketchbookTemplatesFolder().mkdirs();
}
- static public String[] listFiles(File folder, boolean relative, String extension) {
- String path = folder.getAbsolutePath();
- Vector vector = new Vector();
- if (extension != null) {
- if (!extension.startsWith(".")) {
- extension = "." + extension;
- }
- }
- listFiles(relative ? (path + File.separator) : "", path, extension, vector);
- String outgoing[] = new String[vector.size()];
- vector.copyInto(outgoing);
- return outgoing;
+ static public File getSketchbookFolder() {
+ return sketchbookFolder;
}
- static protected void listFiles(String basePath,
- String path, String extension,
- Vector vector) {
- File folder = new File(path);
- String[] list = folder.list();
- if (list != null) {
- for (String item : list) {
- if (item.charAt(0) == '.') continue;
- if (extension == null || item.toLowerCase().endsWith(extension)) {
- File file = new File(path, item);
- String newPath = file.getAbsolutePath();
- if (newPath.startsWith(basePath)) {
- newPath = newPath.substring(basePath.length());
- }
- // only add if no ext or match
- if (extension == null || item.toLowerCase().endsWith(extension)) {
- vector.add(newPath);
- }
- if (file.isDirectory()) { // use absolute path
- listFiles(basePath, file.getAbsolutePath(), extension, vector);
- }
- }
- }
- }
+ static public File getSketchbookLibrariesFolder() {
+ return new File(sketchbookFolder, "libraries");
}
- /**
- * @param folder source folder to search
- * @return a list of .jar and .zip files in that folder
- */
- static public File[] listJarFiles(File folder) {
- return folder.listFiles(new FilenameFilter() {
- public boolean accept(File dir, String name) {
- return (!name.startsWith(".") &&
- (name.toLowerCase().endsWith(".jar") ||
- name.toLowerCase().endsWith(".zip")));
- }
- });
+ static public File getSketchbookToolsFolder() {
+ return new File(sketchbookFolder, "tools");
}
- /////////////////////////////////////////////////////////////////////////////
-
-
- /**
- * Given a folder, return a list of absolute paths to all jar or zip files
- * inside that folder, separated by pathSeparatorChar.
- *
- * This will prepend a colon (or whatever the path separator is)
- * so that it can be directly appended to another path string.
- *
- * As of 0136, this will no longer add the root folder as well.
- *
- * This function doesn't bother checking to see if there are any .class
- * files in the folder or within a subfolder.
- */
- static public String contentsToClassPath(File folder) {
- if (folder == null) return "";
-
- StringBuffer abuffer = new StringBuffer();
- String sep = System.getProperty("path.separator");
-
- try {
- String path = folder.getCanonicalPath();
-
-// disabled as of 0136
- // add the folder itself in case any unzipped files
-// abuffer.append(sep);
-// abuffer.append(path);
-//
- // When getting the name of this folder, make sure it has a slash
- // after it, so that the names of sub-items can be added.
- if (!path.endsWith(File.separator)) {
- path += File.separator;
- }
-
- String list[] = folder.list();
- for (int i = 0; i < list.length; i++) {
- // Skip . and ._ files. Prior to 0125p3, .jar files that had
- // OS X AppleDouble files associated would cause trouble.
- if (list[i].startsWith(".")) continue;
-
- if (list[i].toLowerCase().endsWith(".jar") ||
- list[i].toLowerCase().endsWith(".zip")) {
- abuffer.append(sep);
- abuffer.append(path);
- abuffer.append(list[i]);
- }
- }
- } catch (IOException e) {
- e.printStackTrace(); // this would be odd
- }
- //System.out.println("included path is " + abuffer.toString());
- //packageListFromClassPath(abuffer.toString()); // WHY?
- return abuffer.toString();
+ static public File getSketchbookModesFolder() {
+ return new File(sketchbookFolder, "modes");
}
- /**
- * A classpath, separated by the path separator, will contain
- * a series of .jar/.zip files or directories containing .class
- * files, or containing subdirectories that have .class files.
- *
- * @param path the input classpath
- * @return array of possible package names
- */
- static public String[] packageListFromClassPath(String path) {
- Hashtable table = new Hashtable();
- String pieces[] =
- PApplet.split(path, File.pathSeparatorChar);
-
- for (int i = 0; i < pieces.length; i++) {
- //System.out.println("checking piece '" + pieces[i] + "'");
- if (pieces[i].length() == 0) continue;
-
- if (pieces[i].toLowerCase().endsWith(".jar") ||
- pieces[i].toLowerCase().endsWith(".zip")) {
- //System.out.println("checking " + pieces[i]);
- packageListFromZip(pieces[i], table);
-
- } else { // it's another type of file or directory
- File dir = new File(pieces[i]);
- if (dir.exists() && dir.isDirectory()) {
- packageListFromFolder(dir, null, table);
- //importCount = magicImportsRecursive(dir, null,
- // table);
- //imports, importCount);
- }
- }
- }
- int tableCount = table.size();
- String output[] = new String[tableCount];
- int index = 0;
- Enumeration e = table.keys();
- while (e.hasMoreElements()) {
- output[index++] = ((String) e.nextElement()).replace('/', '.');
- }
- //System.arraycopy(imports, 0, output, 0, importCount);
- //PApplet.printarr(output);
- return output;
+ static public File getSketchbookExamplesFolder() {
+ return new File(sketchbookFolder, "examples");
}
- static private void packageListFromZip(String filename, Hashtable table) {
- try {
- ZipFile file = new ZipFile(filename);
- Enumeration entries = file.entries();
- while (entries.hasMoreElements()) {
- ZipEntry entry = (ZipEntry) entries.nextElement();
-
- if (!entry.isDirectory()) {
- String name = entry.getName();
-
- if (name.endsWith(".class")) {
- int slash = name.lastIndexOf('/');
- if (slash == -1) continue;
-
- String pname = name.substring(0, slash);
- if (table.get(pname) == null) {
- table.put(pname, new Object());
- }
- }
- }
- }
- file.close();
- } catch (IOException e) {
- System.err.println("Ignoring " + filename + " (" + e.getMessage() + ")");
- //e.printStackTrace();
- }
+ static public File getSketchbookTemplatesFolder() {
+ return new File(sketchbookFolder, "templates");
}
- /**
- * Make list of package names by traversing a directory hierarchy.
- * Each time a class is found in a folder, add its containing set
- * of folders to the package list. If another folder is found,
- * walk down into that folder and continue.
- */
- static private void packageListFromFolder(File dir, String sofar,
- Hashtable table) {
- //String imports[],
- //int importCount) {
- //System.err.println("checking dir '" + dir + "'");
- boolean foundClass = false;
- String files[] = dir.list();
-
- for (int i = 0; i < files.length; i++) {
- if (files[i].equals(".") || files[i].equals("..")) continue;
-
- File sub = new File(dir, files[i]);
- if (sub.isDirectory()) {
- String nowfar =
- (sofar == null) ? files[i] : (sofar + "." + files[i]);
- packageListFromFolder(sub, nowfar, table);
- //System.out.println(nowfar);
- //imports[importCount++] = nowfar;
- //importCount = magicImportsRecursive(sub, nowfar,
- // imports, importCount);
- } else if (!foundClass) { // if no classes found in this folder yet
- if (files[i].endsWith(".class")) {
- //System.out.println("unique class: " + files[i] + " for " + sofar);
- table.put(sofar, new Object());
- foundClass = true;
- }
- }
- }
- }
-
-
- static public void unzip(File zipFile, File dest) {
+ static protected File getDefaultSketchbookFolder() {
+ File sketchbookFolder = null;
try {
- FileInputStream fis = new FileInputStream(zipFile);
- CheckedInputStream checksum = new CheckedInputStream(fis, new Adler32());
- ZipInputStream zis = new ZipInputStream(new BufferedInputStream(checksum));
- ZipEntry next = null;
- while ((next = zis.getNextEntry()) != null) {
- File currentFile = new File(dest, next.getName());
- if (next.isDirectory()) {
- currentFile.mkdirs();
- } else {
- currentFile.createNewFile();
- unzipEntry(zis, currentFile);
- }
- }
- } catch (Exception e) {
- e.printStackTrace();
- }
- }
-
+ sketchbookFolder = Platform.getDefaultSketchbookFolder();
+ } catch (Exception e) { }
- static protected void unzipEntry(ZipInputStream zin, File f) throws IOException {
- FileOutputStream out = new FileOutputStream(f);
- byte[] b = new byte[512];
- int len = 0;
- while ((len = zin.read(b)) != -1) {
- out.write(b, 0, len);
+ if (sketchbookFolder == null) {
+ Messages.showError("No sketchbook",
+ "Problem while trying to get the sketchbook", null);
}
- out.flush();
- out.close();
- }
-
- static public void log(Object from, String message) {
- if (DEBUG) {
- System.out.println(from.getClass().getName() + ": " + message);
+ // create the folder if it doesn't exist already
+ boolean result = true;
+ if (!sketchbookFolder.exists()) {
+ result = sketchbookFolder.mkdirs();
}
- }
-
- static public void log(String message) {
- if (DEBUG) {
- System.out.println(message);
+ if (!result) {
+ Messages.showError("You forgot your sketchbook",
+ "Processing cannot run because it could not\n" +
+ "create a folder to store your sketchbook.", null);
}
- }
-
- static public void log(String message, Exception e) {
- if (DEBUG) {
- System.out.println(message);
- e.printStackTrace();
- }
+ return sketchbookFolder;
}
}
diff --git a/app/src/processing/app/BaseSplash.java b/app/src/processing/app/BaseSplash.java
new file mode 100644
index 0000000000..5dc125f6a1
--- /dev/null
+++ b/app/src/processing/app/BaseSplash.java
@@ -0,0 +1,24 @@
+package processing.app;
+
+import java.io.File;
+
+import processing.app.ui.SplashWindow;
+import processing.app.ui.Toolkit;
+
+
+public class BaseSplash {
+ static public void main(String[] args) {
+ try {
+ final boolean hidpi = Toolkit.highResImages();
+ final String filename = "lib/about-" + (hidpi ? 2 : 1) + "x.png";
+ File splashFile = Platform.getContentFile(filename);
+ SplashWindow.splash(splashFile.toURI().toURL(), hidpi);
+ SplashWindow.invokeMain("processing.app.Base", args);
+ SplashWindow.disposeSplash();
+ } catch (Exception e) {
+ e.printStackTrace();
+ // !@#!@$$! umm
+ //SplashWindow.invokeMain("processing.app.Base", args);
+ }
+ }
+}
\ No newline at end of file
diff --git a/app/src/processing/app/Console.java b/app/src/processing/app/Console.java
new file mode 100644
index 0000000000..73b652f337
--- /dev/null
+++ b/app/src/processing/app/Console.java
@@ -0,0 +1,261 @@
+/* -*- mode: java; c-basic-offset: 2; indent-tabs-mode: nil -*- */
+
+/*
+ Part of the Processing project - http://processing.org
+
+ Copyright (c) 2012-16 The Processing Foundation
+ Copyright (c) 2004-12 Ben Fry and Casey Reas
+ Copyright (c) 2001-04 Massachusetts Institute of Technology
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software Foundation,
+ Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+*/
+
+package processing.app;
+
+import java.io.*;
+import java.text.SimpleDateFormat;
+import java.util.Date;
+
+
+/**
+ * Non-GUI handling of System.out and System.err redirection.
+ *
+ * Be careful when debugging this class, because if it's throwing exceptions,
+ * don't take over System.err, and debug while watching just System.out
+ * or just call println() or whatever directly to systemOut or systemErr.
+ *
+ * Also note that encodings will not work properly when run from Eclipse. This
+ * means that if you use non-ASCII characters in a println() or some such,
+ * the characters won't print properly in the Processing and/or Eclipse console.
+ * It seems that Eclipse's console-grabbing and that of Processing don't
+ * get along with one another. Use 'ant run' to work on encoding-related issues.
+ */
+public class Console {
+ // Single static instance shared because there's only one real System.out.
+ // Within the input handlers, the currentConsole variable will be used to
+ // echo things to the correct location.
+
+ /** The original System.out */
+ static PrintStream systemOut;
+ /** The original System.err */
+ static PrintStream systemErr;
+
+ /** Our replacement System.out */
+ static PrintStream consoleOut;
+ /** Our replacement System.err */
+ static PrintStream consoleErr;
+
+ /** All stdout also written to a file */
+ static OutputStream stdoutFile;
+ /** All stderr also written to a file */
+ static OutputStream stderrFile;
+
+ /** stdout listener for the currently active Editor */
+ static OutputStream editorOut;
+ /** stderr listener for the currently active Editor */
+ static OutputStream editorErr;
+
+
+ static public void startup() {
+ if (systemOut != null) {
+ // TODO fix this dreadful style choice in how the Console is initialized
+ // (This is not good code.. startup() should gracefully deal with this.
+ // It's just a low priority relative to the likelihood of trouble.)
+ new Exception("startup() called more than once").printStackTrace(systemErr);
+ return;
+ }
+ systemOut = System.out;
+ systemErr = System.err;
+
+ // placing everything inside a try block because this can be a dangerous
+ // time for the lights to blink out and crash for and obscure reason.
+ try {
+ SimpleDateFormat formatter = new SimpleDateFormat("yyMMdd_HHmmss");
+ // Moving away from a random string in 0256 (and adding hms) because
+ // the random digits looked like times anyway, causing confusion.
+ //String randy = String.format("%04d", (int) (1000 * Math.random()));
+ //final String stamp = formatter.format(new Date()) + "_" + randy;
+ final String stamp = formatter.format(new Date());
+
+ File consoleDir = Base.getSettingsFile("console");
+ if (consoleDir.exists()) {
+ // clear old debug files
+ File[] stdFiles = consoleDir.listFiles(new FileFilter() {
+ final String todayPrefix = stamp.substring(0, 4);
+
+ public boolean accept(File file) {
+ if (!file.isDirectory()) {
+ String name = file.getName();
+ if (name.endsWith(".err") || name.endsWith(".out")) {
+ // don't delete any of today's debug messages
+ return !name.startsWith(todayPrefix);
+ }
+ }
+ return false;
+ }
+ });
+ // Remove any files that aren't from today
+ for (File file : stdFiles) {
+ file.delete();
+ }
+ } else {
+ consoleDir.mkdirs();
+ consoleDir.setWritable(true, false);
+ }
+
+ File outFile = new File(consoleDir, stamp + ".out");
+ outFile.setWritable(true, false);
+ stdoutFile = new FileOutputStream(outFile);
+ File errFile = new File(consoleDir, stamp + ".err");
+ errFile.setWritable(true, false);
+ stderrFile = new FileOutputStream(errFile);
+
+ consoleOut = new PrintStream(new ConsoleStream(false));
+ consoleErr = new PrintStream(new ConsoleStream(true));
+
+ System.setOut(consoleOut);
+ System.setErr(consoleErr);
+
+ } catch (Exception e) {
+ stdoutFile = null;
+ stderrFile = null;
+
+ consoleOut = null;
+ consoleErr = null;
+
+ System.setOut(systemOut);
+ System.setErr(systemErr);
+
+ e.printStackTrace();
+ }
+ }
+
+
+ static public void setEditor(OutputStream out, OutputStream err) {
+ editorOut = out;
+ editorErr = err;
+ }
+
+
+ static public void systemOut(String what) {
+ systemOut.println(what);
+ }
+
+
+ static public void systemErr(String what) {
+ systemErr.println(what);
+ }
+
+
+ /**
+ * Close the streams so that the temporary files can be deleted.
+ *
+ * File.deleteOnExit() cannot be used because the stdout and stderr
+ * files are inside a folder, and have to be deleted before the
+ * folder itself is deleted, which can't be guaranteed when using
+ * the deleteOnExit() method.
+ */
+ static public void shutdown() {
+ // replace original streams to remove references to console's streams
+ System.setOut(systemOut);
+ System.setErr(systemErr);
+
+ cleanup(consoleOut);
+ cleanup(consoleErr);
+
+ // also have to close the original FileOutputStream
+ // otherwise it won't be shut down completely
+ cleanup(stdoutFile);
+ cleanup(stderrFile);
+ }
+
+
+ static private void cleanup(OutputStream output) {
+ try {
+ if (output != null) {
+ output.flush();
+ output.close();
+ }
+ } catch (IOException e) {
+ e.printStackTrace();
+ }
+ }
+
+
+ // . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
+
+
+ static class ConsoleStream extends OutputStream {
+ boolean err; // whether stderr or stdout
+ byte single[] = new byte[1];
+
+ public ConsoleStream(boolean err) {
+ this.err = err;
+ }
+
+ public void close() { }
+
+ public void flush() { }
+
+ public void write(byte b[]) { // appears never to be used
+ write(b, 0, b.length);
+ }
+
+ public void write(byte b[], int offset, int length) {
+ // First write to the original stdout/stderr
+ if (err) {
+ systemErr.write(b, offset, length);
+ } else {
+ systemOut.write(b, offset, length);
+ }
+
+ // Write to the files that are storing this information
+ writeFile(b, offset, length);
+
+ // Write to the console of the current Editor, if any
+ try {
+ if (err) {
+ if (editorErr != null) {
+ editorErr.write(b, offset, length);
+ }
+ } else {
+ if (editorOut != null) {
+ editorOut.write(b, offset, length);
+ }
+ }
+ } catch (IOException e) {
+ // Avoid this function being called in a recursive, infinite loop
+ e.printStackTrace(systemErr);
+ }
+ }
+
+ public void writeFile(byte b[], int offset, int length) {
+ final OutputStream echo = err ? stderrFile : stdoutFile;
+ if (echo != null) {
+ try {
+ echo.write(b, offset, length);
+ echo.flush();
+ } catch (IOException e) {
+ e.printStackTrace();
+ }
+ }
+ }
+
+ public void write(int b) {
+ single[0] = (byte) b;
+ write(single, 0, 1);
+ }
+ }
+}
\ No newline at end of file
diff --git a/app/src/processing/app/Editor.java b/app/src/processing/app/Editor.java
deleted file mode 100644
index 9230452536..0000000000
--- a/app/src/processing/app/Editor.java
+++ /dev/null
@@ -1,2624 +0,0 @@
-/* -*- mode: java; c-basic-offset: 2; indent-tabs-mode: nil -*- */
-
-/*
- Part of the Processing project - http://processing.org
-
- Copyright (c) 2004-12 Ben Fry and Casey Reas
- Copyright (c) 2001-04 Massachusetts Institute of Technology
-
- This program is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License version 2
- as published by the Free Software Foundation.
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with this program; if not, write to the Free Software Foundation,
- Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-*/
-
-package processing.app;
-
-import processing.app.contrib.ToolContribution;
-import processing.app.syntax.*;
-import processing.app.tools.*;
-import processing.core.*;
-
-import java.awt.*;
-import java.awt.datatransfer.*;
-import java.awt.event.*;
-import java.awt.print.*;
-import java.io.*;
-import java.util.*;
-import java.util.Timer;
-
-import javax.swing.*;
-import javax.swing.event.*;
-import javax.swing.text.*;
-import javax.swing.undo.*;
-
-/**
- * Main editor panel for the Processing Development Environment.
- */
-public abstract class Editor extends JFrame implements RunnerListener {
- protected Base base;
- protected EditorState state;
- protected Mode mode;
-
- // otherwise, if the window is resized with the message label
- // set to blank, it's preferredSize() will be fukered
- static protected final String EMPTY =
- " " +
- " " +
- " ";
-
- /**
- * true if this file has not yet been given a name by the user
- */
-// private boolean untitled;
-
- private PageFormat pageFormat;
- private PrinterJob printerJob;
-
- // file and sketch menus for re-inserting items
- private JMenu fileMenu;
-// private JMenuItem saveMenuItem;
-// private JMenuItem saveAsMenuItem;
-
- private JMenu sketchMenu;
-
- protected EditorHeader header;
- protected EditorToolbar toolbar;
- protected JEditTextArea textarea;
- protected EditorStatus status;
- protected JSplitPane splitPane;
- protected JPanel consolePanel;
- protected EditorConsole console;
- protected EditorLineStatus lineStatus;
-
- // currently opened program
- protected Sketch sketch;
-
- // runtime information and window placement
- private Point sketchWindowLocation;
-
- // undo fellers
- private JMenuItem undoItem, redoItem;
- protected UndoAction undoAction;
- protected RedoAction redoAction;
- /** the currently selected tab's undo manager */
- private UndoManager undo;
- // used internally for every edit. Groups hotkey-event text manipulations and
- // groups multi-character inputs into a single undos.
- private CompoundEdit compoundEdit;
- // timer to decide when to group characters into an undo
- private Timer timer;
- private TimerTask endUndoEvent;
- // true if inserting text, false if removing text
- private boolean isInserting;
- // maintain caret position during undo operations
- private final Stack caretUndoStack = new Stack();
- private final Stack caretRedoStack = new Stack();
-
- private FindReplace find;
- JMenu toolsMenu;
- JMenu modeMenu;
-
- ArrayList coreTools;
- public ArrayList contribTools;
-
-
-// protected Editor(final Base base, String path, int[] location, final Mode mode) {
- protected Editor(final Base base, String path, EditorState state, final Mode mode) {
- super("Processing", state.checkConfig());
- this.base = base;
- this.state = state;
- this.mode = mode;
-
- Toolkit.setIcon(this); // TODO should this be per-mode?
-
- // Install default actions for Run, Present, etc.
-// resetHandlers();
-
- // add listener to handle window close box hit event
- addWindowListener(new WindowAdapter() {
- public void windowClosing(WindowEvent e) {
- base.handleClose(Editor.this, false);
- }
- });
- // don't close the window when clicked, the app will take care
- // of that via the handleQuitInternal() methods
- // http://dev.processing.org/bugs/show_bug.cgi?id=440
- setDefaultCloseOperation(WindowConstants.DO_NOTHING_ON_CLOSE);
-
- // When bringing a window to front, let the Base know
- addWindowListener(new WindowAdapter() {
- public void windowActivated(WindowEvent e) {
-// EditorConsole.systemOut.println("editor window activated");
- base.handleActivated(Editor.this);
-// mode.handleActivated(Editor.this);
- fileMenu.insert(base.getSketchbookMenu(), 2);
- fileMenu.insert(base.getRecentMenu(), 3);
-// fileMenu.insert(mode.getExamplesMenu(), 3);
- sketchMenu.insert(mode.getImportMenu(), 4);
- mode.insertToolbarRecentMenu();
- }
-
- // added for 1.0.5
- // http://dev.processing.org/bugs/show_bug.cgi?id=1260
- public void windowDeactivated(WindowEvent e) {
-// EditorConsole.systemErr.println("editor window deactivated");
-// mode.handleDeactivated(Editor.this);
- fileMenu.remove(base.getSketchbookMenu());
- fileMenu.remove(base.getRecentMenu());
-// fileMenu.remove(mode.getExamplesMenu());
- sketchMenu.remove(mode.getImportMenu());
- mode.removeToolbarRecentMenu();
- }
- });
-
- timer = new Timer();
-
- buildMenuBar();
-
- Container contentPain = getContentPane();
- contentPain.setLayout(new BorderLayout());
- JPanel pain = new JPanel();
- pain.setLayout(new BorderLayout());
- contentPain.add(pain, BorderLayout.CENTER);
-
- Box box = Box.createVerticalBox();
- Box upper = Box.createVerticalBox();
-
- initModeMenu();
- toolbar = createToolbar();
- upper.add(toolbar);
-
- header = new EditorHeader(this);
- upper.add(header);
-
- textarea = createTextArea();
- textarea.setRightClickPopup(new TextAreaPopup());
- textarea.setHorizontalOffset(JEditTextArea.leftHandGutter);
-
- // assemble console panel, consisting of status area and the console itself
- consolePanel = new JPanel();
- consolePanel.setLayout(new BorderLayout());
-
- status = new EditorStatus(this);
- consolePanel.add(status, BorderLayout.NORTH);
-
- console = new EditorConsole(this);
- // windows puts an ugly border on this guy
- console.setBorder(null);
- consolePanel.add(console, BorderLayout.CENTER);
-
- lineStatus = new EditorLineStatus(this);
- consolePanel.add(lineStatus, BorderLayout.SOUTH);
-
- upper.add(textarea);
-
- // alternate spot for status, but ugly
-// status = new EditorStatus(this);
-// upper.add(status);
-
- splitPane = new JSplitPane(JSplitPane.VERTICAL_SPLIT, upper, consolePanel);
-
- // disable this because it hides the message area, which is essential (issue #745)
- splitPane.setOneTouchExpandable(false);
- // repaint child panes while resizing
- splitPane.setContinuousLayout(true);
- // if window increases in size, give all of increase to
- // the textarea in the upper pane
- splitPane.setResizeWeight(1D);
-
- // to fix ugliness.. normally macosx java 1.3 puts an
- // ugly white border around this object, so turn it off.
- splitPane.setBorder(null);
-
- // the default size on windows is too small and kinda ugly
- int dividerSize = Preferences.getInteger("editor.divider.size");
- if (dividerSize != 0) {
- splitPane.setDividerSize(dividerSize);
- }
-
- box.add(splitPane);
-
- pain.add(box);
-
- // get shift down/up events so we can show the alt version of toolbar buttons
- textarea.addKeyListener(toolbar);
-
- // end an undo-chunk any time the caret moves unless it's when text is edited
- textarea.addCaretListener(new CaretListener() {
- String lastText = textarea.getText();
- public void caretUpdate(CaretEvent e) {
- String newText = textarea.getText();
- if (lastText.equals(newText) && isDirectEdit()) {
- endTextEditHistory();
- }
- lastText = newText;
- }
- });
-
- pain.setTransferHandler(new FileDropHandler());
-
- // Finish preparing Editor (formerly found in Base)
- pack();
-
- // Set the window bounds and the divider location before setting it visible
- state.apply(this);
-
- // Set the minimum size for the editor window
- setMinimumSize(new Dimension(Preferences.getInteger("editor.window.width.min"),
- Preferences.getInteger("editor.window.height.min")));
-
- // Bring back the general options for the editor
- applyPreferences();
-
- // Make textField get the focus whenever frame is activated.
- // http://download.oracle.com/javase/tutorial/uiswing/misc/focus.html
- // May not be necessary, but helps avoid random situations with
- // the editor not being able to request its own focus.
- addWindowFocusListener(new WindowAdapter() {
- public void windowGainedFocus(WindowEvent e) {
- textarea.requestFocusInWindow();
- }
-
-// public void windowLostFocus(WindowEvent e) {
-// System.out.println("lost focus, should we tell the text area?");
-// }
- });
-
- // Open the document that was passed in
- boolean loaded = handleOpenInternal(path);
- if (!loaded) {
- sketch = null;
- }
- }
-
-
- /**
- * Broken out to get modes working for GSOC, but this needs a longer-term
- * solution where the listeners are handled properly.
- */
- protected JEditTextArea createTextArea() {
- return new JEditTextArea(new PdeTextAreaDefaults(mode));
- }
-
-
- public EditorState getEditorState() {
- return state;
- }
-
-
- public void removeRecent() {
- base.removeRecent(this);
- }
-
-
- public void addRecent() {
- base.handleRecent(this);
- }
-
-
- /**
- * Handles files dragged & dropped from the desktop and into the editor
- * window. Dragging files into the editor window is the same as using
- * "Sketch → Add File" for each file.
- */
- class FileDropHandler extends TransferHandler {
- public boolean canImport(JComponent dest, DataFlavor[] flavors) {
- return true;
- }
-
- @SuppressWarnings("unchecked")
- public boolean importData(JComponent src, Transferable transferable) {
- int successful = 0;
-
- try {
- DataFlavor uriListFlavor =
- new DataFlavor("text/uri-list;class=java.lang.String");
-
- if (transferable.isDataFlavorSupported(DataFlavor.javaFileListFlavor)) {
- java.util.List list = (java.util.List)
- transferable.getTransferData(DataFlavor.javaFileListFlavor);
- for (int i = 0; i < list.size(); i++) {
- File file = (File) list.get(i);
- if (sketch.addFile(file)) {
- successful++;
- }
- }
- } else if (transferable.isDataFlavorSupported(uriListFlavor)) {
- // Some platforms (Mac OS X and Linux, when this began) preferred
- // this method of moving files.
- String data = (String)transferable.getTransferData(uriListFlavor);
- String[] pieces = PApplet.splitTokens(data, "\r\n");
- for (int i = 0; i < pieces.length; i++) {
- if (pieces[i].startsWith("#")) continue;
-
- String path = null;
- if (pieces[i].startsWith("file:///")) {
- path = pieces[i].substring(7);
- } else if (pieces[i].startsWith("file:/")) {
- path = pieces[i].substring(5);
- }
- if (sketch.addFile(new File(path))) {
- successful++;
- }
- }
- }
- } catch (Exception e) {
- Base.showWarning("Drag & Drop Problem",
- "An error occurred while trying to add files to the sketch.", e);
- return false;
- }
-
- if (successful == 0) {
- statusError("No files were added to the sketch.");
-
- } else if (successful == 1) {
- statusNotice("One file added to the sketch.");
-
- } else {
- statusNotice(successful + " files added to the sketch.");
- }
- return true;
- }
- }
-
-
- public Base getBase() {
- return base;
- }
-
-
- public Mode getMode() {
- return mode;
- }
-
-
- protected void initModeMenu() {
- modeMenu = new JMenu();
- for (final Mode m : base.getModeList()) {
- if (mode == m) {
- JRadioButtonMenuItem item = new JRadioButtonMenuItem(m.getTitle());
- // doesn't need a listener, since it doesn't do anything
- item.setSelected(true);
- modeMenu.add(item);
- } else {
- JMenuItem item = new JMenuItem(m.getTitle());
- item.addActionListener(new ActionListener() {
- public void actionPerformed(ActionEvent e) {
- base.changeMode(m);
- }
- });
- modeMenu.add(item);
- }
- }
-
- modeMenu.addSeparator();
- JMenuItem addLib = new JMenuItem("Add Mode...");
- addLib.addActionListener(new ActionListener() {
- public void actionPerformed(ActionEvent e) {
- base.handleOpenModeManager();
- }
- });
- modeMenu.add(addLib);
- }
-
-
- public JMenu getModeMenu() {
- return modeMenu;
- }
-
-
-
-// public Settings getTheme() {
-// return mode.getTheme();
-// }
-
-
- abstract public EditorToolbar createToolbar();
-
-
- abstract public Formatter createFormatter();
-
-
-// protected void setPlacement(int[] location) {
-// setBounds(location[0], location[1], location[2], location[3]);
-// if (location[4] != 0) {
-// splitPane.setDividerLocation(location[4]);
-// }
-// }
-//
-//
-// protected int[] getPlacement() {
-// int[] location = new int[5];
-//
-// // Get the dimensions of the Frame
-// Rectangle bounds = getBounds();
-// location[0] = bounds.x;
-// location[1] = bounds.y;
-// location[2] = bounds.width;
-// location[3] = bounds.height;
-//
-// // Get the current placement of the divider
-// location[4] = splitPane.getDividerLocation();
-//
-// return location;
-// }
-
-
- protected void setDividerLocation(int pos) {
- splitPane.setDividerLocation(pos);
- }
-
-
- protected int getDividerLocation() {
- return splitPane.getDividerLocation();
- }
-
-
- // . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
-
-
- /**
- * Read and apply new values from the preferences, either because
- * the app is just starting up, or the user just finished messing
- * with things in the Preferences window.
- */
- protected void applyPreferences() {
-// // apply the setting for 'use external editor'
-// boolean external = Preferences.getBoolean("editor.external");
-// textarea.setEditable(!external);
-// saveMenuItem.setEnabled(!external);
-// saveAsMenuItem.setEnabled(!external);
-
- TextAreaPainter painter = textarea.getPainter();
-// if (external) {
-// // disable line highlight and turn off the caret when disabling
-// Color color = mode.getColor("editor.external.bgcolor");
-// painter.setBackground(color);
-// painter.setLineHighlightEnabled(false);
-// textarea.setCaretVisible(false);
-// } else {
- Color color = mode.getColor("editor.bgcolor");
- painter.setBackground(color);
- boolean highlight = Preferences.getBoolean("editor.linehighlight");
- painter.setLineHighlightEnabled(highlight);
- textarea.setCaretVisible(true);
-// }
-
- // apply changes to the font size for the editor
- painter.setFont(Preferences.getFont("editor.font"));
-
- // in case tab expansion stuff has changed
- // removing this, just checking prefs directly instead
-// listener.applyPreferences();
-
- // in case moved to a new location
- // For 0125, changing to async version (to be implemented later)
- //sketchbook.rebuildMenus();
- // For 0126, moved into Base, which will notify all editors.
- //base.rebuildMenusAsync();
- }
-
-
- // . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
-
-
- protected void buildMenuBar() {
- JMenuBar menubar = new JMenuBar();
- menubar = new JMenuBar();
- fileMenu = buildFileMenu();
- menubar.add(fileMenu);
- menubar.add(buildEditMenu());
- menubar.add(buildSketchMenu());
-// rebuildToolList();
- rebuildToolMenu();
- menubar.add(getToolMenu());
-
- JMenu modeMenu = buildModeMenu();
- if (modeMenu != null) {
- menubar.add(modeMenu);
- }
-
-// // These are temporary entries while Android mode is being worked out.
-// // The mode will not be in the tools menu, and won't involve a cmd-key
-// if (!Base.RELEASE) {
-// try {
-// Class clazz = Class.forName("processing.app.tools.android.AndroidMode");
-// Object mode = clazz.newInstance();
-// Method m = clazz.getMethod("init", new Class[] { Editor.class, JMenuBar.class });
-// //String libraryPath = (String) m.invoke(null, new Object[] { });
-// m.invoke(mode, new Object[] { this, menubar });
-// } catch (Exception e) {
-// e.printStackTrace();
-// }
-// }
-
- menubar.add(buildHelpMenu());
- setJMenuBar(menubar);
- }
-
-
- abstract public JMenu buildFileMenu();
-
-
-// public JMenu buildFileMenu(Editor editor) {
-// return buildFileMenu(editor, null);
-// }
-//
-//
-// // most of these items are per-mode
-// protected JMenu buildFileMenu(Editor editor, JMenuItem[] exportItems) {
-
-
- protected JMenu buildFileMenu(JMenuItem[] exportItems) {
- JMenuItem item;
- JMenu fileMenu = new JMenu("File");
-
- item = Toolkit.newJMenuItem("New", 'N');
- item.addActionListener(new ActionListener() {
- public void actionPerformed(ActionEvent e) {
- base.handleNew();
- }
- });
- fileMenu.add(item);
-
- item = Toolkit.newJMenuItem("Open...", 'O');
- item.addActionListener(new ActionListener() {
- public void actionPerformed(ActionEvent e) {
- base.handleOpenPrompt();
- }
- });
- fileMenu.add(item);
-
- fileMenu.add(base.getSketchbookMenu());
-
-// fileMenu.add(mode.getExamplesMenu());
- item = Toolkit.newJMenuItemShift("Examples...", 'O');
- item.addActionListener(new ActionListener() {
- public void actionPerformed(ActionEvent e) {
- mode.showExamplesFrame();
- }
- });
- fileMenu.add(item);
-
- item = Toolkit.newJMenuItem("Close", 'W');
- item.addActionListener(new ActionListener() {
- public void actionPerformed(ActionEvent e) {
- base.handleClose(Editor.this, false);
- }
- });
- fileMenu.add(item);
-
- item = Toolkit.newJMenuItem("Save", 'S');
- item.addActionListener(new ActionListener() {
- public void actionPerformed(ActionEvent e) {
- handleSave(false);
- }
- });
-// saveMenuItem = item;
- fileMenu.add(item);
-
- item = Toolkit.newJMenuItemShift("Save As...", 'S');
- item.addActionListener(new ActionListener() {
- public void actionPerformed(ActionEvent e) {
- handleSaveAs();
- }
- });
-// saveAsMenuItem = item;
- fileMenu.add(item);
-
- if (exportItems != null) {
- for (JMenuItem ei : exportItems) {
- fileMenu.add(ei);
- }
- }
- fileMenu.addSeparator();
-
- item = Toolkit.newJMenuItemShift("Page Setup", 'P');
- item.addActionListener(new ActionListener() {
- public void actionPerformed(ActionEvent e) {
- handlePageSetup();
- }
- });
- fileMenu.add(item);
-
- item = Toolkit.newJMenuItem("Print", 'P');
- item.addActionListener(new ActionListener() {
- public void actionPerformed(ActionEvent e) {
- handlePrint();
- }
- });
- fileMenu.add(item);
-
- // Mac OS X already has its own preferences and quit menu.
- // That's right! Think different, b*tches!
- if (!Base.isMacOS()) {
- fileMenu.addSeparator();
-
- item = Toolkit.newJMenuItem("Preferences", ',');
- item.addActionListener(new ActionListener() {
- public void actionPerformed(ActionEvent e) {
- base.handlePrefs();
- }
- });
- fileMenu.add(item);
-
- fileMenu.addSeparator();
-
- item = Toolkit.newJMenuItem("Quit", 'Q');
- item.addActionListener(new ActionListener() {
- public void actionPerformed(ActionEvent e) {
- base.handleQuit();
- }
- });
- fileMenu.add(item);
- }
- return fileMenu;
- }
-
-
-// public void setSaveItem(JMenuItem item) {
-// saveMenuItem = item;
-// }
-
-
-// public void setSaveAsItem(JMenuItem item) {
-// saveAsMenuItem = item;
-// }
-
-
- protected JMenu buildEditMenu() {
- JMenu menu = new JMenu("Edit");
- JMenuItem item;
-
- undoItem = Toolkit.newJMenuItem("Undo", 'Z');
- undoItem.addActionListener(undoAction = new UndoAction());
- menu.add(undoItem);
-
- // Gotta follow them interface guidelines
- // http://code.google.com/p/processing/issues/detail?id=363
- if (Base.isWindows()) {
- redoItem = Toolkit.newJMenuItem("Redo", 'Y');
- } else { // Linux and OS X
- redoItem = Toolkit.newJMenuItemShift("Redo", 'Z');
- }
- redoItem.addActionListener(redoAction = new RedoAction());
- menu.add(redoItem);
-
- menu.addSeparator();
-
- // TODO "cut" and "copy" should really only be enabled
- // if some text is currently selected
- item = Toolkit.newJMenuItem("Cut", 'X');
- item.addActionListener(new ActionListener() {
- public void actionPerformed(ActionEvent e) {
- handleCut();
- }
- });
- menu.add(item);
-
- item = Toolkit.newJMenuItem("Copy", 'C');
- item.addActionListener(new ActionListener() {
- public void actionPerformed(ActionEvent e) {
- textarea.copy();
- }
- });
- menu.add(item);
-
- item = Toolkit.newJMenuItemShift("Copy as HTML", 'C');
- item.addActionListener(new ActionListener() {
- public void actionPerformed(ActionEvent e) {
- handleCopyAsHTML();
- }
- });
- menu.add(item);
-
- item = Toolkit.newJMenuItem("Paste", 'V');
- item.addActionListener(new ActionListener() {
- public void actionPerformed(ActionEvent e) {
- textarea.paste();
- sketch.setModified(true);
- }
- });
- menu.add(item);
-
- item = Toolkit.newJMenuItem("Select All", 'A');
- item.addActionListener(new ActionListener() {
- public void actionPerformed(ActionEvent e) {
- textarea.selectAll();
- }
- });
- menu.add(item);
-
- /*
- menu.addSeparator();
-
- item = Toolkit.newJMenuItem("Delete Selected Lines", 'D');
- item.addActionListener(new ActionListener() {
- public void actionPerformed(ActionEvent e) {
- handleDeleteLines();
- }
- });
- menu.add(item);
-
- item = new JMenuItem("Move Selected Lines Up");
- item.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_UP, Event.ALT_MASK));
- item.addActionListener(new ActionListener() {
- public void actionPerformed(ActionEvent e) {
- handleMoveLines(true);
- }
- });
- menu.add(item);
-
- item = new JMenuItem("Move Selected Lines Down");
- item.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_DOWN, Event.ALT_MASK));
- item.addActionListener(new ActionListener() {
- public void actionPerformed(ActionEvent e) {
- handleMoveLines(false);
- }
- });
- menu.add(item);
- */
-
- menu.addSeparator();
-
- item = Toolkit.newJMenuItem("Auto Format", 'T');
- item.addActionListener(new ActionListener() {
- public void actionPerformed(ActionEvent e) {
- handleAutoFormat();
- }
- });
- menu.add(item);
-
- item = Toolkit.newJMenuItem("Comment/Uncomment", '/');
- item.addActionListener(new ActionListener() {
- public void actionPerformed(ActionEvent e) {
- handleCommentUncomment();
- }
- });
- menu.add(item);
-
- item = Toolkit.newJMenuItem("Increase Indent", ']');
- item.addActionListener(new ActionListener() {
- public void actionPerformed(ActionEvent e) {
- handleIndentOutdent(true);
- }
- });
- menu.add(item);
-
- item = Toolkit.newJMenuItem("Decrease Indent", '[');
- item.addActionListener(new ActionListener() {
- public void actionPerformed(ActionEvent e) {
- handleIndentOutdent(false);
- }
- });
- menu.add(item);
-
- menu.addSeparator();
-
- item = Toolkit.newJMenuItem("Find...", 'F');
- item.addActionListener(new ActionListener() {
- public void actionPerformed(ActionEvent e) {
- if (find == null) {
- find = new FindReplace(Editor.this);
- }
- //new FindReplace(Editor.this).show();
- find.setVisible(true);
- }
- });
- menu.add(item);
-
- // TODO find next should only be enabled after a
- // search has actually taken place
- item = Toolkit.newJMenuItem("Find Next", 'G');
- item.addActionListener(new ActionListener() {
- public void actionPerformed(ActionEvent e) {
- if (find != null) {
- find.findNext();
- }
- }
- });
- menu.add(item);
-
- item = Toolkit.newJMenuItemShift("Find Previous", 'G');
- item.addActionListener(new ActionListener() {
- public void actionPerformed(ActionEvent e) {
- if (find != null) {
- find.findPrevious();
- }
- }
- });
- menu.add(item);
-
- // For Arduino and Mac, this should be command-E, but that currently conflicts with Export Applet
- item = Toolkit.newJMenuItemAlt("Use Selection for Find", 'F');
- item.addActionListener(new ActionListener() {
- public void actionPerformed(ActionEvent e) {
- if (find == null) {
- find = new FindReplace(Editor.this);
- }
- find.setFindText(getSelectedText());
- }
- });
- menu.add(item);
-
- return menu;
- }
-
-
- abstract public JMenu buildSketchMenu();
-
-
- protected JMenu buildSketchMenu(JMenuItem[] runItems) {
- JMenuItem item;
- sketchMenu = new JMenu("Sketch");
-
- for (JMenuItem mi : runItems) {
- sketchMenu.add(mi);
- }
-
- sketchMenu.addSeparator();
-
- sketchMenu.add(mode.getImportMenu());
-
- item = Toolkit.newJMenuItem("Show Sketch Folder", 'K');
- item.addActionListener(new ActionListener() {
- public void actionPerformed(ActionEvent e) {
- Base.openFolder(sketch.getFolder());
- }
- });
- sketchMenu.add(item);
- item.setEnabled(Base.openFolderAvailable());
-
- item = new JMenuItem("Add File...");
- item.addActionListener(new ActionListener() {
- public void actionPerformed(ActionEvent e) {
- sketch.handleAddFile();
- }
- });
- sketchMenu.add(item);
-
- return sketchMenu;
- }
-
-
- abstract public void handleImportLibrary(String jarPath);
-
-
- public JMenu getToolMenu() {
- if (toolsMenu == null) {
- rebuildToolMenu();
- }
- return toolsMenu;
- }
-
-
-// protected void rebuildToolList() {
-// coreTools = ToolContribution.list(Base.getToolsFolder(), true);
-// contribTools = ToolContribution.list(Base.getSketchbookToolsFolder(), true);
-// }
-
-
- public void rebuildToolMenu() {
- if (toolsMenu == null) {
- toolsMenu = new JMenu("Tools");
- } else {
- toolsMenu.removeAll();
- }
-
-// rebuildToolList();
- coreTools = ToolContribution.loadAll(Base.getToolsFolder());
- contribTools = ToolContribution.loadAll(Base.getSketchbookToolsFolder());
-
- addInternalTools(toolsMenu);
- addTools(toolsMenu, coreTools);
- addTools(toolsMenu, contribTools);
-
- toolsMenu.addSeparator();
- JMenuItem item = new JMenuItem("Add Tool...");
- item.addActionListener(new ActionListener() {
- public void actionPerformed(ActionEvent e) {
- base.handleOpenToolManager();
- }
- });
- toolsMenu.add(item);
- }
-
-
- protected void addTools(JMenu menu, ArrayList tools) {
- HashMap toolItems = new HashMap();
-
- for (final ToolContribution tool : tools) {
- String title = tool.getMenuTitle();
- JMenuItem item = new JMenuItem(title);
- item.addActionListener(new ActionListener() {
- boolean inited;
-
- public void actionPerformed(ActionEvent e) {
- if (!inited) {
- tool.init(Editor.this);
- inited = true;
- }
- EventQueue.invokeLater(tool);
- }
- });
- //menu.add(item);
- toolItems.put(title, item);
- }
-
- ArrayList toolList = new ArrayList(toolItems.keySet());
- if (toolList.size() > 0) {
- menu.addSeparator();
- Collections.sort(toolList);
- for (String title : toolList) {
- menu.add(toolItems.get(title));
- }
- }
- }
-
-
- /**
- * Override this if you want a special menu for your particular 'mode'.
- */
- public JMenu buildModeMenu() {
- return null;
- }
-
-
- protected void addToolMenuItem(JMenu menu, String className) {
- try {
- Class> toolClass = Class.forName(className);
- final Tool tool = (Tool) toolClass.newInstance();
-
- JMenuItem item = new JMenuItem(tool.getMenuTitle());
-
- tool.init(Editor.this);
-
- item.addActionListener(new ActionListener() {
- public void actionPerformed(ActionEvent e) {
- SwingUtilities.invokeLater(tool);
- }
- });
- menu.add(item);
-// return item;
-
- } catch (Exception e) {
- e.printStackTrace();
-// return null;
- }
- }
-
-
- protected JMenu addInternalTools(JMenu menu) {
-// JMenuItem item;
-// item = createToolMenuItem("processing.app.tools.AutoFormatTool");
-// int modifiers = Toolkit.getDefaultToolkit().getMenuShortcutKeyMask();
-// item.setAccelerator(KeyStroke.getKeyStroke('T', modifiers));
-// menu.add(item);
-
- addToolMenuItem(menu, "processing.app.tools.CreateFont");
- addToolMenuItem(menu, "processing.app.tools.ColorSelector");
- addToolMenuItem(menu, "processing.app.tools.Archiver");
-
- if (Base.isMacOS()) {
- if (SerialFixer.isNeeded()) {
- addToolMenuItem(menu, "processing.app.tools.SerialFixer");
- }
- addToolMenuItem(menu, "processing.app.tools.InstallCommander");
- }
-
- // I think this is no longer needed... It was Mac OS X specific,
- // and they gave up on MacRoman a long time ago.
-// addToolMenuItem(menu, "processing.app.tools.FixEncoding");
-
- // currently commented out
-// if (Base.DEBUG) {
-// addToolMenuItem(menu, "processing.app.tools.ExportExamples");
-// }
-
-// // These are temporary entries while Android mode is being worked out.
-// // The mode will not be in the tools menu, and won't involve a cmd-key
-// if (!Base.RELEASE) {
-// item = createToolMenuItem("processing.app.tools.android.AndroidTool");
-// item.setAccelerator(KeyStroke.getKeyStroke('D', modifiers));
-// menu.add(item);
-// menu.add(createToolMenuItem("processing.app.tools.android.Permissions"));
-// menu.add(createToolMenuItem("processing.app.tools.android.Reset"));
-// }
-
- return menu;
- }
-
-
- /*
- // testing internal web server to serve up docs from a zip file
- item = new JMenuItem("Web Server Test");
- item.addActionListener(new ActionListener() {
- public void actionPerformed(ActionEvent e) {
- //WebServer ws = new WebServer();
- SwingUtilities.invokeLater(new Runnable() {
- public void run() {
- try {
- int port = WebServer.launch("/Users/fry/coconut/processing/build/shared/reference.zip");
- Base.openURL("http://127.0.0.1:" + port + "/reference/setup_.html");
-
- } catch (IOException e1) {
- e1.printStackTrace();
- }
- }
- });
- }
- });
- menu.add(item);
- */
-
- /*
- item = new JMenuItem("Browser Test");
- item.addActionListener(new ActionListener() {
- public void actionPerformed(ActionEvent e) {
- //Base.openURL("http://processing.org/learning/gettingstarted/");
- //JFrame browserFrame = new JFrame("Browser");
- BrowserStartup bs = new BrowserStartup("jar:file:/Users/fry/coconut/processing/build/shared/reference.zip!/reference/setup_.html");
- bs.initUI();
- bs.launch();
- }
- });
- menu.add(item);
- */
-
-
- abstract public JMenu buildHelpMenu();
-
-
- public void showReference(String filename) {
- File file = new File(mode.getReferenceFolder(), filename);
- // Prepend with file:// and also encode spaces & other characters
- Base.openURL(file.toURI().toString());
- }
-
-
- static public void showChanges() {
- // http://code.google.com/p/processing/issues/detail?id=1520
- if (!Base.isCommandLine()) {
- Base.openURL("http://wiki.processing.org/w/Changes");
- }
- }
-
-
- // . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
-
-
- class UndoAction extends AbstractAction {
- public UndoAction() {
- super("Undo");
- this.setEnabled(false);
- }
-
- public void actionPerformed(ActionEvent e) {
- stopCompoundEdit();
-
- try {
- final Integer caret = caretUndoStack.pop();
- caretRedoStack.push(caret);
- textarea.setCaretPosition(caret);
- textarea.scrollToCaret();
- } catch (Exception ignore) {
- }
- try {
- undo.undo();
- } catch (CannotUndoException ex) {
- //System.out.println("Unable to undo: " + ex);
- //ex.printStackTrace();
- }
- updateUndoState();
- redoAction.updateRedoState();
- if (sketch != null) {
- sketch.setModified(!getText().equals(sketch.getCurrentCode().getSavedProgram()));
- }
- }
-
- protected void updateUndoState() {
- if (undo.canUndo() || compoundEdit != null && compoundEdit.isInProgress()) {
- this.setEnabled(true);
- undoItem.setEnabled(true);
- undoItem.setText(undo.getUndoPresentationName());
- putValue(Action.NAME, undo.getUndoPresentationName());
-// if (sketch != null) {
-// sketch.setModified(true); // 0107, removed for 0196
-// }
- } else {
- this.setEnabled(false);
- undoItem.setEnabled(false);
- undoItem.setText("Undo");
- putValue(Action.NAME, "Undo");
-// if (sketch != null) {
-// sketch.setModified(false); // 0107
-// }
- }
- }
- }
-
-
- class RedoAction extends AbstractAction {
- public RedoAction() {
- super("Redo");
- this.setEnabled(false);
- }
-
- public void actionPerformed(ActionEvent e) {
- stopCompoundEdit();
-
- try {
- undo.redo();
- } catch (CannotRedoException ex) {
- //System.out.println("Unable to redo: " + ex);
- //ex.printStackTrace();
- }
- try {
- final Integer caret = caretRedoStack.pop();
- caretUndoStack.push(caret);
- textarea.setCaretPosition(caret);
- } catch (Exception ignore) {
- }
- updateRedoState();
- undoAction.updateUndoState();
- if (sketch != null) {
- sketch.setModified(!getText().equals(sketch.getCurrentCode().getSavedProgram()));
- }
- }
-
- protected void updateRedoState() {
- if (undo.canRedo()) {
- redoItem.setEnabled(true);
- redoItem.setText(undo.getRedoPresentationName());
- putValue(Action.NAME, undo.getRedoPresentationName());
- } else {
- this.setEnabled(false);
- redoItem.setEnabled(false);
- redoItem.setText("Redo");
- putValue(Action.NAME, "Redo");
- }
- }
- }
-
-
- // . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
-
-
- // these will be done in a more generic way soon, more like:
- // setHandler("action name", Runnable);
- // but for the time being, working out the kinks of how many things to
- // abstract from the editor in this fashion.
-
-
-// public void setHandlers(Runnable runHandler, Runnable presentHandler,
-// Runnable stopHandler,
-// Runnable exportHandler, Runnable exportAppHandler) {
-// this.runHandler = runHandler;
-// this.presentHandler = presentHandler;
-// this.stopHandler = stopHandler;
-// this.exportHandler = exportHandler;
-// this.exportAppHandler = exportAppHandler;
-// }
-
-
-// public void resetHandlers() {
-// runHandler = new DefaultRunHandler();
-// presentHandler = new DefaultPresentHandler();
-// stopHandler = new DefaultStopHandler();
-// exportHandler = new DefaultExportHandler();
-// exportAppHandler = new DefaultExportAppHandler();
-// }
-
-
- // . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
-
-
- /**
- * Gets the current sketch object.
- */
- public Sketch getSketch() {
- return sketch;
- }
-
-
- /**
- * Get the JEditTextArea object for use (not recommended). This should only
- * be used in obscure cases that really need to hack the internals of the
- * JEditTextArea. Most tools should only interface via the get/set functions
- * found in this class. This will maintain compatibility with future releases,
- * which will not use JEditTextArea.
- */
- public JEditTextArea getTextArea() {
- return textarea;
- }
-
-
- /**
- * Get the contents of the current buffer. Used by the Sketch class.
- */
- public String getText() {
- return textarea.getText();
- }
-
-
- /**
- * Get a range of text from the current buffer.
- */
- public String getText(int start, int stop) {
- return textarea.getText(start, stop - start);
- }
-
-
- /**
- * Replace the entire contents of the front-most tab.
- */
- public void setText(String what) {
- startCompoundEdit();
- textarea.setText(what);
- stopCompoundEdit();
- }
-
-
- public void insertText(String what) {
- startCompoundEdit();
- int caret = getCaretOffset();
- setSelection(caret, caret);
- textarea.setSelectedText(what);
- stopCompoundEdit();
- }
-
-
- /**
- * Called to update the text but not switch to a different set of code
- * (which would affect the undo manager).
- */
-// public void setText2(String what, int start, int stop) {
-// beginCompoundEdit();
-// textarea.setText(what);
-// endCompoundEdit();
-//
-// // make sure that a tool isn't asking for a bad location
-// start = Math.max(0, Math.min(start, textarea.getDocumentLength()));
-// stop = Math.max(0, Math.min(start, textarea.getDocumentLength()));
-// textarea.select(start, stop);
-//
-// textarea.requestFocus(); // get the caret blinking
-// }
-
-
- public String getSelectedText() {
- return textarea.getSelectedText();
- }
-
-
- public void setSelectedText(String what) {
- textarea.setSelectedText(what);
- }
-
-
- public void setSelection(int start, int stop) {
- // make sure that a tool isn't asking for a bad location
- start = PApplet.constrain(start, 0, textarea.getDocumentLength());
- stop = PApplet.constrain(stop, 0, textarea.getDocumentLength());
-
- textarea.select(start, stop);
- }
-
-
- /**
- * Get the position (character offset) of the caret. With text selected,
- * this will be the last character actually selected, no matter the direction
- * of the selection. That is, if the user clicks and drags to select lines
- * 7 up to 4, then the caret position will be somewhere on line four.
- */
- public int getCaretOffset() {
- return textarea.getCaretPosition();
- }
-
-
- /**
- * True if some text is currently selected.
- */
- public boolean isSelectionActive() {
- return textarea.isSelectionActive();
- }
-
-
- /**
- * Get the beginning point of the current selection.
- */
- public int getSelectionStart() {
- return textarea.getSelectionStart();
- }
-
-
- /**
- * Get the end point of the current selection.
- */
- public int getSelectionStop() {
- return textarea.getSelectionStop();
- }
-
-
- /**
- * Get text for a specified line.
- */
- public String getLineText(int line) {
- return textarea.getLineText(line);
- }
-
-
- /**
- * Replace the text on a specified line.
- */
- public void setLineText(int line, String what) {
- startCompoundEdit();
- textarea.select(getLineStartOffset(line), getLineStopOffset(line));
- textarea.setSelectedText(what);
- stopCompoundEdit();
- }
-
-
- /**
- * Get character offset for the start of a given line of text.
- */
- public int getLineStartOffset(int line) {
- return textarea.getLineStartOffset(line);
- }
-
-
- /**
- * Get character offset for end of a given line of text.
- */
- public int getLineStopOffset(int line) {
- return textarea.getLineStopOffset(line);
- }
-
-
- /**
- * Get the number of lines in the currently displayed buffer.
- */
- public int getLineCount() {
- return textarea.getLineCount();
- }
-
-
- /**
- * Use before a manipulating text to group editing operations together as a
- * single undo. Use stopCompoundEdit() once finished.
- */
- public void startCompoundEdit() {
- stopCompoundEdit();
- compoundEdit = new CompoundEdit();
- }
-
-
- /**
- * Use with startCompoundEdit() to group edit operations in a single undo.
- */
- public void stopCompoundEdit() {
- if (compoundEdit != null) {
- compoundEdit.end();
- undo.addEdit(compoundEdit);
- undoAction.updateUndoState();
- redoAction.updateRedoState();
- compoundEdit = null;
- }
- }
-
-
- public int getScrollPosition() {
- return textarea.getScrollPosition();
- }
-
-
- // . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
-
-
- /**
- * Switch between tabs, this swaps out the Document object
- * that's currently being manipulated.
- */
- protected void setCode(SketchCode code) {
- SyntaxDocument document = (SyntaxDocument) code.getDocument();
-
- if (document == null) { // this document not yet inited
- document = new SyntaxDocument();
- code.setDocument(document);
-
- // turn on syntax highlighting
- document.setTokenMarker(mode.getTokenMarker());
-
- // insert the program text into the document object
- try {
- document.insertString(0, code.getProgram(), null);
- } catch (BadLocationException bl) {
- bl.printStackTrace();
- }
-
- // set up this guy's own undo manager
-// code.undo = new UndoManager();
-
- document.addDocumentListener(new DocumentListener() {
-
- public void removeUpdate(DocumentEvent e) {
- if (isInserting && isDirectEdit()) {
- endTextEditHistory();
- }
- isInserting = false;
- }
-
- public void insertUpdate(DocumentEvent e) {
- if (!isInserting && isDirectEdit()) {
- endTextEditHistory();
- }
- isInserting = true;
- }
-
- public void changedUpdate(DocumentEvent e) {
- endTextEditHistory();
- }
- });
-
- // connect the undo listener to the editor
- document.addUndoableEditListener(new UndoableEditListener() {
-
- public void undoableEditHappened(UndoableEditEvent e) {
- // if an edit is in progress, reset the timer
- if (endUndoEvent != null) {
- endUndoEvent.cancel();
- endUndoEvent = null;
- startTimerEvent();
- }
-
- // if this edit is just getting started, create a compound edit
- if (compoundEdit == null) {
- startCompoundEdit();
- startTimerEvent();
- }
-
- compoundEdit.addEdit(e.getEdit());
- undoAction.updateUndoState();
- redoAction.updateRedoState();
- }
- });
- }
-
- // update the document object that's in use
- textarea.setDocument(document,
- code.getSelectionStart(), code.getSelectionStop(),
- code.getScrollPosition());
-
-// textarea.requestFocus(); // get the caret blinking
- textarea.requestFocusInWindow(); // required for caret blinking
-
- this.undo = code.getUndo();
- undoAction.updateUndoState();
- redoAction.updateRedoState();
- }
-
- /**
- * @return true if the text is being edited from direct input from typing and
- * not shortcuts that manipulate text
- */
- boolean isDirectEdit() {
- return endUndoEvent != null;
- }
-
- void startTimerEvent() {
- endUndoEvent = new TimerTask() {
- public void run() {
- endTextEditHistory();
- }
- };
- timer.schedule(endUndoEvent, 3000);
- // let the gc eat the cancelled events
- timer.purge();
- }
-
- void endTextEditHistory() {
- if (endUndoEvent != null) {
- endUndoEvent.cancel();
- endUndoEvent = null;
- }
- stopCompoundEdit();
- }
-
- // . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
-
-
- /**
- * Implements Edit → Cut.
- */
- public void handleCut() {
- textarea.cut();
- sketch.setModified(true);
- }
-
-
- /**
- * Implements Edit → Copy.
- */
- public void handleCopy() {
- textarea.copy();
- }
-
-
- public void handleCopyAsHTML() {
- textarea.copyAsHTML();
- statusNotice("Code formatted as HTML has been copied to the clipboard.");
- }
-
-
- /**
- * Implements Edit → Paste.
- */
- public void handlePaste() {
- textarea.paste();
- sketch.setModified(true);
- }
-
-
- /**
- * Implements Edit → Select All.
- */
- public void handleSelectAll() {
- textarea.selectAll();
- }
-
-// /**
-// * @param moveUp
-// * true to swap the selected lines with the line above, false to swap
-// * with the line beneath
-// */
- /*
- public void handleMoveLines(boolean moveUp) {
- startCompoundEdit();
-
- int startLine = textarea.getSelectionStartLine();
- int stopLine = textarea.getSelectionStopLine();
-
- // if more than one line is selected and none of the characters of the end
- // line are selected, don't move that line
- if (startLine != stopLine
- && textarea.getSelectionStop() == textarea.getLineStartOffset(stopLine))
- stopLine--;
-
- int replacedLine = moveUp ? startLine - 1 : stopLine + 1;
- if (replacedLine < 0 || replacedLine >= textarea.getLineCount())
- return;
-
- final String source = getText();
-
- int replaceStart = textarea.getLineStartOffset(replacedLine);
- int replaceEnd = textarea.getLineStopOffset(replacedLine);
- if (replaceEnd == source.length() + 1)
- replaceEnd--;
-
- int selectionStart = textarea.getLineStartOffset(startLine);
- int selectionEnd = textarea.getLineStopOffset(stopLine);
- if (selectionEnd == source.length() + 1)
- selectionEnd--;
-
- String replacedText = source.substring(replaceStart, replaceEnd);
- String selectedText = source.substring(selectionStart, selectionEnd);
- if (replacedLine == textarea.getLineCount() - 1) {
- replacedText += "\n";
- selectedText = selectedText.substring(0, selectedText.length() - 1);
- } else if (stopLine == textarea.getLineCount() - 1) {
- selectedText += "\n";
- replacedText = replacedText.substring(0, replacedText.length() - 1);
- }
-
- int newSelectionStart, newSelectionEnd;
- if (moveUp) {
- // Change the selection, then change the line above
- textarea.select(selectionStart, selectionEnd);
- textarea.setSelectedText(replacedText);
-
- textarea.select(replaceStart, replaceEnd);
- textarea.setSelectedText(selectedText);
-
- newSelectionStart = textarea.getLineStartOffset(startLine - 1);
- newSelectionEnd = textarea.getLineStopOffset(stopLine - 1) - 1;
- } else {
- // Change the line beneath, then change the selection
- textarea.select(replaceStart, replaceEnd);
- textarea.setSelectedText(selectedText);
-
- textarea.select(selectionStart, selectionEnd);
- textarea.setSelectedText(replacedText);
-
- newSelectionStart = textarea.getLineStartOffset(startLine + 1);
- newSelectionEnd = textarea.getLineStopOffset(stopLine + 1) - 1;
- }
-
- textarea.select(newSelectionStart, newSelectionEnd);
- stopCompoundEdit();
- }
- */
-
-
- /*
- public void handleDeleteLines() {
- int startLine = textarea.getSelectionStartLine();
- int stopLine = textarea.getSelectionStopLine();
-
- int start = textarea.getLineStartOffset(startLine);
- int end = textarea.getLineStopOffset(stopLine);
- if (end == getText().length() + 1)
- end--;
-
- textarea.select(start, end);
- textarea.setSelectedText("");
- }
- */
-
-
- public void handleAutoFormat() {
- final String source = getText();
-
- try {
- final String formattedText = createFormatter().format(source);
- // save current (rough) selection point
- int selectionEnd = getSelectionStop();
-
-// boolean wasVisible =
-// textarea.getSelectionStopLine() >= textarea.getFirstLine() &&
-// textarea.getSelectionStopLine() < textarea.getLastLine();
-
- // make sure the caret would be past the end of the text
- if (formattedText.length() < selectionEnd - 1) {
- selectionEnd = formattedText.length() - 1;
- }
-
- if (formattedText.equals(source)) {
- statusNotice("No changes necessary for Auto Format.");
- } else {
- // replace with new bootiful text
- // selectionEnd hopefully at least in the neighborhood
- int scrollPos = textarea.getScrollPosition();
- setText(formattedText);
- setSelection(selectionEnd, selectionEnd);
-
- // Put the scrollbar position back, otherwise it jumps on each format.
- // Since we're not doing a good job of maintaining position anyway,
- // a more complicated workaround here is fairly pointless.
- // http://code.google.com/p/processing/issues/detail?id=1533
- if (scrollPos != textarea.getScrollPosition()) {
-// boolean wouldBeVisible =
-// scrollPos >= textarea.getFirstLine() &&
-// scrollPos < textarea.getLastLine();
-//
-// // if it was visible, and now it's not, then allow the scroll
-// if (!(wasVisible && !wouldBeVisible)) {
- textarea.setScrollPosition(scrollPos);
-// }
- }
- getSketch().setModified(true);
- // mark as finished
- statusNotice("Auto Format finished.");
- }
-
- } catch (final Exception e) {
- statusError(e);
- }
- }
-
-
- abstract public String getCommentPrefix();
-
-
- protected void handleCommentUncomment() {
- startCompoundEdit();
-
- String prefix = getCommentPrefix();
- int prefixLen = prefix.length();
-
- int startLine = textarea.getSelectionStartLine();
- int stopLine = textarea.getSelectionStopLine();
-
- int lastLineStart = textarea.getLineStartOffset(stopLine);
- int selectionStop = textarea.getSelectionStop();
- // If the selection ends at the beginning of the last line,
- // then don't (un)comment that line.
- if (selectionStop == lastLineStart) {
- // Though if there's no selection, don't do that
- if (textarea.isSelectionActive()) {
- stopLine--;
- }
- }
-
- // If the text is empty, ignore the user.
- // Also ensure that all lines are commented (not just the first)
- // when determining whether to comment or uncomment.
- int length = textarea.getDocumentLength();
- boolean commented = true;
- for (int i = startLine; commented && (i <= stopLine); i++) {
- int pos = textarea.getLineStartOffset(i);
- if (pos + prefixLen > length) {
- commented = false;
- } else {
- // Check the first characters to see if it's already a comment.
- String begin = textarea.getText(pos, prefixLen);
- //System.out.println("begin is '" + begin + "'");
- commented = begin.equals(prefix);
- }
- }
-
- for (int line = startLine; line <= stopLine; line++) {
- int location = textarea.getLineStartOffset(line);
- if (commented) {
- // remove a comment
- textarea.select(location, location + prefixLen);
- if (textarea.getSelectedText().equals(prefix)) {
- textarea.setSelectedText("");
- }
- } else {
- // add a comment
- textarea.select(location, location);
- textarea.setSelectedText(prefix);
- }
- }
- // Subtract one from the end, otherwise selects past the current line.
- // (Which causes subsequent calls to keep expanding the selection)
- textarea.select(textarea.getLineStartOffset(startLine),
- textarea.getLineStopOffset(stopLine) - 1);
- stopCompoundEdit();
- sketch.setModified(true);
- }
-
-
- public void handleIndent() {
- handleIndentOutdent(true);
- }
-
-
- public void handleOutdent() {
- handleIndentOutdent(false);
- }
-
-
- public void handleIndentOutdent(boolean indent) {
- int tabSize = Preferences.getInteger("editor.tabs.size");
- String tabString = Editor.EMPTY.substring(0, tabSize);
-
- startCompoundEdit();
-
- int startLine = textarea.getSelectionStartLine();
- int stopLine = textarea.getSelectionStopLine();
-
- // If the selection ends at the beginning of the last line,
- // then don't (un)comment that line.
- int lastLineStart = textarea.getLineStartOffset(stopLine);
- int selectionStop = textarea.getSelectionStop();
- if (selectionStop == lastLineStart) {
- // Though if there's no selection, don't do that
- if (textarea.isSelectionActive()) {
- stopLine--;
- }
- }
-
- for (int line = startLine; line <= stopLine; line++) {
- int location = textarea.getLineStartOffset(line);
-
- if (indent) {
- textarea.select(location, location);
- textarea.setSelectedText(tabString);
-
- } else { // outdent
- int last = Math.min(location + tabSize, textarea.getDocumentLength());
- textarea.select(location, last);
- // Don't eat code if it's not indented
- if (textarea.getSelectedText().equals(tabString)) {
- textarea.setSelectedText("");
- }
- }
- }
- // Subtract one from the end, otherwise selects past the current line.
- // (Which causes subsequent calls to keep expanding the selection)
- textarea.select(textarea.getLineStartOffset(startLine),
- textarea.getLineStopOffset(stopLine) - 1);
- stopCompoundEdit();
- sketch.setModified(true);
- }
-
-
- static public boolean checkParen(char[] array, int index, int stop) {
-// boolean paren = false;
-// int stepper = i + 1;
-// while (stepper < mlength) {
-// if (array[stepper] == '(') {
-// paren = true;
-// break;
-// }
-// stepper++;
-// }
- while (index < stop) {
-// if (array[index] == '(') {
-// return true;
-// } else if (!Character.isWhitespace(array[index])) {
-// return false;
-// }
- switch (array[index]) {
- case '(':
- return true;
-
- case ' ':
- case '\t':
- case '\n':
- case '\r':
- index++;
- break;
-
- default:
-// System.out.println("defaulting because " + array[index] + " " + PApplet.hex(array[index]));
- return false;
- }
- }
-// System.out.println("exiting " + new String(array, index, stop - index));
- return false;
- }
-
-
- protected boolean functionable(char c) {
- return (c == '_') || (c >= 'a' && c <= 'z') || (c >= 'A' && c <= 'Z');
- }
-
-
- /**
- * Check the current selection for reference. If no selection is active,
- * expand the current selection.
- * @return
- */
- protected String referenceCheck(boolean selectIfFound) {
- int start = textarea.getSelectionStart();
- int stop = textarea.getSelectionStop();
- if (stop < start) {
- int temp = stop;
- stop = start;
- start = temp;
- }
- char[] c = textarea.getText().toCharArray();
-
-// System.out.println("checking reference");
- if (start == stop) {
- while (start > 0 && functionable(c[start - 1])) {
- start--;
- }
- while (stop < c.length && functionable(c[stop])) {
- stop++;
- }
-// System.out.println("start is stop");
- }
- String text = new String(c, start, stop - start).trim();
-// System.out.println(" reference piece is '" + text + "'");
- if (checkParen(c, stop, c.length)) {
- text += "_";
- }
- String ref = mode.lookupReference(text);
- if (selectIfFound) {
- textarea.select(start, stop);
- }
- return ref;
- }
-
-
- protected void handleFindReference() {
- String ref = referenceCheck(true);
- if (ref != null) {
- showReference(ref + ".html");
- } else {
- String text = textarea.getSelectedText().trim();
- if (text.length() == 0) {
- statusNotice("First select a word to find in the reference.");
- } else {
- statusNotice("No reference available for \"" + text + "\"");
- }
- }
- }
-
-
- /*
- protected void handleFindReference() {
- String text = textarea.getSelectedText().trim();
-
- if (text.length() == 0) {
- statusNotice("First select a word to find in the reference.");
-
- } else {
- char[] c = textarea.getText().toCharArray();
- int after = Math.max(textarea.getSelectionStart(), textarea.getSelectionStop());
- if (checkParen(c, after, c.length)) {
- text += "_";
- System.out.println("looking up ref for " + text);
- }
- String referenceFile = mode.lookupReference(text);
- System.out.println("reference file is " + referenceFile);
- if (referenceFile == null) {
- statusNotice("No reference available for \"" + text + "\"");
- } else {
- showReference(referenceFile + ".html");
- }
- }
- }
-
-
- protected void handleFindReference() {
- String text = textarea.getSelectedText().trim();
-
- if (text.length() == 0) {
- statusNotice("First select a word to find in the reference.");
-
- } else {
- String referenceFile = mode.lookupReference(text);
- //System.out.println("reference file is " + referenceFile);
- if (referenceFile == null) {
- statusNotice("No reference available for \"" + text + "\"");
- } else {
- showReference(referenceFile + ".html");
- }
- }
- }
- */
-
-
- // . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
-
-
- /**
- * Set the location of the sketch run window. Used by Runner to update the
- * Editor about window drag events while the sketch is running.
- */
- public void setSketchLocation(Point p) {
- sketchWindowLocation = p;
- }
-
-
- /**
- * Get the last location of the sketch's run window. Used by Runner to make
- * the window show up in the same location as when it was last closed.
- */
- public Point getSketchLocation() {
- return sketchWindowLocation;
- }
-
-
-// public void internalCloseRunner() {
-// mode.internalCloseRunner(this);
-// }
-
-
- /**
- * Check if the sketch is modified and ask user to save changes.
- * @return false if canceling the close/quit operation
- */
- protected boolean checkModified() {
- if (!sketch.isModified()) return true;
-
- // As of Processing 1.0.10, this always happens immediately.
- // http://dev.processing.org/bugs/show_bug.cgi?id=1456
-
- String prompt = "Save changes to " + sketch.getName() + "? ";
-
- if (!Base.isMacOS()) {
- int result =
- JOptionPane.showConfirmDialog(this, prompt, "Close",
- JOptionPane.YES_NO_CANCEL_OPTION,
- JOptionPane.QUESTION_MESSAGE);
-
- if (result == JOptionPane.YES_OPTION) {
- return handleSave(true);
-
- } else if (result == JOptionPane.NO_OPTION) {
- return true; // ok to continue
-
- } else if (result == JOptionPane.CANCEL_OPTION ||
- result == JOptionPane.CLOSED_OPTION) {
- return false;
-
- } else {
- throw new IllegalStateException();
- }
-
- } else {
- // This code is disabled unless Java 1.5 is being used on Mac OS X
- // because of a Java bug that prevents the initial value of the
- // dialog from being set properly (at least on my MacBook Pro).
- // The bug causes the "Don't Save" option to be the highlighted,
- // blinking, default. This sucks. But I'll tell you what doesn't
- // suck--workarounds for the Mac and Apple's snobby attitude about it!
- // I think it's nifty that they treat their developers like dirt.
-
- // Pane formatting adapted from the quaqua guide
- // http://www.randelshofer.ch/quaqua/guide/joptionpane.html
- JOptionPane pane =
- new JOptionPane(" " +
- " " +
- "Do you want to save changes to this sketch " +
- " before closing? " +
- "If you don't save, your changes will be lost.",
- JOptionPane.QUESTION_MESSAGE);
-
- String[] options = new String[] {
- "Save", "Cancel", "Don't Save"
- };
- pane.setOptions(options);
-
- // highlight the safest option ala apple hig
- pane.setInitialValue(options[0]);
-
- // on macosx, setting the destructive property places this option
- // away from the others at the lefthand side
- pane.putClientProperty("Quaqua.OptionPane.destructiveOption",
- new Integer(2));
-
- JDialog dialog = pane.createDialog(this, null);
- dialog.setVisible(true);
-
- Object result = pane.getValue();
- if (result == options[0]) { // save (and close/quit)
- return handleSave(true);
-
- } else if (result == options[2]) { // don't save (still close/quit)
- return true;
-
- } else { // cancel?
- return false;
- }
- }
- }
-
-
- /**
- * Open a sketch from a particular path, but don't check to save changes.
- * Used by Sketch.saveAs() to re-open a sketch after the "Save As"
- */
-// protected void handleOpenUnchecked(String path, int codeIndex,
-// int selStart, int selStop, int scrollPos) {
-// internalCloseRunner();
-// handleOpenInternal(path);
-// // Replacing a document that may be untitled. If this is an actual
-// // untitled document, then editor.untitled will be set by Base.
-// untitled = false;
-//
-// sketch.setCurrentCode(codeIndex);
-// textarea.select(selStart, selStop);
-// textarea.setScrollPosition(scrollPos);
-// }
-
-
- /**
- * Second stage of open, occurs after having checked to see if the
- * modifications (if any) to the previous sketch need to be saved.
- */
- protected boolean handleOpenInternal(String path) {
- // check to make sure that this .pde file is
- // in a folder of the same name
- File file = new File(path);
- File parentFile = new File(file.getParent());
- String parentName = parentFile.getName();
- String pdeName = parentName + ".pde";
- File altFile = new File(file.getParent(), pdeName);
-
- if (pdeName.equals(file.getName())) {
- // no beef with this guy
-
- } else if (altFile.exists()) {
- // user selected a .java from the same sketch,
- // but open the .pde instead
- path = altFile.getAbsolutePath();
- //System.out.println("found alt file in same folder");
-
- } else if (!path.endsWith(".pde")) {
- Base.showWarning("Bad file selected",
- "Processing can only open its own sketches\n" +
- "and other files ending in .pde", null);
- return false;
-
- } else {
- String properParent =
- file.getName().substring(0, file.getName().length() - 4);
-
- Object[] options = { "OK", "Cancel" };
- String prompt =
- "The file \"" + file.getName() + "\" needs to be inside\n" +
- "a sketch folder named \"" + properParent + "\".\n" +
- "Create this folder, move the file, and continue?";
-
- int result = JOptionPane.showOptionDialog(this,
- prompt,
- "Moving",
- JOptionPane.YES_NO_OPTION,
- JOptionPane.QUESTION_MESSAGE,
- null,
- options,
- options[0]);
-
- if (result == JOptionPane.YES_OPTION) {
- // create properly named folder
- File properFolder = new File(file.getParent(), properParent);
- if (properFolder.exists()) {
- Base.showWarning("Error",
- "A folder named \"" + properParent + "\" " +
- "already exists. Can't open sketch.", null);
- return false;
- }
- if (!properFolder.mkdirs()) {
- //throw new IOException("Couldn't create sketch folder");
- Base.showWarning("Error",
- "Could not create the sketch folder.", null);
- return false;
- }
- // copy the sketch inside
- File properPdeFile = new File(properFolder, file.getName());
- File origPdeFile = new File(path);
- try {
- Base.copyFile(origPdeFile, properPdeFile);
- } catch (IOException e) {
- Base.showWarning("Error", "Could not copy to a proper location.", e);
- return false;
- }
-
- // remove the original file, so user doesn't get confused
- origPdeFile.delete();
-
- // update with the new path
- path = properPdeFile.getAbsolutePath();
-
- } else if (result == JOptionPane.NO_OPTION) {
- return false;
- }
- }
-
- try {
- sketch = new Sketch(path, this);
- } catch (IOException e) {
- Base.showWarning("Error", "Could not create the sketch.", e);
- return false;
- }
- header.rebuild();
- updateTitle();
- // Disable untitled setting from previous document, if any
-// untitled = false;
-
- // Store information on who's open and running
- // (in case there's a crash or something that can't be recovered)
-// base.storeSketches();
- Preferences.save();
-
- // opening was successful
- return true;
-
-// } catch (Exception e) {
-// e.printStackTrace();
-// statusError(e);
-// return false;
-// }
- }
-
-
- /**
- * Set the title of the PDE window based on the current sketch, i.e.
- * something like "sketch_070752a - Processing 0126"
- */
- public void updateTitle() {
- setTitle(sketch.getName() + " | Processing " + Base.VERSION_NAME);
-
- if (!sketch.isUntitled()) {
- // set current file for OS X so that cmd-click in title bar works
- File sketchFile = sketch.getMainFile();
- getRootPane().putClientProperty("Window.documentFile", sketchFile);
- } else {
- // per other applications, don't set this until the file has been saved
- getRootPane().putClientProperty("Window.documentFile", null);
- }
- }
-
-
- /**
- * Actually handle the save command. If 'immediately' is set to false,
- * this will happen in another thread so that the message area
- * will update and the save button will stay highlighted while the
- * save is happening. If 'immediately' is true, then it will happen
- * immediately. This is used during a quit, because invokeLater()
- * won't run properly while a quit is happening. This fixes
- * Bug 276 .
- */
- public boolean handleSave(boolean immediately) {
-// handleStop(); // 0136
-
- if (sketch.isUntitled()) {
- return handleSaveAs();
- // need to get the name, user might also cancel here
-
- } else if (immediately) {
- handleSaveImpl();
-
- } else {
- EventQueue.invokeLater(new Runnable() {
- public void run() {
- handleSaveImpl();
- }
- });
- }
- return true;
- }
-
-
- protected void handleSaveImpl() {
- statusNotice("Saving...");
- try {
- if (sketch.save()) {
- statusNotice("Done Saving.");
- } else {
- statusEmpty();
- }
-
- } catch (Exception e) {
- // show the error as a message in the window
- statusError(e);
-
- // zero out the current action,
- // so that checkModified2 will just do nothing
- //checkModifiedMode = 0;
- // this is used when another operation calls a save
- }
- }
-
-
- public boolean handleSaveAs() {
- statusNotice("Saving...");
- try {
- if (sketch.saveAs()) {
- statusNotice("Done Saving.");
- // Disabling this for 0125, instead rebuild the menu inside
- // the Save As method of the Sketch object, since that's the
- // only one who knows whether something was renamed.
- //sketchbook.rebuildMenusAsync();
- } else {
- statusNotice("Save Canceled.");
- return false;
- }
- } catch (Exception e) {
- // show the error as a message in the window
- statusError(e);
- }
- return true;
- }
-
-
- /**
- * Handler for File → Page Setup.
- */
- public void handlePageSetup() {
- //printerJob = null;
- if (printerJob == null) {
- printerJob = PrinterJob.getPrinterJob();
- }
- if (pageFormat == null) {
- pageFormat = printerJob.defaultPage();
- }
- pageFormat = printerJob.pageDialog(pageFormat);
- //System.out.println("page format is " + pageFormat);
- }
-
-
- /**
- * Handler for File → Print.
- */
- public void handlePrint() {
- statusNotice("Printing...");
- //printerJob = null;
- if (printerJob == null) {
- printerJob = PrinterJob.getPrinterJob();
- }
- if (pageFormat != null) {
- //System.out.println("setting page format " + pageFormat);
- printerJob.setPrintable(textarea.getPainter(), pageFormat);
- } else {
- printerJob.setPrintable(textarea.getPainter());
- }
- // set the name of the job to the code name
- printerJob.setJobName(sketch.getCurrentCode().getPrettyName());
-
- if (printerJob.printDialog()) {
- try {
- printerJob.print();
- statusNotice("Done printing.");
-
- } catch (PrinterException pe) {
- statusError("Error while printing.");
- pe.printStackTrace();
- }
- } else {
- statusNotice("Printing canceled.");
- }
- //printerJob = null; // clear this out?
- }
-
-
- /**
- * Grab current contents of the sketch window, advance the console,
- * stop any other running sketches... not in that order.
- */
- public void prepareRun() {
- internalCloseRunner();
- statusEmpty();
-
- // do this to advance/clear the terminal window / dos prompt / etc
- for (int i = 0; i < 10; i++) System.out.println();
-
- // clear the console on each run, unless the user doesn't want to
- if (Preferences.getBoolean("console.auto_clear")) {
- console.clear();
- }
-
- // make sure the user didn't hide the sketch folder
- sketch.ensureExistence();
-
- // make sure any edits have been stored
- //current.setProgram(editor.getText());
- sketch.getCurrentCode().setProgram(getText());
-
-// // if an external editor is being used, need to grab the
-// // latest version of the code from the file.
-// if (Preferences.getBoolean("editor.external")) {
-// sketch.reload();
-// }
- }
-
-
- /**
- * Halt the current runner for whatever reason. Might be the VM dying,
- * the window closing, an error...
- */
- abstract public void internalCloseRunner();
-
-
- abstract public void deactivateRun();
-
-
- // . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
-
-
- /**
- * Show an error in the status bar.
- */
- public void statusError(String what) {
- status.error(what);
- //new Exception("deactivating RUN").printStackTrace();
-// toolbar.deactivate(EditorToolbar.RUN);
- }
-
-
- /**
- * Show an exception in the editor status bar.
- */
- public void statusError(Exception e) {
- e.printStackTrace();
-// if (e == null) {
-// System.err.println("Editor.statusError() was passed a null exception.");
-// return;
-// }
-
- if (e instanceof SketchException) {
- SketchException re = (SketchException) e;
- if (re.hasCodeIndex()) {
- sketch.setCurrentCode(re.getCodeIndex());
- }
- if (re.hasCodeLine()) {
- int line = re.getCodeLine();
- // subtract one from the end so that the \n ain't included
- if (line >= textarea.getLineCount()) {
- // The error is at the end of this current chunk of code,
- // so the last line needs to be selected.
- line = textarea.getLineCount() - 1;
- if (textarea.getLineText(line).length() == 0) {
- // The last line may be zero length, meaning nothing to select.
- // If so, back up one more line.
- line--;
- }
- }
- if (line < 0 || line >= textarea.getLineCount()) {
- System.err.println("Bad error line: " + line);
- } else {
- textarea.select(textarea.getLineStartOffset(line),
- textarea.getLineStopOffset(line) - 1);
- }
- }
- }
-
- // Since this will catch all Exception types, spend some time figuring
- // out which kind and try to give a better error message to the user.
- String mess = e.getMessage();
- if (mess != null) {
- String javaLang = "java.lang.";
- if (mess.indexOf(javaLang) == 0) {
- mess = mess.substring(javaLang.length());
- }
- String rxString = "RuntimeException: ";
- if (mess.startsWith(rxString)) {
- mess = mess.substring(rxString.length());
- }
- statusError(mess);
- }
-// e.printStackTrace();
- }
-
-
- /**
- * Show a notice message in the editor status bar.
- */
- public void statusNotice(String msg) {
- status.notice(msg);
- }
-
-
- public void clearNotice(String msg) {
- if (status.message.equals(msg)) {
- statusEmpty();
- }
- }
-
-
- /**
- * Clear the status area.
- */
- public void statusEmpty() {
- statusNotice(EMPTY);
- }
-
-
- public void startIndeterminate() {
- status.startIndeterminate();
- }
-
-
- public void stopIndeterminate() {
- status.stopIndeterminate();
- }
-
-
- public void statusHalt() {
- // stop called by someone else
- }
-
-
- public boolean isHalted() {
- return false;
- }
-
-
- // . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
-
-
- /**
- * Returns the edit popup menu.
- */
- class TextAreaPopup extends JPopupMenu {
- JMenuItem cutItem;
- JMenuItem copyItem;
- JMenuItem discourseItem;
- JMenuItem referenceItem;
-
-
- public TextAreaPopup() {
- JMenuItem item;
-
- cutItem = new JMenuItem("Cut");
- cutItem.addActionListener(new ActionListener() {
- public void actionPerformed(ActionEvent e) {
- handleCut();
- }
- });
- this.add(cutItem);
-
- copyItem = new JMenuItem("Copy");
- copyItem.addActionListener(new ActionListener() {
- public void actionPerformed(ActionEvent e) {
- handleCopy();
- }
- });
- this.add(copyItem);
-
- discourseItem = new JMenuItem("Copy as HTML");
- discourseItem.addActionListener(new ActionListener() {
- public void actionPerformed(ActionEvent e) {
- handleCopyAsHTML();
- }
- });
- this.add(discourseItem);
-
- item = new JMenuItem("Paste");
- item.addActionListener(new ActionListener() {
- public void actionPerformed(ActionEvent e) {
- handlePaste();
- }
- });
- this.add(item);
-
- item = new JMenuItem("Select All");
- item.addActionListener(new ActionListener() {
- public void actionPerformed(ActionEvent e) {
- handleSelectAll();
- }
- });
- this.add(item);
-
- this.addSeparator();
-
- item = new JMenuItem("Comment/Uncomment");
- item.addActionListener(new ActionListener() {
- public void actionPerformed(ActionEvent e) {
- handleCommentUncomment();
- }
- });
- this.add(item);
-
- item = new JMenuItem("Increase Indent");
- item.addActionListener(new ActionListener() {
- public void actionPerformed(ActionEvent e) {
- handleIndentOutdent(true);
- }
- });
- this.add(item);
-
- item = new JMenuItem("Decrease Indent");
- item.addActionListener(new ActionListener() {
- public void actionPerformed(ActionEvent e) {
- handleIndentOutdent(false);
- }
- });
- this.add(item);
-
- this.addSeparator();
-
- referenceItem = new JMenuItem("Find in Reference");
- referenceItem.addActionListener(new ActionListener() {
- public void actionPerformed(ActionEvent e) {
- handleFindReference();
- }
- });
- this.add(referenceItem);
- }
-
- // if no text is selected, disable copy and cut menu items
- public void show(Component component, int x, int y) {
-// if (textarea.isSelectionActive()) {
-// cutItem.setEnabled(true);
-// copyItem.setEnabled(true);
-// discourseItem.setEnabled(true);
-//
-//// String sel = textarea.getSelectedText().trim();
-//// String referenceFile = mode.lookupReference(sel);
-//// referenceItem.setEnabled(referenceFile != null);
-//
-// } else {
-// cutItem.setEnabled(false);
-// copyItem.setEnabled(false);
-// discourseItem.setEnabled(false);
-//// referenceItem.setEnabled(false);
-// }
- boolean active = textarea.isSelectionActive();
- cutItem.setEnabled(active);
- copyItem.setEnabled(active);
- discourseItem.setEnabled(active);
-
- referenceItem.setEnabled(referenceCheck(false) != null);
- super.show(component, x, y);
- }
- }
-}
\ No newline at end of file
diff --git a/app/src/processing/app/EditorConsole.java b/app/src/processing/app/EditorConsole.java
deleted file mode 100644
index fb5ebc17f9..0000000000
--- a/app/src/processing/app/EditorConsole.java
+++ /dev/null
@@ -1,426 +0,0 @@
-/* -*- mode: java; c-basic-offset: 2; indent-tabs-mode: nil -*- */
-
-/*
- Part of the Processing project - http://processing.org
-
- Copyright (c) 2004-10 Ben Fry and Casey Reas
- Copyright (c) 2001-04 Massachusetts Institute of Technology
-
- This program is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation; either version 2 of the License, or
- (at your option) any later version.
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with this program; if not, write to the Free Software Foundation,
- Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-*/
-
-package processing.app;
-
-import java.awt.*;
-import java.awt.event.*;
-import java.io.*;
-
-import javax.swing.*;
-import javax.swing.text.*;
-import processing.core.PApplet;
-
-import java.text.SimpleDateFormat;
-import java.util.*;
-
-
-/**
- * Message console that sits below the editing area.
- *
- * Be careful when debugging this class, because if it's throwing exceptions,
- * don't take over System.err, and debug while watching just System.out
- * or just call println() or whatever directly to systemOut or systemErr.
- *
- * Also note that encodings will not work properly when run from Eclipse. This
- * means that if you use non-ASCII characters in a println() or some such,
- * the characters won't print properly in the Processing and/or Eclipse console.
- * It seems that Eclipse's console-grabbing and that of Processing don't
- * get along with one another. Use 'ant run' to work on encoding-related issues.
- */
-public class EditorConsole extends JScrollPane {
- Editor editor;
-
- JTextPane consoleTextPane;
- BufferedStyledDocument consoleDoc;
-
- MutableAttributeSet stdStyle;
- MutableAttributeSet errStyle;
-
- int maxLineCount;
-
- // Single static instance shared because there's only one real System.out.
- // Within the input handlers, the currentConsole variable will be used to
- // echo things to the correct location.
-
- static PrintStream systemOut;
- static PrintStream systemErr;
-
- static PrintStream consoleOut;
- static PrintStream consoleErr;
-
- static OutputStream stdoutFile;
- static OutputStream stderrFile;
-
- static EditorConsole currentConsole;
-
- // For 0185, moved the first init to this static { } block, so that we never
- // have a situation that causes systemOut/Err to not be set properly.
- static {
- systemOut = System.out;
- systemErr = System.err;
-
- // placing everything inside a try block because this can be a dangerous
- // time for the lights to blink out and crash for and obscure reason.
- try {
- // Create output files that will have a randomized name. Has to
- // be randomized otherwise another instance of Processing (or one of its
- // sister IDEs) might collide with the file causing permissions problems.
- // The files and folders are not deleted on exit because they may be
- // needed for debugging or bug reporting.
- SimpleDateFormat formatter = new SimpleDateFormat("yyMMdd");
- String randy = PApplet.nf((int) (1000 * Math.random()), 4);
- String stamp = formatter.format(new Date()) + "_" + randy;
-
- File consoleDir = Base.getSettingsFile("console");
- consoleDir.mkdirs();
- File outFile = new File(consoleDir, stamp + ".out");
- stdoutFile = new FileOutputStream(outFile);
- File errFile = new File(consoleDir, stamp + ".err");
- stderrFile = new FileOutputStream(errFile);
-
- consoleOut = new PrintStream(new EditorConsoleStream(false));
- consoleErr = new PrintStream(new EditorConsoleStream(true));
-
- System.setOut(consoleOut);
- System.setErr(consoleErr);
-
-// } catch (Exception e) {
-// stdoutFile = null;
-// stderrFile = null;
-//
-// e.printStackTrace();
-// Base.showWarning("Console Error",
-// "A problem occurred while trying to open the\n" +
-// "files used to store the console output.", e);
- } catch (Exception e) {
- stdoutFile = null;
- stderrFile = null;
-
- consoleOut = null;
- consoleErr = null;
-
- System.setOut(systemOut);
- System.setErr(systemErr);
-
- e.printStackTrace(systemErr);
- }
- }
-
-
- public EditorConsole(Editor editor) {
- this.editor = editor;
-
- maxLineCount = Preferences.getInteger("console.length");
-
- consoleDoc = new BufferedStyledDocument(10000, maxLineCount);
- consoleTextPane = new JTextPane(consoleDoc);
- consoleTextPane.setEditable(false);
-
- updateMode();
-
- // add the jtextpane to this scrollpane
- this.setViewportView(consoleTextPane);
-
- // to fix ugliness.. normally macosx java 1.3 puts an
- // ugly white border around this object, so turn it off.
- if (Base.isMacOS()) {
- setBorder(null);
- }
-
- // periodically post buffered messages to the console
- // should the interval come from the preferences file?
- new javax.swing.Timer(250, new ActionListener() {
- public void actionPerformed(ActionEvent evt) {
- // only if new text has been added
- if (consoleDoc.hasAppendage) {
- // insert the text that's been added in the meantime
- consoleDoc.insertAll();
- // always move to the end of the text as it's added
- consoleTextPane.setCaretPosition(consoleDoc.getLength());
- }
- }
- }).start();
- }
-
-
- /**
- * Change coloring, fonts, etc in response to a mode change.
- */
- protected void updateMode() {
- Mode mode = editor.getMode();
-
- // necessary?
- MutableAttributeSet standard = new SimpleAttributeSet();
- StyleConstants.setAlignment(standard, StyleConstants.ALIGN_LEFT);
- consoleDoc.setParagraphAttributes(0, 0, standard, true);
-
- Font font = Preferences.getFont("console.font");
-
- // build styles for different types of console output
- Color bgColor = mode.getColor("console.color");
- Color fgColorOut = mode.getColor("console.output.color");
- Color fgColorErr = mode.getColor("console.error.color");
-
- stdStyle = new SimpleAttributeSet();
- StyleConstants.setForeground(stdStyle, fgColorOut);
- StyleConstants.setBackground(stdStyle, bgColor);
- StyleConstants.setFontSize(stdStyle, font.getSize());
- StyleConstants.setFontFamily(stdStyle, font.getFamily());
- StyleConstants.setBold(stdStyle, font.isBold());
- StyleConstants.setItalic(stdStyle, font.isItalic());
-
- errStyle = new SimpleAttributeSet();
- StyleConstants.setForeground(errStyle, fgColorErr);
- StyleConstants.setBackground(errStyle, bgColor);
- StyleConstants.setFontSize(errStyle, font.getSize());
- StyleConstants.setFontFamily(errStyle, font.getFamily());
- StyleConstants.setBold(errStyle, font.isBold());
- StyleConstants.setItalic(errStyle, font.isItalic());
-
- consoleTextPane.setBackground(bgColor);
-
- // calculate height of a line of text in pixels
- // and size window accordingly
- FontMetrics metrics = this.getFontMetrics(font);
- int height = metrics.getAscent() + metrics.getDescent();
- int lines = Preferences.getInteger("console.lines"); //, 4);
- int sizeFudge = 6; //10; // unclear why this is necessary, but it is
- setPreferredSize(new Dimension(1024, (height * lines) + sizeFudge));
- setMinimumSize(new Dimension(1024, (height * 4) + sizeFudge));
- }
-
-
- static public void setEditor(Editor editor) {
- currentConsole = editor.console;
- }
-
-
- /**
- * Close the streams so that the temporary files can be deleted.
- *
- * File.deleteOnExit() cannot be used because the stdout and stderr
- * files are inside a folder, and have to be deleted before the
- * folder itself is deleted, which can't be guaranteed when using
- * the deleteOnExit() method.
- */
- public void handleQuit() {
- // replace original streams to remove references to console's streams
- System.setOut(systemOut);
- System.setErr(systemErr);
-
- try {
- // close the PrintStream
- if (consoleOut != null) consoleOut.close();
- if (consoleErr != null) consoleErr.close();
-
- // also have to close the original FileOutputStream
- // otherwise it won't be shut down completely
- if (stdoutFile != null) stdoutFile.close();
- if (stderrFile != null) stderrFile.close();
-
- } catch (IOException e) {
- e.printStackTrace(systemErr);
- }
- }
-
-
- synchronized public void message(String what, boolean err) {
- if (err) {
- systemErr.print(what);
- } else {
- systemOut.print(what);
- }
-
- if (err && (what.contains("invalid context 0x0") || (what.contains("invalid drawable")))) {
- // Respectfully declining... This is a quirk of more recent releases of
- // Java on Mac OS X, but is widely reported as the source of any other
- // bug or problem that a user runs into. It may well be a Processing
- // bug, but until we know, we're suppressing the messages.
- } else if (err && what.contains("Make pbuffer:")) {
- // Remove initalization warning from LWJGL.
- } else if (err && what.contains("XInitThreads() called for concurrent")) {
- // "Info: XInitThreads() called for concurrent Thread support" message on Linux
- } else {
- // Append a piece of text to the console. Swing components are NOT
- // thread-safe, and since the MessageSiphon instantiates new threads,
- // and in those callbacks, they often print output to stdout and stderr,
- // which are wrapped by EditorConsoleStream and eventually leads to
- // EditorConsole.appendText(), which directly updates the Swing text
- // components, causing deadlock. Updates are buffered to the console and
- // displayed at regular intervals on Swing's event-dispatching thread.
- // (patch by David Mellis)
- consoleDoc.appendString(what, err ? errStyle : stdStyle);
- }
- }
-
-
- public void clear() {
- try {
- consoleDoc.remove(0, consoleDoc.getLength());
- } catch (BadLocationException e) {
- // ignore the error otherwise this will cause an infinite loop
- // maybe not a good idea in the long run?
- }
- }
-
-
- // . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
-
-
- private static class EditorConsoleStream extends OutputStream {
- //static EditorConsole current;
- final boolean err; // whether stderr or stdout
- final byte single[] = new byte[1];
-
- public EditorConsoleStream(boolean err) {
- this.err = err;
- }
-
- public void close() { }
-
- public void flush() { }
-
- public void write(byte b[]) { // appears never to be used
- write(b, 0, b.length);
- }
-
- public void write(byte b[], int offset, int length) {
- if (currentConsole != null) {
- //currentConsole.write(b, offset, length, err);
-// currentConsole.message(new String(b, offset, length), err, false);
- currentConsole.message(new String(b, offset, length), err);
- } else {
- try {
- if (err) {
- systemErr.write(b);
- } else {
- systemOut.write(b);
- }
- } catch (IOException e) { } // just ignore, where would we write?
- }
-
- final OutputStream echo = err ? stderrFile : stdoutFile;
- if (echo != null) {
- try {
- echo.write(b, offset, length);
- echo.flush();
- } catch (IOException e) {
- e.printStackTrace();
- }
- }
- }
-
- public void write(int b) {
- single[0] = (byte) b;
- write(single, 0, 1);
- }
- }
-}
-
-
-// . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
-
-
-/**
- * Buffer updates to the console and output them in batches. For info, see:
- * http://java.sun.com/products/jfc/tsc/articles/text/element_buffer and
- * http://javatechniques.com/public/java/docs/gui/jtextpane-speed-part2.html
- * appendString() is called from multiple threads, and insertAll from the
- * swing event thread, so they need to be synchronized
- */
-class BufferedStyledDocument extends DefaultStyledDocument {
- ArrayList elements = new ArrayList();
- int maxLineLength, maxLineCount;
- int currentLineLength = 0;
- boolean needLineBreak = false;
- boolean hasAppendage = false;
-
- public BufferedStyledDocument(int maxLineLength, int maxLineCount) {
- this.maxLineLength = maxLineLength;
- this.maxLineCount = maxLineCount;
- }
-
- /** buffer a string for insertion at the end of the DefaultStyledDocument */
- public synchronized void appendString(String str, AttributeSet a) {
- // do this so that it's only updated when needed (otherwise console
- // updates every 250 ms when an app isn't even running.. see bug 180)
- hasAppendage = true;
-
- // process each line of the string
- while (str.length() > 0) {
- // newlines within an element have (almost) no effect, so we need to
- // replace them with proper paragraph breaks (start and end tags)
- if (needLineBreak || currentLineLength > maxLineLength) {
- elements.add(new ElementSpec(a, ElementSpec.EndTagType));
- elements.add(new ElementSpec(a, ElementSpec.StartTagType));
- currentLineLength = 0;
- }
-
- if (str.indexOf('\n') == -1) {
- elements.add(new ElementSpec(a, ElementSpec.ContentType,
- str.toCharArray(), 0, str.length()));
- currentLineLength += str.length();
- needLineBreak = false;
- str = str.substring(str.length()); // eat the string
- } else {
- elements.add(new ElementSpec(a, ElementSpec.ContentType,
- str.toCharArray(), 0, str.indexOf('\n') + 1));
- needLineBreak = true;
- str = str.substring(str.indexOf('\n') + 1); // eat the line
- }
- }
- }
-
- /** insert the buffered strings */
- public synchronized void insertAll() {
- ElementSpec[] elementArray = new ElementSpec[elements.size()];
- elements.toArray(elementArray);
-
- try {
- // check how many lines have been used so far
- // if too many, shave off a few lines from the beginning
- Element element = super.getDefaultRootElement();
- int lineCount = element.getElementCount();
- int overage = lineCount - maxLineCount;
- if (overage > 0) {
- // if 1200 lines, and 1000 lines is max,
- // find the position of the end of the 200th line
- //systemOut.println("overage is " + overage);
- Element lineElement = element.getElement(overage);
- if (lineElement == null) return; // do nuthin
-
- int endOffset = lineElement.getEndOffset();
- // remove to the end of the 200th line
- super.remove(0, endOffset);
- }
- super.insert(super.getLength(), elementArray);
-
- } catch (BadLocationException e) {
- // ignore the error otherwise this will cause an infinite loop
- // maybe not a good idea in the long run?
- }
- elements.clear();
- hasAppendage = false;
- }
-}
diff --git a/app/src/processing/app/EditorHeader.java b/app/src/processing/app/EditorHeader.java
deleted file mode 100644
index b4427b68fb..0000000000
--- a/app/src/processing/app/EditorHeader.java
+++ /dev/null
@@ -1,575 +0,0 @@
-/* -*- mode: java; c-basic-offset: 2; indent-tabs-mode: nil -*- */
-
-/*
- Part of the Processing project - http://processing.org
-
- Copyright (c) 2004-11 Ben Fry and Casey Reas
- Copyright (c) 2001-04 Massachusetts Institute of Technology
-
- This program is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation; either version 2 of the License, or
- (at your option) any later version.
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with this program; if not, write to the Free Software Foundation,
- Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-*/
-
-package processing.app;
-
-import java.awt.*;
-import java.awt.event.*;
-import java.util.Arrays;
-
-import javax.swing.*;
-
-
-/**
- * Sketch tabs at the top of the editor window.
- */
-public class EditorHeader extends JComponent {
- Color backgroundColor;
- Color textColor[] = new Color[2];
-
- Editor editor;
-
- Tab[] tabs = new Tab[0];
- Tab[] visitOrder;
-
- Font font;
- FontMetrics metrics;
- int fontAscent;
-
- JMenu menu;
- JPopupMenu popup;
-
- int menuLeft;
- int menuRight;
-
- //
-
- static final String STATUS[] = { "unsel", "sel" };
- static final int UNSELECTED = 0;
- static final int SELECTED = 1;
-
- static final String WHERE[] = { "left", "mid", "right", "menu" };
- static final int LEFT = 0;
- static final int MIDDLE = 1;
- static final int RIGHT = 2;
- static final int MENU = 3;
-
- static final int PIECE_WIDTH = 4;
-
- Image[][] pieces;
-
- //
-
- Image offscreen;
- int sizeW, sizeH;
- int imageW, imageH;
-
- String lastNoticeName;
-
-
- public EditorHeader(Editor eddie) {
- this.editor = eddie;
-
- updateMode();
-
- addMouseListener(new MouseAdapter() {
- public void mousePressed(MouseEvent e) {
- int x = e.getX();
- int y = e.getY();
-
- if ((x > menuLeft) && (x < menuRight)) {
- popup.show(EditorHeader.this, x, y);
-
- } else {
- Sketch sketch = editor.getSketch();
-// for (int i = 0; i < sketch.getCodeCount(); i++) {
-// if ((x > tabLeft[i]) && (x < tabRight[i])) {
-// sketch.setCurrentCode(i);
-// repaint();
-// }
-// }
- for (Tab tab : tabs) {
- if (tab.contains(x)) {
- sketch.setCurrentCode(tab.index);
- repaint();
- }
- }
- }
- }
-
- public void mouseExited(MouseEvent e) {
- // only clear if it's been set
- if (lastNoticeName != null) {
- // only clear if it's the same as what we set it to
- editor.clearNotice(lastNoticeName);
- lastNoticeName = null;
- }
- }
- });
-
- addMouseMotionListener(new MouseMotionAdapter() {
- public void mouseMoved(MouseEvent e) {
- int x = e.getX();
- for (Tab tab : tabs) {
- if (tab.contains(x) && !tab.textVisible) {
- lastNoticeName = editor.getSketch().getCode(tab.index).getPrettyName();
- editor.statusNotice(lastNoticeName);
- }
- }
- }
- });
- }
-
-
- public void updateMode() {
- Mode mode = editor.getMode();
- pieces = new Image[STATUS.length][WHERE.length];
- for (int i = 0; i < STATUS.length; i++) {
- for (int j = 0; j < WHERE.length; j++) {
- String filename = "theme/tab-" + STATUS[i] + "-" + WHERE[j] + ".gif";
- pieces[i][j] = mode.loadImage(filename);
- }
- }
-
- backgroundColor = mode.getColor("header.bgcolor");
- textColor[SELECTED] = mode.getColor("header.text.selected.color");
- textColor[UNSELECTED] = mode.getColor("header.text.unselected.color");
- font = mode.getFont("header.text.font");
- }
-
-
- public void paintComponent(Graphics screen) {
- if (screen == null) return;
-
- Sketch sketch = editor.getSketch();
- if (sketch == null) return; // ??
-
- Dimension size = getSize();
- if ((size.width != sizeW) || (size.height != sizeH)) {
- // component has been resized
-
- if ((size.width > imageW) || (size.height > imageH)) {
- // nix the image and recreate, it's too small
- offscreen = null;
-
- } else {
- // if the image is larger than necessary, no need to change
- sizeW = size.width;
- sizeH = size.height;
- }
- }
-
- if (offscreen == null) {
- sizeW = size.width;
- sizeH = size.height;
- imageW = sizeW;
- imageH = sizeH;
- if (Toolkit.isRetina()) {
- offscreen = createImage(imageW*2, imageH*2);
- } else {
- offscreen = createImage(imageW, imageH);
- }
- }
-
- Graphics g = offscreen.getGraphics();
- g.setFont(font); // need to set this each time through
- metrics = g.getFontMetrics();
- fontAscent = metrics.getAscent();
-
- Graphics2D g2 = (Graphics2D) g;
-
- if (Toolkit.isRetina()) {
- // scale everything 2x, will be scaled down when drawn to the screen
- g2.scale(2, 2);
- } else {
- // don't anti-alias text in retina mode
- g2.setRenderingHint(RenderingHints.KEY_TEXT_ANTIALIASING,
- RenderingHints.VALUE_TEXT_ANTIALIAS_ON);
- }
-
- // set the background for the offscreen
- g.setColor(backgroundColor);
- g.fillRect(0, 0, imageW, imageH);
-
-// int codeCount = sketch.getCodeCount();
-// if ((tabLeft == null) || (tabLeft.length < codeCount)) {
-// tabLeft = new int[codeCount];
-// tabRight = new int[codeCount];
-// }
- if (tabs.length != sketch.getCodeCount()) {
- tabs = new Tab[sketch.getCodeCount()];
- for (int i = 0; i < tabs.length; i++) {
- tabs[i] = new Tab(i);
- }
- visitOrder = new Tab[sketch.getCodeCount() - 1];
- }
-
-// int x = 6; // offset from left edge of the component
- menuRight = sizeW - 16;
- menuLeft = menuRight - pieces[0][MENU].getWidth(this);
-// int tabMax = menuLeft - x;
- int tabLeft = 6;
- int tabMax = menuLeft - tabLeft;
-
- // reset all tab positions
- for (Tab tab : tabs) {
- SketchCode code = sketch.getCode(tab.index);
- tab.textVisible = true;
- tab.lastVisited = code.lastVisited();
-
- // hide extensions for .pde files (or whatever else is the norm elsewhere
- boolean hide = editor.getMode().hideExtension(code.getExtension());
- String codeName = hide ? code.getPrettyName() : code.getFileName();
- // if modified, add the li'l glyph next to the name
- tab.text = " " + codeName + (code.isModified() ? " \u00A7" : " ");
-
- tab.textWidth = (int)
- font.getStringBounds(tab.text, g2.getFontRenderContext()).getWidth();
- }
-
- // make sure everything can fit
- if (!placeTabs(tabLeft, tabMax, null)) {
- //System.arraycopy(tabs, 0, visitOrder, 0, tabs.length);
- // always show the tab with the sketch's name
-// System.arraycopy(tabs, 1, visitOrder, 0, tabs.length - 1);
- int index = 0;
- // stock the array backwards so that the rightmost tabs are closed by default
- for (int i = tabs.length - 1; i > 0; --i) {
- visitOrder[index++] = tabs[i];
- }
- Arrays.sort(visitOrder); // sort on when visited
-// for (int i = 0; i < visitOrder.length; i++) {
-// System.out.println(visitOrder[i].index + " " + visitOrder[i].text);
-// }
-// System.out.println();
-
- for (int i = 0; i < visitOrder.length; i++) {
- tabs[visitOrder[i].index].textVisible = false;
- if (placeTabs(tabLeft, tabMax, null)) {
- break;
- }
- }
- }
-
- // now actually draw the tabs
- placeTabs(tabLeft, tabMax, g);
-
-// for (int i = 0; i < sketch.getCodeCount(); i++) {
-// SketchCode code = sketch.getCode(i);
-// Tab tab = tabs[i];
-//
-// int pieceCount = 2 + (tab.textWidth / PIECE_WIDTH);
-// int pieceWidth = pieceCount * PIECE_WIDTH;
-//
-// int state = (code == sketch.getCurrentCode()) ? SELECTED : UNSELECTED;
-// g.drawImage(pieces[state][LEFT], x, 0, null);
-// x += PIECE_WIDTH;
-//
-// int contentLeft = x;
-// tab.left = x;
-// for (int j = 0; j < pieceCount; j++) {
-// g.drawImage(pieces[state][MIDDLE], x, 0, null);
-// x += PIECE_WIDTH;
-// }
-// tab.right = x;
-// int textLeft = contentLeft + (pieceWidth - tab.textWidth) / 2;
-//
-// g.setColor(textColor[state]);
-// int baseline = (sizeH + fontAscent) / 2;
-// //g.drawString(sketch.code[i].name, textLeft, baseline);
-// g.drawString(tab.text, textLeft, baseline);
-//
-// g.drawImage(pieces[state][RIGHT], x, 0, null);
-// x += PIECE_WIDTH - 1; // overlap by 1 pixel
-// }
-
-// menuLeft = sizeW - (16 + pieces[0][MENU].getWidth(this));
-// menuRight = sizeW - 16;
- // draw the dropdown menu target
- g.drawImage(pieces[popup.isVisible() ? SELECTED : UNSELECTED][MENU],
- menuLeft, 0, null);
-
- screen.drawImage(offscreen, 0, 0, imageW, imageH, null);
- }
-
-
- private boolean placeTabs(int left, int right, Graphics g) {
- Sketch sketch = editor.getSketch();
- int x = left;
-
- for (int i = 0; i < sketch.getCodeCount(); i++) {
- SketchCode code = sketch.getCode(i);
- Tab tab = tabs[i];
-
- int pieceCount = 2 + (tab.textWidth / PIECE_WIDTH);
- if (tab.textVisible == false) {
- pieceCount = 4;
- }
- int pieceWidth = pieceCount * PIECE_WIDTH;
-
- int state = (code == sketch.getCurrentCode()) ? SELECTED : UNSELECTED;
- if (g != null) {
- g.drawImage(pieces[state][LEFT], x, 0, null);
- }
- x += PIECE_WIDTH;
-
- int contentLeft = x;
- tab.left = x;
- for (int j = 0; j < pieceCount; j++) {
- if (g != null) {
- g.drawImage(pieces[state][MIDDLE], x, 0, null);
- }
- x += PIECE_WIDTH;
- }
- tab.right = x;
-
- if (tab.textVisible) {
- int textLeft = contentLeft + (pieceWidth - tab.textWidth) / 2;
- if (g != null) {
- g.setColor(textColor[state]);
- int baseline = (sizeH + fontAscent) / 2;
- //g.drawString(sketch.code[i].name, textLeft, baseline);
- g.drawString(tab.text, textLeft, baseline);
- }
- }
-
- if (g != null) {
- g.drawImage(pieces[state][RIGHT], x, 0, null);
- }
- x += PIECE_WIDTH - 1; // overlap by 1 pixel
- }
- return x <= right;
- }
-
-
- /**
- * Called when a new sketch is opened.
- */
- public void rebuild() {
- //System.out.println("rebuilding editor header");
- rebuildMenu();
- repaint();
- }
-
-
- public void rebuildMenu() {
- //System.out.println("rebuilding");
- if (menu != null) {
- menu.removeAll();
-
- } else {
- menu = new JMenu();
- popup = menu.getPopupMenu();
- add(popup);
- popup.setLightWeightPopupEnabled(true);
-
- /*
- popup.addPopupMenuListener(new PopupMenuListener() {
- public void popupMenuCanceled(PopupMenuEvent e) {
- // on redraw, the isVisible() will get checked.
- // actually, a repaint may be fired anyway, so this
- // may be redundant.
- repaint();
- }
-
- public void popupMenuWillBecomeInvisible(PopupMenuEvent e) { }
- public void popupMenuWillBecomeVisible(PopupMenuEvent e) { }
- });
- */
- }
- JMenuItem item;
-
- // maybe this shouldn't have a command key anyways..
- // since we're not trying to make this a full ide..
- //item = Editor.newJMenuItem("New", 'T');
-
- /*
- item = Editor.newJMenuItem("Previous", KeyEvent.VK_PAGE_UP);
- item.addActionListener(new ActionListener() {
- public void actionPerformed(ActionEvent e) {
- System.out.println("prev");
- }
- });
- if (editor.sketch != null) {
- item.setEnabled(editor.sketch.codeCount > 1);
- }
- menu.add(item);
-
- item = Editor.newJMenuItem("Next", KeyEvent.VK_PAGE_DOWN);
- item.addActionListener(new ActionListener() {
- public void actionPerformed(ActionEvent e) {
- System.out.println("ext");
- }
- });
- if (editor.sketch != null) {
- item.setEnabled(editor.sketch.codeCount > 1);
- }
- menu.add(item);
-
- menu.addSeparator();
- */
-
- //item = new JMenuItem("New Tab");
- item = Toolkit.newJMenuItemShift("New Tab", 'N');
- item.addActionListener(new ActionListener() {
- public void actionPerformed(ActionEvent e) {
- editor.getSketch().handleNewCode();
- }
- });
- menu.add(item);
-
- item = new JMenuItem("Rename");
- item.addActionListener(new ActionListener() {
- public void actionPerformed(ActionEvent e) {
- editor.getSketch().handleRenameCode();
- /*
- // this is already being called by nameCode(), the second stage of rename
- if (editor.sketch.current == editor.sketch.code[0]) {
- editor.sketchbook.rebuildMenus();
- }
- */
- }
- });
- menu.add(item);
-
- item = new JMenuItem("Delete");
- item.addActionListener(new ActionListener() {
- public void actionPerformed(ActionEvent e) {
- Sketch sketch = editor.getSketch();
- if (!sketch.isUntitled()) { // don't bother if untitled
- if (!Base.isMacOS() && // ok on OS X
- editor.base.editors.size() == 1 && // mmm! accessor
- sketch.getCurrentCodeIndex() == 0) {
- Base.showWarning("Yeah, no." ,
- "You can't delete the last tab " +
- "of the last open sketch.", null);
- } else {
- editor.getSketch().handleDeleteCode();
- }
- }
- }
- });
- menu.add(item);
-
- menu.addSeparator();
-
- // KeyEvent.VK_LEFT and VK_RIGHT will make Windows beep
-
- item = new JMenuItem("Previous Tab");
- KeyStroke ctrlAltLeft =
- KeyStroke.getKeyStroke(KeyEvent.VK_LEFT, Toolkit.SHORTCUT_ALT_KEY_MASK);
- item.setAccelerator(ctrlAltLeft);
- // this didn't want to work consistently
- /*
- item.addActionListener(new ActionListener() {
- public void actionPerformed(ActionEvent e) {
- editor.sketch.prevCode();
- }
- });
- */
- menu.add(item);
-
- item = new JMenuItem("Next Tab");
- KeyStroke ctrlAltRight =
- KeyStroke.getKeyStroke(KeyEvent.VK_RIGHT, Toolkit.SHORTCUT_ALT_KEY_MASK);
- item.setAccelerator(ctrlAltRight);
- /*
- item.addActionListener(new ActionListener() {
- public void actionPerformed(ActionEvent e) {
- editor.sketch.nextCode();
- }
- });
- */
- menu.add(item);
-
- Sketch sketch = editor.getSketch();
- if (sketch != null) {
- menu.addSeparator();
-
- ActionListener jumpListener = new ActionListener() {
- public void actionPerformed(ActionEvent e) {
- editor.getSketch().setCurrentCode(e.getActionCommand());
- }
- };
- for (SketchCode code : sketch.getCode()) {
- item = new JMenuItem(code.getPrettyName());
- item.addActionListener(jumpListener);
- menu.add(item);
- }
- }
- }
-
-
- public void deselectMenu() {
- repaint();
- }
-
-
- public Dimension getPreferredSize() {
- return getMinimumSize();
- }
-
-
- public Dimension getMinimumSize() {
- if (Base.isMacOS()) {
- return new Dimension(300, Preferences.GRID_SIZE);
- }
- return new Dimension(300, Preferences.GRID_SIZE - 1);
- }
-
-
- public Dimension getMaximumSize() {
- if (Base.isMacOS()) {
- return new Dimension(3000, Preferences.GRID_SIZE);
- }
- return new Dimension(3000, Preferences.GRID_SIZE - 1);
- }
-
-
- // . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
-
-
- class Tab implements Comparable {
- int index;
- int left;
- int right;
- String text;
- int textWidth;
- boolean textVisible;
- long lastVisited;
-
- Tab(int index) {
- this.index = index;
- }
-
- boolean contains(int x) {
- return x >= left && x <= right;
- }
-
- // sort by the last time visited
- public int compareTo(Object o) {
- Tab other = (Tab) o;
- // do this here to deal with situation where both are 0
- if (lastVisited == other.lastVisited) {
- return 0;
- }
- if (lastVisited == 0) {
- return -1;
- }
- if (other.lastVisited == 0) {
- return 1;
- }
- return (int) (lastVisited - other.lastVisited);
- }
- }
-}
diff --git a/app/src/processing/app/EditorLineStatus.java b/app/src/processing/app/EditorLineStatus.java
deleted file mode 100644
index dc1a842fb0..0000000000
--- a/app/src/processing/app/EditorLineStatus.java
+++ /dev/null
@@ -1,112 +0,0 @@
-/* -*- mode: java; c-basic-offset: 2; indent-tabs-mode: nil -*- */
-
-/*
- Part of the Processing project - http://processing.org
-
- Copyright (c) 2005-07 Ben Fry and Casey Reas
-
- This program is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation; either version 2 of the License, or
- (at your option) any later version.
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with this program; if not, write to the Free Software Foundation,
- Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-*/
-
-package processing.app;
-
-import java.awt.*;
-import javax.swing.*;
-
-
-/**
- * Li'l status bar fella that shows the line number.
- */
-public class EditorLineStatus extends JComponent {
- Editor editor;
-// JEditTextArea textarea;
- int start = -1, stop;
-
- Color foreground;
- Color background;
- Font font;
- int high;
-
- String text = "";
-
-
- public EditorLineStatus(Editor editor) {
- this.editor = editor;
-
-// textarea = editor.getTextArea();
- // not pretty, but it just does one thing...
-// textarea.editorLineStatus = this;
- editor.getTextArea().editorLineStatus = this;
-
- updateMode();
- }
-
-
- public void updateMode() {
- Mode mode = editor.getMode();
- background = mode.getColor("linestatus.bgcolor");
- font = mode.getFont("linestatus.font");
- foreground = mode.getColor("linestatus.color");
- high = mode.getInteger("linestatus.height");
- }
-
-
- public void set(int newStart, int newStop) {
- if ((newStart == start) && (newStop == stop)) return;
-
- start = newStart;
- stop = newStop;
-
- /*
- if (start == stop) {
- text = "Line " + (start + 1);
- } else {
- text = "Lines " + (start + 1) + " to " + (stop + 1);
- }
- */
- if (start == stop) {
- text = String.valueOf(start+1);
- } else {
- text = (start+1) + " - " + (stop+1);
- }
-
- repaint();
- }
-
-
- public void paintComponent(Graphics g) {
- g.setColor(background);
- Dimension size = getSize();
- g.fillRect(0, 0, size.width, size.height);
-
- g.setFont(font);
- g.setColor(foreground);
- int baseline = (high + g.getFontMetrics().getAscent()) / 2;
- g.drawString(text, 6, baseline);
- }
-
-
- public Dimension getPreferredSize() {
- return new Dimension(300, high);
- }
-
- public Dimension getMinimumSize() {
- return getPreferredSize();
- }
-
- public Dimension getMaximumSize() {
- return new Dimension(3000, high);
- }
-}
diff --git a/app/src/processing/app/EditorStatus.java b/app/src/processing/app/EditorStatus.java
deleted file mode 100644
index 4ed14b377b..0000000000
--- a/app/src/processing/app/EditorStatus.java
+++ /dev/null
@@ -1,427 +0,0 @@
-/* -*- mode: java; c-basic-offset: 2; indent-tabs-mode: nil -*- */
-
-/*
- Part of the Processing project - http://processing.org
-
- Copyright (c) 2004-10 Ben Fry and Casey Reas
- Copyright (c) 2001-04 Massachusetts Institute of Technology
-
- This program is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation; either version 2 of the License, or
- (at your option) any later version.
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with this program; if not, write to the Free Software Foundation,
- Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-*/
-
-package processing.app;
-
-import java.awt.*;
-import java.awt.event.*;
-import javax.swing.*;
-
-
-/**
- * Panel just below the editing area that contains status messages.
- */
-public class EditorStatus extends JPanel {
- Color[] bgcolor;
- Color[] fgcolor;
-
- static final int NOTICE = 0;
- static final int ERR = 1;
- //static final int PROMPT = 2;
- //static final int EDIT = 3;
- static final int EDIT = 2;
-
- static final int YES = 1;
- static final int NO = 2;
- static final int CANCEL = 3;
- static final int OK = 4;
-
- static final String NO_MESSAGE = "";
-
- Editor editor;
-
- int mode;
- String message;
-
- Font font;
- FontMetrics metrics;
- int ascent;
-
- Image offscreen;
- int sizeW, sizeH;
-
- JButton cancelButton;
- JButton okButton;
- JTextField editField;
-
- int response;
-
- boolean indeterminate;
- Thread thread;
-
-
-
- public EditorStatus(Editor editor) {
- this.editor = editor;
- empty();
- updateMode();
- }
-
-
- public void updateMode() {
- Mode mode = editor.getMode();
- bgcolor = new Color[] {
- mode.getColor("status.notice.bgcolor"),
- mode.getColor("status.error.bgcolor"),
- mode.getColor("status.edit.bgcolor")
- };
-
- fgcolor = new Color[] {
- mode.getColor("status.notice.fgcolor"),
- mode.getColor("status.error.fgcolor"),
- mode.getColor("status.edit.fgcolor")
- };
-
- font = mode.getFont("status.font");
- metrics = null;
- }
-
-
- public void empty() {
- mode = NOTICE;
- message = NO_MESSAGE;
- repaint();
- }
-
-
- public void notice(String message) {
- mode = NOTICE;
- this.message = message;
- repaint();
- }
-
-
- public void unnotice(String unmessage) {
- if (message.equals(unmessage)) empty();
- }
-
-
- public void error(String message) {
- mode = ERR;
- this.message = message;
- repaint();
- }
-
-
- public void edit(String message, String dflt) {
- mode = EDIT;
- this.message = message;
-
- response = 0;
- okButton.setVisible(true);
- cancelButton.setVisible(true);
- editField.setVisible(true);
- editField.setText(dflt);
- editField.selectAll();
- editField.requestFocusInWindow();
-
- repaint();
- }
-
-
- public void unedit() {
- okButton.setVisible(false);
- cancelButton.setVisible(false);
- editField.setVisible(false);
- editor.textarea.requestFocusInWindow();
- empty();
- }
-
-
- public void startIndeterminate() {
- indeterminate = true;
- thread = new Thread() {
- public void run() {
- while (Thread.currentThread() == thread) {
- repaint();
- try {
- Thread.sleep(1000 / 10);
- } catch (InterruptedException e) { }
- }
- }
- };
- thread.start();
- }
-
-
- public void stopIndeterminate() {
- indeterminate = false;
- thread = null;
- repaint();
- }
-
-
- public void paintComponent(Graphics screen) {
- if (okButton == null) setup();
-
- Dimension size = getSize();
- if ((size.width != sizeW) || (size.height != sizeH)) {
- // component has been resized
- offscreen = null;
- }
-
- if (offscreen == null) {
- sizeW = size.width;
- sizeH = size.height;
- setButtonBounds();
- if (Toolkit.isRetina()) {
- offscreen = createImage(sizeW*2, sizeH*2);
- } else {
- offscreen = createImage(sizeW, sizeH);
- }
- }
-
- Graphics g = offscreen.getGraphics();
-
- Graphics2D g2 = (Graphics2D) g;
- if (Toolkit.isRetina()) {
- g2.scale(2, 2);
- } else {
- g2.setRenderingHint(RenderingHints.KEY_TEXT_ANTIALIASING,
- RenderingHints.VALUE_TEXT_ANTIALIAS_ON);
- }
-
- g.setFont(font);
- if (metrics == null) {
- metrics = g.getFontMetrics();
- ascent = metrics.getAscent();
- }
-
- //setBackground(bgcolor[mode]); // does nothing
-
- g.setColor(bgcolor[mode]);
- g.fillRect(0, 0, sizeW, sizeH);
-
- g.setColor(fgcolor[mode]);
- g.setFont(font); // needs to be set each time on osx
- g.drawString(message, Preferences.GUI_SMALL, (sizeH + ascent) / 2);
-
- if (indeterminate) {
- int x = cancelButton.getX();
- int w = cancelButton.getWidth();
- int y = getHeight() / 3;
- int h = getHeight() / 3;
-// int y = cancelButton.getY();
-// int h = cancelButton.getHeight();
-// g.setColor(fgcolor[mode]);
-// g.setColor(Color.DARK_GRAY);
- g.setColor(new Color(0x80000000, true));
- g.drawRect(x, y, w, h);
- for (int i = 0; i < 10; i++) {
- int r = (int) (x + Math.random() * w);
- g.drawLine(r, y, r, y+h);
- }
- }
-
- screen.drawImage(offscreen, 0, 0, sizeW, sizeH, null);
- }
-
-
- protected void setup() {
- if (okButton == null) {
- cancelButton = new JButton(Preferences.PROMPT_CANCEL);
- okButton = new JButton(Preferences.PROMPT_OK);
-
- cancelButton.addActionListener(new ActionListener() {
- public void actionPerformed(ActionEvent e) {
- if (mode == EDIT) {
- unedit();
- //editor.toolbar.clear();
- }
- }
- });
-
- okButton.addActionListener(new ActionListener() {
- public void actionPerformed(ActionEvent e) {
- // answering to rename/new code question
- if (mode == EDIT) { // this if() isn't (shouldn't be?) necessary
- String answer = editField.getText();
- editor.getSketch().nameCode(answer);
- unedit();
- }
- }
- });
-
- // !@#(* aqua ui #($*(( that turtle-neck wearing #(** (#$@)(
- // os9 seems to work if bg of component is set, but x still a bastard
- if (Base.isMacOS()) {
- //yesButton.setBackground(bgcolor[EDIT]);
- //noButton.setBackground(bgcolor[EDIT]);
- cancelButton.setBackground(bgcolor[EDIT]);
- okButton.setBackground(bgcolor[EDIT]);
- }
- setLayout(null);
-
- add(cancelButton);
- add(okButton);
-
- cancelButton.setVisible(false);
- okButton.setVisible(false);
-
- editField = new JTextField();
- // disabling, was not in use
- //editField.addActionListener(this);
-
- //if (Base.platform != Base.MACOSX) {
- editField.addKeyListener(new KeyAdapter() {
-
- // Grab ESC with keyPressed, because it's not making it to keyTyped
- public void keyPressed(KeyEvent event) {
- if (event.getKeyChar() == KeyEvent.VK_ESCAPE) {
- unedit();
- //editor.toolbar.clear();
- event.consume();
- }
- }
-
- // use keyTyped to catch when the feller is actually
- // added to the text field. with keyTyped, as opposed to
- // keyPressed, the keyCode will be zero, even if it's
- // enter or backspace or whatever, so the keychar should
- // be used instead. grr.
- public void keyTyped(KeyEvent event) {
- //System.out.println("got event " + event);
- int c = event.getKeyChar();
-
- if (c == KeyEvent.VK_ENTER) { // accept the input
- String answer = editField.getText();
- editor.getSketch().nameCode(answer);
- unedit();
- event.consume();
-
- // easier to test the affirmative case than the negative
- } else if ((c == KeyEvent.VK_BACK_SPACE) ||
- (c == KeyEvent.VK_DELETE) ||
- (c == KeyEvent.VK_RIGHT) ||
- (c == KeyEvent.VK_LEFT) ||
- (c == KeyEvent.VK_UP) ||
- (c == KeyEvent.VK_DOWN) ||
- (c == KeyEvent.VK_HOME) ||
- (c == KeyEvent.VK_END) ||
- (c == KeyEvent.VK_SHIFT)) {
- // these events are ignored
-
- /*
- } else if (c == KeyEvent.VK_ESCAPE) {
- unedit();
- editor.toolbar.clear();
- event.consume();
- */
-
- } else if (c == KeyEvent.VK_SPACE) {
- String t = editField.getText();
- int start = editField.getSelectionStart();
- int end = editField.getSelectionEnd();
- editField.setText(t.substring(0, start) + "_" +
- t.substring(end));
- editField.setCaretPosition(start+1);
- event.consume();
-
- } else if ((c == '_') || (c == '.') || // allow .pde and .java
- ((c >= 'A') && (c <= 'Z')) ||
- ((c >= 'a') && (c <= 'z'))) {
- // these are ok, allow them through
-
- } else if ((c >= '0') && (c <= '9')) {
- // getCaretPosition == 0 means that it's the first char
- // and the field is empty.
- // getSelectionStart means that it *will be* the first
- // char, because the selection is about to be replaced
- // with whatever is typed.
- if ((editField.getCaretPosition() == 0) ||
- (editField.getSelectionStart() == 0)) {
- // number not allowed as first digit
- //System.out.println("bad number bad");
- event.consume();
- }
- } else {
- event.consume();
- //System.out.println("code is " + code + " char = " + c);
- }
- //System.out.println("code is " + code + " char = " + c);
- }
- });
- add(editField);
- editField.setVisible(false);
- }
- }
-
-
- protected void setButtonBounds() {
- int top = (sizeH - Preferences.BUTTON_HEIGHT) / 2;
- int eachButton = Preferences.GUI_SMALL + Preferences.BUTTON_WIDTH;
-
- int cancelLeft = sizeW - eachButton;
- int noLeft = cancelLeft - eachButton;
- int yesLeft = noLeft - eachButton;
-
- //yesButton.setLocation(yesLeft, top);
- //noButton.setLocation(noLeft, top);
- cancelButton.setLocation(cancelLeft, top);
- okButton.setLocation(noLeft, top);
-
- //yesButton.setSize(Preferences.BUTTON_WIDTH, Preferences.BUTTON_HEIGHT);
- //noButton.setSize(Preferences.BUTTON_WIDTH, Preferences.BUTTON_HEIGHT);
- cancelButton.setSize(Preferences.BUTTON_WIDTH, Preferences.BUTTON_HEIGHT);
- okButton.setSize(Preferences.BUTTON_WIDTH, Preferences.BUTTON_HEIGHT);
-
- // edit field height is awkward, and very different between mac and pc,
- // so use at least the preferred height for now.
- int editWidth = 2*Preferences.BUTTON_WIDTH;
- int editHeight = editField.getPreferredSize().height;
- int editTop = (1 + sizeH - editHeight) / 2; // add 1 for ceil
- editField.setBounds(yesLeft - Preferences.BUTTON_WIDTH, editTop,
- editWidth, editHeight);
- }
-
-
- public Dimension getPreferredSize() {
- return getMinimumSize();
- }
-
-
- public Dimension getMinimumSize() {
- return new Dimension(300, Preferences.GRID_SIZE);
- }
-
-
- public Dimension getMaximumSize() {
- return new Dimension(3000, Preferences.GRID_SIZE);
- }
-
-
- public void actionPerformed(ActionEvent e) {
- if (e.getSource() == cancelButton) {
- if (mode == EDIT) unedit();
- //editor.toolbar.clear();
-
- } else if (e.getSource() == okButton) {
- // answering to rename/new code question
- if (mode == EDIT) { // this if() isn't (shouldn't be?) necessary
- String answer = editField.getText();
- editor.getSketch().nameCode(answer);
- unedit();
- }
- }
- }
-}
diff --git a/app/src/processing/app/EditorToolbar.java b/app/src/processing/app/EditorToolbar.java
deleted file mode 100644
index d77f8ff97c..0000000000
--- a/app/src/processing/app/EditorToolbar.java
+++ /dev/null
@@ -1,582 +0,0 @@
-/* -*- mode: java; c-basic-offset: 2; indent-tabs-mode: nil -*- */
-
-/*
- Part of the Processing project - http://processing.org
-
- Copyright (c) 2004-10 Ben Fry and Casey Reas
- Copyright (c) 2001-04 Massachusetts Institute of Technology
-
- This program is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation, version 2.
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with this program; if not, write to the Free Software Foundation,
- Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-*/
-
-package processing.app;
-
-import java.awt.*;
-import java.awt.event.*;
-import java.util.ArrayList;
-
-import javax.swing.*;
-import javax.swing.event.*;
-
-
-/**
- * run/stop/etc buttons for the ide
- */
-public abstract class EditorToolbar extends JComponent implements MouseInputListener, KeyListener {
-
- /** Width of each toolbar button. */
- static final int BUTTON_WIDTH = 27;
- /** Height of each toolbar button. */
- static final int BUTTON_HEIGHT = 32;
- /** The amount of space between groups of buttons on the toolbar. */
- static final int BUTTON_GAP = 5;
- /** Size of the button image being chopped up. */
- static final int BUTTON_IMAGE_SIZE = 33;
-
- static final int INACTIVE = 0;
- static final int ROLLOVER = 1;
- static final int ACTIVE = 2;
-
- protected Base base;
- protected Editor editor;
- protected Mode mode;
-
- Image offscreen;
- int width, height;
-
- Color bgcolor;
-
-// static Image[][] buttonImages;
-// int currentRollover;
- protected Button rollover;
-
-// int buttonCount;
- /** Current state for this button */
-// int[] state; // = new int[BUTTON_COUNT];
- /** Current image for this button's state */
-// Image[] stateImage;
-// int which[]; // mapping indices to implementation
-
-// int x1[], x2[];
- static final int TOP = 0;
- static final int BOTTOM = BUTTON_HEIGHT;
-
- Font statusFont;
- Color statusColor;
-
- boolean shiftPressed;
-
- // what the mode indicator looks like
- Color modeButtonColor;
- Font modeTextFont;
- Color modeTextColor;
- String modeTitle; // = "JAVA"; //"Java";
-// String modeTitle = "ANDROID"; //"Java";
- int modeX1, modeY1;
- int modeX2, modeY2;
- JMenu modeMenu;
-
- protected ArrayList buttons;
-
-
- public EditorToolbar(Editor editor, Base base) { //, JMenu menu) {
- this.editor = editor;
- this.base = base;
-// this.menu = menu;
-
- buttons = new ArrayList();
-// buttonCount = 0;
-// which = new int[BUTTON_COUNT];
-
-// which[buttonCount++] = RUN;
-// which[buttonCount++] = STOP;
-// which[buttonCount++] = NEW;
-// which[buttonCount++] = OPEN;
-// which[buttonCount++] = SAVE;
-// which[buttonCount++] = EXPORT;
-
-// currentRollover = -1;
- rollover = null;
-
- mode = editor.getMode();
- bgcolor = mode.getColor("buttons.bgcolor");
- statusFont = mode.getFont("buttons.status.font");
- statusColor = mode.getColor("buttons.status.color");
- modeTitle = mode.getTitle().toUpperCase();
- modeTextFont = mode.getFont("mode.button.font");
- modeButtonColor = mode.getColor("mode.button.color");
-
- addMouseListener(this);
- addMouseMotionListener(this);
- }
-
-
- /** Load images and add toolbar buttons */
- abstract public void init();
-
-
- /**
- * Only call this from paintComponent, or when the comp is displayable,
- * otherwise createImage() might fail.
- */
- public Image[][] loadImages() {
-// Image allButtons = Base.getThemeImage("buttons.gif", this);
-// Image allButtons = Base.loadImage(file);
- Image allButtons = mode.loadImage("theme/buttons.gif");
- int count = allButtons.getWidth(this) / BUTTON_WIDTH;
-// System.out.println("width is " + allButtons.getWidth(this));
- Image[][] buttonImages = new Image[count][3];
-
- for (int i = 0; i < count; i++) {
- for (int state = 0; state < 3; state++) {
-// Toolkit tk = Toolkit.getDefaultToolkit();
-// Image image = tk.createImage(BUTTON_WIDTH, BUTTON_HEIGHT);
-// System.out.println("image is " + image + " " + BUTTON_WIDTH + " " + BUTTON_HEIGHT);
- Image image = createImage(BUTTON_WIDTH, BUTTON_HEIGHT);
- Graphics g = image.getGraphics();
- g.drawImage(allButtons,
- -(i*BUTTON_IMAGE_SIZE) - 3,
- (-2 + state)*BUTTON_IMAGE_SIZE, null);
- buttonImages[i][state] = image;
- }
- }
- return buttonImages;
- }
-
-
-// abstract static public String getTitle(int index, boolean shift);
-
-
- @Override
- public void paintComponent(Graphics screen) {
- if (buttons.size() == 0) {
- init();
- }
-
- // this data is shared by all EditorToolbar instances
-// if (buttonImages == null) {
-// loadButtons();
-// }
-
- // this happens once per instance of EditorToolbar
-// if (stateImage == null) {
-// state = new int[buttonCount];
-// stateImage = new Image[buttonCount];
-// for (int i = 0; i < buttonCount; i++) {
-// setState(i, INACTIVE, false);
-// }
-// y1 = 0;
-// y2 = BUTTON_HEIGHT;
-// x1 = new int[buttonCount];
-// x2 = new int[buttonCount];
-// }
-
- Dimension size = getSize();
- if ((offscreen == null) ||
- (size.width != width) || (size.height != height)) {
- if (Toolkit.isRetina()) {
- offscreen = createImage(size.width*2, size.height*2);
- } else {
- offscreen = createImage(size.width, size.height);
- }
-
- width = size.width;
- height = size.height;
-
- int offsetX = 3;
- for (Button b : buttons) {
- b.left = offsetX;
- if (b.gap) {
- b.left += BUTTON_GAP;
- }
- b.right = b.left + BUTTON_WIDTH;
- offsetX = b.right;
- }
-// for (int i = 0; i < buttons.size(); i++) {
-// x1[i] = offsetX;
-// if (i == 2) x1[i] += BUTTON_GAP;
-// x2[i] = x1[i] + BUTTON_WIDTH;
-// offsetX = x2[i];
-// }
- }
- Graphics g = offscreen.getGraphics();
- Graphics2D g2 = (Graphics2D) g;
-
- if (Toolkit.isRetina()) {
- // scale everything 2x, will be scaled down when drawn to the screen
- g2.scale(2, 2);
- } else {
- // don't anti-alias text in retina mode
- g2.setRenderingHint(RenderingHints.KEY_TEXT_ANTIALIASING,
- RenderingHints.VALUE_TEXT_ANTIALIAS_ON);
- }
-
- g.setColor(bgcolor); //getBackground());
- g.fillRect(0, 0, width, height);
-
-// for (int i = 0; i < buttonCount; i++) {
-// g.drawImage(stateImage[i], x1[i], y1, null);
-// }
- for (Button b : buttons) {
- g.drawImage(b.stateImage, b.left, TOP, BUTTON_WIDTH, BUTTON_HEIGHT, null);
- }
-
- g.setColor(statusColor);
- g.setFont(statusFont);
-
- // If I ever find the guy who wrote the Java2D API, I will hurt him.
-// Graphics2D g2 = (Graphics2D) g;
-// FontRenderContext frc = g2.getFontRenderContext();
-// float statusW = (float) statusFont.getStringBounds(status, frc).getWidth();
-// float statusX = (getSize().width - statusW) / 2;
-// g2.drawString(status, statusX, statusY);
-
-// if (currentRollover != -1) {
- if (rollover != null) {
- int statusY = (BUTTON_HEIGHT + g.getFontMetrics().getAscent()) / 2;
- //String status = shiftPressed ? titleShift[currentRollover] : title[currentRollover];
- String status = shiftPressed ? rollover.titleShift : rollover.title;
- g.drawString(status, buttons.size() * BUTTON_WIDTH + 3 * BUTTON_GAP, statusY);
- }
-
-// Color modeButtonColor;
-// Font modeTextFont;
-// Color modeTextColor;
- g.setFont(modeTextFont);
- FontMetrics metrics = g.getFontMetrics();
- int modeH = metrics.getAscent();
- int modeW = metrics.stringWidth(modeTitle);
- final int modeGapH = 6;
- final int modeGapV = 3;
- modeX2 = getWidth() - 16;
- modeX1 = modeX2 - (modeGapH + modeW + modeGapH);
- modeY1 = (getHeight() - modeH)/2 - modeGapV;
- modeY2 = modeY1 + modeH + modeGapV*2;
-// g.setColor(modeButtonColor);
-// g.fillRect(modeX1, modeY1, modeX2 - modeX1, modeY2 - modeY1);
-// g.setColor(modeTextColor);
-// g.drawString(modeTitle, modeX1 + modeGapH, modeY2 - modeGapV);
- g.setColor(modeButtonColor);
- g.drawRect(modeX1, modeY1, modeX2 - modeX1, modeY2 - modeY1);
- g.drawString(modeTitle, modeX1 + modeGapH, modeY2 - modeGapV);
-
- screen.drawImage(offscreen, 0, 0, size.width, size.height, null);
-
- // dim things out when not enabled (not currently in use)
- if (!isEnabled()) {
- screen.setColor(new Color(0, 0, 0, 100));
- screen.fillRect(0, 0, getWidth(), getHeight());
- }
- }
-
-
- protected void checkRollover(int x, int y) {
- Button over = findSelection(x, y);
- if (over != null) {
- // if (state[sel] != ACTIVE) {
- if (over.state != ACTIVE) {
- // setState(sel, ROLLOVER, true);
- over.setState(ROLLOVER, true);
- // currentRollover = sel;
- rollover = over;
- }
- }
- }
-
-
- public void mouseMoved(MouseEvent e) {
- if (!isEnabled()) return;
-
- // ignore mouse events before the first paintComponent() call
- if (offscreen == null) return;
-
- // TODO this isn't quite right, since it's gonna kill rollovers too
-// if (state[OPEN] != INACTIVE) {
-// // avoid flicker, since there should be another update event soon
-// setState(OPEN, INACTIVE, false);
-// }
-
- int x = e.getX();
- int y = e.getY();
-
- if (rollover != null) {
- // if ((x > x1[currentRollover]) && (y > y1) &&
- // (x < x2[currentRollover]) && (y < y2)) {
- if (y > TOP && y < BOTTOM && x > rollover.left && x < rollover.right) {
- // nothing has changed
- return;
-
- } else {
- if (rollover.state == ROLLOVER) {
- rollover.setState(INACTIVE, true);
- }
- rollover = null;
- }
- }
- checkRollover(x, y);
- }
-
-
- public void mouseDragged(MouseEvent e) { }
-
-
-// public void handleMouse(MouseEvent e) {
-// int x = e.getX();
-// int y = e.getY();
-//
-//// if (currentRollover != -1) {
-// if (rollover != null) {
-//// if ((x > x1[currentRollover]) && (y > y1) &&
-//// (x < x2[currentRollover]) && (y < y2)) {
-// if (y > y1 && y < y2 && x > rollover.left && x < rollover.right) {
-// // nothing has changed
-// return;
-//
-// } else {
-//// setState(currentRollover, INACTIVE, true);
-// rollover.setState(INACTIVE, true);
-//// currentRollover = -1;
-// rollover = null;
-// }
-// }
-//// int sel = findSelection(x, y);
-// Button over = findSelection(x, y);
-// if (over != null) {
-//// if (state[sel] != ACTIVE) {
-// if (over.state != ACTIVE) {
-//// setState(sel, ROLLOVER, true);
-// over.setState(ROLLOVER, true);
-//// currentRollover = sel;
-// rollover = over;
-// }
-// }
-// }
-
-
-// private int findSelection(int x, int y) {
-// // if app loads slowly and cursor is near the buttons
-// // when it comes up, the app may not have time to load
-// if ((x1 == null) || (x2 == null)) return -1;
-//
-// for (int i = 0; i < buttonCount; i++) {
-// if ((y > y1) && (x > x1[i]) &&
-// (y < y2) && (x < x2[i])) {
-// //System.out.println("sel is " + i);
-// return i;
-// }
-// }
-// return -1;
-// }
-
-
- private Button findSelection(int x, int y) {
- // if app loads slowly and cursor is near the buttons
- // when it comes up, the app may not have time to load
- if (offscreen != null && y > TOP && y < BOTTOM) {
- for (Button b : buttons) {
- if (x > b.left && x < b.right) {
- return b;
- }
- }
- }
- return null;
- }
-
-
-// private void setState(int slot, int newState, boolean updateAfter) {
-// if (buttonImages != null) {
-// state[slot] = newState;
-// stateImage[slot] = buttonImages[which[slot]][newState];
-// if (updateAfter) {
-// repaint();
-// }
-// }
-// }
-
-
- public void mouseEntered(MouseEvent e) {
-// handleMouse(e);
- }
-
-
- public void mouseExited(MouseEvent e) {
-// // if the 'open' popup menu is visible, don't register this,
-// // because the popup being set visible will fire a mouseExited() event
-// if ((popup != null) && popup.isVisible()) return;
- // this might be better
- if (e.getComponent() != this) {
- return;
- }
-
- // TODO another weird one.. come back to this
-// if (state[OPEN] != INACTIVE) {
-// setState(OPEN, INACTIVE, true);
-// }
-// handleMouse(e);
-
- // there is no more rollover, make sure that the rollover text goes away
-// currentRollover = -1;
- if (rollover != null) {
- if (rollover.state == ROLLOVER) {
- rollover.setState(INACTIVE, true);
- }
- rollover = null;
- }
- }
-
-// int wasDown = -1;
-
-
- public void mousePressed(MouseEvent e) {
- // ignore mouse presses so hitting 'run' twice doesn't cause problems
- if (isEnabled()) {
- int x = e.getX();
- int y = e.getY();
- if (x > modeX1 && x < modeX2 && y > modeY1 && y < modeY2) {
- JPopupMenu popup = editor.getModeMenu().getPopupMenu();
- popup.show(this, x, y);
- }
-
- // Need to reset the rollover here. If the window isn't active,
- // the rollover wouldn't have been updated.
- // http://code.google.com/p/processing/issues/detail?id=561
- checkRollover(x, y);
- if (rollover != null) {
- //handlePressed(rollover);
- handlePressed(e, buttons.indexOf(rollover));
- }
- }
- }
-
-
- public void mouseClicked(MouseEvent e) { }
-
-
- public void mouseReleased(MouseEvent e) { }
-
-
-// public void handlePressed(Button b) {
-// handlePressed(buttons.indexOf(b));
-// }
-
-
- abstract public void handlePressed(MouseEvent e, int index);
-
-
- /**
- * Set a particular button to be active.
- */
- public void activate(int what) {
-// setState(what, ACTIVE, true);
- buttons.get(what).setState(ACTIVE, true);
- }
-
-
- /**
- * Set a particular button to be active.
- */
- public void deactivate(int what) {
-// setState(what, INACTIVE, true);
- buttons.get(what).setState(INACTIVE, true);
- }
-
-
- public Dimension getPreferredSize() {
- return getMinimumSize();
- }
-
-
- public Dimension getMinimumSize() {
- return new Dimension((buttons.size() + 1)*BUTTON_WIDTH, BUTTON_HEIGHT);
- }
-
-
- public Dimension getMaximumSize() {
- return new Dimension(3000, BUTTON_HEIGHT);
- }
-
-
- public void keyPressed(KeyEvent e) {
- if (e.getKeyCode() == KeyEvent.VK_SHIFT) {
- shiftPressed = true;
- repaint();
- }
- }
-
-
- public void keyReleased(KeyEvent e) {
- if (e.getKeyCode() == KeyEvent.VK_SHIFT) {
- shiftPressed = false;
- repaint();
- }
- }
-
-
- public void keyTyped(KeyEvent e) { }
-
-
- // . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
-
-
- public void addButton(String title, String shiftTitle, Image[] images, boolean gap) {
- Button b = new Button(title, shiftTitle, images, gap);
- buttons.add(b);
- }
-
-
- public class Button {
- /** Button's description. */
- String title;
- /** Description of alternate behavior when shift is down. */
- String titleShift;
- /** Three state images. */
- Image[] images;
- /** Current state value, one of ACTIVE, INACTIVE, ROLLOVER. */
- int state;
- /** Current state image. */
- Image stateImage;
- /** Left and right coordinates. */
- int left, right;
- /** Whether there's a gap before this button. */
- boolean gap;
-
-// JPopupMenu popup;
-// JMenu menu;
-
-
- public Button(String title, String titleShift, Image[] images, boolean gap) {
- this.title = title;
- this.titleShift = titleShift;
- this.images = images;
- this.gap = gap;
-
- state = INACTIVE;
- stateImage = images[INACTIVE];
- }
-
-
-// public void setMenu(JMenu menu) {
-// this.menu = menu;
-// }
-
-
- public void setState(int newState, boolean updateAfter) {
- state = newState;
- stateImage = images[newState];
- if (updateAfter) {
- repaint();
- }
- }
- }
-}
\ No newline at end of file
diff --git a/app/src/processing/app/FindReplace.java b/app/src/processing/app/FindReplace.java
deleted file mode 100644
index 9ee94c0c60..0000000000
--- a/app/src/processing/app/FindReplace.java
+++ /dev/null
@@ -1,468 +0,0 @@
-/* -*- mode: java; c-basic-offset: 2; indent-tabs-mode: nil -*- */
-
-/*
- Part of the Processing project - http://processing.org
-
- Copyright (c) 2004-12 Ben Fry and Casey Reas
- Copyright (c) 2001-04 Massachusetts Institute of Technology
-
- This program is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation, version 2.
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with this program; if not, write to the Free Software Foundation,
- Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-*/
-
-package processing.app;
-
-import java.awt.*;
-import java.awt.event.*;
-
-import javax.swing.*;
-
-
-/**
- * Find & Replace window for the Processing editor.
- */
-public class FindReplace extends JFrame {
-
- static final int EDGE = Base.isMacOS() ? 20 : 13;
- static final int SMALL = 6;
- // 12 is correct for Mac, other numbers may be required for other platforms
- static final int BUTTON_GAP = 12;
-
- Editor editor;
-
- JTextField findField;
- JTextField replaceField;
- static String findString;
- static String replaceString;
-
- JButton replaceButton;
- JButton replaceAllButton;
- JButton replaceAndFindButton;
- JButton previousButton;
- JButton findButton;
-
- JCheckBox ignoreCaseBox;
- static boolean ignoreCase = true;
-
- JCheckBox allTabsBox;
- static boolean allTabs = false;
-
- JCheckBox wrapAroundBox;
- static boolean wrapAround = true;
-
-
- public FindReplace(Editor editor) {
- super("Find");
- setResizable(false);
- this.editor = editor;
-
- Container pain = getContentPane();
- pain.setLayout(null);
-
- JLabel findLabel = new JLabel("Find:");
- JLabel replaceLabel = new JLabel("Replace with:");
- Dimension labelDimension = replaceLabel.getPreferredSize();
-
- pain.add(findLabel);
- pain.add(replaceLabel);
-
- pain.add(findField = new JTextField());
- pain.add(replaceField = new JTextField());
- int fieldHeight = findField.getPreferredSize().height;
-
- if (findString != null) findField.setText(findString);
- if (replaceString != null) replaceField.setText(replaceString);
-
- ignoreCaseBox = new JCheckBox("Ignore Case");
- ignoreCaseBox.addActionListener(new ActionListener() {
- public void actionPerformed(ActionEvent e) {
- ignoreCase = ignoreCaseBox.isSelected();
- }
- });
- ignoreCaseBox.setSelected(ignoreCase);
- pain.add(ignoreCaseBox);
-
- allTabsBox = new JCheckBox("All Tabs");
- allTabsBox.addActionListener(new ActionListener() {
- public void actionPerformed(ActionEvent e) {
- allTabs = allTabsBox.isSelected();
- }
- });
- allTabsBox.setSelected(allTabs);
- allTabsBox.setEnabled(true);
- pain.add(allTabsBox);
-
- wrapAroundBox = new JCheckBox("Wrap Around");
- wrapAroundBox.addActionListener(new ActionListener() {
- public void actionPerformed(ActionEvent e) {
- wrapAround = wrapAroundBox.isSelected();
- }
- });
- wrapAroundBox.setSelected(wrapAround);
- pain.add(wrapAroundBox);
-
- JPanel buttons = new JPanel();
- buttons.setLayout(new FlowLayout(FlowLayout.CENTER,BUTTON_GAP, 0));
-
- replaceAllButton = new JButton("Replace All");
- replaceButton = new JButton("Replace");
- replaceAndFindButton = new JButton("Replace & Find");
- previousButton = new JButton("Previous");
- findButton = new JButton("Find");
-
- // ordering is different on mac versus pc
- if (Base.isMacOS()) {
- buttons.add(replaceAllButton);
- buttons.add(replaceButton);
- buttons.add(replaceAndFindButton);
- buttons.add(previousButton);
- buttons.add(findButton);
-
- // to fix ugliness.. normally macosx java 1.3 puts an
- // ugly white border around this object, so turn it off.
- buttons.setBorder(null);
-
- } else {
- buttons.add(findButton);
- buttons.add(previousButton);
- buttons.add(replaceAndFindButton);
- buttons.add(replaceButton);
- buttons.add(replaceAllButton);
- }
- pain.add(buttons);
- setFound(false);
-
- Dimension buttonsDimension = buttons.getPreferredSize();
- int visibleButtonWidth = buttonsDimension.width - 2 * BUTTON_GAP;
- int fieldWidth = visibleButtonWidth - (labelDimension.width + SMALL);
-
- // +1 since it's better to tend downwards
- int yoff = (1 + fieldHeight - labelDimension.height) / 2;
-
- int ypos = EDGE;
-
- int labelWidth = findLabel.getPreferredSize().width;
- findLabel.setBounds(EDGE + (labelDimension.width-labelWidth), ypos + yoff, // + yoff was added to the wrong field
- labelWidth, labelDimension.height);
- findField.setBounds(EDGE + labelDimension.width + SMALL, ypos,
- fieldWidth, fieldHeight);
-
- ypos += fieldHeight + SMALL;
-
- labelWidth = replaceLabel.getPreferredSize().width;
- replaceLabel.setBounds(EDGE + (labelDimension.width-labelWidth), ypos + yoff,
- labelWidth, labelDimension.height);
- replaceField.setBounds(EDGE + labelDimension.width + SMALL, ypos,
- fieldWidth, fieldHeight);
-
- ypos += fieldHeight + SMALL;
-
- final int third = (fieldWidth - SMALL*2) / 3;
- ignoreCaseBox.setBounds(EDGE + labelDimension.width + SMALL,
- ypos,
- third, fieldHeight);
-
- allTabsBox.setBounds(EDGE + labelDimension.width + SMALL + third + SMALL,
- ypos,
- third, fieldHeight);
-
- //wrapAroundBox.setBounds(EDGE + labelDimension.width + SMALL + (fieldWidth-SMALL)/2 + SMALL,
- wrapAroundBox.setBounds(EDGE + labelDimension.width + SMALL + third*2 + SMALL*2,
- ypos,
- third, fieldHeight);
-
- ypos += fieldHeight + SMALL;
-
- buttons.setBounds(EDGE-BUTTON_GAP, ypos,
- buttonsDimension.width, buttonsDimension.height);
-
- ypos += buttonsDimension.height + EDGE;
-
- int wide = visibleButtonWidth + EDGE*2;
- int high = ypos;
-
- pack();
- Insets insets = getInsets();
- setSize(wide + insets.left + insets.right,high + insets.top + insets.bottom);
-
- setLocationRelativeTo(null); // center
-
- replaceButton.addActionListener(new ActionListener() {
- public void actionPerformed(ActionEvent e) {
- replace();
- }
- });
-
- replaceAllButton.addActionListener(new ActionListener() {
- public void actionPerformed(ActionEvent e) {
- replaceAll();
- }
- });
-
- replaceAndFindButton.addActionListener(new ActionListener() {
- public void actionPerformed(ActionEvent e) {
- replaceAndFindNext();
- }
- });
-
- findButton.addActionListener(new ActionListener() {
- public void actionPerformed(ActionEvent e) {
- findNext();
- }
- });
-
- previousButton.addActionListener(new ActionListener() {
- public void actionPerformed(ActionEvent e) {
- findPrevious();
- }
- });
-
- // you mustn't replace what you haven't found, my son
- // semantics of replace are "replace the current selection with the replace field"
- // so whether we have found before or not is irrelevent
- // replaceButton.setEnabled(false);
- // replaceFindButton.setEnabled(false);
-
- // make the find button the blinky default
- getRootPane().setDefaultButton(findButton);
-
- setDefaultCloseOperation(WindowConstants.DO_NOTHING_ON_CLOSE);
- addWindowListener(new WindowAdapter() {
- public void windowClosing(WindowEvent e) {
- handleClose();
- }
- });
- Toolkit.registerWindowCloseKeys(getRootPane(), new ActionListener() {
- public void actionPerformed(ActionEvent actionEvent) {
- //hide();
- handleClose();
- }
- });
- Toolkit.setIcon(this);
-
- // hack to to get first field to focus properly on osx
- addWindowListener(new WindowAdapter() {
- public void windowActivated(WindowEvent e) {
- //System.out.println("activating");
- /*boolean ok =*/ findField.requestFocusInWindow();
- //System.out.println("got " + ok);
- findField.selectAll();
- }
- });
- }
-
-
- public void handleClose() {
- //System.out.println("handling close now");
- findString = findField.getText();
- replaceString = replaceField.getText();
-
- // this object should eventually become dereferenced
- setVisible(false);
- }
-
-
- // look for the next instance of the find string to be found
- // once found, select it (and go to that line)
- private boolean find(boolean wrap, boolean backwards) {
- String searchTerm = findField.getText();
-
- // this will catch "find next" being called when no search yet
- if (searchTerm.length() != 0) {
- String text = editor.getText();
-
- // Started work on find/replace across tabs. These two variables store
- // the original tab and selection position so that it knew when to stop
- // rotating through.
- Sketch sketch = editor.getSketch();
- int tabIndex = sketch.getCurrentCodeIndex();
-// int selIndex = backwards ?
-// editor.getSelectionStart() : editor.getSelectionStop();
-
- if (ignoreCase) {
- searchTerm = searchTerm.toLowerCase();
- text = text.toLowerCase();
- }
-
- int nextIndex;
- if (!backwards) {
- //int selectionStart = editor.textarea.getSelectionStart();
- int selectionEnd = editor.getSelectionStop();
-
- nextIndex = text.indexOf(searchTerm, selectionEnd);
- if (nextIndex == -1 && wrap && !allTabs) {
- // if wrapping, a second chance is ok, start from beginning
- nextIndex = text.indexOf(searchTerm, 0);
-
- } else if (nextIndex == -1 && allTabs) {
- // For searching in all tabs, wrapping always happens.
-
- int tempIndex = tabIndex;
- // Look for searchterm in all tabs.
- while (tabIndex <= sketch.getCodeCount() - 1) {
- if (tabIndex == sketch.getCodeCount() - 1) {
- // System.out.println("wrapping.");
- tabIndex = -1;
- } else if (tabIndex == sketch.getCodeCount() - 1) {
- break;
- }
-
- text = sketch.getCode(tabIndex + 1).getProgram();
- tabIndex++;
- if (ignoreCase) {
- text = text.toLowerCase();
- }
- nextIndex = text.indexOf(searchTerm, 0);
-
- if (nextIndex != -1 || tabIndex == tempIndex) {
- break;
- }
- }
-
- // searchterm wasn't found in any of the tabs.
- // No tab switching should happen, restore tabIndex
- if (nextIndex == -1) {
- tabIndex = tempIndex;
- }
- }
- } else {
- //int selectionStart = editor.textarea.getSelectionStart();
- int selectionStart = editor.getSelectionStart()-1;
-
- if (selectionStart >= 0) {
- nextIndex = text.lastIndexOf(searchTerm, selectionStart);
- } else {
- nextIndex = -1;
- }
- if (wrap && !allTabs && nextIndex == -1) {
- // if wrapping, a second chance is ok, start from the end
- nextIndex = text.lastIndexOf(searchTerm);
-
- } else if (nextIndex == -1 && allTabs) {
- int tempIndex = tabIndex;
- // Look for search term in previous tabs.
- while (tabIndex >= 0) {
- if (tabIndex == 0) {
- //System.out.println("wrapping.");
- tabIndex = sketch.getCodeCount();
- } else if (tabIndex == 0) {
- break;
- }
- text = sketch.getCode(tabIndex - 1).getProgram();
- tabIndex--;
- if (ignoreCase) {
- text = text.toLowerCase();
- }
- nextIndex = text.lastIndexOf(searchTerm);
-
- if (nextIndex != -1 || tabIndex == tempIndex) {
- break;
- }
- }
-
- // search term wasn't found in any of the tabs.
- // No tab switching should happen, restore tabIndex
- if (nextIndex == -1) {
- tabIndex = tempIndex;
- }
- }
- }
-
- if (nextIndex != -1) {
- if (allTabs) {
- sketch.setCurrentCode(tabIndex);
- }
- editor.setSelection(nextIndex, nextIndex + searchTerm.length());
- } else {
- //Toolkit.getDefaultToolkit().beep();
- }
- if (nextIndex != -1) {
- setFound(true);
- return true;
- }
- }
- setFound(false);
- return false;
- }
-
-
- protected void setFound(boolean found) {
- replaceButton.setEnabled(found);
- replaceAndFindButton.setEnabled(found);
- }
-
-
- /**
- * Replace the current selection with whatever's in the
- * replacement text field.
- */
- public void replace() {
- editor.setSelectedText(replaceField.getText());
- editor.getSketch().setModified(true); // TODO is this necessary?
- setFound(false);
- }
-
-
- /**
- * Replace the current selection with whatever's in the
- * replacement text field, and then find the next match
- */
- public void replaceAndFindNext() {
- replace();
- findNext();
- }
-
-
- /**
- * Replace everything that matches by doing find and replace
- * alternately until nothing more found.
- */
- public void replaceAll() {
- // move to the beginning
- editor.setSelection(0, 0);
-
- boolean foundAtLeastOne = false;
- while (true) {
- if (find(false, false)) {
- foundAtLeastOne = true;
- replace();
- } else {
- break;
- }
- }
- if (!foundAtLeastOne) {
- Toolkit.beep();
- }
- setFound(false);
- }
-
-
- public void setFindText(String t) {
- findField.setText(t);
- findString = t;
- }
-
-
- public void findNext() {
- if (!find(wrapAround, false)) {
- Toolkit.beep();
- }
- }
-
-
- public void findPrevious() {
- if (!find(wrapAround, true)) {
- Toolkit.beep();
- }
- }
-}
diff --git a/app/src/processing/app/Language.java b/app/src/processing/app/Language.java
new file mode 100644
index 0000000000..06be82fc5a
--- /dev/null
+++ b/app/src/processing/app/Language.java
@@ -0,0 +1,380 @@
+/* -*- mode: java; c-basic-offset: 2; indent-tabs-mode: nil -*- */
+
+/*
+ Part of the Processing project - http://processing.org
+
+ Copyright (c) 2014 The Processing Foundation
+
+ This program is free software; you can redistribute it and/or
+ modify it under the terms of the GNU General Public License
+ version 2, as published by the Free Software Foundation.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software Foundation,
+ Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+*/
+
+package processing.app;
+
+import java.io.*;
+import java.util.*;
+
+import processing.core.PApplet;
+
+
+/**
+ * Internationalization (i18n)
+ */
+public class Language {
+ // Store the language information in a file separate from the preferences,
+ // because preferences need the language on load time.
+ static protected final String PREF_FILE = "language.txt";
+ static protected final File prefFile = Base.getSettingsFile(PREF_FILE);
+
+ /** Single instance of this Language class */
+ static private volatile Language instance;
+
+ /** The system language */
+ private String language;
+
+ /** Available languages */
+ private HashMap languages;
+
+ private LanguageBundle bundle;
+
+
+ private Language() {
+ String systemLanguage = Locale.getDefault().getLanguage();
+ language = loadLanguage();
+ boolean writePrefs = false;
+
+ if (language == null) {
+ language = systemLanguage;
+ writePrefs = true;
+ }
+
+ // Set available languages
+ languages = new HashMap