@@ -33,8 +33,12 @@ class LightViewer : public guik::Application, public guik::LightViewerContext {
3333 bool toggle_spin_once ();
3434 virtual void register_ui_callback (const std::string& name, const std::function<void ()>& callback = 0) override ;
3535
36+ // Invoke a task in the visualization thread
3637 void invoke (const std::function<void ()>& func);
38+ // Invoke a task after rendering in the visualization thread
3739 void invoke_after_rendering (const std::function<void ()>& func);
40+ // Invoke a labeled task only once
41+ void invoke_once (const std::string& label, const std::function<void ()>& func);
3842
3943 virtual void clear () override ;
4044 virtual void clear_text () override ;
@@ -55,7 +59,8 @@ class LightViewer : public guik::Application, public guik::LightViewerContext {
5559 void clear_plots (bool clear_settings = true );
5660 void remove_plot (const std::string& plot_name, const std::string& label = " " );
5761 void setup_plot (const std::string& plot_name, int width, int height, int plot_flags = 0 , int x_flags = 0 , int y_flags = 0 , int order = -1 );
58- void link_plot_axes (const std::string& plot_name, int link_id, int axis);
62+ void link_plot_axis (const std::string& plot_name, int link_id, int axis); // axis = ImAxis_X1 or ImAxis_X2, ...
63+ void link_plot_axes (const std::string& plot_name, int link_id, int axes = -1 ); // axes = (1 << ImAxis_X1) | (1 << ImAxis_X2) ...
5964 void setup_legend (const std::string& plot_name, int loc, int flags = 0 );
6065 void fit_plot (const std::string& plot_name);
6166 void fit_all_plots ();
@@ -286,6 +291,7 @@ class LightViewer : public guik::Application, public guik::LightViewerContext {
286291
287292 std::mutex invoke_requests_mutex;
288293 std::deque<std::function<void ()>> invoke_requests;
294+ std::unordered_set<std::string> invoke_once_called;
289295
290296 std::mutex post_render_invoke_requests_mutex;
291297 std::deque<std::function<void ()>> post_render_invoke_requests;
0 commit comments