igeo.p
Class PIGraphicsGL2

java.lang.Object
  extended by processing.core.PImage
      extended by processing.core.PGraphics
          extended by igeo.p.PIGraphicsGL2
All Implemented Interfaces:
java.lang.Cloneable, java.util.EventListener, javax.media.opengl.GLEventListener, processing.core.PConstants

public class PIGraphicsGL2
extends processing.core.PGraphics
implements javax.media.opengl.GLEventListener

A child class of Processing's PGraphic to draw on Processing using OpenGL. This class also manages the IServer to manage all the objects in iGeo.

Author:
Satoru Sugihara

Field Summary
 boolean finished
           
 javax.media.opengl.awt.GLCanvas glCanvas
           
 javax.media.opengl.glu.GLU glu
           
 IGraphicsGL igg
           
 boolean initialized
           
 boolean looping
           
 com.jogamp.opengl.util.awt.Overlay overlay
          To draw Java2D graphic over OpenGL graphic.
static java.awt.Color overlayBG
          Background color of overlay should be transparent.
 boolean overwritePAppletFinish
          To show iGeo correctly in Processing's basic mode, this needs to be true.
 boolean overwritePAppletLoop
          To show iGeo correctly in Processing's basic mode, this needs to be true.
 IPanel panel
           
 
Fields inherited from class processing.core.PGraphics
A, AB, AG, ambientB, ambientColor, ambientG, ambientR, AR, autoNormal, B, backgroundA, backgroundAi, backgroundAlpha, backgroundB, backgroundBi, backgroundColor, backgroundG, backgroundGi, backgroundR, backgroundRi, BEEN_LIT, bezierBasisInverse, bezierBasisMatrix, bezierDetail, bezierDrawMatrix, bezierInited, cacheMap, calcA, calcAi, calcAlpha, calcB, calcBi, calcColor, calcG, calcGi, calcR, calcRi, canvas, colorMode, colorModeA, colorModeX, colorModeY, colorModeZ, cosLUT, curveBasisMatrix, curveDetail, curveDrawMatrix, curveInited, curveTightness, curveToBezierMatrix, curveVertexCount, curveVertices, DA, DB, DEFAULT_STROKE_CAP, DEFAULT_STROKE_JOIN, DEFAULT_STROKE_WEIGHT, DEFAULT_VERTICES, DG, DR, EB, edge, EDGE, EG, ellipseMode, emissiveB, emissiveColor, emissiveG, emissiveR, ER, fill, fillA, fillAi, fillAlpha, fillB, fillBi, fillColor, fillG, fillGi, fillR, fillRi, G, HAS_NORMAL, hints, image, imageMode, NORMAL_MODE_AUTO, NORMAL_MODE_SHAPE, NORMAL_MODE_VERTEX, normalMode, normalX, normalY, normalZ, NX, NY, NZ, path, pixelCount, primarySurface, quality, R, raw, reapplySettings, rectMode, SA, SB, setAmbient, settingsInited, SG, shape, shapeMode, SHINE, shininess, SINCOS_LENGTH, SINCOS_PRECISION, sinLUT, smooth, SPB, specularB, specularColor, specularG, specularR, SPG, sphereDetailU, sphereDetailV, sphereX, sphereY, sphereZ, SPR, SR, stroke, strokeA, strokeAi, strokeAlpha, strokeB, strokeBi, strokeCap, strokeColor, strokeG, strokeGi, strokeJoin, strokeR, strokeRi, strokeWeight, SW, textAlign, textAlignY, textBreakCount, textBreakStart, textBreakStop, textBuffer, textFont, textLeading, textMode, textSize, textureImage, textureMode, textureU, textureV, textWidthBuffer, tint, tintA, tintAi, tintAlpha, tintB, tintBi, tintColor, tintG, tintGi, tintR, tintRi, TX, TY, TZ, U, V, VERTEX_FIELD_COUNT, vertexCount, vertices, VW, VX, VY, VZ, warnings
 
Fields inherited from class processing.core.PImage
ALPHA_MASK, BLUE_MASK, format, GREEN_MASK, height, loaded, modified, mx1, mx2, my1, my2, parent, pixels, RED_MASK, saveImageFormats, width
 
Fields inherited from interface processing.core.PConstants
ADD, ALPHA, ALT, AMBIENT, ARC, ARGB, ARROW, BACKSPACE, BASELINE, BEVEL, BEZIER_VERTEX, BLEND, BLUR, BOTTOM, BOX, BREAK, BURN, CENTER, CHATTER, CHORD, CLAMP, CLOSE, CODED, COMPLAINT, CONTROL, CORNER, CORNERS, CROSS, CURVE_VERTEX, CUSTOM, DARKEST, DEG_TO_RAD, DELETE, DIAMETER, DIFFERENCE, DILATE, DIRECTIONAL, DISABLE_DEPTH_MASK, DISABLE_DEPTH_SORT, DISABLE_DEPTH_TEST, DISABLE_NATIVE_FONTS, DISABLE_OPENGL_ERRORS, DISABLE_OPTIMIZED_STROKE, DISABLE_RETINA_PIXELS, DISABLE_STROKE_PERSPECTIVE, DISABLE_STROKE_PURE, DISABLE_TEXTURE_MIPMAPS, DODGE, DOWN, DXF, ELLIPSE, ENABLE_DEPTH_MASK, ENABLE_DEPTH_SORT, ENABLE_DEPTH_TEST, ENABLE_NATIVE_FONTS, ENABLE_OPENGL_ERRORS, ENABLE_OPTIMIZED_STROKE, ENABLE_RETINA_PIXELS, ENABLE_STROKE_PERSPECTIVE, ENABLE_STROKE_PURE, ENABLE_TEXTURE_MIPMAPS, ENTER, EPSILON, ERODE, ERROR_BACKGROUND_IMAGE_FORMAT, ERROR_BACKGROUND_IMAGE_SIZE, ERROR_PUSHMATRIX_OVERFLOW, ERROR_PUSHMATRIX_UNDERFLOW, ERROR_TEXTFONT_NULL_PFONT, ESC, EXCLUSION, GIF, GRAY, GROUP, HALF_PI, HAND, HARD_LIGHT, HINT_COUNT, HSB, IMAGE, INVERT, JAVA2D, JPEG, LANDSCAPE, LEFT, LIGHTEST, LINE, LINE_LOOP, LINE_STRIP, LINES, LINUX, MACOSX, MAX_FLOAT, MAX_INT, MIN_FLOAT, MIN_INT, MITER, MODEL, MODELVIEW, MOVE, MULTIPLY, NORMAL, OPAQUE, OPEN, OPENGL, ORTHOGRAPHIC, OTHER, OVERLAY, P2D, P3D, PATH, PDF, PERSPECTIVE, PI, PIE, platformNames, POINT, POINTS, POLYGON, PORTRAIT, POSTERIZE, PROBLEM, PROJECT, PROJECTION, QUAD, QUAD_BEZIER_VERTEX, QUAD_STRIP, QUADS, QUARTER_PI, RAD_TO_DEG, RADIUS, RECT, REPEAT, REPLACE, RETURN, RGB, RIGHT, ROUND, SCREEN, SHAPE, SHIFT, SOFT_LIGHT, SPHERE, SPOT, SQUARE, SUBTRACT, TAB, TARGA, TAU, TEXT, THIRD_PI, THRESHOLD, TIFF, TOP, TRIANGLE, TRIANGLE_FAN, TRIANGLE_STRIP, TRIANGLES, TWO_PI, UP, VERTEX, WAIT, WHITESPACE, WINDOWS, X, Y, Z
 
Constructor Summary
PIGraphicsGL2()
           
 
Method Summary
 void display(javax.media.opengl.GLAutoDrawable drawable)
           
 void dispose(javax.media.opengl.GLAutoDrawable drawable)
           
 void init(javax.media.opengl.GLAutoDrawable drawable)
           
 void initGraphics()
           
 void requestDraw()
           
 void reshape(javax.media.opengl.GLAutoDrawable drawable, int x, int y, int width, int height)
           
 void setOverlay()
          Drawing all the iGeo objects through IPanel.
 void setSize(int w, int h)
           
 
Methods inherited from class processing.core.PGraphics
allocate, alpha, ambient, ambient, ambient, ambientFromCalc, ambientLight, ambientLight, applyMatrix, applyMatrix, applyMatrix, applyMatrix, applyMatrix, arc, arc, arcImpl, background, background, background, background, background, background, background, backgroundFromCalc, backgroundImpl, backgroundImpl, beginCamera, beginContour, beginDraw, beginPGL, beginRaw, beginShape, beginShape, bezier, bezier, bezierDetail, bezierInit, bezierInitCheck, bezierPoint, bezierTangent, bezierVertex, bezierVertex, bezierVertexCheck, bezierVertexCheck, blendMode, blue, box, box, brightness, camera, camera, canDraw, checkSettings, clear, clip, clipImpl, color, color, color, color, color, color, color, color, color, colorCalc, colorCalc, colorCalc, colorCalc, colorCalc, colorCalc, colorCalcARGB, colorMode, colorMode, colorMode, colorMode, createShape, createShape, createShape, createShape, curve, curve, curveDetail, curveInit, curveInitCheck, curvePoint, curveTangent, curveTightness, curveVertex, curveVertex, curveVertexCheck, curveVertexCheck, curveVertexSegment, curveVertexSegment, defaultFontOrDeath, defaultFontOrDeath, defaultSettings, directionalLight, displayable, dispose, edge, ellipse, ellipseImpl, ellipseMode, emissive, emissive, emissive, emissiveFromCalc, endCamera, endContour, endDraw, endPGL, endRaw, endShape, endShape, fill, fill, fill, fill, fill, fill, fillFromCalc, filter, flush, frustum, getCache, getMatrix, getMatrix, getMatrix, getRaw, getStyle, getStyle, green, haveRaw, hint, hue, image, image, image, imageImpl, imageMode, is2D, is3D, isGL, lerpColor, lerpColor, lightFalloff, lights, lightSpecular, line, line, loadShader, loadShader, loadShape, loadShape, modelX, modelY, modelZ, noClip, noFill, noLights, normal, noSmooth, noStroke, noTexture, noTint, ortho, ortho, ortho, perspective, perspective, point, point, pointLight, popMatrix, popStyle, printCamera, printMatrix, printProjection, pushMatrix, pushStyle, quad, quadraticVertex, quadraticVertex, reapplySettings, rect, rect, rect, rectImpl, rectImpl, rectMode, red, removeCache, requestFocus, resetMatrix, resetShader, resetShader, rotate, rotate, rotateX, rotateY, rotateZ, saturation, scale, scale, scale, screenX, screenX, screenY, screenY, screenZ, setCache, setFrameRate, setMatrix, setMatrix, setMatrix, setParent, setPath, setPrimary, shader, shader, shape, shape, shape, shape, shape, shapeMode, shearX, shearY, shininess, showDepthWarning, showDepthWarningXYZ, showException, showMethodWarning, showMissingWarning, showVariationWarning, showWarning, showWarning, smooth, smooth, specular, specular, specular, specularFromCalc, sphere, sphereDetail, sphereDetail, splineForward, spotLight, stroke, stroke, stroke, stroke, stroke, stroke, strokeCap, strokeFromCalc, strokeJoin, strokeWeight, style, text, text, text, text, text, text, text, text, text, text, text, textAlign, textAlign, textAscent, textCharImpl, textCharModelImpl, textCharScreenImpl, textDescent, textFont, textFont, textLeading, textLineAlignImpl, textLineImpl, textMode, textModeCheck, textSentence, textSentenceBreak, textSize, texture, textureMode, textureWrap, textWidth, textWidth, textWidth, textWidthImpl, tint, tint, tint, tint, tint, tint, tintFromCalc, translate, translate, triangle, vertex, vertex, vertex, vertex, vertex, vertexCheck, vertexTexture
 
Methods inherited from class processing.core.PImage
blend, blend, blendColor, blurAlpha, blurARGB, blurRGB, buildBlurKernel, checkAlpha, clone, copy, copy, dilate, filter, filter, get, get, get, getImage, getImpl, getModifiedX1, getModifiedX2, getModifiedY1, getModifiedY2, getNative, init, isLoaded, isModified, loadPixels, loadTIFF, mask, mask, resize, save, saveImageIO, saveTGA, saveTIFF, set, set, setImpl, setLoaded, setLoaded, setModified, setModified, updatePixels, updatePixels
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

panel

public IPanel panel

igg

public IGraphicsGL igg

overlay

public com.jogamp.opengl.util.awt.Overlay overlay
To draw Java2D graphic over OpenGL graphic.


overlayBG

public static java.awt.Color overlayBG
Background color of overlay should be transparent.


overwritePAppletFinish

public boolean overwritePAppletFinish
To show iGeo correctly in Processing's basic mode, this needs to be true.


finished

public boolean finished

overwritePAppletLoop

public boolean overwritePAppletLoop
To show iGeo correctly in Processing's basic mode, this needs to be true.


looping

public boolean looping

glCanvas

public javax.media.opengl.awt.GLCanvas glCanvas

initialized

public boolean initialized

glu

public javax.media.opengl.glu.GLU glu
Constructor Detail

PIGraphicsGL2

public PIGraphicsGL2()
Method Detail

initGraphics

public void initGraphics()

init

public void init(javax.media.opengl.GLAutoDrawable drawable)
Specified by:
init in interface javax.media.opengl.GLEventListener

display

public void display(javax.media.opengl.GLAutoDrawable drawable)
Specified by:
display in interface javax.media.opengl.GLEventListener

reshape

public void reshape(javax.media.opengl.GLAutoDrawable drawable,
                    int x,
                    int y,
                    int width,
                    int height)
Specified by:
reshape in interface javax.media.opengl.GLEventListener

dispose

public void dispose(javax.media.opengl.GLAutoDrawable drawable)
Specified by:
dispose in interface javax.media.opengl.GLEventListener

requestDraw

public void requestDraw()
Overrides:
requestDraw in class processing.core.PGraphics

setOverlay

public void setOverlay()
Drawing all the iGeo objects through IPanel. Overlay is also used to draw 2D graphics on top of OpenGL 3D graphics.


setSize

public void setSize(int w,
                    int h)
Overrides:
setSize in class processing.core.PGraphics