Belle II Software development
VisualRepMap.h
1/**************************************************************************
2 * basf2 (Belle II Analysis Software Framework) *
3 * Author: The Belle II Collaboration *
4 * *
5 * See git log for contributors and copyright holders. *
6 * This file is licensed under LGPL-3.0, see LICENSE.md. *
7 **************************************************************************/
8
9#pragma once
10
11#include <vector>
12
13class TEveElement;
14class TEveCaloData;
15class TObject;
16
17namespace Belle2 {
22 class EveTower;
29 public:
31 static VisualRepMap* getInstance();
32
34 void select(const TObject* object) const;
35
37 void selectOnly(const TEveElement* eveObj) const;
38
40 void selectRelated(TEveElement* eveObj) const;
41
43 void clearSelection() const;
44
51
56 const TObject* getDataStoreObject(TEveElement* elem) const;
57
59 TEveElement* getEveElement(const TObject* obj) const;
60
62 bool isVisualized(const TObject* obj) { return getEveElement(obj) != nullptr; }
63
65 void clear();
66
74 void add(const TObject* dataStoreObject, TEveElement* visualRepresentation);
75
77 void addCluster(const TObject* dataStoreObject, TEveCaloData* caloData, int towerID);
78 private:
82 VisualRepMap(const VisualRepMap&) = delete;
87
89
90 mutable bool m_currentlySelecting;
94
96 std::vector<EveTower*> m_eclTowers;
97
98 };
100}
defines a bidirectional (many to many) mapping between TObjects in DataStore and their visual represe...
Definition: VisualRepMap.h:28
~VisualRepMap()
destructor
Definition: VisualRepMap.cc:44
void addCluster(const TObject *dataStoreObject, TEveCaloData *caloData, int towerID)
Selection inside TEveCalo* is complicated, use this to keep track of ECL clusters.
const TObject * getDataStoreObject(TEveElement *elem) const
Get object represented by given visual representation.
Definition: VisualRepMap.cc:56
bool m_currentlySelecting
are we currently in a select() call?
Definition: VisualRepMap.h:90
bool isCurrentlySelecting() const
are we currently in a select() call?
Definition: VisualRepMap.h:50
void clearSelection() const
Clear existing selection in Eve Browser.
static VisualRepMap * getInstance()
get instance pointer.
Definition: VisualRepMap.cc:36
void selectRelated(TEveElement *eveObj) const
Select related objects.
TEveElement * getEveElement(const TObject *obj) const
Get (first) visual representation of given object.
Definition: VisualRepMap.cc:78
std::vector< EveTower * > m_eclTowers
individual ECL towers (getting them out of TEve is hard).
Definition: VisualRepMap.h:96
void selectOnly(const TEveElement *eveObj) const
Deselect all other objects.
void select(const TObject *object) const
Select the representation of the given object.
Definition: VisualRepMap.cc:87
DataStoreEveElementMap * m_dataStoreEveElementMap
Map DataStore contents in current event with their visual representation.
Definition: VisualRepMap.h:93
void clear()
Remove all contents in map.
Definition: VisualRepMap.cc:46
VisualRepMap & operator=(const VisualRepMap &)=delete
no assignment
VisualRepMap(const VisualRepMap &)=delete
no copy ctor
VisualRepMap()
default constructor
Definition: VisualRepMap.cc:42
void add(const TObject *dataStoreObject, TEveElement *visualRepresentation)
Generic function to keep track of which objects have which visual representation.
bool isVisualized(const TObject *obj)
Does obj have a visualization?
Definition: VisualRepMap.h:62
Hide implementation in private class.
Definition: VisualRepMap.cc:34
Abstract base class for different kinds of events.