Logo ROOT  
Reference Guide
ROOT::Experimental::REveGeomDescription Class Reference

Definition at line 161 of file REveGeomData.hxx.

Classes

class  ShapeDescr
 

Public Member Functions

 REveGeomDescription ()=default
 
void Build (TGeoManager *mgr, const std::string &volname="")
 Collect information about geometry hierarchy into flat list like it done JSROOT.GEO.ClonedNodes.prototype.CreateClones. More...
 
bool ChangeConfiguration (const std::string &json)
 Change configuration by client Returns true if any parameter was really changed. More...
 
bool ChangeNodeVisibility (int nodeid, bool selected)
 Change visibility for specified element Returns true if changes was performed. More...
 
void ClearDrawData ()
 Clear raw data. Will be rebuild when next connection will be established. More...
 
bool CollectVisibles ()
 Collect all information required to draw geometry on the client This includes list of each visible nodes, meshes and matrixes. More...
 
int FindNodeId (const std::vector< int > &stack)
 Returns nodeid for given stack array, returns -1 in case of failure. More...
 
const std::string & GetDrawJson () const
 
std::string GetDrawOptions () const
 Returns draw options, used for JSROOT TGeoPainter. More...
 
int GetJsonComp () const
 Returns JSON compression level for data transfer. More...
 
int GetMaxVisFaces () const
 Returns maximal visible number of faces, ignored when non-positive. More...
 
int GetMaxVisNodes () const
 Returns maximal visible number of nodes, ignored when non-positive. More...
 
int GetNSegments () const
 Return of segments for cylindrical shapes, if 0 - default value will be used. More...
 
int GetNumNodes () const
 Number of unique nodes in the geometry. More...
 
int GetVisLevel () const
 Returns maximal visible level. More...
 
bool HasDrawData () const
 
bool IsBuild () const
 
int IsBuildShapes () const
 Returns true if binary 3D model build already by C++ server (default) More...
 
bool IsPreferredOffline () const
 Is offline operations preferred. More...
 
bool IsPrincipalEndNode (int nodeid)
 return true when node used in main geometry drawing and does not have childs for such nodes one could provide optimize toggling of visibility flags More...
 
std::vector< int > MakeIdsByStack (const std::vector< int > &stack)
 Produce list of node ids for given stack If found nodes preselected - use their ids. More...
 
std::unique_ptr< REveGeomNodeInfoMakeNodeInfo (const std::string &path)
 Change visibility for specified element Returns true if changes was performed. More...
 
std::string MakePathByStack (const std::vector< int > &stack)
 Returns path string for provided stack. More...
 
std::vector< int > MakeStackByIds (const std::vector< int > &ids)
 Creates stack for given array of ids, first element always should be 0. More...
 
std::vector< int > MakeStackByPath (const std::string &path)
 Produce stack based on string path Used to highlight geo volumes by browser hover event. More...
 
std::string ProcessBrowserRequest (const std::string &req="")
 Find description object for requested shape If not exists - will be created. More...
 
bool ProduceDrawingFor (int nodeid, std::string &json, bool check_volume=false)
 Produce shape rendering data for given stack All nodes, which are referencing same shape will be transferred Returns true if new render information provided. More...
 
std::string ProduceModifyReply (int nodeid)
 Return string with only part of nodes description which were modified Checks also volume. More...
 
int SearchVisibles (const std::string &find, std::string &hjson, std::string &json)
 Search visible nodes for provided name If number of found elements less than 100, create description and shapes for them Returns number of match elements. More...
 
void SetBuildShapes (int lvl=1)
 Instruct to build binary 3D model already on the server (true) or send TGeoShape as is to client, which can build model itself. More...
 
void SetDrawOptions (const std::string &opt="")
 Set draw options as string for JSROOT TGeoPainter. More...
 
void SetJsonComp (int comp=0)
 Set JSON compression level for data transfer. More...
 
void SetMaxVisFaces (int cnt)
 Set maximal number of faces which should be selected for drawing. More...
 
void SetMaxVisNodes (int cnt)
 Set maximal number of nodes which should be selected for drawing. More...
 
void SetNSegments (int n=0)
 Set number of segments for cylindrical shapes, if 0 - default value will be used. More...
 
void SetPreferredOffline (bool on)
 Set preference of offline operations. More...
 
void SetVisLevel (int lvl=3)
 Set maximal visible level. More...
 

Private Member Functions

void CollectNodes (REveGeomDrawing &drawing)
 Collect nodes which are used in visibles. More...
 
void CopyMaterialProperties (TGeoVolume *vol, REveGeomNode &node)
 Copy material properties. More...
 
ShapeDescrFindShapeDescr (TGeoShape *shape)
 Find description object for requested shape If not exists - will be created. More...
 
std::string MakeDrawingJson (REveGeomDrawing &drawing, bool has_shapes=false)
 Produce JSON for the drawing If TGeoShape appears in the drawing, one has to keep typeinfo But in this case one can exclude several classes which are not interesting, but appears very often. More...
 
ShapeDescrMakeShapeDescr (TGeoShape *shape)
 Find description object and create render information. More...
 
int MarkVisible (bool on_screen=false)
 Set visibility flag for each nodes. More...
 
void PackMatrix (std::vector< float > &arr, TGeoMatrix *matr)
 Pack matrix into vector, which can be send to client Following sizes can be used for vector: 0 - Identity matrix 3 - Translation 4 - Scale (last element always 1) 9 - Rotation 16 - Full size. More...
 
void ProduceIdShifts ()
 Count total number of visible childs under each node. More...
 
void ResetRndrInfos ()
 Reset shape info, which used to pack binary data. More...
 
int ScanNodes (bool only_visible, int maxlvl, REveGeomScanFunc_t func)
 Iterate over all nodes and call function for visible. More...
 

Private Attributes

int fActualLevel {0}
 ! level can be reduced when selecting nodes More...
 
REveGeomConfig fCfg
 ! configuration parameter editable from GUI More...
 
std::vector< REveGeomNodefDesc
 converted description, send to client More...
 
int fDrawIdCut {0}
 ! sortid used for selection of most-significant nodes More...
 
std::string fDrawJson
 ! JSON with main nodes drawn by client More...
 
int fJsonComp {0}
 ! default JSON compression More...
 
std::vector< TGeoNode * > fNodes
 ! flat list of all nodes More...
 
bool fPreferredOffline {false}
 ! indicates that full description should be provided to client More...
 
std::vector< ShapeDescrfShapes
 ! shapes with created descriptions More...
 
std::vector< int > fSortMap
 ! nodes in order large -> smaller volume More...
 

Friends

class RGeomBrowserIter
 

#include <ROOT/REveGeomData.hxx>

Constructor & Destructor Documentation

◆ REveGeomDescription()

ROOT::Experimental::REveGeomDescription::REveGeomDescription ( )
default

Member Function Documentation

◆ Build()

void ROOT::Experimental::REveGeomDescription::Build ( TGeoManager mgr,
const std::string &  volname = "" 
)

Collect information about geometry hierarchy into flat list like it done JSROOT.GEO.ClonedNodes.prototype.CreateClones.

Definition at line 281 of file REveGeomData.cxx.

◆ ChangeConfiguration()

bool ROOT::Experimental::REveGeomDescription::ChangeConfiguration ( const std::string &  json)

Change configuration by client Returns true if any parameter was really changed.

Definition at line 1313 of file REveGeomData.cxx.

◆ ChangeNodeVisibility()

bool ROOT::Experimental::REveGeomDescription::ChangeNodeVisibility ( int  nodeid,
bool  selected 
)

Change visibility for specified element Returns true if changes was performed.

Definition at line 1242 of file REveGeomData.cxx.

◆ ClearDrawData()

void ROOT::Experimental::REveGeomDescription::ClearDrawData ( )

Clear raw data. Will be rebuild when next connection will be established.

Definition at line 817 of file REveGeomData.cxx.

◆ CollectNodes()

void ROOT::Experimental::REveGeomDescription::CollectNodes ( REveGeomDrawing drawing)
private

Collect nodes which are used in visibles.

Definition at line 498 of file REveGeomData.cxx.

◆ CollectVisibles()

bool ROOT::Experimental::REveGeomDescription::CollectVisibles ( )

Collect all information required to draw geometry on the client This includes list of each visible nodes, meshes and matrixes.

Definition at line 721 of file REveGeomData.cxx.

◆ CopyMaterialProperties()

void ROOT::Experimental::REveGeomDescription::CopyMaterialProperties ( TGeoVolume vol,
REveGeomNode node 
)
private

Copy material properties.

Definition at line 678 of file REveGeomData.cxx.

◆ FindNodeId()

int ROOT::Experimental::REveGeomDescription::FindNodeId ( const std::vector< int > &  stack)

Returns nodeid for given stack array, returns -1 in case of failure.

Definition at line 1007 of file REveGeomData.cxx.

◆ FindShapeDescr()

ROOT::Experimental::REveGeomDescription::ShapeDescr & ROOT::Experimental::REveGeomDescription::FindShapeDescr ( TGeoShape shape)
private

Find description object for requested shape If not exists - will be created.

Definition at line 610 of file REveGeomData.cxx.

◆ GetDrawJson()

const std::string & ROOT::Experimental::REveGeomDescription::GetDrawJson ( ) const
inline

Definition at line 270 of file REveGeomData.hxx.

◆ GetDrawOptions()

std::string ROOT::Experimental::REveGeomDescription::GetDrawOptions ( ) const
inline

Returns draw options, used for JSROOT TGeoPainter.

Definition at line 304 of file REveGeomData.hxx.

◆ GetJsonComp()

int ROOT::Experimental::REveGeomDescription::GetJsonComp ( ) const
inline

Returns JSON compression level for data transfer.

Definition at line 299 of file REveGeomData.hxx.

◆ GetMaxVisFaces()

int ROOT::Experimental::REveGeomDescription::GetMaxVisFaces ( ) const
inline

Returns maximal visible number of faces, ignored when non-positive.

Definition at line 247 of file REveGeomData.hxx.

◆ GetMaxVisNodes()

int ROOT::Experimental::REveGeomDescription::GetMaxVisNodes ( ) const
inline

Returns maximal visible number of nodes, ignored when non-positive.

Definition at line 241 of file REveGeomData.hxx.

◆ GetNSegments()

int ROOT::Experimental::REveGeomDescription::GetNSegments ( ) const
inline

Return of segments for cylindrical shapes, if 0 - default value will be used.

Definition at line 294 of file REveGeomData.hxx.

◆ GetNumNodes()

int ROOT::Experimental::REveGeomDescription::GetNumNodes ( ) const
inline

Number of unique nodes in the geometry.

Definition at line 233 of file REveGeomData.hxx.

◆ GetVisLevel()

int ROOT::Experimental::REveGeomDescription::GetVisLevel ( ) const
inline

Returns maximal visible level.

Definition at line 253 of file REveGeomData.hxx.

◆ HasDrawData()

bool ROOT::Experimental::REveGeomDescription::HasDrawData ( ) const
inline

Definition at line 269 of file REveGeomData.hxx.

◆ IsBuild()

bool ROOT::Experimental::REveGeomDescription::IsBuild ( ) const
inline

Definition at line 235 of file REveGeomData.hxx.

◆ IsBuildShapes()

int ROOT::Experimental::REveGeomDescription::IsBuildShapes ( ) const
inline

Returns true if binary 3D model build already by C++ server (default)

Definition at line 309 of file REveGeomData.hxx.

◆ IsPreferredOffline()

bool ROOT::Experimental::REveGeomDescription::IsPreferredOffline ( ) const
inline

Is offline operations preferred.

After get full description, client can do most operations without extra requests

Definition at line 261 of file REveGeomData.hxx.

◆ IsPrincipalEndNode()

bool ROOT::Experimental::REveGeomDescription::IsPrincipalEndNode ( int  nodeid)

return true when node used in main geometry drawing and does not have childs for such nodes one could provide optimize toggling of visibility flags

Definition at line 826 of file REveGeomData.cxx.

◆ MakeDrawingJson()

std::string ROOT::Experimental::REveGeomDescription::MakeDrawingJson ( REveGeomDrawing drawing,
bool  has_shapes = false 
)
private

Produce JSON for the drawing If TGeoShape appears in the drawing, one has to keep typeinfo But in this case one can exclude several classes which are not interesting, but appears very often.

Definition at line 1218 of file REveGeomData.cxx.

◆ MakeIdsByStack()

std::vector< int > ROOT::Experimental::REveGeomDescription::MakeIdsByStack ( const std::vector< int > &  stack)

Produce list of node ids for given stack If found nodes preselected - use their ids.

Definition at line 1084 of file REveGeomData.cxx.

◆ MakeNodeInfo()

std::unique_ptr< ROOT::Experimental::REveGeomNodeInfo > ROOT::Experimental::REveGeomDescription::MakeNodeInfo ( const std::string &  path)

Change visibility for specified element Returns true if changes was performed.

Definition at line 1273 of file REveGeomData.cxx.

◆ MakePathByStack()

std::string ROOT::Experimental::REveGeomDescription::MakePathByStack ( const std::vector< int > &  stack)

Returns path string for provided stack.

Definition at line 1112 of file REveGeomData.cxx.

◆ MakeShapeDescr()

ROOT::Experimental::REveGeomDescription::ShapeDescr & ROOT::Experimental::REveGeomDescription::MakeShapeDescr ( TGeoShape shape)
private

Find description object and create render information.

Definition at line 626 of file REveGeomData.cxx.

◆ MakeStackByIds()

std::vector< int > ROOT::Experimental::REveGeomDescription::MakeStackByIds ( const std::vector< int > &  ids)

Creates stack for given array of ids, first element always should be 0.

Definition at line 1023 of file REveGeomData.cxx.

◆ MakeStackByPath()

std::vector< int > ROOT::Experimental::REveGeomDescription::MakeStackByPath ( const std::string &  path)

Produce stack based on string path Used to highlight geo volumes by browser hover event.

Definition at line 1062 of file REveGeomData.cxx.

◆ MarkVisible()

int ROOT::Experimental::REveGeomDescription::MarkVisible ( bool  on_screen = false)
private

Set visibility flag for each nodes.

Definition at line 393 of file REveGeomData.cxx.

◆ PackMatrix()

void ROOT::Experimental::REveGeomDescription::PackMatrix ( std::vector< float > &  arr,
TGeoMatrix matr 
)
private

Pack matrix into vector, which can be send to client Following sizes can be used for vector: 0 - Identity matrix 3 - Translation 4 - Scale (last element always 1) 9 - Rotation 16 - Full size.

Definition at line 207 of file REveGeomData.cxx.

◆ ProcessBrowserRequest()

std::string ROOT::Experimental::REveGeomDescription::ProcessBrowserRequest ( const std::string &  req = "")

Find description object for requested shape If not exists - will be created.

Definition at line 535 of file REveGeomData.cxx.

◆ ProduceDrawingFor()

bool ROOT::Experimental::REveGeomDescription::ProduceDrawingFor ( int  nodeid,
std::string &  json,
bool  check_volume = false 
)

Produce shape rendering data for given stack All nodes, which are referencing same shape will be transferred Returns true if new render information provided.

Definition at line 1155 of file REveGeomData.cxx.

◆ ProduceIdShifts()

void ROOT::Experimental::REveGeomDescription::ProduceIdShifts ( )
private

Count total number of visible childs under each node.

Definition at line 426 of file REveGeomData.cxx.

◆ ProduceModifyReply()

std::string ROOT::Experimental::REveGeomDescription::ProduceModifyReply ( int  nodeid)

Return string with only part of nodes description which were modified Checks also volume.

Definition at line 1133 of file REveGeomData.cxx.

◆ ResetRndrInfos()

void ROOT::Experimental::REveGeomDescription::ResetRndrInfos ( )
private

Reset shape info, which used to pack binary data.

Definition at line 711 of file REveGeomData.cxx.

◆ ScanNodes()

int ROOT::Experimental::REveGeomDescription::ScanNodes ( bool  only_visible,
int  maxlvl,
REveGeomScanFunc_t  func 
)
private

Iterate over all nodes and call function for visible.

Definition at line 450 of file REveGeomData.cxx.

◆ SearchVisibles()

int ROOT::Experimental::REveGeomDescription::SearchVisibles ( const std::string &  find,
std::string &  hjson,
std::string &  json 
)

Search visible nodes for provided name If number of found elements less than 100, create description and shapes for them Returns number of match elements.

Definition at line 842 of file REveGeomData.cxx.

◆ SetBuildShapes()

void ROOT::Experimental::REveGeomDescription::SetBuildShapes ( int  lvl = 1)
inline

Instruct to build binary 3D model already on the server (true) or send TGeoShape as is to client, which can build model itself.

Definition at line 307 of file REveGeomData.hxx.

◆ SetDrawOptions()

void ROOT::Experimental::REveGeomDescription::SetDrawOptions ( const std::string &  opt = "")
inline

Set draw options as string for JSROOT TGeoPainter.

Definition at line 302 of file REveGeomData.hxx.

◆ SetJsonComp()

void ROOT::Experimental::REveGeomDescription::SetJsonComp ( int  comp = 0)
inline

Set JSON compression level for data transfer.

Definition at line 297 of file REveGeomData.hxx.

◆ SetMaxVisFaces()

void ROOT::Experimental::REveGeomDescription::SetMaxVisFaces ( int  cnt)
inline

Set maximal number of faces which should be selected for drawing.

Definition at line 244 of file REveGeomData.hxx.

◆ SetMaxVisNodes()

void ROOT::Experimental::REveGeomDescription::SetMaxVisNodes ( int  cnt)
inline

Set maximal number of nodes which should be selected for drawing.

Definition at line 238 of file REveGeomData.hxx.

◆ SetNSegments()

void ROOT::Experimental::REveGeomDescription::SetNSegments ( int  n = 0)
inline

Set number of segments for cylindrical shapes, if 0 - default value will be used.

Definition at line 292 of file REveGeomData.hxx.

◆ SetPreferredOffline()

void ROOT::Experimental::REveGeomDescription::SetPreferredOffline ( bool  on)
inline

Set preference of offline operations.

Server provides more info to client from the begin on to avoid communication

Definition at line 257 of file REveGeomData.hxx.

◆ SetVisLevel()

void ROOT::Experimental::REveGeomDescription::SetVisLevel ( int  lvl = 3)
inline

Set maximal visible level.

Definition at line 250 of file REveGeomData.hxx.

Friends And Related Function Documentation

◆ RGeomBrowserIter

friend class RGeomBrowserIter
friend

Definition at line 163 of file REveGeomData.hxx.

Member Data Documentation

◆ fActualLevel

int ROOT::Experimental::REveGeomDescription::fActualLevel {0}
private

! level can be reduced when selecting nodes

Definition at line 201 of file REveGeomData.hxx.

◆ fCfg

REveGeomConfig ROOT::Experimental::REveGeomDescription::fCfg
private

! configuration parameter editable from GUI

Definition at line 205 of file REveGeomData.hxx.

◆ fDesc

std::vector<REveGeomNode> ROOT::Experimental::REveGeomDescription::fDesc
private

converted description, send to client

Definition at line 194 of file REveGeomData.hxx.

◆ fDrawIdCut

int ROOT::Experimental::REveGeomDescription::fDrawIdCut {0}
private

! sortid used for selection of most-significant nodes

Definition at line 200 of file REveGeomData.hxx.

◆ fDrawJson

std::string ROOT::Experimental::REveGeomDescription::fDrawJson
private

! JSON with main nodes drawn by client

Definition at line 199 of file REveGeomData.hxx.

◆ fJsonComp

int ROOT::Experimental::REveGeomDescription::fJsonComp {0}
private

! default JSON compression

Definition at line 203 of file REveGeomData.hxx.

◆ fNodes

std::vector<TGeoNode *> ROOT::Experimental::REveGeomDescription::fNodes
private

! flat list of all nodes

Definition at line 193 of file REveGeomData.hxx.

◆ fPreferredOffline

bool ROOT::Experimental::REveGeomDescription::fPreferredOffline {false}
private

! indicates that full description should be provided to client

Definition at line 202 of file REveGeomData.hxx.

◆ fShapes

std::vector<ShapeDescr> ROOT::Experimental::REveGeomDescription::fShapes
private

! shapes with created descriptions

Definition at line 197 of file REveGeomData.hxx.

◆ fSortMap

std::vector<int> ROOT::Experimental::REveGeomDescription::fSortMap
private

! nodes in order large -> smaller volume

Definition at line 196 of file REveGeomData.hxx.

Libraries for ROOT::Experimental::REveGeomDescription:
[legend]

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