Description

The open source project includes the interface-less source code for some functions of software. The source code is still being adopted from standalone applications, however some things are already working. The source code is rewritten in a way that the majority of compilers will compile it. Some system-dependent functions such as IO operations were combined in a single object, so it will not take long to adopt the library to a particular OS. A standard library of objects including string, list, list of strings, table, vectors and matrices. I have tested the library with Borland and Microsoft (R) compilers and supplemented some examples.

2004.05.19
Recent release includes graphics library based on OpenGL (R). The library has been implemented only for Windows (R) platform. However implementation to any other platform requires only a few changes in the context initialisation procedures. The TXApplication wrapper includes basic functionality of a graphic crystallographic application. An example for Borland C++ Builder is available.

2004.04.01
To use the library an external variable TLog *Log  has to be created and its property BaseDir initialised with the folder name from which the program is started as follows:

#include "log.h"
#include "efiles.h"
TLog * Log;
int main(int argc, char* argv[] )
{
    Log = new TLog("log.file");
    Log->BaseDir = TEFiles::ExtractFileDir(argv[0]);
    ...
}
Some chemical related objects include (chemobj.h) TCHNExp and TIPattern. The first one allows the calculation of elemental analysis for a given formula and disassembling expression of following type: ((C2B9H11)2Co)Cu, etc. The TIPattern object allows the calculation of isotope patterns for a given formula. The evaluation of isotope patterns is based on the TPolynom class, which allows multiplication of polynomes in a "symbolic" form and can be used in calculation of an NMR signals splitting or somewhere else.
    There is also a crystallographic library (xclasses.h, cif.h, ins.h). The library is still under the construction, however the basic framework is already implemented and fully functional TCif and TIns objects, encapsulating crystallographic CIF and INS files is implemented. The library library operates in the following way:
A crystallographic file parser is created. The parser id inherited form TBasicCFile, which implements following functions:
    bool virtual SaveToFile(const TEString &A)=0;
    bool virtual LoadFromFile(const TEString &A)=0;
    virtual bool Adopt(class TXFile *)=0;
The parser could work as a standalone object supporting full functionality of the format, however to work with crystallographic files, it should initialise its property: TAsymmetricUnit *AsymmUnit with cell parameters and atoms. After this an instance of XFile is created and the parser is registered using the RegisterFileFormat Method. The XFile (still under construction) implements all the functionality of a crystallographic object such as generation of atoms, searching the bonds etc. When an XFile has to be saved to a file it finds the file format (from the registered parsers) and calls its Adopt method. The Adopt method forces the BasicCFile to initialise all necessary data such as unit cell parameters, symmetry operations etc and be ready to be saved to disk. The main property of an XFile is the Lattice. The lattice incorporates asymmetric unit (AsymmUnit) and unit cell (UnitCell). Thus a parser can extract all necessary information from these objects. For example when a Cif adopts an XFile it takes atoms from the AsymmUnit and symmetry operations from the UnitCell. See instructions how to use an XFile.

Alongside with chemical and crystallographic objects the library includes a module for the evaluation of string expressions containing variables and user-defined functions (evailn.h). The object is called TSOperation and is a very useful, when you need to do some calculations within a program, which depend on user input (for example a user types in an expression and the program has to evaluate it and give result or use it for further calculations).

 

© Oleg V. Dolomanov, 2004
Last Updated 2004.05.15