Debian Codegraph @

avogadro/qtplugins/insertpeptide/insertpeptide.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_INSERTPEPTIDE_H
7 #define AVOGADRO_QTPLUGINS_INSERTPEPTIDE_H
8
9 #include <avogadro/core/internalcoordinates.h>
10 #include <avogadro/qtgui/extensionplugin.h>
11
12 namespace Avogadro {
13
14 namespace QtPlugins {
15
16 class InsertPeptideDialog;
17
18 // Used to store the amino acids as they are built
19 struct AminoAcid
20 {
21 std::vector<unsigned char> atomicNumbers;
22 std::vector<std::string> atomNames;
23 std::vector<Avogadro::Core::InternalCoordinate> internalCoords;
24 };
25
26 /**
27 * @brief Insert oligopeptide sequences
28 */
29 class InsertPeptide : public QtGui::ExtensionPlugin
30 {
31 Q_OBJECT
32 public:
33 explicit InsertPeptide(QObject* parent_ = nullptr);
34 ~InsertPeptide() override;
35
36 QString name() const override { return tr("InsertPeptide"); }
37 QString description() const override
38 {
39 return tr("Insert oligopeptide sequences.");
40 }
41 QList<QAction*> actions() const override;
42 QStringList menuPath(QAction*) const override;
43
44 public slots:
45 void setMolecule(QtGui::Molecule*) override;
46
47 private slots:
48 void showDialog();
49 void performInsert();
50 void updateText();
51 void setStructureType(int);
52
53 private:
54 AminoAcid readAminoAcid(const QString& threeLetterCode);
55
56 QList<QAction*> m_actions;
57 QtGui::Molecule* m_molecule;
58 InsertPeptideDialog* m_dialog;
59 QString m_directory; // directory to amino acid fragments
60 };
61
62 } // namespace QtPlugins
63 } // namespace Avogadro
64
65 #endif // AVOGADRO_QTPLUGINS_INSERTPEPTIDE_H