| 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_CRYSTALSCENE_H |
| 7 |
#define AVOGADRO_QTPLUGINS_CRYSTALSCENE_H |
| 8 |
|
| 9 |
#include <avogadro/core/vector.h> |
| 10 |
#include <avogadro/qtgui/sceneplugin.h> |
| 11 |
|
| 12 |
#include <QtGui/QColor> |
| 13 |
|
| 14 |
namespace Avogadro { |
| 15 |
namespace QtPlugins { |
| 16 |
|
| 17 |
/** |
| 18 |
* @brief Render the unit cell boundaries. |
| 19 |
*/ |
| 20 |
class CrystalScene : public QtGui::ScenePlugin |
| 21 |
{ |
| 22 |
Q_OBJECT |
| 23 |
|
| 24 |
public: |
| 25 |
explicit CrystalScene(QObject* parent = nullptr); |
| 26 |
~CrystalScene() override; |
| 27 |
|
| 28 |
void process(const QtGui::Molecule& molecule, |
| 29 |
Rendering::GroupNode& node) override; |
| 30 |
|
| 31 |
QString name() const override { return tr("Crystal Lattice"); } |
| 32 |
|
| 33 |
QString description() const override |
| 34 |
{ |
| 35 |
return tr("Render the unit cell boundaries."); |
| 36 |
} |
| 37 |
|
| 38 |
QWidget* setupWidget() override; |
| 39 |
bool hasSetupWidget() const override { return true; } |
| 40 |
|
| 41 |
private slots: |
| 42 |
void setColor(const QColor& color); |
| 43 |
void setLineWidth(double width); |
| 44 |
void setMultiColor(bool multiColor); |
| 45 |
|
| 46 |
private: |
| 47 |
std::string m_name = "Crystal Lattice"; |
| 48 |
|
| 49 |
QWidget* m_setupWidget; |
| 50 |
float m_lineWidth; |
| 51 |
Vector3ub m_color; |
| 52 |
bool m_multiColor; |
| 53 |
}; |
| 54 |
|
| 55 |
} // end namespace QtPlugins |
| 56 |
} // end namespace Avogadro |
| 57 |
|
| 58 |
#endif // AVOGADRO_QTPLUGINS_CRYSTALSCENE_H |