diff --git a/CMakeLists.txt b/CMakeLists.txt index 7d6b7d24..4c023ec6 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -179,6 +179,7 @@ set(SOURCES "editor/editorRoad.cpp" "editor/editorAlignment.cpp" "editor/editorAlignmentStore.cpp" +"editor/editorSwitchStore.cpp" "editor/editorSpeed.cpp" "editor/editorProfile.cpp" "editor/editorGauge.cpp" diff --git a/application/editormode.cpp b/application/editormode.cpp index 134c5335..bd3000a2 100644 --- a/application/editormode.cpp +++ b/application/editormode.cpp @@ -29,6 +29,7 @@ extern char **environ; #include "editor/editorGroundMesh.hpp" #include "editor/editorFormat.hpp" #include "editor/editorAlignmentStore.hpp" +#include "editor/editorSwitchStore.hpp" #include "editor/editorGeometry.hpp" #include "editor/editorIcons.hpp" #include "utilities/translation.h" @@ -497,6 +498,7 @@ void editor_mode::editormode_input::poll() editor_mode::editor_mode() { alignment_store::reset(); + switch_store::reset(); m_userinterface = std::make_shared(); // the area fill settings live in the node bank window, in the tab of the fill mode ui()->set_fill_options([this]() { render_area_fill(); }); @@ -2904,6 +2906,7 @@ bool editor_mode::save() if (m_profile.changed) profile_store(); + switch_store::tidy(); infra_store(); if (false == m_saved_camera.has_value() || glm::distance(m_saved_camera->first, glm::dvec3{Camera.Pos}) > 0.5 || glm::distance(m_saved_camera->second, glm::vec3{Camera.Angle}) > 0.01f) { diff --git a/application/editormode.h b/application/editormode.h index 015497bd..f5b4fa53 100644 --- a/application/editormode.h +++ b/application/editormode.h @@ -787,6 +787,9 @@ class editor_mode : public application_mode, private editor_track::observer bool route_load(TTrack &Track); void route_read_stored(); void route_take_stored(int const Index); + void record_switch(TTrack &Track, editor_track::switch_template const &Shape); + void record_slip(std::vector const &Parts, std::string const &Kind, std::string const &Type, double const Radius, double const Angle, std::string const &Base); + void render_switch_record(TTrack &Track); void route_store(); void render_route_stored(); void route_update() { m_route.result = alignment::compute(m_route.design); } diff --git a/application/editormodeselftest.cpp b/application/editormodeselftest.cpp index 50558c8c..dd6622b7 100644 --- a/application/editormodeselftest.cpp +++ b/application/editormodeselftest.cpp @@ -34,6 +34,9 @@ http://mozilla.org/MPL/2.0/. #include #include "editor/editorFormat.hpp" #include "editor/editorAlignmentStore.hpp" +#include "editor/editorSwitchStore.hpp" +#include "scene/sceneterrain.h" +#include "editor/editorSpeed.hpp" #include #include @@ -98,6 +101,10 @@ http://mozilla.org/MPL/2.0/. // routeapply, routetake as the buttons of the route design do it // alignments logs the alignments kept in the scenery and the element under each path // splitkind , nudgekind the first path over an element of the kind split in two, or moved +// switchplace