17
0
mirror of https://github.com/MaSzyna-EU07/maszyna.git synced 2026-11-02 17:29:14 +01:00

Add a track layout drawing board to the editor

A "Plan" panel, opened from Track layout in the editor's menu bar, draws a
niweleta the way the web frontend did: click to lay chained straights, drag
a corner to move it, and pick a fit for each gap between them. The geometry
is entirely maj0sted's - the panel gathers the input, hands the document to
solve_project and paints the rails that come back, coloured by whether they
came from a straight, an arc or a clothoid. Scenery nodes are untouched.

A fit the library cannot produce is simply absent from its answer, so the
gap is labelled as not fitting rather than left looking as though its
parameters took effect. Save/load go through the library's own document
format, so a project written here opens in the same state.

Also translates the comments added with -editor into English, matching the
files they sit in.
This commit is contained in:
maj00r
2026-07-31 19:00:35 +02:00
committed by maj00r
parent e3237034db
commit 4bef28cf94
8 changed files with 684 additions and 13 deletions

View File

@@ -11,6 +11,7 @@ http://mozilla.org/MPL/2.0/.
#include "application/uilayer.h"
#include "application/editoruipanels.h"
#include "application/planpanel.h"
namespace scene
{
@@ -38,11 +39,15 @@ class editor_ui : public ui_layer
float getSpacing();
void toggleBrushSettings(bool isVisible);
protected:
void render_menu_contents() override;
private:
// members
itemproperties_panel m_itempropertiespanel{"Node Properties", true};
functions_panel m_functionspanel{"Functions", true};
nodebank_panel m_nodebankpanel{"Node Bank", true};
brush_object_list m_brushobjects{"Brush properties", false};
plan_panel m_planpanel{"Plan", false};
scene::basic_node *m_node{nullptr}; // currently bound scene node, if any
};