Logo ROOT   6.07/09
Reference Guide
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 
10 
11 void arrow()
12 {
14 
16 
17  TEvePointSet* marker = new TEvePointSet(8);
18  marker->SetName("Origin marker");
19  marker->SetMarkerColor(6);
20  marker->SetMarkerStyle(3);
21  Float_t a = 10;
22  marker->SetPoint(0, a, +a, +a);
23  marker->SetPoint(1, a, -a, +a);
24  marker->SetPoint(2, -a, -a, +a);
25  marker->SetPoint(3, -a, +a, +a);
26  marker->SetPoint(4, +a, +a, -a);
27  marker->SetPoint(5, +a, -a, -a);
28  marker->SetPoint(6, -a, +a, -a);
29  marker->SetPoint(7, -a, -a, -a);
30  gEve->AddElement(marker);
31 
32  TEveArrow* a1 = new TEveArrow(1., 1., 10., 10., 4., 0.);
33  a1->SetMainColor(kBlue);
34  a1->SetTubeR(0.02);
35  a1->SetPickable(kTRUE);
36  gEve->AddElement(a1);
37  TEveText* t1 = new TEveText("blue");
38  t1->SetFontSize(20);
39  TEveVector tv = a1->GetVector()*0.5f+a1->GetOrigin();
40  t1->RefMainTrans().SetPos(tv.Arr());
41  a1->AddElement(t1);
42 
43  TEveArrow* a2 = new TEveArrow(20., 1., 10., 3., 0., 4.);
44  a2->SetMainColor(kGreen);
45  a2->SetPickable(kTRUE);
46  gEve->AddElement(a2);
47 
48  TEveArrow* a3 = new TEveArrow(1., 10., 10., 0., 20., 0.);
49  a3->SetMainColor(kOrange);
50  a3->SetPickable(kTRUE);
51  gEve->AddElement(a3);
52 
54 }
TEveVector GetOrigin()
Definition: TEveArrow.h:62
void SetTubeR(Float_t x)
Definition: TEveArrow.h:53
float Float_t
Definition: RtypesCore.h:53
virtual void SetName(const char *name)
Change (i.e.
void SetPickable(Bool_t p)
Definition: TEveElement.h:340
Class used for display of a thick arrow.
Definition: TEveArrow.h:21
TArc * a
Definition: textangle.C:12
virtual void SetMarkerStyle(Style_t mstyle=1)
Set marker style, propagate to projecteds.
Definition: Rtypes.h:61
TLatex * t1
Definition: textangle.C:20
void AddElement(TEveElement *element, TEveElement *parent=0)
Add an element.
TArrow * arrow
virtual void SetMarkerColor(Color_t col)
Set the marker color.
Definition: TEvePointSet.h:81
static TEveManager * Create(Bool_t map_window=kTRUE, Option_t *opt="FIV")
If global TEveManager* gEve is not set initialize it.
R__EXTERN TSystem * gSystem
Definition: TSystem.h:549
TEveVector GetVector()
Definition: TEveArrow.h:61
R__EXTERN TEveManager * gEve
Definition: TEveManager.h:243
TEvePointSet is a render-element holding a collection of 3D points with optional per-point TRef and a...
Definition: TEvePointSet.h:31
const TT * Arr() const
Definition: TEveVector.h:45
virtual void AddElement(TEveElement *el)
Add el to the list of children.
virtual void SetMainColor(Color_t color)
Set main color of the element.
void SetPoint(Int_t n, Double_t x, Double_t y, Double_t z)
Set point n to x, y, z.
void SetPos(Double_t x, Double_t y, Double_t z)
Set position (base-vec 4).
Definition: TEveTrans.cxx:507
void FullRedraw3D(Bool_t resetCameras=kFALSE, Bool_t dropLogicals=kFALSE)
Perform 3D redraw of all scenes and viewers.
void SetFontSize(Int_t size, Bool_t validate=kTRUE)
Set valid font size.
Definition: TEveText.cxx:60
TEveElement class used for displaying FreeType GL fonts.
Definition: TEveText.h:21
virtual TEveTrans & RefMainTrans()
Return reference to main transformation.
Definition: Rtypes.h:61
const Bool_t kTRUE
Definition: Rtypes.h:91
Definition: Rtypes.h:62
virtual void IgnoreSignal(ESignals sig, Bool_t ignore=kTRUE)
If ignore is true ignore the specified signal, else restore previous behaviour.
Definition: TSystem.cxx:598