Search in sources :

Example 1 with ConnectionGlyphStream

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

the class ConnectionLabelBatcher method createBatch.

@Override
public GLRenderableUpdateTask createBatch(final VisualAccess access) throws InterruptedException {
    final ConnectionGlyphStream glyphStream = new ConnectionGlyphStream();
    fillLabels(access, glyphStream);
    return gl -> {
        labelBatch.initialise(glyphStream.getCurrentFloats().size() / FLOAT_BUFFER_WIDTH);
        labelBatch.buffer(gl, intsTarget, IntBuffer.wrap(glyphStream.getCurrentInts().rawArray()));
        labelBatch.buffer(gl, floatsTarget, FloatBuffer.wrap(glyphStream.getCurrentFloats().rawArray()));
        labelBatch.finalise(gl);
    };
}
Also used : 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) ConnectionGlyphStream(au.gov.asd.tac.constellation.visual.opengl.utilities.glyphs.ConnectionGlyphStream) 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) VisualGraphDefaults(au.gov.asd.tac.constellation.graph.visual.framework.VisualGraphDefaults) Camera(au.gov.asd.tac.constellation.utilities.camera.Camera) Matrix44f(au.gov.asd.tac.constellation.utilities.graphics.Matrix44f) ConnectionGlyphStreamContext(au.gov.asd.tac.constellation.visual.opengl.utilities.glyphs.ConnectionGlyphStreamContext) GL(com.jogamp.opengl.GL) ConnectionGlyphStream(au.gov.asd.tac.constellation.visual.opengl.utilities.glyphs.ConnectionGlyphStream)

Example 2 with ConnectionGlyphStream

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

the class ConnectionLabelBatcher method updateLabels.

public GLRenderableUpdateTask updateLabels(final VisualAccess access) throws InterruptedException {
    // We build the whole batch again - can't update labels in place at this stage.
    final ConnectionGlyphStream glyphStream = new ConnectionGlyphStream();
    fillLabels(access, glyphStream);
    return gl -> {
        labelBatch.dispose(gl);
        labelBatch.initialise(glyphStream.getCurrentFloats().size() / FLOAT_BUFFER_WIDTH);
        labelBatch.buffer(gl, intsTarget, IntBuffer.wrap(glyphStream.getCurrentInts().rawArray()));
        labelBatch.buffer(gl, floatsTarget, FloatBuffer.wrap(glyphStream.getCurrentFloats().rawArray()));
        labelBatch.finalise(gl);
    };
}
Also used : 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) ConnectionGlyphStream(au.gov.asd.tac.constellation.visual.opengl.utilities.glyphs.ConnectionGlyphStream) 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) VisualGraphDefaults(au.gov.asd.tac.constellation.graph.visual.framework.VisualGraphDefaults) Camera(au.gov.asd.tac.constellation.utilities.camera.Camera) Matrix44f(au.gov.asd.tac.constellation.utilities.graphics.Matrix44f) ConnectionGlyphStreamContext(au.gov.asd.tac.constellation.visual.opengl.utilities.glyphs.ConnectionGlyphStreamContext) GL(com.jogamp.opengl.GL) ConnectionGlyphStream(au.gov.asd.tac.constellation.visual.opengl.utilities.glyphs.ConnectionGlyphStream)

Aggregations

VisualGraphDefaults (au.gov.asd.tac.constellation.graph.visual.framework.VisualGraphDefaults)2 Camera (au.gov.asd.tac.constellation.utilities.camera.Camera)2 ConstellationColor (au.gov.asd.tac.constellation.utilities.color.ConstellationColor)2 Matrix44f (au.gov.asd.tac.constellation.utilities.graphics.Matrix44f)2 VisualAccess (au.gov.asd.tac.constellation.utilities.visual.VisualAccess)2 GLRenderableUpdateTask (au.gov.asd.tac.constellation.visual.opengl.renderer.GLRenderable.GLRenderableUpdateTask)2 TextureUnits (au.gov.asd.tac.constellation.visual.opengl.renderer.TextureUnits)2 LabelUtilities (au.gov.asd.tac.constellation.visual.opengl.utilities.LabelUtilities)2 SharedDrawable (au.gov.asd.tac.constellation.visual.opengl.utilities.SharedDrawable)2 ConnectionGlyphStream (au.gov.asd.tac.constellation.visual.opengl.utilities.glyphs.ConnectionGlyphStream)2 ConnectionGlyphStreamContext (au.gov.asd.tac.constellation.visual.opengl.utilities.glyphs.ConnectionGlyphStreamContext)2 GL (com.jogamp.opengl.GL)2 GL3 (com.jogamp.opengl.GL3)2 IOException (java.io.IOException)2 FloatBuffer (java.nio.FloatBuffer)2 IntBuffer (java.nio.IntBuffer)2 ArrayList (java.util.ArrayList)2