g4display
Loading...
Searching...
No Matches
g4display.cc
Go to the documentation of this file.
1// gemc
2#include "g4display.h"
3#include "g4display_options.h" // provides G4DISPLAY_LOGGER constant and option definitions
4#include "tabs/g4displayview.h" // control tab
5#include "tabs/g4displayutilities.h" // utilities tab
6
7// G4Display Constructor
8// Initializes the QTabWidget base class and the unique_ptr for the logger.
9// Creates and adds the specific control tabs.
10G4Display::G4Display(const std::shared_ptr<GOptions>& gopt, QWidget* parent) :
11 GBase(gopt, G4DISPLAY_LOGGER),
12 QWidget(parent) {
13 auto dialogTabs = new QTabWidget;
14
15 // Create and add the 'View' tab.
16 // Pass the GOptions, the logger instance (retrieved via log.get()), and this widget as the parent.
17 dialogTabs->addTab(new G4DisplayView(gopt, log, this), tr("View"));
18
19 // Create and add the 'Utilities' tab.
20 // Pass the GOptions, the logger instance, and this widget as the parent.
21 dialogTabs->addTab(new G4DisplayUtilities(gopt, log, this), tr("Utilities"));
22
23 auto* mainLayout = new QVBoxLayout;
24 mainLayout->addWidget(dialogTabs);
25 setLayout(mainLayout);
26
27 log->debug(NORMAL, SFUNCTION_NAME, "View and Utilities tabs added.");
28}
A utility widget for Geant4 display functionalities.
A QWidget tab providing controls for Geant4 camera, lighting, slicing, and view styles.
G4Display(const std::shared_ptr< GOptions > &gopt, QWidget *parent=nullptr)
Constructs the G4Display widget.
Definition g4display.cc:10
constexpr const char * G4DISPLAY_LOGGER
Declaration of the G4DisplayUtilities widget.