|
JOGL v2.6.0-rc-20250712
JOGL, High-Performance Graphics Binding for Java (public API).
|
Classes | |
| class | DefaultPMVMatrixSetup |
Default implementation of Scene.PMVMatrixSetup, implementing Scene.PMVMatrixSetup#set(PMVMatrix4f, Recti) as follows: More... | |
| interface | PMVMatrixSetup |
Interface providing a method to setup PMVMatrix4f's GLMatrixFunc#GL_PROJECTION and GLMatrixFunc#GL_MODELVIEW. More... | |
Public Member Functions | |
| Scene () | |
Create a new scene with an internally created RegionRenderer, a graph AA sample-count 4 and using DefaultPMVMatrixSetup#DefaultPMVMatrixSetup(). More... | |
| Scene (final int sampleCount) | |
Create a new scene with an internally created RegionRenderer, using DefaultPMVMatrixSetup#DefaultPMVMatrixSetup(). More... | |
| Scene (final RegionRenderer renderer) | |
Create a new scene taking ownership of the given RegionRenderer, using DefaultPMVMatrixSetup#DefaultPMVMatrixSetup(). More... | |
| RegionRenderer | getRenderer () |
| Returns the associated RegionRenderer. More... | |
| final void | setClearParams (final float[] clearColor, final int clearMask) |
Sets the clear parameter for glClearColor(..) and glClear(..) to be issued at display(GLAutoDrawable). More... | |
| final float[] | getClearColor () |
Returns the glClearColor(..) arguments, see setClearParams(float[], int). More... | |
| final int | getClearMask () |
Returns the glClear(..) mask, see setClearParams(float[], int). More... | |
| final void | setPMvCullingEnabled (final boolean v) |
Enable or disable Project-Modelview (PMv) frustum culling per Shape for this container. More... | |
| final boolean | isPMvCullingEnabled () |
Return whether Project-Modelview (PMv) frustum culling is enabled for this container. More... | |
| final boolean | isCullingEnabled () |
Return whether Project-Modelview (PMv) frustum culling or Group's Modelview (Mv) frustum clipping is enabled for this container. More... | |
| synchronized void | attachGLAutoDrawable (final GLAutoDrawable drawable) |
| synchronized void | detachGLAutoDrawable (final GLAutoDrawable drawable) |
| synchronized void | attachInputListenerTo (final GLWindow window) |
| synchronized void | detachInputListenerFrom (final GLWindow window) |
| int | getShapeCount () |
Returns number of Shapes, see getShapes(). More... | |
| List< Shape > | getShapes () |
Returns added Shapes. More... | |
| List< Shape > | getRenderedShapes () |
Returns added shapes which are rendered and sorted by z-axis in ascending order toward z-near. More... | |
| void | addShape (final Shape s) |
Adds a Shape. More... | |
| Shape | removeShape (final Shape s) |
Removes given shape, w/o Shape#destroy(GL2ES2, RegionRenderer). More... | |
| void | removeShapes (final Collection<? extends Shape > shapes) |
Removes all given shapes, w/o Shape#destroy(GL2ES2, RegionRenderer). More... | |
| boolean | removeShape (final GL2ES2 gl, final RegionRenderer renderer, final Shape s) |
Removes given shape with Shape#destroy(GL2ES2, RegionRenderer), if contained. More... | |
| boolean | removeShape (final GL2ES2 gl, final Shape s) |
Removes given shape and destroy it, if contained - convenient call for removeShape(GL2ES2, RegionRenderer, Shape). More... | |
| void | addShapes (final Collection<? extends Shape > shapes) |
| void | removeShapes (final GL2ES2 gl, final RegionRenderer renderer, final Collection<? extends Shape > shapes) |
Removes all given shapes with Shape#destroy(GL2ES2, RegionRenderer). More... | |
| void | removeShapes (final GL2ES2 gl, final Collection<? extends Shape > shapes) |
Removes all given shapes and destroys them, convenient call for removeShape(GL2ES2, RegionRenderer, Shape). More... | |
| void | removeAllShapes (final GL2ES2 gl, final RegionRenderer renderer) |
Removes all contained shapes with Shape#destroy(GL2ES2, RegionRenderer). More... | |
| void | removeAllShapes (final GL2ES2 gl) |
Removes all given shapes and destroys them, convenient call for removeAllShapes(GL2ES2, RegionRenderer). More... | |
| boolean | contains (final Shape s) |
| Shape | getShapeByIdx (final int id) |
| Shape | getShapeByID (final int id) |
| Shape | getShapeByName (final String name) |
| int | getSampleCount () |
Returns RegionRenderer#getSampleCount(). More... | |
| int | setSampleCount (final int v) |
Sets RegionRenderer#setSampleCount(int). More... | |
| int | getAAQuality () |
Returns RegionRenderer#getAAQuality(). More... | |
| int | setAAQuality (final int v) |
Sets RegionRenderer#setAAQuality(int). More... | |
| void | setSharpness (final float sharpness) |
| void | markShapesDirty () |
| void | markStatesDirty () |
| void | init (final GLAutoDrawable drawable) |
| Called by the drawable immediately after the OpenGL context is initialized. More... | |
| boolean | invoke (final boolean wait, final GLRunnable glRunnable) throws IllegalStateException |
Enqueues a one-shot GLRunnable, which will be executed within the next GLAutoDrawable#display() call if this Scene has been added as a GLEventListener and init(GLAutoDrawable) has been called. More... | |
| void | addGLEventListener (final GLEventListener listener) |
| void | removeGLEventListener (final GLEventListener listener) |
| void | reshape (final GLAutoDrawable drawable, final int x, final int y, final int width, final int height) |
Reshape scene using setupMatrix(PMVMatrix4f, int, int, int, int) using PMVMatrixSetup. More... | |
| final boolean | isOutside (final PMVMatrix4f pmv, final Shape shape) |
Returns whether the given Shape is completely outside of this container. More... | |
| boolean | isOutside2 (final Matrix4f mvCont, final Shape shape, final PMVMatrix4f pmvShape) |
Returns whether the given Shape is completely outside of this container. More... | |
| void | display (final GLAutoDrawable drawable) |
| Called by the drawable to initiate OpenGL rendering by the client. More... | |
| void | waitUntilDisplayed () |
Blocks until first display(GLAutoDrawable) has completed after construction or dispose(GLAutoDrawable). More... | |
| void | dispose (final GLAutoDrawable drawable) |
Disposes all added Shapes. More... | |
| void | addDisposeAction (final GLRunnable action) |
Add a user one-time GLRunnable disposal action to an internal list, all invoked at {@Link dispose(GLAutoDrawable)} where the list is cleared afterwards similar to all shapes. More... | |
| void | winToShapeCoord (final Shape shape, final int glWinX, final int glWinY, final PMVMatrix4f pmv, final Vec3f objPos, final Runnable runnable) |
Calling Shape#winToObjCoord(Scene, int, int, float[]), retrieving its Shape object position. More... | |
| AABBox | getBounds (final PMVMatrix4f pmv, final Shape shape) |
Returns AABBox dimension of given Shape from this container's perspective, i.e. More... | |
| final PMVMatrixSetup | getPMVMatrixSetup () |
Return the default or setPMVMatrixSetup(PMVMatrixSetup) PMVMatrixSetup. More... | |
| final void | setPMVMatrixSetup (final PMVMatrixSetup setup) |
Set a custom PMVMatrixSetup. More... | |
| void | setupMatrix (final PMVMatrix4f pmv, final Recti viewport) |
Setup PMVMatrix4f GLMatrixFunc#GL_PROJECTION and GLMatrixFunc#GL_MODELVIEW by calling getPMVMatrixSetup()'s PMVMatrixSetup#set(PMVMatrix4f, Recti). More... | |
| void | setupMatrix (final PMVMatrix4f pmv) |
Setup PMVMatrix4f GLMatrixFunc#GL_PROJECTION and GLMatrixFunc#GL_MODELVIEW using implicit getViewport() surface dimension by calling getPMVMatrixSetup()'s PMVMatrixSetup#set(PMVMatrix4f, Recti). More... | |
| final Recti | getViewport (final Recti target) |
| Copies the current int[4] viewport in given target and returns it for chaining. More... | |
| Recti | getViewport () |
| Borrows the current int[4] viewport w/o copying. More... | |
| int | getWidth () |
Returns the getViewport()'s width, set after initial reshape(GLAutoDrawable, int, int, int, int). More... | |
| int | getHeight () |
Returns the getViewport()'s height, set after initial reshape(GLAutoDrawable, int, int, int, int). More... | |
| PMVMatrix4f | getMatrix () |
Borrow the current PMVMatrix4f. More... | |
| AABBox | getBounds () |
| Describing the scene's object model-dimensions of the plane at scene-distance covering the visible viewport rectangle. More... | |
| float | getZEpsilon (final int zBits) |
Return Z precision on using current getPMVMatrixSetup()'s PMVMatrixSetup#getSceneDist() z-position and PMVMatrixSetup#getZNear(). More... | |
| void | surfaceToPlaneSize (final Recti viewport, final float zNear, final float zFar, final float objOrthoDist, final Vec2f objSceneSize) |
| Map given window surface-size to object coordinates relative to this scene using the give projection parameters. More... | |
| void | surfaceToPlaneSize (final Recti viewport, final Vec2f objSceneSize) |
Map given window surface-size to object coordinates relative to this scene using the default PMVMatrixSetup, i.e. More... | |
| final Shape | getActiveShape () |
| void | releaseActiveShape () |
| float | getActiveShapeZOffsetScale () |
Returns the active Shape Z-Offset scale, defaults to DEFAULT_ACTIVE_ZOFFSET_SCALE. More... | |
| void | setActiveShapeZOffsetScale (final float v) |
Sets the active Shape Z-Offset scale, defaults to DEFAULT_ACTIVE_ZOFFSET_SCALE. More... | |
| float | getActiveTopLevelZOffsetScale () |
Returns the general top-level widget Z-Offset scale, defaults to DEFAULT_ACTIVE_ZOFFSET_SCALE. More... | |
| void | setActiveTopLevelZOffsetScale (final float v) |
Sets the general top-level widget Z-Offset scale, defaults to DEFAULT_ACTIVE_TOPLEVEL_ZOFFSET_SCALE. More... | |
| void | pickShapeGL (final int glWinX, final int glWinY, final Vec3f objPos, final Shape[] shape, final Runnable runnable) |
Attempt to pick a Shape using the OpenGL false color rendering. More... | |
| Shape | pickShape (final PMVMatrix4f pmv, final Ray ray, final int glWinX, final int glWinY, final Vec3f objPos, final Shape.Visitor1 visitor) |
Attempt to pick a Shape using the window coordinates and contained {@ling Shape}'s AABBox bounds using a ray-intersection algorithm in Z-axis descending order. More... | |
| String | getStatusText (final GLAutoDrawable glad, final int renderModes, final float dpi) |
| Return a formatted status string containing avg fps and avg frame duration. More... | |
| File | nextScreenshotFile (final String dir, final String prefix, final int renderModes, final GLCapabilitiesImmutable caps, final String contentDetail) |
Return the unique next technical screenshot PNG File instance as follows: More... | |
| int | getScreenshotCount () |
Return the number of nextScreenshotFile(String, String, int, GLCapabilitiesImmutable, String) calls. More... | |
| void | screenshot (final GL gl, final File file) |
| Write current read drawable (screen) to a file. More... | |
| void | screenshot (final boolean wait, final File file) |
Write current read drawable (screen) to a file on on the display call. More... | |
| int | getShapeCount () |
Returns number of Shapes, see getShapes(). More... | |
| List< Shape > | getShapes () |
Returns added Shapes. More... | |
| List< Shape > | getRenderedShapes () |
Returns added shapes which are rendered and sorted by z-axis in ascending order toward z-near. More... | |
| void | addShape (Shape s) |
Adds a Shape. More... | |
| Shape | removeShape (final Shape s) |
Removes given shape, w/o Shape#destroy(GL2ES2, RegionRenderer). More... | |
| void | removeShapes (Collection<? extends Shape > shapes) |
Removes all given shapes, w/o Shape#destroy(GL2ES2, RegionRenderer). More... | |
| boolean | removeShape (final GL2ES2 gl, final RegionRenderer renderer, final Shape s) |
Removes given shape with Shape#destroy(GL2ES2, RegionRenderer), if contained. More... | |
| void | addShapes (Collection<? extends Shape > shapes) |
| void | removeShapes (final GL2ES2 gl, final RegionRenderer renderer, final Collection<? extends Shape > shapes) |
Removes all given shapes with Shape#destroy(GL2ES2, RegionRenderer). More... | |
| void | removeAllShapes (final GL2ES2 gl, final RegionRenderer renderer) |
Removes all contained shapes with Shape#destroy(GL2ES2, RegionRenderer). More... | |
| boolean | contains (Shape s) |
| Shape | getShapeByIdx (final int id) |
| Shape | getShapeByID (final int id) |
| Shape | getShapeByName (final String name) |
| AABBox | getBounds (final PMVMatrix4f pmv, Shape shape) |
Returns AABBox dimension of given Shape from this container's perspective, i.e. More... | |
| void | setPMvCullingEnabled (final boolean v) |
Enable or disable Project-Modelview (PMv) frustum culling per Shape for this container. More... | |
| boolean | isPMvCullingEnabled () |
Return whether Project-Modelview (PMv) frustum culling is enabled for this container. More... | |
| boolean | isCullingEnabled () |
Return whether Project-Modelview (PMv) frustum culling or Group's Modelview (Mv) frustum clipping is enabled for this container. More... | |
| boolean | isOutside (final PMVMatrix4f pmv, final Shape shape) |
Returns whether the given Shape is completely outside of this container. More... | |
| boolean | isOutside2 (final Matrix4f mvCont, final Shape shape, final PMVMatrix4f pmvShape) |
Returns whether the given Shape is completely outside of this container. More... | |
| void | init (GLAutoDrawable drawable) |
| Called by the drawable immediately after the OpenGL context is initialized. More... | |
| void | dispose (GLAutoDrawable drawable) |
| Notifies the listener to perform the release of all OpenGL resources per GLContext, such as memory buffers and GLSL programs. More... | |
| void | display (GLAutoDrawable drawable) |
| Called by the drawable to initiate OpenGL rendering by the client. More... | |
| void | reshape (GLAutoDrawable drawable, int x, int y, int width, int height) |
| Called by the drawable during the first repaint after the component has been resized. More... | |
Static Public Member Functions | |
| static float | getZEpsilon (final int zBits, final PMVMatrixSetup setup) |
Default Z precision on 16-bit depth buffer using -1 z-position and DEFAULT_ZNEAR. More... | |
| static void | winToPlaneCoord (final PMVMatrix4f pmv, final Recti viewport, final float zNear, final float zFar, final float winX, final float winY, final float objOrthoZ, final Vec3f objPos) |
| static String | getStatusText (final FPSCounter fpsCounter) |
| Return a formatted status string containing avg fps and avg frame duration. More... | |
Static Public Attributes | |
| static final float | DEFAULT_SCENE_DIST = -1/5f |
| Default scene distance on z-axis to projection is -1/5f. More... | |
| static final float | DEFAULT_ANGLE = FloatUtil.QUARTER_PI |
| Default projection angle in radians is PI/4, i.e. More... | |
| static final float | DEFAULT_ZNEAR = 0.1f |
| Default projection z-near value is {@value}. More... | |
| static final float | DEFAULT_ZFAR = 7000.0f |
| Default projection z-far value is {@value}. More... | |
| static final float | DEFAULT_Z16_EPSILON = FloatUtil.getZBufferEpsilon(16 , DEFAULT_SCENE_DIST, DEFAULT_ZNEAR) |
Default Z precision on 16-bit depth buffer using DEFAULT_SCENE_DIST z-position and DEFAULT_ZNEAR. More... | |
| static final float | DEFAULT_ACTIVE_ZOFFSET_SCALE = 10f |
| Default Z precision scale, i.e. More... | |
| static final float | DEFAULT_ACTIVE_TOPLEVEL_ZOFFSET_SCALE = 100f |
| Default Z precision scale, i.e. More... | |
GraphUI Scene.
GraphUI is GPU based and resolution independent.
GraphUI is intended to become an immediate- and retained-mode API.
To utilize a Scene instance directly as a GLEventListener, user needs to setClearParams(float[], int).
Otherwise user may just call provided GLEventListener from within their own workflow
GLEventListener#init(GLAutoDrawable)GLEventListener#reshape(GLAutoDrawable, int, int, int, int)GLEventListener#display(GLAutoDrawable)GLEventListener#dispose(GLAutoDrawable) setPMVMatrixSetup(PMVMatrixSetup) maybe used to provide a custom PMVMatrix4f setup.
Definition at line 102 of file Scene.java.
| com.jogamp.graph.ui.Scene.Scene | ( | ) |
Create a new scene with an internally created RegionRenderer, a graph AA sample-count 4 and using DefaultPMVMatrixSetup#DefaultPMVMatrixSetup().
Definition at line 176 of file Scene.java.
| com.jogamp.graph.ui.Scene.Scene | ( | final int | sampleCount | ) |
Create a new scene with an internally created RegionRenderer, using DefaultPMVMatrixSetup#DefaultPMVMatrixSetup().
| sampleCount | sample count for Graph Region AA render-modes: Region#VBAA_RENDERING_BIT or Region#MSAA_RENDERING_BIT, clipped to [Region#MIN_AA_SAMPLE_COUNT..Region#MAX_AA_SAMPLE_COUNT] |
Definition at line 188 of file Scene.java.
| com.jogamp.graph.ui.Scene.Scene | ( | final RegionRenderer | renderer | ) |
Create a new scene taking ownership of the given RegionRenderer, using DefaultPMVMatrixSetup#DefaultPMVMatrixSetup().
| renderer | RegionRenderer to be owned |
Definition at line 199 of file Scene.java.
| void com.jogamp.graph.ui.Scene.addDisposeAction | ( | final GLRunnable | action | ) |
Add a user one-time GLRunnable disposal action to an internal list, all invoked at {@Link dispose(GLAutoDrawable)} where the list is cleared afterwards similar to all shapes.
This allows proper take-down of custom user resources at exit.
| action | the custom GLRunnable disposal action |
Definition at line 650 of file Scene.java.
| void com.jogamp.graph.ui.Scene.addGLEventListener | ( | final GLEventListener | listener | ) |
Definition at line 435 of file Scene.java.
| void com.jogamp.graph.ui.Scene.addShape | ( | final Shape | s | ) |
Adds a Shape.
Implements com.jogamp.graph.ui.Container.
Definition at line 287 of file Scene.java.
| void com.jogamp.graph.ui.Scene.addShapes | ( | final Collection<? extends Shape > | shapes | ) |
Implements com.jogamp.graph.ui.Container.
Definition at line 322 of file Scene.java.
| synchronized void com.jogamp.graph.ui.Scene.attachGLAutoDrawable | ( | final GLAutoDrawable | drawable | ) |
Definition at line 238 of file Scene.java.
| synchronized void com.jogamp.graph.ui.Scene.attachInputListenerTo | ( | final GLWindow | window | ) |
Definition at line 246 of file Scene.java.
| boolean com.jogamp.graph.ui.Scene.contains | ( | final Shape | s | ) |
Implements com.jogamp.graph.ui.Container.
Definition at line 350 of file Scene.java.
| synchronized void com.jogamp.graph.ui.Scene.detachGLAutoDrawable | ( | final GLAutoDrawable | drawable | ) |
Definition at line 241 of file Scene.java.
| synchronized void com.jogamp.graph.ui.Scene.detachInputListenerFrom | ( | final GLWindow | window | ) |
Definition at line 262 of file Scene.java.
| void com.jogamp.graph.ui.Scene.display | ( | final GLAutoDrawable | drawable | ) |
Called by the drawable to initiate OpenGL rendering by the client.
After all GLEventListeners have been notified of a display event, the drawable will swap its buffers if setAutoSwapBufferMode is enabled.
Implements com.jogamp.opengl.GLEventListener.
Definition at line 487 of file Scene.java.
| void com.jogamp.graph.ui.Scene.dispose | ( | final GLAutoDrawable | drawable | ) |
Implementation also issues RegionRenderer#destroy(GL2ES2) if set and detachInputListenerFrom(GLWindow) in case the drawable is of type GLWindow.
Notifies the listener to perform the release of all OpenGL resources per GLContext, such as memory buffers and GLSL programs.Called by the drawable before the OpenGL context is destroyed by an external event, like a reconfiguration of the GLAutoDrawable closing an attached window, but also manually by calling destroy.Note that this event does not imply the end of life of the application. It could be produced with a followup call to init(GLAutoDrawable) in case the GLContext has been recreated, e.g. due to a pixel configuration change in a multihead environment.
Implements com.jogamp.opengl.GLEventListener.
Definition at line 605 of file Scene.java.
| int com.jogamp.graph.ui.Scene.getAAQuality | ( | ) |
Returns RegionRenderer#getAAQuality().
Definition at line 378 of file Scene.java.
| final Shape com.jogamp.graph.ui.Scene.getActiveShape | ( | ) |
Definition at line 860 of file Scene.java.
| float com.jogamp.graph.ui.Scene.getActiveShapeZOffsetScale | ( | ) |
Returns the active Shape Z-Offset scale, defaults to DEFAULT_ACTIVE_ZOFFSET_SCALE.
Definition at line 925 of file Scene.java.
| float com.jogamp.graph.ui.Scene.getActiveTopLevelZOffsetScale | ( | ) |
Returns the general top-level widget Z-Offset scale, defaults to DEFAULT_ACTIVE_ZOFFSET_SCALE.
Definition at line 930 of file Scene.java.
| AABBox com.jogamp.graph.ui.Scene.getBounds | ( | ) |
Describing the scene's object model-dimensions of the plane at scene-distance covering the visible viewport rectangle.
The value is evaluated at reshape(GLAutoDrawable, int, int, int, int) via /p><p>@linkAABBox#getWidth()and@linkAABBox#getHeight()definescene'sdimensioncoveredbysurfacesize.</p><p>@linkAABBoxissetupvia@link#getPMVMatrixSetup()'s@linkPMVMatrixSetup#setPlaneBox(AABBox, PMVMatrix4f, Recti).</p><p>Thedefault@linkPMVMatrixSetupimplementationscalestonormalizedplanedimensions,1forthegreaterofwidthandheight.</p>
Definition at line 796 of file Scene.java.
| AABBox com.jogamp.graph.ui.Scene.getBounds | ( | final PMVMatrix4f | pmv, |
| final Shape | shape | ||
| ) |
Returns AABBox dimension of given Shape from this container's perspective, i.e.
world-bounds if performing from the Scene.
Implements com.jogamp.graph.ui.Container.
Definition at line 676 of file Scene.java.
| final float[] com.jogamp.graph.ui.Scene.getClearColor | ( | ) |
Returns the glClearColor(..) arguments, see setClearParams(float[], int).
Definition at line 224 of file Scene.java.
| final int com.jogamp.graph.ui.Scene.getClearMask | ( | ) |
Returns the glClear(..) mask, see setClearParams(float[], int).
Definition at line 227 of file Scene.java.
| int com.jogamp.graph.ui.Scene.getHeight | ( | ) |
Returns the getViewport()'s height, set after initial reshape(GLAutoDrawable, int, int, int, int).
Definition at line 776 of file Scene.java.
| PMVMatrix4f com.jogamp.graph.ui.Scene.getMatrix | ( | ) |
Borrow the current PMVMatrix4f.
Definition at line 779 of file Scene.java.
| final PMVMatrixSetup com.jogamp.graph.ui.Scene.getPMVMatrixSetup | ( | ) |
Return the default or setPMVMatrixSetup(PMVMatrixSetup) PMVMatrixSetup.
Definition at line 742 of file Scene.java.
| List< Shape > com.jogamp.graph.ui.Scene.getRenderedShapes | ( | ) |
Returns added shapes which are rendered and sorted by z-axis in ascending order toward z-near.
The rendered shapes are visible and not deemed outside of this container due to culling.
Only rendered shapes are considered for picking/activation.
The returned list is data-race free, i.e. won't be mutated by the rendering thread as it gets completely replace at each rendering loop using a local volatile reference.
Only when disposing the container, the list gets cleared, hence {@Link List::size()} shall be used in the loop.
Implements com.jogamp.graph.ui.Container.
Definition at line 284 of file Scene.java.
| RegionRenderer com.jogamp.graph.ui.Scene.getRenderer | ( | ) |
Returns the associated RegionRenderer.
Definition at line 208 of file Scene.java.
| int com.jogamp.graph.ui.Scene.getSampleCount | ( | ) |
Returns RegionRenderer#getSampleCount().
Definition at line 370 of file Scene.java.
| int com.jogamp.graph.ui.Scene.getScreenshotCount | ( | ) |
Return the number of nextScreenshotFile(String, String, int, GLCapabilitiesImmutable, String) calls.
Definition at line 1447 of file Scene.java.
| Shape com.jogamp.graph.ui.Scene.getShapeByID | ( | final int | id | ) |
Implements com.jogamp.graph.ui.Container.
Definition at line 361 of file Scene.java.
| Shape com.jogamp.graph.ui.Scene.getShapeByIdx | ( | final int | id | ) |
Implements com.jogamp.graph.ui.Container.
Definition at line 354 of file Scene.java.
| Shape com.jogamp.graph.ui.Scene.getShapeByName | ( | final String | name | ) |
Implements com.jogamp.graph.ui.Container.
Definition at line 365 of file Scene.java.
| int com.jogamp.graph.ui.Scene.getShapeCount | ( | ) |
Returns number of Shapes, see getShapes().
Implements com.jogamp.graph.ui.Container.
Definition at line 278 of file Scene.java.
| List< Shape > com.jogamp.graph.ui.Scene.getShapes | ( | ) |
Implements com.jogamp.graph.ui.Container.
Definition at line 281 of file Scene.java.
|
static |
Return a formatted status string containing avg fps and avg frame duration.
| fpsCounter | the counter, must not be null |
Definition at line 1410 of file Scene.java.
| String com.jogamp.graph.ui.Scene.getStatusText | ( | final GLAutoDrawable | glad, |
| final int | renderModes, | ||
| final float | dpi | ||
| ) |
Return a formatted status string containing avg fps and avg frame duration.
| glad | GLAutoDrawable instance for FPSCounter, its chosen GLCapabilities and its GL's swap-interval |
| renderModes | render modes for Region#getRenderModeString(int, int, int, int) |
| dpi | the monitor's DPI (vertical preferred) |
Definition at line 1381 of file Scene.java.
| Recti com.jogamp.graph.ui.Scene.getViewport | ( | ) |
Borrows the current int[4] viewport w/o copying.
It is set after initial reshape(GLAutoDrawable, int, int, int, int).
Definition at line 771 of file Scene.java.
Copies the current int[4] viewport in given target and returns it for chaining.
It is set after initial reshape(GLAutoDrawable, int, int, int, int).
Definition at line 768 of file Scene.java.
| int com.jogamp.graph.ui.Scene.getWidth | ( | ) |
Returns the getViewport()'s width, set after initial reshape(GLAutoDrawable, int, int, int, int).
Definition at line 774 of file Scene.java.
| float com.jogamp.graph.ui.Scene.getZEpsilon | ( | final int | zBits | ) |
Return Z precision on using current getPMVMatrixSetup()'s PMVMatrixSetup#getSceneDist() z-position and PMVMatrixSetup#getZNear().
| zBits | depth buffer bit-depth, minimum 16-bit |
Definition at line 803 of file Scene.java.
|
static |
Default Z precision on 16-bit depth buffer using -1 z-position and DEFAULT_ZNEAR.
Value is 1.5256461E-4. Return Z precision on using PMVMatrixSetup#getSceneDist() z-position and PMVMatrixSetup#getZNear().
| zBits | depth buffer bit-depth, minimum 16-bit |
| setup | PMVMatrixSetup for scene-distance as z-position and zNear |
Definition at line 126 of file Scene.java.
| void com.jogamp.graph.ui.Scene.init | ( | final GLAutoDrawable | drawable | ) |
Called by the drawable immediately after the OpenGL context is initialized.
Can be used to perform one-time OpenGL initialization per GLContext, such as setup of lights and display lists.
Note that this method may be called more than once if the underlying OpenGL context for the GLAutoDrawable is destroyed and recreated, for example if a GLCanvas is removed from the widget hierarchy and later added again.
Implements com.jogamp.opengl.GLEventListener.
Definition at line 407 of file Scene.java.
| boolean com.jogamp.graph.ui.Scene.invoke | ( | final boolean | wait, |
| final GLRunnable | glRunnable | ||
| ) | throws IllegalStateException |
Enqueues a one-shot GLRunnable, which will be executed within the next GLAutoDrawable#display() call if this Scene has been added as a GLEventListener and init(GLAutoDrawable) has been called.
See GLAutoDrawable#invoke(boolean, GLRunnable).
| wait | if true block until execution of glRunnable is finished, otherwise return immediately w/o waiting |
| glRunnable | the GLRunnable to execute within display() |
true if the GLRunnable has been processed or queued, otherwise false. | IllegalStateException | in case of a detected deadlock situation ahead, see above. |
Definition at line 428 of file Scene.java.
| final boolean com.jogamp.graph.ui.Scene.isCullingEnabled | ( | ) |
Return whether Project-Modelview (PMv) frustum culling or Group's Modelview (Mv) frustum clipping is enabled for this container.
Default is disabled.
Implements com.jogamp.graph.ui.Container.
Definition at line 236 of file Scene.java.
| final boolean com.jogamp.graph.ui.Scene.isOutside | ( | final PMVMatrix4f | pmv, |
| final Shape | shape | ||
| ) |
Returns whether the given Shape is completely outside of this container.
Note: If method returns false, the box may only be partially inside, i.e. intersects with this container
| pmv | current PMVMatrix4f of this container |
| shape | the Shape to test |
Implements com.jogamp.graph.ui.Container.
Definition at line 466 of file Scene.java.
| boolean com.jogamp.graph.ui.Scene.isOutside2 | ( | final Matrix4f | mvCont, |
| final Shape | shape, | ||
| final PMVMatrix4f | pmvShape | ||
| ) |
Returns whether the given Shape is completely outside of this container.
Note: If method returns false, the box may only be partially inside, i.e. intersects with this container
| mvCont | copy of the model-view of this container shape the Shape to test |
| pmvShape | current PMVMatrix4f of the shape to test |
Implements com.jogamp.graph.ui.Container.
Definition at line 478 of file Scene.java.
| final boolean com.jogamp.graph.ui.Scene.isPMvCullingEnabled | ( | ) |
Return whether Project-Modelview (PMv) frustum culling is enabled for this container.
Implements com.jogamp.graph.ui.Container.
Definition at line 233 of file Scene.java.
| void com.jogamp.graph.ui.Scene.markShapesDirty | ( | ) |
| void com.jogamp.graph.ui.Scene.markStatesDirty | ( | ) |
| File com.jogamp.graph.ui.Scene.nextScreenshotFile | ( | final String | dir, |
| final String | prefix, | ||
| final int | renderModes, | ||
| final GLCapabilitiesImmutable | caps, | ||
| final String | contentDetail | ||
| ) |
Return the unique next technical screenshot PNG File instance as follows:
filename = [{dir}][{prefix}-]Region#getRenderModeString(int, int, int, int)[-{contentDetails}]-snap{screenShotCount}-{resolution}.png
Implementation increments getScreenshotCount().
| dir | the target directory, may be null or an empty string |
| prefix | the prefix, may be null or an empty string |
| renderModes | the used Graph renderModes, see create(..) |
| caps | the used GLCapabilitiesImmutable used to retrieved the full-screen AA (fsaa) GLCapabilitiesImmutable#getNumSamples() |
| contentDetail | user content details to be added at the end but before getScreenshotCount(), may be null or an empty string |
Definition at line 1434 of file Scene.java.
| Shape com.jogamp.graph.ui.Scene.pickShape | ( | final PMVMatrix4f | pmv, |
| final Ray | ray, | ||
| final int | glWinX, | ||
| final int | glWinY, | ||
| final Vec3f | objPos, | ||
| final Shape.Visitor1 | visitor | ||
| ) |
Attempt to pick a Shape using the window coordinates and contained {@ling Shape}'s AABBox bounds using a ray-intersection algorithm in Z-axis descending order.
If Shape was found the given action is performed.
Method performs on current thread and returns after either a shaper is determined to be picked/active or probing every Shape w/o result.
| pmv | a new PMVMatrix4f which will be setup, shape-transformed and can be reused by the caller and runnable. |
| ray | temporary Ray storage, passed for reusage |
| glWinX | window X coordinate, bottom-left origin |
| glWinY | window Y coordinate, bottom-left origin |
| objPos | storage for found object position in model-space of found Shape |
| runnable | the action to perform if Shape was found |
Definition at line 1113 of file Scene.java.
| void com.jogamp.graph.ui.Scene.pickShapeGL | ( | final int | glWinX, |
| final int | glWinY, | ||
| final Vec3f | objPos, | ||
| final Shape[] | shape, | ||
| final Runnable | runnable | ||
| ) |
Attempt to pick a Shape using the OpenGL false color rendering.
If Shape was found the given action is performed on the rendering thread.
Method is non blocking and performs on rendering-thread, it returns immediately.
| glWinX | window X coordinate, bottom-left origin |
| glWinY | window Y coordinate, bottom-left origin |
| objPos | storage for found object position in model-space of found Shape |
| shape | storage for found Shape or null |
| runnable | the action to perform if Shape was found |
Definition at line 1000 of file Scene.java.
| void com.jogamp.graph.ui.Scene.releaseActiveShape | ( | ) |
| void com.jogamp.graph.ui.Scene.removeAllShapes | ( | final GL2ES2 | gl | ) |
Removes all given shapes and destroys them, convenient call for removeAllShapes(GL2ES2, RegionRenderer).
Definition at line 345 of file Scene.java.
| void com.jogamp.graph.ui.Scene.removeAllShapes | ( | final GL2ES2 | gl, |
| final RegionRenderer | renderer | ||
| ) |
Removes all contained shapes with Shape#destroy(GL2ES2, RegionRenderer).
Implements com.jogamp.graph.ui.Container.
Definition at line 338 of file Scene.java.
| void com.jogamp.graph.ui.Scene.removeGLEventListener | ( | final GLEventListener | listener | ) |
| boolean com.jogamp.graph.ui.Scene.removeShape | ( | final GL2ES2 | gl, |
| final RegionRenderer | renderer, | ||
| final Shape | s | ||
| ) |
Removes given shape with Shape#destroy(GL2ES2, RegionRenderer), if contained.
| gl | GL2ES2 context |
| renderer | |
| s | the shape to be removed |
Implements com.jogamp.graph.ui.Container.
Definition at line 308 of file Scene.java.
Removes given shape and destroy it, if contained - convenient call for removeShape(GL2ES2, RegionRenderer, Shape).
Definition at line 318 of file Scene.java.
Removes given shape, w/o Shape#destroy(GL2ES2, RegionRenderer).
Implements com.jogamp.graph.ui.Container.
Definition at line 292 of file Scene.java.
| void com.jogamp.graph.ui.Scene.removeShapes | ( | final Collection<? extends Shape > | shapes | ) |
Removes all given shapes, w/o Shape#destroy(GL2ES2, RegionRenderer).
Implements com.jogamp.graph.ui.Container.
Definition at line 301 of file Scene.java.
| void com.jogamp.graph.ui.Scene.removeShapes | ( | final GL2ES2 | gl, |
| final Collection<? extends Shape > | shapes | ||
| ) |
Removes all given shapes and destroys them, convenient call for removeShape(GL2ES2, RegionRenderer, Shape).
Definition at line 334 of file Scene.java.
| void com.jogamp.graph.ui.Scene.removeShapes | ( | final GL2ES2 | gl, |
| final RegionRenderer | renderer, | ||
| final Collection<? extends Shape > | shapes | ||
| ) |
Removes all given shapes with Shape#destroy(GL2ES2, RegionRenderer).
Implements com.jogamp.graph.ui.Container.
Definition at line 328 of file Scene.java.
| void com.jogamp.graph.ui.Scene.reshape | ( | final GLAutoDrawable | drawable, |
| final int | x, | ||
| final int | y, | ||
| final int | width, | ||
| final int | height | ||
| ) |
Reshape scene using setupMatrix(PMVMatrix4f, int, int, int, int) using PMVMatrixSetup.
Called by the drawable during the first repaint after the component has been resized.The client can update it's viewport associated data and view volume of the window appropriately. For efficiency the GL viewport has already been updated via glViewport(x, y, width, height) when this method is called.
| drawable | the triggering GLAutoDrawable |
| x | lower left corner of the viewport rectangle in pixel units |
| y | lower left corner of the viewport rectangle in pixel units |
| width | width of the viewport rectangle in pixel units |
| height | height of the viewport rectangle in pixel units |
Implements com.jogamp.opengl.GLEventListener.
Definition at line 458 of file Scene.java.
| void com.jogamp.graph.ui.Scene.screenshot | ( | final boolean | wait, |
| final File | file | ||
| ) |
Write current read drawable (screen) to a file on on the display call.
| wait | if true block until execution of screenshot GLRunnable is finished, otherwise return immediately w/o waiting |
| file | the target file to be used, consider using nextScreenshotFile(String, String, int, GLCapabilitiesImmutable, String) |
Definition at line 1477 of file Scene.java.
| void com.jogamp.graph.ui.Scene.screenshot | ( | final GL | gl, |
| final File | file | ||
| ) |
Write current read drawable (screen) to a file.
Best to be invoked on the display call, see screenshot(boolean, String).
| gl | current GL object |
| file | the target file to be used, consider using nextScreenshotFile(String, String, int, GLCapabilitiesImmutable, String) |
Definition at line 1461 of file Scene.java.
| int com.jogamp.graph.ui.Scene.setAAQuality | ( | final int | v | ) |
Sets RegionRenderer#setAAQuality(int).
Definition at line 383 of file Scene.java.
| void com.jogamp.graph.ui.Scene.setActiveShapeZOffsetScale | ( | final float | v | ) |
Sets the active Shape Z-Offset scale, defaults to DEFAULT_ACTIVE_ZOFFSET_SCALE.
Definition at line 927 of file Scene.java.
| void com.jogamp.graph.ui.Scene.setActiveTopLevelZOffsetScale | ( | final float | v | ) |
Sets the general top-level widget Z-Offset scale, defaults to DEFAULT_ACTIVE_TOPLEVEL_ZOFFSET_SCALE.
Definition at line 932 of file Scene.java.
| final void com.jogamp.graph.ui.Scene.setClearParams | ( | final float[] | clearColor, |
| final int | clearMask | ||
| ) |
Sets the clear parameter for glClearColor(..) and glClear(..) to be issued at display(GLAutoDrawable).
Without setting these parameter, user has to issue glClearColor(..) and glClear(..) before calling display(GLAutoDrawable).
| clearColor | glClearColor(..) arguments |
| clearMask | glClear(..) mask, default is GL#GL_COLOR_BUFFER_BIT | GL#GL_DEPTH_BUFFER_BIT |
Definition at line 221 of file Scene.java.
| final void com.jogamp.graph.ui.Scene.setPMvCullingEnabled | ( | final boolean | v | ) |
Enable or disable Project-Modelview (PMv) frustum culling per Shape for this container.
Default is disabled.
Implements com.jogamp.graph.ui.Container.
Definition at line 230 of file Scene.java.
| final void com.jogamp.graph.ui.Scene.setPMVMatrixSetup | ( | final PMVMatrixSetup | setup | ) |
Set a custom PMVMatrixSetup.
Definition at line 745 of file Scene.java.
| int com.jogamp.graph.ui.Scene.setSampleCount | ( | final int | v | ) |
Sets RegionRenderer#setSampleCount(int).
Definition at line 375 of file Scene.java.
| void com.jogamp.graph.ui.Scene.setSharpness | ( | final float | sharpness | ) |
Definition at line 385 of file Scene.java.
| void com.jogamp.graph.ui.Scene.setupMatrix | ( | final PMVMatrix4f | pmv | ) |
Setup PMVMatrix4f GLMatrixFunc#GL_PROJECTION and GLMatrixFunc#GL_MODELVIEW using implicit getViewport() surface dimension by calling getPMVMatrixSetup()'s PMVMatrixSetup#set(PMVMatrix4f, Recti).
| pmv | the PMVMatrix4f to setup |
Definition at line 762 of file Scene.java.
| void com.jogamp.graph.ui.Scene.setupMatrix | ( | final PMVMatrix4f | pmv, |
| final Recti | viewport | ||
| ) |
Setup PMVMatrix4f GLMatrixFunc#GL_PROJECTION and GLMatrixFunc#GL_MODELVIEW by calling getPMVMatrixSetup()'s PMVMatrixSetup#set(PMVMatrix4f, Recti).
| pmv | the PMVMatrix4f to setup |
| Recti | viewport |
Definition at line 753 of file Scene.java.
| void com.jogamp.graph.ui.Scene.surfaceToPlaneSize | ( | final Recti | viewport, |
| final float | zNear, | ||
| final float | zFar, | ||
| final float | objOrthoDist, | ||
| final Vec2f | objSceneSize | ||
| ) |
Map given window surface-size to object coordinates relative to this scene using the give projection parameters.
| viewport | viewport rectangle |
| zNear | custom DEFAULT_ZNEAR |
| zFar | custom DEFAULT_ZFAR |
| objOrthoDist | custom DEFAULT_SCENE_DIST |
| objSceneSize | Vec2f storage for object surface size result |
Definition at line 836 of file Scene.java.
| void com.jogamp.graph.ui.Scene.surfaceToPlaneSize | ( | final Recti | viewport, |
| final Vec2f | objSceneSize | ||
| ) |
Map given window surface-size to object coordinates relative to this scene using the default PMVMatrixSetup, i.e.
DEFAULT_ZNEAR, DEFAULT_ZFAR and DEFAULT_SCENE_DIST
| viewport | viewport rectangle |
| objSceneSize | Vec2f storage for object surface size result |
Definition at line 856 of file Scene.java.
| void com.jogamp.graph.ui.Scene.waitUntilDisplayed | ( | ) |
Blocks until first display(GLAutoDrawable) has completed after construction or dispose(GLAutoDrawable).
Definition at line 584 of file Scene.java.
|
static |
| pmv | |
| viewport | |
| zNear | |
| zFar | |
| winX | |
| winY | |
| objOrthoZ | |
| objPos | float[3] storage for object coord result |
| winZ |
Definition at line 819 of file Scene.java.
| void com.jogamp.graph.ui.Scene.winToShapeCoord | ( | final Shape | shape, |
| final int | glWinX, | ||
| final int | glWinY, | ||
| final PMVMatrix4f | pmv, | ||
| final Vec3f | objPos, | ||
| final Runnable | runnable | ||
| ) |
Calling Shape#winToObjCoord(Scene, int, int, float[]), retrieving its Shape object position.
| shape | |
| glWinX | in GL window coordinates, origin bottom-left |
| glWinY | in GL window coordinates, origin bottom-left |
| pmv | a new PMVMatrix4f which will be setup, shape-transformed and can be reused by the caller and runnable. |
| objPos | resulting object position |
| runnable | action |
Definition at line 662 of file Scene.java.
|
static |
Default Z precision scale, i.e.
multiple of DEFAULT_Z16_EPSILON for setActiveTopLevelZOffsetScale(float). Value is {@value}.
Definition at line 116 of file Scene.java.
|
static |
Default Z precision scale, i.e.
multiple of DEFAULT_Z16_EPSILON for setActiveShapeZOffsetScale(float). Value is {@value}.
Definition at line 114 of file Scene.java.
|
static |
Default projection angle in radians is PI/4, i.e.
45.0 degrees.
Definition at line 106 of file Scene.java.
|
static |
Default scene distance on z-axis to projection is -1/5f.
Definition at line 104 of file Scene.java.
|
static |
Default Z precision on 16-bit depth buffer using DEFAULT_SCENE_DIST z-position and DEFAULT_ZNEAR.
Value is 6.1033297E-6.
Definition at line 112 of file Scene.java.
|
static |
Default projection z-far value is {@value}.
Definition at line 110 of file Scene.java.
|
static |
Default projection z-near value is {@value}.
Definition at line 108 of file Scene.java.