3 #ifndef REVE_RenderElement_H
4 #define REVE_RenderElement_H
24 friend class RGTopFrame;
30 Color_t* fMainColorPtr;
34 TGListTreeItem* fItem;
37 ListTreeInfo(TGListTree* lt, TGListTreeItem* lti) : fTree(lt), fItem(lti) {}
38 virtual ~ListTreeInfo() {}
40 bool operator==(const ListTreeInfo& x) const
41 { return fTree == x.fTree && fItem == x.fItem; }
42 bool operator<(const ListTreeInfo& x) const
43 { return fTree == x.fTree ? fItem < x.fItem : fTree < x.fTree; }
45 ClassDef(ListTreeInfo, 0);
47 typedef std::set<ListTreeInfo> sLTI_t;
48 typedef std::set<ListTreeInfo>::iterator sLTI_i;
54 RenderElement(Color_t& main_color);
55 virtual ~RenderElement() {}
57 TObject* GetObject(Reve::Exc_t eh="RenderElement::GetObject ");
60 TRef& GetSource() { return fSource; }
61 TObject* GetSourceObject() const { return fSource.GetObject(); }
62 void SetSourceObject(TObject* o) { fSource.SetObject(o); }
64 void DumpSourceObject(); // *MENU*
65 void InspectSourceObject(); // *MENU*
68 virtual TGListTreeItem* AddIntoListTree(TGListTree* ltree,
69 TGListTreeItem* parent);
71 virtual void FullUpdate();
73 void SpawnEditor(); // *MENU*
74 void ExportToCINT(Text_t* var_name); // *MENU*
76 virtual Bool_t CanEditRnrElement() { return true; }
77 virtual Bool_t GetRnrElement() const { return fRnrElement; }
78 virtual void SetRnrElement(Bool_t rnr);
80 virtual Bool_t CanEditMainColor() { return false; }
81 Color_t* GetMainColorPtr() { return fMainColorPtr; }
82 void SetMainColorPtr(Color_t* color) { fMainColorPtr = color; }
84 virtual Color_t GetMainColor() const { return fMainColorPtr ? *fMainColorPtr : 0; }
85 virtual void SetMainColor(Color_t color);
86 void SetMainColorByPixel(Pixel_t pixel);
88 ClassDef(RenderElement, 1);
91 /**************************************************************************/
93 class RenderElementListBase : public RenderElement
96 typedef std::list<RenderElement*> lpRE_t;
97 typedef std::list<RenderElement*>::iterator lpRE_i;
101 void PaintElements(Option_t* option="");
104 RenderElementListBase() {}
105 RenderElementListBase(Color_t& col) : RenderElement(col) {}
106 virtual ~RenderElementListBase() {}
108 virtual void AddElement(RenderElement* el) { fList.push_back(el); }
110 virtual Int_t ExpandIntoListTree(TGListTree* ltree, TGListTreeItem* parent);
112 void EnableListElements(); // *MENU*
113 void DisableListElements(); // *MENU*
115 virtual void SetMainColor(Color_t color);
116 virtual void SetMainColor(Pixel_t pixel);
118 ClassDef(RenderElementListBase, 1);
121 /**************************************************************************/
123 class RenderElementList : public TNamed, public RenderElementListBase
129 RenderElementList(const Text_t* n="RenderElementList", const Text_t* t="") :
130 TNamed(n, t), RenderElementListBase(fColor), fColor(0)
132 virtual ~RenderElementList() {}
134 virtual Bool_t CanEditMainColor() { return true; }
136 virtual void Paint(Option_t* option = "") { PaintElements(option); }
138 ClassDef(RenderElementList, 1);