source: trunk/examples/novice/gemc/src/gemc_MainGui.h@ 1354

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

update

File size: 2.1 KB
Line 
1#ifndef gemc_MAINGUI_H
2#define gemc_MAINGUI_H
3
4// %%%%%%%%%%
5// Qt headers
6// %%%%%%%%%%
7#include <QComboBox>
8#include <QGroupBox>
9#include <QLCDNumber>
10#include <QLineEdit>
11#include <QObject>
12#include <QPushButton>
13#include <QSlider>
14#include <QVBoxLayout>
15#include <QWidget>
16
17// %%%%%%%%%%
18// G4 headers
19// %%%%%%%%%%
20#include "G4Material.hh"
21#include "G4RunManager.hh"
22#include "G4VisManager.hh"
23#include "G4UImanager.hh"
24
25// %%%%%%%%%%%%%
26// gemc headers
27// %%%%%%%%%%%%%
28#include "detector_tree.h"
29#include "usage.h"
30
31// %%%%%%%%%%%%%%%%
32// Class definition
33// %%%%%%%%%%%%%%%%
34class gemcMainWidget : public QWidget
35{
36 // metaobject required for non-qt slots
37 Q_OBJECT
38
39 public:
40 gemcMainWidget(G4RunManager*, G4VisManager*, G4UImanager*);
41 ~gemcMainWidget();
42
43 map<string, detector> *Hall_Map;
44 map<string, G4Material*> *MMats;
45 gemc_opts gemcOpt;
46
47 private:
48 QLineEdit *ManualCommandQLineEdit;
49 QComboBox *ManualCommandBox;
50 QPushButton *MainButtons[8];
51 QPushButton *PanButtons[4];
52 QVBoxLayout *VMainButtons;
53
54 // The timer will periodically update theta_hall, phi_hall if they're changed with the mouse
55 QTimer *timer ;
56
57 // Transformations
58 int theta_hall, phi_hall;
59 double zoom_value;
60
61 QGroupBox *TransfGro[5];
62 QVBoxLayout *TransfLay[5];
63 QSlider *TransfSli[3];
64 QSlider *PanFactorSl;
65
66 QLCDNumber *Theta_V;
67 QLCDNumber *Phi_V;
68
69 QComboBox *ThetaCombo;
70 QComboBox *PhiCombo;
71 vector<string> ThetaSet;
72 vector<string> PhiSet;
73
74
75 // passing G4 managers to QT so we can delete them when QT quits
76 // and can access directly the UImanager
77 G4RunManager *runManager;
78 G4VisManager *visManager;
79 G4UImanager *UImanager;
80
81 detector_tree *DTree;
82
83 private slots:
84
85 // Command Box
86 void RunManualCommand();
87
88 // Transformations
89 void clickpan_left();
90 void clickpan_right();
91 void clickpan_up();
92 void clickpan_down();
93 void change_theta(int);
94 void set_theta(int);
95 void change_phi(int);
96 void set_phi(int);
97 void zoom(int);
98 void beamOn();
99
100 void update_angles();
101
102 // Tree
103 void Build_DTree();
104};
105
106#endif
107
108
109
Note: See TracBrowser for help on using the repository browser.