60 std::shared_ptr<GLogger> logger,
62 : QWidget(parent), gopts(gopts), log(logger) {
67 flcd.setFamilies({
"Helvetica"});
68 flcd.setPointSize(24);
79 backgroundColor = colorFromG4Rgb(g4view.
background);
84 vector<string> toggle_button_titles;
85 toggle_button_titles.emplace_back(
"");
86 toggle_button_titles.emplace_back(
"");
87 toggle_button_titles.emplace_back(
"");
88 toggle_button_titles.emplace_back(
"");
93 buttons_set1->
setSvgButtonIcon(0,
":/images/hidden_lines.svg", QSize(120, 120));
94 buttons_set1->
setSvgButtonIcon(1,
":/images/anti_aliasing.svg", QSize(120, 120));
95 buttons_set1->
setSvgButtonIcon(2,
":/images/auxiliary_edges.svg", QSize(120, 120));
96 buttons_set1->
setSvgButtonIcon(3,
":/images/field_lines.svg", QSize(120, 120));
99 QStringList theta_angle_Set;
100 for (
int t = 0; t <= 180; t += 30) { theta_angle_Set << QString::number(t); }
101 QStringList phi_angle_Set;
102 for (
int t = 0; t <= 360; t += 30) { phi_angle_Set << QString::number(t); }
108 cameraTheta =
new QSlider(Qt::Horizontal);
109 cameraTheta->setRange(0, 180);
110 cameraTheta->setSingleStep(1);
111 cameraTheta->setValue(thetaValue);
112 cameraTheta->setTracking(
true);
114 auto cameraThetaLabel =
new QLabel(tr(
"θ"));
116 thetaLCD =
new QLCDNumber(
this);
117 thetaLCD->setFont(flcd);
118 thetaLCD->setMaximumSize(QSize(42, 32));
119 thetaLCD->setSegmentStyle(QLCDNumber::Flat);
121 thetaDropdown =
new QComboBox(
this);
122 thetaDropdown->addItems(theta_angle_Set);
123 thetaDropdown->setMaximumSize(QSize(100, 45));
125 auto cameraThetaLayout =
new QHBoxLayout;
126 cameraThetaLayout->setContentsMargins(0, 0, 0, 0);
127 cameraThetaLayout->setSpacing(4);
128 cameraThetaLayout->addWidget(cameraThetaLabel);
129 cameraThetaLayout->addWidget(cameraTheta);
130 cameraThetaLayout->addWidget(thetaLCD);
131 cameraThetaLayout->addWidget(thetaDropdown);
133 cameraPhi =
new QSlider(Qt::Horizontal);
134 cameraPhi->setRange(0, 360);
135 cameraPhi->setSingleStep(1);
136 cameraPhi->setValue(phiValue);
137 cameraPhi->setTracking(
true);
139 auto cameraPhiLabel =
new QLabel(tr(
"ɸ"));
141 phiLCD =
new QLCDNumber(
this);
142 phiLCD->setFont(flcd);
143 phiLCD->setMaximumSize(QSize(42, 32));
144 phiLCD->setSegmentStyle(QLCDNumber::Flat);
146 phiDropdown =
new QComboBox(
this);
147 phiDropdown->addItems(phi_angle_Set);
148 phiDropdown->setMaximumSize(QSize(100, 45));
150 auto cameraPhiLayout =
new QHBoxLayout;
151 cameraPhiLayout->setContentsMargins(0, 0, 0, 0);
152 cameraPhiLayout->setSpacing(4);
153 cameraPhiLayout->addWidget(cameraPhiLabel);
154 cameraPhiLayout->addWidget(cameraPhi);
155 cameraPhiLayout->addWidget(phiLCD);
156 cameraPhiLayout->addWidget(phiDropdown);
158 auto* readViewButton =
new QPushButton(tr(
"Read View"),
this);
159 readViewButton->setToolTip(tr(
"Sync sliders to current viewer orientation"));
160 auto* readViewRow =
new QHBoxLayout;
161 readViewRow->setContentsMargins(0, 0, 0, 0);
162 readViewRow->addStretch(1);
163 readViewRow->addWidget(readViewButton);
165 QVBoxLayout* cameraDirectionLayout =
new QVBoxLayout;
166 cameraDirectionLayout->setContentsMargins(6, 6, 6, 6);
167 cameraDirectionLayout->setSpacing(2);
168 cameraDirectionLayout->addLayout(cameraThetaLayout);
169 cameraDirectionLayout->addLayout(cameraPhiLayout);
170 cameraDirectionLayout->addLayout(readViewRow);
172 QGroupBox* cameraAnglesGroup =
new QGroupBox(tr(
"Camera Direction"));
173 cameraAnglesGroup->setLayout(cameraDirectionLayout);
176 connect(cameraTheta, &QSlider::valueChanged,
this, &G4DisplayView::changeCameraDirection);
177 connect(cameraTheta, &QSlider::valueChanged, thetaLCD, qOverload<int>(&QLCDNumber::display));
180 connect(thetaDropdown, &QComboBox::currentTextChanged,
181 this, [
this](
const QString&) { setCameraDirection(0); });
183 connect(cameraPhi, &QSlider::valueChanged,
this, &G4DisplayView::changeCameraDirection);
184 connect(cameraPhi, &QSlider::valueChanged, phiLCD, qOverload<int>(&QLCDNumber::display));
186 connect(phiDropdown, &QComboBox::currentTextChanged,
187 this, [
this](
const QString&) { setCameraDirection(1); });
189 connect(readViewButton, &QPushButton::clicked,
this, &G4DisplayView::readCameraFromViewer);
196 QLabel* projLabel =
new QLabel(tr(
"Projection:"));
197 perspectiveDropdown =
new QComboBox;
198 perspectiveDropdown->addItem(tr(
"Orthogonal"));
199 perspectiveDropdown->addItem(tr(
"Perspective 30"));
200 perspectiveDropdown->addItem(tr(
"Perspective 45"));
201 perspectiveDropdown->addItem(tr(
"Perspective 60"));
204 QLabel* sides_per_circlesLabel =
new QLabel(tr(
"Sides per circle:"));
205 precisionDropdown =
new QComboBox;
206 precisionDropdown->addItem(tr(
"50"));
207 precisionDropdown->addItem(tr(
"100"));
208 precisionDropdown->addItem(tr(
"200"));
209 precisionDropdown->addItem(tr(
"300"));
210 precisionDropdown->setCurrentIndex(0);
212 connect(perspectiveDropdown, &QComboBox::currentTextChanged,
this, &G4DisplayView::set_projection);
213 connect(precisionDropdown, &QComboBox::currentTextChanged,
this, &G4DisplayView::set_precision);
215 QVBoxLayout* resolutionAndPerspectiveLayout =
new QVBoxLayout;
216 resolutionAndPerspectiveLayout->setContentsMargins(6, 6, 6, 6);
217 resolutionAndPerspectiveLayout->setSpacing(4);
218 resolutionAndPerspectiveLayout->addWidget(projLabel);
219 resolutionAndPerspectiveLayout->addWidget(perspectiveDropdown);
220 resolutionAndPerspectiveLayout->addWidget(sides_per_circlesLabel);
221 resolutionAndPerspectiveLayout->addWidget(precisionDropdown);
223 QGroupBox* propertyGroup =
new QGroupBox(tr(
"View Properties"));
224 propertyGroup->setLayout(resolutionAndPerspectiveLayout);
226 QHBoxLayout* cameraAndPerspective =
new QHBoxLayout;
227 cameraAndPerspective->setContentsMargins(0, 0, 0, 0);
228 cameraAndPerspective->setSpacing(6);
229 cameraAndPerspective->addWidget(cameraAnglesGroup);
230 cameraAndPerspective->addWidget(propertyGroup);
236 lightTheta =
new QSlider(Qt::Horizontal);
237 lightTheta->setRange(0, 180);
238 lightTheta->setSingleStep(1);
239 lightTheta->setValue(lightThetaValue);
240 lightTheta->setTracking(
true);
242 auto lightThetaLabel =
new QLabel(tr(
"θ"));
244 lthetaLCD =
new QLCDNumber(
this);
245 lthetaLCD->setFont(flcd);
246 lthetaLCD->setMaximumSize(QSize(42, 32));
247 lthetaLCD->setSegmentStyle(QLCDNumber::Flat);
249 lthetaDropdown =
new QComboBox(
this);
250 lthetaDropdown->addItems(theta_angle_Set);
251 lthetaDropdown->setMaximumSize(QSize(100, 45));
253 auto lightThetaLayout =
new QHBoxLayout;
254 lightThetaLayout->setContentsMargins(0, 0, 0, 0);
255 lightThetaLayout->setSpacing(4);
256 lightThetaLayout->addWidget(lightThetaLabel);
257 lightThetaLayout->addWidget(lightTheta);
258 lightThetaLayout->addWidget(lthetaLCD);
259 lightThetaLayout->addWidget(lthetaDropdown);
261 lightPhi =
new QSlider(Qt::Horizontal);
262 lightPhi->setRange(0, 360);
263 lightPhi->setSingleStep(1);
264 lightPhi->setValue(lightPhiValue);
265 lightPhi->setTracking(
true);
267 auto lightPhiLabel =
new QLabel(tr(
"ɸ"));
269 lphiLCD =
new QLCDNumber(
this);
270 lphiLCD->setFont(flcd);
271 lphiLCD->setMaximumSize(QSize(42, 32));
272 lphiLCD->setSegmentStyle(QLCDNumber::Flat);
274 lphiDropdown =
new QComboBox(
this);
275 lphiDropdown->addItems(phi_angle_Set);
276 lphiDropdown->setMaximumSize(QSize(100, 45));
278 auto lightPhiLayout =
new QHBoxLayout;
279 lightPhiLayout->setContentsMargins(0, 0, 0, 0);
280 lightPhiLayout->setSpacing(4);
281 lightPhiLayout->addWidget(lightPhiLabel);
282 lightPhiLayout->addWidget(lightPhi);
283 lightPhiLayout->addWidget(lphiLCD);
284 lightPhiLayout->addWidget(lphiDropdown);
286 auto lightDirectionLayout =
new QVBoxLayout;
287 lightDirectionLayout->setContentsMargins(6, 6, 6, 6);
288 lightDirectionLayout->setSpacing(2);
289 lightDirectionLayout->addLayout(lightThetaLayout);
290 lightDirectionLayout->addLayout(lightPhiLayout);
292 QGroupBox* lightAnglesGroup =
new QGroupBox(tr(
"Light Direction"));
293 lightAnglesGroup->setLayout(lightDirectionLayout);
295 connect(lightTheta, &QSlider::valueChanged,
this, &G4DisplayView::changeLightDirection);
296 connect(lightTheta, &QSlider::valueChanged, lthetaLCD, qOverload<int>(&QLCDNumber::display));
297 connect(lthetaDropdown, &QComboBox::currentTextChanged,
298 this, [
this](
const QString&) { setLightDirection(0); });
300 connect(lightPhi, &QSlider::valueChanged,
this, &G4DisplayView::changeLightDirection);
301 connect(lightPhi, &QSlider::valueChanged, lphiLCD, qOverload<int>(&QLCDNumber::display));
302 connect(lphiDropdown, &QComboBox::currentTextChanged,
303 this, [
this](
const QString&) { setLightDirection(1); });
309 QLabel* cullingLabel =
new QLabel(tr(
"Culling:"));
310 cullingDropdown =
new QComboBox;
311 cullingDropdown->addItem(tr(
"Reset"));
312 cullingDropdown->addItem(tr(
"Covered Daughters"));
313 cullingDropdown->addItem(tr(
"Density: 1 mg/cm3"));
314 cullingDropdown->addItem(tr(
"Density: 10 mg/cm3"));
315 cullingDropdown->addItem(tr(
"Density: 100 mg/cm3"));
316 cullingDropdown->addItem(tr(
"Density: 1 g/cm3"));
317 cullingDropdown->addItem(tr(
"Density: 10 g/cm3"));
319 QLabel* backgroundColorLabel =
new QLabel(tr(
"Background Color:"));
320 backgroundColorDropdown =
new QComboBox;
321 const auto addBackgroundPreset = [
this](
const QString& name,
const QString& rgb) {
322 backgroundColorDropdown->addItem(name, rgb);
324 addBackgroundPreset(tr(
"lightslategray"),
"0.46667 0.53333 0.60000");
325 addBackgroundPreset(tr(
"ghostwhite"),
"0.97255 0.97255 1.00000");
326 addBackgroundPreset(tr(
"black"),
"0.00000 0.00000 0.00000");
327 addBackgroundPreset(tr(
"navy"),
"0.00000 0.00000 0.50196");
328 addBackgroundPreset(tr(
"whitesmoke"),
"0.96078 0.96078 0.96078");
329 addBackgroundPreset(tr(
"lightskyblue"),
"0.52941 0.80784 0.98039");
330 addBackgroundPreset(tr(
"deepskyblue"),
"0.00000 0.74902 1.00000");
331 addBackgroundPreset(tr(
"lightsteelblue"),
"0.69020 0.76863 0.87059");
332 addBackgroundPreset(tr(
"blueviolet"),
"0.54118 0.16863 0.88627");
333 addBackgroundPreset(tr(
"turquoise"),
"0.25098 0.87843 0.81569");
334 addBackgroundPreset(tr(
"mediumaquamarine"),
"0.40000 0.80392 0.66667");
335 addBackgroundPreset(tr(
"springgreen"),
"0.00000 1.00000 0.49804");
336 addBackgroundPreset(tr(
"lawngreen"),
"0.48627 0.98824 0.00000");
337 addBackgroundPreset(tr(
"yellowgreen"),
"0.60392 0.80392 0.19608");
338 addBackgroundPreset(tr(
"lemonchiffon"),
"1.00000 0.98039 0.80392");
339 addBackgroundPreset(tr(
"antiquewhite"),
"0.98039 0.92157 0.84314");
340 addBackgroundPreset(tr(
"wheat"),
"0.96078 0.87059 0.70196");
341 addBackgroundPreset(tr(
"sienna"),
"0.62745 0.32157 0.17647");
342 addBackgroundPreset(tr(
"snow"),
"1.00000 0.98039 0.98039");
343 addBackgroundPreset(tr(
"floralwhite"),
"1.00000 0.98039 0.94118");
344 addBackgroundPreset(tr(
"lightsalmon"),
"1.00000 0.62745 0.47843");
345 addBackgroundPreset(tr(
"orchid"),
"0.85490 0.43922 0.83922");
346 addBackgroundPreset(tr(
"plum"),
"0.86667 0.62745 0.86667");
347 setBackgroundDropdownColor(backgroundColor);
349 backgroundColorButton =
new QToolButton(
this);
350 backgroundColorButton->setToolTip(tr(
"Choose background color"));
351 backgroundColorButton->setAutoRaise(
true);
352 backgroundColorButton->setIconSize(QSize(18, 18));
353 setBackgroundButtonColor(backgroundColor);
355 auto* cloudPointsLabel =
new QLabel(tr(
"Number of Cloud Points:"));
356 cloudPointsSpinBox =
new QSpinBox(
this);
357 cloudPointsSpinBox->setRange(1, 100000000);
358 cloudPointsSpinBox->setSingleStep(100);
359 cloudPointsSpinBox->setGroupSeparatorShown(
true);
360 cloudPointsSpinBox->setValue(std::max(1, cloudPoints));
362 auto* explodeLabel =
new QLabel(tr(
"Explode Factor:"));
363 explodeSlider =
new QSlider(Qt::Horizontal);
364 explodeSlider->setRange(0, 100);
365 explodeSlider->setValue(0);
366 explodeSlider->setSingleStep(1);
367 explodeSlider->setPageStep(5);
368 explodeValueLabel =
new QLabel(tr(
"1.00"));
369 explodeIntensityDropdown =
new QComboBox;
370 explodeIntensityDropdown->addItem(tr(
"Low"), QVariant(45.0));
371 explodeIntensityDropdown->addItem(tr(
"Medium"), QVariant(15.0));
372 explodeIntensityDropdown->addItem(tr(
"High"), QVariant(5.0));
373 explodeIntensityDropdown->setCurrentIndex(1);
375 connect(cullingDropdown, &QComboBox::currentTextChanged,
this, &G4DisplayView::set_culling);
376 connect(backgroundColorDropdown, &QComboBox::currentTextChanged,
this, &G4DisplayView::set_background);
377 connect(backgroundColorButton, &QToolButton::clicked,
this, &G4DisplayView::choose_background_color);
378 connect(cloudPointsSpinBox, qOverload<int>(&QSpinBox::valueChanged),
this, &G4DisplayView::set_cloud_points);
379 connect(explodeSlider, &QSlider::valueChanged,
this, &G4DisplayView::set_explode);
380 connect(explodeIntensityDropdown, &QComboBox::currentIndexChanged,
this, &G4DisplayView::set_explode);
382 QVBoxLayout* sceneLayout =
new QVBoxLayout;
383 sceneLayout->setContentsMargins(6, 6, 6, 6);
384 sceneLayout->setSpacing(4);
385 sceneLayout->addWidget(cullingLabel);
386 sceneLayout->addWidget(cullingDropdown);
387 sceneLayout->addWidget(backgroundColorLabel);
388 auto* backgroundLayout =
new QHBoxLayout;
389 backgroundLayout->setContentsMargins(0, 0, 0, 0);
390 backgroundLayout->setSpacing(4);
391 backgroundLayout->addWidget(backgroundColorDropdown);
392 backgroundLayout->addWidget(backgroundColorButton);
393 sceneLayout->addLayout(backgroundLayout);
394 sceneLayout->addWidget(cloudPointsLabel);
395 sceneLayout->addWidget(cloudPointsSpinBox);
396 sceneLayout->addWidget(explodeLabel);
397 auto* explodeRow =
new QHBoxLayout;
398 explodeRow->setContentsMargins(0, 0, 0, 0);
399 explodeRow->setSpacing(4);
400 explodeRow->addWidget(explodeSlider);
401 explodeRow->addWidget(explodeValueLabel);
402 explodeRow->addWidget(explodeIntensityDropdown);
403 sceneLayout->addLayout(explodeRow);
405 QGroupBox* spropertyGroup =
new QGroupBox(tr(
"Scene Properties"));
406 spropertyGroup->setLayout(sceneLayout);
408 QHBoxLayout* lightAndProperties =
new QHBoxLayout;
409 lightAndProperties->setContentsMargins(0, 0, 0, 0);
410 lightAndProperties->setSpacing(6);
411 lightAndProperties->addWidget(lightAnglesGroup);
412 lightAndProperties->addWidget(spropertyGroup);
419 sliceXEdit =
new QLineEdit(tr(
"0"));
420 sliceXEdit->setMaximumWidth(100);
421 sliceXActi =
new QCheckBox(tr(
"&On"));
422 sliceXActi->setChecked(
false);
423 sliceXInve =
new QCheckBox(tr(
"&Flip"));
424 sliceXInve->setChecked(
false);
426 auto sliceXLayout =
new QHBoxLayout;
427 sliceXLayout->setContentsMargins(0, 0, 0, 0);
428 sliceXLayout->setSpacing(4);
429 sliceXLayout->addWidget(
new QLabel(tr(
"X: ")));
430 sliceXLayout->addWidget(sliceXEdit);
431 sliceXLayout->addSpacing(16);
432 sliceXLayout->addWidget(sliceXActi);
433 sliceXLayout->addWidget(sliceXInve);
434 sliceXLayout->addStretch(1);
437 sliceYEdit =
new QLineEdit(tr(
"0"));
438 sliceYEdit->setMaximumWidth(100);
439 sliceYActi =
new QCheckBox(tr(
"&On"));
440 sliceYActi->setChecked(
false);
441 sliceYInve =
new QCheckBox(tr(
"&Flip"));
442 sliceYInve->setChecked(
false);
444 auto sliceYLayout =
new QHBoxLayout;
445 sliceYLayout->setContentsMargins(0, 0, 0, 0);
446 sliceYLayout->setSpacing(4);
447 sliceYLayout->addWidget(
new QLabel(tr(
"Y: ")));
448 sliceYLayout->addWidget(sliceYEdit);
449 sliceYLayout->addSpacing(16);
450 sliceYLayout->addWidget(sliceYActi);
451 sliceYLayout->addWidget(sliceYInve);
452 sliceYLayout->addStretch(1);
455 sliceZEdit =
new QLineEdit(tr(
"0"));
456 sliceZEdit->setMaximumWidth(100);
457 sliceZActi =
new QCheckBox(tr(
"&On"));
458 sliceZActi->setChecked(
false);
459 sliceZInve =
new QCheckBox(tr(
"&Flip"));
460 sliceZInve->setChecked(
false);
462 auto sliceZLayout =
new QHBoxLayout;
463 sliceZLayout->setContentsMargins(0, 0, 0, 0);
464 sliceZLayout->setSpacing(4);
465 sliceZLayout->addWidget(
new QLabel(tr(
"Z: ")));
466 sliceZLayout->addWidget(sliceZEdit);
467 sliceZLayout->addSpacing(16);
468 sliceZLayout->addWidget(sliceZActi);
469 sliceZLayout->addWidget(sliceZInve);
470 sliceZLayout->addStretch(1);
473 QPushButton* clearSliceButton =
new QPushButton(tr(
"Clear Slices"));
474 clearSliceButton->setToolTip(
"Clear Slice Planes");
475 clearSliceButton->setIcon(QIcon::fromTheme(
"edit-clear"));
476 clearSliceButton->setIconSize(QSize(16, 16));
477 connect(clearSliceButton, &QPushButton::clicked,
this, &G4DisplayView::clearSlices);
480 QGroupBox* sliceChoiceBox =
new QGroupBox(tr(
"Slices Style"));
481 sliceSectn =
new QRadioButton(tr(
"&Intersection"), sliceChoiceBox);
482 sliceUnion =
new QRadioButton(tr(
"&Union"), sliceChoiceBox);
483 sliceSectn->setChecked(
true);
485 connect(sliceSectn, &QRadioButton::toggled,
this, &G4DisplayView::slice);
486 connect(sliceUnion, &QRadioButton::toggled,
this, &G4DisplayView::slice);
488 auto sliceChoiceLayout =
new QHBoxLayout;
489 sliceChoiceLayout->setContentsMargins(6, 4, 6, 4);
490 sliceChoiceLayout->setSpacing(8);
491 sliceChoiceLayout->addWidget(sliceSectn);
492 sliceChoiceLayout->addWidget(sliceUnion);
493 sliceChoiceBox->setLayout(sliceChoiceLayout);
496 auto sliceLayout =
new QVBoxLayout;
497 sliceLayout->setContentsMargins(0, 0, 0, 0);
498 sliceLayout->setSpacing(3);
499 sliceLayout->addLayout(sliceXLayout);
500 sliceLayout->addLayout(sliceYLayout);
501 sliceLayout->addLayout(sliceZLayout);
502 sliceLayout->addWidget(sliceChoiceBox);
503 sliceLayout->addWidget(clearSliceButton);
506 connect(sliceXEdit, &QLineEdit::returnPressed,
this, &G4DisplayView::slice);
507 connect(sliceYEdit, &QLineEdit::returnPressed,
this, &G4DisplayView::slice);
508 connect(sliceZEdit, &QLineEdit::returnPressed,
this, &G4DisplayView::slice);
510#if QT_VERSION < QT_VERSION_CHECK(6, 7, 0)
511 connect(sliceXActi, &QCheckBox::stateChanged,
this, &G4DisplayView::slice);
512 connect(sliceYActi, &QCheckBox::stateChanged,
this, &G4DisplayView::slice);
513 connect(sliceZActi, &QCheckBox::stateChanged,
this, &G4DisplayView::slice);
514 connect(sliceXInve, &QCheckBox::stateChanged,
this, &G4DisplayView::slice);
515 connect(sliceYInve, &QCheckBox::stateChanged,
this, &G4DisplayView::slice);
516 connect(sliceZInve, &QCheckBox::stateChanged,
this, &G4DisplayView::slice);
518 connect(sliceXActi, &QCheckBox::checkStateChanged,
this, &G4DisplayView::slice);
519 connect(sliceYActi, &QCheckBox::checkStateChanged,
this, &G4DisplayView::slice);
520 connect(sliceZActi, &QCheckBox::checkStateChanged,
this, &G4DisplayView::slice);
521 connect(sliceXInve, &QCheckBox::checkStateChanged,
this, &G4DisplayView::slice);
522 connect(sliceYInve, &QCheckBox::checkStateChanged,
this, &G4DisplayView::slice);
523 connect(sliceZInve, &QCheckBox::checkStateChanged,
this, &G4DisplayView::slice);
530 QGroupBox* fieldPrecisionBox =
new QGroupBox(tr(
"Number of Field Points"));
531 field_npoints =
new QLineEdit(QString::number(field_NPOINTS),
this);
532 field_npoints->setMaximumWidth(40);
534 QFont font = field_npoints->font();
535 font.setPointSize(18);
536 field_npoints->setFont(font);
538 connect(field_npoints, &QLineEdit::returnPressed,
this, &G4DisplayView::field_precision_changed);
541 auto fieldPointsHBox =
new QHBoxLayout;
542 fieldPointsHBox->setContentsMargins(6, 4, 6, 4);
543 fieldPointsHBox->setSpacing(4);
544 fieldPointsHBox->addWidget(field_npoints);
545 fieldPrecisionBox->setLayout(fieldPointsHBox);
547 auto buttons_field_HBox =
new QHBoxLayout;
548 buttons_field_HBox->setContentsMargins(0, 0, 0, 0);
549 buttons_field_HBox->setSpacing(6);
550 buttons_field_HBox->addWidget(buttons_set1);
551 buttons_field_HBox->addWidget(fieldPrecisionBox);
552 fieldPrecisionBox->setMaximumHeight(3 * buttons_set1->height());
553 fieldPrecisionBox->setMaximumWidth(140);
559 auto mainLayout =
new QVBoxLayout;
560 mainLayout->setContentsMargins(6, 6, 6, 6);
561 mainLayout->setSpacing(6);
562 mainLayout->addLayout(buttons_field_HBox);
563 mainLayout->addLayout(cameraAndPerspective);
564 mainLayout->addLayout(lightAndProperties);
565 mainLayout->addLayout(sliceLayout);
566 setLayout(mainLayout);