16 #include <boost/bind.hpp>
19 #include "TEveElement.h"
20 #include "TEveCompound.h"
21 #include "TEveManager.h"
22 #include "TEveProjectionManager.h"
23 #include "TEveSelection.h"
47 m_elements =
new TEveElementList(
"ProxyProduct");
55 TEveProjectable* pable =
dynamic_cast<TEveProjectable*
>(m_elements);
57 for (TEveProjectable::ProjList_i
i = pable->BeginProjecteds();
i != pable->EndProjecteds(); ++
i)
59 TEveElement* projected = (*i)->GetProjectedAsElement();
60 (*projected->BeginParents())->RemoveElement(projected);
64 while (m_elements->HasParents())
66 TEveElement*
parent = *m_elements->BeginParents();
67 parent->RemoveElement(m_elements);
70 m_elements->Annihilate();
106 if(iFlag && !oldValue) {
124 (*i)->m_scaleConnection.disconnect();
144 TEveElementList* elms = (*i)->m_elements;
145 size_t oldSize = elms->NumChildren();
159 TEveProjectable* pable =
dynamic_cast<TEveProjectable*
>(elms);
160 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 pmgr->SubImportChildren(*prodIt, *parentIt);
179 else if (cnt < itemSize)
182 pmgr->SubImportElements(*prodIt, projectedAsElement);
189 pmgr->SetCurrentDepth(oldDepth);
196 TEveElement::List_i elIt = elms->BeginChildren();
197 for (
size_t cnt = 0; cnt < itemSize; ++cnt, ++elIt)
205 catch (
const std::runtime_error& iException)
208 << iException.what() << std::endl;
220 assert(
m_item && static_cast<int>(
m_item->
size()) <= elms->NumChildren() &&
"can not use default modelChanges implementation");
222 TEveElement::List_i itElement = elms->BeginChildren();
224 for (FWModelIds::const_iterator it = iIds.begin(), itEnd = iIds.end();
226 ++it,++itElement,++
index)
228 assert(itElement != elms->EndChildren());
229 while (index < it->
index())
233 assert(itElement != elms->EndChildren());
237 elms->ProjectChild(*itElement);
300 if (viewType == (*i)->m_viewType)
301 return (*i)->m_elements;
332 if ((*i)->m_elements)
333 (*i)->m_elements->DestroyElements();
335 if ( (*i)->m_viewContext)
336 (*i)->m_scaleConnection.disconnect();
377 scaleProduct((*i)->m_elements, (*i)->m_viewType, (*i)->m_viewContext);
389 if ((*i)->m_elements)
390 (*i)->m_elements->DestroyElements();
406 assert(
"virtual build(const FWEventItem*, TEveElementList*, const FWViewContext*) not implemented by inherited class");
412 assert(
"virtual buildViewType(const FWEventItem*, TEveElementList*, FWViewType::EType, const FWViewContext*) not implemented by inherited class");
421 TEveProjectable* pable =
static_cast<TEveProjectable*
>((*pIt)->m_elements);
422 for (TEveProjectable::ProjList_i
i = pable->BeginProjecteds();
i != pable->EndProjecteds(); ++
i)
433 parent->AddElement(el);
442 el->CSCTakeAnyParentAsMaster();
443 el->SetPickable(
true);
447 el->CSCApplyMainColorToMatchingChildren();
448 el->CSCApplyMainTransparencyToMatchingChildren();
461 TEveCompound*
c =
new TEveCompound();
462 c->CSCTakeAnyParentAsMaster();
463 c->CSCImplySelectAllChildren();
464 c->SetPickable(
true);
470 if (propagate_color_to_all_children)
472 c->CSCApplyMainColorToAllChildren();
473 c->CSCApplyMainTransparencyToAllChildren();
477 c->CSCApplyMainColorToMatchingChildren();
478 c->CSCApplyMainTransparencyToMatchingChildren();
485 const std::string&
name, Char_t transpOffset)
491 TEveElement::List_t matches;
492 holder->FindChildren(matches, name.c_str());
493 for (TEveElement::List_i
m = matches.begin();
m != matches.end(); ++
m)
495 (*m)->SetMainTransparency(transp);
521 return std::string();
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()
std::set< FWModelId > FWModelIds
const FWViewContext * m_viewContext
virtual void cleanLocal()
void scaleChanged(const FWViewContext *)
const FWEventItem * m_item
void added(TEveElement *, unsigned int)
const FWEventItem * item() const
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)
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