Logo ROOT  
Reference Guide
show_extract.C File Reference

Detailed Description

Helper script for showing of extracted / simplified geometries. By default shows a simplified ALICE geometry.

#include "TFile.h"
#include "TKey.h"
#include "TGeoShape.h"
namespace REX = ROOT::Experimental;
void show_extract(const char* file="csg.root")
{
// disable browser cache - all scripts and html files will be loaded every time, useful for development
// gEnv->SetValue("WebGui.HttpMaxAge", 0);
TIter next(gDirectory->GetListOfKeys());
const TString extract_class("ROOT::Experimental::REveGeoShapeExtract");
REX::REveGeoShape *eve_shape = nullptr;
while (auto key = (TKey *)next())
{
if (extract_class == key->GetClassName())
{
auto gse = (REX::REveGeoShapeExtract*) key->ReadObj();
eveMng->AddGlobalElement(eve_shape);
}
}
if (!eve_shape)
{
Error("show_extract.C", "No keys of class '%s'.", extract_class.Data());
return;
}
eve_shape->GetShape()->Draw("ogl");
}
Author
Matevz Tadel

Definition in file show_extract.C.

TGeoShape.h
ROOT::Experimental::REveGeoShape
Definition: REveGeoShape.hxx:33
ROOT::Experimental::REveManager::Create
static REveManager * Create()
If global REveManager* REX::gEve is not set initialize it.
Definition: REveManager.cxx:698
TFile::Open
static TFile * Open(const char *name, Option_t *option="", const char *ftitle="", Int_t compress=ROOT::RCompressionSetting::EDefaults::kUseCompiledDefault, Int_t netopt=0)
Create / open a file.
Definition: TFile.cxx:3946
ROOT::Experimental::REveGeoShape::GetShape
TGeoShape * GetShape() const
Definition: REveGeoShape.hxx:60
TString
Definition: TString.h:136
TFile.h
ROOT::Experimental::REveGeoShape::ImportShapeExtract
static REveGeoShape * ImportShapeExtract(REveGeoShapeExtract *gse, REveElement *parent=nullptr)
Import a shape extract 'gse' under element 'parent'.
Definition: REveGeoShape.cxx:318
eveMng
REX::REveManager * eveMng
Definition: collection_proxies.C:40
TGeoShape::Draw
virtual void Draw(Option_t *option="")
Draw this shape.
Definition: TGeoShape.cxx:721
ROOT::Experimental::REveGeoShapeExtract
Definition: REveGeoShapeExtract.hxx:23
ROOT::Experimental::REveManager::AddGlobalElement
void AddGlobalElement(REveElement *element, REveElement *parent=nullptr)
Add a global element, i.e.
Definition: REveManager.cxx:305
gDirectory
#define gDirectory
Definition: TDirectory.h:236
REveGeoShape.hxx
TKey
Definition: TKey.h:28
REveManager.hxx
file
Definition: file.py:1
TIter
Definition: TCollection.h:233
ROOT::Experimental
Definition: RDirectory.hxx:36
REveGeoShapeExtract.hxx
TKey.h
Error
void Error(const char *location, const char *msgfmt,...)
Use this function in case an error occurred.
Definition: TError.cxx:187