BALL::XYZFile Class Reference
[Molecular structure file formats]

#include <BALL/FORMAT/XYZFile.h>

Inheritance diagram for BALL::XYZFile:
Inheritance graph
[legend]

List of all members.

Public Member Functions

Constructors and Destructors

 XYZFile ()
 XYZFile (const String &filename, File::OpenMode open_mode=std::ios::in)
virtual ~XYZFile ()

Reading and Writing of Kernel Datastructures



String comment_
virtual bool write (const AtomContainer &ac)
virtual bool write (const System &system)
virtual bool write (const Molecule &mol)
virtual bool read (System &system)
virtual Moleculeread ()
BALL_DEPRECATED const StringgetComent () const
const StringgetComment () const
const XYZFileoperator= (const XYZFile &file)

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.

Definition at line 34 of file XYZFile.h.


Constructor & Destructor Documentation

BALL::XYZFile::XYZFile (  ) 

Default constructor

BALL::XYZFile::XYZFile ( const String filename,
File::OpenMode  open_mode = std::ios::in 
)

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
Exceptions:
Exception::FileNotFound if the file could not be opened
virtual BALL::XYZFile::~XYZFile (  )  [virtual]

Destructor


Member Function Documentation

BALL_DEPRECATED const String& BALL::XYZFile::getComent (  )  const [inline]
Deprecated:
Instead of this method use XYZFile::getComment()

Definition at line 90 of file XYZFile.h.

const String& BALL::XYZFile::getComment (  )  const [inline]

Definition at line 93 of file XYZFile.h.

const XYZFile& BALL::XYZFile::operator= ( const XYZFile file  )  [private]
virtual Molecule* BALL::XYZFile::read (  )  [virtual]

Read a molecule from the XYZ file

Exceptions:
Exception::ParseError if a syntax error was encountered

Reimplemented from BALL::GenericMolFile.

virtual bool BALL::XYZFile::read ( System system  )  [virtual]

Read a system from the XYZ file

Exceptions:
Exception::ParseError if a syntax error was encountered

Reimplemented from BALL::GenericMolFile.

virtual bool BALL::XYZFile::write ( const Molecule mol  )  [virtual]

Write a molecule to the XYZ file

Exceptions:
File::CannotWrite if writing to the file failed

Reimplemented from BALL::GenericMolFile.

virtual bool BALL::XYZFile::write ( const System system  )  [virtual]

Write a system to the XYZ file

Exceptions:
File::CannotWrite if writing to the file failed

Reimplemented from BALL::GenericMolFile.

virtual bool BALL::XYZFile::write ( const AtomContainer ac  )  [virtual]

Write an AtomContainer to the XYZ file

Exceptions:
File::CannotWrite if writing to the file failed

Member Data Documentation

Definition at line 98 of file XYZFile.h.

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Defines
Generated by  doxygen 1.6.3