Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
9.2.2023: Due to updates GitLab will be unavailable for some minutes between 9:00 and 11:00.
Open sidebar
vadere
vadere
Commits
72af1aed
Commit
72af1aed
authored
Sep 03, 2018
by
Benedikt Kleinmeier
Browse files
In "TikzGenerator.java", added clipping at scenario bounds and fixed TODO.
parent
c9f5661d
Pipeline
#67443
failed with stages
in 55 minutes and 45 seconds
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
VadereGui/src/org/vadere/gui/postvisualization/utils/TikzGenerator.java
View file @
72af1aed
...
...
@@ -127,7 +127,16 @@ public class TikzGenerator {
DefaultSimulationConfig
config
=
model
.
getConfig
();
Topography
topography
=
model
.
getTopography
();
// Draw background elements first, then other scenario elements on toph.
// Clip everything outside of topography bound.
generatedCode
+=
"% Clipping\n"
;
String
clipTextPattern
=
"\\clip (%f,%f) rectangle (%f,%f);\n"
;
generatedCode
+=
String
.
format
(
clipTextPattern
,
topography
.
getBounds
().
x
,
topography
.
getBounds
().
y
,
topography
.
getBounds
().
x
+
topography
.
getBounds
().
width
,
topography
.
getBounds
().
y
+
topography
.
getBounds
().
height
);
// Draw background elements first, then other scenario elements.
generatedCode
+=
"% Ground\n"
;
String
groundTextPattern
=
(
config
.
isShowGrid
())
?
"\\draw[help lines] (%f,%f) grid (%f,%f);\n"
:
"\\fill[white] (%f,%f) rectangle (%f,%f);\n"
;
generatedCode
+=
String
.
format
(
groundTextPattern
,
...
...
@@ -255,9 +264,14 @@ public class TikzGenerator {
}
catch
(
ClassCastException
cce
)
{
logger
.
error
(
"Error casting to Pedestrian"
);
cce
.
printStackTrace
();
// TODO: render agent as circle!
// Fall back to default rendering of agents.
String
agentTextPattern
=
"\\fill[AgentColor] (%f,%f) circle [radius=%fcm];\n"
;
generatedCode
+=
String
.
format
(
agentTextPattern
,
agent
.
getPosition
().
x
,
agent
.
getPosition
().
y
,
agent
.
getRadius
());
}
}
else
{
// Do not draw agents as path for performance reasons. Usually, agents have a circular shape.
// generatedCode += String.format("\\fill[AgentColor] %s\n", generatePathForScenarioElement(agent));
String
agentTextPattern
=
"\\fill[AgentColor] (%f,%f) circle [radius=%fcm];\n"
;
generatedCode
+=
String
.
format
(
agentTextPattern
,
agent
.
getPosition
().
x
,
agent
.
getPosition
().
y
,
agent
.
getRadius
());
}
...
...
@@ -266,8 +280,6 @@ public class TikzGenerator {
String
agentTextPattern
=
"\\draw[magenta] (%f,%f) circle [radius=%fcm];\n"
;
generatedCode
+=
String
.
format
(
agentTextPattern
,
agent
.
getPosition
().
x
,
agent
.
getPosition
().
y
,
agent
.
getRadius
());
}
// Do not draw agents as path for performance reasons. Usually, agents have a circular shape.
// generatedCode += String.format("\\fill[AgentColor] %s\n", generatePathForScenarioElement(agent));
}
return
generatedCode
;
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment