Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Simonstrator
PeerfactSim.KOM
Commits
b8398839
Commit
b8398839
authored
Apr 24, 2020
by
Julian Zobel
Browse files
Viz for blocked graphhopper areas
parent
cd980908
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/de/tud/kom/p2psim/impl/topology/movement/modularosm/ModularMovementModelViz.java
View file @
b8398839
...
...
@@ -29,14 +29,20 @@ import java.awt.Point;
import
java.awt.RenderingHints
;
import
java.awt.geom.Point2D
;
import
java.util.LinkedHashMap
;
import
java.util.LinkedList
;
import
java.util.Map
;
import
javax.swing.JCheckBoxMenuItem
;
import
javax.swing.JComponent
;
import
javax.swing.JMenu
;
import
javax.swing.event.ChangeEvent
;
import
javax.swing.event.ChangeListener
;
import
com.graphhopper.util.PointList
;
import
com.graphhopper.util.shapes.GHPoint3D
;
import
de.tud.kom.p2psim.api.topology.movement.SimLocationActuator
;
import
de.tud.kom.p2psim.impl.topology.movement.local.AbstractLocalMovementStrategy
;
import
de.tud.kom.p2psim.impl.topology.movement.local.RealWorldStreetsMovement
;
import
de.tud.kom.p2psim.impl.topology.util.PositionVector
;
import
de.tud.kom.p2psim.impl.topology.views.VisualizationTopologyView
;
import
de.tud.kom.p2psim.impl.topology.views.VisualizationTopologyView.VisualizationInjector
;
...
...
@@ -153,6 +159,8 @@ public class ModularMovementModelViz extends JComponent
return
checkBox
;
}
public
static
LinkedList
<
PointList
>
paths
=
new
LinkedList
<
PointList
>();
@Override
public
void
paint
(
Graphics
g
)
{
super
.
paintComponent
(
g
);
...
...
@@ -176,6 +184,33 @@ public class ModularMovementModelViz extends JComponent
tVis
.
drawTrajectory
(
g2
);
}
}
g2
.
setColor
(
Color
.
black
);
PositionVector
p1
=
GPSCalculation
.
transformGPSWindowToOwnWorld
(
51.813680
,
8.783510
);
PositionVector
p2
=
GPSCalculation
.
transformGPSWindowToOwnWorld
(
51.806795
,
8.804239
);
g2
.
fillRect
(
VisualizationInjector
.
scaleValue
(
p1
.
getX
()),
VisualizationInjector
.
scaleValue
(
p1
.
getX
()),
VisualizationInjector
.
scaleValue
(
p2
.
getX
())
-
VisualizationInjector
.
scaleValue
(
p1
.
getX
()),
VisualizationInjector
.
scaleValue
(
p2
.
getY
())-
VisualizationInjector
.
scaleValue
(
p1
.
getY
()));
p1
=
GPSCalculation
.
transformGPSWindowToOwnWorld
(
51.821036
,
8.771151
);
p2
=
GPSCalculation
.
transformGPSWindowToOwnWorld
(
51.814987
,
8.779090
);
g2
.
fillRect
(
VisualizationInjector
.
scaleValue
(
p1
.
getX
()),
VisualizationInjector
.
scaleValue
(
p1
.
getX
()),
VisualizationInjector
.
scaleValue
(
p2
.
getX
()
-
p1
.
getX
()),
VisualizationInjector
.
scaleValue
(
p2
.
getY
()
-
p1
.
getY
()));
//
// for (PointList pointList : paths) {
// for (GHPoint3D temp : pointList) {
// PositionVector p = RealWorldStreetsMovement.transformGPSWindowToOwnWorld(temp.getLat(), temp.getLon());
//
// g2.fillOval(VisualizationInjector.scaleValue(p.getX()) - 2, VisualizationInjector.scaleValue(p.getY()) - 2, 4,4 );
// }
// }
}
@Override
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a 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