| 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_NONCOVALENT_H |
| 7 |
#define AVOGADRO_QTPLUGINS_NONCOVALENT_H |
| 8 |
|
| 9 |
#include <avogadro/core/vector.h> |
| 10 |
#include <avogadro/qtgui/sceneplugin.h> |
| 11 |
|
| 12 |
namespace Avogadro { |
| 13 |
namespace QtPlugins { |
| 14 |
|
| 15 |
/** |
| 16 |
* @brief Predict some non-covalent interactions, like hydrogen bonds. |
| 17 |
* @author Aritz Erkiaga |
| 18 |
*/ |
| 19 |
class NonCovalent : public QtGui::ScenePlugin |
| 20 |
{ |
| 21 |
Q_OBJECT |
| 22 |
|
| 23 |
public: |
| 24 |
explicit NonCovalent(QObject* parent = nullptr); |
| 25 |
~NonCovalent() override; |
| 26 |
|
| 27 |
void process(const QtGui::Molecule& molecule, |
| 28 |
Rendering::GroupNode& node) override; |
| 29 |
|
| 30 |
QString name() const override { return tr("Non-Covalent"); } |
| 31 |
|
| 32 |
QString description() const override |
| 33 |
{ |
| 34 |
return tr("Render a few non-covalent interactions."); |
| 35 |
} |
| 36 |
|
| 37 |
QWidget* setupWidget() override; |
| 38 |
bool hasSetupWidget() const override { return true; } |
| 39 |
|
| 40 |
DefaultBehavior defaultBehavior() const override |
| 41 |
{ |
| 42 |
return DefaultBehavior::False; |
| 43 |
} |
| 44 |
|
| 45 |
public slots: |
| 46 |
void setAngleTolerance(float angleTolerance, Index index); |
| 47 |
void setMaximumDistance(float maximumDistance, Index index); |
| 48 |
void setLineWidth(float width, Index index); |
| 49 |
|
| 50 |
private: |
| 51 |
const std::string m_name = "Non-Covalent"; |
| 52 |
|
| 53 |
std::array<double, 3> m_angleTolerancesDegrees; |
| 54 |
std::array<double, 3> m_maximumDistances; |
| 55 |
std::array<Vector3ub, 3> m_lineColors; |
| 56 |
std::array<float, 3> m_lineWidths; |
| 57 |
}; |
| 58 |
|
| 59 |
} // end namespace QtPlugins |
| 60 |
} // end namespace Avogadro |
| 61 |
|
| 62 |
#endif // AVOGADRO_QTPLUGINS_NONCOVALENT_H |