17
0
mirror of https://github.com/MaSzyna-EU07/maszyna.git synced 2026-11-03 00:26:22 +01:00

refactor(editor): the joints check is a tool of its own

The third tool out of editor_mode. It reaches the terrain model and the
places of the tracks on it through the services, the place of a track
for the terrain model is a type of its own now, and the laying and the
switches ask the tool for the kink it allows. A self-test command can
ask to be run again in the next frame, as the check against the terrain
model does while the model comes in.
This commit is contained in:
maj00r
2026-10-21 09:23:36 +02:00
parent 0c2880f48f
commit 8ba8345faf
10 changed files with 232 additions and 163 deletions

View File

@@ -78,6 +78,26 @@ alignment::limits const &editor_mode::route_norms() const
return m_route.design.norms;
}
void editor_mode::clear_track_point()
{
m_track_point = {};
}
editor_nmt &editor_mode::terrain_model()
{
return m_nmt;
}
double editor_mode::terrain_model_offset() const
{
return m_nmt_state.offset;
}
bool editor_mode::terrain_model_fitted() const
{
return m_nmt_state.fitted;
}
void editor_mode::select_track(scene::basic_node *Node)
{
auto *track = dynamic_cast<TTrack *>(Node);
@@ -527,7 +547,7 @@ void editor_mode::render_track_inspector()
m_profile.open = m_track_window_open && m_track_tab == track_tab::profile;
m_speed.set_open(m_track_window_open && m_track_tab == track_tab::speed);
m_infra.open = m_track_window_open && m_track_tab == track_tab::infra;
m_joints.open = m_track_window_open && m_track_tab == track_tab::joints;
m_joints.set_open(m_track_window_open && m_track_tab == track_tab::joints);
if (false == m_track_window_open || m_track_tab != track_tab::lineside)
{
m_sweep.open = false;
@@ -559,7 +579,7 @@ void editor_mode::render_track_inspector()
switch (m_track_tab)
{
case track_tab::speed: m_speed.render_options(); break;
case track_tab::joints: render_joints_body(); break;
case track_tab::joints: m_joints.render_options(); break;
default: render_infra_body(); break;
}
}