| 1 | /*
|
|---|
| 2 | * GLMoleculeObject_atom.hpp
|
|---|
| 3 | *
|
|---|
| 4 | * Created on: Aug 17, 2011
|
|---|
| 5 | * Author: heber
|
|---|
| 6 | */
|
|---|
| 7 |
|
|---|
| 8 | #ifndef GLMOLECULEOBJECT_ATOM_HPP_
|
|---|
| 9 | #define GLMOLECULEOBJECT_ATOM_HPP_
|
|---|
| 10 |
|
|---|
| 11 | // include config.h
|
|---|
| 12 | #ifdef HAVE_CONFIG_H
|
|---|
| 13 | #include <config.h>
|
|---|
| 14 | #endif
|
|---|
| 15 |
|
|---|
| 16 | #include "GLMoleculeObject.hpp"
|
|---|
| 17 |
|
|---|
| 18 | #include <vector>
|
|---|
| 19 | #include <boost/any.hpp>
|
|---|
| 20 |
|
|---|
| 21 | #include "CodePatterns/ObservedValue.hpp"
|
|---|
| 22 |
|
|---|
| 23 | #include "UIElements/Views/Qt4/Qt3D/GLMoleculeObject_bond.hpp"
|
|---|
| 24 | #include "UIElements/Qt4/InstanceBoard/QtObservedAtom.hpp"
|
|---|
| 25 | #include "types.hpp"
|
|---|
| 26 |
|
|---|
| 27 | class GLWorldScene;
|
|---|
| 28 | class QtObservedInstanceBoard;
|
|---|
| 29 |
|
|---|
| 30 | class GLMoleculeObject_atom : public GLMoleculeObject
|
|---|
| 31 | {
|
|---|
| 32 | Q_OBJECT
|
|---|
| 33 | public:
|
|---|
| 34 | GLMoleculeObject_atom(
|
|---|
| 35 | QGLSceneNode *mesh[],
|
|---|
| 36 | QGLSceneNode *mesharrow[],
|
|---|
| 37 | QObject *parent,
|
|---|
| 38 | QtObservedAtom::ptr &_ObservedAtom
|
|---|
| 39 | );
|
|---|
| 40 | virtual ~GLMoleculeObject_atom();
|
|---|
| 41 |
|
|---|
| 42 | void draw(QGLPainter *painter, const QVector4D &cameraPlane);
|
|---|
| 43 |
|
|---|
| 44 | private slots:
|
|---|
| 45 | void wasClicked();
|
|---|
| 46 | void resetIndex();
|
|---|
| 47 | void resetElement();
|
|---|
| 48 | void resetPosition();
|
|---|
| 49 | void resetVelocity();
|
|---|
| 50 | void resetForce();
|
|---|
| 51 | void resetSelected();
|
|---|
| 52 |
|
|---|
| 53 | signals:
|
|---|
| 54 | void clicked(atomId_t);
|
|---|
| 55 | void BondsAdded(const atomId_t _left, const atomId_t _right, const GLMoleculeObject_bond::SideOfBond side);
|
|---|
| 56 | void BondsRemoved(const atomId_t _left, const atomId_t _right);
|
|---|
| 57 | void indexChanged(GLMoleculeObject_atom*, const atomId_t _oldid, const atomId_t _newid);
|
|---|
| 58 |
|
|---|
| 59 | private:
|
|---|
| 60 | void init(const atomId_t _id);
|
|---|
| 61 |
|
|---|
| 62 | private:
|
|---|
| 63 | //!> internal GLMoleculeObject to represent the atom's velocity as an arrow
|
|---|
| 64 | GLMoleculeObject GLMoleculeObjectVelocity;
|
|---|
| 65 | //!> internal GLMoleculeObject to represent the atom's force as an arrow
|
|---|
| 66 | GLMoleculeObject GLMoleculeObjectForce;
|
|---|
| 67 |
|
|---|
| 68 | //!> current list of bonds to compare new onw against for changes
|
|---|
| 69 | QtObservedAtom::ListOfBonds_t ListOfBonds;
|
|---|
| 70 |
|
|---|
| 71 | QtObservedAtom::ptr ObservedAtom;
|
|---|
| 72 | };
|
|---|
| 73 |
|
|---|
| 74 |
|
|---|
| 75 |
|
|---|
| 76 | #endif /* GLMOLECULEOBJECT_ATOM_HPP_ */
|
|---|