Back to home page

EIC code displayed by LXR

 
 

    


Warning, file /include/root/TEveProjectionBases.h was not indexed or was modified since last indexation (in which case cross-reference links may be missing, inaccurate or erroneous).

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