new function
[u/mrichter/AliRoot.git] / EVE / macros / reve_quad_test.C
CommitLineData
5a5a1232 1// $Header$
2
adabd949 3Reve::QuadSet* reve_quad_test(Float_t x=0, Float_t y=0, Float_t z=0)
5a5a1232 4{
becafd4b 5 TRandom r(0);
6
7 gStyle->SetPalette(1, 0);
8
9 Reve::QuadSet* q = new Reve::QuadSet("Pepe");
10 q->Reset(Reve::QuadSet::QT_AxisAligned, kFALSE, 32);
adabd949 11 for (Int_t i=0; i<10; ++i) {
becafd4b 12 q->AddQuad(r.Uniform(-10, 10), r.Uniform(-10, 10), r.Uniform(-10, 10),
13 r.Uniform(-1, 1), r.Uniform(-1, 1));
14 q->QuadValue(r.Uniform(0, 130));
15 }
16 q->RefitPlex();
17
adabd949 18 Reve::ZTrans& t = q->RefHMTrans();
19 t.SetPos(x, y, z);
20
21 gReve->AddRenderElement(q);
22 gReve->Redraw3D();
23
24 return q;
25}
26
27Reve::QuadSet* reve_quad_test_circ()
28{
29 TRandom r(0);
30
31 gStyle->SetPalette(1, 0);
32
33 Reve::QuadSet* q = new Reve::QuadSet("Pepe");
34 q->Reset(Reve::QuadSet::QT_AxisAligned, kFALSE, 32);
35
36 Float_t R = 10, dW = 1, dH = .5;
37 for (Int_t i=0; i<12; ++i) {
38 Float_t x = R * TMath::Cos(TMath::TwoPi()*i/12);
39 Float_t y = R * TMath::Sin(TMath::TwoPi()*i/12);
40 q->AddQuad(x-dW, y-dH, r.Uniform(-1, 1), 2*dW, 2*dH);
41 q->QuadValue(r.Uniform(0, 130));
42 }
43 q->RefitPlex();
44
45 Reve::ZTrans& t = q->RefHMTrans();
46 t.SetPos(0, 0, 300);
47
becafd4b 48 gReve->AddRenderElement(q);
49 gReve->Redraw3D();
adabd949 50
51 return q;
5a5a1232 52}