Logo ROOT  
Reference Guide
 
Loading...
Searching...
No Matches
lineset.C
Go to the documentation of this file.
1/// \file
2/// \ingroup tutorial_eve_7
3/// Demonstrates usage of class REveStraightLineSet. The elements in the set can be individually picked when enable
4/// secondary select. The REveStraightLineSet is a projectable class. It can be visible in RhoZ and RhoPhi projected
5/// views.
6///
7/// \macro_code
8///
9/// \author Alja Mrak-Tadel
10
11#include "TRandom.h"
12
13#include <ROOT/REveElement.hxx>
14#include <ROOT/REveScene.hxx>
15#include <ROOT/REveManager.hxx>
17
18namespace REX = ROOT::Experimental;
19
21{
22 TRandom r(0);
23 Float_t s = 100;
24
25 auto ls = new REX::REveStraightLineSet();
26
27 for (Int_t i = 0; i < nlines; i++) {
28 ls->AddLine(r.Uniform(-s, s), r.Uniform(-s, s), r.Uniform(-s, s), r.Uniform(-s, s), r.Uniform(-s, s),
29 r.Uniform(-s, s));
30 // add random number of markers
31 Int_t nm = 1 + Int_t(nmarkers * r.Rndm());
32 for (Int_t m = 0; m < nm; m++)
33 ls->AddMarker(i, r.Rndm());
34 }
35
36 ls->SetMarkerSize(5);
37 ls->SetMarkerStyle(1);
38 ls->SetAlwaysSecSelect(sc);
40
41 return ls;
42}
43
44void lineset(bool secondarySelect = true)
45{
46 auto eveMng = REX::REveManager::Create();
47 // eveMng->AllowMultipleRemoteConnections(false, false);
48
49 auto ls1 = makeLineSet(50, 10, secondarySelect);
50 ls1->SetLineWidth(2);
51 ls1->SetMarkerSize(8);
52 ls1->SetMainColor(kViolet);
53 ls1->SetMarkerColor(kMagenta);
54 ls1->SetName("LineSet Violet");
55
56 auto ls2 = makeLineSet(10, 10, secondarySelect);
57 ls2->SetLineWidth(2);
58 ls2->SetMarkerSize(8);
59 ls2->SetMainColor(kBlue);
60 ls2->SetMarkerColor(kCyan + 2);
61 ls2->SetName("LineSet Blue");
62 ls2->InitMainTrans();
63 ls2->RefMainTrans().Move3LF(40, 200, 200);
64
65 eveMng->Show();
66}
int Int_t
Signed integer 4 bytes (int)
Definition RtypesCore.h:60
float Float_t
Float 4 bytes (float)
Definition RtypesCore.h:72
@ kMagenta
Definition Rtypes.h:67
@ kCyan
Definition Rtypes.h:67
@ kBlue
Definition Rtypes.h:67
@ kViolet
Definition Rtypes.h:68
ROOT::Detail::TRangeCast< T, true > TRangeDynCast
TRangeDynCast is an adapter class that allows the typed iteration through a TCollection.
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
virtual void AddElement(REveElement *el)
Add el to the list of children.
REveScene * GetEventScene() const
REveStraightLineSet Set of straight lines with optional markers along the lines.
This is the base class for the ROOT Random number generators.
Definition TRandom.h:28
Namespace for ROOT features in testing.
Definition TROOT.h:100
R__EXTERN REveManager * gEve
TMarker m
Definition textangle.C:8