Open Babel  3.0
typer.h
Go to the documentation of this file.
1 /**********************************************************************
2 typer.h - Open Babel atom and aromaticity typer.
3 
4 Copyright (C) 1998-2001 by OpenEye Scientific Software, Inc.
5 Some portions Copyright (C) 2001-2005 by Geoffrey R. Hutchison
6 
7 This file is part of the Open Babel project.
8 For more information, see <http://openbabel.org/>
9 
10 This program is free software; you can redistribute it and/or modify
11 it under the terms of the GNU General Public License as published by
12 the Free Software Foundation version 2 of the License.
13 
14 This program is distributed in the hope that it will be useful,
15 but WITHOUT ANY WARRANTY; without even the implied warranty of
16 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 GNU General Public License for more details.
18 ***********************************************************************/
19 
20 #ifndef OB_TYPER_H
21 #define OB_TYPER_H
22 
23 #include <openbabel/babelconfig.h>
24 #include <openbabel/mol.h>
25 
26 #include <vector>
27 #include <string>
28 
29 #include <openbabel/parsmart.h>
30 #include <openbabel/data.h>
31 
32 namespace OpenBabel
33 {
34 
35  // Forward declaration
36  class OBSmartsPattern;
37 
38 // class introduction in typer.cpp
39 class OBAPI OBAtomTyper : public OBGlobalDataBase
40 {
41  std::vector<std::pair<OBSmartsPattern*,int> > _vinthyb;
42  std::vector<std::pair<OBSmartsPattern*,std::string> > _vexttyp;
43 
44 public:
45  OBAtomTyper();
46  OBAtomTyper(const OBAtomTyper& rhs) {abort();}
47  ~OBAtomTyper();
48 
49  //swig is requiring these, but I can't figure out how to make it not, so definte with abort
50  const OBAtomTyper& operator=(const OBAtomTyper& rhs) {abort();}
51 
52  void ParseLine(const char*);
54  size_t GetSize() { return _vinthyb.size(); }
55 
57  void AssignHyb(OBMol&);
59  void AssignTypes(OBMol&);
60 };
61 
62 #ifndef THREAD_LOCAL
63 # define THREAD_LOCAL
64 #endif
65 #ifndef EXTERN
66 #error EXTERN
67 #endif
68 THREAD_LOCAL EXTERN OBAtomTyper atomtyper;
71 
72 // class introduction in typer.cpp
73 class OBAPI OBAromaticTyper
74 {
75 public:
78 
80  void AssignAromaticFlags(OBMol &);
81 };
82 
85 
86 // class introduction in typer.cpp
87 class OBAPI OBRingTyper : public OBGlobalDataBase
88 {
89  std::vector<std::pair<OBSmartsPattern*,std::string> > _ringtyp;
90 
91 public:
92  OBRingTyper();
93  ~OBRingTyper();
94 
95  void ParseLine(const char*);
97  size_t GetSize() { return _ringtyp.size();}
98 
100  void AssignTypes(OBMol&);
101 };
102 
103 
104 } //namespace OpenBabel
105 
106 #endif // OB_TYPER_H
107 
OBAromaticTyper()
Definition: typer.h:76
~OBAromaticTyper()
Definition: typer.h:77
size_t GetSize()
Definition: typer.h:54
Molecule Class.
Definition: mol.h:118
OBAtomTyper(const OBAtomTyper &rhs)
Definition: typer.h:46
Handle molecules. Declarations of OBMol, OBAtom, OBBond, OBResidue. (the main header for Open Babel) ...
THREAD_LOCAL OBAtomTyper atomtyper
Definition: typer.h:70
THREAD_LOCAL OBAromaticTyper aromtyper
Global OBAromaticTyper for detecting aromatic atoms and bonds.
Definition: typer.h:84
Global data and resource file parsers.
Assigns aromatic typing to atoms and bonds.
Definition: typer.h:73
Assigns ring types.
Definition: typer.h:87
#define THREAD_LOCAL
Definition: typer.h:63
const OBAtomTyper & operator=(const OBAtomTyper &rhs)
Definition: typer.h:50
Assigns atom types, hybridization, and formal charges.
Definition: typer.h:39
size_t GetSize()
Definition: typer.h:97
Daylight SMARTS parser.
Base data table class, handles reading data files.
Definition: data.h:48
Global namespace for all Open Babel code.
Definition: alias.h:22