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_REveProjectionBases
0013 #define ROOT7_REveProjectionBases
0014 
0015 #include "Rtypes.h"
0016 #include <list>
0017 #include <set>
0018 
0019 class TClass;
0020 
0021 namespace ROOT {
0022 namespace Experimental {
0023 
0024 class REveElement;
0025 class REveProjection;
0026 class REveProjected;
0027 class REveProjectionManager;
0028 
0029 ////////////////////////////////////////////////////////////////
0030 //                                                            //
0031 // REveProjectable                                            //
0032 //                                                            //
0033 // Abstract base class for non-linear projectable objects.    //
0034 //                                                            //
0035 ////////////////////////////////////////////////////////////////
0036 
0037 class REveProjectable
0038 {
0039 private:
0040    REveProjectable &operator=(const REveProjectable &) = delete;
0041 
0042 public:
0043    typedef std::list<REveProjected *> ProjList_t;
0044 
0045 protected:
0046    ProjList_t fProjectedList; // references to projected instances.
0047 
0048 public:
0049    REveProjectable();
0050    REveProjectable(const REveProjectable &);
0051    virtual ~REveProjectable();
0052 
0053    virtual TClass *ProjectedClass(const REveProjection *p) const = 0;
0054 
0055    virtual Bool_t HasProjecteds() const { return !fProjectedList.empty(); }
0056 
0057    ProjList_t &RefProjecteds()   { return fProjectedList;         }
0058 
0059    virtual void AddProjected(REveProjected *p) { fProjectedList.emplace_back(p); }
0060    virtual void RemoveProjected(REveProjected *p) { fProjectedList.remove(p); }
0061 
0062    virtual void AnnihilateProjecteds();
0063    virtual void ClearProjectedList();
0064 
0065    virtual void AddProjectedsToSet(std::set<REveElement *> &set);
0066 
0067    virtual void PropagateVizParams(REveElement *el = nullptr);
0068    virtual void PropagateRenderState(Bool_t rnr_self, Bool_t rnr_children);
0069    virtual void PropagateMainColor(Color_t color, Color_t old_color);
0070    virtual void PropagateMainTransparency(Char_t t, Char_t old_t);
0071 };
0072 
0073 ////////////////////////////////////////////////////////////////
0074 //                                                            //
0075 // REveProjected                                              //
0076 //                                                            //
0077 // Abstract base class for non-linear projected objects.      //
0078 //                                                            //
0079 ////////////////////////////////////////////////////////////////
0080 
0081 class REveProjected {
0082 private:
0083    REveProjected(const REveProjected &) = delete;
0084    REveProjected &operator=(const REveProjected &) = delete;
0085 
0086 protected:
0087    REveProjectionManager *fManager{nullptr}; // manager
0088    REveProjectable *fProjectable{nullptr};   // link to original object
0089    Float_t fDepth{0.};                       // z coordinate
0090 
0091    void SetDepthCommon(Float_t d, REveElement *el, Float_t *bbox);
0092    virtual void SetDepthLocal(Float_t d);
0093 
0094 public:
0095    REveProjected() = default;
0096    virtual ~REveProjected();
0097 
0098    REveProjectionManager *GetManager() const { return fManager; }
0099    REveProjectable *GetProjectable() const { return fProjectable; }
0100    Float_t GetDepth() const { return fDepth; }
0101 
0102    virtual void SetProjection(REveProjectionManager *mng, REveProjectable *model);
0103    virtual void UnRefProjectable(REveProjectable *assumed_parent, bool notifyParent = true);
0104 
0105    virtual void UpdateProjection() = 0;
0106    virtual REveElement *GetProjectedAsElement();
0107 
0108    virtual void SetDepth(Float_t d);
0109 };
0110 
0111 } // namespace Experimental
0112 } // namespace ROOT
0113 
0114 #endif