Warning, file /include/root/TEveDigitSet.h was not indexed
or was modified since last indexation (in which case cross-reference links may be missing, inaccurate or erroneous).
0001
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012 #ifndef ROOT_TEveDigitSet
0013 #define ROOT_TEveDigitSet
0014
0015 #include "TNamed.h"
0016 #include "TQObject.h"
0017 #include "TAtt3D.h"
0018 #include "TAttBBox.h"
0019
0020 #include "TEveUtil.h"
0021 #include "TEveElement.h"
0022 #include "TEveFrameBox.h"
0023 #include "TEveRGBAPalette.h"
0024 #include "TEveChunkManager.h"
0025 #include "TEveSecondarySelectable.h"
0026
0027 class TRefArray;
0028
0029 class TEveDigitSet : public TEveElement,
0030 public TNamed, public TQObject,
0031 public TAtt3D,
0032 public TAttBBox,
0033 public TEveSecondarySelectable
0034 {
0035 friend class TEveDigitSetEditor;
0036 friend class TEveDigitSetGL;
0037
0038 TEveDigitSet(const TEveDigitSet&);
0039 TEveDigitSet& operator=(const TEveDigitSet&);
0040
0041 public:
0042 enum ERenderMode_e { kRM_AsIs, kRM_Line, kRM_Fill };
0043
0044 typedef void (*Callback_foo)(TEveDigitSet*, Int_t, TObject*);
0045 typedef TString (*TooltipCB_foo)(TEveDigitSet*, Int_t);
0046
0047 struct DigitBase_t
0048 {
0049
0050
0051 Int_t fValue;
0052 void *fUserData;
0053
0054 DigitBase_t(Int_t v=0) : fValue(v), fUserData(nullptr) {}
0055 };
0056
0057 protected:
0058 TRefArray *fDigitIds;
0059
0060 Int_t fDefaultValue;
0061 Bool_t fValueIsColor;
0062 Bool_t fSingleColor;
0063 Bool_t fAntiFlick;
0064 Bool_t fOwnIds;
0065 TEveChunkManager fPlex;
0066 DigitBase_t* fLastDigit;
0067 Int_t fLastIdx;
0068
0069 Color_t fColor;
0070 TEveFrameBox* fFrame;
0071 TEveRGBAPalette* fPalette;
0072 ERenderMode_e fRenderMode;
0073 Bool_t fSelectViaFrame;
0074 Bool_t fHighlightFrame;
0075 Bool_t fDisableLighting;
0076 Bool_t fHistoButtons;
0077
0078 Bool_t fEmitSignals;
0079 Callback_foo fCallbackFoo;
0080 TooltipCB_foo fTooltipCBFoo;
0081
0082 DigitBase_t* NewDigit();
0083 void ReleaseIds();
0084
0085 public:
0086 TEveDigitSet(const char* n="TEveDigitSet", const char* t="");
0087 ~TEveDigitSet() override;
0088
0089 TObject* GetObject(const TEveException&) const override
0090 { const TObject* obj = this; return const_cast<TObject*>(obj); }
0091
0092 void UseSingleColor();
0093
0094 Bool_t GetAntiFlick() const { return fAntiFlick; }
0095 void SetAntiFlick(Bool_t f) { fAntiFlick = f; }
0096
0097 void SetMainColor(Color_t color) override;
0098
0099 void UnSelected() override;
0100 void UnHighlighted() override;
0101
0102 TString GetHighlightTooltip() override;
0103
0104
0105
0106
0107 void RefitPlex();
0108 void ScanMinMaxValues(Int_t& min, Int_t& max);
0109
0110
0111
0112 void SetCurrentDigit(Int_t idx);
0113
0114 void DigitValue(Int_t value);
0115 void DigitColor(Color_t ci);
0116 void DigitColor(Color_t ci, Char_t transparency);
0117 void DigitColor(UChar_t r, UChar_t g, UChar_t b, UChar_t a=255);
0118 void DigitColor(UChar_t* rgba);
0119
0120 Bool_t GetOwnIds() const { return fOwnIds; }
0121 void SetOwnIds(Bool_t o) { fOwnIds = o; }
0122
0123 void DigitId(TObject* id);
0124 void DigitUserData(void* ud);
0125
0126 void DigitId(Int_t n, TObject* id);
0127 void DigitUserData(Int_t n, void* ud);
0128
0129 DigitBase_t* GetDigit(Int_t n) const { return (DigitBase_t*) fPlex.Atom(n); }
0130 TObject* GetId(Int_t n) const;
0131 void* GetUserData(Int_t n) const;
0132 using TEveElement::GetUserData;
0133
0134
0135
0136
0137
0138
0139 void Paint(Option_t* option="") override;
0140
0141 virtual void DigitSelected(Int_t idx);
0142 virtual void SecSelected(TEveDigitSet* qs, Int_t idx);
0143
0144
0145
0146 TEveChunkManager* GetPlex() { return &fPlex; }
0147
0148 TEveFrameBox* GetFrame() const { return fFrame; }
0149 void SetFrame(TEveFrameBox* b);
0150
0151 Bool_t GetSelectViaFrame() const { return fSelectViaFrame; }
0152 void SetSelectViaFrame(Bool_t sf) { fSelectViaFrame = sf; }
0153
0154 Bool_t GetHighlightFrame() const { return fHighlightFrame; }
0155 void SetHighlightFrame(Bool_t hf) { fHighlightFrame = hf; }
0156
0157 Bool_t GetValueIsColor() const { return fValueIsColor; }
0158
0159 TEveRGBAPalette* GetPalette() const { return fPalette; }
0160 void SetPalette(TEveRGBAPalette* p);
0161 TEveRGBAPalette* AssertPalette();
0162
0163 ERenderMode_e GetRenderMode() const { return fRenderMode; }
0164 void SetRenderMode(ERenderMode_e rm) { fRenderMode = rm; }
0165
0166 Bool_t GetDisableLighting() const { return fDisableLighting; }
0167 void SetDisableLighting(Bool_t l) { fDisableLighting = l; }
0168
0169 Bool_t GetHistoButtons() const { return fHistoButtons; }
0170 void SetHistoButtons(Bool_t f) { fHistoButtons = f; }
0171
0172 Bool_t GetEmitSignals() const { return fEmitSignals; }
0173 void SetEmitSignals(Bool_t f) { fEmitSignals = f; }
0174
0175 Callback_foo GetCallbackFoo() const { return fCallbackFoo; }
0176 void SetCallbackFoo(Callback_foo f) { fCallbackFoo = f; }
0177
0178 TooltipCB_foo GetTooltipCBFoo() const { return fTooltipCBFoo; }
0179 void SetTooltipCBFoo(TooltipCB_foo f) { fTooltipCBFoo = f; }
0180
0181 ClassDefOverride(TEveDigitSet, 0);
0182 };
0183
0184 #endif