In der Zeit vom 27.05.19 16 Uhr bis zum 28.05.19 10 Uhr steht die GitLab Instanz der RWTH Aachen nicht zur Verfügung. Es findet ein Umzug des angeschlossenen Storage Systems statt, so dass in der genannten Zeit keine Repositories angelegt, gelöscht oder verändert werden können. Wir bitten um Ihr Verständnis. // In the time from 27.05.19 16 o'clock to 28.05.19 10 o'clock the GitLab instance of the RWTH Aachen is not available. The connected storage system will be moved so that no repositories can be created, deleted or changed during this time. We ask for your understanding.

Commit f44058a5 authored by Martin Kröning's avatar Martin Kröning

Add documentation to MapWindowWrapper

parent 48f8a3b4
......@@ -7,18 +7,41 @@
#include <vector>
struct MapWindow;
/// A window showing a map, a list of vehicles and additional information
class MapWindowWrapper {
public:
/// Opens a MapWindow with \p windowTitle.
MapWindowWrapper(std::string_view windowTitle);
/// Adds a junction
///
/// The coordinates \p x and \p y mark the middle of the junction and
/// represent amounts of pixels.
void addJunction(double x, double y);
/// Adds a road
///
/// The coordinates have to be alternating values of x and y in pixels.
void addRoad(std::string_view laneThereName, std::string_view laneBackName,
const std::vector<double> &coordinates);
/// Adds or replaces a bicycle
///
/// \param positionOnLane The relative position of the vehicle on its lane
/// has to be between 0 and 1.
void addOrReplaceBicycle(std::string_view vehicleName,
std::string_view laneName, double positionOnLane,
double speed);
/// Adds or replaces a car
///
/// \param positionOnLane The relative position of the vehicle on its lane
/// has to be between 0 and 1.
void addOrReplaceCar(std::string_view vehicleName, std::string_view laneName,
double positionOnLane, double speed,
double remainingFuel);
/// Sets the time label to \p time
void setTimeLabel(std::chrono::minutes time);
private:
......
......@@ -4,6 +4,8 @@
#include <type_traits>
#include <vector>
/// Wraps MapWindow of pi2-view.h
/// Uses custom deleter of std::unique_ptr to properly destroy mapWindow
MapWindowWrapper::MapWindowWrapper(std::string_view windowTitle)
: mapWindow(mapWindowCreate(windowTitle.data()),
[](MapWindow *mapWindow) { mapWindowDestroy(mapWindow); }) {}
......
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