17
0
mirror of https://github.com/MaSzyna-EU07/maszyna.git synced 2026-10-29 02:17:28 +01:00

feat(editor): the whole-scenery grade fit keeps the tracks a station shares at one height, lets the switches lie on the vertical curves the regulation allows, runs straight through the double slips and leaves the bridges out of the faults

A switch may lie on a concave vertical curve, and on a convex one no sharper than 2000 m (Dz.U. 2026 poz. 1225 § 58 ust. 16): the fit bends over the switches and their shared timbers where the ground does, a curve on a switch is a warning, and only a sharper convex one an error. A sharp crest of a hump keeps its curve off the switch zones. The zone of a crossing reaches only as far as the path crossed has rails, so the middle of a double slip keeps to itself.

A line runs through a switch along its main path, and through the quarters of a double slip straight on, so the long lines go through the slips and the connections between them are fitted after. Rails of the lines fitted already nearer than a sleeper is long are taken at their height, as both lie on the same timbers. A short line between two lines whose end grades can't be joined within the norms keeps only the heights of its ends, and the grade breaks at the joints. The norms speed of a line is the one most of its length is laid for, so a few tracks set much faster don't stiffen the curves of all of it.

The fault finder leaves out the places over the terrain model on a bridge or a viaduct, the ground falling away under them by the abutments. A formation modifier may be open at its start or end.
This commit is contained in:
maj00r
2026-10-22 01:48:04 +02:00
parent 9fedbaf6a8
commit f361bc406b
11 changed files with 1020 additions and 186 deletions

View File

@@ -45,6 +45,7 @@ http://mozilla.org/MPL/2.0/.
#include <array>
#include <map>
#include <tuple>
#include <chrono>
#include <functional>
#include <memory>
@@ -349,8 +350,25 @@ class editor_mode : public application_mode, private editor_track::observer, pri
std::vector<TTrack *> left; // tracks whose grade line is still to be fitted
std::vector<TTrack *> done; // tracks of the lines fitted already: the lines fitted later end on them and don't change them
// the rail tops of the lines fitted already, in squares of the plan: the tracks of a station lie in one plane, a line laid
// near them takes their height for its ground too, the more closely the nearer it is
std::map<std::pair<int, int>, std::vector<glm::dvec3>> laid;
// near them takes their height for its ground too, the more closely the nearer it is, and a line crossing one of them
// on its level its height on the crossing
struct laid_point
{
glm::dvec3 position{0.0};
glm::dvec2 direction{0.0, 1.0};
double grade{0.0};
double was{0.0}; // the height before the line was fitted
double rails{0.0}; // the height of the rails of the track
TTrack const *track{nullptr};
};
std::map<std::pair<int, int>, std::vector<laid_point>> laid;
// the points of all the paths as they were laid, for the crossings
std::map<std::pair<int, int>, std::vector<laid_point>> paths;
// ends which meet in the plan unlinked, laid apart in height, that the joining of the ends couldn't join as neither of
// them can be changed alone, as of two switches: each with the other one, which a line ending there takes over
std::map<std::tuple<TTrack const *, int, bool>, std::tuple<TTrack *, int, bool>> loose;
// the points of the lines over a bridge or a viaduct, the model falling away under them: no formation is laid there
std::map<std::pair<int, int>, std::vector<glm::dvec3>> bridged;
std::size_t lines{0}; // grade lines fitted and applied
std::size_t refused{0}; // grade lines the checks didn't let apply
std::size_t departures{0}; // grade lines parting from the terrain model by much