| 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_CENTROID_H |
| 7 |
#define AVOGADRO_QTPLUGINS_CENTROID_H |
| 8 |
|
| 9 |
#include <avogadro/core/avogadrocore.h> |
| 10 |
#include <avogadro/qtgui/extensionplugin.h> |
| 11 |
|
| 12 |
namespace Avogadro::QtPlugins { |
| 13 |
|
| 14 |
/** |
| 15 |
* @brief The Centroid class adds centroids and center-of-mass |
| 16 |
*/ |
| 17 |
class Centroid : public QtGui::ExtensionPlugin |
| 18 |
{ |
| 19 |
Q_OBJECT |
| 20 |
public: |
| 21 |
explicit Centroid(QObject* parent_ = nullptr); |
| 22 |
~Centroid() override = default; |
| 23 |
|
| 24 |
QString name() const override { return tr("Centroid"); } |
| 25 |
|
| 26 |
QString description() const override |
| 27 |
{ |
| 28 |
return tr("Add centroids and center-of-mass."); |
| 29 |
} |
| 30 |
|
| 31 |
QList<QAction*> actions() const override; |
| 32 |
|
| 33 |
QStringList menuPath(QAction* action) const override; |
| 34 |
|
| 35 |
public slots: |
| 36 |
void setMolecule(QtGui::Molecule* mol) override; |
| 37 |
|
| 38 |
private slots: |
| 39 |
void addCentroid(); |
| 40 |
void addCenterOfMass(); |
| 41 |
void normal(); |
| 42 |
|
| 43 |
private: |
| 44 |
QtGui::Molecule* m_molecule; |
| 45 |
|
| 46 |
QAction* m_centroidAction; |
| 47 |
QAction* m_comAction; |
| 48 |
QAction* m_normalAction; |
| 49 |
}; |
| 50 |
|
| 51 |
} // namespace Avogadro::QtPlugins |
| 52 |
|
| 53 |
#endif // AVOGADRO_QTPLUGINS_BONDING_H |