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

feat(editor): the kept alignments and switches after a drag of the gizmo or of a point: a line all of whose paths are moved or turned as a whole takes its kept design along; paths pulled out of a kept design, or given another cant, are told about on the status line with the way back; a switch moved or turned as a whole keeps its type and its record follows it, with its km; a switch bent out of the shape of its type loses it and is told about (//$r records keep the shape of the switch); all of it in the same undo step as the drag; Polish translation

This commit is contained in:
maj00r
2026-10-11 16:57:23 +02:00
parent ddb637a3f5
commit 4ea2f4f13f
8 changed files with 307 additions and 10 deletions

View File

@@ -38,6 +38,10 @@ struct record
std::vector<std::string> parts; // the switch, the switches of a slip, the paths of a crossing
glm::dvec3 start{0.0}; // of the first part
glm::dvec2 direction{0.0, 1.0};
// ends of the main and the diverging track of the first part seen from its start: along, across, along, across. it stays the
// same as long as the switch is moved or turned as a whole, it changes when the switch gets bent out of its shape
glm::dvec4 shape{0.0};
bool shaped{false};
std::optional<double> km;
std::string number{"-"};
std::string source{"designed"}; // designed: from the catalogue, measured: copied from a switch of the scenery
@@ -46,8 +50,12 @@ struct record
void reset();
void load();
std::vector<record> const &records();
// the record of the switch, slip or crossing the track is a part of, while its first part starts where the record says
// the record of the switch, slip or crossing the track is a part of, while its first part keeps the shape the record says
std::optional<record> of(TTrack const &Track);
// the record of the track by its name alone, also when the switch lost its shape
std::optional<record> named(TTrack const &Track);
// records whose switches were moved or turned as a whole take their new place and km; returns their names
std::vector<std::string> follow();
// radius of the diverging track: of the type, bent with the main track for an arc switch
double branch_radius(record const &Record);
// keeps the record in the file of the layer, in place of the one with the same name