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

Streams trajectory snapshot frames into Scene3D with zero vector reallocation. More...

#include <TrajectoryStreamer.hpp>

Public Member Functions

 TrajectoryStreamer (std::shared_ptr< const core::Trajectory > trajectory=nullptr) noexcept
 Constructs streamer referencing a trajectory dataset.
void setTrajectory (std::shared_ptr< const core::Trajectory > trajectory) noexcept
 Sets or replaces the active trajectory source.
bool seekFrame (std::size_t frame_index, Scene3D &scene, bool recompute_bonds=false, double bond_cutoff_scale=1.15, bool in_cell=false)
 Seeks to a specific frame and updates the scene in-place.
bool stepNext (Scene3D &scene, bool loop=true, bool recompute_bonds=false, double bond_cutoff_scale=1.15, bool in_cell=false)
 Advances to the next frame.
bool stepPrev (Scene3D &scene, bool loop=true, bool recompute_bonds=false, double bond_cutoff_scale=1.15, bool in_cell=false)
 Steps backward to the previous frame.
std::size_t currentFrameIndex () const noexcept
 Gets current active frame index.
std::size_t totalFrames () const noexcept
 Gets total frame count in the active trajectory.
bool hasTrajectory () const noexcept
 Checks if a valid trajectory dataset is attached.
void setPlaybackFps (float fps) noexcept
 Sets target playback frame rate.
float playbackFps () const noexcept
 Gets current playback frame rate.

Private Attributes

std::shared_ptr< const core::Trajectory > trajectory_
std::size_t current_frame_ {0}
float playback_fps_ {30.0F}

Detailed Description

Streams trajectory snapshot frames into Scene3D with zero vector reallocation.

Constructor & Destructor Documentation

◆ TrajectoryStreamer()

correlation::render3d::TrajectoryStreamer::TrajectoryStreamer ( std::shared_ptr< const core::Trajectory > trajectory = nullptr)
explicitnoexcept

Constructs streamer referencing a trajectory dataset.

Parameters
[in]trajectoryShared pointer to simulation trajectory.

Member Function Documentation

◆ currentFrameIndex()

std::size_t correlation::render3d::TrajectoryStreamer::currentFrameIndex ( ) const
inlinenodiscardnoexcept

Gets current active frame index.

Returns
Zero-based frame index.

◆ hasTrajectory()

bool correlation::render3d::TrajectoryStreamer::hasTrajectory ( ) const
inlinenodiscardnoexcept

Checks if a valid trajectory dataset is attached.

Returns
True if trajectory is loaded.
Here is the call graph for this function:
Here is the caller graph for this function:

◆ playbackFps()

float correlation::render3d::TrajectoryStreamer::playbackFps ( ) const
inlinenodiscardnoexcept

Gets current playback frame rate.

Returns
Playback rate in frames per second.

◆ seekFrame()

bool correlation::render3d::TrajectoryStreamer::seekFrame ( std::size_t frame_index,
Scene3D & scene,
bool recompute_bonds = false,
double bond_cutoff_scale = 1.15,
bool in_cell = false )

Seeks to a specific frame and updates the scene in-place.

Parameters
[in]frame_indexZero-based frame index.
[in,out]sceneTarget scene to update.
[in]recompute_bondsIf true, recalculates bond pairs for this frame.
[in]bond_cutoff_scaleMultiplier for covalent radius bond cutoff.
[in]in_cellIf true, wraps coordinates into [0, 1) and generates boundary-clipped bonds.
Returns
True if frame exists and scene was updated.
Here is the call graph for this function:
Here is the caller graph for this function:

◆ setPlaybackFps()

void correlation::render3d::TrajectoryStreamer::setPlaybackFps ( float fps)
inlinenoexcept

Sets target playback frame rate.

Parameters
[in]fpsPlayback rate in frames per second.

◆ setTrajectory()

void correlation::render3d::TrajectoryStreamer::setTrajectory ( std::shared_ptr< const core::Trajectory > trajectory)
noexcept

Sets or replaces the active trajectory source.

Parameters
[in]trajectoryShared pointer to trajectory.

◆ stepNext()

bool correlation::render3d::TrajectoryStreamer::stepNext ( Scene3D & scene,
bool loop = true,
bool recompute_bonds = false,
double bond_cutoff_scale = 1.15,
bool in_cell = false )

Advances to the next frame.

Parameters
[in,out]sceneTarget scene.
[in]loopIf true, loops back to frame 0 upon reaching the end.
[in]recompute_bondsWhether to re-evaluate bonds.
[in]bond_cutoff_scaleMultiplier for covalent radius bond cutoff.
[in]in_cellIf true, wraps coordinates into [0, 1) and generates boundary-clipped bonds.
Returns
True if advance succeeded.
Here is the call graph for this function:

◆ stepPrev()

bool correlation::render3d::TrajectoryStreamer::stepPrev ( Scene3D & scene,
bool loop = true,
bool recompute_bonds = false,
double bond_cutoff_scale = 1.15,
bool in_cell = false )

Steps backward to the previous frame.

Parameters
[in,out]sceneTarget scene.
[in]loopIf true, wraps to the last frame from frame 0.
[in]recompute_bondsWhether to re-evaluate bonds.
[in]bond_cutoff_scaleMultiplier for covalent radius bond cutoff.
[in]in_cellIf true, wraps coordinates into [0, 1) and generates boundary-clipped bonds.
Returns
True if step succeeded.
Here is the call graph for this function:

◆ totalFrames()

std::size_t correlation::render3d::TrajectoryStreamer::totalFrames ( ) const
nodiscardnoexcept

Gets total frame count in the active trajectory.

Returns
Total number of frames, or 0 if trajectory is unset.
Here is the caller graph for this function:

Member Data Documentation

◆ current_frame_

std::size_t correlation::render3d::TrajectoryStreamer::current_frame_ {0}
private

◆ playback_fps_

float correlation::render3d::TrajectoryStreamer::playback_fps_ {30.0F}
private

◆ trajectory_

std::shared_ptr<const core::Trajectory> correlation::render3d::TrajectoryStreamer::trajectory_
private

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