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);
63 while (m_elements->HasParents())
65 TEveElement*
parent = *m_elements->BeginParents();
66 parent->RemoveElement(m_elements);
69 m_elements->Annihilate();
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())
161 for (TEveProjectable::ProjList_i
i = pable->BeginProjecteds();
i != pable->EndProjecteds(); ++
i)
163 TEveProjectionManager *pmgr = (*i)->GetManager();
164 Float_t oldDepth = pmgr->GetCurrentDepth();
168 TEveElement* projectedAsElement = (*i)->GetProjectedAsElement();
169 TEveElement::List_i parentIt = projectedAsElement->BeginChildren();
170 for (TEveElement::List_i prodIt = elms->BeginChildren(); prodIt != elms->EndChildren(); ++prodIt, ++cnt)
175 pmgr->SubImportChildren(*prodIt, *parentIt);
178 else if (cnt < itemSize)
181 pmgr->SubImportElements(*prodIt, projectedAsElement);
188 pmgr->SetCurrentDepth(oldDepth);
195 TEveElement::List_i elIt = elms->BeginChildren();
196 for (
size_t cnt = 0; cnt < itemSize; ++cnt, ++elIt)
204 catch (
const std::runtime_error& iException)
207 << iException.what() << std::endl;
219 assert(
m_item && static_cast<int>(
m_item->
size()) <= elms->NumChildren() &&
"can not use default modelChanges implementation");
221 TEveElement::List_i itElement = elms->BeginChildren();
223 for (FWModelIds::const_iterator it = iIds.begin(), itEnd = iIds.end();
225 ++it,++itElement,++
index)
227 assert(itElement != elms->EndChildren());
228 while (index < it->
index())
232 assert(itElement != elms->EndChildren());
236 elms->ProjectChild(*itElement);
299 if (viewType == (*i)->m_viewType)
300 return (*i)->m_elements;
331 if ((*i)->m_elements)
332 (*i)->m_elements->DestroyElements();
334 if ( (*i)->m_viewContext)
335 (*i)->m_scaleConnection.disconnect();
376 scaleProduct((*i)->m_elements, (*i)->m_viewType, (*i)->m_viewContext);
388 if ((*i)->m_elements)
389 (*i)->m_elements->DestroyElements();
405 assert(
"virtual build(const FWEventItem*, TEveElementList*, const FWViewContext*) not implemented by inherited class");
411 assert(
"virtual buildViewType(const FWEventItem*, TEveElementList*, FWViewType::EType, const FWViewContext*) not implemented by inherited class");
420 TEveProjectable* pable =
static_cast<TEveProjectable*
>((*pIt)->m_elements);
421 for (TEveProjectable::ProjList_i
i = pable->BeginProjecteds();
i != pable->EndProjecteds(); ++
i)
432 parent->AddElement(el);
441 el->CSCTakeAnyParentAsMaster();
442 el->SetPickable(
true);
446 el->CSCApplyMainColorToMatchingChildren();
447 el->CSCApplyMainTransparencyToMatchingChildren();
460 TEveCompound*
c =
new TEveCompound();
461 c->CSCTakeAnyParentAsMaster();
462 c->CSCImplySelectAllChildren();
463 c->SetPickable(
true);
469 if (propagate_color_to_all_children)
471 c->CSCApplyMainColorToAllChildren();
472 c->CSCApplyMainTransparencyToAllChildren();
476 c->CSCApplyMainColorToMatchingChildren();
477 c->CSCApplyMainTransparencyToMatchingChildren();
490 TEveElement::List_t matches;
491 holder->FindChildren(matches, name.c_str());
492 for (TEveElement::List_i
m = matches.begin();
m != matches.end(); ++
m)
494 (*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
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 *)
volatile std::atomic< bool > shutdown_flag false
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