17
0
mirror of https://github.com/MaSzyna-EU07/maszyna.git synced 2026-11-08 17:26:22 +01:00

feat(editor): the plan shows which curve is edited: each named W1, W2... as its vertex is in the view, with its km and "Show in the view", which flies the camera over it; the part of it whose field the mouse is over or which is being edited (the whole curve, an arc of a compound one, the transition in, out or between two arcs) lit up in the view and named there with its radius, cant or length. The points clicked when a line is laid are kept with its design in the scenery ("click" lines, moved with it): the plan shows them in the colours of their departure and, while "Keep to the points clicked" is on, fits the radii of a curve whose transitions or cants are changed again to them, its transitions and cants as set; "Transitions for these cants" makes the transitions as long as the norms ask for at the radii and the cants set, an arc of a compound curve with no cant lengthening the ones either side of it. Unit test: 50 m between the arcs become 85 m, the curve 4 cm off the points clicked instead of 58

This commit is contained in:
maj00r
2026-10-25 00:11:58 +02:00
parent 2a399a92a5
commit aeef2cebb3
9 changed files with 633 additions and 68 deletions

View File

@@ -51,6 +51,8 @@ struct record
glm::dvec2 low{0.0};
glm::dvec2 high{0.0};
std::vector<glm::dvec2> samples;
// the points clicked when the line was laid, its curves fitted to them, so they can be fitted again
std::vector<glm::dvec3> clicks;
};
struct hit
@@ -84,8 +86,12 @@ std::optional<designed_vertex> vertex_of(std::vector<std::pair<TTrack *, bool>>
int find(glm::dvec3 const &Start, glm::dvec3 const &End, bool &Reversed);
// stored alignment near the tracks, whose line they no longer follow; Departure receives the largest distance
int departed(std::vector<TTrack *> const &Tracks, double &Departure);
// keeps the design in the file of the layer, in place of the one with the same ends
int store(alignment::design const &Design, alignment::result const &Result, double const Origin, scene::layer_handle const Layer, std::string const &Source = "designed", double const Fit = 0.0);
// keeps the design in the file of the layer, in place of the one with the same ends; with no points clicked given it keeps the
// ones of the design it takes the place of
int store(alignment::design const &Design, alignment::result const &Result, double const Origin, scene::layer_handle const Layer, std::string const &Source = "designed", double const Fit = 0.0,
std::vector<glm::dvec3> const &Clicks = {});
// the points clicked when the lines were laid, kept with them, which lie by the line within the reach, between its ends
std::vector<glm::dvec3> clicks_along(alignment::result const &Result, double const Reach);
bool follows(alignment::result const &Result, std::vector<TTrack *> const &Tracks);
double deviation(alignment::result const &Result, std::vector<TTrack *> const &Tracks, TTrack *&Worst);
std::optional<double> chainage_on(alignment::result const &Result, glm::dvec3 const &Point);