| 1 | #ifndef detector_tree_H
|
|---|
| 2 | #define detector_tree_H 1
|
|---|
| 3 |
|
|---|
| 4 | // %%%%%%%%%%
|
|---|
| 5 | // Qt headers
|
|---|
| 6 | // %%%%%%%%%%
|
|---|
| 7 | #include <QTreeWidgetItem>
|
|---|
| 8 | #include <QAction>
|
|---|
| 9 | #include <QContextMenuEvent>
|
|---|
| 10 |
|
|---|
| 11 | // %%%%%%%%%%
|
|---|
| 12 | // G4 headers
|
|---|
| 13 | // %%%%%%%%%%
|
|---|
| 14 | #include "G4RunManager.hh"
|
|---|
| 15 | #include "G4VisManager.hh"
|
|---|
| 16 | #include "G4UImanager.hh"
|
|---|
| 17 |
|
|---|
| 18 | // %%%%%%%%%%%%%
|
|---|
| 19 | // gemc headers
|
|---|
| 20 | // %%%%%%%%%%%%%
|
|---|
| 21 | #include "detector.h"
|
|---|
| 22 | #include "usage.h"
|
|---|
| 23 |
|
|---|
| 24 |
|
|---|
| 25 | // %%%%%%%%%%%
|
|---|
| 26 | // C++ headers
|
|---|
| 27 | // %%%%%%%%%%%
|
|---|
| 28 | #include <string>
|
|---|
| 29 | #include <map>
|
|---|
| 30 | using namespace std;
|
|---|
| 31 |
|
|---|
| 32 | // %%%%%%%%%%%%%%%%
|
|---|
| 33 | // Class definition
|
|---|
| 34 | // %%%%%%%%%%%%%%%%
|
|---|
| 35 | class tree_item
|
|---|
| 36 | {
|
|---|
| 37 | public:
|
|---|
| 38 | tree_item(){;}
|
|---|
| 39 | ~tree_item(){;}
|
|---|
| 40 |
|
|---|
| 41 | public:
|
|---|
| 42 | string volume;
|
|---|
| 43 | string mother;
|
|---|
| 44 | QTreeWidgetItem *treeItem;
|
|---|
| 45 | int scanned;
|
|---|
| 46 | int exist;
|
|---|
| 47 | int visible;
|
|---|
| 48 | int wiresolid;
|
|---|
| 49 | };
|
|---|
| 50 |
|
|---|
| 51 |
|
|---|
| 52 | // %%%%%%%%%%%%%%%%
|
|---|
| 53 | // Class definition
|
|---|
| 54 | // %%%%%%%%%%%%%%%%
|
|---|
| 55 | class detector_tree : public QWidget
|
|---|
| 56 | {
|
|---|
| 57 | // metaobject required for non-qt slots
|
|---|
| 58 | Q_OBJECT
|
|---|
| 59 |
|
|---|
| 60 | public:
|
|---|
| 61 | detector_tree(){;}
|
|---|
| 62 | detector_tree(map<string, detector>*, gemc_opts, G4RunManager*, G4VisManager*, G4UImanager*, map<string, G4Material*>);
|
|---|
| 63 | ~detector_tree();
|
|---|
| 64 |
|
|---|
| 65 | gemc_opts gemcOpt;
|
|---|
| 66 | map<string, detector> *Hall_Map;
|
|---|
| 67 |
|
|---|
| 68 | map<string, tree_item> tree_map;
|
|---|
| 69 | map<string, tree_item> read_geometry(QTreeWidget *motherWidget);
|
|---|
| 70 | map<string, G4Material*> *MMats;
|
|---|
| 71 |
|
|---|
| 72 | QLinearGradient ActiveGrad;
|
|---|
| 73 | QLinearGradient NonActiveGrad;
|
|---|
| 74 | QLinearGradient NonVisibleGrad;
|
|---|
| 75 |
|
|---|
| 76 | QBrush ActiveBrush;
|
|---|
| 77 | QBrush NonActiveBrush;
|
|---|
| 78 | QBrush NonVisibleBrush;
|
|---|
| 79 |
|
|---|
| 80 | private:
|
|---|
| 81 | QTreeWidget *treeWidget;
|
|---|
| 82 | QAction *Switch_visibility;
|
|---|
| 83 | QAction *Switch_visibility_daughters;
|
|---|
| 84 | QAction *Switch_wiresolid;
|
|---|
| 85 | QAction *Switch_color;
|
|---|
| 86 | QAction *Edit_Detector;
|
|---|
| 87 |
|
|---|
| 88 | // passing G4 managers to QT so we can delete them when QT quits
|
|---|
| 89 | // and can access directly the UImanager
|
|---|
| 90 | G4RunManager *runManager;
|
|---|
| 91 | G4VisManager *visManager;
|
|---|
| 92 | G4UImanager *UImanager;
|
|---|
| 93 |
|
|---|
| 94 | private slots:
|
|---|
| 95 | void switch_visibility();
|
|---|
| 96 | void switch_visibility_daughters();
|
|---|
| 97 | void switch_wiresolid();
|
|---|
| 98 | void switch_color();
|
|---|
| 99 | void edit_detector();
|
|---|
| 100 |
|
|---|
| 101 | private:
|
|---|
| 102 | void createActions();
|
|---|
| 103 |
|
|---|
| 104 | };
|
|---|
| 105 |
|
|---|
| 106 | #endif
|
|---|