Debian Codegraph @

avogadro/qtplugins/openbabel/obcharges.h

raw
1 /******************************************************************************
2 This source file is part of the Avogadro project.
3 This source code is released under the 3-Clause BSD License, (see "LICENSE").
4 ******************************************************************************/
5
6 #ifndef AVOGADRO_QTPLUGINS_OBCHARGES_H
7 #define AVOGADRO_QTPLUGINS_OBCHARGES_H
8
9 #include <avogadro/calc/chargemodel.h>
10 #include <avogadro/io/cmlformat.h>
11
12 namespace Avogadro {
13 namespace QtPlugins {
14
15 class OBCharges : public Avogadro::Calc::ChargeModel
16 {
17 public:
18 OBCharges(const std::string& identifier = "");
19 ~OBCharges() override;
20
21 /**
22 * Create a new instance of the file format class. Ownership passes to the
23 * caller.
24 */
25 OBCharges* newInstance() const override { return new OBCharges; }
26
27 /**
28 * @brief A unique identifier defined by the file
29 */
30 std::string identifier() const override { return m_identifier; }
31
32 /**
33 * @brief Set the identifier
34 */
35 virtual void setIdentifier(const std::string& identifier)
36 {
37 m_identifier = identifier;
38 }
39
40 /**
41 * @brief Based on the identifiers -- for the menus, etc.
42 */
43 std::string name() const override;
44
45 /**
46 * @brief The element mask for a particular OB charge model (e.g., Gasteiger)
47 * @return the mask relevant for this method
48 */
49 Core::Molecule::ElementMask elements() const override { return m_elements; }
50
51 /**
52 * @brief Retrieve the relevant charges from the molecule for our defined type
53 */
54 MatrixX partialCharges(Core::Molecule& mol) const override;
55 MatrixX partialCharges(const Core::Molecule& mol) const override;
56
57 /**
58 * @brief Synchronous use of the OBProcess.
59 */
60 class ProcessListener;
61
62 protected:
63 std::string m_identifier;
64 std::string m_name;
65 Core::Molecule::ElementMask m_elements;
66
67 mutable Io::CmlFormat m_cmlFormat;
68 };
69
70 } // namespace QtPlugins
71 } // namespace Avogadro
72
73 #endif // AVOGADRO_QTPLUGINS_OBCHARGES_H