Logo ROOT   6.16/01
Reference Guide
TEveDigitSet.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_TEveDigitSet
13#define ROOT_TEveDigitSet
14
15#include "TNamed.h"
16#include "TQObject.h"
17#include "TAtt3D.h"
18#include "TAttBBox.h"
19
20#include "TEveUtil.h"
21#include "TEveElement.h"
22#include "TEveFrameBox.h"
23#include "TEveRGBAPalette.h"
24#include "TEveChunkManager.h"
26
27class TRefArray;
28
30 public TNamed, public TQObject,
31 public TAtt3D,
32 public TAttBBox,
34{
35 friend class TEveDigitSetEditor;
36 friend class TEveDigitSetGL;
37
38 TEveDigitSet(const TEveDigitSet&); // Not implemented
39 TEveDigitSet& operator=(const TEveDigitSet&); // Not implemented
40
41public:
43
46
48 {
49 // Base-class for digit representation classes.
50
51 Int_t fValue; // signal value of a digit (can be direct RGBA color)
52 void *fUserData; // user-data for given digit
53
55 };
56
57protected:
58 TRefArray *fDigitIds; // Array holding references to external objects.
59
60 Int_t fDefaultValue; // Default signal value.
61 Bool_t fValueIsColor; // Interpret signal value as RGBA color.
62 Bool_t fSingleColor; // Use the same color for all digits.
63 Bool_t fAntiFlick; // Make extra render pass to avoid flickering when quads are too small.
64 Bool_t fOwnIds; // Flag specifying if id-objects are owned by the TEveDigitSet.
65 TEveChunkManager fPlex; // Container of digit data.
66 DigitBase_t* fLastDigit; //! The last / current digit added to collection.
67 Int_t fLastIdx; //! The last / current idx added to collection.
68
69 Color_t fColor; // Color used for frame (or all digis with single-color).
70 TEveFrameBox* fFrame; // Pointer to frame structure.
71 TEveRGBAPalette* fPalette; // Pointer to signal-color palette.
72 ERenderMode_e fRenderMode; // Render mode: as-is / line / filled.
73 Bool_t fSelectViaFrame; // Allow selection via frame.
74 Bool_t fHighlightFrame; // Highlight frame when object is selected.
75 Bool_t fDisableLighting;// Disable lighting for rendering.
76 Bool_t fHistoButtons; // Show histogram buttons in object editor.
77
78 Bool_t fEmitSignals; // Emit signals on secondary-select.
79 Callback_foo fCallbackFoo; //! Additional function to call on secondary-select.
80 TooltipCB_foo fTooltipCBFoo; //! Function providing highlight tooltips when always-sec-select is active.
81
83 void ReleaseIds();
84
85public:
86 TEveDigitSet(const char* n="TEveDigitSet", const char* t="");
87 virtual ~TEveDigitSet();
88
89 virtual TObject* GetObject(const TEveException&) const
90 { const TObject* obj = this; return const_cast<TObject*>(obj); }
91
92 void UseSingleColor();
93
94 Bool_t GetAntiFlick() const { return fAntiFlick; }
96
97 virtual void SetMainColor(Color_t color);
98
99 virtual void UnSelected();
100 virtual void UnHighlighted();
101
103
104 // Implemented in sub-classes:
105 // virtual void Reset(EQuadType_e quadType, Bool_t valIsCol, Int_t chunkSize);
106
107 void RefitPlex();
108 void ScanMinMaxValues(Int_t& min, Int_t& max);
109
110 // --------------------------------
111
112 void SetCurrentDigit(Int_t idx);
113
114 void DigitValue(Int_t value);
115 void DigitColor(Color_t ci);
116 void DigitColor(Color_t ci, Char_t transparency);
118 void DigitColor(UChar_t* rgba);
119
120 Bool_t GetOwnIds() const { return fOwnIds; }
121 void SetOwnIds(Bool_t o) { fOwnIds = o; }
122
123 void DigitId(TObject* id);
124 void DigitUserData(void* ud);
125
126 void DigitId(Int_t n, TObject* id);
127 void DigitUserData(Int_t n, void* ud);
128
130 TObject* GetId(Int_t n) const;
131 void* GetUserData(Int_t n) const;
133
134 // --------------------------------
135
136 // Implemented in subclasses:
137 // virtual void ComputeBBox();
138
139 virtual void Paint(Option_t* option="");
140
141 virtual void DigitSelected(Int_t idx);
142 virtual void SecSelected(TEveDigitSet* qs, Int_t idx); // *SIGNAL*
143
144 // --------------------------------
145
147
148 TEveFrameBox* GetFrame() const { return fFrame; }
149 void SetFrame(TEveFrameBox* b);
150
153
156
158
162
165
168
171
174
177
180
181 ClassDef(TEveDigitSet, 0); // Base-class for storage of digit collections; provides transformation matrix (TEveTrans), signal to color mapping (TEveRGBAPalette) and visual grouping (TEveFrameBox).
182};
183
184#endif
SVector< double, 2 > v
Definition: Dict.h:5
ROOT::R::TRInterface & r
Definition: Object.C:4
#define b(i)
Definition: RSha256.hxx:100
#define f(i)
Definition: RSha256.hxx:104
#define g(i)
Definition: RSha256.hxx:105
int Int_t
Definition: RtypesCore.h:41
unsigned char UChar_t
Definition: RtypesCore.h:34
char Char_t
Definition: RtypesCore.h:29
bool Bool_t
Definition: RtypesCore.h:59
short Color_t
Definition: RtypesCore.h:79
const char Option_t
Definition: RtypesCore.h:62
#define ClassDef(name, id)
Definition: Rtypes.h:324
typedef void((*Func_t)())
Use this attribute class when an object should have 3D capabilities.
Definition: TAtt3D.h:19
Helper for management of bounding-box information.
Definition: TAttBBox.h:18
Vector-like container with chunked memory allocation.
Char_t * Atom(Int_t idx) const
Editor for TEveDigitSet class.
OpenGL renderer class for TEveDigitSet.
Base-class for storage of digit collections; provides transformation matrix (TEveTrans),...
Definition: TEveDigitSet.h:34
Bool_t GetValueIsColor() const
Definition: TEveDigitSet.h:157
void SetHighlightFrame(Bool_t hf)
Definition: TEveDigitSet.h:155
void SetHistoButtons(Bool_t f)
Definition: TEveDigitSet.h:170
void ScanMinMaxValues(Int_t &min, Int_t &max)
Iterate over the digits and determine min and max signal values.
Bool_t GetAntiFlick() const
Definition: TEveDigitSet.h:94
virtual ~TEveDigitSet()
Destructor.
virtual void SetMainColor(Color_t color)
Override from TEveElement, forward to Frame.
void SetCurrentDigit(Int_t idx)
Set current digit – the one that will receive calls to DigitValue/Color/Id/UserData() functions.
TooltipCB_foo fTooltipCBFoo
Additional function to call on secondary-select.
Definition: TEveDigitSet.h:80
Int_t fDefaultValue
Definition: TEveDigitSet.h:60
TEveRGBAPalette * GetPalette() const
Definition: TEveDigitSet.h:159
virtual TString GetHighlightTooltip()
Return tooltip for highlighted element if always-sec-select is set.
Bool_t fDisableLighting
Definition: TEveDigitSet.h:75
TEveDigitSet(const TEveDigitSet &)
virtual void UnHighlighted()
Virtual function called when both fHighlighted is false and fImpliedHighlighted is 0.
TooltipCB_foo GetTooltipCBFoo() const
Definition: TEveDigitSet.h:178
Bool_t fEmitSignals
Definition: TEveDigitSet.h:78
TEveRGBAPalette * fPalette
Definition: TEveDigitSet.h:71
Bool_t GetHistoButtons() const
Definition: TEveDigitSet.h:169
virtual TObject * GetObject(const TEveException &) const
Get a TObject associated with this render-element.
Definition: TEveDigitSet.h:89
TEveRGBAPalette * AssertPalette()
Make sure the TEveRGBAPalette pointer is not null.
Bool_t fHistoButtons
Definition: TEveDigitSet.h:76
Bool_t fOwnIds
Definition: TEveDigitSet.h:64
void SetDisableLighting(Bool_t l)
Definition: TEveDigitSet.h:167
Bool_t GetDisableLighting() const
Definition: TEveDigitSet.h:166
Int_t fLastIdx
The last / current digit added to collection.
Definition: TEveDigitSet.h:67
Bool_t GetEmitSignals() const
Definition: TEveDigitSet.h:172
Bool_t GetOwnIds() const
Definition: TEveDigitSet.h:120
void UseSingleColor()
Instruct digit-set to use single color for its digits.
Bool_t fSingleColor
Definition: TEveDigitSet.h:62
void DigitColor(Color_t ci)
Set color for the last digit added.
Bool_t GetSelectViaFrame() const
Definition: TEveDigitSet.h:151
void SetSelectViaFrame(Bool_t sf)
Definition: TEveDigitSet.h:152
void DigitValue(Int_t value)
Set signal value for the last digit added.
Bool_t fHighlightFrame
Definition: TEveDigitSet.h:74
void RefitPlex()
Instruct underlying memory allocator to regroup itself into a contiguous memory chunk.
void ReleaseIds()
Protected method.
Bool_t fSelectViaFrame
Definition: TEveDigitSet.h:73
ERenderMode_e fRenderMode
Definition: TEveDigitSet.h:72
Callback_foo fCallbackFoo
Definition: TEveDigitSet.h:79
TObject * GetId(Int_t n) const
Return external TObject associated with digit n.
TEveChunkManager fPlex
Definition: TEveDigitSet.h:65
Callback_foo GetCallbackFoo() const
Definition: TEveDigitSet.h:175
void * GetUserData() const
Definition: TEveElement.h:302
void SetPalette(TEveRGBAPalette *p)
Set TEveRGBAPalette pointer.
void SetCallbackFoo(Callback_foo f)
Definition: TEveDigitSet.h:176
Bool_t GetHighlightFrame() const
Definition: TEveDigitSet.h:154
ERenderMode_e GetRenderMode() const
Definition: TEveDigitSet.h:163
void SetAntiFlick(Bool_t f)
Definition: TEveDigitSet.h:95
void SetEmitSignals(Bool_t f)
Definition: TEveDigitSet.h:173
void SetRenderMode(ERenderMode_e rm)
Definition: TEveDigitSet.h:164
DigitBase_t * fLastDigit
Definition: TEveDigitSet.h:66
TEveDigitSet & operator=(const TEveDigitSet &)
virtual void DigitSelected(Int_t idx)
Called from renderer when a digit with index idx is selected.
void(* Callback_foo)(TEveDigitSet *, Int_t, TObject *)
Definition: TEveDigitSet.h:44
TEveChunkManager * GetPlex()
Definition: TEveDigitSet.h:146
DigitBase_t * NewDigit()
Function providing highlight tooltips when always-sec-select is active.
void SetTooltipCBFoo(TooltipCB_foo f)
Definition: TEveDigitSet.h:179
void SetFrame(TEveFrameBox *b)
Set TEveFrameBox pointer.
virtual void Paint(Option_t *option="")
Paint this object. Only direct rendering is supported.
virtual void SecSelected(TEveDigitSet *qs, Int_t idx)
Emit a SecSelected signal.
void DigitUserData(void *ud)
Set user-data for the last digit added.
virtual void UnSelected()
Virtual function called when both fSelected is false and fImpliedSelected is 0.
TString(* TooltipCB_foo)(TEveDigitSet *, Int_t)
Definition: TEveDigitSet.h:45
Color_t fColor
The last / current idx added to collection.
Definition: TEveDigitSet.h:69
DigitBase_t * GetDigit(Int_t n) const
Definition: TEveDigitSet.h:129
TEveFrameBox * fFrame
Definition: TEveDigitSet.h:70
TRefArray * fDigitIds
Definition: TEveDigitSet.h:58
void DigitId(TObject *id)
Set external object reference for the last digit added.
Bool_t fValueIsColor
Definition: TEveDigitSet.h:61
void SetOwnIds(Bool_t o)
Definition: TEveDigitSet.h:121
TEveFrameBox * GetFrame() const
Definition: TEveDigitSet.h:148
Bool_t fAntiFlick
Definition: TEveDigitSet.h:63
Base class for TEveUtil visualization elements, providing hierarchy management, rendering control and...
Definition: TEveElement.h:34
void * GetUserData() const
Definition: TEveElement.h:302
Exception class thrown by TEve classes and macros.
Definition: TEveUtil.h:103
Description of a 2D or 3D frame that can be used to visually group a set of objects.
Definition: TEveFrameBox.h:19
A generic, speed-optimised mapping from value to RGBA color supporting different wrapping and range t...
Semi-abstract interface for classes supporting secondary-selection.
The TNamed class is the base class for all named ROOT classes.
Definition: TNamed.h:29
Mother of all ROOT objects.
Definition: TObject.h:37
This is the ROOT implementation of the Qt object communication mechanism (see also http://www....
Definition: TQObject.h:49
An array of references to TObjects.
Definition: TRefArray.h:39
Basic string class.
Definition: TString.h:131
const Int_t n
Definition: legend1.C:16
auto * l
Definition: textangle.C:4
auto * a
Definition: textangle.C:12