Logo ROOT  
Reference Guide
REveManager.cxx
Go to the documentation of this file.
1// @(#)root/eve7:$Id$
2// Authors: Matevz Tadel & Alja Mrak-Tadel: 2006, 2007
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#include <ROOT/REveManager.hxx>
13
14#include <ROOT/REveUtil.hxx>
16#include <ROOT/REveViewer.hxx>
17#include <ROOT/REveScene.hxx>
18#include <ROOT/REveClient.hxx>
19#include <ROOT/RWebWindow.hxx>
20#include <ROOT/RFileDialog.hxx>
21#include <ROOT/RLogger.hxx>
22#include <ROOT/REveSystem.hxx>
23
24#include "TGeoManager.h"
25#include "TGeoMatrix.h"
26#include "TObjString.h"
27#include "TROOT.h"
28#include "TSystem.h"
29#include "TFile.h"
30#include "TMap.h"
31#include "TExMap.h"
32#include "TEnv.h"
33#include "TColor.h"
34#include "TPRegexp.h"
35#include "TClass.h"
36#include "TMethod.h"
37#include "TMethodCall.h"
38#include "THttpServer.h"
39#include "TTimer.h"
40#include "TApplication.h"
41
42#include <fstream>
43#include <sstream>
44#include <iostream>
45#include <regex>
46
47#include <nlohmann/json.hpp>
48
49using namespace ROOT::Experimental;
50namespace REX = ROOT::Experimental;
51
52REveManager *REX::gEve = nullptr;
53
54thread_local std::vector<RLogEntry> gEveLogEntries;
55/** \class REveManager
56\ingroup REve
57Central application manager for Eve.
58Manages elements, GUI, GL scenes and GL viewers.
59
60Following parameters can be specified in .rootrc file
61
62WebEve.GLViewer: Three # kind of GLViewer, either Three, JSRoot or RCore
63WebEve.DisableShow: 1 # do not start new web browser when REveManager::Show is called
64WebEve.HTimeout: 200 # timeout in ms for elements highlight
65WebEve.DblClick: Off # mouse double click handling in GL viewer: Off or Reset
66WebEve.TableRowHeight: 33 # size of each row in pixels in the Table view, can be used to make design more compact
67*/
68
69////////////////////////////////////////////////////////////////////////////////
70
72 : // (Bool_t map_window, Option_t* opt) :
73 fExcHandler(nullptr), fVizDB(nullptr), fVizDBReplace(kTRUE), fVizDBUpdate(kTRUE), fGeometries(nullptr),
74 fGeometryAliases(nullptr),
75 fKeepEmptyCont(kFALSE)
76{
77 // Constructor.
78
79 static const REveException eh("REveManager::REveManager ");
80
81 if (REX::gEve)
82 throw eh + "There can be only one REve!";
83
84 REX::gEve = this;
85
87 fServerStatus.fTStart = std::time(nullptr);
88
90
91 fGeometries = new TMap;
95 fVizDB = new TMap;
97
98 fElementIdMap[0] = nullptr; // do not increase count for null element.
99
100 fWorld = new REveScene("EveWorld", "Top-level Eve Scene");
103
104 fSelectionList = new REveElement("Selection List");
105 fSelectionList->SetChildClass(TClass::GetClass<REveSelection>());
108 fSelection = new REveSelection("Global Selection", "", kRed, kViolet);
111 fHighlight = new REveSelection("Global Highlight", "", kGreen, kCyan);
115
116 fViewers = new REveViewerList("Viewers");
119
120 fScenes = new REveSceneList("Scenes");
123
124 fGlobalScene = new REveScene("Geometry scene");
127
128 fEventScene = new REveScene("Event scene");
131
132 {
133 REveViewer *v = SpawnNewViewer("Default Viewer");
134 v->AddScene(fGlobalScene);
135 v->AddScene(fEventScene);
136 }
137
138 // !!! AMT increase threshold to enable color pick on client
140
142 fWebWindow->UseServerThreads();
143 fWebWindow->SetDefaultPage("file:rootui5sys/eve7/index.html");
144
145 const char *gl_viewer = gEnv->GetValue("WebEve.GLViewer", "Three");
146 const char *gl_dblclick = gEnv->GetValue("WebEve.DblClick", "Off");
147 Int_t htimeout = gEnv->GetValue("WebEve.HTimeout", 250);
148 Int_t table_row_height = gEnv->GetValue("WebEve.TableRowHeight", 0);
149 fWebWindow->SetUserArgs(Form("{ GLViewer: \"%s\", DblClick: \"%s\", HTimeout: %d, TableRowHeight: %d }", gl_viewer,
150 gl_dblclick, htimeout, table_row_height));
151
152 // this is call-back, invoked when message received via websocket
153 fWebWindow->SetCallBacks([this](unsigned connid) { WindowConnect(connid); },
154 [this](unsigned connid, const std::string &arg) { WindowData(connid, arg); },
155 [this](unsigned connid) { WindowDisconnect(connid); });
156 fWebWindow->SetGeometry(900, 700); // configure predefined window geometry
157 fWebWindow->SetConnLimit(100); // maximal number of connections
158 fWebWindow->SetMaxQueueLength(30); // number of allowed entries in the window queue
159
160 fMIRExecThread = std::thread{[this] { MIRExecThread(); }};
161}
162
163////////////////////////////////////////////////////////////////////////////////
164/// Destructor.
165
167{
168 fMIRExecThread.join();
169
170 // QQQQ How do we stop THttpServer / fWebWindow?
171
176 // Not needed - no more top-items: fScenes->Destroy();
177 fScenes = nullptr;
178
181 // Not needed - no more top-items: fViewers->Destroy();
182 fViewers = nullptr;
183
184 // fWindowManager->DestroyWindows();
185 // fWindowManager->DecDenyDestroy();
186 // fWindowManager->Destroy();
187 // fWindowManager = 0;
188
191
192 delete fGeometryAliases;
193 delete fGeometries;
194 delete fVizDB;
195 delete fExcHandler;
196}
197
198////////////////////////////////////////////////////////////////////////////////
199/// Create a new GL viewer.
200
201REveViewer *REveManager::SpawnNewViewer(const char *name, const char *title)
202{
203 REveViewer *v = new REveViewer(name, title);
205 return v;
206}
207
208////////////////////////////////////////////////////////////////////////////////
209/// Create a new scene.
210
211REveScene *REveManager::SpawnNewScene(const char *name, const char *title)
212{
213 REveScene *s = new REveScene(name, title);
215 return s;
216}
217
219{
220 printf("REveManager::RegisterRedraw3D() obsolete\n");
221}
222
223////////////////////////////////////////////////////////////////////////////////
224/// Perform 3D redraw of scenes and viewers whose contents has
225/// changed.
226
228{
229 printf("REveManager::DoRedraw3D() obsolete\n");
230}
231
232////////////////////////////////////////////////////////////////////////////////
233/// Perform 3D redraw of all scenes and viewers.
234
235void REveManager::FullRedraw3D(Bool_t /*resetCameras*/, Bool_t /*dropLogicals*/)
236{
237 printf("REveManager::FullRedraw3D() obsolete\n");
238}
239
240////////////////////////////////////////////////////////////////////////////////
241/// Clear all selection objects. Can make things easier for EVE when going to
242/// the next event. Still, destruction os selected object should still work
243/// correctly as long as it is executed within a change cycle.
244
246{
247 for (auto el : fSelectionList->fChildren) {
248 dynamic_cast<REveSelection *>(el)->ClearSelection();
249 }
250}
251
252////////////////////////////////////////////////////////////////////////////////
253/// Add an element. If parent is not specified it is added into
254/// current event (which is created if does not exist).
255
257{
258 if (parent == nullptr) {
259 // XXXX
260 }
261
262 parent->AddElement(element);
263}
264
265////////////////////////////////////////////////////////////////////////////////
266/// Add a global element, i.e. one that does not change on each
267/// event, like geometry or projection manager.
268/// If parent is not specified it is added to a global scene.
269
271{
272 if (!parent)
273 parent = fGlobalScene;
274
275 parent->AddElement(element);
276}
277
278////////////////////////////////////////////////////////////////////////////////
279/// Remove element from parent.
280
282{
283 parent->RemoveElement(element);
284}
285
286////////////////////////////////////////////////////////////////////////////////
287/// Lookup ElementId in element map and return corresponding REveElement*.
288/// Returns nullptr if the id is not found
289
291{
292 auto it = fElementIdMap.find(id);
293 return (it != fElementIdMap.end()) ? it->second : nullptr;
294}
295
296////////////////////////////////////////////////////////////////////////////////
297/// Assign a unique ElementId to given element.
298
300{
301 static const REveException eh("REveManager::AssignElementId ");
302
304 throw eh + "ElementId map is full.";
305
306next_free_id:
307 while (fElementIdMap.find(++fLastElementId) != fElementIdMap.end())
308 ;
309 if (fLastElementId == 0)
310 goto next_free_id;
311 // MT - alternatively, we could spawn a thread to find next thousand or so ids and
312 // put them in a vector of ranges. Or collect them when they are freed.
313 // Don't think this won't happen ... online event display can run for months
314 // and easily produce 100000 objects per minute -- about a month to use up all id space!
315
316 element->fElementId = fLastElementId;
317 fElementIdMap.insert(std::make_pair(fLastElementId, element));
319}
320
321////////////////////////////////////////////////////////////////////////////////
322/// Activate EVE browser (summary view) for specified element id
323
325{
326 nlohmann::json msg = {};
327 msg["content"] = "BrowseElement";
328 msg["id"] = id;
329
330 fWebWindow->Send(0, msg.dump());
331}
332
333////////////////////////////////////////////////////////////////////////////////
334/// Called from REveElement prior to its destruction so the
335/// framework components (like object editor) can unreference it.
336
338{
339 if (el->fImpliedSelected > 0) {
340 for (auto slc : fSelectionList->fChildren) {
341 REveSelection *sel = dynamic_cast<REveSelection *>(slc);
342 sel->RemoveImpliedSelectedReferencesTo(el);
343 }
344
345 if (el->fImpliedSelected != 0)
346 Error("REveManager::PreDeleteElement", "ImpliedSelected not zero (%d) after cleanup of selections.",
347 el->fImpliedSelected);
348 }
349 // Primary selection deregistration is handled through Niece removal from Aunts.
350
351 if (el->fElementId != 0) {
352 auto it = fElementIdMap.find(el->fElementId);
353 if (it != fElementIdMap.end()) {
354 if (it->second == el) {
355 fElementIdMap.erase(it);
357 } else
358 Error("PreDeleteElement", "element ptr in ElementIdMap does not match the argument element.");
359 } else
360 Error("PreDeleteElement", "element id %u was not registered in ElementIdMap.", el->fElementId);
361 } else
362 Error("PreDeleteElement", "element with 0 ElementId passed in.");
363}
364
365////////////////////////////////////////////////////////////////////////////////
366/// Insert a new visualization-parameter database entry. Returns
367/// true if the element is inserted successfully.
368/// If entry with the same key already exists the behaviour depends on the
369/// 'replace' flag:
370/// - true - The old model is deleted and new one is inserted (default).
371/// Clients of the old model are transferred to the new one and
372/// if 'update' flag is true (default), the new model's parameters
373/// are assigned to all clients.
374/// - false - The old model is kept, false is returned.
375///
376/// If insert is successful, the ownership of the model-element is
377/// transferred to the manager.
378
380{
381 TPair *pair = (TPair *)fVizDB->FindObject(tag);
382 if (pair) {
383 if (replace) {
384 model->IncDenyDestroy();
385 model->SetRnrChildren(kFALSE);
386
387 REveElement *old_model = dynamic_cast<REveElement *>(pair->Value());
388 if (old_model) {
389 while (old_model->HasChildren()) {
390 REveElement *el = old_model->FirstChild();
391 el->SetVizModel(model);
392 if (update) {
393 el->CopyVizParams(model);
395 }
396 }
397 old_model->DecDenyDestroy();
398 }
399 pair->SetValue(dynamic_cast<TObject *>(model));
400 return kTRUE;
401 } else {
402 return kFALSE;
403 }
404 } else {
405 model->IncDenyDestroy();
406 model->SetRnrChildren(kFALSE);
407 fVizDB->Add(new TObjString(tag), dynamic_cast<TObject *>(model));
408 return kTRUE;
409 }
410}
411
412////////////////////////////////////////////////////////////////////////////////
413/// Insert a new visualization-parameter database entry with the default
414/// parameters for replace and update, as specified by members
415/// fVizDBReplace(default=kTRUE) and fVizDBUpdate(default=kTRUE).
416/// See docs of the above function.
417
419{
420 return InsertVizDBEntry(tag, model, fVizDBReplace, fVizDBUpdate);
421}
422
423////////////////////////////////////////////////////////////////////////////////
424/// Find a visualization-parameter database entry corresponding to tag.
425/// If the entry is not found 0 is returned.
426
428{
429 return dynamic_cast<REveElement *>(fVizDB->GetValue(tag));
430}
431
432////////////////////////////////////////////////////////////////////////////////
433/// Load visualization-parameter database from file filename. The
434/// replace, update arguments replace the values of fVizDBReplace
435/// and fVizDBUpdate members for the duration of the macro
436/// execution.
437
439{
440 Bool_t ex_replace = fVizDBReplace;
441 Bool_t ex_update = fVizDBUpdate;
442 fVizDBReplace = replace;
444
446
447 fVizDBReplace = ex_replace;
448 fVizDBUpdate = ex_update;
449}
450
451////////////////////////////////////////////////////////////////////////////////
452/// Load visualization-parameter database from file filename.
453/// State of data-members fVizDBReplace and fVizDBUpdate determine
454/// how the registered entries are handled.
455
457{
459 Redraw3D();
460}
461
462////////////////////////////////////////////////////////////////////////////////
463/// Save visualization-parameter database to file filename.
464
466{
467 TPMERegexp re("(.+)\\.\\w+");
468 if (re.Match(filename) != 2) {
469 Error("SaveVizDB", "filename does not match required format '(.+)\\.\\w+'.");
470 return;
471 }
472
473 TString exp_filename(filename);
474 gSystem->ExpandPathName(exp_filename);
475
476 std::ofstream out(exp_filename, std::ios::out | std::ios::trunc);
477 out << "void " << re[1] << "()\n";
478 out << "{\n";
479 out << " REveManager::Create();\n";
480
482
483 Int_t var_id = 0;
484 TString var_name;
485 TIter next(fVizDB);
486 TObjString *key;
487 while ((key = (TObjString *)next())) {
488 REveElement *mdl = dynamic_cast<REveElement *>(fVizDB->GetValue(key));
489 if (mdl) {
490 var_name.Form("x%03d", var_id++);
491 mdl->SaveVizParams(out, key->String(), var_name);
492 } else {
493 Warning("SaveVizDB", "Saving failed for key '%s'.", key->String().Data());
494 }
495 }
496
497 out << "}\n";
498 out.close();
499}
500
501////////////////////////////////////////////////////////////////////////////////
502/// Get geometry with given filename.
503/// This is cached internally so the second time this function is
504/// called with the same argument the same geo-manager is returned.
505/// gGeoManager is set to the return value.
506
508{
509 static const REveException eh("REveManager::GetGeometry ");
510
511 TString exp_filename = filename;
512 gSystem->ExpandPathName(exp_filename);
513 printf("REveManager::GetGeometry loading: '%s' -> '%s'.\n", filename.Data(), exp_filename.Data());
514
516 if (gGeoManager) {
518 } else {
519 Bool_t locked = TGeoManager::IsLocked();
520 if (locked) {
521 Warning("REveManager::GetGeometry", "TGeoManager is locked ... unlocking it.");
523 }
524 if (TGeoManager::Import(filename) == 0) {
525 throw eh + "TGeoManager::Import() failed for '" + exp_filename + "'.";
526 }
527 if (locked) {
529 }
530
532
533 // Import colors exported by Gled, if they exist.
534 {
535 TFile f(exp_filename, "READ");
536 TObjArray *collist = (TObjArray *)f.Get("ColorList");
537 f.Close();
538 if (collist) {
540 TGeoVolume *vol;
541 while ((vol = (TGeoVolume *)next()) != nullptr) {
542 Int_t oldID = vol->GetLineColor();
543 TColor *col = (TColor *)collist->At(oldID);
544 Float_t r, g, b;
545 col->GetRGB(r, g, b);
546 Int_t newID = TColor::GetColor(r, g, b);
547 vol->SetLineColor(newID);
548 }
549 }
550 }
551
553 }
554 return gGeoManager;
555}
556
557////////////////////////////////////////////////////////////////////////////////
558/// Get geometry with given alias.
559/// The alias must be registered via RegisterGeometryAlias().
560
562{
563 static const REveException eh("REveManager::GetGeometry ");
564
565 TObjString *full_name = (TObjString *)fGeometryAliases->GetValue(alias);
566 if (!full_name)
567 throw eh + "geometry alias '" + alias + "' not registered.";
568 return GetGeometry(full_name->String());
569}
570
571////////////////////////////////////////////////////////////////////////////////
572/// Get the default geometry.
573/// It should be registered via RegisterGeometryName("Default", `<URL>`).
574
576{
577 return GetGeometryByAlias("Default");
578}
579
580////////////////////////////////////////////////////////////////////////////////
581/// Register 'name' as an alias for geometry file 'filename'.
582/// The old aliases are silently overwritten.
583/// After that the geometry can be retrieved also by calling:
584/// REX::gEve->GetGeometryByName(name);
585
587{
589}
590
591////////////////////////////////////////////////////////////////////////////////
592/// Work-around uber ugly hack used in SavePrimitive and co.
593
595{
596 TIter nextcl(gROOT->GetListOfClasses());
597 TClass *cls;
598 while ((cls = (TClass *)nextcl())) {
600 }
601}
602
603////////////////////////////////////////////////////////////////////////////////
604/// Register new directory to THttpServer
605// For example: AddLocation("mydir/", "/test/EveWebApp/ui5");
606//
607void REveManager::AddLocation(const std::string &locationName, const std::string &path)
608{
609 fWebWindow->GetServer()->AddLocation(locationName.c_str(), path.c_str());
610}
611
612////////////////////////////////////////////////////////////////////////////////
613/// Set content of default window HTML page
614// Got example: SetDefaultHtmlPage("file:currentdir/test.html")
615//
616void REveManager::SetDefaultHtmlPage(const std::string &path)
617{
618 fWebWindow->SetDefaultPage(path.c_str());
619}
620
621////////////////////////////////////////////////////////////////////////////////
622/// Set client version, used as prefix in scripts URL
623/// When changed, web browser will reload all related JS files while full URL will be different
624/// Default is empty value - no extra string in URL
625/// Version should be string like "1.2" or "ver1.subv2" and not contain any special symbols
626void REveManager::SetClientVersion(const std::string &version)
627{
628 fWebWindow->SetClientVersion(version);
629}
630
631////////////////////////////////////////////////////////////////////////////////
632/// If global REveManager* REX::gEve is not set initialize it.
633/// Returns REX::gEve.
634
636{
637 static const REveException eh("REveManager::Create ");
638
639 if (!REX::gEve) {
640 // XXXX Initialize some server stuff ???
641
642 REX::gEve = new REveManager();
643 }
644 return REX::gEve;
645}
646
647////////////////////////////////////////////////////////////////////////////////
648/// Properly terminate global REveManager.
649
651{
652 if (!REX::gEve)
653 return;
654
655 delete REX::gEve;
656 REX::gEve = nullptr;
657}
658
660{
661 class XThreadTimer : public TTimer {
662 std::function<void()> foo_;
663 public:
664 XThreadTimer(std::function<void()> f) : foo_(f)
665 {
666 SetTime(0);
668 gSystem->AddTimer(this);
669 }
670 Bool_t Notify() override
671 {
672 foo_();
673 gSystem->RemoveTimer(this);
674 delete this;
675 return kTRUE;
676 }
677 };
678
679 new XThreadTimer(func);
680}
681
683{
685 // QQQQ Should call Terminate() but it needs to:
686 // - properly stop MIRExecThread;
687 // - shutdown civet/THttp/RWebWindow
689 });
690}
691
692////////////////////////////////////////////////////////////////////////////////
693/// Process new connection from web window
694
695void REveManager::WindowConnect(unsigned connid)
696{
697 std::unique_lock<std::mutex> lock(fServerState.fMutex);
698
700 {
701 fServerState.fCV.wait(lock);
702 }
703
704 fConnList.emplace_back(connid);
705 printf("connection established %u\n", connid);
706
707 // QQQQ do we want mir-time here as well? maybe set it at the end of function?
708 // Note, this is all under lock, so nobody will get state out in between.
709 fServerStatus.fTLastMir = fServerStatus.fTLastConnect = std::time(nullptr);
711
712 // This prepares core and render data buffers.
713 printf("\nEVEMNG ............. streaming the world scene.\n");
714
715 fWorld->AddSubscriber(std::make_unique<REveClient>(connid, fWebWindow));
717
718 printf(" sending json, len = %d\n", (int)fWorld->fOutputJson.size());
719 Send(connid, fWorld->fOutputJson);
720 printf(" for now assume world-scene has no render data, binary-size=%d\n", fWorld->fTotalBinarySize);
721 assert(fWorld->fTotalBinarySize == 0);
722
723 for (auto &c : fScenes->RefChildren()) {
724 REveScene *scene = dynamic_cast<REveScene *>(c);
725
726 scene->AddSubscriber(std::make_unique<REveClient>(connid, fWebWindow));
727 printf("\nEVEMNG ............. streaming scene %s [%s]\n", scene->GetCTitle(), scene->GetCName());
728
729 // This prepares core and render data buffers.
730 scene->StreamElements();
731
732 printf(" sending json, len = %d\n", (int)scene->fOutputJson.size());
733 Send(connid, scene->fOutputJson);
734
735 if (scene->fTotalBinarySize > 0) {
736 printf(" sending binary, len = %d\n", scene->fTotalBinarySize);
737 SendBinary(connid, &scene->fOutputBinary[0], scene->fTotalBinarySize);
738 } else {
739 printf(" NOT sending binary, len = %d\n", scene->fTotalBinarySize);
740 }
741 }
742
743 fServerState.fCV.notify_all();
744}
745
746////////////////////////////////////////////////////////////////////////////////
747/// Process disconnect of web window
748
749void REveManager::WindowDisconnect(unsigned connid)
750{
751 std::unique_lock<std::mutex> lock(fServerState.fMutex);
753 {
754 fServerState.fCV.wait(lock);
755 }
756 auto conn = fConnList.end();
757 for (auto i = fConnList.begin(); i != fConnList.end(); ++i) {
758 if (i->fId == connid) {
759 conn = i;
760 break;
761 }
762 }
763 // this should not happen, just check
764 if (conn == fConnList.end()) {
765 printf("error, connection not found!");
766 } else {
767 printf("connection closed %u\n", connid);
768 fConnList.erase(conn);
769 for (auto &c : fScenes->RefChildren()) {
770 REveScene *scene = dynamic_cast<REveScene *>(c);
771 scene->RemoveSubscriber(connid);
772 }
773 fWorld->RemoveSubscriber(connid);
774 }
775
776 fServerStatus.fTLastDisconnect = std::time(nullptr);
778
779 fServerState.fCV.notify_all();
780}
781
782////////////////////////////////////////////////////////////////////////////////
783/// Process data from web window
784
785void REveManager::WindowData(unsigned connid, const std::string &arg)
786{
787 static const REveException eh("REveManager::WindowData ");
788
789 // find connection object
790 bool found = false;
791 for (auto &conn : fConnList) {
792 if (conn.fId == connid) {
793 found = true;
794 break;
795 }
796 }
797
798 // this should not happen, just check
799 if (!found) {
800 R__LOG_ERROR(REveLog()) << "Internal error - no connection with id " << connid << " found";
801 return;
802 }
803 // client status data
804 if (arg.compare("__REveDoneChanges") == 0)
805 {
806 std::unique_lock<std::mutex> lock(fServerState.fMutex);
807
808 for (auto &conn : fConnList) {
809 if (conn.fId == connid) {
810 conn.fState = Conn::Free;
811 break;
812 }
813 }
814
815 if (ClientConnectionsFree()) {
817 fServerState.fCV.notify_all();
818 }
819
820 return;
821 }
822 else if (arg.compare( 0, 10, "FILEDIALOG") == 0)
823 {
825 return;
826 }
827
828 nlohmann::json cj = nlohmann::json::parse(arg);
829 if (gDebug > 0)
830 ::Info("REveManager::WindowData", "MIR test %s\n", cj.dump().c_str());
831
832 std::string cmd = cj["mir"];
833 int id = cj["fElementId"];
834 std::string ctype = cj["class"];
835
836 ScheduleMIR(cmd, id, ctype);
837}
838
839//
840//____________________________________________________________________
841void REveManager::ScheduleMIR(const std::string &cmd, ElementId_t id, const std::string& ctype)
842{
843 std::unique_lock<std::mutex> lock(fServerState.fMutex);
844 fServerStatus.fTLastMir = std::time(nullptr);
845 fMIRqueue.push(std::shared_ptr<MIR>(new MIR(cmd, id, ctype)));
847 fServerState.fCV.notify_all();
848}
849
850//
851//____________________________________________________________________
852void REveManager::ExecuteMIR(std::shared_ptr<MIR> mir)
853{
854 static const REveException eh("REveManager::ExecuteMIR ");
855
856 class ChangeSentry {
857 public:
858 ChangeSentry()
859 {
861 gEve->GetScenes()->AcceptChanges(true);
862 }
863 ~ChangeSentry()
864 {
865 gEve->GetScenes()->AcceptChanges(false);
867 }
868 };
869 ChangeSentry cs;
870
871 //if (gDebug > 0)
872 ::Info("REveManager::ExecuteCommand", "MIR cmd %s", mir->fCmd.c_str());
873
874 try {
875 REveElement *el = FindElementById(mir->fId);
876 if ( ! el) throw eh + "Element with id " + mir->fId + " not found";
877
878 static const std::regex cmd_re("^(\\w[\\w\\d]*)\\(\\s*(.*)\\s*\\)\\s*;?\\s*$", std::regex::optimize);
879 std::smatch m;
880 std::regex_search(mir->fCmd, m, cmd_re);
881 if (m.size() != 3)
882 throw eh + "Command string parse error: '" + mir->fCmd + "'.";
883
884 static const TClass *elem_cls = TClass::GetClass<REX::REveElement>();
885
886 TClass *call_cls = TClass::GetClass(mir->fCtype.c_str());
887 if ( ! call_cls)
888 throw eh + "Class '" + mir->fCtype + "' not found.";
889
890 void *el_casted = call_cls->DynamicCast(elem_cls, el, false);
891 if ( ! el_casted)
892 throw eh + "Dynamic cast from REveElement to '" + mir->fCtype + "' failed.";
893
894 std::string tag(mir->fCtype + "::" + m.str(1));
895 std::shared_ptr<TMethodCall> mc;
896
897 auto mmi = fMethCallMap.find(tag);
898 if (mmi != fMethCallMap.end())
899 {
900 mc = mmi->second;
901 }
902 else
903 {
904 const TMethod *meth = call_cls->GetMethodAllAny(m.str(1).c_str());
905 if ( ! meth)
906 throw eh + "Can not find TMethod matching '" + m.str(1) + "'.";
907 mc = std::make_shared<TMethodCall>(meth);
908 fMethCallMap.insert(std::make_pair(tag, mc));
909 }
910
912 mc->Execute(el_casted, m.str(2).c_str());
913
914 // Alternative implementation through Cling. "Leaks" 200 kB per call.
915 // This might be needed for function calls that involve data-types TMethodCall
916 // can not handle.
917 // std::stringstream cmd;
918 // cmd << "((" << mir->fCtype << "*)" << std::hex << std::showbase << (size_t)el << ")->" << mir->fCmd << ";";
919 // std::cout << cmd.str() << std::endl;
920 // gROOT->ProcessLine(cmd.str().c_str());
921 } catch (std::exception &e) {
922 R__LOG_ERROR(REveLog()) << "REveManager::ExecuteCommand " << e.what() << std::endl;
923 } catch (...) {
924 R__LOG_ERROR(REveLog()) << "REveManager::ExecuteCommand unknow execption \n";
925 }
926}
927
928//
929//____________________________________________________________________
931{
932 nlohmann::json jobj = {};
933 jobj["content"] = "BeginChanges";
934 fWebWindow->Send(0, jobj.dump());
935
936 // Process changes in scenes.
939 jobj["content"] = "EndChanges";
940
941 if (!gEveLogEntries.empty()) {
942
943 constexpr static int numLevels = static_cast<int>(ELogLevel::kDebug) + 1;
944 constexpr static std::array<const char *, numLevels> sTag{
945 {"{unset-error-level please report}", "FATAL", "Error", "Warning", "Info", "Debug"}};
946
947 std::stringstream strm;
948 for (auto entry : gEveLogEntries) {
949 int cappedLevel = std::min(static_cast<int>(entry.fLevel), numLevels - 1);
950 strm << sTag[cappedLevel];
951 if (!entry.fLocation.fFuncName.empty())
952 strm << " " << entry.fLocation.fFuncName;
953 strm << " " << entry.fMessage;
954 }
955 jobj["log"] = strm.str();
956 gEveLogEntries.clear();
957 }
958
959 fWebWindow->Send(0, jobj.dump());
960}
961
962//
963//____________________________________________________________________
965{
966#if defined(R__LINUX)
967 pthread_setname_np(pthread_self(), "mir_exec");
968#endif
969 while (true)
970 {
971 std::unique_lock<std::mutex> lock(fServerState.fMutex);
972 abcLabel:
973 if (fMIRqueue.empty())
974 {
975 fServerState.fCV.wait(lock);
976 goto abcLabel;
977 }
979 {
980 std::shared_ptr<MIR> mir = fMIRqueue.front();
981 fMIRqueue.pop();
982
984 lock.unlock();
985
986 ExecuteMIR(mir);
987
988 lock.lock();
991 }
992 }
993}
994
995
996//____________________________________________________________________
997void REveManager::Send(unsigned connid, const std::string &data)
998{
999 fWebWindow->Send(connid, data);
1000}
1001
1002void REveManager::SendBinary(unsigned connid, const void *data, std::size_t len)
1003{
1004 fWebWindow->SendBinary(connid, data, len);
1005}
1006
1008{
1009 for (auto &conn : fConnList) {
1010 if (conn.fState != Conn::Free)
1011 return false;
1012 }
1013
1014 return true;
1015}
1016
1018{
1019 for (auto &conn : fConnList) {
1020 if (conn.fId == cinnId)
1021 {
1022 conn.fState = Conn::WaitingResponse;
1023 break;
1024 }
1025 }
1026}
1027
1029{
1030 for (auto &conn : fConnList) {
1031 if (conn.fId == cinnId)
1032 {
1033 conn.fState = Conn::Processing;
1034 break;
1035 }
1036 }
1037}
1038
1039//////////////////////////////////////////////////////////////////
1040/// Show eve manager in specified browser.
1041
1042/// If rootrc variable WebEve.DisableShow is set, HTTP server will be
1043/// started and access URL printed on stdout.
1044
1046{
1047 if (gEnv->GetValue("WebEve.DisableShow", 0) != 0) {
1048 std::string url = fWebWindow->GetUrl(true);
1049 printf("EVE URL %s\n", url.c_str());
1050 } else {
1051 fWebWindow->Show(args);
1052 }
1053}
1054
1055
1056//____________________________________________________________________
1058{
1059 {
1060 std::unique_lock<std::mutex> lock(fServerState.fMutex);
1062 fServerState.fCV.wait(lock);
1063 }
1065 }
1067 GetScenes()->AcceptChanges(true);
1068}
1069
1070//____________________________________________________________________
1072{
1073 GetScenes()->AcceptChanges(false);
1075
1077
1078 std::unique_lock<std::mutex> lock(fServerState.fMutex);
1080 fServerState.fCV.notify_all();
1081}
1082
1083//____________________________________________________________________
1085{
1086 std::unique_lock<std::mutex> lock(fServerState.fMutex);
1088#if defined(_MSC_VER)
1089 std::timespec_get(&fServerStatus.fTReport, TIME_UTC);
1090#else
1091 fServerStatus.fTReport = std::time_t(nullptr);
1092#endif
1093 st = fServerStatus;
1094}
1095
1096/** \class REveManager::ChangeGuard
1097\ingroup REve
1098RAII guard for locking Eve manager (ctor) and processing changes (dtor).
1099*/
1100
1101//////////////////////////////////////////////////////////////////////
1102//
1103// Helper struct to guard update mechanism
1104//
1106{
1107 gEve->BeginChange();
1108}
1109
1111{
1112 gEve->EndChange();
1113}
1114
1115/** \class REveManager::RExceptionHandler
1116\ingroup REve
1117Exception handler for Eve exceptions.
1118*/
1119
1120////////////////////////////////////////////////////////////////////////////////
1121/// Handle exceptions deriving from REveException.
1122
1124{
1125 REveException *ex = dynamic_cast<REveException *>(&exc);
1126 if (ex) {
1127 Info("Handle", "Exception %s", ex->what());
1128 // REX::gEve->SetStatusLine(ex->Data());
1129 gSystem->Beep();
1130 return kSEHandled;
1131 }
1132 return kSEProceed;
1133}
1134
1135
1136////////////////////////////////////////////////////////////////////////////////
1137/// Utility to stream loggs to client.
1138
1140{
1141 gEveLogEntries.emplace_back(entry);
1142 return true;
1143}
thread_local std::vector< RLogEntry > gEveLogEntries
Definition: REveManager.cxx:54
#define R__LOG_ERROR(...)
Definition: RLogger.hxx:362
#define f(i)
Definition: RSha256.hxx:104
#define c(i)
Definition: RSha256.hxx:101
#define e(i)
Definition: RSha256.hxx:103
static void update(gsl_integration_workspace *workspace, double a1, double b1, double area1, double error1, double a2, double b2, double area2, double error2)
const Bool_t kFALSE
Definition: RtypesCore.h:101
const Bool_t kTRUE
Definition: RtypesCore.h:100
@ kRed
Definition: Rtypes.h:66
@ kGreen
Definition: Rtypes.h:66
@ kCyan
Definition: Rtypes.h:66
@ kViolet
Definition: Rtypes.h:67
R__EXTERN TApplication * gApplication
Definition: TApplication.h:165
R__EXTERN TEnv * gEnv
Definition: TEnv.h:170
void Info(const char *location, const char *msgfmt,...)
Use this function for informational messages.
Definition: TError.cxx:221
void Error(const char *location, const char *msgfmt,...)
Use this function in case an error occurred.
Definition: TError.cxx:188
void Warning(const char *location, const char *msgfmt,...)
Use this function in warning situations.
Definition: TError.cxx:232
R__EXTERN TEveManager * gEve
Definition: TEveManager.h:243
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void data
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void char Point_t Rectangle_t WindowAttributes_t Float_t Float_t Float_t Int_t Int_t UInt_t UInt_t Rectangle_t Int_t Int_t Window_t TString Int_t GCValues_t GetPrimarySelectionOwner GetDisplay GetScreen GetColormap GetNativeEvent const char const char dpyName wid window const char font_name cursor keysym reg const char only_if_exist regb h Point_t winding char text const char depth char const char Int_t count const char ColorStruct_t color const char filename
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void char Point_t Rectangle_t WindowAttributes_t Float_t Float_t Float_t Int_t Int_t UInt_t UInt_t Rectangle_t Int_t Int_t Window_t TString Int_t GCValues_t GetPrimarySelectionOwner GetDisplay GetScreen GetColormap GetNativeEvent const char const char dpyName wid window const char font_name cursor keysym reg const char only_if_exist regb h Point_t winding char text const char depth char const char Int_t count const char ColorStruct_t color const char Pixmap_t Pixmap_t PictureAttributes_t attr const char char ret_data h unsigned char height h Atom_t Int_t ULong_t ULong_t unsigned char prop_list Atom_t sel
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void char Point_t Rectangle_t WindowAttributes_t Float_t Float_t Float_t b
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void char Point_t Rectangle_t WindowAttributes_t Float_t r
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize id
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void char Point_t Rectangle_t WindowAttributes_t Float_t Float_t Float_t Int_t Int_t UInt_t UInt_t Rectangle_t Int_t Int_t Window_t TString Int_t GCValues_t GetPrimarySelectionOwner GetDisplay GetScreen GetColormap GetNativeEvent const char const char dpyName wid window const char font_name cursor keysym reg const char only_if_exist regb h Point_t winding char text const char depth char const char Int_t count const char ColorStruct_t color const char Pixmap_t Pixmap_t PictureAttributes_t attr const char char ret_data h unsigned char height h Atom_t Int_t ULong_t ULong_t unsigned char prop_list Atom_t Atom_t Atom_t Time_t UChar_t len
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void char Point_t Rectangle_t WindowAttributes_t Float_t Float_t g
char name[80]
Definition: TGX11.cxx:110
R__EXTERN TGeoManager * gGeoManager
Definition: TGeoManager.h:602
R__EXTERN TGeoIdentity * gGeoIdentity
Definition: TGeoMatrix.h:478
R__EXTERN TVirtualMutex * gInterpreterMutex
Definition: TInterpreter.h:46
#define R__LOCKGUARD_CLING(mutex)
Definition: TInterpreter.h:51
Int_t gDebug
Definition: TROOT.cxx:585
#define gROOT
Definition: TROOT.h:404
char * Form(const char *fmt,...)
Formats a string in a circular formatting buffer.
Definition: TString.cxx:2456
R__EXTERN TVirtualMutex * gSystemMutex
Definition: TSystem.h:244
R__EXTERN TSystem * gSystem
Definition: TSystem.h:560
#define R__LOCKGUARD2(mutex)
void DecDenyDestroy()
Decreases the deny-destroy count of the element.
void SaveVizParams(std::ostream &out, const TString &tag, const TString &var)
Save visualization parameters for this element with given tag.
const char * GetCTitle() const
const char * GetCName() const
virtual void AddElement(REveElement *el)
Add el to the list of children.
virtual Bool_t SetRnrChildren(Bool_t rnr)
Set render state of this element's children, i.e.
virtual void DestroyElements()
Destroy all children of this element.
REveElement * FirstChild() const
Returns the first child element or 0 if the list is empty.
void IncDenyDestroy()
Increases the deny-destroy count of the element.
virtual void CopyVizParams(const REveElement *el)
Copy visualization parameters from element el.
void SetVizModel(REveElement *model)
Set visualization-parameter model element.
virtual void RemoveElement(REveElement *el)
Remove el from the list of children.
virtual void PropagateVizParamsToProjecteds()
Propagate visualization parameters to dependent elements.
REveException Exception-type thrown by Eve classes.
Definition: REveTypes.hxx:41
bool Emit(const RLogEntry &entry) override
Utility to stream loggs to client.
virtual EStatus Handle(std::exception &exc)
Handle exceptions deriving from REveException.
void ClearROOTClassSaved()
Work-around uber ugly hack used in SavePrimitive and co.
void ScheduleMIR(const std::string &cmd, ElementId_t i, const std::string &ctype)
void RegisterGeometryAlias(const TString &alias, const TString &filename)
Register 'name' as an alias for geometry file 'filename'.
void PreDeleteElement(REveElement *element)
Called from REveElement prior to its destruction so the framework components (like object editor) can...
void ExecuteMIR(std::shared_ptr< MIR > mir)
REveSceneList * GetScenes() const
void ClearAllSelections()
Clear all selection objects.
RExceptionHandler * fExcHandler
exception handler
void AssignElementId(REveElement *element)
Assign a unique ElementId to given element.
TGeoManager * GetDefaultGeometry()
Get the default geometry.
static void ExecuteInMainThread(std::function< void()> func)
void GetServerStatus(REveServerStatus &)
void SetDefaultHtmlPage(const std::string &path)
Set content of default window HTML page.
void AddLocation(const std::string &name, const std::string &path)
Register new directory to THttpServer.
void Send(unsigned connid, const std::string &data)
static void Terminate()
Properly terminate global REveManager.
REveElement * FindElementById(ElementId_t id) const
Lookup ElementId in element map and return corresponding REveElement*.
void SaveVizDB(const TString &filename)
Save visualization-parameter database to file filename.
TGeoManager * GetGeometryByAlias(const TString &alias)
Get geometry with given alias.
std::unordered_map< ElementId_t, REveElement * > fElementIdMap
static REveManager * Create()
If global REveManager* REX::gEve is not set initialize it.
std::unordered_map< std::string, std::shared_ptr< TMethodCall > > fMethCallMap
void WindowConnect(unsigned connid)
Process new connection from web window.
std::vector< Conn > fConnList
REveElement * FindVizDBEntry(const TString &tag)
Find a visualization-parameter database entry corresponding to tag.
TGeoManager * GetGeometry(const TString &filename)
Get geometry with given filename.
std::shared_ptr< ROOT::Experimental::RWebWindow > fWebWindow
std::queue< std::shared_ptr< MIR > > fMIRqueue
void LoadVizDB(const TString &filename, Bool_t replace, Bool_t update)
Load visualization-parameter database from file filename.
void DoRedraw3D()
Perform 3D redraw of scenes and viewers whose contents has changed.
void SendBinary(unsigned connid, const void *data, std::size_t len)
void AddElement(REveElement *element, REveElement *parent=nullptr)
Add an element.
void SetClientVersion(const std::string &version)
Set client version, used as prefix in scripts URL When changed, web browser will reload all related J...
void AddGlobalElement(REveElement *element, REveElement *parent=nullptr)
Add a global element, i.e.
void Redraw3D(Bool_t resetCameras=kFALSE, Bool_t dropLogicals=kFALSE)
void SceneSubscriberWaitingResponse(unsigned cinnId)
REveScene * SpawnNewScene(const char *name, const char *title="")
Create a new scene.
void SceneSubscriberProcessingChanges(unsigned cinnId)
void RemoveElement(REveElement *element, REveElement *parent)
Remove element from parent.
virtual ~REveManager()
Destructor.
void WindowDisconnect(unsigned connid)
Process disconnect of web window.
void FullRedraw3D(Bool_t resetCameras=kFALSE, Bool_t dropLogicals=kFALSE)
Perform 3D redraw of all scenes and viewers.
REveViewer * SpawnNewViewer(const char *name, const char *title="")
Create a new GL viewer.
Bool_t InsertVizDBEntry(const TString &tag, REveElement *model, Bool_t replace, Bool_t update)
Insert a new visualization-parameter database entry.
REveScene * GetWorld() const
void BrowseElement(ElementId_t id)
Activate EVE browser (summary view) for specified element id.
void WindowData(unsigned connid, const std::string &arg)
Process data from web window.
void Show(const RWebDisplayArgs &args="")
Show eve manager in specified browser.
void DestroyScenes()
Destroy all scenes and their contents.
Definition: REveScene.cxx:490
void AcceptChanges(bool)
Set accept changes flag on all scenes.
Definition: REveScene.cxx:504
void AddSubscriber(std::unique_ptr< REveClient > &&sub)
Definition: REveScene.cxx:60
std::vector< char > fOutputBinary
!
Definition: REveScene.hxx:78
void RemoveSubscriber(unsigned int)
Definition: REveScene.cxx:71
REveSelection Container for selected and highlighted elements.
void SetHighlightMode()
Set to 'highlight' mode.
static void Macro(const char *mac)
Execute macro 'mac'. Do not reload the macro.
Definition: REveUtil.cxx:94
REveViewerList List of Viewers providing common operations on REveViewer collections.
Definition: REveViewer.hxx:62
void AddElement(REveElement *el) override
Call base-class implementation.
Definition: REveViewer.cxx:147
REveViewer Reve representation of TGLViewer.
Definition: REveViewer.hxx:28
static std::shared_ptr< RFileDialog > Embedded(const std::shared_ptr< RWebWindow > &window, const std::string &args)
Create dialog instance to use as embedded dialog inside other widget Embedded dialog started on the c...
A diagnostic that can be emitted by the RLogManager.
Definition: RLogger.hxx:178
Holds different arguments for starting browser with RWebDisplayHandle::Display() method.
static std::shared_ptr< RWebWindow > Create()
Create new RWebWindow Using default RWebWindowsManager.
virtual void Terminate(Int_t status=0)
Terminate the application by call TSystem::Exit() unless application has been told to return from Run...
virtual Color_t GetLineColor() const
Return the line color.
Definition: TAttLine.h:33
TClass instances represent classes, structs and namespaces in the ROOT type system.
Definition: TClass.h:81
void * DynamicCast(const TClass *base, void *obj, Bool_t up=kTRUE)
Cast obj of this class type up to baseclass cl if up is true.
Definition: TClass.cxx:4904
TMethod * GetMethodAllAny(const char *method)
Return pointer to method without looking at parameters.
Definition: TClass.cxx:4373
@ kClassSaved
Definition: TClass.h:95
static TClass * GetClass(const char *name, Bool_t load=kTRUE, Bool_t silent=kFALSE)
Static method returning pointer to TClass of the specified class name.
Definition: TClass.cxx:2969
The color creation and management class.
Definition: TColor.h:19
virtual void GetRGB(Float_t &r, Float_t &g, Float_t &b) const
Definition: TColor.h:52
static Int_t GetColor(const char *hexcolor)
Static method returning color number for color specified by hex color string of form: "#rrggbb",...
Definition: TColor.cxx:1823
static void SetColorThreshold(Float_t t)
This method specifies the color threshold used by GetColor to retrieve a color.
Definition: TColor.cxx:1895
virtual Int_t GetValue(const char *name, Int_t dflt) const
Returns the integer value for a resource.
Definition: TEnv.cxx:491
A ROOT file is a suite of consecutive data records (TKey instances) with a well defined format.
Definition: TFile.h:54
An identity transformation.
Definition: TGeoMatrix.h:384
The manager class for any TGeo geometry.
Definition: TGeoManager.h:45
static void UnlockGeometry()
Unlock current geometry.
TObjArray * GetListOfVolumes() const
Definition: TGeoManager.h:493
TObjArray * GetListOfMatrices() const
Definition: TGeoManager.h:490
static Bool_t IsLocked()
Check lock state.
static TGeoManager * Import(const char *filename, const char *name="", Option_t *option="")
static function Import a geometry from a gdml or ROOT file
static void LockGeometry()
Lock current geometry so that no other geometry can be imported.
TGeoVolume * GetTopVolume() const
Definition: TGeoManager.h:532
TGeoVolume, TGeoVolumeMulti, TGeoVolumeAssembly are the volume classes.
Definition: TGeoVolume.h:49
void VisibleDaughters(Bool_t vis=kTRUE)
set visibility for daughters
virtual void SetLineColor(Color_t lcolor)
Set the line color.
TMap implements an associative array of (key,value) pairs using a THashTable for efficient retrieval ...
Definition: TMap.h:40
void Add(TObject *obj) override
This function may not be used (but we need to provide it since it is a pure virtual in TCollection).
Definition: TMap.cxx:54
virtual void SetOwnerKeyValue(Bool_t ownkeys=kTRUE, Bool_t ownvals=kTRUE)
Set ownership for keys and values.
Definition: TMap.cxx:352
TObject * FindObject(const char *keyname) const override
Check if a (key,value) pair exists with keyname as name of the key.
Definition: TMap.cxx:215
TObject * GetValue(const char *keyname) const
Returns a pointer to the value associated with keyname as name of the key.
Definition: TMap.cxx:236
Each ROOT class (see TClass) has a linked list of methods.
Definition: TMethod.h:38
An array of TObjects.
Definition: TObjArray.h:31
TObject * At(Int_t idx) const override
Definition: TObjArray.h:164
Collectable string class.
Definition: TObjString.h:28
TString & String()
Definition: TObjString.h:48
Mother of all ROOT objects.
Definition: TObject.h:41
void ResetBit(UInt_t f)
Definition: TObject.h:200
Wrapper for PCRE library (Perl Compatible Regular Expressions).
Definition: TPRegexp.h:97
Int_t Match(const TString &s, UInt_t start=0)
Runs a match on s against the regex 'this' was created with.
Definition: TPRegexp.cxx:706
Class used by TMap to store (key,value) pairs.
Definition: TMap.h:102
void SetValue(TObject *val)
Definition: TMap.h:122
TObject * Value() const
Definition: TMap.h:121
Basic string class.
Definition: TString.h:136
const char * Data() const
Definition: TString.h:369
void Form(const char *fmt,...)
Formats a string using a printf style format descriptor.
Definition: TString.cxx:2323
void Beep(Int_t freq=-1, Int_t duration=-1, Bool_t setDefault=kFALSE)
Beep for duration milliseconds with a tone of frequency freq.
Definition: TSystem.cxx:327
virtual Bool_t ExpandPathName(TString &path)
Expand a pathname getting rid of special shell characters like ~.
Definition: TSystem.cxx:1277
virtual int GetPid()
Get process id.
Definition: TSystem.cxx:710
virtual void AddTimer(TTimer *t)
Add timer to list of system timers.
Definition: TSystem.cxx:474
virtual int GetProcInfo(ProcInfo_t *info) const
Returns cpu and memory used by this process into the ProcInfo_t structure.
Definition: TSystem.cxx:2498
virtual TTimer * RemoveTimer(TTimer *t)
Remove timer from list of system timers.
Definition: TSystem.cxx:484
Handles synchronous and a-synchronous timer events.
Definition: TTimer.h:51
RVec< PromoteType< T > > trunc(const RVec< T > &v)
Definition: RVec.hxx:1814
Double_t ex[n]
Definition: legend1.C:17
R__EXTERN REveManager * gEve
@ kDebug
Debug information; only useful for developers; can have added verbosity up to 255-kDebug.
RLogChannel & REveLog()
Log channel for Eve diagnostics.
Definition: REveTypes.cxx:47
void(off) SmallVectorTemplateBase< T
void function(const Char_t *name_, T fun, const Char_t *docstring=0)
Definition: RExports.h:167
static constexpr double s
basic_json<> json
Definition: REveElement.hxx:62
TMarker m
Definition: textangle.C:8