Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-01-18 10:11:42

0001 // @(#)root/eve:$Id$
0002 // Authors: Matevz Tadel & Alja Mrak-Tadel: 2006, 2007
0003 
0004 /*************************************************************************
0005  * Copyright (C) 1995-2007, 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 ROOT_TEveProjectionManager
0013 #define ROOT_TEveProjectionManager
0014 
0015 #include "TEveElement.h"
0016 #include "TAttBBox.h"
0017 #include "TEveProjections.h"
0018 
0019 
0020 class TEveProjectionManager : public TEveElementList,
0021                               public TAttBBox
0022 {
0023 private:
0024    TEveProjectionManager(const TEveProjectionManager&);            // Not implemented
0025    TEveProjectionManager& operator=(const TEveProjectionManager&); // Not implemented
0026 
0027 protected:
0028    TEveProjection* fProjections[TEveProjection::kPT_End];
0029 
0030    TEveProjection* fProjection;     // current projection
0031    TEveVector      fCenter;         // center of distortion
0032    Float_t         fCurrentDepth;   // z depth of object being projected
0033 
0034    List_t          fDependentEls;   // elements that depend on manager and need to be destroyed with it
0035 
0036    Bool_t          fImportEmpty;    // import sub-trees with no projectable elements
0037 
0038    virtual Bool_t  ShouldImport(TEveElement* el);
0039    virtual void    UpdateDependentElsAndScenes(TEveElement* root);
0040 
0041 public:
0042    TEveProjectionManager(TEveProjection::EPType_e type=TEveProjection::kPT_Unknown);
0043    ~TEveProjectionManager() override;
0044 
0045    void AddDependent(TEveElement* el);
0046    void RemoveDependent(TEveElement* el);
0047 
0048    void            SetProjection(TEveProjection::EPType_e type);
0049    TEveProjection* GetProjection() { return fProjection; }
0050 
0051    virtual void    UpdateName();
0052 
0053    void            SetCenter(Float_t x, Float_t y, Float_t z);
0054    TEveVector&     GetCenter() { return fCenter; }
0055 
0056    void            SetCurrentDepth(Float_t d) { fCurrentDepth = d;      }
0057    Float_t         GetCurrentDepth()    const { return fCurrentDepth;   }
0058 
0059    void            SetImportEmpty(Bool_t ie)  { fImportEmpty = ie;   }
0060    Bool_t          GetImportEmpty()     const { return fImportEmpty; }
0061 
0062    Bool_t  HandleElementPaste(TEveElement* el) override;
0063 
0064    virtual TEveElement* ImportElementsRecurse(TEveElement* el,
0065                                               TEveElement* parent);
0066    virtual TEveElement* ImportElements(TEveElement* el,
0067                                        TEveElement* ext_list = nullptr);
0068 
0069    virtual TEveElement* SubImportElements(TEveElement* el, TEveElement* proj_parent);
0070    virtual Int_t        SubImportChildren(TEveElement* el, TEveElement* proj_parent);
0071 
0072    virtual void    ProjectChildren();
0073    virtual void    ProjectChildrenRecurse(TEveElement* el);
0074 
0075    void    ComputeBBox() override;
0076 
0077    ClassDefOverride(TEveProjectionManager, 0); // Manager class for steering of projections and managing projected objects.
0078 };
0079 
0080 #endif