|
Correlation 4.10.0
An Analysis Tool for Liquids and for Amorphous Solids
|
Manages plot rendering, caching, interactions, and exports. More...
#include <PlotController.hpp>

Public Member Functions | |
| PlotController (::AppWindow &window, AnalysisDispatcher &dispatcher, const ProgramOptions &options) | |
| Constructs the PlotController with injected dispatcher and options. | |
| ~PlotController () | |
| Destructor. Joins render worker thread before destruction. | |
| void | populatePlotList () |
| Populates available plot names into the UI dropdown list. | |
| void | handleMouseMove (float mouse_x, float mouse_y, bool hover, float width, float height) |
| Handles mouse movement and hover tooltip calculation on the plot canvas. | |
| void | requestPlotUpdate (int index, bool immediate=false) |
| Schedules or immediately triggers a plot redraw for the specified plot index. | |
| void | syncPlotListForActiveTab (int tab) |
| Synchronizes the dropdown plot items and available keys according to active tab. In Dual View mode (tab 2), restricts selections to g(r), S(Q), PAD, and 2D Phase Heatmap. | |
| std::span< const std::string > | availablePlotKeys () const noexcept |
| Returns active plot key names. | |
| void | handleSavePlot () |
| Handles saving the current plot to file (SVG/PDF). | |
| void | handleCopyPlotToClipboard () |
| Copies SVG vector markup of the active plot to the system clipboard. | |
| void | handlePinRun () |
| Pins the current analysis run for comparison overlay. | |
| void | handleClearPinnedRuns () |
| Clears all pinned comparison overlay runs. | |
| void | handlePlotResized (PlotSize size) |
| Handles plot resized callback from UI layout changes. | |
| void | handleToggleCurveVisibility (int curve_id, bool visible) |
| Handles toggling curve visibility from the Slint preview checklist. | |
| void | handleToggleAllCurves (bool visible) |
| Handles bulk toggling all curves visible or hidden. | |
| void | handleFilterCurves (const slint::SharedString &filter_text) |
| Handles real-time curve name filtering from the curve sidebar. | |
| void | handleInvertCurveVisibility () |
| Handles inverting visibility of tracked curves (scoped to filter if active). | |
| void | handleToggleDifferencePlot (bool show_difference) |
| Handles toggling overlaid absolute difference curve Y_diff rendering. | |
| void | handleSetCurveColor (int curve_id, const slint::SharedString &color_hex) |
| Handles setting a custom color for a curve. | |
| void | handleZoomRect (float start_x, float start_y, float end_x, float end_y) |
| Handles box zoom to a specified screen bounding rectangle. | |
| void | handlePan (float delta_x, float delta_y) |
| Handles continuous panning by screen pixel displacement. | |
| void | handleWheelZoom (float mouse_x, float mouse_y, float delta) |
| Handles mouse wheel zooming centered around the mouse cursor. | |
| void | handleResetZoom () |
| Resets zoom to full dataset auto bounds. | |
| void | handleAddMarkerAt (float click_x, float click_y, bool is_vertical) |
| Adds a reference line (vertical for X, horizontal for Y) at clicked screen coordinates. | |
| void | handleAddMarker (bool is_vertical) |
| Adds a reference line (vertical for X, horizontal for Y) at current cursor position. | |
| void | handleClearMarkers () |
| Clears all user reference markers. | |
| void | resetPlotState () noexcept |
| Resets all plot series state (visibility overrides, custom colors, pinned runs). | |
| void | handleApplyAxisSettings () |
| Applies manual axis range, ticks, and scaling from the floating popover. | |
| correlation::plotters::PlotConfig | buildPlotConfigFromUI () |
| Constructs the consolidated plot rendering configuration from active UI state. | |
| void | handleResetAxisSettings () |
| Resets axis limits, ticks, and scaling to automatic dataset extents. | |
| void | handleSetCurveWidth (const slint::SharedString &width_str) |
| Sets custom curve line width from the styling popover. | |
| void | setStructure3DController (Structure3DController *s3d) noexcept |
| Connects reference to Structure3DController to synchronize distribution limits. | |
| void | setTrajectoryLoader (const TrajectoryLoader *loader) noexcept |
| Associates TrajectoryLoader for density calculations in CN integration. | |
| void | handleTagPeakAt (float click_x, float click_y) |
| Detects and tags the peak near clicked screen coordinates. | |
| void | handleTagPeakRange (float start_x, float end_x) |
| Integrates and tags peak within screen coordinate range [start_x, end_x]. | |
| void | handleRemoveTaggedPeak (int idx) |
| Removes a tagged peak by its identifier. | |
| void | handleClearTaggedPeaks () |
| Clears all tagged peak annotations. | |
| void | handleExportTaggedPeaks () |
| Exports tagged peaks to CSV. | |
| void | updateTaggedPeakPixels () |
| Recomputes screen projection coordinates for all tagged peaks. | |
| std::span< const TaggedPeakData > | getTaggedPeaks () const noexcept |
| Returns a read-only view of active tagged peaks. | |
| float | getLastPlotWidth () const noexcept |
| Returns the last cached plot canvas width. | |
| float | getLastPlotHeight () const noexcept |
| Returns the last cached plot canvas height. | |
| correlation::plotters::PlotConfig | getActivePlotConfig () |
| Builds and returns the active plot configuration from current UI state. | |
| void | setOnPlotGeometryChanged (std::function< void(float, float)> callback) |
| Registers a callback invoked whenever plot canvas dimensions change. | |
Private Member Functions | |
| void | updateTableData (const correlation::analysis::Histogram *hist) |
| void | updateCurveToggleItems (const correlation::analysis::Histogram *hist) |
| void | applyDualViewOverlay (RenderTask &task, const std::string &name, std::size_t current_frame) const |
| void | syncMetricSettingsToUI (int index) |
| void | syncSettingsTo3DHUD (int index, const correlation::plotters::MetricPlotSettings &settings) |
| void | notifyRadialHover (std::string_view plot_name, std::optional< double > data_x) const |
| void | syncZoomLimitsToSettings (int current_idx) |
| Synchronizes active zoom viewport limits to metric plot settings and UI. | |
Manages plot rendering, caching, interactions, and exports.
| correlation::app::PlotController::PlotController | ( | ::AppWindow & | window, |
| AnalysisDispatcher & | dispatcher, | ||
| const ProgramOptions & | options ) |
Constructs the PlotController with injected dispatcher and options.
| [in,out] | window | Reference to the UI window. |
| [in,out] | dispatcher | Reference to the analysis dispatcher. |
| [in] | options | Reference to program options. |

| correlation::app::PlotController::~PlotController | ( | ) |
Destructor. Joins render worker thread before destruction.
|
private |

|
inlinenodiscardnoexcept |
Returns active plot key names.
|
nodiscard |
Constructs the consolidated plot rendering configuration from active UI state.

|
inlinenodiscard |
Builds and returns the active plot configuration from current UI state.

|
inlinenodiscardnoexcept |
Returns the last cached plot canvas height.
|
inlinenodiscardnoexcept |
Returns the last cached plot canvas width.
|
inlinenodiscardnoexcept |
Returns a read-only view of active tagged peaks.
| void correlation::app::PlotController::handleAddMarker | ( | bool | is_vertical | ) |
Adds a reference line (vertical for X, horizontal for Y) at current cursor position.
| [in] | is_vertical | True for vertical X marker, false for horizontal Y marker. |

| void correlation::app::PlotController::handleAddMarkerAt | ( | float | click_x, |
| float | click_y, | ||
| bool | is_vertical ) |
Adds a reference line (vertical for X, horizontal for Y) at clicked screen coordinates.
| [in] | click_x | Screen X coordinate of the click. |
| [in] | click_y | Screen Y coordinate of the click. |
| [in] | is_vertical | True for vertical X marker, false for horizontal Y marker. |


| void correlation::app::PlotController::handleApplyAxisSettings | ( | ) |
Applies manual axis range, ticks, and scaling from the floating popover.

| void correlation::app::PlotController::handleClearMarkers | ( | ) |
Clears all user reference markers.

| void correlation::app::PlotController::handleClearPinnedRuns | ( | ) |
Clears all pinned comparison overlay runs.

| void correlation::app::PlotController::handleClearTaggedPeaks | ( | ) |
Clears all tagged peak annotations.

| void correlation::app::PlotController::handleCopyPlotToClipboard | ( | ) |
Copies SVG vector markup of the active plot to the system clipboard.

| void correlation::app::PlotController::handleExportTaggedPeaks | ( | ) |
Exports tagged peaks to CSV.
| void correlation::app::PlotController::handleFilterCurves | ( | const slint::SharedString & | filter_text | ) |
Handles real-time curve name filtering from the curve sidebar.
| [in] | filter_text | Substring query to filter visible curve items. |

| void correlation::app::PlotController::handleInvertCurveVisibility | ( | ) |
Handles inverting visibility of tracked curves (scoped to filter if active).

| void correlation::app::PlotController::handleMouseMove | ( | float | mouse_x, |
| float | mouse_y, | ||
| bool | hover, | ||
| float | width, | ||
| float | height ) |
Handles mouse movement and hover tooltip calculation on the plot canvas.
| [in] | mouse_x | Mouse X coordinate on canvas. |
| [in] | mouse_y | Mouse Y coordinate on canvas. |
| [in] | hover | Flag indicating active mouse hover state. |
| [in] | width | Canvas layout width. |
| [in] | height | Canvas layout height. |

| void correlation::app::PlotController::handlePan | ( | float | delta_x, |
| float | delta_y ) |
Handles continuous panning by screen pixel displacement.
| [in] | delta_x | Screen horizontal delta in pixels. |
| [in] | delta_y | Screen vertical delta in pixels. |

| void correlation::app::PlotController::handlePinRun | ( | ) |
Pins the current analysis run for comparison overlay.

| void correlation::app::PlotController::handlePlotResized | ( | PlotSize | size | ) |
Handles plot resized callback from UI layout changes.
| [in] | size | New plot container dimensions. |

| void correlation::app::PlotController::handleRemoveTaggedPeak | ( | int | idx | ) |
Removes a tagged peak by its identifier.
| [in] | id | Peak identifier. |

| void correlation::app::PlotController::handleResetAxisSettings | ( | ) |
Resets axis limits, ticks, and scaling to automatic dataset extents.

| void correlation::app::PlotController::handleResetZoom | ( | ) |
Resets zoom to full dataset auto bounds.

| void correlation::app::PlotController::handleSavePlot | ( | ) |
Handles saving the current plot to file (SVG/PDF).

| void correlation::app::PlotController::handleSetCurveColor | ( | int | curve_id, |
| const slint::SharedString & | color_hex ) |
Handles setting a custom color for a curve.
| [in] | curve_id | Curve identifier index. |
| [in] | color_hex | Custom hex color string. |

| void correlation::app::PlotController::handleSetCurveWidth | ( | const slint::SharedString & | width_str | ) |
Sets custom curve line width from the styling popover.
| [in] | width_str | Stroke line width string in pixels. |

| void correlation::app::PlotController::handleTagPeakAt | ( | float | click_x, |
| float | click_y ) |
Detects and tags the peak near clicked screen coordinates.
| [in] | click_x | Screen horizontal pixel coordinate. |
| [in] | click_y | Screen vertical pixel coordinate. |

| void correlation::app::PlotController::handleTagPeakRange | ( | float | start_x, |
| float | end_x ) |
Integrates and tags peak within screen coordinate range [start_x, end_x].
| [in] | start_x | Starting screen pixel coordinate. |
| [in] | end_x | Ending screen pixel coordinate. |

| void correlation::app::PlotController::handleToggleAllCurves | ( | bool | visible | ) |
Handles bulk toggling all curves visible or hidden.
| [in] | visible | Target visibility state for all curves. |

| void correlation::app::PlotController::handleToggleCurveVisibility | ( | int | curve_id, |
| bool | visible ) |
Handles toggling curve visibility from the Slint preview checklist.
| [in] | curve_id | Curve identifier index. |
| [in] | visible | Target visibility state. |

| void correlation::app::PlotController::handleToggleDifferencePlot | ( | bool | show_difference | ) |
Handles toggling overlaid absolute difference curve Y_diff rendering.
| [in] | show_difference | Target visibility state for Y_diff. |

| void correlation::app::PlotController::handleWheelZoom | ( | float | mouse_x, |
| float | mouse_y, | ||
| float | delta ) |
Handles mouse wheel zooming centered around the mouse cursor.
| [in] | mouse_x | Screen cursor X coordinate. |
| [in] | mouse_y | Screen cursor Y coordinate. |
| [in] | delta | Mouse wheel vertical displacement delta. |

| void correlation::app::PlotController::handleZoomRect | ( | float | start_x, |
| float | start_y, | ||
| float | end_x, | ||
| float | end_y ) |
Handles box zoom to a specified screen bounding rectangle.
| [in] | start_x | Starting screen X coordinate. |
| [in] | start_y | Starting screen Y coordinate. |
| [in] | end_x | Ending screen X coordinate. |
| [in] | end_y | Ending screen Y coordinate. |

|
private |

| void correlation::app::PlotController::populatePlotList | ( | ) |
Populates available plot names into the UI dropdown list.

| void correlation::app::PlotController::requestPlotUpdate | ( | int | index, |
| bool | immediate = false ) |
Schedules or immediately triggers a plot redraw for the specified plot index.
| [in] | index | Target plot selection index. |
| [in] | immediate | If true, skips debounce timer and updates immediately. |


|
noexcept |
Resets all plot series state (visibility overrides, custom colors, pinned runs).

|
inline |
Registers a callback invoked whenever plot canvas dimensions change.
|
inlinenoexcept |
Connects reference to Structure3DController to synchronize distribution limits.
| [in] | s3d | Pointer to Structure3DController. |


|
inlinenoexcept |
Associates TrajectoryLoader for density calculations in CN integration.
| [in] | loader | Pointer to active TrajectoryLoader. |
|
private |

| void correlation::app::PlotController::syncPlotListForActiveTab | ( | int | tab | ) |
Synchronizes the dropdown plot items and available keys according to active tab. In Dual View mode (tab 2), restricts selections to g(r), S(Q), PAD, and 2D Phase Heatmap.
| [in] | tab | Active tab index. |

|
private |

|
private |
Synchronizes active zoom viewport limits to metric plot settings and UI.
| [in] | current_idx | Target metric plot selection index. |


|
private |


|
private |


| void correlation::app::PlotController::updateTaggedPeakPixels | ( | ) |
Recomputes screen projection coordinates for all tagged peaks.


|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |