16 using namespace ROOT::Experimental;
17 namespace REX = ROOT::Experimental;
27 REveCompound::REveCompound(
const std::string& n,
const std::string& t,
28 Bool_t doColor, Bool_t doTransparency) :
32 fDoTransparency (doTransparency)
36 SetupDefaultColorAndTransparency(0, fDoColor, fDoTransparency);
50 void REveCompound::SetMainColor(Color_t color)
52 if (!fDoColor)
return;
54 Color_t old_color = GetMainColor();
56 REveElement::SetMainColor(color);
58 Bool_t color_all = TestCSCBits(kCSCBApplyMainColorToAllChildren);
59 Bool_t color_matching = TestCSCBits(kCSCBApplyMainColorToMatchingChildren);
61 for (
auto &c: fChildren)
63 if (color_all || (color_matching && c->GetMainColor() == old_color) ||
64 (c->GetCompound() ==
this && c->GetMainColor() == old_color))
66 c->SetMainColor(color);
81 void REveCompound::SetMainTransparency(Char_t t)
83 if ( ! fDoTransparency)
return;
85 Char_t old_t = GetMainTransparency();
87 REveElement::SetMainTransparency(t);
89 Bool_t chg_all = TestCSCBits(kCSCBApplyMainTransparencyToAllChildren);
90 Bool_t chg_matching = TestCSCBits(kCSCBApplyMainTransparencyToMatchingChildren);
92 for (
auto &c: fChildren) {
93 if (chg_all || (chg_matching && c->GetMainTransparency() == old_t) ||
94 (c->GetCompound() ==
this && c->GetMainTransparency() == old_t))
96 c->SetMainTransparency(t);
107 void REveCompound::AddElement(REveElement* el)
109 REveElement::AddElement(el);
110 if (IsCompoundOpen() && el->GetCompound() ==
nullptr)
111 el->SetCompound(
this);
117 void REveCompound::RemoveElementLocal(REveElement* el)
119 if (el->GetCompound() ==
this)
122 REveElement::RemoveElementLocal(el);
128 void REveCompound::RemoveElementsLocal()
130 for (
auto &c: fChildren) {
131 if (c->GetCompound() ==
this)
132 c->SetCompound(
nullptr);
135 REveElement::RemoveElementsLocal();
147 void REveCompound::FillImpliedSelectedSet(Set_t& impSelSet)
149 Bool_t select_all = TestCSCBits(kCSCBImplySelectAllChildren);
151 for (
auto &c: fChildren) {
152 if (select_all || c->GetCompound() ==
this) {
153 if (impSelSet.insert(c).second)
154 c->FillImpliedSelectedSet(impSelSet);
158 REveElement::FillImpliedSelectedSet(impSelSet);
164 TClass* REveCompound::ProjectedClass(
const REveProjection*)
const
166 return TClass::GetClass<REveCompoundProjected>();
178 REveCompoundProjected::REveCompoundProjected() :
191 void REveCompoundProjected::SetMainColor(Color_t color)
193 REveElement::SetMainColor(color);