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());
122 gEve->GetHighlight()->SetPickToSelect(TEveSelection::kPS_Master);
123 TEveSelection* eveSelection = gEve->GetSelection();
124 eveSelection->SetPickToSelect(TEveSelection::kPS_Master);
125 eveSelection->Connect(
"SelectionAdded(TEveElement*)",
"FWEveViewManager",
this,
"selectionAdded(TEveElement*)");
126 eveSelection->Connect(
"SelectionRepeated(TEveElement*)",
"FWEveViewManager",
this,
"selectionAdded(TEveElement*)");
127 eveSelection->Connect(
"SelectionRemoved(TEveElement*)",
"FWEveViewManager",
this,
"selectionRemoved(TEveElement*)");
128 eveSelection->Connect(
"SelectionCleared()",
"FWEveViewManager",
this,
"selectionCleared()");
130 gEve->GetHighlight()->Connect(
131 "SelectionAdded(TEveElement*)",
"FWEveViewManager",
this,
"highlightAdded(TEveElement*)");
132 gEve->GetHighlight()->Connect(
133 "SelectionRepeated(TEveElement*)",
"FWEveViewManager",
this,
"highlightAdded(TEveElement*)");
135 TGeoManager::SetVerboseLevel(0);
153 FWRPZView* rpzView = dynamic_cast<FWRPZView*>(view);
181 std::vector<BuilderInfo>& blist = itFind->second;
185 for (
size_t bii = 0, bie = blist.size(); bii != bie; ++bii) {
188 info.classType(bType, bIsSimple);
198 if (itype != bType) {
205 int builderViewBit =
info.m_viewBit;
207 std::shared_ptr<FWProxyBuilderBase> builder;
213 <<
"FWEveViewManager::newItem ignoring the following exception (probably edmplugincache mismatch):"
223 builder->setItem(iItem);
231 if (builder->willHandleInteraction() ==
false) {
232 typedef std::map<const FWEventItem*, FWInteractionList*>::iterator
Iterator;
235 if (
t.second ==
true)
238 builder->setInteractionList(
t.first->second, iItem->
purpose());
245 if (((1 << viewType) & builderViewBit) == 0)
254 TEveElementList* product = builder->createProduct(
type, view->
viewContext());
258 TEveElementList* product = builder->createProduct(
type,
nullptr);
279 std::shared_ptr<FWEveView> view;
306 m_views[
type].push_back(std::shared_ptr<FWEveView>(view));
312 gEve->DisableRedraw();
320 int viewerBit = 1 << view->typeId();
321 if (
m_views[view->typeId()].size() == 1) {
323 int builderViewBit =
i->first;
325 if (viewerBit == (builderViewBit & viewerBit)) {
326 for (
BuilderVec_it bIt = bv.begin(); bIt != bv.end(); ++bIt) {
327 (*bIt)->setHaveWindow(
true);
333 FWRPZView* rpzView = dynamic_cast<FWRPZView*>(view.get());
335 int builderViewBit =
i->first;
337 if (viewerBit == (builderViewBit & viewerBit)) {
338 for (
BuilderVec_it bIt = bv.begin(); bIt != bv.end(); ++bIt) {
341 TEveElementList* product = (*bIt)->createProduct(view->typeId(), view->viewContext());
349 view->ownedProducts()->AddElement(product);
356 view->eventScene()->AddElement(product);
365 view->setupEnergyScale();
367 gEve->EnableRedraw();
368 view->viewerGL()->UpdateScene();
376 int typeId = view->
typeId();
378 int viewerBit = 1 << typeId;
379 int nviews =
m_views[typeId].size();
381 int builderBit =
i->first;
382 if (viewerBit == (builderBit & viewerBit))
387 if (viewerBit == (builderBit & viewerBit)) {
395 if (viewerBit == (builderBit & viewerBit)) {
397 (*bIt)->setHaveWindow(
false);
405 if (
i->get() == vb) {
425 bool itemHaveWindow =
false;
427 for (
size_t bi = 0,
be =
i->second.size(); bi !=
be; ++bi) {
431 itemHaveWindow =
true;
443 if (!it->second->empty())
444 it->second->modelChanges(iIds);
457 bool itemHaveWindow =
false;
460 for (
size_t bi = 0,
be =
i->second.size(); bi !=
be; ++bi) {
476 if (!it->second->empty())
477 it->second->itemChanged();
494 while (bIt !=
i->second.end()) {
495 if ((*bIt)->item() ==
item) {
497 (*bIt)->itemBeingDestroyed(
item);
498 bIt =
i->second.erase(bIt);
508 x->commonPrefs()->getEnergyScale()->parameterChanged_.connect(
516 if ((*i)->isEnergyScaleGlobal()) {
517 (*i)->setupEnergyScale();
526 (*i)->setupEventCenter();
542 gEve->EnforceTimerActive(kTRUE);
543 gEve->DisableRedraw();
568 TExMapIter stamped_elements(gEve->PtrToStampedElements());
569 while (stamped_elements.Next(
key,
value)) {
570 TEveElement* el = reinterpret_cast<TEveElement*>(
key);
571 if (el->GetChangeBits() & TEveElement::kCBVisibility) {
572 el->CollectSceneParents(scenes);
575 gEve->ScenesChanged(scenes);
579 gEve->GetScenes()->ProcessSceneChanges(kFALSE, gEve->PtrToStampedElements());
589 (*i)->fwViewerGL()->DrawHiLod(swap_on_render);
593 if (!swap_on_render) {
596 (*i)->fwViewerGL()->JustSwap();
600 gEve->GetViewers()->RepaintChangedViewers(kFALSE, kFALSE);
604 TExMapIter stamped_elements(gEve->PtrToStampedElements());
605 while (stamped_elements.Next(
key,
value)) {
606 TEveElement* el = reinterpret_cast<TEveElement*>(
key);
607 if (gEve->GetEditor()->GetModel() == el->GetEditorObject(
"FWEveViewManager::eventEnd"))
608 gEve->EditElement(el);
609 TEveGedEditor::ElementChanged(el);
614 gEve->PtrToStampedElements()->Delete();
616 gEve->GetListTree()->ClearViewPort();
618 gEve->EnableRedraw();
619 gEve->EnforceTimerActive(kFALSE);
631 void*
userData = iElement->GetUserData();
639 return reinterpret_cast<FWFromEveSelectorBase*>(
userData);
663 const static std::string kFullFrameWorkPBExtension =
"FullFramework";
665 std::vector<BuilderInfo> blist = it->second;
666 for (
size_t bii = 0, bie = blist.size(); bii != bie; ++bii) {
671 if (std::string::npos !=
info.m_name.find(pfExt))
675 unsigned int bitPackedViews =
info.m_viewBit;
676 bool representsSubPart = (
info.m_name.substr(
info.m_name.find_first_of(
'@') - 1, 1) ==
"!");
677 size_t extp =
info.m_name.rfind(kFullFrameWorkPBExtension);
678 bool FFOnly = (extp != std::string::npos);
684 returnValue.
add(std::make_shared<FWSimpleRepresentationChecker>(
685 name, it->first, bitPackedViews, representsSubPart, FFOnly));
687 returnValue.
add(std::make_shared<FWEDProductRepresentationChecker>(
688 name, it->first, bitPackedViews, representsSubPart, FFOnly));
707 simple = (
m_name.substr(0, kSimple.size()) == kSimple);
723 #include "TEveCaloData.h"
726 bool blocked = gEve->GetHighlight()->BlockSignals(
true);
728 if (iElement ==
context().getCaloData()) {
730 std::set<TEveCaloData::CellId_t> hset;
734 TAxis* etaAxis =
hist->GetXaxis();
735 int nBinsX = etaAxis->GetNbins() + 2;
737 for (TEveCaloData::vCellId_i
i = hlist.begin();
i != hlist.end(); ++
i) {
740 newPhiBin = ((
phiBin + 1) / 4) * 4 - 1;
745 hset.insert(TEveCaloData::CellId_t(
tower, (*i).fSlice, (*i).fFraction));
747 hset.insert(TEveCaloData::CellId_t(
tower, (*i).fSlice, (*i).fFraction));
753 hset.insert(TEveCaloData::CellId_t(
tower, (*i).fSlice, (*i).fFraction));
755 hset.insert(TEveCaloData::CellId_t(
tower, (*i).fSlice, (*i).fFraction));
757 newPhiBin = ((
phiBin + 1) / 2) * 2 - 1;
759 hset.insert(TEveCaloData::CellId_t(
tower, (*i).fSlice, (*i).fFraction));
761 hset.insert(TEveCaloData::CellId_t(
tower, (*i).fSlice, (*i).fFraction));
769 for (std::set<TEveCaloData::CellId_t>::iterator it = hset.begin(); it != hset.end(); ++it) {
770 hlist.push_back(*it);
775 gEve->GetHighlight()->BlockSignals(blocked);