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" 46 m_elements =
new TEveElementList(
"ProxyProduct");
54 TEveProjectable* pable =
dynamic_cast<TEveProjectable*
>(
m_elements);
56 for (TEveProjectable::ProjList_i
i = pable->BeginProjecteds();
i != pable->EndProjecteds(); ++
i)
58 TEveElement* projected = (*i)->GetProjectedAsElement();
59 (*projected->BeginParents())->RemoveElement(projected);
105 if(iFlag && !oldValue) {
123 (*i)->m_scaleConnection.disconnect();
143 TEveElementList* elms = (*i)->m_elements;
144 size_t oldSize = elms->NumChildren();
158 TEveProjectable* pable =
dynamic_cast<TEveProjectable*
>(elms);
159 if (pable->HasProjecteds())
162 for (TEveProjectable::ProjList_i
i = pable->BeginProjecteds();
i != pable->EndProjecteds(); ++
i)
164 TEveProjectionManager *pmgr = (*i)->GetManager();
165 Float_t oldDepth = pmgr->GetCurrentDepth();
169 TEveElement* projectedAsElement = (*i)->GetProjectedAsElement();
170 TEveElement::List_i parentIt = projectedAsElement->BeginChildren();
171 for (TEveElement::List_i prodIt = elms->BeginChildren(); prodIt != elms->EndChildren(); ++prodIt, ++cnt)
176 if ((*parentIt)->NumChildren()) {
178 for ( TEveElement::List_i pci = (*parentIt)->BeginChildren(); pci != (*parentIt)->EndChildren(); pci++)
179 pmgr->ProjectChildrenRecurse(*parentIt);
183 pmgr->SubImportChildren(*prodIt, *parentIt);
188 else if (cnt < itemSize)
191 pmgr->SubImportElements(*prodIt, projectedAsElement);
198 pmgr->SetCurrentDepth(oldDepth);
205 TEveElement::List_i elIt = elms->BeginChildren();
206 for (
size_t cnt = 0; cnt < itemSize; ++cnt, ++elIt)
214 catch (
const std::runtime_error& iException)
217 << iException.what() << std::endl;
229 assert(
m_item && static_cast<int>(
m_item->
size()) <= elms->NumChildren() &&
"can not use default modelChanges implementation");
231 TEveElement::List_i itElement = elms->BeginChildren();
233 for (FWModelIds::const_iterator it = iIds.begin(), itEnd = iIds.end();
235 ++it,++itElement,++
index)
237 assert(itElement != elms->EndChildren());
238 while (index < it->
index())
242 assert(itElement != elms->EndChildren());
246 elms->ProjectChild(*itElement);
309 if (viewType == (*i)->m_viewType)
310 return (*i)->m_elements;
341 if ((*i)->m_elements)
342 (*i)->m_elements->DestroyElements();
344 if ( (*i)->m_viewContext)
345 (*i)->m_scaleConnection.disconnect();
386 scaleProduct((*i)->m_elements, (*i)->m_viewType, (*i)->m_viewContext);
398 if ((*i)->m_elements)
399 (*i)->m_elements->DestroyElements();
415 assert(
"virtual build(const FWEventItem*, TEveElementList*, const FWViewContext*) not implemented by inherited class");
421 assert(
"virtual buildViewType(const FWEventItem*, TEveElementList*, FWViewType::EType, const FWViewContext*) not implemented by inherited class");
430 TEveProjectable* pable =
static_cast<TEveProjectable*
>((*pIt)->m_elements);
431 for (TEveProjectable::ProjList_i
i = pable->BeginProjecteds();
i != pable->EndProjecteds(); ++
i)
442 parent->AddElement(el);
451 el->CSCTakeAnyParentAsMaster();
452 el->SetPickable(
true);
456 el->CSCApplyMainColorToMatchingChildren();
457 el->CSCApplyMainTransparencyToMatchingChildren();
470 TEveCompound*
c =
new TEveCompound();
471 c->CSCTakeAnyParentAsMaster();
472 c->CSCImplySelectAllChildren();
473 c->SetPickable(
true);
479 if (propagate_color_to_all_children)
481 c->CSCApplyMainColorToAllChildren();
482 c->CSCApplyMainTransparencyToAllChildren();
486 c->CSCApplyMainColorToMatchingChildren();
487 c->CSCApplyMainTransparencyToMatchingChildren();
499 Char_t transp =
TMath::Min(100, transpOffset + (100 - transpOffset) * transparency / 100);
501 holder->FindChildren(matches, name.c_str());
502 for (TEveElement::List_i
m = matches.begin();
m != matches.end(); ++
m)
504 (*m)->SetMainTransparency(transp);
const fireworks::Context & context() const
virtual void buildViewType(const FWEventItem *iItem, TEveElementList *, FWViewType::EType, const FWViewContext *)
virtual void scaleProduct(TEveElementList *parent, FWViewType::EType, const FWViewContext *vc)
std::vector< Product * >::iterator Product_it
const FWDisplayProperties & defaultDisplayProperties() const
const FWDisplayProperties & displayProperties() const
static std::string typeOfBuilder()
Used by the plugin system to determine how the proxy uses the data from FWEventItem.
std::vector< Product * > m_products
virtual void itemBeingDestroyed(const FWEventItem *)
virtual bool havePerViewProduct(FWViewType::EType) const
const std::string & name() const
virtual bool visibilityModelChanges(const FWModelId &, TEveElement *, FWViewType::EType, const FWViewContext *)
void setupAddElement(TEveElement *el, TEveElement *parent, bool set_color=true) const
static bool representsSubPart()
const FWViewContext * m_viewContext
virtual void cleanLocal()
void scaleChanged(const FWViewContext *)
const FWEventItem * m_item
void added(TEveElement *, unsigned int)
const FWEventItem * item() const
std::list< Particle > List_t
sigc::connection m_scaleConnection
TEveElementList * m_elements
virtual void localModelChanges(const FWModelId &iId, TEveElement *iCompound, FWViewType::EType viewType, const FWViewContext *vc)
Char_t transparency() const
sigc::signal< void, const FWViewContext * > scaleChanged_
Product(FWViewType::EType t, const FWViewContext *c)
std::set< FWModelId > FWModelIds
void set_color(TEveElement *element, Color_t color, float alpha, unsigned int levels)
virtual void setItem(const FWEventItem *iItem)
const fireworks::Context & context() const
void removePerViewProduct(FWViewType::EType, const FWViewContext *vc)
virtual ~FWProxyBuilderBase()
void setHaveWindow(bool iFlag)
virtual bool haveSingleProduct() const
virtual bool canHandle(const FWEventItem &)
FWInteractionList * m_interactionList
TEveCompound * createCompound(bool set_color=true, bool propagate_color_to_all_children=false) const
TEveElementList * createProduct(FWViewType::EType, const FWViewContext *)
ModelInfo modelInfo(int iIndex) const
const std::string & purpose() const
void setProjectionLayer(float)
void increaseComponentTransparency(unsigned int index, TEveElement *holder, const std::string &name, Char_t transpOffset)
FWViewType::EType m_viewType
void itemChanged(const FWEventItem *)
void modelChanges(const FWModelIds &)
virtual void setInteractionList(FWInteractionList *, const std::string &)
void setupElement(TEveElement *el, bool color=true) const