Search in sources :

Example 1 with NodeGlyphStream

use of au.gov.asd.tac.constellation.visual.opengl.utilities.glyphs.NodeGlyphStream in project constellation by constellation-app.

the class NodeLabelBatcher method updateBottomLabels.

public GLRenderableUpdateTask updateBottomLabels(final VisualAccess access) throws InterruptedException {
    // We build the whole batch again - can't update labels in place at this stage.
    final NodeGlyphStream glyphStream = new NodeGlyphStream();
    fillBottomLabels(access, glyphStream);
    return gl -> {
        bottomBatch.dispose(gl);
        bottomBatch.initialise(glyphStream.getCurrentFloats().size() / FLOAT_BUFFERS_WIDTH);
        bottomBatch.buffer(gl, labelFloatsTarget, FloatBuffer.wrap(glyphStream.getCurrentFloats().rawArray()));
        bottomBatch.buffer(gl, labelIntsTarget, IntBuffer.wrap(glyphStream.getCurrentInts().rawArray()));
        bottomBatch.finalise(gl);
    };
}
Also used : NodeGlyphStream(au.gov.asd.tac.constellation.visual.opengl.utilities.glyphs.NodeGlyphStream) GL3(com.jogamp.opengl.GL3) TextureUnits(au.gov.asd.tac.constellation.visual.opengl.renderer.TextureUnits) SharedDrawable(au.gov.asd.tac.constellation.visual.opengl.utilities.SharedDrawable) FloatBuffer(java.nio.FloatBuffer) ConstellationColor(au.gov.asd.tac.constellation.utilities.color.ConstellationColor) LabelUtilities(au.gov.asd.tac.constellation.visual.opengl.utilities.LabelUtilities) IOException(java.io.IOException) ArrayList(java.util.ArrayList) GLRenderableUpdateTask(au.gov.asd.tac.constellation.visual.opengl.renderer.GLRenderable.GLRenderableUpdateTask) VisualAccess(au.gov.asd.tac.constellation.utilities.visual.VisualAccess) IntBuffer(java.nio.IntBuffer) Camera(au.gov.asd.tac.constellation.utilities.camera.Camera) NodeGlyphStreamContext(au.gov.asd.tac.constellation.visual.opengl.utilities.glyphs.NodeGlyphStreamContext) Matrix44f(au.gov.asd.tac.constellation.utilities.graphics.Matrix44f) GL(com.jogamp.opengl.GL) Collections(java.util.Collections) NodeGlyphStream(au.gov.asd.tac.constellation.visual.opengl.utilities.glyphs.NodeGlyphStream)

Example 2 with NodeGlyphStream

use of au.gov.asd.tac.constellation.visual.opengl.utilities.glyphs.NodeGlyphStream in project constellation by constellation-app.

the class NodeLabelBatcher method updateTopLabels.

public GLRenderableUpdateTask updateTopLabels(final VisualAccess access) throws InterruptedException {
    // We build the whole batch again - can't update labels in place at this stage.
    final NodeGlyphStream glyphStream = new NodeGlyphStream();
    fillTopLabels(access, glyphStream);
    return gl -> {
        topBatch.dispose(gl);
        topBatch.initialise(glyphStream.getCurrentFloats().size() / FLOAT_BUFFERS_WIDTH);
        topBatch.buffer(gl, labelFloatsTarget, FloatBuffer.wrap(glyphStream.getCurrentFloats().rawArray()));
        topBatch.buffer(gl, labelIntsTarget, IntBuffer.wrap(glyphStream.getCurrentInts().rawArray()));
        topBatch.finalise(gl);
    };
}
Also used : NodeGlyphStream(au.gov.asd.tac.constellation.visual.opengl.utilities.glyphs.NodeGlyphStream) GL3(com.jogamp.opengl.GL3) TextureUnits(au.gov.asd.tac.constellation.visual.opengl.renderer.TextureUnits) SharedDrawable(au.gov.asd.tac.constellation.visual.opengl.utilities.SharedDrawable) FloatBuffer(java.nio.FloatBuffer) ConstellationColor(au.gov.asd.tac.constellation.utilities.color.ConstellationColor) LabelUtilities(au.gov.asd.tac.constellation.visual.opengl.utilities.LabelUtilities) IOException(java.io.IOException) ArrayList(java.util.ArrayList) GLRenderableUpdateTask(au.gov.asd.tac.constellation.visual.opengl.renderer.GLRenderable.GLRenderableUpdateTask) VisualAccess(au.gov.asd.tac.constellation.utilities.visual.VisualAccess) IntBuffer(java.nio.IntBuffer) Camera(au.gov.asd.tac.constellation.utilities.camera.Camera) NodeGlyphStreamContext(au.gov.asd.tac.constellation.visual.opengl.utilities.glyphs.NodeGlyphStreamContext) Matrix44f(au.gov.asd.tac.constellation.utilities.graphics.Matrix44f) GL(com.jogamp.opengl.GL) Collections(java.util.Collections) NodeGlyphStream(au.gov.asd.tac.constellation.visual.opengl.utilities.glyphs.NodeGlyphStream)

Example 3 with NodeGlyphStream

use of au.gov.asd.tac.constellation.visual.opengl.utilities.glyphs.NodeGlyphStream in project constellation by constellation-app.

the class NodeLabelBatcher method createBatch.

@Override
public GLRenderableUpdateTask createBatch(final VisualAccess access) throws InterruptedException {
    final NodeGlyphStream topGlyphStream = new NodeGlyphStream();
    final NodeGlyphStream bottomGlyphStream = new NodeGlyphStream();
    fillTopLabels(access, topGlyphStream);
    fillBottomLabels(access, bottomGlyphStream);
    return gl -> {
        topBatch.initialise(topGlyphStream.getCurrentFloats().size() / FLOAT_BUFFERS_WIDTH);
        topBatch.buffer(gl, labelFloatsTarget, FloatBuffer.wrap(topGlyphStream.getCurrentFloats().rawArray()));
        topBatch.buffer(gl, labelIntsTarget, IntBuffer.wrap(topGlyphStream.getCurrentInts().rawArray()));
        topBatch.finalise(gl);
        bottomBatch.initialise(bottomGlyphStream.getCurrentFloats().size() / FLOAT_BUFFERS_WIDTH);
        bottomBatch.buffer(gl, labelFloatsTarget, FloatBuffer.wrap(bottomGlyphStream.getCurrentFloats().rawArray()));
        bottomBatch.buffer(gl, labelIntsTarget, IntBuffer.wrap(bottomGlyphStream.getCurrentInts().rawArray()));
        bottomBatch.finalise(gl);
    };
}
Also used : NodeGlyphStream(au.gov.asd.tac.constellation.visual.opengl.utilities.glyphs.NodeGlyphStream) GL3(com.jogamp.opengl.GL3) TextureUnits(au.gov.asd.tac.constellation.visual.opengl.renderer.TextureUnits) SharedDrawable(au.gov.asd.tac.constellation.visual.opengl.utilities.SharedDrawable) FloatBuffer(java.nio.FloatBuffer) ConstellationColor(au.gov.asd.tac.constellation.utilities.color.ConstellationColor) LabelUtilities(au.gov.asd.tac.constellation.visual.opengl.utilities.LabelUtilities) IOException(java.io.IOException) ArrayList(java.util.ArrayList) GLRenderableUpdateTask(au.gov.asd.tac.constellation.visual.opengl.renderer.GLRenderable.GLRenderableUpdateTask) VisualAccess(au.gov.asd.tac.constellation.utilities.visual.VisualAccess) IntBuffer(java.nio.IntBuffer) Camera(au.gov.asd.tac.constellation.utilities.camera.Camera) NodeGlyphStreamContext(au.gov.asd.tac.constellation.visual.opengl.utilities.glyphs.NodeGlyphStreamContext) Matrix44f(au.gov.asd.tac.constellation.utilities.graphics.Matrix44f) GL(com.jogamp.opengl.GL) Collections(java.util.Collections) NodeGlyphStream(au.gov.asd.tac.constellation.visual.opengl.utilities.glyphs.NodeGlyphStream)

Aggregations

Camera (au.gov.asd.tac.constellation.utilities.camera.Camera)3 ConstellationColor (au.gov.asd.tac.constellation.utilities.color.ConstellationColor)3 Matrix44f (au.gov.asd.tac.constellation.utilities.graphics.Matrix44f)3 VisualAccess (au.gov.asd.tac.constellation.utilities.visual.VisualAccess)3 GLRenderableUpdateTask (au.gov.asd.tac.constellation.visual.opengl.renderer.GLRenderable.GLRenderableUpdateTask)3 TextureUnits (au.gov.asd.tac.constellation.visual.opengl.renderer.TextureUnits)3 LabelUtilities (au.gov.asd.tac.constellation.visual.opengl.utilities.LabelUtilities)3 SharedDrawable (au.gov.asd.tac.constellation.visual.opengl.utilities.SharedDrawable)3 NodeGlyphStream (au.gov.asd.tac.constellation.visual.opengl.utilities.glyphs.NodeGlyphStream)3 NodeGlyphStreamContext (au.gov.asd.tac.constellation.visual.opengl.utilities.glyphs.NodeGlyphStreamContext)3 GL (com.jogamp.opengl.GL)3 GL3 (com.jogamp.opengl.GL3)3 IOException (java.io.IOException)3 FloatBuffer (java.nio.FloatBuffer)3 IntBuffer (java.nio.IntBuffer)3 ArrayList (java.util.ArrayList)3 Collections (java.util.Collections)3