Logo ROOT  
Reference Guide
REveGeomViewer.hxx
Go to the documentation of this file.
1// @(#)root/eve7:$Id$
2// Author: Sergey Linev, 13.12.2018
3
4/*************************************************************************
5 * Copyright (C) 1995-2019, Rene Brun and Fons Rademakers. *
6 * All rights reserved. *
7 * *
8 * For the licensing terms see $ROOTSYS/LICENSE. *
9 * For the list of contributors see $ROOTSYS/README/CREDITS. *
10 *************************************************************************/
11
12#ifndef ROOT7_REveGeomViewer
13#define ROOT7_REveGeomViewer
14
16#include <ROOT/REveGeomData.hxx>
17
18#include <memory>
19
20class TGeoManager;
21
22namespace ROOT {
23namespace Experimental {
24
25class RWebWindow;
26class REveManager;
27
29
30 friend class REveManager;
31
32protected:
33
34 TGeoManager *fGeoManager{nullptr}; ///<! geometry to show
35 std::string fSelectedVolume; ///<! name of selected volume
36 REveGeomDescription fDesc; ///<! geometry description, send to the client as first message
37 bool fShowHierarchy{true}; ///<! if hierarchy visible by default
38
39 std::shared_ptr<RWebWindow> fWebWindow; ///<! web window to show geometry
40
41 void WebWindowCallback(unsigned connid, const std::string &arg);
42
43 std::vector<int> GetStackFromJson(const std::string &json, bool node_ids = false);
44
45 void SendGeometry(unsigned connid);
46
47public:
48
49 REveGeomViewer(TGeoManager *mgr = nullptr, const std::string &volname = "");
50 virtual ~REveGeomViewer();
51
52 void SetGeometry(TGeoManager *mgr, const std::string &volname = "");
53
54 void SelectVolume(const std::string &volname);
55
56 /** Configures maximal number of visible nodes and faces */
57 void SetLimits(int nnodes = 5000, int nfaces = 100000)
58 {
59 fDesc.SetMaxVisNodes(nnodes);
60 fDesc.SetMaxVisFaces(nfaces);
61 }
62
63 /** Configures maximal visible level */
64 void SetVisLevel(int lvl = 3)
65 {
66 fDesc.SetVisLevel(lvl);
67 }
68
69 /** Configures default hierarchy browser visibility, only has effect before showing web window */
70 void SetShowHierarchy(bool on = true) { fShowHierarchy = on; }
71
72 /** Returns default hierarchy browser visibility */
73 bool GetShowHierarchy() const { return fShowHierarchy; }
74
75 void SetDrawOptions(const std::string &opt);
76
77 void Show(const RWebDisplayArgs &args = "", bool always_start_new_browser = false);
78
79 void Update();
80
81 void SaveImage(const std::string &fname = "geometry.png");
82
83};
84
85} // namespace Experimental
86} // namespace ROOT
87
88#endif
void SetVisLevel(int lvl=3)
Set maximal visible level.
void SetMaxVisFaces(int cnt)
Set maximal number of faces which should be selected for drawing.
void SetMaxVisNodes(int cnt)
Set maximal number of nodes which should be selected for drawing.
std::string fSelectedVolume
! name of selected volume
void SaveImage(const std::string &fname="geometry.png")
Produce PNG image of drawn geometry Drawing should be completed at the moment Executed asynchronous -...
void SelectVolume(const std::string &volname)
Select visible top volume, all other volumes will be disabled.
void Update()
Update geometry drawings in all web displays.
bool fShowHierarchy
! if hierarchy visible by default
void SendGeometry(unsigned connid)
Send data for principal geometry draw.
std::shared_ptr< RWebWindow > fWebWindow
! web window to show geometry
REveGeomDescription fDesc
! geometry description, send to the client as first message
REveGeomViewer(TGeoManager *mgr=nullptr, const std::string &volname="")
constructor
bool GetShowHierarchy() const
Returns default hierarchy browser visibility.
TGeoManager * fGeoManager
! geometry to show
void SetVisLevel(int lvl=3)
Configures maximal visible level.
void WebWindowCallback(unsigned connid, const std::string &arg)
receive data from client
void SetLimits(int nnodes=5000, int nfaces=100000)
Configures maximal number of visible nodes and faces.
std::vector< int > GetStackFromJson(const std::string &json, bool node_ids=false)
convert JSON into stack array
void SetDrawOptions(const std::string &opt)
Configures draw option for geometry Normally has effect before first drawing of the geometry When geo...
void SetGeometry(TGeoManager *mgr, const std::string &volname="")
assign new geometry to the viewer
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 "rel...
void SetShowHierarchy(bool on=true)
Configures default hierarchy browser visibility, only has effect before showing web window.
Holds different arguments for starting browser with RWebDisplayHandle::Display() method.
The manager class for any TGeo geometry.
Definition: TGeoManager.h:43
tbb::task_arena is an alias of tbb::interface7::task_arena, which doesn't allow to forward declare tb...
Definition: StringConv.hxx:21
basic_json<> json
default JSON class
Definition: REveElement.hxx:88