17
0
mirror of https://github.com/MaSzyna-EU07/maszyna.git synced 2026-10-31 23:59:03 +01:00

feat(editor): the signals and the signs by a track go with it as the Plan lays it anew, square to the line, not along it

A curve laid anew, its radius changed or made compound, or a straight moved: the paths of the chain are cut again where their joints stood, set square onto the new line, each keeping its stretch of the ground, so their events, their track circuits and the cuts of the block sections stay where they were instead of being handed on along the line; the parts between the switches alike, the old even sharing kept where the joints don't follow one another along the new line.

The objects by a track taken for a change go with it by themselves: the signals and the warning discs it or its run reads, the SHP resonators by their events, and the controls of the block sections, the hectometre posts, the W17 markers and the other signs by the track nearest to them, within 12 m. They move square to the new axis keeping their offset and their turn, an object moved by hand meanwhile staying where it was put. Such a binding isn't kept in the scenery nor shown among the bound objects of the infra tool, which can still bind the object for good, and the undo and the redo take the objects back and forth with the tracks. The status of the Plan tells how many objects moved with the tracks. A path taking an object over the other way round keeps it on its side, turned as it was.
This commit is contained in:
maj00r
2026-10-22 21:32:34 +02:00
parent 4c55951d8a
commit c024d7c262
11 changed files with 336 additions and 30 deletions

View File

@@ -217,6 +217,13 @@ std::size_t minimum_pieces(result const &Result, design const &Design);
// one more than the breaks; Intervals receives the number of the interval of each piece
std::vector<segment_data> pieces(result const &Result, design const &Design, std::size_t const Count, std::vector<double> const &Breaks = {}, std::vector<std::size_t> const &Counts = {},
std::vector<std::size_t> *Intervals = nullptr);
// the points of the plan set square onto the line, the chainages of them in their order between From and To; empty where they
// don't follow one another along it
std::vector<double> breaks_at(result const &Result, std::vector<glm::dvec2> const &Points, double const From, double const To);
// the pieces of the line ending at the joints of the old paths set square onto it, so that each old path keeps its stretch of the
// ground: Intervals receives the old path of each piece, or stays empty where the joints don't follow one another along the line
// and the pieces are cut as by pieces() alone
std::vector<segment_data> pieces_at(result const &Result, design const &Design, std::size_t const Count, std::vector<glm::dvec2> const &Joints, std::vector<std::size_t> &Intervals);
struct join_end
{