use of au.gov.asd.tac.constellation.utilities.visual.VisualAccess in project constellation by constellation-app.
the class VertexFlagsTexturiser method createTexture.
public GLRenderableUpdateTask createTexture(final VisualAccess access) {
final ByteBuffer flagsBuffer = Buffers.newDirectByteBuffer(access.getVertexCount());
for (int i = 0; i < access.getVertexCount(); i++) {
bufferFlagsInfo(i, flagsBuffer, access);
}
flagsBuffer.flip();
return gl -> vertexFlagsTexture = new ByteTextureBuffer(gl, flagsBuffer);
}
use of au.gov.asd.tac.constellation.utilities.visual.VisualAccess 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);
};
}
use of au.gov.asd.tac.constellation.utilities.visual.VisualAccess 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);
};
}
use of au.gov.asd.tac.constellation.utilities.visual.VisualAccess in project constellation by constellation-app.
the class ConnectionLabelBatcher method setLabelColors.
public GLRenderableUpdateTask setLabelColors(final VisualAccess access) {
final int numConnectionLabels = Math.min(LabelUtilities.MAX_LABELS_TO_DRAW, access.getConnectionAttributeLabelCount());
for (int i = 0; i < numConnectionLabels; i++) {
final ConstellationColor labelColor = access.getConnectionLabelColor(i);
attributeLabelInfoReference.setRow(labelColor.getRed(), labelColor.getGreen(), labelColor.getBlue(), attributeLabelInfoReference.get(i, 3), i);
}
return gl -> attributeLabelInfo.set(attributeLabelInfoReference);
}
use of au.gov.asd.tac.constellation.utilities.visual.VisualAccess in project constellation by constellation-app.
the class FpsBatcher method createBatch.
@Override
public GLRenderableUpdateTask createBatch(final VisualAccess access) {
final FloatBuffer colorBuffer = Buffers.newDirectFloatBuffer(COLOR_BUFFER_WIDTH * 2);
bufferColorInfo(0, colorBuffer, ConstellationColor.WHITE);
bufferColorInfo(1, colorBuffer, ConstellationColor.WHITE);
colorBuffer.flip();
final IntBuffer iconBuffer = Buffers.newDirectIntBuffer(ICON_BUFFER_WIDTH * 2);
bufferIconInfo(0, iconBuffer, 0, 0);
bufferIconInfo(1, iconBuffer, 0, 0);
iconBuffer.flip();
return gl -> {
batch.initialise(2);
batch.buffer(gl, colorTarget, colorBuffer);
batch.buffer(gl, iconTarget, iconBuffer);
// Ensure that the icons for the digits are loaded into the texture
for (int digit = 0; digit < 10; digit++) {
GLTools.LOADED_ICON_HELPER.addIcon(Integer.toString(digit));
}
updateIconTexture(gl);
batch.finalise(gl);
};
}
Aggregations