use of de.lmu.ifi.dbs.elki.visualization.gui.overview.PlotItem in project elki by elki-project.
the class ExportVisualizations method processNewResult.
@Override
public void processNewResult(ResultHierarchy hier, Result newResult) {
if (output.isFile()) {
throw new AbortException("Output folder cannot be an existing file.");
}
if (!output.exists() && !output.mkdirs()) {
throw new AbortException("Could not create output directory.");
}
if (this.baseResult == null) {
this.baseResult = newResult;
context = null;
counter = new HashMap<>();
LOG.warning("Note: Reusing visualization exporter for more than one result is untested.");
}
if (context == null) {
context = manager.newContext(hier, baseResult);
}
// Projected visualizations
Hierarchy<Object> vistree = context.getVisHierarchy();
for (It<Projector> iter2 = vistree.iterAll().filter(Projector.class); iter2.valid(); iter2.advance()) {
// TODO: allow selecting individual projections only.
Collection<PlotItem> items = iter2.get().arrange(context);
for (PlotItem item : items) {
processItem(item);
}
}
for (It<VisualizationTask> iter2 = vistree.iterAll().filter(VisualizationTask.class); iter2.valid(); iter2.advance()) {
VisualizationTask task = iter2.get();
if (vistree.iterParents(task).filter(Projector.class).valid()) {
continue;
}
PlotItem pi = new PlotItem(ratio, 1.0, null);
pi.add(task);
processItem(pi);
}
}
Aggregations