3 #ifndef REVE_DigitSetBase_H
4 #define REVE_DigitSetBase_H
11 #include <Reve/Reve.h>
12 #include <Reve/RenderElement.h>
13 #include <Reve/FrameBox.h>
14 #include <Reve/RGBAPalette.h>
15 #include <Reve/Plex.h>
16 #include <Reve/ZTrans.h>
22 class DigitSet : public RenderElement,
23 public TNamed, public TQObject,
27 friend class DigitSetEditor;
29 DigitSet(const DigitSet&); // Not implemented
30 DigitSet& operator=(const DigitSet&); // Not implemented
33 enum RenderMode_e { RM_AsIs, RM_Line, RM_Fill };
41 // Here could have additional integer (like time, second threshold).
43 DigitBase(Int_t v=0) : fValue(v), fId() {}
48 Bool_t fOwnIds; //Flag specifying if id-objects are owned by the DigitSet
50 DigitBase* fLastDigit; //!
53 RGBAPalette* fPalette;
54 RenderMode_e fRenderMode;
55 Bool_t fDisableLigting;
60 DigitBase* NewDigit();
64 DigitSet(const Text_t* n="DigitSet", const Text_t* t="");
67 virtual Bool_t CanEditMainColor() { return kTRUE; }
68 virtual void SetMainColor(Color_t color);
70 // virtual void Reset(QuadType_e quadType, Bool_t valIsCol, Int_t chunkSize);
73 void ScanMinMaxValues(Int_t& min, Int_t& max);
75 // --------------------------------
77 void DigitValue(Int_t value);
78 void DigitColor(Color_t ci);
79 void DigitColor(UChar_t r, UChar_t g, UChar_t b, UChar_t a=255);
80 void DigitColor(UChar_t* rgba);
82 void DigitId(TObject* id);
84 Bool_t GetOwnIds() const { return fOwnIds; }
85 void SetOwnIds(Bool_t o) { fOwnIds = o; }
87 DigitBase* GetDigit(Int_t n) { return (DigitBase*) fPlex.Atom(n); }
88 TObject* GetId(Int_t n) { return GetDigit(n)->fId.GetObject(); }
90 // --------------------------------
92 // virtual void ComputeBBox(); // implement in subclass
93 virtual void Paint(Option_t* option="");
95 virtual void DigitSelected(Int_t idx);
96 virtual void CtrlClicked(DigitSet* qs, Int_t idx); // *SIGNAL*
98 // --------------------------------
100 VoidCPlex* GetPlex() { return &fPlex; }
102 FrameBox* GetFrame() const { return fFrame; }
103 void SetFrame(FrameBox* b);
105 Bool_t GetValueIsColor() const { return fValueIsColor; }
107 RGBAPalette* GetPalette() const { return fPalette; }
108 void SetPalette(RGBAPalette* p);
109 RGBAPalette* AssertPalette();
111 RenderMode_e GetRenderMode() const { return fRenderMode; }
112 void SetRenderMode(RenderMode_e rm) { fRenderMode = rm; }
114 Bool_t GetEmitSignals() const { return fEmitSignals; }
115 void SetEmitSignals(Bool_t f) { fEmitSignals = f; }
117 Bool_t GetHistoButtons() const { return fHistoButtons; }
118 void SetHistoButtons(Bool_t f) { fHistoButtons = f; }
120 ZTrans& RefHMTrans() { return fHMTrans; }
121 void SetTransMatrix(Double_t* carr) { fHMTrans.SetFrom(carr); }
122 void SetTransMatrix(const TGeoMatrix& mat) { fHMTrans.SetFrom(mat); }
124 ClassDef(DigitSet, 1);
125 }; // endclass DigitSet