Correlation 4.10.0
An Analysis Tool for Liquids and for Amorphous Solids
Loading...
Searching...
No Matches
correlation::app::BondCutoffController Class Reference

Controller that manages element-pair bond cutoff matrices and synchronizes with the UI. More...

#include <BondCutoffController.hpp>

Collaboration diagram for correlation::app::BondCutoffController:

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}

Detailed Description

Controller that manages element-pair bond cutoff matrices and synchronizes with the UI.

Constructor & Destructor Documentation

◆ BondCutoffController() [1/2]

correlation::app::BondCutoffController::BondCutoffController ( AppWindow & window,
TrajectoryLoader & loader,
ProgramOptions & options,
AnalysisDispatcher * dispatcher = nullptr )

Constructs a BondCutoffController with injected services.

Parameters
[in,out]windowTarget UI window.
[in,out]loaderTrajectory loader providing cell and trajectory.
[in,out]optionsProgram options holding bond cutoffs.
[in]dispatcherOptional analysis dispatcher providing computed histograms.
Here is the caller graph for this function:

◆ BondCutoffController() [2/2]

correlation::app::BondCutoffController::BondCutoffController ( AppWindow & window,
TrajectoryLoader & loader,
BondCutoffService & cutoff_service,
ProgramOptions & options )

Constructs a BondCutoffController with injected services (transitional).

Parameters
[in,out]windowTarget UI window.
[in,out]loaderTrajectory loader providing cell and trajectory.
[in,out]cutoff_serviceCutoff calculation service.
[in,out]optionsProgram options holding bond cutoffs.
Here is the call graph for this function:

Member Function Documentation

◆ applyCovalentFactor()

void correlation::app::BondCutoffController::applyCovalentFactor ( float factor,
FactorBound bound )

Adjusts min or max bond cutoffs using covalent radii sum scaled by factor.

Parameters
[in]factorCovalent scale factor (> 0).
[in]boundTarget bound (Min or Max).
Here is the call graph for this function:

◆ applyGlobalCutoff()

void correlation::app::BondCutoffController::applyGlobalCutoff ( float global_cutoff)

Applies a uniform global cutoff to all element pairs.

Parameters
[in]global_cutoffCutoff distance in Angstroms (> 0).
Here is the call graph for this function:

◆ applyScaledCutoffs()

void correlation::app::BondCutoffController::applyScaledCutoffs ( float scale_factor)

Scales all current bond cutoffs by a multiplicative factor.

Parameters
[in]scale_factorScaling factor (> 0).
Here is the call graph for this function:

◆ autoDetectCutoffs()

void correlation::app::BondCutoffController::autoDetectCutoffs ( int pair_index)

Automatically detects first coordination shell peak onset and minimum for a pair.

Parameters
[in]pair_indexIndex of the calibration pair.
Here is the call graph for this function:
Here is the caller graph for this function:

◆ dragCutoffHandle()

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.

Parameters
[in]pair_indexIndex of the calibration pair.
[in]is_maxTrue if dragging r_max handle, false if dragging r_min handle.
[in]mouse_xCursor X position in screen pixels.
Here is the call graph for this function:

◆ evaluateSanityState()

void correlation::app::BondCutoffController::evaluateSanityState ( )

Evaluates current bond cutoffs with CutoffSanityChecker and updates UI badge state.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ getBondCutoffs()

correlation::analysis::BondCutoffMatrix correlation::app::BondCutoffController::getBondCutoffs ( ) const
nodiscard

Parses the current UI model into a BondCutoffMatrix.

Returns
Active bond cutoff matrix.
Here is the call graph for this function:
Here is the caller graph for this function:

◆ handleFixSanityIssue()

void correlation::app::BondCutoffController::handleFixSanityIssue ( int fix_action)

Executes automated repair action for sanity issues.

Parameters
[in]fix_actionInteger corresponding to SanityFixAction enum.
Here is the call graph for this function:

◆ initializeCalibrationPairs()

void correlation::app::BondCutoffController::initializeCalibrationPairs ( )

Initializes and populates the UI CalibrationPair list from loaded elements.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ resetCalibrationPair()

void correlation::app::BondCutoffController::resetCalibrationPair ( int pair_index)

Resets specified calibration pair to standard covalent radii bounds.

Parameters
[in]pair_indexIndex of the calibration pair.
Here is the call graph for this function:

◆ setBondCutoffs()

void correlation::app::BondCutoffController::setBondCutoffs ( )

Populates the UI model with default recommended bond cutoffs based on atomic elements.

Here is the call graph for this function:

◆ setCutoffRange()

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.

Parameters
[in]pair_indexIndex of the calibration pair.
[in]r_minLower cutoff bound in Å.
[in]r_maxUpper cutoff bound in Å.
Here is the call graph for this function:
Here is the caller graph for this function:

◆ setDispatcher()

void correlation::app::BondCutoffController::setDispatcher ( AnalysisDispatcher * dispatcher)
inlinenoexcept

Injects the AnalysisDispatcher service.

Parameters
[in]dispatcherAnalysisDispatcher instance pointer.

◆ setPlotController()

void correlation::app::BondCutoffController::setPlotController ( PlotController * plot_controller)
inlinenoexcept

Injects the PlotController service.

Parameters
[in]plot_controllerPlotController instance pointer.

◆ setUniformCutoff()

void correlation::app::BondCutoffController::setUniformCutoff ( float max_cutoff)

Sets uniform maximum cutoff across all element pairs.

Parameters
[in]max_cutoffMaximum cutoff distance in Angstroms (> 0).
Here is the call graph for this function:
Here is the caller graph for this function:

◆ syncCutoffsToUI()

void correlation::app::BondCutoffController::syncCutoffsToUI ( )
private
Here is the call graph for this function:
Here is the caller graph for this function:

◆ updateCalibrationPixels()

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.

Parameters
[in]canvas_wWidth of preview plot container in pixels.
[in]canvas_hHeight of preview plot container in pixels.
Here is the call graph for this function:
Here is the caller graph for this function:

Member Data Documentation

◆ dispatcher_

AnalysisDispatcher* correlation::app::BondCutoffController::dispatcher_ {nullptr}
private

◆ last_canvas_h_

float correlation::app::BondCutoffController::last_canvas_h_ {600.0F}
private

◆ last_canvas_w_

float correlation::app::BondCutoffController::last_canvas_w_ {1000.0F}
private

◆ loader_

TrajectoryLoader& correlation::app::BondCutoffController::loader_
private

◆ options_

ProgramOptions& correlation::app::BondCutoffController::options_
private

◆ plot_controller_

PlotController* correlation::app::BondCutoffController::plot_controller_ {nullptr}
private

◆ window_

AppWindow& correlation::app::BondCutoffController::window_
private

The documentation for this class was generated from the following files: