BALL 1.5.0
Loading...
Searching...
No Matches
smilesParser.h
Go to the documentation of this file.
1// -*- Mode: C++; tab-width: 2; -*-
2// vi: set ts=2:
3//
4
5#ifndef BALL_STRUCTURE_SMILES_PARSER_H
6#define BALL_STRUCTURE_SMILES_PARSER_H
7
8#ifndef BALL_COMMON_H
9# include <BALL/common.h>
10#endif
11
12#ifndef BALL_KERNEL_ATOM_H
13# include <BALL/KERNEL/atom.h>
14#endif
15
16#ifndef BALL_KERNEL_BOND_H
17# include <BALL/KERNEL/bond.h>
18#endif
19
20#ifndef BALL_KERNEL_SYSTEM_H
21# include <BALL/KERNEL/system.h>
22#endif
23
24namespace BALL
25{
26
37 {
38 public:
40 {
43 E
44 };
45
55
56 enum
57 {
58 MAX_CONNECTIONS = 100
59 };
60
61 typedef std::pair<ChiralClass, Position> ChiralDef;
62
63 class SPAtom;
65 : public Bond
66 {
67 public:
68 virtual ~SPBond() ;
69
70 SPBond(SPAtom* first, SPAtom* second, Index order = 1);
71
74
75 protected:
77 };
78
80 : public Atom
81 {
82 public:
83
84 SPAtom(const String& symbol, bool in_brackets);
85 virtual ~SPAtom() ;
86
89
90 Size getIsotope() const { return isotope_; }
91 void setIsotope(Size isotope) { isotope_ = isotope; };
92
93 Index getFormalCharge() const { return formal_charge_; }
94 void setFormalCharge(Index charge) { formal_charge_ = charge; }
95
96 const ChiralDef& getChirality() const { return chirality_; }
97 void setChirality(const ChiralDef& chirality) { chirality_ = chirality; }
98
99 bool isAromatic() const { return is_aromatic_; }
100 void setAromatic(bool is_aromatic) { is_aromatic_ = is_aromatic; };
101 bool isInBrackets() const { return in_brackets_; }
102 void setInBrackets(bool in_brackets) { in_brackets_ = in_brackets; };
103
104 protected:
110 };
111
112 typedef std::list<Position> ConnectionList;
113
117
120
123
125 virtual ~SmilesParser();
127
134 void parse(const String& s);
135
138 const System& getSystem() const;
140
145 SPAtom* createAtom(const String& symbol, bool in_bracket = false);
146
148 void createBonds(SPAtom* atom, const ConnectionList* list);
149
151 void createBond(SPAtom* left, SPAtom* right, Index order);
152
156
157
164
165 static State state;
166
167 protected:
169 std::vector<SPAtom*> connections_;
170 std::vector<SPAtom*> all_atoms_;
172 };
173
174} // namespace BALL
175
176#endif // BALL_STRUCTURE_SMILES_PARSER_H
SmilesParser(const SmilesParser &parser)
std::list< Position > ConnectionList
const System & getSystem() const
void createBond(SPAtom *left, SPAtom *right, Index order)
void parse(const String &s)
std::pair< ChiralClass, Position > ChiralDef
void createBonds(SPAtom *atom, const ConnectionList *list)
std::vector< SPAtom * > all_atoms_
SPAtom * createAtom(const String &symbol, bool in_bracket=false)
virtual ~SmilesParser()
std::vector< SPAtom * > connections_
void addMissingHydrogens()
static SmilesParser * current_parser_
static State state
SPBond(SPAtom *first, SPAtom *second, Index order=1)
ZEIsomerType getZEType() const
void setZEType(ZEIsomerType type)
void setInBrackets(bool in_brackets)
void setIsotope(Size isotope)
SPAtom(const String &symbol, bool in_brackets)
const ChiralDef & getChirality() const
void setAromatic(bool is_aromatic)
Size getDefaultValence() const
Size countRealValences() const
void setChirality(const ChiralDef &chirality)
void setFormalCharge(Index charge)
Index getFormalCharge() const
SmilesParser * current_parser
#define BALL_EXPORT