source: trunk/examples/novice/gemc/src/detector_tree.h@ 1305

Last change on this file since 1305 was 807, checked in by garnier, 17 years ago

update

File size: 2.0 KB
Line 
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>
30using namespace std;
31
32// %%%%%%%%%%%%%%%%
33// Class definition
34// %%%%%%%%%%%%%%%%
35class 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// %%%%%%%%%%%%%%%%
55class 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
Note: See TracBrowser for help on using the repository browser.