| 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_LICORICE_H |
| 7 |
#define AVOGADRO_QTPLUGINS_LICORICE_H |
| 8 |
|
| 9 |
#include <avogadro/qtgui/sceneplugin.h> |
| 10 |
|
| 11 |
namespace Avogadro { |
| 12 |
namespace QtPlugins { |
| 13 |
|
| 14 |
/** |
| 15 |
* @brief Render a molecule in the licorice style. |
| 16 |
* @author Marcus D. Hanwell |
| 17 |
*/ |
| 18 |
class Licorice : public QtGui::ScenePlugin |
| 19 |
{ |
| 20 |
Q_OBJECT |
| 21 |
|
| 22 |
public: |
| 23 |
explicit Licorice(QObject* parent = nullptr); |
| 24 |
~Licorice() override; |
| 25 |
|
| 26 |
void process(const QtGui::Molecule& molecule, |
| 27 |
Rendering::GroupNode& node) override; |
| 28 |
|
| 29 |
QString name() const override |
| 30 |
{ |
| 31 |
return tr("Licorice", "stick / licorice rendering"); |
| 32 |
} |
| 33 |
|
| 34 |
QString description() const override |
| 35 |
{ |
| 36 |
return tr("Render atoms as licorice / sticks."); |
| 37 |
} |
| 38 |
|
| 39 |
DefaultBehavior defaultBehavior() const override |
| 40 |
{ |
| 41 |
return DefaultBehavior::False; |
| 42 |
} |
| 43 |
|
| 44 |
QWidget* setupWidget() override; |
| 45 |
bool hasSetupWidget() const override { return true; } |
| 46 |
|
| 47 |
public slots: |
| 48 |
void setOpacity(int opacity); |
| 49 |
|
| 50 |
private: |
| 51 |
std::string m_name = "Licorice"; |
| 52 |
QWidget* m_setupWidget = nullptr; |
| 53 |
float m_opacity = 1.0; |
| 54 |
}; |
| 55 |
|
| 56 |
} // end namespace QtPlugins |
| 57 |
} // end namespace Avogadro |
| 58 |
|
| 59 |
#endif // AVOGADRO_QTPLUGINS_LICORICE_H |