igeo.gui
Class IGraphicsGL2

java.lang.Object
  extended by igeo.gui.IGraphicsGL2
All Implemented Interfaces:
IGraphics, IGraphics3D, IGraphicsGL

public class IGraphicsGL2
extends java.lang.Object
implements IGraphicsGL

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

Author:
Satoru Sugihara

Field Summary
 double[][][] bgColor
           
static float[] defaultGLAmbientLight
           
static float[] defaultGLDiffuseLight
           
static float[] defaultGLLightPosition
           
static float[] defaultGLSpecularLight
           
static boolean defaultGLTwoSidedLighting
           
 boolean firstDraw
           
 java.awt.Graphics2D g
           
 javax.media.opengl.GL gl
           
 javax.media.opengl.GL2 gl2
           
 IView view
           
 
Constructor Summary
IGraphicsGL2()
           
 
Method Summary
 void ambient(float[] rgba)
           
 void ambient(float r, float g, float b)
           
 void ambient(float r, float g, float b, float a)
           
 void ambient(IColor c)
           
 void clr(float[] rgba)
          fill color (array of 4 float in order of r, g, b, a)
 void clr(float red, float green, float blue)
          fill color (float 0-255)
 void clr(float red, float green, float blue, float alpha)
          fill color (float 0-255)
 void clr(IColor c)
          fill color
 void diffuse(float[] rgba)
           
 void diffuse(float r, float g, float b)
           
 void diffuse(float r, float g, float b, float a)
          diffuse color is same with color(Color c)
 void diffuse(IColor c)
           
 void disableLight()
           
 void draw(java.util.ArrayList<IGraphicI> objects, IView v)
           
 void drawBG(javax.media.opengl.GL gl, IView v)
           
 void drawLineLoop(IVec[] p)
           
 void drawLines(IVec[] p)
           
 void drawLineStrip(IVec[] p)
           
 void drawPoint(IVec p)
           
 void drawPoints(IVec[] p)
           
 void drawPolygon(IVec[] pts)
           
 void drawPolygon(IVec[] pts, IVec[] nml)
           
 void drawQuadMatrix(IVec[][] pts)
           
 void drawQuadMatrix(IVec[][] pts, IVec[][] nml)
           
 void drawQuads(IVec[] pts)
           
 void drawQuads(IVec[] pts, IVec[] nml)
           
 void drawQuadStrip(IVec[] pts)
           
 void drawQuadStrip(IVec[] pts, IVec[] nml)
           
 void drawTriangleFan(IVec[] pts)
           
 void drawTriangleFan(IVec[] pts, IVec[] nml)
           
 void drawTriangles(IVec[] pts)
           
 void drawTriangles(IVec[] pts, IVec[] nml)
           
 void drawTriangleStrip(IVec[] pts)
           
 void drawTriangleStrip(IVec[] pts, IVec[] nml)
           
 void drawView(IView view)
           
 void emissive(float[] rgba)
           
 void emissive(float r, float g, float b)
           
 void emissive(float r, float g, float b, float a)
           
 void emissive(IColor c)
           
 void enableLight()
           
 boolean firstDraw()
          check if this is the first time frame to draw
 void firstDraw(boolean f)
          set the first draw flag
 javax.media.opengl.GL getGL()
           
 javax.media.opengl.GL2 getGL2()
           
 java.awt.Graphics2D getGraphics()
           
 void pointSize(float sz)
           
 void setGL(javax.media.opengl.GL gl)
           
 void setGraphics(java.awt.Graphics2D g)
           
 void shininess(float s)
           
 void specular(float[] rgba)
           
 void specular(float r, float g, float b)
           
 void specular(float r, float g, float b, float a)
           
 void specular(IColor c)
           
 void stroke(float[] rgba)
          stroke color (array of 4 float in order of r, g, b, a)
 void stroke(float red, float green, float blue)
          stroke color (float 0-255)
 void stroke(float red, float green, float blue, float alpha)
          stroke color (float 0-255)
 void stroke(IColor c)
          in GL, stroke color and fill color use both same glColor
 IGraphicMode.GraphicType type()
           
 IView view()
           
 void weight(double w)
           
 void weight(float w)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

defaultGLLightPosition

public static float[] defaultGLLightPosition

defaultGLAmbientLight

public static float[] defaultGLAmbientLight

defaultGLDiffuseLight

public static float[] defaultGLDiffuseLight

defaultGLSpecularLight

public static float[] defaultGLSpecularLight

defaultGLTwoSidedLighting

public static boolean defaultGLTwoSidedLighting

gl

public javax.media.opengl.GL gl

gl2

public javax.media.opengl.GL2 gl2

g

public java.awt.Graphics2D g

view

public IView view

bgColor

public double[][][] bgColor

firstDraw

public boolean firstDraw
Constructor Detail

IGraphicsGL2

public IGraphicsGL2()
Method Detail

view

public IView view()
Specified by:
view in interface IGraphics

setGL

public void setGL(javax.media.opengl.GL gl)
Specified by:
setGL in interface IGraphicsGL

setGraphics

public void setGraphics(java.awt.Graphics2D g)

getGL

public javax.media.opengl.GL getGL()
Specified by:
getGL in interface IGraphicsGL

getGL2

public javax.media.opengl.GL2 getGL2()

getGraphics

public java.awt.Graphics2D getGraphics()

type

public IGraphicMode.GraphicType type()
Specified by:
type in interface IGraphics

drawBG

public void drawBG(javax.media.opengl.GL gl,
                   IView v)

drawView

public void drawView(IView view)

draw

public void draw(java.util.ArrayList<IGraphicI> objects,
                 IView v)
Specified by:
draw in interface IGraphics

firstDraw

public boolean firstDraw()
Description copied from interface: IGraphics
check if this is the first time frame to draw

Specified by:
firstDraw in interface IGraphics

firstDraw

public void firstDraw(boolean f)
Description copied from interface: IGraphics
set the first draw flag

Specified by:
firstDraw in interface IGraphics

clr

public void clr(IColor c)
Description copied from interface: IGraphics
fill color

Specified by:
clr in interface IGraphics

clr

public void clr(float[] rgba)
Description copied from interface: IGraphics
fill color (array of 4 float in order of r, g, b, a)

Specified by:
clr in interface IGraphics

clr

public void clr(float red,
                float green,
                float blue,
                float alpha)
Description copied from interface: IGraphics
fill color (float 0-255)

Specified by:
clr in interface IGraphics

clr

public void clr(float red,
                float green,
                float blue)
Description copied from interface: IGraphics
fill color (float 0-255)

Specified by:
clr in interface IGraphics

stroke

public void stroke(IColor c)
in GL, stroke color and fill color use both same glColor

Specified by:
stroke in interface IGraphics

stroke

public void stroke(float[] rgba)
Description copied from interface: IGraphics
stroke color (array of 4 float in order of r, g, b, a)

Specified by:
stroke in interface IGraphics

stroke

public void stroke(float red,
                   float green,
                   float blue,
                   float alpha)
Description copied from interface: IGraphics
stroke color (float 0-255)

Specified by:
stroke in interface IGraphics

stroke

public void stroke(float red,
                   float green,
                   float blue)
Description copied from interface: IGraphics
stroke color (float 0-255)

Specified by:
stroke in interface IGraphics

weight

public void weight(double w)

weight

public void weight(float w)
Specified by:
weight in interface IGraphics

diffuse

public void diffuse(float[] rgba)
Specified by:
diffuse in interface IGraphics3D

diffuse

public void diffuse(float r,
                    float g,
                    float b,
                    float a)
Description copied from interface: IGraphics3D
diffuse color is same with color(Color c)

Specified by:
diffuse in interface IGraphics3D

diffuse

public void diffuse(float r,
                    float g,
                    float b)
Specified by:
diffuse in interface IGraphics3D

diffuse

public void diffuse(IColor c)
Specified by:
diffuse in interface IGraphics3D

ambient

public void ambient(float[] rgba)
Specified by:
ambient in interface IGraphics3D

ambient

public void ambient(float r,
                    float g,
                    float b,
                    float a)
Specified by:
ambient in interface IGraphics3D

ambient

public void ambient(float r,
                    float g,
                    float b)
Specified by:
ambient in interface IGraphics3D

ambient

public void ambient(IColor c)
Specified by:
ambient in interface IGraphics3D

specular

public void specular(float[] rgba)
Specified by:
specular in interface IGraphics3D

specular

public void specular(float r,
                     float g,
                     float b,
                     float a)
Specified by:
specular in interface IGraphics3D

specular

public void specular(float r,
                     float g,
                     float b)
Specified by:
specular in interface IGraphics3D

specular

public void specular(IColor c)
Specified by:
specular in interface IGraphics3D

emissive

public void emissive(float[] rgba)
Specified by:
emissive in interface IGraphics3D

emissive

public void emissive(float r,
                     float g,
                     float b,
                     float a)
Specified by:
emissive in interface IGraphics3D

emissive

public void emissive(float r,
                     float g,
                     float b)
Specified by:
emissive in interface IGraphics3D

emissive

public void emissive(IColor c)
Specified by:
emissive in interface IGraphics3D

shininess

public void shininess(float s)
Specified by:
shininess in interface IGraphics3D

enableLight

public void enableLight()
Specified by:
enableLight in interface IGraphics3D

disableLight

public void disableLight()
Specified by:
disableLight in interface IGraphics3D

pointSize

public void pointSize(float sz)
Specified by:
pointSize in interface IGraphics3D

drawPoint

public void drawPoint(IVec p)
Specified by:
drawPoint in interface IGraphics3D

drawPoints

public void drawPoints(IVec[] p)
Specified by:
drawPoints in interface IGraphics3D

drawLines

public void drawLines(IVec[] p)
Specified by:
drawLines in interface IGraphics3D

drawLineStrip

public void drawLineStrip(IVec[] p)
Specified by:
drawLineStrip in interface IGraphics3D

drawLineLoop

public void drawLineLoop(IVec[] p)
Specified by:
drawLineLoop in interface IGraphics3D

drawPolygon

public void drawPolygon(IVec[] pts,
                        IVec[] nml)
Specified by:
drawPolygon in interface IGraphics3D

drawPolygon

public void drawPolygon(IVec[] pts)
Specified by:
drawPolygon in interface IGraphics3D

drawQuads

public void drawQuads(IVec[] pts)
Specified by:
drawQuads in interface IGraphics3D

drawQuads

public void drawQuads(IVec[] pts,
                      IVec[] nml)
Specified by:
drawQuads in interface IGraphics3D

drawQuadStrip

public void drawQuadStrip(IVec[] pts)
Specified by:
drawQuadStrip in interface IGraphics3D

drawQuadStrip

public void drawQuadStrip(IVec[] pts,
                          IVec[] nml)
Specified by:
drawQuadStrip in interface IGraphics3D

drawQuadMatrix

public void drawQuadMatrix(IVec[][] pts)
Specified by:
drawQuadMatrix in interface IGraphics3D

drawQuadMatrix

public void drawQuadMatrix(IVec[][] pts,
                           IVec[][] nml)
Specified by:
drawQuadMatrix in interface IGraphics3D

drawTriangles

public void drawTriangles(IVec[] pts,
                          IVec[] nml)
Specified by:
drawTriangles in interface IGraphics3D

drawTriangles

public void drawTriangles(IVec[] pts)
Specified by:
drawTriangles in interface IGraphics3D

drawTriangleStrip

public void drawTriangleStrip(IVec[] pts,
                              IVec[] nml)
Specified by:
drawTriangleStrip in interface IGraphics3D

drawTriangleStrip

public void drawTriangleStrip(IVec[] pts)
Specified by:
drawTriangleStrip in interface IGraphics3D

drawTriangleFan

public void drawTriangleFan(IVec[] pts,
                            IVec[] nml)
Specified by:
drawTriangleFan in interface IGraphics3D

drawTriangleFan

public void drawTriangleFan(IVec[] pts)
Specified by:
drawTriangleFan in interface IGraphics3D