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 };
38 // Base-class for digit representation classes.
40 Int_t fValue; // signal value of a digit (can be direct RGBA color)
41 TRef fId; // external object reference
43 DigitBase(Int_t v=0) : fValue(v), fId() {}
46 Int_t fDefaultValue; // Default signal value.
47 Bool_t fValueIsColor; // Interpret signal value as RGBA color.
48 Bool_t fOwnIds; // Flag specifying if id-objects are owned by the DigitSet
49 VoidCPlex fPlex; // Container of digit data.
50 DigitBase* fLastDigit; //! The last digit added to collection.
52 FrameBox* fFrame; // Pointer to frame structure.
53 RGBAPalette* fPalette; // Pointer to signal-color palette.
54 RenderMode_e fRenderMode; // Render mode: as-is / line / filled.
55 Bool_t fDisableLigting; // Disable lighting for rendering.
56 Bool_t fEmitSignals; // Emit signals on secondary-select.
57 Bool_t fHistoButtons; // Show histogram buttons in object editor.
58 ZTrans fHMTrans; // Overall transformation of whole collection.
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 // Implemented in sub-classes:
71 // virtual void Reset(QuadType_e quadType, Bool_t valIsCol, Int_t chunkSize);
74 void ScanMinMaxValues(Int_t& min, Int_t& max);
76 // --------------------------------
78 void DigitValue(Int_t value);
79 void DigitColor(Color_t ci);
80 void DigitColor(UChar_t r, UChar_t g, UChar_t b, UChar_t a=255);
81 void DigitColor(UChar_t* rgba);
83 void DigitId(TObject* id);
85 Bool_t GetOwnIds() const { return fOwnIds; }
86 void SetOwnIds(Bool_t o) { fOwnIds = o; }
88 DigitBase* GetDigit(Int_t n) { return (DigitBase*) fPlex.Atom(n); }
89 TObject* GetId(Int_t n) { return GetDigit(n)->fId.GetObject(); }
91 // --------------------------------
93 // Implemented in subclasses:
94 // virtual void ComputeBBox();
96 virtual void Paint(Option_t* option="");
98 virtual void DigitSelected(Int_t idx);
99 virtual void CtrlClicked(DigitSet* qs, Int_t idx); // *SIGNAL*
101 // --------------------------------
103 VoidCPlex* GetPlex() { return &fPlex; }
105 FrameBox* GetFrame() const { return fFrame; }
106 void SetFrame(FrameBox* b);
108 Bool_t GetValueIsColor() const { return fValueIsColor; }
110 RGBAPalette* GetPalette() const { return fPalette; }
111 void SetPalette(RGBAPalette* p);
112 RGBAPalette* AssertPalette();
114 RenderMode_e GetRenderMode() const { return fRenderMode; }
115 void SetRenderMode(RenderMode_e rm) { fRenderMode = rm; }
117 Bool_t GetEmitSignals() const { return fEmitSignals; }
118 void SetEmitSignals(Bool_t f) { fEmitSignals = f; }
120 Bool_t GetHistoButtons() const { return fHistoButtons; }
121 void SetHistoButtons(Bool_t f) { fHistoButtons = f; }
123 ZTrans& RefHMTrans() { return fHMTrans; }
124 void SetTransMatrix(Double_t* carr) { fHMTrans.SetFrom(carr); }
125 void SetTransMatrix(const TGeoMatrix& mat) { fHMTrans.SetFrom(mat); }
127 ClassDef(DigitSet, 1); // Base-class for visual digit collections.
128 }; // endclass DigitSet