89 std::shared_ptr<GLogger> logger,
91 : QWidget(parent), gopts(gopts), log(logger) {
96 flcd.setFamilies({
"Helvetica"});
97 flcd.setPointSize(24);
108 backgroundColor = colorFromG4Rgb(g4view.
background);
113 vector<string> toggle_button_titles;
114 toggle_button_titles.emplace_back(
"");
115 toggle_button_titles.emplace_back(
"");
116 toggle_button_titles.emplace_back(
"");
117 toggle_button_titles.emplace_back(
"");
122 buttons_set1->setSvgButtonIcon(0,
":/images/hidden_lines.svg", QSize(120, 120));
123 buttons_set1->setSvgButtonIcon(1,
":/images/anti_aliasing.svg", QSize(120, 120));
124 buttons_set1->setSvgButtonIcon(2,
":/images/auxiliary_edges.svg", QSize(120, 120));
125 buttons_set1->setSvgButtonIcon(3,
":/images/field_lines.svg", QSize(120, 120));
128 QStringList theta_angle_Set;
129 for (
int t = 0; t <= 180; t += 30) { theta_angle_Set << QString::number(t); }
130 QStringList phi_angle_Set;
131 for (
int t = 0; t <= 360; t += 30) { phi_angle_Set << QString::number(t); }
137 cameraTheta =
new QSlider(Qt::Horizontal);
138 cameraTheta->setRange(0, 180);
139 cameraTheta->setSingleStep(1);
140 cameraTheta->setValue(thetaValue);
141 cameraTheta->setTracking(
true);
143 auto cameraThetaLabel =
new QLabel(tr(
"θ"));
145 thetaLCD =
new QLCDNumber(
this);
146 thetaLCD->setFont(flcd);
147 thetaLCD->setMaximumSize(QSize(42, 32));
148 thetaLCD->setSegmentStyle(QLCDNumber::Flat);
150 thetaDropdown =
new QComboBox(
this);
151 thetaDropdown->addItems(theta_angle_Set);
152 thetaDropdown->setMaximumSize(QSize(100, 45));
154 auto cameraThetaLayout =
new QHBoxLayout;
155 cameraThetaLayout->setContentsMargins(0, 0, 0, 0);
156 cameraThetaLayout->setSpacing(4);
157 cameraThetaLayout->addWidget(cameraThetaLabel);
158 cameraThetaLayout->addWidget(cameraTheta);
159 cameraThetaLayout->addWidget(thetaLCD);
160 cameraThetaLayout->addWidget(thetaDropdown);
162 cameraPhi =
new QSlider(Qt::Horizontal);
163 cameraPhi->setRange(0, 360);
164 cameraPhi->setSingleStep(1);
165 cameraPhi->setValue(phiValue);
166 cameraPhi->setTracking(
true);
168 auto cameraPhiLabel =
new QLabel(tr(
"ɸ"));
170 phiLCD =
new QLCDNumber(
this);
171 phiLCD->setFont(flcd);
172 phiLCD->setMaximumSize(QSize(42, 32));
173 phiLCD->setSegmentStyle(QLCDNumber::Flat);
175 phiDropdown =
new QComboBox(
this);
176 phiDropdown->addItems(phi_angle_Set);
177 phiDropdown->setMaximumSize(QSize(100, 45));
179 auto cameraPhiLayout =
new QHBoxLayout;
180 cameraPhiLayout->setContentsMargins(0, 0, 0, 0);
181 cameraPhiLayout->setSpacing(4);
182 cameraPhiLayout->addWidget(cameraPhiLabel);
183 cameraPhiLayout->addWidget(cameraPhi);
184 cameraPhiLayout->addWidget(phiLCD);
185 cameraPhiLayout->addWidget(phiDropdown);
187 auto* readViewButton =
new QPushButton(tr(
"Read View"),
this);
188 readViewButton->setToolTip(tr(
"Sync sliders to current viewer orientation"));
189 auto* readViewRow =
new QHBoxLayout;
190 readViewRow->setContentsMargins(0, 0, 0, 0);
191 readViewRow->addStretch(1);
192 readViewRow->addWidget(readViewButton);
194 QVBoxLayout* cameraDirectionLayout =
new QVBoxLayout;
195 cameraDirectionLayout->setContentsMargins(6, 6, 6, 6);
196 cameraDirectionLayout->setSpacing(2);
197 cameraDirectionLayout->addLayout(cameraThetaLayout);
198 cameraDirectionLayout->addLayout(cameraPhiLayout);
199 cameraDirectionLayout->addLayout(readViewRow);
201 QGroupBox* cameraAnglesGroup =
new QGroupBox(tr(
"Camera Direction"));
202 cameraAnglesGroup->setLayout(cameraDirectionLayout);
205 connect(cameraTheta, &QSlider::valueChanged,
this, &G4DisplayView::changeCameraDirection);
206 connect(cameraTheta, &QSlider::valueChanged, thetaLCD, qOverload<int>(&QLCDNumber::display));
209 connect(thetaDropdown, &QComboBox::currentTextChanged,
210 this, [
this](
const QString&) { setCameraDirection(0); });
212 connect(cameraPhi, &QSlider::valueChanged,
this, &G4DisplayView::changeCameraDirection);
213 connect(cameraPhi, &QSlider::valueChanged, phiLCD, qOverload<int>(&QLCDNumber::display));
215 connect(phiDropdown, &QComboBox::currentTextChanged,
216 this, [
this](
const QString&) { setCameraDirection(1); });
218 connect(readViewButton, &QPushButton::clicked,
this, &G4DisplayView::readCameraFromViewer);
225 QLabel* projLabel =
new QLabel(tr(
"Projection:"));
226 perspectiveDropdown =
new QComboBox;
227 perspectiveDropdown->addItem(tr(
"Orthogonal"));
228 perspectiveDropdown->addItem(tr(
"Perspective 30"));
229 perspectiveDropdown->addItem(tr(
"Perspective 45"));
230 perspectiveDropdown->addItem(tr(
"Perspective 60"));
233 QLabel* sides_per_circlesLabel =
new QLabel(tr(
"Sides per circle:"));
234 precisionDropdown =
new QComboBox;
235 precisionDropdown->addItem(tr(
"50"));
236 precisionDropdown->addItem(tr(
"100"));
237 precisionDropdown->addItem(tr(
"200"));
238 precisionDropdown->addItem(tr(
"300"));
239 precisionDropdown->setCurrentIndex(0);
241 connect(perspectiveDropdown, &QComboBox::currentTextChanged,
this, &G4DisplayView::set_projection);
242 connect(precisionDropdown, &QComboBox::currentTextChanged,
this, &G4DisplayView::set_precision);
244 QVBoxLayout* resolutionAndPerspectiveLayout =
new QVBoxLayout;
245 resolutionAndPerspectiveLayout->setContentsMargins(6, 6, 6, 6);
246 resolutionAndPerspectiveLayout->setSpacing(4);
247 resolutionAndPerspectiveLayout->addWidget(projLabel);
248 resolutionAndPerspectiveLayout->addWidget(perspectiveDropdown);
249 resolutionAndPerspectiveLayout->addWidget(sides_per_circlesLabel);
250 resolutionAndPerspectiveLayout->addWidget(precisionDropdown);
252 QGroupBox* propertyGroup =
new QGroupBox(tr(
"View Properties"));
253 propertyGroup->setLayout(resolutionAndPerspectiveLayout);
255 QHBoxLayout* cameraAndPerspective =
new QHBoxLayout;
256 cameraAndPerspective->setContentsMargins(0, 0, 0, 0);
257 cameraAndPerspective->setSpacing(6);
258 cameraAndPerspective->addWidget(cameraAnglesGroup);
259 cameraAndPerspective->addWidget(propertyGroup);
265 lightTheta =
new QSlider(Qt::Horizontal);
266 lightTheta->setRange(0, 180);
267 lightTheta->setSingleStep(1);
268 lightTheta->setValue(lightThetaValue);
269 lightTheta->setTracking(
true);
271 auto lightThetaLabel =
new QLabel(tr(
"θ"));
273 lthetaLCD =
new QLCDNumber(
this);
274 lthetaLCD->setFont(flcd);
275 lthetaLCD->setMaximumSize(QSize(42, 32));
276 lthetaLCD->setSegmentStyle(QLCDNumber::Flat);
278 lthetaDropdown =
new QComboBox(
this);
279 lthetaDropdown->addItems(theta_angle_Set);
280 lthetaDropdown->setMaximumSize(QSize(100, 45));
282 auto lightThetaLayout =
new QHBoxLayout;
283 lightThetaLayout->setContentsMargins(0, 0, 0, 0);
284 lightThetaLayout->setSpacing(4);
285 lightThetaLayout->addWidget(lightThetaLabel);
286 lightThetaLayout->addWidget(lightTheta);
287 lightThetaLayout->addWidget(lthetaLCD);
288 lightThetaLayout->addWidget(lthetaDropdown);
290 lightPhi =
new QSlider(Qt::Horizontal);
291 lightPhi->setRange(0, 360);
292 lightPhi->setSingleStep(1);
293 lightPhi->setValue(lightPhiValue);
294 lightPhi->setTracking(
true);
296 auto lightPhiLabel =
new QLabel(tr(
"ɸ"));
298 lphiLCD =
new QLCDNumber(
this);
299 lphiLCD->setFont(flcd);
300 lphiLCD->setMaximumSize(QSize(42, 32));
301 lphiLCD->setSegmentStyle(QLCDNumber::Flat);
303 lphiDropdown =
new QComboBox(
this);
304 lphiDropdown->addItems(phi_angle_Set);
305 lphiDropdown->setMaximumSize(QSize(100, 45));
307 auto lightPhiLayout =
new QHBoxLayout;
308 lightPhiLayout->setContentsMargins(0, 0, 0, 0);
309 lightPhiLayout->setSpacing(4);
310 lightPhiLayout->addWidget(lightPhiLabel);
311 lightPhiLayout->addWidget(lightPhi);
312 lightPhiLayout->addWidget(lphiLCD);
313 lightPhiLayout->addWidget(lphiDropdown);
315 auto lightDirectionLayout =
new QVBoxLayout;
316 lightDirectionLayout->setContentsMargins(6, 6, 6, 6);
317 lightDirectionLayout->setSpacing(2);
318 lightDirectionLayout->addLayout(lightThetaLayout);
319 lightDirectionLayout->addLayout(lightPhiLayout);
321 QGroupBox* lightAnglesGroup =
new QGroupBox(tr(
"Light Direction"));
322 lightAnglesGroup->setLayout(lightDirectionLayout);
324 connect(lightTheta, &QSlider::valueChanged,
this, &G4DisplayView::changeLightDirection);
325 connect(lightTheta, &QSlider::valueChanged, lthetaLCD, qOverload<int>(&QLCDNumber::display));
326 connect(lthetaDropdown, &QComboBox::currentTextChanged,
327 this, [
this](
const QString&) { setLightDirection(0); });
329 connect(lightPhi, &QSlider::valueChanged,
this, &G4DisplayView::changeLightDirection);
330 connect(lightPhi, &QSlider::valueChanged, lphiLCD, qOverload<int>(&QLCDNumber::display));
331 connect(lphiDropdown, &QComboBox::currentTextChanged,
332 this, [
this](
const QString&) { setLightDirection(1); });
338 QLabel* cullingLabel =
new QLabel(tr(
"Culling:"));
339 cullingDropdown =
new QComboBox;
340 cullingDropdown->addItem(tr(
"Reset"));
341 cullingDropdown->addItem(tr(
"Covered Daughters"));
342 cullingDropdown->addItem(tr(
"Density: 1 mg/cm3"));
343 cullingDropdown->addItem(tr(
"Density: 10 mg/cm3"));
344 cullingDropdown->addItem(tr(
"Density: 100 mg/cm3"));
345 cullingDropdown->addItem(tr(
"Density: 1 g/cm3"));
346 cullingDropdown->addItem(tr(
"Density: 10 g/cm3"));
348 QLabel* backgroundColorLabel =
new QLabel(tr(
"Background Color:"));
349 backgroundColorDropdown =
new QComboBox;
350 const auto addBackgroundPreset = [
this](
const QString& name,
const QString& rgb) {
351 backgroundColorDropdown->addItem(name, rgb);
353 addBackgroundPreset(tr(
"lightslategray"),
"0.46667 0.53333 0.60000");
354 addBackgroundPreset(tr(
"ghostwhite"),
"0.97255 0.97255 1.00000");
355 addBackgroundPreset(tr(
"black"),
"0.00000 0.00000 0.00000");
356 addBackgroundPreset(tr(
"navy"),
"0.00000 0.00000 0.50196");
357 addBackgroundPreset(tr(
"whitesmoke"),
"0.96078 0.96078 0.96078");
358 addBackgroundPreset(tr(
"lightskyblue"),
"0.52941 0.80784 0.98039");
359 addBackgroundPreset(tr(
"deepskyblue"),
"0.00000 0.74902 1.00000");
360 addBackgroundPreset(tr(
"lightsteelblue"),
"0.69020 0.76863 0.87059");
361 addBackgroundPreset(tr(
"blueviolet"),
"0.54118 0.16863 0.88627");
362 addBackgroundPreset(tr(
"turquoise"),
"0.25098 0.87843 0.81569");
363 addBackgroundPreset(tr(
"mediumaquamarine"),
"0.40000 0.80392 0.66667");
364 addBackgroundPreset(tr(
"springgreen"),
"0.00000 1.00000 0.49804");
365 addBackgroundPreset(tr(
"lawngreen"),
"0.48627 0.98824 0.00000");
366 addBackgroundPreset(tr(
"yellowgreen"),
"0.60392 0.80392 0.19608");
367 addBackgroundPreset(tr(
"lemonchiffon"),
"1.00000 0.98039 0.80392");
368 addBackgroundPreset(tr(
"antiquewhite"),
"0.98039 0.92157 0.84314");
369 addBackgroundPreset(tr(
"wheat"),
"0.96078 0.87059 0.70196");
370 addBackgroundPreset(tr(
"sienna"),
"0.62745 0.32157 0.17647");
371 addBackgroundPreset(tr(
"snow"),
"1.00000 0.98039 0.98039");
372 addBackgroundPreset(tr(
"floralwhite"),
"1.00000 0.98039 0.94118");
373 addBackgroundPreset(tr(
"lightsalmon"),
"1.00000 0.62745 0.47843");
374 addBackgroundPreset(tr(
"orchid"),
"0.85490 0.43922 0.83922");
375 addBackgroundPreset(tr(
"plum"),
"0.86667 0.62745 0.86667");
376 setBackgroundDropdownColor(backgroundColor);
378 backgroundColorButton =
new QToolButton(
this);
379 backgroundColorButton->setToolTip(tr(
"Choose background color"));
380 backgroundColorButton->setAutoRaise(
true);
381 backgroundColorButton->setIconSize(QSize(18, 18));
382 setBackgroundButtonColor(backgroundColor);
384 auto* cloudPointsLabel =
new QLabel(tr(
"Number of Cloud Points:"));
385 cloudPointsSpinBox =
new QSpinBox(
this);
386 cloudPointsSpinBox->setRange(1, 100000000);
387 cloudPointsSpinBox->setSingleStep(100);
388 cloudPointsSpinBox->setGroupSeparatorShown(
true);
389 cloudPointsSpinBox->setValue(std::max(1, cloudPoints));
391 auto* explodeLabel =
new QLabel(tr(
"Explode Factor:"));
392 explodeSlider =
new QSlider(Qt::Horizontal);
393 explodeSlider->setRange(0, 100);
394 explodeSlider->setValue(0);
395 explodeSlider->setSingleStep(1);
396 explodeSlider->setPageStep(5);
397 explodeValueLabel =
new QLabel(tr(
"1.00"));
398 explodeIntensityDropdown =
new QComboBox;
399 explodeIntensityDropdown->addItem(tr(
"Low"), QVariant(45.0));
400 explodeIntensityDropdown->addItem(tr(
"Medium"), QVariant(15.0));
401 explodeIntensityDropdown->addItem(tr(
"High"), QVariant(5.0));
402 explodeIntensityDropdown->setCurrentIndex(1);
404 connect(cullingDropdown, &QComboBox::currentTextChanged,
this, &G4DisplayView::set_culling);
405 connect(backgroundColorDropdown, &QComboBox::currentTextChanged,
this, &G4DisplayView::set_background);
406 connect(backgroundColorButton, &QToolButton::clicked,
this, &G4DisplayView::choose_background_color);
407 connect(cloudPointsSpinBox, qOverload<int>(&QSpinBox::valueChanged),
this, &G4DisplayView::set_cloud_points);
408 connect(explodeSlider, &QSlider::valueChanged,
this, &G4DisplayView::set_explode);
409 connect(explodeIntensityDropdown, &QComboBox::currentIndexChanged,
this, &G4DisplayView::set_explode);
411 QVBoxLayout* sceneLayout =
new QVBoxLayout;
412 sceneLayout->setContentsMargins(6, 6, 6, 6);
413 sceneLayout->setSpacing(4);
414 sceneLayout->addWidget(cullingLabel);
415 sceneLayout->addWidget(cullingDropdown);
416 sceneLayout->addWidget(backgroundColorLabel);
417 auto* backgroundLayout =
new QHBoxLayout;
418 backgroundLayout->setContentsMargins(0, 0, 0, 0);
419 backgroundLayout->setSpacing(4);
420 backgroundLayout->addWidget(backgroundColorDropdown);
421 backgroundLayout->addWidget(backgroundColorButton);
422 sceneLayout->addLayout(backgroundLayout);
423 sceneLayout->addWidget(cloudPointsLabel);
424 sceneLayout->addWidget(cloudPointsSpinBox);
425 sceneLayout->addWidget(explodeLabel);
426 auto* explodeRow =
new QHBoxLayout;
427 explodeRow->setContentsMargins(0, 0, 0, 0);
428 explodeRow->setSpacing(4);
429 explodeRow->addWidget(explodeSlider);
430 explodeRow->addWidget(explodeValueLabel);
431 explodeRow->addWidget(explodeIntensityDropdown);
432 sceneLayout->addLayout(explodeRow);
434 QGroupBox* spropertyGroup =
new QGroupBox(tr(
"Scene Properties"));
435 spropertyGroup->setLayout(sceneLayout);
437 QHBoxLayout* lightAndProperties =
new QHBoxLayout;
438 lightAndProperties->setContentsMargins(0, 0, 0, 0);
439 lightAndProperties->setSpacing(6);
440 lightAndProperties->addWidget(lightAnglesGroup);
441 lightAndProperties->addWidget(spropertyGroup);
448 sliceXEdit =
new QLineEdit(tr(
"0"));
449 sliceXEdit->setMaximumWidth(100);
450 sliceXEdit->setValidator(
new QDoubleValidator(sliceXEdit));
451 sliceXActi =
new QCheckBox(tr(
"&On"));
452 sliceXActi->setChecked(
false);
453 sliceXInve =
new QCheckBox(tr(
"&Flip"));
454 sliceXInve->setChecked(
false);
456 auto sliceXLayout =
new QHBoxLayout;
457 sliceXLayout->setContentsMargins(0, 0, 0, 0);
458 sliceXLayout->setSpacing(4);
459 sliceXLayout->addWidget(
new QLabel(tr(
"X: ")));
460 sliceXLayout->addWidget(sliceXEdit);
461 sliceXLayout->addSpacing(16);
462 sliceXLayout->addWidget(sliceXActi);
463 sliceXLayout->addWidget(sliceXInve);
464 sliceXLayout->addStretch(1);
467 sliceYEdit =
new QLineEdit(tr(
"0"));
468 sliceYEdit->setMaximumWidth(100);
469 sliceYEdit->setValidator(
new QDoubleValidator(sliceYEdit));
470 sliceYActi =
new QCheckBox(tr(
"&On"));
471 sliceYActi->setChecked(
false);
472 sliceYInve =
new QCheckBox(tr(
"&Flip"));
473 sliceYInve->setChecked(
false);
475 auto sliceYLayout =
new QHBoxLayout;
476 sliceYLayout->setContentsMargins(0, 0, 0, 0);
477 sliceYLayout->setSpacing(4);
478 sliceYLayout->addWidget(
new QLabel(tr(
"Y: ")));
479 sliceYLayout->addWidget(sliceYEdit);
480 sliceYLayout->addSpacing(16);
481 sliceYLayout->addWidget(sliceYActi);
482 sliceYLayout->addWidget(sliceYInve);
483 sliceYLayout->addStretch(1);
486 sliceZEdit =
new QLineEdit(tr(
"0"));
487 sliceZEdit->setMaximumWidth(100);
488 sliceZEdit->setValidator(
new QDoubleValidator(sliceZEdit));
489 sliceZActi =
new QCheckBox(tr(
"&On"));
490 sliceZActi->setChecked(
false);
491 sliceZInve =
new QCheckBox(tr(
"&Flip"));
492 sliceZInve->setChecked(
false);
494 auto sliceZLayout =
new QHBoxLayout;
495 sliceZLayout->setContentsMargins(0, 0, 0, 0);
496 sliceZLayout->setSpacing(4);
497 sliceZLayout->addWidget(
new QLabel(tr(
"Z: ")));
498 sliceZLayout->addWidget(sliceZEdit);
499 sliceZLayout->addSpacing(16);
500 sliceZLayout->addWidget(sliceZActi);
501 sliceZLayout->addWidget(sliceZInve);
502 sliceZLayout->addStretch(1);
505 QPushButton* clearSliceButton =
new QPushButton(tr(
"Clear Slices"));
506 clearSliceButton->setToolTip(
"Clear Slice Planes");
507 clearSliceButton->setIcon(QIcon::fromTheme(
"edit-clear"));
508 clearSliceButton->setIconSize(QSize(16, 16));
509 connect(clearSliceButton, &QPushButton::clicked,
this, &G4DisplayView::clearSlices);
512 QGroupBox* sliceChoiceBox =
new QGroupBox(tr(
"Slices Style"));
513 sliceSectn =
new QRadioButton(tr(
"&Intersection"), sliceChoiceBox);
514 sliceUnion =
new QRadioButton(tr(
"&Union"), sliceChoiceBox);
515 sliceSectn->setChecked(
true);
517 connect(sliceSectn, &QRadioButton::toggled,
this, &G4DisplayView::slice);
518 connect(sliceUnion, &QRadioButton::toggled,
this, &G4DisplayView::slice);
520 auto sliceChoiceLayout =
new QHBoxLayout;
521 sliceChoiceLayout->setContentsMargins(6, 4, 6, 4);
522 sliceChoiceLayout->setSpacing(8);
523 sliceChoiceLayout->addWidget(sliceSectn);
524 sliceChoiceLayout->addWidget(sliceUnion);
525 sliceChoiceBox->setLayout(sliceChoiceLayout);
528 auto sliceLayout =
new QVBoxLayout;
529 sliceLayout->setContentsMargins(0, 0, 0, 0);
530 sliceLayout->setSpacing(3);
531 sliceLayout->addLayout(sliceXLayout);
532 sliceLayout->addLayout(sliceYLayout);
533 sliceLayout->addLayout(sliceZLayout);
534 sliceLayout->addWidget(sliceChoiceBox);
535 sliceLayout->addWidget(clearSliceButton);
538 connect(sliceXEdit, &QLineEdit::returnPressed,
this, &G4DisplayView::slice);
539 connect(sliceYEdit, &QLineEdit::returnPressed,
this, &G4DisplayView::slice);
540 connect(sliceZEdit, &QLineEdit::returnPressed,
this, &G4DisplayView::slice);
542#if QT_VERSION < QT_VERSION_CHECK(6, 7, 0)
543 connect(sliceXActi, &QCheckBox::stateChanged,
this, &G4DisplayView::slice);
544 connect(sliceYActi, &QCheckBox::stateChanged,
this, &G4DisplayView::slice);
545 connect(sliceZActi, &QCheckBox::stateChanged,
this, &G4DisplayView::slice);
546 connect(sliceXInve, &QCheckBox::stateChanged,
this, &G4DisplayView::slice);
547 connect(sliceYInve, &QCheckBox::stateChanged,
this, &G4DisplayView::slice);
548 connect(sliceZInve, &QCheckBox::stateChanged,
this, &G4DisplayView::slice);
550 connect(sliceXActi, &QCheckBox::checkStateChanged,
this, &G4DisplayView::slice);
551 connect(sliceYActi, &QCheckBox::checkStateChanged,
this, &G4DisplayView::slice);
552 connect(sliceZActi, &QCheckBox::checkStateChanged,
this, &G4DisplayView::slice);
553 connect(sliceXInve, &QCheckBox::checkStateChanged,
this, &G4DisplayView::slice);
554 connect(sliceYInve, &QCheckBox::checkStateChanged,
this, &G4DisplayView::slice);
555 connect(sliceZInve, &QCheckBox::checkStateChanged,
this, &G4DisplayView::slice);
562 QGroupBox* fieldPrecisionBox =
new QGroupBox(tr(
"Number of Field Points"));
563 field_npoints =
new QLineEdit(QString::number(field_NPOINTS),
this);
564 field_npoints->setMaximumWidth(40);
566 QFont font = field_npoints->font();
567 font.setPointSize(18);
568 field_npoints->setFont(font);
570 connect(field_npoints, &QLineEdit::returnPressed,
this, &G4DisplayView::field_precision_changed);
573 auto fieldPointsHBox =
new QHBoxLayout;
574 fieldPointsHBox->setContentsMargins(6, 4, 6, 4);
575 fieldPointsHBox->setSpacing(4);
576 fieldPointsHBox->addWidget(field_npoints);
577 fieldPrecisionBox->setLayout(fieldPointsHBox);
579 auto buttons_field_HBox =
new QHBoxLayout;
580 buttons_field_HBox->setContentsMargins(0, 0, 0, 0);
581 buttons_field_HBox->setSpacing(6);
582 buttons_field_HBox->addWidget(buttons_set1);
583 buttons_field_HBox->addWidget(fieldPrecisionBox);
584 fieldPrecisionBox->setMaximumHeight(3 * buttons_set1->height());
585 fieldPrecisionBox->setMaximumWidth(140);
591 auto mainLayout =
new QVBoxLayout;
592 mainLayout->setContentsMargins(6, 6, 6, 6);
593 mainLayout->setSpacing(6);
594 mainLayout->addLayout(buttons_field_HBox);
595 mainLayout->addLayout(cameraAndPerspective);
596 mainLayout->addLayout(lightAndProperties);
597 mainLayout->addLayout(sliceLayout);
598 setLayout(mainLayout);