mirror of
https://github.com/MaSzyna-EU07/maszyna.git
synced 2026-12-01 05:57:08 +01:00
75ce03b95a
Continues E4b (editor-tracks-domain.md §8, "Odsuń tor równoległy"): with the editing on the model on, the parallel tool beside a track of a line of the model lays a new line of the model at the spacing, one create_line, checked by the norms. - editor/layout/layoutParallel: the line alongside a line, pure: the legs of the tangents offset, the vertices where the offset legs meet, the arcs concentric with the line's, the radius less on the inside of a curve and more on the outside, the transitions recomputed from the shift of the arc so the centre stays the line's; the cant and the class of the line, its grade breaks at the same share of the length. In a curve the spacing is widened by the widening of the gauge of both tracks on the sides facing each other (PLK tom II annex 1, gauge::curve_widening, under R 250 m), where the transitions of the curve can take it; where they can't, told so. The norms of the track geometry have no spacing of their own yet. - The tool tells the line laid, the spacing in each curve widened, what the norms warn of; refused, why, nothing changed. Self-test: expect modelspacing <line> <other> <m> <low> <high>. The case m_13_parallel (a line laid on the inside of the curve of a line of the model, 4.5 m on the straight and in the arc, one step). Tests: U: the line alongside a straight and alongside three curves on both sides, laid, the arcs concentric within 2 mm; alongside a curve of R 200 m the spacing widened by the gauges, the transitions longer on the inside and shorter on the outside; not widened where a curve has no transitions, told why. lang/editor_pl.po: the Polish of the new texts.
39 lines
1.6 KiB
C++
39 lines
1.6 KiB
C++
/*
|
|
This Source Code Form is subject to the
|
|
terms of the Mozilla Public License, v.
|
|
2.0. If a copy of the MPL was not
|
|
distributed with this file, You can
|
|
obtain one at
|
|
http://mozilla.org/MPL/2.0/.
|
|
*/
|
|
|
|
#pragma once
|
|
|
|
#include "editor/layout/layoutCommands.hpp"
|
|
|
|
#include <string>
|
|
#include <vector>
|
|
|
|
// A track laid alongside a line of the track geometry (editor-tracks-domain.md §8, "Odsuń tor równoległy"): a new line at a constant
|
|
// spacing, its straights offset and its arcs concentric with the line's, the radius less on the inside of a curve and more on the outside,
|
|
// the transition curves recomputed so the arcs stay concentric: the shift of the arc from its tangents taken so its centre is the line's.
|
|
// In a curve the spacing is widened, where the line's curve has transitions to take it, by the widening of the gauge of both tracks on the
|
|
// sides facing each other (PLK tom II annex 1, editorGauge.hpp): the norms of the track geometry have no spacing of their own yet. The new
|
|
// line is a create_line command, checked by the norms when it's carried out.
|
|
namespace layout
|
|
{
|
|
|
|
struct parallel_plan
|
|
{
|
|
bool valid{false};
|
|
create_line command;
|
|
std::vector<std::string> errors; // why there's none
|
|
std::vector<std::string> notes; // a curve the spacing isn't widened in, and why
|
|
std::vector<double> spacings; // m, in the arc of each curve, the widening with it
|
|
};
|
|
|
|
// the line alongside the line at the offset, m, above 0 to its left as it runs (left_of), its spacing in the curves widened where Widen
|
|
parallel_plan parallel_line(network const &Network, line_id const Line, double const Offset, bool const Widen = true);
|
|
|
|
} // namespace layout
|