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

feat(editor): the horizontal alignment designed in the route design kept in the scenery as //$h lines: its vertices and the elements they make (straight, transition, arc, with the radius at the start and the end and the cant), so the paths laid by it are known again without guessing from their curvature; a curve read from the paths takes the radius, the transitions, the cant and the compound arcs of the kept design when its paths lie on it within 2 cm, the other way round too; the whole line design taken back when the fragment has its ends; a curve redesigned alone taken into the line it belongs to; km of the start kept with the design and carried on to the vertical profile of the same paths; paths which no longer follow the kept design shown in the route window, with the kept design to take or to forget; self-test commands for the route design and the kept alignments; Polish translation

This commit is contained in:
maj00r
2026-10-11 16:06:23 +02:00
parent f0ccd375a0
commit 572daeb274
12 changed files with 1105 additions and 5 deletions

View File

@@ -11,6 +11,7 @@ http:
#include "editor/editorTrack.hpp"
#include "editor/editorFormat.hpp"
#include "editor/editorGeometry.hpp"
#include "editor/editorAlignmentStore.hpp"
#include "world/Track.h"
#include "vehicle/DynObj.h"
@@ -1756,6 +1757,26 @@ bool editor_track::analyse_curve(std::vector<std::pair<TTrack *, bool>> const &R
Curve.arcs = arcs;
}
}
if (Curve.reversals == 0)
{
if (auto const designed{alignment_store::vertex_of(Run)})
{
auto const &shape{designed->shape};
Curve.designed = shape;
Curve.radius = shape.radius;
Curve.transition_in = shape.transition_in;
Curve.transition_out = shape.transition_out;
Curve.cant = shape.cant;
Curve.compound = shape.compound && false == shape.arcs.empty();
Curve.arcs.clear();
if (Curve.compound)
{
Curve.arcs.push_back({shape.radius, shape.share, 0.0});
for (auto const &arc : shape.arcs)
Curve.arcs.push_back({arc.radius, arc.share, arc.transition});
}
}
}
Curve.from = run.front().first;
Curve.to = run.back().first;
return true;