Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-01-18 10:10:40

0001 // @(#)root/eve7:$Id$
0002 // Authors: Matevz Tadel & Alja Mrak-Tadel: 2006, 2007
0003 
0004 /*************************************************************************
0005  * Copyright (C) 1995-2019, Rene Brun and Fons Rademakers.               *
0006  * All rights reserved.                                                  *
0007  *                                                                       *
0008  * For the licensing terms see $ROOTSYS/LICENSE.                         *
0009  * For the list of contributors see $ROOTSYS/README/CREDITS.             *
0010  *************************************************************************/
0011 
0012 #ifndef ROOT7_REveProjectionManager
0013 #define ROOT7_REveProjectionManager
0014 
0015 #include <ROOT/REveElement.hxx>
0016 #include <ROOT/REveProjections.hxx>
0017 #include <TAttBBox.h>
0018 
0019 namespace ROOT {
0020 namespace Experimental {
0021 
0022 ////////////////////////////////////////////////////////////////////////////////
0023 /// REveProjectionManager
0024 /// Manager class for steering of projections and managing projected objects.
0025 ////////////////////////////////////////////////////////////////////////////////
0026 
0027 class REveProjectionManager : public REveElement,
0028                               public REveAuntAsList,
0029                               public TAttBBox
0030 {
0031 private:
0032    REveProjectionManager(const REveProjectionManager &) = delete;
0033    REveProjectionManager &operator=(const REveProjectionManager &) = delete;
0034 
0035 protected:
0036    REveProjection *fProjections[REveProjection::kPT_End];
0037 
0038    REveProjection *fProjection{nullptr};  // current projection
0039    REveVector      fCenter;               // center of distortion
0040    Float_t         fCurrentDepth{0.};     // z depth of object being projected
0041 
0042    List_t fDependentEls;                  // elements that depend on manager and need to be destroyed with it
0043 
0044    Bool_t fImportEmpty{kFALSE};           // import sub-trees with no projectable elements
0045 
0046    virtual Bool_t ShouldImport(REveElement *el);
0047    virtual void   UpdateDependentElements(REveElement *root);
0048 
0049 public:
0050    REveProjectionManager(REveProjection::EPType_e type = REveProjection::kPT_Unknown);
0051    ~REveProjectionManager() override;
0052 
0053    void AddDependent(REveElement *el);
0054    void RemoveDependent(REveElement *el);
0055 
0056    void SetProjection(REveProjection::EPType_e type);
0057    REveProjection *GetProjection() { return fProjection; }
0058 
0059    virtual void UpdateName();
0060 
0061    void SetCenter(Float_t x, Float_t y, Float_t z);
0062    REveVector &GetCenter() { return fCenter; }
0063 
0064    void SetCurrentDepth(Float_t d) { fCurrentDepth = d; }
0065    Float_t GetCurrentDepth() const { return fCurrentDepth; }
0066 
0067    void SetImportEmpty(Bool_t ie) { fImportEmpty = ie; }
0068    Bool_t GetImportEmpty() const { return fImportEmpty; }
0069 
0070    virtual REveElement *ImportElementsRecurse(REveElement *el, REveElement *parent);
0071    virtual REveElement *ImportElements(REveElement *el, REveElement *ext_list = nullptr);
0072 
0073    virtual REveElement *SubImportElements(REveElement *el, REveElement *proj_parent);
0074    virtual Int_t SubImportChildren(REveElement *el, REveElement *proj_parent);
0075 
0076    virtual void ProjectChildren();
0077    virtual void ProjectChildrenRecurse(REveElement *el);
0078 
0079    void ComputeBBox() override;
0080 };
0081 
0082 } // namespace Experimental
0083 } // namespace ROOT
0084 
0085 #endif