| 1 |
tim |
746 |
/********************************************************************** |
| 2 |
|
|
Copyright (C) 2000 by OpenEye Scientific Software, Inc. |
| 3 |
|
|
Some portions Copyright (C) 2001-2005 by Geoffrey R. Hutchison |
| 4 |
|
|
Some portions Copyright (C) 2004 by Chris Morley |
| 5 |
|
|
|
| 6 |
|
|
This program is free software; you can redistribute it and/or modify |
| 7 |
|
|
it under the terms of the GNU General Public License as published by |
| 8 |
|
|
the Free Software Foundation version 2 of the License. |
| 9 |
|
|
|
| 10 |
|
|
This program is distributed in the hope that it will be useful, |
| 11 |
|
|
but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 12 |
|
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 13 |
|
|
GNU General Public License for more details. |
| 14 |
|
|
***********************************************************************/ |
| 15 |
|
|
#ifndef OB_XYZFORMAT_HPP |
| 16 |
|
|
#define OB_XYZFORMAT_HPP |
| 17 |
|
|
|
| 18 |
|
|
#include "mol.hpp" |
| 19 |
|
|
#include "obconversion.hpp" |
| 20 |
|
|
#include "obmolecformat.hpp" |
| 21 |
|
|
|
| 22 |
|
|
#ifdef HAVE_SSTREAM |
| 23 |
|
|
#include <sstream> |
| 24 |
|
|
#else |
| 25 |
|
|
#include <strstream> |
| 26 |
|
|
#endif |
| 27 |
|
|
|
| 28 |
|
|
using namespace std; |
| 29 |
|
|
namespace OpenBabel |
| 30 |
|
|
{ |
| 31 |
|
|
|
| 32 |
|
|
class XYZFormat : public OBMoleculeFormat |
| 33 |
|
|
{ |
| 34 |
|
|
public: |
| 35 |
|
|
//Register this format type ID |
| 36 |
|
|
XYZFormat() |
| 37 |
|
|
{ |
| 38 |
|
|
OBConversion::RegisterFormat("xyz", this, "chemical/x-xyz"); |
| 39 |
|
|
} |
| 40 |
|
|
|
| 41 |
|
|
virtual const char* Description() //required |
| 42 |
|
|
{ |
| 43 |
|
|
return |
| 44 |
|
|
"XYZ cartesian coordinates format\n \ |
| 45 |
|
|
Read Options e.g. -as\n\ |
| 46 |
|
|
s Output single bonds only\n\ |
| 47 |
|
|
b Disable bonding entirely\n\n"; |
| 48 |
|
|
}; |
| 49 |
|
|
|
| 50 |
|
|
virtual const char* SpecificationURL() |
| 51 |
|
|
{return "http://openbabel.sourceforge.net/formats/xyz.shtml";}; //optional |
| 52 |
|
|
|
| 53 |
|
|
virtual const char* GetMIMEType() |
| 54 |
|
|
{ return "chemical/x-xyz"; }; |
| 55 |
|
|
|
| 56 |
|
|
//*** This section identical for most OBMol conversions *** |
| 57 |
|
|
//////////////////////////////////////////////////// |
| 58 |
|
|
/// The "API" interface functions |
| 59 |
|
|
virtual bool ReadMolecule(OBBase* pOb, OBConversion* pConv); |
| 60 |
|
|
virtual bool WriteMolecule(OBBase* pOb, OBConversion* pConv); |
| 61 |
|
|
}; |
| 62 |
|
|
|
| 63 |
|
|
} |
| 64 |
|
|
|
| 65 |
|
|
#endif |