Logo ROOT  
Reference Guide
 
Loading...
Searching...
No Matches
arrow.C
Go to the documentation of this file.
1/// \file
2/// \ingroup tutorial_eve
3/// Demonstrates usage of TEveArrow class.
4///
5/// \image html eve_arrow.png
6/// \macro_code
7///
8/// \author Alja Mrak-Tadel
9
10void arrow()
11{
13
15
16 auto marker = new TEvePointSet(8);
17 marker->SetName("Origin marker");
18 marker->SetMarkerColor(6);
19 marker->SetMarkerStyle(3);
20 Float_t a = 10;
21 marker->SetPoint(0, a, +a, +a);
22 marker->SetPoint(1, a, -a, +a);
23 marker->SetPoint(2, -a, -a, +a);
24 marker->SetPoint(3, -a, +a, +a);
25 marker->SetPoint(4, +a, +a, -a);
26 marker->SetPoint(5, +a, -a, -a);
27 marker->SetPoint(6, -a, +a, -a);
28 marker->SetPoint(7, -a, -a, -a);
29 gEve->AddElement(marker);
30
31 auto a1 = new TEveArrow(1., 1., 10., 10., 4., 0.);
32 a1->SetMainColor(kBlue);
33 a1->SetTubeR(0.02);
34 a1->SetPickable(kTRUE);
36 auto t1 = new TEveText("blue");
37 t1->SetFontSize(20);
38 TEveVector tv = a1->GetVector() * 0.5f + a1->GetOrigin();
39 t1->RefMainTrans().SetPos(tv.Arr());
40 a1->AddElement(t1);
41
42 auto a2 = new TEveArrow(20., 1., 10., 3., 0., 4.);
43 a2->SetMainColor(kGreen);
44 a2->SetPickable(kTRUE);
46
47 auto a3 = new TEveArrow(1., 10., 10., 0., 20., 0.);
48 a3->SetMainColor(kOrange);
49 a3->SetPickable(kTRUE);
51
53}
#define a(i)
Definition RSha256.hxx:99
float Float_t
Definition RtypesCore.h:57
constexpr Bool_t kTRUE
Definition RtypesCore.h:93
@ kOrange
Definition Rtypes.h:67
@ kGreen
Definition Rtypes.h:66
@ kBlue
Definition Rtypes.h:66
R__EXTERN TEveManager * gEve
@ kSigSegmentationViolation
R__EXTERN TSystem * gSystem
Definition TSystem.h:561
Class used for display of a thick arrow.
Definition TEveArrow.h:25
void AddElement(TEveElement *element, TEveElement *parent=nullptr)
Add an element.
static TEveManager * Create(Bool_t map_window=kTRUE, Option_t *opt="FIV")
If global TEveManager* gEve is not set initialize it.
void FullRedraw3D(Bool_t resetCameras=kFALSE, Bool_t dropLogicals=kFALSE)
Perform 3D redraw of all scenes and viewers.
TEvePointSet is a render-element holding a collection of 3D points with optional per-point TRef and a...
TEveElement class used for displaying FreeType GL fonts.
Definition TEveText.h:25
virtual void IgnoreSignal(ESignals sig, Bool_t ignore=kTRUE)
If ignore is true ignore the specified signal, else restore previous behaviour.
Definition TSystem.cxx:593
auto * t1
Definition textangle.C:20