|
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||
java.lang.Objectde.grogra.imp.awt.ViewComponentAdapter
de.grogra.imp3d.glsl.GLDisplay
de.grogra.imp3d.glsl.GLSLDisplay
public class GLSLDisplay
Extension to the GLDisplay class to work with shaders generated by ShaderOGL
| Nested Class Summary |
|---|
| Nested classes/interfaces inherited from class de.grogra.imp3d.glsl.GLDisplay |
|---|
GLDisplay.GLVisitor |
| Field Summary | |
|---|---|
static boolean |
DEBUG
Debug switch. |
protected boolean |
optionShowBGImage
|
static EnumerationType |
TONEMAPPING_TYPE
Enumeration of the available Tonemapping-Algorithms. |
| Fields inherited from class de.grogra.imp3d.glsl.GLDisplay |
|---|
curHighlight, dlSphere, dlSupershape, endPoint, gridColor, lineWidth, LOD_LEVELS, optionGridColorB, optionGridColorG, optionGridColorR, optionGridDimension, optionGridSpacing, optionShowAxes, optionShowDisplaySize, optionShowGrid, optionShowPoints, polyCache, pool, RENDER_MODE, startPoint, supportsVBO, visitor |
| Fields inherited from class de.grogra.imp.awt.ViewComponentAdapter |
|---|
DISPOSED, DISPOSING, RENDERED_IMAGE, RENDERING, REPAINT_MASK |
| Fields inherited from interface de.grogra.imp3d.RenderState |
|---|
CURRENT_HIGHLIGHT |
| Fields inherited from interface java.awt.image.ImageObserver |
|---|
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH |
| Fields inherited from interface de.grogra.imp.ViewComponent |
|---|
ALL, CHANGED, MIN_USER_FLAG, SCENE, SELECTION, TOOLS |
| Constructor Summary | |
|---|---|
GLSLDisplay()
|
|
| Method Summary | |
|---|---|
void |
drawBoxImpl(javax.media.opengl.GL gl,
float x0,
float y0,
float z0,
float x1,
float y1,
float z1)
Draw a box on gl. |
void |
drawGrid(javax.media.opengl.GL gl)
|
void |
drawParallelogram(float length,
Vector3f axis,
float scaleU,
float scaleV,
Shader s,
int highlight,
Matrix4d t)
|
void |
drawPlane(Shader s,
int highlight,
Matrix4d t)
Draw an x/y plane. |
void |
drawPoint(Tuple3f origin,
int pixelSize,
Tuple3f color,
int highlight,
Matrix4d t)
Draw a single point with the specified pixel size and color. |
void |
drawPolygons(Polygonizable pz,
java.lang.Object obj,
boolean asNode,
Shader s,
int highlight,
Matrix4d t)
|
void |
drawPolygons(Polygonizable pz,
java.lang.Object obj,
boolean asNode,
Shader s,
int highlight,
Matrix4d t,
int defaultCulledSide,
boolean cullingEnabled,
boolean normalMode)
Draw a polygonizable Object. |
void |
drawRectangle(int x,
int y,
int w,
int h,
Tuple3f color)
Draw a rectangle from (x/y) to (x+w/y+h) with the specified color. |
void |
fillRectangle(int x,
int y,
int w,
int h,
Tuple3f color)
Draw a filled rectangle from (x/y) to (x+w/y+h) with the specified color. |
void |
findAndActivateShader(Shader s)
Searches Shader-Cache for a GLSL-Shader corresponding to the given Shader s. |
GLSLManagedShader |
findShader(Shader s)
Searches Shader-Cache for a GLSL-Shader corresponding to the given Shader s. |
float |
getBackgroundAlpha()
|
float |
getBackgroundColorB()
|
float |
getBackgroundColorG()
|
float |
getBackgroundColorR()
|
float |
getBrightness()
|
OpenGLState |
getCurrentGLState()
Returns the OpenGLState associated with the current GLContext. |
int |
getDebugRenderPass()
|
static int |
getDepthStencilSetup()
|
int |
getMaxDepth()
|
TextureManager |
getTextureManager()
|
int |
getTonemapping()
|
Matrix4d |
getTransformation(Matrix4d t)
|
GLDisplay.GLVisitor |
getVisitor()
|
void |
init()
Initialize OpenGL (Proteus). |
void |
init(javax.media.opengl.GLAutoDrawable d)
Initialise opengl state and set default values. |
void |
initView(View view,
EventListener listener)
Initializes this component. |
boolean |
isOptionAltDrawing()
|
boolean |
isOptionAutoAdjustBrightness()
|
boolean |
isOptionEdgeFiltering()
|
boolean |
isOptionLighting()
|
boolean |
isOptionPhysicalLighting()
|
boolean |
isOptionShaderAntialiasing()
|
boolean |
isOptionShowBGImage()
|
boolean |
isOptionShowDiffuseSkyLight()
|
boolean |
isOptionShowGrid()
|
boolean |
isOptionShowShadows()
|
boolean |
isOptionShowSky()
|
boolean |
isVisible(int layer)
Tests if the given layer is currently visible. |
protected void |
optionValueChanged(java.lang.String name,
java.lang.Object value)
|
static void |
printDebugInfo(java.lang.String string)
Output a string to OUT if the DEBUG switch is set. |
static void |
printDebugInfoN(java.lang.String string)
Output a string to OUT if the DEBUG switch is set. |
protected void |
render(int flags)
Render the scene graph. |
void |
renderScene()
This method renders the Scene. |
void |
resize()
If called, all associated FBOs are resized to the current viewports size. |
void |
setGL(javax.media.opengl.GL gl)
Sets the gl object as current active GL object. |
boolean |
setupBGShader(Sky node)
Setup a sky. |
void |
setUpContext(javax.media.opengl.GLContext context)
Setter for GL. |
void |
setVisitor(GLDisplay.GLVisitor visitor)
Sets the active visitor. |
static void |
ViewOrtho(javax.media.opengl.GL gl,
int width,
int height)
construct an orthogonal view matrix for easing full screen Quad drawing |
static void |
ViewPerspective(javax.media.opengl.GL gl)
change view matrix back to default |
| Methods inherited from class de.grogra.imp3d.glsl.GLDisplay |
|---|
display, displayChanged, dispose, drawAxes, drawBox, drawDisplaySize, drawFrustum, drawLine, drawPointCloud, drawSphere, drawString, drawSupershape, drawWithDisplayList, estimateScaleAt, estimateScaleAt, getComponent, getCurrentHighlight, getCurrentShader, getLOD, getObserverForRenderer, getPool, getShader, getView3D, getWindowPos, imageUpdate, initRender, invokeRender, isExtensionSupported, makeSnapshot, reshape |
| Methods inherited from class de.grogra.imp.awt.ViewComponentAdapter |
|---|
checkRepaint, checkRepaintWrapException, disposeRenderer, getColor, getColor, getFactory, getFontMetrics, getGlobalLOD, getIntColor, getInterruptedException, getOption, getRenderGraphState, getView, initFactory, installListeners, invokeRenderSync, render, render, renderUninterruptibly, repaint, run, toSelection, uninstallListeners |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Methods inherited from interface de.grogra.imp3d.RenderState |
|---|
getFontMetrics, getRenderGraphState |
| Methods inherited from interface de.grogra.pf.ui.edit.Selectable |
|---|
toSelection |
| Field Detail |
|---|
public static final boolean DEBUG
protected boolean optionShowBGImage
public static final EnumerationType TONEMAPPING_TYPE
| Constructor Detail |
|---|
public GLSLDisplay()
| Method Detail |
|---|
public void drawBoxImpl(javax.media.opengl.GL gl,
float x0,
float y0,
float z0,
float x1,
float y1,
float z1)
GLDisplay
public void drawGrid(javax.media.opengl.GL gl)
public void drawParallelogram(float length,
Vector3f axis,
float scaleU,
float scaleV,
Shader s,
int highlight,
Matrix4d t)
drawParallelogram in interface RenderStatedrawParallelogram in class GLDisplay
public void drawPlane(Shader s,
int highlight,
Matrix4d t)
GLDisplay
drawPlane in interface RenderStatedrawPlane in class GLDisplay
public void drawPoint(Tuple3f origin,
int pixelSize,
Tuple3f color,
int highlight,
Matrix4d t)
GLDisplay
drawPoint in interface RenderStatedrawPoint in class GLDisplaypixelSize - size of point on screen in pixels
public void drawPolygons(Polygonizable pz,
java.lang.Object obj,
boolean asNode,
Shader s,
int highlight,
Matrix4d t)
drawPolygons in interface RenderStatedrawPolygons in class GLDisplay
public void drawPolygons(Polygonizable pz,
java.lang.Object obj,
boolean asNode,
Shader s,
int highlight,
Matrix4d t,
int defaultCulledSide,
boolean cullingEnabled,
boolean normalMode)
pz - obj - asNode - s - highlight - t - Transformation matrix. Input for getTransformation(Matrix4d)defaultCulledSide - Default state for culling. This is one of GL.FRONT, GL.GL_BACKcullingEnabled - True if culling is currently enabled in OpenGL. False else.normalMode - True if this is used for drawing visible geometry. False if used
for drawing into Shadow Map.GLDisplay.drawPolygons(Polygonizable, Object, boolean, Shader, int, Matrix4d)
public void drawRectangle(int x,
int y,
int w,
int h,
Tuple3f color)
GLDisplay
drawRectangle in interface RenderStatedrawRectangle in class GLDisplay
public void fillRectangle(int x,
int y,
int w,
int h,
Tuple3f color)
GLDisplay
fillRectangle in interface RenderStatefillRectangle in class GLDisplaypublic void findAndActivateShader(Shader s)
s - The GroIMP-Shader.public GLSLManagedShader findShader(Shader s)
s - The GroIMP-Shader.
public float getBackgroundAlpha()
public float getBackgroundColorB()
public float getBackgroundColorG()
public float getBackgroundColorR()
public float getBrightness()
public OpenGLState getCurrentGLState()
OpenGLStatepublic int getDebugRenderPass()
public static int getDepthStencilSetup()
public int getMaxDepth()
public TextureManager getTextureManager()
public int getTonemapping()
public Matrix4d getTransformation(Matrix4d t)
getTransformation in class GLDisplaypublic GLDisplay.GLVisitor getVisitor()
public void init()
public void init(javax.media.opengl.GLAutoDrawable d)
DEBUG
is set to true resulting in detailed Debug-Output if an GLError occurs.
init in interface javax.media.opengl.GLEventListenerinit in class GLDisplay
public void initView(View view,
EventListener listener)
ViewComponentview
within which this view component is used to display the graph.
It also sets an event listener. this has to be informed of
mouse and keys events within the view component by implementations
of this method.
initView in interface ViewComponentinitView in class GLDisplayview - the containing viewlistener - mouse and key events will be reported to this listenerpublic boolean isOptionAltDrawing()
public boolean isOptionAutoAdjustBrightness()
public boolean isOptionEdgeFiltering()
public boolean isOptionLighting()
public boolean isOptionPhysicalLighting()
public boolean isOptionShaderAntialiasing()
public boolean isOptionShowBGImage()
public boolean isOptionShowDiffuseSkyLight()
public boolean isOptionShowGrid()
public boolean isOptionShowShadows()
public boolean isOptionShowSky()
public boolean isVisible(int layer)
layer - The layer that should be tested.
protected void optionValueChanged(java.lang.String name,
java.lang.Object value)
optionValueChanged in class GLDisplaypublic static void printDebugInfo(java.lang.String string)
string - The String to be printed.public static void printDebugInfoN(java.lang.String string)
string - The String to be printed.
protected void render(int flags)
throws java.lang.InterruptedException
GLDisplay
render in class GLDisplayflags - combination of bit masks
java.lang.InterruptedException - if the rendering has been interruptedpublic void renderScene()
GLDisplay.render(int).
public void resize()
public void setGL(javax.media.opengl.GL gl)
OpenGLState.setGL(GL).
gl - The GL objectpublic boolean setupBGShader(Sky node)
node -
public void setUpContext(javax.media.opengl.GLContext context)
context - The new GL-context that should be used for all actions.public void setVisitor(GLDisplay.GLVisitor visitor)
getVisitor() to store a reference.
visitor - The visitor Object that replaces the active visitor.
public static void ViewOrtho(javax.media.opengl.GL gl,
int width,
int height)
gl - Current GL Object. Used to issue OpenGL commands.width - Width of the orthogonal projection in OpenGL units.height - Height of the orthogonal projection in OpenGL units.public static void ViewPerspective(javax.media.opengl.GL gl)
gl - Current GL Object. Used to issue OpenGL commands.
|
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||