Logo ROOT  
Reference Guide
geom_cms_stereo.C File Reference

Detailed Description

Shows CMS geometry in stereo mode.

This requires quad-buffer support in the OpenGL hardware / driver, otherwise a fatal error occurs.

void geom_cms_stereo(Bool_t quad_buf=kTRUE)
{
gGeoManager = gEve->GetGeometry("http://root.cern.ch/files/cms.root");
auto top = gGeoManager->GetTopVolume()->FindNode("CMSE_1")->GetVolume();
auto trk = new TEveGeoTopNode(gGeoManager, top->FindNode("TRAK_1"));
trk->SetVisLevel(6);
auto calo = new TEveGeoTopNode(gGeoManager, top->FindNode("CALO_1"));
calo->SetVisLevel(3);
auto muon = new TEveGeoTopNode(gGeoManager, top->FindNode("MUON_1"));
muon->SetVisLevel(4);
// --- Stereo ---
TEveWindowSlot* slot = 0;
auto sv = new TEveViewer("Stereo GL", "Stereoscopic view");
sv->SpawnGLViewer(gEve->GetEditor(), kTRUE, quad_buf);
sv->AddScene(gEve->GetGlobalScene());
slot->ReplaceWindow(sv);
// --- Redraw ---
// --- Fix editor ---
// EClipType not exported to CINT (see TGLUtil.h):
// 0 - no clip, 1 - clip plane, 2 - clip box
v->GetClipSet()->SetClipType(TGLClip::EType(1));
v->ColorSet().Background().SetColor(kMagenta+4);
v->SetGuideState(TGLUtil::kAxesEdge, kTRUE, kFALSE, 0);
v->RefreshPadEditor(v);
v->CurrentCamera().RotateRad(-1.2, 0.5);
v->DoDraw();
}
const Bool_t kFALSE
Definition: RtypesCore.h:88
bool Bool_t
Definition: RtypesCore.h:59
const Bool_t kTRUE
Definition: RtypesCore.h:87
@ kMagenta
Definition: Rtypes.h:64
R__EXTERN TEveManager * gEve
Definition: TEveManager.h:243
R__EXTERN TGeoManager * gGeoManager
Definition: TGeoManager.h:601
A wrapper over a TGeoNode, possibly displaced with a global trasformation stored in TEveElement.
Definition: TEveGeoNode.h:93
TEveViewerList * GetViewers() const
Definition: TEveManager.h:145
void AddGlobalElement(TEveElement *element, TEveElement *parent=0)
Add a global element, i.e.
TGLViewer * GetDefaultGLViewer() const
Get TGLViewer of the default TEveViewer.
TEveScene * GetGlobalScene() const
Definition: TEveManager.h:147
TEveBrowser * GetBrowser() const
Definition: TEveManager.h:137
void EditElement(TEveElement *element)
Show element in default editor.
TEveGedEditor * GetEditor() const
Returns main object editor.
static TEveManager * Create(Bool_t map_window=kTRUE, Option_t *opt="FIV")
If global TEveManager* gEve is not set initialize it.
void FullRedraw3D(Bool_t resetCameras=kFALSE, Bool_t dropLogicals=kFALSE)
Perform 3D redraw of all scenes and viewers.
TGeoManager * GetGeometry(const TString &filename)
Get geometry with given filename.
virtual void AddElement(TEveElement *el)
Call base-class implementation.
Definition: TEveViewer.cxx:358
Eve representation of TGLViewer.
Definition: TEveViewer.h:31
Description of TEveWindowSlot.
Definition: TEveWindow.h:302
void ReplaceWindow(TEveWindow *w)
Replace this window with the passed one.
Definition: TEveWindow.cxx:819
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.
static Bool_t SetCacheFileDir(ROOT::Internal::TStringView cacheDir, Bool_t operateDisconnected=kTRUE, Bool_t forceCacheread=kFALSE)
Definition: TFile.h:319
@ kAxesEdge
Definition: TGLUtil.h:948
virtual Bool_t SetTab(Int_t tabIndex, Bool_t emit=kTRUE)
Brings the composite frame with the index tabIndex to the front and generate the following event if t...
Definition: TGTab.cxx:507
void DefaultColors()
Set default volume colors according to A of material.
TGeoNode * FindNode(Bool_t safe_start=kTRUE)
Returns deepest node containing current point.
TGeoVolume * GetTopVolume() const
Definition: TGeoManager.h:531
TGeoVolume * GetVolume() const
Definition: TGeoNode.h:97
TGeoNode * FindNode(const char *name) const
search a daughter inside the list of nodes
TGTab * GetTabRight() const
Definition: TRootBrowser.h:141
Author
Matevz Tadel

Definition in file geom_cms_stereo.C.