Main Page | Modules | Namespace List | Class Hierarchy | Class List | Namespace Members | Class Members

XYZFile Class Reference
[Molecular structure file formats]

XYZ file class. More...

#include <XYZFile.h>

Inheritance diagram for XYZFile:

File List of all members.

Reading and Writing of Kernel Datastructures

virtual bool write (const System &system) throw (File::CannotWrite)
 Write a system to the XYZ file.
virtual bool read (System &system)
 Read a system from the XYZ file.
virtual XYZFileoperator>> (System &system)
 Read a system from the XYZ file.
virtual XYZFileoperator<< (const System &system)
 Write a system to the XYZ file.
const XYZFileoperator= (const XYZFile &file) throw ()
const StringgetComent () const

Public Member Functions

Constructors and Destructors
 XYZFile ()
 Default constructor.
 XYZFile (const String &filename, File::OpenMode open_mode=std::ios::in) throw (Exception::FileNotFound)
 Detailed constructor.
 XYZFile (const XYZFile &file) throw (Exception::FileNotFound)
 Copy constructor.
virtual ~XYZFile () throw ()
 Destructor.

Detailed Description

XYZ file class.

This class enables BALL to read and write XMol XYZ files. The XYZ format is a very simple molecular file format. In general it contains only the atom type (i.e., the element) and the cartesian coordinates of the structure. Newer versions of this file format also contain bonds (without bond order) and atom names.

The first line of each XYZ file contains a single integer number: the number of atoms in the file. The second line is just a comment line. When reading a XYZ file, BALL stores this comment as the name attribute of the system read. Similarly, on writing the system, it's name is written to this comment line. All remaining lines contain the element symbol and the three coordinates in free format.


Constructor & Destructor Documentation

XYZFile::XYZFile const String filename,
File::OpenMode  open_mode = std::ios::in
throw (Exception::FileNotFound)
 

Detailed constructor.

Create a XYZ file and open it with mode open_mode (reading is default)

Parameters:
filename the filename
open_mode the openmode - default is File::IN