Logo ROOT  
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
19class TClass;
20
21namespace ROOT {
22namespace Experimental {
23
24class REveElement;
25class REveProjection;
26class REveProjected;
27class REveProjectionManager;
28
29////////////////////////////////////////////////////////////////
30// //
31// REveProjectable //
32// //
33// Abstract base class for non-linear projectable objects. //
34// //
35////////////////////////////////////////////////////////////////
36
38{
39private:
40 REveProjectable &operator=(const REveProjectable &); // Not implemented
41
42public:
43 typedef std::list<REveProjected *> ProjList_t;
44
45protected:
46 ProjList_t fProjectedList; // references to projected instances.
47
48public:
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
82private:
83 REveProjected(const REveProjected &); // Not implemented
84 REveProjected &operator=(const REveProjected &); // Not implemented
85
86protected:
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
94public:
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
#define d(i)
Definition: RSha256.hxx:102
char Char_t
Definition: RtypesCore.h:29
bool Bool_t
Definition: RtypesCore.h:59
short Color_t
Definition: RtypesCore.h:79
float Float_t
Definition: RtypesCore.h:53
virtual void AddProjectedsToSet(std::set< REveElement * > &set)
Add the projected elements to the set, dyn-casting them to REveElement.
REveProjectable & operator=(const REveProjectable &)
virtual void PropagateVizParams(REveElement *el=nullptr)
Set visualization parameters of projecteds.
std::list< REveProjected * > ProjList_t
virtual void RemoveProjected(REveProjected *p)
virtual void PropagateMainColor(Color_t color, Color_t old_color)
Set main color of projecteds if their color is the same as old_color.
virtual void AnnihilateProjecteds()
Optimized destroy of projected elements with condition there is only one parent for projected element...
virtual void PropagateRenderState(Bool_t rnr_self, Bool_t rnr_children)
Set render state of projecteds.
virtual TClass * ProjectedClass(const REveProjection *p) const =0
virtual void AddProjected(REveProjected *p)
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.
REveProjectionManager * GetManager() const
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.
REveProjected & operator=(const REveProjected &)
virtual void UnRefProjectable(REveProjectable *assumed_parent, bool notifyParent=true)
Remove reference to projectable.
void SetDepthCommon(Float_t d, REveElement *el, Float_t *bbox)
Utility function to update the z-values of the bounding-box.
virtual void SetDepth(Float_t d)
Set depth coordinate for the element.
REveProjected(const REveProjected &)
REveProjectable * GetProjectable() const
virtual void SetDepthLocal(Float_t d)
Base-class implementation – just sets fDepth.
REveProjectionManager Manager class for steering of projections and managing projected objects.
REveProjection Base for specific classes that implement non-linear projections.
TClass instances represent classes, structs and namespaces in the ROOT type system.
Definition: TClass.h:75
VSD Structures.
Definition: StringConv.hxx:21