BALL
1.4.2
Main Page
Related Pages
Modules
Namespaces
Classes
Files
File List
File Members
•
All
Classes
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Properties
Friends
Macros
Groups
Pages
include
BALL
FORMAT
MOL2File.h
Go to the documentation of this file.
1
// -*- Mode: C++; tab-width: 2; -*-
2
// vi: set ts=2:
3
//
4
5
#ifndef BALL_FORMAT_MOL2FILE_H
6
#define BALL_FORMAT_MOL2FILE_H
7
8
#ifndef BALL_FORMAT_GENERICMOLFILE_H
9
# include <
BALL/FORMAT/genericMolFile.h
>
10
#endif
11
12
#ifndef BALL_MATHS_VECTOR3_H
13
# include <
BALL/MATHS/vector3.h
>
14
#endif
15
16
#ifndef BALL_KERNEL_ATOMCONTAINER_H
17
# include <
BALL/KERNEL/atomContainer.h
>
18
#endif
19
20
namespace
BALL
21
{
22
class
Atom
;
23
class
System;
24
30
class
BALL_EXPORT
MOL2File
31
:
public
GenericMolFile
32
{
33
public
:
34
36
BALL_EXPORT
struct
SetStruct
37
{
38
String
name
;
39
bool
is_static
;
40
String
obj_type
;
41
String
sub_type
;
42
String
status
;
43
String
comment
;
44
Size
number_of_members
;
45
46
vector<Index>
static_members
;
47
String
dynamic_rule
;
48
};
49
53
56
static
const
String
TRIPOS
;
58
62
65
MOL2File
();
66
70
MOL2File
(
const
String
& filename,
File::OpenMode
open_mode = std::ios::in);
71
73
virtual
~
MOL2File
();
74
76
80
84
virtual
bool
write(
const
System
& system);
85
89
virtual
bool
read(
System
& system);
90
94
virtual
Molecule
* read();
95
99
virtual
bool
write(
const
Molecule
& molecule);
100
102
const
MOL2File
& operator = (
const
MOL2File
& file);
103
105
Size
getNumberOfSets
()
const
{
return
sets_.size(); }
106
108
SetStruct
&
getSet
(
Position
i) {
return
sets_[i]; }
109
111
const
SetStruct
&
getSet
(
Position
i)
const
{
return
sets_[i]; }
112
114
115
protected
:
116
117
void
readAtomSection_();
118
119
void
readBondSection_();
120
121
void
readMoleculeSection_();
122
123
void
readSetSection_();
124
125
void
readSubstructureSection_();
126
127
void
readCommentSection_();
128
129
String
getSybylType_(
const
Atom
& atom)
const
;
130
131
bool
nextLine_();
132
133
void
clear_();
134
135
bool
buildAll_(
Molecule
& molecule);
136
137
bool
containsAtomChilds_(
AtomContainerConstIterator
& frag_it);
138
139
BALL_EXPORT
struct
AtomStruct
140
{
141
String
name
;
142
Vector3
position
;
143
String
type
;
144
Position
substructure
;
145
String
substructure_name
;
146
float
charge
;
147
};
148
149
BALL_EXPORT
struct
BondStruct
150
{
151
Position
atom1
;
152
Position
atom2
;
153
String
type
;
154
};
155
156
BALL_EXPORT
struct
MoleculeStruct
157
{
158
String
name
;
159
Size
number_of_atoms
;
160
Size
number_of_bonds
;
161
Size
number_of_substructures
;
162
Size
number_of_features
;
163
Size
number_of_sets
;
164
String
type
;
165
String
charge_type
;
166
String
comment
;
167
};
168
169
BALL_EXPORT
struct
SubstructureStruct
170
{
171
String
name
;
172
Size
root_atom
;
173
String
substructure_type
;
174
Size
dictionary_type
;
175
String
chain
;
176
String
sub_type
;
177
Size
inter_bonds
;
178
String
comment
;
179
};
180
181
BALL_EXPORT
struct
CommentStruct
182
{
183
String
name
;
184
String
value
;
185
};
186
187
188
vector<AtomStruct>
atoms_
;
189
vector<BondStruct>
bonds_
;
190
vector<SetStruct>
sets_
;
191
vector<SubstructureStruct>
substructures_
;
192
vector<CommentStruct>
comments_
;
193
MoleculeStruct
molecule_
;
194
195
Size
number_of_lines_
;
196
static
const
Size
MAX_LENGTH_
;
197
char
buffer_[4096];
198
String
line_
;
199
bool
found_next_header_
;
200
};
201
}
// namespace BALL
202
203
#endif // BALL_FORMAT_MOL2FILE_H
Generated by
1.8.3.1