| 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_CRYSTAL_H |
| 7 |
#define AVOGADRO_QTPLUGINS_CRYSTAL_H |
| 8 |
|
| 9 |
#include <avogadro/qtgui/extensionplugin.h> |
| 10 |
|
| 11 |
namespace Avogadro { |
| 12 |
namespace QtPlugins { |
| 13 |
class UnitCellDialog; |
| 14 |
|
| 15 |
/** |
| 16 |
* @brief Tools for crystal-specific editing/analysis. |
| 17 |
*/ |
| 18 |
class Crystal : public Avogadro::QtGui::ExtensionPlugin |
| 19 |
{ |
| 20 |
Q_OBJECT |
| 21 |
public: |
| 22 |
explicit Crystal(QObject* parent_ = nullptr); |
| 23 |
~Crystal() override; |
| 24 |
|
| 25 |
QString name() const override { return tr("Crystal"); } |
| 26 |
QString description() const override; |
| 27 |
QList<QAction*> actions() const override; |
| 28 |
QStringList menuPath(QAction*) const override; |
| 29 |
|
| 30 |
bool handleCommand(const QString& command, |
| 31 |
const QVariantMap& options) override; |
| 32 |
|
| 33 |
void registerCommands() override; |
| 34 |
|
| 35 |
public slots: |
| 36 |
void setMolecule(QtGui::Molecule* mol) override; |
| 37 |
|
| 38 |
void moleculeChanged(unsigned int changes); |
| 39 |
|
| 40 |
private slots: |
| 41 |
void updateActions(); |
| 42 |
|
| 43 |
void importCrystalClipboard(); |
| 44 |
void editUnitCell(); |
| 45 |
void buildSupercell(); |
| 46 |
void niggliReduce(); |
| 47 |
void scaleVolume(); |
| 48 |
void standardOrientation(); |
| 49 |
void toggleUnitCell(); |
| 50 |
void wrapAtomsToCell(); |
| 51 |
|
| 52 |
private: |
| 53 |
QList<QAction*> m_actions; |
| 54 |
QtGui::Molecule* m_molecule; |
| 55 |
UnitCellDialog* m_unitCellDialog; |
| 56 |
|
| 57 |
QAction* m_importCrystalClipboardAction; |
| 58 |
QAction* m_editUnitCellAction; |
| 59 |
QAction* m_buildSupercellAction; |
| 60 |
QAction* m_niggliReduceAction; |
| 61 |
QAction* m_scaleVolumeAction; |
| 62 |
QAction* m_standardOrientationAction; |
| 63 |
QAction* m_toggleUnitCellAction; |
| 64 |
QAction* m_wrapAtomsToCellAction; |
| 65 |
}; |
| 66 |
|
| 67 |
inline QString Crystal::description() const |
| 68 |
{ |
| 69 |
return tr("Tools for crystal-specific editing/analysis."); |
| 70 |
} |
| 71 |
|
| 72 |
} // namespace QtPlugins |
| 73 |
} // namespace Avogadro |
| 74 |
|
| 75 |
#endif // AVOGADRO_QTPLUGINS_CRYSTAL_H |