Logo ROOT   6.10/09
Reference Guide
TEveQuadSet.h
Go to the documentation of this file.
1 // @(#)root/eve:$Id$
2 // Authors: Matevz Tadel & Alja Mrak-Tadel: 2006, 2007
3 
4 /*************************************************************************
5  * Copyright (C) 1995-2007, Rene Brun and Fons Rademakers. *
6  * All rights reserved. *
7  * *
8  * For the licensing terms see $ROOTSYS/LICENSE. *
9  * For the list of contributors see $ROOTSYS/README/CREDITS. *
10  *************************************************************************/
11 
12 #ifndef ROOT_TEveQuadSet
13 #define ROOT_TEveQuadSet
14 
15 #include "TEveDigitSet.h"
16 
17 class TRandom;
18 
19 class TEveQuadSet : public TEveDigitSet
20 {
21  friend class TEveQuadSetGL;
22 
23  TEveQuadSet(const TEveQuadSet&); // Not implemented
24  TEveQuadSet& operator=(const TEveQuadSet&); // Not implemented
25 
26 public:
27  enum EQuadType_e {
28  kQT_Undef, // unknown-ignored
29  kQT_FreeQuad, // arbitrary quad: specify 4*(x,y,z) quad corners
30  kQT_RectangleXY, // rectangle in x-y plane: specify x, y, z, w, h
31  kQT_RectangleXZ, // rectangle in x-z plane: specify x, y, z, w, h
32  kQT_RectangleYZ, // rectangle in y-z plane: specify x, y, z, w, h
33  kQT_RectangleXYFixedDim, // rectangle in x-y plane: specify x, y, z; w, h taken from fDefWidth/Height
34  kQT_RectangleXYFixedZ, // rectangle in x-y plane: specify x, y, w, h; z taken from fDefCoord
35  kQT_RectangleXZFixedY, // rectangle in x-z plane: specify x, z, w, h; y taken from fDefCoord
36  kQT_RectangleYZFixedX, // rectangle in y-z plane: specify y, z, w, h; x taken from fDefWidth/Height/Coord
37  kQT_RectangleXYFixedDimZ, // rectangle in x-y plane: specify x, y; w, h, z taken from fDefWidth/Height/Coord
38  kQT_RectangleXZFixedDimY, // rectangle in x-z plane: specify x, z; w, h, y taken from fDefWidth/Height/Coord
39  kQT_RectangleYZFixedDimX, // rectangle in y-z plane: specify y, z; w, h, x taken from fDefWidth/Height/Coord
41  // line modes (needed for uniform handling of silicon-strip digits)
42  kQT_LineXYFixedZ, // line in x-y plane: specify x, y, w(dx), h(dy); z taken from fDefCoord
43  kQT_LineXZFixedY, // line in x-z plane: specify x, z, w(dx), h(dz); y taken from fDefCoord
45  // hexagon modes
46  kQT_HexagonXY, // horizontal hexagon: specify x, y, z, r
47  kQT_HexagonYX, // vertical hexagon: specify x, y, z, r
49  // circle modes:
50  // QT_CircleXY, // specify r, z
51  // QT_CircleXYFixedZ, // specify r
52  // QT_CircleXYFixedR, // specify z
53  };
54 
55  struct QFreeQuad_t : public DigitBase_t { Float_t fVertices[12]; };
56 
57  struct QOrigin_t : public DigitBase_t { Float_t fA, fB; };
58 
59  struct QRectFixDimC_t : public QOrigin_t {};
60 
61  struct QRectFixDim_t : public QRectFixDimC_t { Float_t fC; };
62 
63  struct QRectFixC_t : public QRectFixDimC_t { Float_t fW, fH; };
64 
65  struct QRect_t : public QRectFixDim_t { Float_t fW, fH; };
66 
67  struct QLineFixC_t : public QOrigin_t { Float_t fDx, fDy; };
68 
69  struct QHex_t : public QOrigin_t { Float_t fC, fR; };
70 
71 protected:
73 
74  Float_t fDefWidth; // Breadth assigned to first coordinate (A)
75  Float_t fDefHeight; // Breadth assigned to second coordinate (B)
76  Float_t fDefCoord; // Default value for third coordinate (C)
77 
78  static Int_t SizeofAtom(EQuadType_e qt);
79 
80 public:
81  TEveQuadSet(const char* n="TEveQuadSet", const char* t="");
82  TEveQuadSet(EQuadType_e quadType, Bool_t valIsCol, Int_t chunkSize,
83  const char* n="TEveQuadSet", const char* t="");
84  virtual ~TEveQuadSet() {}
85 
86  void Reset(EQuadType_e quadType, Bool_t valIsCol, Int_t chunkSize);
87 
88  Float_t GetDefWidth() const { return fDefWidth; }
89  Float_t GetDefHeight() const { return fDefHeight; }
90  Float_t GetDefCoord() const { return fDefCoord; }
91 
92  void SetDefWidth(Float_t v) { fDefWidth = v; }
93  void SetDefHeight(Float_t v) { fDefHeight = v; }
94  void SetDefCoord(Float_t v) { fDefCoord = v; }
95 
96  // --------------------------------
97 
98  void AddQuad(Float_t* verts);
99 
100  void AddQuad(Float_t a, Float_t b);
101  void AddQuad(Float_t a, Float_t b, Float_t c);
102  void AddQuad(Float_t a, Float_t b, Float_t w, Float_t h);
103  void AddQuad(Float_t a, Float_t b, Float_t c, Float_t w, Float_t h);
104 
105  void AddLine(Float_t a, Float_t b, Float_t w, Float_t h);
106 
107  void AddHexagon(Float_t a, Float_t b, Float_t z, Float_t r);
108 
109  // Wrappers to make transition to TEveDigitSet as base easier
110  void QuadValue(Int_t value) { DigitValue(value); }
111  void QuadColor(Color_t ci) { DigitColor(ci); }
112  void QuadColor(UChar_t r, UChar_t g, UChar_t b, UChar_t a=255) { DigitColor(r, g, b, a); }
113  void QuadId(TObject* id) { DigitId(id); }
114 
115  // --------------------------------
116 
117  // void Test(Int_t nquads);
118 
119  virtual void ComputeBBox();
120 
121  // virtual void Paint(Option_t* option="");
122 
123  ClassDef(TEveQuadSet, 0); // Collection of 2D primitives (rectangles, hexagons, or lines); each primitive can be assigned a signal value and a TRef.
124 };
125 
126 #endif
Float_t fDefHeight
Definition: TEveQuadSet.h:75
static Int_t SizeofAtom(EQuadType_e qt)
Return size of given atom type.
Definition: TEveQuadSet.cxx:74
void DigitId(TObject *id)
Set external object reference for the last digit added.
float Float_t
Definition: RtypesCore.h:53
Float_t GetDefWidth() const
Definition: TEveQuadSet.h:88
void SetDefWidth(Float_t v)
Definition: TEveQuadSet.h:92
TH1 * h
Definition: legend2.C:5
void AddHexagon(Float_t a, Float_t b, Float_t z, Float_t r)
Add a hexagon with given center (a,b,c) and radius.
void QuadColor(Color_t ci)
Definition: TEveQuadSet.h:111
void AddLine(Float_t a, Float_t b, Float_t w, Float_t h)
Add a line with starting coordinates and displacements.
void AddQuad(Float_t *verts)
int Int_t
Definition: RtypesCore.h:41
bool Bool_t
Definition: RtypesCore.h:59
TArc * a
Definition: textangle.C:12
void QuadId(TObject *id)
Definition: TEveQuadSet.h:113
Float_t GetDefCoord() const
Definition: TEveQuadSet.h:90
#define ClassDef(name, id)
Definition: Rtypes.h:297
void QuadColor(UChar_t r, UChar_t g, UChar_t b, UChar_t a=255)
Definition: TEveQuadSet.h:112
This is the base class for the ROOT Random number generators.
Definition: TRandom.h:27
Float_t GetDefHeight() const
Definition: TEveQuadSet.h:89
void SetDefHeight(Float_t v)
Definition: TEveQuadSet.h:93
void DigitColor(Color_t ci)
Set color for the last digit added.
short Color_t
Definition: RtypesCore.h:79
EQuadType_e fQuadType
Definition: TEveQuadSet.h:72
Float_t fDefCoord
Definition: TEveQuadSet.h:76
TRandom2 r(17)
SVector< double, 2 > v
Definition: Dict.h:5
virtual ~TEveQuadSet()
Definition: TEveQuadSet.h:84
void SetDefCoord(Float_t v)
Definition: TEveQuadSet.h:94
void QuadValue(Int_t value)
Definition: TEveQuadSet.h:110
TEveQuadSet(const TEveQuadSet &)
Mother of all ROOT objects.
Definition: TObject.h:37
you should not use this method at all Int_t Int_t z
Definition: TRolke.cxx:630
you should not use this method at all Int_t Int_t Double_t Double_t Double_t Int_t Double_t Double_t Double_t Double_t b
Definition: TRolke.cxx:630
Float_t fDefWidth
Definition: TEveQuadSet.h:74
void Reset(EQuadType_e quadType, Bool_t valIsCol, Int_t chunkSize)
Clear the quad-set and reset the basic parameters.
TEveQuadSet & operator=(const TEveQuadSet &)
unsigned char UChar_t
Definition: RtypesCore.h:34
GL-renderer for TEveQuadSet class.
Definition: TEveQuadSetGL.h:18
void DigitValue(Int_t value)
Set signal value for the last digit added.
const Int_t n
Definition: legend1.C:16
Base-class for storage of digit collections; provides transformation matrix (TEveTrans), signal to color mapping (TEveRGBAPalette) and visual grouping (TEveFrameBox).
Definition: TEveDigitSet.h:29
virtual void ComputeBBox()
Fill bounding-box information.
Supports various internal formats that result in rendering of a set of planar (lines, rectangles, hexagons with shared normal) objects.
Definition: TEveQuadSet.h:19