Logo ROOT  
Reference Guide
 
Loading...
Searching...
No Matches
web_cms.cxx File Reference

Detailed Description

Web-based geometry viewer for CMS geometry.

#include "TGeoManager.h"
#include "TGeoVolume.h"
#include "TFile.h"
void web_cms(bool split = false)
{
TGeoManager::Import("https://root.cern/files/cms.root");
auto viewer = std::make_shared<ROOT::RGeomViewer>(gGeoManager);
// select volume to draw
viewer->SelectVolume("CMSE");
// specify JSROOT draw options - here clipping on X,Y,Z axes
viewer->SetDrawOptions("clipxyz");
// set default limits for number of visible nodes and faces
// when viewer created, initial values exported from TGeoManager
viewer->SetLimits();
viewer->SetShowHierarchy(!split);
// start web browser
viewer->Show();
// destroy viewer only when connection to client is closed
viewer->ClearOnClose(viewer);
if (split) {
// create separate widget with geometry hierarchy only
auto hier = std::make_shared<ROOT::RGeomHierarchy>(viewer->Description());
// start web browser with hierarchy
hier->Show();
// destroy widget only when connection to client is closed
hier->ClearOnClose(hier);
}
}
R__EXTERN TGeoManager * gGeoManager
static Bool_t SetCacheFileDir(std::string_view cacheDir, Bool_t operateDisconnected=kTRUE, Bool_t forceCacheread=kFALSE)
Sets the directory where to locally stage/cache remote files.
Definition TFile.cxx:4623
void SetVisLevel(Int_t level=3)
set default level down to which visualization is performed
static TGeoManager * Import(const char *filename, const char *name="", Option_t *option="")
static function Import a geometry from a gdml or ROOT file
TGeoVolume * GetVolume(const char *name) const
Search for a named volume. All trailing blanks stripped.
void DefaultColors()
Set default volume colors according to A of material.
void SetTransparency(Char_t transparency=0)
Definition TGeoVolume.h:376
void InvisibleAll(Bool_t flag=kTRUE)
Make volume and each of it daughters (in)visible.
void SetLineColor(Color_t lcolor) override
Set the line color.
Author
Sergey Linev

Definition in file web_cms.cxx.