mirror of
https://github.com/MaSzyna-EU07/maszyna.git
synced 2026-10-17 07:29:20 +02:00
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.
26 lines
750 B
C++
26 lines
750 B
C++
#include "check.hpp"
|
|
#include "maj0sted/maj0sted.hpp"
|
|
|
|
using namespace maj0sted::domain;
|
|
|
|
int main() {
|
|
// A map project defaults to the Cartesian CRS EPSG:2180.
|
|
const MapProject project;
|
|
CHECK(project.crs() == Crs::default_crs());
|
|
CHECK(project.crs().epsg() == 2180);
|
|
|
|
// An explicit CRS is honoured.
|
|
const MapProject wgs84{Crs{4326}};
|
|
CHECK(wgs84.crs().epsg() == 4326);
|
|
|
|
// Cartesian position value object.
|
|
const CartesianPosition p{100.5, 200.25};
|
|
CHECK(p.x() == 100.5);
|
|
CHECK(p.y() == 200.25);
|
|
CHECK(CartesianPosition{1.0, 2.0} == CartesianPosition{1.0, 2.0});
|
|
CHECK(CartesianPosition{1.0, 2.0} != CartesianPosition{2.0, 1.0});
|
|
CHECK(CartesianPosition{}.x() == 0.0);
|
|
|
|
return REPORT();
|
|
}
|