# christian-mv/freenoisemap-fnm architecture

> Architecture diagram of the GitHub repository christian-mv/freenoisemap-fnm, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-09-28). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/christian-mv/freenoisemap-fnm
- Repository: https://github.com/christian-mv/freenoisemap-fnm

## Overview

Free Noise Map is a desktop/mobile/web environmental-noise modelling application. Users place point, line or multiline sources and barriers, configure a receiver grid, run an ISO 9613-2-oriented calculation, then inspect an interpolated heatmap. The graph follows the sampled calculation and rendering calls; the README documents platform and modelling capabilities whose detailed implementations were not sampled, so uncertain internal wiring is omitted.

Main entry points: [`code/ui/main_window.cpp`](https://github.com/christian-mv/freenoisemap-fnm/blob/main/code/ui/main_window.cpp) (Main window), [`code/core/noise_engine.cpp`](https://github.com/christian-mv/freenoisemap-fnm/blob/main/code/core/noise_engine.cpp) (Noise engine), [`code/core/noise_grid.cpp`](https://github.com/christian-mv/freenoisemap-fnm/blob/main/code/core/noise_grid.cpp) (Receiver noise grid), [`code/core/project_controller.cpp`](https://github.com/christian-mv/freenoisemap-fnm/blob/main/code/core/project_controller.cpp) (Project controller)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_interaction["Map interaction"]
  node_window["Main window<br/>[main_window.cpp]"]
  node_view["Map view<br/>[fnm_view.cpp]"]
  node_map_items["Map items"]
  node_polyline_items["Polyline items"]
end

subgraph group_model["Acoustic model"]
  node_sources["Sources<br/>[point_source.cpp]"]
  node_lines["Line sources"]
  node_barriers["Barriers"]
end

subgraph group_calculation["Calculation"]
  node_settings["Grid settings<br/>[grid_settings.cpp]"]
  node_controller["Project controller"]
  node_engine["Noise engine<br/>[noise_engine.cpp]"]
  node_grid[("Receiver noise grid<br/>[noise_grid.cpp]")]
  node_interpolation["Grid interpolation<br/>[noise_grid.cpp]"]
end

subgraph group_visualization["Result visualization"]
  node_gradient["Color gradient<br/>[gradient_color.cpp]"]
  node_renderer["Heatmap renderer<br/>[receivers_grid.cpp]"]
end

node_user(("User"))

node_user -->|"edits model"| node_window
node_window -->|"controls map"| node_view
node_window -->|"creates items"| node_map_items
node_window -->|"creates lines"| node_polyline_items
node_map_items -->|"updates position"| node_sources
node_polyline_items -->|"owns segments"| node_lines
node_window -->|"runs calculation"| node_controller
node_window -->|"sets grid"| node_settings
node_controller -->|"uses receiver grid"| node_grid
node_controller -->|"calculates levels"| node_engine
node_engine -->|"reads source data"| node_sources
node_engine -->|"discretizes lines"| node_lines
node_engine -->|"checks diffraction"| node_barriers
node_engine -->|"updates receiver levels"| node_grid
node_window -->|"requests interpolation"| node_interpolation
node_interpolation -->|"refines receivers"| node_grid
node_window -->|"paints results"| node_renderer
node_renderer -->|"reads levels"| node_grid
node_renderer -->|"maps levels to colors"| node_gradient

click node_window "https://github.com/christian-mv/freenoisemap-fnm/blob/main/code/ui/main_window.cpp"
click node_view "https://github.com/christian-mv/freenoisemap-fnm/blob/main/code/ui/fnm_view.cpp"
click node_map_items "https://github.com/christian-mv/freenoisemap-fnm/blob/main/code/ui/qgraphics_items/abstract_point_item.cpp"
click node_polyline_items "https://github.com/christian-mv/freenoisemap-fnm/blob/main/code/ui/qgraphics_items/abstract_polyline_item.cpp"
click node_sources "https://github.com/christian-mv/freenoisemap-fnm/blob/main/code/core/point_source.cpp"
click node_lines "https://github.com/christian-mv/freenoisemap-fnm/blob/main/code/core/line_source_segment.cpp"
click node_barriers "https://github.com/christian-mv/freenoisemap-fnm/blob/main/code/core/barrier_segment.cpp"
click node_settings "https://github.com/christian-mv/freenoisemap-fnm/blob/main/code/core/grid_settings.cpp"
click node_controller "https://github.com/christian-mv/freenoisemap-fnm/blob/main/code/core/project_controller.cpp"
click node_engine "https://github.com/christian-mv/freenoisemap-fnm/blob/main/code/core/noise_engine.cpp"
click node_grid "https://github.com/christian-mv/freenoisemap-fnm/blob/main/code/core/noise_grid.cpp"
click node_interpolation "https://github.com/christian-mv/freenoisemap-fnm/blob/main/code/core/noise_grid.cpp"
click node_gradient "https://github.com/christian-mv/freenoisemap-fnm/blob/main/code/core/gradient_color.cpp"
click node_renderer "https://github.com/christian-mv/freenoisemap-fnm/blob/main/code/ui/receivers_grid.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_window,node_view,node_map_items,node_polyline_items,node_user toneBlue
class node_sources,node_lines,node_barriers toneAmber
class node_settings,node_controller,node_engine,node_grid,node_interpolation toneMint
class node_gradient,node_renderer toneRose
```

## Components

### Map interaction

- [Main window](https://github.com/christian-mv/freenoisemap-fnm/blob/main/code/ui/main_window.cpp): `code/ui/main_window.cpp`
- [Map view](https://github.com/christian-mv/freenoisemap-fnm/blob/main/code/ui/fnm_view.cpp): `code/ui/fnm_view.cpp`
- [Map items](https://github.com/christian-mv/freenoisemap-fnm/blob/main/code/ui/qgraphics_items/abstract_point_item.cpp): `code/ui/qgraphics_items/abstract_point_item.cpp`
- [Polyline items](https://github.com/christian-mv/freenoisemap-fnm/blob/main/code/ui/qgraphics_items/abstract_polyline_item.cpp): `code/ui/qgraphics_items/abstract_polyline_item.cpp`

### Acoustic model

- [Sources](https://github.com/christian-mv/freenoisemap-fnm/blob/main/code/core/point_source.cpp): `code/core/point_source.cpp`
- [Line sources](https://github.com/christian-mv/freenoisemap-fnm/blob/main/code/core/line_source_segment.cpp): `code/core/line_source_segment.cpp`
- [Barriers](https://github.com/christian-mv/freenoisemap-fnm/blob/main/code/core/barrier_segment.cpp): `code/core/barrier_segment.cpp`

### Calculation

- [Grid settings](https://github.com/christian-mv/freenoisemap-fnm/blob/main/code/core/grid_settings.cpp): `code/core/grid_settings.cpp`
- [Project controller](https://github.com/christian-mv/freenoisemap-fnm/blob/main/code/core/project_controller.cpp): `code/core/project_controller.cpp`
- [Noise engine](https://github.com/christian-mv/freenoisemap-fnm/blob/main/code/core/noise_engine.cpp): `code/core/noise_engine.cpp`
- [Receiver noise grid](https://github.com/christian-mv/freenoisemap-fnm/blob/main/code/core/noise_grid.cpp): `code/core/noise_grid.cpp`
- [Grid interpolation](https://github.com/christian-mv/freenoisemap-fnm/blob/main/code/core/noise_grid.cpp): `code/core/noise_grid.cpp`

### Result visualization

- [Color gradient](https://github.com/christian-mv/freenoisemap-fnm/blob/main/code/core/gradient_color.cpp): `code/core/gradient_color.cpp`
- [Heatmap renderer](https://github.com/christian-mv/freenoisemap-fnm/blob/main/code/ui/receivers_grid.cpp): `code/ui/receivers_grid.cpp`

### Other components

- **User**

## Connections

- User → Main window: edits model
- Main window → Map view: controls map
- Main window → Map items: creates items
- Main window → Polyline items: creates lines
- Map items → Sources: updates position
- Polyline items → Line sources: owns segments
- Main window → Project controller: runs calculation
- Main window → Grid settings: sets grid
- Project controller → Receiver noise grid: uses receiver grid
- Project controller → Noise engine: calculates levels
- Noise engine → Sources: reads source data
- Noise engine → Line sources: discretizes lines
- Noise engine → Barriers: checks diffraction
- Noise engine → Receiver noise grid: updates receiver levels
- Main window → Grid interpolation: requests interpolation
- Grid interpolation → Receiver noise grid: refines receivers
- Main window → Heatmap renderer: paints results
- Heatmap renderer → Receiver noise grid: reads levels
- Heatmap renderer → Color gradient: maps levels to colors
