24#include <TEveBrowser.h>
25#include <TEveManager.h>
26#include <TEveProjectionAxes.h>
27#include <TEveProjectionManager.h>
28#include <TEveWindowManager.h>
30#include <fairlogger/Logger.h>
36namespace event_visualisation
39MultiView* MultiView::sInstance =
nullptr;
51 mSceneDescriptions[
Scene3dGeom] =
"Scene holding 3D geometry.";
52 mSceneDescriptions[
SceneRphiGeom] =
"Scene holding projected geometry for the R-Phi view.";
53 mSceneDescriptions[
SceneZYGeom] =
"Scene holding projected geometry for the Z-Y view.";
54 mSceneDescriptions[
Scene3dEvent] =
"Scene holding 3D event.";
55 mSceneDescriptions[
SceneRphiEvent] =
"Scene holding projected event for the R-Phi view.";
56 mSceneDescriptions[
SceneZYEvent] =
"Scene holding projected event for the Z-Y view.";
66 mScenes[
i] = gEve->SpawnNewScene(mSceneNames[
i].c_str(), mSceneDescriptions[
i].c_str());
70 gEve->GetWindowManager()->RemoveFromListTree(gEve->GetListTree(),
nullptr);
74 mProjections[
ProjectionZY] =
new TEveProjectionManager();
76 mProjections[
ProjectionRphi]->SetProjection(TEveProjection::kPT_RPhi);
77 mProjections[
ProjectionZY]->SetProjection(TEveProjection::kPT_ZY);
80 gEve->GetScenes()->FindListTreeItem(gEve->GetListTree())->SetOpen(
true);
87 TEveProjectionAxes axes(mProjections[
static_cast<EProjections>(
i)]);
88 axes.SetMainColor(kWhite);
89 axes.SetTitle(
"R-Phi");
90 axes.SetTitleSize(0.05);
91 axes.SetTitleFont(102);
92 axes.SetLabelSize(0.025);
93 axes.SetLabelFont(102);
94 mScenes[getSceneOfProjection(
static_cast<EProjections>(
i))]->AddElement(&axes);
101MultiView::~MultiView()
114void MultiView::setupMultiview()
117 TEveWindowSlot* slot = TEveWindow::CreateWindowInTab(gEve->GetBrowser()->GetTabRight());
118 TEveWindowPack*
pack = slot->MakePack();
120 pack->SetElementName(
"Multi View");
121 pack->SetHorizontal();
122 pack->SetShowTitleBar(kFALSE);
123 pack->NewSlotWithWeight(2)->MakeCurrent();
125 mViews[
View3d] = gEve->SpawnNewViewer(
"3D View",
"");
130 pack->SetNameTitle(
"2D Views",
"");
131 pack->SetShowTitleBar(kFALSE);
132 pack->NewSlot()->MakeCurrent();
133 mViews[
ViewRphi] = gEve->SpawnNewViewer(
"R-Phi View",
"");
134 mViews[
ViewRphi]->GetGLViewer()->SetCurrentCamera(TGLViewer::kCameraOrthoXOY);
138 pack->NewSlot()->MakeCurrent();
139 mViews[
ViewZY] = gEve->SpawnNewViewer(
"Z-Y View",
"");
140 mViews[
ViewZY]->GetGLViewer()->SetCurrentCamera(TGLViewer::kCameraOrthoXOY);
144 mAnnotationTop = std::make_unique<TGLAnnotation>(mViews[
View3d]->GetGLViewer(),
"", 0, 1.0);
145 mAnnotationTop->SetState(TGLOverlayElement::kDisabled);
146 mAnnotationTop->SetUseColorSet(
false);
147 mAnnotationTop->SetTextColor(0);
148 mAnnotationTop->SetTextSize(0.05f);
150 mAnnotationBottom = std::make_unique<TGLAnnotation>(mViews[
View3d]->GetGLViewer(),
"", 0, 0.07);
151 mAnnotationBottom->SetState(TGLOverlayElement::kDisabled);
152 mAnnotationBottom->SetUseColorSet(
false);
153 mAnnotationBottom->SetTextColor(0);
154 mAnnotationBottom->SetTextSize(0.03f);
169 for (
const auto& geom : mDetectors) {
170 if (geom->GetElementName() == detectorName) {
181 TEveGeoShape* shape = geometryManager.getGeometryForDetector(detectorName);
183 mDetectors.push_back(shape);
189 LOGF(error,
"MultiView::registerGeometry -- geometry is NULL!");
192 TEveProjectionManager* projection;
199 projection->SetCurrentDepth(-10);
201 projection->SetCurrentDepth(0);
205 projection->SetCurrentDepth(-10);
207 projection->SetCurrentDepth(0);
229 TEveElement*
event = elements[dataType];
230 gEve->GetCurrentEvent()->AddElement(
event);
234 TEveElement*
event = phiElements[dataType];
242 gEve->GetCurrentEvent()->AddElement(
event);
249 if (gEve->GetCurrentEvent()) {
250 gEve->GetCurrentEvent()->RemoveElements();
static bool getAxesShow()
static GeometryManager & getInstance()
Returns an instance of GeometryManager.
@ SceneZYEvent
Z-Y scene of event.
@ SceneZYGeom
Z-Y scene of geometry.
@ SceneRphiGeom
R-Phi scene of geometry.
@ SceneRphiEvent
R-Phi scene of event.
@ NumberOfScenes
Total number of scenes.
@ Scene3dGeom
3D scene of geometry
@ Scene3dEvent
3D scene of event
static MultiView * getInstance()
Returns an instance of the MultiView.
void drawGeometryForDetector(std::string detectorName, bool threeD=true, bool rPhi=true, bool zy=true)
void registerElements(TEveElementList *elements[], TEveElementList *phiElements[])
Registers an elements to be drawn.
void destroyAllEvents()
Removes all shapes representing current event.
@ NumberOfProjections
Total number of projections.
@ ProjectionRphi
R-Phi projection.
@ ProjectionZY
Z-Y projection.
TEveProjectionManager * getProjection(EProjections projection)
Returns pointer to specific projection manager.
TEveGeoShape * getDetectorGeometry(const std::string &detectorName)
void registerElement(TEveElement *event)
Registers an element to be drawn.
TEveScene * getScene(EScenes scene)
Returns pointer to specific scene.
void registerGeometry(TEveGeoShape *geom, bool threeD=true, bool rPhi=true, bool zy=true)
Registers geometry to be drawn in appropriate views.
void destroyAllGeometries()
Removes all geometries.
@ NdataTypes
number of supported data types
a couple of static helper functions to create timestamp values for CCDB queries or override obsolete ...
Defining DataPointCompositeObject explicitly as copiable.