mirror of
https://github.com/MaSzyna-EU07/maszyna.git
synced 2026-11-02 01:09:13 +01:00
feat(editor): switch templates by their geometry and a template editor: the diverging track is a chain of straights, arcs and transition curves from the start of the switch, with the pre-blade stretch and the angle of the blade at its tip; own templates are kept in eu07_switch_templates.txt and listed in the switch tool; double switches Rpd and Rpj are laid as two switches joined by the main track and handled as one set by sliding, replacing, flipping, the gizmo and deleting, with drives for both switches; self-test switchtemplates
This commit is contained in:
@@ -19,6 +19,7 @@ http:
|
||||
|
||||
#include "world/Segment.h"
|
||||
#include "editor/editorAlignment.hpp"
|
||||
#include "editor/editorSwitchDesign.hpp"
|
||||
#include "utilities/Classes.h"
|
||||
|
||||
class TTrack;
|
||||
@@ -406,8 +407,16 @@ class editor_track
|
||||
bool double_slip{false};
|
||||
std::string type{"Rz"};
|
||||
std::string rail{"-"};
|
||||
// the second switch of a double one, starting on the main track of the first at the stagger
|
||||
std::array<segment_data, 2> second;
|
||||
segment_data link; // plain track from the main track of the first switch to the start of the second one
|
||||
double stagger{0.0};
|
||||
bool own{false};
|
||||
int design{-1}; // in the list of the designs the template was built from
|
||||
bool twofold() const { return stagger > 0.0; }
|
||||
};
|
||||
static std::vector<switch_template> standard_switch_templates();
|
||||
static std::optional<switch_template> template_of(switch_design::design const &Design, std::string &Error);
|
||||
static std::vector<switch_template> find_switch_templates();
|
||||
static TTrack *load_path(std::string const &Text, TTrack const &Template, std::string const &Name = {});
|
||||
static TTrack *create_path(TTrack const &Style, segment_data const &Path);
|
||||
|
||||
Reference in New Issue
Block a user