17
0
mirror of https://github.com/MaSzyna-EU07/maszyna.git synced 2026-10-18 14:59:19 +02:00

feat(editor): the switch no longer slides to meet the track, only the straight and arc fill in: arc of the switch radius between two straights, and where the angles match but the tracks are apart, or the arc doesn't fit, reverse curves with no transitions and the largest radius that fits; the straight between them (6 m to V 60, 0.15 V to 100, 0.25 V above) only when 1/R1 + 1/R2 > 1/106.5 m (PLK ST-T1 9.3, table 9.4); new pieces take the style of a plain track, not of a switch

This commit is contained in:
maj00r
2026-10-12 00:09:49 +02:00
parent 0a73550c8d
commit d4d2a02018
6 changed files with 206 additions and 151 deletions

View File

@@ -1072,9 +1072,6 @@ class editor_mode : public application_mode, private editor_track::observer
editor_track::snap_target origin;
editor_track::snap_target snap;
glm::vec2 pressed{0.f};
bool slides{false};
double slide_low{0.0};
double slide_high{0.0};
std::vector<TTrack *> line;
};
extend_tool m_extend;
@@ -1143,7 +1140,7 @@ class editor_mode : public application_mode, private editor_track::observer
bool plan_branch_link(editor_track::branch_link &Link, std::string &Reason) const;
void finish_branch_link(editor_track::branch_link const &Link);
std::string link_problem(editor_track::snap_target const &Target, editor_track::branch_link const &Link) const;
std::vector<TTrack *> link_tracks(editor_track::snap_target const &Target, editor_track::branch_link const &Link, std::vector<std::pair<TTrack *, editor_track::state>> &States, std::vector<TTrack *> &Created);
std::vector<TTrack *> link_tracks(editor_track::snap_target const &Target, editor_track::branch_link const &Link, TTrack const &Style, std::vector<std::pair<TTrack *, editor_track::state>> &States, std::vector<TTrack *> &Created);
bool cut_straight(editor_track::straight const &Line, double const From, double const To, std::vector<std::pair<TTrack *, editor_track::state>> &States, std::vector<TTrack *> &Created, std::vector<TTrack *> &Removed, TTrack **Style);
bool insert_double_slip(editor_track::straight const &Line, glm::dvec3 const &Point, editor_track::switch_template const &Shape);
bool replace_double_slip(TTrack &Part, editor_track::switch_template const &Shape);