SimpleFastOpenAtomicVisualiser
Loading...
Searching...
No Matches
Functions | Variables
colour.h File Reference
#include <map>
#include <string>
#include <filesystem>
#include <sstream>
#include <fstream>
#include <glm/glm.hpp>
#include <element.h>
Include dependency graph for colour.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Functions

glm::vec4 elementToColour (Element &e)
 Map an Element to a CPK colour.
 
glm::vec4 stringSymbolToColour (std::string &s)
 Map a string symbol to a CPK colour.
 
std::map< Element, glm::vec4coloursFromFile (std::filesystem::path path)
 Read an Element colour map from a file.
 
std::map< uint64_t, glm::vec4atomColoursFromFile (std::filesystem::path path)
 Read an atom index colour map from a file.
 

Variables

const std::map< Element, glm::vec4CPK_COLOURS
 Corey–Pauling–Koltun colourings.
 

Function Documentation

◆ atomColoursFromFile()

std::map< uint64_t, glm::vec4 > atomColoursFromFile ( std::filesystem::path  path)

Read an atom index colour map from a file.

Remarks
The file should be formatted with lines as the atom index and 4 floats.
Not all atoms need be specified.
These colours will override any others.
Parameters
paththe file path.
Returns
std::map<uint64_t, glm::vec4> the atom colourings.

◆ coloursFromFile()

std::map< Element, glm::vec4 > coloursFromFile ( std::filesystem::path  path)

Read an Element colour map from a file.

Remarks
The file should be formatted with lines as the element name string and 4 floats.
Any unspecified colourings will default to CPK.
CPK colours are returned on errors.
Parameters
paththe file path.
Returns
std::map<Element, glm::vec4> the Element colourings.

◆ elementToColour()

glm::vec4 elementToColour ( Element e)

Map an Element to a CPK colour.

Parameters
ethe Element type.
Returns
glm::vec4 the colour.

◆ stringSymbolToColour()

glm::vec4 stringSymbolToColour ( std::string &  s)

Map a string symbol to a CPK colour.

Parameters
sthe element symbol.
Returns
glm::vec4 the colour.

Variable Documentation

◆ CPK_COLOURS

Corey–Pauling–Koltun colourings.