/usr/include/BALL/FORMAT/MOL2File.h is in libball1.4-dev 1.4.1+20111206-3.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 | // -*- Mode: C++; tab-width: 2; -*-
// vi: set ts=2:
//
#ifndef BALL_FORMAT_MOL2FILE_H
#define BALL_FORMAT_MOL2FILE_H
#ifndef BALL_FORMAT_GENERICMOLFILE_H
# include <BALL/FORMAT/genericMolFile.h>
#endif
#ifndef BALL_MATHS_VECTOR3_H
# include <BALL/MATHS/vector3.h>
#endif
#ifndef BALL_KERNEL_ATOMCONTAINER_H
# include <BALL/KERNEL/atomContainer.h>
#endif
namespace BALL
{
class Atom;
class System;
/** SYBYL MOL2 file class.
This class is used to read and write SYBYL MOL2 files (Tripos). \par
\ingroup StructureFormats
*/
class BALL_EXPORT MOL2File
: public GenericMolFile
{
public:
/// A class used for storing TRIPOS sets
BALL_EXPORT struct SetStruct
{
String name;
bool is_static;
String obj_type;
String sub_type;
String status;
String comment;
Size number_of_members;
vector<Index> static_members;
String dynamic_rule;
};
/** @name Constants
*/
//@{
/** Tripos Record Type Identifier (RTI)
*/
static const String TRIPOS;
//@}
/** @name Constructors and Destructors
*/
//@{
/** Default constructor
*/
MOL2File();
/** Detailed constructor
* @throw Exception::FileNotFound if the file could not be opened
*/
MOL2File(const String& filename, File::OpenMode open_mode = std::ios::in);
/// Destructor
virtual ~MOL2File();
//@}
/** @name Reading and Writing of Kernel Datastructures
*/
//@{
/** Write a system to the MOL2 file
* @throw File::CannotWrite if writing to the file failed
*/
virtual bool write(const System& system);
/** Read a system from the MOL2 file
* @throw Exception::ParseError if a syntax error was encountered
*/
virtual bool read(System& system);
/** Read a molecule from the MOL2 file
* @throw Exception::ParseError if a syntax error was encountered
*/
virtual Molecule* read();
/** Write a molecule to a HIN file.
* @throw File::CannotWrite if writing to the file failed
*/
virtual bool write(const Molecule& molecule);
///
const MOL2File& operator = (const MOL2File& file);
/// Return the number of TRIPOS-Sets defined in this instance
Size getNumberOfSets() const { return sets_.size(); }
/// Return the i-th TRIPOS set. NOTE: no range checking is performed
SetStruct& getSet(Position i) { return sets_[i]; }
/// Return the i-th TRIPOS set, const version. NOTE: no range checking is performed
const SetStruct& getSet(Position i) const { return sets_[i]; }
//@}
protected:
void readAtomSection_();
void readBondSection_();
void readMoleculeSection_();
void readSetSection_();
void readSubstructureSection_();
void readCommentSection_();
String getSybylType_(const Atom& atom) const;
bool nextLine_();
void clear_();
bool buildAll_(Molecule& molecule);
bool containsAtomChilds_(AtomContainerConstIterator& frag_it);
BALL_EXPORT struct AtomStruct
{
String name;
Vector3 position;
String type;
Position substructure;
String substructure_name;
float charge;
};
BALL_EXPORT struct BondStruct
{
Position atom1;
Position atom2;
String type;
};
BALL_EXPORT struct MoleculeStruct
{
String name;
Size number_of_atoms;
Size number_of_bonds;
Size number_of_substructures;
Size number_of_features;
Size number_of_sets;
String type;
String charge_type;
String comment;
};
BALL_EXPORT struct SubstructureStruct
{
String name;
Size root_atom;
String substructure_type;
Size dictionary_type;
String chain;
String sub_type;
Size inter_bonds;
String comment;
};
BALL_EXPORT struct CommentStruct
{
String name;
String value;
};
vector<AtomStruct> atoms_;
vector<BondStruct> bonds_;
vector<SetStruct> sets_;
vector<SubstructureStruct> substructures_;
vector<CommentStruct> comments_;
MoleculeStruct molecule_;
Size number_of_lines_;
static const Size MAX_LENGTH_;
char buffer_[4096];
String line_;
bool found_next_header_;
};
} // namespace BALL
#endif // BALL_FORMAT_MOL2FILE_H
|