Logo ROOT  
Reference Guide
 
Loading...
Searching...
No Matches
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
19class TEveElement;
20class TEveProjection;
21class TEveProjected;
23
24class TClass;
25
26////////////////////////////////////////////////////////////////
27// //
28// TEveProjectable //
29// //
30// Abstract base class for non-linear projectable objects. //
31// //
32////////////////////////////////////////////////////////////////
33
35{
36private:
37 TEveProjectable(const TEveProjectable&); // Not implemented
38 TEveProjectable& operator=(const TEveProjectable&); // Not implemented
39
40public:
41 typedef std::list<TEveProjected*> ProjList_t;
42 typedef std::list<TEveProjected*>::iterator ProjList_i;
43
44protected:
45 ProjList_t fProjectedList; // references to projected instances.
46
47public:
49 virtual ~TEveProjectable();
50
51 virtual TClass* ProjectedClass(const TEveProjection* p) const = 0;
52
53 virtual Bool_t HasProjecteds() const { return ! fProjectedList.empty(); }
54
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=nullptr);
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{
85private:
86 TEveProjected(const TEveProjected&); // Not implemented
87 TEveProjected& operator=(const TEveProjected&); // Not implemented
88
89protected:
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
97public:
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
#define d(i)
Definition RSha256.hxx:102
bool Bool_t
Definition RtypesCore.h:63
short Color_t
Definition RtypesCore.h:85
char Char_t
Definition RtypesCore.h:37
float Float_t
Definition RtypesCore.h:57
#define ClassDef(name, id)
Definition Rtypes.h:342
winID h TVirtualViewer3D TVirtualGLPainter p
TClass instances represent classes, structs and namespaces in the ROOT type system.
Definition TClass.h:81
Base class for TEveUtil visualization elements, providing hierarchy management, rendering control and...
Definition TEveElement.h:36
Abstract base-class for non-linear projectable objects.
virtual void ClearProjectedList()
virtual void PropagateVizParams(TEveElement *el=nullptr)
Set visualization parameters of projecteds.
TEveProjectable()
Constructor.
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 AddProjected(TEveProjected *p)
std::list< TEveProjected * > ProjList_t
virtual void AddProjectedsToSet(std::set< TEveElement * > &set)
Add the projected elements to the set, dyn-casting them to TEveElement.
virtual void PropagateRenderState(Bool_t rnr_self, Bool_t rnr_children)
Set render state of projecteds.
ProjList_i EndProjecteds()
TEveProjectable & operator=(const TEveProjectable &)
virtual void RemoveProjected(TEveProjected *p)
virtual ~TEveProjectable()
Destructor.
ProjList_i BeginProjecteds()
virtual Bool_t HasProjecteds() const
TEveProjectable(const TEveProjectable &)
virtual void AnnihilateProjecteds()
Optimized destroy of projected elements with condition there is only one parent for projected element...
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 TClass * ProjectedClass(const TEveProjection *p) const =0
std::list< TEveProjected * >::iterator ProjList_i
Abstract base class for classes that hold results of a non-linear projection transformation.
Float_t GetDepth() const
virtual void SetDepth(Float_t d)
Set depth coordinate for the element.
TEveProjected()
Constructor.
TEveProjectable * fProjectable
virtual void UpdateProjection()=0
TEveProjectionManager * fManager
virtual void SetDepthLocal(Float_t d)
Base-class implementation – just sets fDepth.
TEveProjectionManager * GetManager() const
virtual ~TEveProjected()
Destructor.
virtual void SetProjection(TEveProjectionManager *mng, TEveProjectable *model)
Sets projection manager and reference in the projectable object.
virtual TEveElement * GetProjectedAsElement()
Returns this projected dynamic-casted to TEveElement.
TEveProjected & operator=(const TEveProjected &)
virtual void UnRefProjectable(TEveProjectable *assumed_parent, bool notifyParent=true)
Remove reference to projectable.
TEveProjected(const TEveProjected &)
TEveProjectable * GetProjectable() const
void SetDepthCommon(Float_t d, TEveElement *el, Float_t *bbox)
Utility function to update the z-values of the bounding-box.
Manager class for steering of projections and managing projected objects.
Base-class for non-linear projections.