g4display
Loading...
Searching...
No Matches
g4displayview.h
Go to the documentation of this file.
1#pragma once
2
13// Qt
14#include <QtWidgets>
15
16// gemc
17#include <gemc/glogging/glogger.h>
18#include <gemc/gqtbuttonswidget/gQtButtonsWidget.h> // Custom toggle button widget
19
37class G4DisplayView : public QWidget
38{
39 Q_OBJECT
40
41public:
53 G4DisplayView(const std::shared_ptr<GOptions>& gopts,
54 std::shared_ptr<GLogger> logger,
55 QWidget* parent = nullptr);
56
62 ~G4DisplayView() override { log->debug(DESTRUCTOR, "G4DisplayView"); }
63
64private:
65 // --- Member widgets (owned by Qt via parenting) ---
66
68 QLineEdit* field_npoints = nullptr;
69
71 GQTToggleButtonWidget* buttons_set1 = nullptr;
72
74 QSlider* cameraTheta = nullptr;
75 QSlider* cameraPhi = nullptr;
76 QLCDNumber* thetaLCD = nullptr;
77 QLCDNumber* phiLCD = nullptr;
78
80 QComboBox* thetaDropdown = nullptr;
81 QComboBox* phiDropdown = nullptr;
82
84 QLCDNumber* lthetaLCD = nullptr;
85 QLCDNumber* lphiLCD = nullptr;
86
88 QComboBox* lthetaDropdown = nullptr;
89 QComboBox* lphiDropdown = nullptr;
90
92 QComboBox* perspectiveDropdown = nullptr;
93 QComboBox* precisionDropdown = nullptr;
94 QComboBox* cullingDropdown = nullptr;
95 QComboBox* backgroundColorDropdown = nullptr;
96 QToolButton* backgroundColorButton = nullptr;
97 QSpinBox* cloudPointsSpinBox = nullptr;
98
100 QSlider* explodeSlider = nullptr;
101 QLabel* explodeValueLabel = nullptr;
102 QComboBox* explodeIntensityDropdown = nullptr;
103
105 QSlider* lightTheta = nullptr;
106 QSlider* lightPhi = nullptr;
107
109 QLineEdit* sliceXEdit = nullptr;
110 QLineEdit* sliceYEdit = nullptr;
111 QLineEdit* sliceZEdit = nullptr;
112
114 QCheckBox* sliceXActi = nullptr;
115 QCheckBox* sliceYActi = nullptr;
116 QCheckBox* sliceZActi = nullptr;
117
119 QCheckBox* sliceXInve = nullptr;
120 QCheckBox* sliceYInve = nullptr;
121 QCheckBox* sliceZInve = nullptr;
122
124 QRadioButton* sliceSectn = nullptr;
125 QRadioButton* sliceUnion = nullptr;
126
127 // --- Member data ---
128
130 int field_NPOINTS = 5;
131
133 QColor backgroundColor;
134
136 int cloudPoints = 1000;
137
139 std::shared_ptr<GOptions> gopts;
140
146 std::shared_ptr<GLogger> log;
147
148 void setBackgroundButtonColor(const QColor& color);
149 void setBackgroundDropdownColor(const QColor& color);
150
153 void syncViewToOptions();
154
155private slots:
165 void changeCameraDirection();
166
177 void setCameraDirection(int which);
178
188 void changeLightDirection();
189
199 void setLightDirection(int which);
200
210 void set_projection();
211
222 void set_precision();
223
230 void set_culling();
231
240 void set_background();
241
245 void choose_background_color();
246
250 void set_cloud_points();
251
262 void set_explode();
263
270 void slice();
271
277 void clearSlices();
278
288 void apply_buttons_set1(int index);
289
298 void readCameraFromViewer();
299
306 void field_precision_changed();
307
308protected:
309 void showEvent(QShowEvent* event) override;
310};
“View” tab for G4Display.
G4DisplayView(const std::shared_ptr< GOptions > &gopts, std::shared_ptr< GLogger > logger, QWidget *parent=nullptr)
Construct the view-control tab.
~G4DisplayView() override
Destructor.
void showEvent(QShowEvent *event) override
void debug(debug_type type, Args &&... args) const
DESTRUCTOR