18 #include "TEveManager.h" 19 #include "TEveSelection.h" 20 #include "TEveScene.h" 21 #include "TEveViewer.h" 23 #include "TEveGedEditor.h" 24 #include "TGListTree.h" 25 #include "TGeoManager.h" 99 for (std::set<std::string>::iterator it =
builders.begin(), itEnd =
builders.end(); it != itEnd; ++it) {
103 first = it->find_last_of(
'@') + 1;
105 int viewTypes = atoi(view_str.c_str());
121 gEve->GetHighlight()->SetPickToSelect(TEveSelection::kPS_Master);
122 TEveSelection* eveSelection = gEve->GetSelection();
123 eveSelection->SetPickToSelect(TEveSelection::kPS_Master);
124 eveSelection->Connect(
"SelectionAdded(TEveElement*)",
"FWEveViewManager",
this,
"selectionAdded(TEveElement*)");
125 eveSelection->Connect(
"SelectionRepeated(TEveElement*)",
"FWEveViewManager",
this,
"selectionAdded(TEveElement*)");
126 eveSelection->Connect(
"SelectionRemoved(TEveElement*)",
"FWEveViewManager",
this,
"selectionRemoved(TEveElement*)");
127 eveSelection->Connect(
"SelectionCleared()",
"FWEveViewManager",
this,
"selectionCleared()");
129 gEve->GetHighlight()->Connect(
130 "SelectionAdded(TEveElement*)",
"FWEveViewManager",
this,
"highlightAdded(TEveElement*)");
131 gEve->GetHighlight()->Connect(
132 "SelectionRepeated(TEveElement*)",
"FWEveViewManager",
this,
"highlightAdded(TEveElement*)");
134 TGeoManager::SetVerboseLevel(0);
156 view->eventScene()->AddElement(product);
180 std::vector<BuilderInfo>& blist = itFind->second;
184 for (
size_t bii = 0, bie = blist.size(); bii != bie; ++bii) {
187 info.classType(bType, bIsSimple);
197 if (itype != bType) {
204 int builderViewBit =
info.m_viewBit;
206 std::shared_ptr<FWProxyBuilderBase> builder;
212 <<
"FWEveViewManager::newItem ignoring the following exception (probably edmplugincache mismatch):" 222 builder->setItem(iItem);
230 if (builder->willHandleInteraction() ==
false) {
231 typedef std::map<const FWEventItem*, FWInteractionList*>::iterator
Iterator;
234 if (
t.second ==
true)
237 builder->setInteractionList(
t.first->second, iItem->
purpose());
244 if (((1 << viewType) & builderViewBit) == 0)
253 TEveElementList* product = builder->createProduct(
type,
view->viewContext());
257 TEveElementList* product = builder->createProduct(
type,
nullptr);
278 std::shared_ptr<FWEveView>
view;
311 gEve->DisableRedraw();
319 int viewerBit = 1 <<
view->typeId();
322 int builderViewBit =
i->first;
324 if (viewerBit == (builderViewBit & viewerBit)) {
325 for (
BuilderVec_it bIt = bv.begin(); bIt != bv.end(); ++bIt) {
326 (*bIt)->setHaveWindow(
true);
334 int builderViewBit =
i->first;
336 if (viewerBit == (builderViewBit & viewerBit)) {
337 for (
BuilderVec_it bIt = bv.begin(); bIt != bv.end(); ++bIt) {
340 TEveElementList* product = (*bIt)->createProduct(
view->typeId(),
view->viewContext());
348 view->ownedProducts()->AddElement(product);
355 view->eventScene()->AddElement(product);
364 view->setupEnergyScale();
366 gEve->EnableRedraw();
367 view->viewerGL()->UpdateScene();
375 int typeId =
view->typeId();
377 int viewerBit = 1 << typeId;
378 int nviews =
m_views[typeId].size();
380 int builderBit =
i->first;
381 if (viewerBit == (builderBit & viewerBit))
386 if (viewerBit == (builderBit & viewerBit)) {
388 (*bIt)->removePerViewProduct(
view->typeId(),
view->viewContext());
394 if (viewerBit == (builderBit & viewerBit)) {
396 (*bIt)->setHaveWindow(
false);
404 if (
i->get() == vb) {
424 bool itemHaveWindow =
false;
426 for (
size_t bi = 0,
be =
i->second.size(); bi !=
be; ++bi) {
430 itemHaveWindow =
true;
442 if (!it->second->empty())
443 it->second->modelChanges(iIds);
456 bool itemHaveWindow =
false;
459 for (
size_t bi = 0,
be =
i->second.size(); bi !=
be; ++bi) {
475 if (!it->second->empty())
476 it->second->itemChanged();
493 while (bIt !=
i->second.end()) {
494 if ((*bIt)->item() ==
item) {
496 (*bIt)->itemBeingDestroyed(
item);
497 bIt =
i->second.erase(bIt);
507 x->commonPrefs()->getEnergyScale()->parameterChanged_.connect(
515 if ((*i)->isEnergyScaleGlobal()) {
516 (*i)->setupEnergyScale();
525 (*i)->setupEventCenter();
541 gEve->EnforceTimerActive(kTRUE);
542 gEve->DisableRedraw();
565 TEveElement::List_t scenes;
567 TExMapIter stamped_elements(gEve->PtrToStampedElements());
568 while (stamped_elements.Next(
key,
value)) {
569 TEveElement* el =
reinterpret_cast<TEveElement*
>(
key);
570 if (el->GetChangeBits() & TEveElement::kCBVisibility) {
571 el->CollectSceneParents(scenes);
574 gEve->ScenesChanged(scenes);
578 gEve->GetScenes()->ProcessSceneChanges(kFALSE, gEve->PtrToStampedElements());
588 (*i)->fwViewerGL()->DrawHiLod(swap_on_render);
592 if (!swap_on_render) {
595 (*i)->fwViewerGL()->JustSwap();
599 gEve->GetViewers()->RepaintChangedViewers(kFALSE, kFALSE);
603 TExMapIter stamped_elements(gEve->PtrToStampedElements());
604 while (stamped_elements.Next(
key,
value)) {
605 TEveElement* el =
reinterpret_cast<TEveElement*
>(
key);
606 if (gEve->GetEditor()->GetModel() == el->GetEditorObject(
"FWEveViewManager::eventEnd"))
607 gEve->EditElement(el);
608 TEveGedEditor::ElementChanged(el);
613 gEve->PtrToStampedElements()->Delete();
615 gEve->GetListTree()->ClearViewPort();
617 gEve->EnableRedraw();
618 gEve->EnforceTimerActive(kFALSE);
630 void*
userData = iElement->GetUserData();
662 const static std::string kFullFrameWorkPBExtension =
"FullFramework";
664 std::vector<BuilderInfo> blist = it->second;
665 for (
size_t bii = 0, bie = blist.size(); bii != bie; ++bii) {
670 if (std::string::npos !=
info.m_name.find(pfExt))
674 unsigned int bitPackedViews =
info.m_viewBit;
675 bool representsSubPart = (
info.m_name.substr(
info.m_name.find_first_of(
'@') - 1, 1) ==
"!");
676 size_t extp =
info.m_name.rfind(kFullFrameWorkPBExtension);
677 bool FFOnly = (extp != std::string::npos);
683 returnValue.
add(std::make_shared<FWSimpleRepresentationChecker>(
684 name, it->first, bitPackedViews, representsSubPart, FFOnly));
686 returnValue.
add(std::make_shared<FWEDProductRepresentationChecker>(
687 name, it->first, bitPackedViews, representsSubPart, FFOnly));
706 simple = (
m_name.substr(0, kSimple.size()) == kSimple);
722 #include "TEveCaloData.h" 725 bool blocked = gEve->GetHighlight()->BlockSignals(
true);
727 if (iElement ==
context().getCaloData()) {
729 std::set<TEveCaloData::CellId_t> hset;
733 TAxis* etaAxis =
hist->GetXaxis();
734 int nBinsX = etaAxis->GetNbins() + 2;
736 for (TEveCaloData::vCellId_i
i = hlist.begin();
i != hlist.end(); ++
i) {
738 if (TMath::Abs(etaAxis->GetBinCenter(
etaBin)) > 4.71475) {
739 newPhiBin = ((
phiBin + 1) / 4) * 4 - 1;
744 hset.insert(TEveCaloData::CellId_t(
tower, (*i).fSlice, (*i).fFraction));
746 hset.insert(TEveCaloData::CellId_t(
tower, (*i).fSlice, (*i).fFraction));
752 hset.insert(TEveCaloData::CellId_t(
tower, (*i).fSlice, (*i).fFraction));
754 hset.insert(TEveCaloData::CellId_t(
tower, (*i).fSlice, (*i).fFraction));
755 }
else if (TMath::Abs(etaAxis->GetBinCenter(
etaBin)) > 1.747650) {
756 newPhiBin = ((
phiBin + 1) / 2) * 2 - 1;
758 hset.insert(TEveCaloData::CellId_t(
tower, (*i).fSlice, (*i).fFraction));
760 hset.insert(TEveCaloData::CellId_t(
tower, (*i).fSlice, (*i).fFraction));
768 for (std::set<TEveCaloData::CellId_t>::iterator it = hset.begin(); it != hset.end(); ++it) {
769 hlist.push_back(*it);
774 gEve->GetHighlight()->BlockSignals(blocked);
const CategoryToInfos & categoryToInfos() const
FWSelectionManager * selectionManager() const
std::vector< std::vector< std::shared_ptr< FWEveView > > > m_views
void resetMaxEtAndEnergy() const
std::vector< std::shared_ptr< FWEveView > >::iterator EveViewVec_it
void eventBegin() override
FWColorManager & colorManager() const
void globalEnergyScaleChanged()
void selectionAdded(TEveElement *)
void itemChanged(const FWEventItem *)
bool haveViewForBit(int) const
FWItemChangeSignal goingToBeDestroyed_
void newItem(const FWEventItem *) override
TypeToBuilder m_typeToBuilder
Color_t background() const
TEveCaloDataHist * getCaloData() const
static bool s_syncAllViews
void add(std::shared_ptr< FWRepresentationCheckerBase > iChecker)
FWEveViewManager(FWGUIManager *)
void registerViewBuilder(const std::string &iName, ViewBuildFunctor &iBuilder)
bool getHidePFBuilders() const
FWFromEveSelectorBase * getSelector(TEveElement *iElement)
static bool isProjected(int)
const TClass * modelType() const
static bool inheritsFrom(const edm::TypeWithDict &iChild, const std::string &iParentTypeName, unsigned int &distance)
FWEveView * finishViewCreate(std::shared_ptr< FWEveView >)
~FWEveViewManager() override
virtual void setContext(const fireworks::Context *x)
std::set< FWModelId > FWModelIds
bool getHaveWindow() const
FWItemChangeSignal itemChanged_
void addElements(const FWEventItem *item, FWEveView *view, int viewType, TEveElementList *product)
key
prepare the HTCondor submission files and eventually submit them
void selectionRemoved(TEveElement *)
void highlightAdded(TEveElement *)
void modelChanges(const FWModelIds &iIds)
void beingDestroyed(const FWViewBase *)
std::map< int, BuilderVec > m_builders
std::function< FWViewBase *(TEveWindowSlot *, const std::string &)> ViewBuildFunctor
FWViewBase * buildView(TEveWindowSlot *iParent, const std::string &type)
void setContext(const fireworks::Context *) override
void classType(std::string &, bool &) const
const TClass * type() const
void colorsChanged() override
std::map< const FWEventItem *, FWInteractionList * > m_interactionLists
void importElements(TEveElement *iProjectableChild, float layer, TEveElement *iProjectedParent=nullptr)
BuilderVec::iterator BuilderVec_it
FWModelChangeSignal changed_
std::vector< std::shared_ptr< FWProxyBuilderBase > > BuilderVec
static const std::string & idToName(int)
TEveElement * ownedProducts()
static Bool_t setColorSetViewer(TGLViewer *, Color_t)
virtual void removeItem(const FWEventItem *)
const std::string & purpose() const
FWTypeToRepresentations supportedTypesAndRepresentations() const override
void modelChangesDone() override
static PluginManager * get()
const FWEventItem * item() const
void modelChangesComing() override
void itemChanged(const FWEventItem *)
FWColorManager * colorManager() const
const fireworks::Context & context() const
void modelChanges(const FWModelIds &)
void eventCenterChanged()