Debian Codegraph @

avogadro/qtplugins/ballandstick/ballandstick.h

raw symbols SCIP
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_BALLANDSTICK_H
7 #define AVOGADRO_QTPLUGINS_BALLANDSTICK_H
8
9 #include <avogadro/qtgui/sceneplugin.h>
10
11 namespace Avogadro::QtPlugins {
12
13 /**
14 * @brief Render a molecule in the ball and stick style.
15 * @author Allison Vacanti
16 */
17 class BallAndStick : public QtGui::ScenePlugin
18 {
19 Q_OBJECT
20
21 public:
22 explicit BallAndStick(QObject* parent = nullptr);
23 ~BallAndStick() override;
24
25 void process(const QtGui::Molecule& molecule,
26 Rendering::GroupNode& node) override;
27
28 QString name() const override { return tr("Ball and Stick"); }
29
30 QString description() const override
31 {
32 return tr("Render atoms as spheres and bonds as cylinders.");
33 }
34
35 QWidget* setupWidget() override;
36 bool hasSetupWidget() const override { return true; }
37
38 DefaultBehavior defaultBehavior() const override
39 {
40 return DefaultBehavior::True;
41 }
42
43 public slots:
44 void atomRadiusChanged(int value);
45 void bondRadiusChanged(int value);
46 void multiBonds(bool show);
47 void showHydrogens(bool show);
48 void opacityChanged(int value);
49
50 private:
51 Rendering::GroupNode* m_group;
52 std::string m_name = "Ball and Stick";
53 float m_atomScale = 0.3f;
54 float m_bondRadius = 0.1f;
55 float m_opacity = 1.0f;
56 };
57
58 } // end namespace Avogadro::QtPlugins
59
60 #endif // AVOGADRO_QTPLUGINS_BALLANDSTICK_H