Commit f83d10b0 authored by Benedikt Kleinmeier's avatar Benedikt Kleinmeier

In "ActionGenerateTikZ.java", added method "generateTikZCode()" with minimal...

In "ActionGenerateTikZ.java", added method "generateTikZCode()" with minimal code to generate agents.
parent 6d7f4d58
Pipeline #57844 passed with stage
in 45 seconds
......@@ -6,6 +6,7 @@ import org.vadere.gui.components.utils.Resources;
import org.vadere.gui.postvisualization.PostVisualisation;
import org.vadere.gui.postvisualization.utils.SVGGenerator;
import org.vadere.gui.postvisualization.view.PostvisualizationRenderer;
import org.vadere.state.scenario.Agent;
import javax.swing.*;
import java.awt.event.ActionEvent;
......@@ -42,7 +43,20 @@ public class ActionGenerateTikZ extends ActionVisualization {
outputFile = fileChooser.getSelectedFile().toString().endsWith(".svg") ? fileChooser.getSelectedFile()
: new File(fileChooser.getSelectedFile().toString() + ".svg");
// TODO: add code to generate TikZ code (get topography from "renderer").
svgGenerator.generateSVG(outputFile);
System.out.println(generateTikZCode());
// svgGenerator.generateSVG(outputFile);
}
}
private String generateTikZCode() {
String generatedText = "";
String agentTextPattern = "\\fill[blue] (%f,%f) circle (%fcm);\n";
for (Agent agent : model.getAgents()) {
generatedText += String.format(agentTextPattern, agent.getPosition().x, agent.getPosition().y, agent.getRadius());
}
return generatedText;
}
}
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment