mirror of
https://github.com/MaSzyna-EU07/maszyna.git
synced 2026-10-17 13:19:20 +02:00
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.
This commit is contained in:
20
maj0sted/examples/basic_editor.cpp
Normal file
20
maj0sted/examples/basic_editor.cpp
Normal file
@@ -0,0 +1,20 @@
|
||||
// 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;
|
||||
}
|
||||
Reference in New Issue
Block a user