18
0
mirror of https://github.com/MaSzyna-EU07/maszyna.git synced 2026-12-01 22:07:55 +01:00

feat(editor): laying from the photo: the points clicked along the track laid as recognised, told on the view, going on after Enter

quirky-crafting-summit, Etap 2. The lay tool has two shapes, From the photo and Bends: from the photo where the photo is on, the bends
without it, Tab switching them for the points clicked so far and on. The curve traced between bends (Tab) and its radii Auto/1R/2R/3R
are gone from the panel; the radii are changed in Plan afterwards.

- From the photo the points clicked go to the tracer (editor/editorTrace), each with the noise of two pixels of the view at it; the line
  shown is the one of the points clicked, worked out once for them, a dashed leg to the cursor. On the view: "straight 420 m", "curve R
  850 m", "nearly straight · curve R 9 km", "compound curve R 600/450 m", "R 300 m · up to 70 km/h" in orange; the points green, yellow
  or red by how far the line is from them in their noise, one which doesn't fit yellow and ringed, "doesn't fit - Backspace takes it
  back" by the cursor.
- A curve sharper than the norms at the speed of the line is laid slowed down: its tracks and its transitions get its speed, told in the
  status. One below the least radius of the kind of the track (the block of the norms) isn't laid, Lay disabled, the points kept; It's a
  side track offered where a side track may be that sharp (no profile has it so now).
- After Enter the tool stays at the end laid: the next clicks carry the line on from its free end, joined to it, with no need to hit the
  ring; Esc ends it. A free end is reached within 1 m on the ground only, not the end of the track beside.
- The first point turns the view from above on; a click in the outer 15 % of the view glides the view on by half of what the point is off
  its middle.
- The step: Click along the middle of the track on the photo: every 100-300 m on straights, closer on curves. Enter lays. The bar under
  the view: LMB a point on the track, Enter lay, Backspace take back.
- A tool key (G, T, N...) over points not laid warns as Esc does, the second press within 3 s goes; Enter over a single point clicked
  tells to click two instead of dropping it silently.
- With the editing on the model the line traced is laid the old way, told so, as the curve traced was.

Self-test: laymode traced|default, laysigma <m>; laysample lays out curves of the norms, compound ones too, and clicks them traced (no
Tab); laywalk clicks traced; expect laid curves|clicks|length|radius|speed|nearly|slowtracks|joined, expect laykeys <tabs> <enters>,
expect laycontinue; a self-test starts with the bends, whatever the orthophoto of the player's settings. The cases tr_1_three_curves
(3.2 km, three curves, 16 clicks, no Tab, one Enter), tr_2_nearly_straight (R 9 km), tr_3_compound (R 600/400), tr_4_below_norms (R 300
at 120 km/h laid for 70, R 150 refused), tr_5_continue. lf_1_lay_panel_states goes through the shape from the photo in place of the
curve traced, which the panel has no more.

lang/editor_pl.po: the Polish of the new texts; the ones of the curve traced and of its radii gone, the eight of the plan which no
source had any more among them.
This commit is contained in:
maj00r
2026-11-24 00:51:56 +01:00
parent 656c5b4d75
commit 6febdb0d64
17 changed files with 1055 additions and 186 deletions
+12 -4
View File
@@ -140,19 +140,24 @@ editor_mode::selftest_result editor_mode::selftest_dispatch(std::string const &c
// laymonkey <seed> <count> [case] random lines laid to and from the free ends of the scenery, as the preview shows them: gaps and
// angles at the joints, loops, the turning wasted and the sharpest curve logged; case: that one alone
// layspeed <km/h> <own 0|1> the speed set for the laying, and whether it goes also on from a track with its own
// laymode <straights|curve>, laytrace <radii 0..3> <straights between 0|1> as the panel of the laying sets them
// laymode <traced|straights|curve|default>, laytrace <radii 0..3> <straights between 0|1> as the panel of the laying sets them, not counted as
// Tab; curve: a curve traced between bends, the shape of before, reached by the self-test alone; default:
// as the user who hasn't chosen, traced where the photo is on
// laysigma <m> the noise of the clicks from now on; 0: two pixels of the view at each
// endcurves logs every free end of the rails: where, the way out and the curvature its track goes on with
// curvejoint <x> <z> logs the paths meeting at the end nearest the point, the curvature of each and its jump from the ones before to the ones after
// cantcheck <label> logs each jump of the cant at a joint of plain tracks, and the steepest ramp of the cant on a path
// fitcheck <label> logs the steps and grade breaks at the joints, the switches off their plane, the rails against the ground
// laywalk <from|into> <x> <z> <spacing> <noise> <k0> <k1> <L>... a line of known curves on from the free end nearest the point,
// the points along it clicked in the mode of a curve, from the end or towards it (see the command)
// the points along it clicked traced on the photo, from the end or towards it (see the command)
// laybends <x> <z> <distance> <degrees> ... <distance> the bends of straights clicked from the free end nearest the point
// layp <x> <z>... the points clicked in the mode set, on the ground, a free end within 3 m reached
// layreport <label> logs the line the points clicked make, as Enter would lay it: its bends and curves, warnings, traces
// layenter, layback, laycancel as Enter, Backspace and Esc while laying
// laysample <x> <z> <heading> <spacing> <noise> <deflection> <R> [<from the first vertex to the second, m> <deflection> <R>]
// a line of known curves, the points along them clicked as a curve traced, the line they make logged
// laysample <x> <z> <heading> <lead> <straight> <spacing> <noise> <deflection> <R[/R2]> <after> [<deflection> <R> <after>]...
// a line of known curves of the norms, lead and after the metres from vertex to vertex, the points
// along it clicked traced on the photo every straight
// metres on its straights and every spacing metres along its curves, the line they make logged
// laychain <layout> <R> <x> <z> | b | u | r | e | t | p... the points clicked, Backspace, undo, redo, Enter, Tab, the line logged
// joints <x> <z>... the joints check over the scenery, the issues around the points logged, every issue with free ends without points
// normsreport <file> [scope 0|1] [plk|tsi|en|ch] [km/h] the tracks checked against the norms of the profile, the line through the
@@ -291,6 +296,9 @@ void editor_mode::selftest_step()
if (false == line.empty() && line.front() != '#')
test.lines.push_back(line);
WriteLog("SELFTEST: " + std::to_string(test.lines.size()) + " steps from " + file);
// the lay tool lays the bends whatever the orthophoto of the settings of the player: a case traces the photo by laymode traced
m_lay.shape_chosen = true;
m_lay.mode = lay_mode::straights;
}
++editor_selftest::frames();
// how long each frame took, for the longest one perf tells