Debian Codegraph @

avogadro/qtplugins/applycolors/applycolors.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_APPLYCOLORS_H
7 #define AVOGADRO_QTPLUGINS_APPLYCOLORS_H
8
9 #include <avogadro/qtgui/extensionplugin.h>
10
11 #include <tinycolormap.hpp>
12
13 #include <QtGui/QColor>
14
15 class QColorDialog;
16
17 namespace Avogadro::QtPlugins {
18
19 /**
20 * @brief The ApplyColors class is an extension to modify apply custom colors.
21 */
22 class ApplyColors : public Avogadro::QtGui::ExtensionPlugin
23 {
24 Q_OBJECT
25 public:
26 explicit ApplyColors(QObject* parent_ = nullptr);
27 ~ApplyColors() override;
28
29 QString name() const override { return tr("ApplyColors"); }
30 QString description() const override;
31 QList<QAction*> actions() const override;
32 QStringList menuPath(QAction*) const override;
33
34 public slots:
35 void setMolecule(QtGui::Molecule* mol) override;
36
37 private slots:
38 void openColorDialog();
39 void applyCustomColor(const QColor& color);
40 void applyDistanceColors();
41 void applyIndexColors();
42
43 void applyChargeColors();
44
45 void resetColors();
46
47 void openColorDialogResidue();
48 void applyCustomColorResidue(const QColor& color);
49 void applyAminoColors();
50 void applyShapelyColors();
51 void applySecondaryStructureColors();
52 void resetColorsResidue();
53
54 private:
55 QList<QAction*> m_actions;
56 QtGui::Molecule* m_molecule;
57 QColorDialog* m_dialog;
58
59 tinycolormap::ColormapType getColormapFromString(const QString& name) const;
60 };
61
62 } // namespace Avogadro::QtPlugins
63
64 #endif // AVOGADRO_QTPLUGINS_APPLYCOLORS_H