17
0
mirror of https://github.com/MaSzyna-EU07/maszyna.git synced 2026-11-01 02:19:05 +01:00

feat(editor): the kilometrage tool leads a line through a station along the tracks chosen, the straight paths of the switches by default, from the track chosen on along them until the line meets its tracks again or on and away at a junction, kept as //$k via lines; a track beside that comes back onto the line between the stretches it runs beside it or both ways is a track of a station, not the other track of a double-track line

This commit is contained in:
maj00r
2026-10-22 14:16:42 +02:00
parent 5ecb6ebe00
commit 7cc8e5bb9a
10 changed files with 533 additions and 38 deletions

View File

@@ -47,6 +47,8 @@ class km_tool final : public editor_tool
TTrack *track{nullptr};
glm::dvec3 point{0.0}; // on the axis of the track
glm::dvec2 along{0.0, 1.0}; // of the track there, in the plan
int path{0}; // of the switch, the one nearest to the click
glm::dvec3 on{0.0}; // the point of it nearest to the click
};
std::optional<picked> m_pick;
int m_edited{-1}; // of the marks, the one standing by the point picked, -1 for a new one
@@ -56,6 +58,7 @@ class km_tool final : public editor_tool
double m_beyond{0.0};
bool m_against{false}; // the km rise against the track picked
std::string m_status;
std::string m_route_status; // of the way through a station
// what the overlay draws, made again when the axes change
struct tick
{
@@ -80,6 +83,15 @@ class km_tool final : public editor_tool
void remove();
// the point of the km picked and the camera over it
void show(std::size_t const Index);
// the line of the field led along the track picked, along the path of the switch picked, instead of the straight paths of the
// switches; one step of the history
void lead_along();
// the line back on the straight paths of the switches by the track picked; one step of the history
void drop_via();
// of the vias of the line of the field, the one on the track picked, -1 for none
int via_here() const;
// the track of the via picked and the camera over it
void show_via(std::size_t const Index);
// the hectometre posts standing along the line through the track picked read into points of the km: the first and the last
// post of each run of them numbered by 100 m, a jump where the runs meet; one step of the history
void read_posts();