Logo ROOT  
Reference Guide
 
Loading...
Searching...
No Matches
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
44 typedef void (*Callback_foo)(TEveDigitSet*, Int_t, TObject*);
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
54 DigitBase_t(Int_t v=0) : fValue(v), fUserData(nullptr) {}
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
#define b(i)
Definition RSha256.hxx:100
#define f(i)
Definition RSha256.hxx:104
#define g(i)
Definition RSha256.hxx:105
#define a(i)
Definition RSha256.hxx:99
int Int_t
Definition RtypesCore.h:45
short Color_t
Definition RtypesCore.h:92
unsigned char UChar_t
Definition RtypesCore.h:38
char Char_t
Definition RtypesCore.h:37
const char Option_t
Definition RtypesCore.h:66
#define ClassDef(name, id)
Definition Rtypes.h:337
winID h TVirtualViewer3D TVirtualGLPainter p
Option_t Option_t option
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
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void value
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),...
Bool_t GetValueIsColor() const
void SetHighlightFrame(Bool_t hf)
void SetHistoButtons(Bool_t f)
void ScanMinMaxValues(Int_t &min, Int_t &max)
Iterate over the digits and determine min and max signal values.
Bool_t GetAntiFlick() const
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.
Int_t fDefaultValue
TEveRGBAPalette * GetPalette() const
virtual TString GetHighlightTooltip()
Return tooltip for highlighted element if always-sec-select is set.
Bool_t fDisableLighting
TEveDigitSet(const TEveDigitSet &)
virtual void UnHighlighted()
Virtual function called when both fHighlighted is false and fImpliedHighlighted is 0.
TooltipCB_foo GetTooltipCBFoo() const
Bool_t fEmitSignals
TEveRGBAPalette * fPalette
Bool_t GetHistoButtons() const
virtual TObject * GetObject(const TEveException &) const
Get a TObject associated with this render-element.
TEveRGBAPalette * AssertPalette()
Make sure the TEveRGBAPalette pointer is not null.
Bool_t fHistoButtons
void SetDisableLighting(Bool_t l)
Bool_t GetDisableLighting() const
Int_t fLastIdx
The last / current digit added to collection.
Bool_t GetEmitSignals() const
Bool_t GetOwnIds() const
void UseSingleColor()
Instruct digit-set to use single color for its digits.
Bool_t fSingleColor
void DigitColor(Color_t ci)
Set color for the last digit added.
Bool_t GetSelectViaFrame() const
void SetSelectViaFrame(Bool_t sf)
void DigitValue(Int_t value)
Set signal value for the last digit added.
Bool_t fHighlightFrame
void RefitPlex()
Instruct underlying memory allocator to regroup itself into a contiguous memory chunk.
void ReleaseIds()
Protected method.
Bool_t fSelectViaFrame
ERenderMode_e fRenderMode
Callback_foo fCallbackFoo
TObject * GetId(Int_t n) const
Return external TObject associated with digit n.
TEveChunkManager fPlex
Callback_foo GetCallbackFoo() const
void * GetUserData() const
void SetPalette(TEveRGBAPalette *p)
Set TEveRGBAPalette pointer.
void SetCallbackFoo(Callback_foo f)
Bool_t GetHighlightFrame() const
ERenderMode_e GetRenderMode() const
void SetAntiFlick(Bool_t f)
void SetEmitSignals(Bool_t f)
void SetRenderMode(ERenderMode_e rm)
DigitBase_t * fLastDigit
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 *)
TEveChunkManager * GetPlex()
DigitBase_t * NewDigit()
Function providing highlight tooltips when always-sec-select is active.
void SetTooltipCBFoo(TooltipCB_foo f)
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)
Color_t fColor
The last / current idx added to collection.
DigitBase_t * GetDigit(Int_t n) const
TEveFrameBox * fFrame
TRefArray * fDigitIds
void DigitId(TObject *id)
Set external object reference for the last digit added.
Bool_t fValueIsColor
void SetOwnIds(Bool_t o)
TEveFrameBox * GetFrame() const
Bool_t fAntiFlick
Base class for TEveUtil visualization elements, providing hierarchy management, rendering control and...
Definition TEveElement.h:36
void * GetUserData() const
Exception class thrown by TEve classes and macros.
Definition TEveUtil.h:102
Description of a 2D or 3D frame that can be used to visually group a set of objects.
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:41
This is the ROOT implementation of the Qt object communication mechanism (see also http://www....
Definition TQObject.h:48
An array of references to TObjects.
Definition TRefArray.h:33
Basic string class.
Definition TString.h:139
const Int_t n
Definition legend1.C:16
TLine l
Definition textangle.C:4