Logo ROOT   6.30.04
Reference Guide
 All Namespaces Files Pages
REveProjectionBases.hxx
Go to the documentation of this file.
1 // @(#)root/eve7:$Id$
2 // Authors: Matevz Tadel & Alja Mrak-Tadel: 2006, 2007
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_REveProjectionBases
13 #define ROOT7_REveProjectionBases
14 
15 #include "Rtypes.h"
16 #include <list>
17 #include <set>
18 
19 class TClass;
20 
21 namespace ROOT {
22 namespace Experimental {
23 
24 class REveElement;
25 class REveProjection;
26 class REveProjected;
27 class REveProjectionManager;
28 
29 ////////////////////////////////////////////////////////////////
30 // //
31 // REveProjectable //
32 // //
33 // Abstract base class for non-linear projectable objects. //
34 // //
35 ////////////////////////////////////////////////////////////////
36 
37 class REveProjectable
38 {
39 private:
40  REveProjectable &operator=(const REveProjectable &); // Not implemented
41 
42 public:
43  typedef std::list<REveProjected *> ProjList_t;
44 
45 protected:
46  ProjList_t fProjectedList; // references to projected instances.
47 
48 public:
49  REveProjectable();
50  REveProjectable(const REveProjectable &);
51  virtual ~REveProjectable();
52 
53  virtual TClass *ProjectedClass(const REveProjection *p) const = 0;
54 
55  virtual Bool_t HasProjecteds() const { return !fProjectedList.empty(); }
56 
57  ProjList_t &RefProjecteds() { return fProjectedList; }
58 
59  virtual void AddProjected(REveProjected *p) { fProjectedList.emplace_back(p); }
60  virtual void RemoveProjected(REveProjected *p) { fProjectedList.remove(p); }
61 
62  virtual void AnnihilateProjecteds();
63  virtual void ClearProjectedList();
64 
65  virtual void AddProjectedsToSet(std::set<REveElement *> &set);
66 
67  virtual void PropagateVizParams(REveElement *el = nullptr);
68  virtual void PropagateRenderState(Bool_t rnr_self, Bool_t rnr_children);
69  virtual void PropagateMainColor(Color_t color, Color_t old_color);
70  virtual void PropagateMainTransparency(Char_t t, Char_t old_t);
71 };
72 
73 ////////////////////////////////////////////////////////////////
74 // //
75 // REveProjected //
76 // //
77 // Abstract base class for non-linear projected objects. //
78 // //
79 ////////////////////////////////////////////////////////////////
80 
81 class REveProjected {
82 private:
83  REveProjected(const REveProjected &); // Not implemented
84  REveProjected &operator=(const REveProjected &); // Not implemented
85 
86 protected:
87  REveProjectionManager *fManager{nullptr}; // manager
88  REveProjectable *fProjectable{nullptr}; // link to original object
89  Float_t fDepth{0.}; // z coordinate
90 
91  void SetDepthCommon(Float_t d, REveElement *el, Float_t *bbox);
92  virtual void SetDepthLocal(Float_t d);
93 
94 public:
95  REveProjected() = default;
96  virtual ~REveProjected();
97 
98  REveProjectionManager *GetManager() const { return fManager; }
99  REveProjectable *GetProjectable() const { return fProjectable; }
100  Float_t GetDepth() const { return fDepth; }
101 
102  virtual void SetProjection(REveProjectionManager *mng, REveProjectable *model);
103  virtual void UnRefProjectable(REveProjectable *assumed_parent, bool notifyParent = true);
104 
105  virtual void UpdateProjection() = 0;
106  virtual REveElement *GetProjectedAsElement();
107 
108  virtual void SetDepth(Float_t d);
109 };
110 
111 } // namespace Experimental
112 } // namespace ROOT
113 
114 #endif