ROOT  6.06/09
Reference Guide
TEveProjectionBases.h
Go to the documentation of this file.
1 // @(#)root/eve:$Id$
2 // Authors: Matevz Tadel & Alja Mrak-Tadel: 2006, 2007
3 
4 /*************************************************************************
5  * Copyright (C) 1995-2007, 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 ROOT_TEveProjectionBases
13 #define ROOT_TEveProjectionBases
14 
15 #include "Rtypes.h"
16 #include <list>
17 #include <set>
18 
19 class TEveElement;
20 class TEveProjection;
21 class TEveProjected;
23 
24 class TClass;
25 
26 ////////////////////////////////////////////////////////////////
27 // //
28 // TEveProjectable //
29 // //
30 // Abstract base class for non-linear projectable objects. //
31 // //
32 ////////////////////////////////////////////////////////////////
33 
35 {
36 private:
37  TEveProjectable(const TEveProjectable&); // Not implemented
38  TEveProjectable& operator=(const TEveProjectable&); // Not implemented
39 
40 public:
41  typedef std::list<TEveProjected*> ProjList_t;
42  typedef std::list<TEveProjected*>::iterator ProjList_i;
43 
44 protected:
45  ProjList_t fProjectedList; // references to projected instances.
46 
47 public:
49  virtual ~TEveProjectable();
50 
51  virtual TClass* ProjectedClass(const TEveProjection* p) const = 0;
52 
53  virtual Bool_t HasProjecteds() const { return ! fProjectedList.empty(); }
54 
55  ProjList_i BeginProjecteds() { return fProjectedList.begin(); }
56  ProjList_i EndProjecteds() { return fProjectedList.end(); }
57 
58  virtual void AddProjected(TEveProjected* p) { fProjectedList.push_back(p); }
59  virtual void RemoveProjected(TEveProjected* p) { fProjectedList.remove(p); }
60 
61  virtual void AnnihilateProjecteds();
62  virtual void ClearProjectedList();
63 
64  virtual void AddProjectedsToSet(std::set<TEveElement*>& set);
65 
66  virtual void PropagateVizParams(TEveElement* el=0);
67  virtual void PropagateRenderState(Bool_t rnr_self, Bool_t rnr_children);
68  virtual void PropagateMainColor(Color_t color, Color_t old_color);
69  virtual void PropagateMainTransparency(Char_t t, Char_t old_t);
70 
71  ClassDef(TEveProjectable, 0); // Abstract base class for classes that can be transformed with non-linear projections.
72 };
73 
74 
75 ////////////////////////////////////////////////////////////////
76 // //
77 // TEveProjected //
78 // //
79 // Abstract base class for non-linear projected objects. //
80 // //
81 ////////////////////////////////////////////////////////////////
82 
84 {
85 private:
86  TEveProjected(const TEveProjected&); // Not implemented
87  TEveProjected& operator=(const TEveProjected&); // Not implemented
88 
89 protected:
91  TEveProjectable *fProjectable; // link to original object
92  Float_t fDepth; // z coordinate
93 
94  void SetDepthCommon(Float_t d, TEveElement* el, Float_t* bbox);
95  virtual void SetDepthLocal(Float_t d);
96 
97 public:
98  TEveProjected();
99  virtual ~TEveProjected();
100 
103  Float_t GetDepth() const { return fDepth; }
104 
105  virtual void SetProjection(TEveProjectionManager* mng, TEveProjectable* model);
106  virtual void UnRefProjectable(TEveProjectable* assumed_parent, bool notifyParent = true);
107 
108  virtual void UpdateProjection() = 0;
110 
111  virtual void SetDepth(Float_t d);
112 
113  ClassDef(TEveProjected, 0); // Abstract base class for classes that hold results of a non-linear projection transformation.
114 };
115 
116 #endif
virtual void AnnihilateProjecteds()
Optimized destroy of projected elements with condition there is only one parent for projected element...
Abstract base class for classes that hold results of a non-linear projection transformation.
float Float_t
Definition: RtypesCore.h:53
std::list< TEveProjected * > ProjList_t
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.
ClassDef(TEveProjectable, 0)
TEveProjected()
Constructor.
bool Bool_t
Definition: RtypesCore.h:59
virtual void RemoveProjected(TEveProjected *p)
TEveProjectable * GetProjectable() const
virtual void SetProjection(TEveProjectionManager *mng, TEveProjectable *model)
Sets projection manager and reference in the projectable object.
virtual ~TEveProjectable()
Destructor.
Base-class for non-linear projections.
virtual void PropagateRenderState(Bool_t rnr_self, Bool_t rnr_children)
Set render state of projecteds.
Manager class for steering of projections and managing projected objects.
short Color_t
Definition: RtypesCore.h:79
virtual void SetDepth(Float_t d)
Set depth coordinate for the element.
Abstract base-class for non-linear projectable objects.
virtual TClass * ProjectedClass(const TEveProjection *p) const =0
ClassDef(TEveProjected, 0)
TEveProjected & operator=(const TEveProjected &)
TEveProjectable * fProjectable
TEveProjectionManager * fManager
std::list< TEveProjected * >::iterator ProjList_i
virtual void ClearProjectedList()
Float_t GetDepth() const
The ROOT global object gROOT contains a list of all defined classes.
Definition: TClass.h:81
virtual ~TEveProjected()
Destructor.
virtual void SetDepthLocal(Float_t d)
Base-class implementation – just sets fDepth.
virtual TEveElement * GetProjectedAsElement()
Returns this projected dynamic-casted to TEveElement.
virtual void UpdateProjection()=0
virtual Bool_t HasProjecteds() const
virtual void UnRefProjectable(TEveProjectable *assumed_parent, bool notifyParent=true)
Remove reference to projectable.
virtual void AddProjectedsToSet(std::set< TEveElement * > &set)
Add the projected elements to the set, dyn-casting them to TEveElement.
virtual void PropagateVizParams(TEveElement *el=0)
Set visualization parameters of projecteds.
char Char_t
Definition: RtypesCore.h:29
ProjList_t fProjectedList
ProjList_i BeginProjecteds()
void SetDepthCommon(Float_t d, TEveElement *el, Float_t *bbox)
Utility function to update the z-values of the bounding-box.
virtual void AddProjected(TEveProjected *p)
TEveProjectionManager * GetManager() const
TEveProjectable()
Constructor.
virtual void PropagateMainColor(Color_t color, Color_t old_color)
Set main color of projecteds if their color is the same as old_color.
TEveProjectable & operator=(const TEveProjectable &)
Base class for TEveUtil visualization elements, providing hierarchy management, rendering control and...
Definition: TEveElement.h:33
ProjList_i EndProjecteds()