| [c67518] | 1 | /*
|
|---|
| 2 | * GLMoleculeObject_molecule.hpp
|
|---|
| 3 | *
|
|---|
| 4 | * Created on: Mar 30, 2012
|
|---|
| 5 | * Author: ankele
|
|---|
| 6 | */
|
|---|
| 7 |
|
|---|
| 8 | #ifndef GLMOLECULEOBJECT_MOLECULE_HPP_
|
|---|
| 9 | #define GLMOLECULEOBJECT_MOLECULE_HPP_
|
|---|
| 10 |
|
|---|
| 11 | // include config.h
|
|---|
| 12 | #ifdef HAVE_CONFIG_H
|
|---|
| 13 | #include <config.h>
|
|---|
| 14 | #endif
|
|---|
| 15 |
|
|---|
| 16 | #include "GLMoleculeObject.hpp"
|
|---|
| 17 |
|
|---|
| [6c16a0] | 18 | #include <Qt3D/qgeometrydata.h>
|
|---|
| 19 |
|
|---|
| [494478] | 20 | #include "UIElements/Qt4/InstanceBoard/QtObservedMolecule.hpp"
|
|---|
| 21 |
|
|---|
| 22 | #include <map>
|
|---|
| 23 |
|
|---|
| [8688ef] | 24 | #include <boost/function.hpp>
|
|---|
| [7c7c4a] | 25 |
|
|---|
| [c67518] | 26 | #include "GLMoleculeObject_bond.hpp"
|
|---|
| 27 |
|
|---|
| [494478] | 28 | #include "types.hpp"
|
|---|
| [e39e7a] | 29 |
|
|---|
| [c67518] | 30 | class atom;
|
|---|
| 31 | class bond;
|
|---|
| [494478] | 32 | class molecule;
|
|---|
| [8c001a] | 33 | class GLMoleculeObject_atom;
|
|---|
| 34 | class GLWorldScene;
|
|---|
| [2f7988] | 35 | class QtObservedInstanceBoard;
|
|---|
| [c67518] | 36 |
|
|---|
| [494478] | 37 | class GLMoleculeObject_molecule : public GLMoleculeObject
|
|---|
| [c67518] | 38 | {
|
|---|
| 39 | Q_OBJECT
|
|---|
| 40 | public:
|
|---|
| [026bef] | 41 | GLMoleculeObject_molecule(
|
|---|
| 42 | QObject *parent,
|
|---|
| [1b07b1] | 43 | QtObservedMolecule::ptr &_ObservedMolecule);
|
|---|
| [026bef] | 44 | GLMoleculeObject_molecule(
|
|---|
| 45 | QGLSceneNode *mesh[],
|
|---|
| 46 | QObject *parent,
|
|---|
| [1b07b1] | 47 | QtObservedMolecule::ptr &_ObservedMolecule);
|
|---|
| [c67518] | 48 | virtual ~GLMoleculeObject_molecule();
|
|---|
| 49 |
|
|---|
| [8c001a] | 50 | void initialize(QGLView *view, QGLPainter *painter);
|
|---|
| 51 | void draw(QGLPainter *painter, const QVector4D &cameraPlane);
|
|---|
| 52 |
|
|---|
| 53 | typedef std::pair< atomId_t, atomId_t> BondIds;
|
|---|
| 54 | friend std::ostream &operator<<(std::ostream &ost, const BondIds &t);
|
|---|
| 55 |
|
|---|
| 56 | signals:
|
|---|
| 57 | void changed();
|
|---|
| 58 | void changeOccured();
|
|---|
| 59 |
|
|---|
| 60 | private slots:
|
|---|
| 61 | //!> grant GLWorldScene access to private slots
|
|---|
| 62 | friend class GLWorldScene;
|
|---|
| 63 |
|
|---|
| [34e7fdb] | 64 | void setVisible(bool value);
|
|---|
| 65 |
|
|---|
| [691533] | 66 | void setTesselationOutOfDate();
|
|---|
| [6c16a0] | 67 | void resetBoundingBox();
|
|---|
| [522c45] | 68 | void resetIndex();
|
|---|
| [5cd3a33] | 69 | void resetSelected();
|
|---|
| [015f8c] | 70 |
|
|---|
| [c67518] | 71 | private:
|
|---|
| [8c001a] | 72 |
|
|---|
| [96f14a] | 73 | void init();
|
|---|
| [494478] | 74 |
|
|---|
| [691533] | 75 | void resetTesselationHull();
|
|---|
| 76 |
|
|---|
| [494478] | 77 | private:
|
|---|
| 78 |
|
|---|
| 79 | QGeometryData updateTesselationHull() const;
|
|---|
| [6c16a0] | 80 |
|
|---|
| 81 | //!> contains current version of the tesselation hull on request
|
|---|
| [3fe318] | 82 | QGeometryData TesselationHull;
|
|---|
| [6c16a0] | 83 |
|
|---|
| [691533] | 84 | //!> simple flag that tells whether we need to recalc the hull or not
|
|---|
| 85 | bool TesselationUptodate;
|
|---|
| [8c001a] | 86 |
|
|---|
| [704d59] | 87 | atomId_t hoverAtomId;
|
|---|
| [8d5fbf1] | 88 |
|
|---|
| [494478] | 89 | QtObservedMolecule::ptr ObservedMolecule;
|
|---|
| [c67518] | 90 | };
|
|---|
| 91 |
|
|---|
| [8c001a] | 92 | std::ostream &operator<<(std::ostream &ost, const GLMoleculeObject_molecule::BondIds &t);
|
|---|
| [c67518] | 93 |
|
|---|
| 94 |
|
|---|
| 95 | #endif /* GLMOLECULEOBJECT_MOLECULE_HPP_ */
|
|---|