10#include "pmakerView.h"
11#ifdef GEMC_HAS_QTCHARTS
12#include "gAnalysisView.h"
14#include "gemc/actions/gaction.h"
17#include "G4RunManager.hh"
19void GemcGUI::createRightContent(std::shared_ptr<GOptions> gopts,
23 rightContent =
new QStackedWidget;
28 auto* setupView =
new DBSelectView(gopts, dc);
31 auto* g4display =
new G4Display(gopts);
32 rightContent->addWidget(g4display);
33 auto* displayUtilities = g4display->findChild<G4DisplayUtilities*>();
34 if (displayUtilities) {
36 this, &GemcGUI::refreshVisualizationFromOptions);
40 rightContent->addWidget(setupView);
42 this, &GemcGUI::resetVisualizationBeforeGeometryReload);
46 geometryTree =
new GTree(gopts,
49 : std::unordered_map<std::string, G4Volume*>{},
52 : std::unordered_map<std::string, const GVolume*>{},
56 : std::unordered_map<std::string, const GMirror*>{});
57 rightContent->addWidget(geometryTree);
60 rightContent->addWidget(
new G4Dialog(gopts, gb));
63 std::shared_ptr<std::vector<GparticlePtr>> sharedParticles;
64 if (
auto* rm = G4RunManager::GetRunManager()) {
65 if (
auto* ga =
dynamic_cast<GAction*
>(
66 const_cast<G4VUserActionInitialization*
>(rm->GetUserActionInitialization())))
67 sharedParticles = ga->getSharedParticles();
69 rightContent->addWidget(
new PmakerView(sharedParticles, gopts));
72#ifdef GEMC_HAS_QTCHARTS
73 analysisView =
new GAnalysisView(analysisAccumulator, ganalysis::getOptions(gopts));
74 rightContent->addWidget(analysisView);
78 auto* analysisPlaceholder =
new QLabel(
79 QStringLiteral(
"The analysis view requires Qt6 Charts, which was not available when GEMC was "
80 "built.\nInstall the Qt6 Charts package and rebuild GEMC to enable live "
82 analysisPlaceholder->setAlignment(Qt::AlignCenter);
83 analysisPlaceholder->setWordWrap(
true);
84 rightContent->addWidget(analysisPlaceholder);
88 rightContent->setCurrentIndex(0);
89 leftButtons->press_button(0);
void geometryAboutToReload()
void sceneOptionsChanged()
std::unordered_map< std::string, const GVolume * > get_gvolumes_flat_map() const
std::unordered_map< std::string, G4Volume * > get_g4volumes_map() const
std::unordered_map< std::string, const GMirror * > get_gmirrors_flat_map() const
bool has_built_geometry() const