Search in sources :

Example 1 with ConnectionGlyphStreamContext

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

the class ConnectionLabelBatcher method fillLabels.

private void fillLabels(final VisualAccess access, ConnectionGlyphStream glyphStream) throws InterruptedException {
    final ConnectionGlyphStreamContext context = new ConnectionGlyphStreamContext();
    for (int link = 0; link < access.getLinkCount(); link++) {
        final int connectionCount = access.getLinkConnectionCount(link);
        setCurrentConnection(access.getLinkLowVertex(link), access.getLinkHighVertex(link), connectionCount, context);
        for (int pos = 0; pos < connectionCount; pos++) {
            final int connection = access.getLinkConnection(link, pos);
            nextParallelConnection((int) (LabelUtilities.NRADIUS_TO_LINE_WIDTH_UNITS * Math.min(LabelUtilities.MAX_TRANSACTION_WIDTH, access.getConnectionWidth(connection))), context);
            final Matrix44f currentLabelInfo = access.isLabelSummary(connection) ? summaryLabelInfo : attributeLabelInfoReference;
            bufferLabel(connection, access, glyphStream, currentLabelInfo, context);
        }
    }
    glyphStream.trimToSize();
}
Also used : ConnectionGlyphStreamContext(au.gov.asd.tac.constellation.visual.opengl.utilities.glyphs.ConnectionGlyphStreamContext) Matrix44f(au.gov.asd.tac.constellation.utilities.graphics.Matrix44f)

Aggregations

Matrix44f (au.gov.asd.tac.constellation.utilities.graphics.Matrix44f)1 ConnectionGlyphStreamContext (au.gov.asd.tac.constellation.visual.opengl.utilities.glyphs.ConnectionGlyphStreamContext)1