12#ifndef ROOT7_REveGeomData
13#define ROOT7_REveGeomData
31namespace Experimental {
34class RGeomBrowserIter;
83 std::vector<unsigned char>
raw;
275 int FindNodeId(
const std::vector<int> &stack);
313 std::unique_ptr<REveGeomNodeInfo>
MakeNodeInfo(
const std::string &path);
Configuration parameters which can be configured on the client Send as is to-from client.
bool showtop
show geometry top volume, off by default
int vislevel
visible level
std::string drawopt
draw options for TGeoPainter
int build_shapes
when shapes build on server 0 - never, 1 - TGeoComposite, 2 - plus non-cylindrical,...
int maxnumnodes
maximal number of nodes
int nsegm
number of segments for cylindrical shapes
int maxnumfaces
maximal number of faces
RGeomRawRenderInfo fRawInfo
! raw render info
int nfaces
! number of faces in render data
RGeomRenderInfo * rndr_info()
Provide render info for visible item.
RGeomShapeRenderInfo fShapeInfo
! shape itself as info
TGeoShape * fShape
! original shape
void SetVisLevel(int lvl=3)
Set maximal visible level.
void CollectNodes(REveGeomDrawing &drawing)
Collect nodes which are used in visibles.
REveGeomConfig fCfg
! configuration parameter editable from GUI
std::vector< int > MakeStackByIds(const std::vector< int > &ids)
Creates stack for given array of ids, first element always should be 0.
ShapeDescr & MakeShapeDescr(TGeoShape *shape)
Find description object and create render information.
int GetNumNodes() const
Number of unique nodes in the geometry.
bool IsPreferredOffline() const
Is offline operations preferred.
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...
int GetVisLevel() const
Returns maximal visible level.
int GetMaxVisFaces() const
Returns maximal visible number of faces, ignored when non-positive.
int GetMaxVisNodes() const
Returns maximal visible number of nodes, ignored when non-positive.
void SetMaxVisFaces(int cnt)
Set maximal number of faces which should be selected for drawing.
std::string ProduceModifyReply(int nodeid)
Return string with only part of nodes description which were modified Checks also volume.
int fDrawIdCut
! sortid used for selection of most-significant nodes
std::vector< REveGeomNode > fDesc
converted description, send to client
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 ...
bool CollectVisibles()
Collect all information required to draw geometry on the client This includes list of each visible no...
int GetJsonComp() const
Returns JSON compression level for data transfer.
int fJsonComp
! default JSON compression
void Build(TGeoManager *mgr, const std::string &volname="")
Collect information about geometry hierarchy into flat list like it done JSROOT.GEO....
void SetNSegments(int n=0)
Set number of segments for cylindrical shapes, if 0 - default value will be used.
bool ChangeConfiguration(const std::string &json)
Change configuration by client Returns true if any parameter was really changed.
int ScanNodes(bool only_visible, int maxlvl, REveGeomScanFunc_t func)
Iterate over all nodes and call function for visible.
std::string GetDrawOptions() const
Returns draw options, used for JSROOT TGeoPainter.
int fActualLevel
! level can be reduced when selecting nodes
void ClearDrawData()
Clear raw data. Will be rebuild when next connection will be established.
void SetJsonComp(int comp=0)
Set JSON compression level for data transfer.
std::vector< int > fSortMap
! nodes in order large -> smaller volume
bool ChangeNodeVisibility(int nodeid, bool selected)
Change visibility for specified element Returns true if changes was performed.
int GetNSegments() const
Return of segments for cylindrical shapes, if 0 - default value will be used.
void ProduceIdShifts()
Count total number of visible childs under each node.
bool fPreferredOffline
! indicates that full description should be provided to client
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 thi...
void SetMaxVisNodes(int cnt)
Set maximal number of nodes which should be selected for drawing.
void ResetRndrInfos()
Reset shape info, which used to pack binary data.
friend class RGeomBrowserIter
ShapeDescr & FindShapeDescr(TGeoShape *shape)
Find description object for requested shape If not exists - will be created.
void SetBuildShapes(int lvl=1)
Instruct to build binary 3D model already on the server (true) or send TGeoShape as is to client,...
bool IsPrincipalEndNode(int nodeid)
return true when node used in main geometry drawing and does not have childs for such nodes one could...
int FindNodeId(const std::vector< int > &stack)
Returns nodeid for given stack array, returns -1 in case of failure.
std::string ProcessBrowserRequest(const std::string &req="")
Find description object for requested shape If not exists - will be created.
std::unique_ptr< REveGeomNodeInfo > MakeNodeInfo(const std::string &path)
Change visibility for specified element Returns true if changes was performed.
std::string MakePathByStack(const std::vector< int > &stack)
Returns path string for provided stack.
void SetPreferredOffline(bool on)
Set preference of offline operations.
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...
std::vector< TGeoNode * > fNodes
! flat list of all nodes
const std::string & GetDrawJson() const
REveGeomDescription()=default
int IsBuildShapes() const
Returns true if binary 3D model build already by C++ server (default)
std::vector< int > MakeStackByPath(const std::string &path)
Produce stack based on string path Used to highlight geo volumes by browser hover event.
std::vector< int > MakeIdsByStack(const std::vector< int > &stack)
Produce list of node ids for given stack If found nodes preselected - use their ids.
void SetDrawOptions(const std::string &opt="")
Set draw options as string for JSROOT TGeoPainter.
std::vector< ShapeDescr > fShapes
! shapes with created descriptions
void CopyMaterialProperties(TGeoVolume *vol, REveGeomNode &node)
Copy material properties.
int MarkVisible(bool on_screen=false)
Set visibility flag for each nodes.
std::string fDrawJson
! JSON with main nodes drawn by client
Object with full description for drawing geometry It includes list of visible items and list of nodes...
std::vector< REveGeomNode * > nodes
all used nodes to display visible items and not known for client
std::vector< REveGeomVisible > visibles
all visible items
int numnodes
total number of nodes in description
REveGeomConfig * cfg
current configurations
Base description of geometry node, required only to build hierarchy.
int vis
visibility flag, 0 - off, 1 - only when level==0, 99 - always
int sortid
! place in sorted array, to check cuts, or id of original node when used search structures
bool nochlds
how far in hierarchy depth should be scanned
std::vector< int > chlds
list of childs id
std::string name
node name
std::string color
rgb code without rgb() prefix
int id
node id, index in array
REveGeomNodeBase(int _id=0)
RGeomRenderInfo * ri
rendering information (if applicable)
std::string shape_type
shape type (if any)
std::string fullpath
full path to node
std::string node_type
node class name
std::string node_name
node name
std::string shape_name
shape class name (if any)
Full node description including matrices and other attributes.
std::vector< float > matr
matrix for the node, can have reduced number of elements
bool useflag
! extra flag, used for selection
double vol
! volume estimation
float opacity
! opacity of the color
bool CanDisplay() const
True when there is shape and it can be displayed.
int idshift
! used to jump over then scan all geom hierarchy
int nfaces
! number of shape faces
Request object send from client for different operations.
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
REveGeomVisible contains description of visible node It is path to the node plus reference to shape r...
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,
RGeomRenderInfo * ri
render information for the shape, can be same for different nodes
std::string color
color in rgb format
REveGeomVisible(int _nodeid, int _seqid, const std::vector< int > &_stack)
REveGeomVisible()=default
Render info with raw data.
virtual ~RGeomRawRenderInfo()=default
int sz[3]
fRenderData: [SizeV(), SizeN(), SizeI()];
std::vector< unsigned char > raw
raw shape data with render information, JSON_base64
Base class for render info block.
virtual ~RGeomRenderInfo()=default
virtual destructor required for the I/O
Render info with shape itself - client can produce shape better.
TGeoShape * shape
original shape - can be much less than binary data
virtual ~RGeomShapeRenderInfo()=default
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(REveGeomNode &, std::vector< int > &, bool, int)> REveGeomScanFunc_t
void function(const Char_t *name_, T fun, const Char_t *docstring=0)
static constexpr double s
basic_json< std::map, std::vector, std::string, bool, std::int64_t, std::uint64_t, double, std::allocator, adl_serializer > json