SimpleFastOpenAtomicVisualiser
Loading...
Searching...
No Matches
Classes | Functions
atom.h File Reference
#include <cstdint>
#include <iostream>
#include <set>
#include <vector>
#include <map>
#include <glm/glm.hpp>
#include <element.h>
#include <colour.h>
Include dependency graph for atom.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

class  Atom
 An atom structure. More...
 

Functions

std::ostreamoperator<< (std::ostream &o, Atom &atom)
 Print an atom to std::ostream.
 
glm::vec3 getCenter (const std::vector< Atom > &atoms)
 Calculate the centre of mass.
 
void center (std::vector< Atom > &atoms)
 Subtract the centre of mass of some Atoms.
 
void centerOn (std::vector< Atom > &atoms, uint64_t index)
 Centre on a particular Atom.
 
void translate (std::vector< Atom > &atoms, glm::vec3 r)
 
glm::vec3 min (const std::vector< Atom > &atoms)
 Calculate the minimum positions of some Atoms.
 
glm::vec3 max (const std::vector< Atom > &atoms)
 Calculate the maximum positions of some Atoms.
 
glm::vec3 extent (const std::vector< Atom > &atoms)
 Calculate the extent of some Atoms.
 
std::set< ElementuniqueElements (const std::vector< Atom > &atoms)
 Determine the unique elements in a list of Atom.
 
float largest (const std::vector< Atom > &atoms)
 Calculate the largest Atom.
 
std::multimap< Element, uint64_telementIndices (const std::vector< Atom > &atoms)
 Obtain indices of each element.
 
void applyColours (std::vector< Atom > &atoms, const std::map< uint64_t, glm::vec4 > &colours)
 Apply colours by index.
 
void applySizes (std::vector< Atom > &atoms, const std::vector< float > sizes)
 Apply sizes by index.
 

Function Documentation

◆ applyColours()

void applyColours ( std::vector< Atom > &  atoms,
const std::map< uint64_t, glm::vec4 > &  colours 
)

Apply colours by index.

Parameters
atomsthe Atoms to colour.
coloursthe partial map of indices to colours.

◆ applySizes()

void applySizes ( std::vector< Atom > &  atoms,
const std::vector< float sizes 
)

Apply sizes by index.

Parameters
atomsthe Atoms to colour.
coloursthe atom sizes.

◆ center()

void center ( std::vector< Atom > &  atoms)

Subtract the centre of mass of some Atoms.

Parameters
atomsthe Atom list to centre.

◆ centerOn()

void centerOn ( std::vector< Atom > &  atoms,
uint64_t  index 
)

Centre on a particular Atom.

Parameters
atomsthe Atom list to centre.
indexthe Atom index to centre on.

◆ elementIndices()

std::multimap< Element, uint64_t > elementIndices ( const std::vector< Atom > &  atoms)

Obtain indices of each element.

Parameters
atomsthe atoms to index.
Returns
std::multimap<Element, uint64_t> the indices of each element type.

◆ extent()

glm::vec3 extent ( const std::vector< Atom > &  atoms)

Calculate the extent of some Atoms.

Parameters
atomsthe Atom list.
Returns
glm::vec3 the extent (max-min).

◆ getCenter()

glm::vec3 getCenter ( const std::vector< Atom > &  atoms)

Calculate the centre of mass.

Parameters
atomsthe Atom list to centre.
Returns
glm::vec3 the Atoms centers of mass.

◆ largest()

float largest ( const std::vector< Atom > &  atoms)

Calculate the largest Atom.

Parameters
atomsthe Atom list.
Returns
float the largest Atom.

◆ max()

glm::vec3 max ( const std::vector< Atom > &  atoms)

Calculate the maximum positions of some Atoms.

Parameters
atomsthe Atom list.
Returns
glm::vec3 the maximum position.

◆ min()

glm::vec3 min ( const std::vector< Atom > &  atoms)

Calculate the minimum positions of some Atoms.

Parameters
atomsthe Atom list.
Returns
glm::vec3 the minimum position.

◆ operator<<()

std::ostream & operator<< ( std::ostream o,
Atom atom 
)

Print an atom to std::ostream.

Remarks
Prints and atoms element symbol and position.
Parameters
ooutput stream.
atomatom to print.
Returns
std::ostream& the resulting output stream.

◆ translate()

void translate ( std::vector< Atom > &  atoms,
glm::vec3  r 
)

◆ uniqueElements()

std::set< Element > uniqueElements ( const std::vector< Atom > &  atoms)

Determine the unique elements in a list of Atom.

Parameters
atomsthe atoms to check.
Returns
std::set<Element> the set of elements.