SimpleFastOpenAtomicVisualiser
All Classes Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
Public Member Functions | Public Attributes | List of all members
VisualisationState Struct Reference

Holds editable data for the visualisation state. More...

#include <visualisationState.h>

Public Member Functions

 VisualisationState (std::vector< Atom > &atoms, const std::filesystem::path &atomColours, uint64_t bondFocus, float bondCutoff, bool sizeByMass, const std::map< int, std::string > &keyCodes)
 Construct a VisualisationState from a some Atoms.
 
bool recordWaiting () const
 Video writing is behind.
 
void toggleRecord (const CommandLine &options)
 Toggle recording to video.
 
void recordFrame (uint32_t resX, uint32_t resY)
 If recording, obtain the pixels for the current frame and submit for recording.
 
int lua_setAtomColour (lua_State *lua)
 Lua binding to set an Atom's colour by index.
 
int lua_getAtomColour (lua_State *lua)
 Lua binding to get a Atom's colour by index.
 
int lua_bond (lua_State *lua)
 Lua binding to bond 2 Atoms.
 
int lua_unbond (lua_State *lua)
 Lua binding to unbond 2 Atoms.
 
int lua_getAtomsBonds (lua_State *lua)
 Lua binding to get the bonds of an Atom.
 
int lua_atomCount (lua_State *lua)
 Lua binding to get the Atom count.
 
int lua_getAtomsNeighbours (lua_State *lua)
 Lua binding to get the neighbours of an Atom to a cutoff.
 
int lua_getAtom (lua_State *lua)
 Lua binding to get an Atom.
 
int lua_setText (lua_State *lua)
 Set the on screen text.
 
int lua_getFrame (lua_State *lua)
 Get the current frame number.
 

Public Attributes

std::vector< Atom > & atoms
 
std::map< uint64_t, std::set< uint64_t > > bonds
 
std::vector< uint64_tbondsFor
 
std::vector< floatatomEmphasisOverrides
 
std::map< uint64_t, glm::vec4 > atomColourOverrides
 
std::vector< floatatomSizes
 
std::multimap< Element, uint64_telementMap
 
std::map< int, ElementemphasisControls
 
std::string text
 
uint64_t frame
 
uint64_t atomCount
 
std::unique_ptr< Recordrecord = nullptr
 
bool recording = false
 
bool recordClosing = false
 

Detailed Description

Holds editable data for the visualisation state.

Constructor & Destructor Documentation

◆ VisualisationState()

VisualisationState::VisualisationState ( std::vector< Atom > &  atoms,
const std::filesystem::path &  atomColours,
uint64_t  bondFocus,
float  bondCutoff,
bool  sizeByMass,
const std::map< int, std::string > &  keyCodes 
)
inline

Construct a VisualisationState from a some Atoms.

Parameters
atomsthe Atoms to construct from.
atomColoursfile path for colour overrides.
bondFocusa particular atom to focus bonds on.
bondCutoffa bond cutoff distance.
keyCodeskey codes.

Member Function Documentation

◆ lua_atomCount()

int VisualisationState::lua_atomCount ( lua_State lua)
inline

Lua binding to get the Atom count.

Parameters
luathe Lua context.
Returns
int the return code.

◆ lua_bond()

int VisualisationState::lua_bond ( lua_State lua)
inline

Lua binding to bond 2 Atoms.

Remarks
Lua arguments are:
  1. The first Atom index.
  2. The second Atom index.
Parameters
luathe Lua context.
Returns
int the return code.

◆ lua_getAtom()

int VisualisationState::lua_getAtom ( lua_State lua)
inline

Lua binding to get an Atom.

Remarks
Lua arguments are:
  1. The Atom index.
Parameters
luathe Lua context.
Returns
int the return code.

◆ lua_getAtomColour()

int VisualisationState::lua_getAtomColour ( lua_State lua)
inline

Lua binding to get a Atom's colour by index.

Remarks
Lua arguments are:
  1. The Atom index.
Parameters
luathe Lua context.
Returns
int the return code.

◆ lua_getAtomsBonds()

int VisualisationState::lua_getAtomsBonds ( lua_State lua)
inline

Lua binding to get the bonds of an Atom.

Remarks
Lua arguments are:
  1. The Atom index.
Parameters
luathe Lua context.
Returns
int the return code.

◆ lua_getAtomsNeighbours()

int VisualisationState::lua_getAtomsNeighbours ( lua_State lua)
inline

Lua binding to get the neighbours of an Atom to a cutoff.

Remarks
Lua arguments are:
  1. The Atom index.
  2. The cutoff distance.
  3. [Optional] whether to use nearest images.
Parameters
luathe Lua context.
Returns
int the return code.

◆ lua_getFrame()

int VisualisationState::lua_getFrame ( lua_State lua)
inline

Get the current frame number.

Parameters
luathe Lua context.
Returns
int the return code.

◆ lua_setAtomColour()

int VisualisationState::lua_setAtomColour ( lua_State lua)
inline

Lua binding to set an Atom's colour by index.

Lua binding to set an Atoms colour by index.

Remarks
Lua arguments are:
  1. The Atom index.
  2. The red channel [0, 1].
  3. The green channel [0, 1].
  4. The blue channel [0, 1].
  5. [Optional] The alpha channel [0, 1] defaults to 1. Call as sfoav.setAtomColour(5, 1.0, 0.5, 0.5, 1.0)
Parameters
luathe Lua context.
Returns
int the return code.

◆ lua_setText()

int VisualisationState::lua_setText ( lua_State lua)
inline

Set the on screen text.

Remarks
Lua arguments are:
  1. The text string.
Parameters
luathe Lua context.
Returns
int the return code.

◆ lua_unbond()

int VisualisationState::lua_unbond ( lua_State lua)
inline

Lua binding to unbond 2 Atoms.

Remarks
Lua arguments are:
  1. The first Atom index.
  2. The second Atom index.
Parameters
luathe Lua context.
Returns
int the return code.

◆ recordFrame()

void VisualisationState::recordFrame ( uint32_t  resX,
uint32_t  resY 
)
inline

If recording, obtain the pixels for the current frame and submit for recording.

Parameters
resXthe x resolution.
resYthe y resolution.

◆ recordWaiting()

bool VisualisationState::recordWaiting ( ) const
inline

Video writing is behind.

Returns
true the main process should wait.
false the main process may continue the trajectory.

◆ toggleRecord()

void VisualisationState::toggleRecord ( const CommandLine options)
inline

Toggle recording to video.

Parameters
optionsthe command line options (with video options).

Member Data Documentation

◆ atomColourOverrides

std::map<uint64_t, glm::vec4> VisualisationState::atomColourOverrides

◆ atomCount

uint64_t VisualisationState::atomCount

◆ atomEmphasisOverrides

std::vector<float> VisualisationState::atomEmphasisOverrides

◆ atoms

std::vector<Atom>& VisualisationState::atoms

◆ atomSizes

std::vector<float> VisualisationState::atomSizes

◆ bonds

std::map<uint64_t, std::set<uint64_t> > VisualisationState::bonds

◆ bondsFor

std::vector<uint64_t> VisualisationState::bondsFor

◆ elementMap

std::multimap<Element, uint64_t> VisualisationState::elementMap

◆ emphasisControls

std::map<int, Element> VisualisationState::emphasisControls

◆ frame

uint64_t VisualisationState::frame

◆ record

std::unique_ptr<Record> VisualisationState::record = nullptr

◆ recordClosing

bool VisualisationState::recordClosing = false

◆ recording

bool VisualisationState::recording = false

◆ text

std::string VisualisationState::text

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