Logo ROOT  
Reference Guide
compound.C
Go to the documentation of this file.
1 #include "TRandom.h"
2 #include <ROOT/REveManager.hxx>
3 #include <ROOT/REveScene.hxx>
4 #include <ROOT/REveLine.hxx>
5 #include <ROOT/REveCompound.hxx>
6 
7 namespace REX = ROOT::Experimental;
8 
10 {
11  auto line = new REX::REveLine;
12  line->SetMainColor(kGreen);
13 
14  Float_t x = 0, y = 0, z = 0;
15  for (Int_t i=0; i<n; ++i) {
16  line->SetNextPoint(x, y, z);
17  x += rnd.Uniform(0, delta);
18  y += rnd.Uniform(0, delta);
19  z += rnd.Uniform(0, delta);
20  }
21 
22  return line;
23 }
24 
25 void compound()
26 {
27  // disable browser cache - all scripts and html files will be loaded every time, useful for development
28  // gEnv->SetValue("WebGui.HttpMaxAge", 0);
29 
31  TRandom rnd(0);
32  /*
33  auto* ml = random_line(rnd, 20, 10);
34  ml->SetMainColor(kRed);
35  ml->SetLineStyle(2);
36  ml->SetLineWidth(3);
37  eveMng->InsertVizDBEntry("BigLine", ml);
38  */
39  auto cmp = new REX::REveCompound;
40  cmp->SetMainColor(kGreen);
41 
42 
43  cmp->OpenCompound();
44  cmp->AddElement(random_line(rnd, 20, 10));
45  cmp->AddElement(random_line(rnd, 20, 10));
46 
47  auto line = random_line(rnd, 20, 12);
48  line->SetMainColor(kRed);
49  line->SetLineStyle(2);
50  line->SetLineWidth(3);
51  // line->ApplyVizTag("BigLine");
52  cmp->AddElement(line);
53 
54 
55  cmp->CloseCompound();
56 
58 
59  eveMng->Show();
60 }
n
const Int_t n
Definition: legend1.C:16
kGreen
@ kGreen
Definition: Rtypes.h:66
compound
void compound()
Definition: compound.C:25
ROOT::Experimental::REveManager::Create
static REveManager * Create()
If global REveManager* REX::gEve is not set initialize it.
Definition: REveManager.cxx:698
REveLine.hxx
ROOT::Experimental::REveManager::GetEventScene
REveScene * GetEventScene() const
Definition: REveManager.hxx:146
TRandom.h
Float_t
float Float_t
Definition: RtypesCore.h:57
Int_t
int Int_t
Definition: RtypesCore.h:45
TRandom::Uniform
virtual Double_t Uniform(Double_t x1=1)
Returns a uniform deviate on the interval (0, x1).
Definition: TRandom.cxx:635
x
Double_t x[n]
Definition: legend1.C:17
eveMng
REX::REveManager * eveMng
Definition: collection_proxies.C:40
random_line
REX::REveLine * random_line(TRandom &rnd, Int_t n, Float_t delta)
Definition: compound.C:9
TRandom
Definition: TRandom.h:27
ROOT::Experimental::REveCompound::SetMainColor
void SetMainColor(Color_t color) override
SetMainColor for the compound.
Definition: REveCompound.cxx:50
REveScene.hxx
REveCompound.hxx
y
Double_t y[n]
Definition: legend1.C:17
kRed
@ kRed
Definition: Rtypes.h:66
line
TLine * line
Definition: entrylistblock_figure1.C:235
REveManager.hxx
ROOT::Experimental::REveElement::AddElement
virtual void AddElement(REveElement *el)
Add el to the list of children.
Definition: REveElement.cxx:842
ROOT::Experimental::REveManager::Show
void Show(const RWebDisplayArgs &args="")
Show eve manager in specified browser.
Definition: REveManager.cxx:963
ROOT::Experimental
Definition: RDirectory.hxx:36
ROOT::Experimental::REveLine
REveLine An arbitrary polyline with fixed line and marker attributes.
Definition: REveLine.hxx:40
ROOT::Experimental::REveCompound
Definition: REveCompound.hxx:38