Class Reference for E1039 Core & Analysis Software
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
mPHEveModuleBase.h
Go to the documentation of this file.
1 /*
2  \file mPHEveModuleBase.h
3  \author Sookhyun Lee
4  \brief abstract interface for PHEve framework modules
5  \version $Revision: 1.1 $
6  \date $Date: 07/26/2016
7 */
8 
9 #ifndef __MPHEVEMODULEBASE_H__
10 #define __MPHEVEMODULEBASE_H__
11 
12 #include <boost/bind.hpp>
13 
14 #include <phool/phool.h>
15 #include <map>
16 
17 #include <TEveManager.h>
18 
19 using boost::bind;
20 
21 class PHCompositeNode;
22 class TEveElement;
23 
25 {
26  public:
27  virtual ~mPHEveModuleBase() {}
28  virtual void init(PHCompositeNode* top_node) = 0;
29  virtual void init_run(PHCompositeNode* top_node) = 0;
30  virtual bool event(PHCompositeNode* top_node) = 0;
31  virtual void draw_event(){};
32  void add_elements()
33  {
34  std::for_each(_elmt_buffer.begin(),
35  _elmt_buffer.end(),
36  bind(&TEveManager::AddElement,
38  bind(&mvt::first, _1),
39  bind(&mvt::second, _1)));
40  };
41  void buffer_element(TEveElement* el,
42  TEveElement* parent_elmt)
43  {
44  _elmt_buffer.insert(std::make_pair(el, parent_elmt));
45  }
46 
48  {
49  _elmt_buffer.clear();
50  }
51 
52  virtual void clear() = 0;
53 
54  virtual void end(PHCompositeNode* top_node) = 0;
55 
56  protected:
57 
58  TEveManager* _evemanager;
59 
60  typedef std::multimap<TEveElement*, TEveElement*> elmtmap;
62  typedef elmtmap::iterator::value_type mvt;
63 
64 };
65 
66 #endif // __MPHEVEMODULEBASE_H__
virtual void clear()=0
virtual void end(PHCompositeNode *top_node)=0
virtual void init_run(PHCompositeNode *top_node)=0
void buffer_element(TEveElement *el, TEveElement *parent_elmt)
virtual ~mPHEveModuleBase()
TEveManager * _evemanager
virtual void draw_event()
virtual bool event(PHCompositeNode *top_node)=0
virtual void init(PHCompositeNode *top_node)=0
std::multimap< TEveElement *, TEveElement * > elmtmap
elmtmap::iterator::value_type mvt