mirror of
https://github.com/MaSzyna-EU07/maszyna.git
synced 2026-10-17 10:59:20 +02:00
refactor(editor): split the track mode into its gizmo, kept records, switch drive, switch slide and track bed files; path geometry shared in editorGeometry instead of four copies of the reversed path, track shape rules (stretching, rolls at joints, middle, switch axis, drive spot) in editor_track, fitting the track to the ground in ground_follow with the terrain query passed in, the record layer and the switch classification in the stores; long gizmo, record watch and switch slide functions broken up, out-parameters replaced by optional results
This commit is contained in:
@@ -745,4 +745,15 @@ void restore(std::vector<record> Records)
|
||||
settle();
|
||||
}
|
||||
|
||||
scene::layer_handle layer_of(TTrack const &Track)
|
||||
{
|
||||
auto const usable = [](scene::layer_handle const Layer) { return scene::Layers.valid(Layer) && scene::Layers.accepts(Layer) && false == scene::Layers.layer(Layer).name.ends_with(".txtf"); };
|
||||
auto layer{scene::Layers.resolve(Track.layer())};
|
||||
if (false == usable(layer))
|
||||
layer = scene::Layers.active();
|
||||
if (false == usable(layer))
|
||||
layer = 1;
|
||||
return layer;
|
||||
}
|
||||
|
||||
} // namespace alignment_store
|
||||
|
||||
Reference in New Issue
Block a user