|
Correlation 4.10.0
An Analysis Tool for Liquids and for Amorphous Solids
|
Manages background SVG rasterization/generation worker thread, task queue, and caching. More...
#include <PlotRenderPipeline.hpp>

Public Types | |
| using | ImageRenderedCallback = std::function<void(const slint::Image &)> |
Public Member Functions | |
| PlotRenderPipeline (ImageRenderedCallback callback, bool dispatch_to_slint_event_loop=true) | |
| Constructs pipeline and starts background rendering worker thread. | |
| ~PlotRenderPipeline () | |
| Destructor. Signals stop condition and joins worker thread safely. | |
| PlotRenderPipeline (const PlotRenderPipeline &)=delete | |
| PlotRenderPipeline & | operator= (const PlotRenderPipeline &)=delete |
| PlotRenderPipeline (PlotRenderPipeline &&)=delete | |
| PlotRenderPipeline & | operator= (PlotRenderPipeline &&)=delete |
| bool | isCacheHit (int index, const correlation::plotters::PlotConfig &config, const correlation::plotters::HoverInfo &hover, std::size_t pinned_runs_count, std::size_t active_frame=0) const noexcept |
| Evaluates whether a new render request matches previously rendered frame parameters. | |
| void | invalidateCache () noexcept |
| Invalidates cached parameters to force re-rendering on the next request. | |
| void | submitTask (RenderTask task) |
| Enqueues a render task to the worker queue, discarding superseded tasks. | |
| void | stop () noexcept |
| Stops worker thread and cancels pending operations. | |
Private Member Functions | |
| std::optional< RenderTask > | waitForNextTask () |
| void | dispatchImage (slint::Image img) |
| void | renderLoop () |
Static Private Member Functions | |
| static std::string | renderSvg (RenderTask &task) |
Private Attributes | |
| ImageRenderedCallback | callback_ |
| bool | dispatch_to_slint_event_loop_ {true} |
| std::jthread | render_worker_ |
| std::mutex | render_mutex_ |
| std::condition_variable | render_cv_ |
| std::optional< RenderTask > | pending_task_ |
| bool | stop_render_worker_ {false} |
| std::shared_ptr< std::atomic< bool > > | alive_ {std::make_shared<std::atomic<bool>>(true)} |
| std::mutex | cache_mutex_ |
| int | last_rendered_index_ {-1} |
| std::size_t | last_rendered_frame_ {0} |
| correlation::plotters::PlotConfig | last_config_ |
| correlation::plotters::HoverInfo | last_hover_ |
| std::size_t | last_pinned_runs_count_ {0} |
Manages background SVG rasterization/generation worker thread, task queue, and caching.
| using correlation::app::PlotRenderPipeline::ImageRenderedCallback = std::function<void(const slint::Image &)> |
|
explicit |
Constructs pipeline and starts background rendering worker thread.
| [in] | callback | Callback invoked upon successful image generation. |
| [in] | dispatch_to_slint_event_loop | If true, dispatches via slint::invoke_from_event_loop. |


| correlation::app::PlotRenderPipeline::~PlotRenderPipeline | ( | ) |
Destructor. Signals stop condition and joins worker thread safely.

|
delete |

|
delete |

|
private |

|
noexcept |
Invalidates cached parameters to force re-rendering on the next request.

|
nodiscardnoexcept |
Evaluates whether a new render request matches previously rendered frame parameters.
| [in] | index | Target plot index. |
| [in] | config | Target plot configuration. |
| [in] | hover | Target hover info. |
| [in] | pinned_runs_count | Current pinned comparison runs count. |
| [in] | active_frame | Current active trajectory frame index. |
|
delete |

|
delete |

|
private |


|
staticnodiscardprivate |


|
noexcept |
Stops worker thread and cancels pending operations.

| void correlation::app::PlotRenderPipeline::submitTask | ( | RenderTask | task | ) |
Enqueues a render task to the worker queue, discarding superseded tasks.
| [in] | task | Self-contained render payload. |

|
nodiscardprivate |

|
private |
|
mutableprivate |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |