|
Correlation 4.10.0
An Analysis Tool for Liquids and for Amorphous Solids
|
Controller that manages element-pair bond cutoff matrices and synchronizes with the UI. More...
#include <BondCutoffController.hpp>

Public Member Functions | |
| BondCutoffController (AppWindow &window, TrajectoryLoader &loader, ProgramOptions &options, AnalysisDispatcher *dispatcher=nullptr) | |
| Constructs a BondCutoffController with injected services. | |
| BondCutoffController (AppWindow &window, TrajectoryLoader &loader, BondCutoffService &cutoff_service, ProgramOptions &options) | |
| Constructs a BondCutoffController with injected services (transitional). | |
| void | setDispatcher (AnalysisDispatcher *dispatcher) noexcept |
| Injects the AnalysisDispatcher service. | |
| void | setPlotController (PlotController *plot_controller) noexcept |
| Injects the PlotController service. | |
| void | setBondCutoffs () |
| Populates the UI model with default recommended bond cutoffs based on atomic elements. | |
| correlation::analysis::BondCutoffMatrix | getBondCutoffs () const |
| Parses the current UI model into a BondCutoffMatrix. | |
| void | applyScaledCutoffs (float scale_factor) |
| Scales all current bond cutoffs by a multiplicative factor. | |
| void | setUniformCutoff (float max_cutoff) |
| Sets uniform maximum cutoff across all element pairs. | |
| void | applyCovalentFactor (float factor, FactorBound bound) |
| Adjusts min or max bond cutoffs using covalent radii sum scaled by factor. | |
| void | applyGlobalCutoff (float global_cutoff) |
| Applies a uniform global cutoff to all element pairs. | |
| void | initializeCalibrationPairs () |
| Initializes and populates the UI CalibrationPair list from loaded elements. | |
| void | autoDetectCutoffs (int pair_index) |
| Automatically detects first coordination shell peak onset and minimum for a pair. | |
| void | resetCalibrationPair (int pair_index) |
| Resets specified calibration pair to standard covalent radii bounds. | |
| void | dragCutoffHandle (int pair_index, bool is_max, float mouse_x) |
| Handles dragging of r_min or r_max handles on the calibration overlay. | |
| void | updateCalibrationPixels (float canvas_w, float canvas_h) |
| Recomputes screen pixel coordinates (r_min_px, r_max_px, r_peak_px) for calibration pairs. | |
| void | setCutoffRange (int pair_index, float r_min, float r_max) |
| Sets explicit cutoff range for a pair and synchronizes UI and trajectory. | |
| void | evaluateSanityState () |
| Evaluates current bond cutoffs with CutoffSanityChecker and updates UI badge state. | |
| void | handleFixSanityIssue (int fix_action) |
| Executes automated repair action for sanity issues. | |
Private Member Functions | |
| void | syncCutoffsToUI () |
Private Attributes | |
| AppWindow & | window_ |
| TrajectoryLoader & | loader_ |
| ProgramOptions & | options_ |
| AnalysisDispatcher * | dispatcher_ {nullptr} |
| PlotController * | plot_controller_ {nullptr} |
| float | last_canvas_w_ {1000.0F} |
| float | last_canvas_h_ {600.0F} |
Controller that manages element-pair bond cutoff matrices and synchronizes with the UI.
| correlation::app::BondCutoffController::BondCutoffController | ( | AppWindow & | window, |
| TrajectoryLoader & | loader, | ||
| ProgramOptions & | options, | ||
| AnalysisDispatcher * | dispatcher = nullptr ) |
Constructs a BondCutoffController with injected services.
| [in,out] | window | Target UI window. |
| [in,out] | loader | Trajectory loader providing cell and trajectory. |
| [in,out] | options | Program options holding bond cutoffs. |
| [in] | dispatcher | Optional analysis dispatcher providing computed histograms. |

| correlation::app::BondCutoffController::BondCutoffController | ( | AppWindow & | window, |
| TrajectoryLoader & | loader, | ||
| BondCutoffService & | cutoff_service, | ||
| ProgramOptions & | options ) |
Constructs a BondCutoffController with injected services (transitional).
| [in,out] | window | Target UI window. |
| [in,out] | loader | Trajectory loader providing cell and trajectory. |
| [in,out] | cutoff_service | Cutoff calculation service. |
| [in,out] | options | Program options holding bond cutoffs. |

| void correlation::app::BondCutoffController::applyCovalentFactor | ( | float | factor, |
| FactorBound | bound ) |
Adjusts min or max bond cutoffs using covalent radii sum scaled by factor.
| [in] | factor | Covalent scale factor (> 0). |
| [in] | bound | Target bound (Min or Max). |

| void correlation::app::BondCutoffController::applyGlobalCutoff | ( | float | global_cutoff | ) |
Applies a uniform global cutoff to all element pairs.
| [in] | global_cutoff | Cutoff distance in Angstroms (> 0). |

| void correlation::app::BondCutoffController::applyScaledCutoffs | ( | float | scale_factor | ) |
Scales all current bond cutoffs by a multiplicative factor.
| [in] | scale_factor | Scaling factor (> 0). |

| void correlation::app::BondCutoffController::autoDetectCutoffs | ( | int | pair_index | ) |
Automatically detects first coordination shell peak onset and minimum for a pair.
| [in] | pair_index | Index of the calibration pair. |


| void correlation::app::BondCutoffController::dragCutoffHandle | ( | int | pair_index, |
| bool | is_max, | ||
| float | mouse_x ) |
Handles dragging of r_min or r_max handles on the calibration overlay.
| [in] | pair_index | Index of the calibration pair. |
| [in] | is_max | True if dragging r_max handle, false if dragging r_min handle. |
| [in] | mouse_x | Cursor X position in screen pixels. |

| void correlation::app::BondCutoffController::evaluateSanityState | ( | ) |
Evaluates current bond cutoffs with CutoffSanityChecker and updates UI badge state.


|
nodiscard |
Parses the current UI model into a BondCutoffMatrix.


| void correlation::app::BondCutoffController::handleFixSanityIssue | ( | int | fix_action | ) |
Executes automated repair action for sanity issues.
| [in] | fix_action | Integer corresponding to SanityFixAction enum. |

| void correlation::app::BondCutoffController::initializeCalibrationPairs | ( | ) |
Initializes and populates the UI CalibrationPair list from loaded elements.


| void correlation::app::BondCutoffController::resetCalibrationPair | ( | int | pair_index | ) |
Resets specified calibration pair to standard covalent radii bounds.
| [in] | pair_index | Index of the calibration pair. |

| void correlation::app::BondCutoffController::setBondCutoffs | ( | ) |
Populates the UI model with default recommended bond cutoffs based on atomic elements.

| void correlation::app::BondCutoffController::setCutoffRange | ( | int | pair_index, |
| float | r_min, | ||
| float | r_max ) |
Sets explicit cutoff range for a pair and synchronizes UI and trajectory.
| [in] | pair_index | Index of the calibration pair. |
| [in] | r_min | Lower cutoff bound in Å. |
| [in] | r_max | Upper cutoff bound in Å. |


|
inlinenoexcept |
Injects the AnalysisDispatcher service.
| [in] | dispatcher | AnalysisDispatcher instance pointer. |
|
inlinenoexcept |
Injects the PlotController service.
| [in] | plot_controller | PlotController instance pointer. |
| void correlation::app::BondCutoffController::setUniformCutoff | ( | float | max_cutoff | ) |
Sets uniform maximum cutoff across all element pairs.
| [in] | max_cutoff | Maximum cutoff distance in Angstroms (> 0). |


|
private |


| void correlation::app::BondCutoffController::updateCalibrationPixels | ( | float | canvas_w, |
| float | canvas_h ) |
Recomputes screen pixel coordinates (r_min_px, r_max_px, r_peak_px) for calibration pairs.
| [in] | canvas_w | Width of preview plot container in pixels. |
| [in] | canvas_h | Height of preview plot container in pixels. |


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