Logo ROOT   6.19/01
Reference Guide
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 
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:
51  virtual ~REveProjectable();
52 
53  virtual TClass *ProjectedClass(const REveProjection *p) const = 0;
54 
55  virtual Bool_t HasProjecteds() const { return !fProjectedList.empty(); }
56 
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 
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 
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;
107 
108  virtual void SetDepth(Float_t d);
109 };
110 
111 } // namespace Experimental
112 } // namespace ROOT
113 
114 #endif
virtual REveElement * GetProjectedAsElement()
Returns this projected dynamic-casted to REveElement.
virtual void SetProjection(REveProjectionManager *mng, REveProjectable *model)
Sets projection manager and reference in the projectable object.
VSD Structures.
Definition: StringConv.hxx:21
float Float_t
Definition: RtypesCore.h:53
REveProjected & operator=(const REveProjected &)
REveProjectable * GetProjectable() const
virtual void AnnihilateProjecteds()
Optimized destroy of projected elements with condition there is only one parent for projected element...
virtual void UnRefProjectable(REveProjectable *assumed_parent, bool notifyParent=true)
Remove reference to projectable.
bool Bool_t
Definition: RtypesCore.h:59
REveProjectionManager * GetManager() const
REveProjection Base for specific classes that implement non-linear projections.
short Color_t
Definition: RtypesCore.h:79
virtual void PropagateMainColor(Color_t color, Color_t old_color)
Set main color of projecteds if their color is the same as old_color.
REveProjectionManager Manager class for steering of projections and managing projected objects...
TClass instances represent classes, structs and namespaces in the ROOT type system.
Definition: TClass.h:75
virtual void AddProjected(REveProjected *p)
virtual void PropagateVizParams(REveElement *el=nullptr)
Set visualization parameters of projecteds.
#define d(i)
Definition: RSha256.hxx:102
virtual void PropagateMainTransparency(Char_t t, Char_t old_t)
Set main transparency of projecteds if their transparency is the same as the old one.
virtual void RemoveProjected(REveProjected *p)
virtual void AddProjectedsToSet(std::set< REveElement *> &set)
Add the projected elements to the set, dyn-casting them to REveElement.
virtual void PropagateRenderState(Bool_t rnr_self, Bool_t rnr_children)
Set render state of projecteds.
std::list< REveProjected * > ProjList_t
void SetDepthCommon(Float_t d, REveElement *el, Float_t *bbox)
Utility function to update the z-values of the bounding-box.
char Char_t
Definition: RtypesCore.h:29
virtual void SetDepthLocal(Float_t d)
Base-class implementation – just sets fDepth.
virtual void SetDepth(Float_t d)
Set depth coordinate for the element.
REveProjectable & operator=(const REveProjectable &)
virtual TClass * ProjectedClass(const REveProjection *p) const =0