mirror of
https://github.com/MaSzyna-EU07/maszyna.git
synced 2026-11-03 01:30:16 +01:00
refactor(editor): the speed check is a tool of its own
The second tool out of editor_mode. Tools get two more hooks, the overlay drawn over the view and the options in the tool window, and the editor gives them the track it focuses on, the node it makes current, the norms of the route design and the snapshot of the tracks for the undo. The check gets a self-test command, speedcheck <scope>, which runs it through and logs the paths found too fast for their geometry.
This commit is contained in:
@@ -67,6 +67,17 @@ glm::dvec3 editor_mode::camera_position() const
|
||||
return Camera.Pos;
|
||||
}
|
||||
|
||||
void editor_mode::set_current_node(scene::basic_node *Node)
|
||||
{
|
||||
m_node = Node;
|
||||
ui()->set_node(m_node);
|
||||
}
|
||||
|
||||
alignment::limits const &editor_mode::route_norms() const
|
||||
{
|
||||
return m_route.design.norms;
|
||||
}
|
||||
|
||||
void editor_mode::select_track(scene::basic_node *Node)
|
||||
{
|
||||
auto *track = dynamic_cast<TTrack *>(Node);
|
||||
@@ -514,7 +525,7 @@ void editor_mode::render_track_inspector()
|
||||
{
|
||||
auto const &io{ImGui::GetIO()};
|
||||
m_profile.open = m_track_window_open && m_track_tab == track_tab::profile;
|
||||
m_speed.open = m_track_window_open && m_track_tab == track_tab::speed;
|
||||
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;
|
||||
if (false == m_track_window_open || m_track_tab != track_tab::lineside)
|
||||
@@ -547,7 +558,7 @@ void editor_mode::render_track_inspector()
|
||||
{
|
||||
switch (m_track_tab)
|
||||
{
|
||||
case track_tab::speed: render_speed_body(); break;
|
||||
case track_tab::speed: m_speed.render_options(); break;
|
||||
case track_tab::joints: render_joints_body(); break;
|
||||
default: render_infra_body(); break;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user