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

Coordinates 3D orbit interactions, scene streaming, and asynchronous off-thread rendering. More...

#include <Structure3DController.hpp>

Collaboration diagram for correlation::app::Structure3DController:

Classes

struct  CameraAnimState

Public Member Functions

 Structure3DController (::AppWindow &window, const ProgramOptions &options)
 Constructs controller injected with UI window and options.
 ~Structure3DController ()
 Destructor. Cleanly stops render worker thread.
void requestRender (bool immediate=false)
 Schedules an asynchronous 3D frame redraw.
void handleViewportResized (float width, float height)
 Updates viewport dimensions.
void handleRotate (float delta_x, float delta_y)
 Handles mouse orbit rotation deltas.
void handlePan (float delta_x, float delta_y)
 Handles mouse panning deltas.
void handleZoom (float delta)
 Handles scroll wheel zoom delta.
void handleResetView ()
 Resets camera view to auto-fit system bounding box.
void handleSetCameraPreset (int preset_idx)
 Sets camera orientation to a standard orthographic or isometric preset.
void handleToggleBonds (bool enabled)
 Toggles rendering of covalent bonds.
void handleToggleWireframe (bool enabled)
 Toggles rendering of periodic simulation unit cell wireframe.
void handleToggleInCell (bool enabled)
 Toggles in-cell PBC coordinate wrapping and boundary-clipped bonds.
void handleSeekFrame (int frame_index)
 Seeks to target frame in active trajectory.
void handleStepFrame (bool forward)
 Steps forward or backward through trajectory frames.
bool isInCell () const noexcept
 Queries whether in-cell PBC wrapping mode is active.
bool isIsometric () const noexcept
 Queries whether isometric (orthographic) projection mode is active.
void handleToggleProjection (bool isometric)
 Toggles between perspective and isometric (orthographic) 3D camera projection.
void handleToggleDepthCueing (bool enabled)
 Toggles atmospheric depth cueing (fog) in Vulkan and CPU renderers.
bool isDepthCueingEnabled () const noexcept
 Queries whether depth cueing is enabled.
void handleToggleSsao (bool enabled)
 Toggles screen-space ambient occlusion (SSAO) contact darkening on Vulkan.
bool isSsaoEnabled () const noexcept
 Queries whether SSAO is enabled.
void handleSetVisualSupercell (int rep_a, int rep_b, int rep_c)
 Sets visual-only periodic supercell replication counts (1..3 per axis).
void handleResetVisualSupercell ()
 Resets visual supercell replication back to 1x1x1.
std::array< int, 3 > visualSupercellDims () const noexcept
 Returns current visual supercell replication counts [nx, ny, nz].
bool exportTrajectoryAnimation (const std::string &filepath, bool as_gif, int fps=15, int bg_mode=0, std::size_t *out_frames=nullptr)
 Exports all frames of the loaded trajectory as a PNG-sequence ZIP or Animated GIF.
void handleFocusPickedAtom ()
 Smoothly centers and zooms the camera onto the currently picked atom.
void tickCameraAnimation ()
 Advances active smooth camera interpolation by one frame tick.
void handleToggleElementVisibility (const std::string &symbol)
 Toggles hide/show visibility for all atoms of a chemical element symbol.
void handleShowAllElements ()
 Restores visibility of all chemical elements.
bool exportSnapshotPng (const std::string &filepath, int scale_idx=1, int bg_mode=0, std::uint32_t *out_width=nullptr, std::uint32_t *out_height=nullptr)
 Exports a high-resolution offscreen 3D viewport snapshot to a PNG file.
void setCell (const core::Cell &cell)
 Updates active atomic structure from loaded Cell.
void setTrajectory (std::shared_ptr< const core::Trajectory > trajectory)
 Updates active trajectory dataset.
void setDistributionStore (std::shared_ptr< const analysis::PerFrameDistributionStore > store)
 Sets or updates the trajectory-wide per-frame distribution store.
std::shared_ptr< const analysis::PerFrameDistributionStore > distributionStore () const noexcept
 Returns active per-frame distribution store if available.
void handleSelectDistributionMetric (int metric_index)
 Selects active distribution metric displayed in 3D viewer mini-chart HUD.
void handleToggleDistributionHUD (bool visible)
 Toggles visibility of the distribution mini-chart HUD.
bool isDistributionHUDVisible () const noexcept
 Queries whether the distribution mini-graph HUD is currently visible.
void setMetricPlotLimits (analysis::DistributionMetric metric, const render3d::MiniPlotConfig &config)
 Sets custom plot configuration / limits for a distribution metric on the HUD.
void syncDistributionHUDToWindow ()
 Renders and synchronizes the active frame mini-chart with the Slint UI.
void set3DModeActive (bool active)
 Sets whether the 3D Structure tab is currently active.
void updateBondCutoffScale (double cutoff_scale)
 Updates the covalent radius scaling factor used for bond generation.
bool is3DModeActive () const noexcept
 Queries whether the 3D Structure tab is active.
const render3d::Camera3D & camera () const noexcept
 Gets reference to the active orbit camera.
std::shared_ptr< const render3d::Scene3D > scene () const noexcept
 Gets shared pointer to the active render scene.
void setPhaseSearchEnabled (bool enabled)
 Enables or disables phase search halo visualization.
bool isPhaseSearchEnabled () const noexcept
 Queries whether phase search halo visualization is active.
void setPhaseDescriptor (PhaseDescriptor descriptor)
 Sets the active Steinhardt order parameter descriptor.
PhaseDescriptor phaseDescriptor () const noexcept
 Gets current active Steinhardt order parameter descriptor.
void setCrystalPreset (CrystalPreset preset)
 Applies a crystal structure preset and auto-configures thresholds.
CrystalPreset crystalPreset () const noexcept
 Gets current crystal preset mode.
void setPhaseThresholds (float min_threshold, float max_threshold)
 Sets filtering threshold boundaries.
float phaseMinThreshold () const noexcept
 Gets current lower scalar threshold.
float phaseMaxThreshold () const noexcept
 Gets current upper scalar threshold.
void setPhaseColormap (plotters::ColormapType colormap)
 Sets scientific colormap for halo gradient.
plotters::ColormapType phaseColormap () const noexcept
 Gets active colormap type.
void setPhaseHaloIntensity (float intensity)
 Sets halo alpha glow intensity [0.1, 1.0].
float phaseHaloIntensity () const noexcept
 Gets current halo intensity factor.
void setPhaseHaloRadiusRatio (float ratio)
 Sets halo radius multiplier ratio [1.0, 5.0].
float phaseHaloRadiusRatio () const noexcept
 Gets current halo radius ratio.
void setAtomScale (float scale)
 Sets uniform atom ball radius scaling multiplier [0.05, 2.0].
float atomScale () const noexcept
 Gets current uniform atom ball radius scaling multiplier.
void setPhaseDimNonMatching (bool dim)
 Toggles ghosting/dimming of atoms outside threshold boundaries.
bool isPhaseDimNonMatching () const noexcept
 Queries whether non-matching atom dimming is enabled.
void setPhaseHideNonMatching (bool hide)
 Toggles hiding/culling of atoms outside threshold boundaries.
bool isPhaseHideNonMatching () const noexcept
 Queries whether non-matching atom hiding is enabled.
PhaseSearchSettings phaseSearchSettings () const noexcept
 Gets snapshot copy of entire phase search configuration bundle.
PhaseHistogram phaseHistogram () const
 Retrieves latest computed 1D distribution histogram.
void setPhase2DMode (bool is_2d)
 Enables or disables 2D joint distribution filtering mode.
bool isPhase2DMode () const noexcept
 Queries whether 2D phase search mode is active.
void setPhaseDescriptorY (PhaseDescriptor desc_y)
 Sets active Y-axis descriptor for 2D mode.
PhaseDescriptor phaseDescriptorY () const noexcept
 Gets active Y-axis order descriptor.
void setPhaseThresholds2D (float min_x, float max_x, float min_y, float max_y)
 Sets 2D bounding box thresholds [Xmin, Xmax] x [Ymin, Ymax].
float phaseMinThresholdY () const noexcept
 Gets current lower scalar threshold on Y.
float phaseMaxThresholdY () const noexcept
 Gets current upper scalar threshold on Y.
PhaseHeatmap2D phaseHeatmap () const
 Retrieves latest computed 64x64 2D joint distribution heatmap.
bool exportHeatmapPng (const std::string &filepath="")
 Exports the active 2D heatmap to a PNG image file.
void syncPhaseSearchToWindow ()
 Pushes current phase search settings, colormap texture, and histogram telemetry to Slint UI.
PhaseDescriptorsLRUCache & lruCache () noexcept
 Accesses reference to the frame phase descriptors LRU cache.
const PhaseDescriptorsLRUCache & lruCache () const noexcept
 Accesses const reference to the frame phase descriptors LRU cache.
std::shared_ptr< const FramePhaseDescriptors > getOrComputeDescriptors (std::size_t frame_index)
 Synchronously computes or retrieves phase descriptors for a frame.
std::shared_ptr< const calculators::SteinhardtCalculator::SteinhardtParams > getOrComputeSteinhardt (std::size_t frame_index)
 Synchronously computes or retrieves Steinhardt parameters for a frame.
void syncCameraHudToWindow ()
 Synchronizes projected axis triad and Angstrom scale bar HUD to the Slint window.
void handlePickAtom (float norm_x, float norm_y)
 Performs ray-sphere atom picking at normalized viewport coordinates [0, 1].
void clearPickedAtom ()
 Clears the currently inspected atom selection and removes inspection highlights.
void handleMeasureAtom (float norm_x, float norm_y)
 Picks an atom for the 3D distance/angle ruler (up to 3 atoms, Shift+Click).
void clearMeasurement ()
 Clears active 3D distance/angle measurement atoms and guide lines.
std::vector< std::size_t > measuredAtomIndices () const
 Returns currently measured atom indices (0..3).
std::optional< std::size_t > pickedAtomIndex () const noexcept
 Returns the currently picked atom index, if any.
void setSlabClipConfig (const SlabClipConfig &config)
 Updates X/Y/Z normalized slab clipping bounds and re-renders.
void resetSlabClip ()
 Resets slab clipping bounds to [0, 1] and disables clipping.
SlabClipConfig slabClipConfig () const noexcept
 Returns the current slab clipping configuration.
void setRadialBrushDistance (std::optional< double > r_angstrom)
 Sets or clears the Dual-View radial-shell brushing distance from g(r) hover.

Private Member Functions

void requestPhaseCalculation (std::size_t frame_index)
bool canAdvancePlaybackFrameLocked (bool forward) const
void startCameraAnimationLocked (const math::Vector3< float > &target, float distance, float azimuth_deg, float elevation_deg)
void cancelCameraAnimationLocked ()
void updateScenePhaseVisuals ()
void updateScenePhaseVisualsLocked ()
void applyAtomInspectionHighlightLocked ()
void applyMeasurementHighlightLocked ()
void applyRadialBrushHighlightLocked (std::size_t &matched_atoms)
void applyElementVisibilityLocked ()
void applySlabClippingLocked ()
void syncInspectedAtomToWindow ()
void syncMeasurementToWindow ()
void syncElementLegendToWindow ()
template<typename F>
void safeInvokeOnWindow (F &&action)

Private Attributes

::AppWindow & window_
const ProgramOptions & options_
std::shared_ptr< std::atomic< bool > > alive_
std::unique_ptr< Structure3DRenderPipeline > render_pipeline_
std::unique_ptr< PhaseSearchService > phase_service_
std::shared_ptr< render3d::Scene3D > scene_
std::shared_ptr< render3d::Scene3D > published_scene_
bool scene_dirty_ {true}
render3d::Camera3D camera_
render3d::TrajectoryStreamer streamer_
render3d::ViewportDimensions viewport_dims_ {.width = 800, .height = 600}
bool is_active_ {false}
bool render_bonds_ {true}
bool render_wireframe_ {true}
bool in_cell_mode_ {true}
bool depth_cueing_ {true}
bool ssao_enabled_ {true}
bool is_interacting_ {false}
std::array< int, 3 > supercell_dims_ {1, 1, 1}
CameraAnimState camera_anim_ {}
std::unordered_set< std::string > hidden_elements_
double bond_cutoff_scale_ {1.15}
core::Cell current_cell_
std::shared_ptr< const core::Trajectory > current_trajectory_
std::shared_ptr< const analysis::PerFrameDistributionStore > distribution_store_
analysis::DistributionMetric active_dist_metric_ {analysis::DistributionMetric::RDF}
std::array< render3d::MiniPlotConfig, 4 > metric_plot_configs_ {}
bool dist_hud_visible_ {true}
std::optional< std::size_t > picked_atom_index_
std::vector< std::size_t > measured_atom_indices_
SlabClipConfig slab_clip_ {}
std::optional< double > radial_brush_r_
std::mutex mutex_
std::thread::id main_thread_id_ {std::this_thread::get_id()}

Detailed Description

Coordinates 3D orbit interactions, scene streaming, and asynchronous off-thread rendering.

Constructor & Destructor Documentation

◆ Structure3DController()

correlation::app::Structure3DController::Structure3DController ( ::AppWindow & window,
const ProgramOptions & options )

Constructs controller injected with UI window and options.

Parameters
[in]windowSlint AppWindow reference.
[in]optionsApplication program options.

◆ ~Structure3DController()

correlation::app::Structure3DController::~Structure3DController ( )

Destructor. Cleanly stops render worker thread.

Member Function Documentation

◆ applyAtomInspectionHighlightLocked()

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

◆ applyElementVisibilityLocked()

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

◆ applyMeasurementHighlightLocked()

void correlation::app::Structure3DController::applyMeasurementHighlightLocked ( )
private
Here is the caller graph for this function:

◆ applyRadialBrushHighlightLocked()

void correlation::app::Structure3DController::applyRadialBrushHighlightLocked ( std::size_t & matched_atoms)
private
Here is the caller graph for this function:

◆ applySlabClippingLocked()

void correlation::app::Structure3DController::applySlabClippingLocked ( )
private
Here is the caller graph for this function:

◆ atomScale()

float correlation::app::Structure3DController::atomScale ( ) const
nodiscardnoexcept

Gets current uniform atom ball radius scaling multiplier.

Returns
Atom radius scale multiplier.

◆ camera()

const render3d::Camera3D & correlation::app::Structure3DController::camera ( ) const
inlinenodiscardnoexcept

Gets reference to the active orbit camera.

Returns
Const reference to Camera3D instance.

◆ canAdvancePlaybackFrameLocked()

bool correlation::app::Structure3DController::canAdvancePlaybackFrameLocked ( bool forward) const
nodiscardprivate
Here is the caller graph for this function:

◆ cancelCameraAnimationLocked()

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

◆ clearMeasurement()

void correlation::app::Structure3DController::clearMeasurement ( )

Clears active 3D distance/angle measurement atoms and guide lines.

Here is the call graph for this function:

◆ clearPickedAtom()

void correlation::app::Structure3DController::clearPickedAtom ( )

Clears the currently inspected atom selection and removes inspection highlights.

Here is the call graph for this function:

◆ crystalPreset()

CrystalPreset correlation::app::Structure3DController::crystalPreset ( ) const
nodiscardnoexcept

Gets current crystal preset mode.

Returns
Preset enum value.

◆ distributionStore()

std::shared_ptr< const analysis::PerFrameDistributionStore > correlation::app::Structure3DController::distributionStore ( ) const
inlinenodiscardnoexcept

Returns active per-frame distribution store if available.

Returns
Shared pointer to const PerFrameDistributionStore, or nullptr.

◆ exportHeatmapPng()

bool correlation::app::Structure3DController::exportHeatmapPng ( const std::string & filepath = "")

Exports the active 2D heatmap to a PNG image file.

Parameters
[in]filepathDestination file path (defaults to heatmap_snapshot.png if empty).
Returns
True if image file was successfully written.
Here is the call graph for this function:

◆ exportSnapshotPng()

bool correlation::app::Structure3DController::exportSnapshotPng ( const std::string & filepath,
int scale_idx = 1,
int bg_mode = 0,
std::uint32_t * out_width = nullptr,
std::uint32_t * out_height = nullptr )
nodiscard

Exports a high-resolution offscreen 3D viewport snapshot to a PNG file.

Parameters
[in]filepathDestination PNG file path.
[in]scale_idxResolution multiplier index (0 = 1x, 1 = 2x, 2 = 4x).
[in]bg_modeBackground mode (0 = Viewport dark, 1 = White, 2 = Transparent).
[out]out_widthOptional exported pixel width.
[out]out_heightOptional exported pixel height.
Returns
True if PNG file was written successfully.
Here is the call graph for this function:

◆ exportTrajectoryAnimation()

bool correlation::app::Structure3DController::exportTrajectoryAnimation ( const std::string & filepath,
bool as_gif,
int fps = 15,
int bg_mode = 0,
std::size_t * out_frames = nullptr )
nodiscard

Exports all frames of the loaded trajectory as a PNG-sequence ZIP or Animated GIF.

Parameters
[in]filepathDestination .zip or .gif path.
[in]as_gifTrue for GIF89a animation, false for PNG-sequence ZIP archive.
[in]fpsPlayback frame rate for GIF timing (default 15).
[in]bg_modeBackground mode (0 = Dark, 1 = White, 2 = Transparent).
[out]out_framesOptional count of exported frames.
Returns
True if export succeeded.
Here is the call graph for this function:

◆ getOrComputeDescriptors()

std::shared_ptr< const FramePhaseDescriptors > correlation::app::Structure3DController::getOrComputeDescriptors ( std::size_t frame_index)
nodiscard

Synchronously computes or retrieves phase descriptors for a frame.

Parameters
[in]frame_indexZero-based frame index.
Returns
Shared pointer to FramePhaseDescriptors, or nullptr if unavailable.

◆ getOrComputeSteinhardt()

std::shared_ptr< const calculators::SteinhardtCalculator::SteinhardtParams > correlation::app::Structure3DController::getOrComputeSteinhardt ( std::size_t frame_index)
nodiscard

Synchronously computes or retrieves Steinhardt parameters for a frame.

Parameters
[in]frame_indexZero-based frame index.
Returns
Shared pointer to SteinhardtParams, or nullptr if unavailable.

◆ handleFocusPickedAtom()

void correlation::app::Structure3DController::handleFocusPickedAtom ( )

Smoothly centers and zooms the camera onto the currently picked atom.

Here is the call graph for this function:

◆ handleMeasureAtom()

void correlation::app::Structure3DController::handleMeasureAtom ( float norm_x,
float norm_y )

Picks an atom for the 3D distance/angle ruler (up to 3 atoms, Shift+Click).

Parameters
[in]norm_xNormalized horizontal click position (0 = left, 1 = right).
[in]norm_yNormalized vertical click position (0 = top, 1 = bottom).
Here is the call graph for this function:

◆ handlePan()

void correlation::app::Structure3DController::handlePan ( float delta_x,
float delta_y )

Handles mouse panning deltas.

Parameters
[in]delta_xHorizontal drag delta in pixels.
[in]delta_yVertical drag delta in pixels.
Here is the call graph for this function:

◆ handlePickAtom()

void correlation::app::Structure3DController::handlePickAtom ( float norm_x,
float norm_y )

Performs ray-sphere atom picking at normalized viewport coordinates [0, 1].

Parameters
[in]norm_xNormalized horizontal click position (0 = left, 1 = right).
[in]norm_yNormalized vertical click position (0 = top, 1 = bottom).
Here is the call graph for this function:

◆ handleResetView()

void correlation::app::Structure3DController::handleResetView ( )

Resets camera view to auto-fit system bounding box.

Here is the call graph for this function:

◆ handleResetVisualSupercell()

void correlation::app::Structure3DController::handleResetVisualSupercell ( )

Resets visual supercell replication back to 1x1x1.

Here is the call graph for this function:

◆ handleRotate()

void correlation::app::Structure3DController::handleRotate ( float delta_x,
float delta_y )

Handles mouse orbit rotation deltas.

Parameters
[in]delta_xHorizontal drag delta in pixels.
[in]delta_yVertical drag delta in pixels.
Here is the call graph for this function:

◆ handleSeekFrame()

void correlation::app::Structure3DController::handleSeekFrame ( int frame_index)

Seeks to target frame in active trajectory.

Parameters
[in]frame_indexZero-based frame index.
Here is the call graph for this function:

◆ handleSelectDistributionMetric()

void correlation::app::Structure3DController::handleSelectDistributionMetric ( int metric_index)

Selects active distribution metric displayed in 3D viewer mini-chart HUD.

Parameters
[in]metric_index0 = RDF g(r), 1 = PAD θ, 2 = S(Q).
Here is the call graph for this function:

◆ handleSetCameraPreset()

void correlation::app::Structure3DController::handleSetCameraPreset ( int preset_idx)

Sets camera orientation to a standard orthographic or isometric preset.

Parameters
[in]preset_idx0: Top (XY), 1: Front (XZ), 2: Side (YZ), 3: Isometric.
Here is the call graph for this function:

◆ handleSetVisualSupercell()

void correlation::app::Structure3DController::handleSetVisualSupercell ( int rep_a,
int rep_b,
int rep_c )

Sets visual-only periodic supercell replication counts (1..3 per axis).

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

◆ handleShowAllElements()

void correlation::app::Structure3DController::handleShowAllElements ( )

Restores visibility of all chemical elements.

Here is the call graph for this function:

◆ handleStepFrame()

void correlation::app::Structure3DController::handleStepFrame ( bool forward)

Steps forward or backward through trajectory frames.

Parameters
[in]forwardTrue for next frame, false for previous frame.
Here is the call graph for this function:

◆ handleToggleBonds()

void correlation::app::Structure3DController::handleToggleBonds ( bool enabled)

Toggles rendering of covalent bonds.

Parameters
[in]enabledTrue to render bonds.
Here is the call graph for this function:

◆ handleToggleDepthCueing()

void correlation::app::Structure3DController::handleToggleDepthCueing ( bool enabled)

Toggles atmospheric depth cueing (fog) in Vulkan and CPU renderers.

Parameters
[in]enabledTrue to enable depth cueing.
Here is the call graph for this function:

◆ handleToggleDistributionHUD()

void correlation::app::Structure3DController::handleToggleDistributionHUD ( bool visible)

Toggles visibility of the distribution mini-chart HUD.

Parameters
[in]visibleTrue to display mini-chart HUD overlay.
Here is the call graph for this function:

◆ handleToggleElementVisibility()

void correlation::app::Structure3DController::handleToggleElementVisibility ( const std::string & symbol)

Toggles hide/show visibility for all atoms of a chemical element symbol.

Parameters
[in]symbolChemical element symbol (e.g. "Cu", "Si").
Here is the call graph for this function:

◆ handleToggleInCell()

void correlation::app::Structure3DController::handleToggleInCell ( bool enabled)

Toggles in-cell PBC coordinate wrapping and boundary-clipped bonds.

Parameters
[in]enabledTrue to wrap atoms and clip crossing bonds to unit cell faces.
Here is the call graph for this function:

◆ handleToggleProjection()

void correlation::app::Structure3DController::handleToggleProjection ( bool isometric)

Toggles between perspective and isometric (orthographic) 3D camera projection.

Parameters
[in]isometricTrue for isometric/orthographic, false for perspective.
Here is the call graph for this function:

◆ handleToggleSsao()

void correlation::app::Structure3DController::handleToggleSsao ( bool enabled)

Toggles screen-space ambient occlusion (SSAO) contact darkening on Vulkan.

Parameters
[in]enabledTrue to enable SSAO.
Here is the call graph for this function:

◆ handleToggleWireframe()

void correlation::app::Structure3DController::handleToggleWireframe ( bool enabled)

Toggles rendering of periodic simulation unit cell wireframe.

Parameters
[in]enabledTrue to render wireframe box.
Here is the call graph for this function:

◆ handleViewportResized()

void correlation::app::Structure3DController::handleViewportResized ( float width,
float height )

Updates viewport dimensions.

Parameters
[in]widthLayout width in pixels.
[in]heightLayout height in pixels.
Here is the call graph for this function:

◆ handleZoom()

void correlation::app::Structure3DController::handleZoom ( float delta)

Handles scroll wheel zoom delta.

Parameters
[in]deltaWheel scroll delta factor.
Here is the call graph for this function:

◆ is3DModeActive()

bool correlation::app::Structure3DController::is3DModeActive ( ) const
inlinenodiscardnoexcept

Queries whether the 3D Structure tab is active.

Returns
True if 3D viewport is visible and receiving updates.

◆ isDepthCueingEnabled()

bool correlation::app::Structure3DController::isDepthCueingEnabled ( ) const
inlinenodiscardnoexcept

Queries whether depth cueing is enabled.

Returns
True if depth cueing is active.

◆ isDistributionHUDVisible()

bool correlation::app::Structure3DController::isDistributionHUDVisible ( ) const
inlinenodiscardnoexcept

Queries whether the distribution mini-graph HUD is currently visible.

Returns
True if HUD is visible, false otherwise.

◆ isInCell()

bool correlation::app::Structure3DController::isInCell ( ) const
inlinenodiscardnoexcept

Queries whether in-cell PBC wrapping mode is active.

Returns
True if in-cell wrapping and boundary clipping are enabled.

◆ isIsometric()

bool correlation::app::Structure3DController::isIsometric ( ) const
inlinenodiscardnoexcept

Queries whether isometric (orthographic) projection mode is active.

Returns
True if isometric projection is enabled.

◆ isPhase2DMode()

bool correlation::app::Structure3DController::isPhase2DMode ( ) const
nodiscardnoexcept

Queries whether 2D phase search mode is active.

Returns
True if 2D mode is enabled.

◆ isPhaseDimNonMatching()

bool correlation::app::Structure3DController::isPhaseDimNonMatching ( ) const
nodiscardnoexcept

Queries whether non-matching atom dimming is enabled.

Returns
True if dimming is enabled.
Here is the caller graph for this function:

◆ isPhaseHideNonMatching()

bool correlation::app::Structure3DController::isPhaseHideNonMatching ( ) const
nodiscardnoexcept

Queries whether non-matching atom hiding is enabled.

Returns
True if hiding is enabled.
Here is the caller graph for this function:

◆ isPhaseSearchEnabled()

bool correlation::app::Structure3DController::isPhaseSearchEnabled ( ) const
nodiscardnoexcept

Queries whether phase search halo visualization is active.

Returns
True if phase halos are enabled.
Here is the caller graph for this function:

◆ isSsaoEnabled()

bool correlation::app::Structure3DController::isSsaoEnabled ( ) const
inlinenodiscardnoexcept

Queries whether SSAO is enabled.

Returns
True if SSAO is enabled.

◆ lruCache() [1/2]

const PhaseDescriptorsLRUCache & correlation::app::Structure3DController::lruCache ( ) const
inlinenodiscardnoexcept

Accesses const reference to the frame phase descriptors LRU cache.

Returns
Const PhaseDescriptorsLRUCache reference.

◆ lruCache() [2/2]

PhaseDescriptorsLRUCache & correlation::app::Structure3DController::lruCache ( )
inlinenodiscardnoexcept

Accesses reference to the frame phase descriptors LRU cache.

Returns
PhaseDescriptorsLRUCache reference.
Here is the call graph for this function:
Here is the caller graph for this function:

◆ measuredAtomIndices()

std::vector< std::size_t > correlation::app::Structure3DController::measuredAtomIndices ( ) const
inlinenodiscard

Returns currently measured atom indices (0..3).

Returns
Copy of measured atom index list.

◆ phaseColormap()

plotters::ColormapType correlation::app::Structure3DController::phaseColormap ( ) const
nodiscardnoexcept

Gets active colormap type.

Returns
Colormap type.

◆ phaseDescriptor()

PhaseDescriptor correlation::app::Structure3DController::phaseDescriptor ( ) const
nodiscardnoexcept

Gets current active Steinhardt order parameter descriptor.

Returns
Active descriptor enum value.
Here is the caller graph for this function:

◆ phaseDescriptorY()

PhaseDescriptor correlation::app::Structure3DController::phaseDescriptorY ( ) const
nodiscardnoexcept

Gets active Y-axis order descriptor.

Returns
Active Y descriptor enum value.

◆ phaseHaloIntensity()

float correlation::app::Structure3DController::phaseHaloIntensity ( ) const
nodiscardnoexcept

Gets current halo intensity factor.

Returns
Halo intensity.
Here is the caller graph for this function:

◆ phaseHaloRadiusRatio()

float correlation::app::Structure3DController::phaseHaloRadiusRatio ( ) const
nodiscardnoexcept

Gets current halo radius ratio.

Returns
Radius ratio.
Here is the caller graph for this function:

◆ phaseHeatmap()

PhaseHeatmap2D correlation::app::Structure3DController::phaseHeatmap ( ) const
nodiscard

Retrieves latest computed 64x64 2D joint distribution heatmap.

Returns
PhaseHeatmap2D telemetry struct.

◆ phaseHistogram()

PhaseHistogram correlation::app::Structure3DController::phaseHistogram ( ) const
nodiscard

Retrieves latest computed 1D distribution histogram.

Returns
PhaseHistogram telemetry struct.

◆ phaseMaxThreshold()

float correlation::app::Structure3DController::phaseMaxThreshold ( ) const
nodiscardnoexcept

Gets current upper scalar threshold.

Returns
Max threshold.
Here is the caller graph for this function:

◆ phaseMaxThresholdY()

float correlation::app::Structure3DController::phaseMaxThresholdY ( ) const
nodiscardnoexcept

Gets current upper scalar threshold on Y.

Returns
Max Y threshold.

◆ phaseMinThreshold()

float correlation::app::Structure3DController::phaseMinThreshold ( ) const
nodiscardnoexcept

Gets current lower scalar threshold.

Returns
Min threshold.
Here is the caller graph for this function:

◆ phaseMinThresholdY()

float correlation::app::Structure3DController::phaseMinThresholdY ( ) const
nodiscardnoexcept

Gets current lower scalar threshold on Y.

Returns
Min Y threshold.

◆ phaseSearchSettings()

PhaseSearchSettings correlation::app::Structure3DController::phaseSearchSettings ( ) const
nodiscardnoexcept

Gets snapshot copy of entire phase search configuration bundle.

Returns
PhaseSearchSettings struct.

◆ pickedAtomIndex()

std::optional< std::size_t > correlation::app::Structure3DController::pickedAtomIndex ( ) const
inlinenodiscardnoexcept

Returns the currently picked atom index, if any.

Returns
Optional zero-based atom index in Scene3D::atoms().

◆ requestPhaseCalculation()

void correlation::app::Structure3DController::requestPhaseCalculation ( std::size_t frame_index)
private

◆ requestRender()

void correlation::app::Structure3DController::requestRender ( bool immediate = false)

Schedules an asynchronous 3D frame redraw.

Parameters
[in]immediateIf true, signals worker without debounce delay.
Here is the call graph for this function:
Here is the caller graph for this function:

◆ resetSlabClip()

void correlation::app::Structure3DController::resetSlabClip ( )

Resets slab clipping bounds to [0, 1] and disables clipping.

Here is the call graph for this function:

◆ safeInvokeOnWindow()

template<typename F>
void correlation::app::Structure3DController::safeInvokeOnWindow ( F && action)
inlineprivate
Here is the caller graph for this function:

◆ scene()

std::shared_ptr< const render3d::Scene3D > correlation::app::Structure3DController::scene ( ) const
inlinenodiscardnoexcept

Gets shared pointer to the active render scene.

Returns
Shared pointer to const Scene3D instance.

◆ set3DModeActive()

void correlation::app::Structure3DController::set3DModeActive ( bool active)

Sets whether the 3D Structure tab is currently active.

Parameters
[in]activeTrue if 3D viewport is visible on screen.
Here is the call graph for this function:

◆ setAtomScale()

void correlation::app::Structure3DController::setAtomScale ( float scale)

Sets uniform atom ball radius scaling multiplier [0.05, 2.0].

Parameters
[in]scaleAtom radius scale multiplier.
Here is the call graph for this function:

◆ setCell()

void correlation::app::Structure3DController::setCell ( const core::Cell & cell)

Updates active atomic structure from loaded Cell.

Parameters
[in]cellNew atomic simulation cell.
Here is the call graph for this function:

◆ setCrystalPreset()

void correlation::app::Structure3DController::setCrystalPreset ( CrystalPreset preset)

Applies a crystal structure preset and auto-configures thresholds.

Parameters
[in]presetPreset enum value (Liquid, FCC, HCP, BCC, Icosahedral).
Here is the call graph for this function:

◆ setDistributionStore()

void correlation::app::Structure3DController::setDistributionStore ( std::shared_ptr< const analysis::PerFrameDistributionStore > store)

Sets or updates the trajectory-wide per-frame distribution store.

Parameters
[in]storeShared pointer to PerFrameDistributionStore.
Here is the call graph for this function:

◆ setMetricPlotLimits()

void correlation::app::Structure3DController::setMetricPlotLimits ( analysis::DistributionMetric metric,
const render3d::MiniPlotConfig & config )

Sets custom plot configuration / limits for a distribution metric on the HUD.

Parameters
[in]metricTarget distribution metric.
[in]configCustom mini-plot configuration.
Here is the call graph for this function:

◆ setPhase2DMode()

void correlation::app::Structure3DController::setPhase2DMode ( bool is_2d)

Enables or disables 2D joint distribution filtering mode.

Parameters
[in]is_2dTrue to activate 2D bounding box phase search.
Here is the call graph for this function:

◆ setPhaseColormap()

void correlation::app::Structure3DController::setPhaseColormap ( plotters::ColormapType colormap)

Sets scientific colormap for halo gradient.

Parameters
[in]colormapColormap enum value (Viridis, Plasma, Coolwarm, Turbo).
Here is the call graph for this function:

◆ setPhaseDescriptor()

void correlation::app::Structure3DController::setPhaseDescriptor ( PhaseDescriptor descriptor)

Sets the active Steinhardt order parameter descriptor.

Parameters
[in]descriptorActive descriptor (e.g. Q6Bar, W6Hat).
Here is the call graph for this function:

◆ setPhaseDescriptorY()

void correlation::app::Structure3DController::setPhaseDescriptorY ( PhaseDescriptor desc_y)

Sets active Y-axis descriptor for 2D mode.

Parameters
[in]desc_yY-axis order descriptor.
Here is the call graph for this function:

◆ setPhaseDimNonMatching()

void correlation::app::Structure3DController::setPhaseDimNonMatching ( bool dim)

Toggles ghosting/dimming of atoms outside threshold boundaries.

Parameters
[in]dimTrue to apply dimming to non-matching atoms.
Here is the call graph for this function:

◆ setPhaseHaloIntensity()

void correlation::app::Structure3DController::setPhaseHaloIntensity ( float intensity)

Sets halo alpha glow intensity [0.1, 1.0].

Parameters
[in]intensityHalo alpha factor.
Here is the call graph for this function:

◆ setPhaseHaloRadiusRatio()

void correlation::app::Structure3DController::setPhaseHaloRadiusRatio ( float ratio)

Sets halo radius multiplier ratio [1.0, 5.0].

Parameters
[in]ratioRatio of halo radius over visual sphere radius.
Here is the call graph for this function:

◆ setPhaseHideNonMatching()

void correlation::app::Structure3DController::setPhaseHideNonMatching ( bool hide)

Toggles hiding/culling of atoms outside threshold boundaries.

Parameters
[in]hideTrue to cull non-matching atoms.
Here is the call graph for this function:

◆ setPhaseSearchEnabled()

void correlation::app::Structure3DController::setPhaseSearchEnabled ( bool enabled)

Enables or disables phase search halo visualization.

Parameters
[in]enabledTrue to activate phase halos and non-matching dimming.
Here is the call graph for this function:

◆ setPhaseThresholds()

void correlation::app::Structure3DController::setPhaseThresholds ( float min_threshold,
float max_threshold )

Sets filtering threshold boundaries.

Parameters
[in]min_thresholdLower scalar threshold.
[in]max_thresholdUpper scalar threshold.
Here is the call graph for this function:

◆ setPhaseThresholds2D()

void correlation::app::Structure3DController::setPhaseThresholds2D ( float min_x,
float max_x,
float min_y,
float max_y )

Sets 2D bounding box thresholds [Xmin, Xmax] x [Ymin, Ymax].

Parameters
[in]min_xLower scalar threshold on X.
[in]max_xUpper scalar threshold on X.
[in]min_yLower scalar threshold on Y.
[in]max_yUpper scalar threshold on Y.
Here is the call graph for this function:

◆ setRadialBrushDistance()

void correlation::app::Structure3DController::setRadialBrushDistance ( std::optional< double > r_angstrom)

Sets or clears the Dual-View radial-shell brushing distance from g(r) hover.

Parameters
[in]r_angstromHovered radial distance in Angstroms, or std::nullopt to clear.
Here is the call graph for this function:

◆ setSlabClipConfig()

void correlation::app::Structure3DController::setSlabClipConfig ( const SlabClipConfig & config)

Updates X/Y/Z normalized slab clipping bounds and re-renders.

Parameters
[in]configSlab clipping configuration.
Here is the call graph for this function:
Here is the caller graph for this function:

◆ setTrajectory()

void correlation::app::Structure3DController::setTrajectory ( std::shared_ptr< const core::Trajectory > trajectory)

Updates active trajectory dataset.

Parameters
[in]trajectoryShared pointer to loaded trajectory.
Here is the call graph for this function:

◆ slabClipConfig()

SlabClipConfig correlation::app::Structure3DController::slabClipConfig ( ) const
inlinenodiscardnoexcept

Returns the current slab clipping configuration.

Returns
SlabClipConfig copy.

◆ startCameraAnimationLocked()

void correlation::app::Structure3DController::startCameraAnimationLocked ( const math::Vector3< float > & target,
float distance,
float azimuth_deg,
float elevation_deg )
private
Here is the call graph for this function:
Here is the caller graph for this function:

◆ syncCameraHudToWindow()

void correlation::app::Structure3DController::syncCameraHudToWindow ( )

Synchronizes projected axis triad and Angstrom scale bar HUD to the Slint window.

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

◆ syncDistributionHUDToWindow()

void correlation::app::Structure3DController::syncDistributionHUDToWindow ( )

Renders and synchronizes the active frame mini-chart with the Slint UI.

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

◆ syncElementLegendToWindow()

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

◆ syncInspectedAtomToWindow()

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

◆ syncMeasurementToWindow()

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

◆ syncPhaseSearchToWindow()

void correlation::app::Structure3DController::syncPhaseSearchToWindow ( )

Pushes current phase search settings, colormap texture, and histogram telemetry to Slint UI.

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

◆ tickCameraAnimation()

void correlation::app::Structure3DController::tickCameraAnimation ( )

Advances active smooth camera interpolation by one frame tick.

Here is the call graph for this function:

◆ updateBondCutoffScale()

void correlation::app::Structure3DController::updateBondCutoffScale ( double cutoff_scale)

Updates the covalent radius scaling factor used for bond generation.

Parameters
[in]cutoff_scaleMultiplier for covalent radius bond cutoff.
Here is the call graph for this function:

◆ updateScenePhaseVisuals()

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

◆ updateScenePhaseVisualsLocked()

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

◆ visualSupercellDims()

std::array< int, 3 > correlation::app::Structure3DController::visualSupercellDims ( ) const
inlinenodiscardnoexcept

Returns current visual supercell replication counts [nx, ny, nz].

Member Data Documentation

◆ active_dist_metric_

analysis::DistributionMetric correlation::app::Structure3DController::active_dist_metric_ {analysis::DistributionMetric::RDF}
private

◆ alive_

std::shared_ptr<std::atomic<bool> > correlation::app::Structure3DController::alive_
private

◆ bond_cutoff_scale_

double correlation::app::Structure3DController::bond_cutoff_scale_ {1.15}
private

◆ camera_

render3d::Camera3D correlation::app::Structure3DController::camera_
private

◆ camera_anim_

CameraAnimState correlation::app::Structure3DController::camera_anim_ {}
private

◆ current_cell_

core::Cell correlation::app::Structure3DController::current_cell_
private

◆ current_trajectory_

std::shared_ptr<const core::Trajectory> correlation::app::Structure3DController::current_trajectory_
private

◆ depth_cueing_

bool correlation::app::Structure3DController::depth_cueing_ {true}
private

◆ dist_hud_visible_

bool correlation::app::Structure3DController::dist_hud_visible_ {true}
private

◆ distribution_store_

std::shared_ptr<const analysis::PerFrameDistributionStore> correlation::app::Structure3DController::distribution_store_
private

◆ hidden_elements_

std::unordered_set<std::string> correlation::app::Structure3DController::hidden_elements_
private

◆ in_cell_mode_

bool correlation::app::Structure3DController::in_cell_mode_ {true}
private

◆ is_active_

bool correlation::app::Structure3DController::is_active_ {false}
private

◆ is_interacting_

bool correlation::app::Structure3DController::is_interacting_ {false}
private

◆ main_thread_id_

std::thread::id correlation::app::Structure3DController::main_thread_id_ {std::this_thread::get_id()}
private

◆ measured_atom_indices_

std::vector<std::size_t> correlation::app::Structure3DController::measured_atom_indices_
private

◆ metric_plot_configs_

std::array<render3d::MiniPlotConfig, 4> correlation::app::Structure3DController::metric_plot_configs_ {}
private

◆ mutex_

std::mutex correlation::app::Structure3DController::mutex_
mutableprivate

◆ options_

const ProgramOptions& correlation::app::Structure3DController::options_
private

◆ phase_service_

std::unique_ptr<PhaseSearchService> correlation::app::Structure3DController::phase_service_
private

◆ picked_atom_index_

std::optional<std::size_t> correlation::app::Structure3DController::picked_atom_index_
private

◆ published_scene_

std::shared_ptr<render3d::Scene3D> correlation::app::Structure3DController::published_scene_
private

◆ radial_brush_r_

std::optional<double> correlation::app::Structure3DController::radial_brush_r_
private

◆ render_bonds_

bool correlation::app::Structure3DController::render_bonds_ {true}
private

◆ render_pipeline_

std::unique_ptr<Structure3DRenderPipeline> correlation::app::Structure3DController::render_pipeline_
private

◆ render_wireframe_

bool correlation::app::Structure3DController::render_wireframe_ {true}
private

◆ scene_

std::shared_ptr<render3d::Scene3D> correlation::app::Structure3DController::scene_
private

◆ scene_dirty_

bool correlation::app::Structure3DController::scene_dirty_ {true}
private

◆ slab_clip_

SlabClipConfig correlation::app::Structure3DController::slab_clip_ {}
private

◆ ssao_enabled_

bool correlation::app::Structure3DController::ssao_enabled_ {true}
private

◆ streamer_

render3d::TrajectoryStreamer correlation::app::Structure3DController::streamer_
private

◆ supercell_dims_

std::array<int, 3> correlation::app::Structure3DController::supercell_dims_ {1, 1, 1}
private

◆ viewport_dims_

render3d::ViewportDimensions correlation::app::Structure3DController::viewport_dims_ {.width = 800, .height = 600}
private

◆ window_

::AppWindow& correlation::app::Structure3DController::window_
private

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