16#include <condition_variable>
59 bool dispatch_to_slint_event_loop =
true);
82 std::size_t pinned_runs_count,
83 std::size_t active_frame = 0) const noexcept;
114 std::shared_ptr<std::atomic<bool>>
alive_{std::make_shared<std::atomic<bool>>(
true)};
Manager for distribution function calculations (RDF, PAD, S(Q), etc.).
Facade header for zero-dependency SVG plotter.
PlotRenderPipeline & operator=(PlotRenderPipeline &&)=delete
std::optional< RenderTask > waitForNextTask()
Definition PlotRenderPipeline.cpp:115
void renderLoop()
Definition PlotRenderPipeline.cpp:165
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.
Definition PlotRenderPipeline.cpp:86
std::mutex cache_mutex_
Definition PlotRenderPipeline.hpp:116
std::jthread render_worker_
Definition PlotRenderPipeline.hpp:109
void invalidateCache() noexcept
Invalidates cached parameters to force re-rendering on the next request.
Definition PlotRenderPipeline.cpp:77
int last_rendered_index_
Definition PlotRenderPipeline.hpp:117
correlation::plotters::PlotConfig last_config_
Definition PlotRenderPipeline.hpp:119
PlotRenderPipeline(ImageRenderedCallback callback, bool dispatch_to_slint_event_loop=true)
Constructs pipeline and starts background rendering worker thread.
Definition PlotRenderPipeline.cpp:56
std::mutex render_mutex_
Definition PlotRenderPipeline.hpp:110
PlotRenderPipeline & operator=(const PlotRenderPipeline &)=delete
void submitTask(RenderTask task)
Enqueues a render task to the worker queue, discarding superseded tasks.
Definition PlotRenderPipeline.cpp:96
static std::string renderSvg(RenderTask &task)
Definition PlotRenderPipeline.cpp:132
bool stop_render_worker_
Definition PlotRenderPipeline.hpp:113
std::shared_ptr< std::atomic< bool > > alive_
Definition PlotRenderPipeline.hpp:114
correlation::plotters::HoverInfo last_hover_
Definition PlotRenderPipeline.hpp:120
std::condition_variable render_cv_
Definition PlotRenderPipeline.hpp:111
std::size_t last_pinned_runs_count_
Definition PlotRenderPipeline.hpp:121
ImageRenderedCallback callback_
Definition PlotRenderPipeline.hpp:107
void stop() noexcept
Stops worker thread and cancels pending operations.
Definition PlotRenderPipeline.cpp:64
std::optional< RenderTask > pending_task_
Definition PlotRenderPipeline.hpp:112
std::size_t last_rendered_frame_
Definition PlotRenderPipeline.hpp:118
~PlotRenderPipeline()
Destructor. Signals stop condition and joins worker thread safely.
Definition PlotRenderPipeline.cpp:62
PlotRenderPipeline(const PlotRenderPipeline &)=delete
std::function< void(const slint::Image &)> ImageRenderedCallback
Definition PlotRenderPipeline.hpp:51
bool dispatch_to_slint_event_loop_
Definition PlotRenderPipeline.hpp:108
PlotRenderPipeline(PlotRenderPipeline &&)=delete
void dispatchImage(slint::Image img)
Definition PlotRenderPipeline.cpp:148
Definition AppController.hpp:27
Container for a single calculated distribution function.
Definition DistributionFunctions.hpp:226
Self-contained payload consumed by the background SVG render worker.
Definition PlotRenderPipeline.hpp:32
correlation::plotters::PlotConfig config
Output styling config.
Definition PlotRenderPipeline.hpp:37
int index
Target plot index.
Definition PlotRenderPipeline.hpp:33
std::map< std::string, bool > curve_visibility
Curve visibility flags.
Definition PlotRenderPipeline.hpp:40
std::map< std::string, std::string > custom_curve_colors
Custom curve colors.
Definition PlotRenderPipeline.hpp:41
std::map< std::string, real_t > ashcroft_weights
Ashcroft weights.
Definition PlotRenderPipeline.hpp:39
correlation::analysis::Histogram active_hist
Active histogram data.
Definition PlotRenderPipeline.hpp:35
std::size_t pinned_runs_count
Pinned runs count.
Definition PlotRenderPipeline.hpp:42
correlation::plotters::HoverInfo hover
Cursor hover metadata.
Definition PlotRenderPipeline.hpp:38
std::size_t active_frame
Active trajectory frame.
Definition PlotRenderPipeline.hpp:34
std::vector< correlation::plotters::LabeledHistogram > comparison_hists
Comparison histograms.
Definition PlotRenderPipeline.hpp:36
Information about the mouse hover position.
Definition PlotTypes.hpp:176
Theme and layout configuration for the plot.
Definition PlotTypes.hpp:42