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 TRefArray *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 fOwnIds; // 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 Bool_t GetOwnIds() const { return fOwnIds; }
122 void SetOwnIds(Bool_t o) { fOwnIds = o; }
123
124 void DigitId(TObject* id);
125 void DigitUserData(void* ud);
126
127 void DigitId(Int_t n, TObject* id);
128 void DigitUserData(Int_t n, void* ud);
129
131 TObject* GetId(Int_t n) const;
132 void* GetUserData(Int_t n) const;
134
135 // --------------------------------
136
137 // Implemented in subclasses:
138 // virtual void ComputeBBox();
139 /*
140 virtual void Paint(Option_t* option="");
141
142 virtual void DigitSelected(Int_t idx);
143 virtual void SecSelected(REveDigitSet* qs, Int_t idx); // *SIGNAL*
144 */
145 // --------------------------------
146
148
149 REveFrameBox* GetFrame() const { return fFrame; }
150 void SetFrame(REveFrameBox* b);
151
154
157
159
163
166
169
172
175
178
181
182 Int_t WriteCoreJson(nlohmann::json &j, Int_t rnr_offset) override;
183};
184
185} // namespace Experimental
186} // namespace ROOT
187#endif
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:43
unsigned char UChar_t
Definition: RtypesCore.h:36
char Char_t
Definition: RtypesCore.h:31
short Color_t
Definition: RtypesCore.h:81
typedef void((*Func_t)())
virtual void SetMainColor(Color_t color) override
Override from REveElement, forward to Frame.
void DigitId(TObject *id)
Set external object reference for the last digit added.
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 SetPalette(REveRGBAPalette *p)
Set REveRGBAPalette pointer.
void DigitUserData(void *ud)
Set user-data for the last digit added.
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.
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.
void DigitValue(Int_t value)
Set signal value for the last digit added.
Callback_foo GetCallbackFoo() const
void SetFrame(REveFrameBox *b)
Set REveFrameBox pointer.
TooltipCB_foo fTooltipCBFoo
Additional function to call on secondary-select.
TObject * GetId(Int_t n) const
Return external TObject associated with digit n.
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:131
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...
Definition: StringConv.hxx:21
basic_json<> json
default JSON class
Definition: REveElement.hxx:88
auto * l
Definition: textangle.C:4
auto * a
Definition: textangle.C:12