# josiashod/reseau_v2v architecture

> Architecture diagram of the GitHub repository josiashod/reseau_v2v, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-10-15). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/josiashod/reseau_v2v
- Repository: https://github.com/josiashod/reseau_v2v

## Overview

reseau_v2v is a Qt desktop application for simulating vehicle-to-vehicle activity on OpenStreetMap data. The user loads a map, which is parsed into features and rendered while car-eligible roads populate a routing graph; cars then move along routes under simulation controls, with radio coverage and vehicle connections visualized on the map. The README also documents building layers for buildings, water, and parks, though their rendering implementation was not sampled. Some links to unsampled UI behavior are omitted or marked unverified.

Main entry points: [`ui/widgets/mapwidget.cpp`](https://github.com/josiashod/reseau_v2v/blob/compress/ui/widgets/mapwidget.cpp) (Map display and layers), [`ui/windows/mainwindow.cpp`](https://github.com/josiashod/reseau_v2v/blob/compress/ui/windows/mainwindow.cpp) (Main window controls), [`core/car.cpp`](https://github.com/josiashod/reseau_v2v/blob/compress/core/car.cpp) (Moving vehicle), [`ui/dialog/addcardialog.cpp`](https://github.com/josiashod/reseau_v2v/blob/compress/ui/dialog/addcardialog.cpp) (Add-car dialog)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_interface["Desktop interface"]
  node_app["Application startup<br/>[main.cpp]"]
  node_window["Main window controls<br/>[mainwindow.cpp]"]
  node_car_dialog["Add-car dialog<br/>[addcardialog.cpp]"]
  node_logs["Simulation logs<br/>[logwidget.cpp]"]
end

subgraph group_mapping["Map ingestion and display"]
  node_osm_reader["OSM parser<br/>[osmreader.cpp]"]
  node_map_view["Map display and layers<br/>[mapwidget.cpp]"]
  node_map_data["Parsed map features<br/>[osmreader.h]"]
  node_map_file["OSM map file<br/>[map.osm]"]
  node_hexagons["Territorial mesh<br/>[hexagon.cpp]"]
end

subgraph group_routing["Road routing"]
  node_road_filter["Car-road filter<br/>[way.cpp]"]
  node_road_graph["Road graph<br/>[graph.cpp]"]
  node_pathfinder["A-star routing<br/>[graph.cpp]"]
end

subgraph group_simulation["Vehicle simulation"]
  node_car["Moving vehicle<br/>[car.cpp]"]
  node_coverage["Radio coverage<br/>[car.cpp]"]
  node_v2v["Vehicle connections<br/>[car.cpp]"]
end

node_user(("Map user"))

node_user -->|"launches"| node_app
node_app -->|"creates"| node_window
node_user -->|"controls"| node_window
node_user -.->|"sets parameters"| node_car_dialog
node_car_dialog -->|"emits car settings"| node_window
node_window -.->|"requests map load"| node_map_view
node_map_view -->|"parses file"| node_osm_reader
node_map_view -->|"loads default"| node_map_file
node_osm_reader -->|"produces features"| node_map_data
node_map_view -->|"reads features"| node_map_data
node_map_view -->|"checks road type"| node_road_filter
node_road_filter -->|"selects car roads"| node_road_graph
node_map_view -->|"adds road nodes"| node_road_graph
node_window -->|"requests routes"| node_pathfinder
node_pathfinder -->|"searches graph"| node_road_graph
node_window -->|"creates and ticks"| node_car
node_car_dialog -.->|"supplies settings"| node_car
node_car -.->|"calculates coverage"| node_coverage
node_car -.->|"updates connections"| node_v2v
node_hexagons -.->|"checks connections"| node_car
node_window -->|"writes messages"| node_logs
node_map_view -->|"writes load details"| node_logs

click node_app "https://github.com/josiashod/reseau_v2v/blob/compress/main.cpp"
click node_window "https://github.com/josiashod/reseau_v2v/blob/compress/ui/windows/mainwindow.cpp"
click node_car_dialog "https://github.com/josiashod/reseau_v2v/blob/compress/ui/dialog/addcardialog.cpp"
click node_logs "https://github.com/josiashod/reseau_v2v/blob/compress/ui/widgets/logwidget.cpp"
click node_osm_reader "https://github.com/josiashod/reseau_v2v/blob/compress/utils/osmreader.cpp"
click node_map_view "https://github.com/josiashod/reseau_v2v/blob/compress/ui/widgets/mapwidget.cpp"
click node_map_data "https://github.com/josiashod/reseau_v2v/blob/compress/utils/osmreader.h"
click node_map_file "https://github.com/josiashod/reseau_v2v/blob/compress/lib/map.osm"
click node_road_filter "https://github.com/josiashod/reseau_v2v/blob/compress/core/way.cpp"
click node_road_graph "https://github.com/josiashod/reseau_v2v/blob/compress/core/graph.cpp"
click node_pathfinder "https://github.com/josiashod/reseau_v2v/blob/compress/core/graph.cpp"
click node_car "https://github.com/josiashod/reseau_v2v/blob/compress/core/car.cpp"
click node_coverage "https://github.com/josiashod/reseau_v2v/blob/compress/core/car.cpp"
click node_v2v "https://github.com/josiashod/reseau_v2v/blob/compress/core/car.cpp"
click node_hexagons "https://github.com/josiashod/reseau_v2v/blob/compress/core/hexagon.cpp"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_app,node_window,node_car_dialog,node_logs,node_user toneBlue
class node_osm_reader,node_map_view,node_map_data,node_map_file,node_hexagons toneAmber
class node_road_filter,node_road_graph,node_pathfinder toneMint
class node_car,node_coverage,node_v2v toneRose
```

## Components

### Desktop interface

- [Application startup](https://github.com/josiashod/reseau_v2v/blob/compress/main.cpp): `main.cpp`
- [Main window controls](https://github.com/josiashod/reseau_v2v/blob/compress/ui/windows/mainwindow.cpp): `ui/windows/mainwindow.cpp`
- [Add-car dialog](https://github.com/josiashod/reseau_v2v/blob/compress/ui/dialog/addcardialog.cpp): `ui/dialog/addcardialog.cpp`
- [Simulation logs](https://github.com/josiashod/reseau_v2v/blob/compress/ui/widgets/logwidget.cpp): `ui/widgets/logwidget.cpp`

### Map ingestion and display

- [OSM parser](https://github.com/josiashod/reseau_v2v/blob/compress/utils/osmreader.cpp): `utils/osmreader.cpp`
- [Map display and layers](https://github.com/josiashod/reseau_v2v/blob/compress/ui/widgets/mapwidget.cpp): `ui/widgets/mapwidget.cpp`
- [Parsed map features](https://github.com/josiashod/reseau_v2v/blob/compress/utils/osmreader.h): `utils/osmreader.h`
- [OSM map file](https://github.com/josiashod/reseau_v2v/blob/compress/lib/map.osm): `lib/map.osm`
- [Territorial mesh](https://github.com/josiashod/reseau_v2v/blob/compress/core/hexagon.cpp): `core/hexagon.cpp`

### Road routing

- [Car-road filter](https://github.com/josiashod/reseau_v2v/blob/compress/core/way.cpp): `core/way.cpp`
- [Road graph](https://github.com/josiashod/reseau_v2v/blob/compress/core/graph.cpp): `core/graph.cpp`
- [A-star routing](https://github.com/josiashod/reseau_v2v/blob/compress/core/graph.cpp): `core/graph.cpp`

### Vehicle simulation

- [Moving vehicle](https://github.com/josiashod/reseau_v2v/blob/compress/core/car.cpp): `core/car.cpp`
- [Radio coverage](https://github.com/josiashod/reseau_v2v/blob/compress/core/car.cpp): `core/car.cpp`
- [Vehicle connections](https://github.com/josiashod/reseau_v2v/blob/compress/core/car.cpp): `core/car.cpp`

### Other components

- **Map user**

## Connections

- Map user → Application startup: launches (evidence: `main.cpp`)
- Application startup → Main window controls: creates (evidence: `main.cpp`)
- Map user → Main window controls: controls (evidence: `ui/windows/mainwindow.cpp`)
- Map user → Add-car dialog: sets parameters
- Add-car dialog → Main window controls: emits car settings (evidence: `ui/windows/mainwindow.cpp`)
- Main window controls → Map display and layers: requests map load
- Map display and layers → OSM parser: parses file (evidence: `ui/widgets/mapwidget.cpp`)
- Map display and layers → OSM map file: loads default
- OSM parser → Parsed map features: produces features (evidence: `utils/osmreader.h`)
- Map display and layers → Parsed map features: reads features (evidence: `ui/widgets/mapwidget.cpp`)
- Map display and layers → Car-road filter: checks road type (evidence: `ui/widgets/mapwidget.cpp`)
- Car-road filter → Road graph: selects car roads
- Map display and layers → Road graph: adds road nodes (evidence: `ui/widgets/mapwidget.cpp`)
- Main window controls → A-star routing: requests routes (evidence: `ui/windows/mainwindow.cpp`)
- A-star routing → Road graph: searches graph (evidence: `core/graph.cpp`)
- Main window controls → Moving vehicle: creates and ticks (evidence: `ui/windows/mainwindow.cpp`)
- Add-car dialog → Moving vehicle: supplies settings
- Moving vehicle → Radio coverage: calculates coverage (evidence: `core/car.cpp`)
- Moving vehicle → Vehicle connections: updates connections (evidence: `core/car.cpp`)
- Territorial mesh → Moving vehicle: checks connections
- Main window controls → Simulation logs: writes messages (evidence: `ui/windows/mainwindow.cpp`)
- Map display and layers → Simulation logs: writes load details (evidence: `ui/widgets/mapwidget.cpp`)
