Logo ROOT  
Reference Guide
REveDataProxyBuilderBase.hxx
Go to the documentation of this file.
1 // @(#)root/eve7:$Id$
2 // Authors: Matevz Tadel & Alja Mrak-Tadel, 2018
3 
4 /*************************************************************************
5  * Copyright (C) 1995-2019, Rene Brun and Fons Rademakers. *
6  * All rights reserved. *
7  * *
8  * For the licensing terms see $ROOTSYS/LICENSE. *
9  * For the list of contributors see $ROOTSYS/README/CREDITS. *
10  *************************************************************************/
11 
12 #ifndef ROOT7_REveDataProxyBuilderBase
13 #define ROOT7_REveDataProxyBuilderBase
14 
15 #include <ROOT/REveElement.hxx>
16 #include <ROOT/REveCompound.hxx>
17 #include <ROOT/REveDataClasses.hxx>
18 
19 namespace ROOT {
20 namespace Experimental {
21 
22 class REveViewContext;
23 class REveTrackPropagator;
24 
26 {
27 public:
28  struct Product
29  {
30  std::string m_viewType;
31  const REveViewContext *m_viewContext{nullptr};
33 
34  Product(std::string viewType, const REveViewContext* c);
35  virtual ~Product();
36  };
37 
38  // ---------- const member functions ---------------------
39 
40  const REveViewContext& Context() const;
41  const REveDataCollection* Collection() const { return m_collection; }
42 
43  // ---------- constructor/destructor ---------------------
44 
45  REveDataProxyBuilderBase(const std::string &type);
47 
48  virtual void SetCollection(REveDataCollection*);
49  // virtual void SetInteractionList(REveDataInteractionList*, const std::string&);
50 
51  virtual void CollectionBeingDestroyed(const REveDataCollection*);
52 
53  void Build();
54  // virtual void Build(REveElement* product);
55 
56  REveElement* CreateProduct(std::string viewType, const REveViewContext*);
57  // void removePerViewProduct(const REveViewContext* vc);
58 
61 
62  void SetupElement(REveElement* el, bool color = true) const;
63  void SetupAddElement(REveElement* el, REveElement* parent, bool set_color = true) const;
64 
65  bool GetHaveAWindow() const { return m_haveWindow; }
66  void SetHaveAWindow(bool);
67 
68  std::string Type() const { return m_type; }
69 
70  // const member functions
71  virtual bool HaveSingleProduct() const { return true; }
72 
73 protected:
74  // Override this if visibility changes can cause (re)-creation of proxies.
75  // Returns true if new proxies were created.
76  virtual bool VisibilityModelChanges(int idx, REveElement*, const REveViewContext*);
77 
78  virtual void Build(const REveDataCollection* iItem, REveElement* product, const REveViewContext*);
79  virtual void BuildViewType(const REveDataCollection* iItem, REveElement* product, std::string viewType, const REveViewContext*);
80 
81  virtual void ModelChanges(const REveDataCollection::Ids_t&, Product*);
82  virtual void LocalModelChanges(int idx, REveElement* el, const REveViewContext* ctx);
83 
84  // Utility
85  REveCompound* CreateCompound(bool set_color=true, bool propagate_color_to_all_children=false) const;
86  virtual void Clean();
87  virtual void CleanLocal();
88 
89  std::vector<Product*> m_products;
90 
91 private:
92  std::string m_type;
94 
95  float m_layer;
96  // REveDataInteractionList* m_interactionList;
99 };
100 
101 } // namespace Experimental
102 } // namespace ROOT
103 #endif
ROOT::Experimental::REveViewContext
Definition: REveViewContext.hxx:21
c
#define c(i)
Definition: RSha256.hxx:101
ROOT::Experimental::REveDataProxyBuilderBase::ModelChanges
void ModelChanges(const REveDataCollection::Ids_t &)
Definition: REveDataProxyBuilderBase.cxx:289
ROOT::Experimental::REveDataCollection
Definition: REveDataClasses.hxx:32
ROOT::Experimental::REveDataCollection::Ids_t
std::vector< int > Ids_t
Definition: REveDataClasses.hxx:34
ROOT::Experimental::REveDataProxyBuilderBase::Product::Product
Product(std::string viewType, const REveViewContext *c)
Definition: REveDataProxyBuilderBase.cxx:25
ROOT::Experimental::REveDataProxyBuilderBase::VisibilityModelChanges
virtual bool VisibilityModelChanges(int idx, REveElement *, const REveViewContext *)
Definition: REveDataProxyBuilderBase.cxx:401
ROOT::Experimental::REveDataProxyBuilderBase::Product::m_elements
REveCompound * m_elements
Definition: REveDataProxyBuilderBase.hxx:32
ROOT::Experimental::REveDataProxyBuilderBase::m_modelsChanged
bool m_modelsChanged
Definition: REveDataProxyBuilderBase.hxx:98
ROOT::Experimental::REveDataProxyBuilderBase::GetHaveAWindow
bool GetHaveAWindow() const
Definition: REveDataProxyBuilderBase.hxx:65
ROOT::Experimental::REveDataProxyBuilderBase::Product::~Product
virtual ~Product()
Definition: REveDataProxyBuilderBase.cxx:42
ROOT::Experimental::REveDataProxyBuilderBase::m_layer
float m_layer
Definition: REveDataProxyBuilderBase.hxx:95
ROOT::Experimental::REveDataProxyBuilderBase::LocalModelChanges
virtual void LocalModelChanges(int idx, REveElement *el, const REveViewContext *ctx)
Definition: REveDataProxyBuilderBase.cxx:280
ROOT::Experimental::REveDataProxyBuilderBase::~REveDataProxyBuilderBase
virtual ~REveDataProxyBuilderBase()
Definition: REveDataProxyBuilderBase.hxx:46
ROOT::Experimental::REveDataProxyBuilderBase::CollectionBeingDestroyed
virtual void CollectionBeingDestroyed(const REveDataCollection *)
Definition: REveDataProxyBuilderBase.cxx:385
ROOT::Experimental::REveDataProxyBuilderBase::HaveSingleProduct
virtual bool HaveSingleProduct() const
Definition: REveDataProxyBuilderBase.hxx:71
ROOT::Experimental::REveDataProxyBuilderBase::m_haveWindow
bool m_haveWindow
Definition: REveDataProxyBuilderBase.hxx:97
ROOT::Experimental::REveDataProxyBuilderBase::REveDataProxyBuilderBase
REveDataProxyBuilderBase(const std::string &type)
Definition: REveDataProxyBuilderBase.cxx:34
ROOT::Experimental::REveElement
Definition: REveElement.hxx:80
ROOT::Experimental::REveDataProxyBuilderBase::Context
const REveViewContext & Context() const
ROOT::Experimental::REveDataProxyBuilderBase::Product::m_viewContext
const REveViewContext * m_viewContext
Definition: REveDataProxyBuilderBase.hxx:31
ROOT::Experimental::REveDataProxyBuilderBase::CreateProduct
REveElement * CreateProduct(std::string viewType, const REveViewContext *)
Definition: REveDataProxyBuilderBase.cxx:198
ROOT::Experimental::REveDataProxyBuilderBase::Type
std::string Type() const
Definition: REveDataProxyBuilderBase.hxx:68
ROOT::Experimental::REveDataProxyBuilderBase::Product
Definition: REveDataProxyBuilderBase.hxx:29
ROOT::Experimental::REveDataProxyBuilderBase::m_collection
const REveDataCollection * m_collection
Definition: REveDataProxyBuilderBase.hxx:93
ROOT::Experimental::REveDataProxyBuilderBase::SetHaveAWindow
void SetHaveAWindow(bool)
Definition: REveDataProxyBuilderBase.cxx:406
ROOT::Experimental::REveDataProxyBuilderBase::Collection
const REveDataCollection * Collection() const
Definition: REveDataProxyBuilderBase.hxx:41
ROOT::Experimental::REveDataProxyBuilderBase::Clean
virtual void Clean()
Definition: REveDataProxyBuilderBase.cxx:368
ROOT::Experimental::REveDataProxyBuilderBase::Build
void Build()
Definition: REveDataProxyBuilderBase.cxx:84
REveElement.hxx
REveDataClasses.hxx
ROOT::Experimental::REveDataProxyBuilderBase::BuildViewType
virtual void BuildViewType(const REveDataCollection *iItem, REveElement *product, std::string viewType, const REveViewContext *)
Definition: REveDataProxyBuilderBase.cxx:190
REveCompound.hxx
ROOT::Experimental::REveDataProxyBuilderBase::SetupElement
void SetupElement(REveElement *el, bool color=true) const
This method is invoked to setup the per element properties of the various objects being drawn.
Definition: REveDataProxyBuilderBase.cxx:326
ROOT::Experimental::REveDataProxyBuilderBase::Product::m_viewType
std::string m_viewType
Definition: REveDataProxyBuilderBase.hxx:30
ROOT::Experimental::REveDataProxyBuilderBase
Definition: REveDataProxyBuilderBase.hxx:26
ROOT::Experimental::REveDataProxyBuilderBase::m_products
std::vector< Product * > m_products
Definition: REveDataProxyBuilderBase.hxx:89
ROOT::Experimental::REveDataProxyBuilderBase::m_type
std::string m_type
Definition: REveDataProxyBuilderBase.hxx:92
Product
static Double_t Product(const Double_t *x, const Float_t *y)
Product.
Definition: TCTUB.cxx:101
ROOT::Experimental::REveDataProxyBuilderBase::SetupAddElement
void SetupAddElement(REveElement *el, REveElement *parent, bool set_color=true) const
Definition: REveDataProxyBuilderBase.cxx:314
type
int type
Definition: TGX11.cxx:121
ROOT::Experimental::REveDataProxyBuilderBase::SetCollection
virtual void SetCollection(REveDataCollection *)
Definition: REveDataProxyBuilderBase.cxx:65
ROOT::Experimental::REveCompound
Definition: REveCompound.hxx:28
ROOT
VSD Structures.
Definition: StringConv.hxx:21
ROOT::Experimental::REveDataProxyBuilderBase::CreateCompound
REveCompound * CreateCompound(bool set_color=true, bool propagate_color_to_all_children=false) const
Definition: REveDataProxyBuilderBase.cxx:343
ROOT::Experimental::REveDataProxyBuilderBase::CollectionChanged
void CollectionChanged(const REveDataCollection *)
Definition: REveDataProxyBuilderBase.cxx:304
ROOT::Experimental::REveDataProxyBuilderBase::CleanLocal
virtual void CleanLocal()
Definition: REveDataProxyBuilderBase.cxx:380