/****************************************************************************** This source file is part of the Avogadro project. This source code is released under the 3-Clause BSD License, (see "LICENSE"). ******************************************************************************/ #ifndef CONSTRAINTSMODEL_H #define CONSTRAINTSMODEL_H #include #include #include #include #include #include namespace Avogadro { namespace QtPlugins { class ConstraintsModel : public QAbstractTableModel { Q_OBJECT public: ConstraintsModel() : QAbstractTableModel() {} int rowCount(const QModelIndex& parent = QModelIndex()) const override; int columnCount(const QModelIndex& parent = QModelIndex()) const override; QVariant data(const QModelIndex& index, int role) const override; QVariant headerData(int section, Qt::Orientation orientation, int role = Qt::DisplayRole) const override; void clear(); Core::Constraint constraint(int index); std::vector constraints() { return m_constraints; } void addConstraint(int type, int a, int b, int c, int d, double value); void deleteConstraint(int index); void setConstraints(const std::vector& constraints); int currentRow = -1; public slots: void emitDataChanged(); private: std::vector m_constraints; }; // ConstraintsModel } // namespace QtPlugins } // end namespace Avogadro #endif