17
0
mirror of https://github.com/MaSzyna-EU07/maszyna.git synced 2026-10-17 10:59:20 +02:00
Files
maszyna/maj0sted/examples/basic_editor.cpp
maj00r a083269867 Vendor the maj0sted track layout library and link it into the editor
Drop-in copy of C:\Users\maj00r\Projects\maj0sted-master minus its web/
directory - the WASM frontend is not being ported, the editor drives the
same C++ API natively. What is left is plain C++20 with no dependencies:
domain model (niweleta, plan and profile geometry, fitting, parallelism),
project serialization, rail sampling and the editor document.

src/web/ribbon.cpp was missing from the library source list; added, since
without it the ribbon symbols never make it into the archive.
2026-08-27 19:36:55 +02:00

21 lines
533 B
C++

// Minimal walkthrough: create a map project and inspect its CRS.
#include <cstdio>
#include "maj0sted/maj0sted.hpp"
using namespace maj0sted::domain;
int main() {
std::printf("maj0sted %s\n\n", MAJ0STED_VERSION_STRING);
const MapProject project; // defaults to EPSG:2180
std::printf("Map project CRS: EPSG:%d\n", project.crs().epsg());
const CartesianPosition position{500000.0, 300000.0};
std::printf("Sample position: x=%.1f m, y=%.1f m\n", position.x(),
position.y());
return 0;
}