Belle II Software  release-08-01-10
VisualRepMap Class Reference

defines a bidirectional (many to many) mapping between TObjects in DataStore and their visual representation. More...

#include <VisualRepMap.h>

Collaboration diagram for VisualRepMap:

Classes

class  DataStoreEveElementMap
 Hide implementation in private class. More...
 

Public Member Functions

void select (const TObject *object) const
 Select the representation of the given object.
 
void selectOnly (const TEveElement *eveObj) const
 Deselect all other objects.
 
void selectRelated (TEveElement *eveObj) const
 Select related objects.
 
void clearSelection () const
 Clear existing selection in Eve Browser.
 
bool isCurrentlySelecting () const
 are we currently in a select() call? More...
 
const TObject * getDataStoreObject (TEveElement *elem) const
 Get object represented by given visual representation. More...
 
TEveElement * getEveElement (const TObject *obj) const
 Get (first) visual representation of given object.
 
bool isVisualized (const TObject *obj)
 Does obj have a visualization?
 
void clear ()
 Remove all contents in map. More...
 
void add (const TObject *dataStoreObject, TEveElement *visualRepresentation)
 Generic function to keep track of which objects have which visual representation. More...
 
void addCluster (const TObject *dataStoreObject, TEveCaloData *caloData, int towerID)
 Selection inside TEveCalo* is complicated, use this to keep track of ECL clusters.
 

Static Public Member Functions

static VisualRepMapgetInstance ()
 get instance pointer.
 

Private Member Functions

 VisualRepMap ()
 default constructor
 
 VisualRepMap (const VisualRepMap &)=delete
 no copy ctor
 
VisualRepMapoperator= (const VisualRepMap &)=delete
 no assignment
 
 ~VisualRepMap ()
 destructor
 

Private Attributes

bool m_currentlySelecting
 are we currently in a select() call?
 
DataStoreEveElementMapm_dataStoreEveElementMap
 Map DataStore contents in current event with their visual representation.
 
std::vector< EveTower * > m_eclTowers
 individual ECL towers (getting them out of TEve is hard).
 

Detailed Description

defines a bidirectional (many to many) mapping between TObjects in DataStore and their visual representation.

This is used to allow retrieving the original objects for a given TEveElement (to show additional info), and vice versa.

Definition at line 28 of file VisualRepMap.h.

Member Function Documentation

◆ add()

void add ( const TObject *  dataStoreObject,
TEveElement *  visualRepresentation 
)

Generic function to keep track of which objects have which visual representation.

Should be called by functions adding TEveElements to the event scene (Hits are currently excluded).

Does not take ownership of given objects, just stores mapping between pointers.

Definition at line 134 of file VisualRepMap.cc.

135 {
136  if (!dataStoreObject) {
137  B2ERROR("Trying to insert NULL for object represented by " << visualRepresentation->GetElementName());
138  return;
139  }
140  auto ret = m_dataStoreEveElementMap->insert(DataStoreEveElementMap::value_type(dataStoreObject, visualRepresentation));
141  if (!ret.second) {
142  B2DEBUG(100, "Failed to insert object represented by " << visualRepresentation->GetElementName() << "! Duplicate?");
143  }
144 }
DataStoreEveElementMap * m_dataStoreEveElementMap
Map DataStore contents in current event with their visual representation.
Definition: VisualRepMap.h:93

◆ clear()

void clear ( void  )

Remove all contents in map.

(call this after each event)

Definition at line 46 of file VisualRepMap.cc.

◆ getDataStoreObject()

const TObject * getDataStoreObject ( TEveElement *  elem) const

Get object represented by given visual representation.

(elem is pretty much const, but boost refuses to search for it then. )

Definition at line 56 of file VisualRepMap.cc.

◆ isCurrentlySelecting()

bool isCurrentlySelecting ( ) const
inline

are we currently in a select() call?

Call this in your selection handler and abort if true. (otherwise we end up recursively calling ourselves).

Definition at line 50 of file VisualRepMap.h.

50 { return m_currentlySelecting; }
bool m_currentlySelecting
are we currently in a select() call?
Definition: VisualRepMap.h:88

The documentation for this class was generated from the following files: