Logo ROOT   6.16/01
Reference Guide
points.C
Go to the documentation of this file.
1/// \file
2/// \ingroup tutorial_eve7
3/// This example display only points in web browser
4///
5/// \macro_code
6///
7
8#include "TRandom.h"
9#include <ROOT/REveElement.hxx>
10#include <ROOT/REveScene.hxx>
11#include <ROOT/REveManager.hxx>
12#include <ROOT/REvePointSet.hxx>
13
14namespace REX = ROOT::Experimental;
15
16REX::REvePointSet *createPointSet(int npoints = 2, float s = 2, int color = 28)
17{
18 TRandom &r = *gRandom;
19
20 REX::REvePointSet *ps = new REX::REvePointSet("MyTestPoints", npoints);
21
22 for (Int_t i=0; i<npoints; ++i) {
23 ps->SetNextPoint(r.Uniform(-s,s), r.Uniform(-s,s), r.Uniform(-s,s));
24 }
25
26 ps->SetMarkerColor(color);
27 ps->SetMarkerSize(3+r.Uniform(1, 2));
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 auto ps = createPointSet(100);
38 event->AddElement(ps);
39
40 eveMng->Show();
41}
ROOT::R::TRInterface & r
Definition: Object.C:4
int Int_t
Definition: RtypesCore.h:41
R__EXTERN TRandom * gRandom
Definition: TRandom.h:62
This is the base class for the ROOT Random number generators.
Definition: TRandom.h:27
REX::REveManager * eveMng
Definition: collection.C:28
static constexpr double s
static constexpr double ps
void points()
Definition: points.C:32
REX::REvePointSet * createPointSet(int npoints=2, float s=2, int color=28)
Definition: points.C:16