Logo ROOT  
Reference Guide
 
Loading...
Searching...
No Matches
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
45 typedef void (*Callback_foo)(const REveDigitSet*, Int_t, TObject*);
46 typedef std::string (*TooltipCB_foo)(const REveDigitSet*, Int_t);
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
55 DigitBase_t(Int_t v=0) : fValue(v), fUserData(nullptr) {}
56 };
57
58protected:
59 TRefArray *fDigitIds{nullptr}; // 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
66 Bool_t fOwnIds{false}; // Flag specifying if id-objects are owned by the TEveDigitSet.
67 Bool_t fDetIdsAsSecondaryIndices; // Flag specifying if id-objects are owned by the REveDigitSet.
68 REveChunkManager fPlex; // Container of digit data.
69 DigitBase_t* fLastDigit; //! The last / current digit added to collection.
70 Int_t fLastIdx; //! The last / current idx added to collection.
71
72 Color_t fColor; // Color used for frame (or all digis with single-color).
73 REveFrameBox* fFrame; // Pointer to frame structure.
74 REveRGBAPalette* fPalette; // Pointer to signal-color palette.
75 ERenderMode_e fRenderMode; // Render mode: as-is / line / filled.
76 Bool_t fSelectViaFrame; // Allow selection via frame.
77 Bool_t fHighlightFrame; // Highlight frame when object is selected.
78 Bool_t fDisableLighting;// Disable lighting for rendering.
79 Bool_t fHistoButtons; // Show histogram buttons in object editor.
80
81 Bool_t fEmitSignals; // Emit signals on secondary-select.
82 Callback_foo fCallbackFoo; //! Additional function to call on secondary-select.
83 TooltipCB_foo fTooltipCBFoo; //! Function providing highlight tooltips when always-sec-select is active.
84
86 void ReleaseIds();
87
88public:
89 REveDigitSet(const char* n="REveDigitSet", const char* t="");
90 virtual ~REveDigitSet();
91
92 void UseSingleColor();
93
94 Bool_t GetAntiFlick() const { return fAntiFlick; }
96
97 virtual void SetMainColor(Color_t color) override;
98
99 /*
100 virtual void UnSelected();
101 virtual void UnHighlighted();
102*/
104 std::string GetHighlightTooltip(const std::set<int>& secondary_idcs) const override;
105
106 // Implemented in sub-classes:
107 // virtual void Reset(EQuadType_e quadType, Bool_t valIsCol, Int_t chunkSize);
108
109 void RefitPlex();
110 void ScanMinMaxValues(Int_t& min, Int_t& max);
111
112 // --------------------------------
113
114 void SetCurrentDigit(Int_t idx);
115
116 void DigitValue(Int_t value);
117 void DigitColor(Color_t ci);
118 void DigitColor(Color_t ci, Char_t transparency);
120 void DigitColor(UChar_t* rgba);
121
122 void DigitId(TObject* id);
123 void DigitId(Int_t n, TObject* id);
124
127
129 TObject* GetId(Int_t n) const;
130
131 // --------------------------------
132
133 // Implemented in subclasses:
134 // virtual void ComputeBBox();
135 /*
136 virtual void Paint(Option_t* option="");
137
138 virtual void DigitSelected(Int_t idx);
139 virtual void SecSelected(REveDigitSet* qs, Int_t idx); // *SIGNAL*
140 */
141 // --------------------------------
142
144
145 REveFrameBox* GetFrame() const { return fFrame; }
146 void SetFrame(REveFrameBox* b);
147
150
153
155
159
162
165
168
171
174
177
178 bool IsDigitVisible(const DigitBase_t*) const;
179 int GetAtomIdxFromShapeIdx(int) const;
180 int GetShapeIdxFromAtomIdx(int) const;
181
182 void NewShapePicked(int shapeId, Int_t selectionId, bool multi);
183
184
185 bool RequiresExtraSelectionData() const override { return GetAlwaysSecSelect(); };
186 void FillExtraSelectionData(nlohmann::json& j, const std::set<int>& secondary_idcs) const override;
187
188 Int_t WriteCoreJson(nlohmann::json &j, Int_t rnr_offset) override;
189};
190
191} // namespace Experimental
192} // namespace ROOT
193#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
winID h TVirtualViewer3D TVirtualGLPainter p
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
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.
void NewShapePicked(int shapeId, Int_t selectionId, bool multi)
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 &)
REveFrameBox * GetFrame() const
void SetPalette(REveRGBAPalette *p)
Set REveRGBAPalette pointer.
std::string(* TooltipCB_foo)(const REveDigitSet *, Int_t)
void FillExtraSelectionData(nlohmann::json &j, const std::set< int > &secondary_idcs) const override
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.
int GetAtomIdxFromShapeIdx(int) const
Utility function for maping digit idx with visible shape idx.
bool IsDigitVisible(const DigitBase_t *) const
Utility function for maping digit idx with visible shape idx.
std::string GetHighlightTooltip(const std::set< int > &secondary_idcs) const override
Return tooltip for highlighted element if always-sec-select is set.
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(* Callback_foo)(const REveDigitSet *, Int_t, TObject *)
void RefitPlex()
Instruct underlying memory allocator to regroup itself into a contiguous memory chunk.
void SetRenderMode(ERenderMode_e rm)
virtual ~REveDigitSet()
Destructor.
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.
int GetShapeIdxFromAtomIdx(int) const
Utility function for maping shape idx to digit idx.
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
Set external object reference for digit n.
ERenderMode_e GetRenderMode() const
bool RequiresExtraSelectionData() const override
virtual std::string GetHighlightTooltip(const std::set< int > &) 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:41
An array of references to TObjects.
Definition TRefArray.h:33
const Int_t n
Definition legend1.C:16
This file contains a specialised ROOT message handler to test for diagnostic in unit tests.
basic_json<> json
TLine l
Definition textangle.C:4