53 lines
1.4 KiB
C++
53 lines
1.4 KiB
C++
#include <QApplication>
|
|
#include "MainWindow.h"
|
|
#include "MainPanel.h"
|
|
#include "ViewportPane.h"
|
|
|
|
#include "Math/ContainerBox.h"
|
|
#include <HEP/Geant/Scene.h>
|
|
#include "HEP/Detectors/DetectorChamber.h"
|
|
#include "Vtk/HEP/Detectors/vtkDetectorChamber.h"
|
|
|
|
#include <Vtk/vtkContainerBox.h>
|
|
#include <Vtk/vtkQViewport.h>
|
|
|
|
#include <vtkSmartPointer.h>
|
|
#include <vtkCubeSource.h>
|
|
#include <vtkPolyDataMapper.h>
|
|
#include <vtkActor.h>
|
|
#include <vtkRenderer.h>
|
|
|
|
|
|
#include "Math/Units.h"
|
|
#include <iostream>
|
|
|
|
using namespace uLib;
|
|
using namespace uLib::literals;
|
|
|
|
int main(int argc, char** argv) {
|
|
QApplication app(argc, argv);
|
|
std::cout << "Starting gcompose Qt application..." << std::endl;
|
|
|
|
ContainerBox world_box(Vector3f(1, 1, 1));
|
|
world_box.Scale(Vector3f(20_mm, 20_mm, 20_mm));
|
|
|
|
Geant::Scene scene;
|
|
scene.ConstructWorldBox(world_box.GetSize(), "G4_AIR");
|
|
scene.Initialize();
|
|
|
|
// 2. Initialize MainWindow (contains embedded VTK QViewport)
|
|
MainWindow window;
|
|
MainPanel* panel = window.getPanel();
|
|
ViewportPane* pane = panel->getFirstPane();
|
|
Vtk::QViewport* viewport = qobject_cast<Vtk::QViewport*>(pane->currentViewport());
|
|
|
|
Vtk::vtkContainerBox vtk_box(&world_box);
|
|
viewport->AddPuppet(vtk_box);
|
|
viewport->ZoomAuto();
|
|
|
|
std::cout << "Geant4 and VTK scenes are ready." << std::endl;
|
|
|
|
window.show();
|
|
return app.exec();
|
|
}
|