mirror of
https://github.com/MaSzyna-EU07/maszyna.git
synced 2026-11-01 08:02:10 +01:00
feat(editor): the kilometrage tool sets the km of the railway lines, points where the km is known and jumps of the km, the rest along the axis of the line, between the tracks of a double-track one and along the longer track where they run apart, kept in the scenery as //$k lines
The track mode Kilometrage (X, under More) puts a point of the km where a track is clicked: the line, the km and, at a jump, the km on from it. The axis of a line follows the main paths of the switches through the tracks of its points; on a double-track line it runs between the tracks, and where they part on formations of their own and come together again it runs along the longer one, the shorter one going by its own length with its last hectometre before they meet taking up the difference (PKP GK-1 6.1.12). The km between the points are stretched to the length of the scenery evenly; the panel lists the points with the stretch, the 3D view shows the axis, a tick at each hectometre, the points with their km and the km of the lines by the mouse. Read the km from the posts turns the hectometre posts along the line into the points of its km, a jump where two runs of numbers meet, and warns of a jump on a curve or at a station (Id-1 § 19). Each change is a step of undo.
This commit is contained in:
@@ -843,17 +843,18 @@ bool node_layers::pending() const
|
||||
namespace
|
||||
{
|
||||
// marks of the lines the editor keeps track of
|
||||
std::array<char const *, 7> const editormarks{"//$p", "//$h", "//$r", "//$b", "//$c", "//$o", "//$s"};
|
||||
std::array<char const *, 8> const editormarks{"//$p", "//$h", "//$r", "//$b", "//$c", "//$o", "//$s", "//$k"};
|
||||
|
||||
// other tools put lines of their own after some of these marks: Rainsted its includes after //$r, the launcher the descriptions
|
||||
// of the trainsets after //$o. The editor's lines of them are told by their first word
|
||||
bool editor_line(char const *Mark, std::string const &Text)
|
||||
{
|
||||
static std::array<std::pair<std::string_view, std::array<std::string_view, 9>>, 4> const words{{
|
||||
static std::array<std::pair<std::string_view, std::array<std::string_view, 9>>, 5> const words{{
|
||||
{"//$h", {"#", "alignment", "source", "ends", "norms", "pieces", "vertex", "element", "end"}},
|
||||
{"//$r", {"#", "switch", "slip", "crossing", "double", "connection"}},
|
||||
{"//$o", {"on"}},
|
||||
{"//$s", {"#", "station"}},
|
||||
{"//$k", {"#", "mark"}},
|
||||
}};
|
||||
auto const lookup{std::find_if(words.begin(), words.end(), [&](auto const &Entry) { return Entry.first == Mark; })};
|
||||
if (lookup == words.end())
|
||||
|
||||
Reference in New Issue
Block a user