/
packmolextension.h
82 lines (60 loc) · 2.24 KB
/
packmolextension.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
/**********************************************************************
PackmolExtension - Hydrogens Plugin for Avogadro
Copyright (C) 2010 by Tim Vandermeersch
This file is part of the Avogadro molecular editor project.
For more information, see <http://avogadro.openmolecules.net/>
Some code is based on Open Babel
For more information, see <http://openbabel.sourceforge.net/>
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation version 2 of the License.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
***********************************************************************/
#ifndef PACKMOLEXTENSION_H
#define PACKMOLEXTENSION_H
#include <avogadro/glwidget.h>
#include <avogadro/extension.h>
#include <avogadro/idlist.h>
#include <QObject>
#include <QList>
#include <QString>
#include <QUndoCommand>
namespace Avogadro {
class PackmolDialog;
class PackmolExtension : public Extension
{
Q_OBJECT
AVOGADRO_EXTENSION("Packmol", tr("Packmol"),
tr("Create complex input systems for MD"))
public:
//! Constructor
PackmolExtension(QObject *parent=0);
//! Deconstructor
virtual ~PackmolExtension();
//! Perform Action
virtual QList<QAction *> actions() const;
virtual QUndoCommand* performAction(QAction *action, GLWidget *widget);
virtual QString menuPath(QAction *action) const;
//@}
void setMolecule(Molecule *molecule);
void writeSettings(QSettings &settings) const;
void readSettings(QSettings &settings);
public slots:
void resultsReady(Molecule*);
private:
void createDialog();
QList<QAction *> m_actions;
Molecule *m_molecule;
PackmolDialog *m_dialog;
};
class PackmolExtensionFactory : public QObject, public PluginFactory
{
Q_OBJECT
Q_INTERFACES(Avogadro::PluginFactory)
AVOGADRO_EXTENSION_FACTORY(PackmolExtension)
};
} // end namespace Avogadro
#endif