1 | /*
|
---|
2 | * MoleculeView.hpp
|
---|
3 | *
|
---|
4 | * Created on: Mar 4, 2010
|
---|
5 | * Author: crueger
|
---|
6 | */
|
---|
7 |
|
---|
8 | #ifndef QTINFOBOX_HPP_
|
---|
9 | #define QTINFOBOX_HPP_
|
---|
10 |
|
---|
11 | // include config.h
|
---|
12 | #ifdef HAVE_CONFIG_H
|
---|
13 | #include <config.h>
|
---|
14 | #endif
|
---|
15 |
|
---|
16 |
|
---|
17 | #include <string>
|
---|
18 | #include <QtGui/QTabWidget>
|
---|
19 | #include <QtGui/QTreeWidget>
|
---|
20 | #include <QTimer>
|
---|
21 |
|
---|
22 | #include "UIElements/Qt4/InstanceBoard/QtObservedAtom.hpp"
|
---|
23 | #include "UIElements/Qt4/InstanceBoard/QtObservedMolecule.hpp"
|
---|
24 |
|
---|
25 | #include <boost/thread/recursive_mutex.hpp>
|
---|
26 |
|
---|
27 | #include "types.hpp"
|
---|
28 |
|
---|
29 | class periodentafel;
|
---|
30 |
|
---|
31 | // Forwarding of the Tab-Pages
|
---|
32 | class QtAtomInfoPage;
|
---|
33 | class QtMoleculeInfoPage;
|
---|
34 |
|
---|
35 | class QtObservedInstanceBoard;
|
---|
36 |
|
---|
37 | class QtInfoBox : public QTabWidget
|
---|
38 | {
|
---|
39 | Q_OBJECT
|
---|
40 | public:
|
---|
41 | QtInfoBox(QtObservedInstanceBoard *_board, QWidget *_parent = NULL);
|
---|
42 | virtual ~QtInfoBox();
|
---|
43 |
|
---|
44 | void showAtom(const atomId_t _id);
|
---|
45 | void showMolecule(const moleculeId_t _id);
|
---|
46 |
|
---|
47 | public slots:
|
---|
48 | void atomHover(const atomId_t _id);
|
---|
49 | void moleculeHover(const moleculeId_t _id);
|
---|
50 | void timerTimeout();
|
---|
51 |
|
---|
52 | void clearAtomTab();
|
---|
53 | void clearMoleculeTab();
|
---|
54 |
|
---|
55 | private:
|
---|
56 | atomId_t curAtomId;
|
---|
57 | atomId_t nextAtomId;
|
---|
58 | moleculeId_t curMoleculeId;
|
---|
59 | moleculeId_t nextMoleculeId;
|
---|
60 | QtMoleculeInfoPage *page_mol;
|
---|
61 | QtAtomInfoPage *page_atom;
|
---|
62 |
|
---|
63 | mutable boost::recursive_mutex tabs_mutex;
|
---|
64 |
|
---|
65 | QTimer *timer;
|
---|
66 |
|
---|
67 | QtObservedInstanceBoard *board;
|
---|
68 |
|
---|
69 | int currentPage;
|
---|
70 |
|
---|
71 | periodentafel *periode;
|
---|
72 | };
|
---|
73 |
|
---|
74 | /**
|
---|
75 | * Widget to display the tab page for a single atom
|
---|
76 | */
|
---|
77 | class QtAtomInfoPage : public QTreeWidget
|
---|
78 | {
|
---|
79 | Q_OBJECT
|
---|
80 | public:
|
---|
81 | QtAtomInfoPage(QtObservedAtom::ptr &_atom, periodentafel *_periode, QWidget *parent);
|
---|
82 | virtual ~QtAtomInfoPage();
|
---|
83 |
|
---|
84 | private slots:
|
---|
85 | void updatePage();
|
---|
86 |
|
---|
87 | private:
|
---|
88 | QtObservedAtom::ptr atomRef;
|
---|
89 | periodentafel *periode;
|
---|
90 | QTreeWidget *info;
|
---|
91 | };
|
---|
92 |
|
---|
93 | /**
|
---|
94 | * Widget to display the tab page for a single molecule
|
---|
95 | */
|
---|
96 | class QtMoleculeInfoPage : public QTreeWidget
|
---|
97 | {
|
---|
98 | Q_OBJECT
|
---|
99 | public:
|
---|
100 | QtMoleculeInfoPage(QtObservedMolecule::ptr &_mol, QWidget *parent);
|
---|
101 | virtual ~QtMoleculeInfoPage();
|
---|
102 |
|
---|
103 | private slots:
|
---|
104 | void updatePage();
|
---|
105 |
|
---|
106 | private:
|
---|
107 | QtObservedMolecule::ptr mol;
|
---|
108 | QTreeWidget *info;
|
---|
109 | };
|
---|
110 | #endif /* QTINFOBOX_HPP_ */
|
---|