Logo ROOT  
Reference Guide
 
Loading...
Searching...
No Matches
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 std::string fTitle; ///<! title of geometry viewer
39
40 std::shared_ptr<RWebWindow> fWebWindow; ///<! web window to show geometry
41
42 void WebWindowCallback(unsigned connid, const std::string &arg);
43
44 std::vector<int> GetStackFromJson(const std::string &json, bool node_ids = false);
45
46 void SendGeometry(unsigned connid);
47
48public:
49
50 REveGeomViewer(TGeoManager *mgr = nullptr, const std::string &volname = "");
51 virtual ~REveGeomViewer();
52
53 void SetTitle(const std::string &title) { fTitle = title; }
54 const std::string &GetTitle() const { return fTitle; }
55
56 std::string GetWindowAddr() const;
57
58 void SetGeometry(TGeoManager *mgr, const std::string &volname = "");
59
60 void SelectVolume(const std::string &volname);
61
62 /** Configures maximal number of visible nodes and faces */
63 void SetLimits(int nnodes = 5000, int nfaces = 100000)
64 {
65 fDesc.SetMaxVisNodes(nnodes);
66 fDesc.SetMaxVisFaces(nfaces);
67 }
68
69 /** Configures maximal visible level */
70 void SetVisLevel(int lvl = 3)
71 {
72 fDesc.SetVisLevel(lvl);
73 }
74
75 /** Configures default hierarchy browser visibility, only has effect before showing web window */
76 void SetShowHierarchy(bool on = true) { fShowHierarchy = on; }
77
78 /** Returns default hierarchy browser visibility */
79 bool GetShowHierarchy() const { return fShowHierarchy; }
80
81 void SetDrawOptions(const std::string &opt);
82
83 void Show(const RWebDisplayArgs &args = "", bool always_start_new_browser = false);
84
85 void Update();
86
87 void SaveImage(const std::string &fname = "geometry.png");
88
89};
90
91} // namespace Experimental
92} // namespace ROOT
93
94#endif
Central application manager for Eve.
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 SetTitle(const std::string &title)
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::string GetWindowAddr() const
Return URL address of web window used for geometry viewer.
std::shared_ptr< RWebWindow > fWebWindow
! web window to show geometry
REveGeomDescription fDesc
! geometry description, send to the client as first message
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::string fTitle
! title of geometry viewer
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...
const std::string & GetTitle() const
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:45
tbb::task_arena is an alias of tbb::interface7::task_arena, which doesn't allow to forward declare tb...