How openorienteering/mapper works
Project type and purpose
• This is a full‐stack, cross‐platform desktop/mobile application for orienteering map creation (“OpenOrienteering Mapper”).
• It uses C++/Qt for core logic and GUI, with an Android front end in Java, plus extensive file I/O, printing, sensor‐plugin integration, and vectorization via third‐party libraries.
File structure
• Top‐level build/config: CMakeLists.txt, cmake/, ci/, packaging/
• Third‐party code: 3rd-party/clipper (geometry clipping), 3rd-party/cove (vectorizer), 3rd-party/qtsingleapplication
• Source directories under src/:
• src/gui – Qt GUI views, dialogs, controllers (MVC pattern)
• src/core – data model, map representation, coordinate systems, symbol logic
• src/fileformats – file import/export registry and format implementations (OCD, IOF, KML, XML)
• src/gdal – GDAL‐backed file I/O and georeferencing support
• src/printsupport – PDF/printer backends with platform patches
• src/sensors – plugin framework for GPS/compass inputs (JSON plugin descriptors)
• src/tools, src/templates, src/undo – map‐editing tools, template management, undo stack
• src/android – Java entry/activity/service that loads the native Qt engine via JNI
• Packaging: platform‐specific installers for Windows (NSIS), macOS (hdiutil), Linux (desktop files, Android packages).
• Tests: test/ directory with unit tests per module.
• Translations: Qt .ts files and scripts.
README for additional insights
• Confirms cross‐platform support (Android, Windows, macOS, Linux).
• Points to CMake build instructions (INSTALL.md).
• Mentions API docs, manual, translation workflow.
a. Main components
• User Interfaces
• Qt Desktop GUI (src/gui)
• Android UI (Java + native Qt via JNI)
• Core Engine
• Data model (src/core)
• Geometry & coordinate transformations
• Symbol management
• Undo/redo manager
• File I/O & Geospatial Services
• Fileformats registry (multiple formats)
• GDAL integration (src/gdal)
• Rendering Pipeline
• Qt QPainter/QGraphics-based rendering
• Tools & Plugins
• Editing tools (src/tools)
• Template management (src/templates)
• Sensor plugins (src/sensors)
• Printing Support
• Advanced PDF engine (src/printsupport)
• Packaging & CI
• Build scripts (CMake, ci/)
• Platform packages (packaging/)
• External Dependencies
• GDAL, Qt, C++ standard library
b. Relationships & interactions
• UI layers invoke Core Engine to manipulate map state.
• Core Engine delegates file load/save to File I/O & GDAL modules.
• Rendering Pipeline subscribes to model changes and draws via QPainter.
• Tools plug into Core Engine to modify map objects; Undo manager tracks operations.
• Sensor plugins feed live GPS/compass data into Core Engine.
• Printing Support reads map model and uses vectorizer to generate printable output.
• Packaging & CI orchestrate builds of all components and bundles dependencies.
c. Architectural patterns & principles
• Model-View-Controller: src/core (Model), src/gui/View + Controller classes (e.g., MainWindowController)
• Plugin registry: fileformats and sensors use a registration pattern for extensibility
• Layered architecture: clear separation of UI, business logic, data access, rendering
• Cross‐platform abstraction: platform‐specific code isolated under src/android, src/printsupport, packaging/
d. Key technologies & libraries
• Qt (Widgets, QPainter, QML not used here)
• CMake build system, Azure Pipelines / GitHub CI
• GDAL for geospatial I/O
• 3rd‐party/cove & clipper for vectorization
• JNI bridging for Android
• NSIS, hdiutil, CPack for packaging
• Weblate / Qt .ts for translations