Public Member Functions | |
void | drawMovingObjects (Graphics2D g2d) |
void | drawScale (BufferedImage image) |
synchronized void | drawStaticObjects (BufferedImage image) |
synchronized void | pan (char direction) |
synchronized void | pan (double x, double y) |
synchronized void | setMapZoom (double zoom) |
synchronized void | updateParams () |
void | ReRender (boolean fullRender, boolean forceRenderNow) |
double | getMiddleX () |
double | getMiddleY () |
double | getMapZoom () |
int | getTimePassed () |
AffineTransform | getTransform () |
void | notifySimulationRunning (boolean running) |
synchronized void | setMarkedStreet (Street markedStreet) |
synchronized void | setMarkedVehicle (Vehicle markedVehicle) |
synchronized Vehicle | getMarkedVehicle () |
synchronized void | setAttackerVehicle (Vehicle attackerVehicle) |
synchronized Vehicle | getAttackerVehicle () |
synchronized void | setMiddle (int x, int y) |
void | setDrawArea (DrawingArea drawArea) |
void | setDrawHeight (int drawHeight) |
void | setDrawWidth (int drawWidth) |
void | setTimePassed (int timePassed) |
void | setBarrierForSimulationMaster (CyclicBarrier barrier) |
void | setHighlightNodes (boolean highlightNodes) |
void | setHighlightCommunication (boolean highlightCommunication) |
void | setHideMixZones (boolean hideMixZones) |
void | setDisplayVehicleIDs (boolean displayVehicleIDs) |
void | setShowAllBlockings (boolean showAllBlockings) |
void | setShowBeaconMonitorZone (boolean showBeaconMonitorZone) |
void | setMonitoredBeaconZoneVariables (int beaconMonitorMinX, int beaconMonitorMaxX, int beaconMonitorMinY, int beaconMonitorMaxY) |
void | setShowVehicles (boolean showVehicles) |
boolean | isShowVehicles () |
void | setShowMixZones (boolean showMixZones) |
boolean | isShowMixZones () |
void | setAutoAddMixZones (boolean autoAddMixZones) |
boolean | isAutoAddMixZones () |
void | setShowRSUs (boolean showRSUs) |
boolean | isShowRSUs () |
Vehicle | getAttackedVehicle () |
void | setAttackedVehicle (Vehicle attackedVehicle_) |
boolean | isShowAttackers () |
void | setShowAttackers (boolean showAttackers_) |
boolean | isConsoleStart () |
void | setConsoleStart (boolean consoleStart) |
void | setMarkedJunction_ (Junction markedJunction_) |
Junction | getMarkedJunction_ () |
ArrayList< String > | getLocationInformationMix () |
void | setLocationInformationMix (ArrayList< String > locationInformation) |
ArrayList< String > | getLocationInformationSilentPeriod_ () |
void | setLocationInformationSilentPeriod_ (ArrayList< String > locationInformationSilentPeriod_) |
int | getMixZoneAmount () |
void | setMixZoneAmount (int mixZoneAmount) |
Static Public Member Functions | |
static Renderer | getInstance () |
This class performs all rendering tasks.
|
inline |
This function renders all non-static objects on the supplied Graphics2D
object.
g2d | the Graphics2D object on which rendering takes place |
|
inline |
Creates an image to see the current scale.
image | the BufferedImage on which rendering should be done |
|
inline |
This function renders all non-moving objects on a supplied image. All streets and other static objects are rendered into the cached Image in this function. This function should only be called on
Note: The main performance factor here are the calls to draw()
or drawLine()
. This is a factor determined by the underlying graphics subsytem and there's not much space for lot of improvement. Multithreading approaches are not possible here: The graphics subsystem is just singlethreaded (blocks concurrent draw-Calls even if they are done on different BufferedImages) and so there's no performance benefit.
Optimizing anything concerned with iterating through the regions is not worth it because the cpu time for this is barely measurable after using ArrayLists
instead of Iterators
(iterators create lots of object creations and calls)
image | the BufferedImage on which rendering should be done |
|
inline |
Gets the attacker vehicle.
|
inlinestatic |
Gets the single instance of this renderer.
|
inline |
Gets the current zooming factor.
|
inline |
|
inline |
Gets a marked vehicle.
|
inline |
Gets the x coordinate of the middle of the current view.
|
inline |
Gets the y coordinate of the middle of the current view.
|
inline |
Gets the time passed since simulation start.
|
inline |
Gets the currently active coordinate transformation.
|
inline |
Gets if mix zones are added automatically on each street corner
|
inline |
Gets if mix zones are displayed
|
inline |
Gets if RSUs are displayed
|
inline |
Gets if vehicles are displayed.
true
if vehicles are displayed
|
inline |
Notify if the simulation is running or not.
running | true if a simulation is currently running, false if it's suspended |
|
inline |
Pans the viewable area.
direction | u to pan up, d to pan down, l to pan left, r to pan right |
|
inline |
Pans the viewable area.
x | the value for how far to pan in x direction (in map scale!) |
y | the value for how far to pan in y direction (in map scale!) |
|
inline |
Schedules an update of the DrawingArea. Note that depending on if a simulation is running or not, the update might be performed at a later time!
fullRender | true if a full update including all static objects should be done, else false |
forceRenderNow | true to force an immediate update regardless of consistency considerations (should only be used by the vanetsim.simulation.SimulationMaster) |
|
inline |
Sets a new attacker vehicle.
attackerVehicle | the attacker vehicle |
|
inline |
If you want to add mix zones to all street corners automatically.
autoAddMixZones | true if you want to add mix zones to all street corners automatically else false |
|
inline |
Sets the barrier for synchronization with the SimulationMaster.
barrier | the barrier to use |
|
inline |
If the IDs of the vehicle shall be drawn on the map.
displayVehicleIDs | true if you want to show the IDs, else false |
|
inline |
Sets the DrawingArea this Renderer is associated with.
drawArea | the area on which this Renderer draws |
|
inline |
Set the height of the DrawingArea.
drawHeight | the new height |
|
inline |
Set the width of the DrawingArea.
drawWidth | the new width |
|
inline |
If filled circles shall be displayed to hide the mix zones.
hideMixZones | true if you want to show the circles, else false |
|
inline |
If circles shall be displayed to show communication distance.
highlightCommunication | true if you want to show the circles, else false |
|
inline |
If all nodes shall be highlighted.
highlightNodes | true if you want to highlight nodes, else false |
|
inline |
Sets a new zooming factor.
zoom | the new zooming factor |
|
inline |
markedJunction_ | the markedJunction_ to set |
|
inline |
Sets a new marked street.
markedStreet | the street to mark |
|
inline |
Sets a new marked vehicle.
markedVehicle | the vehicle to mark |
|
inline |
Sets the coordinates of the center of the viewable area.
x | the new x coordinate for the center of the viewable area |
y | the new y coordinate for the center of the viewable area |
|
inline |
Sets the values for the monitored beacon zone. A rectangular bounding box within the specified coordinates is monitored if setShowBeaconMonitorZone(boolean) is set to true
.
beaconMonitorMinX | the minimum x coordinate |
beaconMonitorMaxX | the maximum x coordinate |
beaconMonitorMinY | the minimum y coordinate |
beaconMonitorMaxY | the maximum y coordinate |
|
inline |
If you want to show all blockings.
showAllBlockings | true if you want to show all blockings, else false |
|
inline |
If you want to display the monitored beacon zone.
showBeaconMonitorZone | true if you want to display the monitored beacon zones, else false |
|
inline |
If you want to show all mix zones.
showMixZones | true if you want to show all mix zones, else false |
|
inline |
If you want to show all RSUs.
showRSUs | true if you want to show all RSUs, else false |
|
inline |
If you want to show all vehicles.
showVehicles | true if you want to show all vehicles, else false |
|
inline |
Sets the time passed since simulation start.
timePassed | the new time in milliseconds |
|
inline |
Updates various internal parameters after changes through panning or zooming.
The regions which shall be drawn are calculated here. They are a little bit larger than normally necessary in order to correctly display communication distance and mix zones. Otherwise, the distance of a vehicle, which is a little bit outside the currently viewable area wouldn't be drawn. This all induces a little bit of an unnecessary overdraw to the static objects but this should not matter a lot.