Logo ROOT  
Reference Guide
MultiView.C File Reference

Detailed Description

Multi-view (3d, rphi, rhoz) service class using EVE Window Manager.

#include <TEveManager.h>
#include <TEveViewer.h>
#include <TGLViewer.h>
#include <TEveScene.h>
#include <TEveBrowser.h>
#include <TEveWindow.h>
// MultiView
//
// Structure encapsulating standard views: 3D, r-phi and rho-z.
// Includes scenes and projection managers.
//
// Should be used in compiled mode.
struct MultiView
{
TEveViewer *f3DView;
TEveViewer *fRPhiView;
TEveViewer *fRhoZView;
TEveScene *fRPhiGeomScene;
TEveScene *fRhoZGeomScene;
TEveScene *fRPhiEventScene;
TEveScene *fRhoZEventScene;
//---------------------------------------------------------------------------
MultiView()
{
// Constructor --- creates required scenes, projection managers
// and GL viewers.
// Scenes
//========
fRPhiGeomScene = gEve->SpawnNewScene("RPhi Geometry",
"Scene holding projected geometry for the RPhi view.");
fRhoZGeomScene = gEve->SpawnNewScene("RhoZ Geometry",
"Scene holding projected geometry for the RhoZ view.");
fRPhiEventScene = gEve->SpawnNewScene("RPhi Event Data",
"Scene holding projected event-data for the RPhi view.");
fRhoZEventScene = gEve->SpawnNewScene("RhoZ Event Data",
"Scene holding projected event-data for the RhoZ view.");
// Projection managers
//=====================
gEve->AddToListTree(fRPhiMgr, kFALSE);
{
a->SetMainColor(kWhite);
a->SetTitle("R-Phi");
a->SetTitleSize(0.05);
a->SetTitleFont(102);
a->SetLabelSize(0.025);
a->SetLabelFont(102);
fRPhiGeomScene->AddElement(a);
}
gEve->AddToListTree(fRhoZMgr, kFALSE);
{
a->SetMainColor(kWhite);
a->SetTitle("Rho-Z");
a->SetTitleSize(0.05);
a->SetTitleFont(102);
a->SetLabelSize(0.025);
a->SetLabelFont(102);
fRhoZGeomScene->AddElement(a);
}
// Viewers
//=========
TEveWindowSlot *slot = 0;
TEveWindowPack *pack = 0;
pack = slot->MakePack();
pack->SetElementName("Multi View");
pack->SetHorizontal();
pack->NewSlot()->MakeCurrent();
f3DView = gEve->SpawnNewViewer("3D View", "");
f3DView->AddScene(gEve->GetEventScene());
pack = pack->NewSlot()->MakePack();
pack->NewSlot()->MakeCurrent();
fRPhiView = gEve->SpawnNewViewer("RPhi View", "");
fRPhiView->AddScene(fRPhiGeomScene);
fRPhiView->AddScene(fRPhiEventScene);
pack->NewSlot()->MakeCurrent();
fRhoZView = gEve->SpawnNewViewer("RhoZ View", "");
fRhoZView->AddScene(fRhoZGeomScene);
fRhoZView->AddScene(fRhoZEventScene);
}
//---------------------------------------------------------------------------
void SetDepth(Float_t d)
{
// Set current depth on all projection managers.
fRPhiMgr->SetCurrentDepth(d);
fRhoZMgr->SetCurrentDepth(d);
}
//---------------------------------------------------------------------------
void ImportGeomRPhi(TEveElement* el)
{
fRPhiMgr->ImportElements(el, fRPhiGeomScene);
}
void ImportGeomRhoZ(TEveElement* el)
{
fRhoZMgr->ImportElements(el, fRhoZGeomScene);
}
void ImportEventRPhi(TEveElement* el)
{
fRPhiMgr->ImportElements(el, fRPhiEventScene);
}
void ImportEventRhoZ(TEveElement* el)
{
fRhoZMgr->ImportElements(el, fRhoZEventScene);
}
//---------------------------------------------------------------------------
void DestroyEventRPhi()
{
fRPhiEventScene->DestroyElements();
}
void DestroyEventRhoZ()
{
fRhoZEventScene->DestroyElements();
}
};
#define d(i)
Definition: RSha256.hxx:102
const Bool_t kFALSE
Definition: RtypesCore.h:88
float Float_t
Definition: RtypesCore.h:53
@ kWhite
Definition: Rtypes.h:63
R__EXTERN TEveManager * gEve
Definition: TEveManager.h:243
virtual void SetElementName(const char *name)
Virtual function for setting of name of an element.
Definition: TEveElement.h:453
Base class for TEveUtil visualization elements, providing hierarchy management, rendering control and...
Definition: TEveElement.h:34
virtual void AddElement(TEveElement *el)
Add el to the list of children.
virtual void DestroyElements()
Destroy all children of this element.
TEveScene * GetGlobalScene() const
Definition: TEveManager.h:147
TEveBrowser * GetBrowser() const
Definition: TEveManager.h:137
TGListTreeItem * AddToListTree(TEveElement *re, Bool_t open, TGListTree *lt=0)
TEveViewer * SpawnNewViewer(const char *name, const char *title="", Bool_t embed=kTRUE)
Create a new GL viewer.
TEveScene * SpawnNewScene(const char *name, const char *title="")
Create a new scene.
TEveScene * GetEventScene() const
Definition: TEveManager.h:148
Axes for non-linear projections.
Manager class for steering of projections and managing projected objects.
virtual TEveElement * ImportElements(TEveElement *el, TEveElement *ext_list=0)
Recursively import elements and apply projection to the newly imported objects.
void SetCurrentDepth(Float_t d)
Eve representation of TGLScene.
Definition: TEveScene.h:27
Eve representation of TGLViewer.
Definition: TEveViewer.h:31
TGLViewer * GetGLViewer() const
Definition: TEveViewer.h:51
virtual void AddScene(TEveScene *scene)
Add 'scene' to the list of scenes.
Definition: TEveViewer.cxx:261
Encapsulates TGPack into an eve-window.
Definition: TEveWindow.h:361
void SetHorizontal()
Definition: TEveWindow.h:381
virtual TEveWindowSlot * NewSlot()
Create a new frame-slot at the last position of the pack.
Description of TEveWindowSlot.
Definition: TEveWindow.h:302
TEveWindowPack * MakePack()
A pack is created in place of this window-slot.
void MakeCurrent()
Make this window current.
Definition: TEveWindow.cxx:919
static TEveWindowSlot * CreateWindowInTab(TGTab *tab, TEveWindow *eve_parent=0)
Create a new tab in a given tab-widget and populate it with a default window-slot.
void SetShowTitleBar(Bool_t x)
Set display state of the title-bar.
Definition: TEveWindow.cxx:898
void SetCurrentCamera(ECameraType camera)
Set current active camera - 'cameraType' one of: kCameraPerspX, kCameraPerspY, kCameraPerspZ,...
Definition: TGLViewer.cxx:1794
@ kCameraOrthoXOY
Definition: TGLViewer.h:64
TGTab * GetTabRight() const
Definition: TRootBrowser.h:141
auto * a
Definition: textangle.C:12
Author
Matevz Tadel

Definition in file MultiView.C.