Logo ROOT  
Reference Guide
 
Loading...
Searching...
No Matches
ROOT::RGeomViewer Class Reference

Definition at line 27 of file RGeomViewer.hxx.

Public Member Functions

 RGeomViewer (TGeoManager *mgr=nullptr, const std::string &volname="")
 constructor
 
virtual ~RGeomViewer ()
 destructor
 
void ClearOnClose (const std::shared_ptr< void > &handle)
 Set handle which will be cleared when connection is closed Must be called after window is shown.
 
RGeomDescriptionDescription ()
 
bool GetShowColumns () const
 
bool GetShowHierarchy () const
 Returns default hierarchy browser visibility.
 
const std::string & GetTitle () const
 
std::string GetWindowAddr () const
 Return web window address (name) used for geometry viewer.
 
std::string GetWindowUrl (bool remote)
 Return web window URL which can be used for connection See ROOT::RWebWindow::GetUrl docu for more details.
 
void SaveAsMacro (const std::string &fname)
 Save viewer configuration as macro.
 
void SaveImage (const std::string &fname="geometry.png", int width=0, int height=0)
 Produce PNG image of the geometry If web-browser is shown and drawing completed, image is requested from the browser.
 
void SelectVolume (const std::string &volname)
 Select visible top volume, all other volumes will be disabled.
 
void SetDrawOptions (const std::string &opt)
 Configures draw option for geometry Normally has effect before first drawing of the geometry When geometry displayed, only "axis" and "rotate" options are updated.
 
void SetGeometry (TGeoManager *mgr, const std::string &volname="")
 assign new geometry to the viewer
 
void SetLimits (int nnodes=5000, int nfaces=100000)
 Configures maximal number of visible nodes and faces.
 
void SetOnlyVolume (TGeoVolume *vol)
 Draw only specified volume, special case when volume stored without valid geomanager.
 
void SetShowColumns (bool on=true)
 
void SetShowHierarchy (bool on=true)
 Configures default hierarchy browser visibility, only has effect before showing web window.
 
void SetTitle (const std::string &title)
 
void SetTopVisible (bool on=true)
 
void SetVisLevel (int lvl=3)
 Configures maximal visible level.
 
void Show (const RWebDisplayArgs &args="", bool always_start_new_browser=false)
 Show or update geometry in web window If web browser already started - just refresh drawing like "reload" button does If no web window exists or.
 
void Update ()
 Update geometry drawings in all web displays.
 

Protected Member Functions

std::vector< intGetStackFromJson (const std::string &json, bool node_ids=false)
 convert JSON into stack array
 
void ProcessSignal (const std::string &)
 Process signal from geom description when it changed by any means.
 
void SendGeometry (unsigned connid=0, bool first_time=false)
 Send data for principal geometry draw Should be used when essential settings were changed in geometry description.
 
void WebWindowCallback (unsigned connid, const std::string &arg)
 Process data from client.
 
void WebWindowDisconnect (unsigned connid)
 Process disconnect event Clear cache data and dependent connections.
 

Protected Attributes

RGeomDescription fDesc
 ! geometry description, send to the client as first message
 
TGeoManagerfGeoManager {nullptr}
 ! geometry to show
 
bool fInfoActive {false}
 ! true when info page active and node info need to be provided
 
std::string fSelectedVolume
 ! name of selected volume
 
bool fShowColumns {true}
 ! show columns in hierarchy
 
bool fShowHierarchy {true}
 ! if hierarchy visible by default
 
std::string fTitle
 ! title of geometry viewer
 
std::shared_ptr< RGeomHierarchyfWebHierarchy
 ! web handle for hierarchy part
 
std::shared_ptr< RWebWindowfWebWindow
 ! web window to show geometry
 

#include <ROOT/RGeomViewer.hxx>

Constructor & Destructor Documentation

◆ RGeomViewer()

RGeomViewer::RGeomViewer ( TGeoManager mgr = nullptr,
const std::string &  volname = "" 
)

constructor

Definition at line 35 of file RGeomViewer.cxx.

◆ ~RGeomViewer()

RGeomViewer::~RGeomViewer ( )
virtual

destructor

Definition at line 63 of file RGeomViewer.cxx.

Member Function Documentation

◆ ClearOnClose()

void RGeomViewer::ClearOnClose ( const std::shared_ptr< void > &  handle)

Set handle which will be cleared when connection is closed Must be called after window is shown.

Definition at line 444 of file RGeomViewer.cxx.

◆ Description()

RGeomDescription & ROOT::RGeomViewer::Description ( )
inline

Definition at line 107 of file RGeomViewer.hxx.

◆ GetShowColumns()

bool ROOT::RGeomViewer::GetShowColumns ( ) const
inline

Definition at line 97 of file RGeomViewer.hxx.

◆ GetShowHierarchy()

bool ROOT::RGeomViewer::GetShowHierarchy ( ) const
inline

Returns default hierarchy browser visibility.

Definition at line 93 of file RGeomViewer.hxx.

◆ GetStackFromJson()

std::vector< int > RGeomViewer::GetStackFromJson ( const std::string &  json,
bool  node_ids = false 
)
protected

convert JSON into stack array

Definition at line 164 of file RGeomViewer.cxx.

◆ GetTitle()

const std::string & ROOT::RGeomViewer::GetTitle ( ) const
inline

Definition at line 59 of file RGeomViewer.hxx.

◆ GetWindowAddr()

std::string RGeomViewer::GetWindowAddr ( ) const

Return web window address (name) used for geometry viewer.

Definition at line 133 of file RGeomViewer.cxx.

◆ GetWindowUrl()

std::string RGeomViewer::GetWindowUrl ( bool  remote)

Return web window URL which can be used for connection See ROOT::RWebWindow::GetUrl docu for more details.

Definition at line 142 of file RGeomViewer.cxx.

◆ ProcessSignal()

void RGeomViewer::ProcessSignal ( const std::string &  kind)
protected

Process signal from geom description when it changed by any means.

Definition at line 365 of file RGeomViewer.cxx.

◆ SaveAsMacro()

void RGeomViewer::SaveAsMacro ( const std::string &  fname)

Save viewer configuration as macro.

Definition at line 397 of file RGeomViewer.cxx.

◆ SaveImage()

void RGeomViewer::SaveImage ( const std::string &  fname = "geometry.png",
int  width = 0,
int  height = 0 
)

Produce PNG image of the geometry If web-browser is shown and drawing completed, image is requested from the browser.

In this case method executed asynchronously - it returns immediately and image will stored shortly afterwards when received from the client Height and width parameters are ignored in that case and derived from actual drawing size in the browser. Another possibility is to invoke headless browser, providing positive width and height parameter explicitely

Definition at line 231 of file RGeomViewer.cxx.

◆ SelectVolume()

void RGeomViewer::SelectVolume ( const std::string &  volname)

Select visible top volume, all other volumes will be disabled.

Definition at line 84 of file RGeomViewer.cxx.

◆ SendGeometry()

void RGeomViewer::SendGeometry ( unsigned  connid = 0,
bool  first_time = false 
)
protected

Send data for principal geometry draw Should be used when essential settings were changed in geometry description.

Definition at line 185 of file RGeomViewer.cxx.

◆ SetDrawOptions()

void RGeomViewer::SetDrawOptions ( const std::string &  opt)

Configures draw option for geometry Normally has effect before first drawing of the geometry When geometry displayed, only "axis" and "rotate" options are updated.

Definition at line 213 of file RGeomViewer.cxx.

◆ SetGeometry()

void RGeomViewer::SetGeometry ( TGeoManager mgr,
const std::string &  volname = "" 
)

assign new geometry to the viewer

Definition at line 71 of file RGeomViewer.cxx.

◆ SetLimits()

void ROOT::RGeomViewer::SetLimits ( int  nnodes = 5000,
int  nfaces = 100000 
)
inline

Configures maximal number of visible nodes and faces.

Definition at line 72 of file RGeomViewer.hxx.

◆ SetOnlyVolume()

void RGeomViewer::SetOnlyVolume ( TGeoVolume vol)

Draw only specified volume, special case when volume stored without valid geomanager.

Definition at line 93 of file RGeomViewer.cxx.

◆ SetShowColumns()

void ROOT::RGeomViewer::SetShowColumns ( bool  on = true)
inline

Definition at line 95 of file RGeomViewer.hxx.

◆ SetShowHierarchy()

void ROOT::RGeomViewer::SetShowHierarchy ( bool  on = true)
inline

Configures default hierarchy browser visibility, only has effect before showing web window.

Definition at line 90 of file RGeomViewer.hxx.

◆ SetTitle()

void ROOT::RGeomViewer::SetTitle ( const std::string &  title)
inline

Definition at line 58 of file RGeomViewer.hxx.

◆ SetTopVisible()

void ROOT::RGeomViewer::SetTopVisible ( bool  on = true)
inline

Definition at line 84 of file RGeomViewer.hxx.

◆ SetVisLevel()

void ROOT::RGeomViewer::SetVisLevel ( int  lvl = 3)
inline

Configures maximal visible level.

Definition at line 79 of file RGeomViewer.hxx.

◆ Show()

void RGeomViewer::Show ( const RWebDisplayArgs args = "",
bool  always_start_new_browser = false 
)

Show or update geometry in web window If web browser already started - just refresh drawing like "reload" button does If no web window exists or.

Parameters
always_start_new_browserconfigured, starts new window
argsarguments to display

Definition at line 109 of file RGeomViewer.cxx.

◆ Update()

void RGeomViewer::Update ( )

Update geometry drawings in all web displays.

Definition at line 150 of file RGeomViewer.cxx.

◆ WebWindowCallback()

void RGeomViewer::WebWindowCallback ( unsigned  connid,
const std::string &  arg 
)
protected

Process data from client.

Definition at line 260 of file RGeomViewer.cxx.

◆ WebWindowDisconnect()

void RGeomViewer::WebWindowDisconnect ( unsigned  connid)
protected

Process disconnect event Clear cache data and dependent connections.

Definition at line 353 of file RGeomViewer.cxx.

Member Data Documentation

◆ fDesc

RGeomDescription ROOT::RGeomViewer::fDesc
protected

! geometry description, send to the client as first message

Definition at line 33 of file RGeomViewer.hxx.

◆ fGeoManager

TGeoManager* ROOT::RGeomViewer::fGeoManager {nullptr}
protected

! geometry to show

Definition at line 31 of file RGeomViewer.hxx.

◆ fInfoActive

bool ROOT::RGeomViewer::fInfoActive {false}
protected

! true when info page active and node info need to be provided

Definition at line 37 of file RGeomViewer.hxx.

◆ fSelectedVolume

std::string ROOT::RGeomViewer::fSelectedVolume
protected

! name of selected volume

Definition at line 32 of file RGeomViewer.hxx.

◆ fShowColumns

bool ROOT::RGeomViewer::fShowColumns {true}
protected

! show columns in hierarchy

Definition at line 35 of file RGeomViewer.hxx.

◆ fShowHierarchy

bool ROOT::RGeomViewer::fShowHierarchy {true}
protected

! if hierarchy visible by default

Definition at line 34 of file RGeomViewer.hxx.

◆ fTitle

std::string ROOT::RGeomViewer::fTitle
protected

! title of geometry viewer

Definition at line 36 of file RGeomViewer.hxx.

◆ fWebHierarchy

std::shared_ptr<RGeomHierarchy> ROOT::RGeomViewer::fWebHierarchy
protected

! web handle for hierarchy part

Definition at line 41 of file RGeomViewer.hxx.

◆ fWebWindow

std::shared_ptr<RWebWindow> ROOT::RGeomViewer::fWebWindow
protected

! web window to show geometry

Definition at line 39 of file RGeomViewer.hxx.

Libraries for ROOT::RGeomViewer:

The documentation for this class was generated from the following files: