Logo ROOT  
Reference Guide
 
Loading...
Searching...
No Matches
points.C
Go to the documentation of this file.
1/// \file
2/// \ingroup tutorial_eve_7
3/// This example display only points in web browser
4///
5/// \macro_code
6///
7/// \author Alja Mrak-Tadel
8
9#include "TRandom.h"
10#include <ROOT/REveElement.hxx>
11#include <ROOT/REveScene.hxx>
12#include <ROOT/REveManager.hxx>
13#include <ROOT/REvePointSet.hxx>
14
15namespace REX = ROOT::Experimental;
16
17REX::REvePointSet *createPointSet(int npoints = 2, float s = 2, int color = 28)
18{
19 TRandom &r = *gRandom;
20
21 REX::REvePointSet *ps = new REX::REvePointSet("MyTestPoints", "list of eve points", npoints);
22
23 for (Int_t i = 0; i < npoints; ++i)
24 ps->SetNextPoint(r.Uniform(-s, s), r.Uniform(-s, s), r.Uniform(-s, s));
25
26 ps->SetMarkerColor(color);
27 ps->SetMarkerSize(5 + r.Uniform(1, 15));
28 ps->SetMarkerStyle(4);
29 return ps;
30}
31
32void points()
33{
34 auto eveMng = REX::REveManager::Create();
35
36 REX::REveElement *event = eveMng->GetEventScene();
37
38 auto psDot = createPointSet(100, 300);
39 psDot->SetMarkerStyle(1);
40 event->AddElement(psDot);
41
42 auto psSquare = createPointSet(100, 300);
43 psSquare->SetMarkerStyle(2);
44 event->AddElement(psSquare);
45
46 auto psStar = createPointSet(10, 300);
47 psStar->SetMarkerStyle(3);
48 event->AddElement(psStar);
49
50 eveMng->Show();
51}
int Int_t
Signed integer 4 bytes (int)
Definition RtypesCore.h:60
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
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void char Point_t points
R__EXTERN TRandom * gRandom
Definition TRandom.h:73
void SetMarkerColor(Color_t col) override
Set the marker color.
void SetMarkerSize(Size_t msize=1) override
Set marker size, propagate to projecteds.
int SetNextPoint(float x, float y, float z)
void SetMarkerStyle(Style_t mstyle=1) override
Set marker style, propagate to projecteds.
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