SimpleFastOpenAtomicVisualiser
Loading...
Searching...
No Matches
Public Member Functions | List of all members
XYZ Class Reference

Read XYZ and EXTXYZ files. More...

#include <xyz.h>

Inheritance diagram for XYZ:
Inheritance graph
[legend]
Collaboration diagram for XYZ:
Collaboration graph
[legend]

Public Member Functions

 XYZ (std::filesystem::path path, bool blocking=false)
 Construct a new XYZ object to read from path.
 
- Public Member Functions inherited from Structure
 Structure (std::filesystem::path path, bool blocking=false)
 
virtual uint64_t atomCount () const
 Get the number of atoms in the file.
 
virtual void readFrame (uint64_t frame)
 Read a single frame at position frame, and increment the current frame.
 
virtual ~Structure ()=default
 
uint64_t frameCount () const
 Get the number of frames.
 
uint64_t framePosition () const
 Get the current frame index.
 
bool framePositionsLoaded () const
 Check if frames start positions have been loaded.
 
uint64_t frameReadProgress () const
 Progress of the current frame read.
 
bool frameReadComplete () const
 If the frame has been fully read into atoms.
 
glm::vec3 getCellA () const
 Get the a cell vector.
 
glm::vec3 getCellB () const
 Get the b cell vector.
 
glm::vec3 getCellC () const
 Get the c cell vector.
 

Additional Inherited Members

- Public Attributes inherited from Structure
std::vector< Atomatoms
 The Atoms read in the current frame.
 
std::map< Element, glm::vec4 > colourMap = CPK_COLOURS
 Colour map from Element to colour.
 
- Protected Member Functions inherited from Structure
virtual void beginning ()
 
void skipFrame ()
 
virtual void skipFrames (uint64_t count)
 
void skipLine (std::ifstream &in)
 
void scanPositions ()
 
void cachePositions ()
 
void countContentLinesInFile ()
 
void checkRead (std::stringstream &ss, std::string lastInput, std::string context)
 
- Protected Attributes inherited from Structure
std::filesystem::path path
 
bool blockingReads
 
std::ifstream filestream
 
uint64_t natoms
 
uint64_t frames
 
uint64_t linesPerFrame
 
uint64_t timeStep
 
uint64_t currentFrame
 
uint64_t linesInFile
 
uint64_t atomsRead
 
glm::vec3 cellA
 
glm::vec3 cellB
 
glm::vec3 cellC
 
bool cacheComplete = false
 
std::map< uint64_t, uint64_tframePositions
 

Detailed Description

Read XYZ and EXTXYZ files.

Remarks
The file structure is nLine reads: ++line2 lines for nLine reads: +lineatoms.
  • Atom count [integer]
  • Comment line [string]
  • nLine reads: +lineentries of the form
    • Symbol [string]
    • Position [float, float, float]
A trajectory is a simple concatenation of multiple XYZ files.
EXTXYZ includes a more detail specification for the comment line.

Constructor & Destructor Documentation

◆ XYZ()

XYZ::XYZ ( std::filesystem::path  path,
bool  blocking = false 
)
inline

Construct a new XYZ object to read from path.

Parameters
paththe file path of the XYZ file.
blockingif reads are blocking or detached.

The documentation for this class was generated from the following file: