| 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_CONSTRAINTSDIALOG_H |
| 7 |
#define AVOGADRO_QTPLUGINS_CONSTRAINTSDIALOG_H |
| 8 |
|
| 9 |
#include "constraintsmodel.h" |
| 10 |
|
| 11 |
#include <QDialog> |
| 12 |
|
| 13 |
namespace Avogadro { |
| 14 |
namespace QtPlugins { |
| 15 |
|
| 16 |
namespace Ui { |
| 17 |
class ConstraintsDialog; |
| 18 |
} |
| 19 |
|
| 20 |
class ConstraintsDialog : public QDialog |
| 21 |
{ |
| 22 |
Q_OBJECT |
| 23 |
|
| 24 |
public: |
| 25 |
explicit ConstraintsDialog(QWidget* parent_ = nullptr, |
| 26 |
Qt::WindowFlags f = Qt::WindowFlags()); |
| 27 |
~ConstraintsDialog() override; |
| 28 |
|
| 29 |
void setMolecule(QtGui::Molecule* molecule); |
| 30 |
|
| 31 |
public slots: |
| 32 |
void acceptConstraints(); |
| 33 |
void addConstraint(); |
| 34 |
void getConstraint(); |
| 35 |
void deleteConstraint(); |
| 36 |
void deleteAllConstraints(); |
| 37 |
void highlightSelected(const QModelIndex& newIndex, |
| 38 |
const QModelIndex& oldIndex); |
| 39 |
|
| 40 |
void changeType(int type); |
| 41 |
|
| 42 |
void updateConstraints(); |
| 43 |
|
| 44 |
private: |
| 45 |
Ui::ConstraintsDialog* ui; |
| 46 |
ConstraintsModel* m_model; |
| 47 |
QtGui::Molecule* m_molecule = nullptr; |
| 48 |
}; |
| 49 |
|
| 50 |
} // namespace QtPlugins |
| 51 |
} // namespace Avogadro |
| 52 |
#endif // AVOGADRO_QTPLUGINS_CONSTRAINTSDIALOG_H |