Logo ROOT  
Reference Guide
TEveUtil.cxx
Go to the documentation of this file.
1 // @(#)root/eve:$Id$
2 // Authors: Matevz Tadel & Alja Mrak-Tadel: 2006, 2007
3 
4 /*************************************************************************
5  * Copyright (C) 1995-2007, 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 "TEveUtil.h"
13 #include "TEveElement.h"
14 #include "TEveManager.h"
15 
16 #include "TError.h"
17 #include "TGeoManager.h"
18 #include "TGeoMatrix.h"
19 #include "TClass.h"
20 #include "TMath.h"
21 #include "TColor.h"
22 
23 #include "TROOT.h"
24 #include "TInterpreter.h"
25 #include "TSystem.h"
26 
27 #include "TGClient.h"
28 #include "TGMimeTypes.h"
29 
30 #include <list>
31 #include <algorithm>
32 #include <string>
33 
34 /** \class TEveUtil
35 \ingroup TEve
36 Standard utility functions for Eve.
37 */
38 
40 
42 
43 ////////////////////////////////////////////////////////////////////////////////
44 /// Setup Include and Macro paths.
45 /// Since inclusion into ROOT this does nothing but could
46 /// potentially be reactivated if some common macros are established
47 /// and shipped with binary ROOT (in macros/eve). For example, these
48 /// might be used to spawn specific GUI / GL configurations.
49 
51 {
52  static const TEveException eh("TEveUtil::SetupEnvironment");
53  static Bool_t setupDone = kFALSE;
54 
55  if (setupDone) {
56  Info(eh.Data(), "has already been run.");
57  return;
58  }
59 
60  // Old initialization for ALICE.
61  // Left as an example.
62  /*
63  // Check if REVESYS exists, try fallback to $ALICE_ROOT/EVE.
64  if(gSystem->Getenv("REVESYS") == 0) {
65  if(gSystem->Getenv("ALICE_ROOT") != 0) {
66  Info(eh.Data(), "setting REVESYS from ALICE_ROOT.");
67  gSystem->Setenv("REVESYS", Form("%s/EVE", gSystem->Getenv("ALICE_ROOT")));
68  } else {
69  Error(eh.Data(), "REVESYS not defined, neither is ALICE_ROOT.");
70  gSystem->Exit(1);
71  }
72  }
73  if(gSystem->AccessPathName(gSystem->Getenv("REVESYS")) == kTRUE) {
74  Error(eh.Data(), "REVESYS '%s' does not exist.", gSystem->Getenv("REVESYS"));
75  gSystem->Exit(1);
76  }
77 
78  TString macPath(gROOT->GetMacroPath());
79  macPath += Form(":%s/macros", gSystem->Getenv("REVESYS"));
80  gInterpreter->AddIncludePath(gSystem->Getenv("REVESYS"));
81  if(gSystem->Getenv("ALICE_ROOT") != 0) {
82  macPath += Form(":%s/alice-macros", gSystem->Getenv("REVESYS"));
83  gInterpreter->AddIncludePath(Form("%s/include", gSystem->Getenv("ALICE_ROOT")));
84  gInterpreter->AddIncludePath(gSystem->Getenv("ALICE_ROOT"));
85  }
86  gROOT->SetMacroPath(macPath);
87  */
88 }
89 
90 ////////////////////////////////////////////////////////////////////////////////
91 /// Setup icon pictures and mime-types.
92 
94 {
95  TEveElement::fgRnrIcons[0] = gClient->GetPicture("eve_rnr00_t.xpm");
96  TEveElement::fgRnrIcons[1] = gClient->GetPicture("eve_rnr01_t.xpm");
97  TEveElement::fgRnrIcons[2] = gClient->GetPicture("eve_rnr10_t.xpm");
98  TEveElement::fgRnrIcons[3] = gClient->GetPicture("eve_rnr11_t.xpm");
99 
100  TEveElement::fgListTreeIcons[0] = gClient->GetPicture("folder_t.xpm");
101  TEveElement::fgListTreeIcons[1] = gClient->GetPicture("eve_viewer.xpm");
102  TEveElement::fgListTreeIcons[2] = gClient->GetPicture("eve_scene.xpm");
103  TEveElement::fgListTreeIcons[3] = gClient->GetPicture("eve_pointset.xpm");
104  TEveElement::fgListTreeIcons[4] = gClient->GetPicture("eve_track.xpm");
105  TEveElement::fgListTreeIcons[5] = gClient->GetPicture("eve_text.gif");
106  TEveElement::fgListTreeIcons[6] = gClient->GetPicture("eve_axes.xpm");
107  TEveElement::fgListTreeIcons[7] = gClient->GetPicture("ofolder_t.xpm");
108  TEveElement::fgListTreeIcons[8] = gClient->GetPicture("eve_line.xpm");
109 
110  gClient->GetMimeTypeList()->AddType("root/tmacro", "TEveMacro",
111  "tmacro_s.xpm", "tmacro_t.xpm", "");
112 }
113 
114 namespace
115 {
116 ////////////////////////////////////////////////////////////////////////////////
117 /// Remove last part of string 's', starting from the last
118 /// occurrence of character 'c'.
119 /// Remove directory part -- everything until the last '/'.
120 
121 void ChompTailAndDir(TString& s, char c='.')
122 {
123  Ssiz_t p = s.Last(c);
124  if (p != kNPOS)
125  s.Remove(p);
126 
127  Ssiz_t ls = s.Last('/');
128  if (ls != kNPOS)
129  s.Remove(0, ls + 1);
130 }
131 }
132 
133 ////////////////////////////////////////////////////////////////////////////////
134 /// Checks if macro 'mac' is loaded.
135 
136 Bool_t TEveUtil::CheckMacro(const char* mac)
137 {
138  // Axel's advice; now sth seems slow, using old method below for test.
139  // return gROOT->GetInterpreter()->IsLoaded(mac);
140 
141  // Previous version expected function with same name and used ROOT's
142  // list of global functions.
143 
144  TString foo(mac); ChompTailAndDir(foo);
145  if (gROOT->GetGlobalFunction(foo.Data(), 0, kFALSE) != 0)
146  return kTRUE;
147  else
148  return (gROOT->GetGlobalFunction(foo.Data(), 0, kTRUE) != 0);
149 }
150 
151 ////////////////////////////////////////////////////////////////////////////////
152 /// Load and execute macro 'mac' if it has not been loaded yet.
153 
154 void TEveUtil::AssertMacro(const char* mac)
155 {
156  if( CheckMacro(mac) == kFALSE) {
157  gROOT->Macro(mac);
158  }
159 }
160 
161 ////////////////////////////////////////////////////////////////////////////////
162 /// Execute macro 'mac'. Do not reload the macro.
163 
164 void TEveUtil::Macro(const char* mac)
165 {
166  if (CheckMacro(mac) == kFALSE) {
167  gROOT->LoadMacro(mac);
168  }
169  TString foo(mac); ChompTailAndDir(foo); foo += "()";
170  gROOT->ProcessLine(foo.Data());
171 }
172 
173 ////////////////////////////////////////////////////////////////////////////////
174 /// Makes sure that macro 'mac' is loaded, but do not reload it.
175 
176 void TEveUtil::LoadMacro(const char* mac)
177 {
178  if (CheckMacro(mac) == kFALSE) {
179  gROOT->LoadMacro(mac);
180  }
181 }
182 
183 ////////////////////////////////////////////////////////////////////////////////
184 /// Fill col with RGBA values corresponding to index ci. If alpha
185 /// is true, set alpha component of col to 255.
186 /// ROOT's indexed color palette does not support transparency.
187 
189 {
190  TColor* c = gROOT->GetColor(ci);
191  if (c)
192  {
193  col[0] = (UChar_t)(255*c->GetRed());
194  col[1] = (UChar_t)(255*c->GetGreen());
195  col[2] = (UChar_t)(255*c->GetBlue());
196  if (alpha) col[3] = 255;
197  }
198  else
199  {
200  // Set to magenta.
201  col[0] = 255; col[1] = 0; col[2] = 255;
202  if (alpha) col[3] = 255;
203  return;
204  }
205 }
206 
207 ////////////////////////////////////////////////////////////////////////////////
208 /// Fill col with RGBA values corresponding to index ci and transparency.
209 /// ROOT's indexed color palette does not support transparency.
210 
211 void TEveUtil::ColorFromIdx(Color_t ci, UChar_t col[4], Char_t transparency)
212 {
213  UChar_t alpha = (255*(100 - transparency))/100;
214 
215  TColor* c = gROOT->GetColor(ci);
216  if (c)
217  {
218  col[0] = (UChar_t)(255*c->GetRed());
219  col[1] = (UChar_t)(255*c->GetGreen());
220  col[2] = (UChar_t)(255*c->GetBlue());
221  col[3] = alpha;
222  }
223  else
224  {
225  // Set to magenta.
226  col[0] = 255; col[1] = 0; col[2] = 255; col[3] = alpha;
227  return;
228  }
229 }
230 
231 ////////////////////////////////////////////////////////////////////////////////
232 /// Fill col with weighted RGBA values corresponding to
233 /// color-indices c1 and c2. If alpha is true, set alpha component
234 /// of col to 255.
235 
237  UChar_t col[4], Bool_t alpha)
238 {
239  TColor* t1 = gROOT->GetColor(c1);
240  TColor* t2 = gROOT->GetColor(c2);
241  if(t1 && t2) {
242  col[0] = (UChar_t)(255*(f1*t1->GetRed() + f2*t2->GetRed()));
243  col[1] = (UChar_t)(255*(f1*t1->GetGreen() + f2*t2->GetGreen()));
244  col[2] = (UChar_t)(255*(f1*t1->GetBlue() + f2*t2->GetBlue()));
245  if (alpha) col[3] = 255;
246  }
247 }
248 
249 ////////////////////////////////////////////////////////////////////////////////
250 /// Find address of Color_t data-member with name varname in object
251 /// obj.
252 ///
253 /// This is used to access color information for TGListTreeItem
254 /// coloration from visualization macros that wrap TObjects into
255 /// TEveElementObjectPtr instances.
256 
257 Color_t* TEveUtil::FindColorVar(TObject* obj, const char* varname)
258 {
259  static const TEveException eh("TEveUtil::FindColorVar");
260 
261  Int_t off = obj->IsA()->GetDataMemberOffset(varname);
262  if(off == 0)
263  throw(eh + "could not find member '" + varname + "' in class " + obj->IsA()->GetName() + ".");
264  return (Color_t*) (((char*)obj) + off);
265 }
266 
267 ////////////////////////////////////////////////////////////////////////////////
268 /// Tweak all ROOT colors to become brighter (if value > 0) or
269 /// darker (value < 0). Reasonable values for the value argument are
270 /// from -2.5 to 2.5 (error will be printed otherwise).
271 /// If value is zero, the original colors are restored.
272 ///
273 /// You should call TEveManager::FullRedraw3D() afterwards or set
274 /// the argument full_redraw to true (default is false).
275 
277 {
278  if (value < -2.5 || value > 2.5)
279  {
280  Error("TEveUtil::SetColorBrightness", "value '%f' out of range [-0.5, 0.5].", value);
281  return;
282  }
283 
284  TObjArray *colors = (TObjArray*) gROOT->GetListOfColors();
285 
286  if (fgDefaultColors == 0)
287  {
288  const Int_t n_col = colors->GetEntriesFast();
289  fgDefaultColors = new TObjArray(n_col);
290  for (Int_t i = 0; i < n_col; ++i)
291  {
292  TColor* c = (TColor*) colors->At(i);
293  if (c)
294  fgDefaultColors->AddAt(new TColor(*c), i);
295  }
296  }
297 
298  const Int_t n_col = fgDefaultColors->GetEntriesFast();
299  for (Int_t i = 0; i < n_col; ++i)
300  {
301  TColor* cdef = (TColor*) fgDefaultColors->At(i);
302  if (cdef)
303  {
304  TColor* croot = (TColor*) colors->At(i);
305  if (croot == 0)
306  {
307  croot = new TColor(*cdef);
308  colors->AddAt(croot, i);
309  }
310  else
311  {
312  cdef->Copy(*croot);
313  }
314 
315  Float_t r, g, b;
316  croot->GetRGB(r, g, b);
317  r = TMath::Power( r, (2.5 - value)/2.5);
318  g = TMath::Power(g, (2.5 - value)/2.5);
319  b = TMath::Power(b, (2.5 - value)/2.5);
320 
321  r = TMath::Min(r, 1.0f);
322  g = TMath::Min(g, 1.0f);
323  b = TMath::Min(b, 1.0f);
324 
325  croot->SetRGB(r, g, b);
326  }
327  else
328  {
329  delete colors->RemoveAt(i);
330  }
331  }
332 
333  if (full_redraw && gEve != 0)
334  gEve->FullRedraw3D();
335 }
336 
337 ////////////////////////////////////////////////////////////////////////////////
338 /// Return true if interval Q is contained within interval M for U1 variables.
339 /// It is assumed that all values are within the [-2pi, 2pi] interval and
340 /// minM <= maxM & minQ <= maxQ.
341 
343  Float_t minQ, Float_t maxQ)
344 {
345  using namespace TMath;
346 
347  if (maxQ < minM)
348  {
349  minQ += TwoPi(); maxQ += TwoPi();
350  }
351  else if (minQ > maxM)
352  {
353  minQ -= TwoPi(); maxQ -= TwoPi();
354  }
355  return minQ >= minM && maxQ <= maxM;
356 }
357 
358 ////////////////////////////////////////////////////////////////////////////////
359 /// Return true if interval Q is overlapping within interval M for U1 variables.
360 /// It is assumed that all values are within the [-2pi, 2pi] interval and
361 /// minM <= maxM & minQ <= maxQ.
362 
364  Float_t minQ, Float_t maxQ)
365 {
366  using namespace TMath;
367 
368  if (maxQ < minM)
369  {
370  minQ += TwoPi(); maxQ += TwoPi();
371  }
372  else if (minQ > maxM)
373  {
374  minQ -= TwoPi(); maxQ -= TwoPi();
375  }
376  return maxQ >= minM && minQ <= maxM;
377 }
378 
379 ////////////////////////////////////////////////////////////////////////////////
380 /// Get fraction of interval [minQ, maxQ] in [minM, maxM]
381 
383 {
384  if (minQ>=minM && maxQ<=maxM)
385  return 1;
386 
387  else if (minQ<minM && maxQ>maxM)
388  return (maxM-minM)/(maxQ-minQ);
389 
390  else if (minQ>=minM && maxQ>maxM)
391  return (maxM-minQ)/(maxQ-minQ);
392 
393  else if (minQ<minM && maxQ<=maxM)
394  return (maxQ-minM)/(maxQ-minQ);
395 
396  return 0;
397 }
398 
399 
400 /** \class TEveException
401 \ingroup TEve
402 Exception class thrown by TEve classes and macros.
403 */
404 
406 
407 ////////////////////////////////////////////////////////////////////////////////
408 
409 bool operator==(const TString& t, const std::string& s)
410 { return (s == t.Data()); }
411 
412 bool operator==(const std::string& s, const TString& t)
413 { return (s == t.Data()); }
414 
415 // Exc
416 
417 TEveException::TEveException(const std::string& s) : TString(s.c_str())
418 {
419  // Constructor.
420 }
421 
422 // Exc + ops
423 
424 TEveException operator+(const TEveException &s1, const std::string &s2)
425 { TEveException r(s1); r += s2; return r; }
426 
428 { TEveException r(s1); r += s2; return r; }
429 
430 TEveException operator+(const TEveException &s1, const char *s2)
431 { TEveException r(s1); r += s2; return r; }
432 
433 
434 /** \class TEvePadHolder
435 \ingroup TEve
436 Exception safe wrapper for setting gPad.
437 Optionally calls gPad->Modified()/Update() in destructor.
438 */
439 
441 
442 ////////////////////////////////////////////////////////////////////////////////
443 /// Constructor.
444 
445 TEvePadHolder::TEvePadHolder(Bool_t modify_update_p, TVirtualPad* new_pad, Int_t subpad) :
446  fOldPad (gPad),
447  fModifyUpdateP (modify_update_p)
448 {
449  if (new_pad != 0)
450  new_pad->cd(subpad);
451  else
452  gPad = 0;
453 }
454 
455 ////////////////////////////////////////////////////////////////////////////////
456 /// Destructor.
457 
459 {
460  if (fModifyUpdateP && gPad != 0) {
461  gPad->Modified();
462  gPad->Update();
463  }
464  gPad = fOldPad;
465 }
466 
467 /** \class TEveGeoManagerHolder
468 \ingroup TEve
469 Exception safe wrapper for setting gGeoManager.
470 Functionality to lock-unlock via setting of a static lock in
471 TGeoManager should be added (new feature of TGeoManager).
472 */
473 
475 
476 ////////////////////////////////////////////////////////////////////////////////
477 /// Constructor.
478 /// If n_seg is specified and larger than 2, the new geo-manager's
479 /// NSegments is set to this value.
480 
482  fManager (gGeoManager),
483  fNSegments (0)
484 {
485  gGeoManager = new_gmgr;
486  if (gGeoManager)
487  {
489  if (n_seg > 2)
490  {
492  gGeoManager->SetNsegments(n_seg);
493  }
494  }
495  else
496  {
497  gGeoIdentity = 0;
498  }
499 }
500 
501 ////////////////////////////////////////////////////////////////////////////////
502 /// Destructor.
503 
505 {
506  if (gGeoManager && fNSegments > 2)
507  {
509  }
511  if (gGeoManager)
512  {
514  }
515  else
516  {
517  gGeoIdentity = 0;
518  }
519 }
520 
521 /** \class TEveRefCnt
522 \ingroup TEve
523 Base-class for reference-counted objects.
524 By default the object is destroyed when zero reference-count is reached.
525 */
526 
528 
529 /** \class TEveRefBackPtr
530 \ingroup TEve
531 Base-class for reference-counted objects with reverse references to
532 TEveElement objects.
533 */
534 
536 
537 ////////////////////////////////////////////////////////////////////////////////
538 /// Default constructor.
539 
541  TEveRefCnt(),
542  fBackRefs()
543 {
544 }
545 
546 ////////////////////////////////////////////////////////////////////////////////
547 /// Destructor. Noop, should complain if back-ref list is not empty.
548 
550 {
551  // !!! Complain if list not empty.
552 }
553 
554 ////////////////////////////////////////////////////////////////////////////////
555 /// Copy constructor. New copy starts with zero reference count and
556 /// empty back-reference list.
557 
559  TEveRefCnt(),
560  fBackRefs()
561 {
562 }
563 
564 ////////////////////////////////////////////////////////////////////////////////
565 /// Assignment operator. Reference count and back-reference
566 /// information is not assigned as these object hold pointers to a
567 /// specific object.
568 
570 {
571  return *this;
572 }
573 
574 ////////////////////////////////////////////////////////////////////////////////
575 /// Increase reference count and add re to the list of back-references.
576 
578 {
580  ++fBackRefs[re];
581 }
582 
583 ////////////////////////////////////////////////////////////////////////////////
584 /// Decrease reference count and remove re from the list of back-references.
585 
587 {
588  static const TEveException eh("TEveRefBackPtr::DecRefCount ");
589 
590  RefMap_i i = fBackRefs.find(re);
591  if (i != fBackRefs.end()) {
592  if (--(i->second) <= 0)
593  fBackRefs.erase(i);
595  } else {
596  Warning(eh, "render element '%s' not found in back-refs.",
597  re->GetObject(eh)->GetName());
598  }
599 }
600 
601 ////////////////////////////////////////////////////////////////////////////////
602 /// Add given stamps to elements in the list of reverse references.
603 
605 {
606  RefMap_i i = fBackRefs.begin();
607  while (i != fBackRefs.end())
608  {
609  i->first->AddStamp(stamps);
610  ++i;
611  }
612 }
c
#define c(i)
Definition: RSha256.hxx:101
TEveGeoManagerHolder
Exception safe wrapper for setting gGeoManager.
Definition: TEveUtil.h:142
TEveUtil::SetupEnvironment
static void SetupEnvironment()
Setup Include and Macro paths.
Definition: TEveUtil.cxx:50
TEveRefBackPtr::IncRefCount
void IncRefCount()
Definition: TEveUtil.h:174
TEveElement::fgRnrIcons
static const TGPicture * fgRnrIcons[4]
Definition: TEveElement.h:64
TEveElement
Base class for TEveUtil visualization elements, providing hierarchy management, rendering control and...
Definition: TEveElement.h:36
kTRUE
const Bool_t kTRUE
Definition: RtypesCore.h:91
TEveUtil::SetColorBrightness
static void SetColorBrightness(Float_t value, Bool_t full_redraw=kFALSE)
Tweak all ROOT colors to become brighter (if value > 0) or darker (value < 0).
Definition: TEveUtil.cxx:276
gGeoIdentity
R__EXTERN TGeoIdentity * gGeoIdentity
Definition: TGeoMatrix.h:478
TObjArray
An array of TObjects.
Definition: TObjArray.h:37
Warning
void Warning(const char *location, const char *msgfmt,...)
Use this function in warning situations.
Definition: TError.cxx:231
kNPOS
const Ssiz_t kNPOS
Definition: RtypesCore.h:115
TEveRefBackPtr::TEveRefBackPtr
TEveRefBackPtr()
Default constructor.
Definition: TEveUtil.cxx:540
gGeoManager
R__EXTERN TGeoManager * gGeoManager
Definition: TGeoManager.h:602
TString::Data
const char * Data() const
Definition: TString.h:369
TEveUtil::GetFraction
static Float_t GetFraction(Float_t minM, Float_t maxM, Float_t minQ, Float_t maxQ)
Get fraction of interval [minQ, maxQ] in [minM, maxM].
Definition: TEveUtil.cxx:382
TEveUtil::IsU1IntervalOverlappingByMinMax
static Bool_t IsU1IntervalOverlappingByMinMax(Float_t minM, Float_t maxM, Float_t minQ, Float_t maxQ)
Return true if interval Q is overlapping within interval M for U1 variables.
Definition: TEveUtil.cxx:363
ClassImp
#define ClassImp(name)
Definition: Rtypes.h:364
TEveRefCnt::DecRefCount
void DecRefCount()
Definition: TEveUtil.h:175
r
ROOT::R::TRInterface & r
Definition: Object.C:4
colors
Color * colors
Definition: X3DBuffer.c:21
TEveUtil::ColorFromIdx
static void ColorFromIdx(Color_t ci, UChar_t col[4], Bool_t alpha=kTRUE)
Fill col with RGBA values corresponding to index ci.
Definition: TEveUtil.cxx:188
TEvePadHolder::~TEvePadHolder
virtual ~TEvePadHolder()
Destructor.
Definition: TEveUtil.cxx:458
TColor::SetRGB
virtual void SetRGB(Float_t r, Float_t g, Float_t b)
Initialize this color and its associated colors.
Definition: TColor.cxx:1702
Float_t
float Float_t
Definition: RtypesCore.h:57
TGeant4Unit::s
static constexpr double s
Definition: TGeant4SystemOfUnits.h:162
TEveElement::fgListTreeIcons
static const TGPicture * fgListTreeIcons[9]
Definition: TEveElement.h:65
TVirtualPad::cd
virtual TVirtualPad * cd(Int_t subpadnumber=0)=0
TEveRefBackPtr::StampBackPtrElements
virtual void StampBackPtrElements(UChar_t stamps)
Add given stamps to elements in the list of reverse references.
Definition: TEveUtil.cxx:604
TEveException::TEveException
TEveException()
Definition: TEveUtil.h:104
TGeoManager::GetNsegments
Int_t GetNsegments() const
Get number of segments approximating circles.
Definition: TGeoManager.cxx:3350
TEveUtil::IsU1IntervalContainedByMinMax
static Bool_t IsU1IntervalContainedByMinMax(Float_t minM, Float_t maxM, Float_t minQ, Float_t maxQ)
Return true if interval Q is contained within interval M for U1 variables.
Definition: TEveUtil.cxx:342
TGMimeTypes.h
TClass.h
TEveUtil::Macro
static void Macro(const char *mac)
Execute macro 'mac'. Do not reload the macro.
Definition: TEveUtil.cxx:164
TColor.h
TEveElement.h
TEveGeoManagerHolder::fManager
TGeoManager * fManager
Definition: TEveUtil.h:144
TObjArray::At
TObject * At(Int_t idx) const
Definition: TObjArray.h:166
TString
Basic string class.
Definition: TString.h:136
TEvePadHolder::fModifyUpdateP
Bool_t fModifyUpdateP
Definition: TEveUtil.h:129
operator==
bool operator==(const TString &t, const std::string &s)
Definition: TEveUtil.cxx:409
Color_t
short Color_t
Definition: RtypesCore.h:83
TColor::GetBlue
Float_t GetBlue() const
Definition: TColor.h:59
gEve
R__EXTERN TEveManager * gEve
Definition: TEveManager.h:243
b
#define b(i)
Definition: RSha256.hxx:100
TEveRefBackPtr::~TEveRefBackPtr
virtual ~TEveRefBackPtr()
Destructor. Noop, should complain if back-ref list is not empty.
Definition: TEveUtil.cxx:549
bool
TGeoManager::SetNsegments
void SetNsegments(Int_t nseg)
Set number of segments for approximating circles in drawing.
Definition: TGeoManager.cxx:3340
TROOT.h
gClient
#define gClient
Definition: TGClient.h:166
TObject::GetName
virtual const char * GetName() const
Returns name of object.
Definition: TObject.cxx:359
TEveUtil.h
TEveGeoManagerHolder::~TEveGeoManagerHolder
virtual ~TEveGeoManagerHolder()
Destructor.
Definition: TEveUtil.cxx:504
TEveUtil::CheckMacro
static Bool_t CheckMacro(const char *mac)
Checks if macro 'mac' is loaded.
Definition: TEveUtil.cxx:136
TEveUtil::SetupGUI
static void SetupGUI()
Setup icon pictures and mime-types.
Definition: TEveUtil.cxx:93
TEveGeoManagerHolder::TEveGeoManagerHolder
TEveGeoManagerHolder(const TEveGeoManagerHolder &)
TSystem.h
TColor
The color creation and management class.
Definition: TColor.h:19
TColor::GetRGB
virtual void GetRGB(Float_t &r, Float_t &g, Float_t &b) const
Definition: TColor.h:51
TEveUtil::FindColorVar
static Color_t * FindColorVar(TObject *obj, const char *varname)
Find address of Color_t data-member with name varname in object obj.
Definition: TEveUtil.cxx:257
TEveUtil::fgDefaultColors
static TObjArray * fgDefaultColors
Definition: TEveUtil.h:37
TEveUtil
Standard utility functions for Eve.
Definition: TEveUtil.h:35
TObjArray::GetEntriesFast
Int_t GetEntriesFast() const
Definition: TObjArray.h:64
TEveUtil::LoadMacro
static void LoadMacro(const char *mac)
Makes sure that macro 'mac' is loaded, but do not reload it.
Definition: TEveUtil.cxx:176
kFALSE
const Bool_t kFALSE
Definition: RtypesCore.h:92
s1
#define s1(x)
Definition: RSha256.hxx:91
TEveManager::FullRedraw3D
void FullRedraw3D(Bool_t resetCameras=kFALSE, Bool_t dropLogicals=kFALSE)
Perform 3D redraw of all scenes and viewers.
Definition: TEveManager.cxx:427
operator+
TEveException operator+(const TEveException &s1, const std::string &s2)
Definition: TEveUtil.cxx:424
TEveRefBackPtr
Base-class for reference-counted objects with reverse references to TEveElement objects.
Definition: TEveUtil.h:187
TEveRefBackPtr::RefMap_i
RefMap_t::iterator RefMap_i
Definition: TEveUtil.h:190
TMath::Power
LongDouble_t Power(LongDouble_t x, LongDouble_t y)
Definition: TMath.h:735
TEvePadHolder::fOldPad
TVirtualPad * fOldPad
Definition: TEveUtil.h:128
TEveGeoManagerHolder::fNSegments
Int_t fNSegments
Definition: TEveUtil.h:145
TColor::GetRed
Float_t GetRed() const
Definition: TColor.h:57
TGClient.h
TEvePadHolder
Exception safe wrapper for setting gPad.
Definition: TEveUtil.h:126
TEvePadHolder::TEvePadHolder
TEvePadHolder(const TEvePadHolder &)
TEveUtil::AssertMacro
static void AssertMacro(const char *mac)
Load and execute macro 'mac' if it has not been loaded yet.
Definition: TEveUtil.cxx:154
TMath::Min
Short_t Min(Short_t a, Short_t b)
Definition: TMathBase.h:180
TGeoMatrix.h
TMath::TwoPi
constexpr Double_t TwoPi()
Definition: TMath.h:44
TGeoManager.h
Ssiz_t
int Ssiz_t
Definition: RtypesCore.h:67
TObjArray::AddAt
virtual void AddAt(TObject *obj, Int_t idx)
Add object at position ids.
Definition: TObjArray.cxx:254
TEveRefCnt
Base-class for reference-counted objects.
Definition: TEveUtil.h:163
TEveManager.h
TEveRefBackPtr::operator=
TEveRefBackPtr & operator=(const TEveRefBackPtr &)
Assignment operator.
Definition: TEveUtil.cxx:569
f1
TF1 * f1
Definition: legend1.C:11
TVirtualPad
TVirtualPad is an abstract base class for the Pad and Canvas classes.
Definition: TVirtualPad.h:51
TEveException
Exception class thrown by TEve classes and macros.
Definition: TEveUtil.h:102
t1
auto * t1
Definition: textangle.C:20
TInterpreter.h
Info
void Info(const char *location, const char *msgfmt,...)
Use this function for informational messages.
Definition: TError.cxx:220
UChar_t
unsigned char UChar_t
Definition: RtypesCore.h:38
TObject
Mother of all ROOT objects.
Definition: TObject.h:37
TColor::Copy
void Copy(TObject &color) const
Copy this color to obj.
Definition: TColor.cxx:1230
TEveElement::GetObject
virtual TObject * GetObject(const TEveException &eh) const
Get a TObject associated with this render-element.
Definition: TEveElement.cxx:937
c2
return c2
Definition: legend2.C:14
gPad
#define gPad
Definition: TVirtualPad.h:287
TEveRefBackPtr::DecRefCount
void DecRefCount()
Definition: TEveUtil.h:175
TEveRefBackPtr::fBackRefs
RefMap_t fBackRefs
Definition: TEveUtil.h:192
Float_t
TGeoManager::GetListOfMatrices
TObjArray * GetListOfMatrices() const
Definition: TGeoManager.h:490
Char_t
char Char_t
Definition: RtypesCore.h:33
TGeoManager
The manager class for any TGeo geometry.
Definition: TGeoManager.h:45
TColor::GetGreen
Float_t GetGreen() const
Definition: TColor.h:58
TGeoIdentity
An identity transformation.
Definition: TGeoMatrix.h:384
TEveRefCnt::IncRefCount
void IncRefCount()
Definition: TEveUtil.h:174
TMath
TMath.
Definition: TMathBase.h:35
TMath.h
gROOT
#define gROOT
Definition: TROOT.h:406
int
Error
void Error(const char *location, const char *msgfmt,...)
Use this function in case an error occurred.
Definition: TError.cxx:187
TError.h
c1
return c1
Definition: legend1.C:41
g
#define g(i)
Definition: RSha256.hxx:105