29 lua_writestring(
"setAtomColour:\n Arguments:\n i [number]\n r [number]\n g [nummber]\n b [number]\n a [number]\n Set atom i's colour.\n");
34 const std::string
msg =
"setAtomColour expects an atom index and RGB or RGBA arguments.\n";
48 const std::string
msg =
"setAtomColour atom index larger than atom count.\n";
53 r = std::clamp(
float(
lua_r.n), 0.0f, 1.0f);
55 g = std::clamp(
float(
lua_g.n), 0.0f, 1.0f);
57 b = std::clamp(
float(
lua_b.n), 0.0f, 1.0f);
61 a = std::clamp(
float(
lua_a.n), 0.0f, 1.0f);
82 lua_writestring(
"setAtomColour:\n Arguments: none\n Get atom i's colour.\n");
87 const std::string
msg =
"getAtomColour expects an atom index as argument.\n";
99 const std::string
msg =
"getAtomColour atom index larger than atom count.\n";
104 glm::vec4 colour =
atoms[index].colour;
129 lua_writestring(
"atomCount:\n Arguments: none\n Get number of atoms.\n");
151 lua_writestring(
"setAtomColour:\n Arguments:\n i [number]\n cutoff [number]\n Get atom i's neighbours within cutoff.\n");
156 const std::string
msg =
"getAtomsNeighbours expects an atom index and cutoff distance as argument.\n";
177 const std::string
msg =
"getAtom atom index larger than atom count.\n";
212 lua_writestring(
"getAtom:\n Arguments: \n i [number]\n Get atom i's state.\n");
217 const std::string
msg =
"getAtom expects an atom index as argument.\n";
229 const std::string
msg =
"getAtom atom index larger than atom count.\n";
294 lua_writestring(
"getAtomsBonds:\n Arguments:\n i [number]\n Get atom i's bonds.\n");
299 const std::string
msg =
"getAtomsBonds expects an atom index as argument.\n";
311 const std::string
msg =
"getAtomsBonds atom index larger than atom count.\n";
An atom structure.
Definition atom.h:20
Calculate neighbour lists.
Definition neighbours.h:18
glm::vec< L, float, glm::qualifier::highp > vec
Definition commandLine.h:214
const std::map< Element, std::string > STRING_FROM_ELEMENT
Map Element to string symbols.
Definition element.h:348
Interop for booleans Lua.
Definition LuaBool.h:11
void read(lua_State *lua, int index)
Read the bool from stack index index.
Definition LuaBool.h:27
bool bit
Definition LuaBool.h:85
Interop for a number in Lua.
Definition LuaNumber.h:11
void read(lua_State *lua, int index)
Read the number from stack index index.
Definition LuaNumber.h:26
std::map< uint64_t, glm::vec4 > atomColourOverrides
Definition visualisationState.h:121
int lua_atomCount(lua_State *lua)
Lua binding to get the Atom count.
Definition atoms.h:125
std::vector< Atom > & atoms
Definition visualisationState.h:117
int lua_getAtom(lua_State *lua)
Lua binding to get an Atom.
Definition atoms.h:207
bool elementsUpdated
Definition visualisationState.h:135
std::map< uint64_t, std::set< uint64_t > > bonds
Definition visualisationState.h:118
int lua_setAtomColour(lua_State *lua)
Lua binding to set an Atom's colour by index.
Definition atoms.h:24
std::vector< float > atomEmphasisOverrides
Definition visualisationState.h:120
uint64_t atomCount
Definition visualisationState.h:128
int lua_getAtomsNeighbours(lua_State *lua)
Lua binding to get the neighbours of an Atom to a cutoff.
Definition atoms.h:146
int lua_getAtomsBonds(lua_State *lua)
Lua binding to get the bonds of an Atom.
Definition atoms.h:289
int lua_getAtomColour(lua_State *lua)
Lua binding to get a Atom's colour by index.
Definition atoms.h:77