Logo ROOT  
Reference Guide
REveDataSimpleProxyBuilder.cxx
Go to the documentation of this file.
2
3// user include files
6
7using namespace ROOT::Experimental;
8namespace REX = ROOT::Experimental;
9
11{
12}
13
14
16{
17}
18
19void
21{
22 for (auto &p: m_products)
23 {
24 if (p->m_elements)
25 {
26 REveElement *elms = p->m_elements;
27 for (auto &c: elms->RefChildren())
28 c->DestroyElements();
29 }
30 }
31
34
35//______________________________________________________________________________
36
37void
39 REveElement* product, const REveViewContext* vc)
40{
41 auto size = collection->GetNItems();
42 auto pIdx = product->RefChildren().begin();
43 for (int index = 0; index < size; ++index)
44 {
45 auto di = Collection()->GetDataItem(index);
46 REveElement *itemHolder = nullptr;
47
48 if (index < product->NumChildren())
49 {
50 itemHolder = *pIdx;
51 itemHolder->SetRnrSelfChildren(true, true);
52 ++pIdx;
53 }
54 else
55 {
56 itemHolder = CreateCompound(true, true);
57 itemHolder->SetMainColor(collection->GetMainColor());
58 itemHolder->SetName(Form("%s %d", collection->GetCName(), index));
59
60 product->AddElement(itemHolder);
61 }
62
63 di->AddNiece(itemHolder);
64 itemHolder->SetSelectionMaster(di);
65
66 if (di->GetRnrSelf() && !di->GetFiltered())
67 {
68 Build(collection->GetDataPtr(index), index, itemHolder, vc);
69 }
70 }
71}
72
73void
75 REveElement* product, std::string viewType, const REveViewContext* vc)
76{
77 auto size = collection->GetNItems();
78 auto pIdx = product->RefChildren().begin();
79 for (int index = 0; index < size; ++index)
80 {
81 auto di = Collection()->GetDataItem(index);
82 REveElement* itemHolder = nullptr;
83
84 if (index < product->NumChildren())
85 {
86 itemHolder = *pIdx;
87 itemHolder->SetRnrSelfChildren(true, true);
88 ++pIdx;
89 }
90 else
91 {
92 itemHolder = CreateCompound(true, true);
93 itemHolder->SetMainColor(collection->GetMainColor());
94 itemHolder->SetName(Form("%s %d", collection->GetCName(), index));
95
96 product->AddElement(itemHolder);
97 }
98
99 di->AddNiece(itemHolder);
100 itemHolder->SetSelectionMaster(di);
101
102 if (di->GetRnrSelf() && !di->GetFiltered())
103 {
104 BuildViewType(collection->GetDataPtr(index), index, itemHolder, viewType, vc);
105 }
106 }
107}
108
109//______________________________________________________________________________
110
111bool
113{
114 REveDataItem* item = Collection()->GetDataItem(idx);
115 bool returnValue = false;
116 if (item->GetRnrSelf() && iCompound->NumChildren()==0)
117 {
118 printf("REveDataSimpleProxyBuilder::VisibilityModelChanges BUILD %d \n", idx);
119 Build(Collection()->GetDataPtr(idx), idx, iCompound, vc);
120 returnValue=true;
121 }
122 return returnValue;
123}
#define c(i)
Definition: RSha256.hxx:101
int type
Definition: TGX11.cxx:120
char * Form(const char *fmt,...)
REveDataItem * GetDataItem(Int_t i) const
REveCompound * CreateCompound(bool set_color=true, bool propagate_color_to_all_children=false) const
void BuildViewType(const REveDataCollection *iCollection, REveElement *product, std::string viewType, const REveViewContext *) override
bool VisibilityModelChanges(int idx, REveElement *, const REveViewContext *) override
const char * GetCName() const
virtual void AddElement(REveElement *el)
Add el to the list of children.
virtual Bool_t GetRnrSelf() const
void SetSelectionMaster(REveElement *el)
virtual Bool_t SetRnrSelfChildren(Bool_t rnr_self, Bool_t rnr_children)
Set state for rendering of this element and its children.
virtual void SetMainColor(Color_t color)
Set main color of the element.
virtual Color_t GetMainColor() const
void SetName(const std::string &name)
Set name of an element.