11 #include <display/VisualRepMap.h>
13 #include <display/EveTower.h>
14 #include <framework/logging/Logger.h>
15 #include <framework/datastore/RelationVector.h>
16 #include <framework/datastore/DataStore.h>
18 #include <TEveSelection.h>
19 #include <TEveCaloData.h>
20 #include <TEveManager.h>
22 #include <boost/bimap/bimap.hpp>
23 #include <boost/bimap/unordered_multiset_of.hpp>
29 typedef boost::bimaps::bimap <
30 boost::bimaps::unordered_multiset_of<const TObject*>,
31 boost::bimaps::unordered_multiset_of<TEveElement*>
32 > DataStoreEveElementMap_Base;
61 if (TEveCaloData* caloData =
dynamic_cast<TEveCaloData*
>(elem)) {
62 const auto& selectedCells = caloData->GetCellsSelected();
63 if (selectedCells.empty())
65 int id = selectedCells[0].fTower;
67 if (eveTower->getID() ==
id) {
92 B2FATAL(
"recursive select() call detected. Please check isCurrentlySelecting().");
95 for (
auto it = range.first; it != range.second; ++it) {
96 TEveElement* elem = it->second;
97 if (elem and !gEve->GetSelection()->HasChild(elem)) {
99 gEve->GetSelection()->UserPickedElement(elem,
true);
108 const std::list<TEveElement*> sel(gEve->GetSelection()->BeginChildren(), gEve->GetSelection()->EndChildren());
109 for (TEveElement* el : sel) {
110 if (el == eveObj or el->IsA() == EveTower::Class())
112 gEve->GetSelection()->UserUnPickedElement(el);
119 if (representedObject) {
122 const RelationVector<TObject>& relatedObjects = DataStore::getRelationsWithObj<TObject>(representedObject,
"ALL");
123 for (
const TObject& relObj : relatedObjects) {
134 gEve->GetSelection()->UserPickedElement(
nullptr);
138 if (!dataStoreObject) {
139 B2ERROR(
"Trying to insert NULL for object represented by " << visualRepresentation->GetElementName());
142 auto ret =
m_dataStoreEveElementMap->insert(DataStoreEveElementMap::value_type(dataStoreObject, visualRepresentation));
144 B2DEBUG(100,
"Failed to insert object represented by " << visualRepresentation->GetElementName() <<
"! Duplicate?");
151 tower->IncDenyDestroy();
154 add(dataStoreObject, tower);