15 #include <boost/bind.hpp>
18 #include "TEveElement.h"
19 #include "TEveCompound.h"
20 #include "TEveManager.h"
21 #include "TEveProjectionManager.h"
22 #include "TEveSelection.h"
44 : m_viewType(
t), m_viewContext(
c), m_elements(nullptr) {
45 m_elements =
new TEveElementList(
"ProxyProduct");
51 TEveProjectable* pable = dynamic_cast<TEveProjectable*>(m_elements);
53 for (TEveProjectable::ProjList_i
i = pable->BeginProjecteds();
i != pable->EndProjecteds(); ++
i) {
54 TEveElement* projected = (*i)->GetProjectedAsElement();
55 (*projected->BeginParents())->RemoveElement(projected);
59 while (m_elements->HasParents()) {
60 TEveElement*
parent = *m_elements->BeginParents();
61 parent->RemoveElement(m_elements);
64 m_elements->Annihilate();
89 if (iFlag && !oldValue) {
103 (*i)->m_scaleConnection.disconnect();
118 TEveElementList* elms = (*i)->m_elements;
119 size_t oldSize = elms->NumChildren();
130 TEveProjectable* pable = dynamic_cast<TEveProjectable*>(elms);
131 if (pable->HasProjecteds()) {
133 for (TEveProjectable::ProjList_i
i = pable->BeginProjecteds();
i != pable->EndProjecteds(); ++
i) {
134 TEveProjectionManager* pmgr = (*i)->GetManager();
135 Float_t oldDepth = pmgr->GetCurrentDepth();
139 TEveElement* projectedAsElement = (*i)->GetProjectedAsElement();
140 TEveElement::List_i parentIt = projectedAsElement->BeginChildren();
141 for (TEveElement::List_i prodIt = elms->BeginChildren(); prodIt != elms->EndChildren(); ++prodIt, ++cnt) {
144 if ((*parentIt)->NumChildren()) {
146 for (TEveElement::List_i pci = (*parentIt)->BeginChildren(); pci != (*parentIt)->EndChildren(); pci++)
147 pmgr->ProjectChildrenRecurse(*parentIt);
150 pmgr->SubImportChildren(*prodIt, *parentIt);
154 }
else if (cnt < itemSize) {
156 pmgr->SubImportElements(*prodIt, projectedAsElement);
161 pmgr->SetCurrentDepth(oldDepth);
166 TEveElement::List_i elIt = elms->BeginChildren();
167 for (
size_t cnt = 0; cnt < itemSize; ++cnt, ++elIt) {
173 }
catch (
const std::runtime_error& iException) {
175 << iException.what() << std::endl;
184 TEveElementList* elms =
p->m_elements;
186 "can not use default modelChanges implementation");
188 TEveElement::List_i itElement = elms->BeginChildren();
190 for (FWModelIds::const_iterator it = iIds.begin(), itEnd = iIds.end(); it != itEnd; ++it, ++itElement, ++
index) {
191 assert(itElement != elms->EndChildren());
192 while (index < it->
index()) {
195 assert(itElement != elms->EndChildren());
198 elms->ProjectChild(*itElement);
245 if (viewType == (*i)->m_viewType)
246 return (*i)->m_elements;
272 if ((*i)->m_elements)
273 (*i)->m_elements->DestroyElements();
275 if ((*i)->m_viewContext)
276 (*i)->m_scaleConnection.disconnect();
308 scaleProduct((*i)->m_elements, (*i)->m_viewType, (*i)->m_viewContext);
317 if ((*i)->m_elements)
318 (*i)->m_elements->DestroyElements();
330 "virtual build(const FWEventItem*, TEveElementList*, const FWViewContext*) not implemented by inherited class");
335 "virtual buildViewType(const FWEventItem*, TEveElementList*, FWViewType::EType, const FWViewContext*) not "
336 "implemented by inherited class");
342 TEveProjectable* pable = static_cast<TEveProjectable*>((*pIt)->m_elements);
343 for (TEveProjectable::ProjList_i
i = pable->BeginProjecteds();
i != pable->EndProjecteds(); ++
i)
359 el->CSCTakeAnyParentAsMaster();
360 el->SetPickable(
true);
363 el->CSCApplyMainColorToMatchingChildren();
364 el->CSCApplyMainTransparencyToMatchingChildren();
375 TEveCompound*
c =
new TEveCompound();
376 c->CSCTakeAnyParentAsMaster();
377 c->CSCImplySelectAllChildren();
378 c->SetPickable(
true);
383 if (propagate_color_to_all_children) {
384 c->CSCApplyMainColorToAllChildren();
385 c->CSCApplyMainTransparencyToAllChildren();
387 c->CSCApplyMainColorToMatchingChildren();
388 c->CSCApplyMainTransparencyToMatchingChildren();
396 Char_t transpOffset) {
400 Char_t transp =
TMath::Min(100, transpOffset + (100 - transpOffset) * transparency / 100);
404 (*m)->SetMainTransparency(transp);