Notice: If you are member of any public project or group, please make sure that your GitLab username is not the same as the LRZ identifier/Kennung (see https://gitlab.lrz.de/profile/account). Please change your username if necessary. For more information see the section "Public projects / Öffentliche Projekte" at https://doku.lrz.de/display/PUBLIC/GitLab . Thank you!

Commit e87f9542 authored by Benedikt Kleinmeier's avatar Benedikt Kleinmeier

Process measurement areas in "TikzGenerator".

parent 8a6bf222
...@@ -127,6 +127,9 @@ public class TikzGenerator { ...@@ -127,6 +127,9 @@ public class TikzGenerator {
Color stairColor = model.getConfig().getStairColor(); Color stairColor = model.getConfig().getStairColor();
colorDefinitions += String.format(Locale.US, colorTextPattern, "StairColor", stairColor.getRed(), stairColor.getGreen(), stairColor.getBlue()); colorDefinitions += String.format(Locale.US, colorTextPattern, "StairColor", stairColor.getRed(), stairColor.getGreen(), stairColor.getBlue());
Color measurementAreaColor = model.getConfig().getMeasurementAreaColor();
colorDefinitions += String.format(Locale.US, colorTextPattern, "MeasurementAreaColor", measurementAreaColor.getRed(), measurementAreaColor.getGreen(), measurementAreaColor.getBlue());
Color agentColor = model.getConfig().getPedestrianDefaultColor(); Color agentColor = model.getConfig().getPedestrianDefaultColor();
colorDefinitions += String.format(Locale.US, colorTextPattern, "AgentColor", agentColor.getRed(), agentColor.getGreen(), agentColor.getBlue()); colorDefinitions += String.format(Locale.US, colorTextPattern, "AgentColor", agentColor.getRed(), agentColor.getGreen(), agentColor.getBlue());
...@@ -142,16 +145,18 @@ public class TikzGenerator { ...@@ -142,16 +145,18 @@ public class TikzGenerator {
String drawSettings = "% Draw Settings\n"; String drawSettings = "% Draw Settings\n";
double agentRadius = model.getConfig().getPedestrianTorso() / 2.0; double agentRadius = model.getConfig().getPedestrianTorso() / 2.0;
double opacityBetweenZeroAndOne = model.getConfig().getMeasurementAreaAlpha() / 255.0;
drawSettings += String.format(Locale.US,"\\newcommand{\\AgentRadius}{%f}\n", agentRadius); drawSettings += String.format(Locale.US,"\\newcommand{\\AgentRadius}{%f}\n", agentRadius);
drawSettings += String.format(Locale.US,"\\newcommand{\\LineWidth}{%d}\n", 1); drawSettings += String.format(Locale.US,"\\newcommand{\\LineWidth}{%d}\n", 1);
drawSettings += String.format(Locale.US,"\\newcommand{\\MeasurementAreaOpacity}{%f}\n", opacityBetweenZeroAndOne);
drawSettings += "\n"; drawSettings += "\n";
return drawSettings; return drawSettings;
} }
private String convertScenarioElementsToTikz() { private String convertScenarioElementsToTikz() {
String generatedCode = ""; String generatedCode = "";
DefaultSimulationConfig config = model.getConfig(); DefaultSimulationConfig config = model.getConfig();
...@@ -221,6 +226,15 @@ public class TikzGenerator { ...@@ -221,6 +226,15 @@ public class TikzGenerator {
generatedCode += "% Stairs (not enabled in config)\n"; generatedCode += "% Stairs (not enabled in config)\n";
} }
if (config.isShowMeasurementArea()) {
generatedCode += "% Measurement Areas\n";
for (MeasurementArea measurementArea : topography.getMeasurementAreas()) {
generatedCode += String.format(Locale.US, "\\fill[MeasurementAreaColor,opacity=\\MeasurementAreaOpacity] %s;\n", generatePathForScenarioElement(measurementArea));
}
} else {
generatedCode += "% Measurement Areas (not enabled in config)\n";
}
if (config.isShowTrajectories()) { if (config.isShowTrajectories()) {
generatedCode += "% Trajectories\n"; generatedCode += "% Trajectories\n";
......
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