23 std::string
ext = path.extension().string();
29 [](
unsigned char c){ return std::tolower(c); }
31 if (
ext.rfind(
".xyz", 0) == 0 ||
ext.rfind(
".extxyz", 0) == 0)
69 std::map<std::string, std::string> metaData;
99 auto pos =
s.find(
"=");
100 metaData.insert(std::pair(
s.substr(0,
pos),
s.substr(
pos+1)));
105 metaData[
"comment"] =
line;
112 std::stringstream
ss;
120 ss = std::stringstream(
line);
138 std::thread
io = std::thread
148 if (metaData.find(
"Lattice") != metaData.end())
150 auto values =
split(metaData[
"Lattice"], std::regex(
" "));
153 v = std::regex_replace(
v, std::regex(
"[^0-9\\.]"),
"");
An atom structure.
Definition atom.h:20
Specification for the structure file interface.
Definition structure.h:26
uint64_t atomsRead
Definition structure.h:187
glm::vec3 cellA
Definition structure.h:189
glm::vec3 cellB
Definition structure.h:190
virtual void beginning()
Definition structure.h:199
bool blockingReads
Definition structure.h:179
uint64_t frames
Definition structure.h:182
std::vector< Atom > atoms
The Atoms read in the current frame.
Definition structure.h:147
std::map< Element, glm::vec4 > colourMap
Colour map from Element to colour.
Definition structure.h:174
void scanPositions()
Definition structure.h:237
std::ifstream filestream
Definition structure.h:180
uint64_t linesPerFrame
Definition structure.h:183
std::filesystem::path path
Definition structure.h:178
uint64_t natoms
Definition structure.h:181
void skipLine(std::ifstream &in)
Definition structure.h:226
glm::vec3 cellC
Definition structure.h:191
void checkRead(std::stringstream &ss, std::string lastInput, std::string context)
Definition structure.h:287
std::map< uint64_t, uint64_t > framePositions
Definition structure.h:195
Read XYZ and EXTXYZ files.
Definition xyz.h:50
XYZ(std::filesystem::path path, bool blocking=false)
Construct a new XYZ object to read from path.
Definition xyz.h:59
glm::vec< L, float, glm::qualifier::highp > vec
Definition commandLine.h:214
Element stringSymbolToElement(const std::string &s)
Map a string symbol to an Element.
Definition element.h:681
const std::map< Element, float > ELEMENT_RADIUS
Map Element to a Van der Waals radius in Angstroms.
Definition element.h:461
std::vector< std::string > split(std::string str, std::regex delim)
Split a std::string by a std::regex token.
Definition util.h:108
bool ostensiblyXYZLike(std::filesystem::path path)
Check if a path is XYZ'y.
Definition xyz.h:21