Logo ROOT  
Reference Guide
 
Loading...
Searching...
No Matches
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"
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", "list of eve points", 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 ps->SetMarkerColor(color);
26 ps->SetMarkerSize(5 + r.Uniform(1, 15));
27 ps->SetMarkerStyle(4);
28 return ps;
29}
30
31void points()
32{
33 auto eveMng = REX::REveManager::Create();
34
36
37 auto psDot = createPointSet(100, 300);
38 psDot->SetMarkerStyle(1);
39 event->AddElement(psDot);
40
41 auto psSquare = createPointSet(100, 300);
42 psSquare->SetMarkerStyle(2);
43 event->AddElement(psSquare);
44
45 auto psStar = createPointSet(10, 300);
46 psStar->SetMarkerStyle(3);
47 event->AddElement(psStar);
48
49 eveMng->Show();
50}
int Int_t
Definition RtypesCore.h:45
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
R__EXTERN TRandom * gRandom
Definition TRandom.h:62
REveScene * GetEventScene() const
void Show(const RWebDisplayArgs &args="")
Show eve manager in specified browser.
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:27
ROOT::Experimental::REveManager * eveMng
void points()
Definition points.C:31
REX::REvePointSet * createPointSet(int npoints=2, float s=2, int color=28)
Definition points.C:16