Correlation 4.10.0
An Analysis Tool for Liquids and for Amorphous Solids
Loading...
Searching...
No Matches
BondCutoffController.hpp
Go to the documentation of this file.
1
8
9#pragma once
10
11#include "AppWindow.h"
16
17namespace correlation::app {
18
20class PlotController;
21
26enum class FactorBound { Min, Max };
27
33public:
41 BondCutoffController(AppWindow &window, TrajectoryLoader &loader, ProgramOptions &options,
42 AnalysisDispatcher *dispatcher = nullptr);
43
51 BondCutoffController(AppWindow &window, TrajectoryLoader &loader,
52 BondCutoffService &cutoff_service, ProgramOptions &options);
53
58 void setDispatcher(AnalysisDispatcher *dispatcher) noexcept { dispatcher_ = dispatcher; }
59
64 void setPlotController(PlotController *plot_controller) noexcept {
65 plot_controller_ = plot_controller;
66 }
67
71 void setBondCutoffs();
72
78
83 void applyScaledCutoffs(float scale_factor);
84
89 void setUniformCutoff(float max_cutoff);
90
96 void applyCovalentFactor(float factor, FactorBound bound);
97
102 void applyGlobalCutoff(float global_cutoff);
103
108
113 void autoDetectCutoffs(int pair_index);
114
119 void resetCalibrationPair(int pair_index);
120
127 void dragCutoffHandle(int pair_index, bool is_max, float mouse_x);
128
135 void updateCalibrationPixels(float canvas_w, float canvas_h);
136
143 void setCutoffRange(int pair_index, float r_min, float r_max);
144
148 void evaluateSanityState();
149
154 void handleFixSanityIssue(int fix_action);
155
156private:
157 void syncCutoffsToUI();
158
159 AppWindow &window_;
164 float last_canvas_w_{1000.0F};
165 float last_canvas_h_{600.0F};
166};
167
168} // namespace correlation::app
Configuration structures and defaults for application analysis.
Service providing atomic pair cutoff calculations, scaling, and uniform matrices.
Manager for distribution function calculations (RDF, PAD, S(Q), etc.).
Service responsible for loading trajectories and extracting structural metadata.
Contiguous 2D matrix of element-pair bond cutoff ranges.
Definition AnalysisTypes.hpp:48
Dispatches analysis workflows to CorrelationEngine, handles cancellation, and exports data.
Definition AnalysisDispatcher.hpp:32
void updateCalibrationPixels(float canvas_w, float canvas_h)
Recomputes screen pixel coordinates (r_min_px, r_max_px, r_peak_px) for calibration pairs.
Definition BondCutoffController.cpp:464
void resetCalibrationPair(int pair_index)
Resets specified calibration pair to standard covalent radii bounds.
Definition BondCutoffController.cpp:329
void syncCutoffsToUI()
Definition BondCutoffController.cpp:527
void initializeCalibrationPairs()
Initializes and populates the UI CalibrationPair list from loaded elements.
Definition BondCutoffController.cpp:275
void setCutoffRange(int pair_index, float r_min, float r_max)
Sets explicit cutoff range for a pair and synchronizes UI and trajectory.
Definition BondCutoffController.cpp:304
void setUniformCutoff(float max_cutoff)
Sets uniform maximum cutoff across all element pairs.
Definition BondCutoffController.cpp:98
correlation::analysis::BondCutoffMatrix getBondCutoffs() const
Parses the current UI model into a BondCutoffMatrix.
Definition BondCutoffController.cpp:62
BondCutoffController(AppWindow &window, TrajectoryLoader &loader, ProgramOptions &options, AnalysisDispatcher *dispatcher=nullptr)
Constructs a BondCutoffController with injected services.
Definition BondCutoffController.cpp:27
AppWindow & window_
Definition BondCutoffController.hpp:159
void handleFixSanityIssue(int fix_action)
Executes automated repair action for sanity issues.
Definition BondCutoffController.cpp:603
TrajectoryLoader & loader_
Definition BondCutoffController.hpp:160
void setPlotController(PlotController *plot_controller) noexcept
Injects the PlotController service.
Definition BondCutoffController.hpp:64
AnalysisDispatcher * dispatcher_
Definition BondCutoffController.hpp:162
void applyGlobalCutoff(float global_cutoff)
Applies a uniform global cutoff to all element pairs.
Definition BondCutoffController.cpp:271
void applyScaledCutoffs(float scale_factor)
Scales all current bond cutoffs by a multiplicative factor.
Definition BondCutoffController.cpp:89
float last_canvas_w_
Definition BondCutoffController.hpp:164
void applyCovalentFactor(float factor, FactorBound bound)
Adjusts min or max bond cutoffs using covalent radii sum scaled by factor.
Definition BondCutoffController.cpp:235
PlotController * plot_controller_
Definition BondCutoffController.hpp:163
void setBondCutoffs()
Populates the UI model with default recommended bond cutoffs based on atomic elements.
Definition BondCutoffController.cpp:36
void autoDetectCutoffs(int pair_index)
Automatically detects first coordination shell peak onset and minimum for a pair.
Definition BondCutoffController.cpp:361
void evaluateSanityState()
Evaluates current bond cutoffs with CutoffSanityChecker and updates UI badge state.
Definition BondCutoffController.cpp:576
void setDispatcher(AnalysisDispatcher *dispatcher) noexcept
Injects the AnalysisDispatcher service.
Definition BondCutoffController.hpp:58
void dragCutoffHandle(int pair_index, bool is_max, float mouse_x)
Handles dragging of r_min or r_max handles on the calibration overlay.
Definition BondCutoffController.cpp:406
ProgramOptions & options_
Definition BondCutoffController.hpp:161
float last_canvas_h_
Definition BondCutoffController.hpp:165
Service calculating and managing covalent bond cutoffs on trajectories and cells.
Definition BondCutoffService.hpp:21
Manages plot rendering, caching, interactions, and exports.
Definition PlotController.hpp:59
Manages loading of structure/trajectory files and provides atomic/cell metadata.
Definition TrajectoryLoader.hpp:34
Definition AppController.hpp:27
FactorBound
Specifies which cutoff bound (Min or Max) to adjust by a covalent factor.
Definition BondCutoffController.hpp:26
@ Max
Definition BondCutoffController.hpp:26
@ Min
Definition BondCutoffController.hpp:26
Encapsulates all configurable options for the application.
Definition AppOptions.hpp:122