12#ifndef ROOT7_RGeomData
13#define ROOT7_RGeomData
29namespace Experimental {
31class RGeomBrowserIter;
79 std::vector<unsigned char>
raw;
282 int FindNodeId(
const std::vector<int> &stack);
290 std::vector<int>
MakeStackByPath(
const std::vector<std::string> &path);
292 std::vector<std::string>
MakePathByStack(
const std::vector<int> &stack);
325 std::unique_ptr<RGeomNodeInfo>
MakeNodeInfo(
const std::vector<std::string> &path);
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void on
Iterator of hierarchical geometry structures.
Configuration parameters which can be configured on the client Send as is to-from client.
int maxnumfaces
maximal number of faces
int build_shapes
when shapes build on server 0 - never, 1 - TGeoComposite, 2 - plus non-cylindrical,...
int vislevel
visible level
std::string drawopt
draw options for TGeoPainter
int nsegm
number of segments for cylindrical shapes
bool showtop
show geometry top volume, off by default
int maxnumnodes
maximal number of nodes
RGeomRawRenderInfo fRawInfo
! raw render info
TGeoShape * fShape
! original shape
int nfaces
! number of faces in render data
RGeomRenderInfo * rndr_info()
Provide render info for visible item.
RGeomShapeRenderInfo fShapeInfo
! shape itself as info
std::vector< int > fSortMap
! nodes in order large -> smaller volume
std::string ProcessBrowserRequest(const std::string &req="")
Find description object for requested shape If not exists - will be created.
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 - Iden...
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 tran...
std::vector< int > MakeIdsByStack(const std::vector< int > &stack)
Produce list of node ids for given stack If found nodes preselected - use their ids.
int fActualLevel
! level can be reduced when selecting nodes
RGeomConfig fCfg
! configuration parameter editable from GUI
int MarkVisible(bool on_screen=false)
Set visibility flag for each nodes.
int GetJsonComp() const
Returns JSON compression level for data transfer.
bool IsPrincipalEndNode(int nodeid)
return true when node used in main geometry drawing and does not have childs for such nodes one could...
int GetMaxVisFaces() const
Returns maximal visible number of faces, ignored when non-positive.
TGeoVolume * fDrawVolume
! select volume independent from TGeoMaanger
int GetNumNodes() const
Number of unique nodes in the geometry.
int GetNSegments() const
Return of segments for cylindrical shapes, if 0 - default value will be used.
void SetMaxVisNodes(int cnt)
Set maximal number of nodes which should be selected for drawing.
void SetVisLevel(int lvl=3)
Set maximal visible level.
int GetMaxVisNodes() const
Returns maximal visible number of nodes, ignored when non-positive.
void ClearDescription()
Clear geometry description.
std::vector< int > MakeStackByIds(const std::vector< int > &ids)
Creates stack for given array of ids, first element always should be 0.
RGeomDescription()=default
int GetVisLevel() const
Returns maximal visible level.
const std::string & GetDrawJson() const
std::vector< RGeomNode > fDesc
converted description, send to client
void SetMaxVisFaces(int cnt)
Set maximal number of faces which should be selected for drawing.
std::vector< ShapeDescr > fShapes
! shapes with created descriptions
std::string MakeDrawingJson(RGeomDrawing &drawing, bool has_shapes=false)
Produce JSON for the drawing If TGeoShape appears in the drawing, one has to keep typeinfo But in thi...
TGeoVolume * GetVolume(int nodeid)
Get volume for specified nodeid If specific volume was configured, it will be returned for nodeid==0.
std::unique_ptr< RGeomNodeInfo > MakeNodeInfo(const std::vector< std::string > &path)
Change visibility for specified element Returns true if changes was performed.
void ProduceDrawData()
Collect all information required to draw geometry on the client This includes list of each visible no...
bool fPreferredOffline
! indicates that full description should be provided to client
std::string GetDrawOptions() const
Returns draw options, used for JSROOT TGeoPainter.
void SetNSegments(int n=0)
Set number of segments for cylindrical shapes, if 0 - default value will be used.
void BuildDescription(TGeoNode *topnode, TGeoVolume *topvolume)
Build geometry description.
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 ...
void ClearDrawData()
Clear raw data. Will be rebuild when next connection will be established.
std::vector< std::string > MakePathByStack(const std::vector< int > &stack)
Returns path string for provided stack.
bool ChangeConfiguration(const std::string &json)
Change configuration by client Returns true if any parameter was really changed.
void CopyMaterialProperties(TGeoVolume *vol, RGeomNode &node)
Copy material properties.
std::vector< int > MakeStackByPath(const std::vector< std::string > &path)
Produce stack based on string path Used to highlight geo volumes by browser hover event.
int ScanNodes(bool only_visible, int maxlvl, RGeomScanFunc_t func)
Iterate over all nodes and call function for visible.
void SetBuildShapes(int lvl=1)
Instruct to build binary 3D model already on the server (true) or send TGeoShape as is to client,...
bool IsPreferredOffline() const
Is offline operations preferred.
std::vector< TGeoNode * > fNodes
! flat list of all nodes
ShapeDescr & MakeShapeDescr(TGeoShape *shape)
Find description object and create render information.
void SetPreferredOffline(bool on)
Set preference of offline operations.
bool GetTopVisible() const
Returns draw options, used for JSROOT TGeoPainter.
int IsBuildShapes() const
Returns true if binary 3D model build already by C++ server (default)
ShapeDescr & FindShapeDescr(TGeoShape *shape)
Find description object for requested shape If not exists - will be created.
std::string fDrawJson
! JSON with main nodes drawn by client
std::string ProduceJson()
Produce JSON string which can be directly used with build function from JSROOT to create three....
int FindNodeId(const std::vector< int > &stack)
Returns nodeid for given stack array, returns -1 in case of failure.
bool ChangeNodeVisibility(int nodeid, bool selected)
Change visibility for specified element Returns true if changes was performed.
void CollectNodes(RGeomDrawing &drawing)
Collect nodes which are used in visibles.
void ProduceIdShifts()
Count total number of visible childs under each node.
std::string ProduceModifyReply(int nodeid)
Return string with only part of nodes description which were modified Checks also volume.
void SetTopVisible(bool on=true)
Set draw options as string for JSROOT TGeoPainter.
void SetDrawOptions(const std::string &opt="")
Set draw options as string for JSROOT TGeoPainter.
void ResetRndrInfos()
Reset shape info, which used to pack binary data.
int fJsonComp
! default JSON compression
void SetJsonComp(int comp=0)
Set JSON compression level for data transfer.
int fDrawIdCut
! sortid used for selection of most-significant nodes
void Build(TGeoManager *mgr, const std::string &volname="")
Collect information about geometry hierarchy into flat list like it done in JSROOT ClonedNodes....
Object with full description for drawing geometry It includes list of visible items and list of nodes...
RGeomConfig * cfg
current configurations
std::vector< RGeomVisible > visibles
all visible items
std::vector< RGeomNode * > nodes
all used nodes to display visible items and not known for client
int numnodes
total number of nodes in description
Base description of geometry node, required only to build hierarchy.
int sortid
! place in sorted array, to check cuts, or id of original node when used search structures
int vis
visibility flag, 0 - off, 1 - only when level==0, 99 - always
int id
node id, index in array
std::string name
node name
bool nochlds
how far in hierarchy depth should be scanned
std::string color
rgb code without rgb() prefix
std::vector< int > chlds
list of childs id
std::string shape_name
shape class name (if any)
std::string shape_type
shape type (if any)
RGeomRenderInfo * ri
rendering information (if applicable)
std::vector< std::string > path
full path to node
std::string node_name
node name
std::string node_type
node class name
Full node description including matrices and other attributes.
double vol
! volume estimation
std::vector< float > matr
matrix for the node, can have reduced number of elements
int idshift
! used to jump over then scan all geom hierarchy
bool CanDisplay() const
True when there is shape and it can be displayed.
bool useflag
! extra flag, used for selection
float opacity
! opacity of the color
int nfaces
! number of shape faces
Render info with raw data.
virtual ~RGeomRawRenderInfo()=default
std::vector< int > idx
vertex indexes, always triangles
std::vector< unsigned char > raw
float vertices as raw data, JSON_base64
Base class for render info block.
virtual ~RGeomRenderInfo()=default
virtual destructor required for the I/O
Request object send from client for different operations.
std::vector< std::string > path
path parameter, used with HOVER
std::vector< int > stack
stack parameter, used with HIGHL
std::string oper
operation like HIGHL or HOVER
Render info with shape itself - client can produce shape better.
TGeoShape * shape
original shape - can be much less than binary data
virtual ~RGeomShapeRenderInfo()=default
RGeomVisible contains description of visible node It is path to the node plus reference to shape rend...
std::string color
color in rgb format
std::vector< int > stack
path to the node, index in list of childs
int seqid
sequence id, used for merging later
int nodeid
selected node id,
RGeomVisible(int _nodeid, int _seqid, const std::vector< int > &_stack)
RGeomRenderInfo * ri
render information for the shape, can be same for different nodes
The manager class for any TGeo geometry.
Geometrical transformation package.
A node represent a volume positioned inside another.They store links to both volumes and to the TGeoM...
Base abstract class for all shapes.
TGeoVolume, TGeoVolumeMulti, TGeoVolumeAssembly are the volume classes.
std::function< bool(RGeomNode &, std::vector< int > &, bool, int)> RGeomScanFunc_t
RLogChannel & RGeomLog()
Log channel for Eve diagnostics.
This file contains a specialised ROOT message handler to test for diagnostic in unit tests.