mirror of
https://github.com/MaSzyna-EU07/maszyna.git
synced 2026-11-02 06:59:13 +01:00
feat(editor): the tracks laid on the terrain model go onto it as the tracks going onto the terrain do, the chain laid since the laying began fitted again at each click, with the tracks around kept and met; a straight or an arc cut by the fit before made one again, a path cut only where it would part from the line by more than 3 cm; a choice of the heights while laying: fitted, from point to point, level, kept in the settings; the fit taken back with its click
This commit is contained in:
@@ -1450,7 +1450,7 @@ void editor_mode::profile_frame_view()
|
||||
fly_to(centre - right * (shift.x * pixel) + above * (shift.y * pixel), look, distance, 0.35);
|
||||
}
|
||||
|
||||
void editor_mode::profile_apply(bool const Terrain, std::vector<profile::departure> const &Bridges)
|
||||
void editor_mode::profile_apply(bool const Terrain, std::vector<profile::departure> const &Bridges, double const Fewest)
|
||||
{
|
||||
auto &state{m_profile};
|
||||
state.status.clear();
|
||||
@@ -1475,12 +1475,14 @@ void editor_mode::profile_apply(bool const Terrain, std::vector<profile::departu
|
||||
auto const before{state.samples};
|
||||
std::vector<std::pair<TTrack *, editor_track::state>> states;
|
||||
std::vector<TTrack *> created;
|
||||
auto cuts{profile::breaks(line)};
|
||||
std::vector<double> ends;
|
||||
for (auto const &span : state.route.spans)
|
||||
ends.insert(ends.end(), {span.from, span.to});
|
||||
auto cuts{Fewest > 0.0 ? profile::fewest_breaks(line, ends, Fewest) : profile::breaks(line)};
|
||||
// a bridge ends at a joint or a break of the line by its abutment rather than leave a sliver of a path there
|
||||
double constexpr kBridgeSnap{1.0}; // m
|
||||
auto joints{cuts};
|
||||
for (auto const &span : state.route.spans)
|
||||
joints.insert(joints.end(), {span.from, span.to});
|
||||
joints.insert(joints.end(), ends.begin(), ends.end());
|
||||
auto bridges{Bridges};
|
||||
for (auto &bridge : bridges)
|
||||
for (auto *end : {&bridge.from, &bridge.to})
|
||||
|
||||
Reference in New Issue
Block a user