10#include "pmakerView.h"
12#ifdef GEMC_HAS_QTCHARTS
13#include "gAnalysisView.h"
15#include "gemc/actions/gaction.h"
18#include "G4RunManager.hh"
20void GemcGUI::createRightContent(std::shared_ptr<GOptions> gopts,
24 rightContent =
new QStackedWidget;
29 auto* setupView =
new DBSelectView(gopts, dc);
32 auto* g4display =
new G4Display(gopts);
33 rightContent->addWidget(g4display);
34 auto* displayUtilities = g4display->findChild<G4DisplayUtilities*>();
35 if (displayUtilities) {
37 this, &GemcGUI::refreshVisualizationFromOptions);
41 rightContent->addWidget(setupView);
43 this, &GemcGUI::resetVisualizationBeforeGeometryReload);
47 geometryTree =
new GTree(gopts,
50 : std::unordered_map<std::string, G4Volume*>{},
53 : std::unordered_map<std::string, const GVolume*>{},
57 : std::unordered_map<std::string, const GMirror*>{});
58 rightContent->addWidget(geometryTree);
61 rightContent->addWidget(
new G4Dialog(gopts, gb));
64 std::shared_ptr<std::vector<GparticlePtr>> sharedParticles;
65 if (
auto* rm = G4RunManager::GetRunManager()) {
66 if (
auto* ga =
dynamic_cast<GAction*
>(
67 const_cast<G4VUserActionInitialization*
>(rm->GetUserActionInitialization())))
68 sharedParticles = ga->getSharedParticles();
70 rightContent->addWidget(
new PmakerView(sharedParticles, gopts));
73#ifdef GEMC_HAS_QTCHARTS
74 analysisView =
new GAnalysisView(analysisAccumulator, ganalysis::getOptions(gopts));
75 rightContent->addWidget(analysisView);
79 auto* analysisPlaceholder =
new QLabel(
80 tr(
"The analysis view requires Qt6 Charts, which was not available when GEMC was "
81 "built.\nInstall the Qt6 Charts package and rebuild GEMC to enable live histograms."));
82 analysisPlaceholder->setAlignment(Qt::AlignCenter);
83 analysisPlaceholder->setWordWrap(
true);
84 rightContent->addWidget(analysisPlaceholder);
87 physicsView =
new PhysicsView(gopts);
88 rightContent->addWidget(physicsView);
91 rightContent->setCurrentIndex(0);
92 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