|
Correlation 4.10.0
An Analysis Tool for Liquids and for Amorphous Solids
|
Manages 2D plot coordinate space, active zoom window, and interactive pan/zoom transitions. More...
#include <PlotViewportNavigator.hpp>
Public Member Functions | |
| bool | hasActiveZoom () const noexcept |
| Checks if a custom zoom window is currently active. | |
| void | applyZoomRect (float start_x, float start_y, float end_x, float end_y, float canvas_w, float canvas_h, const correlation::analysis::Histogram &hist, const correlation::plotters::PlotConfig &config) |
| Applies rectangular selection box zoom. | |
| void | applyPan (float delta_x, float delta_y, float mouse_x, float mouse_y, float canvas_w, float canvas_h, const correlation::analysis::Histogram &hist, const correlation::plotters::PlotConfig &config) |
| Applies viewport translation pan by delta pixel displacement. | |
| void | applyWheelZoom (float mouse_x, float mouse_y, float delta, float canvas_w, float canvas_h, const correlation::analysis::Histogram &hist, const correlation::plotters::PlotConfig &config) |
| Applies stepped or continuous zoom centered around mouse cursor. | |
| void | resetZoom () noexcept |
| Resets zoom state to full automatic bounds. | |
| ViewportLimits | limits () const noexcept |
| Returns currently active zoom window limits. | |
| void | setLimits (ViewportLimits limits) noexcept |
| Sets explicit manual viewport limits. | |
| void | applyToConfig (correlation::plotters::PlotConfig &config) const noexcept |
| Injects active zoom limits into target PlotConfig. | |
Static Public Member Functions | |
| static correlation::plotters::detail::NiceScale | computeXScale (const correlation::analysis::Histogram &hist, const correlation::plotters::PlotConfig &config) |
| Computes standard or manual nice axis scale for the X dimension. | |
| static correlation::plotters::detail::NiceScale | computeYScale (const correlation::analysis::Histogram &hist, const correlation::plotters::PlotConfig &config) |
| Computes standard or manual nice axis scale for the Y dimension across all visible partials. | |
| static std::pair< real_t, real_t > | screenToData (float screen_x, float screen_y, float canvas_w, float canvas_h, const correlation::analysis::Histogram &hist, const correlation::plotters::PlotConfig &config) |
| Projects screen-space coordinates to data-space coordinates. | |
| static std::pair< real_t, real_t > | dataToScreen (real_t data_x, real_t data_y, float canvas_w, float canvas_h, const correlation::analysis::Histogram &hist, const correlation::plotters::PlotConfig &config) |
| Projects data-space coordinates to screen-space coordinates. | |
Private Attributes | |
| std::optional< real_t > | zoom_x_min_ |
| std::optional< real_t > | zoom_x_max_ |
| std::optional< real_t > | zoom_y_min_ |
| std::optional< real_t > | zoom_y_max_ |
Manages 2D plot coordinate space, active zoom window, and interactive pan/zoom transitions.
| void correlation::app::PlotViewportNavigator::applyPan | ( | float | delta_x, |
| float | delta_y, | ||
| float | mouse_x, | ||
| float | mouse_y, | ||
| float | canvas_w, | ||
| float | canvas_h, | ||
| const correlation::analysis::Histogram & | hist, | ||
| const correlation::plotters::PlotConfig & | config ) |
Applies viewport translation pan by delta pixel displacement.
| [in] | delta_x | Screen horizontal pixel shift. |
| [in] | delta_y | Screen vertical pixel shift. |
| [in] | mouse_x | Reference cursor X coordinate. |
| [in] | mouse_y | Reference cursor Y coordinate. |
| [in] | canvas_w | Canvas width in pixels. |
| [in] | canvas_h | Canvas height in pixels. |
| [in] | hist | Active histogram data. |
| [in] | config | Base plotting configuration. |

|
noexcept |
Injects active zoom limits into target PlotConfig.
| [in,out] | config | Configuration structure to enrich. |
| void correlation::app::PlotViewportNavigator::applyWheelZoom | ( | float | mouse_x, |
| float | mouse_y, | ||
| float | delta, | ||
| float | canvas_w, | ||
| float | canvas_h, | ||
| const correlation::analysis::Histogram & | hist, | ||
| const correlation::plotters::PlotConfig & | config ) |
Applies stepped or continuous zoom centered around mouse cursor.
| [in] | mouse_x | Focus cursor X coordinate in pixels. |
| [in] | mouse_y | Focus cursor Y coordinate in pixels. |
| [in] | delta | Zoom displacement factor (>0 zooms in, <0 zooms out). |
| [in] | canvas_w | Canvas width in pixels. |
| [in] | canvas_h | Canvas height in pixels. |
| [in] | hist | Active histogram data. |
| [in] | config | Base plotting configuration. |

| void correlation::app::PlotViewportNavigator::applyZoomRect | ( | float | start_x, |
| float | start_y, | ||
| float | end_x, | ||
| float | end_y, | ||
| float | canvas_w, | ||
| float | canvas_h, | ||
| const correlation::analysis::Histogram & | hist, | ||
| const correlation::plotters::PlotConfig & | config ) |
Applies rectangular selection box zoom.
| [in] | start_x | Starting drag X coordinate. |
| [in] | start_y | Starting drag Y coordinate. |
| [in] | end_x | Ending drag X coordinate. |
| [in] | end_y | Ending drag Y coordinate. |
| [in] | canvas_w | Canvas width in pixels. |
| [in] | canvas_h | Canvas height in pixels. |
| [in] | hist | Active histogram data. |
| [in] | config | Base plotting configuration. |

|
staticnodiscard |
Computes standard or manual nice axis scale for the X dimension.
| [in] | hist | Active histogram data. |
| [in] | config | Base plotting configuration. |

|
staticnodiscard |
Computes standard or manual nice axis scale for the Y dimension across all visible partials.
| [in] | hist | Active histogram data. |
| [in] | config | Base plotting configuration. |

|
staticnodiscard |
Projects data-space coordinates to screen-space coordinates.
| [in] | data_x | Data horizontal coordinate. |
| [in] | data_y | Data vertical coordinate. |
| [in] | canvas_w | Total canvas width in pixels. |
| [in] | canvas_h | Total canvas height in pixels. |
| [in] | hist | Active histogram data. |
| [in] | config | Base plotting configuration. |


|
nodiscardnoexcept |
Checks if a custom zoom window is currently active.
|
nodiscardnoexcept |
Returns currently active zoom window limits.

|
noexcept |
Resets zoom state to full automatic bounds.
|
staticnodiscard |
Projects screen-space coordinates to data-space coordinates.
| [in] | screen_x | Screen horizontal coordinate in pixels. |
| [in] | screen_y | Screen vertical coordinate in pixels. |
| [in] | canvas_w | Total canvas width in pixels. |
| [in] | canvas_h | Total canvas height in pixels. |
| [in] | hist | Active histogram data. |
| [in] | config | Base plotting configuration. |


|
noexcept |
Sets explicit manual viewport limits.
| [in] | limits | Manual boundary limits to apply. |

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