# neos80/qtrassa architecture

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

- Interactive diagram: https://gitdiagram.com/neos80/qtrassa
- Repository: https://github.com/neos80/qtrassa

## Overview

qTrassa is a Qt desktop tool for tunnel surveyors. Users enter route geometry, transition curves, profile and chainage settings, then calculate chainage/offsets or predict coordinates; a separate ring workflow computes lining deviations and produces reports and DXF output. The main window is the visible workflow coordinator, while `geo` provides the shared geometry and chainage calculations. README capabilities are included, but some feature wiring lies in omitted portions of the large main-window source, so only documented or excerpt-supported relationships are shown.

Main entry points: [`src/mainwindow.cpp`](https://github.com/neos80/qtrassa/blob/master/src/mainwindow.cpp) (Main window), [`src/main.cpp`](https://github.com/neos80/qtrassa/blob/master/src/main.cpp) (Qt application), [`src/qlineeditdelegate.cpp`](https://github.com/neos80/qtrassa/blob/master/src/qlineeditdelegate.cpp) (Text editor delegate), [`src/comboboxdelegate.cpp`](https://github.com/neos80/qtrassa/blob/master/src/comboboxdelegate.cpp) (Element type delegate)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_desktop["Desktop interface"]
  node_app["Qt application<br/>[main.cpp]"]
  node_window["Main window<br/>[mainwindow.cpp]"]
  node_textedit["Text editor delegate"]
  node_typeedit["Element type delegate"]
  node_qcalc["Transition q calculator<br/>[calcq.cpp]"]
  node_about["About dialog<br/>[about.cpp]"]
end

subgraph group_route["Route surveying"]
  node_routeinput["Route and profile input<br/>[mainwindow.cpp]"]
  node_geometry["Alignment geometry<br/>[geo.cpp]"]
  node_chainage["Chainage and offset<br/>[geo.cpp]"]
  node_transitions["Transition curves<br/>[geo.cpp]"]
  node_profile["Longitudinal profile<br/>[geo.cpp]"]
  node_coordinates["Coordinate prediction<br/>[geo.cpp]"]
  node_stakeout["Route stakeout<br/>[mainwindow.cpp]"]
  node_dxf["DXF export<br/>[mainwindow.cpp]"]
end

subgraph group_rings["Ring assessment"]
  node_ringsinput["Ring measurements<br/>[mainwindow.cpp]"]
  node_ringcalc["Ring deviations<br/>[mainwindow.cpp]"]
  node_reports["Ring reports<br/>[mainwindow.cpp]"]
  node_summary["Summary statement<br/>[mainwindow.cpp]"]
  node_xmltemplate["Word XML template<br/>[templateFull.xml]"]
end

node_surveyor(("Surveyor"))

node_surveyor -->|"launches"| node_app
node_app -->|"shows"| node_window
node_surveyor -->|"enters data"| node_window
node_window -->|"calculates route"| node_geometry
node_window -->|"calculates chainage"| node_chainage
node_window -->|"calculates offsets"| node_transitions
node_window -->|"calculates elevation"| node_profile
node_window -->|"predicts coordinates"| node_coordinates
node_window -->|"runs stakeout"| node_stakeout
node_window -->|"exports scheme"| node_dxf
node_surveyor -->|"enters measurements"| node_ringsinput
node_window -->|"calculates deviations"| node_ringcalc
node_window -->|"generates protocol"| node_reports
node_window -->|"generates summary"| node_summary
node_window -.->|"opens calculator"| node_qcalc
node_window -.-> node_textedit
node_window -.-> node_typeedit
node_window -.-> node_about
node_reports -.->|"fills template"| node_xmltemplate

click node_app "https://github.com/neos80/qtrassa/blob/master/src/main.cpp"
click node_window "https://github.com/neos80/qtrassa/blob/master/src/mainwindow.cpp"
click node_textedit "https://github.com/neos80/qtrassa/blob/master/src/qlineeditdelegate.cpp"
click node_typeedit "https://github.com/neos80/qtrassa/blob/master/src/comboboxdelegate.cpp"
click node_qcalc "https://github.com/neos80/qtrassa/blob/master/src/calcq.cpp"
click node_routeinput "https://github.com/neos80/qtrassa/blob/master/src/mainwindow.cpp"
click node_geometry "https://github.com/neos80/qtrassa/blob/master/src/geo.cpp"
click node_chainage "https://github.com/neos80/qtrassa/blob/master/src/geo.cpp"
click node_transitions "https://github.com/neos80/qtrassa/blob/master/src/geo.cpp"
click node_profile "https://github.com/neos80/qtrassa/blob/master/src/geo.cpp"
click node_coordinates "https://github.com/neos80/qtrassa/blob/master/src/geo.cpp"
click node_stakeout "https://github.com/neos80/qtrassa/blob/master/src/mainwindow.cpp"
click node_dxf "https://github.com/neos80/qtrassa/blob/master/src/mainwindow.cpp"
click node_ringsinput "https://github.com/neos80/qtrassa/blob/master/src/mainwindow.cpp"
click node_ringcalc "https://github.com/neos80/qtrassa/blob/master/src/mainwindow.cpp"
click node_reports "https://github.com/neos80/qtrassa/blob/master/src/mainwindow.cpp"
click node_summary "https://github.com/neos80/qtrassa/blob/master/src/mainwindow.cpp"
click node_xmltemplate "https://github.com/neos80/qtrassa/blob/master/templateFull.xml"
click node_about "https://github.com/neos80/qtrassa/blob/master/src/about.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_textedit,node_typeedit,node_qcalc,node_about toneBlue
class node_routeinput,node_geometry,node_chainage,node_transitions,node_profile,node_coordinates,node_stakeout,node_dxf toneAmber
class node_ringsinput,node_ringcalc,node_reports,node_summary,node_xmltemplate toneMint
class node_surveyor toneIndigo
```

## Components

### Desktop interface

- [Qt application](https://github.com/neos80/qtrassa/blob/master/src/main.cpp): `src/main.cpp`
- [Main window](https://github.com/neos80/qtrassa/blob/master/src/mainwindow.cpp): `src/mainwindow.cpp`
- [Text editor delegate](https://github.com/neos80/qtrassa/blob/master/src/qlineeditdelegate.cpp): `src/qlineeditdelegate.cpp`
- [Element type delegate](https://github.com/neos80/qtrassa/blob/master/src/comboboxdelegate.cpp): `src/comboboxdelegate.cpp`
- [Transition q calculator](https://github.com/neos80/qtrassa/blob/master/src/calcq.cpp): `src/calcq.cpp`
- [About dialog](https://github.com/neos80/qtrassa/blob/master/src/about.cpp): `src/about.cpp`

### Route surveying

- [Route and profile input](https://github.com/neos80/qtrassa/blob/master/src/mainwindow.cpp): `src/mainwindow.cpp`
- [Alignment geometry](https://github.com/neos80/qtrassa/blob/master/src/geo.cpp): `src/geo.cpp`
- [Chainage and offset](https://github.com/neos80/qtrassa/blob/master/src/geo.cpp): `src/geo.cpp`
- [Transition curves](https://github.com/neos80/qtrassa/blob/master/src/geo.cpp): `src/geo.cpp`
- [Longitudinal profile](https://github.com/neos80/qtrassa/blob/master/src/geo.cpp): `src/geo.cpp`
- [Coordinate prediction](https://github.com/neos80/qtrassa/blob/master/src/geo.cpp): `src/geo.cpp`
- [Route stakeout](https://github.com/neos80/qtrassa/blob/master/src/mainwindow.cpp): `src/mainwindow.cpp`
- [DXF export](https://github.com/neos80/qtrassa/blob/master/src/mainwindow.cpp): `src/mainwindow.cpp`

### Ring assessment

- [Ring measurements](https://github.com/neos80/qtrassa/blob/master/src/mainwindow.cpp): `src/mainwindow.cpp`
- [Ring deviations](https://github.com/neos80/qtrassa/blob/master/src/mainwindow.cpp): `src/mainwindow.cpp`
- [Ring reports](https://github.com/neos80/qtrassa/blob/master/src/mainwindow.cpp): `src/mainwindow.cpp`
- [Summary statement](https://github.com/neos80/qtrassa/blob/master/src/mainwindow.cpp): `src/mainwindow.cpp`
- [Word XML template](https://github.com/neos80/qtrassa/blob/master/templateFull.xml): `templateFull.xml`

### Other components

- **Surveyor**

## Connections

- Surveyor → Qt application: launches (evidence: `src/main.cpp`)
- Qt application → Main window: shows (evidence: `src/main.cpp`)
- Surveyor → Main window: enters data (evidence: `README.md`)
- Main window → Alignment geometry: calculates route (evidence: `src/mainwindow.cpp`)
- Main window → Chainage and offset: calculates chainage (evidence: `src/mainwindow.cpp`)
- Main window → Transition curves: calculates offsets (evidence: `README.md`)
- Main window → Longitudinal profile: calculates elevation (evidence: `src/mainwindow.cpp`)
- Main window → Coordinate prediction: predicts coordinates (evidence: `README.md`)
- Main window → Route stakeout: runs stakeout (evidence: `README.md`)
- Main window → DXF export: exports scheme (evidence: `README.md`)
- Surveyor → Ring measurements: enters measurements (evidence: `README.md`)
- Main window → Ring deviations: calculates deviations (evidence: `src/mainwindow.cpp`)
- Main window → Ring reports: generates protocol (evidence: `README.md`)
- Main window → Summary statement: generates summary (evidence: `README.md`)
- Main window → Transition q calculator: opens calculator
- Main window → Text editor delegate
- Main window → Element type delegate
- Main window → About dialog
- Ring reports → Word XML template: fills template
