Logo ROOT  
Reference Guide
REveDigitSet.hxx
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_REveDigitSet
13#define ROOT_REveDigitSet
14
15#include "TNamed.h"
16#include "TAtt3D.h"
17#include "TAttBBox.h"
18
19#include "ROOT/REveUtil.hxx"
20#include "ROOT/REveElement.hxx"
21#include "ROOT/REveFrameBox.hxx"
25
26class TRefArray;
27
28namespace ROOT {
29namespace Experimental {
30
32 public TAtt3D,
33 public TAttBBox,
35{
36 friend class REveDigitSetEditor;
37 friend class REveDigitSetGL;
38
39 REveDigitSet(const REveDigitSet&); // Not implemented
40 REveDigitSet& operator=(const REveDigitSet&); // Not implemented
41
42public:
44
47
49 {
50 // Base-class for digit representation classes.
51
52 Int_t fValue; // signal value of a digit (can be direct RGBA color)
53 void *fUserData{nullptr}; // user-data for given digit
54
56 };
57
58protected:
59 std::vector<int> fDigitIds; // Array holding references to external objects.
60
61 Int_t fDefaultValue; // Default signal value.
62 Bool_t fValueIsColor; // Interpret signal value as RGBA color.
63 Bool_t fSingleColor; // Use the same color for all digits.
64 Bool_t fAntiFlick; // Make extra render pass to avoid flickering when quads are too small.
65 Bool_t fDetIdsAsSecondaryIndices; // Flag specifying if id-objects are owned by the REveDigitSet.
66 REveChunkManager fPlex; // Container of digit data.
67 DigitBase_t* fLastDigit; //! The last / current digit added to collection.
68 Int_t fLastIdx; //! The last / current idx added to collection.
69
70 Color_t fColor; // Color used for frame (or all digis with single-color).
71 REveFrameBox* fFrame; // Pointer to frame structure.
72 REveRGBAPalette* fPalette; // Pointer to signal-color palette.
73 ERenderMode_e fRenderMode; // Render mode: as-is / line / filled.
74 Bool_t fSelectViaFrame; // Allow selection via frame.
75 Bool_t fHighlightFrame; // Highlight frame when object is selected.
76 Bool_t fDisableLighting;// Disable lighting for rendering.
77 Bool_t fHistoButtons; // Show histogram buttons in object editor.
78
79 Bool_t fEmitSignals; // Emit signals on secondary-select.
80 Callback_foo fCallbackFoo; //! Additional function to call on secondary-select.
81 TooltipCB_foo fTooltipCBFoo; //! Function providing highlight tooltips when always-sec-select is active.
82
84 void ReleaseIds();
85
86public:
87 REveDigitSet(const char* n="REveDigitSet", const char* t="");
88 virtual ~REveDigitSet();
89
90 void UseSingleColor();
91
92 Bool_t GetAntiFlick() const { return fAntiFlick; }
94
95 virtual void SetMainColor(Color_t color) override;
96
97 /*
98 virtual void UnSelected();
99 virtual void UnHighlighted();
100
101 using REveElement::GetHighlightTooltip;
102 virtual TString GetHighlightTooltip();
103 */
104
105 // Implemented in sub-classes:
106 // virtual void Reset(EQuadType_e quadType, Bool_t valIsCol, Int_t chunkSize);
107
108 void RefitPlex();
109 void ScanMinMaxValues(Int_t& min, Int_t& max);
110
111 // --------------------------------
112
113 void SetCurrentDigit(Int_t idx);
114
115 void DigitValue(Int_t value);
116 void DigitColor(Color_t ci);
117 void DigitColor(Color_t ci, Char_t transparency);
119 void DigitColor(UChar_t* rgba);
120
121 void DigitId(Int_t n);
122
125
127 Int_t GetId(Int_t n) const;
128
129 // --------------------------------
130
131 // Implemented in subclasses:
132 // virtual void ComputeBBox();
133 /*
134 virtual void Paint(Option_t* option="");
135
136 virtual void DigitSelected(Int_t idx);
137 virtual void SecSelected(REveDigitSet* qs, Int_t idx); // *SIGNAL*
138 */
139 // --------------------------------
140
142
143 REveFrameBox* GetFrame() const { return fFrame; }
144 void SetFrame(REveFrameBox* b);
145
148
151
153
157
160
163
166
169
172
175
176 Int_t WriteCoreJson(nlohmann::json &j, Int_t rnr_offset) override;
177};
178
179} // namespace Experimental
180} // namespace ROOT
181#endif
typedef void(GLAPIENTRYP _GLUfuncptr)(void)
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:45
unsigned char UChar_t
Definition: RtypesCore.h:38
char Char_t
Definition: RtypesCore.h:33
bool Bool_t
Definition: RtypesCore.h:63
short Color_t
Definition: RtypesCore.h:92
virtual void SetMainColor(Color_t color) override
Override from REveElement, forward to Frame.
REveDigitSet(const char *n="REveDigitSet", const char *t="")
REveRGBAPalette * GetPalette() const
Int_t WriteCoreJson(nlohmann::json &j, Int_t rnr_offset) override
Fill core part of JSON representation.
TooltipCB_foo GetTooltipCBFoo() const
REveDigitSet(const REveDigitSet &)
void DigitColor(UChar_t r, UChar_t g, UChar_t b, UChar_t a=255)
REveFrameBox * GetFrame() const
void DigitId(Int_t n)
Set external id for the last added digit.
void SetPalette(REveRGBAPalette *p)
Set REveRGBAPalette pointer.
void SetTooltipCBFoo(TooltipCB_foo f)
REveRGBAPalette * AssertPalette()
Make sure the REveRGBAPalette pointer is not null.
Color_t fColor
The last / current idx added to collection.
DigitBase_t * NewDigit()
Function providing highlight tooltips when always-sec-select is active.
void DigitColor(Color_t ci)
Set color for the last digit added.
void SetCurrentDigit(Int_t idx)
Set current digit – the one that will receive calls to DigitValue/Color/Id/UserData() functions.
void ScanMinMaxValues(Int_t &min, Int_t &max)
Iterate over the digits and determine min and max signal values.
void UseSingleColor()
Instruct digit-set to use single color for its digits.
Int_t GetId(Int_t n) const
Set external object reference for digit n.
void RefitPlex()
Instruct underlying memory allocator to regroup itself into a contiguous memory chunk.
void SetRenderMode(ERenderMode_e rm)
void(* Callback_foo)(REveDigitSet *, Int_t, TObject *)
virtual ~REveDigitSet()
Destructor.
TString(* TooltipCB_foo)(REveDigitSet *, Int_t)
DigitBase_t * GetDigit(Int_t n) const
REveDigitSet & operator=(const REveDigitSet &)
Int_t fLastIdx
The last / current digit added to collection.
void SetCallbackFoo(Callback_foo f)
void ReleaseIds()
Protected method.
Bool_t GetDetIdsAsSecondaryIndices() const
void DigitValue(Int_t value)
Set signal value for the last digit added.
Callback_foo GetCallbackFoo() const
void SetDetIdsAsSecondaryIndices(Bool_t o)
void SetFrame(REveFrameBox *b)
Set REveFrameBox pointer.
TooltipCB_foo fTooltipCBFoo
Additional function to call on secondary-select.
ERenderMode_e GetRenderMode() const
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
Mother of all ROOT objects.
Definition: TObject.h:37
An array of references to TObjects.
Definition: TRefArray.h:39
Basic string class.
Definition: TString.h:136
const Int_t n
Definition: legend1.C:16
tbb::task_arena is an alias of tbb::interface7::task_arena, which doesn't allow to forward declare tb...
auto * l
Definition: textangle.C:4
auto * a
Definition: textangle.C:12