Logo ROOT  
Reference Guide
REveProjectionManager.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_REveProjectionManager
13 #define ROOT7_REveProjectionManager
14 
15 #include <ROOT/REveElement.hxx>
16 #include <ROOT/REveProjections.hxx>
17 #include <TAttBBox.h>
18 
19 namespace ROOT {
20 namespace Experimental {
21 
22 ////////////////////////////////////////////////////////////////////////////////
23 /// REveProjectionManager
24 /// Manager class for steering of projections and managing projected objects.
25 ////////////////////////////////////////////////////////////////////////////////
26 
27 class REveProjectionManager : public REveElement,
28  public REveAuntAsList,
29  public TAttBBox
30 {
31 private:
34 
35 protected:
36  REveProjection *fProjections[REveProjection::kPT_End];
37 
38  REveProjection *fProjection{nullptr}; // current projection
39  REveVector fCenter; // center of distortion
40  Float_t fCurrentDepth{0.}; // z depth of object being projected
41 
42  List_t fDependentEls; // elements that depend on manager and need to be destroyed with it
43 
44  Bool_t fImportEmpty{kFALSE}; // import sub-trees with no projectable elements
45 
46  virtual Bool_t ShouldImport(REveElement *el);
47  virtual void UpdateDependentElsAndScenes(REveElement *root);
48 
49 public:
51  virtual ~REveProjectionManager();
52 
53  void AddDependent(REveElement *el);
55 
58 
59  virtual void UpdateName();
60 
61  void SetCenter(Float_t x, Float_t y, Float_t z);
62  REveVector &GetCenter() { return fCenter; }
63 
65  Float_t GetCurrentDepth() const { return fCurrentDepth; }
66 
67  void SetImportEmpty(Bool_t ie) { fImportEmpty = ie; }
68  Bool_t GetImportEmpty() const { return fImportEmpty; }
69 
71  virtual REveElement *ImportElements(REveElement *el, REveElement *ext_list = nullptr);
72 
73  virtual REveElement *SubImportElements(REveElement *el, REveElement *proj_parent);
74  virtual Int_t SubImportChildren(REveElement *el, REveElement *proj_parent);
75 
76  virtual void ProjectChildren();
77  virtual void ProjectChildrenRecurse(REveElement *el);
78 
79  void ComputeBBox() override;
80 };
81 
82 } // namespace Experimental
83 } // namespace ROOT
84 
85 #endif
ROOT::Experimental::REveProjectionManager::SubImportElements
virtual REveElement * SubImportElements(REveElement *el, REveElement *proj_parent)
Recursively import elements and apply projection to the newly imported objects.
Definition: REveProjectionManager.cxx:283
ROOT::Experimental::REveProjectionManager::operator=
REveProjectionManager & operator=(const REveProjectionManager &)=delete
ROOT::Experimental::REveProjectionManager::ShouldImport
virtual Bool_t ShouldImport(REveElement *el)
Returns true if element el should be imported.
Definition: REveProjectionManager.cxx:149
ROOT::Experimental::REveProjectionManager::fDependentEls
List_t fDependentEls
Definition: REveProjectionManager.hxx:60
ROOT::Experimental::REveProjectionManager::SetCenter
void SetCenter(Float_t x, Float_t y, Float_t z)
Set projection center and rebuild projected scene.
Definition: REveProjectionManager.cxx:135
ROOT::Experimental::REveProjectionManager::RemoveDependent
void RemoveDependent(REveElement *el)
Remove el as dependent element.
Definition: REveProjectionManager.cxx:74
ROOT::Experimental::REveProjectionManager::fImportEmpty
Bool_t fImportEmpty
Definition: REveProjectionManager.hxx:62
Float_t
float Float_t
Definition: RtypesCore.h:57
ROOT::Experimental::REveProjection::EPType_e
EPType_e
Definition: REveProjections.hxx:44
Int_t
int Int_t
Definition: RtypesCore.h:45
ROOT::Experimental::REveProjectionManager::ImportElements
virtual REveElement * ImportElements(REveElement *el, REveElement *ext_list=nullptr)
Recursively import elements and apply projection to the newly imported objects.
Definition: REveProjectionManager.cxx:251
x
Double_t x[n]
Definition: legend1.C:17
ROOT::Experimental::REveProjectionManager::ImportElementsRecurse
virtual REveElement * ImportElementsRecurse(REveElement *el, REveElement *parent)
If el is REveProjectable add projected instance else add plain REveElementList to parent.
Definition: REveProjectionManager.cxx:197
ROOT::Experimental::REveProjectionManager::ProjectChildrenRecurse
virtual void ProjectChildrenRecurse(REveElement *el)
Project el (via REveProjected::UpdateProjection()) and recurse through el's children.
Definition: REveProjectionManager.cxx:339
ROOT::Experimental::REveProjectionManager::fProjection
REveProjection * fProjection
Definition: REveProjectionManager.hxx:56
ROOT::Experimental::REveProjectionManager::GetImportEmpty
Bool_t GetImportEmpty() const
Definition: REveProjectionManager.hxx:86
ROOT::Experimental::REveElement
Definition: REveElement.hxx:79
ROOT::Experimental::REveVectorT< Float_t >
Bool_t
bool Bool_t
Definition: RtypesCore.h:63
ROOT::Experimental::REveProjection
REveProjection Base for specific classes that implement non-linear projections.
Definition: REveProjections.hxx:42
ROOT::Experimental::REveProjectionManager::SetProjection
void SetProjection(REveProjection::EPType_e type)
Set projection type and distortion.
Definition: REveProjectionManager.cxx:93
TAttBBox
Definition: TAttBBox.h:17
ROOT::Experimental::REveProjection::kPT_Unknown
@ kPT_Unknown
Definition: REveProjections.hxx:44
ROOT::Experimental::REveProjectionManager::~REveProjectionManager
virtual ~REveProjectionManager()
Destructor.
Definition: REveProjectionManager.cxx:53
ROOT::Experimental::REveProjection::kPT_End
@ kPT_End
Definition: REveProjections.hxx:44
ROOT::Experimental::REveProjectionManager::ProjectChildren
virtual void ProjectChildren()
Project all children recursively, update bounding-box and notify EveManger about the scenes that have...
Definition: REveProjectionManager.cxx:362
ROOT::Experimental::REveElement::List_t
std::list< REveElement * > List_t
Definition: REveElement.hxx:87
REveElement.hxx
TAttBBox.h
ROOT::Experimental::REveProjectionManager::fProjections
REveProjection * fProjections[REveProjection::kPT_End]
Definition: REveProjectionManager.hxx:54
kFALSE
const Bool_t kFALSE
Definition: RtypesCore.h:92
ROOT::Experimental::REveProjectionManager::UpdateName
virtual void UpdateName()
Updates name to have consistent information with projection.
Definition: REveProjectionManager.cxx:82
ROOT::Experimental::REveProjectionManager::AddDependent
void AddDependent(REveElement *el)
Add el as dependent element.
Definition: REveProjectionManager.cxx:66
ROOT::Experimental::REveProjectionManager::ComputeBBox
void ComputeBBox() override
Virtual from TAttBBox; fill bounding-box information.
Definition: REveProjectionManager.cxx:383
y
Double_t y[n]
Definition: legend1.C:17
ROOT::Experimental::REveProjectionManager::SetImportEmpty
void SetImportEmpty(Bool_t ie)
Definition: REveProjectionManager.hxx:85
ROOT::Experimental::REveProjectionManager::fCurrentDepth
Float_t fCurrentDepth
Definition: REveProjectionManager.hxx:58
ROOT::Experimental::REveProjectionManager::GetCurrentDepth
Float_t GetCurrentDepth() const
Definition: REveProjectionManager.hxx:83
ROOT::Experimental::REveElement::REveElement
REveElement(const std::string &name="", const std::string &title="")
Default constructor.
Definition: REveElement.cxx:51
ROOT::Experimental::REveProjectionManager::REveProjectionManager
REveProjectionManager(const REveProjectionManager &)=delete
ROOT::Experimental::REveProjectionManager::fCenter
REveVector fCenter
Definition: REveProjectionManager.hxx:57
d
#define d(i)
Definition: RSha256.hxx:120
ROOT::Experimental::REveProjectionManager::SetCurrentDepth
void SetCurrentDepth(Float_t d)
Definition: REveProjectionManager.hxx:82
ROOT::Experimental::REveProjectionManager::GetProjection
REveProjection * GetProjection()
Definition: REveProjectionManager.hxx:75
ROOT::Experimental::REveProjectionManager::SubImportChildren
virtual Int_t SubImportChildren(REveElement *el, REveElement *proj_parent)
Recursively import children elements of el and apply projection to the newly imported objects.
Definition: REveProjectionManager.cxx:312
type
int type
Definition: TGX11.cxx:121
REveProjections.hxx
ROOT
VSD Structures.
Definition: StringConv.hxx:21
ROOT::Experimental::REveProjectionManager::GetCenter
REveVector & GetCenter()
Definition: REveProjectionManager.hxx:80
ROOT::Experimental::REveProjectionManager::UpdateDependentElsAndScenes
virtual void UpdateDependentElsAndScenes(REveElement *root)
Update dependent elements' bounding box and mark scenes containing element root or its children as re...
Definition: REveProjectionManager.cxx:166