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

HINFile Class Reference
[Molecular structure file formats]

HyperChem file class. More...

#include <HINFile.h>

Inheritance diagram for HINFile:

GenericMolFile LineBasedFile File List of all members.

Public Member Functions

Constructors and Destructors
 HINFile () throw ()
 Default constructor.
 HINFile (const HINFile &file) throw (Exception::FileNotFound)
 Copy constructor.
 HINFile (const String &filename, File::OpenMode open_mode=std::ios::in) throw (Exception::FileNotFound)
 Detailed constructor.
virtual ~HINFile () throw ()
 Destructor.
Assignment.
const HINFileoperator= (const HINFile &rhs) throw (Exception::FileNotFound)
 Assignment operator.
Reading and Writing of Kernel Datastructures
virtual bool write (const Molecule &molecule) throw (File::CannotWrite)
 Write a molecule to a HIN file.
virtual bool write (const System &system) throw (File::CannotWrite)
 Write a system to a HIN file.
virtual Moleculeread () throw (Exception::ParseError)
 Read a system from the HIN file.
virtual bool read (System &system) throw (Exception::ParseError)
 Read a system.
Accessors
bool hasPeriodicBoundary () const
 Check for a periodic boundary in the file.
SimpleBox3 getPeriodicBoundary () const
 Return the periodic boundary of the file.
float getTemperature () const
 Return the temperature stored in the file.

Protected Member Functions

virtual void initRead_ ()
 Initialize temperature and box dimensions prior to reading a system.
void writeAtom_ (const Atom &atom, Size number, Size atom_offset)

Protected Attributes

SimpleBox3 box_
float temperature_

Detailed Description

HyperChem file class.

This class enables BALL to read and write HyperChem HIN files.


Member Function Documentation

SimpleBox3 HINFile::getPeriodicBoundary  )  const
 

Return the periodic boundary of the file.

An emptry box is returned if no periodic boundary is defined.

Returns:
the boundary box

float HINFile::getTemperature  )  const
 

Return the temperature stored in the file.

HIN files may contain a sys entry containing the temperature of the last simulation step. If it is set, it is returned. Otherwise 0 is returned.

Returns:
the final simulation temperature

bool HINFile::hasPeriodicBoundary  )  const
 

Check for a periodic boundary in the file.

const HINFile& HINFile::operator= const HINFile rhs  )  throw (Exception::FileNotFound)
 

Assignment operator.

virtual bool HINFile::read System system  )  throw (Exception::ParseError) [virtual]
 

Read a system.

This method will read all molecules contained in the file and add them to the system.

The default implementation calls read() until false is returned and adds the molecules read to the system.
Returns:
true if anything could be read
Exceptions:
Exception::ParseError if the file could not be parsed while reading a molecule

Reimplemented from GenericMolFile.

virtual bool HINFile::write const System system  )  throw (File::CannotWrite) [virtual]
 

Write a system to a HIN file.

Note that this changes the properties of atoms in the system.

Reimplemented from GenericMolFile.

virtual bool HINFile::write const Molecule molecule  )  throw (File::CannotWrite) [virtual]
 

Write a molecule to a HIN file.

Note that this changes the properties of atoms in the system.

Reimplemented from GenericMolFile.