Open Babel  3.0
chargemodel.h
Go to the documentation of this file.
1 /**********************************************************************
2 chargemodel.h - Base class for partial charge models
3 
4 Copyright (C) 2010 by Geoffrey Hutchison
5 Some portions Copyright (C) 2009 by Frank Peters
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_CHARGEMODEL_H
21 #define OB_CHARGEMODEL_H
22 
23 #include <openbabel/babelconfig.h>
24 #include <openbabel/plugin.h>
25 #include <openbabel/math/vector3.h>
26 
27 namespace OpenBabel
28 {
29 class OBMol; //Forward declaration; used only as pointer.
30 
31 // Documentation is down below
32 class OBAPI OBChargeModel : public OBPlugin
33 {
35 
36  public:
37  const char* TypeID(){return "charges";};
38 
41  virtual bool ComputeCharges(OBMol &m ) { return false; };
42  virtual bool ComputeCharges(OBMol &m, const char *args) { return ComputeCharges( m ); }
43 
49  const std::vector<double> & GetFormalCharges() const
50  { return m_formalCharges; }
51 
54  const std::vector<double> & GetPartialCharges() const
55  { return m_partialCharges; }
56 
58  vector3 GetDipoleMoment(OBMol &);
59 
60  protected:
61  std::vector<double> m_partialCharges;
62  std::vector<double> m_formalCharges;
63 
65  void FillChargeVectors(OBMol &mol);
66 
68  virtual double DipoleScalingFactor() { return 1.0; }
69 };
70 
124 }//namespace
125 #endif
126 
virtual bool ComputeCharges(OBMol &m)
Definition: chargemodel.h:41
virtual double DipoleScalingFactor()
Provide a scaling factor for the dipole moment – ideally calibrated from many molecules.
Definition: chargemodel.h:68
Atomic partial charge models.
Definition: chargemodel.h:32
Handle 3D coordinates.
const std::vector< double > & GetPartialCharges() const
Definition: chargemodel.h:54
Base class for all types of dynamic classes discovered at runtime.
Definition: plugin.h:52
Molecule Class.
Definition: mol.h:118
const std::vector< double > & GetFormalCharges() const
Definition: chargemodel.h:49
virtual bool ComputeCharges(OBMol &m, const char *args)
Definition: chargemodel.h:42
std::vector< double > m_partialCharges
Definition: chargemodel.h:61
#define MAKE_PLUGIN(BaseClass)
Definition: plugin.h:195
Simplify &#39;plugin&#39; classes to be discovered and/or loaded at runtime.
Represents a vector in 3-dimensional real space.
Definition: vector3.h:44
std::vector< double > m_formalCharges
Definition: chargemodel.h:62
const char * TypeID()
Redefined by each plugin type: "formats", "fingerprints", etc.
Definition: chargemodel.h:37
Global namespace for all Open Babel code.
Definition: alias.h:22