use of au.gov.asd.tac.constellation.visual.opengl.renderer.GLVisualProcessor in project constellation by constellation-app.
the class GLVisualProcessorGraphTester method main.
public static void main(String[] args) {
final GLVisualProcessorDemo demo = new GLVisualProcessorDemo();
final StoreGraph graph = createGraph();
final Graph dualGraph = new DualGraph(graph, false);
final GraphVisualAccess access = new GraphVisualAccess(dualGraph);
final GLVisualProcessor processor = new GLVisualProcessor();
final VisualManager visualManager = new VisualManager(access, processor);
processor.startVisualising(visualManager);
demo.runDemo(processor, visualManager);
final GraphChangeListener gct = (event) -> visualManager.updateFromIndigenousChanges();
gct.graphChanged(null);
try {
Thread.sleep(3000);
} catch (InterruptedException ex) {
}
try {
WritableGraph wg = dualGraph.getWritableGraph("linkmode", false);
try {
final int connectionModeAttr = VisualConcept.GraphAttribute.CONNECTION_MODE.ensure(wg);
wg.setObjectValue(connectionModeAttr, 0, ConnectionMode.LINK);
} finally {
wg.commit();
}
} catch (InterruptedException ex) {
}
gct.graphChanged(null);
try {
Thread.sleep(2000);
} catch (InterruptedException ex) {
}
try {
WritableGraph wg = dualGraph.getWritableGraph("transmode", false);
try {
final int connectionModeAttr = VisualConcept.GraphAttribute.CONNECTION_MODE.ensure(wg);
wg.setObjectValue(connectionModeAttr, 0, ConnectionMode.TRANSACTION);
} finally {
wg.commit();
}
} catch (InterruptedException ex) {
}
gct.graphChanged(null);
try {
Thread.sleep(2000);
} catch (InterruptedException ex) {
}
final int[] changed = new int[] { 0, 1 };
try {
WritableGraph wg = dualGraph.getWritableGraph("blazin", false);
try {
final int blazeAttr = VisualConcept.VertexAttribute.BLAZE.ensure(wg);
for (int i = 0; i < 10000; i++) {
try {
Thread.sleep(1);
} catch (InterruptedException ex) {
}
wg.setObjectValue(blazeAttr, 0, new Blaze(((Blaze) wg.getObjectValue(blazeAttr, 0)).getAngle() + 1, ConstellationColor.BLUE));
wg = wg.flush(false);
visualManager.addSingleChangeOperation(new VisualChangeBuilder(VisualProperty.VERTEX_BLAZE_ANGLE).forItems(changed).build());
}
} finally {
wg.commit();
}
} catch (InterruptedException ex) {
}
}
use of au.gov.asd.tac.constellation.visual.opengl.renderer.GLVisualProcessor in project constellation by constellation-app.
the class GLVisualProcessorTester method main.
public static void main(String[] args) {
final GLVisualProcessorDemo demo = new GLVisualProcessorDemo();
final VisualAccess access = new DummyVisualAccess();
final GLVisualProcessor processor = new GLVisualProcessor();
final VisualManager visualManager = new VisualManager(access, processor);
processor.startVisualising(visualManager);
demo.runDemo(processor, visualManager);
final List<VisualChange> changeSet = new ArrayList<>();
changeSet.add(new VisualChangeBuilder(VisualProperty.VERTICES_REBUILD).build());
changeSet.add(new VisualChangeBuilder(VisualProperty.CONNECTIONS_REBUILD).build());
changeSet.add(new VisualChangeBuilder(VisualProperty.BACKGROUND_COLOR).build());
changeSet.add(new VisualChangeBuilder(VisualProperty.HIGHLIGHT_COLOUR).build());
changeSet.add(new VisualChangeBuilder(VisualProperty.CONNECTIONS_OPACITY).build());
changeSet.add(new VisualChangeBuilder(VisualProperty.BLAZE_SIZE).build());
changeSet.add(new VisualChangeBuilder(VisualProperty.DRAW_FLAGS).build());
changeSet.add(new VisualChangeBuilder(VisualProperty.CAMERA).build());
changeSet.add(new VisualChangeBuilder(VisualProperty.TOP_LABELS_REBUILD).build());
changeSet.add(new VisualChangeBuilder(VisualProperty.BOTTOM_LABELS_REBUILD).build());
changeSet.add(new VisualChangeBuilder(VisualProperty.CONNECTION_LABELS_REBUILD).build());
visualManager.addMultiChangeOperation(changeSet);
try {
Thread.sleep(3000);
} catch (InterruptedException ex) {
}
for (int i = 0; i < 10; i++) {
((DummyVisualAccess) access).zoomOut();
visualManager.addSingleChangeOperation(new VisualChangeBuilder(VisualProperty.CAMERA).build());
try {
Thread.sleep(250);
} catch (InterruptedException ex) {
}
}
}
Aggregations